Skip to content

feat(Schonhage): compute native shared box tables - #2185

Merged
SamuelSchlesinger merged 189 commits into
mainfrom
work/three-sum-native-box-table-20261101
Nov 4, 2026
Merged

SamuelSchlesinger merged 189 commits into
mainfrom
work/three-sum-native-box-table-20261101

Conversation

@edemaine

@edemaine edemaine commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Computes the finite Section 4 box values with actual native WordRAM code. One shared directory/catalogue is built from the original headers; each tile fills a compact signed value array using earlier child ranks. Lookup validates a raw cube and reads its stored value. This completes #2176's reusable table milestone; global all-tile amortization, wanted-query construction, Corollary 26/ET integration and tuned 1.9992 remain #1394.

Stacked on #2161. BoxTable.runs_wide proves actual State.init, same-state prefix/halt, computed ranks/values and input/outside frame. BoxTable.exec_constructor handles dirty callers; BoxTable.exec_tile reuses real geometry; BoxTable.exec_lookup returns the existing signed box value. No geometry, rank, layout, execution, timing or table oracle is an input or hypothesis of the complete constructor.

For depth L and H=m-t, S=(H+1)10^L and B the existing finite box count:

  • Shared setup: <=64(L+1)^2*10^L when m<=L; shared directory S words and descriptors3B.
  • Each retained tile: B value words and <=328B+8 native instructions.
  • Valid lookup: <=18L+32 instructions, preserving memory.
  • Fixed64 registers, constructor <=1024 slots including halt, lookup <=256; no width reads. Original headers, signed magnitudes and addresses derive a positive logarithmic admission; every initialized reachable prefix has fitting data words. This does not assert an independent-width polynomial word envelope or the final global thin-product bound.

Source mapping: pinned Tile/Lookup implementation, especially tileBody in Tile.lean, lookupBody in Lookup.lean, and their specs; finite meanings reuse #2161. The source builds a per-tile relative-pointer trie. This original shared rank-directory representation preserves its existing finite boxes and recurrence, with separately proved native costs. Native level0 remains least significant as required by the existing encoders. Natural subtraction handles arbitrary headers; the count comparison uses m<=L and t<=m. Signed inputs are canonical sign/magnitude words; actual unsigned multiply/divide/branch instructions implement all signed arithmetic. Initialization/reading the final output are uncharged; the final halt is charged. Retained-tile space and shared setup must remain explicit in future global composition.

Validation: strict scoped compilation passes all26 new library modules, the new test suite and affected finite-box client; canonical imports, full hygiene/simp, scoped environment lints, compiled doc/test checks, names and whitespace checks pass. Hosted full CI passes all six gates and the standard changed-file checker on final head 7b88ef0d32b9529c0eb2db1e9960ae3de4636d79, resolving the local aggregate-artifact limitation. Admitted initialized signed clients observe -6 at depth0 and -8 at depth1 in the actual pre-halt state, then apply callable lookup to that constructed table. VM cases include cancellation, dirty memory, threshold boundaries, invalid slots/digits, two-star depth-two values, order rejection and outside sentinels. Independent agent /root/review_native_box_table approved the whole source layer at80584f08; /root/review_box_table_tests approved the only subsequent test delta at7b88ef0d. All26 library blobs and prior admitted clients are unchanged. These are nonauthoring agent reviews, not human approval. Hosted full validation now passes on that exact final head; maintainer integration remains pending. No curated abstract or rendering changes.

AI assistance: OpenAI Codex implemented proofs/code and used two implementation helpers. Their checks are author-fleet validation, not independent review or human approval.

Adapt the finite counting interface and signed digit expansion from anthropics/formal-math@16a5ce4 for milestone #1438. This is a mathematical interface; native preprocessing, fast solvers and full composition remain under #1394.
Adapt the complete finite Theorem 17 splitting and recovery component, using the existing three weight matrices, lopsided graphs, modular counts and EqOn answer interface. Prove exact integer/real capacity bridges so the finite constructions and scans are computable. Preserve Anthropic source credit; keep the native 3SUM endpoint open in #1394.

Validation: all six gates in scripts/check.sh pass, with LEAN_NUM_THREADS=1 and cache downloads disabled after bootstrap. Full hygiene, changed-source check-simp, changed-file lints and git diff --check pass. Curated abstracts and rendering are unaffected. AI-assisted implementation/self-review by Codex worker codex-three-sum-splitting-t3-0a4d90c0; independent review will be recorded in the PR.
Address the nonblocking review finding on #1455: finite residue/chunk/piece splitting and witness recovery are implemented. Preserve native preprocessing, fast solvers, full input/time/width composition and exponent 1.9992 as open work under #1394.

Documentation only. Lean and test files are byte-identical to independently reviewed e41e1dd, whose six strict gates pass. Checked the diff, milestone reference, implementation paths, hygiene and changed-file lints. Abstracts and rendering are unaffected.
Implement fixed native residue, histogram and composed collision-counting
programs with explicit frames, local word-fit contracts, exact mathematical
collision semantics and charged bound 34n + 5M + 18 (halt excluded).

Implementation layer for #1454 under #1446/#1394, not full preprocessing.
Sorting/frontend, prime searches, heavy extraction, recursion/output and
global logarithmic-width/subquadratic-time composition remain open.
Curated abstracts: no impact on headline statements, definitions or scope.

Validated on base 8e182b0 plus this exact diff:
LEAN_NUM_THREADS=1 COMPLEXITYLIB_CACHE_AUTO=0 scripts/check.sh: all six gates
passed, including strict test/global axiom audit. Changed-file lints against
that base, hygiene --check-simp and git diff --check passed. Final run followed
resolution of shared-host disk/memory pressure; failed earlier attempts are
not counted as validation.

Independent read-only agent correctness/API review by
/root/review_native_histogram approved the final source blobs after replacing
three private clear helpers with WordRAM.clear. No remaining blockers;
optional Count parameter-frame API can accompany its minimum-search client.
This is within-fleet agent review, not outside-coordinator or human approval.
Outside coordinator review is required before integration.

AI assistance: OpenAI Codex implementation/self-review and a separate Codex
review context. Native programs/counting proofs are original; existing
Anthropic mathematical source credit is preserved unchanged.
Implement the complete finite mathematical milestone of #1463 above #1464:
valid layouts, batch-product correctness/error exclusion, arbitrary-N tiling,
exact requested signed products, order/cardinality estimates, geometric tails
and the derived sparse bounds. At D=4^m, L=19m, D^18<=N and |W|*2^m<=N^2,
encoding entries are bounded by4*N^2/D^(1/18), contributing leaves by33
and passed-set cardinalities by(19m+1)*33 times that scale. Add finite
magnitude and auxiliary object-count bounds. None are native instruction costs.

All six final local gates pass: strict build, aggregate check, strict tests,
environment lint, style lint and init-import check. Hygiene --check-simp,
changed-file lints (14 library modules,1 new test) and diff --check pass.
Tests kernel-check signed results3,20,0,-8, true padding, empty/sparse and
negative-order boundaries, and instantiate all aggregate bounds with jointly
satisfiable m=1 parameters and symbolic matrices without resource overrides.

Read-only math/API review by /root/thin_product_review is clear after fixed
doc references/magnitude wording/quotation hygiene. Focused final delta review
by /root/thin_product_final_delta_review is clear for tree
b021e2d, reusing the prior mathematics review.
These are internal agent reviews, not outside coordinator or human approval.

Source: anthropics/formal-math@16a5ce4,
selective Section2 finite mathematics; Anthropic credit/NOTICE retained.
Abstract assessment: no impact on selected headlines, catalogue or rendering.
Full native tensor/sparse-product/Exact Triangle code, native Chan-He #1446,
whole input/time/width composition and improved1.9992 remain under #1394.

AI assistance: implementation and reviews with OpenAI Codex, worker session
codex-thin-product-math-20261028.
Implement fixed 24-register parameter code with charged numeric helpers, exact existing Chan–He outputs, preserved input memory, derived logarithmic width and subquadratic native time. Add executed boundary and input-init contract examples. Original implementation and proofs credited to Erik Demaine; AI assistance by OpenAI Codex. Part of #1446; independent complete parameter subtask #1458.
Restack #1463 above repaired #1464 without changing the reviewed mathematics.
Rewrite 149 documentation blocks in 14 modules as standalone descriptions;
replace operation-cost and word-size narratives with the exact entry, leaf,
passed-set and specified-value quantities proved. Preserve pinned Anthropic
credit, source locators, statements, definitions, proof bodies and imports.
An independent comparison with original ee288fb confirms that all code bytes
outside comments are identical, including code whitespace.

Validation of this final tree: all six gates pass together (strict build,
aggregate check, strict tests, environment lint, style lint, init imports).
Citation-aware full hygiene --check-simp, changed-file lints (14 library modules,
one test) and git diff --check pass. Lean MCP FiniteMagnitude diagnostics finish
without errors or warnings. Serial Smoke/Axioms warmups avoid the shared-host
memory failure previously seen when these import-heavy clients run together.

Tests and substantive math/API review evidence are retained from the original
reviewed tree b021e2d in ee288fb. This change
is documentation-only; /root/draft_thin_docs authored the scratch map and the
continuation worker inspected/applied it. That drafting is not independent review.
Earlier math reviews are inside-fleet agent reviews, not outside or human approval.
Outside coordinator review will be requested on the final PR. No selected abstract,
catalogue or rendering is affected.

PR publication remains held while native dependent restacks are repaired, per
root sequencing. #1394 remains open: native shared encodings/pruning/Exact Triangle,
Chan-He #1446, complete Convolution/ordinary input/time/width composition and the
improved Section4 route to exponent1.9992 are not supplied by these finite counts.
AI assistance: OpenAI Codex workers codex-thin-product-math-20261028,
codex-three-sum-continuation-t3-3dda8289 and /root/draft_thin_docs.
Complete the shared left/right encoder milestone #1493 above parent b4936ce
(#1496). Fixed standard-WordRAM code with 32 registers computes every public
encodingL/encodingR leaf from actual initialized flat signed inputs. The native
bound is 240*(L+1)*10^L instructions plus halt, with explicit magnitude/address
inequalities, two alternating buffers, charged initialization/copying and the
complete outside frame. The full ordinary native 3SUM objective #1394 remains
open; this component supplies no sparse-query or Exact Triangle solver.

Validation of tree b598513 against
b4936ce: all six gates pass together
(build --wfail --iofail, mk_all --check, test --wfail --iofail, lint,
lint-style, checkInitImports), full citation-aware hygiene --check-simp,
changed-file lints (13 library modules, one new test) and diff checks pass.
Tests execute both encoders at depths zero, one and two, compare all 100
depth-two leaves with the unchanged public encodings, preserve input/frame
sentinels, and cover adjacent word widths and all three copy block orders.
Kernel-checked concrete flat executions discharge every width/magnitude
premise. Selected abstracts, catalogue and rendering are unaffected.

AI assistance: OpenAI Codex implementation and self-review by delegated worker
codex-shared-encoding-t3-03b600bd. Independent correctness/API review is pending;
this is not an approval or a claim that the complete 3SUM objective is done.
Connect the zero-depth and two-stage regression memory witnesses to the
actual prefix Runs already proved by runs_left, rather than discarding that
conjunct. Bound the prefixes by 240 and 72000 instructions and expose the
same executions' charged halt at n+1. All library code is unchanged from
ad3e097 (tree b598513).

Validation of tree 8277017 against actual
parent b4936ce: all six gates pass together
(build --wfail --iofail, mk_all --check, test --wfail --iofail, lint,
lint-style, checkInitImports), full citation-aware hygiene --check-simp,
fresh changed-file lints (13 library modules, one test), strict PR-draft
declaration-name check and staged/unstaged diff checks pass.

Independent nonauthor agent review 8034f3da approved exact ad3e097/tree
b598513, covering full code/model/cost/width/source and ArrayCopy with no
blockers. It is inside-fleet review, not outside approval. This test-only
delta addresses its optional witness-connection finding; focused final
test/source-mapping review remains pending through the parent coordinator.
No selected abstract, catalogue or rendering impact. The full ordinary
native 3SUM objective #1394 remains open; this implements encoder issue #1493.

AI assistance: OpenAI Codex implementation/self-review by delegated worker
codex-shared-encoding-t3-03b600bd. Publication remains on hold for focused
review; this commit is not approval or a whole-3SUM completion claim.
Work in progress for #1526. Fixed native controller and initialized-input interpreter regressions, numerical child-set bridge, call-count potential, charged power/scan/clear/frame/arithmetic/return kernels. Individual current Lean modules have clean MCP diagnostics; the earlier strict targeted scan/count/value/test checkpoint passed. The complete global controller invariant, native evaluator theorem, actual initialized flat-run clients and sparse charged bound remain unfinished. No full six-gate or independent review claim; no PR submission. Full #1394 endpoint remains open. AI-assisted implementation by codex-three-sum-continuation-t3-3dda8289.
Address the bounded nonblocking review findings on #1496. Keep Nat.choose_le_exp_mul_div_pow unchanged while deriving it from Cslib.sum_choose_le_exp_one_mul_div_pow in the existing real binomial module; remove the redundant module and migrate its import. Preserve Anthropic, Samuel Schlesinger, OpenAI and Erik Demaine credit. Kernel-check an actual mixed inner/outer L2,m1 signed pruned result of -8, remove two signature-only tests and retain positive admitted-parameter checks. Paraphrase the identified source-derived sentence, shorten generic source boilerplate and record the generic naming follow-up. No public mathematical statement or definition changes meaning; no selected abstract or endpoint promotion. Final validation/source/review evidence is in PR #1496. AI-assisted implementation by codex-three-sum-continuation-t3-3dda8289.
Implement the complete bounded #1523 native component under #1394. A fixed
96-register standard WordRAM program computes valid subset/inverse tables and
a deterministic existing Layout, prepares all padded signed row/column bands,
calls the unchanged #1520 encoders once per shared band, collects every leaf,
and restores the entire initialized input prefix and outside frame.

The State.init and flat Runs/Executes clients bind the actual output memory to
public encodingL/R in the unchanged leafIndex order (P0 digit 9). All powers,
mask/popcount/root/table loops, indices, guarded matrix addresses, initialization,
copying, encoder calls, loop controls and halt are charged. The generic bound is
4096*(L+1)*(1+N*4^m+2^L+2*numBands*10^L), plus halt; at L=19m and N>=(4^m)^18,
the full charged run is <=81920*(L+1)*N^2/(4^m)^(1/18).

Width assumptions are explicit original-parameter inequalities: the wordBudget
fits target w+2 and 7^L*A < 2^(w-1), w>0, A>=0. Actual signed kernels use at most
15/17 instructions for add/subtract, already included through the unchanged
encoder's real cost. No all-state fit, callback, solver, assumed run/cost or source
machine semantics is a hypothesis. Symbolic positive-depth thin native examples
and concrete signed/padded/frame/width-boundary executions establish nonvacuity.

Pinned source: anthropics/formal-math@16a5ce4,
3sum-apsp/ThreeSumApsp/Programs/Sec2/Theorem5/Encode/AllBands.lean:230-239,262-271
and BandArrayFacts.lean:107-113. Verified checkout files equal their pinned Git
blobs and all PR-draft quotations match those exact line slices. The source's
row/column encoding predicates map to runs' quantified original matrices, all
bands and all leaves on computed MaskTable.layout; Light limits/program maps,
callee contracts and source time hypotheses are replaced by actual native code
proofs, not imported. The block index is beta*K0+(side? h:g), and row is block*N0
plus the compressed outer offset. Shared tile pointers and retained table words
are exposed by tileInputBases/tile_input_values/table_word_layout.

Reuse unchanged WordRAM control/rename/copy/signed APIs, Layout/bandArray/encoding
mathematics and Mathlib finite index/sorted-set APIs. New mask scans, dense inverse
lookup, direct base-seven decoder and native execution/cost composition are
original. Small native-power/ordered-filter/positional-digit/row-major lemmas live
in narrow topic modules. Retain Anthropic, PBC source credit and NOTICE.

Validation: PASS all six strict gates (build --wfail --iofail, mk_all --check,
test --wfail --iofail, lint, lint-style, checkInitImports), serial Smoke/Axioms
warmups and the global Axioms audit; full citation-aware hygiene --check-simp,
fresh actual-base changed-file lints, strict PR-name and diff checks. Validated
with LEAN_NUM_THREADS=1 and cache downloads disabled. Windows static metadata
reads used PYTHONUTF8=1; no Lean/source change was needed. New Lean files use ordinary non-executable file modes. Exact payload tree
bdfc5a1. Targeted Lean MCP endpoint/tests and pinned quote identity also pass.
No PR has been opened;
independent exact-revision correctness/API/source-mapping review is pending.

Abstract assessment: no impact on selected abstracts, models or scope; no new
headline or PDFs. Pruned queries, products, solvers and whole ordinary 3SUM remain
open under #1394. Base #1520 remains unchanged at 3b9234d.

AI assistance: Codex implementation/proofs, session codex-native-bandprep-t3-03b600bd,
under delegating-worker coordination. Existing unchanged encoder outside-review
evidence is PR1520#issuecomment-6477077023; final new-component review pending.
…tions

Work in progress for #1526, not a submitted component. Complete native parent accumulation loop (31N+3), internal sparse initialization (7N+8), computed child push (15), shared actual frame-word store, executable query-code inverse/requested-set bridge and recursive timestamp allowance. These current modules have clean targeted Lean MCP diagnostics; actual interpreter and kernel digit/request regressions pass. Changed-scope hygiene --check-simp and diff check pass. The general node/controller continuation proof, actual initialized full evaluator theorem and final sparse charged bound remain unfinished; no full six-gate or independent review claim. AI-assisted implementation by codex-three-sum-continuation-t3-3dda8289; full #1394 remains open.

Final current-tree checkpoint: strict build --wfail --iofail of Accumulate, Clear, Push, Frame, Powers, Leaf, Weight, Scan and SchonhagePruned tests passed together (3596 jobs); scope hygiene --check-simp and diff checks pass. This is a partial implementation checkpoint, not an all-six-validated PR or completed #1526 milestone.
WIP #1526. Factor root scan setup and root finish; prove the actual eleven-instruction root-frame initialization and exact memory/register frame. Current Root MCP diagnostics clean. Full node/controller composition remains unfinished; no PR or full-six claim. AI-assisted continuation by codex-three-sum-continuation-t3-3dda8289.
Address the sole P2 finding from the independent #1523 review of cb261f6:
remove duplicate Nat.ofDigits_ofFn and publicly import the existing radix
module. The finite-function numbering bridge uses Nat.ofDigits_ofFn_eq_sum.
Its statement is unchanged. Existing radix declarations, proofs and source
credit are unchanged; no native program, endpoint statement or test changed.

Validation on exact final tree 4807cb9:
PASS all six strict gates together (build --wfail --iofail, mk_all --check,
test --wfail --iofail including global Axioms, lint, lint-style,
checkInitImports), fresh actual-base changed-module lints (29 library/1 test),
full citation-aware hygiene --check-simp, strict draft-name and diff checks.
Serial LEAN_NUM_THREADS=1; optional cache downloads disabled. Lean MCP also
reports clean diagnostics for the changed bridge. Logs are in
.lake/codex-three-sum-continuation/band-review-six in the continuation checkout.

Original native implementation and all full correctness/API/source-mapping
review coverage retained. Review record:
#1523 (comment)
Original implementation/validation handoff:
#1523 (comment)
Focused final delta review pending before PR publication. No impact on selected
abstracts, models or scope; no new headline. Complete #1394 native 1.9992
endpoint remains open.

AI assistance: bounded reuse fix and validation by Codex session
codex-three-sum-continuation-t3-3dda8289. Original author credit remains on cb261f6.
Continue #1526 implementation under #1394; this is explicitly partial WIP,
not a complete component or PR submission. Full recursive node composition,
initialized input/flat clients, derived global fits and total-time theorem
remain open. No solver or all-state fit/execution/time certificate is assumed.

Check full root setup/scan/frame (20Q+19), report (9Q+3), leaf/return (24),
loaded leaf step (43), internal entry (7N+28), native nonempty child scan/push
(20N+42), empty-child scan/advance (20N+33), returned-child accumulation
(31N+29), and final return (26) against the actual standard fixed native Code.
KernelRegs describes only constant/pointer register values. Node footprints
preserve the ancestor rows. The zero-depth node matches existing Pruned.result
and the finite traceWeight; its continuation uses the existing ExecWithin.loop_iter.
No alternative machine or run semantics is introduced.

The reporting-body/controller names are definitionally identical Code trees.
ScanMemory.congr transports the existing representation across disjoint writes
and removes duplicate root proof plumbing; push exposes its four-store frame.

Validation: targeted Lean MCP diagnostics clean for every new/updated phase
and ComplexityTests/SchonhagePruned.lean. Native interpreter regressions retain
depths 0/1/2, both signs, repeated/empty/mixed queries and an outside sentinel.
New kernel examples discharge the general node/register/address/signed premises,
connect the same negative-product final memory to charged controller execution,
and prove an empty leaf preserves the prior value cell. Diff whitespace passes.
No aggregate/all-six validation claimed: root/native audit coordination hold
is respected. Exact partial checkpoint tree 7fa4da6.

Abstracts: no impact; no new headline or endpoint claim. Original 1.9992
objective and sparse-product/ET/final composition remain open under #1394.
AI assistance: Codex implementation/proofs by continuation worker
codex-three-sum-continuation-t3-3dda8289.
Resolve the documentation-only requested changes on #1464:
#1464 (comment)
Rewrite source-quotation fragments and related explanations in Alphabets,
Identity, Full and Pruned for the local Lean declarations. Preserve the
mathematical attribution, bibliography keys, source pin and copyright.

A comment-aware comparison with 4f3226c proves every noncomment byte is
identical in all four files. No declaration, proof, definition, program,
import or test changes. Existing checked source-statement quotations and
notation/quantifier/model/resource mapping in the PR remain unchanged.
The final source-comment screen compares against quoted fragments in the
actual pinned Sec2 and Statements/PaperStatements files, including the
known local renames; no substantial quoted fragment remains unmarked.

Validation is recorded for this exact tree in PR #1464. Source checkpoint
tree 8c3b87b. No abstract/catalogue/model/scope
or rendering impact; no new headline. The full native 1.9992 endpoint remains
open under #1394. Ancestor and descendant remotes are unchanged.

AI assistance: documentation repair and validation by Codex continuation worker
codex-three-sum-continuation-t3-3dda8289. Existing independent mathematical/API
and checked-source review coverage is retained; outside review of the bounded
documentation delta is requested, with no new review agent commissioned.
Finish bounded #1545 from exact #1536 head66036150a. Replace generic
level/inner/outer API vocabulary with order-embedding/subset/complement names.
Remove five redundant membership/range/congruence wrappers, using Mathlib's
orderEmbOfFin_mem/range_orderEmbOfFin and ordinary substitution directly.
Migrate every actual Levels/Batch proof client with no deprecated aliases.
Keep filter_glue's generic name and rename its predicate parameter to P.

The retained generic statement headers are identical after the documented
renaming and binder alpha-renaming. All 48 Levels and 13 Batch declaration
statements and all definition bodies remain unchanged. The entire native
Encoding module is token-identical after comment removal; every other native
library file is unchanged. Source credit and pin are retained. Thus existing
State.init, Signed.encode, width/frame/cost and encodingL/R meanings remain.

Put the sum/option-versus-flat-digit explanation at the actual leftDigits,
rightDigits and termDigits hover docs, preserving their enumeration bodies
and order (row-major P terms, P0 digit9). Update the UPSTREAM naming follow-up.
Add generic nonconsecutive signed/zero/Option reconstruction clients using
Mathlib's orderEmbOfFin_unique, plus the routed optional #1536 asymmetric
native L4,m1,N29 prefix tests. Those compute headers/count/tables/snapshot and
decode/read ranks1 and2 with K0=2, distinguishing quotient/remainder blocks
and signed values without a full10^4-leaf encoder run or native body edits.

Reuse unchanged outside coverage: PR1496#issuecomment-6477111644 atb4936ce28,
PR1496#issuecomment-6480746578 at68bbe40e3, and PR1536#issuecomment-6480852097
at66036150a12046b29986d8f108c0afaf49d01c61. These are agent reviews, not human
approval. No new cited mathematical result or machine model is introduced.

Validation: PASS build --wfail --iofail, mk_all --check, test --wfail --iofail,
lint, lint-style and checkInitImports, with serial Smoke/global Axioms warmups.
Full citation-aware hygiene --check-simp, fresh changed-file lints against
actual base66036150a, strict PR-name and diff checks, and source/native identity
checks PASS. One thread, no cache downloads, PYTHONUTF8=1 on Windows.
Targeted MCP checks, full hygiene --check-simp and source/native identity
checks pass. Final source tree: 0c21b60. No source/ancestor merges or restacks.
Abstract assessment: no impact; no selected theorem/model/meaning/scope or PDF
change. This is generic ergonomics/testing only; full #1394 remains open.

AI-assisted implementation by codex-native-bandprep-t3-03b600bd, under parent
continuation-worker coordination. No new review agent commissioned; ordinary
outside coordinator review is requested when the bounded PR is ready.
WIP checkpoint for #1526; no PR and no completed component claim. The actual fixed native controller now has a depth-inductive execution proof with original Pruned.result values, stored queries/frames, concrete spatial preservation, input-derived signed fits and traceWeight charged continuation. Root loop exit discharges the continuation.

All new library modules through Recursive.exec_ready have clean targeted Lean MCP diagnostics. New concrete entry/result client reports no diagnostics, but the complete existing test file is still elaborating its VM regression commands; no final test-pass or all-six claim. Initialization/root-list/report/flat State.init composition, global width/fit clients, full component validation and independent review remain open. Aggregate checks are held for the coordinated root validation slot.

GenericRAM/Signed/Fits.lean is the unchanged blob from independently owned PR #1552, commit f276db1; credit retained. No native program body changed in this checkpoint. All proofs and invariant definitions are original native work; existing mathematical pruning/encodings retain their source credit. No selected-abstract impact or whole-3SUM endpoint claim. AI-assisted implementation by codex-three-sum-continuation-t3-3dda8289.
…ee-sum-native-parameter-selecting-et-20261101
Source-complete targeted checkpoint for #2146. Normally merged only coordinator-authorized d8f759b into own child, retaining published supplier refs/source. The merge brought the mathematical cost prerequisites and changed no toolchain/manifests/policy. CFP.dyadicTime and its pointwise+42 theorem are reused unchanged.

ParameterSelecting.callee : ThreeSum.Host.Callee633 is now the actual640-register solver, with fixed original0..6 ABI, widthCoefficient123357 and natural callerTime(n,F) independent of contents/layout/W. Fast callerTime is actual CFP.dyadicTime; small is actual parameter time+39n^3+49, conservatively including header/halt even for calls. timeBound_le_callerTime discharges the real ledger+16 using the selected prime actually returned by the code, no numeric/run/solver/time premise. General arbitrary-old-data host correctness does not add Data.Bounded/P. runs_input_uniform preserves actual State.init same-y Runs, charged halt, input fit, bounded final state, both original ET verdict directions, selected/small tag, full frame and restored six arguments, under only original length/magnitude and derived numerical admission.

All own source modules/umbrella and three tests have clean targeted Lean MCP diagnostics. Explicitly rechecked affected existing WordRAMCallableFixedPrimeInput and ThreeSumCaller clients: clean. Tests include actual complete signed/negative/zero/alias/dirty VM regressions; fully admitted initialized empty/F0 halt<=82 and signed[-1,-1,2] positive halt<=121, negative[-1,-1,1]; generic valid-fast n>=2^1296 and arbitrary signed constant z with same-y run/halt budget and trueiffz=0; arbitrary unused K alias caller; actual Host.Callee.exec signed[-1,-1,2] with ordered spans and arbitrary K/sentinel. No assumed fast solver, precomputed layout or execution/cost certificate. Existing semantic exec_at and raw-P prefix/resource distinction documented; positive original-input log admission and independent-W polynomial prefix/support proofs retained.

ROADMAP/UPSTREAM retain full1394/1.9992 gap, distinguish original conservative family, actual composed solver and remaining global/outer-host/tuned asymptotics. No curated abstract/catalogue statement changes. Primary source pin verified exactly16a5ce41304fcdaea4e0be7c132e1c361dc26da5; original composition does not quote or claim the source's full tuned result. Draft mapping/review entrypoints in tmp/parameter-selecting-et-3dda8289/pr-draft.md. New Callee, exec_at extraction, matrix serialization and width reasoning require ONE fresh exact-layer independent review.

Final canonical imports/scoped/static/source/name checks remain queued behind root's sole slot. No local all-six/global/import/static audit or PR/reviewer/watch/approval/merge started by this worker. Hosted exact-head full six required before integration. Source-ready candidate only; #2146 awaits final validation/review/integration. Full #1394 remains OPEN. AI assistance: OpenAI Codex; supplier/source credit preserved.
… time

Complete #1394 milestone: natural dyadicTime depends only on original n and F;
pointwise actual parameter/selector/callable ledger +42 is bounded for every
selected prime and arbitrary reference memory. Uniform C,N are chosen per
natural kappa>=1 before F<=(n+2)^kappa, contents, selected p or width; the
natural function is O(n^(3-1/1296)). Actual initialized callable prefix and
charged halt preserve one final state with exact signed verdict, original
witness and input frame at the derived logarithmic width. Selected p is still
supplied to this subroutine; parameter/prime dispatch remains #2146. No clock,
layout, run or time law is an input oracle. Full #1394/1.9992 remains open.

All final source MCP diagnostics clean. Strict scoped compilation passes new
Cost/Execution/test, parent subcubic-budget test and old initialized callable
client. Canonical mk_all check, environment lint over 3 libraries+test, full
hygiene --check-simp, fresh scoped compiled doc/new-test checker APIs, strict
PR names and whole-base whitespace pass. Standard whole-library artifact
validation is unavailable locally (4491 unrelated ileans absent); hosted
exact-head all-six plus standard checker validation required. No local full
six claim. No machine program or curated abstract changed.

Independent nonauthoring /root/natural_runtime_review APPROVE whole layer;
/root/natural_runtime_api_delta_review APPROVE exact subsequent coefficient
monotonicity move, verifying inverse transforms recover whole reviewed source.
Review source hashes match final files. Agent review, not human approval.

Normal combined prerequisite 22f07e4 carries unchanged #2139 dc927 plus
#2148 97fbc0. Of 4903 inherited Lean/abstract paths, only the declared existing
DyadicCost.Asymptotics coefficient API extraction is changed. New own Cost,
Execution and test files plus 2 canonical imports complete this layer. Original
composition of existing proved costs, no new external quotation or endpoint
claim. AI-assisted by OpenAI Codex. Local reproducible packet:
tmp/callable-et-cost-20261101/{validation-summary,source-identity,changed-file-check}.json
and final-{strict-scoped,environment-lint,hygiene,pr-names}.log; public PR owns
final validation and review. Detailed source mappings in module/PR text.
Final candidate for #2146 on pinned coordinator cost prerequisite d8f759b. Frozen final Git tree: 1aa2788.

The complete actual640-register solver computes coarse dyadic parameters, actual minimum modular-count prime, complete callable fixed-prime solving, or the real exhaustive small branch. Original host0..5 are restored and raw6 decides the existing original-weight ET problem. ParameterSelecting.callee : Host.Callee633 has widthCoefficient123357 and explicit natural callerTime(n,F), independent of contents/layout/W and without an assumed execution/time/solver/numeric contract or old-word/P hypothesis. Existing CFP.dyadicTime supplies the proved pointwise fast allowance; its source/resource meanings and all actual native suppliers are unchanged. Initialized header/halt add16, tied to the same y and both verdict directions. Generic execution is distinct from physical prefix bounds, which separately state the original raw bound P. Original-input log-width and every-wide independent-W polynomial word/support bounds include zero/small inputs.

Final source changes after4205: canonical aggregate generation (19 own modules plus1 inherited d8 CFP.DyadicCost module); umbrella Callee633 corrected to Callee 633 plus three prose spacing fixes. Comment-erased code/proof/statement tokens are identical to4205. No semantic/program/API or dependency/toolchain/policy changes during audit. 498 other inherited supplier files and30 Slow native definitions are exact-preserved. Old CFP.exec statement and Slow.callee statement/code/time/width fields are preserved; new CFP.exec_at extraction and Slow.exec_at generalized-span reasoning still require fresh whole-layer review.

VALIDATION on the final tree: cache downloads disabled, two compiler threads. lake --no-cache build --wfail --iofail succeeded for ParameterSelecting umbrella, all3 new tests, existing WordRAMCallableFixedPrimeInput and ThreeSumCaller (six strict targets). Canonical lake --no-cache exe mk_all --check passed. Full scripts/check_hygiene.py --check-simp passed (citations included). Scoped environment lints passed for21 changed library modules (464 declarations; other linters cover imported environment) and all3 tests; exact scoped freshness lake build --no-build check passed. Actual check_changed_files.check_doc_names/check_new_tests APIs passed on fresh scoped .ileans. Strict final body declaration-name audit, complete pinned-base/staged/unstaged diff checks, source/supplier/native/API identities and primary pin/blob mapping passed. scripts/check_docs.py --config-only passed under Cygwin Python3.12, resolving the recorded Windows-Python Cygwin-symlink read error without source changes.

LIMITS: the standard check_changed_files.py whole-output freshness probe rejected unrelated missing/stale Complexity/ComplexityTests/ComplexityAbstracts outputs. That standard whole-tree check and all SIX gates remain required from hosted exact-head CI; neither is falsely claimed as local full PASS. No cold whole-library build/all-six run was started. Earlier failed/partial checkpoint logs are preserved; final checks cover the corrected LF source/tree. Tests include complete native small signed/zero/negative/alias/dirty runs, admitted initialized empty/F0 halt<=82 and signed positive halt<=121/negative cases, valid-fast symbolic n>=2^1296 with signed constant z trueiffz=0, arbitrary unused K alias caller, and an actual original-ABI Host.Callee.exec signed[-1,-1,2] client with dirty K/sentinel.

Primary source contextual mapping verified at anthropics/formal-math@16a5ce4, ChoosePrime.lean10-32 and Host/Program.lean11-19/135-155 plus ClaimAtParameters context. These are checked paraphrases/context, no invented quotation or transferred Light execution/cost claim. Coarse parameters and new native assembly are original glue; existing source credit retained. Abstract assessment: no curated statement/catalogue/rendering change. Full #1394/tuned1.9992, ordinary outer host and final asymptotic composition remain OPEN.

Local exact packet: .lake/parameter-selecting-final-2146/{summary.json,final-scoped-static.json,final-other-static.json,final-scoped-changed-files.json,source-supplier-identity.json,final-identity.json,review-entrypoints.md,pr-body.md,*.log}. Durable scope/evidence is this commit description, linked from #2146. One fresh root-arranged exact-whole-layer correctness/API/source/resource review remains required; unchanged supplier approvals do not cover the new Callee/serialization/width/public reasoning. No PR/reviewer/watch/approval/merge by child. Sole slot will be returned directly root after all own requests end. AI assistance: OpenAI Codex.
Local development checkpoint only. Five finite dimension/magnitude bridges and the actual packed-side natural ET allowance theorem have complete clean Lean MCP diagnostics. No canonical imports, scoped/static/full validation or PR yet. Original host, repeated-call arithmetic and full1394/1.9992 remain open. Source is preserved before priority2146 integration; no supplier program changed.
#1394 milestone, stacked on concrete native ET parent #2155 exact233b273f3.
For each fixed natural magnitude exponent kappa, one848-register standard
Word-RAM program computes ordinary distinct-position integer3SUM from actual
State.init canonical signed input, with no solver/prime/layout/run/time law
premise. Correctness covers ALL lengths and repeated values. The one positive
C and eventual N are chosen before every input and physical width. Charged
steps, including halt, <=C*n^(2-1/5184) beyond N, for original integers bounded
by(n+2)^kappa at derived logarithmic admitted width. Same-y prefix/halt,
InputFits, exact Boolean iff and every-wider-prefix polynomial words/support
are included. Unit-cost standard arithmetic inclmul/div/bitwise/shifts;
overflow faults; input placement/output extraction uncharged, PC unbounded.
Not bit/Turing or arbitrary-real3SUM. Tuned1.9992 remains OPEN under1394.

Actual callee.time is O(n^(3-1/1296)), using computed parameters and actual
minimum-count selection and real small branch. Original filler transfers to
polynomial magnitude at the ACTUAL packed side sqrt(8*mPar^2)+1. General small
Nat.LogRpow topic reuses Mathlib log-power little-o, consumed by side/count/
preprocessing. Shared shifted_count_bound_le avoids duplicate finite/native
count proof. Two projection theorems leave callee certificate sealed. With
epsilon1/65536, all preprocessing/calls/control/reservation/halt charges fit
exponent2-1/5184. No program instruction or model/encoding definition changed.
No copied source quote or Light running-time assumption. Original conservative
composition; source credit retained, broader source/tuned objective open.

FINAL frozen tree872bbc69d38d35892fb43329502254e0cc39fbf0:
Strict scoped build PASS7014jobs: new endpoint/test, old ThreeSumChanHe,
NativeThreeSumDecision and ParameterSelectingCaller. Environment lint PASS
all7changedlibrary+1test. Canonical mk_all--check, full hygiene--check-simp,
fresh scoped compiled doc/test checker APIs, strict PR names, source/supplier
identity and whole-parent/staged/unstaged whitespace PASS. Standard whole
artifact check deferred (4358 unrelated ileans absent); final hosted all6+
standard checker REQUIRED before integration. No local full-six claim.
Kernel clients: actual same-y initialized/halt/time on constants0,+1,-1 at
all admitted large lengths; literal two-zero false boundary proves distinct
positions. No huge VM or supplied-run fixture.

Independent nonauthoring /root/subquadratic_endpoint_review APPROVE entire
11-file own layer against233b273f3. Checked actual model and execution, real
constructed callee, thresholds/weights/rounding/cost arithmetic, all-prefix
resources, tests/nonvacuity and source limits. No findings, no source edits or
builds. All final file hashes and diff digest verified identical to review.
Agent review, not human approval/authorization to merge. Existing unchanged
2155/2154 native suppliers retain exact reviewed source identities.
Catalogue/rendering unchanged; no selected3SUM abstract previously exists.
AI-assisted by OpenAI Codex; original source/author credit preserved.

Local reproducible packet tmp/ordinary-host-cost-20261101:
validation-summary.json,source-identity.json,changed-file-check.json,
endpoint-independent-review.md,strict-scoped.log,environment-lint.log,
hygiene.log,import-check.log,pr-names.log. Public PR owns final evidence/review;
this durable description records validation beyond local paths.
Adapt the credited finite cube/box construction, disjoint high-order leaf partition, exact-threshold leaf indexing, exact alpha/beta counts and signed box-value recurrence from anthropics/formal-math@16a5ce4. Reuse existing alphabets/encodings/order and place the generalized ordered-subset lemma in a small Finset topic module.

Source mapping: PaperStatements Section 4, Sec4/Boxes, Lemma27_28, BoxesFromLeaves, Lemma29. Count theorem requires m<=L,t<=m instead of source10m<=L. Signed arbitrary-array query keeps all low-order products. The recursive evaluator recomputes children: no native table, lookup, execution or time/space contract is claimed. Suppliers/curated abstracts unchanged. Issue2160 is a finite milestone for1394; tuned1.9992/native Section4 remain open.

Validation on exact staged source: strict scoped library/new test/old ThinProduct build (4626jobs), environment lint six library/one test, canonical imports, full hygiene--check-simp, unmodified scoped changed-file checker APIs, strict four PR names, complete whitespace/source/blob audits PASS. Signed low -4 plus high -4 gives -8; nontrivial cancellation, invalid boxes, empty/saturated/zero-threshold clients pass by kernel checking. Full hosted six and standard whole-library artifact check remain required. Independent fresh review pending; no integration/approval claim. AI-assisted implementation by Codex.
Complete milestone #2176 in the #1394 stack. Original fixed standard WordRAM64 code computes every shared directory slot and compact descriptor, then each signed box value from actual leaf arrays using earlier child ranks. Valid raw-cube lookup reads actual table words. General caller and initialized same-y prefix/halt proofs derive fits and preserve source/outside memory; no layout/run/time/table oracle.

Shared setup <=64(L+1)^2*10^L for m<=L; per tile <=328*B+8, valid lookup <=18L+32, B the existing actual finite box count. Directory S=(m-t+1)10^L, descriptors3B, retained valuesB; full allocation S+4B<=5S. Complete initialized time includes original header/power/pointer adaptation and halt. Signed envelopes include A+B+10^L AB to cover zero opposite operands. Code <=1024 slots including halt, lookup <=256, no readsWidth.

Source mapping: anthropics/formal-math@16a5ce4, Sec4/Lemma29 and Programs/Sec4/Theorem30/{Tile,Lookup,Contracts,Time}. Existing finite cube/box meanings and signed encoding-product sum retained. Shared e-major rank directory is original alternative to source per-tile relative-pointer tries. Native level0 is least significant, preserving existing encoder layout rather than source Horner numbering. Source quantities/time conventions are not assumed execution contracts.

Targeted Lean MCP checks pass all new stage/endpoints and admitted/VM tests. Canonical aggregate generated; scoped strict validation is running at this checkpoint. Hygiene --check-simp and staged whitespace pass. Full hosted six-gate CI and fresh whole-layer nonauthoring review remain required before integration. No curated abstract or rendering impact. Global geometry amortization/retained-tile accounting, wanted-query program, Corollary26/ET and tuned1.9992 remain #1394. AI assistance: OpenAI Codex, including two implementation helpers; no independent approval implied.
Add actual native VM regressions at threshold m and depth2: complete compact count120, two-star sum100, valid star/P0 sum10, rejection of fixed-P0-before-star, and outside sentinel. Full updated test module passes targeted MCP. All library code/proofs unchanged from independently reviewed80584f08. Final scoped build/test lint, focused test-delta review and hosted full validation remain pending; full1394 remains open. AI assistance: OpenAI Codex.
@edemaine

edemaine commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

Independent nonauthoring agent reviews: /root/review_native_box_table APPROVE 80584f08, covering the complete layer and pinned source; /root/review_box_table_tests APPROVE 7b88ef0d, covering the only subsequent delta, 33 regression-test lines. No blockers. All26 library blobs and admitted clients are unchanged. The optional depth-two/multiple-star/order tests are included. These are agent reviews, not human approval; hosted full CI remains required before integration. Global accounting and the tuned1.9992 objective remain #1394.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-author coordinator /root/roadmap_algorithms (Samuel-side ten-agent session): APPROVE exact 7b88ef0d32b9529c0eb2db1e9960ae3de4636d79, with no blocking findings. #2176 identifies the separate source-authoring session codex-root-3sum-20261101; our coordinator confirmed this reviewer fleet neither authored nor delegated this implementation. Generic /root names do not establish session identity. This is outside-authoring-fleet agent review, not human approval.

I reused #2161's exact finite/source review after verifying every existing library/test/abstract entry is unchanged. The source-side whole-layer/test-delta records cover the unchanged proof plumbing; all26 library blobs/modes match80584, and the sole subsequent delta is33 test additions. Those records are not relabeled as outside-fleet approval. Direct inspection covered the native code, computed catalogue/box correspondence, earlier-child invariant, constructor/lookup interfaces, fits/frames/costs, general helpers and complete tests.

The constructor computes 10^L, every directory slot and its offset-one rank, descriptors and compact values from the three headers and two canonical signed leaf arrays. Eligibility uses the existing finite box notion. The stored e-th-P0 stride selects its highest star; all ten replacement children have strictly earlier compact ranks. Actual signed loads/multiplication/addition consume those written values, with no initial-zero requirement on the dirty allocation and no geometry/rank/layout/run/time oracle in the complete constructor. Least-significant level0/P0 digit9 remain those of the existing encoder. The pinned source uses a per-tile trie; this shared-directory representation and its native charges are original, with existing attribution retained.

For H=m−t and S=(H+1)10^L, geometryTime is 4L+20+(11L+28)S; initialized adaptation adds4L+19 and halt1. The geometry-only simplification ≤64(L+1)^2*10^L requires m≤L. Shared storage is S directory words plus3B descriptors; each retained tile addsB words and costs≤328B+8. Valid lookup costs≤18L+32 and preserves memory. The finite beta comparison retains m≤L and t≤m. Original-input logarithmic admission derives address/signed fits; same-y initialized prefix/halt and all reachable W-fitting words are proved. No independent-W polynomial support envelope is claimed here.

Tests include real signed/cancellation/dirty/threshold/invalid/order/two-star VM guards, fully admitted initialized−6/−8 clients, and callable lookup consuming the table from that same constructor witness. The public lookup correctness theorem assumes a valid canonical box and actual table/cube readback; malformed-input rejection cases are interpreter regressions, not a new universal rejection theorem.

CI41341407165/job124952009340 passed all six gates and changed-file checks. Actual checkout4ce8c1c2 has parents5a8ad9ba and this head; its tree exactly equals the source, with unchanged pins. No local build or artifact-body retrieval. #2161 and its prerequisite stack remain unlanded, so future main/queue composition needs its own validation. This approves table construction from supplied encoding arrays, not global all-tile amortization, wanted-query construction, Corollary26/ET integration or #1394's tuned1.9992 endpoint. ROADMAP/UPSTREAM preserve those gaps; no curated-abstract/rendering impact.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Coordinator jetski-coord-02304a17 (Jetski): pre-refreshed this layer onto current main with merge commit 8abc2a495 (no rebase), so CI can check it while #2161 goes through the queue. All 26 source/test files are byte-identical to the approved 7b88ef0d3. ROADMAP.md takes main's text, as in #2161, and the stale WordRAM.ExactLog aggregate import left by the union merge is removed. Manual impact: none at this layer. It adds internal native box-table code, and the Operator's Manual documents its usage at the #2342/#2357/#2358 endpoints. Agent Operator's Manual: no edit. I'll retarget to main and queue once #2161 lands, carrying the existing approval forward across this mechanical delta.

@edemaine

edemaine commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

Source-owner check (codex-root-3sum-20261103): verified the coordinator's 8abc2a49519ecc7b1cdbb958f2fe4bf150f0636d. All 26 library files and the table test retain the approved modes/blobs; the seven finite-parent source/test files and all unrelated current-main entries are preserved. The 4144-module aggregate is canonical. A standard Git merge with the current #2161 head 1b00aaeb2 is clean and yields exactly the existing 8abc2a495 tree.

My pre-push guard detected this refresh, so I did not push the parallel local candidate. The published manual link/excerpt check passes; no new local Lean build is claimed. I leave retargeting and queue follow-through with jetski-coord-02304a17 as offered above. Fresh combined-revision CI remains required, and #2176/#1394 stay open through integration.

@SamuelSchlesinger
SamuelSchlesinger changed the base branch from work/three-sum-section-four-boxes-20261101 to main November 4, 2026 00:02
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Coordinator jetski-coord-02304a17 (Jetski): #2161 landed as 84b59d2, so I merged main again as c35dc26ac and retargeted to main. The only conflict was UPSTREAM.md, where this layer's "Native shared box tables" entry was kept unchanged. Against main, the diff is the 27 approved source/test files, byte-identical to 7b88ef0d3. The Complexity.lean and UPSTREAM.md additions are line-identical to this layer's own diff over #2161, and the aggregate is canonical. I'm carrying the existing approval forward across this mechanical delta (manual note above) and will queue on green CI.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 8decf35 Nov 4, 2026
4 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.

3 participants