Latest Repo Discovered
algorand-developper-assignment
JavaScript
·
No license
Top Contributor of the Month
10172 commits in all time
Jan 13, 2026 05:53 – Apr 13, 2026 05:53 UTC
fix: remove biguint x ^ x identity fold
The `a == b` identity match for bitwise_xor_bytes folded `x ^ x` to the biguint constant 0, which encodes as empty bytes. The AVM `b^` op produces a zero-filled array of the same length as the inputs, so the fold changed the observable byte-width of the result. Remove the identity case; constant folding of literal xors is unaffected (it correctly produces a zero-filled byte array of the appropriate length).
5bb8ce97
fix/biguint-xor-identity-fold
2/42 ++ 2 --
test: add regression test for x ^ x biguint identity fold miscompilation
The intrinsic simplifier folds biguint `x ^ x` to the integer constant 0 (which encodes as empty bytes), but the AVM `b^` op produces a zero-filled byte array of the same length as the inputs. The fold changes the observable byte-width of the result, breaking any downstream code that depends on the length. Visible in the destructured IR as `self_xor` reducing to `return 0b` (empty bytes) regardless of the argument's length. The on-chain test fails at -O1/-O2 where the fold triggers.
1e79a3ac
fix/biguint-xor-identity-fold
56/2,244 ++ 0 --
fix: remove x // x identity fold for uint64 and biguint
The `a == b` identity match for `div_floor` and `div_floor_bytes` folded `x // x` to `1`, but this is only valid when `x != 0`. Since the AVM panics on division by zero, the fold silently eliminates a runtime error.
59d93306
fix/div-identity-fold-divzero
2/42 ++ 4 --
test: add regression tests for x // x identity fold miscompilation
Both the uint64 and biguint intrinsic simplification paths fold `x // x` to `1` unconditionally, without considering that `x` may be zero. The AVM panics on division by zero, so the fold silently eliminates a runtime error: calling self_div(0) returns 1 instead of halting. The incorrect optimization is visible in the destructured IR where the subroutine body is reduced to `return 1u` / `return 1b` regardless of the argument. The on-chain tests fail at -O1 and -O2 (where the fold triggers) but pass at -O0 (where the division is preserved).
7a61f0d3
fix/div-identity-fold-divzero
107/4,144 ++ 0 --
fix: guard biguint constant-fold floor division against zero divisor
The constant-folding branch for div_floor_bytes had no guard against a zero divisor, crashing the compiler with a ZeroDivisionError. Now guarded with `if b_const != 0`, matching the existing mod_bytes case.
302e8622
fix/biguint-constant-fold-divzero
2/41 ++ 1 --
test: add regression test for BigUInt constant fold division by zero
The intrinsic simplifier attempts to constant-fold BigUInt floor division without guarding against a zero divisor, crashing the compiler with a Python ZeroDivisionError. compilation at -O1/-O2 crashes with: ZeroDivisionError: division by zero
05370a4f
fix/biguint-constant-fold-divzero
15/571 ++ 1,454 --
fix: handle BigUInt constants exceeding 64 bytes in intrinsic simplification
Remove the assertion in biguint_bytes_eval that crashes on >64 byte values. Instead, _get_biguint_constant now returns None for the integer value when the bytes constant exceeds 64 bytes, preventing constant folding while still allowing valid IR to flow through.
0797c32b
fix/biguint-large-constant-crash
3/47 ++ 2 --
fix: handle BigUInt constants exceeding 64 bytes in intrinsic simplification
Remove the assertion in biguint_bytes_eval that crashes on >64 byte values. Instead, _get_biguint_constant now returns None for the integer value when the bytes constant exceeds 64 bytes, preventing constant folding while still allowing valid IR to flow through.
8c20b933
fix/biguint-large-constant-crash
2/5 ++ 2 --
test: add regression test for large BigUInt constant crash
BigUInt constants that exceed 64 bytes (e.g. 2**512) cause an AssertionError in biguint_bytes_eval during intrinsic simplification. The crash is triggered when a first constant fold produces a >64 byte result, and a subsequent optimization pass attempts to simplify a binary op using that result. compilation at -O1/-O2 crashes with: AssertionError: Biguints must be 64 bytes or less
183fec00
fix/biguint-large-constant-crash
12/319 ++ 0 --
Merge 8b9a96f0157a10b8fce00b21755659f909a36470 into 97eab87fc40a86b9e9fae6259e442f7b9fbe4a4b
4044884e
pull/124/merge
14/1,587 ++ 88 --
refactor: use instanceof to check if a value is LocalState or LocalMap
8b9a96f0
global-local-map-support
4/96 ++ 42 --
Merge 16dbeb811ba0136b2d41e80ee29b15c38f9ea8a2 into 5f3112c38747bfc042c7eb014bb67fb76e80f794
c61788a6
pull/623/merge
75/16,896 ++ 39 --
Merge 32fa1ea1d7667fa3a644db7bb178c7de191e20f3 into 5073ca134b7c4c5721fcfbe976d5c364a5cc777a
e23220a9
pull/421/merge
15/1,585 ++ 1,225 --
chore(deps): update non-major dependencies
32fa1ea1
renovate/non-major-dependencies
15/1,585 ++ 1,225 --