Repository navigation
Description
Goal
Cut a code PR's merge-queue run from 13–15 min to under 8 min, and keep docs/CI-only runs at 2–4 min, without weakening the gate (RED→GREEN, Tier 2 ON/OFF, differential coverage).
Where the time goes now (measured 2026-10-15)
Merge-queue runs of the Pull workflow:
| Run | Before (morning) | Now |
|---|---|---|
| Code PR | 25–27 min | 13–15 min |
| Docs/CI-only | — | 2–4 min (lane proofs) |
Jobs in a code-PR queue run (#918):
| Job | Time |
|---|---|
| Rust Tier 2 Linux | 13.1 min (all of it in the one step Validate Tier 2 (ENABLE_RUST_LIBOBS OFF vs ON)) |
| Rust Tests (ubuntu) | 3.1 min |
| clang-format / gersemi | 1.5 / 1.3 min |
| everything else | < 0.5 min |
Tier 2 Linux is the critical path. Everything else runs alongside it.
Already landed (context)
#716 merge queue · #807 lane proofs · #898/#911 path-scoped platform jobs · #837 Tier 2 -j4 · #783 Tier 2 under xvfb/PipeWire/D-Bus · #717 submodule guard · #721 retries · #924 maintainer bypass and jump-to-front
Follow-ups
A. Tier 2 Linux (critical path, the biggest payoff)
- A1. (done: per-stage timing in the split jobs, ci: Tier 2 Linux builds once and shards the tests #975) Break down the 13 min: time configure, build, OFF ctest and ON ctest separately in the step's log and the job summary. This is needed before A2–A4 can be judged.
- A2. (done: ci: Run Tier 2 Linux natively on the runner #967, then build once + 6 shards ci: Tier 2 Linux builds once and shards the tests #975/ci: Tier 2 test shards run without a Rust toolchain #1044/ci: Balance Tier 2 Linux shards by recorded test duration #1049, 13 → 6.9 min) Split OFF and ON into two parallel jobs (matrix), so they don't run one after the other. Expected about −5 to −6 min.
CI Gate ✅needs both. - A3. (closed with data: runners are nproc=4, -j4 already saturates them; the slow shard was order-bound, fixed by ci: Tier 2 Linux shards start from the merged test timings #1098: 168 → 117 s)
A4. Warm ccache: dropped. The Tier 2 C compile already hits ccache about 99.8% of the time (comment inbuild-project.yaml), so the 13 min is test execution, which no compiler cache (ccache, soldr, zccache) speeds up. A1 confirms this.- A5. (done: ci: Tier 2 Linux lane proof ignores Rust tests and unbuilt crates (#930 A5) #1093 drops rust/*/tests,benches,examples and the crates Tier 2 never builds from the proof inputs, checked by ci/test_tier2_proof_inputs.py) Narrow the tier2-linux lane-proof inputs: a change only to
rust/files that no Tier 2 binary links should hit the proof.
B. Per-run setup
soldr and zccache pay off here and in C (Rust and C++ compiles on cold or slow runners), not in Tier 2. zccache has replayed stale output (docs/ci-tooling.md), so leaning on it harder needs that fixed first.
- infra: CI: PR runs spend most of their time on per-run setup #427: PR runs spend most of their time on per-run setup
- infra: obs-studio-libs prebuilt build-dependency cache (phase 2 of #520), gated on CI-time measurement #525: obs-studio-libs prebuilt build-dependency cache
- perf: accelerate Windows/macOS validation CI and publishing with compiler caches, PCH and zccache/reld #782: compiler caches, PCH and zccache for Windows/macOS validation and publishing
C. Platform jobs (macOS/Windows off the per-PR path)
-
ci: Start native jobs for edits inside platform #if blocks in shared files #896: start native jobs only for edits inside platform(superseded by path-only scoping + ci: Ratchet platform conditionals in shared C/C++ files (#847) #900 ratchet)#ifblocks in shared files - meta: Cross-compile through Soldr to shrink macOS/Windows CI #700: cross-compile through soldr to shrink macOS/Windows CI (branch
infra/695-soldr-cross-linkin progress) - ci: Move per-PR native macOS/Windows jobs to post-merge once cross lanes link and run #698: move per-PR native macOS/Windows jobs to post-merge once cross lanes link and run
- ci: Let local native lanes attest the macOS and Windows jobs #443: let local native lanes attest the macOS and Windows jobs
- Keystone: meta: Platform-scoped CI (keystone for CI optimization) #897, platform-scoped CI
D. Full and release builds (not on the PR path)
- ci: Flatpak build takes ~17 min; where the time goes #651: Flatpak build takes ~17 min
- ci: Build the full app with ENABLE_RUST_LIBOBS=ON and run Tier 4 against it #140: build the full app with
ENABLE_RUST_LIBOBS=ONand run Tier 4 against it (coverage; keep it off the critical path)
E. Queue hygiene
- E1. (done: ci: Queue runs report wall time and rebuilds in the job summary (#930 E1) #1095, CI Gate summary on queue runs; first live: run 38927842294) Report each queue run's wall time, and whether it was rebuilt by a bypass, in the job summary, so regressions show up. Today the numbers come from
gh run listby hand. - E2. (done: docs: Bypass the queue only when it's empty (#930 E2) #1096, coordination.md §8) Use the bypass (coordination.md §8) only when the queue is empty, and jump-to-front otherwise. Revisit if rebuilds show up in E1.
Measuring done
Median code-PR queue run over a day of merges is under 8 min (E1 or gh run list --workflow pr-pull.yaml --event merge_group), with no drop in Tier 2 test count, ON or OFF.
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTracker
Activity
zackees commentedon Oct 16, 2026
How Tier 2 runs today (
rust/tools/linux-validate/validate.sh):for mode in OFF ON(line 75): each mode configures, builds and runs ctest, and the two modes run one after the other.-j "${OBS_CTEST_JOBS:-1}"(line 104), with CI settingOBS_CTEST_JOBS: 4(build-project.yaml:916, ci: Run Tier 2 Linux ctest with -j4 #837). Locally the default is 1.xvfb-run -adisplay is shared by every test in a mode.So A2 comes first: separate OFF and ON jobs should roughly halve the 13 min. A3 is less certain: the runner has 4 vCPUs, so
-j4already matches the core count. Going higher only helps if tests mostly wait (sleeps, timeouts, PipeWire or D-Bus startup), which A1 will show, and the shared display may needRUN_SERIALfor tests that interfere.zackees commentedon Oct 16, 2026
A1 measured from the Tier 2 Linux log of #918's queue run (timestamps of
validate.shphases):-j4)Compiling is about 1 min of the 12.9; tests are 9.4 min and setup is 2.4 min.
Slowest tests (OFF run):
test_deinterlace_2x_field_order82.8 s,test_async_delay_audio59.3,test_startup_cycle_stress47.7,test_portal_shortcuts42.7,test_vlc_audio_pacing34.6,test_vlc_playlist_gap26.4,test_audio_clock_drift23.5,test_stinger_media_duration23.4,test_vlc_audio_track20.4,test_audio_sync_offset_change19.0. The top 10 sum to about 380 s, more than the whole 285 s run. They look like real-time media tests, so they mostly wait instead of using CPU.Revised order:
COST, or keepCTestCostData.txtbetween runs; a fresh container has none, so long tests can start last) and raise-jpast 4, since waiting tests don't compete for the 4 vCPUs. Expected: each ctest goes from about 4.7 min to about 1.5–2 min; the floor is the longest test (about 83 s) unless it can run faster than real time.libobs.soand a Rustlibobs.so(same soname and exports, viaLD_LIBRARY_PATH). This is a stronger ABI check, makes the C library cacheable from master, and lets Rust-only PRs skip the OFF build and the OFF ctest (about 5 min). Check first: decklink/obs-nvenc link libobs dynamically, and both libraries come from one configure.Combined target for Tier 2: about 4–5 min, down from 13.
zackees commentedon Oct 16, 2026
A7: fail fast on exports and ABI before any test runs.
Today
validate.shcompares the twolibobs.soexports (nm -D, "IDENTICAL (1766 symbols)") last, after both ctest runs, so an export mismatch costs the full 13 min. New order:nm --defined-only -g libobs.dir/util/<unit>.c.o) must equal the Rust staticlib's exports for that unit, minus an allowlist of Rust runtime internals. A mismatch fails in seconds and names the unit and symbol. It also catches the case where both sides link only because another object defines the symbol.nm -DOFF/ON comparison, moved to run before ctest. It catches link-time problems such asrust-exports.mapletting internals through.nmcompares names only (C symbols carry no types). Addabidiff libobs-C.so libobs-Rust.so(libabigail), which reads the DWARF from theRelWithDebInfobuilds and compares function signatures and struct layouts. Check first how well it handles Rust DWARF for#[repr(C)]types; it may need suppressions for Rust-only internals. This complements the per-struct layout tests.This pairs with the swap design (one set of test binaries, two
libobs.so): both libraries exist as artifacts before any test runs, so all of these checks run first.zackees commentedon Oct 16, 2026
A7 follow-up: the Rust side of
libobs.sohas no signatures today.Checked with
gdb -batch -ex 'ptype …'on the local Tier 2 OFF and ON libraries:[profile.release]inCargo.tomldoesn't enable debug info, so the Rust staticlib carries no DWARF, andabidiffwould see only names on the ON side. To make the signature check real:CARGO_PROFILE_RELEASE_DEBUG=2(shipped builds unchanged). "limited" or line-tables-only debug info leaves out parameter types.usizevssize_t,*mut Dstrvsstruct dstr *,c_charvschar).abidiffcompares what the types resolve to, but some suppressions will be needed; tune them once on the current 1,766 exports.nm(names), thenabidiff libobs-OFF.so libobs-ON.so(signatures and layouts), then ctest.Tools:
gdb ptype,llvm-dwarfdump,readelf --debug-dump=infoare available now.abidw/abidiff(libabigail) andpaholeneed adding to the Tier 2 image.zackees commentedon Oct 16, 2026
A7 revised: check signatures with the compiler, not DWARF. Supersedes the previous comment's
CARGO_PROFILE_RELEASE_DEBUG=2+abidiffplan. Full debug info bloats every object, slows linking and inflates the cache, all to recover what the public headers already state.Signature check: generate a C header from the Rust
extern "C"exports (cbindgen), and compile one translation unit that includes it together with the real public header:A mismatch fails the compile with
conflicting types for 'dstr_ncat'. This uses C's own compatibility rules (size_t/usize,char/c_char), needs no suppressions, and is text in and text out, so ccache handles it. cbindgen needs config to emit the C tag names (struct dstr), not the layouts.Mirror option on the Rust side: bindgen declarations from the C headers, plus a compile-time assertion per export:
That fails
cargo build, so it runs in the lint lane before Tier 2.A7 order:
nm: names complete, none missing or extra.Steps 1–3 take seconds, need no debug info and cache cleanly.
zackees commentedon Oct 16, 2026
Do first: #937, the target design for Tier 2 Linux: build once (C
libobs.so+ Rustlibobs.so+ test programs), then fan the tests out over parallel runners (library × shard). Builds are about 1 min of the 12.9 and tests are 9.4 min back to back, so splitting the tests is the win. Expected Tier 2 at about 3–4 min. A2 (OFF/ON as parallel jobs, in progress) and #931 (slow tests first) are steps toward it.22 remaining items
zackees commentedon Oct 16, 2026
A5 (#1093) demonstrated with
ci/lane_proof.py key --lane tier2-linux --base origin/masteron stacked probe commits:ca487d36…rust/obs-util/tests/*.rsca487d36…(same)rust/obs-gpu-status/src/lib.rs(not built by Tier 2)ca487d36…(same)rust/obs-util/src/lib.rs(built)38b4a1a8…(new)So a queue run for a test-only or unbuilt-crate change hits master's proof and skips Tier 2 Linux: build ~3 min + 6 shards ~1.5–2 min each ≈ 13–15 runner-min per such run (master run 38934065121 numbers).
zackees commentedon Oct 16, 2026
Full run 38936650968 (dispatch on master):
macos-tier2-xcas-266b6515…(this run built cold by design, 6.8 min). PR/queue runs touching macOS paths now restore it; I'll post the first restore's time against the ~10 min baseline (run 38908431573).zackees commentedon Oct 16, 2026
#978 (157 → 22 integration-test binaries) measured on master run 38941912537 vs 38892442457:
cargo test --no-runper target: Windows MSVC 62 → 37 s, aarch64 macOS 64 → 37 s, x86_64 macOS 57 → 32 s; lane 299 → 229 s; job 360 → 300 s.zackees commentedon Oct 17, 2026
Claiming: evaluate moving only the Tier 2 compile stage ahead of Fast Gate under #1286. Current generated graph serializes independent runners: Fast Gate -> Tier 2 build -> OFF/ON tests. The build consumes no Fast Gate artifact; scope/proof checks come from check-event/ci-mode. Proposed policy exception: compile can overlap Fast Gate, but both OFF/ON test jobs explicitly wait for Fast Gate and successful build; a skipped attested Fast Gate remains allowed, while failed/canceled gates block tests. All existing required checks remain. This trades possible wasted compilation on red PRs for shorter successful queue critical paths, so document the exception and model/measure runner cost. No workflow graph change has been made yet.
zackees commentedon Oct 22, 2026
Final speed-batch report: #1754; measurements and portable evidence. The maintainer explicitly waived the24h wait; the fixed after window is October22,05:52–07:12:45UTC (80m45s),36listed/29terminal/7active-or-queued at capture. This is not a full-day result.
#1701 allows tests to overlap remaining FastGate work without removing that required check. Baseline median opportunity was0s; benefit is run-dependent. Current complete-Linux matched queue median526→560.5s (n5→2), although samplep95709→574s and medianrunner-minutes18.167→16.367. The under8minute queue target remains unproven and this issue stays open. Broad queue709→352s must not be used because after cohorts include Qt-only/FastGate-only selections.
Additional trace attribution from the same portable records: dependency-ready→test-start median3s before (10mode jobs) versus30s after (4mode jobs). Run39735875632 waited57sON/59sOFF after its builder and metadata dependencies completed, versus3s/3s in39732507051. This includes orchestration/dispatch; it does not prove runner-capacity exhaustion. FastGate had already completed before the builder in both after runs, so removing that dependency had no opportunity in these two queue samples.
ci: Keep the timings job's uv save master-only (#930)
ci: Install uv before merging the Tier 2 test timings (obs-rust#930) (o…