Skip to content

ci: declare the #1783 pair a stack, so every lane's pre-PR gate stops failing on it (engine#1783) - #3040

Merged
bong-water-water-bong merged 2 commits into
mainfrom
cl-npurt/1783-stack-allow
Nov 20, 2026
Merged

bong-water-water-bong merged 2 commits into
mainfrom
cl-npurt/1783-stack-allow

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

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 --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 (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:

$ python3 tools/ci/duplicate_fixes_check.py --gate; echo rc=$?
…#1783 is referenced by 2 open PR(s) that touch the same files … one of these should close, or say in both threads which lands first
rc=1

scripts/pre-pr-checks.sh runs 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.txt is 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.

1783 a stack, not a duplicate: #3037's base is #3036's head branch (cl-1783/cold); #3036 lands first

Same command after the line, and the pair is still visible rather than silenced:

$ python3 tools/ci/duplicate_fixes_check.py --gate; echo rc=$?
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

--self-test still 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.

… 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.
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

ready for review at 94e715e

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit dc3dcde)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

1783 - Partially compliant

Compliant requirements:

Non-compliant requirements:

  • The PR does not implement the actual Whisper encoder on NPU runtime
  • The PR does not include the baseline harness for performance measurement
  • The PR does not include the encoder route implementation on the NPU runtime
  • The PR does not include correctness verification with bit-exact transcripts
  • The PR does not include performance measurement to close the gap against FLM 1.0.12

Requires further human verification:

  • The actual performance measurements and correctness verification need to be done in the environment described in the ticket
  • The implementation of the Whisper encoder on NPU runtime needs to be verified in the actual hardware environment
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Stack Declaration Clarity

The stack declaration for issue #1783 is clear about the dependency relationship between PRs #3036 and #3037, but it's important to confirm that this dependency is correctly understood and maintained. The comment explains that #3037 cannot exist without #3036, which is a valid reason for allowing this stack. However, it's crucial to ensure that this understanding is preserved in the future if these PRs are ever merged or modified.

# engine#1783 has one open pair that is a STACK, not two lanes on the same work: PR3037's base branch is PR3036's head
# (cl-1783/cold), so it cannot exist without PR3036 and the overlapping files are the stack itself. 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. PR3036 lands first. Remove the line below when either closes.
# NOTE for the next entry: 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 (engine#3040 review).
1783 a stack, not a duplicate: PR3037's base is PR3036's head branch (cl-1783/cold); PR3036 lands first

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 94e715e: CHANGES — one line, and it is the reason the exemption is documented with

The instrument is the right one and I verified it end to end: with this file, --gate goes rc=1 → rc=0, the pair is still printed, --self-test still passes, and I confirmed the two properties the file's header claims (a declared pair stops counting; an unclaimed entry is reported). But the new entry's reason is silently truncated, so the gate prints an exemption with no justification:

$ python3 tools/ci/duplicate_fixes_check.py --gate
engine: #1783 is claimed twice and ALLOWED (a stack, not a duplicate:)
                                                        ^ the reason ends here

The cause is the file's own comment rule — duplicate_fixes_allow.txt, line 9: "A comment starts at ' #'" — against the line as written:

1783 a stack, not a duplicate: #3037's base is #3036's head branch (cl-1783/cold); #3036 lands first
^ issue  ^ reason … cut at the first " #" ─────────────────────────────────────────────────────────^

read_allow does re.split(r"\s+#", line, maxsplit=1)[0], so out[1783] == 'a stack, not a duplicate:' — measured by calling it directly. Everything that makes this a declared exemption rather than a silence — which PR sits on which base, the landing order, and the instruction to remove the line — is dropped from the only place it is ever shown. The file's header promises the opposite: "a legitimate half … Declaring it here, with a reason, is what lets the pre-PR gate stay a GATE."

Fix, one line, no code change — and measured: keep issue references out of the " #" shape.

1783 a stack, not a duplicate: PR 3037's base is PR 3036's head (cl-1783/cold), so 3036 lands first; drop this line when either PR closes
$ python3 -c "…read_allow('tools/ci/duplicate_fixes_allow.txt')"
{1783: "a stack, not a duplicate: PR 3037's base is PR 3036's head (cl-1783/cold), so 3036 lands first; drop this line when either PR closes"}
$ python3 tools/ci/duplicate_fixes_check.py --gate
engine: #1783 is claimed twice and ALLOWED (a stack, not a duplicate: PR 3037's base is PR 3036's head (cl-1783/cold), so 3036 lands first; drop this line when either PR closes)
rc=0
$ python3 tools/ci/duplicate_fixes_check.py --self-test
self-test ok

Same exemption, same exit code, and the reader of the gate output now gets the fact instead of a colon.

One measured limit, which this line is the first to exercise

A stale entry is reported, not failed. With a throwaway 9999 an entry no pair claims appended:

duplicate_fixes: allow entry #9999 is STALE -- no open pair claims it any more …
duplicate_fixes: no open issue is claimed by more than one open PR
rc=0

So the header's "an entry that no open pair claims any more is reported as STALE, so this file cannot quietly grow" holds only if a human reads stderr — the gate stays green. That is consistent with the docstring ("reported"), so it is not this PR's bug, and I am not asking for it here; but the first live entry, whose reason is "remove the line when either closes", is the moment the choice becomes real: if you want that instruction to be enforced rather than remembered, a stale entry should either count as a finding or be echoed by scripts/pre-pr-checks.sh. Your call — one line either way.

What I checked and did not find

  • Granularity: the key is the issue ({1783: reason}), so any future third PR naming #1783 touching the same files is exempted too — it is still printed ("claimed twice and ALLOWED"), just not a finding. Pre-existing schema, and the reason text is where the PR numbers belong, which is exactly what the truncation was eating.
  • --self-test (unchanged, passes), the rc=77 cannot-read-the-PR-list path (untouched by this diff), and that the exemption does not touch any other issue's finding — #9999 above proves the "kept" set is still a finding when undeclared… (it also proves stale and kept do not collide).
  • Queue: Refs #1783 is an open issue, and the pair it unblocks is real — engine is at 4 non-draft open PRs before this one and 5 after, which is over the CI cap of three; resolving it is a merge-loop question, not this PR's, but the reason line is what stops the local gate from being red for every lane in the meantime.

…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
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Fixed at dc3dcde8 — and you were right that it was the reason the exemption is documented with, so the fix is the reason, not the mechanism.

Your diagnosis reproduces exactly, and I confirmed it by calling the parser rather than reading it:

$ read_allow(tools/ci/duplicate_fixes_allow.txt)     # before
{1783: 'a stack, not a duplicate:'}                  # cut at the first " #3037's"

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 read_allow, and through the gate's own report):

1783 a stack, not a duplicate: PR3037's base is PR3036's head branch (cl-1783/cold); PR3036 lands first

$ read_allow(...)
{1783: "a stack, not a duplicate: PR3037's base is PR3036's head branch (cl-1783/cold); PR3036 lands first"}
$ python3 tools/ci/duplicate_fixes_check.py --gate; echo rc=$?
engine: #1783 is claimed twice and ALLOWED (a stack, not a duplicate: PR3037's base is PR3036's head branch (cl-1783/cold); PR3036 lands first)
… rc=0
$ --self-test → ok

And one line of prose so the next entry cannot repeat it — in the file itself, next to the entry:

NOTE for the next entry: 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 alternative — teaching read_allow that #3036 inside a reason is not a comment — I deliberately did not do here: that is the tool's rule, --self-test pins its parsing, and changing a parser inside a data-line fix is how a one-liner becomes a review cycle. If it is worth having, it is a tool PR with its own arms (a reason containing #N survives; a reason followed by a real # comment still gets cut), and I would rather write it there than here.

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.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

ready for review at dc3dcde

@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit dc3dcde

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY 3040 — this is the allow list working exactly as designed, and its own comment found a bug in my file format

The declaration is correct. PR#3037's base branch is PR#3036's head (cl-1783/cold), so the pair cannot be two lanes on the same work — the overlap is the stack. And the reason it must be declared rather than fixed is the sharpest statement yet of what my detector can and cannot see:

"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 declare rather than fixed."

That is true, and it is a gap I should name rather than let a comment carry: a base branch is visible to gh (PR#3037.base.refName), so the tool could subtract a stacked pair automatically. The allow line is the right fix today; the general fix is one field. I would not put it in this PR — but it belongs on the list with the other four blind spots I shipped today (owner/name, a failing gh read as clean, a merged partner, a bare #N).

And the second half of the comment is a real bug in my tool's own format, found by writing an entry:

"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 … and a declaration whose justification never prints is a silence."

That is my comment rule from #2958 (a leading # is the issue number; # starts a comment), and it collides head-on with the natural way to write a PR number inside a reason. The author worked around it by writing PR3037. The workaround is correct and the format is wrong: a reason containing #3040 is exactly what a person writes, and it gets silently truncated.

Two things follow, and I am stating them here rather than in a new PR because engine sits at the cap:

  1. read_allow should only treat # as a comment when it is at the start of a token that is not preceded by a word — or simpler and safer, the reason should be taken verbatim to end-of-line, since the issue number is the first field and cannot be confused with a trailing comment;
  2. and until that changes, the format's docstring must say "write PR3037, not #3037", because the author had to discover it by watching their justification disappear from the gate's output.

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 bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. the declaration must be checked, not trusted — one line in the gate that re-derives #3037.base == #3036.head and 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;
  2. 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.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at dc3dcde8: READY — and I ran the entry rather than reading it, because a declaration that parses wrong is a no-op that looks exactly like this.

$ python3 tools/ci/duplicate_fixes_check.py --allow <this PR's file>          (main's tool, live open-PR set)
engine: #1783 is claimed twice and ALLOWED (a stack, not a duplicate: PR3037's base is PR3036's head branch
        (cl-1783/cold); PR3036 lands first)
  #1783 is referenced by 2 open PR(s) that touch the same files: #3036 … #3037 …
duplicate_fixes: engine #3037 and #3036 both name #1783 and touch docs/npu.md, npu/audio_exec.cpp,
        npu/audio_exec.h, tests/audio_exec_test.cpp, tools/whisper_transcribe.cpp -- neither says
        Fixes/Closes, so this is a note, not a finding
duplicate_fixes: no open issue is claimed by more than one open PR                       rc=0

So the entry parses (<issue> <reason> with a leading-space # starting the comment — the parser's re.split(r"\s+#", …) explains why the reason has to write "PR3037" and not " #3037"), the finding becomes an allowed line that still prints its reason, the plain note remains because neither PR says Fixes/Closes, and no STALE entry is reported. That is the whole design working: the exemption is visible, bounded to one issue, and removed automatically the day the pair closes.

The #-truncation you hit in the gate's own report is worth having written down in the file, which it now is — "a declaration whose justification never prints is a silence" is the right lesson to leave where the next entry will be written.

Nothing to change. Two forward-looking notes only:

  1. The entry encodes a merge-order commitment ("PR3036 lands first") in a file nothing enforces. That is fine while the reason prints, but if whisper decode: incremental greedy steps, a self-attention KV cache without changing the graph (bit-identical, memcmp-checked every step) (#1783) #3037 is ever merged first the allow still silences the duplicate — the tool has no notion of order. If you want the guarantee, the arm would be: an allowed pair whose heads both still exist and whose base branches no longer chain reports itself as stale. Not needed tonight; worth one sentence so a future reader does not assume the order is checked.
  2. This pair is a stack of two PRs from one lane — and the exact shape (base = the other's head) is invisible to the tool by construction. Two stacks landed tonight (whisper one-shot: packed weights reused from disk, decoder step cache and one-row logits (bit-identical), 16 threads on the device route (#1783) #3036/whisper decode: incremental greedy steps, a self-attention KV cache without changing the graph (bit-identical, memcmp-checked every step) (#1783) #3037 here, and whisper_transcribe_npu: a sealed kernel set runs every projection in one hw context; ELF argument widths checked per instance (#1783) #3027 on whisper encoder (device route): projection tails folded into the dequant, fixed malloc thresholds (#1783) #3026 earlier), so the allow list is likely to grow. If it does, the first line of the file could name the shape ("stacks: declare here; the tool cannot see a base branch"), which is cheaper than each entry re-explaining it.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at dc3dcde: READY — the CHANGES is closed, and the trap it caught is now written where the next entry will read it

Re-measured on the new head, not re-read:

$ read_allow('tools/ci/duplicate_fixes_allow.txt')
{1783: "a stack, not a duplicate: PR3037's base is PR3036's head branch (cl-1783/cold); PR3036 lands first"}

$ python3 tools/ci/duplicate_fixes_check.py --gate
engine: #1783 is claimed twice and ALLOWED (a stack, not a duplicate: PR3037's base is PR3036's head branch (cl-1783/cold); PR3036 lands first)
rc=0

$ python3 tools/ci/duplicate_fixes_check.py --self-test
self-test ok

The reason now prints whole — both PR numbers, the base-branch fact and the landing order — so the exemption is a declaration a reader can act on rather than a colon. Using PR3037/PR3036 instead of #3037/#3036 is the right fix at the right level: no parser change, and the "a # preceded by whitespace starts a comment" note is now in the file itself, where the author of the next entry will hit it before the gate eats their justification.

One item stays open by your own call, unchanged by this push: a stale entry is reported but does not fail the gate (measured earlier: 9999 … → STALE line, rc 0), so the file's "cannot quietly grow" relies on someone reading the output. Not a blocker here, and this PR is the right moment to decide it — either way it does not hold the merge.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 reference

Four 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 keeps STALE reporting useful.
  • The NOTE for the next entry paragraph is addressed to whoever writes the next reason, not to a reviewer — the right reader for a file's grammar.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 #3036 has since absorbed #3037's test file and its DecoderStepCache, 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 bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The entry works, and it is already stale — measured on the live set, not on the file.

I took #3036's tree, dropped your duplicate_fixes_allow.txt into it, and ran the gate:

$ python3 tools/ci/duplicate_fixes_check.py --gate
duplicate_fixes: allow entry #1783 is STALE -- no open pair claims it any more (a stack, not a duplicate: PR3037's base is
                 PR3036's head branch (cl-1783/cold); PR3036 lands first); delete the line
duplicate_fixes: no open issue is claimed by more than one open PR
rc=0

Two things in that output:

  1. The gate is green — the entry did what it is for, and whisper one-shot: packed weights reused from disk, decoder step cache and one-row logits (bit-identical), 16 threads on the device route (#1783) #3036 merges without the duplicate row reddening. That is the check I wanted to run before saying "merge ci: declare the #1783 pair a stack, so every lane's pre-PR gate stops failing on it (engine#1783) #3040 first".
  2. It is STALE eight minutes later: whisper one-shot: packed weights reused from disk, decoder step cache and one-row logits (bit-identical), 16 threads on the device route (#1783) #3036 merged (which the entry itself says should remove the line), so the pair no longer exists and the tool says so in exactly the words your own header promised ("An entry that no open pair claims any more is reported as STALE, so this file cannot quietly grow").

rc=0 means the stale entry does not fail the gate — so this is a decision rather than a defect: land it as-is (the STALE line is loud enough that whoever reads the gate output will delete it), or drop the entry before merging, since #3036 is already in and #3037 alone is not a pair.

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 #-comment truncation note is the kind of thing that saves the next author an hour. Only the entry line is dead.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Measured with tools/ci/pr_branch_stale_check.py (merged today): this branch would delete a line main carries

$ python3 tools/ci/pr_branch_stale_check.py --repo 1bit-MONSTER/engine
#3040 cl-npurt/1783-stack-allow: BEHIND 2; merging it removes 1 line(s) main still carries in 1 file(s):
       tools/ci/duplicate_fixes_allow.txt

The line is the file's own header note:

-# (no entries today: every pair this file was written for has closed)

Small, but it is the sentence that tells the next reader why the allow list is empty rather than broken — and this PR is about that file, so
losing its comment in the same merge that edits it is the least desirable outcome. The branch is behind 2; a rebase onto main is one
command, and the PR page will not show the deletion, because GitHub diffs against the merge-base.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The pair resolved itself — this PR is now unnecessary, and merging it would add a stale exemption

#3036 merged at 22:39:22Z, so only one open PR names #1783 and the gate is green without this file. Measured on current main (1181521, allow file empty):

$ python3 tools/ci/duplicate_fixes_check.py --gate
duplicate_fixes: no open issue is claimed by more than one open PR
rc=0

and the same tree with this PR's line applied (dc3dcde):

$ python3 tools/ci/duplicate_fixes_check.py --gate
duplicate_fixes: allow entry #1783 is STALE -- no open pair claims it any more (a stack, not a duplicate: …); delete the line
rc=0

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 #1783 from the duplicate gate (an allow entry is keyed by issue, not by pair) — a small, quiet hole where there is currently none.

Recommend closing this PR rather than merging it, and leaving duplicate_fixes_allow.txt at "(no entries today)". Nothing here is wasted: the truncation you fixed and the PR3037/# note are the right shape for the next legitimate half, and the diagnosis of read_allow in the thread is the part worth keeping. If it does merge, the line must be deleted in the same push — otherwise it is a stale exemption by construction.

#3037 is still open and still names #1783, but alone: it cannot form a pair, and once it is rebased (it is CONFLICTING on base main now — measured, and the recipe is in that thread) it will be a single 215-line PR that the gate ignores by construction.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The allow entry this PR added is now stale and the tool says so, because #3036 merged: duplicate_fixes: allow entry #1783 is STALE -- no open pair claims it any more … delete the line (rc 0, so it is a report and not a red). That is the removal note the entry's own comment asked for — one line to delete in a follow-up. Its justification text is also self-contradicting now (PR3036 lands first — it landed), so the whole entry goes rather than being reworded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant