Repository navigation
feat(ExactTriangle): implement concrete native minimum-count prime selection - #2124
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 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.
Internal #1701 source checkpoint, not the complete counter or #1394 endpoint. Native residue calls charge23*n²+8 including argument delivery and preserve original metadata/outside memory. Actual scan cell charges20, full scan22*n²+4; exact original row-major coefficient readback yields existing countZeroMod. Its nonnegative coefficient bound derives unsigned extraction and all prefix accumulator fits; no answer or execution oracle. General integer negated-residue lemma lives in Int.Residue. Count code is factored into a stage with the same actual operations. Current pinned20e dependencies: targeted Lean MCP clean for Int.Residue, Extraction (via ScanReadback), ScanCell, Scan, ScanReadback, ResidueArray and the complete existing WordRAMCountPrime initialized/interpreter regression module. Initial MCP server timed out after cold preparation; no old worker survived; targeted command-line fallback reached source errors, which were resolved through restored MCP. Optional bootstrap permission failures and failed checkpoint log retained in tmp/native-countprime-3dda8289. No aggregate/import generation/global static/all-six run or independent review. Remaining: complete caller/State.init composition, original-input width and independent-W polynomial prefix/support, full charged subcubic-in-n polynomial-in-p bound.
Internal #1701 source checkpoint. CountPrime.exec now starts with only original runtime scalar/pointer registers and canonical signed AB/BC/AC arrays. Actual logarithm/layout, three signed residue calls, computed spread table, both padded monomial matrices, complete native seven-product Strassen and raw selected count are composed without layout/table/multiplication/run/time oracles. Arguments remain128-bank64..69, rawresult70; original arrays and outside explicit dirty workspace/stack survive. Numeric signed/address admission is in original dimensions/pointers/weight bound; initialized/log-width/wider-prefix/subcubic envelopes remain next. All new setup, three-residue, both-matrix, solve, complete tail and original-caller execution modules have clean targeted Lean MCP diagnostics on pinned20e dependencies. Existing complete WordRAMCountPrime actual native interpreter/kernel regressions are clean after code-stage factoring. Whole preserved Strassen execution elaborated under the new pin. No aggregate/import generation/static/all-six or independent review; no completion claim for1701/1394.
Development checkpoint for #2098, not completion of fast prime selection or #1394. exec_of_count composes actual square-test enumeration, real trial division, the finite counting call, strict-minimum updates and candidate advance. An explicit execution law for count counter is a premise of this component rule, not an assumed endpoint: it must still be discharged with #1701's concrete modular counter. The law includes the actual six argument copies, fixes original dimensions/pointers, preserves a caller-chosen memory predicate and returns the mathematical score. The final algorithm cannot rely on a supplied answer, run or time oracle. Proves actual execution within (sqrtD+1)*(T+7sqrtD+20)+10 before halt, an attained score minimum over the existing Nat.sqrtPrimeWindow, found=1, preserved original inputs/workspace/upper caller registers and retained memory predicate. Numeric controller admission is explicit Fits w (4(D+2)^2+4). The private minimum invariant distinguishes uninitialized flag from genuine zero score, skips ineligible candidates, composes the actual keep code and closes the entire window at the square-loop exit. The counter remains fixed finite code in low128, selector160 registers, +50 flat slots, existing64..69/raw70 ABI. setup/advance factoring changes no native instructions. Fresh Lean MCP diagnostics are success=true/partial=false/no items for the affected Program, Keep, Frame, Minimum, Step and Loop modules plus the complete updated WordRAMPrimeSelection tests at pinned main20e/cslib254e30e6/mathlib69552756/Lean4.36rc2. Existing Trial targeted check remains valid. The test contains a fully discharged explicit constant-score callee client from actual State.init[999], native setup/trial/call/selection, same-y flat prefix and halt, all-word boundedness and sentinel/full-memory preservation within287 charged total instructions. This is a nonvacuity client for the component rule, NOT a modular-triangle counter. All earlier improving/tied/endpoint/empty structured-interpreter regressions pass. Resolved local proof/parser/import/header/style findings before this checkpoint; no incomplete Lean source remains. Targeted hygiene--check-simp and staged diff checks pass. No aggregate generation, all-six/global-Axioms/environment/name audit, independent review or PR. No closed concrete-counter instantiation, original-input complete selector/log-width/prefix/support/subcubic theorem, global parameters/small cases or final ordinary3SUM1.9992 claim. Full #2098/#1701/#1394 remain open. Next: actual CountPrime caller law and uniform window bounds, source-derived admission/space/prefix bounds and closed original-input/flat endpoint, then final validation/review. AI assistance: OpenAI Codex; all current checks are author-side, not independent review.
Source-complete #1701 checkpoint. Fixed128-bank standard program from raw(n,p) and3canonical signed matrices returns existing countZeroMod. Complete caller/State.init/same-y prefix/halt semantics and original arrays/outside dirty-workspace frame. Every setup/residue/index/table/padding/coefficient/Strassen-stack/copy/control/return/scan/halt instruction is charged: <=3704*(p+1)^2*(n+1)^(281/100). Runtime p factor remains explicit. Original p,A<=(n+2)^kappa imply sufficient physical width(kappa+24)*clog2(n+2), guaranteed input fit, and all wider prefixes have words/support below(n+2)^(kappa+25), independent of physicalW. No multiplication/layout/table/count/run/time oracle. Targeted Lean MCP clean for the complete umbrella, every new execution/width/prefix/time module, existing signed-array/Strassen/counter interpreter+kernel tests, and new fully admitted initialized clients: positive false-positive736steps, negative1454, signed asymmetric positive-depth4596, empty412, modulus-one354, and aliased-source dirty caller726prehalt with outside sentinel. Same-y Runs and charged halt are connected. Pin20e dependencies; bootstrap/initial failed target/MCP restart logs retained. Eight primary-source files verified byte-for-byte against pin16a5ce41304fcdaea4e0be7c132e1c361dc26da5; exact countOf_eq quote/locators checked. Source packet tmp/native-countprime-3dda8289/counter-{source-mapping.json,pr-body.md}. Canonical imports, final full static audits, hosted six gates and required fresh whole-layer nonauthoring review remain pending root coordination. No new-head all-six or review approval claim. No selected abstract/catalogue/rendering impact. Full1701 awaits validation/integration; prime selection2098, global ET/ordinary-host composition and1394/1.9992 remain open. AI assistance: OpenAI Codex. Original Anthropic credit retained; original4419 checkpoint preserved.
…ction LOCAL unvalidated source checkpoint for #2098. Prepares actual counter-call composition, uniform modulus budgets, a no-oracle caller selector endpoint and reuse of the actual9-instruction header plus6 copies. No new targeted Lean, imports/static audit, six-gate, independent-review or PR success is claimed; #1701 currently holds sole import/static slot. Previous checked component6b4068c3 is preserved. Resolve/check this source after explicit slot handback; full initialized admission/prefix/resource and #1394 remain open. AI assistance: OpenAI Codex.
Register 67 canonical imports for the source-complete #1701 counter at 61c82f6. No library/native/proof/test/doc source changed after that checkpoint. Final source tree including modes: 86adfee; pinned main20e3ba720ca7939a2ab65c1ada315d547551524e. Final validation: strict scoped --wfail/--iofail build of all69 changed library modules and4 tests PASS; the native counter umbrella environment lint covered all69 modules/1404 declarations and passed, and4 separately run test environment lints exited0. mk_all --check, full hygiene --check-simp, 6 strict PR-body names, complete base/staged/unstaged whitespace, and changed69-library/4-new-test documentation/restatement checks PASS. The standard changed-file driver encountered an unrelated missing global WordRAMUniformProbing.ilean; its unmodified checks passed with fresh own outputs and the available root inventory. No cold unrelated build was run. The redundant multi-root library lint remainder was stopped by exact owned PIDs after complete umbrella coverage passed, under resource pressure; its full-command successful exit is not claimed. Logs/dispositions preserved under tmp/native-countprime-3dda8289/final-*. No full-local-six claim: hosted exact-head CI must supply all six before integration. Source/supplier audit: 36 retained Strassen/array modules exactly match preserved4419; five native cyclic-kernel modules and its test exactly match landed20e; eight primary source files match pinned Anthropic Git blobs at 16a5ce41304fcdaea4e0be7c132e1c361dc26da5 and the countOf_eq quotation was checked. All76 changed paths are100644; policy/toolchain/dependency pins and abstract catalogue unchanged. No abstract/rendering impact. Fresh root-arranged whole-layer review is in progress; its bounds/width subreview approves61c82. Root reserves two nonblocking finite-source locator-only doc corrections after handoff. No review/integration approval or PR publication is claimed by this author. The actual fixed128-bank program computes existing countZeroMod, with original signed inputs/dirty caller frame, actual State.init and same-y prefix plus halt, charged <=3704*(p+1)^2*(n+1)^(281/100), original-input logarithmic width and physical-width-independent polynomial prefix support. The quadratic p dependence remains explicit. Selection2098 and global ET/ordinary-host/full1394/1.9992 composition remain open. AI assistance: OpenAI Codex; retained original Anthropic source credit.
Coordinator fixes the two optional source-reference nits from the independent whole-layer review of 61c82f6. Only two module-doc line ranges change: recurrence 81-96 and block identity/proof 105-126. No declaration, proof, native instruction, attribute, test, import or source-credit change. The parent 7bc9b1c adds only canonical imports to the reviewed source. Targeted/scoped compilation and audits remain recorded in that commit. Exact-head hosted six-gate CI remains required before integration; this documentation-only commit claims no new full local validation. Independent whole-layer review: #1701 (comment) AI assistance: OpenAI Codex.
Normal merge of pinned current main bc2e6c2 into approved source 02a7822. Git merged the aggregate and ROADMAP automatically; no manual conflict resolution. Identity audit: all 69 own library files and four tests are byte/mode-identical to the reviewed revision. Every other main source is retained exactly; only the canonical aggregate and preexisting counter ROADMAP/UPSTREAM additions differ from main. The 103-module local dependency closure of the counter and representative clients has no source delta. Aggregate imports exactly match the sorted 3586-module tracked inventory. Targeted MCP: counter umbrella, initialized execution tests and Strassen clients all clean (no errors/warnings/partial). Canonical mk_all --check, full hygiene --check-simp, body-name audit and staged diff --check pass. No full local validation rerun; hosted six-gate CI is required on this merged head. Original full six-gate coverage remains run41251234639 at 02a7822. Carry forward the independent whole-layer approval and locator/import delta approval only for the identical counter source. No new math/API/attribute or automation changes are introduced here. Full #1394 remains open. AI assistance: OpenAI Codex coordinator integration.
…selection Complete #2098 source on exact counter PR prerequisite4027bd980. The actual 160-register standard program enumerates the existing prime square window with native trial division, invokes the entire native cyclic-Strassen counter on original canonical signed matrices, and returns an attained minimum. Original arguments, dirty workspace and outside-source frames are derived; there is no supplied counter/run/time/prime-list/layout oracle. Generic caller plus actual15-instruction header yield original State.init prefix and charged halt in the same final state. Flat code<=32824 slots, no width reads. D>=16 suffices even for empty matrices or D>n. For D<=n, kappa>=1 and original weights<=(n+2)^kappa, positive sufficient physical width (kappa+30)*clog2(n+2) admits every wider execution; all successful prefix words/support are below (n+2)^(2*kappa+60), independent of physical W. Complete charge including header/halt <=3704*(sqrt(D)+1)^3*(n+1)^2.81 +42*(D+1); D dependence remains explicit. Existing IsSelectedPrime directly supplies the finite false-positive bound. Native tests prove actual update, stable ties and empty behavior; admitted clients connect actual State.init to selected prime3, exact count0, frame and the real source-regime FP theorem. Reuse the counter private numerical-admission proof by exporting it as CountPrime.admission_fits in its existing Width topic module and migrate its one internal client. Old counter public statements/programs remain unchanged. New modulus-budget monotonicity lives beside the actual counter/Strassen budgets. Abstract/catalogue/rendering unchanged. Source adaptation checked against Anthropic pin16a5ce41304fcdaea4e0be7c132e1c361dc26da5 ChoosePrime bytes17572 SHA256e9e7e9b8f8947d36043d8b1b8445a29d2ce90a004b2b88d8714f8701c1ec7280. chKeep/chRound95-107 policy reused; trial enumeration replaces the source prime-list producer109-118 and all native costs are independently proved. Validation at source checkpoint: targeted MCP checks clean through complete caller/header/input/width/flat/source/time composition and full initialized native test module, including actual kernel/VM clients. Canonical imports generated and check passes; hygiene--check-simp and full diffs clean. Source proof errors during development were fixed before these final diagnostics. Fresh whole-layer nonauthoring review, final scoped/static audit and exact-head hosted six-gate CI remain required. No local full-six claim. Global parameter/small-geometry/outer ET/ordinary-host composition and full #1394 exponent1.9992 remain OPEN. AI assistance: OpenAI Codex.
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Non-author coordinator codex-algorithms-review2124-20261101, outside the separate codex-three-sum-stack-20261028 source-authoring session/fleet: APPROVE at 1c290ca. No blocking findings. This separately covers the new selector and its admission/monotonicity API; it does not extend #2133's parameter approval. I reused #2109's counter coverage after confirming that the only changed inherited library/test file is CountPrime/Width.lean: its existing numerical-fit proof is exported unchanged as admission_fits, and the internal client is migrated. Dependency pins are unchanged. The existing whole-layer source-side review is also recorded in the PR description.
The actual loop enumerates integers from two with p²<D, checks the closed lower endpoint D≤4p², and runs native trial division. Its attained-prefix invariant distinguishes no candidate from a genuine zero-count minimum; strict updates retain earlier primes on ties. The public concrete execution rule discharges the finite-code counting-call contract with the complete counter, including six real argument copies. The maximum-modulus monotonicity proofs justify one admission, cost and dirty-workspace frame across all calls; no prime list, primality oracle, approximate score or assumed counter run remains. I checked the private invariant/termination argument, register-bank frames, concrete composition, same-state initialized prefix/halt, and the pinned source's update/call policy. Square enumeration and native costs are proved independently of the source's prime-list producer and Light contracts.
The full charge includes trials, all counter calls, comparisons/control, header and halt: 3704*(sqrt(D)+1)^3*(n+1)^2.81 + 42*(D+1). This is an explicit unit-instruction word-RAM bound, not a bit-operation bound or a full subcubic solver claim. General execution requires D≥16 and permits empty matrices or D>n. Logarithmic admission/polynomial wider-prefix bounds additionally require D≤n, integer κ≥1 and original weights bounded by (n+2)^κ. Applying the existing finite false-positive theorem has its own stated 16≤D≤n, real κ≥1 and n^κ weight hypotheses. Modular counts and selection are exact; modular false positives are bounded only under that theorem's hypotheses.
I inspected both suites: actual-counter improvement from prime 2 to 3, signed ties, empty matrices, a fully admitted same-state selected-prime/count/input-frame client, the finite false-positive application, and separate controller endpoint/tie tests. Hosted CI passed all six gates; verified checkout 34847f20 has parents #2109/4027bd98 and this head, with exactly this head's tree. I ran no Lean, local build or interpreter checks. This is stacked-source validation, not a current-main restack claim. No abstract/catalogue/rendering impact. Global ET/parameter/small-case dispatch, ordinary-host composition, full ThreeSum and unrelated Schönhage claims remain outside this review. Agent review, not human approval.
|
Coordinator This is the shared usable-publication receipt for #2186, #2143, #2100 and #2124. The immutable first-started main 41360914511/job125011321306 executed exact #2098’s actual native minimum-count prime-selector objective is complete: enumeration/trial division, original arguments, actual counter calls and selected-minimum reasoning retain their explicit modulus, geometry, width and cost premises. #2133’s actual-parent gate is satisfied, but its fresh validation is separate. Ordinary bit costs, unrestricted small-geometry/outer-host composition, full #1394 and the tuned 1.9992 endpoint are not claimed. Original source credit is preserved; no selected-abstract change or remaining source/queue/publication hold for #2124. Agent coordination, not human approval. |
Merge actual main 37e23f9 after the counter landed as16fdf907. Retain all22 reviewed selector code/test entries exactly, including the reviewed admission_fits export after checking all73 parent payloads. Replay only the original selector documentation delta on current main and retain canonical imports and every unrelated current-main entry. Source/API review5729790153 and original source CI41267178644 are retained for their exact feature. This local checkpoint has static preservation and whitespace checks only; independent preservation audit precedes publication, main retargeting and fresh canonical all-six validation. AI assistance: Codex non-author coordinator mechanical merge; no new mathematics, public API, machine semantics or curated abstract change.
Implements the concrete minimum-count prime selector for #2098, stacked on #2109. One fixed 160-register standard WordRAM program reads raw
(n,D)and three canonical signed matrices, enumerates the existing square prime window using actual trial division, invokes the entire native cyclic-Strassen counter, and returns a prime satisfyingCslib.Algorithms.ExactTriangle.IsSelectedPrime. Original arrays and the caller frame survive dirty scratch reuse. No prime list, counting result, layout, execution or running-time oracle is supplied. The finite-code composition rule is discharged using the real counter.Cslib.Algorithms.WordRAM.ExactTriangle.PrimeSelection.runs_inputconnects actual State.init to one final state shared by its prefix, halt, selected prime and exact raw modular count. Header, trials, six argument copies, every counter call, comparisons/control and halt are charged. The complete bound is3704*(sqrt(D)+1)^3*(n+1)^2.81 + 42*(D+1); window dependence remains explicit. The code uses at most 32824 flat slots including halt and reads no physical width. General initialized execution requiresD≥16, permitting empty matrices andD>n. ForD≤n, integerk≥1and original absolute weights at most(n+2)^k, width(k+30)*clog₂(n+2)suffices for every wider machine; every such prefix has words/support below(n+2)^(2k+60), independently of physical width.The existing selected-prime theorem supplies the false-positive bound for
16≤D≤n, realκ≥1and weights bounded byn^κ; a fully admitted native client applies it to the actually returned prime. Tests also execute the entire real counter to check an improvement from prime 2 to prime 3, signed cancellation/ties and empty matrices. A kernel client ties selected prime 3, exact count zero and original-word preservation to the same actual initialized prefix/halt. Separate score-code tests isolate controller endpoint and tie cases.Source: selectively adapts the update/call policy of pinned chKeep/chRound. Native square enumeration and trial division replace its prime-list producer. The source's precomputed list/level and Light execution/cost contracts are not assumed. Original parameters compute all native bounds. The pinned source bytes/hash were checked; no quotation is introduced. Native instruction counts and width/frame proofs are original against the existing unit-instruction WordRAM semantics.
Reuse: the counter's existing private numerical-admission proof is exported as
Cslib.Algorithms.WordRAM.ExactTriangle.CountPrime.admission_fitsand its internal client is migrated; no duplicate fit proof or old public statement change. Small counter/Strassen budget-monotonicity topic modules provide the common maximum-modulus envelope. Existing prime/window/count mathematics, native trial division, register relocation, compilation and width-independence rules are reused. Counter #2109 source/review coverage is reused for unchanged implementation only; this PR's entire selector and the narrow public API delta receive fresh independent review.Validation: final targeted MCP checks pass through caller, initialized execution, width/prefix/time and both native/kernel clients. Canonical imports and hygiene/simp pass. Strict scoped compilation passes for the selector umbrella, both selector suites and the affected counter execution clients. Environment lint passes for the selector umbrella and both new suites. Unmodified changed-file checks pass for all 20 affected library modules and two tests on fresh scoped outputs; unrelated missing global artifacts were not rebuilt. Canonical imports, full hygiene/simp, strict description names and diff checks pass. Hosted CI passed all six gates at exact head
1c290ca70e7f48fbe4a380657a884c5457ddd49f. No redundant local full run was performed.Independent nonauthoring agent
/root/prime_selection_reviewAPPROVE at1c290ca70e7f48fbe4a380657a884c5457ddd49f, with no blockers or requested changes. The review inspected all 25 changed files, native execution/minimum/dirty-frame reasoning, concrete counter closure, initialized same-state prefix/halt, charges, width-independent prefixes, admission API migration, tests, reuse and actual pinned source. It reused the unchanged lower-layer review after identity checks. The reviewer ran no builds and claimed no validation beyond source review. This is agent review, not human or platform approval.This completes the selector implementation milestone, pending review/validation/integration. Global ET parameter choices, unrestricted small-geometry handling, aggregate/outer-host composition and #1394's full native 1.9992 endpoint remain open. No curated abstract/catalogue/rendering impact.
AI assistance: OpenAI Codex implementation, proofs and tests, with independent agent review; no human approval implied.