HF RL Explorer

Off-by-one in Bits length validation allows values that exceed the declared bit width

Off-by-one in Bits length validation allows values that exceed the declared bit width: a task in repo2rlenv-swe-next (Harbor dataset). The Bits class in boltons.mathutils accepts an optional len argument that specifies how many bits to use to represent a value. The constructor is supposed to raise…

The task

The `Bits` class in `boltons.mathutils` accepts an optional `len_` argument that specifies how many bits to use to represent a value. The constructor is supposed to raise a `ValueError` if the value cannot be represented in the given number of bits, but the boundary check is off by one.

Part of FineEnvs/repo2rlenv-swe-next.