Skip to content

test: Keep the audio_min_ts parity rate where util_mul_div64 fits on MSVC - #2420

Merged
zackees merged 1 commit into
obs-rust:masterfrom
vpacher:fix/2405-msvc-parity-inputs
Oct 25, 2026
Merged

zackees merged 1 commit into
obs-rust:masterfrom
vpacher:fix/2405-msvc-parity-inputs

Conversation

@vpacher

@vpacher vpacher commented Oct 25, 2026

Copy link
Copy Markdown
Member

Refs #2405

Fixes a crash I introduced in #2406: audio_min_ts_parity::insufficient_matches draws the sample rate from all of usize. On MSVC x64 the C oracle's util_mul_div64 is exact 128-bit math (_umul128 / _udiv128), which faults with STATUS_INTEGER_OVERFLOW when the quotient does not fit in 64 bits, so the whole obs-tests-core binary crashed on windows-2025 (run 40227191204 on #2411, whose oracle change pulls obs-tests-core into the changed-crates run). The shim saturates there; only the oracle faults.

On MSVC x64 the rate now stays below 1e9, so t * rate / 1e9 fits for any t, as audio_mix_parity does since #1909. Other hosts keep the full range. audio_discard_parity keeps its rates below 384 kHz and is not affected.

Testing

  • obs_core::audio_min_ts* 14/14 on macOS arm64; clippy -D warnings clean.
  • Not run on Windows locally: PR CI's Rust Tests (windows-2025-vs2026) is the check.

Checklist

  • Base is master
  • I claimed the issue, or no one else has an open PR for it (rust: Port the audio min-timestamp decisions in obs-audio.c to obs-core (#1903 slice 3) #2405 is mine)
  • Characterization test (if the unit had none), then RED, then GREEN commits: a test-only fix
  • User-visible change: none
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): none
  • Intentional differences from C listed in the parity test header and rust/README.md (ports): unchanged

AI note: Claude Code (Claude Opus 5.5) wrote the change and this text under the submitter's direction.

…MSVC

audio_min_ts_parity::insufficient_matches draws the sample rate from all
of usize. On MSVC x64 the C's util_mul_div64 is exact 128-bit math
(_umul128 / _udiv128), which faults with STATUS_INTEGER_OVERFLOW when
the quotient does not fit in 64 bits, so the C oracle crashed the whole
obs-tests-core binary on windows-2025 (seen on obs-rust#2411, whose oracle
change pulls obs-tests-core into the changed-crates run). The shim
saturates there, so only the oracle faults.

On MSVC x64 the rate now stays below 1e9, so t * rate / 1e9 fits for any
t, as audio_mix_parity does since obs-rust#1909. Other hosts keep the full range
(util_mul_div64 wraps there, and both sides wrap the same way).
audio_discard_parity keeps its rates below 384 kHz and is not affected.

Refs obs-rust#2405

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vpacher
vpacher requested a review from zackees as a code owner October 25, 2026 20:07

@zackees zackees left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. This matches the crash: test-diff: FAILED (3221225621) on #2411's and #2419's Windows Rust Tests is 0xC0000095, STATUS_INTEGER_OVERFLOW, from the oracle's _udiv128. Capping the rate below 1e9 on MSVC x64 only follows the existing MSVC_X64 const in audio_mix_parity.rs:61. Other hosts keep the full range, and the shim's saturation is still covered there. LGTM; queuing, since it unblocks #2411 and #2419.

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.

2 participants