D116 - A reference oracle, so a GPU diff says which instructions are approximate rather than merely that two runs differ

Status: derived - obscene-tool gpuref computes each kernel's near-exact result and is proven end to end against an llvmpipe corpus.

D137 gave us gpudiff, but a diff on its own compares run against run. The question that actually matters on hardware day is narrower: where does the device stop computing the exact answer? An emulator can compute an exact 1.0/x; RDNA2 cannot, and the lanes where the device departs from exact are exactly the ones an emulator must stop computing exactly. So the oracle recomputes every kernel on the CPU in f64 through the host libm, rounds to f32, and emits it as a corpus in the same gpu/gpuop shape. gpudiff device-corpus reference then reads, per operand, where the device is approximate - a real finding today against llvmpipe, and the RDNA2 approximation map the instant a Deck corpus exists.

What "reference" does and does not claim:

The false divergence it exposed, and the fix

Running device-against-reference immediately caught a defect in gpudiff that device-against-device had hidden: obSCEne prints minimal-width hex (0x0), the oracle prints 0x00000000, and the string compare called identical bits a divergence - 123 of them. The fix is to canonicalise every hex field to 0x%08x at parse time, so a lane keys and compares on its bits, not on how a producer chose to print them. Crucially this leaves a real bit difference intact: 0xffc00000 and 0x7fc00000 are two NaNs with different sign bits and stay distinct, because they are distinct. That is what keeps the normalisation from hiding the genuinely interesting residue - llvmpipe does NaN-suppressing min/max and passes some out-of-range int(x) conversions through unchanged, both of which the diff now reports as honest device-behaviour observations rather than drowning them in width noise.

Built ahead of hardware on the same reasoning as D137: it is verifiable now, it turns every future diff from "these differ" into "the device is approximate here and exact there", and it is precisely the machinery the hardware day diffs against. Six unit tests lock the oracle's GLSL semantics (fract of a negative, sign of zero, min's select form, a transcendental rounding from f64) and the canonicalisation invariant.