Files
giant/tests
lars 313373cc10
CI / Format (ruff format) (push) Failing after 29s
CI / Lint (ruff check) (push) Successful in 32s
CI / Sync project version with tag (push) Has been skipped
CI / Type check (ty) (push) Successful in 23s
CI / Tests (push) Successful in 1m8s
Clamp analysis histogram bins before the i32 cast, not after
_bin_expr clipped the bin index to [0, nbins-1] only after casting it to
Int32, so the clip never got the chance to do its job: a rollout
step_length of 1.0725e10 mm against fixed edges [2.9e-5, 94.04] with 50
bins gives a raw index of ~5.7e9, which overflows i32 and fails the
strict cast, killing the whole compute-one job. Same for +/-inf.

Clamp in f64 first and cast after. NaN has no edge to clamp to, so map
it to null and drop it in the two callers (hist1d, profile_partial) —
what np.histogram does with it, and what profile_partial needs anyway
since a null bin index would break its np.add.at.

Partials computed before this change stay valid: the old code crashed on
these values rather than binning them wrong, so any chunk that produced
a partial contained none of them and its counts are unchanged here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 16:15:12 +02:00
..