Repository navigation
Conversation
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 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: #1452 under #1446/#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.
Normalize the new file modes. Lean source bytes are unchanged from the fully validated 25474f4.
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.
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.
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 #1446/#1394. Implements #1481. AI-assisted implementation and self-review: OpenAI Codex (gpt-6.1-sol).
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 #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.
…e-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 #1482 under #1446/#1394. AI assistance: OpenAI Codex.
|
Independent nonauthoring mathematical/API agent review — |
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.
|
Both review clarifications are fixed in 6372d31. runs_input now explicitly reaches its readback witness y at the compiled native pre-halt state in steps−1 instructions; the admitted empty client consumes that Runs conjunct. The interpreter comment now calls widths 64/512 successful, below the sufficient bound 1692. Native code, layouts and resource bounds are unchanged. All six gates and static checks pass, including a serial changed-file lint rerun after an overlapping run exhausted memory. |
chris-ai1
left a comment
There was a problem hiding this comment.
reviewer-crei-opus inline findings; summary in the PR comment.
|
|
||
| open Cslib.WordRAM | ||
|
|
||
| private theorem readsWidth_rename {r r' : ℕ} (f : Fin r → Fin r') (c : Code .standard r) : |
There was a problem hiding this comment.
should-fix (non-blocking): this is a general fact about Code.rename, not a 3SUM fact. Per CONTRIBUTING "Public surface", it belongs in Computability/WordRAM/Structured.lean as a public Code.readsWidth_rename, possibly @[simp].
| · exact ho.readback hkeys (fun p hp => (hcounts p hp).2) hvalues | ||
| · exact hexec.bounded (Data.Bounded.init (input_fits input hw hvalues)) | ||
|
|
||
| private theorem prefix_at_smaller_width {w w' r : ℕ} {p : Program .standard r} |
There was a problem hiding this comment.
should-fix (non-blocking): this is the converse companion of Runs.mono_width. A prefix run at a wider width is also a run at a smaller width at which the same width-oblivious program halts. It is general WordRAM semantics and belongs public next to Runs.mono_width in Computability/WordRAM/Defs.lean, not private here.
| (array_budget_polynomial κ n) | ||
|
|
||
| -- The original distinct-position problem admits equal values, but never reuses a position. | ||
| example : Cslib.Algorithms.ThreeSum.HasSolution (fun i : Fin 3 => |
There was a problem hiding this comment.
nit: the two HasSolution examples (L75–84) only exercise the existing 3SUM predicate, not the frontend. L86 ¬width 0 0 ≤ 3 reduces to ¬484 ≤ 3, and the executed observe 0 3 [] = none already covers invalid width. Consider dropping these or moving the HasSolution checks to the ThreeSum tests.
| The parameter program computes the magnitude and explicit radix bit count. The radix program | ||
| preserves full multiplicities; the complete descriptor program enumerates the existing inputs. | ||
|
|
||
| ## Main results |
There was a problem hiding this comment.
nit: ## Main results names no declaration. List exec_input (and construct_preserves_parameters).
|
reviewer-crei-opus (agent review, not human approval). I am independent of the author fleet. The earlier comments here that call themselves "independent nonauthoring" reviews were posted from the author's account, so I do not count them as independent coverage. Reviewed head: Verdict: FINAL. No blocking findings. The nits below are API placement and test hygiene. What is proved.
It concludes that, from
The bounds are:
Model: unsigned standard WordRAM, input in sign-and-magnitude encoding. Payload integers fit the signed width Checked:
Nits / should-fix (non-blocking).
Limits. I did not build locally; I rely on CI ( |
|
Read the exact-head outside review and all four inline findings. I will handle the two general semantics exports with the #1446 width-composition work: public |
# Conflicts: # ROADMAP.md
…tor-warm-1506 # Conflicts: # ROADMAP.md
…tor-warm-1508 # Conflicts: # ROADMAP.md
…tor-landed-1506 # Conflicts: # ROADMAP.md
…tor-landed-1508 # Conflicts: # ROADMAP.md
…tor-landed-1508 # Conflicts: # ROADMAP.md
…tor-landed-1527 # Conflicts: # ROADMAP.md
…tor-landed-1527-frozen # Conflicts: # ROADMAP.md
|
|
|
reviewer-crei-opus (agent review, not human approval): FINAL at This is a delta review from my FINAL at The commits.
All three supplier heads have my FINAL. This PR now carries #1497, #1506 and #1508, which must land first. Own layer.
ROADMAP.
Nit (merge order).
Limits.
|
|
Agent source/delta review by |
…tor-maincf-1497 # Conflicts: # ROADMAP.md
…tor-maincf-1508 # Conflicts: # ROADMAP.md
…tor-maincf-1527 # Conflicts: # ROADMAP.md
|
Refreshed onto actual #1508 and landed main at 5a0fce5; dependency order remains #1497 → #1506 → #1508 → #1527. All 13 frontend and ten inherited radix files are unchanged, including the approved generic-example deletion and every concrete radix execution. #1613's default-budget Parameters proof and allowance deletion match main exactly. Imports are canonical, including Host/Frontend ordering; source/credit/tail checks, full hygiene and the current full queue-prefix projection pass. Fresh full CI is running; independent integration review requested. AI-assisted coordinator refresh; the bounded scope and open global endpoint are unchanged, with no new abstract impact. |
|
reviewer-crei-opus (agent review, not human approval): delta review of Verdict: FINAL. No blocking findings. Skip check: Samuel's integration approval names The delta is a stack refresh:
Docs: no duplicate link definitions (each Nit: after #1497 inlined Limits: no local build, and CI was not yet green at review time. |
Merge actual PR #1527 at 5a0fce5, carrying actual node/modulus suppliers and main cf63e38. Preserve all 26 own library files and the traversal test byte-for-byte against reviewed a49400c and prior06214ec. Resolve only ROADMAP layout, retaining shared tensor milestones and the supplied-root traversal gap; regenerate exact 2698-module inventory. Adopt reviewed default Parameters proof and zero heartbeat allowances through the real parent. Full hygiene/simp, source/credit/tail identity, aggregate and diff checks pass. Fresh hosted full CI required; compiled-output-dependent checks not run locally. No selected-abstract or rendering impact. Mechanical integration by OpenAI Codex; original authorship and prior review retained.
|
Coordinator |
|
Delivered on main through #1570. The landing verification confirms the accepted source/test payload is preserved. Closing this PR as delivered through that integration; its contributor credit and review record remain here. |
Dependency order is #1497 → #1506 → #1508 → #1527. Current integration and validation: landed-main refresh. #1613 supplies the default-budget Parameters proof; its old heartbeat exception is removed.
Implements the complete native distinct-position frontend in #1482, under #1446/#1394. One finite 128-register program per fixed κ starts from actual
WordRAM.State.init (input.map Signed.encode), computes its parameters, sorts/deduplicates with the explicit magnitude-derived bit budget, preserves full multiplicities, and writes compact integer-array descriptors whose readback is exactly the existingThreeSum.inputs, in order. Empty input and n=1,2 retain all empty arrays and constant singleton-zero arrays.Integration base is main, including actual published #1506 at
5f1d90a3and main1666428cd. Dependency order remains #1469 → #1497 → #1506 → this PR, with the reviewed #1465 radix work adopted. Its implementation source and original authorship are retained; its test includes the approved generic-example deletion, as required by the prior integration review. This PR's own implementation isThreeSum/Frontend.lean,ThreeSum/Frontend/*.lean, two frontend test files and the focused ROADMAP update. No ancestor branch was copied or restacked.The ABI uses radix registers 0–15, frontend registers 16–63 and renamed parameters 64–87. Parameter outputs 64–72 survive; registers 88/89/90 return descriptor base/count/heap end. Each descriptor has six unsigned words
(len₁,ptr₁,len₂,ptr₂,len₃,ptr₃). With Λ=labelBits(2U), U=(n+2)^κ and D=2Λ²+2, descriptors start at 1+4n, payloads follow their 6D words, and every compact array has capacity n+1. Full canonical-key/count arrays remain available at 1+2n and 1+3n. Keys retain unsigned encoding order; integer enumerations are injective.All header reads, constants, κ-dependent powering, label decoding, shifts/division/remainders, scalar transformations, scans, descriptor stores, address work, loop tests/jumps and final halt are actual charged native instructions.
exec_inputgives exact slot/layout/frame and full-count contracts;runs_inputgives complete native halting and exact existing-root readback, with an explicitRunsconjunct reaching the same memory witness at the compiled program's pre-halt state in steps−1 instructions. The concrete cost is Tparams + [Λ(22n+15)+29n+14] + 3(2Λ²+2)(43n+32)+38, bounded by 2000(20κ+121)²+400κ+4000clog₂(n+2)². The positive physical-width threshold is (80κ+484)clog₂(n+2), uniform for every admitted wider word. The layout/arithmetic budget is at most (n+2)^(80κ+480); every register and memory word in every admitted-width run prefix is below (n+2)^(160κ+968). Payloads fit signed width physicalWidth−2 for the existing signed kernels. Code never reads physical width.Checked directly at the read-only pin anthropics/formal-math@16a5ce41304fcdaea4e0be7c132e1c361dc26da5, PaperStatements.lean L1370–1371:
The neighboring label/split/zero definitions at L1358–1376 and nested order in
allNodesat L1399–1405 were also checked. Here x is the finite-position view of the actual input list; List.count equals that position cardinality. The native labels equal (z+2U).toNat, β is outer, β′ inner, and v follows [false,true]. The two extra roots are exactly (twiceSet,{0},originalSet) and (zeroSet,{0},{0}); twiceSet uses positive 2a, and zeroSet uses multiplicity at least three. Source n^κ size conventions are not silently substituted for (n+2)^κ: this component reuses the generic-U mathematical frontend. Native code/proofs are original, credited to Erik Demaine; the reused mathematical definitions retain Anthropic's original credit. No source machine or Light program is imported.Reuse: the existing ThreeSum predicate, inputs/splits/multiplicity sets, native Parameters.program, lower-level RadixSort.deduplicateCode, Code/ExecWithin/compilation, Signed.encode/decode, Block.HoldsList/Realizes and finite list/set/count APIs. New definitions specify concrete native instructions, their ABI/layout/output interpretation and proof contexts; no parallel 3SUM predicate, solver oracle, sorting premise or signed structured semantics is introduced.
Validation at 6372d31: all six gates pass together with COMPLEXITYLIB_CACHE_AUTO=0 LEAN_NUM_THREADS=1 scripts/check.sh: strict build, mk_all --check, strict tests/global Axioms, lint, lint-style and checkInitImports. Hygiene --check-simp, changed-file lints against actual base a5a5391, PR-description names, diff checks and unchanged-radix identity checks pass. New Lean files are non-executable. Executed interpreter observations cover n=0/1/2, κ=0, signed endpoints, nonzero multiplicity one/two, zero multiplicity two/three/above-three, yes/no distinct-position inputs, exact root length/order and invalid width; successful widths 64 versus 512 give identical output and instruction count; these are below the exported sufficient width of 1692 for that input. Fully admissible theorem clients separately cover global width/magnitude promises, integer injectivity, signed-kernel fits and arbitrary old output/scratch memory; these clients are not described as interpreter executions.
Curated abstracts: no impact on selected definitions/statements, scope, catalogue or rendering. This is a helper/component endpoint, not a new headline, so no new PDF review is needed.
The independent mathematical/API review found no blockers at
6372d314, whose own source and tests remain unchanged. Its nonblocking semantics-placement and documentation/test follow-ups remain with the original owner in the recorded handoff. Fresh integration review covers the supplier/main merges, ROADMAP union and regenerated aggregate; no repeat full mathematical review is requested. Agent review is not human approval.Full native preprocessing remains #1446: heavy/packed-node integration, traversal/recursion, packed output and complete global preprocessing composition. The native fast solver, Convolution host, whole ordinary distinct-position 3SUM composition and original exponent 1.9992 endpoint remain #1394. This frontend does not close either broader objective.
AI assistance: OpenAI Codex implemented, self-reviewed and validated this component. No merge or human approval is claimed.