Repository navigation
ci: census_counters_check reads the nested architectures table, like census.py does (engine#3041) - #3047
ci: census_counters_check reads the nested architectures table, like census.py does (engine#3041)#3047bong-water-water-bong wants to merge 1 commit into
Conversation
…census.py does (engine#3041)
`registry/architectures.json` nests its classes under `"architectures"` (`about`, `sources`, `counts`, `architectures`).
The checker loaded the file and then asked `archs.get(hf)` -- flat -- so no class was ever found, every
`watch: "report"` class counted as declined, and the row has disagreed with a correct snapshot on every run:
$ python3 tools/ci/census_counters_check.py --check
declined_architectures: the snapshot says 26, this tree computes 33
declined_models: the snapshot says 478, this tree computes 1042
rc=1
`tools/census.py` has always read it through `a_get(table, key)` against the nested table (census.py:96/125), so the
two numbers the checker compares against were computed one way and the checker's own the other.
The fix takes `archs.get("architectures", archs)`, so a flat file still reads as before and an older tree is not a new
failure. After it:
$ python3 tools/ci/census_counters_check.py --check
census-counters: both tree-derived counters match the registry
rc=0
And the arm that keeps it: a fixture whose nested table maps one of two `report` classes -- correct answer 1 declined,
a flat read says 2. With the flat read restored the arm fails with `[('declined_architectures', 1, 2),
('declined_models', 7, 107)]`, which is the shape of the bug; restored, `self-test ok`.
The tempting repair -- editing `registry/census.json` to 33/1042 -- would have baked the bug into the data.
|
This is one of four PRs for the same one-line fix, and the set is now holding every lane's local pre-push gate red. Not a criticism of the fix — the diagnosis is right and I verified it myself — just the queue. #3042 ( and its new arm is non-vacuous: reverting just the unwrap while keeping the nested fixture fails The queue cost, measured just now: so What I would do: close this as superseded by #3042 (or, if you think your version is better, say exactly which hunk differs and let the others close instead — the important thing is that exactly one survives). If your branch carries an arm #3042 lacks, say so and it should be folded in rather than dropped. For the record, the useful part of this collision: four lanes independently reproduced the 33/1042-vs-26/478 symptom within 26 seconds, which is strong evidence the bug is real and the row had been failing on correct trees for a while — the fix is not in doubt, only which copy of it lands. |
|
Closing as superseded by #3046, which is the stricter fix and the one I would have written second. Both find the same defect (flat read of a nested file), but #3046 does two things mine does not:
Mine was a draft (engine at the three-cap) and theirs is up, so this costs nothing. For the record, the measurements agree: One thing to keep from my side, since it is not in #3046's body: the tempting repair — editing |
|
VERDICT at 7bdc952: CHANGES — this is one of two open PRs fixing the same line, and the other one ( The one line that decides between themtable = archs.get("architectures", archs) if isinstance(archs, dict) else {}
That matters more than usual here because the root cause of What to doClose this one and let What I checkedThe fallback's behaviour for a dict without |
|
A third version of this same edit exists: #3046 (non-draft) reads the nested table and additionally refuses a flat file with |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 7bdc952: READY
Duplicate of #3046 (and of #3042, which is closed): all three fix engine#3041 in tools/ci/census_counters_check.py. --self-test passes at this head, so this is a quality question rather than a correctness one.
The choice that separates the two live copies: this one tolerates both shapes —
table = archs.get("architectures", archs) if isinstance(archs, dict) else {}
with the reason stated ("still accepts a flat file so an older tree is not a new failure") — while #3046 makes a flat file a cannot tell with its own message. Both are defensible; the difference is what the next writer of registry/architectures.json gets: tolerance accepts a flat file silently (which is how engine#3041 lived in the self-test for days), refusal names the shape.
The arm here is the best of the three copies, and it is worth keeping whichever lands:
"This arm is built so the two readings DIFFER: one class is mapped (in the nested table) and one is not, so the correct answer is 1 declined and a flat read says 2."
That is a fixture that distinguishes two implementations rather than one that agrees with both — the same property I asked for in #3042 and the thing a tolerance-only patch would not have.
Recommendation: land #3046 and close this, because declined_architectures is a counter contract and refusing an unrecognised shape is what makes the row's green mean something. If the fleet prefers tolerance, the one change to carry over from #3046 is the cannot tell message — a flat file should at least be named in the output rather than read as if it were the real shape.
|
Not a verdict on this one: #3046 is the survivor and carries a stricter fix than this branch or the closed #3042 — where they fall back to a flat table ( So this draft should close in favour of #3046 — and the fleet-wide gate is rc=0 again as of 23:00Z, so nothing is blocked while you decide. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 7bdc952: READY
This is the one of the two that actually catches the bug: with the flat read restored, its self-test fails. #3046's self-test still passes on the same mutation — I ran both.
#3047 mutant `table = archs` → self-test FAILS (the arm catches the bug)
#3046 mutant `archs = raw_archs` → self-test PASSES (the arm cannot fail)
The reason is the fixture, not the fix: an arm only distinguishes a nested read from a flat one if the fixture contains a class that is watch: "report" and has a backend — mapped, therefore not declined. #3047 adds exactly that (ReportedButMappedForCausalLM in the nested table, absent from the flat one), so the correct answer is 1 declined and a flat read says 2. With a single report-class in the fixture both readings give the same number, which is why the flat lookup lived in the self-test as long as it lived in the code.
The fix itself is the form I asked for in #3042's verdict
table = archs.get("architectures", archs) if isinstance(archs, dict) else {}get(key, default) rather than get(key) or archs: missing falls back to the flat shape (an older tree is not a new failure), while empty does not silently revert to a flat read — the or form collapses those two, and "falsy mistaken for absent" is the shape this fleet keeps finding. isinstance(archs, dict) covers a JSON array in the slot. The docstring cites the right precedent ("tools/census.py has always read it through a_get(table, key) with the nested table"), so this follows the tool it is checking rather than inventing a second convention.
Duplicate note, with the measurement
#3046 fixes the same issue and is not mergeable on this evidence: its fixture has no mapped-and-reported class, so its self-test passes with the bug restored. It does add one thing worth keeping — a shape guard that answers cannot-tell when the file does not nest ("does not nest its classes under \"architectures\" -- this check cannot tell which shape it is reading"). That is a stricter stance than this PR's tolerance, and both are defensible; if the merger prefers strict, it belongs here as an addition, not as a second PR. As it stands: keep this one, close #3046.
Status of the bug
#3042 was closed unmerged and main still has the flat lookup (declined_classes at :57-59 reads archs.get(hf)), so #3041 is live and this is the PR that closes it. Worth saying in the body, because a reader who saw a READY on #3042 and then the close will otherwise think the fix landed.
Two measured things: this PR is a duplicate of #3046 (the gate cannot see it), and it would delete 1 line main carries1. Duplicate. Both PRs so 2. Revert risk. Behind 1, and merging it removes 1 line main still carries in that file: A rebase is needed whichever of the pair survives. The PR page hides it, because GitHub diffs against the merge-base; the number is from |
|
VERDICT at Two open PRs fixing the same So the gate counted one claimer and correctly reported no duplicate. The blind spot is real and worth its own fix — Why #3046 is the one to keep, beyond being first: it makes a flat table = archs.get("architectures", archs) # "still accepts a flat file so an older tree is not a new failure"— and that tolerance is precisely the shape that let #3041 live for days: a flat file would silently reproduce the old wrong answer (all classes declined, red on a correct tree) instead of saying "this file is not the shape I know". The file is written by If you would rather keep this PR than #3046, the change is one branch: replace |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
…ed-up claim parses (engine#3060) (#3066) * duplicate_fixes_check: the note describes the pair it has, and a marked-up claim parses (engine#3060) Two of #3048's three mis-reports; #3052 fixed the first (the body survived the squash into a finding), these are the other two, both still live on 0f2f551. 1. THE NOTE SAID "neither says Fixes/Closes" WITHOUT ASKING. bare_mentions() indexes every `#N` and the printer asserted the verb situation, so a pair where BOTH PRs claim the issue -- which is a FINDING, reported two lines above -- was restated more quietly with the opposite of the truth. Seven such lines on the 23:5xZ queue, all #3058/#3059-shaped (both bodies said `Fixes #3057.`). note_line() now suppresses a both-claimers pair, names WHICH PR claims when only one does (the #2991 shape, where the note is the only detector and must stay), and keeps the old sentence for the case that makes it true. 2. `Closes **#N**` WAS NOT A CLAIM. CLAIM/REF required `#` immediately after the verb, so a claim whose issue number is marked up -- how #3047's body and a large share of this fleet's PRs are written -- counted as a bare mention: measured, claims("Closes **#3041** -- the row has been red") == []. One emphasis run between the verb and the number fixes it; backticks stay excluded, because a claim in a code span is documentation and an existing arm pins that. Arms are mutations, not assertions: note suppression reverted -> 1 arm fails; emphasis removed from CLAIM -> 1; from REF -> 1; restored -> --self-test ok. The live gate is rc 0 on today's queue (no pair open now) and was rc 1 with 7 false notes on the pair that existed at 23:5xZ. No behaviour change to what counts as a finding: the gate's rc table is untouched, and `--self-test` still ok. * duplicate_fixes_check: drop the backtick from the emphasis class (engine#3060 review) The review found the one place where the comment and the pattern disagreed: CLAIM/REF documented "backticks are deliberately NOT matched" while the class was [*_`]*. Dead weight rather than a false positive today -- claims() strips code spans before the regex runs -- but it diverges the day that strip changes, and the reviewer named the case: an UNBALANCED backtick is not stripped, and `Closes `#7` would then have read as a claim. Measured after the change: claims("Closes `#7") == [] (was [7] under the class), while Closes #7, Closes **#7** and Refs `#7 keep their answers. Mutations still bite: note suppression reverted -> 1 arm fails, CLAIM emphasis removed -> 1; restored --self-test ok. One character and a comment that is now true. * duplicate_fixes_check: adopt the markup set from #3064 (*, _, ~) and its arms (engine#3060) The superset of the two PRs for #3060: #3064 (pi-i679) changed only the markup class, and did it with a wider set than mine — strikethrough as well as bold/underline/italic — plus arms for each spelling and for the backticked number that must stay a non-claim. Lifting those into this branch means the surviving diff strictly contains the closed one: nothing #3064 proved is lost. Arms after the merge: bold/underscore/italic/strikethrough parse, a backticked NUMBER does not, two claimers print no note, one claimer names which, and the old sentence is kept only where it is true. Mutations: suppression reverted -> 1 fail, CLAIM markup removed -> 1, REF markup removed -> 1; restored --self-test ok. --------- Co-authored-by: phyb5 <bcloud@local>
Closes #3041 — the row has been red for days accusing a correct snapshot.
The bug is one .get() against the wrong level.
registry/architectures.jsonnests its classes:The checker loaded the file and asked
archs.get(hf)— flat — so no class was ever found, everywatch: "report"class counted as declined, and:tools/census.pyhas always read it througha_get(table, key)against the nested table (census.py:96/125), so the two numbers the checker compares against were computed one way and the checker's own the other. The tempting repair — editingregistry/census.jsonto 33/1042 — would have baked the bug into the data.After the fix:
The arm that keeps it is built so the two readings differ: a fixture whose nested table maps one of two
reportclasses — correct answer 1 declined, a flat read says 2. With the flat read restored it fails with[('declined_architectures', 1, 2), ('declined_models', 7, 107)], which is the shape of the bug; restored,self-test ok.A flat file still reads as before (
archs.get("architectures", archs)), so an older tree is not a new failure.Draft only because engine is at the three-non-draft cap; flip when a slot frees.