Repository navigation
Conversation
EagerGraphNilMmap32Jets answers arboretum's Nat.divmod__fastest natively, and through it div__fastest and mod__fastest, which apply its partial: divmod a is △U (△V (△△a)) by S and K alone, and applying that to b is long division over 64-bit limbs when a and b are naturals without trailing △s and b is not 0; anything else is left to the rules. U and V are read off trees/divmod.dag. Not proven yet: implementation/lean/Cpp/README.md has the plan. Each repository's bundle loaded whole in one runner, tests included, dumps the same bytes in fewer steps: arboretum 2,126.2M -> 2,089.1M; forest 2,103.4M -> 2,069.7M with no collection, 2,971.2M -> 2,706.1M at the default budget (10 collections -> 9). Audio.Wav.33 alone: 75.0M -> 33.3M steps, 5.0 s -> 1.9 s. RUNNER_JETS=0 reduces step for step as main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018ffv5AybPTpV56D5vuayQr
This was referenced Oct 3, 2026
fork(natural(_q), natural(_r)) left the order to the compiler: GCC builds r first, Clang q, and the indices the cells get decide memo slots. Same source, :test.Audio.Wav.33 took 33,342,557 steps under GCC and 33,854,449 under Clang (Music.Melody.36: 75,381,184 and 75,141,611); main takes 75,030,361 under both. r is now built first, as GCC did: GCC's binary is byte-identical, and Clang's counts match it. 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.
Draft: this jet is not proven.
skip_linehasruntimeJets_sound; this jet has no theorem yet. Here is the proof plan, also written inimplementation/lean/Cpp/README.md:divmod a=△U (△V (△△a))for everya.explorecan decide this withaas the uninspectedvar 0.Nat(natVal/ofNat, core Lean only, no Mathlib).a's bits throughList.foldr__fastest, with the invariant "top bits = q·b + r, r < b".is_lte__fastest,sub__fastest,succ__fastest,doubleandcanonicalize, each proved by list induction.explorehas to be extended to handle pending frames and several opaque variables.reduce (△U (△V (△△a))) b k → dispatch (△ q r) kand use it as aJofruntime_sound, asDropJetis used.What changes
eager-graph-nil-mmap-32.hpp. In the S-rule branch, after the memo lookup, one extra compare:an.u == U. When it matches,divmod()runs:yis△V (△△a).aandbinto 64-bit limbs. It falls back to the rules unless both are lists of△/△△with no trailing△andb ≠ 0.△ q rwithlist()(r first, on every compiler), and records the answer for theMEMOIZEframe. That recording isanswered(), whichskip_linenow uses too.div__fastest/mod__fastestare△C (divmod a), so they reach the jet after one S step. They need no keys of their own.trees/divmod.dagisNat.divmod__fastest. It is identical in arboretum e3df589 (current main) and in forest's bundle.embed.mjsturns it intojets.hppandJets/Trees.lean.UandVare read off it, sincedivmod = S (K (△U)) (S (K (△V)) K).test-jets.cpp:△, a cell that is not a bit, a list ending in a stem, andb = 0.clear().divmod()'s six input guards, accepting a trailing△, or dropping the trailing-△strip on its output makes a test fail.fork(natural(_q), natural(_r))left the build order to the compiler. GCC builds r first and Clang builds q first, and the indices decide memo slots. So step counts depended on the compiler:Audio.Wav.33took 33,342,557 steps under GCC and 33,854,449 under Clang. Main takes 75,030,361 under both. r is now built first. GCC's binary is byte-identical, so every number below still holds, and Clang now matches it.Measured
All runs are on the same machine. Base is
b873b56(main).Whole-bundle replay: one runner loads the bundle, evaluates every test, then dumps it. Steps are deterministic.
Single tests in a fresh runner (median of 3, base and jet alternated):
:test.Audio.Wav.33:test.Music.Melody.36:test.Image.Png.Png.30Full builds from empty caches. Each run is one sample. Summed runner steps vary by ±100M from run to run, because tests spread over 4 workers and collections land in different places. So these rows are not a clean measure of the jet; the replay is.
./build.sh, wall./build.sh, summed steps./build/full.sh, wallIdle cost on a test with no division,
:test.Certify.Size.Test.45(5.51M steps):applygoes from 393.6M to 406.9M, +2.4 per step. The S-branch compare (cmp+jne) accounts for +2.0 per step.:test.Certify.Size.Test.43, 24 concurrent pairs): within noise. The median jet/base ratio was 1.010 in one slot order and 0.993 in the other.Validation
implementation/cpp/dag-machine/test.shpasses underLC_ALL=Cand underLC_ALL=C.UTF-8, at both commits.test-jets.cppbuilt with Clang also passes.lake build --wfailpasses.dumps are byte-identical between base and jet, for both bundles. WithRUNNER_JETS=0, step counts equal main's binary withRUNNER_JETS=0: 2,124,623,037 for arboretum and 2,974,074,032 for forest../build.shfrom empty caches with this runtime, 3 runs:src/is unchanged, and the lambada exports are identical to base's../build/full.sh:git diff --exit-code --ignore-submodulesis clean.divmod/div/mod, up to 300 bits, about 20% of them not canonical. Jets off and on gave 0 mismatches. Operands of up to 2,000 bits match Python's//and%.divmod/div/modrequests, 0 mismatches against the rules and 0 against a bit-vector oracle. Operands:a = q·b + rwith r ∈ {0, 1, b−1, random}.a = b·2ᵏ.Caveats
UandV. Any edit todivmod__fastest, or to anything it uses, turns the jet off silently. That coversfoldr,is_lte__fastest,sub__fastest,canonicalize,succ__fastest,double,Pair,Bool.match_ftandfix. The fallback is still correct. A CI canary that checks jets > 0 would catch it.apply,collect's mark line,intern_jets,test-jets.cpp, and the generatedjets.hpp/Trees.lean. Whichever PR lands second should rebase and rerunembed.mjs. arboretum and forest only benefit once their tree-calculus pin is bumped, which is not part of this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_018ffv5AybPTpV56D5vuayQr