Repository navigation
hyperloom custom workload: name the gate reference in every compared result - #955
Conversation
…result `quality_gate` recorded the candidate's own verdict (kld_mean, texts_identical) and nothing about what that verdict was relative to: `HL_STATE` is per-box, and kld() re-records kld-base.kld whenever it is missing, so the same KLD mean can read PASS against a different reference with an identical-looking report. gate_reference() puts the reference identity in the artifact: the baseline's model fingerprint and levers (from ref.json) plus the SHA-256 of kld-base.kld and texts.json. Written only where a comparison actually happened, so the reference-establishing half does not claim to have been compared with anything. closes #954
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at b49ba42f4.
Ran it: python3 tests/hyperloom_benchmark_test.py → hyperloom_benchmark_test: OK, exit 0, and py_compile on benchmark.py clean. The new arm is real and discriminating rather than descriptive — it mutates the base file (b"logits " * 1000 → * 999) and asserts the recorded base_kld_sha256 changes, which is the property the PR is about.
The placement is the right one too: gate_reference() is only called on the compared path (after the finish(True, "reference_established") return), so an establishing run does not record a reference against itself. Naming model + levers + both file hashes is what makes a KLD verdict re-checkable across sessions, and the README sentence explains why the directory alone was not enough.
PR Reviewer Guide 🔍(Review updated until commit baa7c8a)Here are some key observations to aid the review process:
|
|
Persistent review updated to latest commit d58cbd5 |
|
Persistent review updated to latest commit 2e37a3e |
|
Persistent review updated to latest commit 348378f |
|
Persistent review updated to latest commit feb4b9c |
|
Persistent review updated to latest commit ea9f50d |
|
Persistent review updated to latest commit 8fd2a18 |
|
Persistent review updated to latest commit 978807e |
|
Persistent review updated to latest commit 06e7f17 |
|
Persistent review updated to latest commit 46ba12c |
|
Persistent review updated to latest commit d0a567f |
|
Persistent review updated to latest commit baa7c8a |
Root cause
quality_gatein the result JSON carries the candidate's own numbers (kld_mean,kld_max_mean,texts_identical,texts_differing,kld_ok) and nothing about the reference those numbers are relative to.The two references the gate uses live in
HL_STATE(~/lb/hl-gate/<model-stem>), outside the checkout:kld-base.kld— 1,013,178,324 B of base logits on this box (31 Oct 13:31);texts.json— the baseline's three greedy replies;ref.json— the baseline model fingerprint + the levers the baseline ran with.That directory is per box, and
kld()re-records the base whenever it is missing (recording = not base.is_file()),so a KLD mean is only interpretable against these bytes — yet neither the base hash nor
ref.json's fingerprint andlevers reach the report. The pair-of-record artifacts show the gap:
Fix
gate_reference(ref, base_kld, texts_path)— one helper, reusing the existingsha256_head()the build and devicefields already use — is written to
quality_gate.referenceat the comparison site only, i.e. exactly when a comparisonhappened. The reference-establishing half returns before it, so no result claims to have been compared against a
reference that did not exist yet. Live on this box, against the real gate state:
Before/after
Device-free: no GPU, no NPU, no load. The new unit check writes a stub base and texts file, asserts both hashes against
hashlib.sha256of the bytes, and asserts that a changed base of the same name is a different reference (which is thewhole point).
Verification
No score changes: nothing here touches a measurement, a lever or a threshold —
kld_max_mean,kld_ok,passedandreasonare byte-identical to before.closes #954