Repository navigation
mtp: a new MTP leaderboard record cannot arrive outside the records guard - #1229
Conversation
…uard #1206's guard compares the seven MTP records' published values against the fixtures, but it names those seven ids in a dict: a record added later -- a new target, a re-measured window, a k=6 row -- would land in bench/npu-leaderboard/ and be ignored by the check, looking exactly like a covered one. That is the "one table row per record" hole #1213 closed for the generated page, one field over, and the same defect this lane keeps paying for: a check that reports success on the records it was told about rather than the records that exist. The guard now also reads the directory: every file whose id starts 27b-mtp- must be one of the ids it derives, and the readable-directory count is asserted first so an empty listing cannot pass as coverage. Measured (pure python, no model, no device): before: the guard reported `all checks passed` with an extra record present on disk. after: an 8th record added as a copy of the hit-rate one -> `FAIL every MTP record on disk is checked by this guard: uncovered ['27b-mtp-extra-20261105']`, `1 CHECK(S) FAILED`; record removed -> `all checks passed`, `the guard's record directory is readable (7 MTP record(s))`. the existing arms are unchanged: 7 of 7 records equal what the fixtures derive (75.14 / 47.51 / 34.81 / 29.28 %, 46.69 %, 2.87 / 2.82), the +0.01 anti-vacuity arm still bites. tools/copyright.py --check rc 0. refs #805 (P6's leaderboard line); extends #1206.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 7023f956.
Falsified the way the body describes, on this tree: baseline green over the 7 records that exist, an 8th record
(a copy of the hit-rate one, named 27b-mtp-extra-20261105.json) turns it red naming the file, removing it turns it back:
$ python3 tests/mtp_depth_pool_test.py
PASS the guard's record directory is readable (7 MTP record(s))
PASS every MTP record on disk is checked by this guard: uncovered []
all checks passed rc 0
$ cp …/27b-mtp-hit-rate-20261105.json …/27b-mtp-extra-20261105.json ; python3 tests/mtp_depth_pool_test.py
FAIL every MTP record on disk is checked by this guard: uncovered ['27b-mtp-extra-20261105']
1 CHECK(S) FAILED
$ rm …/27b-mtp-extra-20261105.json ; python3 tests/mtp_depth_pool_test.py
all checks passed rc 0
The len(on_disk) >= len(derived) assertion before the uncovered-list check is the part that keeps it honest — an
unreadable or empty records directory fails instead of passing an empty uncovered [] — and it is doing real work: with
7 27b-mtp-* files on disk and 7 derived ids, the two counts are equal, so a deleted record would also be caught by the
first line rather than the second.
One note, not a nit on the change: >= means an extra record is caught by the uncovered list (good) but a record
deleted from the directory while its id stays in derived is caught only by the count if the deletion drops the total
below len(derived) — which it does, since they are equal today. So both drift directions are covered, by different
lines. Worth knowing if a future cycle ever ships more records than ids; that is the only shape where the two checks
stop being equivalent.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
…onebit` any more (engine#1575) CI links only `--target onebit`, so a member declared in a forward header and never defined costs nothing there -- and the targets that would catch it cannot be linked in CI at all, because they need the private NPU runtime. That is how `main` stayed green while a full `cmake --build` stopped at 92 % with `undefined reference to Q4nxNpuForward::step_batch_embeds(...)` (#1573). tests/declared_vs_defined_test.py is the static guard, and it is **arity-aware on purpose**: the failure was a THREE-argument overload declared (npu/forward/include/q4nx_forward.h:154) while only the FOUR-argument `HybridInputs` overload had a body (npu/forward/src/q4nx_forward.cpp:3026). A name-only check would have called that defined, which is why the message it prints names both arities: FAIL Q4nxNpuForward::step_batch_embeds declared with 3 parameter(s) but only defined with 4 -- an overload with no body Red/green, measured rather than asserted: * this tree (main + this test) -> rc 1, the line above, and nothing else * the same check against #1574's head (0c895f9) -> rc 0 Two parser bugs were fixed on the way, both of which would have made the guard useless in opposite directions: a first cut flattened nested classes and reported `Q4nxNpuForward::bytes`, which is really `StateSnapshot::bytes` (the scan is now brace-aware and only takes declarations at depth 0 of the class), and a second cut never matched anything at all because the accumulated statement had its terminator stripped before the matcher ran. Scope, in the file's own docstring rather than implied: only the classes listed there are checked (adding a new forward class to that list is the point); matching is name + parameter count, so a wrong *type* at the right arity still needs a link; inline members, `= default`, `= delete`, pure virtuals and constructors are skipped. Registered as ctest `declared_vs_defined`. refs #1575, refs #1573 (fixed by #1574), refs #1184/#1213/#1229 (same class: a green check that never exercised the thing it claims to check).
…onebit` any more (engine#1575) (#1589) CI links only `--target onebit`, so a member declared in a forward header and never defined costs nothing there -- and the targets that would catch it cannot be linked in CI at all, because they need the private NPU runtime. That is how `main` stayed green while a full `cmake --build` stopped at 92 % with `undefined reference to Q4nxNpuForward::step_batch_embeds(...)` (#1573). tests/declared_vs_defined_test.py is the static guard, and it is **arity-aware on purpose**: the failure was a THREE-argument overload declared (npu/forward/include/q4nx_forward.h:154) while only the FOUR-argument `HybridInputs` overload had a body (npu/forward/src/q4nx_forward.cpp:3026). A name-only check would have called that defined, which is why the message it prints names both arities: FAIL Q4nxNpuForward::step_batch_embeds declared with 3 parameter(s) but only defined with 4 -- an overload with no body Red/green, measured rather than asserted: * this tree (main + this test) -> rc 1, the line above, and nothing else * the same check against #1574's head (0c895f9) -> rc 0 Two parser bugs were fixed on the way, both of which would have made the guard useless in opposite directions: a first cut flattened nested classes and reported `Q4nxNpuForward::bytes`, which is really `StateSnapshot::bytes` (the scan is now brace-aware and only takes declarations at depth 0 of the class), and a second cut never matched anything at all because the accumulated statement had its terminator stripped before the matcher ran. Scope, in the file's own docstring rather than implied: only the classes listed there are checked (adding a new forward class to that list is the point); matching is name + parameter count, so a wrong *type* at the right arity still needs a link; inline members, `= default`, `= delete`, pure virtuals and constructors are skipped. Registered as ctest `declared_vs_defined`. refs #1575, refs #1573 (fixed by #1574), refs #1184/#1213/#1229 (same class: a green check that never exercised the thing it claims to check). Co-authored-by: bong-water-water-bong <bong-water-water-bong@1bit.gg>
Root cause
#1206's records guard compares the seven MTP rows' published values against the shipped fixtures, but it names those seven ids in a dict. A record added later — a new target, a re-measured window, a k=6 row — would land in
bench/npu-leaderboard/and be ignored by the check, looking exactly like a covered one. That is the "one table row per record" hole #1213 closed for the generated page, one field over, and the same class as the three harness defects this lane already closed (#1146 fixtures, #1184 compile step, the watcher that read "no checks reported" as a pass): a check reporting success on the records it was told about rather than the records that exist.Fix (1 file, +11/−1)
tests/mtp_depth_pool_test.py[17] now also reads the directory: every file whose id starts27b-mtp-must be one of the ids the guard derives, and the readable-directory count is asserted first so an empty listing cannot pass as coverage.Measured (pure python, no model, no device)
The existing arms are unchanged:
all 7 MTP records equal what the fixtures derive: [](75.14 / 47.51 / 34.81 / 29.28 %, 46.69 %, 2.87 / 2.82) and the+0.01anti-vacuity arm still bites.tools/copyright.py --checkrc 0.refs #805 (P6's leaderboard line); extends #1206.