From 03b572b3b9ab72c6ba67762e85e1630cda1daad5 Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Thu, 19 Nov 2026 20:13:55 -0500 Subject: [PATCH] Compile overlapping native ranks with polynomial productive width --- .../single-grade-rank-compiler/APPLICATION.md | 80 ++++ research/single-grade-rank-compiler/LICENSE | 201 +++++++++ .../single-grade-rank-compiler/ORIGINS.json | 86 ++++ research/single-grade-rank-compiler/PROOF.md | 87 ++++ research/single-grade-rank-compiler/README.md | 42 ++ .../single-grade-rank-compiler/RESULT.json | 211 +++++++++ .../single-grade-rank-compiler/SOURCES.json | 97 ++++ research/single-grade-rank-compiler/TASK.json | 91 ++++ .../single-grade-rank-compiler/VALIDATION.md | 18 + .../single-grade-rank-compiler/VERIFY.json | 115 +++++ .../check_callers.py | 197 +++++++++ .../single-grade-rank-compiler/check_cold.py | 53 +++ .../single-grade-rank-compiler/check_cover.py | 255 +++++++++++ .../check_funding.py | 151 +++++++ .../check_product.py | 86 ++++ .../check_schedule.py | 148 +++++++ .../single-grade-rank-compiler/funding.py | 183 ++++++++ .../single-grade-rank-compiler/product.py | 110 +++++ .../retained/GATE-NOTICE | 415 ++++++++++++++++++ .../retained/PENDING-NOTICE | 16 + .../retained/pending-application.json.gz | Bin 0 -> 17535 bytes .../retained/pending-bit.json.gz | Bin 0 -> 3866 bytes .../retained/supplier_gate.py | 143 ++++++ .../single-grade-rank-compiler/schedule.py | 118 +++++ 24 files changed, 2903 insertions(+) create mode 100644 research/single-grade-rank-compiler/APPLICATION.md create mode 100644 research/single-grade-rank-compiler/LICENSE create mode 100644 research/single-grade-rank-compiler/ORIGINS.json create mode 100644 research/single-grade-rank-compiler/PROOF.md create mode 100644 research/single-grade-rank-compiler/README.md create mode 100644 research/single-grade-rank-compiler/RESULT.json create mode 100644 research/single-grade-rank-compiler/SOURCES.json create mode 100644 research/single-grade-rank-compiler/TASK.json create mode 100644 research/single-grade-rank-compiler/VALIDATION.md create mode 100644 research/single-grade-rank-compiler/VERIFY.json create mode 100644 research/single-grade-rank-compiler/check_callers.py create mode 100644 research/single-grade-rank-compiler/check_cold.py create mode 100644 research/single-grade-rank-compiler/check_cover.py create mode 100644 research/single-grade-rank-compiler/check_funding.py create mode 100644 research/single-grade-rank-compiler/check_product.py create mode 100644 research/single-grade-rank-compiler/check_schedule.py create mode 100644 research/single-grade-rank-compiler/funding.py create mode 100644 research/single-grade-rank-compiler/product.py create mode 100644 research/single-grade-rank-compiler/retained/GATE-NOTICE create mode 100644 research/single-grade-rank-compiler/retained/PENDING-NOTICE create mode 100644 research/single-grade-rank-compiler/retained/pending-application.json.gz create mode 100644 research/single-grade-rank-compiler/retained/pending-bit.json.gz create mode 100644 research/single-grade-rank-compiler/retained/supplier_gate.py create mode 100644 research/single-grade-rank-compiler/schedule.py diff --git a/research/single-grade-rank-compiler/APPLICATION.md b/research/single-grade-rank-compiler/APPLICATION.md new file mode 100644 index 0000000000..c5f5874aeb --- /dev/null +++ b/research/single-grade-rank-compiler/APPLICATION.md @@ -0,0 +1,80 @@ +# Source applications and physical costs + +The selected record at canonical commit `e54523517d0f03e58352e647c403a5af3e525a57` names five assumptions. Its compiler item covers the finite mixed-target compiler and chronological product, completion and splitting under the retained uniform closure contract. This alternative constructs the required finite full-rank program for **each** of the four native inputs. It does not invoke that closure statement. The proof still needs the original individual native instructions and all-column embeddings, owned storage and erasure, fixed-tape and precision services, and analytic recovery. These are primitive and outer hypotheses used by the selected proof. This source-specific implication does not certify an arbitrary adapter or revise the maintainer's selected record. [Selected claim](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/certificates/frontier7000/CLAIM.json) · [Selected physical audit](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md) + +| Native input | True axes | Arbitrary roles | Ordered paid positions | Tested raw saving | Product power | Width degree | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | +| Selected complex | 153 | 23,392 | 117,612 | 0.00363005817007 | 2^48 | 15 | +| Selected binary | 134 | 19,950 | 107,352 | 0.00385253 | 2^36 | 15 | +| Pending complex | 137 | 52,512 | 283,248 | 0.00387944011075 | 2^56 | 16 | +| Pending binary | 134 | 20,706 | 107,460 | 0.003879928036154 | 2^46 | 15 | +| Historical p7 complex control | 121 | 7,688 | 55,998 | 0.00268648 | 2^35 | 13 | + +The exact rational margins, type multiplicities and sufficient dimensions are in [RESULT.json](RESULT.json). The selected and pending complex uniform savings are the listed raw savings less `10^-14`. The binary uniform savings are the listed raw savings less `10^-10`. The pending complex caller uses 137 physical axes. Its predecessor's conservative compiler calculation used 153. + +## Complex producer and operator boundaries + +Use the exact selected shared-wire or pending P104 word, with all productive fields and all actual paid owners in order. The first caller makes 18 native calls. The second makes 48 calls with 19,200 main bindings. The independently reconstructed histograms include each root target, native helper, complete idle and query. The pending input uses its source's four-return graph, scaled scalar schedule and actual installed return banks. It excludes the failed higher target in that proposal. [Selected word and full result](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/shared-wire-split-composition/FULL-RESULT.json) · [Pending application](https://github.com/Clear1nsight/integer-mult-bounds/blob/89a67c404226d51028e135de2b9169e9020d57af/research/p104-iterated-returns/continuation/evidence/application.json) + +A source field at chart `U` represents `T_U^(tensor f) x` on the whole original factor. Keep every scalar contact, paid MOVE, QUERY, global LAMBDA, signed translation, local odd conversion, and completed return at its source position. For a nested difference, keep both factors in the quoted `L C_r R` representation and the absolute phase `i^(a f)`. Normalize a helper only at a complete endpoint. The two sides need not be mutual inverses. With these source adapters in place, an additional whole-job placement only permutes canonical axes, and is inverted after the whole job. Canonical rank addition is the product of positive transforms on disjoint axes. The product algorithm acts on independently owned full fields. It uses one source instance at each declared column count and preserves every unmatched physical coordinate. Scalar coefficients of an ADD stay outside the tensor product. [Physical normal forms](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/final4610-independent-admission/SPECIALIZATION.md) · [Product implementation](product.py) + +## Binary producer and final cover + +Use the actual paired binary caller and its complete normalized rational projector catalogue. The selected source has 36 native invocations, with paired calls on disjoint mains. The pending source also uses its own 36-call graph, including its charged nonzero retirement. The selected physical ambient is 134 even though its largest target is smaller. The two retained native words have the same table of 636 frames. The source arbitrary-field transfer uses integral identities before reduction in characteristic two. [Selected binary receipt](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/paired-query-only-bit/EFREE-RESULT.json) · [Pending binary receipt](https://github.com/Clear1nsight/integer-mult-bounds/blob/89a67c404226d51028e135de2b9169e9020d57af/research/p104-iterated-returns/binary/FINITE.json) + +Work first in rational coordinates. In reversed-tail coordinates the positive request is the interchange `D_P` on the image of an idempotent `P` and the identity on its kernel. In an image/kernel basis partition the image into consecutive disjoint blocks. The corresponding idempotents have pairwise zero products and sum to `P`. Their sequential partial interchanges equal `D_P` on **all** coordinates. Each intermediate output restores the advertised spectators. For complete projector matchers choose bases `B_P,B_Q` with image columns first. The fixed symbol `S=B_P B_Q^-1` satisfies `SQS^-1=P`. All native port chart symbols stay in the word. To lift a local right-route symbol on a block with multiplicity `c>0`, extend `S tensor I_c` by the identity. A change of basis conjugates this embedding. Equivalently, a restricted column sector `E` uses `S tensor E + I tensor (I-E)`. This preserves multiplication and inverses. On the future full group, each coset of the embedded local group carries the source identity. The extra left coset representative conjugates all its address operators together. It requires no data movement. + +Only after the complete rational word has independent targets `D_I` on the whole rank `N` do we choose an odd cover prime `q`. Exclude all denominators, nonzero determinants and rank witnesses of the **new** finite program, including proper-subspace matchers and their inverses. This is an effective finite list. Use `q>2^45 N^5`. For all `w>=1` each fixed matcher acts by the bijection `g -> gS` of `GL_N(Z/q^w)`. Apply it to a whole fresh row, then undo it on return. The new program never uses a physical dense address map as a free operation. Distinct input roles may have distinct right matchers. They mix at equal child rows and return to their own parents. One external diagonal weight applies everywhere in the whole word. It can depend on the exposed ancestors and atom indices and is independent of the fresh role and cover. Right routes commute with this weight. At the full endpoint `g I g^-1=I`. A proper intermediate projector has a row-dependent endpoint, so an extra cover inserted there would need an additional argument. [Delayed cover](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/kappa-rebuild/bit/DELAYED-COVER-BRIDGE.md) + +Lower only the final rank-one leaves. Each good row has one normalized rank-`f` weighted child at outer column multiplicity `f`. The bad fraction is at most `2N^3/q` per leaf, with at most `32N²` rank-`f` children there. Their full weighted moment multiplies the uniform moment by at most `1+64N^5/q`. Reserve the second saving gap `d=10^-10`. Then `64N^5/q=1+d/2`. This funds both covered rates in the original caller budget. The large finite group and its ordered pivot, fallback and high-digit moves all remain in the cost. [General projector and fallback](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/notes/three-stage-cover-bit.tex) + +## Build the ordinary service from individual swaps + +This step avoids importing a completed backend whose own proof could call an earlier compiler. For any fixed radix, exchange one pair of digits with all prefix, gap and suffix coordinates present using a constant number of sequential streams. In the input order `(prefix,x,gap,y,suffix)` send every suffix block to bucket `(x,y)`. Rewind the buckets once. In the output order `(prefix,y,gap,x,suffix)` consume the next suffix block from that bucket. Its head always advances in original prefix and gap order. The total scans and rewinds cost `O_q(V)` per digit pair for complete payload volume `V`. All other coordinates and arbitrary input bits return to the specified positions. Repeating for `e` pairs supplies ordinary saving zero with `O_q(Ve)` time, linear backing, and no row reserve. [Elementary stream service](https://github.com/aliromman/integer-mult-bounds/blob/f927ed7ffbb2b8870f109d59ddd94e1f87becb13/research/self-hosted-ordinary-interchange/PROOF.md) + +For each fixed word take `rho=1/250`, `w=ceil(e^rho)` and `n=ceil(e/w)`. Use actual productive width `W_N` and row factor + +```text +R(w) = W_N |GL_N(F_q)| q^(N²(w-1)). +D_stock = 2 + ceil(log_N(max(1,n))). +divisor = R(w)^D_stock S_old. +``` + +Reserve it from existing high digits. The high-digit count is `O_fixed(w log(2e))=1`, `N ell<=N^ell<=D` for the original root of `D` axes. Thus the exterior denominator/mass bound satisfies `cL ell=1`. Reserve compact control and owned banks in addition. The binary `R(w)` is larger and has its separate exact formula above. Multiply simultaneous outer reservations, retain each parked parent's full extent until return, and price all scans on that full volume. After fixing the word all descriptor tables and degrees are fixed. The original large controlled fibres eventually dominate these polynomials. For a needed margin `delta>0`, any fixed bound `C(j+1)^b` is below `2^(delta j)` beyond an effective integer `j`. Take the maximum of these bounds, the new stock-fit, scalar-fit, fine-prime and cover exclusions, and the primitive thresholds. For the finitely many smaller lengths use the original elementary algorithms. The `O(p)` common width follows since `D<=p^epsilon` with fixed `epsilon<1`. Fixed costs may be much larger than in the predecessors. + +## Preserve the support of the global outer phase + +The complete multiplier also uses a support-local global wrapper. At a phase with `h` selected bits it exposes whole neighborhoods of width `128G`, with `G=4 ceil(log2 p)+6`. It leaves the selected bits of its front, back and row-reserve chunks for later phases. Each active uniform invocation uses the whole global dyadic tensor. Its *working* `N f` axes, including all axes borrowed by inner paid jobs, lie within the current active coordinates. Every instruction fixes the reserved fields as exterior coordinates at the completed boundary. Chunk exposure, role routing, complete-row padding and its removal return before the next phase or coarse-dependent diagonal. No compiler step imposes an additional condition on an exposed coarse label. + +With binary active width at most `C h (log p)^2`, its logarithmic stock is `O_fixed(h^rho (log p)^(2rho+1))`. Multiplying simultaneous complex/BIT/ancestor stocks adds their logarithms. Allowing the extra logarithmic nesting factor gives an upper bound `C'(log(2h)+h^rho(log p)^3+1)` on the number of stock chunks. Here `rho=1/250<1`; the constant includes the new `N,W_N,q`. Above an effective fixed polylogarithmic threshold in `p`, this term plus fixed guards is at most `h/64`. The remaining active width is then at most `3h/128+h/64<=h/16`. The smaller-phase costs sum in a geometric series, and the final polylogarithmically many bits can be processed individually. Padding is removed after each phase, so its factor never compounds down this sequence. + +For numerical precision, once `j` axes have completed, their product is one Gaussian Clifford on those axes. A fresh phase on `D` active axes can conservatively use input guards `p+j` and `h_0+j+O(1)`, where `h_0` bounds the original magnitude. Since `j+D<=D_total`, one common format with `p+D_total` fractional bits and `p+h_0+2D_total+O(1)` signed bits suffices through all phases. There is one final layer truncation. A predecessor's individual-`Q0` classical precision argument therefore imposes no per-phase linear pass through the reserved kernels of the global caller. [Global support and stock proof](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/kappa-rebuild/transfer-audit/OUTER-TRANSFER-AUDIT.md) + +## What the two complete callers receive + +Use the new complex uniform price, the completed ordinary binary price and the same strictly weaker outer parameters. [check_callers.py](check_callers.py) reconstructs each paid and productive invoice from the source owner counts, recomputes its exact grid constants, checks the new depth inequalities, and runs the unchanged exact gates. The selected gate and the pending gate each pass 54 strict and four functional inequalities with minimum margin `10^-15`. The pending ordinary price exceeds its tested complex price by **0.000000487725395**. The retained gate code also evaluates its historical Pascal constants as part of its normal execution. Only its invoice/outer checks are used here. The new compiler funding and height come from [check_funding.py](check_funding.py). + +The resulting alternative algorithms have the conditional complete savings **.00363005817** and **.00387944011068**. The pending rational invoice has a raw crossing between .00387944011076 and .00387944011077. Its attempted .00387981257853 fails that invoice. A stronger binary or row-width bound alone cannot pay that deficit. Native and physical admissions of the pending proposal still require independent review. No practical input threshold or run time follows from these finite carrier bounds. diff --git a/research/single-grade-rank-compiler/LICENSE b/research/single-grade-rank-compiler/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/single-grade-rank-compiler/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/single-grade-rank-compiler/ORIGINS.json b/research/single-grade-rank-compiler/ORIGINS.json new file mode 100644 index 0000000000..23f68ae415 --- /dev/null +++ b/research/single-grade-rank-compiler/ORIGINS.json @@ -0,0 +1,86 @@ +[ + { + "local": "certificates/frontier7000/CLAIM.json", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "source": "certificates/frontier7000/CLAIM.json", + "blob": "c9b816f8445be9dc19b2259e03e9d8709d18c87a", + "sha256": "3f8add8252adb223b60418ec69351a69b6b5edfe601ec1c6b4b65cd9e2afd9b2" + }, + { + "local": "research/paired-query-only-bit/EFREE-RESULT.json", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "source": "research/paired-query-only-bit/EFREE-RESULT.json", + "blob": "575f76487f9999ecc3e7b1b70f9f71bc582ef8a8", + "sha256": "a46b6c6040f75184cab5467656811ad988c216e3bc8e44d595a5015b6e49620b" + }, + { + "local": "research/shared-wire-split-composition/FULL-RESULT.json", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "source": "research/shared-wire-split-composition/FULL-RESULT.json", + "blob": "ff3256f0d3ffbfc56b062f9ec0fdbbc7b30e76d5", + "sha256": "d9ba709fa5dcefffe3f3abdcf34600ce188224703cfd743e6db8b58ba4816cb7" + }, + { + "local": "research/shared-wire-split-composition/interval_gate.py", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "source": "research/shared-wire-split-composition/interval_gate.py", + "blob": "e24dc46079b4c25152f5afc096dda2ce8ee58ff5", + "sha256": "60a743d13f668ef86db4b8215b4d5d04430a671ba6f1fe06d9c1c4c3dfe86da5" + }, + { + "local": "research/paired-query-only-bit/retained/inputs/BIT-NATIVE-WORD.json.gz", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "source": "research/paired-query-only-bit/retained/inputs/BIT-NATIVE-WORD.json.gz", + "blob": "b718d6b2848215ad785022106dfa9f871a3d1c0c", + "sha256": "51203e7fc75ba10bd3ac3f8e675759f47e13d262bea66b6600d1e515095cad78" + }, + { + "local": "research/higher-moment-strictification/RESULT.json", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "source": "research/higher-moment-strictification/RESULT.json", + "blob": "e66b39c674028adfd22f0de3170555dccda52f6a", + "sha256": "ad79e3c0459e7b495a0ca34010553b12147779a007389e1695cc1336f123c156" + }, + { + "local": "research/shared-wire-split-composition/data/caller.json", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "source": "research/shared-wire-split-composition/data/caller.json", + "blob": "cf55f4271009a06ad192a070d330a4466b6d44fa", + "sha256": "3828d53e80ea97e8b866320f081af20b6b93bfebd58b95b56b85a7afe151af5e" + }, + { + "local": "research/single-grade-rank-compiler/retained/pending-application.json.gz", + "commit": "89a67c404226d51028e135de2b9169e9020d57af", + "source": "research/p104-iterated-returns/continuation/evidence/application.json", + "blob": "e8ebb6c968b10957217e2155ed4513a01c7366f4", + "sha256": "2a3946fc2fdcbf2b52f6fd4d67bcfb8920b5ef871a556bd939501f384fc82203" + }, + { + "local": "research/single-grade-rank-compiler/retained/pending-bit.json.gz", + "commit": "89a67c404226d51028e135de2b9169e9020d57af", + "source": "research/p104-iterated-returns/binary/FINITE.json", + "blob": "bdae53246cb783c49b314cc9ad14a7d43cf31c41", + "sha256": "0cebc543d64ca53ac6c7141dfab40c658bf451fe89bb7744befb76c116ea45e6" + }, + { + "local": "research/single-grade-rank-compiler/retained/PENDING-NOTICE", + "commit": "89a67c404226d51028e135de2b9169e9020d57af", + "source": "research/p104-iterated-returns/NOTICE", + "blob": "3b083891bf59f449b49df024ab7df3feaf6054b8", + "sha256": "4f7d16a4dcaae02de7e7583f7fbb14d5edd19dc4c10b4f47571c145204505844" + }, + { + "local": "research/single-grade-rank-compiler/retained/supplier_gate.py", + "commit": "4f7c67ae387cc91580f469aeda4d508b372b9ec1", + "source": "research/p104-dual-supplier-lift/complex/supplier_gate.py", + "blob": "fe05580142b56854436ca7b5d9b829393a99f075", + "sha256": "3796b2e5a27f3caa142d16364154788e60d0099f1e24a8dcd028e4fbd35a84ca" + }, + { + "local": "research/single-grade-rank-compiler/retained/GATE-NOTICE", + "commit": "4f7c67ae387cc91580f469aeda4d508b372b9ec1", + "source": "NOTICE", + "blob": "59d8e0cf3102e15bd11db430838365531e2d7f18", + "sha256": "b49022cb4104d90b182e4c335f670faf45529025b15db77bf0291835083c28bd" + } +] diff --git a/research/single-grade-rank-compiler/PROOF.md b/research/single-grade-rank-compiler/PROOF.md new file mode 100644 index 0000000000..6701e806e6 --- /dev/null +++ b/research/single-grade-rank-compiler/PROOF.md @@ -0,0 +1,87 @@ +# A finite rank compiler with one productive tensor grade + +## Contract + +A source word has true ambient rank `A`. At each positive integer column count it has the **same finite ordered list** of local instructions and paid requests. A productive role has its own arbitrary complete field. A paid request acts on its actual current owner, which may be an owned center. At a completed boundary, an explicit invertible adapter on the whole field identifies each target or request with a positive transform on specified coordinates and the identity on the other coordinates. The inverse adapter returns before the next dependent instruction. Positive transforms on disjoint axes compose to the transform on their union. Local storage, scalar operations, adapters and retirement have their source meanings and costs. [APPLICATION.md](APPLICATION.md) identifies these primitives in the two source alphabets. + +Start with normalized target and paid boundaries. In the complex source a native endpoint can be `L C_s R` with distinct, two-sided factors. Apply the prescribed two factors in their source order, including their absolute phases. Only an extra placement that permutes coordinates or role rows is undone by its own inverse. Write `W_k` for the number of target roles of rank `k`, and count each occurrence of each positive paid rank `r` in chronological order. All ranks lie in `[1,A]`. Assume a nonempty paid list and at least one target of rank greater than one. Put + +```text +T(s) = sum_k W_k k^s, P(s) = sum_j r_j^s. +``` + +Fix `0 ((1-s) log P(t) + (s-t) log P(1)) / (1-t). +``` + +Under this condition a finite compiler produces independent full-rank outputs with only rank-one paid calls. For each `z>t` there is a fixed `N` with `P_N / W_N < N^z`. The construction is effective for rational prices, or with computable prices and certified strict margins. For fixed source and fixed trial price its width and its number of pre-cover instruction records grow polynomially in the terminal rank `N`. In the five source applications below the common cuts also give a fixed polynomial degree as the trial price approaches the raw crossing. The criterion of necessity concerns the stated intermediate-word grammar. Changed native words, mixed retained grades, paid cancellations and other compilers can have different criteria. + +## Construct the native product + +Here and below the compiler manipulates a finite operation list at a fixed rank. There is no oracle for a recursive job or for a uniform compiled supplier. + +Compose words `U,V` with true ambients `a,b`. In an `a b`-axis space put a separate `U` instance at multiplicity `k_j(V)` for each productive role `j` of `V`. Give each instance its own arbitrary input fields and owned banks. Complete the unused axes as spectators. Advance every instance to the *same* chronological paid position of rank `r` in `U`. The resulting owners are distinct, including when a local request uses an owned bank. The complete `V` word at multiplicity `r` acts on these owners. Its role `j` has precisely the requested `r k_j(V)` active axes. Apply the role-specific complete normalizers, execute `V`, undo the normalizers and resume each suspended instance. Both working windows fit because `a k_j(V)<=ab` and `b r<=ab`. Use fresh banks at each occurrence. The same argument works at any further positive integer lift. It gives targets `k_i(U) k_j(V)` and paid ranks `r_i(U) r_j(V)`. This is Cinna Davis's chronological product construction with explicit independent working ambients. [Product proof](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/pr4359-tensor-strictification/TENSOR.md) + +For power `v` the true work window is `M=A^v`. A type has counts `n_k` with sum `v`, grade `K=product k^n_k`, and exactly `B=v! product W_k^n_k / product n_k!` distinct input slots. In particular `B K^s<=T(s)^v`. Keep those slots. Supply fresh owned zero fields for the other slots, run their instructions, and retire them after their completed outputs. Each discarded output is its own transform applied to zero. No issued request can be dropped, including a request on a bank that currently happens to be zero. This specialization uses distinct storage and preserves the original scalar word. It applies to all arbitrary values on the retained fields. Additional types with the same grade need not be credited. + +## Proof of the criterion + +Any split of `R` into positive pieces smaller than `K` has moment at least `R^t` by subadditivity, and at least `K^(t-1) R` by summing over its pieces. Thus success implies `BK^t>P(t)^v` and `BK>P(1)^v`. Interpolate the logarithms of these two strict inequalities. The line `log B+s log K` is below `v log T(s)` even if several types with grade `K` are used. This proves necessity. + +For sufficiency let `f=log T` and let `L` be the paid chord in the criterion. Choose a minimizer `u` of `f-L` on the closed interval, and put `eta=f(u)-L(u)>0`. The derivative of `f` is the mean of `log k` with weights `w_k=W_k k^u/T(u)`. Its second derivative is the variance of `log k`. At an interior minimizer the derivative matches the slope of the chord. At either endpoint its one-sided sign gives, for both `s=t,1`, + +```text +f(u) + (s-u) f'(u) - L(s) >= eta. +``` + +Choose a modal term of the multinomial expansion of `(sum w_k)^v`. There are at most `(v+1)^d` terms, where `d` is the number of distinct target ranks. Its type gives `BK^u >= T(u)^v/(v+1)^d`. To see how close its rank is to the tangent, first take `floor(v w_k)` occurrences of each rank. Their priorities `w_k/j` are at least `1/v`. All next priorities are smaller. Pick the remaining, at most `d-1`, by the largest next priority. This maximizes `product w_k^n_k / n_k!`. Since the total deficit from the ideal allocation is at most `d`, the error in `log K - v f'(u)` has magnitude at most `d log(k_max/k_min)`. In particular `K` grows exponentially because `f'(u)>0`. + +Consequently `BK^t/P(t)^v` and `BK/P(1)^v` both grow at least exponentially divided by a fixed polynomial in `v`. Set `J=floor(K/2)`. Split each paid product rank `R>J` into consecutive jobs of rank `J` and a final positive remainder if needed. Keep the entire original adapter around the split. For large ranks its charge is at most `2 R J^(t-1)`. The complete cost is therefore at most + +```text +P(t)^v + 2 J^(t-1) P(1)^v. +``` + +As `J>=K/3`, the ratio of this expression to `BK^t` tends to zero. Choose a power giving a ratio `mu<=1/2`. For rational input prices there is an effective search without a real-valued tie oracle. Enumerate powers and types, split using integer ranks, and compare the finite sums by successively refined rational intervals until a strict success is found. Dovetail the comparisons so equality at one candidate cannot stall the search. The preceding proof guarantees termination. The explicit application certificate takes a shorter route. + +The two endpoints alone cannot replace the interval condition. For `T(s)=70+256^s`, `P(s)=18·16^s` and `t=1/2` the endpoint comparisons are `86>72` and `326>288`. At `s=3/4` the target is 134 against the required 144. Necessity rules out every power and every single retained grade of this word. + +Even strict raw moment advantage at *every* price can fail this grammar. Take `T(s)=2+256^s` and `P(s)=1+256^s`. At the midpoint the chord condition would require `66²>17·257`. It fails by 13. Conversely, an interior tangent can succeed when the trial-price tangent fails. For `T(s)=25+256^s`, `P(s)=8·16^s`, let `y=16^s`. Then `T(s)/y=25/y+y>=10>8` everywhere. The tangent at `t=1/2` misses the rank-one endpoint since `41^41·256^8<128^41`. At power 12 retain six slots of each rank on every target path. This type gives `K=16^12` and `B=binom(12,6)25^6`. Splitting each of the `8^12` paid requests in two gives `mu<1/2` by the integer test `8·8^24=2M` axes. A job specifies its owner, complete normalizer and `e` active axes. Its argument is the entire original field. It fixes every inactive coordinate at return, although its temporary scalar operations can use that coordinate. Each input needs `N` working axes once. Descendants inherit the same space. + +For `e1+(1-t)(2+v ceil(log2 A))` and `N>=2M` suffices. All productive credit belongs to those `W_N` independent inputs. A single public root has no divisibility assumption beyond the separately reserved physical row stock in the outer algorithm. + +## A polynomial bound for the actual sources + +The five checked profiles allow `J=8^v` and `K>=16^v`. For a trial saving `p=1-t`, [funding.py](funding.py) uses 275-bit lower bounds `a_k` on `W_k k^t` in a common dyadic unit. Let `S` be their sum in real units. It checks `S>P(t)`, `S·8^p>P(1)`, and computes a modal type for the rational weights `a_k/sum a_k`. The previous type bound applies with `S` in place of `T(t)`. A directed log sum verifies its actual grade. For `v=2^j` it certifies `v·min(1-P(t)/S, log(S·8^p/P(1))) >= d(j+1)+3`. Hence the split paid-to-productive ratio is at most `3/8`. The code also verifies the cutoff margin and `f'(1-p_max)>log 16` at `p_max=1/250` (historical p7 uses `3/1000`). By convexity the cutoff remains valid throughout the price interval whenever the raw moment is strict. A finer arithmetic grid can be required arbitrarily near equality. The finite witness stores the exact type counts without expanding its factorials. + +Every paid rank descends by a factor of at least `2^v`. At level `j>=0` an actual native call requires `16^v<=N 2^(-jv)`. Thus `D<=floor(log2(N)/v)` with no extra level or price-dependent width factor. If `B0=sum W_k` and `Q0` is the raw paid count, then `B<=B0^v` and **`W_N<=N^ceil(log2 B0)<=N^16`**. This also holds for smaller roots run sequentially. The bound is in the final uniform rank, before the binary cover. + +Here is a conservative expanded instruction bound. The number of paid children of a macro is at most `(A Q0)^v`, even if every paid product were split to individual axes. Thus visits at all levels per root tile per initial owner are bounded by `(1+(A Q0)^v)^D<=N^ceil(log2(2 A Q0))<=N^27` (for `D=0`, one base visit). Replicas grouped into one call only reduce this bound. A native product uses `sum_{i=0}^{v-1} B0^(v-1-i) Q0^i` raw occurrences. At each product boundary charge both complete matchers for each routed role. Counting the levels, bindings and terminals gives at most a source-dependent constant times `(v+1)(B0+Q0+A Q0+2)^v` local records per macro, including specialization, paid slices and retirement. For example, each contraction matches at most `B0^v Q0^v` only in a naive cross-product enumeration. The chronological product instead has at most `v(B0+Q0)^v` such bindings: a routed role at an internal product boundary is specified by a target prefix, one paid position and a paid or target suffix of total length at most `v`. Equivalently, adjoining one outer factor starts `B0^i` raw instances, adds at most `2Q0 B0^i` whole-job matchers at that boundary, and invokes `Q0` copies of the existing inner product. Summing this recurrence gives the stated bound. Each raw occurrence contributes its own full fixed raw-record allowance. + +For these profiles `B0+Q0+A Q0+2<2^27`, `A>=2^6` and `N>=A^v`. The macro bill is `O_source(N^6)`. There are at most `N` root tiles. Even charging another factor `N` at every visit for rank-one peeling, the fully expanded instruction and reserved-bank occurrence counts are **`O_source(N^51)`**. The degree and multiplicative primitive allowance can be taken independent of the trial price within the checked family. This is a logical record count. It does not price one physical field as one bit, bound the cardinality of the binary cover by a polynomial, or establish the bit size of every rational matrix. [APPLICATION.md](APPLICATION.md) pays the complete physical volumes, descriptors, prime exclusions and primitive thresholds after fixing the word. diff --git a/research/single-grade-rank-compiler/README.md b/research/single-grade-rank-compiler/README.md new file mode 100644 index 0000000000..3951180a7a --- /dev/null +++ b/research/single-grade-rank-compiler/README.md @@ -0,0 +1,42 @@ +# A polynomial-width compiler for mixed-rank multiplication suppliers + +A native multiplication supplier can produce many independent transforms of different ranks and request other ranks as it runs. The complete multiplier needs independent **full** transforms and positive rank-one requests. This package gives a different way to compile one interface into the other. For the selected and pending complex and binary words, the compiler needs at most **`N^16` productive fields** and **`O_source(N^51)` pre-cover instruction records** at final rank `N`. The degree is uniform as a strictly funded price approaches the raw crossing. The proof supplies the finite compiler implication for these four words from their raw primitive contracts. Both binary services start from individual digit swaps. + +The algorithm keeps one productive grade of a chronological product. It splits oversized paid requests. Each recursive request works inside the *original* tensor, where it can borrow real spectator coordinates and return them. Every productive owner receives its entire transform through disjoint tiles at the root. This avoids an integer Pascal flow, a completion job per source, and intermediate covered binary weights. A necessary and sufficient interval criterion determines when this particular single-grade construction can succeed. Even a raw surplus at every price can miss that criterion. + +[Compiler theorem and record count](PROOF.md) · [Complete physical application](APPLICATION.md) · [Literal product generator](product.py) · [Rank-one schedule](schedule.py) · [Exact types and dimensions](RESULT.json) · [Replay scope](VALIDATION.md) + +| Complete caller | Complex raw price used | Ordinary BIT delivered | Complete conditional κ | +| --- | ---: | ---: | ---: | +| Selected shared native | .00363005817007 | .00385248 | .00363005817 | +| Pending four-return P104 | .00387944011075 | .003879927836145 | .00387944011068 | + +The selected program uses at most `N^15` productive fields on each supplier. The pending complex program gives the largest bound, `N^16`. Hence the outer complex productive row divisor at dimension `d` is at most `N^48 max(1,d)^16`, before separately reserved owned banks, compact controls and simultaneous BIT stock. The binary cover still has the full `GL_N` row factor. The algorithm pays for it. + +There is a substantial tradeoff. For the pending complex word the old sufficient `log2 N` was **15,171,300,000,000,000,000**. This construction uses **223,634,496,475,974,210,983,125,057,536**. The polynomial guarantees concern the program at its own rank. Comparing those guarantees does not establish a smaller physical machine, faster practical multiplication, or a larger κ. The large words have constructive descriptions and finite dimension witnesses. The complete words have not been emitted or executed at those dimensions. + +## Comparison and credit + +- Cinna Davis supplied the p7 product and paid splitting. Jacob Alan Sussman supplied the multinomial integer lockstep construction. zxv supplied the native finite-precompilation and subsequent direct-flow work. The later adaptive-height compiler already approached the historical p7 raw crossing without tensor padding. The present procedure changes the mechanism and resulting size bound. It does not settle a new exponent for that earlier flow. [Chronological product](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/pr4359-tensor-strictification/TENSOR.md) · [Native finite compiler](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/kappa-rebuild/architecture/FINITE-PRECOMPILATION.md) · [Direct-flow checkpoint](https://github.com/CrocSwap/integer-mult-bounds/pull/4436) · [Adaptive-height compiler](https://github.com/CrocSwap/integer-mult-bounds/pull/4483) · [Effective original-flow bound](https://github.com/CrocSwap/integer-mult-bounds/pull/6713) +- Nick Petalas obtained exact polynomial width for a homogeneous rule already having rank-one paid positions. JoyboyBrian bounded multiplicative shells for the adaptive LCM recurrence. CubeJerry gave explicit chronological rank libraries at independent ambient caps, and Nick Petalas sharpened their plateau divisors. These results describe their own compilation policies. The present bound applies to a new schedule for actual mixed productive and paid ranks. It gives no lower bound on any predecessor's widths. [Homogeneous width](https://github.com/CrocSwap/integer-mult-bounds/pull/6612) · [Adaptive shell bound](https://github.com/CrocSwap/integer-mult-bounds/pull/6086) · [Ambient libraries](https://github.com/CrocSwap/integer-mult-bounds/pull/7424) · [Plateau bounds](https://github.com/CrocSwap/integer-mult-bounds/pull/7464) +- Jerry Chen (CubeJerry) supplied the selected physical and precision application. DreamingOfClouds supplied the shared native/chain/paired-caller lineage. Ali Romman supplied the independent-helper and P104 caller predecessors. Clear1nsight supplied the continued four-return construction. Retain the frame work of icekylinx/Dugongue, zxv's rational BIT and delayed-cover work, Cinna Davis, SYLforge, Rohan Arun, Matarener, Douglas Colkitt, and the further authors in the source notices. Historical p7 uses Ryanson Jonathan's invoice check and zxv's higher-moment application. [Selected credits](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md) · [Pending notice](https://github.com/Clear1nsight/integer-mult-bounds/blob/89a67c404226d51028e135de2b9169e9020d57af/research/p104-iterated-returns/NOTICE) · [Historical p7 source](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/higher-moment-strictification/README.md) +- The earlier campaign identified complete-row restoration, paid independent-input requirements, and the two-sided outer budget. Its ordinary-interchange successor supplies an explicit elementary digit service. The present compiler uses those boundary lessons and the earlier audited native words. The Clifford decoder does not supply either native word. [100-result inventory](https://github.com/aliromman/integer-mult-bounds/blob/34a20a30596467409e7361534d52495819787a78/research/clifford-unknown-support-decoder/INVENTORY.md) · [Ordinary interchange](https://github.com/CrocSwap/integer-mult-bounds/pull/7826) + +Ali Romman with substantial OpenAI Codex assistance in the construction, implementation, independent adversarial checks and writing. The agents that checked the two source bindings and arithmetic shared the same tool environment. Their checks provide separate derivations and executions. Independent human acceptance and formal proof-kernel verification are open. New material is Apache-2.0. [Source records](ORIGINS.json) · [Scoped Discussion](https://github.com/CrocSwap/integer-mult-bounds/discussions/7827) + +## Reproduce + +```sh +python3.12 -B scripts/research_package.py --package research/single-grade-rank-compiler +``` + +Expected final line: + +```text +PASS_REGISTERED_RESEARCH_PACKAGE research/single-grade-rank-compiler outcome=completed +``` + +## Open next questions + +- Can several productive grades share one fixed root reservation and retain the polynomial size bound? Start with the all-price surplus example that fails the necessary single-grade chord. Its full normalized bill and independent endpoints are the first test. +- Can a compiler keep the four actual supplier prices and the polynomial row guarantee at a substantially smaller sufficient ambient? Compare both the type-concentration cost and the root tiling cost with the dimensions in the exact receipt. diff --git a/research/single-grade-rank-compiler/RESULT.json b/research/single-grade-rank-compiler/RESULT.json new file mode 100644 index 0000000000..d3a9d84839 --- /dev/null +++ b/research/single-grade-rank-compiler/RESULT.json @@ -0,0 +1,211 @@ +{ + "selected_complex": { + "raw_saving": "363005817007/100000000000000", + "uniform_saving": "181502908503/50000000000000", + "price_cap": "1/250", + "source_ambient": 153, + "source_target_count": 23392, + "source_paid_count": 117612, + "target_weights_grid_bits": 275, + "raw_fraction_slack_lower": "6041622888492652427/1000000000000000000000000000000", + "cut_log_slack_lower": "154513139951435774950730177/200000000000000000000000000000", + "cap_mean_minus_log16_lower": "397373035150983623265235629271/1000000000000000000000000000000", + "cap_cut_log_slack_lower": "92262934945107463791470811/250000000000000000000000000000", + "v": 281474976710656, + "type": { + "1": 207329065081, + "2": 572699206493, + "3": 2096808605366, + "4": 13646766963273, + "5": 5390864951163, + "6": 3992938705220, + "7": 1995352488920, + "8": 8484052699416, + "9": 88016063539426, + "17": 6201831788471, + "25": 9107581529246, + "33": 12009897709982, + "41": 14909635285964, + "49": 17807306442954, + "57": 20703253046032, + "65": 23597719703737, + "73": 26490890181618, + "145": 26243984798294 + }, + "log_K_over_16_to_v_lower": "111979784377762753224774980650866246452959859/1000000000000000000000000000000", + "split_cap": "8^v", + "minimum_target": "16^v", + "mu_upper": "3/8", + "H": 817416431103305304760123392, + "N": "2^H", + "depth_at_most": 2904046536057, + "dimension_log_slack_lower": "90374482538321/50000000000000", + "batch_width_degree_upper": 15, + "all_recursive_visits_degree_per_root_owner": 26 + }, + "selected_BIT": { + "raw_saving": "385253/100000000", + "uniform_saving": "38525299/10000000000", + "price_cap": "1/250", + "source_ambient": 134, + "source_target_count": 19950, + "source_paid_count": 107352, + "target_weights_grid_bits": 275, + "raw_fraction_slack_lower": "2508641496303475842477/200000000000000000000000000000", + "cut_log_slack_lower": "530328312614238416178768003/500000000000000000000000000000", + "cap_mean_minus_log16_lower": "362346000043985048910898941133/1000000000000000000000000000000", + "cap_cut_log_slack_lower": "90499172005958967042439713/100000000000000000000000000000", + "v": 68719476736, + "type": { + "2": 16987421, + "4": 847105979, + "6": 50747026, + "8": 28544560940, + "15": 1559186274, + "22": 2283434865, + "29": 3006780579, + "36": 3729447255, + "43": 4451569314, + "50": 5173236608, + "57": 5894513488, + "64": 6615448337, + "127": 6546458650 + }, + "log_K_over_16_to_v_lower": "24910782988901498222694731704894366358507/1000000000000000000000000000000", + "split_cap": "8^v", + "minimum_target": "16^v", + "mu_upper": "3/8", + "H": 21179507725498843136, + "N": "2^H", + "depth_at_most": 308202401, + "dimension_log_slack_lower": "7330303267/1250000000", + "batch_width_degree_upper": 15, + "all_recursive_visits_degree_per_root_owner": 25, + "covered": "19262649/5000000000", + "ordinary": "12039/3125000", + "cold_start_gap": "546399601/1250000000000", + "levels_from_elementary": 3 + }, + "pending_complex": { + "raw_saving": "15517760443/4000000000000", + "uniform_saving": "193972005537/50000000000000", + "price_cap": "1/250", + "source_ambient": 137, + "source_target_count": 52512, + "source_paid_count": 283248, + "target_weights_grid_bits": 275, + "raw_fraction_slack_lower": "22813474012323469/1000000000000000000000000000000", + "cut_log_slack_lower": "536902818426384203760357473/500000000000000000000000000000", + "cap_mean_minus_log16_lower": "406119431837223772927349804303/1000000000000000000000000000000", + "cap_cut_log_slack_lower": "14707342350746392238580293/15625000000000000000000000000", + "v": 72057594037927936, + "type": { + "1": 93751005031266, + "2": 65449471549474, + "3": 140028432693340, + "4": 4513211001547789, + "5": 745339790337700, + "7": 455925103064632, + "8": 1190371220104904, + "9": 22671789769420932, + "17": 2049249099616891, + "25": 3009096174730637, + "33": 3967731180972143, + "41": 4925455988750416, + "49": 5882451430367712, + "57": 6838838198507157, + "65": 7794702646573114, + "129": 7714203524659829 + }, + "log_K_over_16_to_v_lower": "29273869399795144578263570191201829566085012377/1000000000000000000000000000000", + "split_cap": "8^v", + "minimum_target": "16^v", + "mu_upper": "3/8", + "H": 223634496475974210983125057536, + "N": "2^H", + "depth_at_most": 3103552088601, + "dimension_log_slack_lower": "35978409074952893/50000000000000", + "batch_width_degree_upper": 16, + "all_recursive_visits_degree_per_root_owner": 27 + }, + "pending_BIT": { + "raw_saving": "1939964018077/500000000000000", + "uniform_saving": "1939963968077/500000000000000", + "price_cap": "1/250", + "source_ambient": 134, + "source_target_count": 20706, + "source_paid_count": 107460, + "target_weights_grid_bits": 275, + "raw_fraction_slack_lower": "6655428268381870943/500000000000000000000000000000", + "cut_log_slack_lower": "1087404436640933864046072113/1000000000000000000000000000000", + "cap_mean_minus_log16_lower": "353132669293631636424725714591/1000000000000000000000000000000", + "cap_cut_log_slack_lower": "961767754553121860854520319/1000000000000000000000000000000", + "v": 70368744177664, + "type": { + "1": 70044498510, + "2": 157176847422, + "4": 1497878340053, + "5": 348042341114, + "6": 52169433739, + "8": 27885301101793, + "15": 1602849042942, + "22": 2347354542567, + "29": 3090925315356, + "36": 3833793102375, + "43": 4576097068230, + "50": 5317930235055, + "57": 6059359226378, + "64": 6800434129282, + "127": 6729388952848 + }, + "log_K_over_16_to_v_lower": "24858651710629734737959032232499154561693431/1000000000000000000000000000000", + "split_cap": "8^v", + "minimum_target": "16^v", + "mu_upper": "3/8", + "H": 21842053079886674788352, + "N": "2^H", + "depth_at_most": 310394243, + "dimension_log_slack_lower": "189180719362253411/250000000000000", + "batch_width_degree_upper": 15, + "all_recursive_visits_degree_per_root_owner": 25, + "covered": "1939963918077/500000000000000", + "ordinary": "775985567229/200000000000000", + "cold_start_gap": "1491015601173/125000000000000000", + "levels_from_elementary": 5 + }, + "historical_p7": { + "raw_saving": "33581/12500000", + "uniform_saving": "376107/140000000", + "price_cap": "3/1000", + "source_ambient": 121, + "source_target_count": 7688, + "source_paid_count": 55998, + "target_weights_grid_bits": 275, + "raw_fraction_slack_lower": "623843680918852306839/40000000000000000000000000000", + "cut_log_slack_lower": "1210453764801645883829719041/1000000000000000000000000000000", + "cap_mean_minus_log16_lower": "28825727916318066734480488737/50000000000000000000000000000", + "cap_cut_log_slack_lower": "812333567000502882884784117/1000000000000000000000000000000", + "v": 34359738368, + "type": { + "5": 550350587, + "6": 424348269, + "7": 1539589341, + "8": 2921029683, + "9": 7523981643, + "25": 2922539526, + "41": 4786599244, + "57": 6648652824, + "121": 7042647251 + }, + "log_K_over_16_to_v_lower": "3964226162778364117869976341402256780677/200000000000000000000000000000", + "split_cap": "8^v", + "minimum_target": "16^v", + "mu_upper": "3/8", + "H": 452303109020975104, + "N": "2^H", + "depth_at_most": 13163753, + "dimension_log_slack_lower": "24039983782857142857142857142857/500000000000000000000000000000", + "batch_width_degree_upper": 13, + "all_recursive_visits_degree_per_root_owner": 24 + } +} diff --git a/research/single-grade-rank-compiler/SOURCES.json b/research/single-grade-rank-compiler/SOURCES.json new file mode 100644 index 0000000000..6b76544ac2 --- /dev/null +++ b/research/single-grade-rank-compiler/SOURCES.json @@ -0,0 +1,97 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/frontier7000/CLAIM.json", + "usage": "input", + "git_blob": "c9b816f8445be9dc19b2259e03e9d8709d18c87a", + "sha256": "3f8add8252adb223b60418ec69351a69b6b5edfe601ec1c6b4b65cd9e2afd9b2" + }, + { + "path": "research/paired-query-only-bit/EFREE-RESULT.json", + "usage": "input", + "git_blob": "575f76487f9999ecc3e7b1b70f9f71bc582ef8a8", + "sha256": "a46b6c6040f75184cab5467656811ad988c216e3bc8e44d595a5015b6e49620b" + }, + { + "path": "research/shared-wire-split-composition/FULL-RESULT.json", + "usage": "input", + "git_blob": "ff3256f0d3ffbfc56b062f9ec0fdbbc7b30e76d5", + "sha256": "d9ba709fa5dcefffe3f3abdcf34600ce188224703cfd743e6db8b58ba4816cb7" + }, + { + "path": "research/shared-wire-split-composition/interval_gate.py", + "usage": "input", + "git_blob": "e24dc46079b4c25152f5afc096dda2ce8ee58ff5", + "sha256": "60a743d13f668ef86db4b8215b4d5d04430a671ba6f1fe06d9c1c4c3dfe86da5" + }, + { + "path": "research/paired-query-only-bit/retained/inputs/BIT-NATIVE-WORD.json.gz", + "usage": "input", + "git_blob": "b718d6b2848215ad785022106dfa9f871a3d1c0c", + "sha256": "51203e7fc75ba10bd3ac3f8e675759f47e13d262bea66b6600d1e515095cad78" + }, + { + "path": "research/higher-moment-strictification/RESULT.json", + "usage": "input", + "git_blob": "e66b39c674028adfd22f0de3170555dccda52f6a", + "sha256": "ad79e3c0459e7b495a0ca34010553b12147779a007389e1695cc1336f123c156" + }, + { + "path": "research/shared-wire-split-composition/data/caller.json", + "usage": "input", + "git_blob": "cf55f4271009a06ad192a070d330a4466b6d44fa", + "sha256": "3828d53e80ea97e8b866320f081af20b6b93bfebd58b95b56b85a7afe151af5e" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md", + "usage": "provenance", + "git_blob": "3dd1af2285e597676725e85ad4f65e7ad326d695", + "sha256": "4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055" + }, + { + "path": "research/kappa-rebuild/architecture/FINITE-PRECOMPILATION.md", + "usage": "provenance", + "git_blob": "4badb40f0919c515823cb07e44c6470d4d6469ca", + "sha256": "4cb32f6b8e388ecf6ed41b5bbdeeb4539cb40c8424f194974afea58f7e0921e8" + }, + { + "path": "research/kappa-rebuild/bit/DELAYED-COVER-BRIDGE.md", + "usage": "provenance", + "git_blob": "a58774e237c9362869a60a22bda35be09fb85872", + "sha256": "9731b93026717f5fa15851e3633cbb4bdc76eba2bffb9d6b4a3b69f7dd502443" + }, + { + "path": "research/kappa-rebuild/transfer-audit/OUTER-TRANSFER-AUDIT.md", + "usage": "provenance", + "git_blob": "e8b7ef8956ece5bd493cbf52113916e5dc288535", + "sha256": "67569961d068633c6ff3ac9dfde47a0c17f0da6d20432799dcc920cff92b5779" + }, + { + "path": "research/odd-native-common-grid/PROOF.md", + "usage": "provenance", + "git_blob": "edea8e98a082f4513aedbfb7bd55f32063e32b38", + "sha256": "b710cc953163ebe282fce7cf0a426744c155a0d5acbfb9bf7d67e81195b66a1e" + }, + { + "path": "research/pr4359-tensor-strictification/TENSOR.md", + "usage": "provenance", + "git_blob": "c7c28b4d2590a6fa06383fbdf1c7b56084269013", + "sha256": "d65a39979a0d44ba85123f9e323614caf8efe5585f3b5ea2cb6091c11ce1acc5" + } + ], + "retained_exports": "ORIGINS.json" +} diff --git a/research/single-grade-rank-compiler/TASK.json b/research/single-grade-rank-compiler/TASK.json new file mode 100644 index 0000000000..8dd694d945 --- /dev/null +++ b/research/single-grade-rank-compiler/TASK.json @@ -0,0 +1,91 @@ +{ + "schema_version": 1, + "task_id": "coverage-law-change", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "coverage-law-change", + "question": "Can a completed call earn more independent productive target credit without an offsetting paid bill?", + "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": "A source-bound arbitrary-input identity and legal producer/consumer boundary with the complete paid and productive target invoice, including restoration, ownership, native alignment and extra charges. Price under the actual current model; historical ceiling.py assumptions must be established before use. A favorable optimistic relaxation keeps a route open but is not a completed supplier. A scoped local result remains useful; expansion requires the family-level budget gate.", + "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": "Use #5599 as a completed positive control, then choose one uncovered cut/module beyond an applicable frozen exclusion. Derive independence, saturation and chronological availability rather than counting rational rank alone. Price target credits and all new jobs together, then check compiler and actual caller compatibility. Stop on a nonphysical credit or an unfavorable complete relaxation.", + "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": [ + "target credit", + "helper split", + "coverage law" + ], + "existing_checks": [ + { + "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", + "scope_change_reason": "The draw asks for additional independent raw credits. The investigation tests the finite compiler that consumes those credits on both actual suppliers. The five-point thesis fixes the four source applications before construction.", + "actual_scope": "Construct a finite rank-one compiler for raw overlapping profiles with one retained grade, prove its strict criterion, and establish polynomial pre-cover size and two complete caller applications.", + "bottleneck_link": "Both complete multipliers need an independently productive full-rank interface. Their selected compiler uses a separated floor and chronological integer flow. The new implication starts at the raw primitive boundary.", + "budget_minutes": null, + "stop_rule": "Prove the generic construction and its complete source and consumer obligations, test its failure boundary and obtain separate adversarial checks.", + "outcome": "completed", + "evidence": "PROOF.md, APPLICATION.md, RESULT.json and the registered verification bind the compiler, the two source pairs, and the complete outer ledgers.", + "author": "Ali Romman", + "ai_assistance": "Substantial OpenAI Codex assistance in mathematics, implementation, separate adversarial checks and writing.", + "coordination": "https://github.com/CrocSwap/integer-mult-bounds/discussions/7827", + "freshness": { + "main": "e54523517d0f03e58352e647c403a5af3e525a57", + "priority_revision": 8, + "picker_seed": "8d94a7a957a46f12cc3d31b389274574", + "as_of": "2026-11-20 UTC", + "selected_kappa": "363005817/100000000000", + "compared_pending": [ + "7786@89a67c404226d51028e135de2b9169e9020d57af" + ], + "orientation": "Compared 1122 open PR records, 6175 closed PR records and 7806 Discussion records in the prior snapshot with a fresh query of active threads and recent PRs. Full remote archives can miss later comments." + }, + "open_questions": [ + { + "question": "Can multiple retained grades pass the adverse chord example with polynomial width?", + "why_it_matters": "The single-grade criterion is exact for the current grammar.", + "first_step": "Construct full owners and price all paid calls for T=2+256^s and P=1+256^s.", + "blocked_by": "No valid mixed-grade runtime interface for this example is established here." + }, + { + "question": "Can the ambient bound fall while the polynomial row guarantee and both prices are retained?", + "why_it_matters": "The present dimension witnesses exceed their predecessors.", + "first_step": "Price the full spectral loss and the root tile bill before comparing dimensions.", + "blocked_by": "Power concentration and the full-ambient root toll both enter the current thresholds." + } + ] +} diff --git a/research/single-grade-rank-compiler/VALIDATION.md b/research/single-grade-rank-compiler/VALIDATION.md new file mode 100644 index 0000000000..e40323eacc --- /dev/null +++ b/research/single-grade-rank-compiler/VALIDATION.md @@ -0,0 +1,18 @@ +# Verification boundary + +The written proof gives the quantified compiler and physical implication. The finite tests check source data, integer witnesses, executable schedules, and vulnerable transitions in that argument. + +| Replay | Evidence | +| --- | --- | +| `check_funding.py` | Authentic source bytes, positive directed margins at five raw prices, exact retained types, effective dimensions, constant cuts, width and visit degrees, both complete binary price chains from saving zero, and a negative chord control even with a strict raw surplus at every price. | +| `check_schedule.py` | 36 complete formal-array cases at three positive tensor lifts. Tracks full address permutations of every source field and all coefficients, internal use of spectator axes, a paid owned center, retirement and the exact leaf bill. It also checks dimensions exceeding a platform range-length limit. | +| `check_product.py` | Ten end-to-end cases start at a two-grade raw word. They construct its product, supply 396 discarded whole fields, split a rank-four paid return, expand all 3,140 leaves and verify independent full endpoints. Corrupted ownership, extra public dependence and incompatible serialized type counts are rejected. | +| `check_cover.py` | Two genuine protected rank-four helper frames, 25-dimensional rational-projector geometry modulo 101², ragged tiles, nested right routes and inverses. A second test exercises all 48 rows of GL₂(F₃) and all 81 addresses on two independent roles. Omitting a tile, changing a matcher and inserting an uncompensated early cover alter 5,184, 2,592 and 6,912 labelled cells respectively. The paid slices in the geometry fixture are constructed test slices. | +| `check_cold.py` | 72 fixed-radix layouts and 618,408 independently labelled cells check the elementary forward and inverse digit interchange with complete spectators. | +| `check_callers.py` | Reconstructs the two actual complex invoices, verifies their real source grids and depths and runs the original outer gates. Each passes 54 strict and four functional predicates with minimum margin 10⁻¹⁵. The increased dimension and new depth witnesses are checked separately from the old gates' internal reference calculations. | + +All registered commands require only Python 3.12 and the standard library. The source gates contain assertion-based checks and run with assertions enabled. The new optimized-mode replays keep their explicit rejection checks active. The inputs and the historical source exports have exact Git blob and SHA-256 bindings. The compressed pending objects expand byte-for-byte to their pinned files. [Input bindings](ORIGINS.json) · [Replay manifest](VERIFY.json) + +Separate adversarial checks compared more than 22,000 exact leaf recurrences and independently enumerated 1,375 small multinomial optima. The complex reviewer tested every one of 220,223 pre-add products and 6,998 ordered cuts in the actual pending native scalar graph with correlated nested input. Omitting a local odd factor failed a division at row 155953. The binary reviewer checked the original nonintegral high-row right route on 7,776 affine carries, and separately obtained a direct binary witness by using the original tail bounds and pigeonholing a grade. These are additional development checks. The registered package uses the five explicit modal types and its own full-volume fixtures. + +The original complete native words, operator/adapter implementations, physical movement tariffs, analytic multiplication and final recovery remain source dependencies. This package does not replay unrelated historical suites or the whole native admission from scratch. The large product, full terminal program, prime and binary cover are specified by finite algorithms. Their complete physical instantiations have not been built. There is no end-to-end multiplier benchmark or proof-assistant result. A passing hosted or local replay is a software result. Scientific acceptance is a separate review. diff --git a/research/single-grade-rank-compiler/VERIFY.json b/research/single-grade-rank-compiler/VERIFY.json new file mode 100644 index 0000000000..640e6b1d81 --- /dev/null +++ b/research/single-grade-rank-compiler/VERIFY.json @@ -0,0 +1,115 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "certificates/frontier7000/CLAIM.json", + "research/paired-query-only-bit/EFREE-RESULT.json", + "research/shared-wire-split-composition/FULL-RESULT.json", + "research/shared-wire-split-composition/interval_gate.py", + "research/paired-query-only-bit/retained/inputs/BIT-NATIVE-WORD.json.gz", + "research/higher-moment-strictification/RESULT.json", + "research/shared-wire-split-composition/data/caller.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/check_product.py" + ], + "timeout_seconds": 90, + "checks": "Expand a raw mixed word, specialize its true roles and check the full independent endpoints." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/check_schedule.py" + ], + "timeout_seconds": 90, + "checks": "Check every address in the symbolic fixed-ambient schedule and the rank-one bill." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/check_cover.py" + ], + "timeout_seconds": 90, + "checks": "Check fixed rational right routes, nested projector splits and the complete weighted cover endpoint." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/check_cold.py" + ], + "timeout_seconds": 90, + "checks": "Check every labelled digit in the elementary ordinary service and inverse." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/check_funding.py" + ], + "timeout_seconds": 90, + "checks": "Verify the exact source files, five type witnesses, polynomial width bounds and complete binary stages." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/check_callers.py" + ], + "timeout_seconds": 90, + "checks": "Rebuild both complete outer applications and their new unfinished-context bounds." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-O", + "-B", + "{package}/check_product.py" + ], + "timeout_seconds": 90, + "checks": "Repeat with optimized Python and active explicit checks." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-O", + "-B", + "{package}/check_funding.py" + ], + "timeout_seconds": 90, + "checks": "Repeat with optimized Python and active explicit checks." + } + ] +} diff --git a/research/single-grade-rank-compiler/check_callers.py b/research/single-grade-rank-compiler/check_callers.py new file mode 100644 index 0000000000..cb13a00b3b --- /dev/null +++ b/research/single-grade-rank-compiler/check_callers.py @@ -0,0 +1,197 @@ +"""Check the two retained callers against ordinary BIT prices supplied by the compiler.""" + +from collections import Counter +from fractions import Fraction +import gzip +from hashlib import sha256 +import json +from math import gcd, prod +from pathlib import Path +import sys +from types import ModuleType + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(HERE)) +from check_funding import applications, sources + + +PINS = { + 'selected_result': 'd9ba709fa5dcefffe3f3abdcf34600ce188224703cfd743e6db8b58ba4816cb7', + 'selected_caller': '3828d53e80ea97e8b866320f081af20b6b93bfebd58b95b56b85a7afe151af5e', + 'selected_gate': '60a743d13f668ef86db4b8215b4d5d04430a671ba6f1fe06d9c1c4c3dfe86da5', + 'pending_result': '2a3946fc2fdcbf2b52f6fd4d67bcfb8920b5ef871a556bd939501f384fc82203', + 'pending_gate': '3796b2e5a27f3caa142d16364154788e60d0099f1e24a8dcd028e4fbd35a84ca', +} + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def pinned(path, role): + data = path.read_bytes() + if data.startswith(b'\x1f\x8b'): + data = gzip.decompress(data) + need(sha256(data).hexdigest() == PINS[role], f'wrong {role} source bytes') + return data + + +def gate_at(path, role, invoice, receipt, price): + gate = ModuleType(role) + gate.__file__ = str(path) + exec(compile(pinned(path, role), str(path), 'exec'), gate.__dict__) + # The continued source's driver installs the independently certified BIT cap. + if role == 'pending_gate': + gate.BIT_PIN = str(price) + result = gate.gate(invoice, receipt['claim'], receipt['tested'], *receipt['raw_bracket'], bit_pin=price) + need(Fraction(result['BIT_margin']) == price - Fraction(receipt['tested']) > 0, 'BIT service price') + need(result['outer'] == receipt['outer'], 'outer predicate or minimum margin') + need((result['outer']['strict_count'], result['outer']['functional_count']) == (54, 4), 'outer count') + print(role, 'claim', result['claim'], 'strict=54 functional=4 minimum=' + result['outer']['minimum_margin']) + + +def copies(histogram, count): + return Counter({int(rank): count * n for rank, n in histogram.items()}) + + +def compare(paid, targets, stored): + invoice = {'P': {str(r): n for r, n in paid.items()}, 'T': {str(r): n for r, n in targets.items()}} + need(invoice['P'] == stored['P'] and invoice['T'] == stored['T'], 'complete paid and productive grades') + return invoice + + +def selected_invoice(call, result): + ports = {kind: len(table['ports']) for kind, table in call['types'].items()} + targets, paid = Counter(), Counter() + calls = 0 + for event in call['events']: + if event[0] == 'J': + calls += 1 + elif event[1] == 'QUERY': + paid[1] += ports[event[0]] + elif event[1] == 'IDLE_ONE': + paid[8 * len(event[3])] += ports[event[0]] + for kind, table in call['types'].items(): + for direction in table['diagonal']: + targets[(direction[0] % 2) + 8 * sum(direction[2:])] += ports[kind] + native = result['native'] + targets.update(copies(native['helpers'], calls)) + paid.update(copies(native['paid'], calls)) + need((calls, call['ambient_rank'], sum(targets.values()), sum(paid.values())) == (18, 153, 23392, 117612), 'selected owners') + return compare(paid, targets, result['invoice']) + + +def pending_invoice(result): + ref = result['caller_census'] + native, app = result['native'], result['application'] + bindings = ref['finite_binding'] + need(result['caller_proof']['readback']['event_stream_sha256'] == result['caller'], 'pending caller identity') + need((ref['calls'], bindings['ambient'], bindings['native_main_bindings']) == (48, 137, 19200), 'pending bindings') + targets = copies(native['positive_helper_ranks'], ref['calls']) + copies(ref['fixed_root_targets'], 1) + paid = copies(native['paid_native_ranks'], ref['calls']) + copies(ref['fixed_caller_paid'], 1) + need((sum(targets.values()), sum(paid.values())) == (52512, 283248), 'pending owner counts') + ordinary = app['ordinary'] + need(32 * sum(ordinary['raw_scalar_incidence_allowance_before_factor_32'].values()) == ordinary['scalar_services'] == 1315129344, + 'expanded scalar invoice') + need((ordinary['odd_conversions'], ordinary['ordinary_elementary_record_upper']) == (143424, 151931146752), 'ordinary costs') + return compare(paid, targets, {'P': app['invoice']['paid'], 'T': app['invoice']['targets']}) + + +def ceil_log2(value): + value = Fraction(value) + bits = max(0, value.numerator.bit_length() - value.denominator.bit_length()) + return bits + (2**bits < value) + + +def contexts(selected, pending): + old = selected['precision']['common_grid'] + unit, call = old['word'], old['caller'] + height = max(call['denominator_height'], call['pre_joint_height'] + unit['dyadic_height']) + mass = max(ceil_log2(call['maximum_mass']), ceil_log2(call['pre_joint_mass']) + ceil_log2(unit['maximum_scaled_mass'])) + need((height, mass, unit['odd_scale_lcm']) == (178, 161, 1125), 'selected odd-grid bounds') + first = 2 * max(height, mass) + need(first == old['context_c'], 'selected context') + + unit = pending['native'] + variants = pending['caller_proof']['template_bounds'].values() + caller_odd = pending['caller_census']['odd_scale'] + height = max(max(t['height'], t['entrance_height'] + unit['path_grid_height']) for t in variants) + local_mass = unit['path_grid_odd'] * Fraction(unit['positive_path_mass_bound_unscaled']) + mass = caller_odd * max(max(Fraction(t['mass']), Fraction(t['entrance_mass']) * local_mass) for t in variants) + signed = pending['application']['common_root'] + need((signed['exact_grid'], signed['signed_width'], signed['temporary_width']) + == ('2^(-p-D)', 'W=p+h+2D+3', 'W+26'), 'installed pending grid and temporary') + need((height, ceil_log2(mass), str(mass)) == (140, 428, signed['context_mass_bound']), 'pending raw context') + factors = pending['conversion']['odd_factors'] + need(prod(factors) == unit['path_grid_odd'] and max(factors) < 2**24, 'local exact divisions') + need(unit['path_grid_odd'] * 2**unit['path_grid_height'] == unit['minimum_product_grid'], 'local product grid') + coarse = unit['path_only_grid'] + common = coarse + sparse_witness = None + for row in unit['product_gcd_witnesses']: + need(row['previous_gcd'] == common, 'product gcd chain') + common = gcd(common, row['scaled_product']) + need(row['gcd'] == common, 'product gcd witness') + if (row['row'], row['donor'], row['input_owner']) == (34008, 48, 332): + sparse_witness = Fraction(row['scaled_product'], coarse) + need(coarse // common == unit['minimum_product_grid'] and sparse_witness is not None, + 'actual pre-add product grid') + need((sparse_witness * unit['minimum_snapshot_grid']).denominator == 47 + and (sparse_witness * unit['minimum_product_grid']).denominator == 1, + 'a stored-row-only grid loses the pre-add cut') + second = 2 * max(height, ceil_log2(mass)) + need(second == signed['context_c'], 'pending context') + return first, second + + +def depth_guard(context, row): + # One data dependency traverses at most v raw words at each inner level. + h, v = row['H'], row['v'] + levels = row['depth_at_most'] + need(h == v * levels, 'source-specific nested rank bound') + unfinished = 2 * v * (levels + 1) + bits = (context * unfinished).bit_length() + need(bits < h, 'c L < 2^H for the new program') + return bits + + +def check_nested_return(): + # Parent coefficients use a quarter grid. Its owned auxiliary is zero only at the endpoints. + parent = (2, 3) + owned = tuple(x + y for x, y in zip((0, 0), parent)) + need(owned is not parent, 'private owner has distinct backing') + def child(row): + scaled = tuple(3 * x for x in row) + transformed = scaled[::-1] # A completed Clifford permutes the two amplitudes. + need(all(v % 3 == 0 for v in transformed), 'local odd conversion') + return tuple(v // 3 for v in transformed) + public = child(parent) + retired = tuple(x - y for x, y in zip(child(owned), public)) + need(public == (3, 2) and retired == (0, 0), 'completed child and public source') + need(any(v % 4 for v in public) and any(v % 3 for v in parent), 'parent grid and separate scale are necessary') + need(any(x - y for x, y in zip(child((0, 0)), public)), 'clearing a live parent auxiliary must change this return') + + +def main(): + sources() + rows = applications() + source = ROOT / 'research/shared-wire-split-composition' + selected = json.loads(pinned(source / 'FULL-RESULT.json', 'selected_result')) + pending = json.loads(pinned(HERE / 'retained/pending-application.json.gz', 'pending_result')) + physical = json.loads(pinned(source / 'data/caller.json', 'selected_caller')) + gate_at(source / 'interval_gate.py', 'selected_gate', selected_invoice(physical, selected), + selected['gate'], Fraction(rows['selected_BIT']['ordinary'])) + gate_at(HERE / 'retained/supplier_gate.py', 'pending_gate', pending_invoice(pending), + pending['application']['compiler'], Fraction(rows['pending_BIT']['ordinary'])) + selected_c, pending_c = contexts(selected, pending) + selected_bits = depth_guard(selected_c, rows['selected_complex']) + pending_bits = depth_guard(pending_c, rows['pending_complex']) + check_nested_return() + print(f'PASS_OUTER_CALLERS applications=2 strict=54 functional=4 contexts=356,856 ' + f'new_depth_bits={selected_bits},{pending_bits}') + + +if __name__ == '__main__': + main() diff --git a/research/single-grade-rank-compiler/check_cold.py b/research/single-grade-rank-compiler/check_cold.py new file mode 100644 index 0000000000..2022b4ce58 --- /dev/null +++ b/research/single-grade-rank-compiler/check_cold.py @@ -0,0 +1,53 @@ +"""Exercise the zero-saving ordinary service on complete fixed-radix streams.""" + +from itertools import product + + +def swap_digit(values, q, prefix, gap, suffix): + buckets = [[[] for _ in range(q)] for _ in range(q)] + source = iter(values) + for _ in range(prefix): + for x in range(q): + for _ in range(gap): + for y in range(q): + buckets[x][y].extend(next(source) for _ in range(suffix)) + end = object() + if next(source, end) is not end: + raise ValueError("unread source payload") + streams = [[iter(bucket) for bucket in row] for row in buckets] + result = [] + for _ in range(prefix): + for y in range(q): + for _ in range(gap): + for x in range(q): + result.extend(next(streams[x][y]) for _ in range(suffix)) + if any(next(stream, end) is not end for row in streams for stream in row): + raise ValueError("unread pair bucket") + return result + + +def main(): + cases = cells = 0 + for q, width, pre, gap, tail in product((2, 3, 5), (1, 2, 3), (1, 2), (1, 3), (1, 2)): + chunk = q**width + source = list(range(pre * chunk * gap * chunk * tail)) + value = source + shapes = [(pre*q**j, gap*q**(width-1), tail*q**(width-1-j)) for j in range(width)] + for shape in shapes: + value = swap_digit(value, q, *shape) + expected = [((((p*chunk+x)*gap+g)*chunk+y)*tail+s) + for p, y, g, x, s in product(range(pre), range(chunk), range(gap), + range(chunk), range(tail))] + if value != expected: + raise ValueError("ordinary endpoint") + for shape in reversed(shapes): + value = swap_digit(value, q, *shape) + if value != source: + raise ValueError("complete restoration") + cases += 1 + cells += len(source) + print(f"PASS_ELEMENTARY_ORDINARY cases={cases} independent_cells={cells}") + + +if __name__ == "__main__": + main() diff --git a/research/single-grade-rank-compiler/check_cover.py b/research/single-grade-rank-compiler/check_cover.py new file mode 100644 index 0000000000..8725419728 --- /dev/null +++ b/research/single-grade-rank-compiler/check_cover.py @@ -0,0 +1,255 @@ +"""Check fixed-ambient BIT projector substitution and delayed cover routing.""" + +import argparse +from fractions import Fraction +import gzip +from hashlib import sha256 +from itertools import product +import json +from math import gcd +from pathlib import Path + + +SOURCE_PATH = Path("research/paired-query-only-bit/retained/inputs/BIT-NATIVE-WORD.json.gz") +SOURCE_SHA = "51203e7fc75ba10bd3ac3f8e675759f47e13d262bea66b6600d1e515095cad78" +FRAME_SHA = "b4c3f2891150c90b4092567b9124f071cb9ef3a1a751130e8b79f1af3effcc1a" +HELPER_CHARTS = (506, 507) + + +def check(value, label): + if not value: + raise ValueError(label) + + +def identity(size): + return tuple(tuple(int(i == j) for j in range(size)) for i in range(size)) + + +class Ring: + def __init__(self, modulus): + self.modulus = modulus + + def multiply(self, a, b): + columns = tuple(zip(*b)) + return tuple(tuple(sum(x*y for x, y in zip(row, col) if x and y) % self.modulus + for col in columns) for row in a) + + def inverse(self, a): + size = len(a) + rows = [list(row + unit) for row, unit in zip(a, identity(size))] + for col in range(size): + pivot = next(i for i in range(col, size) if gcd(rows[i][col], self.modulus) == 1) + rows[col], rows[pivot] = rows[pivot], rows[col] + factor = pow(rows[col][col], -1, self.modulus) + rows[col] = [x*factor % self.modulus for x in rows[col]] + for i, row in enumerate(rows): + if i != col and row[col]: + rows[i] = [(x-row[col]*y) % self.modulus for x, y in zip(row, rows[col])] + return tuple(tuple(row[size:]) for row in rows) + + def conjugate(self, basis, matrix): + return self.multiply(self.multiply(basis, matrix), self.inverse(basis)) + + def projector(self, basis, rank): + mask = tuple(tuple(x if j < rank else 0 for j, x in enumerate(row)) for row in basis) + return self.multiply(mask, self.inverse(basis)) + + def subtract(self, a, b): + return tuple(tuple((x-y) % self.modulus for x, y in zip(r, s)) for r, s in zip(a, b)) + + def action(self, matrix, vector): + return tuple(sum(x*y for x, y in zip(row, vector)) % self.modulus for row in matrix) + + +def choose_columns(matrix, first): + first = tuple(first) + order = first + tuple(j for j in range(len(matrix)) if j not in first) + return tuple(tuple(row[j] for j in order) for row in matrix) + + +def lift(matrix, columns, ambient): + # The remaining axes retain their original coordinates. + used = len(matrix)*columns + out = [list(row) for row in identity(ambient)] + for i in range(used): + for j in range(used): + out[i][j] = matrix[i//columns][j//columns] if i % columns == j % columns else 0 + return tuple(map(tuple, out)) + + +def load_helpers(path, ring): + packed = path.read_bytes() + check(sha256(packed).hexdigest() == SOURCE_SHA, "canonical native word") + word = json.loads(gzip.decompress(packed)) + frames = word["frames"] + encoded = json.dumps(frames, sort_keys=True, separators=(",", ":")).encode() + check(sha256(encoded).hexdigest() == FRAME_SHA, "common 636-frame table") + owners = set(zip(word["start"][222:], word["final"][222:])) + helpers = [] + for chart in HELPER_CHARTS: + check((chart, 1) in owners and frames["1"]["dim"] == 8, "complete positive helper") + frame = frames[str(chart)] + check(frame["dim"] == 4 and len(frame["A"]) == 4, "rank-four helper") + # The image of the helper projector is the kernel of its lower frame. + def residue(value): + rational = Fraction(value) + return rational.numerator * pow(rational.denominator, -1, ring.modulus) % ring.modulus + a_rows = tuple(tuple(map(residue, row)) for row in frame["A"]) + b_rows = tuple(tuple(map(residue, row)) for row in frame["B"]) + basis = tuple(zip(*(a_rows + b_rows))) + lower_basis = tuple(zip(*(b_rows + a_rows))) + check(ring.multiply(basis, ring.inverse(basis)) == identity(8), "split image and kernel") + check(ring.projector(basis, 4) == ring.subtract(identity(8), ring.projector(lower_basis, 4)), + "helper is the actual projector difference") + helpers.append(basis) + return helpers + + +def fixed_ambient(helpers, ring): + ambient, grade = 25, 4 + counts = {"matches": 0, "peels": 0, "leaves": 0} + one = identity(ambient) + # This nonorthogonal split gives complementary paid ranks three and one. + split = [list(row) for row in identity(8)] + split[0][3], split[3][0], split[3][3] = 1, 1, 2 + split = tuple(map(tuple, split)) + + def visit(target_basis, width, variant, cover): + if width < grade: + pieces = [choose_columns(target_basis, [j]) for j in range(width)] + counts["leaves"] += width + return [ring.conjugate(cover, ring.projector(piece, 1)) for piece in pieces] + + columns, remainder = divmod(width, grade) + check(8*columns <= ambient, "original ambient fits this request") + moved = grade*columns + role = lift(helpers[variant % len(helpers)], columns, ambient) + matcher = ring.multiply(target_basis, ring.inverse(role)) + routed = ring.multiply(cover, matcher) + expected = ring.conjugate(cover, ring.projector(target_basis, moved)) + actual = ring.conjugate(routed, ring.projector(role, moved)) + check(actual == expected and ring.multiply(routed, ring.inverse(matcher)) == cover, + "whole row right route and inverse") + counts["matches"] += 1 + + paid_basis = ring.multiply(role, lift(split, columns, ambient)) + pieces = [] + for j, axis_range in enumerate((range(3*columns), range(3*columns, moved))): + piece = choose_columns(paid_basis, axis_range) + pieces += visit(piece, len(axis_range), variant+j+1, routed) + for index in range(moved, width): + pieces += visit(choose_columns(target_basis, [index]), 1, variant, cover) + counts["peels"] += remainder + # On the address difference H-C D, the partial swap is I-2P. + # Verifying its complete matrix checks the kernel and all spectators. + matrix = one + for piece in pieces: + change = ring.multiply(piece, matrix) + matrix = ring.subtract(ring.subtract(matrix, change), change) + total = ring.conjugate(cover, ring.projector(target_basis, width)) + check(matrix == ring.subtract(ring.subtract(one, total), total), "all coordinate columns") + return pieces + + shear = [list(row) for row in one] + for i in range(ambient-1): + shear[i][i+1] = (1+101*i) % ring.modulus + shear = tuple(map(tuple, shear)) + for cover in (one, shear, tuple(reversed(shear))): + for variant in range(2): + pieces = [] + tile_width = grade*(ambient//8) + for start in range(0, ambient, tile_width): + tile = range(start, min(ambient, start+tile_width)) + pieces += visit(choose_columns(one, tile), len(tile), variant, cover) + check(len(pieces) == ambient, "rank-one terminal count for the fixture") + matrix = one + for piece in pieces: + change = ring.multiply(piece, matrix) + matrix = ring.subtract(ring.subtract(matrix, change), change) + check(matrix == ring.subtract(ring.subtract(one, one), one), "full I target") + return counts + + +def complete_rows(): + ring = Ring(3) + group = tuple(((a, b), (c, d)) for a, b, c, d in product(range(3), repeat=4) + if (a*d-b*c) % 3) + addresses = tuple(product(range(3), repeat=4)) + position = {point: index for index, point in enumerate(addresses)} + bits = len(addresses) + target = ((1, 0), (0, 0)) + opposite = ring.subtract(identity(2), target) + matchers = (((1, 1), (0, 1)), ((1, 0), (1, 1))) + early = ((0, 1), (1, 0)) + + def image(p, address): + # A=diag(2,1) is one common external unit weight. Tail atoms are reversed. + h = (2*address[0] % 3, address[1]) + d = address[2:][::-1] + offset = ring.action(p, tuple((x-y) % 3 for x, y in zip(h, d))) + h2 = tuple((x-z) % 3 for x, z in zip(h, offset)) + d2 = tuple((y+z) % 3 for y, z in zip(d, offset)) + return (2*h2[0] % 3, h2[1]) + d2[::-1] + + def permute(p, vector): + result = [0]*bits + for j, address in enumerate(addresses): + result[position[image(p, address)]] = vector[j] + return result + + # Each cell carries its own independent Boolean variable as a unit bit mask. + raw = [{g: [1 << ((role*len(group)+row)*bits+j) for j in range(bits)] + for row, g in enumerate(group)} for role in range(2)] + + def tile(inputs, projector, active_matchers): + routed, result = [{}, {}], [{}, {}] + for role, match in enumerate(active_matchers): + for g in group: + routed[role][ring.multiply(g, match)] = inputs[role][g] + check(len(routed[role]) == len(group), "fresh cover fiber permutation") + for h in group: + x, y = (routed[i][h] for i in range(2)) + common = ring.conjugate(h, projector) + coupled = permute(common, [a ^ b for a, b in zip(x, y)]) + move_y = permute(common, y) + for role, output in enumerate(([a ^ b for a, b in zip(coupled, move_y)], move_y)): + parent = ring.multiply(h, ring.inverse(active_matchers[role])) + result[role][parent] = output + return result + + correct_first = tile(raw, target, matchers) + for role, match in enumerate(matchers): + for g in group: + canonical = ring.conjugate(ring.multiply(g, match), target) + check(correct_first[role][g] == permute(canonical, raw[role][g]), "matched proper target") + expected = [{g: permute(identity(2), raw[role][g]) for g in group} for role in range(2)] + complete = tile(correct_first, opposite, matchers) + check(complete == expected, "every role, row and arbitrary address label restored") + wrong = tile(raw, target, (matchers[0], identity(2))) + # A prematurely added cover can take this row before a proper target returns. + premature = tile(raw, ring.conjugate(early, target), matchers) + controls = {} + for name, damaged in (("omitted_tile", correct_first), + ("wrong_matcher", tile(wrong, opposite, matchers)), + ("premature_cover", tile(premature, opposite, matchers))): + mismatches = sum(a != b for role in range(2) for g in group + for a, b in zip(damaged[role][g], expected[role][g])) + check(mismatches > 0, name + " accepted") + controls[name] = mismatches + return 2*len(group)*bits, controls + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--word", type=Path, default=Path(__file__).resolve().parents[2] / SOURCE_PATH) + args = parser.parse_args() + ring = Ring(101**2) + counts = fixed_ambient(load_helpers(args.word, ring), ring) + labels, controls = complete_rows() + print(f"PASS_DIRECT_BIT_GEOMETRY matches={counts['matches']} peels={counts['peels']} " + f"leaves={counts['leaves']} labelled_cells={labels} " + + " ".join(f"{k}={v}" for k, v in controls.items())) + + +if __name__ == "__main__": + main() diff --git a/research/single-grade-rank-compiler/check_funding.py b/research/single-grade-rank-compiler/check_funding.py new file mode 100644 index 0000000000..71acd5bc3a --- /dev/null +++ b/research/single-grade-rank-compiler/check_funding.py @@ -0,0 +1,151 @@ +"""Bind the five exact types, dimension witnesses, cover and ordinary prices.""" + +import gzip +from fractions import Fraction as Q +from hashlib import sha1, sha256 +import json +from itertools import product +from math import comb, isqrt +from pathlib import Path +import sys + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(HERE)) +from funding import _mode, certificate + + +def need(value, message): + if not value: + raise ValueError(message) + + +def read(path): + data = path.read_bytes() + return json.loads(gzip.decompress(data) if path.name.endswith(".gz") else data) + + +def sources(): + for row in read(HERE / "ORIGINS.json"): + path = ROOT / row["local"] + raw = path.read_bytes() + if path.name.endswith(".gz") and not row["source"].endswith(".gz"): + raw = gzip.decompress(raw) + blob = sha1(b"blob " + str(len(raw)).encode() + b"\0" + raw).hexdigest() + need((blob, sha256(raw).hexdigest()) == (row["blob"], row["sha256"]), row["local"]) + + +def ordinary(word, pending): + uniform = word["uniform"] if pending else word["finite_admission"]["uniform_compiler"] + covered = Q(word["covered"] if pending else word["covered_saving"]) + loss = Q(uniform["uniform_saving"]) - covered + need(loss == Q(1, 10**10) and Q(64, 2**45) < loss / 4, "fund the bad cover rows") + rho = Q(1, 250) + levels = word["ordinary_bootstrap"] + price = Q(levels[0]["previous"]) + cold_gap = (1 - rho) * covered - price + need(min(cold_gap, rho - price, 1 - rho - price) > 0, + "the elementary ordinary service must fund the first complete backend") + for row in levels: + need(Q(row["previous"]) == price, "older ordinary service") + next_price = Q(row["claim"] if pending else row["admitted"]) + gap = (1 - rho) * covered + rho * price - next_price + need(min(gap, rho - next_price, 1 - rho - next_price) > 0, "all wrapper costs") + price = next_price + need(price == Q(word["ordinary_admitted"]), "ordinary root price") + return {"covered": str(covered), "ordinary": str(price), "cold_start_gap": str(cold_gap), + "levels_from_elementary": 1 + len(levels)} + + +def applications(): + s = read(ROOT / "research/shared-wire-split-composition/FULL-RESULT.json") + b = read(ROOT / "research/paired-query-only-bit/EFREE-RESULT.json") + p = read(HERE / "retained/pending-application.json.gz") + n = read(HERE / "retained/pending-bit.json.gz") + h = read(ROOT / "research/higher-moment-strictification/RESULT.json") + selected = s["gate"] + pending = p["application"]["compiler"] + cases = { + "selected_complex": (s["invoice"]["T"], s["invoice"]["P"], selected["tested"], + Q(selected["tested"]) - Q(selected["compiler_gap"]), 153), + "selected_BIT": (b["targets"], b["paid"], b["raw_tested"], + b["finite_admission"]["uniform_compiler"]["uniform_saving"], 134), + "pending_complex": (p["application"]["invoice"]["targets"], p["application"]["invoice"]["paid"], + pending["tested"], Q(pending["tested"]) - Q(pending["compiler_gap"]), + p["caller_census"]["finite_binding"]["ambient"]), + "pending_BIT": (n["targets"], n["paid"], n["tested_saving"], n["uniform"]["uniform_saving"], 134), + "historical_p7": (h["invoice_oracle"]["targets"], h["invoice_oracle"]["paid"], + h["strictification"]["tested_saving"], h["uniform_rank"]["uniform_saving"], 121), + } + rows = {} + for name, args in cases.items(): + raw_targets, raw_paid, _, _, ambient = args + row = certificate(*args, cap="3/1000" if name == "historical_p7" else "1/250") + b0, q0 = sum(raw_targets.values()), sum(raw_paid.values()) + need(row["batch_width_degree_upper"] <= 16 and row["all_recursive_visits_degree_per_root_owner"] <= 27, + "unrolled row and visit bounds") + need(ambient >= 64 and b0 + q0 + ambient*q0 + 2 < 2**27, "local syntax degree") + if name.endswith("BIT"): + row.update(ordinary(n, True) if name == "pending_BIT" else ordinary(b, False)) + else: + need(Q(row["uniform_saving"]) > Q(pending["claim"] if name == "pending_complex" else + selected["claim"] if name == "selected_complex" else "0.00268647"), + "outer strict service") + rows[name] = row + need(Q(rows["selected_BIT"]["ordinary"]) == Q(n["ordinary_bootstrap"][0]["previous"]), + "join the two established ordinary series") + return rows + + +def controls(): + def quarter(histogram, power): + total = 0 + for rank, count in histogram.items(): + root = isqrt(isqrt(rank)) + need(root**4 == rank, "test requires an integer fourth root") + total += count * root**power + return total + + targets, paid = {1: 70, 256: 1}, {16: 18} + need(all(quarter(targets, s) > quarter(paid, s) for s in (2, 4)) + and quarter(targets, 3)**2 < quarter(paid, 2) * quarter(paid, 4), "interior chord") + paid = {1: 1, 256: 1} + targets = {1: 2, 256: 1} + need(quarter(paid, 2) * quarter(paid, 4) - quarter(targets, 3)**2 == 13, + "favorable raw moments but adverse chord") + width = comb(12, 6) * 25**6 + need(41**41 * 256**8 < 128**41 and 8 * 8**24 < width**2, "interior constructive type") + cases = [({1: 1}, {1: 1}, "1/300", "1/400", 8), + ({16: 2}, {8: 1}, "1/300", "1/250", 32), + ({32: 1}, {8: 1}, "1/300", "1/400", 31)] + for args in cases: + try: + certificate(*args) + except ValueError: + continue + raise ValueError("invalid input admitted") + + # Independently enumerate integer type terms for 1,375 small three-grade cases. + for a, b, c in product(range(1, 6), repeat=3): + for v in range(1, 12): + def mass(i, j): + return comb(v, i) * comb(v - i, j) * a**i * b**j * c**(v-i-j) + mode = _mode({1: a, 4: b, 16: c}, v) + optimum = max(mass(i, j) for i in range(v + 1) for j in range(v - i + 1)) + need(mass(mode[1], mode[4]) == optimum, "incorrect integer type") + + +def main(): + sources() + controls() + result = applications() + if sys.argv[1:] == ["--write"]: + (HERE / "RESULT.json").write_text(json.dumps(result, indent=2) + "\n") + elif len(sys.argv) != 1: + raise ValueError("use no argument or --write") + need(result == read(HERE / "RESULT.json"), "recorded dimension or useful type changed") + print("PASS_SINGLE_GRADE_FUNDING profiles=5 max_width_degree=16 max_visit_degree=27") + + +if __name__ == "__main__": + main() diff --git a/research/single-grade-rank-compiler/check_product.py b/research/single-grade-rank-compiler/check_product.py new file mode 100644 index 0000000000..56aa0163f8 --- /dev/null +++ b/research/single-grade-rank-compiler/check_product.py @@ -0,0 +1,86 @@ +"""Run the raw product, specialization, splits and full-rank compiler together.""" + +from collections import Counter +from pathlib import Path +import sys + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from check_schedule import Arrays, need, reject +from product import Native, specialize +from schedule import expand + + +def raw(machine, owners, c): + # Independent outputs have ranks one and three. The second travels through an owned bank. + x, y = owners + tmp = machine.zero() + machine.add(tmp, y, 1) + machine.add(x, tmp, 1) + first = tuple(range(c)) + other = tuple(range(c, 3*c)) + yield x, first + yield tmp, first + machine.add(x, tmp, -1) + yield tmp, other + machine.fields[y], machine.fields[tmp] = machine.fields[tmp], machine.fields[y] + del machine.fields[tmp] + + +class ProductArrays(Arrays): + def __init__(self, width, n, lift, program, fault): + super().__init__(width, n, lift) + self.program = program + self.fault = fault + self.discarded = 0 + self.allocations = 0 + self.reused = None + + def zero(self): + idx = self.next_field + self.next_field += 1 + self.fields[idx] = {} + self.allocations += 1 + if self.fault == "alias": + if self.reused is None: + self.reused = idx + return self.reused + return idx + + def retire_zero(self, idx): + need(not self.fields[idx], "a discarded target had an arbitrary-input dependency") + del self.fields[idx] + self.discarded += 1 + + def native(self, owners, columns): + yield from self.program(self, owners, columns) + + +def check(n, lift, fault=None): + def changed_raw(machine, owners, c): + yield from raw(machine, owners, c) + if fault == "leak": + x, y = owners + machine.add(x, y, 1) + source = Native(4, (1, 3), (1, 1, 2), changed_raw) + word, native = specialize(source, {"1": 1, "3": 1}, 2) + need((word.ambient, word.grade, word.roles) == (16, 3, 2), "product grade and actual role count") + need(Counter(word.paid) == {1: 4, 2: 6}, "one split on the rank-four product") + machine = ProductArrays(word.root_width(n), n, lift, native, fault) + expand(word, n, list(range(machine.width)), machine) + machine.check() + need(machine.leaves == machine.width * word.leaves_per_array(n), "complete raw-to-root bill") + need(machine.discarded > 0 and machine.allocations > machine.discarded, "owned fields executed") + return machine.discarded, machine.leaves + + +if __name__ == "__main__": + runs = [check(n, f) for n in (16, 17, 23, 32, 35) for f in (1, 2)] + reject(lambda: check(17, 1, "alias")) + reject(lambda: check(17, 1, "leak")) + source = Native(4, (1, 3), (1, 1, 2), raw) + single, _ = specialize(source, {"1": 0, "3": 2}, 2) + need((single.grade, single.roles) == (9, 1), "zero-count grades in a serialized type") + for bad in ({"1": 0}, {"3": -1}, {"03": 1}, {3: 1, "3": 1}, {"3": True}): + reject(lambda: specialize(source, bad, 1)) + print("PASS_RAW_TO_ROOT cases=10 discarded=" + str(sum(x for x, _ in runs)) + + " paid_leaves=" + str(sum(y for _, y in runs)) + " mutations=7") diff --git a/research/single-grade-rank-compiler/check_schedule.py b/research/single-grade-rank-compiler/check_schedule.py new file mode 100644 index 0000000000..fb38007c1e --- /dev/null +++ b/research/single-grade-rank-compiler/check_schedule.py @@ -0,0 +1,148 @@ +"""Test an expanded word on formal independent input arrays and all their addresses.""" + +from collections import Counter +from pathlib import Path +import json +import sys + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from schedule import Word, complete_order, expand + + +def need(value, label): + if not value: + raise ValueError(label) + + +def exchanged(items, left, right): + out = list(items) + out[left], out[right] = out[right], out[left] + return tuple(out) + + +class Arrays: + # A term is one independent input at a permutation of the full address. + def __init__(self, width, ambient, lift, fault=None): + self.n = ambient + self.lift = lift + self.axes = 2 * ambient * lift + 2 + self.identity = tuple(range(self.axes)) + self.fields = {i: {(i, self.identity): 1} for i in range(width)} + self.next_field = width + self.fault = fault + self.leaves = 0 + self.calls = 0 + self.max_live = 0 + self.width = width + + def permute(self, owner, permutation): + self.fields[owner] = { + (source, tuple(permutation[i] for i in address)): value + for (source, address), value in self.fields[owner].items()} + + def move(self, owner, order, inverse): + if order == tuple(range(self.n)): + return + p = list(self.identity) + for i, old in enumerate(order): + for offset in range(2 * self.lift): + a, b = 2 * self.lift * i + offset, 2 * self.lift * old + offset + if inverse: + p[a] = b + else: + p[b] = a + self.permute(owner, p) + + def leaf(self, owner, axis): + self.leaves += 1 + if self.fault == "lost_leaf" and self.leaves == 1: + return + p = self.identity + for pair in range(self.lift): + a = 2 * (axis * self.lift + pair) + p = exchanged(p, a, a + 1) + self.permute(owner, p) + + def add(self, dest, src, factor): + row = Counter(self.fields[dest]) + for key, value in self.fields[src].items(): + row[key] += factor * value + self.fields[dest] = {k: v for k, v in row.items() if v} + + def native(self, owners, f): + # Two rank-four outputs. One paid field is an owned copy of arbitrary data. + # The five groups of columns include a genuine spectator group. + x, y = owners + tmp = self.next_field + self.next_field += 1 + self.fields[tmp] = {} + self.add(tmp, y, 1) + self.add(x, tmp, 1) + self.max_live = max(self.max_live, len(self.fields) - self.width) + self.calls += 1 + def group(slot): + return tuple(range(slot * f, (slot + 1) * f)) + + # A three-cycle makes a reversed matcher observably different from its inverse. + order = complete_order(group(4) + group(0) + group(2) + group(3) + group(1), self.n) + for owner in (x, tmp): + self.move(owner, order, False) + for owner, slots in ((x, (1, 4)), (x, (2, 3)), (tmp, (1,)), + (tmp, (2,)), (tmp, (3, 4))): + yield owner, tuple(i for s in slots for i in group(s)) + for owner in (x, tmp): + self.move(owner, order, self.fault != "wrong_matcher") + self.add(x, tmp, -1) + self.fields[y], self.fields[tmp] = self.fields[tmp], self.fields[y] + if self.fault != "dirty_bank": + del self.fields[tmp] # The machine retires this owned, nonzero field. + + def check(self): + expected = list(self.identity) + for a in range(0, self.axes - 2, 2): + expected[a], expected[a + 1] = expected[a + 1], expected[a] + target = {i: {(i, tuple(expected)): 1} for i in range(self.width)} + need(self.fields == target, "whole arbitrary-input endpoint or owned retirement") + + +def run(n, f, fault=None): + word = Word(5, 4, 2, (2, 2, 1, 1, 2)) + width = word.root_width(n) + m = Arrays(width, n, f, fault) + expand(word, n, list(range(width)), m) + m.check() + need(m.leaves == width * word.leaves_per_array(n), "complete leaf bill") + return m.calls, m.leaves, m.max_live + + +def reject(fn): + try: + fn() + except ValueError: + return + raise ValueError("negative control survived") + + +def main(): + cases = [run(n, f) for n in (1, 3, 4, 5, 7, 9, 12, 15, 16, 21, 25, 33) + for f in (1, 2, 3)] + for fault in ("wrong_matcher", "dirty_bank", "lost_leaf"): + reject(lambda: run(12, 2, fault)) + word = Word(5, 4, 2, (2, 2, 1, 1, 2)) + width = word.root_width(12) + reject(lambda: expand(word, 12, [0] * width, None)) + reject(lambda: expand(word, 12, list(range(width - 1)), None)) + reject(lambda: complete_order((1, 1), 4)) + reject(lambda: Word(5, 4, 2, (4,))) + # A free native oracle checks the empty-paid edge in the arithmetic interface. + free = Word(8, 4, 1, ()) + need(free.leaves_per_array(16) == 0 and free.leaves_per_array(17) == 1, + "zero paid positions and a nonempty tail") + need(free.leaves_per_array(1 << 70) == 0, "integer tile length") + print("PASS_FULL_ARRAY_SCHEDULE", json.dumps(dict(cases=len(cases), + native_calls=sum(a for a, _, _ in cases), paid_leaves=sum(b for _, b, _ in cases), + peak_owned=max(c for _, _, c in cases), negative_controls=7), sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/single-grade-rank-compiler/funding.py b/research/single-grade-rank-compiler/funding.py new file mode 100644 index 0000000000..5c208e4c1e --- /dev/null +++ b/research/single-grade-rank-compiler/funding.py @@ -0,0 +1,183 @@ +"""Exact certificates for a single retained product rank and an 8^v paid cut.""" + +from fractions import Fraction +from functools import lru_cache + + +GRID = 1 << 275 + + +def _need(condition, message): + if not condition: + raise ValueError(message) + + +def _ceil_ratio(numerator, denominator): + return -((-numerator) // denominator) + + +def _ceil_log2(n): + return (n - 1).bit_length() + + +def _log_ratio(n, d): + """Enclose GRID log(n/d) for d <= n <= 2d.""" + u = (n - d) * GRID + lo = u // (n + d) + hi = _ceil_ratio(u, n + d) + lo_sq = lo * lo // GRID + hi_sq = _ceil_ratio(hi * hi, GRID) + lower = upper = 0 + for j in range(95): + lower += 2 * lo // (2 * j + 1) + upper += _ceil_ratio(2 * hi, 2 * j + 1) + lo = lo * lo_sq // GRID + hi = _ceil_ratio(hi * hi_sq, GRID) + # log(n/d) = 2 atanh((n-d)/(n+d)). The argument is at most 1/3. + return lower, upper + _ceil_ratio(3 * GRID, 3**191) + + +@lru_cache(None) +def _log(n): + _need(n >= 1, "logarithm needs a positive integer") + h = n.bit_length() - 1 + if n == 1: + return 0, 0 + lo, hi = _log_ratio(n, 1 << h) + two_lo, two_hi = _log_ratio(2, 1) + return lo + h * two_lo, hi + h * two_hi + + +@lru_cache(None) +def _rank_weight(rank, saving): + """Enclose GRID rank^(1-saving) with integer arithmetic.""" + log_lo, log_hi = _log(rank) + power = 113 + n = 1 << power + den = saving.denominator * n + lo = GRID - _ceil_ratio(log_hi * saving.numerator, den) + hi = _ceil_ratio(GRID**2 * den, GRID * den + log_lo * saving.numerator) + _need(lo > 0, "increase the exponent subdivision") + # (1-x/n)^n <= exp(-x) <= (1+x/n)^(-n) for x = saving log(rank). + for _ in range(power): + lo = lo * lo // GRID + hi = _ceil_ratio(hi * hi, GRID) + return rank * lo, rank * hi + + +def _histogram(histogram): + result = {} + for key, count in histogram.items(): + rank = int(key) + _need((type(key) is int or str(rank) == key) and rank > 0, + "rank must be a positive integer") + _need(type(count) is int and count > 0 and rank not in result, + "counts must be positive integers at distinct ranks") + result[rank] = count + _need(result, "empty rank profile") + return dict(sorted(result.items())) + + +def _target_weights(targets, saving): + return {rank: count * _rank_weight(rank, saving)[0] for rank, count in targets.items()} + + +def _cut_log_slack(lower_target_sum, paid_rank_mass, saving): + lower = _log(lower_target_sum)[0] - _log(GRID * paid_rank_mass)[1] + return Fraction(lower, GRID) + saving * Fraction(_log(8)[0], GRID) + + +def _mode(weights, v): + """Choose the v largest weights[i]/j over positive integers j.""" + total = sum(weights.values()) + counts = {k: v * a // total for k, a in weights.items()} + # Every prefix priority is >= total/v and every remaining one is smaller. + for _ in range(v - sum(counts.values())): + k = max(weights, key=lambda i: Fraction(weights[i], counts[i] + 1)) + counts[k] += 1 + next_value = max(Fraction(weights[k], m + 1) for k, m in counts.items()) + last_value = min(Fraction(weights[k], m) for k, m in counts.items() if m) + _need(sum(counts.values()) == v and next_value <= last_value, + "the proposed type is not a multinomial mode") + return counts + + +def _show_lower(x): + """Round down to 30 decimal places and keep an exact rational literal.""" + scale = 10**30 + return str(Fraction(x.numerator * scale // x.denominator, scale)) + + +def certificate(targets, paid, raw_saving, uniform_saving, ambient, *, cap="1/250"): + """Certify one source invoice. All prices must be exact rational literals.""" + targets, paid = _histogram(targets), _histogram(paid) + values = (raw_saving, uniform_saving, cap) + _need(all(isinstance(x, (str, int, Fraction)) for x in values), "use exact price literals") + raw, uniform, cap = map(Fraction, values) + _need(0 < uniform < raw <= cap < 1, "need 0 < uniform < raw <= cap < 1") + _need(type(ambient) is int and ambient >= max(max(targets), max(paid)), + "ambient does not contain every source job") + d = len(targets) + p1 = sum(k * count for k, count in paid.items()) + weights = _target_weights(targets, raw) + total = sum(weights.values()) + paid_upper = sum(n * _rank_weight(k, raw)[1] for k, n in paid.items()) + raw_slack = Fraction(total - paid_upper, total) + cut_slack = _cut_log_slack(total, p1, raw) + slack = min(raw_slack, cut_slack) + _need(slack > 0, "raw or split moment lacks a strict certified margin") + + # f(s)=log(T_s). Its second derivative is the variance of log(rank). + # f'(1-cap)>log(16) makes f(1-C)-log(P_1)+C log(8) decrease on [0,cap]. + cap_weights = _target_weights(targets, cap) + cap_upper = sum(n * _rank_weight(k, cap)[1] for k, n in targets.items()) + cap_mean = Fraction(sum(a * _log(k)[0] for k, a in cap_weights.items()), + GRID * cap_upper) + mean_slack = cap_mean - Fraction(_log(16)[1], GRID) + cap_cut_slack = _cut_log_slack(sum(cap_weights.values()), p1, cap) + _need(min(mean_slack, cap_cut_slack) > 0, "uniform 8,16 cuts are not certified") + + raw_tilt = Fraction(sum(a * _log(k)[0] for k, a in weights.items()), total * GRID) + _need(raw_tilt > Fraction(_log(16)[1], GRID), "the rational mode cannot certify growth") + + # For J=8^v, the full split bill is <= P_t^v + 2 J^(t-1) P_1^v. + # The modal target supplies >= (total/GRID)^v / (v+1)^d. + # Thus mu <= 3 (v+1)^d exp(-v slack) < 1/2 under the integer test below. + j = 0 + while True: + v = 1 << j + if v * slack >= d * (j + 1) + 3: + counts = _mode(weights, v) + k_margin = sum(n * _log(k)[0] for k, n in counts.items()) - v * _log(16)[1] + if k_margin >= 0: + break + j += 1 + + # N=2^H. H is a multiple of v to make the row stock B^(H/v) integral. + # 2 (3 ambient^v)^raw < 2^[1+raw(2+v ceil(log2 ambient))]. + axis_bits = v * _ceil_log2(ambient) + gap = raw - uniform + price_bound = 1 + raw * (2 + axis_bits) + depth = max(_ceil_ratio(1 + axis_bits, v), price_bound // (v * gap) + 1) + h = v * depth + _need(h >= 1 + axis_bits and h * gap > price_bound, "uniform dimension failed") + width_degree = _ceil_log2(sum(targets.values())) + # Per owner a node has at most (ambient * paid count)^v paid descendants. + # (1+q)^depth bounds the number of visits at all levels when branches <=q. + visit_degree = _ceil_log2(2 * ambient * sum(paid.values())) + return { + "raw_saving": str(raw), "uniform_saving": str(uniform), "price_cap": str(cap), + "source_ambient": ambient, "source_target_count": sum(targets.values()), + "source_paid_count": sum(paid.values()), "target_weights_grid_bits": 275, + "raw_fraction_slack_lower": _show_lower(raw_slack), + "cut_log_slack_lower": _show_lower(cut_slack), + "cap_mean_minus_log16_lower": _show_lower(mean_slack), + "cap_cut_log_slack_lower": _show_lower(cap_cut_slack), + "v": v, "type": {str(k): m for k, m in counts.items()}, + "log_K_over_16_to_v_lower": _show_lower(Fraction(k_margin, GRID)), + "split_cap": "8^v", "minimum_target": "16^v", "mu_upper": "3/8", + "H": h, "N": "2^H", "depth_at_most": depth, + "dimension_log_slack_lower": _show_lower(h * gap - price_bound), + "batch_width_degree_upper": width_degree, + "all_recursive_visits_degree_per_root_owner": visit_degree, + } diff --git a/research/single-grade-rank-compiler/product.py b/research/single-grade-rank-compiler/product.py new file mode 100644 index 0000000000..9b2ba02afa --- /dev/null +++ b/research/single-grade-rank-compiler/product.py @@ -0,0 +1,110 @@ +"""Build a normalized single-grade word from a literal chronological native program.""" + +from collections import Counter +from collections.abc import Callable +from dataclasses import dataclass +from itertools import product +from math import prod + +from schedule import Word, complete_order + + +@dataclass(frozen=True) +class Native: + ambient: int + targets: tuple[int, ...] + paid: tuple[int, ...] + run: Callable # run(machine, owners, columns) yields the actual normalized requests. + + +def compose(outer, inner): + """Suspend distinct outer instances and finish one inner word at each paid position.""" + def run(machine, owners, columns): + width = len(outer.targets) + instances = [iter(outer.run(machine, owners[j*width:(j+1)*width], h*columns)) + for j, h in enumerate(inner.targets)] + for rank in outer.paid: + placements = [] + for target, instance in zip(inner.targets, instances): + owner, axes = next(instance) + if len(axes) != rank * target * columns: + raise ValueError("outer request does not match this inner target") + order = complete_order(axes, machine.n) + placements.append((owner, order)) + if len({owner for owner, _ in placements}) != len(placements): + raise ValueError("outer instances alias a paid owner") + for owner, order in placements: + machine.move(owner, order, False) + yield from inner.run(machine, [owner for owner, _ in placements], rank * columns) + for owner, order in placements: + machine.move(owner, order, True) + end = object() + if any(next(instance, end) is not end for instance in instances): + raise ValueError("unfinished outer instance") + + return Native(outer.ambient * inner.ambient, + tuple(h * k for h in inner.targets for k in outer.targets), + tuple(r * s for r in outer.paid for s in inner.paid), run) + + +def specialize(raw, counts, cutoff): + """Return a homogeneous Word and the native callback for schedule.expand.""" + typed = {} + for key, number in counts.items(): + rank = int(key) + if (type(key) is not int and str(rank) != key) or rank in typed or rank not in raw.targets: + raise ValueError("invalid or duplicate native grade") + if type(number) is not int or number < 0: + raise ValueError("invalid type multiplicity") + typed[rank] = number + counts = {rank: n for rank, n in typed.items() if n} + if not counts: + raise ValueError("empty target type") + if any(type(k) is not int or not 1 <= k <= raw.ambient for k in raw.targets + raw.paid): + raise ValueError("a native rank exceeds its ambient") + v = sum(counts.values()) + grade = prod(k**n for k, n in counts.items()) + if not 1 <= cutoff < grade: + raise ValueError("the paid cutoff must be positive and below the type rank") + source = raw + for _ in range(1, v): + source = compose(raw, source) + keep = [Counter(path) == counts for path in product(raw.targets, repeat=v)] + split_ranks = [] + for rank in source.paid: + quotient, tail = divmod(rank, cutoff) + split_ranks.extend([cutoff] * quotient) + if tail: + split_ranks.append(tail) + word = Word(source.ambient, grade, sum(keep), tuple(split_ranks)) + + def native(machine, owners, columns): + public = iter(owners) + discarded = [] + slots = [] + for retain in keep: + if retain: + slots.append(next(public)) + else: + blank = machine.zero() + discarded.append(blank) + slots.append(blank) + exhausted = object() + if next(public, exhausted) is not exhausted or len(set(slots)) != len(slots): + raise ValueError("specialization needs distinct complete source fields") + if source.ambient * columns > machine.n: + raise ValueError("missing source ambient") + requests = iter(source.run(machine, slots, columns)) + for rank in source.paid: + owner, axes = next(requests) + if len(axes) != rank * columns or len(set(axes)) != len(axes): + raise ValueError("invalid paid product boundary") + size = cutoff * columns + for start in range(0, len(axes), size): + yield owner, axes[start:start + size] + if next(requests, exhausted) is not exhausted: + raise ValueError("unaccounted paid position") + for blank in discarded: + machine.retire_zero(blank) + + return word, native diff --git a/research/single-grade-rank-compiler/retained/GATE-NOTICE b/research/single-grade-rank-compiler/retained/GATE-NOTICE new file mode 100644 index 0000000000..59d8e0cf31 --- /dev/null +++ b/research/single-grade-rank-compiler/retained/GATE-NOTICE @@ -0,0 +1,415 @@ +A sharper exponent for integer multiplication +Copyright 2026 Douglas Colkitt + +This project includes unmodified source files from OpenAI's manuscript +"Integer multiplication below n log n" and its accompanying repository: +https://github.com/openai/math +Commit: adc7f1241b42e322a6451854ab7e4b4c146bf78a + +The original manuscript identifies OpenAI as its author. Its Apache-2.0 +license is retained at upstream/LICENSE. The exact source URLs and hashes +are recorded in upstream/manifest.json. Proposed modifications are supplied +as separate files under patches/; upstream source files remain unchanged. + +The original local research note, scripts, certificates, patches, and +documentation were prepared by Douglas Colkitt with assistance from OpenAI +Codex. The community release incorporates work by the contributors identified +in the notices below; it is not solely Douglas Colkitt's work. +This project is not an official OpenAI release or an OpenAI endorsement. + +Related contributions (not imported in this checkpoint): +Zhihao Chen (jacklightChen), PR #7, supplied an earlier ternary five-subset +motif, finite-alphabet transfer and a different compressed producer: +https://github.com/CrocSwap/integer-mult-bounds/pull/7 +The present checkpoint claims no priority for that motif. Related compressed +complex-network work was submitted by eumemic in PR #3: +https://github.com/CrocSwap/integer-mult-bounds/pull/3 +The pending contributions and their stronger bounds require their own review; +this notice does not represent adoption or verification of their claims. + +Additional community work, including parallel and superseded submissions, is +acknowledged in CONTRIBUTORS.md, with pinned submission metadata in +docs/research/contribution-snapshot.json. These acknowledgements do not imply +joint authorship of the checkpoint, incorporation of pending code, or verification +of submitted mathematical claims. Original source-specific notices remain in force. + +Community release (accepted by conditional maintainer audit): +The following original contributor notices apply to the imported PR #39 chain. +The preceding non-import statements describe the preserved 2^-30 checkpoint. + +Ternary five-subset construction and common-four-point resynthesis +Copyright 2026 Zhihao Chen (jacklightChen) + +This is Zhihao Chen's first submission of this specific construction to this +repository. Research, proof development, code and verification were prepared +with substantial assistance from GPT-6 Astra (OpenAI Codex), as identified by +the contributor. This is not independent review or an OpenAI endorsement. +Future research building on this contribution should explicitly acknowledge +Zhihao Chen (jacklightChen), cite the accompanying note and pull request, and +retain the preceding contributors' attribution. This notice records research +provenance; the repository's Apache-2.0 license remains unchanged. + +Dependencies retained from eumemic's Claude-assisted PRs #3 and #5: +https://github.com/CrocSwap/integer-mult-bounds/pull/3 +https://github.com/CrocSwap/integer-mult-bounds/pull/5 +PR #5 commit: d3d370c34937503bd3fa63c83d505a05e8e50893 +These include complex_circuit.py, complex_network.py, fast_gaussian.py, +their generators, construction notes and certificates. The Gaussian input +scaling proof is corrected in this derivative; see the modification notice below. +Aligned pairing also appears in Bortlesboat's PR #2. Retained totals and bank +sharing appear in dleen's PR #4 and cheaper retained centers in eumemic's PR #6. +Their results and ideas are credited separately from this new construction. + +Bulk recursion and controlled tensor basis, 8 October 2026 +Copyright 2026 icekylinx + +The new projector batching, controlled simultaneous basis, mixed-width tape +recursions, whole-residual complex recursion, and dependency-path precision +guard in the batched-23 proof package are contributed by icekylinx, developed +with substantial OpenAI GPT-6 Astra assistance. Review corrections and +repository integration were prepared with OpenAI Codex assistance. They build on the retained +PR #7 finite producers and the preceding contributions credited above. +The new package retains the repository's Apache-2.0 license and the original +authors' attribution. It is not an official OpenAI release or endorsement. + +Modification notice, 8 October 2026 (icekylinx): the retained fast Gaussian +proof now bounds shifted approximation error by F=2^ceil(1.14 alpha^2). +The P=34p precision budget and asymptotic exponent are unchanged. New batching +checks are integrated into make verify. Existing attribution and licenses +are retained. + +Partial-swap extension, 8 October 2026 +Copyright 2026 icekylinx + +The partial-swap framing, binary retained-total triple construction, +dependency-preserving positive labels and carrier reuse, unequal (25,23,57) +common basis, improved complex batching, and exact assembly are contributed +by icekylinx with substantial OpenAI GPT-6 Astra and Codex assistance. +This extension directly inherits PR #10, commit +62691e395a0458ce089a1c7b5d89e74291e95e29. The portable producer adapters +modify the retained paired-exclusion and shared-point implementations credited +above. The original licenses, attribution, and Gaussian correction are retained. + +Endpoint-gauge extension, 8 October 2026 +Copyright 2026 icekylinx + +The complementary auxiliary endpoint gauges, (32,30,40) controlled basis, +general nondegenerate binary phase residuals, retained-center complex producer, +updated path guard and exact assembly are contributed by icekylinx with +substantial OpenAI GPT-6 Astra and Codex assistance. This extension inherits +f2ab41aebad47861caf6316282c1793e5513845e and its PR #10 ancestry. New portable +adapters retain the paired-exclusion and shared-point contributions credited +above. Original licenses, notices and the Gaussian correction are retained. + +Structured-basis and semantic-bulk extension, 8 October 2026 +Copyright 2026 icekylinx + +The selected (32,30,36) bit construction, A1/A5 block refinements, fixed +middle-axis I+J profiles with bounded-minor CRT certificates, mixed dyadic +complex centers, complete data-front batching and circuit-specific assembly +are contributed by icekylinx with substantial OpenAI GPT-6 Astra and Codex +assistance. The immediate parent is ed90fd940279c336ebc45968631bdebfb087b505. + +The semantic/bulk compatibility argument, literal scalar charge, product row +stock and parameterization adapt Zhihao Chen (jacklightChen)'s PR #23, +commit 661ebabc1076c9f525d7ce4967c876b203fa9827. Translated complex endpoints +are adopted from the same contributor's PR #21, +commit 5ba6cf0bfb68f2be8d15610e7972207c50254d6a, following eumemic's source-frame +work and the earlier nested-basis contributions. + +Completed-child semantic precision, arbitrary-coordinate routing, phase-cell +Gaussian inversion and bulk tape transfer are credited to the RaD project +(hipotures), commit 45d9b60355872041f9275f77c057514def0d45bc, exposed through +PR #20 at 4f8d6c8272b5ff307a0da51df545ec3cd96a8b6e. Their selected proof +sources retain their separate CC0 license and original NOTICE under +references/semantic-bulk/rad20. The PR #23 source retains its recorded OpenAI +Codex assistance; RaD retains its recorded Codex and GPT-6.1-Sol Ultra +assistance. These are source attributions, not claims about this session's +runtime model. Related contributions by Rohan Arun and Aurel Prosz remain +acknowledged in the imported notices. No exclusive priority or additional +license condition is asserted. + +Copied retained-center extension, 8 October 2026 +Copyright 2026 icekylinx + +The copied retained-center schedule in both orientations, its complex-phase +transfer, the Wm-N+L rank budget, and the selected (25,23)/(28,28) composition +are contributed by icekylinx with substantial OpenAI GPT-6 Astra and Codex +assistance. This extension inherits PR #32 at +0ef3aeb61f55cc0b321ce6a0ef00acee25cefe52 and the preceding PR #10/#18/#24 work. + +The two-stage topology and paid copied-stream endpoint correction are due +to Aurel Prosz (Paureel), c82d09eb4781b68435e3fa3eb6beea72fa900fab, +through Zhihao Chen (jacklightChen)'s PR #29 unequal-axis composition, +9d963275075fa98f1da821e27757b238dafd6b3c. That source also credits Swapnil +Jain's two-stage development at ae405eb474d1486b2d8aef90139869f927f4836a. + +The contiguous corner method, incidence factorization and exact partition +certificates are due to Rohan Arun (PR #31), method commit +02f68f95369c39955c5ffcfddbd75cd83e26b305. The selected (25,23) certificate +specializes Dominik Scholz's parameterization (PR #33), +a499a345c040aa15b68e984a0904eadc485c7a7e. Their source notices and proof +snapshots are preserved in references/copied-centers. Historical OpenAI +Codex, GPT-6 Astra and Anthropic Claude Opus 5.5 assistance is credited to +the respective imported sources. Existing PR #21/#23 and RaD attribution, +licenses and the Gaussian correction remain in force. + +Copied centers with reversed (23,25) data corners, 2026-10-08 +Rohan Arun with substantial OpenAI Codex assistance supplies the composition, +exact dimension23 controls and cost/assembly integration. James Chang's PR34 +supplies the reversed boundary family; icekylinx's PR36 supplies copied retained +centers and the selected complex graph. The balanced assembly remains attributed +to RaD/hipotures and its PR34 specialization. Retain Dominik Scholz PR33, Rohan +Arun PR31, Zhihao Chen PR29/21/23, Paureel/Aurel Prosz, Swapnil Jain, icekylinx, +eumemic, Douglas Colkitt, OpenAI and all earlier notices and hypotheses. +This is not a claim of formal verification, new foundational rank identities, +global optimality or measured runtime speedup. + +Fixed middle basis with copied reversed corners (2026-10-08): +Rohan Arun, with substantial OpenAI Codex assistance. Composition and +simultaneous-basis proof retain icekylinx PR32/36, James Chang PR34, +Dominik Scholz PR35/38, Zhihao Chen, Paureel, Swapnil Jain, RaD/hipotures, +eumemic and all preceding attribution and licenses. See research/copied-fixed-reversed. + +Changed-graph composition with copied centers and fixed bases, 8 October 2026 +Prepared with OpenAI Codex assistance. +The new composition uses icekylinx PR36 copied centers and PR32 fixed-I+J +projectors/profiler, Dominik Scholz PR35 two fixed factors and CRT argument, +Zhihao Chen (jacklightChen) PR29/23 interfaces, Aurel Prosz (Paureel) and +Swapnil Jain's two-stage development, Rohan Arun PR25/31 corner methods, +Dominik Scholz PR33/38 dimension/composition work; James Chang (jamesyc) +PR34 reversed geometry and balanced transfer; Rohan Arun PR37/39/40 +reversed integration, modular data tests and both-fixed baseline; +RaD (hipotures) PR41 changed scalar DAGs, alternating point order and +independent role compiler; RaD balanced routing/bulk interfaces, and all +retained predecessors. +Complete attribution and the conditional proof boundary are recorded in +research/copied-fixed/PROOF.md; imported originals and source pins are retained. +Original Apache-2.0 and CC0 notices remain applicable. + +Community follow-up integration (PRs #49, #45 and #26), 8 October 2026: +Rohan Arun contributes weighted carrier matching and climbed summand/leave-one-out +orders (PRs #44/#47/#49), with Anthropic Claude assistance. The final construction +composes Chafik Boukhalfa's changed-graph checks, exact rational data recovery and +reordered exclusion sums (PRs #43/#46/#48, OpenAI Codex assistance) with RaD / +hipotures's alternating pair order and independent physical role compiler (#41). +All predecessor attribution and conditional proof interfaces remain in force. + +Alejandro Zarzuelo Urdiales contributes Gaussian parity and canonical arithmetic +proofs, finite tensor execution, profile precision accounting and mixed-center +reference checks (#45), with substantial OpenAI Codex assistance. See +research/gaussian-parity-synthesis/PROVENANCE.md for his full attribution. +Ryan S / princezuda contributes historical Lean certificate arithmetic, algebraic +frame/movement/guard lemmas and independent paired-circuit checks (#26). Original +source notices and historical snapshots are preserved. Neither formal package +claims a full formal proof of the multiplication algorithm or a new kappa. + +Joint frame compilation of skip-prefix strips + +The local compiler and exact finite witnesses were prepared by eumemic with +substantial OpenAI Codex assistance. Avi Eisenberg / ikeboy with Anthropic +Claude assistance supplied the unmodified PR #53 skip-prefix producer. +The pinned PR #48 pipeline is Chafik Boukhalfa's contribution, incorporating +Rohan Arun, RaD / hipotures, icekylinx, Dominik Scholz, James Chang, +Zhihao Chen, Aurel Prosz / Paureel, Swapnil Jain, eumemic, Douglas Colkitt, +OpenAI, David Harvey, Joris van der Hoeven and the earlier contributors +credited in the retained sources. See references/frame-compiler/pr48/NOTICE +and references/frame-compiler/pr53/NOTICE for their original attribution. +No authorship or review by those predecessors is claimed for this compiler. + +Joint dual-skip/frame-compiler composition (2026-10-08) +--------------------------------------------------- +Rohan Gupta / gupt1156 with Anthropic Claude assistance: PR55 dual-skip +scalar graph; original LICENSE and NOTICE are retained under +references/frame-compiler/pr55. eumemic with substantial OpenAI Codex +assistance: PR57 joint reversible frame compiler, serialized physical-word +replay and profile reconstruction. Chafik Boukhalfa with OpenAI Codex +assistance: this composition, independent integration and exact certificate. +Avi Eisenberg / ikeboy, Rohan Arun, RaD / hipotures, icekylinx, and all +predecessor authors retain the notices above and in pinned source files. +No original copyright or Apache-2.0 notice is removed. + +Ranked reclamation after the PR58 joint-dual composition (2026-10-08) +---------------------------------------------------------------- +Chafik Boukhalfa with OpenAI Codex assistance: prioritize retired physical +slots by descending current frame rank, retaining slot ID as the tie-breaker; +complete replay, exact profiles, comparison and adversarial controls. +The dedicated joint_dual_reclaim_compiler.py is derived from eumemic's PR57 +compiler. Its original shared compiler remains byte-identical. The PR55 +producer and all preceding attribution remain unchanged. The complete PR58 +comparison certificate and its original source/proof provenance are retained +under references/frame-compiler/pr58. + +Skip-prefix strip producer, 8 October 2026 +By Avi Eisenberg (ikeboy), with Anthropic Claude (Claude Opus 5.5) +assistance. The skip-prefix leave-one-out strip layout in +research/skip-strips/skip_graph.py is new. Everything else reuses Chafik +Boukhalfa's PR #43/#46/#48 research/copied-fixed pipeline, its verification +code, exact data recovery and support-order sorting, together with: +- Rohan Arun's PR #44 weighted carrier matching optimizer; +- RaD (hipotures) PR #41 alternating point order; +- every predecessor credited above. +Complete attribution and the conditional proof boundary are recorded in +research/skip-strips/PROOF.md. Original Apache-2.0 and CC0 notices remain +applicable. + +Local split-pair skip-prefix research continuation (2026-10-08) +Prepared with substantial OpenAI Codex assistance at the user's request. +New contribution: singleton/pair recursive partition refinement, finite summand +order and moment search, and verified composition with inherited paid clones. +Avi Eisenberg/ikeboy with Anthropic Claude assistance: PR53 skip-prefix strips. +Chafik Boukhalfa with OpenAI Codex assistance: PR54 original-envelope clone +specialization and PR43/46/48 checking interfaces. RaD/hipotures: PR51 +whole-chain/source-partition cloning and earlier producer/interfaces. +Rohan Arun: PR44 weighted matching and earlier fixed/reversed work, with all +stated historical AI assistance. All predecessor notices remain applicable. + +Original-envelope whole-chain clones on skip-prefix strips (research/skip-clones): +Chafik Boukhalfa, prepared with OpenAI Codex assistance. The complete-chain +source-partition clone operation is adapted from RaD / hipotures, PR #51, +with original envelopes retained here. The scalar base is Avi Eisenberg's +PR #53 skip-prefix layout, prepared with Anthropic Claude assistance. +All credited PR #43/#46/#48, PR #44 and earlier code/proof notices remain +in force. This extension is provided under the repository's Apache-2.0 terms. + +Community review checkpoint #50–#61, 8 October 2026 +Maintainer integration and independent arithmetic: Douglas Colkitt, with OpenAI Codex. +Avi Eisenberg / ikeboy: skip-prefix strip framework (#53), with Anthropic Claude. +Rohan Gupta / gupt1156: parallel order search (#50, stated Antigravity assistance) +and dual-suffix strips (#55, Anthropic Claude assistance). +Eumemic: equal-frame joint compilation and paid signal reclamation (#57), with Codex. +Chafik Boukhalfa: original-envelope paid clones (#54), composition (#58) and ranked +reclamation (#60), with Codex. Rohan Arun: order search (#52) and positive-frame +composition (#56), with Anthropic Claude and stated Codex validation assistance. +RaD / hipotures: enlarged frames, source partitions and paid whole-chain clones +(#51), with Codex. Rohan Garg / rohangar1: singleton/pair recursion and paid-clone +composition (#59), with Codex. Alejandro Zarzuelo Urdiales: exact parameter +refinement, scoped Lean arithmetic, matrix/parity and search tools (#61), with +his disclosed multi-tool and Codex assistance. +Parallel #50/#52 records are reviewed and credited without replacing the earlier +climbed-48 implementation; their exact commit history is retained. The separate +#51 witness is retained as research; its source-graph/negative-basis data proof +has not received the same full replay as #56's consumed compiler machinery. +See docs/research/community-round2-review.md for precise validation boundaries. +All earlier licenses, contributions and notices remain applicable. + +Interval strips and core-aware pair assembly + +The interval leave-one-out strips and the core-aware group-pair assembly in +research/pair-assembly were prepared by Avi Eisenberg / ikeboy with Anthropic +Claude assistance. They build on PR #53's skip-prefix pipeline and its +inherited PR #48 sources. The stacked witness in research/pair-assembly/frame +uses eumemic's PR #57 joint frame compiler unchanged; its driver and verifier +are adaptations of PR #57's skip_frame_compiler.py, skip_frame_compose.py and +verify_skip_frame.py. Original notices are retained. + +Stopped product-ring extension, 9 October 2026 +Copyright 2026 icekylinx + +The opposite-bank generic projector factorization, componentwise atom-ring +adapters, stopped recurrence and outer ordinary-interchange conversion, +aligned pair-star producer with rational centers, exact denominator-21 +grid and selected (23,23)/(24,24) composition are contributed by icekylinx +with substantial OpenAI GPT-6 Astra and Codex assistance. This extension +builds on merged PR #36, 11817ccacb564bb7f98789c20dc11d3fece207e3, and is +integrated on upstream main 56b66d58297deca1d7dd130247d720e960f77a37. + +The retained ordinary leaf uses the preceding projector, corner and +copied-center proofs. The selected two-stage topology retains Aurel Prosz +(Paureel), Swapnil Jain and Zhihao Chen's credits; the semantic assembly +retains PR #21/#23 and RaD's attribution. Paired producers, carrier matching, +original source notices and each imported license remain unchanged. + +Partial-gauge extension, 9 October 2026 +Copyright 2026 icekylinx + +The pair-first cube assembly, compatible backward frame enlargement, +partial source-gauge schedule and stopped whole-projector composition are +contributed by icekylinx with substantial OpenAI GPT-6 Astra and Codex +assistance, extending PR #104 at 948ce1510df750f4c18b96bdaef436a86f8bf834. + +The physical deferred bit word, reflected event accounting, fan-order +clarification and signed two-stage endpoint are adopted from Zhihao Chen +(jacklightChen), PR #97, e15350b66e4bf796153a68c240a6cc1b788abe3e, with +Codex assistance. Its deferred readouts, V leaves, lifted frames and frozen +witness originate in Swapnil Jain's 741e7aa078392553815df7926ee17ac5e25a8c38, +with the original Claude disclosure retained. Cyclic interval and core-aware +pair primitives build on Avi Eisenberg (ikeboy), PR #62, +ad0f25ff7b23cff7f08ad237c2254e6ecf74257e, with Anthropic Claude assistance. +Prior two-stage, copied-center, ordinary-leaf, semantic/bulk, routing and +precision credits remain in force. Imported source notices and licenses +are preserved under references/partial-gauge/; see SOURCES.json. + +Three-stage cover extension, 9 October 2026 +Copyright 2026 icekylinx + +The arbitrary-subspace Clifford frame theorem, three-stage Cayley geometry, +weighted q-adic GL cover, unit-lower weighted compiler, charged local-ring +fallback, uniform batching, internal row borrowing and exact composition +are contributed by icekylinx with substantial OpenAI GPT-6 Astra assistance. This +repository integration uses Codex assistance and extends +PR #115, cf60442983c153a3a0f5272ea4713f99eba13c86. + +The selected local complex DAG and support/label replay are adopted from +Copyright 2026 eumemic, PR #117, cbb05ce504d571546d9b7794c186a613c659c3bf, +with its original Apache-2.0 terms and Claude assistance disclosure. +The unchanged bit physical word retains Zhihao Chen (jacklightChen), +PR #97, and Swapnil Jain's underlying witness and assistance notices. +The prior opposite-bank, stopped ordinary-leaf, copied-center, topology, +semantic/bulk, precision and analytic credits remain applicable. +Original source notices and license bytes are preserved in +references/three-stage-cover/pr117/ and references/partial-gauge/. + +Paired-cube and shared-core extension, 9 October 2026 +Copyright 2026 icekylinx + +The paired-coordinate triple-cube identity, signed overlap channels, +original-source involution, coordinate-star centers, concrete frame/carrier +compiler, chronological source gauges, PR97 gauge-subset selection, +orthogonal cross-stage routing and exact supplier/assembly integration +are contributed by icekylinx with substantial OpenAI GPT-6 Astra assistance. +Repository integration uses Codex assistance and extends PR #130 at +6a9970a530119174507904e23592fd59ede19a5d. + +The substantial completed-core workspace-sharing principle is credited to +an664, PR #128, 530588a019b4a74f09180680c9e3961bf649ec89, with its reported +OpenAI Codex assistance. No source code, partition or serialized witness +from that PR is imported. The new routing and paired-motif integration +are described separately and claim no exclusive priority for broad sharing, +paired-coordinate, Fourier or carrier-matching ideas. + +Selected coarse queries restrict the retained eumemic PR #117 positive DAG; +its original Apache-2.0 and Claude assistance notices remain unchanged. +The bit word and original frames retain Zhihao Chen's PR #97 and Swapnil +Jain's frozen witness, notices and historical assistance disclosures. +Earlier generalized Clifford, three-stage, uniform weighted recursion, +ordinary-leaf, semantic/bulk, precision and analytic credits remain in force. +Source-specific license bytes are preserved under references/. + +October 9 recycled-bit integration: +DaysSky (#150), William Porter/hpst3r (#147), Thomas Marchand/Th0rgal (#146), +Rohan Gupta/gupt1156 (#148), James Chang/jamesyc (#124), SovereignSteak (#122). +The original notices and assistance disclosures are retained under research/, +including research/recycled-bit-integration/NOTICE. Andrew Barnes/Bortlesboat +(#101) repairs shared verifiers using rfu08's #64 counterexample. rfu08's +scoped finite and formal-transfer packages are included separately; they do +not establish the full multiplication theorem. Earlier and parallel credits +remain applicable. Douglas Colkitt integrated these with OpenAI Codex assistance. + +SovereignSteak PR151 independently supplies the matching gauge/recycling +composition and the selected 473/10^6 atom refinement; its original package +and assistance disclosure are retained under research/gauge-recycling/. + +October 9 coordinated-frame and completed-entrance-bank integration: +Dugongue PR186, 166a34d75e853e933855f0f7e940fe77c4bb6b8d, builds on +Chafik Boukhalfa/chafreaky's PR181, 7fb2194801e3a10f54772c7f0d5505035a4fc0ad, +and eumemic's PR168 v4, 4a3c769e5c5430e7114c4d3e099ff34664677f17. +The frozen package and prerequisite archive preserve all author, source-license +and assistance notices, including PR175's compiler optimization. DaysSky's +carrier closure, James Chang's terminal substitution and balanced assembly, +geckods' stopping refinements and all preceding framework credits remain. +Rohan Arun's PR185 bootstrap and chafreaky's PR182 bit refinement are reviewed +parallel contributions; their gains are not added to the selected witness. +Douglas Colkitt integrated the package and supplied the bank scheduling +supplement with OpenAI Codex assistance, under Apache-2.0. The all-size +interfaces remain conditional; finite verification is not full formalization. diff --git a/research/single-grade-rank-compiler/retained/PENDING-NOTICE b/research/single-grade-rank-compiler/retained/PENDING-NOTICE new file mode 100644 index 0000000000..3b083891bf --- /dev/null +++ b/research/single-grade-rank-compiler/retained/PENDING-NOTICE @@ -0,0 +1,16 @@ +Iterated returns on the P104 ordinary suppliers + +Clear1nsight prepared the successor construction, explicit witnesses and verification +with substantial OpenAI Codex assistance, including independent computational checks. +The new material is offered under Apache-2.0. + +The exact starting words and the rational and binary replay interfaces are from +Clear1nsight's PR #7781. The paid and productive scalar operations, the 48-call +complex schedule, the punctured binary supplier and the common outer application +come from Ali Romman's PR #7776. The two paid projections build on the local +quotient and terminal repair in #7774 and #7781. The binary paired caller and +finite compiler use work by DreamingOfClouds, Jerry Chen (CubeJerry), zxv and the +contributors cited in their retained sources. SYLforge, Rohan Arun, Cinna Davis, +Douglas Colkitt and other predecessors contributed the caller, physical and +analytic framework. The source-fetch helper is adapted from #7774. The immutable +source manifest identifies the public inputs and their notices. diff --git a/research/single-grade-rank-compiler/retained/pending-application.json.gz b/research/single-grade-rank-compiler/retained/pending-application.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..fa0d65ebf14d081b6427b5ac06962a63ba54e22d GIT binary patch literal 17535 zcmV)7K*zryiwFP!00002|LuM2b0f)d=lA_9Ciuygc7@8UtjfxZyANxxBBTge(pi4Q z#f1(50?iqCNrDE!on1Thzh7qKO#&QZrU#FzT02HF=mxqgD<8jnROWww^X}c%;NjtR zJRHo%ll!ax@$SF%BmMAtIvD=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abtoS&%Yv$`) zmuD`kFn89hJ~p@Wit5|R`?fT1^3Y5N%aZ=LSE8;9EZtPXYSDbr>!>aWW_ zm)xK#3fG~B`Ca-8Kdvf-cmB?*LRg>K-=N~6jCqS_`%7TA)}>#3-)z$C`GXgg?#tiU zP0RUBR`xo$A2!e5V}5n{@{6lm6?TtCzJcEK{%JgFta5$$<7PGLveb5?Le_rn@fjtr z?2FB2Il8-cL7m6g5Ql-_;M(g)qroT*gM}+Ora>6d$bwhcB)u~YMm)N?mL#L0Eb9Z> z-~Dk_X>M%Y%=%Ul-oBOUN&Wv-LA{FT-FUN9Z&`V2<=e}O>%|Y-{*C&|%#X%9tCI4& zhw-g$#i|gn8Mf8u{n_AQb=N>?`OC~o!JDC#X8&^a%|bqHQ)f^1{Hs5I|Chh?|M5@% z^iO~KWB(ui^sj&X;kQ5Z|MHLD|Ka<8?tlO1KmXzP|M>mC{QggWoLAk?2GjRVtHs=J zoFXVz?1O<*@SE5BixUQS`mgc*dX3*1WQwS`S)FV(Bq3Uo0l-@c0$VM7P*`qBVl~kE z>oIy&HO>k5^aK5x8d`TJR3nl zZesX?XRoOJaWWlk@Z6Ayuj43O4&6CP(M{ura6ODNxWOB=lyJO(YvE=%N^~9g adT=eH5hg#pzWU~G-~4}t%rIlYpalR!<9O%* literal 0 HcmV?d00001 diff --git a/research/single-grade-rank-compiler/retained/pending-bit.json.gz b/research/single-grade-rank-compiler/retained/pending-bit.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..2e8fb6444a6b8ddc44345e7fc01a93ac3f91e994 GIT binary patch literal 3866 zcmV+#59RP5iwFP!00002|Fv3eZ`?SN{yx7#=ueKjlGzQA^$e211&hO3 zph(JAMlJP7YCFm9{P!zLYQ43(W6$2%fZI*7SY#Ee>Zv0C`CSmKjLtGwM%BH>jIaJ9 zSP3R#!Y~m^CX$A+jYAw_8AD4b4WWp0EVNQihsp^}42_L7%-GNf<7m9PXr?V5VAgG! zZd_!F+@^I}pc__@9d@$IB5tk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C6MMS<}q^?LTZSdL59Z=-3uq?|6#6roe`jboPKHO(*>ZrZ$b9HLEMTN!*ClC=7W6P4n zSqRXfWJaPyOGyQaW2ZPQIZUj!96Qcb0x%;^q#~FPrrbR>`S)*5+iRBN*Yd|MIZs^6 zFO$&OwS4;?VBtMwQ?ahyohu`6J>yHh{zl^)*QrA~tsxBVpEn(D65tpFetspvNijh= zcrYw6_K!>$;u1^*A%PaQ`XoX;-SBYrx!+!Y1zH`s0iEq}d2CVm`|bYK%jmt&{zY(i z&EABUe#+DY8~v#$bzXOo$iF|#-D7v*+&%~ix?AYe_j3D(Pjfd13E=5x0eiv|uWK8W c`2TTbvzp=0fBT~8yFb4BU%3I=!X7RF09><*KL7v# literal 0 HcmV?d00001 diff --git a/research/single-grade-rank-compiler/retained/supplier_gate.py b/research/single-grade-rank-compiler/retained/supplier_gate.py new file mode 100644 index 0000000000..fe05580142 --- /dev/null +++ b/research/single-grade-rank-compiler/retained/supplier_gate.py @@ -0,0 +1,143 @@ +#!/usr/bin/env python3 +# PATCHED COPY of research/shared-wire-split-composition/interval_gate.py (see README.md and interval_gate.diff). +# Do not confuse with the pinned original, which is unchanged. +"""Independent certified fixed-grid intervals (80 decimal places). +ln via 2 atanh after binary range reduction; exp(-x) via alternating +Taylor brackets. Uses only integer floor/ceiling, not Decimal transcendents. +""" +from fractions import Fraction as F +from functools import lru_cache +from pathlib import Path +import json,argparse +if not __debug__: raise RuntimeError('Run without -O; assertions are proof checks.') +B=10**80 + +def ceildiv(a,b):return -((-a)//b) +def exact(q): + q=F(q);return q.numerator*B//q.denominator,ceildiv(q.numerator*B,q.denominator) +def add(a,b):return a[0]+b[0],a[1]+b[1] +def sub(a,b):return a[0]-b[1],a[1]-b[0] +def mul(a,b): + p=[a[i]*b[j] for i in (0,1) for j in (0,1)];return min(p)//B,ceildiv(max(p),B) +def div(a,b): + assert b[0]>0 + p=[F(a[i]*B,b[j]) for i in (0,1) for j in (0,1)] + return min(p).__floor__(),max(p).__ceil__() +def smul(a,q):return mul(a,exact(q)) +def atanh_log(y): + yi=exact(y);yy=mul(yi,yi);p=yi;s=(0,0) + for j in range(100):s=add(s,smul(p,F(2,2*j+1)));p=mul(p,yy) + # 0 <= tail <= 2 y^201/[201(1-y^2)] < 3*(1/3)^201. + return s[0],s[1]+ceildiv(3*B,3**201) +@lru_cache(None) +def log(r): + assert r>=1 + k=r.bit_length()-1;y=F(r-2**k,r+2**k) + a=atanh_log(y);b=atanh_log(F(1,3));return add(a,smul(b,k)) +def expminus(x): + assert 0<=x[0]<=x[1]0 and margins[str(hi)][1]<0 and margins[str(tested)][0]>0 + target=moment(T,tested);paid=moment(P,tested) + alpha=div(paid,target) + # Tail exponent = 1-tested+1/7; argument exp may not be negative. + # r^(1-tested+1/7)=r^(1-tested)* exp(log(r)/7). + def exppos(x): + assert 0<=x[0]<=x[1]0 and gap.numerator==1;step=gap.denominator + wins=lambda j:(step*j+1)**written<2**j + l,h=1,2 + while not wins(h):l,h=h,2*h + while h-l>1: + m=(l+h)//2 + if wins(m):h=m + else:l=m + assert wins(h) and not wins(h-1) + # Bound the derivative through the BIT ceiling and both complex endpoints. + end=max(cap,hi) + derivative=(0,0) + for rr in T.keys()|P.keys(): + c=T.get(rr,0)-P.get(rr,0);r=int(rr) + term=mul(power(r,end if c>=0 else 0),log(r));derivative=add(derivative,smul(term,-c)) + assert derivative[1]<0 + result=dict(claim=str(claim),tested=str(tested),raw_bracket=[str(lo),str(hi)],moment_margins={k:show(v) for k,v in margins.items()},moment_margin_float={k:value(v) for k,v in margins.items()},derivative_upper=float(F(derivative[1],B)),alpha=value(alpha),gamma=value(gamma),delta=value(delta),minimum_log_power=lp,written_log_power=written,compiler_gap=str(gap),H=str(step*h),BIT_pin=str(cap),BIT_margin=str(cap-tested)) + # Outer formulas evaluated independently after algebraically substituting + # b=k+5g,a=k+4g,q=k+3g,epsilon=1-g,beta=1-3g. + k=claim;g=gap;b=k+5*g;a=k+4*g;q=k+3*g;ep=1-g;be=1-3*g;r0=g/10;stop=layout=g + sig=1-b;tau=1-a;internal=tau+(1-stop)*max(sig-tau,0);leaf=sig+stop*(1-sig);lam=1-(q+a)/2;xi=ep*(1+q)-F(3,32)+layout;key=be+1-ep + M=[ep*q,a,1-ep+q*be,1-ep+a*be,1-ep+be,F(3,32)+xi-ep,xi+F(1,2)-ep,ep,1-(ep+be+48-128+2)] + checks=[cap-a,b-a,q,b-q,a-q,stop,1-stop,(1-stop)*b-a,1-internal-q,1-leaf-q,lam-tau,lam-sig,lam-internal,1-q-lam,1-q-leaf,ep,1-ep,xi-F(1,2),ep-xi,be,ep-be,1-be,1-(2*xi-2)-r0-be,1-(2*xi-2)-be,1-ep-r0,1-ep,r0,1-key,1-be-2*(1-ep),128-48-be,layout,ep-a,F(1,32)-b,F(2**45-7**16),F(2),2-xi,F(5),1-be,1-be,1-ep,M[2]-M[0],g,k-F('.001730970419199163702738'),1-ep,F(11,2)]+[x-k for x in M] + functional=[1-be,be*(1-F(3,1000)),128-48-ep-be-1,be*(1-F(1,250))] + assert len(checks)==54 and len(functional)==4 and min(checks+functional)>0 + result['outer']=dict(strict_count=54,functional_count=4,minimum_margin=str(min(checks+functional)),BIT_just_below_effective_rejected=(a-F(1,10**12))-a<0) + # Input-lift is only needed on [1-tested_complex,1]. + # L(k)=sum_pos r^(1-k)-sum_neg r^(1-k); L(0)=0; L'(0)=-d1; + # L''(k)=sum_pos r ln^2 r r^-k - sum_neg r ln^2 r r^-k >= -N for k>=0, + # where N=sum_neg r ln^2 r (the positive part is >=0 and r^-k<=1 for r>=1). + # Hence L'(k)>=-d1-kN and L(k)>=-k d1-k^2 N/2. Only the NEGATIVE-coefficient + # curvature enters (signed bound); |.| over both parts was valid but loose. + pos={7:1,3:1,5:1};neg={9:1,4:1,1:2};d1=(0,0);curvature=(0,0);abs_curvature=(0,0) + for hist,sign in ((pos,1),(neg,-1)): + for r,c in hist.items(): + d1=add(d1,smul(log(r),sign*c*r)) + abs_curvature=add(abs_curvature,smul(mul(log(r),log(r)),c*r)) + if sign<0:curvature=add(curvature,smul(mul(log(r),log(r)),c*r)) + assert curvature[0]>=0 + lift_cap=cap if cap<=LIFT_RANGE else tested + assert tested<=lift_cap and F(d1[1],B)+lift_cap*F(curvature[1],B)<0 + lifts={} + for price in (claim,tested): + lift=sub(moment(pos,price),moment(neg,price));assert lift[0]>0 + assert price*(-F(d1[1],B))-price*price*F(curvature[1],B)/2>0 + lifts[str(price)]=show(lift) + result['input_lift']=dict(margins=lifts,interval_kappa_cap=str(lift_cap),derivative_upper_on_required_interval=str(F(d1[1],B)+lift_cap*F(curvature[1],B)),signed_curvature_upper=str(F(curvature[1],B)),absolute_curvature_upper=str(F(abs_curvature[1],B)),signed_derivative_ceiling=str(-F(d1[1],B)/F(curvature[1],B))) + return result +if __name__=='__main__': + p=argparse.ArgumentParser();p.add_argument('audit');p.add_argument('--claim',default='.00362852408');p.add_argument('--tested',default='.00362852408007');p.add_argument('--lower',default='.00362852408398727978896072723289');p.add_argument('--upper',default='.00362852408398727978896072723290');p.add_argument('--out',required=True);p.add_argument('--bit-pin',default=BIT_PIN);a=p.parse_args() + r=gate(json.loads(Path(a.audit).read_text())['invoice'],a.claim,a.tested,a.lower,a.upper,a.bit_pin);Path(a.out).write_text(json.dumps(r,indent=2)+'\n');print(json.dumps(r,indent=2)) diff --git a/research/single-grade-rank-compiler/schedule.py b/research/single-grade-rank-compiler/schedule.py new file mode 100644 index 0000000000..0f3b6547ba --- /dev/null +++ b/research/single-grade-rank-compiler/schedule.py @@ -0,0 +1,118 @@ +"""Expand a normalized native word to rank-one requests on a fixed ambient space.""" + +from dataclasses import dataclass +from functools import cache +from fractions import Fraction + + +@dataclass(frozen=True) +class Word: + ambient: int + grade: int + roles: int + paid: tuple[int, ...] + + def __post_init__(self): + if not 2 <= self.grade <= self.ambient or self.roles < 1: + raise ValueError("invalid productive interface") + if any(not 1 <= rank < self.grade for rank in self.paid): + raise ValueError("a paid rank does not decrease") + + def depth(self, rank): + height = 0 + largest = max(self.paid, default=0) + while rank >= self.grade: + rank = largest * (rank // self.grade) + height += 1 + return height + + def tile_size(self, ambient): + if ambient < 1: + raise ValueError("a root must have a positive rank") + capacity = self.grade * (ambient // self.ambient) + return capacity or ambient + + def tiles(self, ambient): + size = self.tile_size(ambient) + for start in range(0, ambient, size): + yield range(start, min(start + size, ambient)) + + def root_width(self, ambient): + if ambient < self.ambient: + return 1 + first = self.grade * (ambient // self.ambient) + return self.roles ** self.depth(first) + + def leaves_per_array(self, ambient): + """Count leaf requests independently of the choice of storage.""" + size = self.tile_size(ambient) + if ambient < self.ambient: + return Fraction(ambient) + + @cache + def inside(rank): + columns, tail = divmod(rank, self.grade) + if not columns: + return Fraction(rank) + children = sum((inside(child * columns) for child in self.paid), Fraction()) + return tail + children / self.roles + + count, last = divmod(ambient, size) + return count * inside(size) + inside(last) + + +def complete_order(active, ambient): + used = set(active) + if len(used) != len(active) or any(i < 0 or i >= ambient for i in used): + raise ValueError("the requested coordinates must be distinct ambient axes") + return tuple(active) + tuple(i for i in range(ambient) if i not in used) + + +def expand(word, ambient, owners, machine): + """Call machine.native on whole owners. It yields each normalized paid request. + + A native instance takes distinct fields in its declared role order. It performs + its local instructions and yields (owner, axes) at each paid position. It keeps + its own adapters and scratch until control returns. The machine implements + move(owner, order, inverse), leaf(owner, axis) and native(owners, columns). + """ + width = word.root_width(ambient) + if len(owners) != width or len(set(owners)) != width: + raise ValueError("the root needs its full batch of distinct owners") + + def satisfy(jobs): + rank = len(jobs[0][1]) + if any(len(axes) != rank for _, axes in jobs): + raise ValueError("a chronological batch must have one rank") + if len({owner for owner, _ in jobs}) != len(jobs): + raise ValueError("a chronological batch reused an owner") + placements = [(owner, complete_order(axes, ambient)) for owner, axes in jobs] + for owner, order in placements: + machine.move(owner, order, False) + columns, tail = divmod(rank, word.grade) + if columns: + if columns * word.ambient > ambient or len(jobs) % word.roles: + raise ValueError("the native instance lacks axes or independent rows") + paths = [] + for start in range(0, len(jobs), word.roles): + group = [owner for owner, _ in jobs[start:start + word.roles]] + paths.append(iter(machine.native(group, columns))) + for paid in word.paid: + requests = [next(path) for path in paths] + if any(len(axes) != paid * columns for _, axes in requests): + raise ValueError("native chronology disagrees with the paid rank") + satisfy(requests) + sentinel = object() + if any(next(path, sentinel) is not sentinel for path in paths): + raise ValueError("a native paid position was omitted") + for owner, order in placements: + for axis in range(rank - tail, rank): + machine.leaf(owner, axis) + machine.move(owner, order, True) + + if ambient < word.ambient: + for axis in range(ambient): + machine.leaf(owners[0], axis) + return + for tile in word.tiles(ambient): + satisfy([(owner, tile) for owner in owners])