Skip to content

ci(tier2): ported-object proof reloads the ninja graph ~700 times (59 s on the merge-queue critical path) #3046

Closed

Description

@zackees

Problem

The Tier 2 Linux build job is on the merge-queue critical path, and 59 s of its 239 s build step goes to the ported-object proof in rust/tools/linux-validate/validate.sh, not to compiling.

Merge-group run 41034283809 (PR #3032, the only Tier 2 merge_group run after #3036):

phase in "Build Tier 2" time
configure + build (zccache 89 % hit) 165 s
ported-object proof (IDENTICAL -> decklink.so imports) 59 s
pack + Debug staticlib 15 s

For each of the 176 ported objects, compiles() runs twice (libobs, libobs-c-reference). Each call runs ninja -C "$build" -t inputs <target> up to twice and a find "$build" over the whole build tree. That adds up to about 700 full ninja-graph loads and 176 tree walks. The inputs of a target don't change during the loop.

Fix

Read each target's ninja -t inputs list and Unity include list once into a fresh temp dir, then grep those files. The proof still checks the same things. Test: ci/test_tier2_ported_proof.py runs the extracted functions with a counting fake ninja.

Expected saving: about 55 s on the Tier 2 critical path (merge queue and PRs that touch libobs).

Activity

  1. zackees commented on Oct 30, 2026

    @zackees
    MemberAuthor

    Claiming: #3046. Plan: 1) RED: ci/test_tier2_ported_proof.py counts ninja calls in the proof. 2) GREEN: cache each target's inputs and Unity list once. One PR today; I'll measure on the merge queue afterwards. This is the only item in this PR; the other merge-queue sinks I measured are under 10 s or are on the dead-end list.

  2. added
    ready
    on Oct 30, 2026
  3. zackees commented on Oct 30, 2026

    @zackees
    MemberAuthor

    Fixed by #3049. Merge-group run 41042404269: the ported-object proof took 14 s (was 59 s in run 41034283809). The Tier 2 build job took 4m05s (was 5m40s), and CI Gate finished 7m26s after queue start (was 9m16s; part of that is a warmer zccache, 99.5 % vs 89.2 %). Nothing left for this issue. Next candidates: Fast Gate unit tests (251 s) and Tier 2 test shards (~130 s each), now that the Tier 2 path is only slightly longer than Fast Gate.

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

Metadata

Metadata

Assignees

Labels

ready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions