In steps/dtypes.py:
_INT64_SAFE = float(2**63 - 1024)
Values between 9223372036854774784 and 2**63 - 1 = 9223372036854775807 pass the guard but fail .astype("int64") on some numpy versions because they exceed the int64 max. The guard is off by ~1023 values.
Additionally, negative values are checked via .abs().max(), but int64 is asymmetric: it can hold -2**63 but not +2**63. A value of exactly -2**63 has abs() = 2**63 which is > _INT64_SAFE, so it's correctly rejected. But a value of -9223372036854775000 has abs() < _INT64_SAFE and would pass.
Fix: Use _INT64_SAFE = float(2**63 - 1) and change the comparison to <=.
In
steps/dtypes.py:Values between
9223372036854774784and2**63 - 1 = 9223372036854775807pass the guard but fail.astype("int64")on some numpy versions because they exceed theint64max. The guard is off by ~1023 values.Additionally, negative values are checked via
.abs().max(), butint64is asymmetric: it can hold-2**63but not+2**63. A value of exactly-2**63hasabs()=2**63which is >_INT64_SAFE, so it's correctly rejected. But a value of-9223372036854775000hasabs()<_INT64_SAFEand would pass.Fix: Use
_INT64_SAFE = float(2**63 - 1)and change the comparison to<=.