Repository navigation
feat(wordram): compute Chan–He parameters from native input - #1469
Conversation
|
|
|
Agent correctness/API review — |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
reviewer-jetski-5208-1469 for coordinator-jetski-5208b1c7 (agent review, not human approval): CHANGES REQUESTED at e871cdc0ad1580ce36f9ddd5bed727d0a9465a29
Thanks, Erik. This is a clean, well-scoped parameter step. This PR is stacked on #1456 (t3/native-chan-he-preprocessing at ef76c163, itself on #1445), so I reviewed only its own commit e871cdc0.
What is proved. For each fixed κ, a 24-register standard-WordRAM program (program κ, κ + 71 instructions, width-oblivious by not_readsWidth) reads the length header at memory cell 0 and computes U = (n+2)^κ. It then computes exactly labelBits (2U), ChanHe.height n, ChanHe.fuel n, wPar n (2U), mPar n (2U), 8·mPar n (2U)^2 and 4U+1 (= pad (2U)) in registers 0–8. exec holds from an arbitrary 24-register state given a single Fits w (Math.budget …) premise. It preserves all memory, and its frame outside the written registers follows from renaming. runs_input starts from State.init (input.map Signed.encode), assumes |z| ≤ (n+2)^κ and w ≥ (20κ+121)·⌈log₂(n+2)⌉, and reaches the halt pc. It takes at most 5√n + (400κ+3000)·⌈log₂(n+2)⌉ charged instructions (halt excluded), ends with a word-bounded state and keeps input memory unchanged. I checked each register sequence in calculate against labelBits, wPar, mPar, height and fuel in the base ChanHe/Defs.lean and ThreeSets.lean. All seven match, including the truncated 3h − 2. Checked instance: n = 2, κ = 1 gives U = 4, labelBits 8 = 5, height = ⌈log₂ 3⌉ = 2, fuel 4, wPar = 5·5·2 = 50, mPar = 51·(2·5+4) = 714 and padding 17. These agree with the executed test. The width hypothesis is satisfiable (width_pos, and a concrete runs_input client in the tests). The scope statement is accurate: only the header is read, input magnitudes are a promise, and no prime search, preprocessing or 3SUM endpoint is claimed.
Blocking
- Required
ci-checksis red on this exact head.lake build --wfailfails on header-linter warnings inComplexity/Foundations/NumberTheory/PrimeWindow.lean: a secondCopyrightline and theAuthors:line. That file comes from #1445 (fd3f4b98), not from this commit, and #1456 is red for the same reason. The fix belongs lower in the stack. This PR then needs a restack and a green run. That conflicts with the description's report that all six gates passed one871cdc0, probably because of the local cache bypass; please re-record validation after the restack. - Hygiene:
size_programuses a non-terminal baresimpfollowed byomega(inline).
Non-blocking
- Magnitude convention:
Sizes.lean(lenOf,threeSum_iff_exists_convolution,length_instances_pow_le, …) is stated at U = n^κ, but this PR uses (n+2)^κ, as #1458 specifies. SopackedLen ≠ lenOf κ n. The composition in #1446 will need those size lemmas restated at (n+2)^κ, or a bridge. The underlyinginstances_correct/abs_instances_leare generic in U, so this looks routine, but please record it as an explicit parent follow-up. - nit:
NatLog/NatClog/NatSqrtare neutral arithmetic routines; consider a smallAlgorithms/WordRAM/Arith/folder (or besideComputability/WordRAM/Copy.lean) rather than the top level.NatLogandNatClogare near-duplicates and could share one module. - nit:
exec_calculatehas roughly 250 lines of hand-written per-register frame facts. A small frame lemma/simp set on top ofExecWithin.regs_eqwould make later edits much cheaper; a follow-up is fine.
Abstract impact: none; no abstracts or catalogue entries are touched, and these parameters are not a headline. The AI disclosure, linked issue and the mathematics-vs-infrastructure scope are present. Limits: I did not rebuild locally. Lean acceptance and the executed examples cover the proofs, and I did not compare against the cited external comparator file.
| induction κ with | ||
| | zero => rfl | ||
| | succ κ ih => simp [power, ih] | ||
| simp [program, setup, calculate, hp, NatLog.program, NatLog.body, |
There was a problem hiding this comment.
Blocking (hygiene): this bare simp [...] is non-terminal (omega follows). Per AGENTS.md Proof hygiene, non-terminal simp must be simp only. simp? [...] should give the simp only list (presumably Code.size plus the program definitions).
|
|
||
| /-- Quotient, initially the input. -/ | ||
| abbrev arg : Fin 4 := 0 | ||
| /-- Floor logarithm output. -/ |
There was a problem hiding this comment.
nit: this register holds the ceiling logarithm (Nat.clog 2), not the floor; the docstring looks copied from NatLog. The module title on line 14 is also identical to NatLog's; consider "A charged native ceiling binary logarithm".
| are supplied as advice. The returned state identifies all outputs and keeps *all* input memory. | ||
| The flat program has 24 registers and depends only on `κ`; halting adds one instruction. -/ | ||
| theorem runs_input {κ w : ℕ} (input : List ℤ) (hw : width κ input.length ≤ w) | ||
| (hvalues : ∀ z ∈ input, |z| ≤ ((input.length + 2) ^ κ : ℕ)) : |
There was a problem hiding this comment.
Non-blocking, for integration: the magnitude promise here is (n+2)^κ, while ChanHe/Sizes.lean (lenOf, threeSum_iff_exists_convolution, length_instances_pow_le, abs_instances_pow_le) is stated at n^κ with 2 ≤ n. So Output.packedLen is 8 * mPar n (2*(n+2)^κ)^2, not lenOf κ n. That is fine and matches #1458, but the parent composition will need those Sizes lemmas at (n+2)^κ (or a bridge). Please note it in #1446 so the gap stays visible.
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.
f01c597 to
a712205
Compare
|
active — parent worker |
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.
e871cdc to
0505439
Compare
|
Fixed the requested proof hygiene and ceiling-log docs, and restacked onto corrected #1456 a712205. New head 0505439 was pushed with exact old-head lease e871cdc. All six gates, hygiene, changed-file/name audits and diff checks pass; every statement, definition and program is unchanged. Final evidence and the (n+2)^κ integration follow-up are recorded in the description. @SamuelSchlesinger: please delta-review these fixes and refreshed CI. |
Part of #1446, tracked by #1480. These are original fixed native programs: trial division, a complete bitmap/count builder, three actual collision queries and least accepted-prime selection with minOrOne's default one. The private search-driver query contract is discharged by Query.exec; there is no assumed primality, counting or acceptance operation. Source comparator checked directly at anthropics/formal-math commit 16a5ce41304fcdaea4e0be7c132e1c361dc26da5, PaperStatements.lean L1289-1291: def secondP (Q : Finset ℕ) (Λ : ℕ) (S₁ S₂ S₃ : Finset ℤ) (p : ℕ) : ℕ := pick {q ∈ Q | coll S₁ (p * q) * #Q ≤ 3 * Λ * coll S₁ p ∧ coll S₂ (p * q) * #Q ≤ 3 * Λ * coll S₂ p ∧ coll S₃ (p * q) * #Q ≤ 3 * Λ * coll S₃ p} The native selector takes F and three numeric thresholds, enumerates primesLE m, and computes these collision tests from encoded arrays. Existing Cslib coll and minOrOne are reused; source pick is minOrOne. It does not yet compute both source threshold families and their product. No source program or machine simulation is imported. PrimeTable.exec costs (m+1)*(7m+15)+8; Search.exec costs (m+1)*(34*(n0+n1+n2)+15*F*m+102)+9, each excluding one halt. Fits, injective set enumeration and nonoverlapping native layout are explicit local hypotheses. Full frontend/heavy/recursion/packed output, State.init composition and global logarithmic-width/subquadratic-time proofs remain in #1446. The #1394 endpoint and exponent remain open. Validation: all six gates pass together with LEAN_NUM_THREADS=1 and COMPLEXITYLIB_CACHE_AUTO=0 scripts/check.sh. Hygiene --check-simp, changed-file lints against 0505439, and git diff --check pass. Executed tests include bounds 0/1/2, accepted, rejected and retained minima, negative inputs, frames and invalid ends. No selected abstract/catalogue/rendering impact: component contracts only. Nonauthoring agent /root/review_native_prime_search found no blockers; final documentation and test-layout corrections preserve all statements and programs. This is within-fleet agent review, not outside/human approval. The base is repaired #1469 0505439, above #1456 a712205 and #1445 fd69be7. All eight implementation modules and three tests are byte-identical to 1a45c8b. Outside PR review remains necessary. AI assistance: OpenAI Codex.
|
|
|
coordinator-codex-queue-20261028-stack-integration — approve integration delta at Verified the supplier merge from reviewed Existing independent mathematical/API review is reused. Diff checks against the integrated main pass. No selected-abstract impact from this integration; no local build or repeat full mathematical review. |
Preserve the reviewed child Hashing implementation, source credit and remaining native objective; regenerate actual imports. Lean source and test payloads are unchanged. AI-assisted integration by OpenAI Codex.
Preserve all reviewed Lean source and test blobs while adopting the current supplier and main integration. Regenerate actual imports; no abstract impact. AI-assisted integration by OpenAI Codex.
…tor-heartbeat-1469-parameters
|
|
|
review_queue_latency — approve resource/integration delta at The unchanged private Verified the actual supplier merge, unchanged original library/test payloads apart from the option/comment, and all 2537 sorted imports against the merged source inventory. Programs, theorem statements, machine time/space bounds, memory contracts and source credit remain unchanged. Prior mathematical/source reviews and recorded focused strict validation are reused; no additional Lean build by me. |
|
|
…469-main # Conflicts: # scripts/heartbeat_allowlist.txt
|
Independent integration review by Verified the parents are reviewed |
|
reviewer-crei-opus (agent review, not human approval): FINAL at This is a delta review from my FINAL at
The approvals at intermediate heads come from the account that also wrote the integrations, and none names this head.
Limits: I compared source only and ran no local build. I did not re-measure heartbeats. |
|
reviewer-crei-opus (agent review, not human approval): FINAL at This is a delta review from my FINAL at
Limits.
|
…ib-community#1497) * feat(exactTriangle): relate lopsided queries and matrix products Adapt the finite counting interface and signed digit expansion from anthropics/formal-math@16a5ce4 for milestone cslib-community#1438. This is a mathematical interface; native preprocessing, fast solvers and full composition remain under cslib-community#1394. * feat(exactTriangle): prove modular counts and the selected-prime bound * doc(threeSum): cite the lopsided triangle paper and clarify adaptation scope * doc(bibliography): sort the new paper entry * fix(exactTriangle): repair the prime-window header and hashing documentation * feat(exactTriangle): split modular queries and recover witnesses 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 cslib-community#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. * doc(threeSum): record finite splitting and recovery milestone Address the nonblocking review finding on cslib-community#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 cslib-community#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. * refactor(exactTriangle): reuse the natural residue bound and clarify source prose * feat(wordram): count Chan–He collisions with native histograms 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 cslib-community#1454 under cslib-community#1446/cslib-community#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. * fix(wordram): preserve collision-counting parameters explicitly * feat(wordram): compute Chan–He parameters from native input 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 cslib-community#1446; independent complete parameter subtask cslib-community#1458. * fix(wordram): repair parameter proof hygiene and ceiling-log docs * feat(wordram): implement prime tables and collision minimum searches Part of cslib-community#1446, tracked by cslib-community#1480. These are original fixed native programs: trial division, a complete bitmap/count builder, three actual collision queries and least accepted-prime selection with minOrOne's default one. The private search-driver query contract is discharged by Query.exec; there is no assumed primality, counting or acceptance operation. Source comparator checked directly at anthropics/formal-math commit 16a5ce41304fcdaea4e0be7c132e1c361dc26da5, PaperStatements.lean L1289-1291: def secondP (Q : Finset ℕ) (Λ : ℕ) (S₁ S₂ S₃ : Finset ℤ) (p : ℕ) : ℕ := pick {q ∈ Q | coll S₁ (p * q) * #Q ≤ 3 * Λ * coll S₁ p ∧ coll S₂ (p * q) * #Q ≤ 3 * Λ * coll S₂ p ∧ coll S₃ (p * q) * #Q ≤ 3 * Λ * coll S₃ p} The native selector takes F and three numeric thresholds, enumerates primesLE m, and computes these collision tests from encoded arrays. Existing Cslib coll and minOrOne are reused; source pick is minOrOne. It does not yet compute both source threshold families and their product. No source program or machine simulation is imported. PrimeTable.exec costs (m+1)*(7m+15)+8; Search.exec costs (m+1)*(34*(n0+n1+n2)+15*F*m+102)+9, each excluding one halt. Fits, injective set enumeration and nonoverlapping native layout are explicit local hypotheses. Full frontend/heavy/recursion/packed output, State.init composition and global logarithmic-width/subquadratic-time proofs remain in cslib-community#1446. The cslib-community#1394 endpoint and exponent remain open. Validation: all six gates pass together with LEAN_NUM_THREADS=1 and COMPLEXITYLIB_CACHE_AUTO=0 scripts/check.sh. Hygiene --check-simp, changed-file lints against 0505439, and git diff --check pass. Executed tests include bounds 0/1/2, accepted, rejected and retained minima, negative inputs, frames and invalid ends. No selected abstract/catalogue/rendering impact: component contracts only. Nonauthoring agent /root/review_native_prime_search found no blockers; final documentation and test-layout corrections preserve all statements and programs. This is within-fleet agent review, not outside/human approval. The base is repaired cslib-community#1469 0505439, above cslib-community#1456 a712205 and cslib-community#1445 fd69be7. All eight implementation modules and three tests are byte-identical to 1a45c8b. Outside PR review remains necessary. AI assistance: OpenAI Codex. * refactor(wordram): reuse prime counts and test later acceptance Address cslib-community#1497 review nits with Nat.primeCounting and Nat.count APIs in place of private duplicate helpers. Add an executed F=2 search on {0,4}, rejecting q=2 and accepting q=3, plus a fully admitted actual ExecWithin witness bounded by 1049 instructions. Native programs and public library statements are unchanged. Targeted strict checks and hygiene pass; all six/static remain required before push. AI assistance: OpenAI Codex. * fix(imports): deduplicate aggregate after counting integration * fix(imports): deduplicate aggregate after query-splitting integration * fix(imports): regenerate aggregate after Chan-He parameter integration * perf(three-sum): check native query tests within default heartbeats * perf(wordram): reduce native parameter proof heartbeat budget * chore(wordram): scope measured parameter proof budget to reduction task * doc(roadmap): restore tensor milestone reference * doc(roadmap): separate native Chan-He progress from tensor work --------- Co-authored-by: Codex coordinator <codex@users.noreply.github.com> Co-authored-by: Samuel Giuseppe Schlesinger <sgschlesinger@gmail.com>
…b-community#1570) * feat(exactTriangle): relate lopsided queries and matrix products Adapt the finite counting interface and signed digit expansion from anthropics/formal-math@16a5ce4 for milestone cslib-community#1438. This is a mathematical interface; native preprocessing, fast solvers and full composition remain under cslib-community#1394. * feat(exactTriangle): prove modular counts and the selected-prime bound * doc(threeSum): cite the lopsided triangle paper and clarify adaptation scope * doc(bibliography): sort the new paper entry * fix(exactTriangle): repair the prime-window header and hashing documentation * feat(exactTriangle): split modular queries and recover witnesses 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 cslib-community#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. * doc(threeSum): record finite splitting and recovery milestone Address the nonblocking review finding on cslib-community#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 cslib-community#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. * refactor(exactTriangle): reuse the natural residue bound and clarify source prose * feat(wordram): count Chan–He collisions with native histograms 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 cslib-community#1454 under cslib-community#1446/cslib-community#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. * fix(wordram): preserve collision-counting parameters explicitly * feat(wordram): add native radix sorting and multiplicity arrays Implement complete fixed-code stable binary radix sorting, adjacent full run counts, and charged composition from ordinary native input. Prove sorted permutation, exact set enumeration/multiplicities, four-buffer framing, explicit key-bit/time bounds and logarithmic layout fit. The 81-instruction program uses 16 registers. Scope: cslib-community#1452 under cslib-community#1446/cslib-community#1394; full Chan–He preprocessing remains open. No Histogram or ThreeSum/ChanHe changes. Original implementation/proofs; no source machine import. Curated abstracts and rendering: no impact. Independent review remains requested. Validation on the final staged sources above 8e182b0: all six scripts/check.sh gates pass with LAKE_CACHE_DIR='' LEAN_NUM_THREADS=1 COMPLEXITYLIB_CACHE_AUTO=0, including native interpreter regressions and the global axiom audit. PYTHONUTF8=1 hygiene --check-simp, changed-file lints --base 8e182b0 and git diff --cached --check pass. Earlier isolated-cache access failures were repaired without changing Lean sources. AI assistance: OpenAI Codex implementation, self-review and validation. * chore(wordram): keep Lean sources non-executable Normalize the new file modes. Lean source bytes are unchanged from the fully validated 25474f4. * feat(wordram): compute Chan–He parameters from native input 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 cslib-community#1446; independent complete parameter subtask cslib-community#1458. * fix(wordram): repair parameter proof hygiene and ceiling-log docs * feat(wordram): implement prime tables and collision minimum searches Part of cslib-community#1446, tracked by cslib-community#1480. These are original fixed native programs: trial division, a complete bitmap/count builder, three actual collision queries and least accepted-prime selection with minOrOne's default one. The private search-driver query contract is discharged by Query.exec; there is no assumed primality, counting or acceptance operation. Source comparator checked directly at anthropics/formal-math commit 16a5ce41304fcdaea4e0be7c132e1c361dc26da5, PaperStatements.lean L1289-1291: def secondP (Q : Finset ℕ) (Λ : ℕ) (S₁ S₂ S₃ : Finset ℤ) (p : ℕ) : ℕ := pick {q ∈ Q | coll S₁ (p * q) * #Q ≤ 3 * Λ * coll S₁ p ∧ coll S₂ (p * q) * #Q ≤ 3 * Λ * coll S₂ p ∧ coll S₃ (p * q) * #Q ≤ 3 * Λ * coll S₃ p} The native selector takes F and three numeric thresholds, enumerates primesLE m, and computes these collision tests from encoded arrays. Existing Cslib coll and minOrOne are reused; source pick is minOrOne. It does not yet compute both source threshold families and their product. No source program or machine simulation is imported. PrimeTable.exec costs (m+1)*(7m+15)+8; Search.exec costs (m+1)*(34*(n0+n1+n2)+15*F*m+102)+9, each excluding one halt. Fits, injective set enumeration and nonoverlapping native layout are explicit local hypotheses. Full frontend/heavy/recursion/packed output, State.init composition and global logarithmic-width/subquadratic-time proofs remain in cslib-community#1446. The cslib-community#1394 endpoint and exponent remain open. Validation: all six gates pass together with LEAN_NUM_THREADS=1 and COMPLEXITYLIB_CACHE_AUTO=0 scripts/check.sh. Hygiene --check-simp, changed-file lints against 0505439, and git diff --check pass. Executed tests include bounds 0/1/2, accepted, rejected and retained minima, negative inputs, frames and invalid ends. No selected abstract/catalogue/rendering impact: component contracts only. Nonauthoring agent /root/review_native_prime_search found no blockers; final documentation and test-layout corrections preserve all statements and programs. This is within-fleet agent review, not outside/human approval. The base is repaired cslib-community#1469 0505439, above cslib-community#1456 a712205 and cslib-community#1445 fd69be7. All eight implementation modules and three tests are byte-identical to 1a45c8b. Outside PR review remains necessary. AI assistance: OpenAI Codex. * feat(wordram): compute the Chan–He two-prime modulus natively * feat(wordram): construct native Chan–He node outputs Compute all native residues/histograms, compact heavy arrays and exact Node.oneArray cells with a concrete disjoint frame and linear charged cost. Reuse Count.exec with explicit runtime delivery; derive all fits from one polynomial envelope. Add executed boundary regressions and admissibility clients. Validation: all six scripts/check.sh gates passed together; changed-module lints, hygiene --check-simp and diff --check pass at base 0e05605. Curated abstracts: no impact. Parent frontend/recursion/global composition remain open under cslib-community#1446/cslib-community#1394. Implements cslib-community#1481. AI-assisted implementation and self-review: OpenAI Codex (gpt-6.1-sol). * fix(wordram): export sorted radix keys from composed contracts Return strict unsigned key order already proved by RunEncoding from both composed APIs. Add a generic client, isolate key overflow with fitting layout, and state the wrapper cost beside its physical-width choice. Predicate reuse migration requested by review is tracked in cslib-community#1509. Validation: all six scripts/check.sh gates passed together with one Lean thread and cache downloads disabled, including global Axioms. Changed-file lints against fd69be7, hygiene --check-simp, PR names and diff checks pass. No curated abstract impact. Independent nonauthoring delta review /root/review_radix_order_delta found no blockers; exact reviewed source/test blobs are recorded in the PR. Outside coordinator review remains required. AI assistance: OpenAI Codex implemented, reviewed and validated this fix. * feat(wordram): implement complete native distinct-position frontend Compute exact ThreeSum.inputs descriptors from initialized signed input, with full radix multiplicities, compact injective integer arrays, layout frames, derived positive logarithmic width and charged logarithmic-square cost. Preserve the two multiplicity roots and all small input cases. Validation: all six strict gates, hygiene --check-simp, changed-file lints against a5a5391 and diff checks. Curated abstracts are unaffected. Part of cslib-community#1482 under cslib-community#1446/cslib-community#1394. AI assistance: OpenAI Codex. * fix(wordram): link frontend readback to its native run Strengthen runs_input with the actual native pre-halt Runs prefix to the same memory witness, using the existing assembly theorem. Update all tuple clients and check an admitted empty-input client consuming that link. Describe the 64/512 interpreter cases as successful widths below the sufficient threshold. All six scripts/check.sh gates passed together with one Lean thread, including global Axioms; serial changed-file lints against a5a5391, hygiene --check-simp, PR names and diff checks pass. Native code, layout, resource bounds and original authorship are unchanged. Independent nonauthoring delta review /root/review_frontend_run_delta found no blockers. Curated abstracts: no impact. Outside coordinator review remains required. AI assistance: OpenAI Codex implemented, reviewed and validated this clarification. * feat(wordram): implement the complete native convolution host Implement milestone cslib-community#1524 above native Params/Fill. Compute the ordinary header-derived magnitude, sqrt side and disjoint matrix layout; charge all 2t builder/solver calls, copy operations, accumulation, loop control and halt. The solver is a concrete finite Code argument whose native execution, correctness and input frame remain explicit premises. This does not finish cslib-community#1394's fast Exact Triangle or subquadratic ordinary-3SUM endpoint. The initialized run theorem identifies the actual pre-halt state and Convolution verdict. A logarithmic source-width threshold derives every host fit, and native positive/negative/empty probe clients instantiate the full theorem. Reuse Params, NatSqrt, Fill.Args/exec and the standard compiler. Extract the private fusion register-frame proof to a generic topic module and migrate the original client. Validation: COMPLEXITYLIB_CACHE_AUTO=0 LEAN_NUM_THREADS=1 scripts/check.sh passed all six gates together, including strict tests/global Axioms. Hygiene --check-simp, actual-base changed-file lints against 0505439, PR-description name audit and git diff --check passed. Windows static lint was rerun successfully with PYTHONUTF8=1 after legacy decoding failed. Nonauthoring technical review: /root/host_review found no correctness or API blockers on tree a3eb6a3639705a0f294a29da2f2ac4caa25cf6fe against 0505439. Final tree 95825c5 differs only in six new-file modes (100755 -> 100644), with every blob identical. Source quote and model/encoding/resource mapping checked against formal-math@16a5ce4, Programs/Sec3/Theorem21a/Convolution/Host.lean:60-87. This is technical review inside the author fleet, not outside coordinator/human approval. Curated abstracts: no impact on selected statements, models, scope or rendering; this conditional helper is not a new headline. Outside coordinator review is required. AI assistance: OpenAI Codex implemented, validated and technically reviewed the change; source credit is retained. * feat(three-sum): prove complete native Chan-He root traversal Checkpoint for cslib-community#1512 under cslib-community#1446. Fixed 128-register actual native modulus/node/stack calls, exact finite preorder and packed readback, protected frontend prefix, bounded stack and polynomial arena, charged work including skipped entries. Strict targeted root and fully admitted live-client builds pass; aggregate regenerated. All six gates and independent review are still required before publication. Full forest/State.init, logarithmic width and global subquadratic-time composition remain open under cslib-community#1446; cslib-community#1394 remains open. Original code and proofs assisted by OpenAI Codex. * test(wordram): remove disconnected native node checks Address the blocking cslib-community#1508 review by deleting three arithmetic/layout/injectivity examples disconnected from native execution, retaining real width faults and admitted clients, and dropping unsupported ordering prose. Native code and public library contracts are unchanged. AI assistance: OpenAI Codex. * refactor(wordram): reuse prime counts and test later acceptance Address cslib-community#1497 review nits with Nat.primeCounting and Nat.count APIs in place of private duplicate helpers. Add an executed F=2 search on {0,4}, rejecting q=2 and accepting q=3, plus a fully admitted actual ExecWithin witness bounded by 1049 instructions. Native programs and public library statements are unchanged. Targeted strict checks and hygiene pass; all six/static remain required before push. AI assistance: OpenAI Codex. * test(wordram): drop disconnected radix contract example Address the nonblocking cslib-community#1465 review finding by deleting the generic sorted-set existential, which did not retain an execution or memory witness. Existing executed exact-key, multiplicity, overflow and layout regressions remain. Native code and public library contracts are unchanged. Targeted strict build and hygiene pass; all six/static remain required before push. AI assistance: OpenAI Codex. * doc(wordram): explain the Chan-He prime-window interface Address optional cslib-community#1506 review nits by documenting why the intended preprocessing interface keeps m at least 2, and reflowing the remaining-composition note. Native code and public theorem statements are unchanged. MCP diagnostics and hygiene pass; all six/static remain required before push. AI assistance: OpenAI Codex. * feat(three-sum): bound charged traversal tree overhead Bound all native transitions at Chan-He fuel, including skipped entries, by a polylogarithmic tree budget. Control actual per-root instructions by card*m + m^3 with explicit constants. Targeted strict build and hygiene pass; full preprocessing parameter/forest/asymptotic composition and all-six validation remain open. AI assistance: OpenAI Codex. * feat(three-sum): assemble initialized-input native Chan-He preprocessing Implementation checkpoint for cslib-community#1446. Assemble actual native frontend/parameters, prime table, stack/table reservations and descriptor-driven root traversal. Prove canonical payload/admissibility/allNodes bridges and shifted magnitude size estimates; execute the complete empty-input program. Targeted strict checks and hygiene pass, aggregate regenerated. Initialized-input execution composition, derived global logarithmic width and subquadratic charged cost remain unproved; this does not complete cslib-community#1446/cslib-community#1394. AI assistance: OpenAI Codex. * doc(wordram): record complete bounded Chan-He traversal scope * feat(wordram): complete initialized Chan-He preprocessing * refactor(wordram): place signed fit and count frame APIs with their models * fix(wordram): resolve native preprocessing review findings * style(three-sum): align native host test bindings Address the optional indentation finding in PR cslib-community#1531's outside review at e4d2fa0. Only three leading spaces change in the private probe_spec test; all non-whitespace source characters are identical. Native programs, public contracts, models and costs are unchanged. Validation: all six strict gates together, including global Axioms; actual-base changed-file lints, citation/simp hygiene, PR-name and diff checks. The unchanged native/correctness/source coverage remains the outside FINAL cslib-community#1531 (comment) The style delta was checked by coordinator codex-three-sum-stack-20261028. Curated abstracts: no impact on statements, scope or rendering. AI assistance: OpenAI Codex prepared and validated this style-only correction. * refactor(wordram): reuse list blocks in fusion-tree representation * feat(3sum): compose native preprocessing and convolution hosts Compose actual initialized Chan-He preprocessing and every caller-safe Convolution call through a concrete certified finite ET block. Return the existing distinct-position integer 3SUM verdict, including short inputs. Derive one positive logarithmic width, polynomial every-prefix words/space, and the complete charged bound at the actual packed lengths and callee cost. Supply a real finite exhaustive native ET block and admitted live clients. Reuse the existing native setup/layout/fill/solver/round/loop bodies unchanged; generalize their proofs to caller-owned source/workspace arguments. Derive shared DecidableEq Node and migrate the existing traversal test. Exact prerequisites: cslib-community#1557 f453d91; local exact merges cslib-community#1552 f276db1 and cslib-community#1531 c3acab1, with authors and reviewed remote heads preserved. Source pin: anthropics/formal-math@16a5ce4. Underlying finite reductions/builders retain Anthropic credit. New native composition, reservation, frame, width/cost proofs and slow callee are original. Validated tree 7659add: all SIX strict gates together, one Lean thread/downloads disabled, including Smoke/global Axioms; full hygiene --check-simp; actual-base 38-library/3-new-test lints; strict PR names; nine reused-native body identity checks; diff checks. Curated abstracts have no impact. The fast backend and final 1.9992 endpoint remain cslib-community#1394. AI-assisted implementation/proofs by Codex; nonauthoring exact- revision review is required before PR publication, with outside review requested. Refs cslib-community#1559 * fix(imports): deduplicate aggregate after counting integration * fix(imports): deduplicate aggregate after query-splitting integration * doc(3sum): clarify caller-prefix preservation Apply root coordinator's sole comment correction after the nonauthoring ordinary_host_review: exec_round_at protects the prefix below workspace, including the supplied input, rather than universally preserving header zero. All comment-free tokens match reviewed e1858e0. Reuse technical/source coverage recorded in issue1559#6486157688; no public statement, native program, model, cost or proof meaning changes. Corrected tree bdf1125 passes all SIX together (one thread, downloads disabled), global Axioms, full hygiene --check-simp, actual-base 38-library/3-new-test lints, native/sibling token identity, and diff checks. Curated abstracts remain unaffected. Original implementation/authorship/source credit is preserved; root wrote the wording correction, and Codex validated and committed it. Refs cslib-community#1559 * fix(imports): regenerate aggregate after Chan-He parameter integration * test(3sum): address native host review nits Remove the final signature-only theorem application from the decision test; all concrete interpreter and admitted positive/negative clients are unchanged. Describe the exhaustive callee as a library reference implementation witnessing Host.Callee, and identify the umbrella module's re-exported API. Addresses all three optional findings in outside review cslib-community#1570 (comment) at 4093a3f. This validated coordinator fix is documentation/test-only. Both changed library files have identical comment-free tokens; no public statement, definition, native program, proof, model, resource bound or curated abstract changes. Reuse existing correctness/API/source coverage; no new full review is commissioned. Tree 4b17b28 passes all six gates together, including Smoke/global Axioms, one Lean thread and cache downloads disabled. Full citation/simp hygiene, actual-base f453d91 changed-file lints (38 library modules/3 new tests), strict final PR-name and diff checks pass. Library token identity and exact test-deletion audit pass. AI-assisted coordinator fix by Codex. Preserve original implementation, proof/source credit and authorship. Full fast backend/exponent 1.9992 remains open in cslib-community#1394. Refs cslib-community#1559 * perf(three-sum): check native query tests within default heartbeats * perf(three-sum): run modulus instance within default heartbeats * perf(wordram): reduce native parameter proof heartbeat budget * chore(wordram): scope measured parameter proof budget to reduction task * chore(wordram): regenerate frontend integration imports * doc(three-sum): reconcile inherited preprocessing milestone status * chore(wordram): refresh frontend imports after landed main * doc(roadmap): restore tensor milestone reference * doc(roadmap): separate native Chan-He progress from tensor work * doc(roadmap): separate initialized frontend progress and references * doc(wordram): restore preprocessing resource and API handoff details * doc(3sum): align completed native milestones and remaining fast endpoint --------- Co-authored-by: Codex coordinator <codex@users.noreply.github.com> Co-authored-by: Samuel Giuseppe Schlesinger <sgschlesinger@gmail.com>
Queue-conflict refresh at
4b2d75ce50dbca1101868ed3726170770d0a3e77ordinarily merges actual main62b935439. All five own library/test blobs are byte-identical to reviewed8a81617e; Parameters 300000/#1583 remains unchanged and the obsolete geometry allowance stays removed. The generated aggregate exactly lists the actual 2563 modules. Full hygiene (--check-simp, including allowance staleness) and diff checks pass; no new proof or repeat local build. Read-only projection against queue prefix5fb14df1is clean, with no temporary queue ancestry imported. Fresh hosted CI is running; independent integration review is requested, reusing prior mathematical/resource approvals. Original source credit, selected abstracts and the open #1394 endpoint are preserved. Coordinator:coordinator-codex-queue-20261028-ready-c.Part of #1446; closes #1458 after integration. Depends on reviewed #1456; the integration base is now main. Full native preprocessing and the deterministic distinct-position integer 3SUM exponent 1.9992 endpoint remain open in #1446/#1394. Prime searches, heavy subsets, frontend/recursion/output and full composition remain parent-owned; radix/dedup remains #1452.
For each fixed κ, one native unsigned WordRAM program reads the actual unsigned input-length header and computes U=(n+2)^κ and exactly the existing labelBits(2U), height, fuel, wPar n (2U), mPar n (2U), packed length 8m², and padding magnitude 4U+1.
Parameters.Outputidentifies registers 0–8; all memory is preserved. The program has 24 registers and κ+71 structured instructions (the assembled halt adds one), independent of n and word width. Powering, floor/ceiling logarithms, successive squares, copies, setup, loop tests and jumps are charged native instructions. There is no parameter advice or assumed arithmetic routine.Parameters.runs_inputstarts fromWordRAM.State.init (input.map Signed.encode). For |x|≤(n+2)^κ, width(20κ+121)*Nat.clog 2 (n+2)derives input fitting and every local fit premise. It is positive at n=0 and κ=0. The native run takes at most5*Nat.sqrt n + (400κ+3000)*Nat.clog 2 (n+2)instructions, excluding the final halt.Math.budget_polynomialbounds the common arithmetic budget by(n+2)^(20κ+120);intermediates_polynomialbounds every register and memory word of every canonical-width run prefix by(n+2)^(40κ+242). Constants are deliberately coarse. This is a complete parameter implementation, not the full preprocessing theorem.The programs and proofs are original, credited to Erik Demaine. They reuse the existing mathematical Chan–He definitions rather than re-formalizing a cited theorem. The read-only source comparator was
anthropics/formal-math@16a5ce41304fcdaea4e0be7c132e1c361dc26da5,ThreeSumApsp/Programs/Sec3/Theorem21a/ChanHe/Parameters.lean; no Light machine or source execution is imported or simulated. Here n is the actual list length, U is its original polynomial magnitude bound, and 2U is the existing distinct-position frontend bound. Integer inputs use the existing sign-and-magnitude encoding; outputs and the length header are ordinary unsigned words.Reuse:
WordRAM.Code,ExecWithin.loop_invariant, register renaming, native assembly/execution,Signed.encode, and the existing Nat.log/Nat.clog/Nat.sqrt and Chan–He definitions. New definitions describe concrete programs, their register/output contract, and explicit bounds; no parallel RAM or 3SUM model is introduced. The neutral numeric helpers are independently reusable.Validation on restacked 0505439: all six strict gates passed together via
LEAN_NUM_THREADS=1 COMPLEXITYLIB_CACHE_AUTO=0 scripts/check.sh(strict build, aggregate imports, strict tests/global axiom audit, lint, style, init imports). Hygiene with--check-simp, changed-file lints against corrected base a712205, andgit diff --checkpassed. Executed examples check n=0,1,2, κ=0, a nonconstant magnitude exponent, both signed boundary values, all nine outputs, exact instruction counts and input memory; a checked native input-init client discharges width/magnitude hypotheses. The corrected PrimeWindow header is inherited through the repaired base. The requested non-terminalsimpis now an explicitsimp onlylist obtained from Lean; the ceiling-logarithm title/output comments are corrected. Every public statement, definition and program is unchanged. Three neutral/source-test files are byte-identical to the original revision; the two other files differ only in that proof and documentation. The announced rebase uses exact old-head lease e871cdc. Refreshed CI and outside delta-review remain pending. Abstract assessment: no impact on selected headline statements, definitions or scope; no catalogue or PDF changes.Review: nonauthoring agent
/root/review_native_parametersapproved the original e871cdc source payload (recorded in the PR). Its mathematical/API conclusions are reused for this statement- and definition-preserving proof/doc repair. This is within-fleet agent review, not outside or human approval. The outside review requested the inherited header repair and proof hygiene fix; both are now addressed. Fresh coordinator delta-review is requested from @SamuelSchlesinger. No author approves or merges this work.Integration convention: this PR uses (n+2)^κ, whereas ChanHe/Sizes.lean's lenOf and polynomial bounds currently use n^κ with n≥2. PackedLen is consequently not literally lenOf κ n. The generic-U correctness/magnitude results are available, but full #1446 still needs the (n+2)^κ size/asymptotic bridge, including small n; this is recorded in #1446.
AI assistance: OpenAI Codex implemented, checked and self-reviewed the original change. Coordinator refreshes by
coordinator-codex-queue-20261028-tests-band the measured-budget follow-up bycoordinator-codex-queue-20261028-ready-cpreserve original Erik Demaine source credit and the open #1394 objective. Agent review is not human approval.