Skip to content

ci(tier2): read each Ninja target's inputs once in the ported-object proof (#3046) - #3050

Closed
zackees wants to merge 2 commits into
masterfrom
fix/3046-tier2-proof-cache
Closed

zackees wants to merge 2 commits into
masterfrom
fix/3046-tier2-proof-cache

Conversation

@zackees

@zackees zackees commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

RED commit d66d55945 (test only): ci/test_tier2_ported_proof.py drives the
extracted proof with a counting fake ninja and asserts one graph load per target
instead of per object. It failed at load_proof() with FileNotFoundError —
rust/tools/linux-validate/ported_proof.py did not exist.

GREEN commit b8a8d44a0: the proof moves to
rust/tools/linux-validate/ported_proof.py, which indexes each target's
ninja -t inputs list, its unity group batches (BUILD.md) and its
<target>.dir/Unity batches once, then answers every compiles() from that
index. validate.sh calls it once for the whole object list instead of twice per
(object, target) pair plus a find of the build tree.

The three answers are the ones the shell function gave — a direct object below
<target>.dir, a source included by one of the target's unity group batches, a
source included by <target>.dir/Unity/unity_N_c.c — with the same FAIL: text
and exit status. The obs-nvenc loader twin check (#645) is unchanged.

Measurement

On obs-studio5 against the real build/ tree (1.5 MB build.ninja):

old shell loop new proof
176 ported objects ~0.15 s per object (~26 s on this host) 0.11 s total (2 graph loads)
389 libobs unity-group sources (equivalence run) ~60 s 0.5 s

Equivalence: all 389 sources of libobs' build/*.h.c unity groups through both
implementations — 0 mismatches, 9 real group hits, so the group path was
exercised against real data and not only the fixtures.

Not measured here: the merge-queue win. The 59 s in the issue is merge-group run
41034283809; this checkout has no libobs-c-reference target, so the full proof
lanes were not run locally. Expected saving ~55 s of the 239 s Tier 2 build step;
I will measure it on the merge queue afterwards and comment the number.

Tests

ci/test_tier2_ported_proof.py, 8 tests, all green; picked up by ./lint's
ci/test_*.py sweep.

Test cost: new tests longest 0.46 s (the 50-object graph-load count, which spawns
the fake ninja twice), peak RSS 23 MB over the module, no own threads.
Windows/macOS: pure Python + ninja -t inputs, no platform code.

CI/docs scope: CI-only change (rust/tools/, ci/), so no docs/features.md
line (coordination.md §4).

Refs #3046

…3046)

RED. rust/tools/linux-validate/validate.sh runs `ninja -t inputs <target>`
twice per (portable object, target) pair plus a `find` of the build tree, so
176 ported objects load the Ninja graph about 700 times: 59 s of the
merge-queue critical path in merge-group run 41034283809.

The test drives the proof that replaces it -- rust/tools/linux-validate/
ported_proof.py -- with a counting fake `ninja`, so it asserts the graph is
read once per target, not once per object. ported_proof.py does not exist
yet: this run fails at load_proof() with FileNotFoundError, which is the
missing port.
…proof (#3046)

GREEN. `validate.sh`'s proof ran `ninja -C build -t inputs <target>` up to
twice per (ported object, target) pair plus a `find` of the build tree: about
700 full Ninja-graph loads and 176 tree walks for 176 objects, 59 s of the
Tier 2 merge-queue critical path (merge-group run 41034283809).

The loop moves to `rust/tools/linux-validate/ported_proof.py`, which indexes
each target's `ninja -t inputs` list, its unity group batches (BUILD.md) and
its `<target>.dir/Unity` batches once, then answers every `compiles()` from
that index. The three answers, the FAIL text and the exit status are the ones
the shell function gave; the obs-nvenc loader twin check (#645) is unchanged.

Measured on obs-studio5 against the real `build/` tree: 176 ported objects
answered in 0.11 s (two graph loads) where the shell loop took ~0.15 s per
object (~26 s for the same list on this host). Equivalence: all 389 sources
of libobs' unity groups through both implementations, 0 mismatches, 9 real
group hits.

Refs #3046
@zackees

zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

Coordinator: closing as a duplicate of #3049, which fixes #3046 with a smaller change to validate.sh (+21/-7, against a new 193-line Python module here), the same RED (a counting fake ninja) and checks already running. Two things here are worth carrying over if #3049's numbers fall short: the equivalence run (all 389 libobs unity-group sources through old and new, 0 mismatches) and the measured 0.11 s for the full proof. If #3049's Tier 2 log still shows the proof as significant, reopen this as a follow-up.

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