Skip to content

programs-react: adopt locked inline virtual-activation contract#237

Merged
gnidan merged 1 commit into
transform-contextfrom
ui-inline-contract
Jul 3, 2026
Merged

programs-react: adopt locked inline virtual-activation contract#237
gnidan merged 1 commit into
transform-contextfrom
ui-inline-contract

Conversation

@gnidan

@gnidan gnidan commented Jul 3, 2026

Copy link
Copy Markdown
Member

Follow-up to #234 (already merged). Brings the inline virtual-activation call-stack reconstruction up to architect's locked contract from #23. Targets `transform-context`.

#234 shipped a pragmatic version (invoke-wins + dedup + guard). This replaces the reconstruction core with the agreed contract:

  • extractCallEvents — expose ALL call events on an instruction (ordered invoke-before-return) so a co-located invoke+return context is never swallowed as invoke-only. extractCallInfoFromInstruction now returns the first event (display banner unchanged). Parsing factored into parseInvoke/parseReturn/parseRevert + collectCallInfos.
  • Close-after semantics — an invoke opens a frame inclusive of its instruction; a return closes it after (the pop is deferred until the viewed step advances past it). So a frame is visible while parked on its return-bearing instruction — uniformly for real and virtual frames, and correct for a single-instruction inlined body.
  • Marker-keyed dedup — the caller-JUMP/callee-JUMPDEST collapse now also requires matching inline-ness, so a virtual invoke never merges with an adjacent real invoke of the same name.
  • Generalized membership guard — force-pop trailing virtual frames whose depth exceeds the instruction's inline-marker count (handles nested inlining and residual smear).

Verification

  • TDD, 59 programs-react tests green. New coverage: extractCallEvents both-events ordering; close-after lifetime; single-op body; two adjacent sites split by the return; marker-keyed dedup; nested (double-marker) inlining; and a real-call close-after regression.
  • End-to-end on real O2 (dbl inlined at 2 sites): one virtual frame per body, top level between/after, no phantom — holds even against the current pre-de-smear emission.

Notes

Per architect's rulings on #23, replace the pragmatic invoke-wins
reconstruction with the locked contract:

- extractCallEvents: expose ALL call events (ordered invoke-before-
  return) so a co-located invoke+return context is never swallowed as
  invoke-only. extractCallInfoFromInstruction now returns the first
  event (display banner unchanged). Parsing split into
  parseInvoke/parseReturn/parseRevert + collectCallInfos.
- buildCallStack close-after semantics: an invoke opens a frame
  inclusive of its instruction; a return closes it AFTER (deferred
  until the viewed step advances past it), so a frame is visible while
  parked on its return-bearing instruction — uniformly for real and
  virtual frames, and correct for a single-instruction inlined body.
- marker-keyed dedup: the caller-JUMP/callee-JUMPDEST collapse now also
  requires matching inline-ness, so a virtual invoke never merges with
  an adjacent real invoke of the same name.
- generalized membership guard: force-pop trailing virtual frames whose
  depth exceeds the instruction's inline-marker count (handles nested
  inlining and residual smear).

Tests: close-after lifetime, single-op body, adjacent-site split via
the return, marker-keyed dedup, nested (double-marker) inlining, and a
real-call close-after regression. 59 programs-react tests green.
Verified end-to-end on real O2 (dbl@2 sites): one virtual frame per
body, top level between/after, no phantom — holds even pre-de-smear.
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-03 01:21 UTC

@gnidan gnidan merged commit 20a7654 into transform-context Jul 3, 2026
4 checks passed
@gnidan gnidan deleted the ui-inline-contract branch July 3, 2026 01:16
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