You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comprehensive PR review (code-reviewer + pr-test-analyzer +
comment-analyzer) surfaced 5 actionable items. All fixed here:
**Inaccurate comments** (comment-analyzer)
1. `tests/test_stress.py` — `test_tco_with_allocation_1m_iterations`
docstring claimed "~12 bytes per leaked frame ≈ 1300 iters".
`gc_shadow_push` writes one i32 = 4 bytes, not 12 (the 12-byte
figure came from a different fn elsewhere in the file with 2
pointer params + 1 tmp root). The `loop` fn here only pushes
1 pointer per iteration. Corrected to "4 bytes per leaked
pointer root ≈ 4,096 iterations" and added the inline note
that the @int params aren't pointer-typed. Also dropped the
"~200ms on a 2026 MacBook Pro" claim (will rot).
2. `vera/codegen/functions.py` — comment cited "operators.py"
unqualified, but `vera/codegen/` and `vera/wasm/` are peer
directories — should be `vera/wasm/operators.py`. This
matters because #672 explicitly audits the inline-indentation
surface; a mis-pathed reference would cost search time.
Added a #672 cross-reference too.
3. `vera/codegen/functions.py` dispatch comment said "Two sources
of post-body work" but the actual code is a three-branch
dispatch (revert / patch / untouched). Reframed as "Three
outcomes (precedence: 1 > 2 > 3)" with the third explicitly
named — the common non-allocating tail-recursion case from
SKILL.md's "Iteration" section. Also trimmed the
`alloc_local` implementation-detail digression that didn't
add value.
4. `tests/test_codegen.py` — `test_allocating_function_uses_gc_
aware_tco_549` docstring said "sacrificing TCO for shadow-
stack correctness". Inverted framing — pre-#549 the GC
epilogue ran fine, what was sacrificed was WASM call-stack
depth (1M iters trapped with `call stack exhausted` because
the function paid a WASM frame per recursion). Reframed.
**Test coverage gap** (pr-test-analyzer rating 8)
5. Added `test_allocating_function_gc_aware_tco_patches_both_
branches`. The patch loop iterates every body instruction
and patches every `return_call` site individually; a buggy
implementation that bails after the first match (e.g. an
accidental `break`) would still pass the single-site test
above. New test uses a `match` with two ADT arms each ending
in `return_call $build`, asserts BOTH sites have the
`local.get N; global.set $gc_sp` preamble, and that N matches
the same `$gc_sp_save` local captured by the prologue.
**Suggestion** (pr-test-analyzer rating 6)
6. `test_shadow_stack_overflow_traps` — added inline calibration
for the 2000-iteration count: "16K shadow stack / 12 bytes
per frame (2 Array<Bool> params + 1 tmp root) ≈ 1,365 frames;
2000 chosen with ~1.5× safety margin". Previously the
threshold was undocumented; a future per-frame size change
could silently weaken the test without anyone noticing.
**Not addressed**:
- pr-test-analyzer's mutual-recursion test suggestion (rating
8) — the dispatch is per-function and each function's
correctness is independently pinned. Cross-function GC
composition is a deeper concern that doesn't sit in this
PR's scope and would benefit from a separate issue.
- pr-test-analyzer's zero-`return_call`-site test (rating 6) —
edge case is fine; allocating leaf fns just have an unused
`$gc_sp_save` local, no harm.
- api.py inner-helper workaround mention in `stack_exhausted`
message — too tangential for an end-user-facing trap message.
**code-reviewer verdict**: no issues found at confidence ≥ 80.
The fix is structurally correct, the dispatch precedence is
explicitly pinned by tests, and CodeRabbit's prior concerns
(S101 noqa, indent alignment, boundary-safe regex) are all
addressed.
Validation: pytest 3863/3863 ✓, mypy clean ✓, ruff S rules
clean ✓, doc-counts consistent (test counts updated to 3,893).
Co-Authored-By: Claude <noreply@anthropic.invalid>
Vera is in **active development** at v0.0.154 — 810+ commits, 154 releases, 3,892 tests, 96% code coverage, 86 conformance programs, 34 examples, and a 13-chapter specification. See **[HISTORY.md](HISTORY.md)** for how the compiler was built.
184
+
Vera is in **active development** at v0.0.154 — 810+ commits, 154 releases, 3,893 tests, 96% code coverage, 86 conformance programs, 34 examples, and a 13-chapter specification. See **[HISTORY.md](HISTORY.md)** for how the compiler was built.
185
185
186
186
The reference compiler — parser, AST, type checker, contract verifier (Z3), WASM code generator, module system, browser runtime, and runtime contract insertion — is working. The language specification is in draft across [13 chapters](spec/).
0 commit comments