Repository navigation
loom coverage: a card's name and quant are not its bytes (engine#3156) - #3213
Conversation
The map reported COVERED for a card that names our model on our quantisation, which
is an upper bound: a card binds a checkpoint by sha256, and our pin is sometimes a
RE-HOST, so the same weights can arrive under a different repository and the same
repository can hold an older revision. Measured on today's card tree and pins, two
of the nine hrx rows are exactly that:
Qwen3-Coder-30B-A3B-Instruct-Q4_K_M card binds f6050b4da228, we ship none of the
files it names (17,988,419,552 vs our 18,556,689,568)
LFM3-1.7B-Q4_K_M card binds ecc02a0720a3, ours is a different upload
and Qwen3-0.6B is genuinely the same file (ac2d97712095...), so the arm has to be able
to say both.
New verdicts, each a different answer rather than a pass: DIFFERENT-UPLOAD (the card
binds bytes we do not ship), NO-LOCK (a card with no model.json.lock cannot support a
coverage claim at all), COVERED-UNPINNED (we hold no pin for that filename, so the
bytes were not checked -- reported, not failed, because it is a bookkeeping gap in
models/pins.json and not this PR's defect). Comparison is over the SET of sha256, not
by filename, for the reason above; the card's checkpoint files are read from
model.json's variant/service parameters and its drafter's files are excluded, as the
existing quant arm already does.
--pins (default models/pins.json) is optional: without it the tool reports
COVERED-NOBYTES for rows whose bytes it could not compare, rather than pretending.
Self-test 7 -> 11 arms: same bytes, different bytes, no lock, no pin.
|
One check on the new verdicts, because it is the failure this thread has already ruled on twice (#3058, #3182): the live row is wired advisory — I ran that on this box, where the card tree is present, so it is the hard case rather than CI's cannot-tell. Without So the three new verdicts are visible in every report and still cannot block anyone; if a lane wants the bytes arm to gate, that is a one-word change at the call site, and it should be a separate decision rather than something this PR sneaks in. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at be8b240: READY
Scoped review of the decision this adds, which is the question I raised on #3180: a coverage claim that stops at the quant is not a claim about the bytes. The tool now derives the sha256 set we ship from models/pins.json (files.<name>.oid, the LFS sha — "the pin is the only record of the BYTES we ship") and the card's checkpoint shas from model.json.lock, excluding the drafter's (checkpoint_shas: "the card's CHECKPOINT files (not its drafter's)"), and compares on that axis rather than on name + quant.
Three things in the reasoning are worth keeping, because each is a trap a cheaper implementation would fall into:
- "Two cards can name the same model on the same quant and bind [different bytes]" — which is exactly the #3180 weakness, stated.
- a name-only match is not a match: the parser collects
namesseparately fromshas, so the fallback is explicit rather than conflated. - a pin is sometimes a RE-HOST, and the tool knows it — "the Flash-Next card binds the 1bit-MONSTER shards while the upstream pin is an older revision, and
used_forsays so in as many words". That is the case that would otherwise be reported as a false finding every run, and the fact that the exemption is derived from a recorded field rather than hard-coded is the difference between a check that stays true and one that gets patched into silence.
Not verified: the match/refuse outcomes end to end and the printed map (needs the card corpus and models/pins.json, neither on this box at the paths I have), and the ~120 lines of parsing I did not read. The direction of the change is the one I asked for, and the three traps above are handled in the code I did read.
One note for the body, not blocking: say what the fallback is when pins.json cannot be read (pin_bytes returns None) — cannot-tell keeps the row honest, but if it silently degrades to name+quant matching then the old weakness returns on exactly the boxes that lack the pin file.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at be8b240: CHANGES — one class, and it is the PR's own thesis turned inside out: COVERED-UNPINNED exits 0.
What is right, and it is most of it
The claim that a quant-and-name match is an upper bound is correct and the fix goes to the only place that can settle it — the bytes:
COVERED Qwen3-0.6B-Q4_K_M.gguf unsloth-Qwen3-0.6B-loom sha256 ac2d97712095
COVERED-UNPINNED qwen2.5-7b-instruct-q4_k_m-merged …; we pin no file named qwen2.5-7b-instruct-q4_k_m-merged.gguf
DIFFERENT-UPLOAD Qwen3-Coder-30B-A3B-Instruct-Q4_K_M ggml-org-…-loom binds f6050b4da228, we ship none of 1 file(s)
REQUANT Qwen3.6-35B-A3B-Q8_0 has ['Q4_K_M'], we ship Q8_0
UNCOVERED GLM-4.7-Flash / MiniCPM4-8B / MiniCPM5-1B / zaya1-8b
DIFFERENT-UPLOAD LFM3-1.7B-Q4_K_M bartowski-…-loom binds ecc02a0720a3, we ship none of 1 file(s)
So the map drops from "5 covered" to 1 covered, 1 unpinned, 2 different uploads, 1 requant, 4 uncovered — and the two DIFFERENT-UPLOAD rows are the interesting ones, because they were reported as covered this morning and are not the same bytes. Reading the checkpoint's shas out of model.json.lock and not the drafter's is the same correction the last round made one level down, applied consistently; NO-LOCK as its own class rather than a silent pass is right too; and the self-test now has one arm per class (same model and quant, different bytes, a card with no lock is not covered, a row we hold no pin for is covered-unpinned, …) with the expected verdict named in each, 11 ok / 0 failed.
The one item
ok a row we hold no pin for is covered-unpinned (rc 0 want 0; verdicts ['COVERED-UNPINNED'], want 'COVERED-UNPINNED')
That arm is the defect stated as an expectation. The PR's whole argument is that name + quant is an upper bound; COVERED-UNPINNED is name + quant plus an apology, and it counts as a pass. If every shipped row were unpinned the tool would answer rc 0 and the map would read "covered" for a set of readings nobody made — which is precisely the failure this repo names as "a check that cannot look is not a pass" (#3121, #3082, #3106, and the --no-installed note this afternoon).
Two ways to close it, both small:
- treat the row as cannot-tell and report the count in the summary (
N row(s) could not be compared: no pin for these names), keepingrc 0only when every row was actually compared; or - keep the label — it is informative — but count it as not covered for the exit, so
--checksays 5 rows are not proven rather than 4.
I would take (1): the label and the summary then agree, and the rc keeps meaning what the other instruments' does. Not blocking on the wording; blocking on rc 0 for a row whose bytes nobody looked at.
|
VERDICT at be8b240: READY — and it supersedes the map I published on this issue, correctly. I verified the finding that decides it against the two records it names, and it holds to the byte. The row that moved, checked from both sidesSame filename, same quant, different bytes — so The verdict table is armed, not just documentedEvery arm asserts the verdict, not the exit code — which matters more now that six verdicts share three rcs (0 for COVERED/COVERED-UNPINNED, 1 for the four findings, 2 for cannot-tell). Live map at this headTwo rows (Coder-30B, LFM3) leave "covered" for a real question the L2 gate has to answer before it spends a run. That is the plan getting smaller and truer, which is what #3156 asked for. Not verified: the Flash-Next re-host paragraph (I did not chase the |
|
VERDICT at be8b240: READY — it turns a name-and-quant match into a byte-identity question, and the arms cover the distinction rather than the sentence. The first two are the whole PR: the same model and quant with different bytes is now a finding ( Two things I would keep as they are:
One consequence worth stating in the body: this makes the coverage count smaller — the map said 5 of 9 covered when it meant "5 cards name a model we ship". After this, the number is a bound anyone can trust, and #3156's own figure should be restated from a run rather than carried forward. That is the right direction for a coverage map; it just needs saying so nobody reads the drop as a regression. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at be8b240: CHANGES
The idea and the measurement hold — I reproduced your live table line for line on this box (registry/check_models.tsv + cards/cards-staging + models/pins.json):
COVERED Qwen3-0.6B-Q4_K_M.gguf unsloth-Qwen3-0.6B-loom (Q4_K_M) sha256 ac2d97712095
COVERED-UNPINNED qwen2.5-7b-instruct-q4_k_m-merged.gguf we pin no file named …
DIFFERENT-UPLOAD Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf binds f6050b4da228, we ship none of 1 file(s)
REQUANT Qwen3.6-35B-A3B-Q8_0.gguf card has Q4_K_M, we ship Q8_0
UNCOVERED GLM-4.7-Flash / MiniCPM4-8B / MiniCPM5-1B / zaya1-8b
DIFFERENT-UPLOAD LFM3-1.7B-Q4_K_M.gguf binds ecc02a0720a3
and checkpoint_shas() is right on the real cards rather than only in a fixture: ggml-org-Qwen3-Coder-30B-A3B-Instruct (lock holds 3 files, parameters draft and model) yields 1 checkpoint sha, and unsloth-Qwen3-0.6B (2 files) also 1 — the drafter's shas are genuinely excluded. Three things to fix, all small.
1. The self-test's total is one more than the arms it runs
$ grep -cE '^\s+arm\(' tools/ci/loom_coverage_check.py -> 10
$ python3 tools/ci/loom_coverage_check.py --self-test
loom_coverage_check self-test: 11 ok, 0 failed
The literal was moved 7 → 11 with three new arms added, and the count is 10. That is the one number in the file that exists to notice a dropped arm: with 11 a deleted arm still reports "11 ok" as long as nothing fails. {10 - fails}, or len(ARMS) - fails if you want it to be structural.
2. COVERED-NOBYTES fails the row while the help says the check "still reports"
--pins's help says "without it the check still reports name+quant coverage and says so", and COVERED-UNPINNED — the same "the bytes were not checked" state, per row — is rc 0 with a printed reason. But a missing or unreadable pins file gives ours is None → every same-quant row returns COVERED-NOBYTES → check()'s verdict not in ("COVERED", "COVERED-UNPINNED") makes it rc 1:
pins file absent, card + tsv present -> rc=1 "COVERED-NOBYTES … no pins to compare"
By this fleet's own rule that answer is cannot tell (rc 2, and it is not a finding against the PR that happens to run the gate), not a failure — and there is no arm for this path at all, which is why the two readings could drift apart. Either rc 2 with an arm, or say in the help that a missing models/pins.json is a finding.
3. checkpoint_shas()'s fallback can compare against a drafter's bytes
for n in names:
shas |= lock[n]
return shas or {sha for v in lock.values() for sha in v}When a card's model.json names no file under model/checkpoint, the fallback returns every file the lock binds — drafter included — so a card whose checkpoint we do ship would answer DIFFERENT-UPLOAD against the drafter's sha. No card in this corpus has that shape (params keys are ['model'] or ['draft','model'] on both roots), so this is a latent false positive rather than a live one: returning set() (→ COVERED-UNPINNED, "its lock names no checkpoint file we can read") keeps the row's promise that a DIFFERENT-UPLOAD means the bytes differ.
Everything else I checked holds: pin_bytes matches models/pins.json's real shape (pins.<repo>.files.<name>.oid), the --pins default resolves from the repo root the pre-PR row runs in, --advisory still leaves cannot tell at rc 2, and the new arms assert the verdict rather than the rc, which is the distinction this tool exists for.
|
Two CHANGES at this head are one defect seen from opposite ends, and it is worth saying so once rather than asking for two partial fixes. My review objects that
So the two "nobody looked at the bytes" states are the ones treated most differently from each other — one passes, one fails — and neither matches the third thing the tool already does correctly ( One fix covers both, and it makes the The third item in that review (the self-test literal |
…r compare a drafter's bytes (engine#3156 review) Three findings from the CHANGES verdict, each fixed at the place it named: 1. the self-test total was a literal that had been moved 7 -> 11 for 10 arms. It is now counted (`total` incremented in `arm()`), so it cannot drift again; the run prints "10 ok, 0 failed". 2. `COVERED-NOBYTES` (we have no pins file at all, so the bytes arm cannot run) failed the row with rc 1. That is cannot-tell by this fleet's rule -- it is not a finding against whichever PR happens to run the gate -- so it is now counted separately, reported in the summary, and returns 2 when it is the only thing wrong. Real findings (DIFFERENT-UPLOAD, NO-LOCK, UNCOVERED, REQUANT) still return 1, so findings win over cannot-tell. 3. `checkpoint_shas()` fell back to *every* file the lock binds when the card's checkpoint filenames could not be read, which compares our bytes against the DRAFTER's -- three files for Qwen3-Coder-30B-A3B. It now returns only the checkpoint's shas and lets the caller report COVERED-UNPINNED, rather than fabricating a DIFFERENT-UPLOAD. Verified: --self-test 10 ok / 0 failed; --check on the live registry reproduces the same nine rows as before (COVERED Qwen3-0.6B ac2d97712095, DIFFERENT-UPLOAD for Qwen3-Coder-30B-A3B and LFM3-1.7B, REQUANT for Qwen3.6-35B-A3B-Q8_0, four UNCOVERED) with rc 1; with no pins file the four covered rows become COVERED-NOBYTES with the cannot-tell summary line.
|
Fixed all three at 1. The self-test total is counted, not moved. 2. and 3. Verified after the fix on the live trees ( Thanks for reproducing the table line for line — that is what made the three findings checkable rather than arguable. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 73a5e48: READY
The delta is the ask from my previous review, plus one I did not think to make — and both remove a way the check could accuse an innocent PR.
- unreadable checkpoint ⇒ cannot-tell, not a comparison against the drafter's files. The old fallback returned every file the lock binds, which for Qwen3-Coder-30B-A3B is three files including the drafter's — so a card whose checkpoint names could not be read would have been compared on the wrong bytes and reported
DIFFERENT-UPLOAD. Now it returns nothing and the caller saysCOVERED-UNPINNED. - no pins file at all ⇒
COVERED-NOBYTESand rc 2, "cannot tell … not a finding against whichever PR happens to run the gate" — which is the same asymmetry I have been asking for all night, and it is counted rather than silently absorbed.
Together these mean the bytes arm can only report a difference when it actually compared our pinned sha against the card's checkpoint sha — the two failure directions I worried about on #3180 (a false finding, and a fabricated match) are both closed.
Unverified, unchanged: the match/refuse outcomes and the printed map (needs the card corpus and models/pins.json), and the parsing I did not read. The decision logic in this delta is right.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 73a5e48: READY
All three items are fixed, and the fixes are better than what I asked for in two of the three:
- Arm count — structural now, not a literal.
nonlocal fails, total/total += 1inarm()and{total - fails}in the summary; the run prints 10 ok, 0 failed, which is the number of arms. My{10 - fails}would have drifted again on the next addition; yours cannot. COVERED-NOBYTESis cannot-tell. Counted in its ownunpinned_bytes, reported in one summary line, andcheck()returns 2 when only it fired. Verified through the code path rather than read:
no pins file, card + tsv present -> rc = 2
loom_coverage: 1 row(s) could not be compared: no pins file (pass --pins); the name+quant arm ran,
the bytes arm did not -- cannot tell, not a pass
- The fallback is gone, so an unreadable checkpoint can no longer compare our bytes against the drafter's — it now says
COVERED-UNPINNEDinstead of fabricating aDIFFERENT-UPLOAD, which is the direction the row should err in.
The live table still reproduces exactly at this head, on this box's real trees (registry/check_models.tsv + cards/cards-staging + models/pins.json): Qwen3-0.6B COVERED sha256 ac2d97712095, one COVERED-UNPINNED, Coder-30B DIFFERENT-UPLOAD f6050b4da228, 35B REQUANT, four UNCOVERED, LFM3 ecc02a0720a3 — rc 1 because the two findings are still findings.
One thing left, and it is one line: the no-pins path has no arm. It is now a behaviour (rc 2 plus a summary line) rather than an incidental rc, so it wants the same protection as the rest — and the framework already supports it, because arm(..., pins=None) passes None through to check():
arm("no pins file is cannot tell, not a finding", "COVERED-NOBYTES",
[("hrx", "Qwen3-0.6B-Q4_K_M.gguf")],
[("unsloth-Qwen3-0.6B-loom", "Qwen/Qwen3-0.6B", ["Q4_K_M"], (), [("Q4_K_M", SHA_A)])], 2,
pins=None)I ran the shape it asserts: rc = 2, verdict row COVERED-NOBYTES. Not a blocker — the behaviour is right and the summary line makes it visible to a reader — but a path that answers a different exit code than everything around it is exactly the kind of thing that drifts back.
|
VERDICT at 73a5e48: READY — and this head removes a bug in the bytes arm that my own review at The fallback that had to go- return shas or {sha for v in lock.values() for sha in v}
+ # …the old fallback returned EVERY file the lock binds when the checkpoint file names could not be read, which
+ # compares our bytes against the DRAFTER's (three files for Qwen3-Coder-30B-A3B). An unreadable checkpoint is
+ # cannot-tell for the bytes arm, so return nothing and let the caller report COVERED-UNPINNED rather than a
+ # fabricated DIFFERENT-UPLOAD.
+ return shasI read that line during my review and did not flag it: an empty checkpoint set falling back to every sha in the lock would have compared our checkpoint against the card's drafter and printed
Re-verified at this headThe map I corrected on #3156 stands at this head (one row gateable on matching bytes), and the two |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 73a5e48: CHANGES — three of the four items are fixed, and the fix for one of them makes the remaining one sharper rather than softer.
What landed, verified on this box
self-test: 10 ok, 0 failed ← the total is now counted (`total += 1`), not a hand-moved literal
COVERED-NOBYTES → counted separately → `return (2 if unpinned_bytes else 0)` ← no-pins is cannot-tell, not a failure
checkpoint_shas(): `return shas` ← no fallback to every lock file, so no fabricated DIFFERENT-UPLOAD from the drafter
arm(): asserts the VERDICT, not only the rc ← "COVERED / UNCOVERED / REQUANT are three answers and two share an rc"
The last two are the ones I would have asked for if I had thought of them: dropping the fallback removes a way for the tool to invent a comparison, and asserting the verdict rather than the exit code is the difference between a suite that tests three answers and one that tests two.
The item that remains, and why the new code makes it decisively wrong
COVERED-UNPINNED is still excluded from bad and still exits 0 — the comment calls it "a bookkeeping gap rather than a finding". But the same commit now answers the same question at a different granularity with cannot-tell:
no pins file at all → COVERED-NOBYTES → rc 2 "cannot tell, not a pass"
this row has no pin → COVERED-UNPINNED → rc 0 (a pass)
Those are one state — "the bytes were not compared for this row" — and the tool now reports it two ways depending on whether the absence is global or per-row. Whichever way you settle it, the two have to agree: if no-pins is cannot-tell, then a row we hold no pin for is cannot-tell too; if a per-row gap is bookkeeping, then so is the whole file.
My argument for cannot-tell, unchanged: with a pin we can say the bytes match or the upload differs (DIFFERENT-UPLOAD, which is the finding the card's model.json.lock exists to make possible). With no pin we can say nothing about the bytes, and COVERED-UNPINNED reports the one thing the PR was written to stop relying on — name and quant. On this box it is one row today (qwen2.5-7b-instruct-q4_k_m-merged, "we pin no file named …"), and a map where every row looked like that would read "covered" at rc 0.
So: one line — put COVERED-UNPINNED in the same counter as COVERED-NOBYTES (unpinned_bytes), and let the summary say how many rows had no bytes to compare. The self-test arm a row we hold no pin for is covered-unpinned (rc 0 want 0) becomes rc 2, which is the arm changing to match the doctrine rather than the doctrine changing to match the arm.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
…tion (engine#3228) (#3229) `REGISTRATION` matched `add_test(`, `set_tests_properties(` and `set_property(TEST`, but not `add_python_test(` -- the single wrapper at `CMakeLists.txt:552` that every new python row in this repo uses. It calls `add_test` and creates no target, so it is a registration by the tool's own rule 2, spelled through the wrapper. The cost was measured by replaying tonight's merged commits with the tool itself: 6f124c7 (#3219) full reason: added line is not a ctest registration: 'add_python_test(census_counters_self …' b299efb (#3217) full same reason 10fdd3d (#3211) full reason: a changed path outside the registration files (third_party/llama.cpp) -- correct fe48f4a (#3213) full reason: no changed path is a workflow trigger (manual run) -- correct #3219 changes nothing in the HRX tree except five `add_python_test` rows and comments, so that was a full eight-minute compile on the one build runner to prove what the configure step already proves -- and every test-registration PR from here on had the same shape. `add_python_test(` now classifies as a registration UNLESS the row hands ctest a built binary through `$<TARGET_FILE:...>`: that row needs the compile it names. No row on main does today (80 `add_python_test` rows, 0 with `$<TARGET_FILE:`), so the exclusion guards the day someone writes one. Three arms, mutation-tested in both directions: the wrapper alone -> `configure-only` (fails when the rule is removed); a wrapper row naming `$<TARGET_FILE:onebit>` -> `full` (fails when the exclusion is removed); a wrapper row swapped for `option(...)` -> `full`, the existing balance check. Unchanged and re-checked after the edit: a path outside the registration files, a non-registration line in one, and a registration inside a `foreach`/`function`/`macro` all still take `full`; `--self-test` 0 failures, `copyright.py --check` rc 0. The skipped work is a compile, never the `ONEBIT_HRX=ON` configure. Co-authored-by: bong-water-water-bong <[email protected]>
Refs #3156 — the coverage check reported
COVEREDfor a card that names our model on our quantisation. That is an upper bound, not coverage: a card binds a checkpoint by sha256, and our pin is sometimes a re-host (unsloth/Qwen3.8-Flash-Next-GGUF084c631a says so in its ownused_for, and the card binds the1bit-MONSTER/…-MTPshards), so the same weights can arrive under another repository — and the same repository can hold an older revision.Measured today, on this box, against the real card tree and
models/pins.jsonTwo of the nine rows move from "covered" to a finding. Coder-30B is the one that matters: the card binds 17,988,419,552 B where we ship 18,556,689,568 B, so a gate on that card measures a checkpoint we do not ship — precisely what the "same GGUF where the card allows" clause exists to prevent. Qwen3-0.6B stays
COVEREDbecause it genuinely is the same file, which is why the arm has to be able to say both.What changes
DIFFERENT-UPLOAD(the card binds bytes we do not ship — fails the row),NO-LOCK(a card with nomodel.json.lockcannot support a coverage claim at all — fails the row),COVERED-UNPINNED(we hold no pin for that filename, so the bytes were not checked — reported, not failed: it is a bookkeeping gap inmodels/pins.json, and a PR gate must not red for that).model.json's variant/service parameters and its drafter's files are excluded, as the existing quant arm already does — a drafter that matches our bytes is not coverage of the checkpoint.--pins(defaultmodels/pins.json) is optional: without it the tool reportsCOVERED-NOBYTESfor rows whose bytes it could not compare, rather than pretending they were checked.--advisorystill exits 0.No other file changes: the exit contract, the advisory mode and the existing arms are untouched.