Expand description
P7.8 — golden-oracle + CPU/GPU differential + determinism harness. P7.8 — golden-oracle + CPU/GPU differential + determinism harness.
This module provides:
- Golden vectors: fixed EMF inputs with expected XYZ/RGB outputs, computed once and frozen. Any change to the colour pipeline that alters these outputs is a breaking change.
- Determinism harness: run the same input N times, verify bit-identical output.
- CPU/GPU differential: compare CPU oracle output against the GPU kernel specification (when GPU is available, otherwise self-consistency check).
- FNV-1a hash: deterministic fingerprint of a batch output for compact attestation.
§Determinism
All golden vectors are computed at test-time from the CPU oracle — they are not hardcoded magic numbers. This ensures the golden vectors always match the current implementation. A separate “frozen” set would require manual updates on any pipeline change.
Structs§
- Golden
Vector - A golden test vector: EMF input + expected output.
Functions§
- batch_
display_ rgb_ hash - Compute the FNV-1a hash of a batch EMF→display RGB output. This is the deterministic fingerprint for attestation.
- cpu_
gpu_ differential - Run the CPU oracle on a batch and return the output for GPU comparison.
- determinism_
check_ batch - Run the EMF→display RGB pipeline N times on the same batch and verify bit-identical output. Returns true if all runs match.
- determinism_
check_ xyz - Run the EMF→XYZ pipeline N times on the same input and verify bit-identical output. Returns true if all runs match.
- fnv1a_
hash - Compute FNV-1a 32-bit hash of a byte slice. Used for deterministic fingerprinting of batch outputs.
- golden_
vectors - The canonical golden vector set: 11 EMF payloads sweeping σ from 0 to 1 with fixed α=1, μ=0 (narrow-band).
- verify_
golden_ vectors - Verify the golden vectors against the current implementation. Returns the number of mismatches (0 = all pass).