Skip to content

feat(Schonhage): compose routed native box products - #2332

Merged
SamuelSchlesinger merged 198 commits into
mainfrom
work/three-sum-native-box-product-20261102
Nov 4, 2026
Merged

SamuelSchlesinger merged 198 commits into
mainfrom
work/three-sum-native-box-product-20261102

Conversation

@edemaine

@edemaine edemaine commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

This adds one fixed 160-register WordRAM program that takes original matrices, raw coordinate occurrences and a threshold. It computes routing and shared band encodings, constructs geometry once, runs all retained-value/query batches, reconstructs exact signed products in request order, and restores the full input. Signed and raw nonnegative input modes, duplicates, empty inputs, dirty scratch, charged halt and bounds on every wider execution prefix are covered.

The actual instruction ledger now has a proved finite D^(-8/125) saving, including routing, encoding, table construction, queries and restoration. The bound uses L=189k, m=9k, t=k, D=4^m, D^18≤N and Q*2^m≤N²; Q counts occurrences. Polynomial depth factors remain explicit. The finite Section 4 estimates preserve Anthropic source credit; the algebraic block specialization and native controller are original. ET replacement, polynomial-factor absorption, parameter retuning and ordinary-3SUM exponent 1.9992 remain open in #1394.

Closes #2314 when integrated. Stacked on #2312; no supplier code changes. No curated abstract or rendering changes.

Validation at 341bca745ab4f08e4f37bbb5f2e23e1c6f0d019e: strict scoped build (5036 jobs), scoped library/test environment lints, global hygiene, import-aggregate consistency and changed-file doc/test audits pass. All six project gates and changed-file lints pass in the hosted run for this exact revision. Independent agent correctness/API/resource review approved this exact revision; maintainer review requested.

AI assistance: OpenAI Codex, with disjoint native-kernel and finite-analysis workers and a non-authoring correctness/API/resource reviewer.

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.
#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.
Complete #2203 native query milestone on exact #2185 7b88ef0. Fixed64 actual standard code constructs shared geometry and retained signed values, then enumerates compatible prefixes through threshold t with actual five-word work-stack records. Pure finite frontier potential charges real expansion/low-product/threshold-rank lookup/signed accumulation. Actual query <=258(L+1)sum(d<=t)alpha(m,d)+28, preparation/setup separate, actual allocation <=10(L+1)10^L+50 beyond input. Same-y State.init prefix and charged halt compute queryValue; canonical encoding specialization is existing bilinearProduct. Original-input log width, physical fits, independent-W polynomial words/support and full outside frame proved; no run/list/table/time oracle.

All30 new library modules, complete test and affected supplier client pass targeted MCP. Strict scoped umbrella/newtest/oldtabletest build PASS on candidate source. Fully admitted signed scalar, positive-depth signed bilinear and minimum-admission zero clients; depth2 VM fixtures cover actual sparse one/19-leaf traversal and dirty frames. Canonical mk_all generated30 imports (exit1 reports update); final check/static/whole-layer review and hosted full6 still pending. Primary six pin16a5ce413 Git blobs equal local source; no imported machine/time contract. Existing supplier sources unchanged. Full1394/Cor26/tuned1.9992 remains open. No curated abstract impact. AI assistance: OpenAI Codex and named implementation agents; no independent approval claimed in this commit.
Replace exactly two nonterminal simp calls with explicit lemma lists; CompleteLeaf uses Lean suggested list. No statement, native program, layout, costs, tests or abstract changes.

Final strict scoped build PASS (newumbrella/newtest/affectedtabletest); canonical mk_all --check PASS; full hygiene --check-simp PASS; unmodified repository doc/newtest checker APIs PASS on fresh strict30-library/1-test outputs; library environment lints PASS (all30 modules761 declarations, other11linters4453 declarations), testlint and final checks recorded in packet. All original-input/same-y halt/bilinear/zero/VM clients clean. Standard changed-file driver locally blocked only by unrelated absent ComplexityAbstracts.ilean; hosted final6 and standardglobal checks REQUIRED, not claimed locally. One fresh nonauthoring review of whole34-file layer is finalizing at this exact source; no approval implied by author. Six primary source blobs pin16a5 verified. Complete native Program unchanged fromaab78506a. Existing supplier and abstract sources unchanged. Full1394/tuned1.9992 open. AI assistance: OpenAI Codex.
Remove unused public BoxTable umbrella dependency from the new finite Prefixes module. Add direct proof-only Orders import to PrefixPartition for privateTail_used. No definition/proof body, public statement, native code, attributes, tests or resource bound changed. This addresses the independent review's optional API dependency finding.

Targeted Prefixes/PrefixPartition/completeumbrella MCP clean. Final strict umbrella/newtest/oldtabletest build PASS on this exact delta. Scoped delta hygiene and full-base whitespace PASS; previous full hygiene clean and compiled30library1test APIs pass, final envlint rerun recorded. Native Program bytes unchanged fromaab, all4968 inherited library/test/abstract sources byte-identical to7b88. Root source audit batched Git objects; abandoned redundant per-file reader after exact owned PID verification, no files/caches touched. Six original primary blobs pin16a5 verified. Same independent review covers full original layer and this affected import delta; final verdict must name this revision. Required exact-head hosted6/globalstandard checks remain pending. Full1394/1.9992 open. AI assistance: OpenAI Codex.
Read wanted output codes from original input, construct the real geometry and
retained values once, and store all sparse-query answers in order. Preserve
duplicates, original sources, retained table readback and the outside frame.
Charge six batch instructions per query plus loop exit, separately from shared
preparation. Derive sufficient width and wider-prefix word/support bounds from
original input envelopes; canonical encodings recover the bilinear product.

Scoped strict library/test build, full source hygiene, canonical import check
and whitespace check pass. Tests cover empty/repeated/distinct wanted codes,
signed cancellation, dirty memory, initialized execution and charged halt.
Independent final-source review and hosted full six-gate validation are required
before integration and recorded in the PR. No curated abstract impact.

Implements the batch milestone #2310 toward #1394. Wanted-list construction,
all-tile shared geometry, improved thin-product/ET composition and tuned 1.9992
remain open. AI assistance: OpenAI Codex with an initialized-input/test worker.
Compute original-order signed products with one fixed 160-register WordRAM
program: route raw occurrences, prepare shared encodings and geometry, run all
retained-value/query batches, reconstruct answers and restore the full input.
Connect its actual charged ledger to an exact finite D^(-8/125) saving under
explicit block-dimension and occurrence-sparsity conditions. Polynomial factors,
ET integration and the ordinary 1.9992 endpoint remain open in #1394.

Validation: strict scoped build (5036 jobs), scoped library/test environment
linters, global hygiene, mk_all --check, changed-file doc/test audits and diff
whitespace pass. Hosted full six-gate validation and final non-author review
will be recorded on the PR for #2314; no curated abstract is affected.

AI assistance: OpenAI Codex; disjoint native-kernel and finite-analysis workers.
@edemaine

edemaine commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

Independent agent review by /root/review_box_product (non-authoring context): approved 341bca745ab4f08e4f37bbb5f2e23e1c6f0d019e, with no blocking correctness/API/resource findings. This is agent review, not human or platform approval.

The reviewer inspected the actual native controller and finite statements against the pinned primary source, then checked the completed initialized execution, charged halt, restoration, prefix-width/support and ledger-to-saving proofs. All 28 final source digests matched the reviewed candidate. Every query occurrence is charged; one geometry serves all tiles. The final bound carries the same actual run and answer memory, with block parameters, occurrence sparsity and polynomial factors explicit. The stale roadmap gap was corrected.

Checked clients cover reordered duplicates across real tiles, signed cancellation, raw nonnegative inputs, empty dimensions/requests, dirty scratch, full input restoration, and nonvacuous initialized runs_thin/minimum-width runs_wide instances. Strict scoped build, scoped environment lints, global hygiene, import consistency and changed-file doc/test audits pass. All six project gates on this revision remain required before integration. Ordinary-3SUM 1.9992 and ET replacement remain outside this milestone.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Coordinator jetski-coord-02304a17 (Jetski): pre-refreshed onto the refreshed #2312 head (which includes current main) with merge commit d11283e0e, so CI runs early. Source and test files are byte-identical to the approved 341bca745. This layer's Complexity.lean/UPSTREAM.md additions are line-identical to its approved diff. Any ROADMAP.md progress text yields to main's open-direction entry. Manual impact: none at this layer, because these internals are documented at the #2342/#2357/#2358 endpoints. Agent Operator's Manual: no edit. I'll retarget to main and queue in stack order, carrying the recorded approval forward.

@SamuelSchlesinger
SamuelSchlesinger changed the base branch from work/three-sum-native-box-batch-20261102 to main November 4, 2026 01:51
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Coordinator jetski-coord-02304a17 (Jetski): #2312 landed, so I merged main as ddd41b9c5 and retargeted to main. In UPSTREAM.md I applied this layer's own edit of the #2312 entry to main's text. The diff against main is line-identical to the pre-refreshed delta fa2f7c1e3..d11283e0e, whose source is byte-identical to the approved 341bca745. I'm carrying the recorded approval forward 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 a657645 Nov 4, 2026
5 of 7 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.

feat(Schonhage): compose routed native box products with shared geometry

3 participants