Skip to content

format: clarify inline activation reconstruction (push/pop vs membership)#233

Merged
gnidan merged 1 commit into
transform-contextfrom
architect-inline-reconstruction-spec
Jul 3, 2026
Merged

format: clarify inline activation reconstruction (push/pop vs membership)#233
gnidan merged 1 commit into
transform-contextfrom
architect-inline-reconstruction-spec

Conversation

@gnidan

@gnidan gnidan commented Jul 3, 2026

Copy link
Copy Markdown
Member

Amends the invoke spec's "Reconstructing activations" section to close an ambiguity that #230's inline pass exposed end-to-end. This is a spec-wording change only — no schema change.

Why

ui's verification of #230 found the docs tracer mis-renders inline virtual activations (call stack never pops; phantom dbl > dbl frames). Root cause: downstream O2 passes smear the invoke and return bracket markers across every instruction of an inlined body, and the spec didn't explicitly forbid that or separate the two reconstruction concerns. This amendment makes the contract unambiguous so both the compiler (emission) and the UI (reconstruction) have a firm reference.

What changes

  • Bracketed emission is required. invoke goes on the first instruction of a body, return on the last. Compilers must not duplicate either across interior instructions — repeating them pushes/pops spurious activations.
  • Single-instruction body exception. A body whose entry and exit coincide legitimately carries both invoke and return on that one instruction; a debugger processes them push-then-pop (same pattern a tailcall back-edge already uses).
  • Display semantics stated. invoke opens an activation inclusive of its instruction; return closes it after its instruction (the return instruction is still inside the activation).
  • Lifetime vs membership separated. Push/pop determines when a virtual activation is open (its lifetime); per-instruction transform:["inline"] membership determines which open activation an instruction belongs to. An activation stays open across non-member (interleaved caller) instructions, which are attributed to the enclosing activation.

Companion PRs into transform-context: compiler de-smears the emission to boundary instructions; ui implements push/pop + membership-attribution reconstruction with an inline chip (task #23).

…hip)

Amend the invoke spec's "Reconstructing activations" section to
resolve an ambiguity #230's inline pass exposed: an inlined body's
invoke/return markers must bracket the body (invoke on the first
instruction, return on the last), never duplicate across interior
instructions. Duplicated boundary markers push/pop spurious
activations.

- State the push/pop display semantics: invoke opens inclusive of
  its instruction, return closes after its instruction.
- Require bracketed emission; permit the single-instruction body
  (entry==exit) to carry both invoke and return, processed
  push-then-pop.
- Separate the two concerns explicitly: push/pop determines an
  activation's lifetime; membership determines which open
  activation an instruction belongs to. An activation stays open
  across non-member (interleaved caller) instructions.

No schema change.
@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 00:38 UTC

@gnidan gnidan merged commit c03679c into transform-context Jul 3, 2026
4 checks passed
@gnidan gnidan deleted the architect-inline-reconstruction-spec branch July 3, 2026 00:34
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