Skip to content

[codex] test nested return frame restore#44

Merged
siyul-park merged 1 commit into
mainfrom
codex/test-nested-return-frame-restore
May 30, 2026
Merged

[codex] test nested return frame restore#44
siyul-park merged 1 commit into
mainfrom
codex/test-nested-return-frame-restore

Conversation

@siyul-park

Copy link
Copy Markdown
Owner

What changed

Added a focused interpreter regression test for nested function returns in /Users/siyulpark/.codex/worktrees/d9b2/minivm/interp/interp_test.go.

The new case exercises a recent interp/threaded.go change that replaced repeated frames[fp-1] lookups with the cached current-frame pointer i.fr. It verifies that after an inner function returns, the caller frame is restored before the caller executes LOCAL_SET and LOCAL_GET.

Changed paths tested

  • interp/threaded.go: CALL/RETURN frame restoration through subsequent caller-local access
  • interp/interp_test.go: added nested return restores caller frame for locals

Validation

  • go test ./interp -run 'TestInterpreter_Run/nested return restores caller frame for locals'
  • go test ./interp -run 'TestInterpreter_Run|TestInterpreter_WithThreshold'

Skipped targets

  • Broad opcode re-coverage in interp/threaded.go: skipped because the recent refactor mostly changed frame-pointer access patterns, and existing table-driven runtime coverage already exercises many opcodes.
  • JIT-only coverage: skipped because this change was isolated to threaded execution and the smallest reliable regression target is the threaded nested-return path.

@siyul-park siyul-park force-pushed the main branch 3 times, most recently from 8579b1a to a8e74e1 Compare May 28, 2026 13:07
@siyul-park siyul-park marked this pull request as ready for review May 30, 2026 02:35
@siyul-park siyul-park merged commit 93e3169 into main May 30, 2026
5 checks passed
@siyul-park siyul-park deleted the codex/test-nested-return-frame-restore branch May 30, 2026 03:38
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