Skip to content

Exercise generated tail wrappers with runtime ancestor unwind accounting - #195

Merged
mstan merged 1 commit into
RetroPortingToolKit:mainfrom
sergiomanzur:codex/tail-wrapper-ancestor-unwind
Oct 21, 2026
Merged

mstan merged 1 commit into
RetroPortingToolKit:mainfrom
sergiomanzur:codex/tail-wrapper-ancestor-unwind

Conversation

@sergiomanzur

Copy link
Copy Markdown
Contributor

Add ROM-free execution coverage for the shared-tail return problem encountered during ISSD Native bring-up. Current main already handles this using tail-entry markers in the runtime, so this PR preserves that implementation and adds a regression rather than applying the older downstream per-wrapper decrement.

The test compiles an actual emitted past-end tail statement together with the production context-adoption functions and ancestor/post-return resolvers. It exercises one to three tail wrappers, normal returns, pre-RTS and post-RTS ancestor skips, unchanged LLE unwind sentinels, and discarded/consumed context.

Validation:

  • python -m pytest tests/v2/test_tail_unwind_execution.py -q: 1 passed (12 tail-chain scenarios plus context checks).
  • Mutation check: replacing guest-depth accounting with raw host-frame depth fails with 18 fixture failures.
  • Mutation check: inserting the downstream wrapper decrement fails with 15 fixture failures, including sentinel propagation.
  • Independent review found no blocking issues.

The test executes production resolver bodies and emitted wrapper code; its frame push/prologue and ordinary caller continuation are modeled by the fixture. It does not establish cross-title gameplay coverage. No runtime behavior, game ROM, or generated commercial-game source changes.

@mstan mstan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test-only addition. The fixture exercises emitted tail wrappers and production ancestor resolvers; it preserves the existing runtime implementation and tests sentinel propagation and context consumption.

Validation: five-head integration passed 826 Python tests (2 skipped) and 109 Rust tests. After excluding #198 for its separate title-save compatibility blocker, the four-head combination passed all 69 focused tests. Linux, Windows, macOS and Lua CI are green for this reviewed head. No new cross-title gameplay playtest is claimed.

@mstan
mstan merged commit 62ab763 into RetroPortingToolKit:main Oct 21, 2026
8 checks passed
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.

2 participants