Skip to content

docs: add inlineDemo tracing example (inline showcase)#232

Open
gnidan wants to merge 1 commit into
transform-contextfrom
compiler-inline-demo
Open

docs: add inlineDemo tracing example (inline showcase)#232
gnidan wants to merge 1 commit into
transform-contextfrom
compiler-inline-demo

Conversation

@gnidan

@gnidan gnidan commented Jul 3, 2026

Copy link
Copy Markdown
Member

Adds the inlineDemo tracing example — a dedicated showcase for the
inline transform, the way tailRecursiveSum/tailRecursiveFactorial
showcase tailcall.

The program

A leaf helper square(x) -> x * x called from two sites:

sumOfSquares = square(a) + square(b);   // a = 3, b = 4

Args are storage reads (a, b), not constants — so L1 fold can't
collapse the inlined bodies, keeping the two virtual activations visible
in the tracer at O2/O3.

Verified against bugc (this branch)

Scope of this PR

Data only — the inlineDemo export. Prose + the <TraceExample> block
in tracing.mdx will follow from writer/docs (coordinating placement
with the #227 Explore/trace-playground reorg).

A small leaf helper square(x) called from two sites with
storage-read args. At O2/O3 both sites inline into the caller ->
two virtual activations in the tracer (the inline showcase, as
sum/factorial were for tailcall). Args are non-constant (storage
reads) so L1 fold can't collapse the inlined bodies.

Verified against bugc: correct result (3^2 + 4^2 = 25) at O0-O3;
zero inline marks at O0/O1, both sites inlined at O2 (108 -> 50
runtime instrs) and O3.

Prose + TraceExample wiring to follow (writer/docs).
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://ethdebug.github.io/format/pr-preview/pr-232/

Built to branch gh-pages at 2026-07-03 00:16 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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