Repository navigation
test: Draw the huge floats of extent_parity from their bit patterns - #1952
Merged
Merged
Conversation
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
6 of 7 tasks
6 of 7 tasks
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.
Fixes #1951
What and why
scene::extent_parity'sentry()strategy (from #1922) drew huge values fromprop_oneof![-f32::MAX..-1.0e30f32, 1.0e30f32..f32::MAX]. Proptest's float range sampler can trip its owndebug_assert!(self.low - result < self.intervals.step,float_samplers.rs:128) on a range that wide. That happened torandom_boxes_match_oracleon Windows in the merge group for #1929 and ejected it from the queue; the stack goes throughRange<f32>::new_treein that arm.This draws the same values from their bit patterns: a
u32in1e30.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
Range<f32>arm this replaces.b45ab00a9.scene::extent22/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 lintok.Checklist
master