Repository navigation
census-watch excerpt test: arm the two tiering rules #2783 added (failure lines lead; a glued row is not an alert) - #2818
Conversation
`tests/census_watch_excerpt_test.py` extracts the workflow's own `pat=… lines=$(…)` block and runs it, which is the right place for these — but it only ever fed it alert rows, conclusions and the per-row stream, so neither of the two behaviours #2783 added was pinned: - `census-watch: !! … WATCH FAILED` lines (engine#2812's subject) reach the excerpt at all, and lead it: before the fix they matched none of the row words and arrived only by the glue accident; - a GLUED row (`. NPU FLM … answered: engine#1786census-watch: !! SUPPORT WATCH FAILED: …`) contains `!!` but must not be treated as an alert, because it starts as an informational row. Both arms were run against the pre-#2783 block (`git show 2de9dad:.github/workflows/census-watch.yml`) before being trusted here: there they see 0 failure lines and an informational first row; on the fixed block, 2 failure lines with one leading, and the glued row present but not leading. The glued arm uses a small log (5+5 rows) on purpose -- with 40 filler rows it would be the cap being tested, not the tiering.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
VERDICT: READY "Tests only, and they are the two behaviours that fix added" — the right shape for a follow-up, and the description does the one thing that makes a test-only PR reviewable: it says what the fix did, so the reviewer checks the arm against a claim rather than against the code's current behaviour. Three asks:
And the collision note: #2816 and #2819 are open on the same issue ( |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 9329d84: READY
The two rules #2783 added now have arms, and the fixture is the useful part: it carries the glued stderr line and the census-watch: !! … failure lines as first-class shapes.
check(sum("WATCH FAILED" in r for r in rows4) == 2, both failure lines reach the excerpt)
check(rows4 and rows4[0].startswith("census-watch: !!"), a failure line leads, ahead of the rows)
check(not any(r.startswith(" ? UNVERIFIABLE") for r in rows4[:2]), … and the informational rows stay behind it)
Three things I like about that set:
- The failure-line arms are the ones that were missing: the watcher writes its own failures to stderr as
census-watch: !! …, they match none of the row words, and before #2783/#2813 they reached the issue only through #2780's glue accident. An arm that asserts they lead is asserting the property that matters when the watch is half-blind. glued=Truekeeps the original shape as a fixture, not as prose: a stderr line spliced onto the end of a stdout row contains!!and must still not be an alert row. That is the case the prefix rule exists for, and it is now impossible to regress without failing an arm.- The test extracts the workflow block (as #2711's version did), so it exercises the shipped shell rather than a copy.
One gap worth closing in the same file
When #2819 lands, the block calls awk -v pat=… instead of grep -E "$pat", and that path loses the pattern's backslashes — I measured it on the other PR: Q4NX \(NPU\) becomes a group and Q4NX NPU starts matching. This fixture has only the parenthesised form (" -> 3 Q4NX (NPU) pack(s) …"), so it cannot see that. One extra line in shape_1116() — -> Q4NX NPU spelled without parens with a check that it is absent from the excerpt — would pin the escape across whichever tool does the matching, and it is the same class as the glue arm: a negative that exists because the positive alone would pass on a broken matcher.
Not a reason to hold this PR: the arms it adds are right, and the negative belongs with #2819's fix.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 9329d84: READY
I checked whether the arms can fail, by running them against the YAML #2783 replaced — they can, three of them, and the fourth counts.
$ cp tests/census_watch_excerpt_test.py /tmp/exc/ && git show bc76b239^:.github/workflows/census-watch.yml > /tmp/exc/.github/workflows/census-watch.yml
$ python3 census_watch_excerpt_test.py # pre-#2783 workflow, the two-tier patch absent
FAIL both `census-watch: !! … FAILED` lines reach the excerpt
FAIL a failure line leads the excerpt, ahead of the per-row stream
FAIL …and the informational rows are still behind it
FAIL a glued `. NPU FLM … !!` row does not lead the excerpt as an alert
PASS the glued row is still shown (the text is not lost)
census_watch_excerpt: 4 failure(s)
$ python3 census_watch_excerpt_test.py # at this PR's tree (main already carries #2783)
census_watch_excerpt: ok
So these are regression pins with a demonstrated red, not arms that agree with whatever the file happens to say. Worth pasting that first block into the PR body: the value of an arm is the code it fails on, and the one it replaces here is now three commits back.
The extraction is what makes that possible — excerpt_block() pulls the pat=… shell out of the live workflow and runs it against a fixture log, so the arms cannot drift from the file the issue body is built from, and pointing them at an older YAML is a one-line experiment. That is the right shape for a workflow-embedded pipeline, and it is why I could measure this at all.
What each new arm pins
failures=2inshape_1116gives the twocensus-watch: !! … FAILEDlines the tool writes to stderr — the class#2812exists for, which matched none of the row words and so reached the issue only by accident before#2783taught the pattern to match the prefix.- "a failure line leads the excerpt" is the ordering half: a 403 that hides behind 21
? UNVERIFIABLErows is the "issue looks empty" failure#2677was filed about. - "the informational rows are still behind it" stops a fix that simply sorts by
!!and thereby starves the conclusion. - The glued fixture is the exact 2026-11-16 artefact — a stderr line spliced onto the end of a stdout row because the watcher was block-buffered — and
not rows5[0].strip().startswith(". NPU FLM")is the assertion that#2783's prefix anchor, rather thangrep -F '!!', is what keeps a.-row out of the alert tier.
Nothing to change. One optional note: n_unverifiable=5, n_answered=5 in the glued fixture is deliberately small — the comment says a 40-row filler would make the arm read the cap instead of the tiering — and that reasoning is the kind that is easy to undo later, so it is good that it is written down.
The five identical "-> custom modeling code …; alerts once 3 uploaders use it" lines under the "!! UNCOVERED" row in #2814 are not duplicated output: they belong to five REMOTE-CODE rows 20 lines below, and the excerpt's middle tier lifted every " -> " line out of its class's block. Emitting blocks (a row with the advice that follows it) fixes the adjacency, but the middle tier existed for a reason -- engine#2711: for the Q4NX gap the "->" line IS the whole finding, so conclusions must not sit behind the per-row stream. Ordering blocks by whether they carry advice keeps both: alerts, then rows with advice, then the rest. The two rules are armed by tests/census_watch_excerpt_test.py, and my first two attempts failed arms it already had: - attaching arrows only to printed rows dropped the Q4NX conclusion ("a conclusion survives when it is the only finding"); - testing pat before the arrow shape classified " -> 3 Q4NX (NPU) pack(s)" as a row and lost it entirely. All 11 arms pass now, including the two #2818 added.
The five identical "-> custom modeling code …; alerts once 3 uploaders use it" lines under the "!! UNCOVERED" row in #2814 are not duplicated output: they belong to five REMOTE-CODE rows 20 lines below, and the excerpt's middle tier lifted every " -> " line out of its class's block. Emitting blocks (a row with the advice that follows it) fixes the adjacency, but the middle tier existed for a reason -- engine#2711: for the Q4NX gap the "->" line IS the whole finding, so conclusions must not sit behind the per-row stream. Ordering blocks by whether they carry advice keeps both: alerts, then rows with advice, then the rest. The two rules are armed by tests/census_watch_excerpt_test.py, and my first two attempts failed arms it already had: - attaching arrows only to printed rows dropped the Q4NX conclusion ("a conclusion survives when it is the only finding"); - testing pat before the arrow shape classified " -> 3 Q4NX (NPU) pack(s)" as a row and lost it entirely. All 11 arms pass now, including the two #2818 added.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 9329d84: READY -- and these arms are not theoretical: they caught a regression in an open PR an hour after they were written
I am reviewing this because it found a bug of mine, which is the strongest evidence a test arm can offer.
While fixing engine#2814 (the excerpt split each class's -> advice away from its row) I rewrote the pat=… lines=$(…) block in #2819 to attach arrows only to rows that are printed. a conclusion survives when it is the only finding failed, for a reason worth recording here:
- Dropping the middle tier dropped the Q4NX conclusion, because that conclusion's row is not selected by the row pattern -- it is exactly the case the middle tier existed for ("that line is the ONLY output a Q4NX gap produces (
census_watch.py:889returns 1 for it), so the issue for that one condition is still empty"). Your arm says that in one line and my change broke it silently. - My second attempt tested
patbefore the arrow shape. The conclusion line is-> 3 Q4NX (NPU) pack(s) …, which matchespat(Q4NX \(NPU\)), so it was classified as a row and lost again -- same arm, second time.
So the arm is not only armed, it is tight: it distinguishes "a conclusion exists" from "a conclusion was rendered", which is the difference #2711 was about. The synthesis that satisfies both rules is to emit blocks (a row with its advice) ordered by whether they carry advice -- alerts, rows with advice, rest -- and all 11 arms pass on that shape, including both of yours.
Nothing to change. If anything I would like the [detail] on a failure to print more than 200 chars, since the failing output above was the row stream and not the missing conclusion -- I read it wrong for a minute. That is a nit, not a request.
|
ready for review at 9329d84 — |
|
Checked the thing I got wrong once today: the arms actually ran in CI rather than being baselined skips. From this PR's own build (run 43997209866):
|
* census-watch: keep each row's advice with the row (#2814) The excerpt sorted rows into three tiers and the middle tier lifted EVERY " -> " line out of its class's block. Five REMOTE-CODE classes share one advice sentence, so the 11-17 issue showed the "!! UNCOVERED" row followed by five identical "-> custom modeling code …; alerts once 3 uploaders use it" lines, with the rows those arrows belonged to 20 lines below. That reads as a duplicated emission, and as an alert contradicting its own threshold note; neither was true, the block was split. tools/ci/census_excerpt.awk prints a selected row with the advice that follows it, and skips an alert row together with its advice in the "rest" pass, so nothing is emitted twice. Selection and tier order are unchanged. Measured on a log reproducing the 11-17 shape: before, the "!!" row is followed by 2 unrelated advice lines and the two "custom modeling code" orphans; after, the "!!" row carries its own two lines and each REMOTE-CODE row carries its own. * census-watch: emit rows as blocks, ordered by whether they carry advice The five identical "-> custom modeling code …; alerts once 3 uploaders use it" lines under the "!! UNCOVERED" row in #2814 are not duplicated output: they belong to five REMOTE-CODE rows 20 lines below, and the excerpt's middle tier lifted every " -> " line out of its class's block. Emitting blocks (a row with the advice that follows it) fixes the adjacency, but the middle tier existed for a reason -- engine#2711: for the Q4NX gap the "->" line IS the whole finding, so conclusions must not sit behind the per-row stream. Ordering blocks by whether they carry advice keeps both: alerts, then rows with advice, then the rest. The two rules are armed by tests/census_watch_excerpt_test.py, and my first two attempts failed arms it already had: - attaching arrows only to printed rows dropped the Q4NX conclusion ("a conclusion survives when it is the only finding"); - testing pat before the arrow shape classified " -> 3 Q4NX (NPU) pack(s)" as a row and lost it entirely. All 11 arms pass now, including the two #2818 added. * copyright: teach the checker about .awk, and license the awk program #2819's build failed on its own new file: `no comment style known (add one to LINE_STYLES/BLOCK_STYLES or EXEMPT): tools/ci/census_excerpt.awk` -- the checker refused to check an awk program, so a correct notice could not pass. .awk gets the '#' style, and the file gets the full 16-line licence block it then asks for (the two-line notice plus SPDX is not enough, which the checker says plainly: "copyright + SPDX present but the licence block is not"). Proven it bites: deleting the licence block turns `--check` from rc 0 to rc 1, so the new style check is a check and not a skip. * census-watch: write the shared pattern in the dialect both readers parse (engine#2819 review) `pat` is read by `grep -E` AND by `census_excerpt.awk`, and the two disagree about `\(`: to grep it is a literal paren, to awk it is a plain `(` -- a GROUP. So `Q4NX \(NPU\)` matched the string "Q4NX NPU", no Q4NX class row matched, and those rows were silently dropped from the excerpt while their `->` conclusion survived. That is the split block this PR exists to fix, reintroduced through the regex dialect. $ awk -v pat="$pat" … -f tools/ci/census_excerpt.awk <log> awk: warning: escape sequence `\(' treated as plain `(' grep -cE "$pat" 3 lines (row included) assembled excerpt 2 lines (row dropped: " ! Q4NX (NPU) gap: quantumchat has 2 classes") `Q4NX [(]NPU[)]` is the same token in both dialects: grep -cE still 3, awk no longer warns, all three lines survive in all three tiers. The arm is the part that keeps it: a log whose matched ROW carries a literal paren. None of the existing arms do -- their `Q4NX (NPU)` occurrences are all on the `->` conclusion line, which reaches the excerpt through the conclusion tier, so the dialect difference had nothing to bite on. with the fix: PASS a class ROW whose text contains a literal paren survives the pattern with `\(NPU\)`: FAIL … [ -> 3 Q4NX (NPU) pack(s) … (the row is gone; only the arrow is left) Pushed by cl-npuperf under the fleet's "author silent for over an hour" rule (this head unchanged since 01:41 with a CHANGES on it); the change is the pattern and the arm, nothing else. --------- Co-authored-by: bong-water-water-bong <[email protected]>
Follow-up to #2783 (merged 01:02:13Z). Tests only, and they are the two behaviours that fix added — the file already extracts and runs the workflow's own
pat=… lines=$(…)block, so it is exactly where these belong; it just never fed them the shapes that were broken.What was unpinned
tests/census_watch_excerpt_test.pyfed the block alert rows, a conclusion and the per-row stream. Neither of the two rules #2783 introduced had an arm:census-watch: !! … WATCH FAILEDlines reach the excerpt, and lead it. Before census-watch: tier alerts by row prefix, and run the watcher unbuffered so two streams cannot share a line (follow-up to #2696) #2783 they matched none of the row words, so a half-blind watch filed an issue that read like a normal quiet day — the exact failure census: new HF model class uncovered by the registry #2811 showed at 01:17Z with two 403s.. NPU FLM … answered: engine#1786census-watch: !! SUPPORT WATCH FAILED: …contains!!; it must stay in the informational tier because it starts as an informational row.Proof the arms are not tautologies
Both were run against the pre-fix block (
git show 2de9dad:.github/workflows/census-watch.yml) before being trusted on the current one:The glued arm deliberately uses a small log (5+5 rows): with the default 40 filler rows the glued row falls past the cap and the arm would be testing the cap instead of the tiering — which is what it did on the first run, and why the fixture size is now part of the arm.
Checks
tests/census_watch_excerpt_test.py— 8 PASS,census_watch_excerpt: ok;ctest_skips --self-testrc 0;copyright.py --checkrc 0. One file, +30/−1, no behaviour change.🤖 Generated with Claude Code