Skip to content

test: Draw the huge floats of extent_parity from their bit patterns - #1952

Merged
zackees merged 1 commit into
obs-rust:masterfrom
rdoupe:fix/extent-parity-float-range
Oct 23, 2026
Merged

zackees merged 1 commit into
obs-rust:masterfrom
rdoupe:fix/extent-parity-float-range

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1951

What and why

scene::extent_parity's entry() strategy (from #1922) drew huge values from prop_oneof![-f32::MAX..-1.0e30f32, 1.0e30f32..f32::MAX]. Proptest's float range sampler can trip its own debug_assert! (self.low - result < self.intervals.step, float_samplers.rs:128) on a range that wide. That happened to random_boxes_match_oracle on Windows in the merge group for #1929 and ejected it from the queue; the stack goes through Range<f32>::new_tree in that arm.

This draws the same values from their bit patterns: a u32 in 1e30.to_bits()..=f32::MAX.to_bits() with a random sign. Positive floats order like their bits, so the generated set is unchanged, and no float range is sampled. Test-only; nothing else changes.

RED → GREEN

  • RED: no local reproduction. The panic is rare: 6 million debug-build samples of the old strategy on Linux (deterministic and random seeds) did not trip it. The evidence is the Windows merge-group failure in run 39984794419 (job 120524185410), whose backtrace ends in the Range<f32> arm this replaces.
  • GREEN: b45ab00a9. scene::extent 22/22 in three runs; 2 million samples of the new strategy are all finite with |v| in [1e30, f32::MAX]; uv run ci/local_gate.py --lane lint ok.
  • Real app: N/A (test only).

Checklist

  • Base is master
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits (a focused CI fix: one commit, RED evidence from CI above)
  • User-visible change: not applicable, no user-visible change
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes: not applicable
  • Intentional differences from C: not applicable (test strategy only)

The 1e30..f32::MAX ranges of entry() could trip proptest's own float
sampler assertion ("self.low - result < self.intervals.step"), which
failed random_boxes_match_oracle on Windows in a merge group. Drawing
those values from their bit patterns with a random sign gives the same
set without a float range.

Fixes obs-rust#1951
@rdoupe
rdoupe requested a review from zackees as a code owner October 23, 2026 16:49
@rdoupe rdoupe mentioned this pull request Oct 23, 2026
6 of 7 tasks
@zackees
zackees added this pull request to the merge queue Oct 23, 2026
Merged via the queue into obs-rust:master with commit af0273e Oct 23, 2026
30 checks passed
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: extent_parity proptests can trip proptest's float range assertion (Windows merge group)

2 participants