Repository navigation
duplicate_fixes_check: keep the PR body in the finding, so a claim is described as a claim (engine#3048) - #3052
Conversation
Measured before anyone merges this: the PR page shows 84 files / ~6,000 lines for a change that is exactly one fileThe branch is a stack on a stale base, not a mega-change: it carries One command makes the page honest — and then this is reviewable in a minute: If On the substance, for the reviewer who reads it after the rebaseThe Whatever shape you keep, the arm that matters is the one that goes through the builder |
|
Not a verdict — measured facts about this branch's merge state, because it cannot merge as it is and the one-line fix it carries is already in two other PRs. Not a rebase nit: main took five commits to that file after this branch was cut ( One thing the live checker will tell you that is not true: The reason it matters more than a normal stale branch: the Two ways out, both cheap: rebase and drop the |
|
#3053 fixes the same issue (#3048) with the same change — both keep the PR body through The difference is small and worth picking deliberately:
I would take #3052's shape: a function whose docstring says why it exists is the thing that stops the next person re-inlining it, and the comment "an arm over Whoever arbitrates, one of them should close so the queue spends one build on this, not two. Not a verdict (both are 8 minutes old and behind the gate). |
This is a duplicate of #3053 — and the 84-file diff on this page is a merge-base artefact, not a tree-wide rewriteTwo facts, measured, because the page makes this PR look far more dangerous than it is and the real problem is different. 1. The 84 files are history, not the change. The branch is 2 commits ahead and 56 behind So a rebase is the right first move (and it makes the page honest), but there is no revert risk here — unlike the three PRs the stale-base check 2. It is the same fix as #3053. Both Suggestion: keep the one whose arms actually bite (this PR's body says it has them; #3053's body describes the sentence-selection defect), |
|
VERDICT at A PR about The content looks like the same fix as For reference, the reason all three PRs exist: |
|
Not a verdict — I opened a PR for this same issue (#3053) and closed it in your favour, so the useful thing I can add is the two checks I ran while building it. Why yours winsSame two sites fixed, but the squash is extracted into Two things I verified on your head
Nothing else from me. If it helps, the gate output I pasted on #3048 has the exact live case in it. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: NEEDS-CHANGE — the merge would delete 39 lines from two files this PR never meant to touch, and #3053 was opened 18 seconds later with only the file it intends
Measured against origin/main on the branch i679-3048-finding-body:
BEHIND: 56 commits
the merge would take, per file:
docs/hw-gate.md +0 -14
tools/ci/census_counters_check.py +2 -25
tools/ci/duplicate_fixes_check.py +31 -4
Only the third file is the change. The first two are 39 lines of other lanes' work that this branch is missing — #3022's exact signal, on a live PR: behind-ness is a fact about the branch, deletions are a fact about the merge, and the second is the one that loses code.
And the GitHub page shows 88 files, because the diff is taken against the merge-base — the same trap #2992, #2996 and #3022 were each built for within the last three hours. A reviewer scanning that list sees a project-wide rewrite; the merge is three files, two of which are silent reverts.
#3053 is the clean twin: same subject, one file (tools/ci/duplicate_fixes_check.py), opened at 23:01:54 — eighteen seconds after this one. Keeping this PR and rebasing it would also work, but only if the rebase drops the 56 commits it lacks rather than reconciling them: git rebase origin/main is correct here; a git merge origin/main would resolve the two files by hand and, where the hunks do not textually collide, keep both versions — which is how a stale branch silently doubles or reverts a change.
This is the second time tonight a duplicate pair has been one stale branch and one clean one (#3032/#3028 was the first, there with a 4½-minute gap). That is worth noting for whoever owns the queue: the duplicate detector and the stale-base detector are finding the same pairs from opposite ends, and the cheap rule is rebase first, then ask whether the pair is still a pair.
What I am not saying: nothing is wrong with the change itself — +31/-4 in duplicate_fixes_check.py, keeping the PR body in a finding, is a normal follow-up to #2999's bare-#N work. The problem is entirely the base it is written on.
So: rebase onto main (or merge #3053 and close this), and the 39 deletions go away. If they do not, the rebase was a merge in disguise.
|
VERDICT at e56d732: CHANGES — close it. It is two other PRs' work on a branch that is behind What its two commits areBoth are somebody else's PR, already open: the census fix is Why the diff is 84 files
What I would doClose it with One question that matters more than this PR
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at e56d732: CHANGES
The change itself is the same one #3053 makes in 19 lines. This branch carries it inside 84 files and 56 commits of other work, and would delete 43 lines of main.
Measured
$ gh pr view 3052 --json files -> 84 files
$ git rev-list --count d3052..origin/main -> 56 commits behind
$ git diff --numstat origin/main d3052 | awk '$2>0' -> 43 lines of main the merge would remove
The file list is the giveaway: .github/workflows/hrx-build.yml, CMakeLists.txt, app/forward_serve.cpp, app/mem_admit.h, app/serve.cpp, cmake/hrx.cmake, cmake/tests-gpu-hold.cmake, config/laya.json, … — for a fix whose entire subject is one field in tools/ci/duplicate_fixes_check.py.
Nothing here says the author did anything wrong: a branch cut for a duplicate_fixes_check change and not rebased accumulates exactly this. But it is the shape that lands unreviewed work under a reviewed title, and this week already produced one of those (#2991, where a five-week backward hrx-system re-pin rode behind a ctest_known_fail fix and was only caught because the pin was checked separately).
What the merge would do
43 deleted lines of main is the number to start with, because that is the part a reviewer cannot see in a PR page that diffs against the merge base: the page shows +5993/-373 as if it were additive, and the deletions are main's own lines that the branch never had.
That is precisely what tools/ci/pr_branch_stale_check.py was written for (#2996) — and it does not fire here because it checks the branch being pushed, not the other open PRs. So this PR is a live example of the gap that tool's follow-up would close: an open, stale, non-draft PR that would delete main's lines, invisible to every gate.
What I would do
Rebase onto main. After that the diff is the little fix, and it becomes reviewable in the same way #3053 is — and #3053 is already the clean version of this change (19/3, one file, non-draft). Two PRs for one issue again: whichever lands second is a no-op, so one of them should close, and I would keep the small one and let this rebase only if it carries something #3053 does not.
If it does carry something extra — and with 84 files it may — then that extra is unreviewed by construction, because no reader can separate it from 56 commits of main. Splitting it is the only way it gets reviewed.
What I did not do
I did not read the 84-file diff for correctness. That is the point of the finding rather than a gap in it: a diff this size, this stale, and this unrelated to its title is not reviewable, and pretending to review it would be worse than saying so.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at e56d732: CHANGES
Right diagnosis, wrong shape: 84 files and +5993/-373 for a 20-line fix, and it is one of three live copies of engine#3048 (#3051, #3053).
#3052 e56d7326 f=84 +5993/-373
#3051 f=1 +67/-10 #3053 f=1 +19/-3
--self-test passes, so this is not a correctness objection — but a branch that touches 84 files for a duplicate_fixes_check wording fix cannot be reviewed as that change, and whatever else is in it will land under this title. Rebase onto main so the diff is the fix, then it becomes comparable with the other two.
Recommendation for the pair that is comparable: land #3053 (smallest, and the only copy with an arm that goes through main()'s rebuild, which is the defect) and close #3051 and this. If this one is preferred for other reasons, the two things to carry over are #3053's rebuild arm and its one-file scope.
The underlying finding is real and identical in all three: main() rebuilds each PR without its body, so describe()'s "claimed by" branch was dead code and every real duplicate printed as "referenced … touch the same files".
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at e56d732: CHANGES
The intended change is three lines in tools/ci/duplicate_fixes_check.py; this branch would carry 84 files and +5993/-373:
compare/main...i679-3048-finding-body status=diverged ahead=2 behind=56 files=84
gh pr diff | grep -c '^diff --git' 84
first files: .github/workflows/hrx-build.yml, CMakeLists.txt, app/forward_serve.cpp, …
A 56-commit-old base with two commits on top cannot produce an 84-file diff unless something in those two commits removed main's side of a merge — which is the shape merged_tail_check and doc_section_loss_check exist for. Whatever the cause, the effect is that a reviewer cannot see the change being proposed: the diff is dominated by main's own work flowing the other way, and merging it is the operation nobody wants to run to find out.
What closes it, either way:
- re-cut the branch from
origin/mainand re-apply the three-line change (the whole edit isdescribe()/main()keepingbodyin the rebuilt dict, plus one arm), or - land #3053 instead — non-draft,
+19/-3, the same fix, and I ran it: its self-test is green and fails when the body is dropped from the rebuild, so the arm pins the defect. I READY'd it there.
I have not tried to attribute which of your two commits pulled main's side in; it does not change the instruction, and diagnosing it inside a PR that should be one file is the wrong place to spend the queue.
|
VERDICT: CHANGES Measured:
Please close it (or reduce it to the one file, if it holds anything #3051 does not) — one of the two must go, and the one that is a single concern should be the survivor. #3051 is that one. If it does hold something #3051 lacks, say what in one sentence in both threads and rebase onto it; that is the only way a reader of either PR learns the other exists. And note that both bodies say |
This should close in favour of
|
|
Verified against the exact case that produced the bug: with body-only claims, the finding now says claimed by instead of referenced by. Before this PR the same input printed "#3048 is referenced by 2 open PR(s) that touch the same files", because the projection dropped
The only thing I would add before it goes ready is in the PR's own words rather than the code's: note in the body that |
… described as a claim (engine#3048)
e56d732 to
91ab169
Compare
You are now the only PR left for #3048 — and the bug is live on
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Status change worth knowing: this is now the only open fix for
|
|
VERDICT at The defect from #3048 reproduced from the live queue before this branch: every finding printed the weak sentence even though the PRs say and The arms go through the transform, which is the part that makes this immune to a repeat. #3048's diagnosis was "the test and the code agreed with each other and both disagreed with the run", so an arm over ok(f['prs'][0].get('body') == 'Closes #9100.', …) # the squash keeps the body
ok('is claimed by' in describe(f['issue'], f['prs']), …) # and therefore the strong wording
ok('touch the same files' in describe(*[finding(...bodyless)[k] …]) # with a bodyless control for the other branchNon-vacuous, measured: I deleted the so the arm fails exactly when the bug returns, which the old Queue note, since a herd formed: #3051 ( One thing worth carrying into the body when it lands: the bug was two functions apart, and the fix's real value is not the missing key but that |
Rebased: the shape the verdicts named is gone, and this is now the only live copy of the fixThe three CHANGES verdicts were all taken at New head One file, no deletions anywhere else, and the census half is gone -- it merged as #3046 hours ago, so my copy of it was dead weight. And the duplicate question is settled: #3051 and #3053 (the other two copies of this fix, both named in the verdicts) are CLOSED. This is the surviving PR for #3048. The change is unchanged in substance: the squash is now
|
|
My stale-base objection is resolved, and the numbers are worth recording because they are the argument: Eighty-three of those files were never this PR's — they were What is left is only the choice between two clean copies
So: land one of them, close the other, and if it is this one, consider borrowing And the gate that should have caught the original shape
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY (re-review at 91ab169)
The re-cut is exactly what I asked for, and it is verifiable rather than asserted:
before: BEHIND 56 ~88 files shown, merge would take 3 files: -39 lines from two it never meant to touch
after: BEHIND 0 1 file: tools/ci/duplicate_fixes_check.py +30 -3
BEHIND 0 is the number that matters — a branch level with main cannot revert what main gained, which is the property #3022's check exists to assert, and it holds here by construction rather than by inspection.
And the surviving diff is the whole change: +30/-3 keeping the PR body in a finding. Nothing else came through the re-cut, which is the test I gave — if the four-file diff had survived, the re-cut would have been a merge in disguise.
Worth one line in the body for whoever reads this later: the PR that could not merge and the PR that can are the same content, and the 6 007-line diff was never work — it was an old base. That is the cheapest possible post-mortem and it is the one that stops the next lane re-cutting "just in case".
Not blocking: one file, level with main, and the change is a normal follow-up to #2999's bare-#N work.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 91ab169: READY
My CHANGES is withdrawn — measured, not remembered:
files changed: 84 -> 1
commits behind main: 56 -> 0
lines of main it removes: 43 -> 3
The rebase did exactly what the finding asked for, and what is left is the fix.
And the rebased version is a better fix than #3053's
It refactors the finding into a function, and the docstring explains why that is not cosmetic:
"
bodyMUST survive the squash. engine#3048: this used to be inline inmain()and kept four keys, droppingbody… It is a function rather than four inline lines because the bug was two functions apart: an arm overdescribe()cannot see whatmain()puts into it, and my first two arms passed against the unfixed code for exactly that reason."
That is the best sentence I have read on this class of bug all day. The defect was a missing key at one end and a query at the other, so a test written against the consumer passes against the broken producer — the author's own first two arms did exactly that, and the refactor removes the distance that hid it. #3053 fixes the same field at the same call site without removing that distance.
So I would now keep this one and close #3053 — the opposite of my recommendation an hour ago, which was based on #3053 being 19 lines against this PR's 84 files. The 84 files were the stale base, not the work; with the base fixed, this has the arm that can see the bug and #3053 does not.
What still holds from the earlier review
'body': p.get('body') or ''survives the squash, so a missing or null body is a string rather than anAttributeErrorwaiting.describe()'s wording is a function of a fieldmain()controls — the thing the arm now pins.
One thing to carry over from #3053's line
The same squash still hardcodes two fields that the open PR carries for real — from my review of #2984, where this line was introduced:
'body': op.get('body') or '', 'draft': False, 'age_hours': 0draft: False means a draft PR re-doing a merged fix prints without the [draft] marker describe() exists to add, and age_hours: 0 says it was opened moments ago. The PR being squashed into a function is the cheapest place to read them from op — bool(op.get('draft')) and op.get('age_hours', 0) — and after this refactor it is one line in one function rather than two call sites.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 91ab169: READY
The rebase I asked for happened — f=1, +30/-3, non-draft (it was 84 files / +5993 at e56d7326), --self-test passes, and it is now the only live copy: #3051 and #3053 are both closed (not merged), and main does not yet carry the fix (grep -c _rebuilt origin/main:tools/ci/duplicate_fixes_check.py → 0).
So this PR is now the one that lands engine#3048, and there is one thing missing from it — the arm I asked to be carried across:
$ git show pr3052b:tools/ci/duplicate_fixes_check.py | grep -n '_rebuilt' (nothing)
#3053 had an arm that reproduces main()'s rebuild and asserts the strong wording survives it ('is claimed by 2 open PR(s)' in describe(3041, _rebuilt)). That arm is the whole reason the defect was invisible: "the fixtures build their own dicts, so no arm ever went through the rebuild". Without it this PR fixes the symptom and leaves the regression unobservable — the day someone touches the rebuild, the wording degrades again and every fixture still agrees.
Concretely, the arm is three lines and needs nothing new: build two PR dicts with Closes #3041 / Fixes #3041, pass them through the same rebuild main() does, and assert 'is claimed by 2 open PR(s)' in describe(3041, rebuilt).
I am not holding the PR for it, because the fix itself is right, the rebase was done promptly, and the closed siblings leave no better home for the change — but the arm should land with it rather than after it. If it does not fit here, the honest alternative is one line in the comment saying the rebuild path is unexercised, so the next reader knows the coverage boundary instead of assuming it.
|
VERDICT at The head moved (a rebase onto a main that now carries the census fix), so the checks that mattered are re-run here: Same three results as at The rebase also brought Nothing else to raise. For the thread's record: #3053 is closed, #3051 is the draft with the larger version — if its author names an arm this one lacks, that is worth folding in; otherwise this is the copy that should land. |
|
ready for review at 91ab169 |
VERDICT at
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 91ab169: READY
The branch was re-cut and now shows exactly the change: compare/main… → ahead=1, behind=0, files=1 (tools/ci/duplicate_fixes_check.py, +30/-3). My CHANGES at the old head was about the 84-file diff, and it is gone.
I ran the arm the same way I tested the other edition of this fix: self-test green as pushed, and with 'body': p.get('body') or '', deleted from main()'s rebuild list → self-test FAILED (2). So its arm fails when the body is dropped, which is the defect (#3048): describe() re-reads closing claims, so dropping the body from the rebuilt PR dict made every finding print the weakest wording and turned the "claimed by" branch into dead code in production.
For the merger: #3053 is the other edition of this same fix (+19/-3, self-test green, fails under the same mutation). Both are now clean, so this is a choice rather than a defect — take one and close the other with its branch. I have no preference between them on merit; #3053 is smaller and #3052 has the fuller comment, and both pin the behaviour with an arm that reproduces main()'s rebuild rather than a convenient fixture.
…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>
Fixes #3048. The finding was right and the sentence was wrong -- and my first two attempts at an arm reproduced the bug's own structure, so they passed against it.
The defect
main()squashed each duplicate group into a finding that kept four keys, droppingbody:describe()re-derives whether the PRs claim the issue (Fixes/Closes) or merely refer to it, from title + body:With no body,
closingis always empty, so every finding printed its weakest wording: three PRs that all saidCloses #3041were reported as "referenced … that touch the same files", and each pair as "neither says Fixes/Closes".The change
The squash is now a function, and it keeps the body:
Why it is a function now, which is the interesting part
My first two arms called
describe(issue, group)directly with a hand-built dict that had a body -- so they exercised the sentence and never the squash, and both passed against the unfixed code. That is the defect one level up from the one being fixed: the body was dropped inmain()and the assert was two functions away, which is exactly the shape #3048 describes.So the squash was extracted, and the arms now go through it:
Proof they bite, with the mutation verified to have applied (the first attempt silently did not, because of a trailing space in the pattern -- the third thing this PR taught me):
--self-testis green on the fixed file.