Skip to content

test: add VM coverage for arena fallback and JIT edge cases#115

Merged
danieljohnmorris merged 1 commit intomainfrom
test/vm-coverage
Mar 8, 2026
Merged

test: add VM coverage for arena fallback and JIT edge cases#115
danieljohnmorris merged 1 commit intomainfrom
test/vm-coverage

Conversation

@danieljohnmorris
Copy link
Collaborator

Summary

  • Add 20 tests covering previously uncovered paths in src/vm/mod.rs and src/vm/jit_cranelift.rs
  • Arena-full fallback (7 tests): exhaust the 64KB bump arena by creating 3000+ records in a loop, verifying OP_RECNEW and OP_RECWITH fall back to Rc heap allocation correctly (L3493-3501, L3551-3571)
  • Arena record -> Value conversion (3 tests): exercise to_value and to_value_with_registry on arena-allocated records including nested records (L2328-2350, L2385-2404)
  • Multi-frame OP_RET (3 tests): 3-4 level deep call chains verifying return through multiple stack frames, including record returns across frames (L2630-2637)
  • JIT edge cases (7 tests): OP_ROU (round), zero-arg OP_CALL via bytecode injection, record return arena promotion in call(), OP_RECWITH, and foreach/OP_LISTGET (L730-735, L1037-1039, L1153-1160, L1278-1281)

Test plan

  • cargo test — all 2390 tests pass (0 failures)
  • cargo clippy -- -W clippy::all — no warnings

…nd JIT edge cases

Add tests covering previously uncovered paths in src/vm/mod.rs and
src/vm/jit_cranelift.rs:

- Arena-full fallback: OP_RECNEW and OP_RECWITH heap fallback when 64KB
  bump arena is exhausted (7 tests creating 3000+ records in loops)
- Arena record to Value conversion and to_value_with_registry paths
- Multi-frame OP_RET: 3-4 level deep call chains returning through
  multiple stack frames, including record returns across frames
- JIT: OP_ROU (round builtin), zero-arg OP_CALL via bytecode injection,
  record return arena promotion, OP_RECWITH, and foreach/OP_LISTGET
@danieljohnmorris danieljohnmorris merged commit a304214 into main Mar 8, 2026
2 checks passed
@danieljohnmorris danieljohnmorris deleted the test/vm-coverage branch March 8, 2026 01:19
@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

❌ Patch coverage is 94.40559% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/vm/mod.rs 94.44% 5 Missing ⚠️
src/vm/jit_cranelift.rs 94.33% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant