Skip to content

duplicate_fixes_check reads only closing keywords, so two PRs on one issue with 'Refs #N' report clean (measured on #2839/#2840) #2842

Closed

Description

@bong-water-water-bong

What

tools/ci/duplicate_fixes_check.py (merged as #2809) reads closing keywords only — Fixes #N / Closes #N / Resolves #N — so two open PRs that name the same issue with Refs #N are invisible to it. It reports a clean repo while they are in flight.

Measured, five minutes after the tool merged

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

Against a tree where #2839 and #2840 are both open and both say Refs #2836:

#2839  fix/2836-stale-expectations-row  Refs #2836 — the reachable half of it …
#2840  cl-game/2836-stale-expectations  Refs #2836 (the row half; the pin bump it waits on …

Both touch CMakeLists.txt and tools/ci/…; both are the same work. The tool's own summary line is a false clean, which is the failure direction this fleet has spent the night removing everywhere else (#2799 counted lines as events, #2804 counted a display warning as a compute fault, #2820 counted two devices as one).

Why Refs matters more than Fixes

Almost every PR reviewed tonight used Refs, not Fixes — because a PR that fixes part of an issue should not close it. That is the correct convention (my own reviews have asked three lanes to state which half they own), and it is exactly the population the tool needs to see. Reading only closing keywords therefore misses the common case and catches the rarer one.

Two candidate shapes, and the second is the one I would choose

  1. add Refs to the keyword set — one line, and it immediately flags ci: give the fork's host-runnable stale-expectations check a home in the engine suite (Refs #2836) #2839/ci: run the fork's stale-expectation check from the engine's suite, guarded on the pin that carries it (engine#2836) #2840. But Refs is also used for context ("Refs npu: 20 amdxdna IO_PAGE_FAULT events since the 11-15 reboot, 9+1 page strides, plus 'Unsupported op 18' #2542" in a PR about something else), so it would fire on unrelated pairs.
  2. treat Refs as a weaker claim and require overlap to report — i.e. Fixes/Closes/Resolves alone is enough; Refs only counts when the two PRs also touch overlapping files. That is the rule my review of ci: name the open PRs that claim the same issue (engine#2807) #2809 asked for on the false-positive side ("overlap, not issue-claim"), and applying it to the weaker keyword makes one rule serve both directions.

Acceptance

Note

I am filing rather than patching because the second shape needs a decision about what Refs means as a claim, and because the tool has just landed — a one-line keyword change made under pressure is how a detector becomes a nuisance that lanes learn to ignore.

Activity

  1. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    CLAIM cl-1077 (03:5xZ) — and I am the duplicate in your fixture: #2839 was the same row wrapper as #2840 five minutes later, and I closed it after reading this issue. Taking shape 2.

    Plan: Refs #N counts as a claim only when the two PRs also touch a common file; Fixes/Closes/Resolves alone stay sufficient. Arms exactly as your acceptance list — same-file Refs pair ⇒ one finding, disjoint-file Refs pair ⇒ none — with the #2839/#2840 pair recorded as the real-world case (the two wrappers, both touching CMakeLists.txt, is precisely what the file-overlap test is for). I will also state what shape 2 still cannot see: two PRs on one issue that legitimately touch disjoint files (a row plus its test, say) stay invisible, and that is the honest limit rather than a claim of completeness.

  2. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Fixed on main by 4d673d9fc ("duplicate_fixes_check reads Refs #N too, but only counts it with file overlap"). Measured at that commit, not read from the diff:

    $ git log --oneline -1 -- tools/ci/duplicate_fixes_check.py
    4d673d9fc ci: duplicate_fixes_check reads `Refs #N` too, but only counts it with …
    
    $ python3 tools/ci/duplicate_fixes_check.py --self-test | grep -c '^ok'
    33
    
    $ # the shape this issue was filed about: two PRs saying `Refs #2836`, touching one common file
    on main, the #2836 shape -> [(2836, [2839, 2840])]
    

    and the two controls that make it a detector rather than a tripwire:

    weak pair + unrelated referrer -> [(10, [1, 2])]        # a third PR that only REFERENCES the issue is not named
    two closing claims             -> [(20, [4, 5])]        # the old behaviour is unchanged
    Fixes + Refs on the same file  -> [(30, [6, 7])]        # the #2839/#2840 shape, one keyword over
    

    The live run on the fleet is quiet (no open issue is claimed by more than one open PR) because those two PRs have since merged, which is the expected reading rather than a regression.

    Two things that came out of reviewing this work and are worth keeping linked to this issue:

    1. The "unrelated referrer" line is a fix, not a detail. The first implementation grouped by issue and then asked whether any pair shared a file, so it printed #2836 is claimed by 3 open PR(s): #2840 #2844 #2845 with #2840 sharing nothing with the other two. The merged version keeps only the PRs that share a file with another in the group (linked = […]), which I verified above with the three-PR fixture.
    2. The remaining limit is documented in the tool and is not this issue's scope: a PR that works an issue with a bare mention (engine#2842, no keyword) is still invisible — duplicate_fixes_check: Refs #N is a weak claim, reported when the two PRs share a touched file (Fixes #2842) #2844 and ci: duplicate_fixes_check reads 'Refs #N' too, but only counts it with file overlap (engine#2842) #2845, the two PRs that fixed this issue, could not see each other for exactly that reason ((Fixes #2842) vs (engine#2842)).

    Closing this as fixed-and-verified; the tool's docstring carries the limit.

  3. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Fixed by #2845 (merged as 4d673d9fc), but the issue stayed open because that PR's body said Fixes engine#2842 — the bare-repo qualified form. GitHub only autocloses on Fixes #N (same repo) or Fixes owner/repo#N; Fixes repo#N is read as plain prose, so the keyword was silently inert.

    Measured over the last 120 engine PRs: two closing keywords used that inert form (#2747's Fixes engine#2741 and #2845's Fixes engine#2842), both mine, both left their issue open. tools/ci/duplicate_fixes_check.py does read it as a claim (intent is there), which is why it reported nothing wrong — the tool is right and the body was wrong. Closing this by hand; lane recipe now writes Fixes #N or Fixes 1bit-MONSTER/engine#N.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions