Repository navigation
test: Bound our four slowest parity tests (#2891) - #2898
Merged
Merged
Conversation
random_cases_match took 147.9 s in Fast Gate (58 s on an M-series Mac), the slowest test of the step (#2891). Two changes: - Each side built its 8 input deques with one deque_push_back() per f32 (up to 3,200 frames per channel) and read them back with one deque_pop_front() per f32: about 100,000 calls per case. Source::new now reserves the capacity that pushing one f32 at a time from empty reaches (4 bytes doubled until it fits) and pushes each channel once; end() pops each deque once. Each deque starts in the same state as before (start 0, end at the size, the same capacity) and the same samples come back. The new one_push_matches_one_push_per_sample checks that for 0 to 300 frames and the power-of-two edges up to 3,199. With 20,000 cases: 58 s to 11 s. - 20,000 cases to 1,000. The 19 mutants of #2404, rebuilt and run again: every one still fails the audio_discard tests. Run against random_cases_match alone, 5 runs each, 16 fail within 125 cases in every run. The other 3 (no 1 ns adjustment, in sync as `>`, the shim clearing timing_set only with the warning) need an exact boundary that random inputs do not reach: at 20,000 cases two never failed and one failed in 1 of 2 runs. The chosen cases find all three. random_cases_match: 0.56 s, 17 MB peak RSS over 25 runs (macOS arm64, debug). The comparison, the input ranges and every other test are unchanged. The proptest regression file keeps the seeds the mutants failed on. Refs #2891 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o_mix_parity mix_on_every_start_frame took 31.8 s and mix_matches 21.6 s in Fast Gate (17.6 s and 12.1 s on an M-series Mac), about 3 ms per mix: each compare_mix() makes two sets of 6 x 8 x 1024 random samples and checks every sample bit for bit (#2891). - mix_on_every_start_frame becomes mix_on_sampled_start_frames: the first and the last 8 start frames and every 61st between them (32 of 1024; 61 is prime, so the frames fall on varied offsets), each on the frame's time and one ns before and after, at 44.1 and 48 kHz, as before. - mix_matches: 4096 cases to 512. The mix mutants of #1909, rebuilt (the window end inclusive, = instead of +=, the start frame ignored, the window start as <=, the start frame plus one, frames counted from one ns late, the shim ignoring the channel count or one channel short, and the equivalent frame 1024 accepted): all 8 real ones still fail the audio_mix tests, and the equivalent one survives, as before. mix_matches alone, 5 runs each: 7 of 8 fail within 64 cases in every run; frames counted from one ns late fails mix_on_sampled_start_frames. The window end inclusive needs audio at the window's end, which the every-frame test did not check either; mix_matches and Tier 1 find it. macOS arm64, debug, 25 runs: mix_on_sampled_start_frames 0.62 s and 13 MB peak RSS, mix_matches 1.88 s and 15 MB. The comparison, the buffering and frame-count tests and the input ranges are unchanged. Refs #2891 Co-Authored-By: Claude Opus 5.5 <[email protected]>
sequences took 30.9 s in Fast Gate (14.3 s on an M-series Mac): 5,000 random sequences of up to 60 calls, each compared on both sides with the whole stack state after every call (#2891). 5,000 cases to 500. #2528 lists 16 mutants without naming the 14 it killed, so they were rebuilt from the core and the shim: push keeping cur, the pop floor at 1, pop without the erase, the multiply in the other order, transpose and identity ignored, translate as scale, state_pop returning the first entry or not popping, the blend reset with enable not inverted, the op ignoring the function, the function without dest_a, and in the shim: the erase of the last element keeping num, push not counting, and the capacity growing by one. All 15 fail sequences alone within 125 cases in every one of 5 runs; the equivalent one #2528 names (no max(new_size) in the growth) survives, as before. 1,000 cases would still take about 6 s on the CI runner, so 500 (4x the need) keeps it under the 5 s that #2888 proposes. macOS arm64, debug, 25 runs: 1.50 s and 15 MB peak RSS. The calls, the comparison after every call and every other test are unchanged. The proptest regression files keep the seeds the mutants failed on. Refs #2891 Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=8cec7172b177aead0ee3374cc102d09e830003a5 secs=340 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run,macos-native:n/a,windows-native:n/a Ci-Attestation: {"at":1793263864,"gate":"rust/all/fmt","host":"linux-x86_64","key":"be9de4060c380e3fd3e326cc0ce090e9ac1874b2ad14138f5f0d3a9c1bc97d08","lane":"lint","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":75,"stamp":"9eaa0726b440abd9db3f8c736ab1f641","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"be9de4060c380e3fd3e326cc0ce090e9ac1874b2ad14138f5f0d3a9c1bc97d08","lane":"lint","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":75,"stamp":"467728ef5aaebb56014fa6076e352270","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"db8feb23281ca0e220c448d68f1be14a5f1062a0216f9e0340321e38e7dfee04","lane":"rust-test","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":169,"stamp":"80eb40a7c4812ab98f972778a57d6bdd","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"7cc8841f5fa7a06f3090aade0155e0457b9c4356c17fa44b5418f11c40df3119","lane":"cross","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":96,"stamp":"dd713ca81ab3614076faf09ec3a0f5f3","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"7cc8841f5fa7a06f3090aade0155e0457b9c4356c17fa44b5418f11c40df3119","lane":"cross","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":96,"stamp":"4c9c4ba7cf6c909e381e9266b8bd25d6","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"7cc8841f5fa7a06f3090aade0155e0457b9c4356c17fa44b5418f11c40df3119","lane":"cross","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":96,"stamp":"558779126ebd09147e4147bd5bea2b6a","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"7cc8841f5fa7a06f3090aade0155e0457b9c4356c17fa44b5418f11c40df3119","lane":"cross","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":96,"stamp":"228629c266e4919d49763da44bdfe222","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"53488f90bfeb235b9eecee55e15ed8e9bc3e38e2bc5df515126f9b13b5b82908","lane":"tier2-linux","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":312,"stamp":"71a9f175dda786dd227f70632db58ab7","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"}
vpacher
enabled auto-merge
October 29, 2026 08:52
Member
Author
|
Handed off to the coordinator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bounds the four slow parity tests we wrote (233 s of Fast Gate test time), our part of #2888 row A. Test files only; no library code changes.
Fixes #2891
Results
obs_core::audio_discard_parity::random_cases_matchobs_core::audio_mix_parity::mix_on_every_start_frame→mix_on_sampled_start_framesrender::state_stacks_parity::sequencesobs_core::audio_mix_parity::mix_matchesExpected in Fast Gate: about 1.5 s, 1.5 s, 3 s and 3.5 s (the CI runner took 1.8x to 2.6x the local time for these tests). Windows 11 (VM, MSVC, debug): 0.77 s, 0.78 s, 1.30 s and 1.96 s.
Commits
test(obs-core): Make audio_discard_parity's random cases cheap and fewertest(obs-core): Sample the start frames and cut the mix cases of audio_mix_paritytest(obs-graphics): Cut state_stacks_parity's random sequences to 500How the counts were chosen
The case counts come from the mutants of the source PRs, not a flat cut. Those mutants were not committed, so they were rebuilt from each PR's description and the code, and run with a harness (not committed). For each mutant, two checks:
mix_matches: 7 fail within 64 cases in every run; the 8th (frames counted from 1 ns late) failsmix_on_sampled_start_framesmax(new_size)in the growth)The new counts are 8x (1,000 and 512) and 4x (500) the cases the mutants need.
state_stacks_paritygets 4x: 1,000 cases would still take about 6 s on the CI runner.In
audio_discard_parity, the cost was not the case count alone. Each side built its 8 input deques with onedeque_push_back()perf32and read them back with onedeque_pop_front()perf32: about 100,000 calls per case.Source::newnow reserves the capacity that one push perf32reaches (4 bytes doubled until it fits) and pushes each channel once, so each deque starts in the same state (start 0, end at the size, the same capacity). The new testone_push_matches_one_push_per_samplechecks that for 0 to 300 frames and the power-of-two edges up to 3,199. That alone took the test from 58 s to 11 s with all 20,000 cases.Each changed proptest block has a comment with its count, the count before and the mutant evidence. The proptest regression files keep the seeds the mutants failed on.
Test cost
New and changed tests, macOS arm64, debug, 25 runs each: longest run 1.88 s (
mix_matches), peak RSS 13 to 17 MB, no own threads. The newone_push_matches_one_push_per_sampletakes less than 0.1 s.Verification
cargo fmt --all --check;clippy -p obs-data -p obs-graphics -p obs-core --all-targets -- -D warningsclean.obs_core::audio_discard25/25,obs_core::audio_mix30/30,state_stacks11/11 on macOS arm64 and on Windows 11 (VM, MSVC toolchain, the C oracles compiled by MSVC).ci-lint local-gate run): lint 75 s, rust-test 169 s, cross 96 s, tier2-linux 312 s; 5 min 40 s. The head carries theLocal-GateandCi-Attestationtrailers for its exact tree.🤖 Generated with Claude Code