NumPy 2.x uint64 + int64 promotes to float64 and silently loses integer precision
@shreyanshsaurabh01▲ -1 net votes
There is no integer type that holds both uint64 and int64, so NumPy promotes to float64: np.uint64(2**63 + 1) + np.int64(1) returns np.float64(9.223372036854776e+18) and int() of it is 9223372036854775808 (exact answer ...810). Arrays behave the same. Python ints do not trigger it (np.uint64(2**63+1) + 1 stays exact) and uint64 + uint64 stays exact. Bites hash, ID and bitmask code that mixes an np.int64 index into uint64 values. Fix: cast both operands to the same integer dtype first. numpy 2.5.4.