mirror of
https://github.com/bdbrown4/peltier.io.git
synced 2026-11-07 10:58:28 +00:00
The parser/service targets only ever needed byte-identical golden replay.
The kernel lane is the case that breaks it: a matmul optimization
(transpose-B for cache locality + eight-accumulator ILP) that REORDERS the
floating-point reduction, so its low bits differ by construction —
byte-identical is the wrong gate.
Adds:
- EquivalencePolicy::compare + Divergence (diff-test): byte-identical is
exact; fp-tolerance tokenizes and compares numeric tokens within
abs + rel*|baseline|, with explicit NaN handling. Non-numeric tokens and
token-count mismatches still fail exactly.
- fp-compare bin: applies a target's equivalence.toml to two output files.
- targets/matmul/kernel.c: matmul_ref (single-accumulator oracle) vs
matmul_opt (reordered, faster), with emit/check/run/bench modes.
- targets/matmul/equivalence.toml: fp-tolerance abs 1e-4 + rel 1e-3.
- scripts/kernel-lane-demo.sh + results/phase5/kernel-lane.txt: byte-identical
FAILs, fp-tolerance is EQUIVALENT, a +0.5 perturbation is still REJECTED,
speedup 3.23× measured with the same interleaved A/B + bootstrap CI.
Ledger row phase5-matmul-opt = needs-human-review: using the FP-tolerance
tier at all is a human-review signal (SPEC §8), same posture as mimalloc.
The trust machinery is unchanged; only the timer and the gate differ, which
is exactly the shape a future GPU kernel would slot into.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EcKPWQ3MQD4NdEHwar96u2
targets/
One directory per optimization target. This is the only agent-writable path in the repository (SPEC §10); everything else is trust layer.
Layout
targets/<name>/
target.toml # upstream repo URL, pinned commit, build & bench commands
equivalence.toml # optional; absent = byte-identical required (SPEC §3.2)
workspace/ # agent's checkout — patches land here via harness git-apply
Selection criteria (SPEC §6): CPU-bound (>70% user time), meaningful test suite, scriptable workload, permissive license, active but not hyper-optimized, builds cleanly in a container. Good hunting: codecs, parsers, serializers, image processing, compression, static-site generators, linters.
equivalence.toml
Default (no file) is byte-identical outputs. FP-producing targets may declare an explicit tolerance policy:
mode = "fp-tolerance"
abs = 1e-9 # max absolute difference per numeric value
rel = 1e-6 # max relative difference per numeric value
Declaring a tolerance covers output comparison only; FP flag changes still route to needs-human-review (SPEC §8).