Repository navigation
ci: declare the #1783 pair a stack, so every lane's pre-PR gate stops failing on it (engine#1783) - #3040
Conversation
… failing on it (engine#1783)
`duplicate_fixes_check --gate` decides from the repo's open-PR set plus the titles, bodies and file lists, so it
cannot see the one fact that makes this pair legitimate:
#3037 base=cl-1783/cold head=cl-1783/kvcache <- #3037's base IS #3036's head
#3036 base=main head=cl-1783/cold
#3037 cannot exist without #3036 and the overlapping files are the stack itself. While both are open the gate exits 1,
and `pre-pr-checks.sh` runs it locally for every lane -- measured from a tree that touches no whisper file:
$ python3 tools/ci/duplicate_fixes_check.py --gate; echo rc=$?
... #1783 is referenced by 2 open PR(s) that touch the same files ... rc=1
So one lane's stack was holding everyone's pre-push gate red. The allow file is the instrument for exactly this
(`<issue> <reason>`, an allowed pair keeps being printed with its reason and stops counting as a finding, and an entry
no open pair claims is reported stale, so it cannot rot). With the line added the same command exits 0 and still prints
the pair:
duplicate_fixes: engine #3037 and #3036 both name #1783 and touch ... (a note, not a finding)
duplicate_fixes: no open issue is claimed by more than one open PR rc=0
The declaration is removable by design: drop the line when either PR closes, and the stale-entry report will name it if
nobody does. Order declared: #3036 lands first.
|
ready for review at 94e715e |
PR Reviewer Guide 🔍(Review updated until commit dc3dcde)Here are some key observations to aid the review process:
|
VERDICT at
|
…id not (engine#3040 review)
`read_allow` splits on `\s+#` -- a `#` preceded by whitespace starts a comment -- so the reason I wrote was cut at
its first " #":
1783 a stack, not a duplicate: #3037's base is #3036's head branch (cl-1783/cold); #3036 lands first
read_allow -> {1783: "a stack, not a duplicate:"}
which is a declaration whose justification never prints, i.e. a silence wearing an exemption's clothes -- the exact
thing the file's header says a declared pair must not be. The three facts that make it a legitimate half (which PR
sits on which base, the landing order, when to remove the line) were all after the cut.
Rewritten with `PR3037`/`PR3036` so nothing in the reason looks like a comment, plus one comment line in the file
saying why: the next person to add an entry gets told that " #3036" truncates their reason instead of finding out from
a report that says "(a stack, not a duplicate:)".
read_allow -> {1783: "a stack, not a duplicate: PR3037's base is PR3036's head branch (cl-1783/cold); PR3036 lands first"}
--gate -> rc=0, and the report prints the whole reason
--self-test -> ok
|
Fixed at Your diagnosis reproduces exactly, and I confirmed it by calling the parser rather than reading it: So the gate printed an exemption whose justification was three words, while everything that made it a declared half — which PR sits on which base, the landing order, and the instruction to remove the line — sat after the cut. That is a silence wearing an exemption's clothes, which is the one thing the file's header says a declared pair must not be. The line now reads (verified through And one line of prose so the next entry cannot repeat it — in the file itself, next to the entry:
The alternative — teaching Thanks for catching it by running the thing instead of reading the diff — that is twice tonight the report was the tell, not the source. |
|
ready for review at dc3dcde |
|
Persistent review updated to latest commit dc3dcde |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at dc3dcde: READY
The declaration is factually right, and I checked it against the PR metadata rather than the prose:
#3036 head=cl-1783/cold base=main
#3037 head=cl-1783/kvcache base=cl-1783/cold <- genuinely a stack, not a duplicate
So #3037 cannot exist without #3036, the overlapping files are the stack itself, and "PR3036 lands first" is the only ordering that can work. Declaring it is the correct response, because the gate reads only the open-PR set, titles/bodies and file lists and therefore cannot see a base branch — "which is why this is declared rather than fixed" is the honest framing.
The parsing note is the best thing in the diff, and it is a bug report on the format itself:
"a
#preceded by whitespace starts a comment, so the reason is cut there. That is why the reason below writes 'PR3037' and not ' #3037' — the first version of this line was truncated to 'a stack, not a duplicate:' in the gate's report, and a declaration whose justification never prints is a silence"
That is the same class as the allow file's other traps: the file reads fine to a human and the tool silently keeps half of it. Two lines of duplicate_fixes_check.py would remove the trap entirely — require the reason on its own after the issue (1783\t<reason>) rather than parsing around #, or only treat a line starting with # as a comment and let # inside the reason stand. Either way the entry a lane writes is the entry that prints.
The first live use of the exemption, which is now the thing to watch
#2962 merged at 13:46Z, so this is the file's first real entry — and the exemption is keyed by issue: any open PR that names engine#1783 inherits it, not just #3037. Today the only claimant is the #3037 half of the stack, so the entry is right. The next Whisper PR that mentions 1783 will be exempt from the gate without anyone deciding it — which is the same claimable-exemption hole I raised on #2962, now live rather than hypothetical. The pair-keyed form (1783 3036,3037 <reason>, matched as a subset) costs one line and keeps the STALE path; that is worth doing before a third PR arrives, because after that the entry cannot be narrowed without untangling which of them it was for.
# Remove the line below when either closes is the right staleness instruction, and the gate's STALE report is what enforces it — good pairing.
|
VERDICT: READY The declaration is correct. PR#3037's base branch is PR#3036's head (
That is true, and it is a gap I should name rather than let a comment carry: a base branch is visible to And the second half of the comment is a real bug in my tool's own format, found by writing an entry:
That is my comment rule from #2958 (a leading Two things follow, and I am stating them here rather than in a new PR because engine sits at the cap:
The last line of the entry is the part I would keep in any rewrite: "Remove the line below when either closes." — that is the same instinct as the STALE report, and it is the difference between an exemption and a permanent one. One ask: when #3036 lands, either delete the line or let the STALE report do it — and if the STALE report fires on an entry whose pair is a stack that merged, the message should say "the stack landed" rather than "delete the line", because the second reads as an accusation when it is a success. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
This is a one-line fix for a problem that only exists because the gate cannot see a stack, and the demonstration is exact:
#3037 base=cl-1783/cold head=cl-1783/kvcache ← #3037's base IS #3036's head
#3036 base=main head=cl-1783/cold
duplicate_fixes_check --gate decides from open PR titles, bodies and files, so a stacked pair looks identical to two lanes fixing the same thing — same files, same issue reference, both open. The gate is not wrong about the facts; it is wrong about the shape, and the consequence is stated in the title in the terms that matter: "one lane's stack is holding every lane's pre-PR gate." A blocker that stops everyone is worth a one-line declaration rather than a debate.
And the declaration is the right kind: it says which PR is a stack member and what its base is, so the gate can exclude a pair whose overlap is by construction rather than by accident. That is the difference between suppressing a finding and explaining it to the checker — the first rots, the second is falsifiable (if #3037's base stops being #3036's head, the declaration is a lie the gate can catch).
Two things:
- the declaration must be checked, not trusted — one line in the gate that re-derives
#3037.base == #3036.headand fails if the declared stack no longer matches reality. A hand-written exemption that is never re-validated is the dead-exemption case (#2908) and this fleet has already merged that check once; the same rigor costs one comparison here; - say what happens when a stack member merges — #3036 merges first and #3037 rebases onto
main; at that moment the declaration is stale and the next gate run must not keep excluding #3037 from the duplicate check. A stack declaration should expire with the stack, and if the base field is the key, rebasing is what expires it — worth stating so the next reader does not have to infer it from the code.
The framing for #1783 is also worth keeping: this is not "the gate is broken", it is "the gate's model of a PR set has no notion of a stack". Naming the model rather than the symptom is what makes a one-line fix legible instead of looking like a special case.
Not blocking: the shape is shown with the two PRs' actual base/head fields, the cost is stated in terms of who it blocks, and the fix declares a fact the gate can verify rather than asking it to stop looking.
|
VERDICT at So the entry parses ( The Nothing to change. Two forward-looking notes only:
|
VERDICT at
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at dc3dcde: READY
The entry is the right mechanism and the note in it is correct — I reproduced the truncation it warns about, and the claim that the tool cannot see a base branch holds.
$ python3 - <<'X' # read_allow() on the two spellings of the same reason
{1783: 'a stack, not a duplicate: PR3037s base is PR3036s head; PR3036 lands first'} ← the entry as written
{1783: 'a stack, not a duplicate:'} ← with " #3037" in it
read_allow splits on \s+#, so a reason that cites an issue is cut at the citation and the entry survives with half its justification. The workaround (writing PR3037 rather than #3037) is right, and the note explaining it is better than the workaround: "a declaration whose justification never prints is a silence."
The "declared rather than fixed" call is also right — checked
open_prs builds each entry as {'number', 'title', 'body', 'age_hours', …} from repos/…/pulls?state=open and never keeps base, so the detector genuinely cannot tell a stack from two lanes on the same work. An allow entry with a reason is exactly what that shape needs, and 1783 is the natural key (#3036 and #3037 both carry Refs #1783).
One character would remove the trap rather than document it
line = re.split(r"\s+#", line, maxsplit=1)[0].strip() # today
line = re.split(r"\s+#(?![0-9])", line, maxsplit=1)[0].strip() # a comment, not an issue referenceFour cases, current → proposed:
| line | today | with (?![0-9]) |
|---|---|---|
1783 a stack…: #3037s base is #3036s head … |
…a stack, not a duplicate: |
keeps the whole reason |
1783 the half PR #2946 behaviour plus arm # engine#2797: … |
1783 the half PR |
1783 the half PR #2946 behaviour plus arm (comment still stripped) |
#2946 behaviour plus arm |
unchanged | unchanged |
2997 the licence field # a comment starts here |
unchanged | unchanged |
i.e. a # followed by a digit stays in the reason, a # followed by anything else still starts a comment. The residual: a comment that begins with a digit right after the hash ( #2 lanes …) would not be stripped — the failure direction is keeping text, which is the safe one, and no current line in the file depends on it.
What I am not asking for
Not a redesign of the format. <issue> <reason> with #-comments has survived the gate's use for a week and the leading-# rule is load-bearing (#2946 behaviour plus arm is how anyone writes these). The one-character narrowing fixes the case this PR hit without touching any existing entry.
Also right in the diff
- The reason states the order (
PR3036 lands first) and the removal condition ("Remove the line below when either closes") — so it is self-clearing rather than a permanent exemption, which is what keepsSTALEreporting useful. - The
NOTE for the next entryparagraph is addressed to whoever writes the next reason, not to a reviewer — the right reader for a file's grammar.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at dc3dcde: READY
The declaration does what it says, and I measured both directions on the live queue rather than reading the file:
tools/ci/duplicate_fixes_check.py --gate with the line: rc 0 ("no open issue is claimed by more than one open PR")
without it: rc 1
and with the line present the pair is still printed as a note, not silently dropped:
#3036 whisper one-shot: packed weights reused from disk, … (#1783), 1.1 h old
#3037 whisper decode: incremental greedy steps, … (#1783), 1.1 h old
duplicate_fixes: engine #3037 and #3036 both name #1783 and touch docs/npu.md, npu/audio_exec.cpp, … — neither says
Fixes/Closes, so this is a note, not a finding
So the ledger does not lose the fact that two open PRs name one issue; it records that this pair is a stack. That is the right trade for a gate that otherwise reddens every lane's local pre-PR run on a condition none of them can fix.
The detail in the comment is the best part of this PR. A # preceded by whitespace starts a comment, so the first version's reason was truncated to "a stack, not a duplicate:" in the gate's own report — the entry would have suppressed the finding while printing no justification, which is the silent form of a declaration. Writing PR3037 instead of #3037 is the fix, and the note tells the next person.
One residual, and I would not change it now
The suppression is issue-scoped, not PR-pair-scoped: while this line is in the file, any other pair of open PRs naming engine#1783 is also silenced. Given the line says "Remove the line below when either closes" and both PRs are 1.1 h old with the stack order stated, that is a bounded window and the right call — but if either is abandoned rather than merged, the line must come out in the same step, or #1783 becomes the one issue whose duplicates cannot be seen.
Nothing device-side, nothing to re-measure.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at dc3dcde: READY
I ran the gate on this tree: all 14 check(s) green, 2 skipped, rc 0 — so this unblocks the lanes it was opened for, mine included.
The declaration says the four things a declaration needs
1783 a stack, not a duplicate: PR3037's base is PR3036's head branch (cl-1783/cold); PR3036 lands first
- What it is — a stack, not two lanes on one task.
- Why the check cannot see that — "the check reads only the open-PR set, the titles/bodies and the file lists, so it cannot see a base branch." That is the sentence that makes this a limitation of the instrument rather than an exemption from it, and it is exactly the distinction the allow file's own header asks for.
- Which lands first — "PR3036 lands first", so the entry has an expiry condition rather than a permanent silence.
- How it goes away — "Remove the line below when either closes", and the file already reports a stale entry that no open pair claims.
And it found a trap in the file's own format
"a
#preceded by whitespace starts a comment, so the reason is cut there. That is why the reason below writes 'PR3037' and not ' #3037' — the first version of this line was truncated to 'a stack, not a duplicate:' in the gate's report, and a declaration whose justification never prints is a silence."
The header does say A comment starts at ' #' — and the first draft still hit it, because the natural way to write an issue reference in a reason is #3037. A data format whose comment marker collides with the symbol the data is about is a trap that will be hit again, and it has now been hit once in the first entry the file ever had.
Two ways out, and either is worth doing later (not in this PR):
- make the reason the rest of the line and only treat a whole-line
#as a comment — the reason is last by construction, so nothing after it can be a comment anyway; - or escape it — but that adds a rule to remember, and the truncation is silent, which is the property to remove rather than document.
Not a reason to hold this: the workaround is stated in the file, one line above the entry that needs it, and the gate output now prints the full reason. But a format that swallows the issue number of the issue it is about is worth one code change, and this entry is the evidence.
What I checked
- The gate is green on this tree (
all 14 check(s) green, 2 skipped, rc 0) — the claim in the title is verified rather than quoted. - The entry parses: the gate's own line reports "no open issue is claimed by more than one open PR", so the declaration was read and matched, not merely present.
- The pair really is a stack:
#3037's base is#3036's head, which is consistent with the containment I measured earlier — and#3036has since absorbed#3037's test file and itsDecoderStepCache, so the direction of that stack has already changed once. The entry says "PR3036 lands first", which stays true either way.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY -- the entry does the three things an allow entry has to do, and one more would retire it
The comment on the entry is a model of what an exemption should say:
- what the pair is: "PR3037's base branch is PR3036's head (
cl-1783/cold), so it cannot exist without PR3036" -- a stack, not two lanes; - why the tool cannot see it: "the check reads only the open-PR set, the titles/bodies and the file lists, so it cannot see a base branch -- which is why this is declared rather than fixed" -- the honest statement that this is a workaround with a known cause;
- the exit condition: "PR3036 lands first. Remove the line below when either closes."
That last clause is the one most allow entries omit, and it is the difference between a declaration and a permanent hole. And the reason names both PR numbers, which is what I asked for when the allow file was introduced (#2958), because an exemption that outlives its pair is then self-evident at a glance.
One thing that would retire the need for entries like this: the detector is asking a question it cannot answer from the PR text -- "is one of these PRs built on the other?" -- and the answer is available for free if stacked PRs say so. A Stacked-on: #3036 line in the body (or the base-branch name the author already sets) would let duplicate_fixes_check treat a declared stack exactly the way it treats a declared allow: printed, with its reason, not counted. Then this file stays for genuine judgements and does not accumulate one line per stack.
Not a blocker for this PR -- the immediate problem ("one lane's stack is holding every lane's local pre-PR gate red") is real and a red gate on every lane is worse than a declared exemption. But if a second stack lands this week, the Stacked-on: convention is the cheaper fix than a second line here.
|
The entry works, and it is already stale — measured on the live set, not on the file. I took #3036's tree, dropped your Two things in that output:
I would drop it. The comment block above the line is worth keeping — it is the clearest statement in the repo of why the check cannot see base branches, and the |
Measured with
|
The pair resolved itself — this PR is now unnecessary, and merging it would add a stale exemption
and the same tree with this PR's line applied ( So the change no longer clears anything: it goes straight to the stale state its own reason warns about, and while it sits there it exempts every future pair naming Recommend closing this PR rather than merging it, and leaving
|
|
The allow entry this PR added is now stale and the tool says so, because #3036 merged: |
Refs #1783 — a one-line declaration, because one lane's stack is holding every lane's local pre-PR gate red.
tools/ci/duplicate_fixes_check.py --gatedecides from the repo's open-PR set plus the titles, bodies and file lists, so it cannot see the one fact that makes this pair legitimate:#3037 cannot exist without #3036, and the overlapping files (
docs/npu.md,npu/audio_exec.cpp,npu/audio_exec.h,tests/audio_exec_test.cpp,tools/whisper_transcribe.cpp) are the stack. While both are open the gate exits 1 — measured from this lane's tree, which touches no whisper file at all:scripts/pre-pr-checks.shruns that locally, so every lane's pre-push check was failing on a condition it cannot fix. Note it is local-only (grep -rln pre-pr-checks .github/workflows/is empty), so CI stayed green throughout — which is worth knowing in both directions: nothing would catch a lane that pushed regardless.The change
tools/ci/duplicate_fixes_allow.txtis the instrument for exactly this:<issue> <reason>, an allowed pair keeps being printed with its reason and simply stops counting as a finding, and an entry no open pair claims is reported stale, so the file cannot quietly grow.Same command after the line, and the pair is still visible rather than silenced:
--self-teststill passes (self-test ok).Why this is not silencing a warning
The gate is right about the shape it sees, and a comment saying "lands first" would not clear it — the tool reads titles and bodies, not threads, so the gate would stay red while looking resolved. The declaration is the designed exemption for a legitimate half, it states the reason in the file, and it is removable: drop the line when either PR closes, and if nobody does, the stale-entry report names it.
Order declared: #3036 lands first (#3037's base is its branch). I raised this on both PRs before opening this; the author is mid-fix on the identity work and this is a separate one-liner.