diff --git a/research/extremal-pair-coefficient-adapter/DEPENDENCIES.json b/research/extremal-pair-coefficient-adapter/DEPENDENCIES.json new file mode 100644 index 0000000000..27edc743f6 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/DEPENDENCIES.json @@ -0,0 +1,50 @@ +{ + "canonical_base": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "local": "inputs/FINE-PRIME-PADDING.md", + "repository": "CrocSwap/integer-mult-bounds", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/native-kappa-30201655/modern-sources/FINE-PRIME-PADDING.md", + "bytes": 18927, + "sha256": "47d1b1b4df28aadda3cd6bdeb1fbc47290595e9208cd09c1a1f338520d33fdce", + "git_blob": "bf9899ee21be4058e4aac0b64bfa67d01ee8ddd3" + }, + { + "local": "inputs/BILATERAL-LDU.md", + "repository": "CrocSwap/integer-mult-bounds", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/native-kappa-30201655/modern-sources/BILATERAL-LDU.md", + "bytes": 6305, + "sha256": "0d65e66d227464dda1a19f781ae0a0be671cbfd347c41e37ec954f3d629d8a77", + "git_blob": "5cad6ee19f60d626beb9f6d7be78cbc22fdd08c6" + }, + { + "local": "inputs/SCALAR-PROOF.md", + "repository": "CrocSwap/integer-mult-bounds", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/encoded-gaussian-directed-coefficient-audit/PROOF.md", + "bytes": 9837, + "sha256": "b63efb46b31a43d6be1ba2951709e270deca3390fe9d2dd46a235f2672bfc58a", + "git_blob": "fd7f576039c8867053042d6f616441b41a4a103d" + }, + { + "local": "inputs/UPSTREAM-NOTICE", + "repository": "CrocSwap/integer-mult-bounds", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "references/semantic-bulk/rad20/NOTICE", + "bytes": 1470, + "sha256": "82fc72aff49769ae82a8ce886846d9bd0601827a09c955042d26a61177d14369", + "git_blob": "544634f5f3001c50330413f22dc0070e07c46738" + }, + { + "local": "inputs/A12-PROOF.md", + "repository": "CubeJerry/integer-mult-bounds", + "commit": "702c7616667c5f4e583eb73687944d148b7a1ccf", + "path": "research/extremal-phase-two-axis-margin/PROOF.md", + "bytes": 13831, + "sha256": "03da374ebde2644b883b2398e80112989719c2a0edb7394cc43b2abd26fa447c", + "git_blob": "f19f9ac29b3b797afb57deb9584a8d753b2d112f" + } + ] +} diff --git a/research/extremal-pair-coefficient-adapter/LICENSE b/research/extremal-pair-coefficient-adapter/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/extremal-pair-coefficient-adapter/OVERLAP.json b/research/extremal-pair-coefficient-adapter/OVERLAP.json new file mode 100644 index 0000000000..246a600fba --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/OVERLAP.json @@ -0,0 +1,113 @@ +{ + "canonical_base": "e54523517d0f03e58352e647c403a5af3e525a57", + "coverage": "Bounded source and live PR search, not exhaustive novelty certification.", + "principal_predecessors": [ + { + "number": 6085, + "head": "9fc80f1db55d4939c7b53c0799e6840cce35fbf8", + "disposition": "Reused unchanged generic scalar primitive and quantified tariff; no new exponential backend." + }, + { + "number": 6099, + "disposition": "Named ProductionPlan domain excludes this fine-gap family; isolated scalar calls do not require that domain." + }, + { + "commit": "702c7616667c5f4e583eb73687944d148b7a1ccf", + "disposition": "A12 proves margin with a table-entry premise; the exact four-call source join closes that local premise." + } + ], + "live_queries": [ + { + "query": "repo:CrocSwap/integer-mult-bounds is:pr \"fine-prime\" \"coefficient\" \"direct\"", + "total": 2, + "incomplete": false, + "results": [ + { + "number": 4193, + "title": "Bound capped Gaussian inverses through half shifts", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/4193", + "state": "closed", + "merged_at": "2026-10-21T19:22:10Z" + }, + { + "number": 4359, + "title": "Conditional κ = 0.0023 (+5.690e-4, +32.87% over #4181): productive helper jobs compiled into a uniform supplier", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/4359", + "state": "closed", + "merged_at": "2026-10-21T19:10:56Z" + } + ] + }, + { + "query": "repo:CrocSwap/integer-mult-bounds is:pr \"Gaussian\" \"ratio\" \"bypass\"", + "total": 1, + "incomplete": false, + "results": [ + { + "number": 3985, + "title": "Fuse full QQ16 recovery from 336 to 224 native calls", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/3985", + "state": "closed", + "merged_at": "2026-10-20T05:24:25Z" + } + ] + }, + { + "query": "repo:CrocSwap/integer-mult-bounds is:pr \"extremal\" \"Gaussian\"", + "total": 7, + "incomplete": false, + "results": [ + { + "number": 3086, + "title": "Prove the sharp native format at the rank-seven A13 half-ADD", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/3086", + "state": "closed", + "merged_at": "2026-10-17T02:02:19Z" + }, + { + "number": 4562, + "title": "Independently check #4554's native stability lowering: exact gate norms, roundoff formulas, #956 moment and depth, shear bounds (no new κ)", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/4562", + "state": "closed", + "merged_at": "2026-10-22T19:19:23Z" + }, + { + "number": 3221, + "title": "Prove rank-six A3 shortening and exclude a P112 profile", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/3221", + "state": "closed", + "merged_at": "2026-10-17T21:56:19Z" + }, + { + "number": 4955, + "title": "Price a second central coordinate on the selected p16 controller: it must be repaid; incremental realizations lose, allowance 1,859 (no new κ)", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/4955", + "state": "closed", + "merged_at": "2026-10-23T05:35:46Z" + }, + { + "number": 3557, + "title": "Prove the alternate shared-port transfer and binary obstruction", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/3557", + "state": "closed", + "merged_at": "2026-10-20T04:59:18Z" + }, + { + "number": 6000, + "title": "Improve quadratic Walsh-Hadamard agreement by 79,598,052 entries at rank 137 (no new κ)", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6000", + "state": "closed", + "merged_at": "2026-10-28T00:24:31Z" + }, + { + "number": 2413, + "title": "Independent verification: PR2298 sections 6 and 4 format/error/recovery chain (explicit cutoffs, signed packing and carry lemmas; no κ)", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/2413", + "state": "closed", + "merged_at": "2026-10-15T23:58:39Z" + } + ] + } + ], + "conclusion": "No matching extremal four-call source/periodic-error/ownership join was identified. Nearby capped-conditioning, complete-supplier and unrelated structural work has different interfaces." +} diff --git a/research/extremal-pair-coefficient-adapter/PR-DESCRIPTION.md b/research/extremal-pair-coefficient-adapter/PR-DESCRIPTION.md new file mode 100644 index 0000000000..6e2c7f9c7f --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/PR-DESCRIPTION.md @@ -0,0 +1,37 @@ +# Produce the selected extremal Gaussian tables through four existing encoded scalar calls + +## Result and why it matters + +[A12](https://github.com/CubeJerry/integer-mult-bounds/commit/702c7616667c5f4e583eb73687944d148b7a1ccf) gives a quantitative rank margin for two deterministic extremal source pairs but leaves table production as an explicit premise. This package closes that local interface with four calls to the unchanged scalar primitive audited in #6085. It does not implement another exponential backend. + +For borrowed binary inputs `(p,alpha,s1,t1,s2,t2)` with `p,alpha>=1`, `1=4096`, these are the actual selected source coefficients. With `a=pi alpha^2,w=exp(-2a)`, scalar error and omitted matched periodic aliases each fit `2^-37 w^2`. The emitted factors therefore approximate the selected periodic principal sections within `2^-36 w^2`, meeting A12's contract. Their tensor and its own exact inverse inherit full ordinary Stein displacement rank in all 24 orders. Inversion and taking a section of the full source inverse are not interchanged. + +## Complete interface and costs + +All six borrowed Count bodies remain unchanged and their canonical heads return to 1. Nine distinct returned owners remain live: precision and eight row-major numerator fields. Private setup closes before return; caller retirement of every returned owner is explicitly paid. Closing those nine outputs does not authorize emptying a pool containing other live leases, including borrowed inputs. Normal domain rejections restore inputs. No malformed-tape, allocation-fault or interruption rollback claim is made. + +With fresh private grants, or an explicit O(p+B) entry-history bound per fixed role, the complete local tariff is `O(p^3+(p+B)^2)` bit time and `O(p+B)` storage, where B is maximum input bit length. Reused blank grants retain `sum_tau max(H_tau,C(p+B))` storage and any actual full-history sweep/transport charge. The proof binds the existing precision policy to `R<=257p`, keeps rational input sizes, uses the existing `reduce=False` ABI, and pays argument construction, diagonal values, copies, scalar calls, private histories and output retirement. `O(p^3)` requires a separate `B=O(p)` source bound. This is the retained encoded Count/Rational model, not a new native ROM. + +The #6099 ProductionPlan domain is not needed for isolated calls; this does not repair its global admission. Source/primality/alpha admission, index routing, tensor materialization, payload transport, inverse algorithms and a complete Gaussian caller remain separate. No new kappa or selected-certificate change; all five assumptions remain. + +## Verification and reproduction + +Canonical base `e54523517d0f03e58352e647c403a5af3e525a57`; only a new research package. Exact runtime/source pins are declared. The existing predecessor archives are reused as canonical inputs, not copied into this contribution. + +```sh +python3 -I -W error -B research/extremal-pair-coefficient-adapter/verify.py +python3 -I -O -W error -B research/extremal-pair-coefficient-adapter/verify.py +python3 -B scripts/research_package.py --package research/extremal-pair-coefficient-adapter +``` + +Normal and optimized direct runs produced identical `PASS_EXTREMAL_PAIR_COEFFICIENT_ADAPTER` receipts. The actual encoded packet executes four unchanged calls under sealed constructors/no-decode protection, checks complete scalar intervals against the retained independent-algorithm oracle, binds arguments and precision, checks all nine outputs and history cleanup, and exercises seven guarded invalid inputs. It is a finite semantic check, not a p>=4096 run or a universal proof. The small packet deliberately demonstrates that successful low-precision production does not imply A12 rank admission. The quantified theorem is in PROOF.md. No full supplier replay, human/formal-kernel acceptance or hosted CI is claimed. + +## Novelty, credit and remaining work + +#6085 supplies the classical scalar algorithm, encoded implementation and tariff; A12 supplies the quantitative margin. The new result is their exact extremal source join, including admission, aliases, ownership and the full local bill. Bounded overlap checks found no identical join and make no worldwide priority claim. + +Prepared for Jerry Chen / @CubeJerry with substantial OpenAI assistance. The worker identified the existing scalar backend, derived and implemented the adapter; the lead proposed closing the production premise; a separate worker reviewed admission and ownership. Credit JoyboyBrian / #6085 and #6099, Chafik Boukhalfa / #1786, Vlado Vojdanovski / #1673, Jeremy Kothe and the bilateral source lineage, and the retained arithmetic/framework contributors. Original notices and Apache-2.0 terms are preserved. + +Next obligations are to bind the selector and owned tables to a complete caller and to prove new margins before extending to arbitrary phases or larger dimensions. diff --git a/research/extremal-pair-coefficient-adapter/PROOF.md b/research/extremal-pair-coefficient-adapter/PROOF.md new file mode 100644 index 0000000000..739061baf5 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/PROOF.md @@ -0,0 +1,95 @@ +# Four direct encoded calls produce the selected extremal coefficient tables + +## 1. Precise interface and inherited primitive + +This is a source-bound adapter, not a new exponential algorithm. It calls the unchanged canonical `research/physical-gaussian-core/gaussian_exponentials.py` at base `e54523517d0f03e58352e647c403a5af3e525a57` (blob `8f0f32d7090554b47c112142e300c88fb8e5db4d`). The scalar contract is the #6085 theorem, retained exactly as `inputs/SCALAR-PROOF.md`, from `research/encoded-gaussian-directed-coefficient-audit/PROOF.md`. Runtime bytes and their nested source archives are pinned in `RUNTIME-PINS.json`. + +The adapter borrows six canonical binary `Count` values `(p,alpha,s1,t1,s2,t2)`, each with its head at the canonical origin 1. It admits + + p>=1, alpha>=1, 1=1 and rational `0<=f<=F`, `Exponentials.grid_interval` returns integer endpoints l,u enclosing `exp(-pi f)` on the `2^-P` grid, with `u-l<=2`. `coefficient` returns l with + + 0 <= l 2^-P <= exp(-pi f), + exp(-pi f)-l 2^-P < 2*2^-P. (2) + +This is a downward approximation, not necessarily the exact irrational floor. Its Machin pi bounds, directed Taylor recurrence, squaring, reciprocal and target rounding are predecessor work. No Axis or ProductionPlan contract is required for an isolated scalar call. + +## 2. The four actual arguments and output accuracy + +The adapter forms `u=alpha^2`, `delta_l=t_l-s_l`, + + A_l=2delta_l+1, B_l=2s_l-1, + f_(l,+)=u A_l/s_l, f_(l,-)=u B_l/s_l, + F=2u, P=p+8. (3) + +For integral `1=4096`, distinct odd `s_l>=p^4`, dyadic targets in the retained fine interval, and + + alpha=ceil(sqrt((4/pi)ln(16p))), a=pi alpha^2. + +At the unique centered source phase `s_l beta_i=-(s_l-1)/2`, the literal unrounded, alias-deleted, already column-normalized coefficient pair is exactly the two-by-two matrix from (3). Its nonwrapping index is the paid A12 modular-inverse selector; this adapter produces its coefficient tables, not payload routing or source-index traversal. + +A12 proves `a<=9ln(16p)<=9p/8`, so `alpha^2<4p`: the producer guard (1) adds no restriction to the admitted A12 family. Set `w=exp(-2a)`. Since `w^2>=(16p)^-36`, for `p>=4096`, + + 2^(-p-7) <= 2^-37 w^2. (5) + +Indeed it suffices that `p>=30+36log2(16p)`, true at4096 and increasing thereafter by the same elementary logarithm bound used in A12. Thus the emitted tables meet the alias-deleted factor error premise with ample room. + +The exact matched periodic source is `N_source(j,k)=sum_m G_(j,k+ms)`, as defined in `BILATERAL-LDU.md`, section4. For the selected adjacent pair, A12 bounds the omitted aliases by `4exp(-a t^2/8)`. The same proof gives the slightly stronger constant + + 4exp(-a t^2/8) <= 2^-37 w^2, (6) + +because `t>=32`, `a>=1` and `a(t^2/8-4)>=124>39ln2`. No aliases are computed. Equations (4)-(6) prove that the produced factor tables differ from the selected principal sections of this exact `N_source` by **less than `2^-36 w^2` per entry**, including their diagonals. The alias error is included, not discarded. + +This is exactly A12's sufficient further-table-error contract for the matched periodic sections. Hence the tensor of the produced tables and its own exact inverse have full ordinary Stein displacement rank in every one of the24 vertex orders, with A12's retained quantitative margins. It is not a principal section of the full source inverse. A separate inversion algorithm, tensor materialization, application to payloads, transport and complete caller are not supplied for free. + +The production theorem #6099 is not used: its incompatible fine-gap admission guards are bypassed only by these four direct scalar calls, not repaired globally. The new result closes the named entry-table production premise at this deterministic fixed two-axis interface, conditional on the retained scalar theorem and encoded arithmetic contract. It does not create a full Gaussian producer or discharge all analytic-recovery assumptions. + +## 4. Complete polynomial bit and storage bill + +Let B be the maximum bit length of the six input integers. It cannot be removed merely from A12's lower bound `s_l>=p^4`. Before the guard, computing `alpha^2` costs `O(B^2)` schoolbook bit work and `O(B)` bits. On accepted inputs, `u<=4p`, and each rational numerator in (3) has at most `2B+3` bits; the denominator has at most B bits. Thus the scalar argument length `B_f` is `O(B+log p)`, in particular `O(B)` with this definition of B. + +The unchanged scalar policy is + + X=4F, k=ceil(log2(8(X+1))), H0=P+X+k+16, + c=ceil(log2 H0), R=P+4X+4k+2c+64. (7) + +Since `F=2u<=8p`, we have `X<=32p`, `k<=ceil(log2p)+9`, `H0<=67p`, and `c<=ceil(log2p)+7`. Therefore + + R <=129p+6ceil(log2p)+122 <=257p. (8) + +The predecessor's paid preparation/application tariff is `O(R^3+(R+B_f)^2)` for sigma0. It includes the directed scalar arithmetic and scans; there is no unbounded final binary shift here. One shared setup and four applications give only a constant multiple of that bound. Argument products, input copies/comparisons, exact denominator copies and table construction add `O((p+B)^2)`; no gcd is hidden. Four diagonal fields and four coefficient fields contain `O(P)=O(p)` numerical output bits, plus the precision record. + +Numerical carriers in the scalar routine have `O(R+B_f)` bits, including argument/pi products, directed Taylor endpoints, squaring products and Machin powers. There are only constantly many live carriers at each step; earlier term carriers are closed. The nine returned carriers remain live. On a fresh fixed private cohort, every physical role starts with only its LEFT marker. Its complete history during this invocation is therefore `O(R+B)`; role reuse does not multiply that maximum by the number of iterations. Complete private setup retirement and later caller output retirement or full-history transport are charged at `O(R+B)` per constant-number owner, not merely by a shorter final payload. All fixed bookkeeping and argument formation fit the displayed bound. + +For an arbitrary reused blank cohort, let `H_tau` be each role's entry history. Retained physical storage instead keeps the explicit sum `sum_tau max(H_tau,C(R+B))` for a fixed sufficient C. The unchanged `Tape.clear` clears the current nonblank prefix up to the first BLANK, then rewinds; it does not erase the existence of a longer already-blank tail. A caller requiring a full-history sweep or transport must pay its actual history length. No H-free total-storage or full-history retirement bound is asserted for arbitrary reused grants. The numerical/source-error contract and successful blank-prefix restoration remain the same. + +With fresh private grants (or the stated bounded-entry-history premise), the complete local bill is therefore + + time O(p^3+(p+B)^2), storage O(p+B), (9) + +including returned outputs and ordinary owner-history costs. The caller's input storage is read-only. If the separate full fine-source interface supplies `B=O(p)`, one may simplify time to `O(p^3)`; that upper bound on B is not inferred from the local lower-size guard. This is the retained encoded Count/Rational setup model with elementary bit tariffs, not a newly compiled native ROM or a leading complete-multiplication cost. + +## 5. State, verification and remaining boundaries + +All input Count heads enter at1 and return there. The code never decodes a payload integer into the host: only fixed program literals1,2,4,8, fixed two-axis iteration and retained encoded operations are used. The input bodies remain unchanged. Private F/P and scalar fields stay alive until all calls finish; scalar fields close before their borrowed F/P. The returned precision is a separate owned copy. `Tables.close` retires those nine outputs; `pool.empty` is legal only after every other live lease in that pool has also been released by its owner. Borrowed inputs may remain live in the same pool and are preserved. Normal guard rejections after valid input construction close private carriers and preserve inputs. No arbitrary malformed-tape, allocation-fault or asynchronous-interruption rollback contract is claimed. + +The bounded replay creates its six borrowed inputs outside the installed private pool; its observation of exactly nine live pool owners is specific to that fixture. It uses the unchanged source loaders and exact archives under `sealed_constructors` and `no_decode`. Observer snapshots are decoded only after protected calls return. A retained independent-algorithm oracle uses arcsine pi and alternating decay rather than the source Machin/positive-Taylor path. It must be entirely enclosed by each actual scalar interval. The replay also checks all four argument records, the complete row-major outputs, nine distinct live output owners, borrowed bytes/head returns, post-retirement blank history and domain-guard controls. This is corroboration of the quantified proof, not a claim to have run the p>=4096 instance. + +The small admitted producer packet deliberately does not meet A12's asymptotic margin domain: some correctly approximated small coefficients round to zero. Its production success is not a rank certificate. Primality, exact retained alpha admission, actual index routing, arbitrary phases, larger dimensions, source inverse sections, complete supplier integration and all five foundational assumptions remain separately scoped. No new kappa is claimed. diff --git a/research/extremal-pair-coefficient-adapter/PUBLICATION-CHECKS.json b/research/extremal-pair-coefficient-adapter/PUBLICATION-CHECKS.json new file mode 100644 index 0000000000..ad4ab8fc83 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/PUBLICATION-CHECKS.json @@ -0,0 +1,19 @@ +{ + "status": "PASS_SCOPED_PUBLICATION_GATES", + "canonical_base": "e54523517d0f03e58352e647c403a5af3e525a57", + "tested_local_commit": "900802e5b00fad8d9cd7d9beddf5f3e64f00dd0d", + "dependency": "702c7616667c5f4e583eb73687944d148b7a1ccf", + "canonical_commands": 4, + "metadata_and_pins": "PASS_PACKAGE_METADATA_AND_PINS", + "registered_gate": "PASS_REGISTERED_RESEARCH_PACKAGE outcome=completed", + "committed_bytes_modes": "PASS_RESEARCH_COMMIT_BYTES40 files (34 package plus6 existing external inputs)", + "export": "PASS_RESEARCH_EXPORT40 files;6 declared external inputs checked", + "external_runtime": "Existing canonical54.5MB archive authenticated and reused; no external runtime input added or modified by this branch.", + "authored_diff_check": "PASS; exact predecessor proof inputs excluded", + "source_origin_check": "ROOT-SOURCE-CHECK.json:14 canonical paths,5 retained proof/notice paths,8 nested paths for7 distinct runtime review slices; exact blob/bytes and predecessor remote/local tree equality.", + "independent_review": "review/REVIEW.md: scalar admission/error/cost and shared-pool lifecycle proof review; independent exact retained cleanup/history checker,9 cases and3 controls in normal/optimized modes; scalar replay not duplicated by reviewer.", + "root_review": "ROOT-PROOF-REVIEW.md: precise production-premise join, source/periodic error, B-dependent complete cost and corrected physical-history bill.", + "full_history_gate": "Not run: shallow checkout; no ancestry inferred.", + "kappa": "No new kappa; all five full assumptions remain.", + "log_sha256": "212f2bdfc4446be99bd8d902a0db4d9ece15ea8c8fa7e98c15bf68517b6eddb4" +} diff --git a/research/extremal-pair-coefficient-adapter/README.md b/research/extremal-pair-coefficient-adapter/README.md new file mode 100644 index 0000000000..8827035c3f --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/README.md @@ -0,0 +1,54 @@ +# Produce the two extremal source tables through four existing encoded scalar calls + +**Source-specific coefficient adapter; no new kappa.** [A12](https://github.com/CubeJerry/integer-mult-bounds/commit/702c7616667c5f4e583eb73687944d148b7a1ccf) proves a uniform rank margin for two deterministic extremal Gaussian source pairs, but leaves coefficient production as an explicit premise. This package supplies that local production interface using the unchanged scalar primitive audited in [#6085](https://github.com/CrocSwap/integer-mult-bounds/pull/6085). It introduces no new exponential algorithm. + +The adapter borrows six canonical binary Count values `(p,alpha,s1,t1,s2,t2)` with heads at 1. For `p,alpha>=1`, `1=4096`, `s_l>=p^4` and `alpha=ceil(sqrt((4/pi)ln(16p)))`, the selected centered phase is `s_l beta_i=-(s_l-1)/2`. Its literal directed coefficients are exactly those supplied by this adapter. Phase and chirp remain in the already column-normalized source matrix. Primality, the exact alpha choice and source admission are caller premises; the adapter does not silently certify them. + +Writing `a=pi alpha^2` and `w=exp(-2a)`, each scalar error is less than `2^-37 w^2`. The omitted aliases of the matched exact periodization contribute at most `2^-37 w^2` per selected entry. Thus the emitted factors approximate the selected periodic principal sections with absolute error **less than `2^-36 w^2`**, meeting A12's table-error premise including aliases. Their tensor and its own exact inverse consequently have full ordinary Stein displacement rank in all 24 orders, with the inherited A12 margins. This is not an inverse section of the full source matrix. + +Let B be the maximum input integer bit length. With fresh private scratch grants, or a stated O(p+B) entry-history bound on each of the fixed private roles, the complete local bit tariff is + + time O(p^3+(p+B)^2), storage O(p+B). + +The proof binds the predecessor precision policy to `R<=257p`, keeps rational input lengths, and pays argument products, comparisons, copying, four diagonal outputs, scalar setup, all four calls and complete owner retirement. An additional source bound `B=O(p)` permits the simpler `O(p^3)` specialization; A12's lower bound on s alone does not imply it. For arbitrary reused blank roles, retained storage keeps `sum_tau max(H_tau,C(p+B))`; a required full-history sweep or transport also pays the actual history length. Earlier blank capacity is not erased from the bill. The retained encoded Count/Rational arithmetic model is explicit. This is not a newly compiled native ROM or a complete multiplication bill. + +Successful return preserves all borrowed input bytes and restores every head to 1. Nine distinct output owners remain live: the copied precision and eight numerator records. Private setup is retired; output history is paid when the caller later invokes `Tables.close()`. That retires these nine outputs only: `pool.empty()` additionally requires every other lease in the pool to have been released by its own owner. Borrowed inputs may belong to the same pool and remain live and unchanged. Normal guard rejections restore the valid borrowed inputs. Arbitrary malformed tapes, allocation-fault rollback and asynchronous interruption are outside the interface. + +## Reproduction and evidence + +From a checkout containing the declared canonical runtime inputs, with Python 3.12 and its standard library: + +```sh +python3 -I -W error -B research/extremal-pair-coefficient-adapter/verify.py +python3 -I -O -W error -B research/extremal-pair-coefficient-adapter/verify.py +python3 -B scripts/research_package.py --package research/extremal-pair-coefficient-adapter +``` + +The direct commands are read-only and print `PASS_EXTREMAL_PAIR_COEFFICIENT_ADAPTER`. [VERIFY.json](VERIFY.json) declares six existing runtime inputs, including the predecessor's original source archives; those archives are not duplicated in this new package. `--source-root PATH` supports a separate read-only input cache. [RUNTIME-PINS.json](RUNTIME-PINS.json) authenticates every declared input, and the unchanged predecessor loaders authenticate their nested sources. + +[RESULT.json](RESULT.json) records identical normal and optimized receipts for one complete actual encoded packet: four calls under sealed constructors and no-decode protection, P=9/F=8/R=251, all nine returned owners, borrowed-byte/head restoration, full post-retirement history cleanup and seven guarded invalid inputs. The independent-algorithm predecessor oracle encloses the answer using arcsine pi and alternating decay; its complete interval must lie inside each actual source interval. Argument, precision, sign, normalization and output-order checks bind the source execution. Returning table-swap and omitted-alpha checks are bounded controls, not a claim to have executed every mutant program. + +The small packet deliberately lies outside A12's `p>=4096` rank domain: two coefficients correctly round to zero. It corroborates producer semantics, not asymptotic rank. The universal source/error/cost result rests on [PROOF.md](PROOF.md) and the inherited scalar theorem. No large-p execution, full supplier replay, human/formal-kernel acceptance or hosted CI is claimed. + +## Novelty, limits and credit + +[OVERLAP.json](OVERLAP.json) records bounded overlap checks. #6085 already proves the scalar algorithm and its tariff. A12 already proves the quantitative source margin. The new step is their exact source-specific four-call join, including argument admission, matching alias/error budget, owned output lifecycle and complete local cost. The named #6099 ProductionPlan domain is unnecessary for these isolated calls; its global admission is not repaired. + +Canonical base: `e54523517d0f03e58352e647c403a5af3e525a57`. [SOURCES.json](SOURCES.json) and [DEPENDENCIES.json](DEPENDENCIES.json) pin exact provenance and retained proofs. Credit JoyboyBrian for [#6085](https://github.com/CrocSwap/integer-mult-bounds/pull/6085) and [#6099](https://github.com/CrocSwap/integer-mult-bounds/pull/6099), Chafik Boukhalfa / [#1786](https://github.com/CrocSwap/integer-mult-bounds/pull/1786), Vlado Vojdanovski / [#1673](https://github.com/CrocSwap/integer-mult-bounds/pull/1673), Jeremy Kothe and the bilateral source lineage, and the retained encoded arithmetic/framework contributors. Original notices and Apache-2.0 terms are preserved. + +Prepared for Jerry Chen / @CubeJerry with substantial OpenAI assistance. The worker identified and reused the scalar predecessor and derived the adapter proof; the lead proposed closing the production premise; a separate worker independently audited admission, ownership and proof. All five foundational assumptions, selected #7000 and the complete multiplication bound remain unchanged. + +## Open next questions + +1. Bind the A12 index selector, these owned tables, tensor formation and transport to one actual Gaussian caller with a complete physical bill. +2. Establish a new source-specific margin before extending production to arbitrary phases or more than two axes; A12's three-axis whole-box nonextension remains relevant. diff --git a/research/extremal-pair-coefficient-adapter/RESULT.json b/research/extremal-pair-coefficient-adapter/RESULT.json new file mode 100644 index 0000000000..f906db4ea4 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/RESULT.json @@ -0,0 +1,204 @@ +{ + "authenticated_runtime_files": 6, + "packet": { + "calls": [ + { + "J": 71, + "R": 251, + "argument": [ + 12, + 101 + ], + "argument_bound": 8, + "k": 9, + "lower": 352, + "oracle": [ + [ + 1625644469512916078527, + 2361183241434822606848 + ], + [ + 6502577878051664314111, + 9444732965739290427392 + ] + ], + "precision": 9, + "raw_denominator": 101, + "raw_numerator": 12, + "steps": 19, + "terms": 92, + "upper": 353 + }, + { + "J": 71, + "R": 251, + "argument": [ + 804, + 101 + ], + "argument_bound": 8, + "k": 9, + "lower": 0, + "oracle": [ + [ + 84427336258097395914830824977115833515509831, + 6129982163463555433433388108601236734474956488734408704 + ], + [ + 675418690064779167318646599816926668124078649, + 49039857307708443467467104868809893875799651909875269632 + ] + ], + "precision": 9, + "raw_denominator": 101, + "raw_numerator": 804, + "steps": 32, + "terms": 92, + "upper": 1 + }, + { + "J": 71, + "R": 251, + "argument": [ + 12, + 103 + ], + "argument_bound": 8, + "k": 9, + "lower": 355, + "oracle": [ + [ + 818734758096112459093, + 1180591620717411303424 + ], + [ + 6549878064768899672747, + 9444732965739290427392 + ] + ], + "precision": 9, + "raw_denominator": 103, + "raw_numerator": 12, + "steps": 19, + "terms": 92, + "upper": 356 + }, + { + "J": 71, + "R": 251, + "argument": [ + 820, + 103 + ], + "argument_bound": 8, + "k": 9, + "lower": 0, + "oracle": [ + [ + 673788906881808896116537076757061038453177967, + 49039857307708443467467104868809893875799651909875269632 + ], + [ + 42111806680113056007283567297316314903323623, + 3064991081731777716716694054300618367237478244367204352 + ] + ], + "precision": 9, + "raw_denominator": 103, + "raw_numerator": 820, + "steps": 32, + "terms": 92, + "upper": 1 + } + ], + "cleanup": "all private cells blank, markers erased, heads at1; borrowed bytes unchanged", + "controls": [ + "returning-axis-swap", + "omitted-alpha-square-argument", + "exact-F-P-policy", + "growth-or-normalization-mismatch", + "small-valid-producer-is-not-A12-rank-admission" + ], + "domain_rejections": [ + [ + 0, + 2, + 101, + 102, + 103, + 104 + ], + [ + 1, + 0, + 101, + 102, + 103, + 104 + ], + [ + 1, + 3, + 101, + 102, + 103, + 104 + ], + [ + 1, + 2, + 1, + 2, + 103, + 104 + ], + [ + 1, + 2, + 101, + 101, + 103, + 104 + ], + [ + 1, + 2, + 101, + 202, + 103, + 104 + ], + [ + 1, + 2, + 101, + 102, + 103, + 103 + ] + ], + "emitted_precision": 9, + "input": [ + 1, + 2, + 101, + 102, + 103, + 104 + ], + "live_outputs_before_retirement": 9, + "observed_private_history_cells": 15718, + "row_major_numerators": [ + 512, + 352, + 0, + 512, + 512, + 355, + 0, + 512 + ] + }, + "scope": "Unchanged encoded scalar backend with source-bound four-call adapter; finite packet corroborates universal theorem; no full Gaussian producer or native-ROM claim.", + "status": "PASS_EXTREMAL_PAIR_COEFFICIENT_ADAPTER" +} diff --git a/research/extremal-pair-coefficient-adapter/ROOT-PROOF-REVIEW.md b/research/extremal-pair-coefficient-adapter/ROOT-PROOF-REVIEW.md new file mode 100644 index 0000000000..17cb9b2661 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/ROOT-PROOF-REVIEW.md @@ -0,0 +1,68 @@ +# Lead review of the four-call extremal coefficient adapter + +**Verdict: PASS within the stated retained arithmetic/runtime contract.** +Canonical base: `e54523517d0f03e58352e647c403a5af3e525a57`. +Final proof hash is pinned by the separately frozen review in `review/`. + +This adapter addresses a precise missing production implication in the +published two-axis margin theorem. The isolated scalar theorem admits all +represented positive P,F and rational 0<=f<=F; its admission does not require +the incompatible Axis/ProductionPlan guards. The adapter's four exact +arguments are strictly between zero and F=2 alpha^2 and its actual scalar +calls use the decay branch, zero scale and P=p+8. Its explicit unreduced +Rational ABI pays numerator/denominator copies without inserting a free gcd. +The four output diagonals and four off-diagonals have the stated row-major +order, and the precision Count is a ninth distinct output owner. + +The scalar error is strictly below 2^(-p-7). For the separately admitted +large-p source family this is at most 2^-37 w^2; the exact matched-periodic +alias bound fits another 2^-37 w^2. Their sum therefore satisfies the +published two-axis table-error contract. The matrix identification uses the +actual extremal physical phase; it does not transfer ordinary displacement +rank through arbitrary diagonal similarity. The inverse conclusion refers +to the produced tensor's own inverse, not a section of a larger inverse. + +The guard alpha^2<=4p bounds the inherited scalar precision policy by +R<=257p. Input length B remains in the bill: s>=p^4 is a lower bound and +cannot justify B=O(p). The resulting local tariff is O(p^3+(p+B)^2), with +O(p+B) total private storage only under fresh or bounded-history grants. +Source-parameter acquisition, primality/alpha admission, index routing, +tensor materialization, inverse computation, payload and full caller costs +are separate obligations. This is a fixed two-axis interface, not a +complete supplier or a growing-dimensional production theorem. + +Lead and independent review identified the initial history overstatement. +The final proof keeps each reused blank role's prior history through +sum_tau max(H_tau,C(R+B)). Exact retained Tape.clear scans the contiguous +current nonblank prefix, not its old already-blank capacity. Consequently +no automatic +H scan should be invented; a chosen full-history transport or +sweep must instead pay its actual extent. Dirty remote tails are outside the +blank-cohort premise. The separate review's operational control detects why +an origin-only pool-empty test cannot establish arbitrary dirty-tail cleanup. + +The final lifecycle wording also distinguishes output retirement from +emptying a shared pool. The adapter preserves borrowed input leases even +if they belong to that pool; every other live owner must release its lease +before pool.empty. The small primary fixture creates its borrowed inputs +outside the installed pool and hence observes exactly nine private outputs. +Neither that count nor its p=1 producer packet is a large-p rank certificate. + +The scalar backend's independent-algorithm oracle uses arcsine pi and an +alternating decay bound, whereas the retained producer uses Machin pi and +directed positive Taylor arithmetic. The separate reviewer inspected this +execution evidence and independently checked the cleanup/runtime contract; +it did not claim a second scalar implementation. Canonical registered +execution replays the actual source once in each normal/optimized mode and +runs that independent small history checker in both modes. + +`ROOT-SOURCE-CHECK.json` authenticates 14 canonical origin paths, all five +retained proof/notice inputs and all eight nested extraction paths for the +seven distinct runtime review slices. The existing 54.5 MB runtime archive +is a canonical external input, reused byte-for-byte; it is not a new package +or branch addition. Only narrowly selected source files and the package are +checked out. No archive-wide research clone is needed. + +No full foundational assumption is discharged. The selected complete +multiplication exponent remains unchanged. Prepared for Jerry Chen / +@CubeJerry with substantial OpenAI assistance and predecessor credit as +recorded in the package's PR description and retained notices. diff --git a/research/extremal-pair-coefficient-adapter/ROOT-SOURCE-CHECK.json b/research/extremal-pair-coefficient-adapter/ROOT-SOURCE-CHECK.json new file mode 100644 index 0000000000..fb9bb170a4 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/ROOT-SOURCE-CHECK.json @@ -0,0 +1,214 @@ +{ + "status": "PASS_ORIGIN_PATH_BLOB_BYTES", + "canonical_sources": [ + { + "path": "certificates/selected-result.json", + "blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "bytes": 4803, + "usage": "provenance", + "match": true + }, + { + "path": "docs/audit.md", + "blob": "70c11b50a4a3113cbcb77d99f41adf4e41783b19", + "bytes": 15591, + "usage": "provenance", + "match": true + }, + { + "path": "docs/research/agent-task-catalog.json", + "blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "bytes": 82822, + "usage": "provenance", + "match": true + }, + { + "path": "docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md", + "blob": "3dd1af2285e597676725e85ad4f65e7ad326d695", + "bytes": 25533, + "usage": "provenance", + "match": true + }, + { + "path": "research/physical-gaussian-core/gaussian_sources.py", + "blob": "ce521f91997775e189f984ba7dd68a15bf9ecd9b", + "bytes": 5425, + "usage": "input", + "match": true + }, + { + "path": "research/physical-gaussian-core/gaussian_exponentials.py", + "blob": "8f0f32d7090554b47c112142e300c88fb8e5db4d", + "bytes": 9852, + "usage": "input", + "match": true + }, + { + "path": "research/physical-gaussian-core/gaussian_rationals.py", + "blob": "053404d91c1bef0d4bb0f6647491847bf5879aaf", + "bytes": 8064, + "usage": "input", + "match": true + }, + { + "path": "research/physical-gaussian-core/inputs/word-export.tar", + "blob": "885794cf3328941209034ee2d946ed76dbea8ce3", + "bytes": 54548480, + "usage": "input", + "match": true + }, + { + "path": "research/physical-gaussian-core/inputs/branchfree-source.tar", + "blob": "48dc77f5145d649bfed6745e38ab18b11772d597", + "bytes": 71680, + "usage": "input", + "match": true + }, + { + "path": "research/encoded-gaussian-directed-coefficient-audit/oracle.py", + "blob": "99d60642405f814a500b29b52d862baaf6156d94", + "bytes": 2760, + "usage": "input", + "match": true + }, + { + "path": "research/native-kappa-30201655/modern-sources/FINE-PRIME-PADDING.md", + "blob": "bf9899ee21be4058e4aac0b64bfa67d01ee8ddd3", + "bytes": 18927, + "usage": "provenance", + "match": true + }, + { + "path": "research/native-kappa-30201655/modern-sources/BILATERAL-LDU.md", + "blob": "5cad6ee19f60d626beb9f6d7be78cbc22fdd08c6", + "bytes": 6305, + "usage": "provenance", + "match": true + }, + { + "path": "research/encoded-gaussian-directed-coefficient-audit/PROOF.md", + "blob": "fd7f576039c8867053042d6f616441b41a4a103d", + "bytes": 9837, + "usage": "provenance", + "match": true + }, + { + "path": "references/semantic-bulk/rad20/NOTICE", + "blob": "544634f5f3001c50330413f22dc0070e07c46738", + "bytes": 1470, + "usage": "provenance", + "match": true + } + ], + "retained_dependencies": [ + { + "origin_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "verified_equivalent_local": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/native-kappa-30201655/modern-sources/FINE-PRIME-PADDING.md", + "local": "inputs/FINE-PRIME-PADDING.md", + "blob": "bf9899ee21be4058e4aac0b64bfa67d01ee8ddd3", + "bytes": 18927, + "match": true + }, + { + "origin_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "verified_equivalent_local": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/native-kappa-30201655/modern-sources/BILATERAL-LDU.md", + "local": "inputs/BILATERAL-LDU.md", + "blob": "5cad6ee19f60d626beb9f6d7be78cbc22fdd08c6", + "bytes": 6305, + "match": true + }, + { + "origin_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "verified_equivalent_local": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/encoded-gaussian-directed-coefficient-audit/PROOF.md", + "local": "inputs/SCALAR-PROOF.md", + "blob": "fd7f576039c8867053042d6f616441b41a4a103d", + "bytes": 9837, + "match": true + }, + { + "origin_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "verified_equivalent_local": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "references/semantic-bulk/rad20/NOTICE", + "local": "inputs/UPSTREAM-NOTICE", + "blob": "544634f5f3001c50330413f22dc0070e07c46738", + "bytes": 1470, + "match": true + }, + { + "origin_commit": "702c7616667c5f4e583eb73687944d148b7a1ccf", + "verified_equivalent_local": "839b8e0b4eb3bbf3e8e289a440910e566b177b72", + "path": "research/extremal-phase-two-axis-margin/PROOF.md", + "local": "inputs/A12-PROOF.md", + "blob": "f19f9ac29b3b797afb57deb9584a8d753b2d112f", + "bytes": 13831, + "match": true + } + ], + "nested_runtime_slices": [ + { + "file": "cardinal_counts.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/inputs/sparse-export.tar :: research/physical-sparse-xor-batch/inputs/compact-export.tar :: research/physical-complex-compact/inputs/pr2899.tar :: inputs/pr2809.tar :: inputs/pr2753/predecessor/cardinal_counts.py", + "sha256": "59ddeac102a0cc51fa49b15aae6aeb68cd68ed217fa974ce916372a177d2ec8f", + "bytes": 1861, + "match": true + }, + { + "file": "counts.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/inputs/sparse-export.tar :: research/physical-sparse-xor-batch/inputs/compact-export.tar :: research/physical-complex-compact/inputs/pr2899.tar :: inputs/pr2809.tar :: inputs/pr2753/predecessor/vendor/counts.py", + "sha256": "00b476dbda0e8cc99886bf794439e1cb9e775f435f599a3557e99321fe084069", + "bytes": 1695, + "match": true + }, + { + "file": "records.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/inputs/sparse-export.tar :: research/physical-sparse-xor-batch/inputs/compact-export.tar :: research/physical-complex-compact/inputs/pr2899.tar :: inputs/pr2809.tar :: inputs/pr2753/predecessor/vendor/records.py", + "sha256": "0c9c4b23e998597fb877bb1a29da69ac869b68262abe635b162b4dba9c69b372", + "bytes": 9888, + "match": true + }, + { + "file": "scratch_pool.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/inputs/sparse-export.tar :: research/physical-sparse-xor-batch/inputs/compact-export.tar :: research/physical-complex-compact/inputs/pr2899.tar :: inputs/pr2809.tar :: scratch_pool.py", + "sha256": "41f1eb93652b7174c3b02f95f70e1a9ce2e2aed0a729e725167c8f226e65d8db", + "bytes": 5952, + "match": true + }, + { + "file": "session.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/inputs/sparse-export.tar :: research/physical-sparse-xor-batch/inputs/compact-export.tar :: research/physical-complex-compact/inputs/pr2899.tar :: session.py", + "sha256": "45ee809b27a69ca5576361922fd2760f568c9a98864d4c55c4fee3003ee3c9ad", + "bytes": 5874, + "match": true + }, + { + "file": "router_metadata.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/router_metadata.py", + "sha256": "a0c807471cff33d609cec83b1c63e3fc4d98dab24b7df0911a0ddadd113e99f6", + "bytes": 8205, + "match": true + }, + { + "file": "session.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/t74-export.tar :: research/t74-retuned-physical-layer/inputs/t74-export.tar :: research/t74-physical-layer/inputs/pr3385-controller.tar :: research/physical-gaussian-leaf/inputs/pr3087.tar :: inputs/pr3055.tar :: inputs/pr2899.tar :: session.py", + "sha256": "45ee809b27a69ca5576361922fd2760f568c9a98864d4c55c4fee3003ee3c9ad", + "bytes": 5874, + "match": true + }, + { + "file": "cardinality.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/inputs/sparse-export.tar :: research/physical-sparse-xor-batch/inputs/compact-export.tar :: research/physical-complex-compact/inputs/pr2899.tar :: inputs/pr2809.tar :: inputs/pr2753/predecessor/vendor/cardinality.py", + "sha256": "505d5e560c5a507e6184edcc19a87cf1fed243eb34a5cb21fbe1e4fe017e7f22", + "bytes": 3936, + "match": true + } + ], + "remote_local_tree_equality": { + "published": "702c7616667c5f4e583eb73687944d148b7a1ccf", + "local": "839b8e0b4eb3bbf3e8e289a440910e566b177b72", + "tree": "f60d9522d0768629fb622273b5b46fd8dba0de0a", + "remote_ref_tree_verified_before_mapping": true + } +} diff --git a/research/extremal-pair-coefficient-adapter/RUNTIME-PINS.json b/research/extremal-pair-coefficient-adapter/RUNTIME-PINS.json new file mode 100644 index 0000000000..50eb33ee8d --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/RUNTIME-PINS.json @@ -0,0 +1,41 @@ +{ + "canonical_base": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "research/physical-gaussian-core/gaussian_sources.py", + "bytes": 5425, + "sha256": "c5889a97a11a9c6c6c44deb8a2042498ddc3f55703de15269132b8f198e24b15", + "git_blob": "ce521f91997775e189f984ba7dd68a15bf9ecd9b" + }, + { + "path": "research/physical-gaussian-core/gaussian_exponentials.py", + "bytes": 9852, + "sha256": "f7a27cacbb27c0cfa4a63054e83feba2beae91b3fa9d3c37f903620b3899e67b", + "git_blob": "8f0f32d7090554b47c112142e300c88fb8e5db4d" + }, + { + "path": "research/physical-gaussian-core/gaussian_rationals.py", + "bytes": 8064, + "sha256": "6f9a380c8c7b4233c3bc338a6206d65cc85bee2e4f5625c2a212065f04f4b73d", + "git_blob": "053404d91c1bef0d4bb0f6647491847bf5879aaf" + }, + { + "path": "research/physical-gaussian-core/inputs/word-export.tar", + "bytes": 54548480, + "sha256": "d428e8b6aef4d348fa2e922ca64c4cfd634bbb2f0c150033273e65fcf4600b49", + "git_blob": "885794cf3328941209034ee2d946ed76dbea8ce3" + }, + { + "path": "research/physical-gaussian-core/inputs/branchfree-source.tar", + "bytes": 71680, + "sha256": "e6cdacd59a067189a99bfe03f4448913bb8d518ed4a9b1d981a68c5c666529c7", + "git_blob": "48dc77f5145d649bfed6745e38ab18b11772d597" + }, + { + "path": "research/encoded-gaussian-directed-coefficient-audit/oracle.py", + "bytes": 2760, + "sha256": "87dd13add789995c763ff1f4f059ac23d1b221fff2699daaa38566510f3d1022", + "git_blob": "99d60642405f814a500b29b52d862baaf6156d94" + } + ] +} diff --git a/research/extremal-pair-coefficient-adapter/SOURCES.json b/research/extremal-pair-coefficient-adapter/SOURCES.json new file mode 100644 index 0000000000..857fb0806a --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/SOURCES.json @@ -0,0 +1,90 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/audit.md", + "usage": "provenance", + "git_blob": "70c11b50a4a3113cbcb77d99f41adf4e41783b19", + "sha256": "3858925e9dc44e46df3c22dd77d48614c52ba24a3f42c1db99b09b6fd80540c4" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md", + "usage": "provenance", + "git_blob": "3dd1af2285e597676725e85ad4f65e7ad326d695", + "sha256": "4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055" + }, + { + "path": "research/physical-gaussian-core/gaussian_sources.py", + "usage": "input", + "git_blob": "ce521f91997775e189f984ba7dd68a15bf9ecd9b", + "sha256": "c5889a97a11a9c6c6c44deb8a2042498ddc3f55703de15269132b8f198e24b15" + }, + { + "path": "research/physical-gaussian-core/gaussian_exponentials.py", + "usage": "input", + "git_blob": "8f0f32d7090554b47c112142e300c88fb8e5db4d", + "sha256": "f7a27cacbb27c0cfa4a63054e83feba2beae91b3fa9d3c37f903620b3899e67b" + }, + { + "path": "research/physical-gaussian-core/gaussian_rationals.py", + "usage": "input", + "git_blob": "053404d91c1bef0d4bb0f6647491847bf5879aaf", + "sha256": "6f9a380c8c7b4233c3bc338a6206d65cc85bee2e4f5625c2a212065f04f4b73d" + }, + { + "path": "research/physical-gaussian-core/inputs/word-export.tar", + "usage": "input", + "git_blob": "885794cf3328941209034ee2d946ed76dbea8ce3", + "sha256": "d428e8b6aef4d348fa2e922ca64c4cfd634bbb2f0c150033273e65fcf4600b49" + }, + { + "path": "research/physical-gaussian-core/inputs/branchfree-source.tar", + "usage": "input", + "git_blob": "48dc77f5145d649bfed6745e38ab18b11772d597", + "sha256": "e6cdacd59a067189a99bfe03f4448913bb8d518ed4a9b1d981a68c5c666529c7" + }, + { + "path": "research/encoded-gaussian-directed-coefficient-audit/oracle.py", + "usage": "input", + "git_blob": "99d60642405f814a500b29b52d862baaf6156d94", + "sha256": "87dd13add789995c763ff1f4f059ac23d1b221fff2699daaa38566510f3d1022" + }, + { + "path": "research/native-kappa-30201655/modern-sources/FINE-PRIME-PADDING.md", + "usage": "provenance", + "git_blob": "bf9899ee21be4058e4aac0b64bfa67d01ee8ddd3", + "sha256": "47d1b1b4df28aadda3cd6bdeb1fbc47290595e9208cd09c1a1f338520d33fdce" + }, + { + "path": "research/native-kappa-30201655/modern-sources/BILATERAL-LDU.md", + "usage": "provenance", + "git_blob": "5cad6ee19f60d626beb9f6d7be78cbc22fdd08c6", + "sha256": "0d65e66d227464dda1a19f781ae0a0be671cbfd347c41e37ec954f3d629d8a77" + }, + { + "path": "research/encoded-gaussian-directed-coefficient-audit/PROOF.md", + "usage": "provenance", + "git_blob": "fd7f576039c8867053042d6f616441b41a4a103d", + "sha256": "b63efb46b31a43d6be1ba2951709e270deca3390fe9d2dd46a235f2672bfc58a" + }, + { + "path": "references/semantic-bulk/rad20/NOTICE", + "usage": "provenance", + "git_blob": "544634f5f3001c50330413f22dc0070e07c46738", + "sha256": "82fc72aff49769ae82a8ce886846d9bd0601827a09c955042d26a61177d14369" + } + ] +} diff --git a/research/extremal-pair-coefficient-adapter/TASK.json b/research/extremal-pair-coefficient-adapter/TASK.json new file mode 100644 index 0000000000..5b0363f69a --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/TASK.json @@ -0,0 +1,89 @@ +{ + "schema_version": 1, + "task_id": "uniform-transfer-audit", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "uniform-transfer-audit", + "question": "Can one of the selected record's five inherited assumptions be proved at its actual caller?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose one assumption ID (native_all_columns, owned_erasure, compiler, precision_tape, analytic_recovery), one quantified implication and exact dependency closure. Check current handoffs, including #5625 row reentry and #5707 root-prefix lowering, without treating their partial scope as the whole theorem. Prove or falsify that implication with a caller-bound argument; stop at the chosen obligation. Finite tests or root digits do not discharge an all-size statement.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "existing_checks": [ + { + "scope": "PR #4100: proposed unconditional construction and finite checks, without independent acceptance.", + "evidence": "research/unconditional-batched-crt/README.md", + "remaining": "Independent proof audit of one caller-bound all-size implication; all other premises remain explicit.", + "status": "author-checked", + "source_commit": "337d04939571a637aeab54a0f58f54fde811663a", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Produce two deterministic extremal source-pair tables by four unchanged encoded #6085 scalar calls; prove source admission, matched periodic error, ownership restoration and complete local bit/storage cost. Simplified total-space/retirement tariff assumes fresh or explicitly bounded-history private grants.", + "scope_change_reason": "A12 leaves production explicit. Bounded overlap found the existing #6085 scalar primitive, so this is the approved source-specific adapter rather than another exponential backend.", + "bottleneck_link": "Close the table-production premise at a fixed selected two-axis interface; source admission, routing, global caller and the five framework assumptions remain.", + "budget_minutes": 45, + "stop_rule": "Stop at the four-call interface and source-bound error/cost proof. No global Gaussian production, native ROM, full caller admission or kappa.", + "outcome": "completed", + "evidence": "PROOF.md proves factor error <2^(-p-7), matched periodic error <2^-36 exp(-4a), time O(p^3+(p+B)^2) and storage O(p+B) on fresh/bounded-history private grants, with arbitrary earlier history retained separately. RESULT.json retains four actual encoded calls, seven guarded rejects and complete post-retirement cleanup; normal and optimized receipts agree.", + "author": "Prepared for Jerry Chen / @CubeJerry", + "ai_assistance": "Substantial OpenAI assistance. The worker identified the scalar predecessor, derived the exact source/error/cost composition and implemented the adapter/replay. The lead proposed closing the production premise; a separate worker audited admission, ownership and proof. Generic exponential algorithms and source code are credited, not claimed as new. No human or formal-kernel acceptance is claimed.", + "open_questions": [ + { + "question": "Can the emitted tables enter a selected Gaussian caller with a complete physical bill?", + "why_it_matters": "This produces data with owned outputs, not payload traversal or native application.", + "first_step": "Pin one caller and bind the A12 selector, table lifetime, tensor formation and transport.", + "blocked_by": "Caller and native program integration remain separate." + }, + { + "question": "Can stable production cover arbitrary phases or more than two axes?", + "why_it_matters": "A12 is fixed to extremal phases and has a three-axis nonextension.", + "first_step": "Prove a new source-specific margin before broadening the target.", + "blocked_by": "Current rank margin is fixed to two selected axes." + } + ] +} diff --git a/research/extremal-pair-coefficient-adapter/VERIFY.json b/research/extremal-pair-coefficient-adapter/VERIFY.json new file mode 100644 index 0000000000..561a50f4d4 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/VERIFY.json @@ -0,0 +1,66 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/physical-gaussian-core/gaussian_sources.py", + "research/physical-gaussian-core/gaussian_exponentials.py", + "research/physical-gaussian-core/gaussian_rationals.py", + "research/physical-gaussian-core/inputs/word-export.tar", + "research/physical-gaussian-core/inputs/branchfree-source.tar", + "research/encoded-gaussian-directed-coefficient-audit/oracle.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 240, + "checks": "Authenticate runtime/inputs; four unchanged calls under sealed constructors/no-decode; independent-algorithm interval oracle; argument/precision, nine outputs, borrowed restoration, retirement and seven guarded rejects." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 240, + "checks": "Authenticate runtime/inputs; four unchanged calls under sealed constructors/no-decode; independent-algorithm interval oracle; argument/precision, nine outputs, borrowed restoration, retirement and seven guarded rejects." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/review/check_history.py" + ], + "timeout_seconds": 60, + "checks": "Independent exact retained Count/Lease/Tape history and shared-pool lifecycle methods; nine length/capacity cases and three operational controls." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "-O", + "{package}/review/check_history.py" + ], + "timeout_seconds": 60, + "checks": "Independent exact retained Count/Lease/Tape history and shared-pool lifecycle methods; nine length/capacity cases and three operational controls. Optimized mode." + } + ] +} diff --git a/research/extremal-pair-coefficient-adapter/adapter.py b/research/extremal-pair-coefficient-adapter/adapter.py new file mode 100644 index 0000000000..b90eb89e2a --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/adapter.py @@ -0,0 +1,81 @@ +"""Four direct encoded decay calls for two extremal source-pair tables. +Prepared for Jerry Chen / @CubeJerry with substantial OpenAI assistance. +Reuses unchanged JoyboyBrian/jmbarrancoml Gaussian scalar/runtime sources. +SPDX-License-Identifier: Apache-2.0 +""" +from gaussian_sources import active +active() +from cardinal_counts import Count, positive +from encoded import compare, subtract +from gaussian_exponentials import Exponentials +from gaussian_rationals import Rational +from ring_words import Signed, power_two +from router_metadata import owned +from words import need + + +class Tables: + """Own the precision Count and eight row-major numerator Counts.""" + def __init__(self, precision, entries): + self.precision = precision + self.entries = tuple(entries) + + def close(self): + for value in reversed(self.entries): + value.close() + self.precision.close() + + +def decay(exponentials, square_alpha, numerator_factor, denominator): + numerator = Signed(Count.product(square_alpha, numerator_factor)) + try: + copied_denominator = Count(denominator) + except BaseException: + numerator.close() + raise + with owned(Rational(numerator, copied_denominator, False)) as (argument,): + return exponentials.coefficient(argument, False, None) + + +def produce(p, alpha, s1, t1, s2, t2): + """Borrow canonical head-at-one Counts; return nine distinct owned Counts. + Domain: p,alpha>0,1=4096`, let `s_1,s_2` be distinct odd primes with `s_l>=p^4`, and let dyadic targets satisfy + + (1-1/(2p^2))t_l < s_l <= (1-1/(4p^2))t_l. (1) + +Set `delta_l=t_l-s_l`, `rho_l=t_l/s_l`, and + + L=ln(16p), alpha=ceil(sqrt(4L/pi)), a=pi alpha^2, + n_l=-(s_l-1)/2, + i_l=delta_l^-1 n_l mod s_l, in {0,...,s_l-1}. (2) + +Use the literal source coefficients + + q_j=floor(rho*j+1/2), beta_j=rho*j-q_j, + G_jk=exp(-a[(rho*k-q_j)^2-beta_k^2]). (3) + +The selected indices satisfy `i_l<=s_l-2` and `q_(i_l+1)=q_(i_l)+1`. Put + + C_l=G^(l)[{i_l,i_l+1},{i_l,i_l+1}], C=C_1 tensor C_2, + w=exp(-2a), E(A)=A-Z A Z^T, (4) + +where `Z` is the ordinary four-by-four lower one-step nilpotent shift. For all 24 simultaneous vertex orders `P`, + + |det E(P C P^T)| >= w^2/16, + sigma_min(E(P C P^T)) >= 2^-10 w^2, + sigma_min(E(P C^-1 P^T)) >= 2^-19 w^2. (5) + +The factors are nonsymmetric; singular values use the Euclidean operator norm, without an SPD premise. If a possibly unstructured complex `C_hat` has maximum entry error at most `2^-32 w^2`, it is invertible and every order satisfies + + sigma_min(E(P C_hat P^T)) >= 2^-11 w^2, + sigma_min(E(P C_hat^-1 P^T)) >= 2^-20 w^2. (6) + +It suffices to perturb each factor entry by at most `2^-34 w^2` before forming the tensor. A sufficient factor-table precision, for absolute entry error `<=2^-b`, is + + b >= ceil(34+36 log2(16p)). (7) + +In particular `b=p` suffices for `p>=4096`, and any fixed positive `Cp` suffices eventually. Section 6 adds the exact matched periodic alias sum with a separately paid two-bit error allowance. No existing production routine is asserted to meet the entry-error contract. Its old-domain admission mismatch is explicit there. Inverses are of the selected four-by-four tensors, never sections of larger inverses. No kappa or complete multiplication claim is made. + +## 2. The legal extremal source pair + +The coefficient and finite period `0<=js/(4p^2)` and `delta/s<=1/p^2`; thus `A>4` and `4A+4=8delta+8uA+vB mod s` on `[0,4]^2` is injective: its unreduced values lie in `[-4,4A]`, a range shorter than `s`; equality gives `(u-u')A=v-v'`, forcing both differences zero. The proof below does not need transcendence or CRT. + +Extended Euclid and (2) select each starting index in `O(poly(log s))` bit work and `O(log s)` local arithmetic scratch. Both output indices are charged. This is index selection, not coefficient-page construction or full-source traversal. + +## 3. A uniform four-by-four determinant lemma + +Let `eta=2^-10`, `0=1/2`. + +For the third class, `w/2<=q_l<=2w` gives + + F_x <= 2w-(1/2)(1/4) <= -1/16, + F_y >= (w/2)(1/2)-4w^2 >= w/8. + +Here `w<=1/32` suffices. Hence `|F_x F_y|>=w/128>=w^2/16`. The fourth class has the same bound by exchanging axes. + +The remaining eight orders begin with opposite vertices. Compare with + + H0=[[1,1,1,1],[0,1,0,1],[0,0,1,1],[0,0,0,1]], + +obtained from `u=x=1, v=y=0`. Direct integer determinants give: + +| Order | det E(P H0 P^T) | +| --- | ---: | +| `(0,3,1,2)` | 1 | +| `(0,3,2,1)` | 1 | +| `(1,2,0,3)` | -1 | +| `(1,2,3,0)` | -1 | +| `(2,1,0,3)` | -1 | +| `(2,1,3,0)` | -1 | +| `(3,0,1,2)` | 1 | +| `(3,0,2,1)` | 1 | + +Each factor entry differs from its reference by at most `eta`, because `2w<=eta`. Tensor entry errors are at most `2eta`. Displacement entry errors are at most `4eta`. Entries of both displacements have absolute value at most one. Telescoping each four-factor product in the determinant expansion bounds the total change by + + 24 * 4 * 4eta = 384eta = 3/8. + +These eight determinants therefore have absolute value at least `5/8`. Together the classes prove `|det E(P H P^T)|>=w^2/16` for all 24 orders and all real parameters in (9). The finite order table exhausts the order domain; the inequalities cover a continuous parameter box, not just sampled values. + +All displacement entries have absolute value at most one, so `||E(PHP^T)||_2<=4` by the Frobenius norm. The product of the four singular values is the determinant magnitude. Thus + + sigma_min(E(P H P^T)) >= w^2/(16*4^3)=2^-10 w^2. (10) + +## 4. Inverse and perturbation bills + +Each two-point factor in (9) has determinant `1-q_l>0` and inverse + + (1-q_l)^-1 [[1,-U_l],[-V_l,1]]. + +Its Euclidean norm is at most `2/(1-q_l)<=4`, by its Frobenius norm. Therefore `||H^-1||_2<=16`, `||E(P H^-1 P^T)||_2<=32`, and + + 0 < det H = (1-q1)^2 (1-q2)^2 <= 1. + +For any invertible `A`, the two determinant Schur complements of `[[A,Z],[Z^T,A^-1]]`, followed by the same identity for `A^-1`, give + + det E(A^-1) = det E_rev(A)/(det A)^2, + E_rev(A)=A-Z^T A Z=J E(JAJ) J, (11) + +where `J` reverses indices. Reversal is another allowed order and `det(J)^2=1`. Section 3 and (11) yield inverse displacement determinant magnitude at least `w^2/16`. Hence + + sigma_min(E(P H^-1 P^T)) >= w^2/(16*32^3) + =2^-19 w^2. (12) + +This is a determinant and norm transfer for nonsymmetric matrices, not a persymmetry assumption. + +For a four-by-four perturbation `F` with maximum entry magnitude `delta`, `||F||_2<=4delta` and `||E(F)||_2<=8delta`. If `delta<=2^-32 w^2`, then `||H^-1 F||_2<=64delta<1/2`. The Neumann identity gives invertibility of `H_hat=H+F` and + + ||H_hat^-1-H^-1||_2 <= 2*16^2*4delta=2048delta. + +Consequently its inverse displacement changes by at most `4096delta<=2^-20 w^2`. Singular-value perturbation proves the inverse lower bound in (6). The forward change is at most `8delta`, which also leaves at least half the bound (10). Every factor of four from entry error to the matrix norm is included. + +If the two factor tables instead have maximum entry error `zeta<=1`, their tensor entry error is at most `2zeta+zeta^2<=3zeta`. Thus `zeta<=2^-34 w^2` implies the required matrix error `delta<=2^-32 w^2`. The inverse in this conclusion is the exact inverse of the tensor of the perturbed factor tables. It is not computed for free. Any additional arithmetic/rounding during inverse construction needs its own error and cost bill. + +A separately supplied approximate inverse with maximum entry error `<=2^-23 w^2` also retains full displacement rank: its displacement error is at most `2^-20 w^2`, half of (12). This is a separate approximation contract, not an assertion that a given inverse routine achieves it. + +## 5. Source parameters enter the uniform box + +Write `L=ln(16p)`. Since `L>=pi` for `p>=4096`, the retained integer-alpha definition gives + + 4L <= a <= 4L+4sqrt(pi L)+pi <= 9L. (13) + +Also `L<=p/8` on this range: the function `p/8-ln(16p)` is increasing for `p>=8`, and at 4096 its value exceeds `512-16>0`, using `ln2<1`. Thus `a<=9p/8`. + +Equations (1) and (8) imply + + a A_l/s_l <= a(2/p^2+1/p^4) + <= 27/(8p) <= 27/32768 < 2^-10. + +Using `exp(-x)>=1-x` gives `1-eta<=U_l<=1`. Moreover + + V_l = w exp(a/s_l), a/s_l<=a/p^4=(16p)^-36` by (13), so (7) ensures the required factor entry error. To see that `b=p` suffices, at `p=4096` the right side before taking the ceiling is `34+36*16=610`; the difference `p-178-36 log2 p` is increasing thereafter, since `ln2>1/2`. The claim for any fixed positive `Cp` is the elementary limit `log p=o(p)`. This is a stable mathematical coefficient-table statement; it does not by itself validate a production program or its setup precision. + +## 6. Matched periodic aliases and the unproved production interface + +The exact source in `BILATERAL-LDU.md`, section 4, defines + + N_source(j,k)=sum_(m in Z) G_(j,k+ms), 0<=j,k=3`, + + |rho*k-q_j+mt| >= |m|t-3/2 >= |m|t/2, + G_(j,k+ms) <= exp(-a m^2 t^2/8). + +Summing both tails geometrically gives the per-entry alias error + + |N_source(j,k)-G_jk| <= 4 exp(-a t^2/8). (15) + +Indeed `m^2>=|m|` and `a t^2/8>=9/8>ln2`. For `t>=32` and `a>=1`, + + 4 exp(-a t^2/8) <= 2^-36 exp(-4a)=2^-36 w^2, (16) + +because `a(t^2/8-4)>=124>38 ln2`. Our source range satisfies these guards. Therefore the tensor of the two **selected principal sections of N_source** is within the proved perturbation budget. Its own inverse retains the all-order rank margin. A further factor-table entry error at most `2^-36 w^2` still leaves total factor error at most `2^-35 w^2<2^-34 w^2`. A sufficient precision for this matched periodic-factor error contract is `b>=ceil(36+36 log2(16p))`; `b=p` still suffices for `p>=4096`. + +This is a direct bound on the particular normalization (14), not an identification of every matrix called a physical Gaussian. It does not identify a principal section of `N_source^-1` with the inverse of a principal section. The selector does not construct the alias sum or its rounded table; setup and production costs remain separate. + +In particular, the tempting canonical #6099 theorem (`inputs/PRODUCTION-GUARD.md`) is for a different admitted production domain. It requires `u>=1`, `u d<=p` and `4d theta>1`. Our fine gap has `theta<=p^-2`. Together these would force `d>p^2/4` and `p>=u d>p^2/4`, impossible for `p>=4`. Thus that named production-plan/error theorem cannot be imported to this family. Its target is also the retained-band `N_w`, not automatically (14). A current producer must separately identify its matrix, prove a compatible entry-error estimate and pay its setup precision. An abstract fine-prime error statement is insufficient to skip those bindings. + +## 7. Meaning, controls and open obligations + +All 24 order types are exhausted algebraically in fixed dimension four. The rational checks corroborate the continuous-box inequalities and perturbation accounting; they are not a finite parameter substitute for the proof. Coarse rounding and balanced equal factors can destroy the rank, demonstrating why an entry-error premise and the chosen phase box matter. + +The continuous-box lemma does not tensorize to three axes. For `B=[[1,1],[w,1]]`, `0=1`, define on Z + +`G_ij=exp(-a[(rho*j-q_i)^2-beta_j^2])`. + +Let `r=exp(2a rho)` and `c=prod_(m>=1)(1-r^-m)>0`. Then G has an exact factorization on bounded bilateral sequences + +`G=L C U`, + +where L is unit lower triangular, U is unit upper triangular, C is diagonal, and all factors and their inverses are bounded. Moreover all six factors are invariant under simultaneous index translation by s. Their periodizations therefore factor the periodic Gaussian matrix N, and + +`||N^-1||_infinity <= c^-4 exp(a/2)/(1-exp(-a rho theta))^2`. + +In particular, at the fixed choice `a=1`, + +`||N^-1||_infinity < 16 theta^-2`. + +Any fixed a>=1, including a=4pi if an integer alpha>=2 is retained, gives a constant times theta^-2. No lower bound proportional to log(1/theta) on a is needed for this norm theorem. + +## 1. Finite-origin factorization and the shift correction + +Write `x_i=r^q_i`, `d_i=exp(-a q_i^2)`, and `e_i=exp(-a rho^2 i^2+a beta_i^2)`. Then `G_ij=d_i x_i^j e_j`, including negative indices, and `d_i x_i^i e_i=1`. + +For a finite square principal interval `[l,r0]`, the Vandermonde powers must begin at zero. The correct shifted row diagonal is **d_i x_i^l**, and the power is `j-l`. This removes a possible erroneous origin-dependent diagonal from the upper factor. + +Put + +`C_i(l)=prod_(l<=k=j`, + +`U^l_ij=(e_j/e_i) h_(j-i)(x_l,...,x_i)`, `j>=i`. + +Here h is the complete symmetric polynomial, h_0=1. Upper and lower inverses are + +`(U^l)^-1_ij=(-1)^(j-i)(e_j/e_i) e_(j-i)(x_l,...,x_(j-1))`, + +`(L^l)^-1_ij=(-1)^(i-j) exp(E_ij) C_i(l)/(C_j(l) D_ij)`, + +where + +`D_ij=prod_(j=j`, + +`|(U^l)^-1_ij|<=c^-1 exp(a/4) exp(-a rho theta(j-i))`, `j>=i`. + +Both use only `-1/2<=beta_k<1/2`. Thus their row norms are at most the corresponding constants divided by `1-exp(-a rho theta)`, uniformly in l and the finite size. + +The row sum of G is uniformly finite, since + +`G_i,i+h <= exp(a/4) exp(-a(rho*|h|-1/2)^2)`. + +The same positive Gaussian bound controls all finite-origin L and U factors. + +## 3. Letting the left origin tend to minus infinity + +For fixed i,j, C_i(l) converges to + +`C_i=prod_(k(i+s,j+s)`. Every displayed factor has the same invariance: ratios `x_k/x_i` are preserved, and the Gaussian/prefix expressions shift together. C_i is s-periodic. + +For an invariant matrix A with bounded absolute row sums, set + +`Pi(A)_ij=sum_(n in Z) A_(i,j+ns)`, `0<=i,j=e^2>7, and the elementary product bound gives `c>=1-sum_(m>=1)r^-m>5/6`. Also `1-exp(-rho theta)>=theta/2` for 0=229 that + + |pi(x)-li(x)| <= 0.2795 x (log x)^(-3/4) + exp(-sqrt(log x/6.455)). + +[Primary source, theorem 2](https://arxiv.org/html/1401.2689v2#S2). +This theorem is a cited mathematical input, not re-proved by the verifier. + +Apply it at the two endpoints of the requested interval about x=t_i. +The logarithmic-integral difference is at least `eta_p x/log x`. The sum +of the two errors divided by this main term is bounded, for a fixed C, by + + C p^2 (log x)^(1/4) exp(-c sqrt(log x)) -> 0. + +Indeed `log x=Theta(p^(1-epsilon))` and epsilon<1 is fixed, so its positive +power dominates log p. Consequently the interval contains eventually at +least `x/(8p^2 log x)` primes. This exceeds d, since x is exponential in +`p^(1-epsilon)` and the denominator and d are polynomial in p. Both target +sizes satisfy the estimate. Their intervals are disjoint, so all d source +primes can be made distinct, odd and coprime to their dyadic targets. + +The deterministic search used by the assembly still works: scan the +intervals and test candidates by trial division. Even scanning all O(r) +candidates with O(sqrt r) divisors and polynomial bit overhead costs +`O(d r^(3/2) poly(p))`. Its logarithm is `O(log p+p/d)=o(p)`, hence setup +is `n^o(1)=o(n)`. No unknown threshold is used as a claim of practicality. +The algorithm can fall back on the retained multiplier for smaller inputs. + +Let `rho_i=t_i/s_i=1+theta_i`. The interval gives + + 1/(4p^2) < theta_i <= 1/(2p^2-1) <= 1/p^2. + +Also `S/T > (1-1/(2p^2))^d >= 1-d/(2p^2) > 1/2` eventually, since +d<=p. Thus the same capacity bound `T/2=1/(4d)`. + +## 2. Polynomial conditioning survives the smaller increment + +Keep `alpha=ceil(sqrt((4/pi) log(16p)))` and `a=pi alpha^2`. Eventually +`4 log(16p)<=a<=5 log(16p)` and alpha^2=Theta(log p). The sharp row estimate +of PR1673, LOG-A-PHASE-SCHUR-AUDIT section 1, is valid for every theta>0: + + ||N-I||_infinity <= exp(-2 a theta)+5 exp(-2a). + +For theta>=1/(4p^2), its row gap is at least `1/(8p^2)` eventually; for +example `1-exp(-2a theta)>=1/(4p^2)` while the second term is O(p^-8). +Omitting the exponentially small nonzero diagonal aliases and setting the +diagonal exactly to one preserves a polynomial gap. Exponentially accurate +band truncation and coefficient rounding preserve half of it. Every principal +narrow block has the same row gap, and its Schur complements retain that gap. + +The broad bound in FORWARD-SMALL-A-AUDIT sections 1-3 already states its +dependence on theta explicitly: + + ||K^-1|| <= O(alpha^5 rho^2 theta^-2 exp(a rho/3)). + +This is polynomial for the new theta. Since rho=1+O(p^-2), the exponential +factor is at most p^2 eventually, theta^-2<=16p^4, and alpha^5 is +polylogarithmic. The finite and bilateral LDU entry bounds are geometric +in index distance and bound both row and column sums. The same estimates +apply to the finite contiguous sections used by elimination. The augmented +forward matrix adds identity hole columns and a Gaussian coupling of bounded +row and column sums. Thus a conservative common eventual bound p^10 covers +the relevant matrices and their inverse norms, in both induced row/column +norms and spectral norm. Polynomially small perturbations preserve it with +slightly larger constants. This bound is independent of the number of cells. + +Physical-prefix elimination still consists of one contiguous prefix and +disjoint future interiors separated by at least the bandwidth. The eliminated +matrix is a direct sum of such sections. A Schur inverse is a principal block +of the corresponding full inverse; its norm is therefore polynomial too. +Schur norms follow from `D-C A^-1 B`. These are the same prefix geometries +used in the retained dense no-pivot boundary argument, with new polynomial +constants. No general stability assertion for structured generators is used. + +## 3. Setup precision must increase; online precision need not + +The old absolute weight precision cannot be retained. For the narrow weights + + w_i=exp(-a(1/4-beta_i^2)/theta), + +the negative logarithm can now be as large as `a/(4 theta)=O(p^2 log p)`. +Rounding these weights absolutely to Cp bits can produce zero. The finite +checker includes a concrete underflow witness; this is a required change. + +Let `L_p=ceil(log2 p)` and let C be a sufficiently large fixed constant. +Use setup precision + + P_setup = C p + 64 p^2 L_p. + +Eventually `a<=16 L_p`, so `a/(4 theta)<=16 p^2 L_p`. Since log 2>1/2, +rounding a weight downward with absolute error at most `2^-P_setup` gives + + |w_hat_i-w_i|/w_i + <= 2^-P_setup exp(a/(4 theta)) + < 2^(-C p). + +The weights remain positive. Increasing C by a fixed amount supplies any +additional polynomial slack needed below. Computing these polynomially many +bits, exponentials, exact anchored ratios and local inverse/factor pages takes +polynomial time in p. Schoolbook arithmetic and ordinary convergent series +already suffice; no use of the improved multiplier at a larger precision is +required for this setup bound. + +Define one globally fixed rounded reference matrix H as in the retained +audit: within each original phase cell use positive rounded weights and a +single rounded, truncated Toeplitz kernel, and across cells use rounded +Gaussian entries, with diagonal exactly one. The weights use P_setup, while +the kernel and the actual online pages need only a sufficiently large +constant times p bits. For distances at most W, weight ratios have logarithmic +range O(aW)=o(p). The truncation tail is bounded directly in the Gaussian +entries, independently of the full-cell weight range. Hence H differs from +the exact Gaussian matrix by `poly(p) 2^(-(C-o(1))p)` in row and column norm. +This preserves the polynomial conditioning in section 2. All actual Schur +and inverse tables are computed for this H, with the same perturbation budget. + +The data circuit never multiplies by the full-cell weights. Use PR1758's +exact fractional-shift identities, whose algebra holds for every theta>0. +On a capped block of length at most B, the narrow remaining chirp has +logarithmic range O(a theta B^2); the broad chirp and its leftover linear +term have range O(b0 theta B^2+b0 theta B), where b0=pi/alpha^2. Each is at +most O(a B^2/p^2). The shifted Toeplitz kernels remain accretive: their shift +gap is at least theta/2, and the explicit symbol bound of PR1758 gives +polynomial inverse norms when theta^-1=O(p^2). Its accretive shallow-circuit +theorem therefore has polylog(p) guard bits per axis, as before. + +The ideal shifted representation and H need not have identical stored +coefficients. Their difference has the bound just established: replace the +old raw `Cp` weight precision by P_setup in the comparison in PR1758 section +2. Local shifted kernels and anchored chirps are generated directly, then +rounded at online precision. Across g axes the uncompleted amplification is + + exp(O(g a B^2/p^2 + g polylog p)). + +Thus O(p)-bit records suffice whenever + + beta + 2 xi - 2 < 1, beta < 1. + +The inverse comparison also stays within the error budget. If an ideal +interior A and the rounded reference H_II differ by Delta, then +`H_II^-1-A^-1=-H_II^-1 Delta A^-1`. Both inverse norms are polynomial; +the error changes only by a polynomial factor. Telescoping through the +constant number of completed factor stages, and through g tensor axes, +uses the stated chirp/prefix guard. Exact identity of their rounded +coefficient lists is neither assumed nor needed. + +Setup arithmetic at P_setup is separate from these records. It is not placed +inside an online motif call or multiplied into the per-record data cost. +PHASE-LAYOUT-AUDIT already permits polynomial coefficient/page generation +per complete microbox and axis, amortized by the superpolynomial inner and +spectator payload. Replacing its polynomial by another fixed polynomial +preserves that argument: `L^g` and every full unused source-axis range exceed +every fixed polynomial in p. The number of pages, capped pieces, axes and +required bits is polynomial. This is an asymptotic amortization, not a claim +that P_setup or the eventual cutoff is practical. + +## 4. Normalize completed maps with powers of two + +The exact Gaussian resampling identity and the coprime source/target +permutations do not require theta to be of order 1/d. They require the +positive separation and invertibility established above. The completed +forward, inverse and diagonal factors can have larger polynomial norms +than in the old parameter family. Divide each such completed map by an +additional dyadic factor of at most `2^ceil(100 log2 p)`. The conservative +p^10 bounds above are then below one. Restore the product of these exact +normalizers at the final scalar shift, together with the retained Gaussian +normalization. This preserves the exact transform identity. + +There are O(d) factors; the added shift has O(d log p)=o(p) bits because +epsilon<1. This also bounds the extra accuracy needed before exact recovery. +At a sufficiently large fixed C, data precision is `C p+o(p)=O(p)`. +Completed groups can be treated as contractions, while their uncompleted +prefixes/suffixes use the chirp and circuit guards of section 3. None of +these changes increases the semantic online dimension exponent C1=1. +Offline arithmetic is paid through the setup amortization, not that interface. +The normalizer is scalar: combine its powers into the group coefficients or +apply one scalar per completed group, rather than introducing a full scan per +axis. A constant number of these operations per group is absorbed by the +retained group-scan row. Global restoration is one already-paid exact shift. + +## 5. A larger but still polynomial locality window + +The old literal row-gap and locality constants must not be reused. A +conservative generic locality argument suffices. For a banded reference +matrix with `||H||_2,||H^-1||_2<=p^10`, put + + Q=I-p^-20 H* H. + +Its eigenvalues lie in `[0,1-p^-40]`. With `J=ceil(p^42)`, the polynomial +inverse `p^-20 sum_(j0`. +The locality polynomial is used in the proof and coefficient setup. The +online algorithm still uses the capped factorization and compiled circuits; +it does not perform J Neumann iterations on each data record. + +An original phase cell now has length Theta(p^2). Capped dyadic carving still +has boundary density `O((W/B) polylog p)`: the additional end-cell contribution +is `O(W log B/p^2)`, dominated when B<=p^2. Clipped physical period cuts and +holes remain boundary. Scalar Schur bandwidth stays O(W), since an eliminated +interior joins only its two neighboring O(W)-size separators. Larger cores +and halos change only fixed powers in offline setup and O(log p) address +fields. Their source axes are still superpolynomial in p. + +## 6. Retained Strassen boundary, circuit and union costs + +Use the explicit Strassen circuit, with `7^16<2^45`, so choose fixed matrix +target exponent `tau=45/16` and `c=(3-tau)/2=3/32`. PR1673's dense boundary +proof and fixed-format absolute-precision argument apply to the new polynomially +conditioned pages. Block scans, permutations, rewinds and linear combinations +remain charged. Boundary density is still W/B, so its cost power remains +`epsilon-xi+(tau-1)/2` and its saving is `c+xi-epsilon`. This applies to general +rounded blocks and needs no structured inverse algorithm. + +The interiors use PR1758's shifted Toeplitz representation and accretive +shallow-circuit theorem, with the smaller theta substituted in the explicit +symbol bound and with section 3's setup precision. Circuit algebra and depth +are unchanged; the condition guard remains polylog(p) per axis because all +inverse norms and theta^-1 are polynomial. + +Retain PR1758's radix-distributed union schedule. Complete lines stay in one +flag class and axis operators commute on distinct tensor factors. Its incidence +identity is `sum_r |S_r|=sum_x |F(x)|=sum_i |U_i|<=g mu V`. Each visit already +moves an O(p)-bit record; flag extraction and O(g log L)-bit headers are absorbed +when beta<1. We use PR1758's per-visit argument, not the obsolete 2 beta<1. +Union cost power remains `epsilon+1/2-xi`. No per-axis scan of the whole union +is added, and no vanishing-union fraction is assumed. Support routing, +whole-neighborhood reservation and interchange retain their stated interfaces. + +## 7. Explicit parameters and every paid row + +Use PR1699's certified endpoint +`b_cert=335950991225108904267/200000000000000000000000`. +Set `b=b_cert-10^-64`, `q=b-10^-64`, `a_eff=(q+b)/2`, +`r0=10^-64`, `zeta=10^-66`, layout slack `s=10^-64`, and stopped-recursion +parameter `stop=10^-70`. The bit endpoint is 0.001733427039589844234749. +Choose + + epsilon=9999999/10000000, + beta=9999997/10000000, + xi=epsilon(1+q)-3/32+s. + +Thus xi=0.90792965478815... . This is an explicit interior point; it does not +assert an attained limiting rate. Since beta0`. The global router also +exceeds the main saving. Every other row has larger slack. The minimum is +`epsilon q`, strictly above the rounded headline. + +Key side conditions are + + 1-beta=3 delta>0, + 1-beta-2(1-epsilon)=delta>0, + epsilon-beta=2 delta>0, + 1-epsilon-r0>0, + 1-(2xi-2)-r0-beta=0.184140990423...>0, + 1/20, 48>43. + +The ledger regenerates the remaining stopped-supplier, endpoint, logarithm +and layout conditions. A separate implementation reconstructs the point and +all nine powers. Fourteen rejected variants include the old theta guard, +old union scan, group=dimension, epsilon=1, an unsupported Strassen exponent +and halo/core choices outside the stated locality witness. These failures +are scoped to this proof and point, not universal lower bounds. + +## 8. Scope, sources and open obligations + +Newly supplied here: the effective fine-prime interval and capacity/search +argument; the polynomial setup-precision replacement; the theta-dependent +conditioning substitution; conservative locality/core choices; scalar +normalization accounting; and the exact parameter composition. + +Retained or cited mathematical inputs are Trudgian's prime theorem; PR1673's +Gaussian identities, bilateral/finite LDU, capped factorization, dense boundary +and layout arguments; PR1758's fractional-shift identities, accretive circuit +theorem and per-visit union schedule; and the admitted finite supplier. +Arithmetic and finite simulations do not prove these general statements. + +The multiplication conclusion remains conditional on the all-size compiler, +common labels, mutable sources, whole-call hosting, semantic online precision +C1=1, fixed tapes, prime-packing implementation, arbitrary-width equal-chunk +interchange, exact recovery and analytic transfer. The changed prime interval, +setup precision and locality scales are proved above rather than silently +substituted into old numeric hypotheses. No independent human review, +proof-assistant verification, practical cutoff or physical multiplication +implementation is claimed. + +Credit Vlado Vojdanovski for PR1673; IdeaOuter, as credited by PR1758, for +fractional-shift interiors and per-visit tag accounting; Jeremy Kothe and +contributors for the package series; and LeverRank for the second schedule +simulation. PR1699's notices retain the complete supplier lineage. PR1672 +published the signed-554 kernel first. New material here was prepared by +Chafik Boukhalfa with substantial OpenAI Codex assistance, under Apache-2.0. + +Open next questions: independently review setup versus online precision, +uniform prefix conditioning and the enlarged halo; formalize the fine-prime +transfer lemma; improve the finite supplier endpoint. Every new endpoint +still requires a complete paid native word and admission. The extreme +eventual threshold is intentionally not presented as a practical algorithm. diff --git a/research/extremal-pair-coefficient-adapter/inputs/SCALAR-PROOF.md b/research/extremal-pair-coefficient-adapter/inputs/SCALAR-PROOF.md new file mode 100644 index 0000000000..fd7f576039 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/inputs/SCALAR-PROOF.md @@ -0,0 +1,186 @@ +# Audit of the actual encoded Gaussian coefficient contract + +JoyboyBrian, with substantial OpenAI Codex assistance; Apache-2.0. +This is a source-relative written proof plus independent-algorithm finite +checks, not formal-kernel or independent human acceptance. It audits PR3851's +encoded producer, not the different host Gaussian.exponential audited in +`gaussian-scalar-backend-audit`. + +## Quantified statement + +For integers P,F>=1, a rational 0<=f<=F, a Boolean growth flag and integer +sigma>=0 (None means zero), the pinned Exponentials.grid_interval returns +integers l<=u such that, with eta=2^-P, + + l eta <= 2^-sigma exp((+1 if growth else -1) pi f) <= u eta, + u-l <= 2. + +Consequently coefficient, which returns l, has downward error <2eta. All +Exponentials constructor, Taylor-range, interval-width and final-width checks succeed +mathematically. Termination is for every finite represented input, with the +encoded Count/Rational operations and ownership semantics retained. There +is no assertion that arbitrary non-admitted input succeeds. In particular +negative f and f>F must be rejected. No global H row-gap theorem follows. + +## Directed primitives and Machin interval + +`quotient(a,b,True)` is ceil(a/b), because it increments precisely for a +nonzero remainder; the ordinary branch is floor. `ceil_shift` performs the +right shift and increments precisely when a discarded bit is one. Reading +beyond the number's right marker does not add a discarded bit. Both preserve +the input head by rewinding. Thus nested downward divisions and nested +upward divisions preserve the corresponding exact rational bounds. + +Write X=4F, k=ceil(log2(8(X+1))), H0=P+X+k+16, c=ceil(log2 H0), +R=P+4X+4k+2c+64, h=2^-R, J=ceil(R/4)+8, N=ceil(R/3)+8. +All are the actual Count computations, including remainder-based ceilings. +For this domain H0>=27, R>=115, R<5H0, N<=R/2, and R>=4k. +For the R<5H0 bound use c<=H0/2, valid for integral H0>=4: +R<=P+4X+4k+H0+64<5(P+X+k+16), since P>=1. + +The actual nested archive's twiddle_setup.arctangent encloses each of J +alternating terms using [floor(term/h),floor(term/h)+1]h. The signs reverse +the endpoint order for negative terms. The next omitted arctangent term +has magnitude at most 1/5^(2J+1)16^J>2^R; +the 239 tail is smaller. Its symmetric one-unit padding is sufficient. +Machin's identity pi=16 atan(1/5)-4 atan(1/239) then encloses pi with width +(20J+40)h<=7Rh. The exact signs and nested source bytes are authenticated. +The classical bounds 325/8 +and pi<22/7 follow from elementary rational series enclosures; the independent +arcsine oracle checks stronger rational bounds without using Machin. + +Multiplication by f and outward quotient yield width at most (7RF+2)h. +The upper x endpoint is =115. +After division by 2^k and outward rounding, the y interval obeys + + Delta_y <= (7R+65)h/32 <= Rh/4, + 0 <= y_lower <= y_upper <= 1/8. + +Indeed 2^k>=32F+8 and the extra shift adds less than 2h. For the range, +X/2^k<=X/(8(X+1)); the missing margin is at least 2^-k>=h. +This derives the actual range check, not just an assumption about exp inputs. + +## Taylor termination, early exit and squaring + +The true positive Taylor terms for every y in the interval are enclosed by +the actual lower/upper recurrence. In real R-grid units, each nested rounding +adds at most 2h per endpoint. Upper terms stay <=1 by induction, since their +next value is <= previous/8+2h<1. For term-width d_j, + + d_j <= d_(j-1)/8 + Delta_y + 4h <= 2Delta_y+5h. + +At early exit the added upper term is <=h; all following exact term ratios +are <=1/8, so the omitted positive tail is <=h/7. At fixed exit after N +updates the tail is <(8/7)2^(-3(N+1))=1 and width +E0<=N(2Delta_y+5h)+h<=R^2 h. Comparing upper terms with the exact series +at y_upper gives rounding excess <=(16/7)Nh+h<=3Nh. Thus its upper endpoint +u0 satisfies log(u0)<=y_upper+3Nh. + +Let li,ui denote the endpoints after i outward squarings. They remain >=1, +and log(u_(i+1))<=2log(ui)+h. Consequently + + sum_(i=0)^(k-1) log(ui) + <= (2^k-1)y_upper + 2^k(3N+1)h < X+1. + +The last inequality follows from 2^k y_upper <= x_upper+2^k h and +2^k(3N+2)h<1. To see the latter uniformly, use k<=R/4, +3N+2<=2R<=2^(R/2), so the product is <=2^(-R/4)<1. +Widths satisfy E_(i+1)<=2ui Ei+2h. Since each factor 2ui>=2, +unrolling the recurrence and summing the reciprocal geometric majorant gives + + Ek <= 2^k exp(X+1)(R^2+2)2^-R + < 2^(-P-2X-3k-57) <= 2^(-P-83). + +Here R^2+2<=32H0^2, H0<=2^c and exp(X+1)<2^(2X+2). +This proves the positive_interval strict width check (=|beta_j|, including ties. +Thus f=u[(rho*delta+beta_i)^2-beta_j^2]>=0, while +f<=u(rho*w+1/2)^2. Direct and wrapped branches both satisfy the prepared +domain. The zero-distance kernel and the H matrix diagonal bypass the backend +by returning exactly one. The normalized diagonal still invokes growth, +including at beta=0. +This proves the coefficient-call domain for every admitted Axis tuple. It +does not prove nonzero rounded weights for arbitrary P: positive exact +weights may truncate to zero. That is a separate Axis admission check and +production precision obligation, expressly retained. + +## Independent checks and costs + +The oracle uses pi=6 asin(1/2), a positive series whose consecutive-term +ratio is <1/4, so eight times the next term bounds the pi tail. It computes +exp(-x) by alternating even/odd rational sums at x<=1/4, applies outward +dyadic squaring, and obtains growth by reciprocal. Thus the source positive +Taylor/Machin paths are not their own numerical oracle. Every source output +must contain the entire finer oracle interval; mere overlap is insufficient. +Oracle source/self-tests are frozen before source-output capture. This is +algorithmic separation within one AI-assisted contribution, not a claim of +independent authorship or human verification. + +The adapter executes unchanged encoded Axis construction and isolated boundary +calls with no_decode active. It records raw arguments, endpoints, setup grid +and branch counters; decodes only after protected execution returns. It also +checks the actual argument multiset against the rational formulas above, +including reflection, wrapped differences, growth and normalization. It +supplies no approximation or host arithmetic to the source producer. + +The retained ordinary-arithmetic bound per coefficient preparation/application +is O(R^3+(R+B_f)^2), plus O(sigma+R) for the explicit final shift scan and +storage for its encoded extent. Machin and O(R) Taylor iterations operate on +O(R+X+B_f)-bit carriers, X<=R; k squarings and reciprocal divisions fit that +coarse bound. It is not a bit-length-only tariff for enormous sigma. Actual +Axis repeats coefficients and pays matrix setup/storage; the audit does not +claim a free cache, a new machine-step leading constant or faster setup. +Independent-oracle memory and observer snapshots are verification overhead. + +## Open next questions + +Compose these directed scalar errors with the actual weight ratios and +cross-cell entries to obtain the production old-H perturbation bound, then +bind the ideal matrix row gap. Preserve the separate positive rounded-weight +admission and exact arithmetic/movement contracts. The present theorem does +not install global row dominance, LU caps, online Core error, tensor/CRT +admission or a multiplication theorem, and changes no selected frontier. + +Credit Jose Manuel/jmbarrancoml PR3851 for the physical encoded producer and +its original precision proof, the retained physical-ring Machin runtime and +Gaussian lineage, and the distinct prior scalar-backend audit. Frozen inputs +and source-specific notices remain unchanged. diff --git a/research/extremal-pair-coefficient-adapter/inputs/UPSTREAM-NOTICE b/research/extremal-pair-coefficient-adapter/inputs/UPSTREAM-NOTICE new file mode 100644 index 0000000000..544634f5f3 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/inputs/UPSTREAM-NOTICE @@ -0,0 +1,27 @@ +RaD source-framed h53 research review + +Prepared for publication by the RaD project (hipotures). +This limited contribution builds on the original OpenAI manuscript and +Douglas Colkitt's integer-multiplication research framework. Retain their +notices and the repository Apache-2.0 license. + +The nonzero auxiliary-source-frame lemma is eumemic's PR13 contribution, +with its recorded substantial Claude assistance. We also acknowledge +icekylinx's batching and mixed-width/dependency framework (PR10), +Bortlesboat's aligned pairing (PR2), dleen's retained totals/stage sharing +(PR4), eumemic's earlier complex/resampling/center work (PR3/5/6), Zhihao +Chen's ternary producers and nested basis (PR7/16), Rohan Arun's geometry, +matching and subsequent compositions (PR8/9/11/12/14/17), and Aurel Prosz's +parameter analysis (PR1). PR7's substantial GPT-6 Astra assistance and +all previous AI assistance disclosures remain credited to their sources. +Their precise relationships to the selected binary graph are distinguished +in README.md; acknowledging related work does not assert that every such +producer or proof was imported. + +David Harvey and Joris van der Hoeven's analytic multiplication work is +acknowledged through the inherited manuscript/audit references. + +This is a conditional research draft, not formal verification or an +OpenAI endorsement. No worldwide priority or current-best claim is made. + +Analysis and pull request prepared with Codex and GPT-6.1-Sol Ultra. diff --git a/research/extremal-pair-coefficient-adapter/review/FREEZE.json b/research/extremal-pair-coefficient-adapter/review/FREEZE.json new file mode 100644 index 0000000000..877e09c955 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/FREEZE.json @@ -0,0 +1,68 @@ +{ + "assets": { + "HISTORY-RESULT-O.json": { + "bytes": 2600, + "sha256": "627762c12f864b0d77a9876bcab070f341c784319b39963e7eaf801768a4c93e" + }, + "HISTORY-RESULT.json": { + "bytes": 2600, + "sha256": "627762c12f864b0d77a9876bcab070f341c784319b39963e7eaf801768a4c93e" + }, + "REVIEW.md": { + "bytes": 10032, + "sha256": "aae570bcb4102eb69390d53a03ca9e5181df62df3c421d198e48066d30fbec34" + }, + "SOURCE-CHECK.json": { + "bytes": 3632, + "sha256": "9f54fc853d18f95801dd839ebb13ac744dcd8e26306e6f0a15aff611562b1a6e" + }, + "check_history.py": { + "bytes": 5996, + "sha256": "83d10679234a59e46ba9e59ff13421f95c8535f3a8648286b7439ddea0855480" + }, + "runtime-slices/MANIFEST.json": { + "bytes": 5168, + "sha256": "315ff6bc242a66783fd7a4b7398f6e5f6cd70ae43b17886c9403177b2f83cbe1" + }, + "runtime-slices/cardinal_counts.py": { + "bytes": 1861, + "sha256": "59ddeac102a0cc51fa49b15aae6aeb68cd68ed217fa974ce916372a177d2ec8f" + }, + "runtime-slices/cardinality.py": { + "bytes": 3936, + "sha256": "505d5e560c5a507e6184edcc19a87cf1fed243eb34a5cb21fbe1e4fe017e7f22" + }, + "runtime-slices/counts.py": { + "bytes": 1695, + "sha256": "00b476dbda0e8cc99886bf794439e1cb9e775f435f599a3557e99321fe084069" + }, + "runtime-slices/records.py": { + "bytes": 9888, + "sha256": "0c9c4b23e998597fb877bb1a29da69ac869b68262abe635b162b4dba9c69b372" + }, + "runtime-slices/router_metadata.py": { + "bytes": 8205, + "sha256": "a0c807471cff33d609cec83b1c63e3fc4d98dab24b7df0911a0ddadd113e99f6" + }, + "runtime-slices/scratch_pool.py": { + "bytes": 5952, + "sha256": "41f1eb93652b7174c3b02f95f70e1a9ce2e2aed0a729e725167c8f226e65d8db" + }, + "runtime-slices/session.py": { + "bytes": 5874, + "sha256": "45ee809b27a69ca5576361922fd2760f568c9a98864d4c55c4fee3003ee3c9ad" + } + }, + "base": "e54523517d0f03e58352e647c403a5af3e525a57", + "commands": [ + "python check_history.py", + "python -O check_history.py" + ], + "corrections": "Simplified storage requires fresh/bounded private histories; retained prior stock stays explicit. Tables.close retires its nine owners but every other pool lease must also close before pool.empty.", + "independent_execution_scope": "Exact-source cleanup/history/lease surfaces; scalar author normal/-O receipts inspected, not rerun", + "normal_optimized_identical": true, + "reviewed_adapter_sha256": "d2fc45eaca3a23a02a681df93d4412a0e9b48defa0c3800d6aa22a16263c94b6", + "reviewed_proof_sha256": "c2743b821b0fd522adf82db35ead7f0e8e3db3b8a5833a61e0d89b2b5840fff2", + "reviewed_verifier_sha256": "dfde9da9e8ecc5f8c874ad8e448e1c7340623060f4889b6a240f845da640e12b", + "status": "PASS" +} diff --git a/research/extremal-pair-coefficient-adapter/review/HISTORY-RESULT-O.json b/research/extremal-pair-coefficient-adapter/review/HISTORY-RESULT-O.json new file mode 100644 index 0000000000..7498a716ba --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/HISTORY-RESULT-O.json @@ -0,0 +1,90 @@ +{ + "cases": [ + { + "binary_digits": 1, + "clear_actions": 17, + "empty_actions": 8, + "entry_capacity": 1, + "marker_actions": 10, + "retained_capacity": 3 + }, + { + "binary_digits": 7, + "clear_actions": 47, + "empty_actions": 8, + "entry_capacity": 1, + "marker_actions": 10, + "retained_capacity": 9 + }, + { + "binary_digits": 31, + "clear_actions": 167, + "empty_actions": 8, + "entry_capacity": 1, + "marker_actions": 10, + "retained_capacity": 33 + }, + { + "binary_digits": 1, + "clear_actions": 17, + "empty_actions": 8, + "entry_capacity": 257, + "marker_actions": 10, + "retained_capacity": 257 + }, + { + "binary_digits": 7, + "clear_actions": 47, + "empty_actions": 8, + "entry_capacity": 257, + "marker_actions": 10, + "retained_capacity": 257 + }, + { + "binary_digits": 31, + "clear_actions": 167, + "empty_actions": 8, + "entry_capacity": 257, + "marker_actions": 10, + "retained_capacity": 257 + }, + { + "binary_digits": 1, + "clear_actions": 17, + "empty_actions": 8, + "entry_capacity": 65537, + "marker_actions": 10, + "retained_capacity": 65537 + }, + { + "binary_digits": 7, + "clear_actions": 47, + "empty_actions": 8, + "entry_capacity": 65537, + "marker_actions": 10, + "retained_capacity": 65537 + }, + { + "binary_digits": 31, + "clear_actions": 167, + "empty_actions": 8, + "entry_capacity": 65537, + "marker_actions": 10, + "retained_capacity": 65537 + } + ], + "conclusion": "Blank historical capacity contributes resident stock but is not rescanned by these cleanup methods; fresh or bounded histories justify the simplified current-parameter space bound.", + "controls": [ + "distant-dirty-tail-survives-origin-empty-check", + "large-old-capacity-remains-after-short-clear", + "returned-output-retirement-does-not-release-borrowed-live-lease" + ], + "scope": "Exact retained cleanup methods plus accounting-only Meter; no exponential arithmetic, no full production replay, and no dirty-tail erasure claim.", + "source_pins": { + "cardinality.py": "505d5e560c5a507e6184edcc19a87cf1fed243eb34a5cb21fbe1e4fe017e7f22", + "records.py": "0c9c4b23e998597fb877bb1a29da69ac869b68262abe635b162b4dba9c69b372", + "scratch_pool.py": "41f1eb93652b7174c3b02f95f70e1a9ce2e2aed0a729e725167c8f226e65d8db", + "session.py": "45ee809b27a69ca5576361922fd2760f568c9a98864d4c55c4fee3003ee3c9ad" + }, + "status": "PASS" +} diff --git a/research/extremal-pair-coefficient-adapter/review/HISTORY-RESULT.json b/research/extremal-pair-coefficient-adapter/review/HISTORY-RESULT.json new file mode 100644 index 0000000000..7498a716ba --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/HISTORY-RESULT.json @@ -0,0 +1,90 @@ +{ + "cases": [ + { + "binary_digits": 1, + "clear_actions": 17, + "empty_actions": 8, + "entry_capacity": 1, + "marker_actions": 10, + "retained_capacity": 3 + }, + { + "binary_digits": 7, + "clear_actions": 47, + "empty_actions": 8, + "entry_capacity": 1, + "marker_actions": 10, + "retained_capacity": 9 + }, + { + "binary_digits": 31, + "clear_actions": 167, + "empty_actions": 8, + "entry_capacity": 1, + "marker_actions": 10, + "retained_capacity": 33 + }, + { + "binary_digits": 1, + "clear_actions": 17, + "empty_actions": 8, + "entry_capacity": 257, + "marker_actions": 10, + "retained_capacity": 257 + }, + { + "binary_digits": 7, + "clear_actions": 47, + "empty_actions": 8, + "entry_capacity": 257, + "marker_actions": 10, + "retained_capacity": 257 + }, + { + "binary_digits": 31, + "clear_actions": 167, + "empty_actions": 8, + "entry_capacity": 257, + "marker_actions": 10, + "retained_capacity": 257 + }, + { + "binary_digits": 1, + "clear_actions": 17, + "empty_actions": 8, + "entry_capacity": 65537, + "marker_actions": 10, + "retained_capacity": 65537 + }, + { + "binary_digits": 7, + "clear_actions": 47, + "empty_actions": 8, + "entry_capacity": 65537, + "marker_actions": 10, + "retained_capacity": 65537 + }, + { + "binary_digits": 31, + "clear_actions": 167, + "empty_actions": 8, + "entry_capacity": 65537, + "marker_actions": 10, + "retained_capacity": 65537 + } + ], + "conclusion": "Blank historical capacity contributes resident stock but is not rescanned by these cleanup methods; fresh or bounded histories justify the simplified current-parameter space bound.", + "controls": [ + "distant-dirty-tail-survives-origin-empty-check", + "large-old-capacity-remains-after-short-clear", + "returned-output-retirement-does-not-release-borrowed-live-lease" + ], + "scope": "Exact retained cleanup methods plus accounting-only Meter; no exponential arithmetic, no full production replay, and no dirty-tail erasure claim.", + "source_pins": { + "cardinality.py": "505d5e560c5a507e6184edcc19a87cf1fed243eb34a5cb21fbe1e4fe017e7f22", + "records.py": "0c9c4b23e998597fb877bb1a29da69ac869b68262abe635b162b4dba9c69b372", + "scratch_pool.py": "41f1eb93652b7174c3b02f95f70e1a9ce2e2aed0a729e725167c8f226e65d8db", + "session.py": "45ee809b27a69ca5576361922fd2760f568c9a98864d4c55c4fee3003ee3c9ad" + }, + "status": "PASS" +} diff --git a/research/extremal-pair-coefficient-adapter/review/REVIEW.md b/research/extremal-pair-coefficient-adapter/review/REVIEW.md new file mode 100644 index 0000000000..80f3af1c13 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/REVIEW.md @@ -0,0 +1,185 @@ +# Independent review of the extremal coefficient adapter + +Status: PASS, including the corrected physical-history and shared-pool +lifetime contracts recorded below. +Prepared for Jerry Chen / @CubeJerry with substantial OpenAI assistance. +Base `e54523517d0f03e58352e647c403a5af3e525a57`. +Adapter SHA256: +`d2fc45eaca3a23a02a681df93d4412a0e9b48defa0c3800d6aa22a16263c94b6`. +Final reviewed proof hash is recorded in `FREEZE.json`. + +## Verdict and independence boundary + +The unchanged #6085 scalar contract supplies exactly the isolated calls +needed here. The new adapter's encoded argument construction, precision, +output ordering and ownership compose with A12's selected two-axis +coefficient-error premise, including the matched periodic aliases. +This conclusion retains the stated scalar/Count/Rational/ownership model +and source-parameter admission. It does not assert a complete Gaussian +producer, full source compiler, new kappa or unconditional multiplication. + +I independently read the canonical scalar proof and actual exponential, +rational and loader code, and reviewed the new adapter and final error/cost +argument. I checked the frozen actual-source receipt against its exact +arguments and policy. I did not duplicate the author's scalar execution or +claim its predecessor oracle as an independent reviewer implementation. +The only new executed checker here is a small exact-source cleanup/history +surface check, introduced to resolve a concrete ambiguity in the space bill. + +`SOURCE-CHECK.json` authenticates the six runtime inputs and five retained +proof inputs, including the original archives. The cleanup methods were +selectively extracted through the exact nested archive chain; the path and +hash of every retained slice appear in `runtime-slices/MANIFEST.json`. +No runtime source was edited and no archive was downloaded for this review. + +## Scalar admission and the actual source pair + +#6085 quantifies all represented P,F>=1 and rational 0<=f<=F for isolated +Exponentials calls. Its decay branch returns a downward approximation with +error strictly below `2*2^-P`, not necessarily the exact irrational floor. +The Axis and #6099 ProductionPlan guards are not antecedents of that +isolated primitive. The import-time authenticated-runtime guard still is. + +For u=alpha^2 and integer `1=(16p)^-36`; at p>=4096, +`p>=30+36 log2(16p)` implies `2^(-p-7)<=2^-37 w^2`. +The gap increases with p. This uses the actual retained alpha choice; +the adapter's broader guard `alpha^2<=4p` alone is not a rank-admission +condition. + +The source periodization is the exact matched Pi(G) from BILATERAL-LDU, +not every matrix bearing a Gaussian label. Its selected-pair alias error +is at most `4exp(-a t^2/8)`. With t>=32 and a>=1, +`a(t^2/8-4)>=124>39ln2`, so it is at most `2^-37 w^2`. +Adding the strict scalar error proves `<2^-36 w^2` relative to each +selected periodic factor, including exact-one output diagonals. This +closes the particular A12 further-table-error premise with its stated +margin. Tensor materialization and inversion are mathematical consequences +or separate services; neither implementation is provided for free. + +The frozen executable packet has p=1, alpha=2, P=9, F=8 and R=251. Its +four arguments are 12/101, 804/101, 12/103 and 820/103, and its output is +`[512,352,0,512,512,355,0,512]`. Both zero coefficients are legitimate for +this broad low-precision producer domain. The packet is explicitly outside +A12's large-p margin domain and cannot certify the rank conclusion. + +## Complete local arithmetic and output bill + +The explicit guard u<=4p makes X<=32p. The stated bounds on k,H0,c and +`R<=129p+6ceil(log2p)+122<=257p` hold even at p=1. With B the maximum +input bit length, accepted numerator lengths are at most 2B+3 and denominator +lengths at most B. Thus the inherited scalar tariff remains +`O(R^3+(R+B_f)^2)` with `B_f=O(B+log p)`, and four calls plus one setup give +`O(p^3+(p+B)^2)`. Copies, comparisons, products, four diagonal fields and +the nine returned Count records are paid in that bound. + +B cannot be dropped from A12's lower bound on s. An additional full-source +upper-size interface is needed for the simpler O(p^3) form. The result is +in the retained encoded elementary-arithmetic model; it is not an emitted +new native ROM or a complete multiplier tariff. + +## Correction: physical history and actual revisit work + +The first draft permitted arbitrary earlier scratch history while claiming +total storage O(p+B). That conclusion needed a stronger entry condition. +Both lead and independent review identified the gap. The corrected proof +uses fresh private grants, or an explicit current-size entry-history bound, +for its simplified total-space statement. For arbitrary reused blank roles +it keeps `sum_tau max(H_tau,C(R+B))` on the actual owners. Any extra requested +full-history sweep or transport must pay its actual extent. + +The exact nested runtime resolves whether a further time term is automatic: + +1. Cardinal Count inherits Natural.close, which delegates to its tape. +2. A private Count tape is a Lease; Lease.clear calls the physical Tape.clear + and ends that lease without deleting or shortening the physical backing. +3. Tape.clear rewinds, erases the contiguous current nonblank prefix through + RIGHT, stops at the first BLANK and rewinds. It does not scan an older + already-blank far tail. +4. ScratchPool.acquire/empty and session.erase_marker inspect origin cells. + They do not scan the old blank capacity either. + +For ell nonblank cells through RIGHT and a head at 1, the actual clear costs +exactly `5ell+7` native reads/writes/moves. Earlier blank capacity changes +resident stock, but not that clear cost. A fresh pool starts each tape at +only LEFT/head 1; the stated O(p+B) history bound then follows from the +maximum carrier size during this invocation, not from final output length. + +`check_history.py` executes those exact retained method ASTs, with only an +accounting Meter supplied by the checker. Nine cases cover binary lengths +1, 7, 31 and old capacities 1, 257, 65537; the exact clear counts are invariant +under old capacity, while the old backing length remains. Normal and +optimized receipts match. These are cleanup-surface checks, not another +exponential or full-source execution. + +A negative control supplies a distant dirty cell beyond an initial blank. +The origin-only pool-empty guard succeeds while that dirty cell survives; +the independent whole-history oracle detects it. This confirms why the +reused-cohort premise must be *blank* and why pool.empty alone is not a +certificate of arbitrary dirty-tail erasure. Such dirty entry histories +are outside the admitted ownership invariant. + +## Borrowing, returned owners and final retirement + +The successful path preserves the six borrowed Count bodies and canonical +heads. Temporary F/P remain live until all calls end; scalar fields close +before those parameters. Every argument owns copied numerator/denominator +carriers, so its close cannot consume a source parameter. Nine distinct +returned Counts remain live and must be explicitly consumed or retired. + +Tables.close retires those outputs. It is necessary, but not by itself +sufficient, for emptying a shared pool: every other live lease must also +have been released by its owner. Borrowed input Counts may themselves be +live leases in that same pool and must remain untouched by this adapter. +The primary fixture creates its input Counts before installing the private +pool, so it correctly observes exactly nine pool leases at return. The +general interface does not infer that global live count. A separate tiny +retained-ABI control verifies that retiring an output preserves a borrowed +live lease and that pool.empty rejects until the remaining owner releases it. + +The eager evaluation of several constructors before entering `owned(...)` +does not establish arbitrary allocation-fault atomicity. The final theorem +correctly retains adequate runtime ownership/capacity, successful admitted +execution and its explicit guard-failure scope, excluding malformed tapes, +allocation failures and asynchronous rollback. + +## Reproduction and remaining obligations + +Run the small independent history check with: + +```sh +python check_history.py +python -O check_history.py +``` + +It is read-only by default; `--write PATH` explicitly records output. +Its source slices are byte-pinned before loading. The author's separate +actual scalar normal/-O receipts were inspected and match; they were not +rerun by this reviewer. + +Exact source/primality/alpha admission, source-index acquisition and routing, +arbitrary phases or dimensions, inverse algorithms, payload transport, +global rounded-H identity and whole-caller/fixed-tape compilation remain +separate. The production-plan guard is bypassed locally, not repaired +globally. All five foundational assumptions and the selected kappa remain. diff --git a/research/extremal-pair-coefficient-adapter/review/SOURCE-CHECK.json b/research/extremal-pair-coefficient-adapter/review/SOURCE-CHECK.json new file mode 100644 index 0000000000..8c4c2b3f5b --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/SOURCE-CHECK.json @@ -0,0 +1,85 @@ +{ + "adapter_sha256": "d2fc45eaca3a23a02a681df93d4412a0e9b48defa0c3800d6aa22a16263c94b6", + "base": "e54523517d0f03e58352e647c403a5af3e525a57", + "nested_history_manifest_sha256": "315ff6bc242a66783fd7a4b7398f6e5f6cd70ae43b17886c9403177b2f83cbe1", + "primary_normal_optimized_identical": true, + "primary_normal_receipt_sha256": "547f942f9c45207fc5dddcb2abda2c4b30dd81312d2eb40cd7104e593173b36d", + "primary_scalar_replay_by_this_reviewer": false, + "proof_inputs": [ + { + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "local": "inputs/FINE-PRIME-PADDING.md", + "path": "research/native-kappa-30201655/modern-sources/FINE-PRIME-PADDING.md", + "sha256": "47d1b1b4df28aadda3cd6bdeb1fbc47290595e9208cd09c1a1f338520d33fdce" + }, + { + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "local": "inputs/BILATERAL-LDU.md", + "path": "research/native-kappa-30201655/modern-sources/BILATERAL-LDU.md", + "sha256": "0d65e66d227464dda1a19f781ae0a0be671cbfd347c41e37ec954f3d629d8a77" + }, + { + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "local": "inputs/SCALAR-PROOF.md", + "path": "research/encoded-gaussian-directed-coefficient-audit/PROOF.md", + "sha256": "b63efb46b31a43d6be1ba2951709e270deca3390fe9d2dd46a235f2672bfc58a" + }, + { + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "local": "inputs/UPSTREAM-NOTICE", + "path": "references/semantic-bulk/rad20/NOTICE", + "sha256": "82fc72aff49769ae82a8ce886846d9bd0601827a09c955042d26a61177d14369" + }, + { + "commit": "702c7616667c5f4e583eb73687944d148b7a1ccf", + "local": "inputs/A12-PROOF.md", + "path": "research/extremal-phase-two-axis-margin/PROOF.md", + "sha256": "03da374ebde2644b883b2398e80112989719c2a0edb7394cc43b2abd26fa447c" + } + ], + "runtime_inputs": [ + { + "bytes": 5425, + "exact_pinned_bytes": true, + "git_blob": "ce521f91997775e189f984ba7dd68a15bf9ecd9b", + "path": "research/physical-gaussian-core/gaussian_sources.py", + "sha256": "c5889a97a11a9c6c6c44deb8a2042498ddc3f55703de15269132b8f198e24b15" + }, + { + "bytes": 9852, + "exact_pinned_bytes": true, + "git_blob": "8f0f32d7090554b47c112142e300c88fb8e5db4d", + "path": "research/physical-gaussian-core/gaussian_exponentials.py", + "sha256": "f7a27cacbb27c0cfa4a63054e83feba2beae91b3fa9d3c37f903620b3899e67b" + }, + { + "bytes": 8064, + "exact_pinned_bytes": true, + "git_blob": "053404d91c1bef0d4bb0f6647491847bf5879aaf", + "path": "research/physical-gaussian-core/gaussian_rationals.py", + "sha256": "6f9a380c8c7b4233c3bc338a6206d65cc85bee2e4f5625c2a212065f04f4b73d" + }, + { + "bytes": 54548480, + "exact_pinned_bytes": true, + "git_blob": "885794cf3328941209034ee2d946ed76dbea8ce3", + "path": "research/physical-gaussian-core/inputs/word-export.tar", + "sha256": "d428e8b6aef4d348fa2e922ca64c4cfd634bbb2f0c150033273e65fcf4600b49" + }, + { + "bytes": 71680, + "exact_pinned_bytes": true, + "git_blob": "48dc77f5145d649bfed6745e38ab18b11772d597", + "path": "research/physical-gaussian-core/inputs/branchfree-source.tar", + "sha256": "e6cdacd59a067189a99bfe03f4448913bb8d518ed4a9b1d981a68c5c666529c7" + }, + { + "bytes": 2760, + "exact_pinned_bytes": true, + "git_blob": "99d60642405f814a500b29b52d862baaf6156d94", + "path": "research/encoded-gaussian-directed-coefficient-audit/oracle.py", + "sha256": "87dd13add789995c763ff1f4f059ac23d1b221fff2699daaa38566510f3d1022" + } + ], + "status": "SOURCE_AND_FROZEN_PACKET_REVIEW_PASS" +} diff --git a/research/extremal-pair-coefficient-adapter/review/check_history.py b/research/extremal-pair-coefficient-adapter/review/check_history.py new file mode 100644 index 0000000000..4f816a532e --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/check_history.py @@ -0,0 +1,96 @@ +"""Tiny exact-source Count/lease cleanup surfaces, not a scalar replay. + +Only the frozen class/function ASTs are loaded; Meter is observer accounting. +Old capacity and invalid dirty-tail states are explicit input fixtures. +Apache-2.0; prepared for @CubeJerry with substantial OpenAI assistance. +""" +import argparse +import ast +from contextlib import contextmanager +from hashlib import sha256 +import json +from pathlib import Path + + +def need(ok,message): + if not ok:raise ValueError(message) + + +class Meter: + def __init__(self):self.reads=self.writes=self.moves=0 + def total(self):return self.reads+self.writes+self.moves + + +def selected(path,names,namespace): + raw=path.read_bytes();tree=ast.parse(raw) + nodes=[node for node in tree.body if isinstance(node,(ast.ClassDef,ast.FunctionDef)) and node.name in names] + need({node.name for node in nodes}==set(names),'complete exact-source AST selection') + exec(compile(ast.Module(body=nodes,type_ignores=[]),str(path),'exec'),namespace) + + +def main(): + ap=argparse.ArgumentParser();ap.add_argument('--write',type=Path);args=ap.parse_args() + root=Path(__file__).resolve().parent/'runtime-slices' + pins={'records.py':'0c9c4b23e998597fb877bb1a29da69ac869b68262abe635b162b4dba9c69b372', + 'scratch_pool.py':'41f1eb93652b7174c3b02f95f70e1a9ce2e2aed0a729e725167c8f226e65d8db', + 'cardinality.py':'505d5e560c5a507e6184edcc19a87cf1fed243eb34a5cb21fbe1e4fe017e7f22', + 'session.py':'45ee809b27a69ca5576361922fd2760f568c9a98864d4c55c4fee3003ee3c9ad'} + for name,digest in pins.items():need(sha256((root/name).read_bytes()).hexdigest()==digest,'frozen nested source '+name) + ns=dict(Meter=Meter,need=need,ZERO=0,ONE=1,LEFT=2,RIGHT=3,BLANK=4,RETURN=13,contextmanager=contextmanager) + selected(root/'records.py',{'Tape'},ns) + selected(root/'scratch_pool.py',{'Lease','ScratchPool'},ns) + selected(root/'cardinality.py',{'Natural'},ns) + selected(root/'session.py',{'erase_marker'},ns) + cases=[] + for history in(1,257,65537): + for digits in(1,7,31): + pool=ns['ScratchPool'](2) + for tape in pool.tapes:tape.cells.extend([4]*(history-len(tape.cells))) + lease=pool.acquire();owner=lease.physical + for bit in range(digits):lease.append(1 if bit==digits-1 else bit%2) + lease.append(3);lease.rewind() + current=digits+1;before=owner.meter.total();capacity=len(owner.cells) + view=object.__new__(ns['Natural']);view.tape=lease;view.close() + clear_cost=owner.meter.total()-before + need(clear_cost==5*current+7,'exact active-prefix close invoice') + need(owner.head==1 and len(owner.cells)==capacity==max(history,current+1),'physical capacity retained') + need(not pool.live and all(x==4 for x in owner.cells[1:]),'whole admitted history blank after close') + before=sum(t.meter.total() for t in pool.tapes);pool.empty() + need(sum(t.meter.total() for t in pool.tapes)-before==8,'two-owner empty guard is origin-only') + before=sum(t.meter.total() for t in pool.tapes) + for tape in pool.tapes:ns['erase_marker'](tape) + need(sum(t.meter.total() for t in pool.tapes)-before==10,'two markers have constant retirement cost') + need(all(t.head==1 and all(x==4 for x in t.cells) for t in pool.tapes),'entire admitted capacity blank') + cases.append(dict(entry_capacity=history,binary_digits=digits,clear_actions=clear_cost, + retained_capacity=capacity,empty_actions=8,marker_actions=10)) + for digits in(1,7,31): + need(len({x['clear_actions'] for x in cases if x['binary_digits']==digits})==1,'no historical-capacity time scan') + # A distant dirty cell is outside the blank-history premise and survives. + pool=ns['ScratchPool'](1);tape=pool.tapes[0];tape.cells.extend([4]*256);tape.cells[-1]=1 + lease=pool.acquire();lease.append(1);lease.append(3);lease.rewind() + view=object.__new__(ns['Natural']);view.tape=lease;view.close();pool.empty() + need(tape.head==1 and tape.cells[-1]==1 and not all(x==4 for x in tape.cells[1:]), + 'origin-only empty guard does not establish arbitrary dirty-tail cleanup') + # The exact retained ABI never promises that clearing releases old stock. + need(cases[-1]['retained_capacity']>1000*(cases[-1]['binary_digits']+1),'short output cannot bound old stock') + # Returned results do not own an unrelated borrowed live lease in the pool. + pool=ns['ScratchPool'](2);borrowed=pool.acquire();borrowed.append(1);borrowed.append(3);borrowed.rewind() + original=bytes(borrowed.physical.cells),borrowed.head + result=pool.acquire();result.append(0);result.append(3);result.rewind() + view=object.__new__(ns['Natural']);view.tape=result;view.close() + try:pool.empty() + except ValueError as error:need('closes all scratch leases' in str(error),'unreleased borrowed lease blocks pool empty') + else:raise ValueError('output retirement incorrectly emptied a shared pool') + need(borrowed.active and (bytes(borrowed.physical.cells),borrowed.head)==original,'borrowed live lease preserved') + borrowed.clear();pool.empty() + result=dict(status='PASS',source_pins=pins,cases=cases, + controls=['distant-dirty-tail-survives-origin-empty-check','large-old-capacity-remains-after-short-clear', + 'returned-output-retirement-does-not-release-borrowed-live-lease'], + conclusion='Blank historical capacity contributes resident stock but is not rescanned by these cleanup methods; fresh or bounded histories justify the simplified current-parameter space bound.', + scope='Exact retained cleanup methods plus accounting-only Meter; no exponential arithmetic, no full production replay, and no dirty-tail erasure claim.') + text=json.dumps(result,indent=2,sort_keys=True)+'\n' + if args.write:args.write.write_text(text) + print(text,end='') + + +if __name__=='__main__':main() diff --git a/research/extremal-pair-coefficient-adapter/review/runtime-slices/MANIFEST.json b/research/extremal-pair-coefficient-adapter/review/runtime-slices/MANIFEST.json new file mode 100644 index 0000000000..d793ebd9cb --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/runtime-slices/MANIFEST.json @@ -0,0 +1,53 @@ +{ + "archive_sha256": "d428e8b6aef4d348fa2e922ca64c4cfd634bbb2f0c150033273e65fcf4600b49", + "files": [ + { + "bytes": 1861, + "file": "cardinal_counts.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/inputs/sparse-export.tar :: research/physical-sparse-xor-batch/inputs/compact-export.tar :: research/physical-complex-compact/inputs/pr2899.tar :: inputs/pr2809.tar :: inputs/pr2753/predecessor/cardinal_counts.py", + "sha256": "59ddeac102a0cc51fa49b15aae6aeb68cd68ed217fa974ce916372a177d2ec8f" + }, + { + "bytes": 1695, + "file": "counts.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/inputs/sparse-export.tar :: research/physical-sparse-xor-batch/inputs/compact-export.tar :: research/physical-complex-compact/inputs/pr2899.tar :: inputs/pr2809.tar :: inputs/pr2753/predecessor/vendor/counts.py", + "sha256": "00b476dbda0e8cc99886bf794439e1cb9e775f435f599a3557e99321fe084069" + }, + { + "bytes": 9888, + "file": "records.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/inputs/sparse-export.tar :: research/physical-sparse-xor-batch/inputs/compact-export.tar :: research/physical-complex-compact/inputs/pr2899.tar :: inputs/pr2809.tar :: inputs/pr2753/predecessor/vendor/records.py", + "sha256": "0c9c4b23e998597fb877bb1a29da69ac869b68262abe635b162b4dba9c69b372" + }, + { + "bytes": 5952, + "file": "scratch_pool.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/inputs/sparse-export.tar :: research/physical-sparse-xor-batch/inputs/compact-export.tar :: research/physical-complex-compact/inputs/pr2899.tar :: inputs/pr2809.tar :: scratch_pool.py", + "sha256": "41f1eb93652b7174c3b02f95f70e1a9ce2e2aed0a729e725167c8f226e65d8db" + }, + { + "bytes": 5874, + "file": "session.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/inputs/sparse-export.tar :: research/physical-sparse-xor-batch/inputs/compact-export.tar :: research/physical-complex-compact/inputs/pr2899.tar :: session.py", + "sha256": "45ee809b27a69ca5576361922fd2760f568c9a98864d4c55c4fee3003ee3c9ad" + }, + { + "bytes": 8205, + "file": "router_metadata.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/router_metadata.py", + "sha256": "a0c807471cff33d609cec83b1c63e3fc4d98dab24b7df0911a0ddadd113e99f6" + }, + { + "bytes": 5874, + "file": "session.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/t74-export.tar :: research/t74-retuned-physical-layer/inputs/t74-export.tar :: research/t74-physical-layer/inputs/pr3385-controller.tar :: research/physical-gaussian-leaf/inputs/pr3087.tar :: inputs/pr3055.tar :: inputs/pr2899.tar :: session.py", + "sha256": "45ee809b27a69ca5576361922fd2760f568c9a98864d4c55c4fee3003ee3c9ad" + }, + { + "bytes": 3936, + "file": "cardinality.py", + "path": "word-export.tar :: research/physical-fft-word/inputs/ring-export.tar :: research/physical-ring-product/inputs/fourier-export.tar :: research/physical-synthetic-fourier/inputs/composed-export.tar :: research/t74-support-composition/inputs/router-export.tar :: research/physical-support-router/inputs/sparse-export.tar :: research/physical-sparse-xor-batch/inputs/compact-export.tar :: research/physical-complex-compact/inputs/pr2899.tar :: inputs/pr2809.tar :: inputs/pr2753/predecessor/vendor/cardinality.py", + "sha256": "505d5e560c5a507e6184edcc19a87cf1fed243eb34a5cb21fbe1e4fe017e7f22" + } + ] +} diff --git a/research/extremal-pair-coefficient-adapter/review/runtime-slices/cardinal_counts.py b/research/extremal-pair-coefficient-adapter/review/runtime-slices/cardinal_counts.py new file mode 100644 index 0000000000..6a14feac45 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/runtime-slices/cardinal_counts.py @@ -0,0 +1,55 @@ +"""Separate unbounded tapes for products of arbitrary spectator cardinalities.""" +from counts import Count as RetainedCount +from words import LEFT, ONE, RIGHT, ZERO, need + + +class Count(RetainedCount): + def zero(self): + self.rewind() + result=self.read()==ZERO + self.step(1) + result=result and self.read()==RIGHT + self.rewind() + return result + + def add(self,other): + source=Count(other) + self.rewind();source.rewind() + carry=0;left_done=False + try: + while True: + if not left_done and self.read()==RIGHT:left_done=True + right_done=source.read()==RIGHT + if left_done and right_done and not carry:break + a=ZERO if left_done else self.read() + b=ZERO if right_done else source.read() + need(a in (ZERO,ONE) and b in (ZERO,ONE),"binary cardinality sum") + total=a+b+carry + self.tape.write(total&1);carry=total>>1 + self.step(1) + if not right_done:source.step(1) + self.tape.write(RIGHT) + self.normalize() + finally:source.close() + + @classmethod + def product(cls,left,right): + factor,scan,result=cls(left),cls(right),cls.literal(0) + scan.msb() + try: + while scan.read()!=LEFT: + result.multiply_small(2) + if scan.read()==ONE:result.add(factor) + else:need(scan.read()==ZERO,"binary multiplier digit") + scan.step(-1) + scan.step(1) + return result + except ValueError: + result.close() + raise + finally: + factor.close();scan.close() + + +def positive(value): + need(isinstance(value,Count) and not value.zero(),"independent positive cardinality tape") diff --git a/research/extremal-pair-coefficient-adapter/review/runtime-slices/cardinality.py b/research/extremal-pair-coefficient-adapter/review/runtime-slices/cardinality.py new file mode 100644 index 0000000000..b8ba857e32 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/runtime-slices/cardinality.py @@ -0,0 +1,136 @@ +"""Canonical unbounded binary cardinalities on one sequential tape each.""" +from records import Tape +from stream import Counter +from words import BLANK, LEFT, ONE, RIGHT, ZERO, need + + +class Natural: + def __init__(self, source=None): + self.tape = Tape() + if source is None: + self.tape.append(ONE) + else: + source.rewind() + while source.read() != RIGHT: + bit = source.read() + need(bit in (ZERO, ONE), "binary cardinality input") + self.tape.append(bit) + source.step(1) + source.rewind() + self.tape.append(RIGHT) + self.normalize() + + def read(self): + return self.tape.read() + + def step(self, direction): + self.tape.step(direction) + + def rewind(self): + self.tape.rewind() + + def msb(self): + self.rewind() + while self.read() != RIGHT: + self.step(1) + self.step(-1) + + def normalize(self): + self.rewind() + while self.read() != RIGHT: + self.step(1) + self.step(-1) + while self.read() == ZERO: + self.tape.write(RIGHT) + self.step(1) + self.tape.write(BLANK) + self.step(-1) + self.step(-1) + if self.read() == LEFT: + self.step(1) + self.tape.write(ZERO) + self.step(1) + self.tape.write(RIGHT) + self.rewind() + + def multiply_small(self, constant): + """The multiplier and bounded carry belong to fixed finite control.""" + need(constant >= 2, "fixed cardinality multiplier") + carry = 0 + while self.read() != RIGHT: + total = constant*self.read()+carry + self.tape.write(total & 1) + carry = total >> 1 + self.step(1) + while carry: + self.tape.write(carry & 1) + carry >>= 1 + self.step(1) + self.tape.write(RIGHT) + self.rewind() + + def divide_small(self, constant): + self.msb() + remainder = 0 + while self.read() != LEFT: + remainder = 2*remainder+self.read() + if remainder >= constant: + self.tape.write(ONE) + remainder -= constant + else: + self.tape.write(ZERO) + self.step(-1) + self.step(1) + self.normalize() + return remainder + + def marginal(self): + """Copy with one high zero bit for the retained ADD input contract.""" + result = Natural(self) + result.msb() + result.step(1) + result.tape.write(ZERO) + result.step(1) + result.tape.write(RIGHT) + result.rewind() + return result + + def close(self): + self.tape.clear() + + +def radix_power(ring, q): + """Yield once per radix-q digit of M=q^w, without decoding w.""" + arena = ring.arena + divisor, power = arena.literal(q), arena.copy(ring.modulus) + try: + while ring.raw.compare(power, ring.one) > 0: + quotient, remainder = ring.raw.divmod(power, divisor) + need(remainder.zero() and not quotient.zero(), "cardinality prime-power context") + arena.free_many(power, remainder) + power = quotient + yield + need(ring.raw.compare(power, ring.one) == 0, "complete radix exponent") + finally: + arena.free_many(divisor, power) + + +def multiply_atom_power(value, exponent, ring, q): + count = Counter(exponent) + try: + while not count.finished: + for _ in radix_power(ring, q): + value.multiply_small(q) + count.decrement() + finally: + count.close() + + +def digit_suffix(value, ring, q): + """Multiply by q^(w-1), preserving an arbitrary spectator factor.""" + first = True + for _ in radix_power(ring, q): + if first: + first = False + else: + value.multiply_small(q) diff --git a/research/extremal-pair-coefficient-adapter/review/runtime-slices/counts.py b/research/extremal-pair-coefficient-adapter/review/runtime-slices/counts.py new file mode 100644 index 0000000000..81b48940ce --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/runtime-slices/counts.py @@ -0,0 +1,57 @@ +"""Unbounded cardinalities; only compiled finite constants enter host control.""" +from cardinality import Natural, digit_suffix +from records import Tape +from words import ONE, RIGHT, ZERO, need + + +class Count(Natural): + @classmethod + def literal(cls, value): + """Compile a fixed cardinality, never decode a runtime operand.""" + need(isinstance(value, int) and value >= 0, "compiled cardinality") + tape = Tape() + for bit in range(max(1, value.bit_length())): + tape.append((value >> bit) & 1) + tape.append(RIGHT) + tape.rewind() + result = cls(tape) + tape.clear() + return result + + def increment(self): + self.rewind() + while self.read() == ONE: + self.tape.write(ZERO) + self.step(1) + if self.read() == RIGHT: + self.tape.write(ONE) + self.step(1) + self.tape.write(RIGHT) + else: + need(self.read() == ZERO, "canonical count digit") + self.tape.write(ONE) + self.rewind() + + def equals(self, other): + self.rewind() + other.rewind() + same = True + while self.read() != RIGHT and other.read() != RIGHT: + same = same and self.read() == other.read() + self.step(1) + other.step(1) + same = same and self.read() == other.read() == RIGHT + self.rewind() + other.rewind() + return same + + +def high_power(value, ring, q, dimension): + for _ in range(dimension*dimension): + digit_suffix(value, ring, q) + + +def high_count(ring, q, dimension): + result = Count.literal(1) + high_power(result, ring, q, dimension) + return result diff --git a/research/extremal-pair-coefficient-adapter/review/runtime-slices/records.py b/research/extremal-pair-coefficient-adapter/review/runtime-slices/records.py new file mode 100644 index 0000000000..4f00467a0f --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/runtime-slices/records.py @@ -0,0 +1,271 @@ +"""Sequential binary program/field records and typed continuation stacks. + +Runtime numerical words copy between tapes. Only tags, source codes, ranks +and row labels enter fixed finite control. Fixture encoding is separate. +""" +from words import BLANK, LEFT, ONE, RIGHT, ZERO, Meter, Unsigned, need + +WORD_END, RECORD_END = 5, 6 +ROOT, STEP, VALUE, CONSTANT, MULTIPLY, PAIR, RETURN = range(7, 14) +FINITE_BITS = 16 # Fixed vocabulary width for this compiled source instance. + + +class Tape: + def __init__(self): + self.cells = bytearray([LEFT]) + self.head = 1 + self.meter = Meter() + + def read(self): + self.meter.reads += 1 + return self.cells[self.head] if self.head < len(self.cells) else BLANK + + def write(self, symbol): + need(ZERO <= symbol <= RETURN, "fixed record alphabet") + self.meter.writes += 1 + if self.head >= len(self.cells): + self.cells.extend([BLANK]*(self.head+1-len(self.cells))) + self.cells[self.head] = symbol + + def step(self, direction): + need(direction in (-1, 1), "unit record-head move") + self.head += direction + need(self.head >= 0, "local record boundary") + self.meter.moves += 1 + + def append(self, symbol): + need(self.read() == BLANK, "append at record blank") + self.write(symbol) + self.step(1) + + def rewind(self): + self.step(-1) + while self.read() != LEFT: + self.step(-1) + self.step(1) + + def clear(self): + self.rewind() + while self.read() != BLANK: + self.write(BLANK) + self.step(1) + self.rewind() + + +def append_word(tape, word): + word.rewind() + while word.read() != RIGHT: + tape.append(word.read()) + word.step(1) + tape.append(WORD_END) + word.rewind() + + +def read_word(tape, arena): + out = arena.zero() + while tape.read() != WORD_END: + bit = tape.read() + need(bit in (ZERO, ONE) and out.read() != RIGHT, "encoded word extent") + out.write(bit) + out.step(1) + tape.step(1) + need(out.read() == RIGHT, "complete encoded word") + tape.step(1) + out.rewind() + return out + + +def append_finite(tape, value, bits=FINITE_BITS): + """Compile-time finite source/operation tag encoding.""" + need(0 <= value < 1 << bits, "compiled finite vocabulary") + for bit in range(bits): + tape.append((value >> bit) & 1) + tape.append(WORD_END) + + +def read_finite(tape, bits=FINITE_BITS): + # The accumulator ranges over a fixed finite set, independent of e/w/h. + state = 0 + for bit in range(bits): + value = tape.read() + need(value in (ZERO, ONE), "finite label bit") + state |= value << bit + tape.step(1) + need(tape.read() == WORD_END, "finite label delimiter") + tape.step(1) + return state + + +def seek_record(tape, index): + machine, arena = Unsigned(index.arena), index.arena + remaining, one = arena.copy(index), arena.literal(1) + tape.rewind() + while not remaining.zero(): + while tape.read() != RECORD_END: + need(tape.read() != BLANK, "record exists at global slot") + tape.step(1) + tape.step(1) + after = machine.subtract_exact(remaining, one) + arena.free(remaining) + remaining = after + arena.free_many(remaining, one) + + +class Stack: + def __init__(self, index_arena, residue_arena): + self.index_arena, self.residue_arena = index_arena, residue_arena + self.tape, self.reverse = Tape(), Tape() + + def empty(self): + self.tape.step(-1) + result = self.tape.read() == LEFT + self.tape.step(1) + return result + + def push(self, tag, *words): + need(tag in (VALUE, CONSTANT, MULTIPLY, PAIR, RETURN), "continuation kind") + need(len(words) == (2 if tag == VALUE else 1), "continuation arity") + self.tape.append(tag) + for word in words: + append_word(self.tape, word) + self.tape.append(RECORD_END) + + def pop(self): + need(not self.empty(), "nonempty continuation stack") + tape, reverse = self.tape, self.reverse + tape.step(-1) + need(tape.read() == RECORD_END, "continuation top delimiter") + tape.write(BLANK) + tape.step(-1) + while tape.read() not in (LEFT, RECORD_END): + reverse.append(tape.read()) + tape.write(BLANK) + tape.step(-1) + tape.step(1) + reverse.step(-1) + tag = reverse.read() + need(tag in (VALUE, CONSTANT, MULTIPLY, PAIR, RETURN), "encoded continuation kind") + reverse.write(BLANK) + reverse.step(-1) + arenas = (self.index_arena, self.index_arena) if tag == VALUE else (self.residue_arena,) + words = [] + for arena in arenas: + out = arena.zero() + while reverse.read() != WORD_END: + bit = reverse.read() + need(bit in (ZERO, ONE) and out.read() != RIGHT, "continuation binary word") + out.write(bit) + out.step(1) + reverse.write(BLANK) + reverse.step(-1) + need(out.read() == RIGHT, "complete continuation operand") + reverse.write(BLANK) + reverse.step(-1) + out.rewind() + words.append(out) + need(reverse.read() == LEFT, "complete continuation record") + reverse.step(1) + return tag, tuple(words) + + +class Program: + """Encoded root and admitted chronological steps; numerical fields are words.""" + def __init__(self, index_arena, residue_arena, code_bits=FINITE_BITS): + self.index_arena, self.residue_arena = index_arena, residue_arena + self.code_bits = code_bits + self.tape = Tape() + + def root(self): + self.tape.rewind() + need(self.tape.read() == ROOT, "root record") + self.tape.step(1) + size = read_word(self.tape, self.index_arena) + unit = read_word(self.tape, self.residue_arena) + depth = read_word(self.tape, self.index_arena) + need(self.tape.read() == RECORD_END, "root record end") + self.tape.rewind() + return size, unit, depth + + def step(self, level): + need(not level.zero(), "positive step level") + seek_record(self.tape, level) + need(self.tape.read() == STEP, "step record") + self.tape.step(1) + metadata = tuple(read_finite(self.tape, self.code_bits if field == 1 else FINITE_BITS) + for field in range(6)) + parent = read_word(self.tape, self.index_arena) + child = read_word(self.tape, self.index_arena) + need(self.tape.read() == RECORD_END, "step record end") + self.tape.rewind() + return metadata, parent, child + + @classmethod + def fixture(cls, index_arena, residue_arena, root_size, root_unit, events, code_bits=FINITE_BITS): + """Fixture-only serialization; runtime computes and validates extents.""" + out = cls(index_arena, residue_arena, code_bits) + out.tape.append(ROOT) + for arena, value in ((index_arena, root_size), (residue_arena, root_unit), (index_arena, len(events))): + word = arena.input(value) + append_word(out.tape, word) + arena.free(word) + out.tape.append(RECORD_END) + size = root_size + for kind, code, rank, field, reverse, half in events: + f = size//64 + child = rank*f if kind == 0 else f//2 if half else f + out.tape.append(STEP) + for field_index, label in enumerate((kind, code, rank, field, int(reverse), int(half))): + append_finite(out.tape, label, code_bits if field_index == 1 else FINITE_BITS) + for value in (size, child): + word = index_arena.input(value) + append_word(out.tape, word) + index_arena.free(word) + out.tape.append(RECORD_END) + size = child + out.tape.rewind() + return out + + +class Fields: + def __init__(self, index_arena, residue_arena, code_bits=FINITE_BITS): + self.index_arena, self.residue_arena = index_arena, residue_arena + self.code_bits = code_bits + self.tape = Tape() + + def check_code(self, slot, code): + seek_record(self.tape, slot) + observed = read_finite(self.tape, self.code_bits) + self.tape.rewind() + need(observed == code, "original global raw-field code") + + def end(self, after): + seek_record(self.tape, after) + complete = self.tape.read() == BLANK + self.tape.rewind() + need(complete, "exact frozen/current field prefix") + + def read(self, slot, code, depth): + need(Unsigned(self.index_arena).compare(slot, depth) < 0, "frozen field excludes current/future slot") + seek_record(self.tape, slot) + observed = read_finite(self.tape, self.code_bits) + need(observed == code, "exact encoded raw-field specification") + out = [[read_word(self.tape, self.residue_arena) for _ in range(64)] for _ in range(64)] + need(self.tape.read() == RECORD_END, "complete 64-dimensional raw high field") + self.tape.rewind() + return out + + @classmethod + def fixture(cls, index_arena, residue_arena, fields, code_bits=FINITE_BITS): + """Load canonical raw-field fixture data before measured execution.""" + out = cls(index_arena, residue_arena, code_bits) + for code, high in fields: + append_finite(out.tape, code, code_bits) + need(len(high) == 64 and all(len(row) == 64 for row in high), "field fixture shape") + for row in high: + for value in row: + word = residue_arena.input(value) + append_word(out.tape, word) + residue_arena.free(word) + out.tape.append(RECORD_END) + out.tape.rewind() + return out diff --git a/research/extremal-pair-coefficient-adapter/review/runtime-slices/router_metadata.py b/research/extremal-pair-coefficient-adapter/review/runtime-slices/router_metadata.py new file mode 100644 index 0000000000..4edc546ac5 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/runtime-slices/router_metadata.py @@ -0,0 +1,217 @@ +"""Fixed-tape permutation validation, cycle factorization and record geometry.""" + +from contextlib import contextmanager +from router_sources import active +active() +from cardinal_counts import Count, positive +from compact_counts import read_fixed, reduced, write_fixed +from encoded import compare, subtract +from stream import Counter +from words import BLANK, need + + +@contextmanager +def owned(*values): + """Close a lexically bounded tuple of numerical scratch roles.""" + try: + yield values + finally: + for value in reversed(values): + value.close() + + +def indices(count): + with owned(Count.literal(0), Counter(count)) as (index, remaining): + while not remaining.finished: + yield index + index.increment() + remaining.decrement() + + +def ceiling_log(value): + positive(value) + with owned(Count.literal(1)) as (one,): + current = subtract(value, one) + result = Count.literal(0) + try: + while not current.zero(): + current.divide_small(2) + result.increment() + return result + except BaseException: + result.close() + raise + finally: + current.close() + + +def position_width(value): + result = ceiling_log(value) + if result.zero(): + result.increment() + return result + + +class Pairs: + def __init__(self, tape, count, width): + self.tape, self.count, self.width = tape, count, width + + @contextmanager + def at(self, index): + self.tape.rewind() + with owned(Count.product(index, self.width)) as (distance,): + distance.multiply_small(2) + for _ in indices(distance): + need(self.tape.read() in (0, 1), "complete router pair prefix") + self.tape.step(1) + first = second = None + try: + first = read_fixed(self.tape, self.width) + second = read_fixed(self.tape, self.width) + yield first, second + finally: + if first is not None: + first.close() + if second is not None: + second.close() + self.tape.rewind() + + def exact_end(self): + with owned(Count.product(self.count, self.width)) as (extent,): + extent.multiply_small(2) + self.tape.rewind() + try: + for _ in indices(extent): + need(self.tape.read() in (0, 1), "complete router pair descriptor") + self.tape.step(1) + need(self.tape.read() == BLANK, "exact router pair descriptor extent") + finally: + self.tape.rewind() + + def image(self, source): + for index in indices(self.count): + with self.at(index) as (old, new): + if compare(old, source) == 0: + return Count(new) + raise ValueError("permutation image in listed support") + + def validate(self, n): + positive(n) + need(isinstance(self.count, Count) and isinstance(self.width, Count), "encoded router metadata") + with owned(position_width(n)) as (width,): + need(compare(width, self.width) == 0, "canonical router position width") + need(compare(self.count, n) <= 0, "listed support fits address") + self.exact_end() + identity = True + previous = None + try: + for index in indices(self.count): + with self.at(index) as (source, target): + need(compare(source, n) < 0 and compare(target, n) < 0, "bounded permutation position") + need(previous is None or compare(previous, source) < 0, "sorted unique support") + if previous is not None: + previous.close() + previous = Count(source) + identity = identity and compare(source, target) == 0 + found = False + for other in indices(self.count): + with self.at(other) as (other_source, other_target): + found = found or compare(other_source, target) == 0 + need(compare(index, other) == 0 or compare(target, other_target) != 0, + "unique permutation images") + need(found, "equal permutation source and image sets") + return identity + finally: + if previous is not None: + previous.close() + + +def write_pair(tape, first, second, width): + write_fixed(first, tape, width) + write_fixed(second, tape, width) + + +def factor(table, first, second, factory): + """Emit J0 then J1, where J1 J0 moves old coordinates by pi.""" + cycle = factory() + counts = (Count.literal(0), Count.literal(0)) + try: + for ordinal in indices(table.count): + with table.at(ordinal) as (start, _): + current, length, least = Count(start), Count.literal(0), True + try: + for _ in indices(table.count): + write_pair(cycle, current, current, table.width) + least = least and compare(start, current) <= 0 + following = table.image(current) + current.close() + current = following + length.increment() + if compare(current, start) == 0: + break + need(compare(current, start) == 0, "closed bounded permutation cycle") + if least: + view = Pairs(cycle, length, table.width) + for phase, destination in enumerate((first, second)): + for index in indices(length): + with owned(subtract(length, index)) as (partner_raw,): + if phase: + partner_raw.increment() + with owned(reduced(partner_raw, length)) as (partner,): + if compare(index, partner) < 0: + with view.at(index) as (a, _), view.at(partner) as (b, _): + write_pair(destination, a, b, table.width) + counts[phase].increment() + finally: + current.close() + length.close() + # Keep this lease for the next cycle. + from session import borrowed_tape + borrowed_tape(cycle).clear() + first.rewind() + second.rewind() + return counts + except BaseException: + for count in counts: + count.close() + raise + finally: + cycle.clear() + + +def block_image(position, a, b, width): + """Conjugate a coordinate by an actual disjoint equal-block exchange.""" + with owned(Count(a), Count(b)) as (a_end, b_end): + a_end.add(width) + b_end.add(width) + if compare(a, position) <= 0 and compare(position, a_end) < 0: + result = subtract(position, a) + result.add(b) + return result + if compare(b, position) <= 0 and compare(position, b_end) < 0: + result = subtract(position, b) + result.add(a) + return result + return Count(position) + + +def untouched_gap(table, n, ell): + candidate = Count(ell) + try: + # table is sorted by original source coordinate. + for index in indices(table.count): + with table.at(index) as (source, _), owned(Count(candidate)) as (end,): + end.add(ell) + if compare(source, candidate) >= 0 and compare(source, end) < 0: + candidate.close() + candidate = Count(source) + candidate.increment() + with owned(Count(candidate)) as (end,): + end.add(ell) + if compare(end, n) <= 0: + result, candidate = candidate, None + return result + return None + finally: + if candidate is not None: + candidate.close() diff --git a/research/extremal-pair-coefficient-adapter/review/runtime-slices/scratch_pool.py b/research/extremal-pair-coefficient-adapter/review/runtime-slices/scratch_pool.py new file mode 100644 index 0000000000..0f22807c65 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/runtime-slices/scratch_pool.py @@ -0,0 +1,151 @@ +"""Reusable physical stream tapes for completed, nonrecursive source blocks. + +Each lease has an explicit end. A repeated cleanup of an ended lease cannot +erase a later borrower of the same physical role. No lease crosses CALL. +""" +from contextlib import contextmanager +import sys +from types import FunctionType + +import loader +loader.activate() +from records import Tape +from words import Arena, BLANK, LEFT, Meter, need + + +class Lease: + def __init__(self, pool, slot): + self.pool, self.slot, self.active = pool, slot, True + self.physical = pool.tapes[slot] + self.meter = Meter() + + def owned(self): + need(self.active and self.pool.live.get(self.slot) is self, "live scratch lease") + return self.physical + + @property + def head(self): + return self.owned().head + + def read(self): + if not self.active: + raise ValueError("live scratch lease") + self.meter.reads += 1 + return self.physical.read() + + def write(self, symbol): + if not self.active: + raise ValueError("live scratch lease") + self.meter.writes += 1 + self.physical.write(symbol) + + def step(self, direction): + if not self.active: + raise ValueError("live scratch lease") + self.meter.moves += 1 + self.physical.step(direction) + + def append(self, symbol): + self.operation(self.physical.append, symbol) + + def rewind(self): + self.operation(self.physical.rewind) + + def operation(self, method, *args): + """Run the same literal tape loop without a lease wrapper at each cell. + + Counter differences update only the observer's lease meter; the method + still performs its real reads, writes and unit moves on the physical tape. + """ + if not self.active: + raise ValueError("live scratch lease") + meter = self.physical.meter + before = meter.reads, meter.writes, meter.moves + try: + return method(*args) + finally: + self.meter.reads += meter.reads - before[0] + self.meter.writes += meter.writes - before[1] + self.meter.moves += meter.moves - before[2] + + def clear(self): + if not self.active: + return + self.operation(self.physical.clear) + self.active = False + del self.pool.live[self.slot] + + +class ScratchPool: + def __init__(self, capacity): + need(type(capacity) is int and capacity > 0, "fixed scratch capacity") + self.tapes = tuple(Tape() for _ in range(capacity)) + self.live = {} + self.peak = self.allocations = 0 # Checker observations, never selectors. + + def acquire(self): + for slot, tape in enumerate(self.tapes): + if slot not in self.live: + # clear()'s rewind supplies the origin invariant. No physical + # head coordinate enters the allocator's finite slot choice. + need(tape.read() == BLANK, "empty scratch role before reuse") + lease = Lease(self, slot) + self.live[slot] = lease + self.peak = max(self.peak, len(self.live)) + self.allocations += 1 + return lease + raise ValueError("fixed scratch role inventory exhausted") + + def empty(self): + need(not self.live, "completed macro closes all scratch leases") + for tape in self.tapes: + need(tape.read() == BLANK, "completed macro leaves scratch bodies empty") + tape.step(-1) + need(tape.read() == LEFT, "completed scratch head stands after LEFT") + tape.step(1) + + @contextmanager + def install(self): + """Specialize only the authenticated source's Tape allocation sites. + + Defaults retain the original Tape class object after imports; specialize + those defaults as well as module globals. Restore the process namespace + on exit. This adapter never changes a frozen file. + """ + import controller + saved = [] + for module in tuple(sys.modules.values()): + path = getattr(module, "__file__", None) + if path is None or not str(path).startswith(str(loader.CALLER)): + continue + for name, value in tuple(vars(module).items()): + if value is Tape: + saved.append((module, name, value)) + setattr(module, name, self.acquire) + elif isinstance(value, FunctionType) and value.__defaults__: + old = value.__defaults__ + if any(item is Tape for item in old): + saved.append((value, "__defaults__", old)) + value.__defaults__ = tuple(self.acquire if item is Tape else item for item in old) + original_close = controller.Callback.close + original_tape_init, original_arena_init = Tape.__init__, Arena.__init__ + def close(callback): + original_close(callback) + # The source's close ends these borrows but leaves their empty Tape + # objects to the host allocator. End the four physical leases here. + for stack in (callback.pending, callback.values): + stack.tape.clear() + stack.reverse.clear() + controller.Callback.close = close + def forbid_tape(_self, *_args, **_kwargs): + raise ValueError("physical Tape allocation inside a completed macro") + def forbid_arena(_self, *_args, **_kwargs): + raise ValueError("numerical Arena allocation inside a completed macro") + Tape.__init__, Arena.__init__ = forbid_tape, forbid_arena + try: + yield self + finally: + Tape.__init__, Arena.__init__ = original_tape_init, original_arena_init + controller.Callback.close = original_close + for owner, name, value in reversed(saved): + setattr(owner, name, value) diff --git a/research/extremal-pair-coefficient-adapter/review/runtime-slices/session.py b/research/extremal-pair-coefficient-adapter/review/runtime-slices/session.py new file mode 100644 index 0000000000..09f645bbf0 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/review/runtime-slices/session.py @@ -0,0 +1,156 @@ +"""Reuse a completed physical root while its outer owner retains templates.""" +from contextlib import contextmanager +from types import FunctionType + +import source +_loader, padding, outer = source.activate() +from macro_machine import Machine +from records import Tape +from scratch_pool import Lease +from cardinal_counts import Count +from words import Arena, BLANK, LEFT, need + + +def erase_marker(tape): + need(tape.read() == BLANK, "empty body before owned marker erasure") + tape.step(-1) + need(tape.read() == LEFT, "owned marker at the local origin") + tape.write(BLANK) + tape.step(1) + + +def initialize_marker(tape): + need(tape.read() == BLANK, "empty body before marker initialization") + tape.step(-1) + need(tape.read() == BLANK, "blank owned origin") + tape.write(LEFT) + tape.step(1) + + +def borrowed_tape(tape): + """Expose the physical input without transferring an outer lease's ownership. + + Machine.commit consumes Lease results. Root input ports are borrowed, so + they must carry physical views even when the outer owner uses a lease. + """ + return tape.owned() if isinstance(tape, Lease) else tape + + +def borrowed_count(count): + view = object.__new__(Count) + view.tape = borrowed_tape(count.tape) + return view + + +@contextmanager +def sealed_constructors(): + original_tape, original_arena = Tape.__init__, Arena.__init__ + def forbidden(*_args, **_kwargs): + raise ValueError("physical allocation inside the ordinary invocation") + Tape.__init__ = Arena.__init__ = forbidden + try: + yield + finally: + Tape.__init__, Arena.__init__ = original_tape, original_arena + + +class OuterScope: + """Suspend allocation-site specialization without ending any live lease.""" + def __init__(self, pool): + self.pool = pool + self.manager = self.transform = None + + def enable(self): + need(self.manager is None, "one active outer factory scope") + self.manager = self.pool.install() + self.manager.__enter__() + self.transform = padding.transform + namespace = dict(self.transform.__globals__) + namespace["Tape"] = self.pool.acquire + # Preserve complete()'s nominal Tape ownership checks. Only transform's + # immutable constructor site receives the fixed-role factory. + padding.transform = FunctionType(self.transform.__code__, namespace, + self.transform.__name__, self.transform.__defaults__, + self.transform.__closure__) + + def disable(self): + need(self.manager is not None, "active outer factory scope") + padding.transform = self.transform + manager, self.manager = self.manager, None + manager.__exit__(None, None, None) + + @contextmanager + def installed(self): + self.enable() + try: + yield self + finally: + self.disable() + + @contextmanager + def suspended(self): + self.disable() + try: + yield + finally: + self.enable() + + +class RootSession(Machine): + """Borrow initialized role/bank templates for two completed root calls. + + The outer invocation owns these markers and erases them once at its end. + A successful F return restores the supplied initialized workspace state. + This does not provide recovery from an interrupted or failing inner macro. + """ + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.completed_roots = 0 + + def erase_work(self): + need(not self.arena.live and not self.indices.live and not self.pool.live, + "completed root returns empty banks and scratch leases") + need(self.numerical.machine.tapes == [{}, {0: "^"}], "completed root returns parking baseline") + for tape in (*self.roles.values(), *self.handoff.values()): + need(tape.read() == BLANK, "completed root returns empty role bodies") + tape.step(-1) + need(tape.read() == LEFT, "session retains its initialized role marker") + tape.step(1) + self.completed_roots += 1 + + def run(self, *args, **kwargs): + need(self.output.read() == BLANK, "consume prior root output before reuse") + return super().run(*args, **kwargs) + + def finish(self, expected=2): + need(self.completed_roots == expected and self.output.read() == BLANK, + "expected completed and consumed ordinary-wrapper calls") + need(not self.arena.live and not self.indices.live and not self.pool.live, + "empty numerical and scratch roles at session end") + if hasattr(self.arena, "erase_owned"): + for tape in (*self.roles.values(), *self.handoff.values(), *self.pool.tapes): + erase_marker(tape) + self.arena.erase_owned() + self.indices.erase_owned() + self.numerical._empty_port() + self.numerical._move(1, -1) + self.numerical._write(1, "_") + self.numerical._move(1, 1) + self.closed = True + else: + Machine.erase_work(self) + erase_marker(self.output) + + def rearm(self): + need(self.closed and hasattr(self.arena, "erase_owned"), "closed physical session") + for tape in (*self.roles.values(), *self.handoff.values(), *self.pool.tapes, self.output): + initialize_marker(tape) + for bank in (self.arena, self.indices): + need(not bank.live and not bank.initialized, "blank numerical session") + for word in (*bank.words, bank.template): + initialize_marker(word.tape) + self.numerical._move(1, -1) + need(self.numerical._read(1) == "_", "blank owned parking origin") + self.numerical._write(1, "^") + self.numerical._move(1, 1) + self.closed, self.completed_roots = False, 0 diff --git a/research/extremal-pair-coefficient-adapter/verify.py b/research/extremal-pair-coefficient-adapter/verify.py new file mode 100644 index 0000000000..7b795b17b0 --- /dev/null +++ b/research/extremal-pair-coefficient-adapter/verify.py @@ -0,0 +1,146 @@ +#!/usr/bin/env python3 +"""Read-only actual encoded adapter replay with an inherited independent oracle. +SPDX-License-Identifier: Apache-2.0 +""" +from fractions import Fraction as Q +from hashlib import sha256 +from pathlib import Path +import argparse,importlib.util,json,sys + +HERE=Path(__file__).resolve().parent + +def need(ok,message): + if not ok:raise ValueError(message) + + +def module(name,path): + spec=importlib.util.spec_from_file_location(name,path) + result=importlib.util.module_from_spec(spec);sys.modules[name]=result + spec.loader.exec_module(result) + return result + + +def authenticate(root): + pins=json.loads((HERE/'RUNTIME-PINS.json').read_text()) + for item in pins['files']: + path=root/item['path'] + need(path.is_file() and not path.is_symlink(),'regular pinned input '+item['path']) + data=path.read_bytes() + need(len(data)==item['bytes'] and sha256(data).hexdigest()==item['sha256'],'exact runtime source '+item['path']) + for item in json.loads((HERE/'DEPENDENCIES.json').read_text())['files']: + data=(HERE/item['local']).read_bytes() + need(len(data)==item['bytes'] and sha256(data).hexdigest()==item['sha256'],'retained proof '+item['local']) + return len(pins['files']) + + +def decoded(raw): + need(raw[0]==2,'Count left marker') + k=1;value=0 + while k1 and k