Skip to content

Regenerate compile_file: comments skipped at 2 steps/char, not 15 - #41

Merged
olydis merged 1 commit into
mainfrom
claude/tc-performance-optimizations-rqtyzl
Sep 29, 2026
Merged

olydis merged 1 commit into
mainfrom
claude/tc-performance-optimizations-rqtyzl

Conversation

@olydis

@olydis olydis commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

compile_file.dag rebuilt from lambada-llc/arboretum#70: comment and blank lines are skipped where they stand, 2 reductions a character instead of 15. Output unchanged, byte for byte.

compile_file, tree-calculus main steps reduce
forest 5 MB (1 KB of code) 47,612,116 → 6,475,725 10,159 → 768 ms (13×)
forest 1.2 MB 11,999,984 → 1,728,420 1,805 → 190 ms (9.5×)
arboretum compiler.lamb (66 KB, real code) 7,637,948 → 5,990,278 934 → 747 ms (1.25×)

The whole source still goes in, so #40 isn't needed for speed: this 5 MB source compiles whole in 768 ms here, and in 82 ms on the tree-calculus runtime stack (lambada-llc/tree-calculus#38 → #42).

The demo env-dags only renumber: canonicalized, they are unchanged.

runner -s (eager), min of 5 interleaved runs, 4-CPU VM.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ffv5AybPTpV56D5vuayQr

arboretum's statements no longer splits a source into lines. A run of
comment and blank lines is dropped where it stands by skip_line — two
reductions a character on the eager runner, the list's triage and a memo
hit, instead of fifteen — and a statement's text is copied out of the
source piece by piece, a piece being lines that follow one another, which
only ever looks at the character after a newline. So nothing that is not
code is built, or read twice, memo or no memo.

skip_line is closed and re-enters itself on the tail, so a runtime can
recognize its tree and take its steps natively.

compile_file's output is unchanged, byte for byte: on every arboretum and
forest source, 261 historical ones, 109 constructed edge cases, 9331
exhaustive and 7822 random sources, and statements alone on 142,377 inputs
and 19,830 lists of arbitrary trees. It is the fixed point of the build.

Reduction steps, compile_file, before -> after:
  eager runner
    forest simple/paper_experiments (5 MB)          47.6M -> 6.48M
    arboretum src/lambada/compiler.lamb              7.84M -> 6.13M
  dag.js (lazy, no memo)
    forest simple/paper_experiments (5 MB)          1116M -> 806M
    forest termination/paper_experiments (1.2 MB)    281M -> 204M

The demo environments differ only in the bundle's ids, which the new
definitions shifted; canonicalized, they are what they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ffv5AybPTpV56D5vuayQr
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