Skip to content

infra: allow multi-directory edits for warning-ratchet work — per-directory PRs cost ~35 min of CI each #2689

Closed

Description

@zackees

The warning-ratchet work (#516 and its five children) is currently shaped by a one-PR-per-directory convention. That convention is not written down anywhere, it contradicts #2625's own acceptance criteria, and it multiplies an expensive CI run by the number of directories. This issue changes the process: allow multi-directory edits for mechanical warning work.

What the process costs today

Measured, not estimated:

At ~35 min per PR plus a queue run, a per-directory split of the largest issue is 10–20× the CI cost of doing it once, and that is before the rebase churn of four sibling PRs editing compiler_common.cmake.

Why the split is also wrong on the merits

  1. It is folklore. grep -niE "per-directory|one directory per|directory per PR" over docs/ and .claude/ returns nothing. The rule exists only in issue bodies and in worker instructions, so nothing can be reviewed or changed except by rewriting each issue.
  2. It contradicts build(cmake): Drop the conversion pins (-Wno-conversion, -Wno-sign-conversion, -Wno-float-conversion) #2625's acceptance criteria. The split mechanism is "per-directory PRs that each delete the pin only for their own files" — i.e. per-directory -Wno-* — while the same issue says "no per-file -Wno-* replaces the global pin". The fallback is exactly what the acceptance forbids, and it leaves the tree in a state where the flag list is half-deleted, which is not the GREEN state anyone wants to bisect to.
  3. Each slice changes the compile flags, so each slice pays a full invalidation. A flag list edit changes the command line for every TU, and build(cmake): Drop the conversion pins (-Wno-conversion, -Wno-sign-conversion, -Wno-float-conversion) #2625's own plan notes zccache does not key on flags — so a sliced series invalidates the cache (or worse, returns stale objects) repeatedly, ending with the final slice invalidating everything again.
  4. The diff is mechanical. These fixes are casts and widened types. Splitting them by directory buys nothing at review time that a per-directory table in one PR body does not buy, and it makes rebases worse, not better.

Proposal

  1. Policy: one PR per warning class, any number of directories. The only condition is that the diff stays mechanical (explicit casts / widened types, no behaviour change, no #pragma GCC diagnostic ignored, no per-file -Wno-*). The PR body carries a findings table grouped by directory so the reviewer can read it in slices. Write this into WORKFLOW.md (Definition of Ready) and the coordination docs, and delete the per-directory fallback sentence from build(cmake): Drop the conversion pins (-Wno-conversion, -Wno-sign-conversion, -Wno-float-conversion) #2625 and its siblings.
  2. Make the iteration gate cheap. RED and the inner loop become a -fsyntax-only replay of the affected TUs from the Tier 2 build volume's ninja -t compdb with the three -Wno-* dropped — the technique build(cmake): Drop the conversion pins (-Wno-conversion, -Wno-sign-conversion, -Wno-float-conversion) #2625 already specifies. That is minutes and needs no link. One full Tier 2 build is required only for GREEN.
  3. Land the flag removal in the same PR as the fixes. One invalidation, not N, and a tree that never sits in the half-deleted state.
  4. Batch the siblings that touch the same lists. build(cmake): Compile C with -Wpedantic (deps/glad exempt) #2623/build(cmake): Drop -Wno-missing-prototypes and -Wno-strict-prototypes #2624/build(cmake): Drop the conversion pins (-Wno-conversion, -Wno-sign-conversion, -Wno-float-conversion) #2625/build(msvc): Raise /W3 to /W4 and delete the dead /WX link option #2626 edit the same two files; one branch with one commit per class and one full run at the end is cheaper than four PRs × (PR run + queue run) plus three rebases.
  5. Scope PR CI for flag-only C changes. A C warning-flag edit does not need Rust Tests on windows-2025 (14 min) and macos-26 (13 min), or the macOS/Windows Rust Tier 2 jobs (12 + 10 min) on every push to the branch — those are the critical path, and they are the right gate at queue time. This is the single biggest lever: it takes the 35-minute loop down to the Linux Tier 2 build plus cross-compile (~10–11 min). Needs a changed-file rule in the existing gate rather than a new workflow.

Acceptance criteria

Not claimed

I did not measure the conversion-warning volume (#2625 says to re-measure). The zccache flag-keying statement above is from #2625's plan comment, not re-verified here. The CI durations are from the runs of #2643 and the ci.yml history on 2026-10-27.

Activity

  1. added
    infra
    P1
    size:M
    on Oct 27, 2026
  2. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Claiming: investigation — I am the filer, so this is a resume rather than a takeover; nothing is assigned and no branch exists for it (git ls-remote --heads origin | grep -i warning is empty).

    What I will deliver, in this order:

    1. ci/warning_findings.py + ci/test_warning_findings.py: the acceptance-criteria helper. Given a Tier 2 build tree (or an exported compile_commands.json), it replays only the affected TUs with the chosen -Wno-* dropped plus -fsyntax-only, and prints the findings grouped by directory (and --json for a PR table).
    2. The multi-directory policy written into docs/rust-port/coordination.md (this repo); the WORKFLOW.md half lives in obs-rust/.github, so it is a second, separate PR.
    3. Re-scope build(cmake): Drop the conversion pins (-Wno-conversion, -Wno-sign-conversion, -Wno-float-conversion) #2625 with the "one PR per warning class" shape and remove its per-directory fallback sentence.

    Out of this claim: item 5 (scoping PR CI for flag-only C changes) changes the gate and waits on the maintainer; #2623/#2624/#2625/#2626 batching is a coordinator call, not a worker call.

    First PR (items 1 and 2 in this repo): within the hour.

  3. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    /ready

  4. added
    needs-investigation
    on Oct 27, 2026
  5. added
    ready
    and removed
    needs-investigation
    on Oct 27, 2026
  6. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Claiming: ci/warning_findings.py + the multi-directory policy in docs/rust-port/coordination.md (acceptance items 1 and 2 of this issue; the WORKFLOW.md half is a separate PR in obs-rust/.github).

    Plan:

    1. RED: ci/test_warning_findings.py — it drives the module against a stub compiler over a fake compile_commands.json, and fails on master because the module does not exist.
    2. GREEN: the module replays only the selected TUs with the named -Wno-* dropped and -c swapped for -fsyntax-only, then prints the findings grouped by directory (a table by default, --json for a PR body). No CMake change, no cache: it reuses the Tier 2 build tree's ninja -t compdb output, so the measurement costs minutes instead of a 35-minute CI run.
    3. Docs: one policy paragraph in coordination.md (mechanical warning work is one PR per warning class, any number of directories, with a findings table in the body), and the "one PR per C file or unit" line made explicit about the exception.

    Item 3 of the acceptance criteria (re-scoping #2625) is an issue edit; I will do it after the PR is up so the issue text can point at the merged helper.

  7. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Part 1 and 2 are up as #2698 (ready, not draft): RED c63a13e04 (8 errors, module missing) → GREEN 379524300 (ci/warning_findings.py, 8 tests OK, ./lint ok) → docs 629eb95de (the §4 policy, and §2's claim line naming the exception).

    WORKFLOW.md lives in obs-rust/.github, so that half is a separate PR; it is linked here when it is open. Re-scoping #2625 follows this merge so the text can point at the merged helper.

  8. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Landed as #2698 (merged d9be0446, CI Gate ✅ green): ci/warning_findings.py + ci/test_warning_findings.py (#!/usr/bin/env -S uv run --script, stdlib only) and the §4 policy in docs/rust-port/coordination.md.

    Still open on this issue, and who holds it:

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

Metadata

Metadata

Assignees

Labels

P1infrareadysize:M

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions