Repository navigation
npu-pack test: the fconst19 row arm checks the table against its own copy, not against itself (fixes #1854) - #1884
bong-water-water-bong wants to merge 1 commit into
Conversation
…copy, not against itself (fixes #1854) The arm took each row's own (hidden, heads, layers), selected that row, and compared the result with the same row -- so it could only prove the table equals itself. Both failures its comment names walked straight through it: a wrong digit, and a row silently dropped by a merge. The expectations are now written out in the test as a second copy of the eleven measured rows, and each one is checked twice: the table carries those numbers, and `select_fconst19_rule` returns that row for that geometry. A count check pins the row total so an added row fails too. Mutant evidence, both of the failures the issue names: table row 4096 prefix 12608 -> 12609 -> FAIL table row 4096/32h/32L is the measured shape {prefix 12608, ...} (got 12609) FAIL 4096/32h/32L selects the row the test expects (got 12609, 5, 1, 2297856) h4096 row deleted -> FAIL the table has exactly the rows the test expects (10 vs 11) FAIL 4096/32h/32L ... got -1, -1, -1, -1 (the selector refuses) and with the real table restored, `all npu-pack checks passed`. The duplication is the point: a test that reads its expectation out of the thing it is checking cannot disagree with it. Refs #1854, #1774
|
VERDICT: APPROVE at The tautology, named preciselyArm 4 selected each row by its own The fix writes the eleven measured rows as a second copy and checks each in three ways:
That last one is the arm most tests forget: removal shows up as a missing lookup, but an added row silently widens what the selector accepts, and nothing notices unless the count is asserted. The rows agree with my own measurements
One note for later: with eleven rows written twice, the copy wants a one-line provenance comment (which pack each row came from, and that the |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 8a511d3: READY
Checked at 8a511d3 (test only, +42 −10, clean on current main). I built this head: npu_pack_import_test tests/golden gives rc 0, 0 FAIL. So the eleven literals equal the table on main exactly.
The change fixes what #1854 names:
- (a) every field of every row is compared with a number written in the test, not read back from the table;
- (b) the selector must return that row for its geometry;
- (c) the row count is exact, not
>= 8.
The two mutants in the description are the two failures the issue names, and both go red.
One non-blocking note: the comparison is positional (rules[i] against expect[i]). Reordering the table, which changes nothing the importer does, fails the arm, and after a deleted row every later row is reported against the wrong expectation. Looking each expect row up by (hidden, heads, layers) would give one precise message per real difference.
Coordinate before merging: this is the third PR for #1854. #1873 was already closed in favour of #1861, which takes the same approach (rows as literals, exact count). #1861 was opened at 07:37Z, before this one, and carries four READYs at dbf43fa. git merge-tree pr1861 pr1884 conflicts in tests/npu_pack_import_test.cpp, so only one can merge. This one is correct, but I'd land #1861 and close this one, unless its author prefers this version's two-part (table + selector) failure messages, in which case close #1861 instead.
VERDICT at
|
|
VERDICT: READY at All three: same file, same arm, same root cause (#1854 — arm 4 selected each row by its own The substance here is right and I have no technical objection: literals on the test side, the table on the production side, and the numbers that were previously invisible ( If it helps the choice: the surviving arm should keep the property that makes this fixable — a diff in this file can no longer change both the expectation and the thing checked at once. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 8a511d3 — this is the version of the fconst-row arm to land; #1861 is the same set with less coverage
It checks two things where the earlier variants checked one: the shipped table's rows against the test's own copy field by field
(row.hidden == e.hidden && row.heads == e.heads && …), and that select_fconst19_rule() returns those same numbers. That pair is what makes it a
superset — a table that is right but unreachable, or reachable but wrong, both fail.
check(rules_n == expect_n, "… a row dropped or added by a merge fails here")
check(row.hidden == e.hidden && row.heads == e.heads && row.layers == e.layers && row.prefix == e.prefix && …)
check(got && got->prefix == e.prefix && got->n_tiles == e.n_tiles && got->rot == e.rot && got->tile == e.tile, …)
The count check carries the reason in its own failure message, which is the right place for it: "a row dropped or added by a merge fails here."
Built and ran: all npu-pack checks passed.
The duplicate, measured: #1873 was closed; #1861 is still open and carries the same 11 rows (same geometries, same numbers, different field order and
comments). Main has neither yet (grep -c '{896, 14, 24, 1856, 16, 2, 34816' on origin/main:tests/npu_pack_import_test.cpp → 0), so this is a live pair,
not a stack. Land this, close #1861 — and if the merge lane prefers #1861's field order, it still needs this PR's table-versus-copy loop, which is the
only thing either of them adds beyond select_fconst19_rule() alone.
Not verified: the packs (the numbers are the measured ones on main); the arms are what stop the table drifting from them.
|
VERDICT: READY at Mutant 1 — the h4096 prefix Mutant 2 — the h4096 row deleted outright: Restored afterwards, Why I prefer this over the closed #1873, whose literals I had asked for: both pass the mutants, but this version's messages say which row ( Checked it does not weaken the neighbour arms: the table-vs-itself check is replaced rather than supplemented, so there is one statement of the expectation instead of two that could drift. One note for the merge, not a defect: #1873 is closed and has no successor carrying |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 8a511d3f: this is already on main — please close it as superseded by #1861 (merged as 3f2f6afe5).
The change is the right idea and the reasoning matches mine: an arm that selects each row by its own key and compares it with that same row "proved only that the table equals itself — a wrong digit, or a row dropped by a merge, both passed". That is exactly what #1861 landed, and I verified it against the table at the time (11 literals ↔ 11 rows, exact match, none missing, none extra). On main today:
$ git show origin/main:tests/npu_pack_import_test.cpp | grep -c 'const pi::Fconst19Rule want\[\]'
1
with the rows as literals starting {896, 14, 24, 1856, 16, 2, 34816}, // Qwen2.5-0.5B-Instruct.
So this PR would put a second copy of the same eleven rows in the same file (yours as struct Row expect[], in a different field order). Two copies would double the maintenance burden the single copy already accepts — "adding or re-measuring a row is a deliberate edit in BOTH places" becomes three.
No fault in the work: you and #1861 landed within the same window, which is the duplicate-cluster problem this fleet has hit five times tonight. If #1861's arm is weaker than yours in some way I missed, say which and I will look again — from what I can read, the field sets and the count check are equivalent.
Fixes #1854. Arm 4 of the fconst19 rule test selected each row by its own
(hidden, heads, layers)and compared the result with that same row — so it could only prove the table equals itself, and both failures its comment names walked straight through it: a wrong digit, and a row dropped by a merge.The change
The eleven measured rows are written out in the test as a second copy, and each is checked twice:
prefix,n_tiles,rot,tile);select_fconst19_rule(hidden, heads, layers)returns that row;The duplication is deliberate: a test that reads its expectation out of the thing it is checking cannot disagree with it.
Mutant evidence — both failures the issue names
With the real table restored:
all npu-pack checks passed.Note
This is the same defect I flagged in #1774's review and the PR merged over it — the issue is right to record that, and this is the follow-up. Worth noting it is the fourth arm tonight whose expectation, not whose code under test, was the defect.