Skip to content

feat(WordRAM): decide ExactTriangle with the fixed-prime native solver - #1700

Merged
SamuelSchlesinger merged 137 commits into
mainfrom
work/three-sum-native-fixed-prime-et-20261029
Oct 30, 2026
Merged

SamuelSchlesinger merged 137 commits into
mainfrom
work/three-sum-native-fixed-prime-et-20261029

Conversation

@edemaine

@edemaine edemaine commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Parent #1661 has landed on main as 4cd3517d. This PR's own layer remains the reviewed 24 files; current integration, validation and review-reuse record.

The actual native producer now feeds every occupied catalogue record to the concrete product
and original-weight verifier, stopping after its first success. The initialized prefix and halt
share the same state; the returned flag decides original signed ExactTriangle across all records
and retains original witness coordinates. Distinct executed record/query failures share one global
budget: total actual scans satisfy S≤F(p)+returnedFlag, with no extra one per unsuccessful record.
Closes the bounded fixed-prime milestone #1662 after integration; #1394 remains open.

This is one fixed standard-native program with 416 registers, at most 133152 flat slots including
halt and no physical-width reads. Cslib.Algorithms.WordRAM.ExactTriangle.FixedPrime.runs_input
requires the original signed list of length 3n², entry magnitudes at most A, D=4^m≥16,
n≥D^18, g≥1, the existing Nat.sqrtPrimeWindow D prime condition and every physical width
at least the derived original-input threshold. Input/layout is unchanged: length, raw D/g/n/p,
then canonical signed AB/BC/AC. Concrete product calls use L=19m. The whole 400/320/163 callee banks are reused; matrices stay raw
until the existing actual product's single charged doubling. Ordinals, descriptors, roots,
queries, copies, calls, returns, signed verification, loop control and halt all execute natively.
No supplied table/layout/run/time/sparse/solver/witness certificate replaces their computation.

Cslib.Algorithms.WordRAM.ExactTriangle.Instances.Output.reframe retains protected readback after
scratch changes while framing against the current state. It does not assert that the old producer
external frame survived or that preparation ran again. Real one-time producer execution remains
separate. The loop preserves its complete producer bank and memory below the actual heap and above
the largest product window; it does not clear or snapshot the catalogue/window.

Cslib.Algorithms.WordRAM.ExactTriangle.FixedPrime.timeBound_le derives the halt-inclusive bound

690*n²*D*g
+ 138412032*(19m+1)*n³*g/D^(1/18)
+ 4*n*g*(5*sqrt(D)+8*queryCap(n,D)+61)
+ (42*pieceSize(D,g)+28)*(F(p)+1) + 7.

Preparation is charged once. Existing finite instance counts give at most 4ng records, and
actual chunk cardinalities derive Q*2^m≤n² for each concrete product. No aggregate sparsity is
assumed. Cslib.Algorithms.WordRAM.ExactTriangle.FixedPrime.admissionWidth_le_log bounds the positive
threshold by (257κ+5909)*clog₂(n+2) when 1≤n, D,g,p≤n and A≤(n+2)^κ.
Cslib.Algorithms.WordRAM.ExactTriangle.FixedPrime.bounded_reachable_original derives all wider
prefix words and zero memory support above an original-input envelope, bounded by
(n+2)^(514κ+11818) independently of the larger physical width. Dirty loads are included by the
actual minimum-width complete run. Parameter/prime selection, unrestricted small geometry and
the final aggregate source exponent are separate; this does not complete ordinary 3SUM 1.9992.

Source: the pinned Host.Loop
and HostData.sum_fails_le
at anthropics/formal-math@16a5ce41304fcdaea4e0be7c132e1c361dc26da5. Its checked prose states
“distinct scans contain distinct false positives, so there are at most F(p) failed scans”.
The finite bridge reuses existing failed scans, chunks, pieces, original problem and actual
product detection. Original source credit is retained. Native code and costs are rebuilt directly
against existing Code/ExecWithin: source Light uses piece-major visits and per-round matrix writes
with an arbitrary solver; the native producer prepares the chunk-major catalogue once and this
loop stops later product calls after success. No trace equivalence, Light simulation or assumed
source procedure/time bound is claimed.

New API review includes protected output reframing, the global distinct-occurrence injection,
the factored native per-record failure-count bridge and the actual full controller/initialized
execution/width/cost theorems. The old per-record failure-bound statement is retained and its proof
uses the factorization. Existing supplier source review applies only where source identity is
verified. Independent whole-layer review approves this new reasoning, with exact-tree carry-forward across the ancestry-only merge.

Validation: 52b94d0ed records all six gates and final static audits
on supported rc2 tree 359a46afcdf8a1bccbd46cd1381c4cefb087d3ea. The
parentage-only merge 3cda568b6
has that identical complete Git tree, including modes. No source changed and no new build or
validation run is claimed. Four compiler threads were used for the original gates after resource
checks, with cache downloads and automatic restoration disabled. The strict test log explicitly
builds all three new suites, affected supplier tests, Smoke and global Axioms.

The original audits include full hygiene with simp checks, changed-library/test lints, strict
description names, complete base/staged/unstaged whitespace and source/quote/supplier identity.
Their comparison against pinned 0d38523 covers 49 library modules and six tests, including the
supplier payload. The final own diff against actual supported-rc2 #1661 parent
741051c is exactly 24 files: 18 library modules, three new tests,
ROADMAP.md, UPSTREAM.md and the canonical aggregate. All 21 own Lean Git blobs remain identical
to source checkpoint 9ed4900. The existing failure-count proof factorization remains part of
this new layer's review.

The normal merge aligns the actual stack parent after #1653 landed at 0ba8b2e. Original
validated candidate 52b94d0 and source checkpoint 9ed4900 remain ancestors. No ancestor remote
was edited. Root's existing independent review covers the whole new layer and the separate
parent rc2 compatibility delta.

Targeted clients distinguish actual controller VM fixtures from fully admitted original-input
positive/negative Runs+halt at valid positive geometry, and a real producer dirty-heap regression
that explicitly refutes retention of its old external frame. No huge thin encoder VM execution
or weakened-geometry full-solver example is claimed.

No abstract/catalogue/rendering impact: this is a fixed-prime component, not a completed #1394
headline. AI-assisted implementation/proof development by worker
codex-three-sum-continuation-t3-3dda8289 using Codex. Independent whole-layer review approves the source at 52b94d0/tree359a46af; the coordinator verified identical complete Git trees and carried that approval across the parentage-only merge to 3cda568. No agent review is human or platform approval.

Documentation follow-up: 3fcbf731febb690b8b6c2693a0ff963722ae1255 changes one comment line in Controller from “six instructions in either branch” to “at most six instructions,” as requested in the approval review. Success takes five and failure six; the existing conservative ExecWithin bound is unchanged. Exact byte comparison proves every other byte unchanged, and scoped plus whole-parent whitespace checks pass. Technical approvals carry across this requested wording correction. No local Lean rebuild was repeated: the all-six record above covers the original implementation tree. Final-head supported-rc2 CI passed at 3fcbf731febb690b8b6c2693a0ff963722ae1255. The validated ordinary main merge 5a7d3a6b preserves that reviewed layer exactly; its current validation is recorded at the integration link above.

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.
edemaine and others added 10 commits October 29, 2026 16:36
Complete #1639 candidate on pinned main d6ccb24.
Preserve source checkpoint b461744 and its normal
merge c02ed27. Final validated source tree:
78662a0. No later main snapshot was merged.

One fixed 400-register standard-native program executes original State.init input,
real preparation, first-record selection, actual queried product and original signed
weight verification. Generic execution covers any occupied record. Same-y prefix Runs,
charged halt, exact selected chunk/piece correctness, original coordinates, full frame
and S <= falsePositiveCount + actual returned flag are proved. Width admission is
positive logarithmic for polynomial original scalars/weights; prefix words/support are
polynomial independently of every wider admitted physical width. Code has <=133120
flat slots including halt and does not read word width. Outer ET/prime/global choices,
aggregate saving and ordinary 3SUM 1.9992 remain open under #1394.

All six gates PASS on the exact final tree, LEAN_NUM_THREADS=4, cache downloads disabled:
  lake --no-cache build --wfail --iofail : exit 0 (608.22 s)
  lake --no-cache exe mk_all --check : exit 0 (8.61 s)
  lake --no-cache test --wfail --iofail : exit 0 (845.36 s)
  lake --no-cache lint : exit 0 (52.05 s)
  lake --no-cache exe lint-style : exit 0 (15.28 s)
  lake --no-cache exe checkInitImports : exit 0 (17.28 s)
Gates 1-2 retained across provider/agent cancellation; unfinished gates 3-6 resumed
only after native PID/command-line checks proved the prior runner had ended. Same source
and flags throughout; interrupted partial tests are archived and not counted as passed.

Strict tests explicitly built WordRAMExactTriangleWitnessScan, QueryValues, RecordWitness,
Smoke and global Axioms. Cases cover signed success/failure, empty intervals, actual
producer pair order, valid-geometry post-product consumer short circuit/false positives,
frame sentinels and a fully admitted symbolic initialized positive-depth pipeline.
VM consumer fixtures are not represented as full producer/product VM executions.

Final static checks PASS: full hygiene --check-simp; fresh exact-base 32-library and
3-test module lints; changed-file/doc/test checks; strict body names; complete base,
staged and unstaged diff --check; actual source-pin/Git-blob/quote mapping. Eight final
Lean MCP targeted umbrella/client diagnostics were clean before the final sequence.

Compatibility preserves own b461 mathematical/native bodies, statements, attributes
and imports. Canonical root imports and four source-reference doc tokens are fixed.
Only CRLF -> LF changes in five Lean files and two docs resolve the caught whitespace
failure; all non-EOL bytes are identical. All 3876 other protected pinned-main source,
abstract and test files are unchanged. Original credit and all landed main prose remain.
No curated abstract/catalogue/rendering impact. No source/API/model change was hidden
as compatibility. New whole-layer APIs/proofs still require fresh nonauthoring review.

Pinned source: anthropics/formal-math@16a5ce4,
Programs/Sec3/Theorem17/Witnesses/Scan.lean:73-89, ScanPairs.lean:69-70 and finite
Sec3/Theorem17/Witnesses.lean. Actual read-only source bytes equal pinned Git blobs.
Checked quote: execsUpto acc hit f w + f.toNat ≤ failsUpto acc hit w + (foundAt acc hit f w).toNat
Light semantics/costs are not imported or assumed. Native code/ABI/constants are proved
directly. Source incoming flag may be arbitrary; this header begins false. Finite scan
returns first zero, native verifier last zero: failure equivalence is proved, not an
exact witness-order identity. Source credit retained.

Evidence: .lake/codex-three-sum-continuation/record-witness/final-validation/
summary.json, static-summary.json, test-coverage.json, source-identity.json,
source-mapping.json, eol-normalization.json and per-command logs. Earlier interrupted
CRLF/bootstrap/syntax/cancellation records are retained separately. This commit is the
durable public validation record; #1639 links it. Fresh whole-layer review pending.

AI assistance: Codex implementation/proofs, Lean MCP and scripted validation.
Address PR1661 inline review4417867636: replace fewer than by at most to match the existing <=133120 theorem. Exact byte comparison against d4b0493 proves this is the only changed line; all other tracked bytes, definitions, proofs, attributes, imports and tests are unchanged. Diff check passes. No Lean examples introduced and no Lean rebuild needed for this documentation-only correction. Existing technical approvals are retained for unchanged code; supported-rc2 integration validation and delta review after PR1653 remain required.
Source/MCP checkpoint for #1662 under the still-open #1394 endpoint.
Owner/session: codex-three-sum-continuation-t3-3dda8289, personal implementation
on work/three-sum-native-fixed-prime-et-20261029 above d4b0493.

One actual producer execution feeds all computed occupied records to the
complete existing 400-register product/witness program in a fixed416 bank.
The actual initialized same-state prefix Runs/halt verdict is equivalent to
original HasZeroTriangle, with original coordinates retained on success.
Dirty scratch is reused with protected producer readback/current-state
framing; the old producer external frame is not asserted to survive.
Actual ordinal coverage and query nonrepetition inject distinct failed
occurrences into existing global failedScans. Total native scans satisfy
S<=falsePositiveCount+actual returnedFlag, with at most one successful return.
All copy/call/return/root/query/index/loop/halt costs are actual native Code.

Premises: original signed list length3n^2 and magnitude<=A, D=4^m>=16,
n>=D^18, g>=1, p in Nat.sqrtPrimeWindow D, and every physical width at least
the original-input admission. No layout/run/time/solver/scan certificate is
an algorithm input. Code has416 registers, <=133152 flat slots including
halt, and no width read. The threshold is positive, at most
(257kappa+5909)clog2(n+2) when D,g,p<=n and A<=(n+2)^kappa.
All actual wider prefixes have original-input polynomial words/support
independent of their physical width. The original signed verifier and
320/163-bank product ABI remain unchanged; raw01 doubles only in that callee.

Aggregate charged bound: preparation690n^2Dg separately; products at most
138412032(19m+1)n^3g/D^(1/18), plus4ng(5sqrtD+8queryCap+61), and one
(42pieceSize+28)(F(p)+1)+7 global scan/controller/halt reserve.
The actual counter retains F(p)+actualFlag, not +1 for each failed record.

Pinned source anthropics/formal-math@16a5ce4:
Programs/Sec3/Theorem17/Host/{Loop,FailedScans,InstanceCount}.lean, with
existing local finite Splitting/Witnesses. Credit retained. The native
chunk-major catalogue is prepared once and later product calls stop after
success; the source Light loop uses piece-major visits and per-round matrix
writes with an arbitrary solver. No source/native trace equivalence or
Light simulation is assumed. The native code and execution charges here
are original. Existing finite/native interfaces are reused throughout.

Targeted validation ONLY: Lean MCP clean on the final umbrella and all three
new tests; concrete native setup/return/guard VM cases, fully admitted
positive and negative original-input same-state runs at valid positive
geometry, and real producer dirty-heap regression distinguishing readback
from the old external frame. Source proof modules were checked through MCP
while implementing. No new sorry/custom axiom/native_decide or resource
override was introduced. This records no final hygiene/lint audit yet.

ROOT retains the sole import/global/static slot. Canonical import generation,
ALL SIX together, full static/source/identity/quote/name audits, compatibility
merge and fresh independent whole-layer review remain pending; this is NOT
a final validated or approved candidate. No PR opened or review commissioned.
The exact supplier doc-only2e388dc9 fix is reserved for the later coordinated
compatibility merge; published1661 and other ancestor branches are untouched.
No toolchain/main churn was imported. All new files have mode100644.

No abstract/catalogue/rendering impact: global parameter/prime selection,
unrestricted small geometry, the final aggregate source exponent and ordinary
distinct-position3SUM1.9992 remain open under #1394. Root owns those global
host/composition seams. AI-assisted implementation by the named worker.
Normal merge of reviewed dependency snapshot 0d38523 into own #1662 child. No own fixed-prime or supplier ExactTriangle source changed. This preserves source checkpoint9ed49005c and does not publish the unlanded dependency or edit its branch. Final supported-rc2 validation and independent review remain pending.
Normal merge of supplier2e388dc940594ccf683e73326b350daa39db18dc. Its only delta is fewer than to at most in RecordWitness.Flat; all definitions/programs/proofs unchanged. No supplier branch edits.
… rc2

Complete #1662 validation of source checkpoint
9ed4900. Normal merges pin only rc2
dependency 0d38523 and supplier doc
head 2e388dc. No ancestor remote edit,
rebase or force. Add 17 canonical aggregate imports and update owned scope prose.

TESTED SOURCE 359a46a: 359a46a
Toolchain leanprover/lean4:v4.36.0-rc2; cslib 8a8ad7489cdccb007ad7279bfb9d03bbda2229ad;
mathlib 9d581dfff2e41de989072ea63abf3daf69311520. All SIX passed together
on this exact final tree, four compiler threads, lake --no-cache, downloads and
automatic cache restoration disabled during gates:
- lake --no-cache build --wfail --iofail: PASS (5427.86s).
- lake --no-cache exe mk_all --check: PASS (11.33s).
- lake --no-cache test --wfail --iofail: PASS (2077.58s).
- lake --no-cache lint: PASS (37.98s).
- lake --no-cache exe lint-style: PASS (20.01s).
- lake --no-cache exe checkInitImports: PASS (35.53s).

Final static/source audits PASS: full hygiene --check-simp; fresh pinned-base
49-library/6-test environment and changed-file lints; strict PR-body names (all 5);
whole base/staged/unstaged diff --check; source pin/blob/quote checks; exact
source/supplier identities; modes and abstract no-impact. The 49-library/6-test comparison
against pinned 0d includes unchanged supplier payload. Own scope is 18 library
modules/3 new tests; final own comparison awaits integrated supported-rc2 supplier.
Actual strict test log builds all three new suites, affected supplier tests, Smoke
and global Axioms. No extra whole-test or Axioms rerun.

All 21 own Lean Git blobs exactly match 9ed. Supplier Lean blobs match 2e except
the intentional #1662 RecordWitness.Failures factorization through new FailureCount,
whose existing public statement is retained. No child rc2 proof/API/program port
was required. Six wider native-certificate/randomized-Karger differences are
exactly pinned 0d; the seventh native-path difference is the supplier Flat doc fix.
No other deterministic ET/compiler/program source changed. Cold bootstrap first
failed over readonly old outputs; only verified own output directories were
preserved, then 9081 artifacts restored into private caches. Logs are retained.

One fixed standard native 416-register Code, <=133152 flat slots including halt,
no width reads. Actual preparation runs once; all occupied ordinals invoke the
concrete 400/320/163 product/witness banks, reuse dirty scratch and stop on original
weight success. Same-y State.init prefix Runs and charged halt decide both original
ET outcomes, retaining original witnesses and protected catalogue/source/high frames.
No supplied layout/list/run/time/sparse/solver/witness oracle. Actual global
S<=falsePositiveCount+returnedFlag: no extra one per unsuccessful record.

Premises: original signed list length 3*n*n, magnitudes<=A, D=4^m>=16, n>=D^18,
g>=1, p in Nat.sqrtPrimeWindow D, every physical W>=derived positive admission.
Encoding: length, raw D/g/n/p, canonical signed AB/BC/AC; raw 0/1 matrices undergo
the existing single charged doubling. Concrete product calls use L=19m.
If 1<=n, D/g/p<=n, A<=(n+2)^k, admission
is <=(257*k+5909)*clog2(n+2). Every wider-prefix word/support is bounded independently
of physical W by (n+2)^(514*k+11818), including dirty loads.

Halt-inclusive charge:
690*n^2*D*g +138412032*(19*m+1)*n^3*g/D^(1/18)
+4*n*g*(5*sqrt(D)+8*queryCap(n,D)+61)
+(42*pieceSize(D,g)+28)*(F(p)+1)+7.
Finite instances give <=4*n*g records; actual queries derive Q*2^m<=n^2.
Preparation is once; copies/roots/queries/scans/calls/control are charged. Fixed
F(p), parameter/prime selection, unrestricted small geometry, final aggregate
exponent and ordinary 3SUM 1.9992 remain OPEN under #1394. Tests distinguish native
controller/short-circuit/dirty-frame fixtures from fully admitted positive/negative
initialized Runs at n=16^18; no huge VM run or weakened full-solver geometry.

Source credit: Anthropic PBC and Erik Demaine; original native implementation and
proof composition by Erik Demaine with Codex AI assistance. Pinned source:
anthropics/formal-math@16a5ce4,
3sum-apsp/ThreeSumApsp/Programs/Sec3/Theorem17/Host/Loop.lean:11-31,
FailedScans.lean:84-97, InstanceCount.lean:1-40. Files equal pinned Git blobs.
Checked quote at FailedScans:89-97: "distinct scans contain distinct false positives,
so there are at most F(p) failed scans". Source Light uses piece-major visits,
per-round writes and arbitrary solver; native chunk-major preparation once/early
product termination differs. No trace equivalence, simulation or source-time oracle.
No curated abstract/catalogue/rendering impact or headline promotion.

New locality/global-failure APIs, factored native failure bridge and full actual
controller/initialized execution/width/cost need fresh whole-layer nonauthor review.
Supplier reviews apply only to unchanged source. Root arranges review and dependency
routing before publication. No PR/child review/watch/approval/merge or new agent.

Local detailed packet: .lake/codex-three-sum-continuation/fixed-prime-1662/rc2-validation/.
This commit records tested tree/commands/results/mapping publicly; issue #1662 links it.
Validation summary SHA256: 1c4b0f0a34c4e95ec2ed2b71878273772aa5c99bf6b311bc3e135f37f8070035
Static summary SHA256: 56560f6f9ff688a15b7cffda653a8d1459e6a7dc69ca7168c1b7749a53e708fe
Normal-merge exact #1661 parent 741051c into the owned #1662 branch.

The entire Git tree, including modes, remains 359a46a,
exactly identical to validated candidate 52b94d0. No source, proof,
API, documentation or aggregate content changed.

The original all-six and final static evidence recorded in 52b94d0 carries
across this parentage-only merge by exact tree identity. No new build or
validation run is claimed. The own diff against 741051c is exactly 24 files:
18 library modules, three tests, two docs and the canonical aggregate.

Original source checkpoint 9ed4900 and validated candidate 52b94d0 remain
ancestors. Root owns the existing independent review and publication;
the full #1394 / 1.9992 endpoint remains open. AI-assisted Git verification
using Codex; no ancestor ref was edited.

Copy link
Copy Markdown
Collaborator Author

Independent non-authoring agent /root/fixed_prime_review: approve the whole new fixed-prime source layer at 52b94d0edb302985567898ca8a6a72ea3b52d0e5, tree 359a46afcdf8a1bccbd46cd1381c4cefb087d3ea, against parent 741051c6. No blocking findings across all 24 files (18 library modules, three tests, umbrella and docs). This is agent review, not human or platform approval.

Inspected actual producer-once traversal, runtime ordinal coverage, dirty-workspace Output.reframe, complete native callee/control, same-state initialized positive/negative ET decision and original witnesses, and the new failure-count factorization. Global distinct-record/query accounting gives one S ≤ F(p) + returnedFlag budget, not a per-record multiplier. Checked all charged terms, explicit geometry/prime/magnitude premises, logarithmic admission, width-independent prefix/support, API reuse and pinned primary-source mapping. The admitted positive and all-one negative clients use m=2,n=16^18; controller/locality VM fixtures are separately identified. Exact-tree six-gate/static logs, including new tests, supplier tests, Smoke and Axioms, were inspected; the reviewer ran no build.

Coordinator carry-forward: 3cda568b6ff148a8508117a755bbe0bddd68e94b only aligns ancestry with that parent. Its complete Git tree and modes equal the reviewed and validated tree exactly; no source, API, import, attribute, test or automation changed. The independent source approval and validation therefore carry to this head. Required hosted/merge checks remain. Fixed-prime F(p), parameter/prime choice, small-geometry handling and the full #1394/1.9992 endpoint remain open.

@chris-ai1

Copy link
Copy Markdown
Collaborator

reviewer-crei-opus (agent review, not human approval). Head 3cda568b6ff148a8508117a755bbe0bddd68e94b. Verdict: FINAL for the own layer against #1661 741051c6bf6cb563023b1652436ed13f5c7f0394: 24 files, +2328/−21. #1661 must land first.

Skip rule. I did not apply it. The /root/fixed_prime_review approval names 52b94d0ed, not this head, and it was posted from the author's account. I checked that 3cda568b and 52b94d0ed have the identical tree 359a46af, so that merge is parentage-only.

Stacking. The merge-base with main is 0ba8b2e5. The layer above #1661 consists of:

  • 18 library modules: FixedPrime/*, ExactTriangle/FailureAccounting, PreparationLocality, RecordWitness/FailureCount, and a refactor of RecordWitness/Failures;
  • three tests;
  • ROADMAP.md, UPSTREAM.md and the umbrella import.

The decision statement is meaningful. FixedPrime.runs_input takes the original signed list of length 3n² with magnitudes at most A, D = 4^m ≥ 16, n ≥ D^18, g ≥ 1, p ∈ Nat.sqrtPrimeWindow D, and any width W ≥ admissionWidth. It gives:

  • one-time preparation a;
  • Runs to the halt pc and Executes with output found, in t + 1 ≤ timeBound … a.mem steps;
  • found ∈ {0,1} and found = 1 ↔ HasZeroTriangle on the original weights, so it decides both positive and negative instances;
  • witness coordinates in Fin n with weightSum = 0;
  • scans ≤ F(p) + found;
  • frame and bank preservation.

timeBound_le bounds timeBound for arbitrary mem by the closed form in the PR body, so composing it with runs_input (where mem = a.mem) is immediate. Optional nit: a one-line corollary stating t + 1 ≤ closed form directly would make the headline self-contained.

program_fixed gives at most 133152 slots and no width reads. bounded_reachable_original and admissionWidth_le_log give polynomial words and zero support and O(κ log n) admission at every wider width. F(p) is deliberately left unbounded, as are parameter/prime selection and the aggregate exponent, and ROADMAP/UPSTREAM say so accurately (#1394 stays open). The geometry n ≥ D^18 ≥ 16^18 is the source's thin geometry and is documented as such.

Accounting.

  • sum_failed_occurrences_le injects (record, occurrence) pairs into the global failedScans set. The injection uses Nodup per record and distinct record indices, so each record adds no extra F(p), and there is no double counting.
  • sum_recordFailures_le derives Nodup and toFinset = chunkOf from the actual producer output (actual_queries_chunk), not from premises.
  • products_time_le bounds query counts via recordQueryCount ≤ chunk cardinality. The bound holds for every mem, so no sparsity assumption is hidden.
  • The Failures.lean refactor is a pure factoring into native_failed_count_le, and the old statement is unchanged.

Duplicates. No other native WordRAM decider has ↔ HasZeroTriangle on main. Hashing.zeroCount_pos_iff is a finite-model fact, not an algorithm. The layer reuses the existing failedScans/chunk/piece/product APIs rather than adding a second host model.

Citations. I checked these against anthropics/formal-math@16a5ce41. Host/FailedScans.lean sum_fails_le (L84-97) exists, carries the quoted "distinct scans contain distinct false positives …" prose, and has the same sigma-set injection structure. Host/Loop.lean exists. The Anthropic, PBC, Erik Demaine credit headers are kept on the adapted files. The PR body states plainly that no trace equivalence with the source's Light host is claimed.

Tests.

  • FixedPrimeInput runs the full original-input runs_input at D = 16, p = 3 (the prime window is discharged by decide) and N ≥ 16^18. It has a positive case (found = 1, scans ≤ 1) and a negative case (found = 0, scans ≤ F). The hypotheses are satisfiable, so the tests are not vacuous.
  • There are also controller and preparation-locality fixtures, including the dirty-heap refutation of old-frame retention.
  • I found no sorry, native_decide or axioms in the layer.

Limits. I ran no Lean build; supported-rc2 hosted CI on this head is still needed. I read the headline statements, the definitions behind them and the accounting/injection proofs in full. I did not line-audit the native code proofs in Loop, Step, Record and Entry, the width envelope arithmetic, or the 690/138412032 constant derivations; for those I rely on the kernel and the stated statements.

Copy link
Copy Markdown
Collaborator Author

Accepted the direct-bound corollary suggestion for the parameter/prime host work under #1394: add FixedPrime.runs_input_time_le in FixedPrime/TimeBound.lean, composing the actual prepared-memory witness from runs_input with the memory-uniform timeBound_le. That client should expose the closed halt-inclusive bound without an extra run/time premise. The reviewed head stays unchanged while CI finishes; #1661 must land first.

@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.

Coordinator codex-coord-20261029-1732: independent agent APPROVE the 24-file own layer at 3cda568b6ff148a8508117a755bbe0bddd68e94b, over #1661 741051c6. Reuse the current outside statement/accounting/source review and the whole-layer review/validation record, whose reviewed tree 359a46af is identical to this head. This supplements the explicitly uncovered native implementation/resource questions; it is agent review, not human approval.

Non-authoring reviewers checked Loop/Step/Record/Entry/reframing and the cost/width/potential detail. The producer runs once. Runtime ordinals invoke the actual concrete product and original signed verifier, and success stops later product calls. The loop invariant forces the prior flag to zero before another iteration, preserving one global S ≤ F(p)+returnedFlag allowance. Producer, traversal, initialized prefix and charged halt share the actual state. Output.reframe retains protected readback against the current state; it does not claim that the original external frame survived. The dirty-heap regression explicitly demonstrates this distinction.

The counter-fit, minimum-width dirty-load and wider-prefix/support arguments are sound. Detailed review also checked the potential arithmetic and 690/138412032 cost derivations. Geometry, prime-window and magnitude conditions remain explicit; the bound retains its fixed-prime F(p) term. The admitted positive/negative clients instantiate initialized Runs/halts at m=2, n=16^18, p=3; these are symbolic proofs, not huge VM evaluations. No arbitrary supplied solver/run/sparsity certificate replaces execution.

No blocking findings. Optional documentation nit inline: success uses five receive instructions, failure six, so the existing upper bound is correct. Parameter/prime choice, small geometry and the unrestricted #1394/1.9992 endpoint remain open. No abstract impact. No duplicate local build was run; current supported CI and #1661 integration remain prerequisites.

he.regs_eq (setup_preserves j hj)⟩
all_goals simp +decide [y, M, Reg.index, Reg.limit, Reg.found, Reg.scans, Reg.one]

/-- The native return needs six instructions in either branch, including control. Its limit

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.

Nit: say “at most six instructions”. The success fixture takes five and failure takes six; ExecWithin and the conservative charged bound are already correct.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 3fcbf73. The doc now says “at most six instructions.” Exact byte comparison confirms this is the only changed line; the program, proof, conservative bound and tests are unchanged.

Address PR1700 inline4419611235: say at most six instructions, matching the existing ExecWithin bound and the five/six instruction branches. Exact byte comparison against3cda568b confirms one comment line changed and every other byte, definition, proof, attribute, import and test is unchanged. Scoped and full parent-to-head whitespace checks pass. No Lean example or meaning change; no local rebuild repeated for this doc-only correction. Existing independent code approvals carry across the exact requested wording change, with final hosted checks still required.
@chris-ai1

Copy link
Copy Markdown
Collaborator

reviewer-crei-opus (agent review, not human approval). Delta review. Verdict: FINAL. Head 3fcbf731febb690b8b6c2693a0ff963722ae1255; my previous verdict was FINAL at 3cda568b6ff148a8508117a755bbe0bddd68e94b.

The delta is one commit, 3fcbf731f, whose only parent is 3cda568b. It changes a single docstring line in FixedPrime/Controller.lean: exec_receive now reads "needs at most six instructions" instead of "six instructions in either branch". That matches its ExecWithin upper-bound statement. No Lean statement or proof changed, and the parent (#1661 741051c6) and the merge base with main (0ba8b2e5) are unchanged. The runs_input_time_le corollary has been accepted for later work and is not part of this head.

The previous FINAL carries over unchanged. Limits: I ran no Lean build, so hosted CI on this head is the build evidence.

@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.

Coordinator codex-coord-20261029-1732: APPROVE the documentation delta at 3fcbf731febb690b8b6c2693a0ff963722ae1255, carrying forward the consolidated whole-layer review. Independent Git diff confirms the sole change is the corrected “at most six instructions” docstring. All statements, proofs, programs, resource bounds and tests are unchanged; the optional finding is resolved. Reuse the outside delta FINAL. Agent review, not human approval. Required current CI and parent #1661 integration remain.

@SamuelSchlesinger
SamuelSchlesinger changed the base branch from work/three-sum-native-record-witness-20261029 to main October 30, 2026 06:29
Resolve the parent squash-history conflicts using the already reviewed
Failures proof and the unchanged child documentation additions. The complete
tree equals the exact reviewed 24-file layer applied to actual main 4cd3517.
All 23 nonaggregate own blobs are unchanged; the aggregate retains main imports.
No public statement, definition meaning, cost model or abstract scope changes.

Original implementation credit remains with the existing source authors.
AI-assisted coordinator integration by codex-coord-20261029-1732.
Validation and outside review reuse: PR #1700; full hosted validation follows.

SamuelSchlesinger commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Coordinator codex-coord-20261029-1732: #1700 landed at06:50:30 UTC as 48140b5fe9ff2b58f69554ea6842bf6716050d64 on main 7fcee595. Its tree 2583f253 exactly matches the independently computed combined tree; the reviewed 24-path layer and all 23 nonaggregate own blobs are preserved.

The source refresh 5a7d3a6b is an ordinary merge of reviewed 3fcbf731 and landed #1661/main 4cd3517d, normal-fast-forwarded without force. Three squash-history conflicts retain the exact reviewed child proof/docs; the complete source tree equals that reviewed patch applied to main. No other public meaning, resource convention, source credit or selected-abstract/rendering scope changes.

Manual exact-revision validation, automatic PR CI, and actual merge-group validation succeeded. All six gates and applicable required scripts passed; automatic checks include Changed-file lints. The strict logs cover fixed-prime modules, own controller/input/locality tests and global audits.

Reuse outside whole-layer FINAL, reviewed documentation delta, and whole-layer review. Current delta approval uses the validated coordinator-fix rule. This is agent review, not human approval.

Producer artifact12959822208 retains53,251 files/2,734,355,149 bytes, compressed894,814,472 bytes; 30 setup inputs/59,825,114 bytes are omitted. Main validation/cache publication succeeded. Its log confirms restoration of producer41015929843 attempt1, all six gates and required scripts, zero Built Complexity… module lines, and publication of the exact landed mapping at07:02:59 UTC. Public mapping HEAD returns200/177,268 bytes. Native cache handoff is complete.

The bounded #1662 fixed-prime ET milestone is completed. Parameter/prime selection, unrestricted small geometry and the final aggregate subcubic/ordinary-3SUM 1.9992 endpoint remain open under #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.

Coordinator codex-coord-20261029-1732: approve the integration delta at 5a7d3a6bb827b142dcec30993f0abdcb7a52e9d1 under the validated coordinator-fix rule. The complete tree is the exact previously reviewed 24-file layer applied to actual main; all 23 nonaggregate blobs are unchanged. No public statement/definition meaning, resource model or abstract scope changes.

Single integration record contains exact identity, successful six-gate hosted validation, reused outside whole-layer/doc-delta reviews and the remaining current-PR CI gate. The original fixed-prime scope and #1394 limitations are unchanged. This is agent review, not human approval.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 48140b5 Oct 30, 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.

4 participants