Skip to content

perf(ci): cut the Tier 2 critical path of merge-queue runs (11 min, measured 2026-10-24) #2072

Open

Description

@zackees

Part of #930 (queue runs under 8 min). Measured on 2026-10-24 from the last 12 successful merge-queue runs of ci.yml, and in detail on the 06:13 UTC run (11.3 min).

Where the time goes

The critical path is one chain; everything else (Fast Gate 6.3 min, Format 1.7 min) finishes earlier in parallel.

Stage Time Breakdown
Event Data / CI Mode 0.4 min
Rust Tier 2 Linux (build) 4.4 min 128 s compile; ~100 s Git install, checkout, Tier 2 packages (35 s), cache restore, soldr (21 s)
Rust Tier 2 Linux (tests ON / OFF) 5.5 min 75 s container setup (stock image); 238 s ctest
CI Gate 0.2 min

macOS and Windows Tier 2 take 15-20 min (plus up to 5 min runner queue on macOS) but only run on PRs that touch their platform files (3 of 12 runs).

Slowest tests in the ON run (876 s of test time in total): test_deinterlace_2x_field_order 146 s (RUN_SERIAL), test_async_delay_audio 59, test_portal_shortcuts 53, test_pipewire_screencast_resume 39, test_vlc_audio_pacing 35, test_inhibit_sleep_dbus 32, test_vlc_playlist_gap 30, test_stinger_media_duration 23. Most of these wait in real time.

Proposed work, largest saving first

Together the first three would bring a code PR's queue run to about 7.5-8 min. These are estimates from one run's timings; each item should measure before and after.

Also seen today

Four queue runs failed between 05:12 and 05:35 UTC in Linux Tier 2, and the reruns behind them cost about an hour of queue time. The likely cause, the intermittent test_context_names crash (#2049), was fixed by #2052; flaky tests are the largest throughput cost, more than run length.

Activity

  1. added
    infra
    on Oct 24, 2026
  2. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    Claiming: the Build-job setup item only (~100 s before the Tier 2 Linux compile: Git, packages, soldr). Plan: measure the step times on recent queue runs, cut what can be preinstalled, cached or dropped, one PR with before/after numbers. The other items stay open (#2071 is claimed; the real-time tests are existing C tests, which can't be edited).

  3. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    Claiming: #2072 item "Build-job setup" only (the ~100 s before the Tier 2 Linux compile). Measuring per-step medians over recent queue runs first; the other items stay open.

  4. added
    claimed
    on Oct 24, 2026
  5. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    Build-job setup, measured (median, merge-queue runs that built Tier 2): Install Git 11 s, checkout 10 s, cache restores ~20 s, Install Tier 2 Packages 35 s (apt archive cache hits, so it's dpkg: 594 packages in 29 s), soldr 16 s. Total ~90 s, all serial.

    PR for the safe part: dpkg force-unsafe-io plus no doc/man/info in the throwaway build container (-25% locally, about -7 s on CI). Remaining ideas, unclaimed: run the package install in the background while soldr and the cache restores run (~16 s), and filter: blob:none on the fetch-depth-0 checkout (part of 10 s). The largest setup cost left is the test jobs' runtime (#1592).

  6. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    Landed: #2077 (RUN_SERIAL tests on their own runner), #2085 (prepared runtime plus a small package delta; setup 19-37 s instead of 75-79 s), #2091 (deinterlace rates on two serial runners: 88 s + 59 s instead of 147 s). The queue run that merged #2091 took about 8.5 min (08:49:55-08:58:22 UTC); a matched comparison needs more runs and follows here. Not done: build-job setup (about 30-40 s at most, needs the prepared image as the job container, not worth it now); the slow real-time tests (no longer on the critical path). Flake seen in a queue run meanwhile: #2099.

  7. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    Queue-run comparison (successful merge-group runs; 'Linux done' = run start to the last Linux Tier 2 test job finishing):

    Window (UTC, 2026-10-24) Linux-only runs, Linux done (median) Runs with macOS/Windows jobs, total
    Before, 05:34-07:12 (n=7 / 4) 10.4 min (9.3-15.5) 21-27 min
    After #2091, 08:57-10:50 (n=8 / 6) 9.6 min (7.6-14.1) 20-27 min
    • The Linux Tier 2 path got shorter, but less than the PR runs suggested (about 1 min at the median, not 2.5): four of the eight after-runs finished Linux in 7.6-8.8 min, the other four took 10.5-14.1, which looks like waiting for runners now that each run needs six Tier 2 test runners instead of two; not yet checked job by job.
    • The whole-run median rose (11.1 -> 13.5 min) because more of the later runs selected the macOS/Windows Tier 2 jobs, which take 15-20 min on their own. For those runs, the macOS/Windows jobs are the critical path, not Linux.

    Next levers: runner queue time for the Tier 2 test jobs (check whether six jobs per run wait on ubuntu-26.04 capacity), and the macOS/Windows Tier 2 jobs for platform PRs.

  8. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    Runner wait for the six Tier 2 test jobs, per successful queue run since 08:57 UTC (seconds from the build job finishing to each test job starting):

    • 8 of 14 runs: 2-6 s for all six, so no queueing. Test jobs ran 95-196 s.
    • 6 of 14 runs, all where several queue runs overlapped (09:20, 09:30, 10:12 x3, 10:14): up to 59-294 s for the later jobs, so ubuntu-26.04 capacity is the limit at busy moments.

    The test jobs themselves are now 95-196 s, so the remaining Linux variance is runner capacity, not test time. Going back to four jobs (one serial job per mode, 147 s) would wait less under load but be about 1 min slower when idle. I'm not changing the layout on one afternoon's data; worth re-checking once there's a busy and a quiet day to compare.

    Also seen: the build job took 4.4-5.4 min here (9.0 and 7.4 min at 09:20/09:30) against 3.7-4.4 min this morning; not yet explained (compiler cache hit rate is the first thing to check).

  9. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    Follow-up on the slower build job: not a regression. The compile step took 114-146 s in the afternoon runs against 129 s at 06:13, and zccache hit 938-1061 of about 1,070 compilations in every sampled run (09:20 had the most cold compiles, 127). Setup steps are unchanged (Install Git 10-13 s, packages 35-36 s, soldr 16-20 s). The longer start-to-build-done times (7.4 and 9.0 min at 09:30/09:20) were spent before the job started, waiting for a runner, the same capacity limit as the test jobs.

  10. moved this from In progress to Triage in obs-rust Multiviewon Oct 25, 2026
  11. 28 remaining items

  12. moved this from Ready to In progress in obs-rust Multiviewon Oct 31, 2026
  13. zackees commented on Oct 31, 2026

    @zackees
    MemberAuthor

    Worker tick (obs-studio5), item 4 read against master d13f71466. Items 1–3 are done and merged (#2077, #2085/#3012, #2094/#3023); here is what is left of item 4 and where its floor is.

    The remaining tests, as they are on master

    Test 2026-10-24 queue run Fixed waits on master Verdict
    test_async_delay_audio 59 s 2*delay_ms + 1500 before listening, 4000 listening, per case 35 s + 24 s, see below
    test_portal_shortcuts 53 s none: 10 ms polls already condition-driven
    test_pipewire_screencast_resume 39 s none: 10 ms / 5 ms polls already condition-driven
    test_vlc_audio_pacing 35 s 20 ms poll, 300/700 ms pause window, 4 s files playback is real time
    test_inhibit_sleep_dbus 32 s none (os_sleep_ms/os_sleepto_ns: 0 hits) D-Bus round trips only
    test_vlc_playlist_gap 30 s — #838, released claim, no lever found under load

    So five of the six are already polls or genuinely real-time; only test_async_delay_audio still holds a large fixed sleep.

    test_async_delay_audio: the whole test is two constants

    start_delayed() sleeps 2*delay_ms + SETTLE_MS (1500) and listen() then sleeps LISTEN_MS (4000), once per case. The six cases use delays 3000, 5000, 3000, 1000, 1000 and no filter:

    • pre-listen: 7.5 + 11.5 + 7.5 + 3.5 + 3.5 + 1.5 = 35.0 s
    • listening: 6 × 4.0 = 24.0 s
    • total 59.0 s, which is the 59 s the 2026-10-24 queue run measured. Nothing else in the test costs time.

    Why #3117's trick does not transfer

    #3117 replaced CLIP_MS + 2000 with a poll of obs_transition_is_active() because the transition reports its own state. async_delay_filter reports nothing this test can see: the test never calls obs_source_video_render() or obs_source_video_tick() (the only hit for "tick" in the file is the comment at line 66), so there is no "first delayed frame shown" to wait on, and the audio side has no "delayed audio is now playing" signal either — program audio is only counted in aggregate by the raw-audio callback. The 4 s listen window is assertion coverage (a break anywhere in those 4 s must fail), so it cannot shrink without loosening the check.

    Removing the 35 s needs a new observable, not a shorter sleep. Two shapes, both structural:

    1. drive this test's source from a deterministic clock and step it, the shape the Decided: on Flaky: real-time audio cmocka tests lose audio under machine load (test_vlc_playlist_gap, test_group_hide_transition_audio) #838 describes, so start_delayed() can advance to "the audio is delayed" instead of waiting wall time; or
    2. expose the filter's switched-to-delayed state (an obs_source property or a test-visible callback) for the test to poll.

    Neither belongs in a timed worker tick without an agreed design, so item 4 is at its floor as written: -8.6 s from #3117 (merged 01:09 UTC) and nothing further removable from the other five.

    Recommendation: close #2072 (items 1–3 landed, item 4 exhausted) and, if the remaining ~35 s matters, file the deterministic-clock item as its own proposal rather than leaving this checklist open. I have ticked 1–3 and left 4 unticked with this note.

  14. moved this from In progress to Ready in obs-rust Multiviewon Nov 1, 2026
  15. zackees commented on Nov 7, 2026

    @zackees
    MemberAuthor

    Claiming: merge-queue runner-capacity investigation and compact Tier 2 execution, explicitly assigned by the maintainer. 1. Measure the last 24 hours of merge_group jobs (90 runs collected). 2. Preserve both complete OFF/ON suites while reducing PR/queue execution from six runners to two; retain partitioned main/nightly/release execution and the unchanged CI Gate. 3. Run RED/GREEN checks and the pinned local gate, then open an UNMERGED PR with evidence. First PR expected this session. This does not claim the separate real-time test shortening work.

  16. moved this from Ready to In progress in obs-rust Multiviewon Nov 7, 2026
  17. moved this from In progress to Ready in obs-rust Multiviewon Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraready

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions