Skip to content

ci: prove Tier 2 ported objects in one Python pass - #4968

Merged
zackees merged 3 commits into
masterfrom
perf/4954-tier2-ported-proof
Nov 17, 2026
Merged

zackees merged 3 commits into
masterfrom
perf/4954-tier2-ported-proof

Conversation

@zackees

@zackees zackees commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

validate.sh's ported-object proof drops from 139.5 s to 0.8 s, and its answers are unchanged. Refs #4954.

Why

  • What it checks. validate.sh proves each ported C object is compiled into libobs-c-reference and kept out of hybrid libobs.
  • Why it was slow. It ran as a shell loop that spawned a grep per object per unity group, so each build spent minutes spawning processes.
  • Where it showed. On the Dell, a warm Tier 2 build with a kept tree and nothing to rebuild took 385 s. The loop was 176 s of that: per-line timestamps show 158 s → 334 s between IDENTICAL (1768 symbols) and decklink.so imports. ninja -t inputs itself takes 0.2 s per target.

Change

rust/tools/linux-validate/ported_proof.py now holds the predicate. A target compiles a source when any of these holds:

  • Ninja lists <target>.dir/<object> among the target's inputs;
  • one of its BUILD.md unity groups includes "<source>";
  • one of its CMake Unity batches includes …/<source>.

It reads each target's lists once and answers in memory. validate.sh runs it once for all ported objects, printing the same FAIL: lines, and for the four obs-nvenc loader checks. The shell functions are removed, so there is one implementation.

Evidence

Parity, on the Dell's real kept Tier 2 tree with the 469 ported objects:

Time Answers
shell predicate (verbatim from master) 139.5 s 942
ported_proof.py ported 0.8 s 942, identical (diff empty; 471 true in both)

The 942 answers are libobs and libobs-c-reference per object, plus the obs-nvenc checks.

RED: ci/test_tier2_ported_proof.py (12 cases, with a fake build tree and a stub ninja) fails with 11 failures and 1 error before the module exists.

GREEN:

  • 12/12 pass.
  • test_tier2_native, test_tier2_build_setup and test_tier2_build_errors pass.
  • ./lint passes.

validate.sh proves each ported C object is compiled into
libobs-c-reference and kept out of hybrid libobs. It does this with a shell
loop that spawns a grep per object per unity group. On the Dell (#4954) a
warm build with nothing to rebuild spent 176 of its 385 s in that loop:
469 objects x 2 targets x every group file. ninja -t inputs itself takes
0.2 s per target.

The new cases expect rust/tools/linux-validate/ported_proof.py:
- to answer the same predicate (own object, unity group, CMake Unity batch)
  from lists read once;
- to print the same FAIL lines;
- to serve the obs-nvenc loader check too;
- to be what validate.sh runs.

Refs #4954
rust/tools/linux-validate/ported_proof.py holds validate.sh's "does
<target> compile <source>" predicate:
- Ninja lists <target>.dir/<object> among the target's inputs; or
- one of its BUILD.md unity groups includes "<source>"; or
- one of its CMake Unity batches includes .../<source>.

It reads each target's inputs, groups and batches once and answers in
memory. validate.sh runs it once for all ported objects (same FAIL lines)
and for the four obs-nvenc loader checks. The shell functions are gone, so
there is one implementation.

Measured on the Dell's kept Tier 2 tree (#4954), 469 ported objects:
- shell predicate: 139.5 s;
- ported_proof.py ported: 0.8 s;
- all 942 answers (libobs and libobs-c-reference per object, plus the
  obs-nvenc checks) are identical.

That loop was 176 s of a 385 s warm build with nothing to rebuild.

Refs #4954

Ci-Attestation: {"at":1794912568,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":51,"stamp":"adb811f9491dd299aa8f239d936aa64d","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912568,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":51,"stamp":"870997d9cc350b631c7485e1b4d36f0e","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912568,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":51,"stamp":"7256bfc747bbd6ffea19beedb7b07af9","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912568,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":51,"stamp":"1ac4d665740b9f29bd31084884f712ae","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"general/all/client-lint","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"7fd547c8946b8c499279150df5b9a2b9","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912568,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":51,"stamp":"1e3ea477520a897012b1756fe9827e90","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"fbdfd2c91561a2f6be01b3dd8aff30f1","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"ab008a52cdf2e16898428dfde4ec5920","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"d5ee43e70f4cd476aa5eb59e7e9dfd67","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"f8864cf868e17af05e42d5a68d4d68a6","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"81739fac086f1b980b724802f41a8dea","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"e5c4f82ce65ea4a87199b61fb3de4830","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"7e4a6c2369c45a575cf26350cfc81a6f","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"6fa3a23fb0799ec8d61c2a9b99b73149","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"c5f08851394796d1d941df2d5eea9e90","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"ab5844615722ec1c459019ecc2bc25fa","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"67202185f99ce7b52789d5b07fe91d24","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912515,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"1ba31fde6126a2ce2c9070751aab1bf7192793c2a22d6f24fafedc8811853d95","lane":"client-lint","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":10,"stamp":"a75fbee572ffee042771e175a1a3530f","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}
Ci-Attestation: {"at":1794912843,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"82262efa32df332f01b29fb4bd3dec251c6d15d3432f6f14e385a1358ef9a84d","lane":"client-test-x86_64-unknown-linux-gnu","parents":["bb32017e2320a54945730e89dc383f434c42f40b"],"secs":275,"stamp":"b871e8f3fd4d1ae63beac6f81671f295","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"3ea35fc19440a41d82a83791e325baaf8b36ed7f","coverage":"all-tracked-applicable-files","diff":["ci/test_tier2_ported_proof.py","rust/tools/linux-validate/ported_proof.py","rust/tools/linux-validate/validate.sh"],"head":"b00d6575fbc2c8fb1381e8776a18c129622e113a","tools":{"orchestrator-python":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]","schema-dependencies":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504\n   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ISO8859X Regexps Automata RelaxNG Schemas Modules Debug"},"tracked-digest":"e76eb57ec81a5ee4280e85283d607ca06b06fb4e16c826eaafd0489ba923b1a2","tree":"76466e4624ca8d0fb4549aa039fae517c72e75c2"}}
@zackees
zackees added this pull request to the merge queue Nov 17, 2026
@zackees
zackees removed this pull request from the merge queue due to a manual request Nov 17, 2026
@zackees
zackees added this pull request to the merge queue Nov 17, 2026
Merged via the queue into master with commit 295680b Nov 17, 2026
40 checks passed
@zackees
zackees deleted the perf/4954-tier2-ported-proof branch November 17, 2026 18:38
@obs-rust-project-manager obs-rust-project-manager Bot moved this to In merge queue in obs-rust Multiview Nov 17, 2026
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In merge queue to Done in obs-rust Multiview Nov 18, 2026
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