Repository navigation
Conversation
EagerGraphNilMmap32Jets answers arboretum's Quoted._normalize
(src/quoted/eval.lamb), Certify.Size's budgeted applicative-order
normalizer, with the _apply_nf and _classify it calls:
apply(_normalize fuel, q), recognized in the S-rule branch after the
memo by one compare against y of △(△x)y, then a match of x against a
template that keying derives from the tree (trees/quotedNormalize.dag)
on every clear(): jets::Partial, for any jet asked apply(f fuel, …).
The loop runs on explicit stacks, normalizes a shared subterm that
spends no fuel once, and leaves to the rules a fuel that is no Snat
where a rule needs it. Its answer is remembered as skip_line's, counted
in jets=; RUNNER_JETS=0 keys nothing. No theorem covers it.
Every test of a build loaded and dumped by one runner, dumps
byte-identical; steps saved at collection budgets of 448, 512 (the
default) and 576 MB, and with none:
main -> this arboretum 15M 11M 104M 68M
forest 20M 25M 26M 65M
#63 -> #63 + this arboretum 60M 127M 57M 49M
forest 65M 1M -120M 52M
From empty caches, arboretum ./build.sh 2,376M / 2,343M -> 2,147M /
2,062M steps, 60.7 / 68.2 -> 60.5 / 62.0 s; forest ./build/full.sh
3,243M -> 3,018M, 133.9 -> 127.4 s. Compiling compiler.lamb, where it
never fires, takes 3.6% more instructions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ffv5AybPTpV56D5vuayQr
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.
What changes
EagerGraphNilMmap32Jetsnow answers arboretum'sQuoted._normalize(src/quoted/eval.lamb) natively, together with the_apply_nfand_classifyit calls. This is the budgeted applicative-order normalizer behindCertify.Size's_eagerly.trees/quotedNormalize.dagisQuoted._normalize:6at arboretum e3df589. Forest's pinned arboretum (c8bcaf5) has the same md5.embed.mjsregeneratesjets.hppandJets/Trees.lean. Trees.lean renumbers its shared definitions because the new file sorts beforeskipLine._normalize fuelhas the shape△(△x)y.yis a 464-node tree that is the same for every fuel; the fuel sits at 3 places insidex.recall(), one comparey == Ygates a template match, and the match recovers the fuel.jets::Partial. On everyclear()it reducesf △andf (△△)by the rules and diffs the two results. It throws if the fuel appears anywhere other than as-is.jets::QuotedNormalize, in the neweager-graph-nil-mmap-32-jets.hpp):Option.bindorder, and the firstnoneis the answer.remember(), which skip_line now uses too.RUNNER_STATScounts it injets=. WithRUNNER_JETS=0, nothing is keyed.Measured effect
All runs on the same machine, back to back. Step counts are deterministic for a given configuration; wall-time differences are within run-to-run noise.
Replay: one runner
loads the build's whole canonical bundle, with every expect test, thendumps it. Dumps are byte-identical in every run. Steps saved (negative means fewer steps):RUNNER_RSS_THRESHOLD_MB)Builds from empty caches (4 test threads,
RUNNER_STATS=1, steps summed over every runner command):./build.sh, steps./build/full.sh, stepsBuild step counts vary between identical runs: two identical #63 builds differ by up to 195M steps. The review re-run (order base, this, this, base) saves 58M and 138M steps (mean 98M), against 229M and 281M in the first pairs. On top of #63, the build-level effect is within noise.
Idle cost, measured by compiling compiler.lamb, where the jet never fires (GCC 13,
-O3):clear().Partial::keycallsapply()on an evaluator that GCC cannot prove is the runner's global. GCC therefore emits a genericapply()beside the constprop clone the runner runs, and the clone shrinks from 0x124f to 0xf76 bytes because less gets inlined into it.noinlineoralways_inlineon the keying path does not remove the generic copy.Validation
implementation/cpp/dag-machine/test.shpasses underLC_ALL=CandLC_ALL=C.UTF-8: 35 PASS each, runner 21/21.test-jets.cpp:△(△ w x)). Each term runs at every fuel from 0 to one past where it runs out, capped at 48. That is 5,346 calls, 4,538 of which run out of fuel, using up to 46 rules. The jet answers every call, and every answer equals the rules'. Every rule branch fires: rule 1 23k times, rule 2 31k, rule 3 on △ / △u / △uv 243 / 1.6k / 2.0k, stuck 1.6k.clear(), including a collection in the middle of keying.remember().lake build --wfailpasses. Only Trees.lean changes; no theorem changed../build.shfrom empty caches on this tree (author 2×, review 2×):git status --porcelain --ignore-submodulesis clean, and thesubmodules/lambadadiff is identical to main's run (md5 09cfb412)../build/full.sh:git diff --exit-code --ignore-submodulesis clean.Caveats
Snat.match,fix, the quoting in reflect/quote.lamb), or to the compiler turns the jet off silently. Results stay correct; only the speedup is lost.Overlap and merge order
remember()(eager: Nat.divmod__fastest as a jet #62 and eager: Nat.add and Nat.mul as jets #65 add the same helper asanswered());test-jets.cpp'stree(),snat(),kids()andcopy();eager-graph-nil-mmap-32-jets.hpp. It says the file uses nothing but the evaluator's arena,stem()andfork(), but keying also callsapply()androots(). Whichever PR lands second should correct it.test-jets.cpppasses all 14 checks.jets::Partialis eager: answer Quoted._whnf natively, a jet not yet proven #63'sSpineWhnf::key()/fuel_of(), lifted out and generalized to holes on either side. Whichever PR lands second should moveSpineWhnfonto it, adding aleft()twin ofright(), so the template code exists once, then rerunembed.mjs.🤖 Generated with Claude Code
https://claude.ai/code/session_018ffv5AybPTpV56D5vuayQr