Skip to content

perf(tier2): read each target's ninja graph once in the ported-object proof (#3046) - #3049

Merged
zackees merged 2 commits into
masterfrom
infra/3046-ported-proof-cache
Oct 30, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/3046-ported-proof-cache

Conversation

@zackees

@zackees zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member

Refs #3046

The ported-object proof in rust/tools/linux-validate/validate.sh reloaded the ninja graph up to four times per object and walked the build tree once per object. With 176 objects that cost 59 s of the 239 s "Build Tier 2" step, which sits on the merge-queue critical path (run 41034283809). Now each target's inputs, unity groups and Unity includes are read once into a fresh temp dir. The checks themselves are unchanged.

  • RED (test(tier2): ...): ci/test_tier2_ported_proof.py runs the script's own compiles with a counting fake ninja. It fails with "ninja ran 160 times" (want 2). The answers test (direct object, unity group, Unity batch, absent, other target) already passed before the fix.
  • GREEN (perf(tier2): ...): both tests pass, 4.5 s -> 1.9 s locally.

Before: proof phase 59 s (IDENTICAL -> decklink imports). After: will be measured on this PR's Tier 2 build log.

Tiers: CI-only change, no Rust/C behavior. ./lint: green except the known local test_check_changes.py "git: command not found".

… proof (#3046, RED)

RED: ninja ran 160 times for 80 queries over 2 targets (want 2).
…t proof (#3046, GREEN)

The proof loaded the whole ninja graph up to four times and walked the
build tree once per ported object (176 objects, 59 s of the merge
queue's Tier 2 build in run 41034283809). Read each target's inputs,
unity groups and Unity includes once into a fresh temp dir and grep those.

@zackees zackees left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Coordinator review: LGTM; keeping this one over #3050, which fixed the same issue (#3046) in parallel.

  • It is the smaller change (+21/-7 in validate.sh), and the checks stay the same lines: the direct-object grep -qF, the unity group loop and the Unity-include match. Each target's ninja -t inputs, group list and Unity includes are now read once into a temp dir.
  • RED → GREEN: ci/test_tier2_ported_proof.py counts ninja calls with a fake (160 → 2), and the answers test (direct, group, Unity, absent, other target) passes on both sides of the change.
  • Nit: proof_dir is never removed. The container is thrown away, so it does no harm, but a trap 'rm -rf "$proof_dir"' EXIT would tidy up local runs.

Please post the proof phase's time from this PR's Tier 2 log, against the 59 s baseline. Queue on green.

@zackees

zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

Measured on the PR run 41039631881, Tier 2 build job: the ported-object proof (IDENTICAL -> decklink imports) took 17 s, down from 59 s in merge-group run 41034283809. That's 42 s off the Tier 2 critical path. The 'Build Tier 2' step went from 239 s to 173 s, but part of that is the 99.5 % vs 89.2 % zccache hit rate. CI Gate green; queued.

Merged via the queue into master with commit b924e5e Oct 30, 2026
41 checks passed
@zackees
zackees deleted the infra/3046-ported-proof-cache branch October 30, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant