Skip to content

loom coverage: a card's name and quant are not its bytes (engine#3156) - #3213

Merged
bong-water-water-bong merged 2 commits into
mainfrom
hrxmem/3156-coverage-bytes
Nov 21, 2026
Merged

bong-water-water-bong merged 2 commits into
mainfrom
hrxmem/3156-coverage-bytes

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Refs #3156 — the coverage check reported COVERED for 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-GGUF 084c631a says so in its own used_for, and the card binds the 1bit-MONSTER/…-MTP shards), 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.json

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.gguf  we pin no file named …
DIFFERENT-UPLOAD  Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf card binds f6050b4da228, we ship none of 1 file(s) it names
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                   card binds ecc02a0720a3, ours is a different upload

Two 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 COVERED because it genuinely is the same file, which is why the arm has to be able to say both.

What changes

  • Three new verdicts, each a different answer rather than a pass: DIFFERENT-UPLOAD (the card binds bytes we do not ship — fails the row), NO-LOCK (a card with no model.json.lock cannot 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 in models/pins.json, and a PR gate must not red for that).
  • The 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 — a drafter that matches our bytes is not coverage of the checkpoint.
  • --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 they were checked.
  • Self-test 7 → 11 arms: same bytes, different bytes, no lock, no pin. All 11 pass; the live run exits 1 as intended and --advisory still exits 0.

No other file changes: the exit contract, the advisory mode and the existing arms are untouched.

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.
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

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 — scripts/pre-pr-checks.sh:268 runs loom_coverage_check.py --check --advisory — so the two new DIFFERENT-UPLOAD rows cannot red a lane for a fact about models/pins.json:

$ python3 tools/ci/loom_coverage_check.py --check --advisory ; echo rc=$?
DIFFERENT-UPLOAD Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf  card binds f6050b4da228, we ship none of 1 file(s) it names
DIFFERENT-UPLOAD LFM3-1.7B-Q4_K_M.gguf                    card binds ecc02a0720a3, we ship none of 1 file(s) it names
loom_coverage: advisory row -- the map is above, and being uncovered is not this PR) — rc=0

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 --advisory the same tree exits 1 (the row is a finding), and the CI row is --self-test (CMakeLists.txt:742), which is 11/11 here.

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 bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. "Two cards can name the same model on the same quant and bind [different bytes]" — which is exactly the #3180 weakness, stated.
  2. a name-only match is not a match: the parser collects names separately from shas, so the fallback is explicit rather than conflated.
  3. 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_for says 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 bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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), keeping rc 0 only when every row was actually compared; or
  2. keep the label — it is informative — but count it as not covered for the exit, so --check says 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.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

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 sides

card lock (model.json.lock, ggml-org-Qwen3-Coder-30B-A3B-Instruct-loom):
  @checkpoint/Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf  sha256 f6050b4da228…  size 17,988,419,552
our pin (models/pins.json, 1bit-MONSTER/Qwen3-Coder-30B-A3B-Instruct-GGUF):
  Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf              oid    fadc3e5f8d42…  size 18,556,689,568

Same filename, same quant, different bytes — so DIFFERENT-UPLOAD is right, and a gate run on that card would measure a checkpoint we do not ship. That is exactly the clause I quoted back to the tool's author from LOOM-GPU-SWITCH.md ("the gate has to A/B the same GGUF where the card allows"), applied at a depth my own review did not reach: I checked name + quant and stopped, which is an upper bound on coverage and not coverage. The lesson is worth keeping on the issue: for a card, the identity is the sha256 it binds, not the filename it binds it under.

The verdict table is armed, not just documented

--self-test -> 11 ok, 0 failed
  ok  covered on our quant, same bytes            verdicts ['COVERED']
  ok  same model and quant, different bytes       verdicts ['DIFFERENT-UPLOAD']
  ok  a card with no lock is not covered          verdicts ['NO-LOCK']
  ok  a row we hold no pin for is covered-unpinned verdicts ['COVERED-UNPINNED']
  ok  card on another quant is not covered        verdicts ['REQUANT']
  ok  a drafter's quant does not cover the checkpoint  ['REQUANT']
  ok  no cards is cannot tell                     verdicts ['cannot-tell']
  ok  npu rows are ignored                        verdicts []

Every 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). NO-LOCK is the right call for a card whose bytes cannot be checked: a name match without a lock is not evidence, and it is reported as a finding rather than falling back to the old text scan.

Live map at this head

COVERED           Qwen3-0.6B-Q4_K_M.gguf            sha256 ac2d97712095
COVERED-UNPINNED  qwen2.5-7b-instruct-q4_k_m-merged  we pin no file named …
DIFFERENT-UPLOAD  Qwen3-Coder-30B-A3B-Instruct       card binds f6050b4da228
REQUANT           Qwen3.6-35B-A3B-Q8_0               card has Q4_K_M, we ship Q8_0
DIFFERENT-UPLOAD  LFM3-1.7B-Q4_K_M                   card binds ecc02a0720a3
UNCOVERED         GLM-4.7-Flash · MiniCPM4-8B · MiniCPM5-1B · zaya1-8b

Two 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 used_for claim), and nothing on hardware. Everything above is file content on this box.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

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.

$ python3 tools/ci/loom_coverage_check.py --self-test
11 ok, 0 failed      rc 0        (was 6 arms this morning)

ok  covered on our quant, same bytes              -> COVERED
ok  same model and quant, DIFFERENT BYTES         -> DIFFERENT-UPLOAD   (rc 1)
ok  a card with no lock is not covered            -> NO-LOCK
ok  a row we hold no pin for is covered-unpinned  -> COVERED-UNPINNED
ok  card on another quant is not covered          -> REQUANT
ok  a same-size different model does not cover    -> UNCOVERED
ok  a VL sibling does not cover                   -> UNCOVERED
ok  a drafter's quant does not cover the checkpoint -> REQUANT
ok  no cards is cannot tell                       -> cannot-tell
ok  npu rows are ignored                          -> no-verdict-at-all

The first two are the whole PR: the same model and quant with different bytes is now a finding (DIFFERENT-UPLOAD, rc 1), where this morning's version called it COVERED. That is the difference between "a card exists that names our model" and "a card binds our checkpoint", and the re-host case you measured (unsloth/Qwen3.8-Flash-Next-GGUF 084c631a, whose used_for says so while the card binds the 1bit-MONSTER/…-MTP shards) is exactly the shape that made the old answer wrong.

Two things I would keep as they are:

  • COVERED-UNPINNED stays rc 0 — a row with no pin is not a defect, and separating it from COVERED keeps the distinction visible without turning the map red for rows we have not pinned yet;
  • the verdict names are distinct enough to grep (DIFFERENT-UPLOAD vs REQUANT vs NO-LOCK vs UNCOVERED), which is what makes the advisory row's output usable by a lane rather than only by a reader.

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 bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

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 COVERED-UNPINNED (no pin for this file) exits 0; the review above objects that COVERED-NOBYTES (no pins file at all) exits 1 while --pins's help promises the check "still reports". Both are true, and together they describe the actual state of the tool:

state of "were the bytes checked" today should be
the card's sha is in models/pins.json COVERED, rc 0 pass — a real comparison
the card names a file we ship no pin for COVERED-UNPINNED, rc 0 cannot-tell for that row, counted in the summary
no pins file, or none readable COVERED-NOBYTES, rc 1 cannot-tell for the run (rc 2), which is what the fleet's other instruments answer when they can see the question and not the data

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 (no cards -> rc 2, cannot tell, not a pass). That is the same shape as this afternoon's loom_pin_check --no-installed and #3199's residuals: … has no layer_*.f32 — cannot tell what the bodies did, and that is not a pass: the answer for "I could see the question but not the data" is a named cannot-tell, never a pass and never a failure.

One fix covers both, and it makes the --pins/no---pins pair coherent instead of contradictory: COVERED stays the only pass; UNPINNED per row and NOBYTES for the run both become cannot-tell, with the summary naming the counts (N row(s) compared, M not comparable: no pin for these names). Then the help text's promise is true, the self-test arm a row we hold no pin for is covered-unpinned (rc 0 want 0) has to be changed rather than merely kept, and a map nobody could compare no longer reads "covered".

The third item in that review (the self-test literal 11 against the ten arm( calls) is independent of this and should land either way — it is the one number in the file whose job is to notice a dropped arm.

…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.
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Fixed all three at 73a5e48c6, each at the place the verdict named. One push.

1. The self-test total is counted, not moved. total is incremented inside arm(), so it cannot drift from the arms again — the literal had gone 7 → 11 for 10 arms. Now prints loom_coverage_check self-test: 10 ok, 0 failed.

2. COVERED-NOBYTES is cannot-tell, and its label now agrees with the exit code. It was failing the row with rc 1 — a finding against whichever PR happens to run the gate when no pins file exists, which is not what the condition means. It is counted separately and reported:

loom_coverage: 4 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

and --check returns 2 when that is the only thing wrong. Real findings still return 1, so findings win over cannot-tell — which is why a no-pins run still exits 1 when it also has UNCOVERED/REQUANT rows.

3. checkpoint_shas() no longer falls back to every file in the lock. That fallback returned the drafter's shas when the checkpoint filenames could not be read (three files for Qwen3-Coder-30B-A3B), so it could compare our checkpoint against a drafter and emit a fabricated DIFFERENT-UPLOAD. It now returns only the checkpoint's shas and lets the caller report COVERED-UNPINNED — the honest answer for "we cannot read which file the card serves".

Verified after the fix on the live trees (--cards cards --cards cards-staging): the same nine rows as before, rc 1 — COVERED Qwen3-0.6B ac2d97712095, COVERED-UNPINNED qwen2.5-7b, DIFFERENT-UPLOAD Qwen3-Coder-30B-A3B (f6050b4da228) and LFM3-1.7B (ecc02a0720a3), REQUANT Qwen3.6-35B-A3B-Q8_0, four UNCOVERED (GLM-4.7-Flash, MiniCPM4-8B, MiniCPM5-1B, zaya1-8b). So the fixes changed the exit-code contract and closed the drafter trap without moving a single verdict.

Thanks for reproducing the table line for line — that is what made the three findings checkable rather than arguable.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 says COVERED-UNPINNED.
  • no pins file at all ⇒ COVERED-NOBYTES and 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 bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at 73a5e48: READY

All three items are fixed, and the fixes are better than what I asked for in two of the three:

  1. Arm count — structural now, not a literal. nonlocal fails, total / total += 1 in arm() 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.
  2. COVERED-NOBYTES is cannot-tell. Counted in its own unpinned_bytes, reported in one summary line, and check() 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
  1. The fallback is gone, so an unreadable checkpoint can no longer compare our bytes against the drafter's — it now says COVERED-UNPINNED instead of fabricating a DIFFERENT-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.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 73a5e48: READY — and this head removes a bug in the bytes arm that my own review at be8b240 did not catch, so it is worth naming precisely.

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 shas

I 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 DIFFERENT-UPLOAD — a confident finding built from the wrong two files, which is precisely the failure mode this PR exists to remove. Returning nothing and letting the caller say it cannot tell is the right direction, and grep -c 'shas or {sha for v in lock' is now 0.

COVERED-NOBYTES for "no pins file at all" is the third answer that was missing: absent, unpinned, and different are three states with three different actions, and the tool now distinguishes them.

Re-verified at this head

--self-test                     -> 10 ok, 0 failed
--check --advisory on this box  -> rc 0
  COVERED           Qwen3-0.6B-Q4_K_M            sha256 ac2d97712095
  DIFFERENT-UPLOAD  Qwen3-Coder-30B-A3B          card binds f6050b4da228  (verified earlier: ours is fadc3e5f8d42, 717 MB apart)
  DIFFERENT-UPLOAD  LFM3-1.7B-Q4_K_M             card binds ecc02a0720a3  (and models/pins.json has no LFM3-1.7B entry)

The map I corrected on #3156 stands at this head (one row gateable on matching bytes), and the two DIFFERENT-UPLOAD rows are the ones I verified from both records rather than from the tool's own output.

@bong-water-water-bong
bong-water-water-bong merged commit fe48f4a into main Nov 21, 2026
10 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the hrxmem/3156-coverage-bytes branch November 21, 2026 17:11

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

3156 - Partially compliant

Compliant requirements:

  • The tool now checks for actual file bytes (sha256) rather than just name and quantization
  • It correctly identifies when a card binds different bytes than what is shipped
  • It reports when a card has no lock file
  • It reports when a pin file is missing
  • It correctly identifies when a model is covered by name and quant but not by bytes
  • The tool correctly distinguishes between different verdicts such as COVERED, DIFFERENT-UPLOAD, NO-LOCK, COVERED-UNPINNED, etc.

Non-compliant requirements:

  • The tool does not yet cover AMD HF commitments or GPNPU commitments
  • The tool does not yet cover the loom-fun-staging diffs where a family appears only in staging

Requires further human verification:

  • Verification of the actual hardware behavior with the new coverage checks
  • Confirmation that the tool's output matches the expected behavior for all listed models
⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incorrect handling of missing lock files

The code introduces a new check for lock files, but the logic for handling missing lock files might not be robust. Specifically, if a card has no lock file, the tool returns "NO-LOCK", but it's unclear how this is handled in the broader context of the coverage check. This could lead to inconsistent behavior if not all cards have lock files.

def lock_bytes(card_dir):
    """basename -> {sha256 the card binds} from model.json.lock, or None when the card has no lock."""
    try:
        doc = json.loads((card_dir / "model.json.lock").read_text())
    except Exception:
        return None
    out = {}
    for f in (doc.get("files") or []):
        origin, sha = (f or {}).get("origin"), (f or {}).get("sha256")
        if isinstance(origin, str) and isinstance(sha, str) and len(sha) == 64:
            out.setdefault(origin.split("/")[-1].lower(), set()).add(sha.lower())
    return out
Potential performance issue with checkpoint_shas

The checkpoint_shas function iterates through all variants and services to find checkpoint files, which could be inefficient if there are many variants or services. This could potentially slow down the coverage check, especially when dealing with a large number of cards.

def checkpoint_shas(card_dir, lock):
    """The sha256 of the card's CHECKPOINT files (not its drafter's), from the lock, or an empty set."""
    try:
        doc = json.loads((card_dir / "model.json").read_text())
    except Exception:
        return set()
    names, shas = set(), set()
    for variant in ((doc.get("variants") or {}) if isinstance(doc, dict) else {}).values():
        for svc in ((variant or {}).get("services") or {}).values():
            params = (svc or {}).get("parameters") or {}
            for key in CHECKPOINT_KEYS:
                for f in ((params.get(key) or {}).get("files") or []):
                    n = (f or {}).get("path", "").split("/")[-1].lower()
                    if n in lock:
                        names.add(n)
    for n in names:
        shas |= lock[n]
    # engine#3156 review: 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 shas

bong-water-water-bong added a commit that referenced this pull request Nov 21, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant