Fix/datatree nan handling - #4876
Open
reachsridhard wants to merge 6 commits into
Open
reachsridhard wants to merge 6 commits into
reachsridhard wants to merge 6 commits into
Conversation
reachsridhard
requested review from
DRMacIver,
Liam-DeVoe and
Zac-HD
as code owners
September 12, 2026 11:33
reachsridhard
force-pushed
the
fix/datatree-nan-handling
branch
2 times, most recently
from
September 13, 2026 02:24
1e001ec to
0f5652d
Compare
…_float_clamper bugs
reachsridhard
force-pushed
the
fix/datatree-nan-handling
branch
from
September 13, 2026 10:38
0f5652d to
26a5160
Compare
Under the crosshair backend, the inline f-string in the UnsatisfiedAssumption raise could evaluate to an empty string due to opcode tracing, producing gave_up observations with an empty status_reason. Computing the reason via a helper call keeps it concrete, matching how where and location are produced.
The fallback for an exhausted children cache was uncovered: it only fires for float branches with allow_nan=True, where all_children enumerates only the canonical NaN values but compute_max_children counts every NaN bit pattern.
Downcasting unbounded float64 draws to width=16 rejects the overwhelming majority of inputs, making the filter_too_much health check marginal and flaky (observed failing on Python 3.15 CI).
This branch has not been deployed
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.
Fix NaN handling in
compute_max_childrenandall_childrenSummary
Fixes
compute_max_childrenandall_childrenignoring NaN whenallow_nan=True, despitechoice_permittedcorrectly treating NaN as valid.This caused incorrect exhaustion checks, unnecessary force-splitting of float nodes, and prevented the cache-based drawing path from generating NaN.
Changes
compute_max_children: Include all valid NaN bit patterns whenallow_nan=True.all_children: Yield canonicalmath.nanand-math.nanvalues when NaN is allowed._draw_from_cache: Fall back to random drawing when the cache has no usable candidates.Updated existing tests to distinguish finite-only cases and added coverage for NaN inclusion/exclusion and permission checks.