Skip to content

meta: Platform-scoped CI (keystone for CI optimization) #897

Open
2 of 4 issues completed
Open

Description

@zackees

Implementation meta for CI optimization: platform-scoped CI that runs a macOS/Windows job only when a change can affect that platform, without hiding breaks.

Why this order

ci/ci_scope.py decides native jobs from paths alone. That is only sound when platform code lives in platform-named files. Today ~520 platform conditionals sit in shared C/C++ (#847), so a shared-file edit inside #ifdef _WIN32 runs Linux only. Moving shared-code PRs off native runners (#698) is therefore gated on closing that hole.

Plan

  1. ci: ratchet lint for platform conditionals in shared C/C++ (#847 step 1) #848 lint policy: platform defines only in blessed platform files/dirs (C/C++ twin of the Rust platform-boundary Dylint). Existing offenders are grandfathered by a baseline that only goes down, so no regressions.

  2. ci: Start native jobs for edits inside platform #if blocks in shared files #896 stopgap: for files still in the ratchet baseline, edits inside a platform #if block start that OS's jobs.

  3. ci: Move per-PR native macOS/Windows jobs to post-merge once cross lanes link and run #698 path scoping: shared-code PRs run Linux only (safe once 1 and 2 land).

  4. meta: Move platform #if code in shared C/C++ behind a platform facade #847 facade refactors, ordered by risk (conditionals × 1-year churn), not raw count:

    file #ifs commits/yr score
    frontend/OBSApp.cpp 46 31 1426
    frontend/widgets/OBSBasic.cpp 20 35 700
    frontend/settings/OBSBasicSettings.cpp 29 22 638
    frontend/obs-main.cpp 30 17 510
    frontend/widgets/OBSBasic.hpp 5 37 185
    libobs/obs.c 8 23 184
    plugins/obs-outputs/librtmp/rtmp.c 16 8 128
    plugins/obs-outputs/rtmp-stream.c 17 6 102

    Each move shrinks the ci: Start native jobs for edits inside platform #if blocks in shared files #896 list; the plugin long tail is low priority.

  5. meta: Cross-compile through Soldr to shrink macOS/Windows CI #700 cross-compile/attestation track (build: Link Windows-MSVC and macOS Rust targets on Linux (soldr LLVM bundle needs host libxml2.so.2) #695, ci: Run the windows-gnu Rust tests under Wine in the Linux lane #696, ci: Let local native lanes attest the macOS and Windows jobs #443, build: Maximum C/C++ warning strictness with -Werror on every platform (cross-compiled with soldr) #516, build: Investigate cross-compiling the full OBS C/C++ build for Windows and macOS from Linux #697) reduces what native runners must still cover.

Done when

Policy (maintainer, 2026-10-15)

Sub-issues

Sub-issues

2 of 4 Issues completed
Loading 4 sub-issues

Activity

  1. zackees commented on Oct 15, 2026

    @zackees
    MemberAuthor

    Status (2026-10-15)

    Soldr cross-compiling on Linux: are we using it?

    Yes, partly:

  2. zackees commented on Oct 15, 2026

    @zackees
    MemberAuthor

    Measured A/B on real PR CI (#919 vs #920)

    I ran the same one-line change twice on the same master: a plain C test registration (test/cmocka/tests.d/test_obs_data.cmake), the most common change in recent PRs. A used current master's scoping (path-only, #911). B was identical except that the PR restored the pre-#898 ci_scope.py, which sent every tests.d change to all platforms. Both runs passed.

    A, current scoping B, old scoping
    macOS / Windows jobs skipped ran (4 jobs)
    runner-minutes, all jobs 19.4 43.0
    macOS + Windows runner-minutes 0 25.3
    wall time 20.7 min 19.6 min
    • Runner cost: less than half (−55%), and no macOS or Windows minutes.
    • Wall time: no gain. Both are bound by Linux Tier 2 (12.5–13.6 min), and A's Linux Tier 2 also waited about 7 min for a free runner. Skipping native jobs frees runners for other PRs but doesn't shorten one PR's critical path. Faster PRs need Linux Tier 2 to be faster or skipped when already proven (the stamped local gate, or the ledger proposal).

    Runs: A https://github.com/obs-rust/obs-studio/actions/runs/38818680393, B https://github.com/obs-rust/obs-studio/actions/runs/38818689428

  3. zackees commented on Oct 15, 2026

    @zackees
    MemberAuthor

    Wall time: what native jobs cost in real runs

    Measured from job timestamps (not a replay) over the last 111 successful PR runs and 58 merge-queue runs that ran macOS/Windows jobs. The figure is how long the native jobs finished after every other non-gate job.

    runs native jobs finished last added wall time: mean / p90 / max
    PR runs 111 46 (41%) 2.5 / 7.5 / 26.7 min
    merge-queue runs 58 19 (33%) 1.3 / 5.7 / 7.9 min
    PR runs of the 34 PRs that #911 now runs on Linux only 34 7 1.6 / 3.9 / 21.4 min, 55 min in total

    So skipping native jobs cuts the slow tail. The median PR doesn't change, because Linux Tier 2 (~13 min) is usually the slowest job. Together with the A/B above (runner-minutes 43.0 → 19.4 for the same change), that is the speedup #911 delivers.

  4. zackees commented on Oct 16, 2026

    @zackees
    MemberAuthor

    Real PR runs, before and after #911 merged (22:33 UTC)

    Successful pull_request runs that ran Linux Tier 2 (unstamped, so comparable), excluding probe and measurement PRs:

    runs ran macOS/Windows runner-min median wall median wall p90
    before #911 39 35 64.1 26.9 min 78.4 min
    after #911 7 5 50.1 15.7 min 22.1 min

    Caveats: the after sample is small, and part of the wall-time drop comes from #837 (Tier 2 -j4, merged 19:33), which is also in the before window. The clean single-change A/B is above: runner-minutes 43.0 → 19.4, with equal wall time.

    Also done: #925 merged (soldr 0.9.33, Linux links the msvc and Darwin test binaries); setup-soldr v0.9.86 released and v0 moved to it.

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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions