Skip to content

perf(ci): shorten serial Tier 2 tests, overlap Qt builds, and reduce setup delays #1581

Closed
1 of 1 issue completed

Description

@zackees

Context

Next batch of CI performance work following #930 and #1286. Existing overlap of Fast Gate with Tier 2 compilation and independent OFF/ON test runners is already deployed. The remaining opportunity is serial test scheduling, Qt serialization, repeated setup, and unexplained runner delays.

Snapshot: eight successful PR/merge-group runs inspected around October 20–21, 2026 UTC. These are unmatched observations, not a controlled before/after benchmark.

Representative queue run: https://github.com/obs-rust/obs-studio/actions/runs/39521142237

Critical-path phase Observed elapsed
Initial orchestration 36 s
Fast Gate and Tier 2 build, overlapping 215 s
Transition to test jobs 3 s
OFF/ON test jobs, overlapping 422 s
Aggregation and final gate 20 s
Total through required gate 696 s (11m36s)

Across inspected runs, the Tier 2 build step was 66–96 s, OFF/ON test steps 306–332 s, and package installation 30–52 s per Tier 2 job despite apt download cache hits. Build-step duration includes orchestration; it is not isolated compiler CPU time.

The representative ON suite registered 341 tests and took 331.24 s. Slow RUN_SERIAL tests included deinterlace field order (82.79 s), async audio delay (59.26 s), PipeWire screencast resume (38.87 s), VLC audio pacing (34.61 s), and audio clock drift (23.60 s). Their durations total 239.13 s; this is not a claim that arbitrary test durations sum to suite wall time. Three PulseAudio device scenarios skipped, which must remain visible in coverage reports.

Qt serialization example: https://github.com/obs-rust/obs-studio/actions/runs/39518844194
Fast Gate took 139 s, then the Qt job took 334 s; run creation to required-gate completion was 522 s (8m42s). linux-qt-frontend currently needs [check-event, rust-tests-linux] in .github/workflows/build-project.yaml.

Scheduling example: https://github.com/obs-rust/obs-studio/actions/runs/39520254679
Tier 2 aggregation ended at 00:26:12 UTC; CI Gate started at 00:28:29 UTC, a 137 s gap. Cause is unknown; distinguish readiness, reusable-workflow completion, and runner availability before attributing it to contention.

Proposal

  1. Isolate and balance slow Tier 2 suites. Audit why each RUN_SERIAL test requires isolation. Experiment with separate environments and duration-balanced groups reusing the existing build artifact. Preserve isolation and all OFF/ON coverage; do not simply remove RUN_SERIAL or increase parallelism. Account for repeated setup, runner cost, and real-time flakiness (Flaky: real-time audio cmocka tests lose audio under machine load (test_vlc_playlist_gap, test_group_hide_transition_audio) #838).
  2. Overlap Qt work with Fast Gate. Evaluate starting Qt compilation after scope detection rather than waiting for Fast Gate. Preserve final required-gate dependencies and cancellation/failure handling. Measure extra work consumed by failing Fast Gate runs.
  3. Reduce repeated Tier 2 setup. Benchmark a reproducible pinned prepared environment against the existing stock image plus cached apt installation. Include image pull, restore, installation, and maintenance costs. Adopt only if total job time improves; coordinate with infra: obs-studio-libs prebuilt build-dependency cache (phase 2 of #520), gated on CI-time measurement #525 rather than duplicating its dependency-cache work.
  4. Profile Rust compile/link/test costs. Split the roughly 96–102 s changed-crate unit-test steps into compilation, linking, and execution; capture Cargo rebuild reasons before choosing changes. Coordinate cache correctness and reuse work with perf(ci): fix cache reuse gaps and measure libobs unity/PCH gains #1286. Retain SOLDR_RUSTC_WRAPPER=none and existing fingerprint safeguards.
  5. Explain scheduling gaps. Record job dependency-ready time, actual start, and final aggregation overhead. Determine whether the observed 137 s gap recurs and what causes it before changing runner/concurrency policy.

Planning estimates, NOT measured results or acceptance guarantees:

Cohort / phase Observed before Target to validate
Tier 2 test execution per mode 5–5.5 min 3–4 min
Representative Tier 2 dominated queue run 11m36s about 9–10 min
Representative frontend queue run 8m42s about 6.5–7 min

Savings overlap and must not be added. Setup and Rust compilation gains remain unquantified. Longer-term under-eight-minute queue goal remains in #930.

Acceptance criteria

  • Publish a reproducible baseline and post-change evidence for comparable code PR and merge-group cohorts, with sample sizes and revisions; collect at least one representative day. Report median and tail latency, required-gate wall time, runner-minutes, and canceled/failed work separately.
  • Each proposed experiment has a measured adopt/reject decision or a linked unresolved blocker. Separate setup, cache restore/save, configure, compile/link, test execution, and scheduling delays; distinguish cold from warm runs.
  • Preserve all selected required checks, existing C tests and assertions, Tier 2 OFF/ON coverage, differential tiers, and applicable Rust binary-budget rules. Report executed/skipped counts and investigate timing failures rather than weakening assertions.
  • Scheduling changes prove test-group union equals the existing suite with no omissions or accidental duplication; retain required environmental isolation and assess flakiness across repeated trials.
  • Behavioral/configuration changes include focused RED → GREEN evidence under repository policy, including graph conditions, cancellation, failure and skipped-attestation cases where applicable. Measurement-only work does not need artificial failing tests.
  • No new GitHub Actions workflow files; use existing workflows. Preserve master-only remote cache publication and compiler-cache correctness safeguards.
  • Publish measured before/after results and runner-cost tradeoffs, then update the existing CI performance documentation.

Decisions

  • Prioritize serial Tier 2 scheduling and Qt overlap because current logs identify them directly on the required path.
  • Track this as a follow-up batch with independently reviewable changes; do not reopen completed cache/parallel-mode work from perf(ci): fix cache reuse gaps and measure libobs unity/PCH gains #1286.
  • Preserve public ABI and unchanged C++ obs-websocket compatibility checks; this work changes CI execution, not product behavior.
  • Treat the estimates as experiment targets; do not promise gains from cache downloads, compiler hit counts, or unmatched cohorts.

Related issues

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Claiming: #1581.

    1. Capture the current baseline and audit existing test isolation, job dependencies, and timing collectors.
    2. Land independently reviewable RED → GREEN changes for safe scheduling overlap and measurement; evaluate duration-balanced isolated Tier 2 groups, setup cost, Rust compilation, and readiness gaps using the resulting evidence.
    3. Publish adopt/reject decisions, required-gate timings, coverage and runner-cost comparisons; retain the representative-day acceptance requirement.

    First focused PR expected during this work session. Decisions: preserve existing C tests and assertions, all selected OFF/ON suites, master-only cache writes, and compiler-cache correctness bypasses; introduce no workflow files. Timing targets are hypotheses rather than promised gains.

  2. added
    claimed
    on Oct 21, 2026
  3. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    First focused PR: #1582 (Qt overlap and configure/build/test phase timings), with local RED → GREEN and passing ./lint --fix.

    A 24-hour baseline was collected read-only for 2026-10-20T00:40:00Z through 2026-10-21T00:40:00Z: 265 listed runs, 31 stratified detailed samples. Successful code merge-group sample median 696 s (n=3); code PR median 858 s (n=3). Samples are sparse and unmatched. Full per-event outcomes and raw API responses are retained locally for the retrospective.

    Next: evaluate two duration-balanced isolated shards per OFF/ON mode using the existing build-once harness. Preserve RUN_SERIAL within each environment, coverage union, failure gating, and master-only timing-cache publication. This is an experiment to measure, not a promise of faster throughput; compare added setup/runner-minutes before adopting it.

  4. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Progress:

    First shard trial (unmatched PR vs earlier queue example; not a causal end-to-end speedup): slowest CTest step 190.78 s versus 331.24 s; all test jobs spanned 283 s versus 422 s, while summed test-job time rose 970 s versus 838 s (~16%). Current gate waits still absorb part of the gain. Repeatability, queue measurements and representative post-rollout day are still required.

    Local prepared-environment benchmarking is running under bosn in a scratch workspace. No new repository workflow, producer or image publication has been introduced. #1581 remains open.

  5. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Correction to the profiling PR status: #1586 was merged into its feature base, not master. #1590 now carries only the phase extraction and evidence to master; its PR CI passed and it is queued. All remaining active batch PRs target master.

    The prepared image now passes package-set verification after a scratch Docker-context exclusion fixed bosn's revalidation refusal. Its package/version fingerprint matches the stock-image installation exactly. Local timing is not a fresh GitHub-runner image-pull measurement; a quiet cached-apt repetition and fresh prepared-container startup measurement are running before deciding whether publication is justified.

  6. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    All five implementation PRs are merged into master: #1582 (Qt overlap), #1583 (verified isolated shards), #1585 (interval/tail reports), #1589 (skip empty publication), and #1590 (Rust phase extraction). #1586 merged only into a feature base; #1590 is the verified master-targeted replacement.

    The baseline expansion now inspects all 265 runs in the original 24-hour window. Successful code PRs: n=83, median 723 s, p95 1,121 s. Successful code merge groups: n=61, median 697 s, p95 988 s. Cohort definition includes Rust harness/test paths; actual lanes and source changes are disclosed. The original sparse sample remains immutable.

    The first shard queue completed in 485 s (8m05s), against the inspected earlier queue's 696 s. Its test phase took 254 s versus 422 s and summed test-job time was 982 s versus 838 s (+17.18%). Libobs, Rust crate, Cargo/toolchain and cmocka test source paths were unchanged between queue trees; CI/frontend and runner/setup conditions differed. Both implementation suites retain 341 registered / 338 executed / 3 identical device skips, with zero failures. These two observations do not establish a population-wide causal speedup.

    #1593 consolidates the expanded baseline, rollout observations, source diff and environment experiment. Prepared-image deployment remains deferred under #1592: the local package-equivalent experiment excludes fresh registry transfer and does not establish net CI benefit. Compiler-only/fingerprint questions remain linked to #1286; unsafe cache bypasses remain enabled.

    A read-only frozen collector is running for the post-rollout window 2026-10-21T01:20:52Z through 2026-10-22T01:20:52Z (last implementation merge + 24 hours), with 30 minutes for in-flight jobs to drain. It will inspect all listed runs and retain representative successful code PR/queue logs. No extra CI dispatch or rerun is scheduled. Keep #1581 open until the resulting median/tail, runner-cost, failure/cancellation, skipped/executed coverage and cold/warm observations have been reviewed and published.

  7. zackees commented on Oct 22, 2026

    @zackees
    MemberAuthor

    Completed and published through #1693, following the implementation PRs #1582, #1583, #1585, #1589 and #1590 and initial report #1593.

    Final requirement audit:

    1. Representative day and comparison: published all 276 post-rollout runs against 265 baseline runs, with portable inputs and executable reproduction for all 541 records. PR and queue cohorts, sample sizes, revisions, median/p95, runner-minutes and success/failure/cancellation costs are reported separately.
    2. Experiment decisions and remaining blockers: retain Qt overlap, empty-publisher guard and phase metrics. Sharding is superseded by the maintainer-requested complete OFF/ON suites in ci: unshard Linux Tier 2 and run one complete suite per backend #1663 after perf(test): remove nine serial barriers and fix output deactivation race #1643's concurrency fixes. Prepared-image transfer/publication remains explicitly deferred under perf(ci): validate prepared Tier 2 image transfer before rollout #1592; Rust linker/rebuild/cache questions remain under perf(ci): fix cache reuse gaps and measure libobs unity/PCH gains #1286; readiness/dispatch attribution remains under meta: Faster CI: code-PR queue runs under 8 minutes #930. Missing measurements are disclosed, not represented as zero cost or proven causes.
    3. Coverage and failures: focused rollout runs proved exact registry partitions; the day had 341 successful concrete Tier 2 jobs, two failures and seven cancellations. Sampled runs retain complete per-mode coverage and the same three device skips. Both observed failures were inspected and the perf(test): remove nine serial barriers and fix output deactivation race #1643 fixes documented. Coverage sampling does not reconstruct every assertion in every run.
    4. Isolation and repeated trials: actual-registry partition verification fails on omissions, duplicates, unknown/missing/empty plans; repeated live PR/queue runs and the representative day are recorded. Current suites are unfiltered, with deinterlace RUN_SERIAL preserved. No assertion was weakened to suppress the observed timing failure.
    5. RED → GREEN: implementation PRs record focused graph, partition, publication, failure/cancellation/attestation and extraction tests. The final publication is documentation/evidence only; independent review was clean and the portable comparison reproduced locally.
    6. Policy invariants: no new workflow files, C-test/public-header changes or Rust test binaries in this batch. Required gates, differential tiers, wrapper bypass/fingerprint protections and master-only remote cache publication remain intact; initial master timing publication was observed.
    7. Publication: existing CI performance documentation now contains full-day before/after results, phase limitations, cost tradeoffs, confounding later revisions and adopt/reject decisions, with linked raw evidence.

    Result: comparable Linux queue median 696.5 → 581.5 seconds, with median runner-minutes 22.242 → 25.100; this is a mixed-policy observational comparison, not a causal sharding gain or a universal speedup. Broad code cohorts became slower. Keep the current unsharded policy.

    Next measured batch: #1694. Existing implementation ownership remains #1592/#1286/#930; #1667 remains the overall backlog. Closing this bounded experiment/report batch does not close those unresolved tracks.

  8. zackees commented on Oct 22, 2026

    @zackees
    MemberAuthor

    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.

    Follow-up #1592/#1694 is now measured: approved immutable prepared runtime deployed through #1717 and obs-rust/obs-studio-libs#7. Fresh accounted setup55.604→24.510s median; source/transfer/producer limitations retained. Actual matched Linux PR median691→555s but queue526→560.5s; runner cost medians6.9%/9.9%lower. #1592remains open for its stronger net-gate criterion; this does not change the already completed #1581day report.

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

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions