Skip to content

eager: skip_line as a jet, proven sound - #41

Merged
olydis merged 1 commit into
mainfrom
claude/tc-performance-optimizations-rqtyzl-jets
Oct 2, 2026
Merged

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

Conversation

@olydis

@olydis olydis commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

This is one commit on main. Merge after #59.

EagerGraphNilMmap32Jets, the eager runner's evaluator, answers lambada's skip_line natively. It checks the memo first and records the answer there. EagerGraphNilMmap32 = BasicEagerGraphNilMmap32<false> compiles to main's code.

Measured with #59 applied (cachegrind):

#59 this
5 MB compile_file: steps 6,487,439 162,874
5 MB compile_file: instructions 822.7M 417.3M
1.3 MB: steps / instructions 1,740,694 / 321.5M 164,770 / 219.7M
compiler.lamb: steps / instructions 6,541,055 / 789.3M 6,399,083 / 782.2M
load, no jet fires: instructions 138.0M 139.7M (+1.2%)

Where no jet fires, the check itself costs +0.27%. The rest of the load overhead is 9,506 extra steps: the jet's trees are interned at startup, which shifts the arena indices the memo is keyed on.

  • Off switch: RUNNER_JETS=0 skips interning the jet's trees, so the reduction is main's step for step. RUNNER_STATS adds jets= and skipped=.

  • Soundness: runtimeJets_sound (Cpp/Jets.lean) concludes Apply. It uses propext, Classical.choice and Quot.sound.

  • Drift check: embed.mjs writes jets.hpp and Jets/Trees.lean from trees/*.dag, and test.sh fails if either drifts.

  • Tests: test.sh passes under C and C.UTF-8:

    • test-jets.cpp: 5 checks;
    • runner suite: 18;
    • reduce_canonicalize: 4.

    The suite catches all 29 deliberately broken versions of the code that change an answer.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ffv5AybPTpV56D5vuayQr

@olydis
olydis force-pushed the claude/tc-performance-optimizations-rqtyzl-proofs branch from 1c4de4e to 8e34c8d Compare September 29, 2026 17:49
@olydis
olydis force-pushed the claude/tc-performance-optimizations-rqtyzl-jets branch from 7557ccd to 388c8ec Compare September 29, 2026 17:49
@olydis olydis changed the title eager: skip_line as a proven jet (5 MB compile: 6.5M → 0.16M steps) eager: skip_line as a proven jet (5 MB compile reduce 84 → 17 ms) — after #40 Sep 29, 2026
@olydis
olydis changed the base branch from claude/tc-performance-optimizations-rqtyzl-proofs to main September 29, 2026 17:50
@olydis
olydis marked this pull request as draft September 29, 2026 17:50
@olydis
olydis force-pushed the claude/tc-performance-optimizations-rqtyzl-jets branch 3 times, most recently from b5c8a13 to 01734bc Compare September 30, 2026 04:33
@olydis olydis changed the title eager: skip_line as a proven jet (5 MB compile reduce 84 → 17 ms) — after #40 eager: skip_line as a proven jet, in its own -jets.hpp (5 MB compile reduce 84 → 17 ms) — after #40 Sep 30, 2026
@olydis
olydis force-pushed the claude/tc-performance-optimizations-rqtyzl-jets branch 4 times, most recently from 09aaed7 to e19437c Compare October 1, 2026 23:11
@olydis olydis changed the title eager: skip_line as a proven jet, in its own -jets.hpp (5 MB compile reduce 84 → 17 ms) — after #40 eager: skip_line as a jet, in its own header, proven sound — after #40 Oct 1, 2026
@olydis
olydis force-pushed the claude/tc-performance-optimizations-rqtyzl-jets branch from e19437c to dfabb3b Compare October 2, 2026 03:15
@olydis olydis changed the title eager: skip_line as a jet, in its own header, proven sound — after #40 eager: skip_line as a jet, in its own header, proven sound Oct 2, 2026
@olydis
olydis marked this pull request as ready for review October 2, 2026 03:15
@olydis olydis mentioned this pull request Oct 2, 2026
EagerGraphNilMmap32Jets, the eager runner's evaluator, answers lambada's
skip_line natively after the memo, which records the answer: a 5 MB
compile_file reduces in 162,874 steps instead of 6,487,439.
EagerGraphNilMmap32 compiles to main's code. RUNNER_JETS=0 turns the jet
off, and the reduction is then main's step for step; RUNNER_STATS counts
jets= and skipped=. embed.mjs writes jets.hpp and Jets/Trees.lean from
trees/*.dag, test.sh checks them; runtimeJets_sound.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ffv5AybPTpV56D5vuayQr
@olydis
olydis force-pushed the claude/tc-performance-optimizations-rqtyzl-jets branch from dfabb3b to 4a1ae05 Compare October 2, 2026 12:10
@olydis olydis changed the title eager: skip_line as a jet, in its own header, proven sound eager: skip_line as a jet, proven sound Oct 2, 2026
@olydis
olydis merged commit 16dfe07 into main Oct 2, 2026
2 checks passed
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