docs: add inlineDemo tracing example (inline showcase)#232
Open
gnidan wants to merge 1 commit into
Open
Conversation
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).
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the
inlineDemotracing example — a dedicated showcase for theinlinetransform, the waytailRecursiveSum/tailRecursiveFactorialshowcase
tailcall.The program
A leaf helper
square(x) -> x * xcalled from two sites:Args are storage reads (
a,b), not constants — so L1 fold can'tcollapse the inlined bodies, keeping the two virtual activations visible
in the tracer at O2/O3.
Verified against bugc (this branch)
3^2 + 4^2 = 25.runtime instructions) and O3.
target) / return contexts emitted per the format: spec the inlined-call virtual activation contract #229contract.
Scope of this PR
Data only — the
inlineDemoexport. Prose + the<TraceExample>blockin
tracing.mdxwill follow from writer/docs (coordinating placementwith the #227 Explore/trace-playground reorg).