Skip to content

ci: tracker — long build, test and CI lead times #3249

Open
10 of 11 issues completed
Open

Description

@zackees

What

Parent issue for the long build, test and CI lead times found while working through #3176 on 2026-10-31. Each cause is a native sub-issue (see the panel).

Findings

  • PR CI critical path: whenever ASan runs, it takes 24-35 min, against 5.5 min or less for every other job, because the sanitizer runner executes 633 unit tests one at a time (20 of its 27 min on perf(obs-filters): skip log10f/powf below threshold in compressor, limiter and expander (#3190) #3229).
  • Local benchmark runs: record.py --cpu N pins the build to one core as well as the measurement.
  • Local cold builds: the C oracle compiles more than 225 files in series, because the cc crate's parallel feature is off, and any change under libobs/ (including a branch switch) reruns it.
  • Local hangs: an orphaned or stalled cargo under soldr held a checkout's build lock for 34 min (forge-ci/soldr issue, linked below; not a sub-issue because it is in another repo).

Rules

Each fix records its before and after wall times. The sanitizer and benchmark changes keep the same tests, results and measurements; only scheduling changes.

Sub-issues

Sub-issues

10 of 11 Issues completed
Loading 11 sub-issues

Activity

  1. added
    tracker
    on Oct 31, 2026
  2. zackees commented on Oct 31, 2026

    @zackees
    MemberAuthor

    The soldr side, which is in another repo and so can't be a sub-issue: forge-ci/soldr#4013 (an orphaned or stalled cargo keeps the build-directory lock). A related open issue is forge-ci/soldr#4000: a daemon started under a CPU-pinned process inherits the pin, which ties into #3252.

  3. zackees commented on Oct 31, 2026

    @zackees
    MemberAuthor
  4. vpacher commented on Nov 1, 2026

    @vpacher
    Member

    What changed for the sanitizer passes on 2026-11-01, with numbers, and what we found that is still open.

    Done

    #3290 (follows #3279, closes #3238): the sanitizer passes run their unit tests side by side, each test on its own X server, the timing-sensitive tests alone after the pool. Against the serial runs before #3279:

    Pass Unit tests before Unit tests now Job before Job now
    asan 16.8 min 6.5 min 40.6 min 20.7 min
    tsan 20.3 min 7.4 min 41 min 28.5 min
    valgrind 82 min (101 tests died at start) 53.8 min, every test 95 min 66.5 min

    valgrind runs two tests at a time: serial with every test no longer fit the job's 150 minutes. The asan job now fails on what it finds, with a known list for what is not fixed yet; since then #3363, #3362, #3364, #3366, #3367, #3389, #3390, #3421 and the test leaks #3400/#3401 are fixed, and the remux part of #3365.

    Found, still open

    1. fast_unwind_on_malloc=0 in the harness's ASAN_OPTIONS makes every allocation unwind the slow way. test_dock_proportions took 12.2 s with it and 3.0 s without (test: test_dock_proportions finds the docks equal after a resize in the asan job #3366). The allocation-heavy tests are the long ones in the asan pool, so dropping the option could cut the unit-test phase by an estimated 3 to 4 minutes; the CI runs should give the real number. The frame-pointer unwinder should still give full stacks, as the build has -fno-omit-frame-pointer and Ubuntu packages have frame pointers since 24.04; to check on the leak reports.
    2. Cold asan build: 34 minutes on a PR whose cache came from master 16 hours earlier, after ci(sanitizers): compile the sanitizer passes without FP contraction (#3362) #3428 changed the sanitizer flags (every entry missed), against 6.5 to 13 minutes warm. In the build: 12 websocket tests each compile their own copy of the obs-websocket sources (129 C++ objects), and 316 obs-impl plus 206 native-tests copies of libobs sources. A .ninja_log of one cold build would show which dominates.
    3. Windows Tier 2 (6.9 minutes on a PR without Rust or C changes, test(cmocka): test_dock_proportions waits for the layout to settle (#3366) #3436): four cargo builds with separate target directories (corrosion, cargo-native-core release and test, cargo-native-tests) run without soldr's target cache ("no-cache preflight") and each compile the dependencies again: 130 crate compiles, about 65 s, plus 47 s for the native core. One shared target directory, or a restore from the cook cache, would save about a minute per run.
    4. [profile.dev] debug is not set in Cargo.toml, so soldr sets CARGO_PROFILE_DEV_DEBUG=line-tables-only on every call and warns. Every build goes through soldr today, so nothing differs yet; writing it into Cargo.toml would keep a cargo call outside soldr from building different artifacts.

    I can file 1 to 4 as sub-issues of this tracker if that suits you.

  5. vpacher commented on Nov 1, 2026

    @vpacher
    Member

    Update on item 1 (fast_unwind_on_malloc=0): I measured it, and dropping the option does not pay off.

    Same asan tree (master 3f39ef6), whole unit-test pass through the harness on 4 pinned cores, once with today's options and once with fast_unwind_on_malloc=1:

    fast_unwind_on_malloc=0 (today) =1
    Unit-test pass 366 s 302 s (−17 %)
    Sum of all tests 1034 s 841 s
    Biggest gains test_context_names 29 → 2 s, test_canvas_destroy_scene_refs 18 → 2 s, test_video_output_formats 18 → 4 s, test_dock_proportions 17 → 4 s

    That is about one minute per asan job, not the 3 to 4 minutes I estimated above. The longest tests mostly wait (test_async_delay_audio 60 s, test_portal_shortcuts 53 s, test_slideshow_mem_cap 42 s), and the unwinder does not change them.

    Two costs:

    1. Leak stacks through FFmpeg stop at av_malloc again, as in sanitize: leak stacks stop at av_malloc (fast unwind through FFmpeg) #2035. In test_media_alpha_network (bug: media-playback: LeakSanitizer reports FFmpeg packet buffers in test_media_remux and test_media_alpha_network #3365) the stacks have 10 to 13 frames down to media.c.h and the test today, and 2 frames with the fast unwinder, so triage cannot name an OBS location. Correction to my comment above: Ubuntu 26.04's FFmpeg is not built with frame pointers. In libavutil.so.60 10 of 778 functions set up rbp, in libavformat.so.62 16 of 874 (objdump -d).
    2. test_core_module_load fails 24 of 30 runs with the fast unwinder under load (XOpenDisplay fails during hotkey initialization), 0 of 30 without. I did not look for the cause.

    So I would keep the option. A per-test exception (slow unwinding only for the tests that touch FFmpeg) could get most of the minute back, but it adds a list to maintain for a small gain.

    The measurement also found a real bug: a use-after-free at obs_shutdown(), a regression from #3431, which the different timing exposed (#3441, fix in #3442).

  6. vpacher commented on Nov 1, 2026

    @vpacher
    Member

    Update on the cold sanitizer build, measured locally on 4 pinned cores like the 4-vCPU runner (master 3f39ef6). Real runner numbers follow from the next nightly.

    Where a cold asan build spends its time: 2511 build steps, about 2900 core-seconds without a compiler cache. 43 % are the cmocka tests' own compiles, 38 % the rest of the tree (most of it the frontend and Qt), 8 % the tests' private copies of libobs sources, 4 % the 687 test links, 2 % PCHs, 1 % Rust.

    #3460 builds the three passes with line tables only (-g1 in place of -g). Through zccache as in CI:

    Debug info Cold asan build zccache after the build
    -g 1015 s 4.5 GB
    -g1 760 s 3.4 GB

    So I expect the cold asan job's build step to go from about 27–34 min to about 20–25 min. The reports keep their locations: asan and tsan reports of a -g1 build name the same file:line frames as the nightly's.

    #3447 (merged) made test_inhibit_sleep_dbus 30 s shorter in every pass and in Tier 2 ON: the Rust portal inhibitor kept its bus connection after destroy, and the test's teardown waited 30 s for it.

    Still open:

    1. The cache does not survive. The nightly of 2026-11-01 saved zccache-sanitize-asan-ON-d2efb3ab… at 14:21, and by the evening no zccache-sanitize* cache was left. Even when one is restored, it holds far less than a full build needs (962 MB restored, against 4.5 GB, now 3.4 GB, after a full build), and that nightly still built for 27 min. With a complete cache, the same build took 47 s locally, against 605 s cold.
    2. What fills the cache: precompiled headers are about 2.9 GB of the 4.5 GB (30 files of 80–364 MB, the Qt C++ ones). Debug info is 58 % of the cached objects' bytes, which -g1 reduces.
    3. zccache runs at most 3 compiles at once on 4 cores (3 in flight in the build log). On a cold build that costs about a quarter.
    4. Repeated compiles: 272 compiles repeat a source that another target already compiled. Their command lines differ: per-target include directories, warning flags and the target's own PCH. Another 316 are the tests' private copies of libobs sources. None of these share a cache entry.

    I'll take these one at a time, starting with why the cache is evicted.

  7. vpacher commented on Nov 3, 2026

    @vpacher
    Member

    Update on the asan compiler cache: #3502 works. These are real CI numbers from 2026-11-02 20:23 UTC, when master first saved the archive after that fix, to 2026-11-03 20:40 UTC.

    Restores

    23 of 23 PR asan jobs restored the archive, on 14 branches. One day of data.

    Cold Archive restored (22 jobs that reached the tests)
    Build step 16–25 min (5 runs) median 3.9 min, 2.8–5.0
    Whole job 22–33 min median 12.1 min, 10.3–14.8 (14 green jobs)

    The test step did not change: median 5.8 min. The other 9 jobs were cancelled, or failed on a test or a leak, not on the cache.

    The age of the archive does not matter much

    Age of the archive Jobs Build median
    under 3 h 13 3.8 min
    3–6 h 7 4.1 min
    over 6 h (up to 8.4 h) 2 3.5 min

    The archive stays in the cache

    The archive that the nightly saved at 15:00 (572 MB) survived the 16:55 beta, the 18:27 release run and every merge queue janitor after them. A PR restored it at 18:50. Before #3502 it was gone within hours. This is one day, so it does not prove that it always survives near the 10 GB limit.

    What it costs

    Each refresh is a cold build on a master push: 22.0 and 22.7 min in this period, when the archive is older than 6 h. The nightly is a third (23.5 min). Queue runs do not use the archive, because Sanitize is skipped on merge_group.

    Open

    Since #3290 the job can fail a PR on a test that has nothing to do with it: 3 of 13 jobs at the time I checked. #3575 and #3576 are fixed, #3577 is open, and #3585 added the guidance for 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

    tracker

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions