10896 commits in all time Jan 30, 2026 04:04 – Apr 30, 2026 04:04 UTC
achidlow puya
refactors, plus add substring3 constant start > bytes length case
Git Commit 9668f713 Branch feat/statically-failing-op-validator Document 1/38 ++ 42 --
achidlow puya
chore: compile all
Git Commit 8561de97 Branch feat/statically-failing-op-validator Document 30/1,376 ++ 1,487 --
achidlow puya
message tweaks
Git Commit 6e07a634 Branch feat/statically-failing-op-validator Document 1/15 ++ 15 --
achidlow puya
test: cover substring3 runtime-bytes fallback
The fallback arm (runtime first arg, constant `end` > MAX_BYTES_LENGTH) needs its own test since neither of the constant-bytes substring3 cases in the existing test exceeds 4096.
Git Commit ff79baca Branch feat/statically-failing-op-validator Document 1/2 ++ 0 --
achidlow puya
wip
Git Commit 30533b80 Branch feat/statically-failing-op-validator Document 2/35 ++ 35 --
achidlow puya
refactor: split extract/extract3 into separate cases
Each op has a fixed arg shape so matching them separately means the pattern itself encodes the shape — no `*rest` unpacking, no post-hoc `is not None` guards, and the `_extract_start_length` helper becomes dead and is removed.
Git Commit d47ed18f Branch feat/statically-failing-op-validator Document 1/23 ++ 29 --
achidlow puya
chore: compile all
Git Commit 45f4c097 Branch feat/statically-failing-op-validator Document 18/1,038 ++ 1,038 --
achidlow puya
chore: compile all
Git Commit bc7141ee Branch feat/statically-failing-op-validator Document 3/15 ++ 15 --
achidlow puya
chore: compile all
Git Commit 82d67d96 Branch feat/statically-failing-op-validator Document 3/66 ++ 66 --
achidlow puya
test: cover runtime-bytes / runtime-uint64 bit and byte op branches
Adds runtime-argument calls for getbit/setbit/getbyte/setbyte with constant indices large enough to be statically impossible, restoring 100% line coverage after the generic-index branches were added.
Git Commit 05b0f84a Branch feat/statically-failing-op-validator Document 1/8 ++ 3 --
achidlow puya
refactor: make validator warning messages generic
Drop specific constant values from the reason strings so they describe the class of failure rather than the specific bad inputs, e.g.

  +: 18446744073709551615 + 1 overflows uint64; will fail at runtime if reached

becomes

  uint64 addition of constants overflows; will fail at runtime if reached

Specific values were useful while the validator was being bootstrapped but add noise for end users who can see the literal values at the source location anyway. Also drops the leading `{op.code}:` prefix since the op name is now folded into the reason text.
Git Commit bf079aad Branch feat/statically-failing-op-validator Document 1/29 ++ 45 --
achidlow puya
remove test case that will now fail compilation at TEAL layer
Git Commit aa09c088 Branch feat/statically-failing-op-validator Document 1/2 ++ 2 --
achidlow puya
refactor: split substring/substring3 and replace2/replace3 into separate cases
Same treatment as extract/extract3: each op has a fixed arg shape, so matching them separately lets the pattern encode the shape. Removes `_substring_start_end` and `_replace_start_and_bytes` helpers and their `*rest` unpacking plumbing.

Revealed a missing OP test case, so added coverage.
Git Commit aac2583b Branch feat/statically-failing-op-validator Document 52/1,518 ++ 1,323 --
achidlow puya
consistent formatting
Git Commit 967a8800 Branch feat/statically-failing-op-validator Document 1/72 ++ 58 --
achidlow puya
minor refactor
Git Commit d138f14f Branch feat/statically-failing-op-validator Document 1/57 ++ 34 --
achidlow puya
add StaticallyFailingOpValidator
Post-destructuring IR pass that emits a compile-time warning when an AVM op is statically known to fail at runtime given its constant arguments. Mirrors the guard conditions that `intrinsic_simplification` uses to bail out of folding.

Covers:
- arithmetic: +, -, *, /, %, exp (overflow / underflow / div-by-zero / 0**0)
- shifts: shl, shr (amount >= 64)
- conversion: btoi (len > 8), bzero (len > 4096)
- extract / extract3 / extract_uint{16,32,64}
- substring / substring3
- replace2 / replace3
- getbit / setbit (uint64 and bytes variants)
- getbyte / setbyte

Handles both immediate-form and stack-arg form where the AVM op has both (e.g. extract vs extract3).
Git Commit 3c87b7a6 Branch feat/statically-failing-op-validator Document 2/178 ++ 0 --
achidlow puya
method rename
Git Commit 40c20a90 Branch feat/statically-failing-op-validator Document 1/12 ++ 12 --
achidlow puya
add concat buffer overflow detection
Git Commit bf195465 Branch feat/statically-failing-op-validator Document 2/12 ++ 0 --
achidlow puya
make getbit error handling cover all constant indexes
Git Commit da8fb325 Branch feat/statically-failing-op-validator Document 1/12 ++ 6 --
achidlow puya
refactor (WIP)
Git Commit 20a1c3d8 Branch feat/statically-failing-op-validator Document 1/157 ++ 71 --
achidlow puya
chore: compile all
Git Commit c06399a3 Branch feat/statically-failing-op-validator Document 50/3,131 ++ 2,310 --
achidlow puya
test: add coverage test case for StaticallyFailingOpValidator
Exercises every warning-emitting branch in statically_failing_op.py (both the top-level `_check` match arms and the three helpers' immediate-form / stack-form / None-fallthrough paths). Hits 100% line coverage of the validator via a single test case:

  coverage run -m pytest tests/test_compile.py -k statically_failing_ops -o addopts=""
  coverage report -m --include="src/puya/ir/validation/statically_failing_op.py"

Overlaps deliberately with a handful of the existing regression_tests cases since this is targeted at coverage completeness rather than regression pinning.
Git Commit 22b63769 Branch feat/statically-failing-op-validator Document 55/7,680 ++ 0 --
achidlow puya
chore: compile all
Git Commit f60b8f82 Branch feat/statically-failing-op-validator Document 3/87 ++ 87 --
achidlow puya
improving static failing op detection (WIP)
Git Commit c347c1df Branch feat/statically-failing-op-validator Document 1/37 ++ 49 --
achidlow puya
chore: compile all (after rebase)
Git Commit a57c33f6 Branch feat/statically-failing-op-validator Document 2/0 ++ 32 --