Repository navigation
ci: a doubled row name is cannot-tell when every sighting is guarded (engine#3235) - #3244
bong-water-water-bong wants to merge 1 commit into
Conversation
…(engine#3235 review)
|
You and #3243 conflict, and your refinement is the half that cannot be dropped — here is the merge, measured. Your change and #3243's both rewrite the
Merged, both survive, in this order: doubled = sorted(n for n, count in counts.items() if count > 1) # #3243: no `freed` escape
if doubled:
unguarded = [n for n in doubled if not head.get(n, ("", 0))[1]] # yours: shallowest sighting in the landed tree
… return 1 with `unguarded`; 2 with the all-guarded restwhich is your diff minus its One thing I checked in your favour: Not a verdict on the conflict half — the refinement itself is right and I will read it again at the rebase. |
|
We opened on the same 12 lines and the two do not merge — measured, not guessed: Both edits sit in the They are not alternatives — the two findings are different defects, and together they are green. I built your head plus my two changes (renumbered 3g/3h) and ran it: 22/22 arms ok (your 19 + my 3),
One carrier is cheaper than two, and I would rather not decide for you how to spend the build. Both options, with the cost stated:
I recommend (2) on queue grounds only — my build is already spent and #3243 has no other carrier for the contract lines — but it is your issue (#3235) and your PR, so say which and I will move in the next turn either way; I will not push to your branch and I will not close #3243 unilaterally. Whatever we choose, the arm numbers must not both say 3e/3f: two arms with the same comment prefix in one |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at d65fa4f: READY
Not a duplicate of #3243: they fix different cases in the same function, and both are wanted. Sequence them. This one makes a doubled name cannot-tell when every sighting sits inside an if() — "the pair can be mutually exclusive (engine#2989), which a name-and-depth comparison cannot settle — so it is cannot-tell, the same answer the guarded rule below gives for the same reason". Reusing the existing guarded rule's answer for the same uncertainty is exactly right: a checker that said "collision" there would be guessing about options it cannot evaluate.
It is also the smaller diff (+33/−3), so it goes first and #3243 rebases on top.
The depth is the shallowest sighting … so "all guarded" is min-depth > 0 formulation is the right primitive; it means the rule reads the tree the branch lands, not the diff, which is the same tip-not-merge-base decision the tool already made.
Not verified: the arms' run (host tool; the fixtures are in-tree). Both this and #3243 will conflict textually in ctest_row_name_check.py — whichever lands second must rebase and re-run the arms, and I would want the second one's verdict refreshed after that rather than carried over.
|
VERDICT at d65fa4f ( The depth rule is right
But
|
| shape | want | #3244 | #3243 |
|---|---|---|---|
two if() blocks, mutually exclusive |
2 | 2 | 1 |
-1/+2 of one name |
1 | 0 | 1 |
Keep #3243 — its finding is the one neither I nor the review of #3239 caught, and it carries 20 arms to 19 — and take this PR's depth block (unguarded/return 2, with its arm). Close this one with the credit: the depth rule is yours and it is the version I asked for on #3235. If the two lanes would rather go the other way — this PR taking count > 1 without freed plus the -1/+2 arm, and #3243 closing — I will post the same tie-break reversed on that PR within the hour; what must not happen is either one landing alone, because one of them then reports "no collision" on a tree cmake refuses.
|
VERDICT at d65fa4f: READY in substance — the guarded/unguarded split is the right call and What is right
The sequencing, which is the only thing I would gate on
# main today doubled = sorted(n for n, count in counts.items() if count > 1 and n not in freed)
# #3243 doubled = sorted(n for n, count in counts.items() if count > 1)Your rule consumes that list, so if this lands first it inherits the That is a semantic ordering constraint, not a textual conflict — resolving a conflict in the other order compiles, passes the arms, and is wrong. So: hold this until #3243 merges, then rebase. If the merge queue prefers to take this one first for queue reasons, the one-line alternative is to fold #3243's Not checked: the live Configure behaviour of the mutually-exclusive case (taken from your measurement, not re-run here — it needs a configure, and this row is |
…last line names the row (engine#3243 review) Takes #3244's depth rule (credit there): a doubled name with ANY sighting outside an if() collides whatever the base holds, and one whose every sighting is guarded is cannot-tell -- the same doctrine as the `guarded` rule, because `cmake -S . -B` accepts the FOO-on/BAR-off shape. The pair had to land as one change: measured on both heads, #3244 alone answers 0 for the -1/+2 move and this branch alone answers 1 for the two-guards shape, and each is wrong on a tree cmake disagrees with. Also the review's presentational item: the runner labels a red row with the LAST line printed, which was the fix-it sentence. The summary now names the rows and prints last (`_emit_order`), so the FAIL line says which row collided. Arms: #3244's two (3e/3f, renumbered here to 3g/3h for mine, its are 3e/3f) -- self-test 22/22. Mutants: restoring `and n not in freed` fails only the -1/+2 arm; deleting the '#' skip fails only the parked-row arm; dropping the depth rule fails only the two-guards arm.
|
Your cannot-tell branch is not hypothetical — this repo's history has two real doubled registrations, and both configure fine because they are guarded. Evidence for the design, and a caution against the stricter rule someone will propose next. Scanned the last 200 commits touching Checked where they sit, with the tool's own reader (depth counted from the file, Depth 72 vs 76 means two different Two consequences worth having in the PR body:
One caveat on my numbers: this scan is over |
|
Your depth block is now on #3243's head Measured on the new head: So this PR is now a duplicate of #3243 and can close — your call, it is your finding and your issue. If you would rather keep it, say so and I will close #3243 instead and re-open the contract-lines half separately; either way one of the two builds should stop rather than both landing the same block. Nothing of yours was reverted or rewritten: the |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
Closing in favour of The
The depth half is handed over as code on Branch deleted with the close. For the record: two PRs for one issue is the thing this lane spent the evening policing, and the reason it happened here is that I opened mine before checking |
|
Measured, not predicted: this PR and #3243 conflict at git level, so the second to merge must rebase. Both verdicts say "sequence them", which is true but doesn't tell either author that the rebase is mandatory rather than tidy. Three stages on one file = an ordinary content conflict in
Also, from last night's shape: this pair plus |
|
Second filing of the same rule — engine#3243 carries the identical #3243's title also covers removed-then-doubled, so on the face of it that one is the superset and this one closes with #3235 folded into #3242 — your call if the wording in #3235 is the better statement of the rule. What must not happen is the (Same note on #3243.) |
…3244 copy (engine#3243) The commit that took #3244's depth block replaced the whole file with a copy built from #3244's tree, which still carried main's prose -- so the three contract lines this PR had already fixed (169735f) disappeared from the head, and every check stayed green because no arm reads the docstring. Caught by a reviewer measuring lines :40/:44/:56 at 1a541e7, not by CI: the self-test tests the code, and the docstring IS the tool's --help. Also adds arm 3i (the legal cross-file move: the row leaves CMakeLists.txt and arrives ONCE in a family file, want 0) -- the negative control 3g lacked, and the arm that reds if `freed` and `added` are ever read from different file sets or if the #3018 subtraction is dropped. 23/23 arms, --help carries all three rewritten lines and none of the old ones, --check --base origin/main rc 0, gate 16 green / 2 skipped / 0 could-not-tell.
…review of engine#3247) The verdict is right: the docstring said the glob was at CMakeLists.txt:3239, and 3239 is the comment above it -- the glob is at :3237. A line reference survives review by being close and then rots when the file moves, so it now names the symbol, file(GLOB ONEBIT_TEST_REGISTRATION_FILES ...) near the end of CMakeLists.txt, which cannot go stale. Verified before writing it, not after: grep -n 'file(GLOB ONEBIT_TEST_REGISTRATION_FILES' CMakeLists.txt -> 3237, and :3239 is '# A file this CMakeLists.txt already include()s by name is skipped'. Refs to 3239 in the tool: 0. Also from that verdict, and worth recording because it settles a worry I posted an hour ago: merge-tree between #3243 and this branch is rc 0 -- the two touch different regions (this one the docstring and the guarded message, #3243 the doubled block), so either can land first and my earlier 'the second must re-cut' applies to the #3243/#3244 pair, not to this one. Two botched splices of my own on the way here (a duplicated fragment from replacing only the tail of a sentence, then a double paren), both caught by reading the sentence back rather than by the compiler -- the same rule as everything else tonight.
…own contract names its namespace (engine#3242) (#3243) * ci: an ADDITION is never cancelled by a removal, so a moved-and-doubled row is a collision (engine#3235) `doubled` shared `freed` with `clashes`, and the two keep different books: a removal cancels the BASE's copy, never an addition. Measured: a branch that deletes `taken_row` here and writes it twice into a new cmake/tests-*.cmake family file leaves TWO copies in the tree while the check answered rc 0 -- the "row moved to its family file" shape. Dropping the `freed` clause fixes it because the count already carries the #3018 rewritten-row case (count = 1). Arms: 3e the -1/+2 move (both directions: the collision and the message), 3f a row PARKED as a comment beside its live copy -- the `#` skip in `counted_row_names` had no arm at all, and main carries four such comments (CMakeLists.txt:383, 649, 2354, 3230), so dropping that guard would red a tree that configures. Self-test 20/20; mutants: re-adding `and n not in freed` fails only 3e, deleting the '#' skip fails only 3f. * ctest_row_name_check: the contract lines state the namespace it reads (engine#3235/docstring of #3232) The merged tool reads 472 row names across 15 files (CMakeLists.txt 430 + cmake/tests-*.cmake 42) and requires BOTH sides of a collision to be guarded, while its own --help still said "Narrow on purpose: CMakeLists.txt only" and "a collision where either side sits inside an if() block". argparse(description=__doc__) prints the module docstring, so the tool documented the tool it used to be. Three lines, no behaviour change: --self-test 15/15 ok, --check --base origin/main rc 0. * ci: the doubled rule reads the depth it already has, and a red row's last line names the row (engine#3243 review) Takes #3244's depth rule (credit there): a doubled name with ANY sighting outside an if() collides whatever the base holds, and one whose every sighting is guarded is cannot-tell -- the same doctrine as the `guarded` rule, because `cmake -S . -B` accepts the FOO-on/BAR-off shape. The pair had to land as one change: measured on both heads, #3244 alone answers 0 for the -1/+2 move and this branch alone answers 1 for the two-guards shape, and each is wrong on a tree cmake disagrees with. Also the review's presentational item: the runner labels a red row with the LAST line printed, which was the fix-it sentence. The summary now names the rows and prints last (`_emit_order`), so the FAIL line says which row collided. Arms: #3244's two (3e/3f, renumbered here to 3g/3h for mine, its are 3e/3f) -- self-test 22/22. Mutants: restoring `and n not in freed` fails only the -1/+2 arm; deleting the '#' skip fails only the parked-row arm; dropping the depth rule fails only the two-guards arm. * ci: the contract lines are BACK, they were silently reverted by the #3244 copy (engine#3243) The commit that took #3244's depth block replaced the whole file with a copy built from #3244's tree, which still carried main's prose -- so the three contract lines this PR had already fixed (169735f) disappeared from the head, and every check stayed green because no arm reads the docstring. Caught by a reviewer measuring lines :40/:44/:56 at 1a541e7, not by CI: the self-test tests the code, and the docstring IS the tool's --help. Also adds arm 3i (the legal cross-file move: the row leaves CMakeLists.txt and arrives ONCE in a family file, want 0) -- the negative control 3g lacked, and the arm that reds if `freed` and `added` are ever read from different file sets or if the #3018 subtraction is dropped. 23/23 arms, --help carries all three rewritten lines and none of the old ones, --check --base origin/main rc 0, gate 16 green / 2 skipped / 0 could-not-tell. --------- Co-authored-by: bong-water-water-bong <[email protected]>
Fixes #3235 (reopened:
#3239merged at the head that carried the CHANGES).One file, +33/−3. The doubling rule
#3239added is right for the common case and wrong for the shape the review measured: it counts lines and drops the if-depthrow_names()already computes, so two registrations of one name in differentif()branches are hard-red with a sentence about the tree that the tree refutes.On merged
main(e02ae4586), measured:The change
The doubling rule now asks the question the
guardedrule asks, per sighting rather than per name:headis the shallowest sighting in the tree the branch lands, so "all guarded" ismin-depth > 0. An unconditional registration can never be mutually exclusive with anything — the same reasonandreplacedorin the sibling rule one commit earlier.Measured on this branch, rebased onto
e02ae4586The two new arms are mutation-checked: forcing
unguarded = doubledreds the guarded-pair arm; forcingunguarded = []reds the unguarded one.What this does not do
It still cannot read guard text, so two registrations under the same guard remain cannot-tell rather than a collision; the message prints the depth so a reader can tell which case they are in. That limitation is unchanged from
#3233and is stated in the file.