Skip to content

test: fix the source_profiler_parity race (#1930) - #1931

Merged
zackees merged 1 commit into
masterfrom
fix/1930-source-profiler-parity
Oct 23, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/1930-source-profiler-parity

Conversation

@zackees

@zackees zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member

Fixes #1930.

Cause: not a Rust/C difference. oracle_sp_calculate (rust/obs-c-oracle/oracle/source_profiler.c) temporarily sets the oracle's static gpu_enabled around calculate_tick/calculate_render. parity_calculate called it without the ORACLE lock (its comment said "no shared state"), so when it ran in parallel with parity_random_sequences or parity_gpu_frames, the C source_profiler_frame_begin could see gpu_enabled == true and advance timer_idx on the C side only. That is exactly the reported state: profiler disabled, C index 1, Rust 0. Running parity_random_sequences alone never fails (512 cases, repeated runs).

Fix: parity_calculate holds ORACLE like the sequence tests. No change to the port or the oracle.

Local RED/GREEN (soldr cargo test -p obs-data --test obs-tests-core source_profiler_parity, whole file so the tests run in parallel):

  • before: 5 of 6 runs fail (parity_random_sequences at line 397, parity_gpu_frames at 464);
  • after (source_profiler filter, 36 tests): 0 of 8 runs fail.

Test-only; no features.md line.

@zackees
zackees added this pull request to the merge queue Oct 23, 2026
Merged via the queue into master with commit 739a3c0 Oct 23, 2026
30 checks passed
@zackees
zackees deleted the fix/1930-source-profiler-parity branch October 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

test: source_profiler_parity::parity_random_sequences finds Rust/C differences in about half of runs

1 participant