The GitHub Actions job "Build Burr" on burr.git/fix/safe-expr-bounds has 
succeeded.
Run started by GitHub user elijahbenizzy (triggered by elijahbenizzy).

Head commit for run:
1189c39fb059c42a7c39fa62d6c043ead6bd01c2 / Elijah Ben Izzy 
<[email protected]>
fix(core): bound logical sequence size and restrict arithmetic operand types in 
safe_expr

Follow-ups to the safe_expr bounds, to bound resource use more tightly:

- Track the logical size (elements a full walk would visit, counting shared
  substructure each time it is reached) of every container the interpreter
  builds, and cap it at 1,000,000 for *, + and container displays. Nested
  repeats such as [[[[0]*1000]*1000]*1000]*1000 passed the per-step length
  check but have 10**12 leaves; they are now rejected before anything is
  built. The same cap is applied before an operation walks a container
  (==/!= on equal lengths, ordering comparisons, in / not in, and builtins
  other than len and bool), measuring state values once with a bounded walk.
- +, -, *, % and ** accept only int (anything with __index__, coerced via
  operator.index so NumPy integers are bounded like plain ints), float, str,
  bytes, list and tuple. Other operand types (deque, array.array, Decimal,
  arrays, custom objects) raise ValueError instead of sidestepping the
  repeat and width bounds.
- The construction-time literal check only evaluates subtrees made of
  numeric / string constants, so safe_expr() no longer builds container
  displays; arithmetic and type errors are deferred to run(), and memory or
  recursion exhaustion is reported as ValueError rather than swallowed.
- int ** int is bounded on the estimated result width,
  bit_length(base) * exponent <= 4096 bits (negative exponents: magnitude
  <= 4096), replacing the fixed +/-64 exponent cap so 2**100 and 10**100
  work while 9**9**9 is still rejected.

Report URL: https://github.com/apache/burr/actions/runs/39044969964

With regards,
GitHub Actions via GitBox

Reply via email to