Repository navigation
ci: the decode-split invariant reads every fork suite that carries it, and names the one it cannot decide (engine#2870) - #3008
Conversation
…ne nobody runs (engine#2870)
`fa_split_expectation_check.py` opened `tests/hrx-ops-test.cpp` and asked whether that file
carries a padded-capacity fixture beside its split expectation. Two files in the fork carry
the same rows and they are not the same file:
tests/hrx-ops-test.cpp split=17 kPaddedKeyValueCapacity=0 padding-hits=2 9798 lines
tests/test-hrx-ops.cpp split=45 kPaddedKeyValueCapacity=4 padding-hits=1 6855 lines
`test-hrx-ops` is the suite a device run quotes and the one #448/#454 edit; `hrx-ops-test` is
a second copy the fork ratchet excludes by -E. So the row was green about a suite nobody runs
while the rows that DO run were unwatched -- measured on llama.cpp#454, which un-pads one
row in the suite the check never opened.
Now every suite that carries a split expectation is checked, each failure names the file, and
`cannot tell` still means "no suite on disk" rather than "the one file I looked at was absent".
Arms: the existing ones keep working (the failure side stays `fixture`, the file moved into the
message), and the one that decides this: un-pad only `tests/test-hrx-ops.cpp`, leave
`hrx-ops-test.cpp` intact -> the old version answered 0, this one answers 1 naming the file.
PR Reviewer Guide 🔍(Review updated until commit 6d94504)Here are some key observations to aid the review process:
|
|
VERDICT at Premise confirmed independently at the pin ( The zero is the whole issue: the check's own invariant could not have been satisfied by the file it read. The new behaviour reproduces (out-of-tree arm): mutating the padded expression in Right file named, right side named, the other suite untouched. Unmodified pin: The measured hole — one carrier absent and the other without a split expectation is a PASS: In The self-test has no arm for the new file. Minor: the two names are one transposition apart and the tuple is the only place they meet — Draft is the right state (engine is at the three-non-draft cap) and it should not be flipped until the first item is decided. |
|
VERDICT at My miss, again in the same shapeI reviewed #2929 at 09:2xZ and wrote that the new row "asserts the invariant rather than merely running a tool that checks part of it". I never asked which file it read. It read That is the same failure as the The evidence, and I verified it survives the pin moveThe PR measured on Line counts identical, padding-symbol counts identical. Worth saying in the body, because a reviewer's first question about a count is always "on which pin?", and the honest answer here is "the previous one, and it still holds". The fix keeps both, which is the right choiceAdding the suite a device run quotes rather than replacing the old path means either suite drifting is a finding — and the old path is not worthless: it is a second carrier with its own One askPut the reason for two files in the check's own header, not only in the PR body: one suite is what a device run quotes, the other is what the CI row edits, and the invariant has to hold in both because a row counts only if it runs. Otherwise the next reader sees a tuple of two paths and "simplifies" it back to one — which is precisely how this defect arrived. Nothing elseBoth carriers read, the original kept, the numbers carried with their pin, and a correction to a row that shipped this morning. The class here is worth naming for the third time today: a check can be honest, correct, and pointed at the wrong file — and only asking what it reads finds that. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at f85b195: READY
The measurement in the comment is the whole argument, and it is a hard one to argue with:
"Reading only the first left the rows that actually run unwatched (measured 11-20:
hrx-ops-testsplit=17 padding-hits=2,test-hrx-opssplit=45 kPaddedKeyValueCapacity=4 -- and #454 un-pads a row in the second with this row still green)."
Two suites, different files, different counts — and the one the checker was not reading is the one whose rows the ratchet actually executes (hrx-ops-test is excluded by -E, as #3004's body says). A check that reads the copy nobody runs is the same shape as a skip: green, and about the wrong file.
What I like beyond the fix
- the reason the two files differ is stated — devs quote
test-hrx-ops, #448/#454 edit it,hrx-ops-testis the second copy — so the next reader knows whyTEST_PATHSis a tuple rather than a constant; - the counter-example is named: #454 un-pads a row in the second suite while this row stayed green. That is the evidence that the old checker was blind rather than merely narrower, and it is the sentence I would keep if the comment had to be one line;
- the live check still passes across both (
every decode-split expectation has the padded fixture and the storage guard, rc 0), so the widened read does not turn into a wall of pre-existing findings — worth knowing, since a widening that fails everything is usually a widening that measured the wrong thing.
One ask, the same shape I made on #2943 and #2948: with two paths now, is there an arm that fails if a third suite file appears carrying a split expectation and is not added to TEST_PATHS? The pattern-based version (any tests/*hrx*.cpp containing split) would make the widening self-maintaining; a literal tuple depends on the next author remembering. If the literal is deliberate (only these two are real suites), say so and this is done.
Not verified: #454's own edit passing or failing against the widened checker — that is #454's row to prove, and the two PRs are complementary rather than overlapping (this one reads, that one edits the fixture).
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
The defect is real and this is the right shape of fix: the check read tests/hrx-ops-test.cpp only, while the suite that device runs quote — and that #448/#454 edit — is tests/test-hrx-ops.cpp. A ratchet that watches the copy nobody runs is worse than no ratchet, because it reports green.
What I checked rather than took on trust:
- The
carriersrefactor preserves every previous verdict. One file read → all carriers read;no <file>per missing file; the vacuous case (file exists, noSPLITanywhere) still returns[], Nonerather than a failure; a missing file alongside a present one no longer poisons the result. The three-way distinction this file already drew (failure / cannot-tell / vacuous) is intact, which matters because collapsing cannot-tell into pass is how a check stops checking. - The failure text now names the file (
f"{rel}: the test expects the split kernel…") — with two carriers, an unlabelled failure would be ambiguous exactly when someone is debugging at 3 a.m. - The dispatch-side guard stayed a single global check and stays
all(), notany()— the comment records thatany()once passed a matcher that had dropped one of the two guards, which is the kind of regression this whole file exists to catch. - The stated measurement is the right kind of evidence:
hrx-ops-test split=17 padding-hits=2versustest-hrx-ops split=45 kPaddedKeyValueCapacity=4, i.e. the two suites genuinely differ and the unwatched one is the weaker, plus the concrete proof — #454 un-pads a row in the second suite while this row stayed green. That is a demonstration, not an assertion.
Nit, take or leave: TEST_PATHS is a tuple whose first element is TEST_PATH, which is then still referenced nowhere else — one of the two names is now redundant, and keeping both invites someone editing TEST_PATH and wondering why nothing changes. Minor enough not to hold the PR.
Not checked: I did not run the check against the pre-#454 tree myself, so the "stayed green" claim rests on the PR's own measurement.
…sion (engine#2870)
The review asked for the tuple to stop being the blind spot: a THIRD `tests/*hrx*.cpp` carrying a split
expectation would have been unwatched exactly the way the rows that run were. Two files is not a shape.
The first attempt was a glob: check every `tests/*hrx*.cpp`, judge each by the fixture rule. The live tree
answered red, and correctly -- `hrx-loom-jit-test.cpp` names the kernel because the LoomJIT export/reuse
cases hand it their own workload (`flash_attention_decode_workload`); padding the capacity is not its
invariant. A glob that decides for you is the same failure with a new author, so the discovery reports what
it cannot decide:
* a file that names the split kernel and is neither a reviewed suite nor listed -> FAILURE `unreviewed`
naming the file, with the two ways out written in the message (pin it; or list it as naming the kernel
without running the fixture);
* a listed file that stops naming the kernel -> FAILURE too, because an exemption that outlived its
field is indistinguishable from a reviewed file.
And the discovery found a real one on the pin: `tests/hrx-backend-test.cpp` (4 padding hits, the split
dispatch assertions and the `decode.key_value_token_capacity` compile parameter). It satisfies the rule, so
it is pinned -- three suites now, not two.
Arms (self-test, device-free, no checkout): a third *hrx* suite that pads nothing is `unreviewed` naming
the file; a stale exemption fails; the three pinned suites plus the two listed LoomJIT files are clean.
`--self-test` -> self-test ok; `--check --root third_party/llama.cpp` on the pin -> "every decode-split
expectation has the padded fixture and the storage guard", rc 0.
|
Withdrawing my CHANGES at What I got wrong. I deleted Four states measured at And the head goes past my asks in the right direction. Replacing the hand-written tuple with discovery + named exemptions is the fix for the class (a fourth suite cannot slip in silently), the stale-exemption arm is the half nobody remembers (an exemption that outlived its field looks identical to a reviewed file), and the discovery immediately earned its place by finding Two small things, neither blocking:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 6d94504: READY
I ran the tool against real fork checkouts rather than against its fixtures: green at the new pin and green at the old one, self-test 20 arms ok, and the measurements in the description are the numbers the files actually carry.
The live run, both pins
$ python3 tools/ci/fa_split_expectation_check.py --check --root <fork tree>
check(47c95e15c) -> ([], None) carriers: hrx-ops-test.cpp, test-hrx-ops.cpp, hrx-backend-test.cpp missing: [] unreviewed: []
check(d79524deb) -> ([], None) same three carriers
The second matters because engine main is at d79524deb: the row is green on main today, and stays green through #3015's bump to 47c95e15c. --self-test: all arms ok, including the three this PR adds (a third *hrx* suite is a unreviewed FAILURE naming the file; an exemption that stopped naming the kernel is a FAILURE; the live tuple plus the two LoomJIT exemptions is clean).
The registration already passes the right root — --root ${CMAKE_SOURCE_DIR}/third_party/llama.cpp (CMakeLists.txt:1583) — so the glob and TEST_PATHS are resolved fork-side, which is what my fixture reproduced.
The description's numbers, re-counted on the files
| file | claimed | counted |
|---|---|---|
tests/hrx-ops-test.cpp |
split=17, padding-hits=2, 9798 lines | 17 × decode_split, 2 × padding pattern, 9798 lines |
tests/test-hrx-ops.cpp |
split=45, kPaddedKeyValueCapacity=4, 6855 lines | 44 × decode_split at 47c95e15c, 6860 lines (45/6855 is the 4eb3f08f9 figure — #454 removed one mention and 5 lines, as expected) |
tests/hrx-backend-test.cpp |
"4 hits" | 4 × key_value_capacity |
So the "the row read the wrong file" claim is true as stated: hrx-ops-test carries the expectation but no padded capacity at all (0 kPaddedKeyValueCapacity), and the suite the device runs quotes is the other file. That is the same split I found reviewing #454, from the other side.
One latent gap, not a blocker
suites() records a pinned suite it cannot read in missing, but check() only turns that into cannot tell when all three are missing (if len(missing) == len(TEST_PATHS)). With two carriers clean and the third absent the row answers green, i.e. a tree missing one pinned suite is read as a pass — the same "absence read as success" class as the finding this PR is about. It cannot fire in CI (the fork checkout is complete) and no current tree removes a file, so it is a follow-up rather than a reason to hold: reporting missing as cannot tell whenever it is non-empty is a two-line change.
A note for the next lane that adds a fork test file: because unreviewed fires on every tests/*hrx*.cpp that names the split kernel, a new suite reddens this row until it is added to TEST_PATHS (with the padded fixture) or to NAMES_WITHOUT_FIXTURE (with the reason). That is the intended forcing function, and the message states both ways out — worth one line in docs/ci-checks.md so the red is not a mystery to whoever hits it.
|
Persistent review updated to latest commit 6d94504 |
The row I landed in #2929 watches the wrong file — found while reviewing llama.cpp#454, which un-pads one row in the suite this check never opens.
Measured in the pinned fork (
4eb3f08f9):test-hrx-opsis the suite the device run reports on and the one #448/#454 edit;hrx-ops-testis a second copy of the rows that the fork ratchet excludes by-E. Sorc 0was true and about a suite nobody runs, while the rows that do run were unwatched.What changes: every suite carrying a split expectation is checked, each failure names its file, and
cannot tellstill means "no suite on disk" rather than "the one file I opened was absent".The arm that decides it — un-pad only
tests/test-hrx-ops.cpp, leavehrx-ops-test.cppintact:Existing arms keep working (the failure side stays
fixture; the file name moved into the message), and on the real fork tree both suites are padded today, so the row still answersrc 0there.Draft on purpose: engine is at the three-non-draft cap. Flip when a slot frees — this is one file and it makes an existing row do what its name says.
Closes nothing on its own; it advances #2870, whose row this is.
Second pass (
6d94504c), after the review asked what stops a THIRD suite from being unwatched. The tuple was the blind spot in a new place, so the discovery now looks at everytests/*hrx*.cpp— but a glob that judges them all by the fixture rule answered red on the live tree, and correctly:hrx-loom-jit-test.cppnames the kernel because the LoomJIT export/reuse cases hand it their own workload (flash_attention_decode_workload), and padding the capacity is not its invariant. A glob that decides for you is the same failure with a new author, so the check reports what it cannot decide:unreviewed, naming the file and both ways out (pin it as a carrier, or list it as naming the kernel without running the fixture);It found one on the pin, so the set grew:
tests/hrx-backend-test.cpp(4 padding hits; it asserts the split dispatch and thedecode.key_value_token_capacitycompile parameter). It satisfies the rule, so it is pinned — three suites, not two.Arms: 10 in
--self-test(a third*hrx*suite isunreviewednaming the file; a stale exemption fails; the pinned three plus the two listed LoomJIT files are clean); and on the pin--check --root third_party/llama.cpp→fa-split-expectation: every decode-split expectation has the padded fixture and the storage guard, rc 0.