diff --git a/.gitattributes b/.gitattributes index 6825630198..18d54d5a0d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18,3 +18,7 @@ research/coordinated-frames-and-entrance-banks/** -text -whitespace # Frozen PR210 package and round-nine evidence retain their audited bytes. research/five-stage-source527-banks/** -text -whitespace research/community-round9-audit/** -text -whitespace + +research/e8-early-reset-reuse/** -text + +research/idle-axis-hosting/** -text -whitespace diff --git a/.github/workflows/early-reset-reuse.yml b/.github/workflows/early-reset-reuse.yml new file mode 100644 index 0000000000..ad7aeacfde --- /dev/null +++ b/.github/workflows/early-reset-reuse.yml @@ -0,0 +1,20 @@ +name: Verify early reset and kernel composition +on: [push, pull_request] +jobs: + verify: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python: ['3.11', '3.14'] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + - run: python -B research/e8-early-reset-kernel/verify.py "$RUNNER_TEMP/early-reset-reuse" + - uses: actions/upload-artifact@v4 + if: always() + with: + name: early-reset-reuse-${{ matrix.python }} + path: ${{ runner.temp }}/early-reset-reuse diff --git a/.github/workflows/idle-axis-hosting.yml b/.github/workflows/idle-axis-hosting.yml new file mode 100644 index 0000000000..4f9bad7fea --- /dev/null +++ b/.github/workflows/idle-axis-hosting.yml @@ -0,0 +1,41 @@ +name: Verify idle-axis hosting composition + +on: + push: + paths: + - 'research/idle-axis-hosting/**' + - 'research/e8-early-reset-kernel/**' + - 'research/e8-early-reset-reuse/**' + - 'research/split-centres-global/**' + - '.github/workflows/idle-axis-hosting.yml' + pull_request: + paths: + - 'research/idle-axis-hosting/**' + - 'research/e8-early-reset-kernel/**' + - 'research/e8-early-reset-reuse/**' + - 'research/split-centres-global/**' + - '.github/workflows/idle-axis-hosting.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-24.04 + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + python-version: ['3.11', '3.14'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 + with: + python-version: ${{ matrix.python-version }} + - name: Replay PR434 from scratch, host helper residuals on idle coordinates, audit and assemble + run: python3 -B research/idle-axis-hosting/verify.py "$RUNNER_TEMP/idle-axis-hosting" + - name: Require committed files to remain unchanged + run: git diff --exit-code diff --git a/.github/workflows/split-centres-global.yml b/.github/workflows/split-centres-global.yml new file mode 100644 index 0000000000..1adf7dc2ea --- /dev/null +++ b/.github/workflows/split-centres-global.yml @@ -0,0 +1,23 @@ +name: Split-centres global kappa +on: + pull_request: + paths: + - 'research/split-centres-global/**' + - '.github/workflows/split-centres-global.yml' + push: + paths: + - 'research/split-centres-global/**' + - '.github/workflows/split-centres-global.yml' + workflow_dispatch: +jobs: + verify: + runs-on: ubuntu-latest + strategy: + matrix: + python: ['3.11', '3.14'] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + - run: python -B research/split-centres-global/verify.py "$RUNNER_TEMP/split-centres-check" diff --git a/research/cross-copy-hosting/EXPECTED.json b/research/cross-copy-hosting/EXPECTED.json new file mode 100644 index 0000000000..1574e6488b --- /dev/null +++ b/research/cross-copy-hosting/EXPECTED.json @@ -0,0 +1,10 @@ +{ + "status": "PASS_CONDITIONAL_CROSS_COPY_HOSTING_ASSEMBLY", + "kappa": "1330733966732373/1000000000000000000", + "kappa_decimal": "0.001330733966732373", + "bit_lower": "66625358964838932161/50000000000000000000000", + "complex_lower": "718766148669433/500000000000000000", + "binding_component": "bit", + "bit_template_sha256": "d2befafecd2d4e5dc5d1ca71137038168e59802fa8a8b6e1df3a93745a733283", + "complex_template_sha256": "848ad045872f55c43cc1623600d1ba81e32fe33b68683cb56c39324287bf9fa4" +} diff --git a/research/cross-copy-hosting/LICENSE b/research/cross-copy-hosting/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/cross-copy-hosting/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/cross-copy-hosting/MANIFEST.json b/research/cross-copy-hosting/MANIFEST.json new file mode 100644 index 0000000000..170dd3d124 --- /dev/null +++ b/research/cross-copy-hosting/MANIFEST.json @@ -0,0 +1,18 @@ +{ + "files": { + "EXPECTED.json": "18b42250c3faf6f0df76fcab6c3a483582192ad7bb09cb1985f4b0bb91d67024", + "LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "PROOF.md": "221e37fedb9bfe1f03cb1768906b86b2f073410083f6948ea0f4d4b077a9b81f", + "README.md": "3d920ec44afc3588281ae466c8cd87874b4bfaf4f6f050b756240cd8844b899a", + "SELECTION.json": "23b8da8a4ae51541875b81f0db217e030cccddc25d0c654f2bc845b828c705ce", + "TOY-EXPECTED.json": "d296c395bb0071797b29e9fb3718cd9e728ade7f32f9317f7009966ce5bf441e", + "assemble_split.py": "768b5b56d96f920f180a92b2675de9e90186d58ac66537666557a7b61c724a00", + "audit_split.py": "549d41ce1d6587eae37e43d906297cc356c924d11b668c0bce89474acb5b690b", + "bit_split.py": "3b36608b22eadef0f6dc1db0038b2e22f1bbe0ce26ad6b3dcd9015cae0b4f612", + "complex_split.py": "eeee31964ea328c893d4fe10f5ec4c4f3a055769be39ef455186754459502c3a", + "tape_core.py": "bd1b68b56e382d014c1afeb4a735b26b469681192263f7b0da21c4288afaf3de", + "toy_two_family_check.py": "04fa7c582f8eddd5f68a667d90431a7dbc85a2c1ca5aae537d75b7d69f043afe", + "verify.py": "af2440adf50a39c590fb23f403f31b90bf108467fdf1563159f7c2d1630c8e3f" + }, + "parent_manifest_sha256": "95a9570287b64d22de30e6ae3acf931d5f6daef1a163f0c99532e1a24639fbc2" +} diff --git a/research/cross-copy-hosting/PROOF.md b/research/cross-copy-hosting/PROOF.md new file mode 100644 index 0000000000..181e31a022 --- /dev/null +++ b/research/cross-copy-hosting/PROOF.md @@ -0,0 +1,131 @@ +# Cross-copy idle-axis hosting: one residual on two copies of one idle child + +This package changes only the global nine-stage templates of #442's two suppliers, which are #434's two suppliers: + +- the complex word is #433's split-centre word, R = 560, m = 73; +- the bit word is #434's early-reset kernel word, R = 747, m = 64. + +Local programs, scalar replays, data routes, bridges, terminal exchange and cover correction are unchanged. The idle +windows are #442's. What changes is the shape of a hosted slot: a residual may be laid across the pending coordinates +of two copies of the same idle child. + +## 1. The waste in whole-residual hosting + +An idle child advancing pair j by rank r acts on every copy (side, port) of that pair: 2V = 240 data families on the +bit side, V = 120 ports per side on the complex side, each with r pending coordinates and all with the same window. +#442 places whole residuals inside one copy's pending set. Bit residuals have width 8 − e (entrance rank e ∈ {0, 1, 4}; +637 of width 8, 104 of width 7, 6 of width 4), complex residuals have width 9, while the children have ranks +7, 14, 28, 42 (bit) and 8, 16, 32, 48 (complex). A rank-7 child cannot hold a width-8 residual at all, a rank-14 child +holds one and wastes six coordinates, and so on. On the bit side 6,944 of the 45,360 pending coordinates per replica +stay idle and are paid as remainder children; on the complex side 5,760 of 51,840. + +## 2. The extension + +Fix an idle child Γ of pair j at recipe position τ, and two copies (F₁, g₁), (F₂, g₂) of pair j: two data families with +pending sets S₁ and S₂ of Γ. Let ι be a local invocation inside the window of Γ (the same window for every copy of the +pair: the window condition of #442 §2 names only the pair, the invocation and the child). Let a helper residual of ι +have width w = w₁ + w₂ with w₁, w₂ > 0. + +Claim: the residual may be owned by (F₁, d·σ₁⁻¹) on w₁ coordinates S₁' ⊂ S₁ and by (F₂, d·σ₂⁻¹) on w₂ coordinates +S₂' ⊂ S₂, with Γ replaced on F₁ by its factor on S₁ ∖ S₁' and on F₂ by its factor on S₂ ∖ S₂', and the complete +program's operator is unchanged. + +Proof, from #442's two inherited facts. + +- Fact (a): on the physical coordinates that carry the residual, the dirty invocation ι acts as the coordinate factor + D_P (bit) or P_g C_block P_g⁻¹ (complex) on those w coordinates, independent of their contents. With P = P₁ + P₂ an + orthogonal sum of the projectors onto S₁' and S₂', the identity D_{P₁}·D_{P₂} = D_P (the parent's D_{P'}·D_{P−P'} = D_P) + writes the action as the product of a factor on S₁' and a factor on S₂'. On the complex side the block is the same + commuting product over coordinates that #442 §1(b) already uses. The two factors act on different families, so they + commute with everything acting on the other family. +- Window: nothing touches F₁ or F₂ strictly between ι and τ, because both are copies of pair j and the window is a + property of pair j. So, exactly as in #442 §2, the factor on S₁' is moved to τ on F₁ and the factor on S₂' is moved to + τ on F₂, independently. +- Fact (b): at τ, Γ on F₁ is the commuting product of coordinate factors on S₁; the moved factor on S₁' times the + remainder factor on S₁ ∖ S₁' is Γ's factor on F₁. The same on F₂. + +The residual's coordinate isometry σ now carries the local residual block onto S₁' ⊔ S₂' inside two families of the +same replica. It is still an elementary coordinate permutation of the address space; the finite invoice charges one +further route factor per helper selector for it (three extra factors instead of #442's two). Phases and reflection are +as in #442 §2: Γ'·(hosted factors) = Γ as exact operators on every family, and the window condition is symmetric. + +Residuals of different invocations hosted on the same copy occupy disjoint coordinates and are sequential, as in the +parent. A residual never spans two children and never spans copies of different pairs; the audit rejects both. + +## 3. Selection + +`tape_core.py` concatenates the pending sets of a child's copies into one tape and solves an integer programme over +the counts n(child, stage, width): maximise Σ ln(m/r)·(hosted coordinates on the child) subject to residual +availability per (stage, width) and, on the bit side, exact width-64 tiling of the leftover (width 7 in eights with one +width 8, width 4 in pairs with seven width 8, width 8 in eights). The frozen choice is `SELECTION.json`; `--discover` +recomputes it with scipy. `expand` lays each child's residuals along the tape widest first; a residual that straddles a +copy boundary becomes a two-piece slot. + +## 4. What is checked + +- `bit_split.py` and `complex_split.py` read #434's freshly regenerated templates and emit the new owners, remainders + and banks (bit: exact width-64 tiling, no padding; complex: eight per bank plus one paid pad, final partial bank pays + the larger pad). +- `audit_split.py` shares no code with the generators. It re-derives every window from the template schedule and, for + every replica and invocation, checks that every helper has exactly one owner record; that each hosted residual has + one or two pieces on copies of the child it names, with widths summing to the residual's width, inside the pending + set, pairwise disjoint per (child, copy), inside the window and off the active pair; that remainder children and bank + tilings are exact; and it recomputes the profile, live stock and the rank deficit 2496. Twelve mutations are + rejected, including a split whose pieces sit on two different children and a split whose widths do not sum to the + residual width. +- `assemble_split.py` is #442's assembly with the extra route factor: two rational moment engines per supplier, fresh + finite invoices with the new stock, six bootstrap levels and the 47 strict outer inequalities; the next grid point and + the zero-η, zero-β and unit-β controls are rejected. + +## 5. Result + +| | live stock | max child | hosted residuals | of which split | certified saving | +| --- | ---: | ---: | ---: | ---: | --- | +| bit, m = 64 | 9,457 → 8,592 | 8 → 24 | 46,160 of 53,784 | 12,496 | c = 66625358964838932161/(5·10²²) ≈ 1.33251·10⁻³ | +| complex, m = 73 | 8,400 → 7,680 | 8 → 48 | 40,320 of 40,320 | 13,720 | b = 718766148669433/(5·10¹⁷) ≈ 1.43753·10⁻³ | + +The bit max child 24 is one partial copy of a rank-28 child (eight calls); the complex max child 48 is the 133 copies +per replica of the rank-48 final children that the complex supply (5,040 residuals per replica against 5,760 pending +coordinates of width 9) cannot fill. Both deficits stay 2496. + +κ = 1330733966732373/10¹⁸ ≈ 1.330733966732373·10⁻³, bit-bound, +17.44 % over #434 and +7.53 % over #442. + +## 6. Scope + +This is a written finite extension of #442's hosting interface: a residual's physical slot may lie in two data +families of one idle child. It is the principal new review point. #442's extension (helper residuals on data streams +during idle windows) and all other interfaces remain inherited assumptions: the all-size compiler, correlated +dirty-bank and compressed-window interfaces, restored work, tape/common grid, precision and analytic transfer. + +No Lean proof and no unconditional integer-multiplication theorem is claimed. The global operator identity is argued +from the parents' facts (a) and (b) and checked combinatorially, not replayed numerically on the address spaces. + +## 7. Reply to the trace note of #451 (`research/cross-family-residual-obstruction`) + +The note models a family's address as (x, y) ∈ F_q^m × F_q^m and a rank-r residual action as the exchange x_i ↔ y_i +on r selected coordinates i. It shows that D_{a+b} on family A tensored with the identity on family B has a +different trace from D_a on A tensored with D_b on B, and concludes that the split "needs a new operator theorem". + +The two operators compared are the actions of two different *placements* of one residual: all w = a + b coordinates +in A, or a coordinates in A and b in B. In the note's own model the action is coordinate-wise, the tensor product over +the selected i of the exchange x_i ↔ y_i, so the invocation's action on a residual whose coordinates are placed in two +families is D_a^A ⊗ D_b^B by definition of the placement. §2 does not claim that this equals D_{a+b}^A ⊗ I^B, and no +such equality is needed: #442's hosting already moves a residual from a bank family to a data family, and those two +actions differ in trace in the same way. + +What §2 claims, as #442 §2 does, is equality of the complete program on the live families after absorption. On A the +moved factor on S₁' times the remainder child's factor on S₁ ∖ S₁' is the original child's factor on A; on B likewise. +Each family's per-stage rank-m budget is covered exactly, and the audit checks this cover on every (child, copy). The +trace invariant therefore separates two placements, not a placement from the original program. + +The review point that remains is the one named in §6 and in the note's own scope paragraph: whether the compiler +interface admits a local register whose route lands in two families. In the coordinate-wise model used by the note it +does; a model in which a residual's action is not a tensor product over its coordinates would be a different +interface, and then the same question would apply to #442's banks, which also place sequential residuals of several +helpers in one family. + +`toy_two_family_check.py` makes this exact in the note's own model. For q = 3, m = 2 it reproduces the note's traces +(the residual factor fixes 90 addresses when whole on A and 54 when split), and it shows that the complete program, +factor(s) followed by the remainder children, equals the original children Γ_A × Γ_B as a permutation of the +two-family address space for both placements; for w > r only the split placement exists. `verify.py` runs it and +compares its output with `TOY-EXPECTED.json`. diff --git a/research/cross-copy-hosting/README.md b/research/cross-copy-hosting/README.md new file mode 100644 index 0000000000..5d54ae871f --- /dev/null +++ b/research/cross-copy-hosting/README.md @@ -0,0 +1,39 @@ +# Cross-copy idle-axis hosting on #442: conditional κ ≈ 1.3307340·10⁻³ + +This package lets a hosted helper residual lie across the pending coordinates of two copies (two data families) of +the same idle child. The two copies share the child's window, so #442's hosting lemma applies to each piece. Every +child's capacity, copies × rank, is then a multiple of the residual width, and the idle remainder children almost +vanish. + +Neither local word changes: complex #433 (R = 560, m = 73), bit #434 (R = 747, m = 64). The windows are #442's. + +**Result:** κ = 1330733966732373/10¹⁸ ≈ 1.330733966732373·10⁻³, bit-bound, **+17.44 % over #434** and +7.53 % over +#442 (1.2375517·10⁻³). + +| supplier | #442 saving | this saving | live stock | hosted residuals | +| --- | --- | --- | --- | --- | +| bit, m = 64 | 1.239085·10⁻³ | **1.332507·10⁻³** | 9,457 → 8,592 | 39,568 → 46,160 (12,496 split) | +| complex, m = 73 | 1.267453·10⁻³ | **1.437532·10⁻³** | 8,400 → 7,680 | 34,560 → 40,320 (13,720 split) | + +[PROOF.md](PROOF.md) gives the extension, its argument from #442's two facts, and its scope; §7 answers the trace note of #451, and `toy_two_family_check.py` checks the two-family program identity exactly in that note's model. + +## Verify + +```sh +python3 -B research/cross-copy-hosting/verify.py /absolute/new/output +``` + +- Python 3.11+ and the standard library only (scipy only for `--discover`, which recomputes `SELECTION.json`). +- The output directory must not exist. +- It runs #434's complete `verify.py` from scratch (about two minutes), then both generators, the independent audit + (twelve mutation controls) and the exact assembly, and compares every value with `EXPECTED.json`. + +## Scope and credits + +Conditional, like its parents. The new review point is the two-family slot; #442's data-stream hosting and all +inherited interfaces remain assumptions. No Lean proof or unconditional theorem is claimed. + +Builds on and runs unchanged: #442 (DaysSky, idle-axis hosting; its windows and bank tilings are reused), #434 (Rohan +Arun), #433 (icekylinx), #435/#417 (chafreaky), #426 (ai-nanachi), #425/#386 (Zhihao Chen), #370 (Dylan Crow), +Jacob Sussman's E8 unit and interfaces. The cross-copy selection, generators, audit and assembly were prepared with +Claude (Anthropic) assistance. diff --git a/research/cross-copy-hosting/SELECTION.json b/research/cross-copy-hosting/SELECTION.json new file mode 100644 index 0000000000..a153feb7e7 --- /dev/null +++ b/research/cross-copy-hosting/SELECTION.json @@ -0,0 +1,354 @@ +{ + "bit": { + "counts": [ + [ + 0, + 0, + 8, + 417 + ], + [ + 0, + 1, + 4, + 6 + ], + [ + 1, + 2, + 7, + 104 + ], + [ + 1, + 2, + 8, + 119 + ], + [ + 2, + 0, + 4, + 4 + ], + [ + 2, + 1, + 7, + 104 + ], + [ + 2, + 1, + 8, + 637 + ], + [ + 2, + 2, + 4, + 6 + ], + [ + 2, + 3, + 4, + 6 + ], + [ + 2, + 3, + 8, + 104 + ], + [ + 3, + 4, + 4, + 6 + ], + [ + 3, + 4, + 7, + 96 + ], + [ + 3, + 4, + 8, + 123 + ], + [ + 4, + 0, + 8, + 16 + ], + [ + 4, + 2, + 8, + 118 + ], + [ + 4, + 4, + 8, + 499 + ], + [ + 4, + 5, + 8, + 624 + ], + [ + 5, + 6, + 4, + 6 + ], + [ + 5, + 6, + 7, + 104 + ], + [ + 5, + 6, + 8, + 116 + ], + [ + 6, + 3, + 8, + 520 + ], + [ + 6, + 4, + 8, + 14 + ], + [ + 6, + 5, + 4, + 6 + ], + [ + 6, + 7, + 8, + 402 + ], + [ + 6, + 8, + 8, + 321 + ], + [ + 7, + 6, + 8, + 521 + ], + [ + 7, + 8, + 4, + 6 + ], + [ + 7, + 8, + 8, + 316 + ], + [ + 8, + 7, + 4, + 6 + ], + [ + 8, + 7, + 7, + 104 + ], + [ + 8, + 7, + 8, + 235 + ], + [ + 8, + 8, + 7, + 104 + ] + ], + "proxy_saving": 40958.72701043286 + }, + "complex": { + "counts": [ + [ + 0, + 0, + 9, + 213 + ], + [ + 1, + 2, + 9, + 106 + ], + [ + 2, + 1, + 9, + 213 + ], + [ + 3, + 2, + 9, + 106 + ], + [ + 4, + 3, + 9, + 426 + ], + [ + 5, + 4, + 9, + 106 + ], + [ + 6, + 0, + 9, + 78 + ], + [ + 6, + 2, + 9, + 348 + ], + [ + 7, + 4, + 9, + 106 + ], + [ + 8, + 0, + 9, + 269 + ], + [ + 8, + 1, + 9, + 23 + ], + [ + 8, + 4, + 9, + 348 + ], + [ + 9, + 6, + 9, + 106 + ], + [ + 10, + 1, + 9, + 324 + ], + [ + 10, + 5, + 9, + 316 + ], + [ + 11, + 6, + 9, + 106 + ], + [ + 12, + 3, + 9, + 134 + ], + [ + 12, + 5, + 9, + 87 + ], + [ + 12, + 7, + 9, + 347 + ], + [ + 14, + 6, + 9, + 348 + ], + [ + 14, + 8, + 9, + 78 + ], + [ + 15, + 5, + 9, + 157 + ], + [ + 15, + 8, + 9, + 269 + ], + [ + 16, + 7, + 9, + 213 + ], + [ + 17, + 8, + 9, + 213 + ] + ], + "proxy_saving": 43915.96552502435 + } +} diff --git a/research/cross-copy-hosting/TOY-EXPECTED.json b/research/cross-copy-hosting/TOY-EXPECTED.json new file mode 100644 index 0000000000..d994a0dd81 --- /dev/null +++ b/research/cross-copy-hosting/TOY-EXPECTED.json @@ -0,0 +1,96 @@ +{ + "status": "PASS_TWO_FAMILY_PROGRAM_IDENTITY", + "rows": [ + { + "whole_on_A": { + "factor_fixed": 90, + "program_equals_original": true + }, + "split_A_B": { + "factor_fixed": 54, + "program_equals_original": true + }, + "factors_differ_as_in_note": true, + "q": 3, + "m": 2, + "child_rank": 2, + "residual_width": 2, + "pieces": [ + 1, + 1 + ], + "dimension": 162 + }, + { + "whole_on_A": { + "factor_fixed": 810, + "program_equals_original": true + }, + "split_A_B": { + "factor_fixed": 486, + "program_equals_original": true + }, + "factors_differ_as_in_note": true, + "q": 3, + "m": 3, + "child_rank": 2, + "residual_width": 2, + "pieces": [ + 1, + 1 + ], + "dimension": 1458 + }, + { + "whole_on_A": { + "factor_fixed": 810, + "program_equals_original": true + }, + "split_A_B": { + "factor_fixed": 486, + "program_equals_original": true + }, + "factors_differ_as_in_note": true, + "q": 3, + "m": 3, + "child_rank": 3, + "residual_width": 2, + "pieces": [ + 1, + 1 + ], + "dimension": 1458 + }, + { + "split_A_B": { + "factor_fixed": 128, + "program_equals_original": true + }, + "q": 2, + "m": 4, + "child_rank": 3, + "residual_width": 4, + "pieces": [ + 2, + 2 + ], + "dimension": 512 + }, + { + "split_A_B": { + "factor_fixed": 324, + "program_equals_original": true + }, + "q": 3, + "m": 3, + "child_rank": 2, + "residual_width": 3, + "pieces": [ + 2, + 1 + ], + "dimension": 1458 + } + ], + "conclusion": "In the coordinate-exchange model the residual factor differs between placements (the trace note), but the complete program, factor(s) followed by the remainder children, equals the original children Gamma_A x Gamma_B for the whole-on-A placement and for the split placement alike; when w > r only the split exists." +} diff --git a/research/cross-copy-hosting/assemble_split.py b/research/cross-copy-hosting/assemble_split.py new file mode 100644 index 0000000000..f95ff71f18 --- /dev/null +++ b/research/cross-copy-hosting/assemble_split.py @@ -0,0 +1,82 @@ +"""Two exact moments for both hosted suppliers, fresh finite invoices with the hosted stock, and the strict outer +assembly of #434 (six bootstrap levels, 47 inequalities, next-grid and parameter controls). +usage: assemble.py PARENT_CHANGED_DIR BIT_DIR COMPLEX_DIR AUDIT.json OUT.json""" +import gzip, hashlib, importlib.util, json, math, sys +from fractions import Fraction as Q +from pathlib import Path +par, bd, cd, ap, outp = map(Path, sys.argv[1:6]) +def load(name): + sp = importlib.util.spec_from_file_location('hosted_' + name, par / 'work/pr361/code/engines' / (name + '.py')) + mod = importlib.util.module_from_spec(sp); sp.loader.exec_module(mod); return mod +M, Other, Outer = load('moment'), load('base_two_moment'), load('outer') +audit = json.loads(ap.read_text()); bg = json.loads((bd / 'GLOBAL.json').read_text()); ch = json.loads((cd / 'HOSTED.json').read_text()) +assert audit['bit_template_sha256'] == bg['template_sha256'] and audit['complex_template_sha256'] == ch['template_sha256'] +# ---------------- bit: two moments and the parent's invoice formulas with the hosted stock +P = {int(r): n for r, n in audit['bit_profile'].items()}; m, W = 64, audit['bit_live']; E = sum(P.values()) +geo = json.loads((par / 'bit426-source-centres/global/GEOMETRY.json').read_text()) +pg = json.loads((par / 'bit426-source-centres/global/GLOBAL.json').read_text()) +T, L, R, V, K = 8, 9, 747, 120, 4 +mass = sum(r * z for r, z in P.items()); assert m * W - mass == 2496 +physical = W + 9; d = m * m; N = 2 * m +unit = L * T * pg['local_additions'] + pg['bridge_additions'] +J = 8 * T * L * (2 * V + R) + 8 * (2 * K * V * T) + 2 * L * T * R + 2 * pg['copy_erase_episodes'] # every helper route charged (bank or hosted) +high = 16 * (d + 1) ** 2; good = 8 * m * m + 8; compiler = 128 * N ** 3 +selectors = 2 * L * T * ((W - 1) + R * m * (geo['max_route_factors'] + 3 + (m - 1) + m)) # +3: hosted route may add a slot permutation, U_q and a cross-copy split +prefix = int(pg['global_prefix_bound']); charged_prefix = 64 * ((prefix.bit_length() + 63) // 64) +coefficient = unit + J * high + J * physical + E * (good + compiler) + 16 * m ** 3 + pg['copy_erase_episodes'] + selectors + prefix + 1 +two = (coefficient + 1) ** 2 * (E + 1) ** 2; charged_two = 64 * ((two.bit_length() + 63) // 64) +assert two < 1 << charged_two and 2 * max(P) ** 2 < m * m +row = 2 * (m * m + 1) + 9909 + 252; assert row == 18355 < 20161 +root = M.certify(P, m, W, True); c = Q(root['lower']); chi = Q(root['upper']) +fb = 32 * m * m * E +lo, hi = Other.moment(m, W, list(P.items()), c); bl, bh = Other.moment(m, W, [(1, fb)], c); assert hi + bh / 10 ** 16 < 1 +lo2, hi2 = Other.moment(m, W, list(P.items()), chi); bl2, bh2 = Other.moment(m, W, [(1, fb)], chi); assert lo2 + bl2 / 10 ** 16 > 1 +# ---------------- complex: two moments and the parent's invoice with the hosted stock +PC = {int(r): n for r, n in audit['complex_profile'].items()}; mc, WC = 73, audit['complex_live']; EC = sum(PC.values()) +massc = sum(r * z for r, z in PC.items()); assert mc * WC - massc == 2496 +rc = M.certify(PC, mc, WC, True); b = Q(int(Q(rc['lower']) * 10 ** 18), 10 ** 18) +fbc = 32 * mc * mc * EC +l3, h3 = Other.moment(mc, WC, list(PC.items()), b); b3, bh3 = Other.moment(mc, WC, [(1, fbc)], b); assert h3 + bh3 / 10 ** 16 < 1 +integ = json.loads((par / 'split-centres/INTEGRATION.json').read_text()); inv = integ['finite_invoice'] +physc = ch['physical']; Rc = 560; v = 120 +compilerc = 64 * (mc + 1) ** 3 +pervertex = inv['pervertex'] - integ['physical'] * (64 + 1) + physc * (64 + 1) - integ['live'] + WC # stock-dependent terms re-based +r_ = mc // 2; group = 2 ** (r_ * r_) * math.prod(2 ** (2 * i) - 1 for i in range(1, r_ + 1)); stock = group * physc +smass = group * massc; logical = group * max(pervertex, inv['pervertex']) + 64; router = compilerc * (logical + 1) * (stock + 1) ** 2 +GG, EE, C0 = 1 << 30000, 1 << 100000, 1 << 210000; BB = smass + EE +literal = 2 * GG * stock ** 2 + 8 * smass + 4 * stock + 4 + 32 * mc +assert logical < 1 << 6050 and router < GG and literal < EE and BB < 1 << 100001 and 32 * mc * BB * BB < C0 and 2 * BB + 18 < C0 +depth = 2; assert mc ** depth > 2 * max(PC) ** depth +rowc = depth * stock.bit_length() + 9909 + 252; assert rowc < 20161 +# ---------------- outer assembly exactly as #434's combined.py +eta = beta = Q(1, 10 ** 18); grid = Q(1, 10 ** 18); s = min(c, (1 - beta) * b) - Q(1, 10 ** 24) +assert 0 < s < c and s < (1 - beta) * b +chain = [Q(384599, 10 ** 10)]; cutoffs = [] +def ceil(x): return -((-x.numerator) // x.denominator) +for j in range(6): + old = chain[-1]; a = (1 - s) * s + s * old + gap = min(s - a, 1 - a - s, 1 - a - s * (1 - old), 1 - s); assert old < a < s < 1 - a and gap > 0 + cutoff = max(ceil(36 / gap ** 2), ceil(2 * (4 + charged_two) / gap)); assert cutoff * gap ** 2 >= 36 and cutoff * gap >= 2 * (4 + charged_two) + cutoffs.append(dict(gap=str(gap), cutoff_log2=str(cutoff))); chain.append(a) +q = chain[-1] * (1 - 2 * eta); margin = (1 - eta) * q / (1 + q); ticks = margin / grid; k = grid * ((ticks.numerator - 1) // ticks.denominator) +bridge = {'semantic': {'C0': {'base': 2, 'exponent': 210000}, 'strict_literal_gap': 1}, 'rows': {'degree_gap': Q(10 ** 6) - Q(51 * 20161, 25)}} +a = Outer.assembly(chain[-1], b, bridge, k, eta=eta, beta=beta) +assert len(a['strict_constraints']) == 47 and all(x > 0 for x in a['strict_constraints'].values()) +controls = [] +for name, kk, ee, bb in [('next_grid', k + grid, eta, beta), ('zero_eta', k, Q(0), beta), ('zero_beta', k, eta, Q(0)), ('unit_beta', k, eta, Q(1))]: + try: Outer.assembly(chain[-1], b, bridge, kk, eta=ee, beta=bb) + except AssertionError: controls.append(name) + else: raise AssertionError(name) +parent_k = Q(566550276142217, 500000000000000000) +res = dict(status='PASS_CONDITIONAL_CROSS_COPY_HOSTING_ASSEMBLY', kappa=str(k), kappa_decimal=format(float(k), '.18f'), + bit_lower=str(c), complex_lower=str(b), binding_component='bit' if c < (1 - beta) * b else 'complex', + gain_over_pr434_percent=float(100 * (k / parent_k - 1)), + bit=dict(live=W, physical=physical, maxchild=max(P), rank_mass=mass, hosted_residuals=audit['bit_hosted_residuals'], + prefix_bits=prefix.bit_length(), charged_prefix_bits=charged_prefix, coefficient_bits=coefficient.bit_length(), + two_level_coefficient_bits=two.bit_length(), charged_two_level_coefficient_bits=charged_two, row_coefficient=row), + complex=dict(live=WC, physical=physc, maxchild=max(PC), rank_mass=massc, hosted_residuals=audit['complex_hosted_residuals'], + physical_stock_bits=stock.bit_length(), router_bits=router.bit_length(), literal_bits=literal.bit_length(), row_coefficient=rowc), + strict_outer_constraints={n: str(x) for n, x in a['strict_constraints'].items()}, outer_controls=controls, bootstrap=cutoffs, + bit_template_sha256=bg['template_sha256'], complex_template_sha256=ch['template_sha256']) +outp.write_text(json.dumps(res, indent=2) + '\n') +print(res['status'], res['kappa_decimal'], 'binding', res['binding_component'], 'gain over #434 %.4f%%' % res['gain_over_pr434_percent']) diff --git a/research/cross-copy-hosting/audit_split.py b/research/cross-copy-hosting/audit_split.py new file mode 100644 index 0000000000..ce80cf4e1d --- /dev/null +++ b/research/cross-copy-hosting/audit_split.py @@ -0,0 +1,158 @@ +"""Independent audit of the two cross-copy hosted templates (no code shared with the generators). +Re-derives the windows from each template's schedule and checks, per replica and invocation: every helper residual has +exactly one owner record; a hosted residual's pieces (one or two) lie on data families of the idle child they name, +inside that child's pending coordinates, on copies of the same child, with piece widths summing to the residual width, +pairwise disjoint per (child, copy), with the invocation strictly inside the window and off the active pair; remainder +children exact; banks tiled exactly (bit) or padded (complex); profile, live stock and deficit 2496 recomputed. +usage: audit_split.py PARENT_CHANGED_DIR BIT_DIR COMPLEX_DIR OUT.json""" +import copy, gzip, hashlib, json, sys +from collections import Counter, defaultdict +from pathlib import Path +V, K, T, L = 120, 4, 8, 9 +DATA = 2 * K * V * T +def wins(events): + last = {}; seen = []; w = {} + for pos, e in enumerate(events): + if e[0] == 'local': seen.append((pos, e[1], e[2])); last[e[2]] = pos + elif e[0] == 'bridge': last[e[1]] = pos; last[e[2]] = pos + else: + lo = last.get(e[2], -1); w[e[1]] = {s for q, s, p in seen if lo < q < pos and p != e[2]} + return w +def check_pieces(hs, W, rank, widths, copies): + used = defaultdict(set); hosted = {} + for s, h, i, segs in hs['pieces']: + assert s in W[i], ('window', i, s); assert 1 <= len(segs) <= 2 + assert sum(w for _, _, w in segs) == widths[h] and all(w > 0 for _, _, w in segs) + for cp, off, w in segs: + assert 0 <= cp < copies and 0 <= off and off + w <= rank[i] + cells = set(range(off, off + w)); assert not cells & used[i, cp], ('overlap', i, cp); used[i, cp] |= cells + assert (s, h) not in hosted; hosted[s, h] = (i, segs) + return used, hosted +def audit_bit(t, parent_t, widths): + assert t['local_programs'] == parent_t['local_programs'] and len(t['calls']) == 72 + ev = []; rank = {}; pair = {} + for e in t['schedule']: + if e['kind'] == 'local_cover_sweep': ev.append(('local', e['stage'], e['pair'])) + elif e['kind'] == 'bridge': ev.append(('bridge', e['dst'], e['src'])) + elif e['kind'] == 'idle': ev.append(('idle', e['idx'], e['pair'])); rank[e['idx']] = e['rank']; pair[e['idx']] = e['pair'] + W = wins(ev); hs = t['hosting'] + used, hosted = check_pieces(hs, W, rank, widths, 2 * V) + rem = {} + for i in rank: + if rank[i] == 0: continue + for cp in range(2 * V): rem[i, cp] = rank[i] - len(used[i, cp]) + rr = Counter(rem[i, cp] for cp in range(2 * V)) + if str(i) in hs['remainders']: assert {int(k): v for k, v in hs['remainders'][str(i)].items()} == dict(rr) + else: assert rr == Counter({rank[i]: 2 * V}) + occ = defaultdict(set); LIVE = t['live'] + for c in t['calls']: + s, rep, p = c['stage'], c['replica'], c['pair']; own = c['owners']; assert len(own) == 2 * V + len(widths) + assert own[:2 * V] == next(q for q in parent_t['calls'] if (q['stage'], q['replica']) == (s, rep))['owners'][:2 * V] + for h, (f, r) in enumerate(own[2 * V:]): + if (s, h) in hosted: + i, segs = hosted[s, h]; fam = lambda cp: rep * 960 + (2 * pair[i] + cp // V) * V + cp % V + assert pair[i] != p + if len(segs) == 1: + cp, off, w = segs[0]; assert r == ['hosted', i, off, w] and f == fam(cp) + else: + (c1, o1, w1), (c2, o2, w2) = segs; assert c1 != c2 + assert r == ['hosted-split', i, o1, w1, fam(c2), o2, w2] and f == fam(c1) + else: + assert r[0] == 'bank' and r[2] == widths[h] and DATA <= f < LIVE + cells = set(range(r[1], r[1] + r[2])); assert cells <= set(range(64)) and not cells & occ[f]; occ[f] |= cells + banks = sorted(occ); assert banks == list(range(DATA, LIVE)) and all(occ[f] == set(range(64)) for f in banks) + paid = Counter() + for c in t['calls']: + for z in t['local_programs'][c['orientation']]: + if z[0] == 0 and z[4]: paid[z[4]] += 1 + if z[0] == 2: paid[z[5]] += 1 + for (i, cp), r_ in rem.items(): + if r_: paid[r_] += T + mass = sum(r * n for r, n in paid.items()); assert 64 * LIVE - mass == 2496 + assert 64 * 64 > 2 * max(paid) ** 2 + return paid, len(hosted) * T, sum(1 for _, segs in hosted.values() if len(segs) == 2) * T +def audit_complex(t, parent_t, local_checks): + R = 560; m = 73 + assert t['local_programs'] == parent_t['local_programs'] and len(t['calls']) == 72 + prank = {} + for it in parent_t['idle_children']: prank.setdefault(it['child'], it['rank']) + stage_pair = {e['stage']: e['pair'] for e in t['recipe'] if e['kind'] == 'local'} + ev = []; side = {}; pairs = {} + for e in t['execution_schedule']: + if e['kind'] == 'local_cover_sweep': ev.append(('local', e['stage'], stage_pair[e['stage']])) + elif e['kind'] == 'bridge': ev.append(('bridge', e['dst'], e['src'])) + elif e['kind'] == 'idle_cover_sweep': + for sd, ch in enumerate(e['child_indices']): + if ch in prank: ev.append(('idle', ch, e['pair'])); side[ch] = sd; pairs[ch] = e['pair'] + W = wins(ev); hs = t['hosting'] + used, hosted = check_pieces(hs, W, prank, [9] * R, V) + rem = {} + for it in parent_t['idle_children']: rem[it['child'], it['port']] = it['rank'] - len(used[it['child'], it['port']]) + got = {(it['child'], it['port']): it['rank'] for it in t['idle_children']} + assert got == {k: r for k, r in rem.items() if r} and all(it['replicas'] == T for it in t['idle_children']) + LIVE = t['live']; occ = defaultdict(set) + for c in t['calls']: + s, rep, p = c['stage'], c['replica'], c['pair']; own = c['owners']; assert len(own) == 2 * V + R + assert own[:2 * V] == next(q for q in parent_t['calls'] if (q['stage'], q['replica']) == (s, rep))['owners'][:2 * V] + for h, (f, r) in enumerate(own[2 * V:]): + if (s, h) in hosted: + i, segs = hosted[s, h]; fam = lambda port: rep * 960 + (2 * pairs[i] + side[i]) * V + port + assert pairs[i] != p + if len(segs) == 1: + port, off, w = segs[0]; assert r == [3, i, off] and f == fam(port) and w == 9 + else: + (p1, o1, w1), (p2, o2, w2) = segs; assert p1 != p2 + assert r == [5, i, o1, w1, fam(p2), o2, w2] and f == fam(p1) + else: + assert r[0] == 2 and 0 <= r[1] < 8 and DATA <= f < LIVE and r[1] not in occ[f]; occ[f].add(r[1]) + banks = sorted(occ); assert banks == list(range(DATA, LIVE)) + paid = Counter() + for c in t['calls']: + for r_, z in local_checks[c['orientation']]['paid_profile'].items(): paid[int(r_)] += z + for (ch, port), r_ in rem.items(): + if r_: paid[r_] += T + for f in banks: paid[m - 9 * len(occ[f])] += 1 + mass = sum(r * n for r, n in paid.items()); assert m * LIVE - mass == 2496 + assert m * m > 2 * max(paid) ** 2 + return paid, len(hosted) * T, sum(1 for _, segs in hosted.values() if len(segs) == 2) * T +def main(): + par, bd, cd, outp = map(Path, sys.argv[1:5]) + pbt = json.loads(gzip.decompress((par / 'bit426-source-centres/global/GLOBAL-TEMPLATE.json.gz').read_bytes())) + bt = json.loads(gzip.decompress((bd / 'GLOBAL-TEMPLATE.json.gz').read_bytes())); bg = json.loads((bd / 'GLOBAL.json').read_text()) + assert hashlib.sha256(gzip.decompress((bd / 'GLOBAL-TEMPLATE.json.gz').read_bytes())).hexdigest() == bg['template_sha256'] + st = json.loads((par / 'bit426-source-centres/records/249-states.json').read_text()) + fs = json.loads((par / 'bit426-source-centres/records/frames.json').read_text())['frames'] + widths = [8 - fs[str(st['initial'][str(i)])]['dim'] for i in range(240, 987)] + pct = json.loads(gzip.decompress((par / 'split-centres/GLOBAL-TEMPLATE.json.gz').read_bytes())) + ct = json.loads(gzip.decompress((cd / 'GLOBAL-TEMPLATE.json.gz').read_bytes())); ch = json.loads((cd / 'HOSTED.json').read_text()) + assert hashlib.sha256(gzip.decompress((cd / 'GLOBAL-TEMPLATE.json.gz').read_bytes())).hexdigest() == ch['template_sha256'] + lc = json.loads((par / 'split-centres/LOCAL-CHECKS.json').read_text()) + bp, bh, bs = audit_bit(bt, pbt, widths); assert bp == Counter({int(k): v for k, v in bg['profile'].items()}) + cp, chh, cs = audit_complex(ct, pct, lc); assert cp == Counter({int(k): v for k, v in ch['global_profile'].items()}) + controls = [] + def reject(name, fn, which): + q = copy.deepcopy(bt if which == 'bit' else ct); fn(q) + try: (audit_bit(q, pbt, widths) if which == 'bit' else audit_complex(q, pct, lc)) + except (AssertionError, KeyError, IndexError, StopIteration, ValueError): controls.append(name) + else: raise AssertionError('mutation accepted: ' + name) + def first_split(q): return next(pc for pc in q['hosting']['pieces'] if len(pc[3]) == 2) + def outside(q): + pc = q['hosting']['pieces'][0]; pc[0] = next(s for s in range(9) if s not in q['hosting']['windows'][str(pc[2])][2]) + reject('bit: hosted residual outside its window', outside, 'bit') + reject('bit: split piece widths do not sum to the residual width', lambda q: first_split(q)[3][1].__setitem__(2, first_split(q)[3][1][2] + 1), 'bit') + reject('bit: split pieces on two different children', lambda q: (lambda pc: q['hosting']['pieces'].__setitem__(q['hosting']['pieces'].index(pc), [pc[0], pc[1], (pc[2] + 1) % 9 if (pc[2] + 1) % 9 in [int(k) for k in q['hosting']['windows']] else 0, pc[3]]))(first_split(q)), 'bit') + reject('bit: overlapping hosted coordinates', lambda q: q['hosting']['pieces'][1][3][0].__setitem__(1, q['hosting']['pieces'][0][3][0][1]) if q['hosting']['pieces'][1][3][0][0] == q['hosting']['pieces'][0][3][0][0] and q['hosting']['pieces'][1][2] == q['hosting']['pieces'][0][2] else q['hosting']['pieces'][1][3][0].__setitem__(0, q['hosting']['pieces'][0][3][0][0]) or q['hosting']['pieces'][1][3][0].__setitem__(1, q['hosting']['pieces'][0][3][0][1]), 'bit') + reject('bit: understated live stock', lambda q: q.__setitem__('live', q['live'] - 1), 'bit') + reject('bit: hosted owner on the active pair', lambda q: q['calls'][0]['owners'].__setitem__(240 + next(h for h in range(747) if q['calls'][0]['owners'][240 + h][1][0] == 'hosted'), [0, ['hosted', 0, 0, 8]]), 'bit') + reject('bit: missing remainder child', lambda q: q['hosting']['pieces'].pop(), 'bit') + reject('complex: hosted residual outside its window', outside, 'complex') + reject('complex: split piece widths do not sum to nine', lambda q: first_split(q)[3][0].__setitem__(2, first_split(q)[3][0][2] + 1), 'complex') + reject('complex: remainder child understated', lambda q: q['idle_children'][0].__setitem__('rank', q['idle_children'][0]['rank'] - 1), 'complex') + reject('complex: dropped bank', lambda q: q.__setitem__('live', q['live'] - 1), 'complex') + reject('complex: duplicated hosted residual', lambda q: q['hosting']['pieces'].append(list(q['hosting']['pieces'][0])), 'complex') + res = dict(status='PASS_INDEPENDENT_CROSS_COPY_HOSTING_AUDIT', bit_template_sha256=bg['template_sha256'], complex_template_sha256=ch['template_sha256'], + bit_profile={str(k): v for k, v in sorted(bp.items())}, complex_profile={str(k): v for k, v in sorted(cp.items())}, + bit_live=bt['live'], complex_live=ct['live'], bit_hosted_residuals=bh, complex_hosted_residuals=chh, + bit_split_residuals=bs, complex_split_residuals=cs, bit_maxchild=max(bp), complex_maxchild=max(cp), mutations_rejected=controls) + outp.write_text(json.dumps(res, indent=2) + '\n'); print(json.dumps({k: v for k, v in res.items() if 'profile' not in k})) +if __name__ == '__main__': main() diff --git a/research/cross-copy-hosting/bit_split.py b/research/cross-copy-hosting/bit_split.py new file mode 100644 index 0000000000..3e0f80d3d3 --- /dev/null +++ b/research/cross-copy-hosting/bit_split.py @@ -0,0 +1,133 @@ +"""Cross-copy idle-axis hosting for #434's compressed nine-stage bit template (m=64), on top of #442's windows. +Every residual of a child is laid along the concatenated pending sets of that child's 240 copies; a residual may be +split across two copies (two data families of the same child, same window). Unhosted residuals keep #442's exact +width-64 bank tiling. usage: bit_split.py PARENT_GLOBAL_DIR LOCAL_CHECK_DIR OUT [--discover]""" +import gzip, hashlib, json, sys, time +from collections import Counter +from pathlib import Path +HERE = Path(__file__).resolve().parent; sys.path.insert(0, str(HERE)) +import tape_core as TC +H, V, R, L, K, T, M = 8, 120, 747, 9, 4, 8, 64 +DATA = 2 * K * V * T +DISCOVER = False +def tiling_vars(stages): return [('a', s) for s in stages] + [('b', s) for s in stages] + [('c', s) for s in stages] +def tiling_rows(index, n, avail, win): + import numpy as np + rows = [] + stages = sorted({s for (s, _) in avail}) + for s in stages: + # leftover7 = avail7 - sum n7 = 8 a ; leftover4 = 2 b ; leftover8 - a - 7b = 8 c + for w, name, g in ((7, 'a', 8), (4, 'b', 2)): + row = np.zeros(n) + for key, j in index.items(): + if isinstance(key, tuple) and len(key) == 3 and key[0] in win and key[1] == s and key[2] == w: row[j] = 1 + row[index[(name, s)]] = g; rows.append((row, avail.get((s, w), 0), avail.get((s, w), 0))) + row = np.zeros(n) + for key, j in index.items(): + if isinstance(key, tuple) and len(key) == 3 and key[0] in win and key[1] == s and key[2] == 8: row[j] = 1 + row[index[('a', s)]] = 1; row[index[('b', s)]] = 7; row[index[('c', s)]] = 8 + rows.append((row, avail[(s, 8)], avail[(s, 8)])) + return rows +def main(parent, local, out): + t0 = time.monotonic(); out.mkdir(parents=True, exist_ok=False) + blob = gzip.decompress((parent / 'GLOBAL-TEMPLATE.json.gz').read_bytes()); t = json.loads(blob) + g = json.loads((parent / 'GLOBAL.json').read_text()); assert hashlib.sha256(blob).hexdigest() == g['template_sha256'] + st = json.loads((local / 'records/249-states.json').read_text()) + fs = json.loads((local / 'records/frames.json').read_text())['frames']; dims = {int(f): z['dim'] for f, z in fs.items()} + width = [H - dims[st['initial'][str(i)]] for i in range(2 * V, 2 * V + R)] + sched = []; idx = 0 + for e in t['schedule']: + if e['kind'] == 'local_cover_sweep': sched.append(dict(kind='local', stage=e['stage'], pair=e['pair'])) + elif e['kind'] == 'bridge': sched.append(dict(kind='bridge', dst=e['dst'], src=e['src'])) + elif e['kind'] == 'idle': sched.append(dict(kind='idle', pair=e['pair'], rank=e['rank'], idx=idx)); e['idx'] = idx; idx += 1 + win = {k: x for k, x in TC.windows(sched).items() if x[1] > 0 and x[2]} + avail = Counter() + for s in range(L): + for w in width: avail[s, w] += 1 + sel = HERE / 'SELECTION.json'; key = 'bit' + if DISCOVER: + counts, val = TC.solve(win, 2 * V, dict(avail), M, sorted({w for (_, w) in avail}, reverse=True), dict(vars=tiling_vars, rows=tiling_rows)) + TC.save(sel, key, counts, val) + counts, val = TC.load(sel, key) + helpers = {s: [(h, width[h]) for h in range(R)] for s in range(L)} + pieces, rem = TC.expand(win, counts, helpers, 2 * V) + left = {s: [h for h in range(R) if (s, h) not in pieces] for s in range(L)} + nb = {}; place = {} + for s in range(L): + wl = {h: width[h] for h in left[s]} + slotsS = sorted(((wl[h], rep, h) for rep in range(T) for h in left[s]), key=lambda x: (-x[0], x[1], x[2])) + by = {} + for w_, rep, h in slotsS: by.setdefault(w_, []).append((rep, h)) + bins = [] + def take(w_): return by[w_].pop(0) + while by.get(7): + cont = []; off = 0 + for _ in range(8): rep, h = take(7); cont.append((rep, h, off, 7)); off += 7 + rep, h = take(8); cont.append((rep, h, off, 8)); off += 8; assert off == 64; bins.append(cont) + while by.get(4): + cont = []; off = 0 + for _ in range(2): rep, h = take(4); cont.append((rep, h, off, 4)); off += 4 + for _ in range(7): rep, h = take(8); cont.append((rep, h, off, 8)); off += 8 + assert off == 64; bins.append(cont) + while by.get(8): + cont = []; off = 0 + for _ in range(8): rep, h = take(8); cont.append((rep, h, off, 8)); off += 8 + bins.append(cont) + assert not any(by.values()) + nb[s] = len(bins) + for b, cont in enumerate(bins): + for rep, h, off, w_ in cont: place[s, rep, h] = (b, off, w_) + base = [DATA] + for s in range(L): base.append(base[-1] + nb[s]) + LIVE = base[-1] + split = 0 + for c in t['calls']: + s, rep, p = c['stage'], c['replica'], c['pair']; own = c['owners'][:2 * V] + for h in range(R): + if (s, h) in pieces: + i, segs = pieces[s, h]; pair = win[i][0] + fam = lambda cp: rep * 960 + (2 * pair + cp // V) * V + cp % V + if len(segs) == 1: + cp, off, w = segs[0]; own.append([fam(cp), ['hosted', i, off, w]]) + else: + (c1, o1, w1), (c2, o2, w2) = segs; own.append([fam(c1), ['hosted-split', i, o1, w1, fam(c2), o2, w2]]); split += 1 + else: + b, off, w = place[s, rep, h]; own.append([base[s] + b, ['bank', off, w]]) + assert len({(f, tuple(r)) for f, r in own}) == 2 * V + R and all(0 <= f < LIVE for f, r in own) + c['owners'] = own + paid = Counter() + for c in t['calls']: + for z in t['local_programs'][c['orientation']]: + if z[0] == 0 and z[4]: paid[z[4]] += 1 + if z[0] == 2: paid[z[5]] += 1 + remainder = {} + for e in t['schedule']: + if e['kind'] == 'idle' and e['rank']: + i = e['idx'] + if i in win: + rr = Counter(rem[i, cp] for cp in range(2 * V)); remainder[i] = {str(k): v for k, v in sorted(rr.items())} + for r_, n in rr.items(): + if r_: paid[r_] += n * T + else: paid[e['rank']] += 2 * V * T + mass = sum(r * n for r, n in paid.items()); assert M * LIVE - mass == 2496, M * LIVE - mass + t.update(version='compressed-nine-e8-bit-v1+idle-axis-hosting+cross-copy', live=LIVE, + hosting=dict(windows={str(i): [w[0], w[1], sorted(w[2])] for i, w in win.items()}, + pieces=[[s, h, i, [list(x) for x in segs]] for (s, h), (i, segs) in sorted(pieces.items())], + remainders=remainder, banks_per_stage=nb, + rule='helper (stage s, helper h) of replica r owns, on the pending idle-child projector of child i, the ' + 'coordinates [off, off+w) of data family r*960+(2*pair+side)*120+port for each piece (copy = side*120+port); ' + 'a residual has one or two pieces, on two copies of the same child; s lies strictly between the last ' + 'local/bridge touch of that pair and the child; the child keeps the remaining coordinates.'), + helper_route='bank owner (exact width-64 tiling of the unhosted residuals of each stage) or hosted owner (one or two data families of one idle child, pending idle coordinates)') + tb = json.dumps(t, separators=(',', ':'), sort_keys=True).encode(); (out / 'GLOBAL-TEMPLATE.json.gz').write_bytes(gzip.compress(tb, mtime=0)) + res = dict(g); res.update(status='PASS_CROSS_COPY_HOSTED_BIT_TEMPLATE', live=LIVE, physical=LIVE + 9, template_sha256=hashlib.sha256(tb).hexdigest(), + parent_template_sha256=g['template_sha256'], profile=dict(sorted(paid.items())), paid_calls=sum(paid.values()), rank_mass=mass, + maxchild=max(paid), banks_per_stage_hosted=nb, hosted_residuals_per_replica=len(pieces), hosted_residuals=len(pieces) * T, + split_residuals=split, hosted_coordinates_per_replica=sum(sum(w for _, _, w in segs) for _, segs in pieces.values()), + saved_idle_cost_proxy=val, seconds=time.monotonic() - t0) + res['bank_assignments'] = sum(1 for c in t['calls'] for f, r in c['owners'][2 * V:] if r[0] == 'bank') + (out / 'GLOBAL.json').write_text(json.dumps(res, indent=2) + '\n') + print(json.dumps({k: res[k] for k in ('live', 'maxchild', 'hosted_residuals', 'split_residuals', 'banks_per_stage_hosted', 'rank_mass', 'profile')}), flush=True) +if __name__ == '__main__': + DISCOVER = '--discover' in sys.argv; args = [a for a in sys.argv[1:] if a != '--discover'] + main(Path(args[0]), Path(args[1]), Path(args[2])) diff --git a/research/cross-copy-hosting/complex_split.py b/research/cross-copy-hosting/complex_split.py new file mode 100644 index 0000000000..4de0d0123c --- /dev/null +++ b/research/cross-copy-hosting/complex_split.py @@ -0,0 +1,87 @@ +"""Cross-copy idle-axis hosting for #433's compressed nine-stage complex template (m=73, R=560, rank-nine residuals), +on top of #442's windows. Residuals of a child are laid along the concatenated pending sets of its 120 port copies; +a residual may be split across two ports (two data families of the same child, same window). Unhosted residuals are +re-tiled eight per bank with one paid pad. usage: complex_split.py SPLIT_CENTRES_DIR OUT [--discover]""" +import gzip, hashlib, json, sys, time +from collections import Counter +from pathlib import Path +HERE = Path(__file__).resolve().parent; sys.path.insert(0, str(HERE)) +import tape_core as TC +V, K, T, L, M, R = 120, 4, 8, 9, 73, 560 +DATA = 2 * K * V * T +DISCOVER = False +def main(src, out): + t0 = time.monotonic(); out.mkdir(parents=True, exist_ok=False) + blob = gzip.decompress((src / 'GLOBAL-TEMPLATE.json.gz').read_bytes()); t = json.loads(blob) + integ = json.loads((src / 'INTEGRATION.json').read_text()); checks = json.loads((src / 'LOCAL-CHECKS.json').read_text()) + assert hashlib.sha256(blob).hexdigest() == integ['global_template_sha256'] and t['live'] == integ['live'] + rank = {} + for it in t['idle_children']: + assert it['replicas'] == T; rank.setdefault(it['child'], it['rank']); assert rank[it['child']] == it['rank'] + pair_of_stage = {e['stage']: e['pair'] for e in t['recipe'] if e['kind'] == 'local'} + sched = []; side_of = {}; pair_of = {} + for e in t['execution_schedule']: + if e['kind'] == 'local_cover_sweep': sched.append(dict(kind='local', stage=e['stage'], pair=pair_of_stage[e['stage']])) + elif e['kind'] == 'bridge': sched.append(dict(kind='bridge', dst=e['dst'], src=e['src'])) + elif e['kind'] == 'idle_cover_sweep': + for sd, ch in enumerate(e['child_indices']): + if ch in rank: + sched.append(dict(kind='idle', pair=e['pair'], rank=rank[ch], idx=ch)); side_of[ch] = sd; pair_of[ch] = e['pair'] + win = {k: x for k, x in TC.windows(sched).items() if x[1] > 0 and x[2]} + avail = {(s, 9): R for s in range(L)} + sel = HERE / 'SELECTION.json'; key = 'complex' + if DISCOVER: + counts, val = TC.solve(win, V, avail, M, [9], dict(vars=lambda st: [], rows=lambda *a: [])) + TC.save(sel, key, counts, val) + counts, val = TC.load(sel, key) + pieces, rem = TC.expand(win, counts, {s: [(h, 9) for h in range(R)] for s in range(L)}, V) + base = [DATA]; tile = {}; partial = Counter() + for s in range(L): + left = [(rep, h) for rep in range(T) for h in range(R) if (s, h) not in pieces] + for z, (rep, h) in enumerate(left): tile[s, rep, h] = divmod(z, 8) + nb = -(-len(left) // 8); base.append(base[-1] + nb) + if len(left) % 8: partial[M - 9 * (len(left) % 8)] += 1 + partial[M - 72] += len(left) // 8 + W = base[-1]; split = 0 + for c in t['calls']: + s, rep, p = c['stage'], c['replica'], c['pair']; own = c['owners'][:2 * V] + for h in range(R): + if (s, h) in pieces: + i, segs = pieces[s, h]; fam = lambda port: rep * 960 + (2 * pair_of[i] + side_of[i]) * V + port + if len(segs) == 1: + port, off, w = segs[0]; own.append([fam(port), [3, i, off]]) + else: + (p1, o1, w1), (p2, o2, w2) = segs; own.append([fam(p1), [5, i, o1, w1, fam(p2), o2, w2]]); split += 1 + else: + b, sl = tile[s, rep, h]; own.append([base[s] + b, [2, sl]]) + assert len({(f, tuple(r)) for f, r in own}) == 2 * V + R and all(f < W for f, r in own) + c['owners'] = own + paid = Counter() + for c in t['calls']: + for r_, z in checks[c['orientation']]['paid_profile'].items(): paid[int(r_)] += z + newidle = [] + for it in t['idle_children']: + ch, port = it['child'], it['port']; rr = rem.get((ch, port), it['rank']) if ch in win else it['rank'] + if rr: newidle.append(dict(child=ch, port=port, rank=rr, hosted=it['rank'] - rr, replicas=T)); paid[rr] += T + for r_, n in partial.items(): paid[r_] += n + mass = sum(r * n for r, n in paid.items()); D = M * W - mass; assert D == 2496, D + t.update(version='hamming-mutable-basis-nine-v1+idle-axis-hosting+cross-copy', live=W, idle_children=newidle, + physical=W + R + (integ['physical'] - integ['live'] - R), + hosting=dict(windows={str(i): [w[0], w[1], sorted(w[2])] for i, w in win.items()}, sides=side_of, pairs=pair_of, + pieces=[[s, h, i, [list(x) for x in segs]] for (s, h), (i, segs) in sorted(pieces.items())], + banks=[base[s + 1] - base[s] for s in range(L)])) + t['bank_padding']['families'] = list(range(DATA, W)); t['cover_final_correction']['families'] = [0, W] + t['cover_final_correction']['charged_calls_per_cover'] = W + for e in t['execution_schedule']: + if e['kind'] == 'bank_padding_cover_sweep': e['families'] = [DATA, W] + elif e['kind'] == 'translate_every_live_family': e.update(t['cover_final_correction']) + tb = json.dumps(t, sort_keys=True, separators=(',', ':')).encode(); (out / 'GLOBAL-TEMPLATE.json.gz').write_bytes(gzip.compress(tb, mtime=0)) + res = dict(status='PASS_CROSS_COPY_HOSTED_COMPLEX_TEMPLATE', parent_template_sha256=integ['global_template_sha256'], + template_sha256=hashlib.sha256(tb).hexdigest(), live=W, physical=t['physical'], global_profile=dict(sorted(paid.items())), + rank_mass=mass, deficit=D, maxchild=max(paid), hosted_residuals=len(pieces) * T, split_residuals=split, + banks_per_stage=t['hosting']['banks'], saved_cost_proxy=val, seconds=time.monotonic() - t0) + (out / 'HOSTED.json').write_text(json.dumps(res, indent=2) + '\n') + print(json.dumps({k: res[k] for k in ('live', 'maxchild', 'hosted_residuals', 'split_residuals', 'banks_per_stage', 'deficit', 'global_profile')})) +if __name__ == '__main__': + DISCOVER = '--discover' in sys.argv; args = [a for a in sys.argv[1:] if a != '--discover'] + main(Path(args[0]), Path(args[1])) diff --git a/research/cross-copy-hosting/tape_core.py b/research/cross-copy-hosting/tape_core.py new file mode 100644 index 0000000000..b7cea4707b --- /dev/null +++ b/research/cross-copy-hosting/tape_core.py @@ -0,0 +1,95 @@ +"""Cross-copy idle-axis hosting. A child advancing pair j by rank r has, per replica, C copies (data families) with r +pending coordinates each; they share one window. Concatenate the C pending sets into a tape of C*r coordinates and +place whole residuals (stage in window, width w) contiguously; a residual may straddle a copy boundary, in which case +its two pieces are owned by two families of the same child. Integer programme: maximise saved idle cost (first-order +r ln(m/r) proxy) subject to residual availability and exact bank tiling of what is left. Standard library plus scipy +for the solve; a frozen selection replays without scipy.""" +import math, json +from collections import Counter, defaultdict +from pathlib import Path + +def windows(schedule): + last = {}; out = {}; locals_ = [] + for pos, e in enumerate(schedule): + k = e['kind'] + if k == 'local': locals_.append((pos, e['stage'], e['pair'])); last[e['pair']] = pos + elif k == 'bridge': last[e['dst']] = pos; last[e['src']] = pos + elif k == 'idle': + p = e['pair']; lo = last.get(p, -1) + out[e['idx']] = (p, e['rank'], frozenset(s for q, s, pp in locals_ if lo < q < pos and pp != p)) + return out + +def cost(r, m): return r * math.log(m / r) if r else 0.0 + +def solve(win, copies, avail, m, widths, tiling): + """win: {idx: (pair, rank, stages)}; copies per child per replica; avail: {(stage, width): count per replica}; + tiling: function(leftover counts per stage as dict width->var expressions) -> list of (row, lo, hi) built by caller. + Returns counts {(idx, stage, width): n} maximising sum_i ln(m/r_i) * used_i (used_i = coordinates hosted on child i).""" + import numpy as np + from scipy.optimize import milp, LinearConstraint, Bounds + var = []; index = {} + for idx, (p, r, st) in win.items(): + for s in sorted(st): + for w in widths: + if avail.get((s, w), 0): index[(idx, s, w)] = len(var); var.append(('n', idx, s, w)) + stages = sorted({s for (s, _) in avail}) + extra = tiling['vars'](stages) # list of names of integer slack vars + for name in extra: index[name] = len(var); var.append(name) + n = len(var); c = np.zeros(n); lb = np.zeros(n); ub = np.full(n, np.inf) + for key in list(index): + if isinstance(key, tuple) and len(key) == 3 and key[0] in win: + idx, s, w = key; r = win[idx][1]; c[index[key]] = -math.log(m / r) * w + rows, lo, hi = [], [], [] + for idx, (p, r, st) in win.items(): # capacity of the tape + row = np.zeros(n) + for key, j in index.items(): + if isinstance(key, tuple) and len(key) == 3 and key[0] == idx: row[j] = key[2] + rows.append(row); lo.append(0); hi.append(copies * r) + for (s, w), a in avail.items(): # availability and tiling of the leftover + row = np.zeros(n) + for key, j in index.items(): + if isinstance(key, tuple) and len(key) == 3 and key[0] in win and key[1] == s and key[2] == w: row[j] = 1 + rows.append(row); lo.append(0); hi.append(a) + for row, l, h in tiling['rows'](index, n, avail, win): + rows.append(row); lo.append(l); hi.append(h) + res = milp(c, constraints=LinearConstraint(np.array(rows), lo, hi), integrality=np.ones(n), bounds=Bounds(lb, ub), + options=dict(time_limit=600, disp=False)) + assert res.x is not None, res.message + x = [int(round(t)) for t in res.x] + counts = {key: x[j] for key, j in index.items() if isinstance(key, tuple) and len(key) == 3 and key[0] in win and x[j]} + return counts, -res.fun + +def expand(win, counts, helpers, copies): + """helpers: {stage: [(helper, width), ...]} for one replica (sorted). Lay the residuals of each child along the tape + in (stage, helper) order. Returns pieces {(stage, helper): (idx, [(copy, off, w), ...])} and the remainder rank of + every (idx, copy).""" + pool = defaultdict(list) + for s, hs in helpers.items(): + for h, w in hs: pool[s, w].append(h) + for k in pool: pool[k].sort() + pieces = {}; rem = {} + for idx in sorted(win): + p, r, st = win[idx]; pos = 0 + items = [] + for (i2, s, w), cnt in sorted(counts.items()): + if i2 != idx: continue + for _ in range(cnt): items.append((s, w, pool[s, w].pop(0))) + items.sort(key=lambda t: (-t[1], t[0], t[2])) # wide first: fewer straddles + for s, w, h in items: + a, b = pos, pos + w; segs = [] + while a < b: + cp = a // r; end = min(b, (cp + 1) * r); segs.append((cp, a - cp * r, end - a)); a = end + pieces[s, h] = (idx, segs); pos = b + assert pos <= copies * r + for cp in range(copies): + used = max(0, min(r, pos - cp * r)); rem[idx, cp] = r - used + return pieces, rem + +def save(path, key, counts, val): + p = Path(path); d = json.loads(p.read_text()) if p.exists() else {} + d[key] = dict(counts=sorted([[i, s, w, n] for (i, s, w), n in counts.items()]), proxy_saving=val) + p.write_text(json.dumps(d, indent=1, sort_keys=True) + '\n') + +def load(path, key): + d = json.loads(Path(path).read_text())[key] + return {(i, s, w): n for i, s, w, n in d['counts']}, d['proxy_saving'] diff --git a/research/cross-copy-hosting/toy_two_family_check.py b/research/cross-copy-hosting/toy_two_family_check.py new file mode 100644 index 0000000000..4b80795818 --- /dev/null +++ b/research/cross-copy-hosting/toy_two_family_check.py @@ -0,0 +1,54 @@ +"""Exact finite check of the cross-copy slot in the model of #451's trace note. + +Model (as in research/cross-family-residual-obstruction of #451): a family's address is (x, y) in F_q^m x F_q^m; the +rank-r coordinate operator on a set S of coordinates exchanges x_i and y_i for i in S. Two copies A and B of one pair +are idle; a child of rank r acts on A's pending set S_A and on B's pending set S_B. A residual of width w <= r +from an invocation inside the window is hosted either whole on A (#442) or split, w1 coordinates on A and w2 on B +(#448), and the child keeps the remainder on each family. + +Checked exactly, as permutations of the two-family address space: + (1) the trace note's comparison: the residual factor alone differs between the two placements (its claim, confirmed); + (2) the complete program: residual factor(s) followed by the remainder children equals the original children + Gamma_A x Gamma_B for BOTH placements, so the two placements realise the same program. +Also the whole-on-A placement is impossible when w > r, while the split still works: the case cross-copy hosting +is for. Standard library only. usage: python3 -B toy_two_family_check.py""" +import itertools, json, sys +def families(q, m): + one = list(itertools.product(range(q), repeat=2 * m)) + return [(f, w) for f in range(2) for w in one] +def exchange(states, index, sets, m): + """permutation exchanging x_i <-> y_i for i in sets[family] on each family""" + out = [] + for f, w in states: + w = list(w) + for i in sets[f]: w[i], w[m + i] = w[m + i], w[i] + out.append(index[f, tuple(w)]) + return out +def compose(p, r): return [p[r[i]] for i in range(len(r))] # apply r then p +def fixed(p): return sum(i == j for i, j in enumerate(p)) +def check(q, m, r, w, w1): + states = families(q, m); index = {s: i for i, s in enumerate(states)}; E = lambda a, b: exchange(states, index, {0: a, 1: b}, m) + S = list(range(r)) # the child's pending set on each copy (same coordinates by symmetry) + gamma = E(S, S) # original children: Gamma_A x Gamma_B + res = {} + if w <= r: # #442: whole residual on A + piece = S[:w]; rem_A = S[w:] + factor = E(piece, []); remainder = E(rem_A, S) + res['whole_on_A'] = dict(factor_fixed=fixed(factor), program_equals_original=compose(remainder, factor) == gamma) + w2 = w - w1; assert 0 < w1 <= r and 0 < w2 <= r # #448: split across A and B + pA, pB = S[:w1], S[:w2] + factor = E(pA, pB); remainder = E(S[w1:], S[w2:]) + res['split_A_B'] = dict(factor_fixed=fixed(factor), program_equals_original=compose(remainder, factor) == gamma) + if w <= r: res['factors_differ_as_in_note'] = res['whole_on_A']['factor_fixed'] != res['split_A_B']['factor_fixed'] + res.update(q=q, m=m, child_rank=r, residual_width=w, pieces=[w1, w2], dimension=len(states)) + return res +rows = [check(3, 2, 2, 2, 1), check(3, 3, 2, 2, 1), check(3, 3, 3, 2, 1), check(2, 4, 3, 4, 2), check(3, 3, 2, 3, 2)] +for row in rows: + assert row['split_A_B']['program_equals_original'] + if 'whole_on_A' in row: assert row['whole_on_A']['program_equals_original'] and row['factors_differ_as_in_note'] + else: assert row['residual_width'] > row['child_rank'] +out = dict(status='PASS_TWO_FAMILY_PROGRAM_IDENTITY', rows=rows, + conclusion='In the coordinate-exchange model the residual factor differs between placements (the trace note), ' + 'but the complete program, factor(s) followed by the remainder children, equals the original children ' + 'Gamma_A x Gamma_B for the whole-on-A placement and for the split placement alike; when w > r only the split exists.') +print(json.dumps(out, indent=1)) diff --git a/research/cross-copy-hosting/verify.py b/research/cross-copy-hosting/verify.py new file mode 100644 index 0000000000..08850ded3c --- /dev/null +++ b/research/cross-copy-hosting/verify.py @@ -0,0 +1,40 @@ +"""Fresh replay: #434 in full, then cross-copy idle-axis hosting of both suppliers, independent audit and exact assembly. +usage: python -B research/cross-copy-hosting/verify.py /absolute/new/output (Python 3.11+, standard library only)""" +from pathlib import Path +import gzip, hashlib, json, os, subprocess, sys, time +assert __debug__ +ROOT = Path(__file__).resolve().parent; PARENT = ROOT.parent / 'e8-early-reset-kernel' +out = Path(sys.argv[1]).resolve(); assert not out.exists() and not out.is_relative_to(ROOT.parent) +read = lambda p: json.loads(Path(p).read_text()); sha = lambda p: hashlib.sha256(Path(p).read_bytes()).hexdigest() +def integrity(): + files = {p.relative_to(ROOT).as_posix(): sha(p) for p in ROOT.rglob('*') if p.is_file() and p.name != 'MANIFEST.json' and '__pycache__' not in p.parts} + assert files == read(ROOT / 'MANIFEST.json')['files'], 'manifest mismatch' + assert sha(PARENT / 'MANIFEST.json') == read(ROOT / 'MANIFEST.json')['parent_manifest_sha256'], 'parent package changed' +integrity(); out.mkdir(parents=True) +env = dict(os.environ, PYTHONDONTWRITEBYTECODE='1', PYTHONINTMAXSTRDIGITS='0'); env.pop('PYTHONOPTIMIZE', None); steps = [] +def run(name, file, *args, cwd=None): + t = time.monotonic(); log = out / (name + '.log'); print('RUN', name, flush=True) + with log.open('w') as f: q = subprocess.run([sys.executable, '-B', str(file), *map(str, args)], cwd=cwd, env=env, stdout=f, stderr=subprocess.STDOUT) + if q.returncode: raise RuntimeError((name, q.returncode, log.read_text()[-3000:])) + steps.append(dict(name=name, seconds=round(time.monotonic() - t, 1), log_sha256=sha(log))); print('PASS', name, flush=True) +try: + run('parent-434-full', PARENT / 'verify.py', out / 'parent') + changed = out / 'parent/changed' + run('bit-cross-copy-hosting', ROOT / 'bit_split.py', 'bit426-source-centres/global', 'bit426-source-centres', out / 'bit', cwd=changed) + run('complex-cross-copy-hosting', ROOT / 'complex_split.py', 'split-centres', out / 'complex', cwd=changed) + run('independent-audit', ROOT / 'audit_split.py', changed, out / 'bit', out / 'complex', out / 'AUDIT.json') + run('exact-assembly', ROOT / 'assemble_split.py', changed, out / 'bit', out / 'complex', out / 'AUDIT.json', out / 'RESULT.json') + run('toy-two-family-program-identity', ROOT / 'toy_two_family_check.py') + assert json.loads((out / 'toy-two-family-program-identity.log').read_text()) == read(ROOT / 'TOY-EXPECTED.json'), 'toy check output differs' + actual = read(out / 'RESULT.json'); expected = read(ROOT / 'EXPECTED.json') + for k, v in expected.items(): assert actual[k] == v, (k, actual[k], v) + for side, d in (('bit', 'bit'), ('complex', 'complex')): + h = hashlib.sha256(gzip.decompress((out / d / 'GLOBAL-TEMPLATE.json.gz').read_bytes())).hexdigest() + assert h == expected[side + '_template_sha256'], (side, h) + integrity() + receipt = dict(status='PASS_FULL_CROSS_COPY_HOSTING_COMPOSITION', kappa=actual['kappa'], kappa_decimal=actual['kappa_decimal'], + gain_over_pr434_percent=actual['gain_over_pr434_percent'], manifest_sha256=sha(ROOT / 'MANIFEST.json'), checks=steps, + python=sys.version.split()[0]) + (out / 'RECEIPT.json').write_text(json.dumps(receipt, indent=2) + '\n'); print(json.dumps(receipt, indent=2)) +except BaseException as e: + (out / 'FAILURE.json').write_text(json.dumps(dict(error=repr(e), completed=steps), indent=2) + '\n'); raise diff --git a/research/e8-early-reset-kernel/EXPECTED.json b/research/e8-early-reset-kernel/EXPECTED.json new file mode 100644 index 0000000000..e286628f86 --- /dev/null +++ b/research/e8-early-reset-kernel/EXPECTED.json @@ -0,0 +1,10 @@ +{ + "status": "PASS_CONDITIONAL_EARLY_RESET_KERNEL_ASSEMBLY", + "kappa": "566550276142217/500000000000000000", + "kappa_decimal": "0.001133100552284434", + "bit_lower": "1134385925603239057397/1000000000000000000000000", + "complex_lower": "1183986549206329/1000000000000000000", + "binding_component": "bit", + "bit_template_sha256": "f9ce9ac945d9e8ea737dc5e456e366a7e2a21d8b989d24b742d7f124d26fb32f", + "complex_template_sha256": "942d030fa43316c560c88d7d7d904583446e1a96945b3ebd37a91c88a192ab4f" +} diff --git a/research/e8-early-reset-kernel/LICENSE b/research/e8-early-reset-kernel/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-early-reset-kernel/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/e8-early-reset-kernel/MANIFEST.json b/research/e8-early-reset-kernel/MANIFEST.json new file mode 100644 index 0000000000..c96c75aa92 --- /dev/null +++ b/research/e8-early-reset-kernel/MANIFEST.json @@ -0,0 +1,32 @@ +{ + "files": { + "EXPECTED.json": "6710a99055d7ee1d83d9f811822bb72db84f6ce95bd4e1e17f1df1659c7e958b", + "LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "NOTICE.md": "ff88b6031fe2fb5cbc483e8fcc08d228eaf2c982221adb3659da234dfa24cfeb", + "PROOF.md": "fb4e1c3a23e3a0be48b5254133e584dad6fb523042ca8ef70358684fb9185962", + "README.md": "4d7d736eda667533ab55bf3949e30832d4676d7ebeee00d9608307ecc5aacd4b", + "SELECTION.json": "b5f5d8c78d912820c8ed1a67c21062bec799714b9caa6724dfd515306ad42a2b", + "SOURCE.json": "a5e84250b687624b2158597831fb36a5f2b068983862c491f8e1020c9806cc65", + "VALIDATION.json": "77ad775cf69f5d913568b6276b0dfeb2eaef0306f57b71c0a467bff793807267", + "apply.py": "0d530e9703e1d1734c7af205bd393cba89ac41f75ed9781ea3dc5e46650f44f5", + "bit_audit.py": "203bb609952ad7b7ca761e9f9883ee9fa35a0a0474503b396d47a31169102e7d", + "bit_global.py": "79c7dc84e65dca10c35c842cf170e4719d45c38a25d03bf762332b24c700b6c9", + "bit_price.py": "36bf15803567a95b139a908461541bf19efe1f5b85fb31c270021833ab1393ee", + "combined.py": "4d514b6c70e969ec306d8c2bb38edec95b0cb7fa09f48dadbec8aa1eead69ce1", + "local-evidence/ASSEMBLY.json": "7c3cc4b503e4cf0fd3e050be46ad0da183c5b1c490f4901245df944fd9d6194e", + "local-evidence/AUDIT.json": "76a146a9123d8b653e6e46ff93f153653f9cefd0f5c3fdd264a59f1322110262", + "local-evidence/BIT-PRICE.json": "9a4a320cab1ce62b0c2329ac1bf3b81f73580fd603a406e4bfaae2962dfdad35", + "local-evidence/FULL-PYTHON311.json": "62b37525bf7b60c0d9101ed571681f3bf46ea75df065939864307e4986018332", + "local-evidence/FULL-PYTHON314.json": "85797531db037d06fb597a4c9b6ef6bd71e6a0ab4f220ae70b1b6bf3aeda205f", + "local-evidence/GLOBAL.json": "16c4e829eea1b2d12b70cec7e6a9c0e33ea0eae98a40894a3b779790fd2efbb3", + "local-evidence/SOURCE-SPANS.log": "bdf95dbce8337be57aab8a3d3b42a711ee276496c40cbb4c5356fc9cc9b2e811", + "source_span.py": "4772d177f37254c6f854af5ee3871aca193cfb24307a53c143c3bf517e56631e", + "vendor/kernel417/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "vendor/kernel417/e8core.py": "3f4e25f700b7eb5821ab9cdfc65541f3f921baffeb8704beb21c6d7072052d29", + "vendor/kernel417/engines/base_two_moment.py": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098", + "vendor/kernel417/engines/moment.py": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482", + "vendor/kernel417/engines/outer.py": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c", + "vendor/kernel417/stages.py": "e73ab7836519510ed30dd7e3022dae557fa50fc513d723197929bff741859668", + "verify.py": "16c07414bc956744dc93b8e35b642267ea9819be922b0d3e081c543fdbf92a70" + } +} diff --git a/research/e8-early-reset-kernel/NOTICE.md b/research/e8-early-reset-kernel/NOTICE.md new file mode 100644 index 0000000000..0673347680 --- /dev/null +++ b/research/e8-early-reset-kernel/NOTICE.md @@ -0,0 +1,3 @@ +Rohan Arun with substantial OpenAI Codex assistance. Apache-2.0. + +New contribution: composition of eleven early bit resets with 110 remapped surviving response-kernel relations. Chafik Boukhalfa/chafreaky #417 supplied the kernel principle and independent replay; #435 supplied the source selection and mixed-width bank implementation. icekylinx #433 supplied split centres and source-basis reuse; ai-nanachi #426 supplied clean-reset reuse; Zhihao Chen #425/#386, Dylan Crow #370 and Jacob Sussman supplied the inherited construction. All vendored notices and parent sources remain preserved. diff --git a/research/e8-early-reset-kernel/PROOF.md b/research/e8-early-reset-kernel/PROOF.md new file mode 100644 index 0000000000..25cfa0e865 --- /dev/null +++ b/research/e8-early-reset-kernel/PROOF.md @@ -0,0 +1,9 @@ +# Composed response cancellation after early helper reuse + +First reconstruct the eleven early clean resets using the pinned earlier-reset package, including fresh compensation and cleanup. Its exact all-column target response determines which remapped kernel relations remain valid. Retain a pivot p with entrance E and donors D only if response(p) equals the XOR of donor responses, E lies inside each participant's first frame, pivots and donors are disjoint, and each shared donor serves a single entrance. Omit entries invalidated by physical aliases, changed responses, or changed first frames. Choose total entrance rank divisible by eight for exact bank packing. + +Remove pivot columns from the initial zero-frame target compensation. Start each pivot at E, emit donor += pivot at E before the main word, and emit the inverse at the full frame after cleanup. The exact response relation cancels the omitted compensation. The entire composed program is replayed on all independent columns; the PR417/435 auditor additionally checks integer source-span legality. All unchanged rational frames and every nested/reflected transition are independently checked by the emitted-template audit. + +Residual helper width is 8 minus its entrance rank. With eight replicas, width-seven slots are packed eight at a time with one width-eight slot; width-four slots pack sixteen at a time; remaining width-eight slots pack eight at a time. Every bank is full, every owner disjoint, every helper slot is accounted for, and all 72 emitted local invocations are checked. The emitted histogram, physical stock, coefficient growth, finite cost invoice, two exact moment engines, six bootstrap levels and 47 outer inequalities are recomputed after both transformations. + +No separately reported numerical gains are added. The complex supplier is unchanged and all its phases are freshly replayed by the full wrapper. All-size compiler, dirty-bank, compressed-window, restored-work, tape/common-grid, precision and analytic interfaces remain conditional assumptions. No new Lean theorem or unconditional multiplication bound is claimed. diff --git a/research/e8-early-reset-kernel/README.md b/research/e8-early-reset-kernel/README.md new file mode 100644 index 0000000000..dc413e500b --- /dev/null +++ b/research/e8-early-reset-kernel/README.md @@ -0,0 +1,9 @@ +# Early reset and response-kernel composition + +Conditional kappa = 0.001133100552284434, above PR436's 0.001128983115440183. Eleven earlier resets give R747. After remapping the PR435/417 kernel selection and rejecting changed/invalid response relations, 110 entries survive with entrance rank 128 and 97 donor slots. There are 731 width-64 helper banks per stage, 14,259 live and 14,268 physical families. + +Run `python -B research/e8-early-reset-kernel/verify.py /absolute/new/output` using the Python standard library. The wrapper freshly replays the full earlier-reset package and its parent phases, then applies and checks the kernel composition. + +At draft update, exact changed scalar/frames/source-span checks, global banks, independent audit, two moments and full finite assembly passed. Both Python versions passed the earlier-reset parent wrapper. The new combined wrapper and GitHub CI remain pending. These are conditional bounds, retaining every stated all-size interface. + +The full uninterrupted wrapper now passes locally on Python 3.11 and Python 3.14 against 98b2d164fe0d51253faa05b8fb14cd82e57ef841. Both regenerate every parent phase and every changed program; receipts are in local-evidence/FULL-PYTHON*.json. GitHub CI remains pending. diff --git a/research/e8-early-reset-kernel/SELECTION.json b/research/e8-early-reset-kernel/SELECTION.json new file mode 100644 index 0000000000..fff02ebc1e --- /dev/null +++ b/research/e8-early-reset-kernel/SELECTION.json @@ -0,0 +1,1696 @@ +{ + "status": "PASS_LOCAL_RESPONSE_KERNEL_AND_FIRST_MOMENT", + "input_sha256": "98ffef9246c8bf6c537ab5e134321abea05cf0b7830c9e3fd92cbe4e88d8c308", + "output_sha256": "da4aa797d6dad909fd1faaa90abea749b026299ac8cad3ad0a4a248e16bdb5f5", + "entries": [ + [ + [ + 2 + ], + 738, + [ + 257, + 736 + ] + ], + [ + [ + 2 + ], + 739, + [ + 256, + 737 + ] + ], + [ + [ + 1 + ], + 741, + [ + 250, + 740 + ] + ], + [ + [ + 1 + ], + 743, + [ + 248, + 742 + ] + ], + [ + [ + 0 + ], + 745, + [ + 244, + 744 + ] + ], + [ + [ + 0 + ], + 747, + [ + 242, + 746 + ] + ], + [ + [ + 4 + ], + 751, + [ + 779, + 835 + ] + ], + [ + [ + 4 + ], + 752, + [ + 268, + 750 + ] + ], + [ + [ + 4 + ], + 753, + [ + 269, + 779, + 835 + ] + ], + [ + [ + 5 + ], + 754, + [ + 820, + 900 + ] + ], + [ + [ + 5 + ], + 755, + [ + 272, + 820, + 900 + ] + ], + [ + [ + 1 + ], + 757, + [ + 248, + 756 + ] + ], + [ + [ + 0 + ], + 761, + [ + 242, + 760 + ] + ], + [ + [ + 7 + ], + 767, + [ + 287, + 765 + ] + ], + [ + [ + 1 + ], + 769, + [ + 248, + 768 + ] + ], + [ + [ + 1 + ], + 771, + [ + 249, + 770 + ] + ], + [ + [ + 0 + ], + 773, + [ + 242, + 772 + ] + ], + [ + [ + 0 + ], + 777, + [ + 762, + 763, + 776 + ] + ], + [ + [ + 4 + ], + 781, + [ + 269, + 779 + ] + ], + [ + [ + 2 + ], + 783, + [ + 257, + 782 + ] + ], + [ + [ + 4 + ], + 784, + [ + 750, + 868 + ] + ], + [ + [ + 4 + ], + 785, + [ + 268, + 750, + 868 + ] + ], + [ + [ + 0 + ], + 787, + [ + 241, + 786 + ] + ], + [ + [ + 0 + ], + 789, + [ + 748, + 749, + 788 + ] + ], + [ + [ + 0 + ], + 791, + [ + 762, + 763, + 790 + ] + ], + [ + [ + 5 + ], + 795, + [ + 275, + 793 + ] + ], + [ + [ + 2 + ], + 797, + [ + 257, + 796 + ] + ], + [ + [ + 2 + ], + 799, + [ + 256, + 798 + ] + ], + [ + [ + 0 + ], + 801, + [ + 748, + 749, + 800 + ] + ], + [ + [ + 0 + ], + 803, + [ + 241, + 802 + ] + ], + [ + [ + 0 + ], + 804, + [ + 762, + 776, + 790 + ] + ], + [ + [ + 0 + ], + 805, + [ + 763, + 776, + 790 + ] + ], + [ + [ + 7 + ], + 808, + [ + 284, + 806 + ] + ], + [ + [ + 4 + ], + 809, + [ + 269, + 807 + ] + ], + [ + [ + 7 + ], + 811, + [ + 764, + 766, + 810 + ] + ], + [ + [ + 4 + ], + 813, + [ + 268, + 812 + ] + ], + [ + [ + 0 + ], + 814, + [ + 776, + 790 + ] + ], + [ + [ + 0 + ], + 815, + [ + 762, + 763, + 776, + 790 + ] + ], + [ + [ + 0 + ], + 817, + [ + 241, + 816 + ] + ], + [ + [ + 0 + ], + 818, + [ + 748, + 800 + ] + ], + [ + [ + 0 + ], + 819, + [ + 749, + 800 + ] + ], + [ + [ + 5 + ], + 822, + [ + 272, + 820 + ] + ], + [ + [ + 5 + ], + 823, + [ + 275, + 821 + ] + ], + [ + [ + 3 + ], + 825, + [ + 263, + 824 + ] + ], + [ + [ + 5 + ], + 827, + [ + 274, + 826 + ] + ], + [ + [ + 0 + ], + 828, + [ + 762, + 790 + ] + ], + [ + [ + 0 + ], + 829, + [ + 763, + 790 + ] + ], + [ + [ + 0 + ], + 830, + [ + 748, + 788 + ] + ], + [ + [ + 0 + ], + 831, + [ + 749, + 788 + ] + ], + [ + [ + 0 + ], + 832, + [ + 786, + 802, + 816 + ] + ], + [ + [ + 0 + ], + 833, + [ + 241, + 786, + 802, + 816 + ] + ], + [ + [ + 7 + ], + 836, + [ + 283, + 834 + ] + ], + [ + [ + 4 + ], + 837, + [ + 269, + 835 + ] + ], + [ + [ + 2 + ], + 838, + [ + 736, + 782 + ] + ], + [ + [ + 2 + ], + 839, + [ + 257, + 736, + 782 + ] + ], + [ + [ + 4 + ], + 840, + [ + 750, + 812 + ] + ], + [ + [ + 4 + ], + 841, + [ + 268, + 750, + 812 + ] + ], + [ + [ + 1 + ], + 845, + [ + 250, + 844 + ] + ], + [ + [ + 1 + ], + 847, + [ + 249, + 846 + ] + ], + [ + [ + 5 + ], + 851, + [ + 275, + 849 + ] + ], + [ + [ + 2 + ], + 852, + [ + 736, + 796 + ] + ], + [ + [ + 2 + ], + 853, + [ + 257, + 736, + 796 + ] + ], + [ + [ + 2 + ], + 855, + [ + 256, + 854 + ] + ], + [ + [ + 5 + ], + 856, + [ + 896, + 924 + ] + ], + [ + [ + 5 + ], + 857, + [ + 792, + 794, + 896, + 924 + ] + ], + [ + [ + 1 + ], + 859, + [ + 250, + 858 + ] + ], + [ + [ + 1 + ], + 860, + [ + 756, + 768 + ] + ], + [ + [ + 1 + ], + 861, + [ + 248, + 756, + 768 + ] + ], + [ + [ + 4 + ], + 863, + [ + 779, + 807, + 835 + ] + ], + [ + [ + 4 + ], + 865, + [ + 269, + 779, + 807, + 835 + ] + ], + [ + [ + 3 + ], + 867, + [ + 263, + 866 + ] + ], + [ + [ + 4 + ], + 869, + [ + 268, + 868 + ] + ], + [ + [ + 1 + ], + 873, + [ + 249, + 872 + ] + ], + [ + [ + 1 + ], + 874, + [ + 742, + 768 + ] + ], + [ + [ + 1 + ], + 875, + [ + 248, + 742, + 768 + ] + ], + [ + [ + 5 + ], + 877, + [ + 793, + 821, + 849 + ] + ], + [ + [ + 5 + ], + 879, + [ + 275, + 793, + 821, + 849 + ] + ], + [ + [ + 7 + ], + 881, + [ + 764, + 766, + 880 + ] + ], + [ + [ + 5 + ], + 883, + [ + 274, + 882 + ] + ], + [ + [ + 1 + ], + 884, + [ + 844, + 858 + ] + ], + [ + [ + 1 + ], + 885, + [ + 250, + 844, + 858 + ] + ], + [ + [ + 5 + ], + 886, + [ + 900, + 928 + ] + ], + [ + [ + 5 + ], + 887, + [ + 272, + 900, + 928 + ] + ], + [ + [ + 1 + ], + 888, + [ + 742, + 756 + ] + ], + [ + [ + 1 + ], + 889, + [ + 248, + 742, + 756 + ] + ], + [ + [ + 4 + ], + 891, + [ + 779, + 807 + ] + ], + [ + [ + 4 + ], + 893, + [ + 269, + 779, + 807 + ] + ], + [ + [ + 2 + ], + 894, + [ + 782, + 796 + ] + ], + [ + [ + 2 + ], + 895, + [ + 257, + 782, + 796 + ] + ], + [ + [ + 5 + ], + 897, + [ + 792, + 794, + 896 + ] + ], + [ + [ + 4 + ], + 899, + [ + 267, + 898 + ] + ], + [ + [ + 5 + ], + 901, + [ + 272, + 900 + ] + ], + [ + [ + 2 + ], + 903, + [ + 254, + 902 + ] + ], + [ + [ + 2 + ], + 908, + [ + 737, + 798, + 854 + ] + ], + [ + [ + 2 + ], + 909, + [ + 256, + 737, + 798, + 854 + ] + ], + [ + [ + 3 + ], + 913, + [ + 260, + 912 + ] + ], + [ + [ + 2 + ], + 917, + [ + 254, + 916 + ] + ], + [ + [ + 7 + ], + 919, + [ + 286, + 766, + 810, + 880 + ] + ], + [ + [ + 7 + ], + 921, + [ + 286, + 764, + 810, + 880 + ] + ], + [ + [ + 4 + ], + 922, + [ + 750, + 812, + 868 + ] + ], + [ + [ + 4 + ], + 923, + [ + 268, + 750, + 812, + 868 + ] + ], + [ + [ + 5 + ], + 925, + [ + 792, + 794, + 924 + ] + ], + [ + [ + 5 + ], + 929, + [ + 272, + 928 + ] + ], + [ + [ + 7 + ], + 931, + [ + 284, + 930 + ] + ], + [ + [ + 0, + 3, + 5, + 6, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119 + ], + 938, + [ + 932, + 933, + 937 + ] + ], + [ + [ + 0, + 1, + 2, + 3, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + 949, + [ + 941 + ] + ], + [ + [ + 0, + 2, + 5, + 7, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47 + ], + 953, + [ + 942, + 944, + 951 + ] + ], + [ + [ + 0, + 1, + 6, + 7, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31 + ], + 958, + [ + 943, + 945, + 956 + ] + ], + [ + [ + 2, + 3, + 6, + 7, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95 + ], + 961, + [ + 936 + ] + ], + [ + [ + 4, + 5, + 6, + 7, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63 + ], + 978, + [ + 959, + 960, + 977 + ] + ] + ], + "total_entrance_rank": 128, + "donor_slots": 97, + "new_frames": 0, + "local_profile": { + "1": 2480, + "4": 324, + "2": 1031, + "3": 309, + "5": 133, + "8": 9, + "7": 14 + }, + "global_profile": { + "1": 178560, + "4": 23328, + "2": 74232, + "3": 22248, + "5": 9576, + "8": 648, + "7": 6768, + "14": 3840, + "28": 3840, + "42": 3840 + }, + "live": 14259, + "banks_per_stage": 731, + "bit_price": { + "lower": "0.001134385925603239057397", + "upper": "0.001134385925603239057398", + "lower_endpoint_residual_upper": "-1.208815110554072546890868962118806453466727141708111658528148771609217E-24", + "upper_endpoint_residual_lower": "1.206647999073094385830833942650340983281407775833257592984711501729879E-24", + "strict_rational_signs": true, + "moment_minus_one_at_current_k_required_rate": [ + "-0.001059935772403113935979679141367753634160753707351085784521072950941911", + "-0.001059935772403113935979679141367753634160753707351085784521072950867727" + ], + "nominal_k_ceiling_interval": [ + "0.001133100552284434337978314624649498572528216136568917723800228264595422", + "0.001133100552284434337979312359732310865246830293765932499225360045604731" + ] + }, + "rejected": [ + { + "entry": [ + [ + 0, + 3, + 4, + 7, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79 + ], + 947, + [ + 937 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 0, + 3, + 4, + 7, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79 + ], + 948, + [ + 937, + 940, + 941 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 0, + 1, + 2, + 3, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71 + ], + 961, + [ + 950 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 0, + 1, + 4, + 5, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39 + ], + 965, + [ + 957, + 959, + 963 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 0, + 2, + 4, + 6, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23 + ], + 966, + [ + 936 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 0, + 2, + 4, + 6, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23 + ], + 968, + [ + 936, + 956, + 958 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 2, + 3, + 6, + 7, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95 + ], + 973, + [ + 942 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 1, + 3, + 5, + 7, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111 + ], + 976, + [ + 932 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 2, + 3, + 6, + 7, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95 + ], + 981, + [ + 942, + 943, + 980 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 2, + 3, + 4, + 5, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103 + ], + 982, + [ + 944 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 2, + 3, + 4, + 5, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103 + ], + 983, + [ + 944, + 974, + 975 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 1, + 3, + 5, + 7, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111 + ], + 985, + [ + 932, + 977, + 984 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 1, + 3, + 4, + 6, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87 + ], + 986, + [ + 934 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 1, + 3, + 4, + 6, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87 + ], + 987, + [ + 934, + 978, + 979 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 1, + 2, + 5, + 6, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55 + ], + 990, + [ + 935 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 1, + 2, + 5, + 6, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55 + ], + 995, + [ + 935, + 991, + 994 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 1, + 2, + 4, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + 996, + [ + 933 + ] + ], + "reason": "changed response" + }, + { + "entry": [ + [ + 1, + 2, + 4, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + 997, + [ + 933, + 992, + 993 + ] + ], + "reason": "changed response" + } + ] +} diff --git a/research/e8-early-reset-kernel/SOURCE.json b/research/e8-early-reset-kernel/SOURCE.json new file mode 100644 index 0000000000..78e840b5ad --- /dev/null +++ b/research/e8-early-reset-kernel/SOURCE.json @@ -0,0 +1,68 @@ +{ + "parent_pr": 434, + "parent_code_head": "50585107b561a170ccd2c6be09dbe90041ea7f6f", + "parent_manifest_sha256": "4d23bafa43634a59e25f875333408b67cbecb1c912929824b5d45dea4de51da7", + "kernel_source_pr": 435, + "kernel_source_head": "2c9c833ac8709402c37fc88a6a23393fb0d397fb", + "kernel_provenance": { + "head": "2c9c833ac8709402c37fc88a6a23393fb0d397fb", + "files": [ + { + "path": "research/split-centres-kernel/code/bit_audit.py", + "git_blob": "ce13906fe7473999b0ffc721f60fbf853645e371", + "sha256": "c94a1dd1c078deddbde088dc6291190977266009073c4cb4108f9e2faf898381" + }, + { + "path": "research/split-centres-kernel/code/bit_global.py", + "git_blob": "c8f37eb96eb13847fa157c574d7ab445edaae61c", + "sha256": "6d0eea0aaafbe90f1cdb43d7719ceb7b472fbbb6e6a7cb58bcfe82c31ac801c0" + }, + { + "path": "research/split-centres-kernel/code/bit_kernel.py", + "git_blob": "c0b7445f769713d0cd647c1e01f8befc39fffbd1", + "sha256": "14f164fcc0674f73163808a9d9762eb439ea130895f593cb78a6cafaed2dfb11" + }, + { + "path": "research/split-centres-kernel/code/combined.py", + "git_blob": "cead756a2c8fb52d6ba4cc7fe27200950d9a6b2c", + "sha256": "4f1f280b050e9aca659f10ad8996164e47f4e42fe4fd8631c822227413c427ae" + }, + { + "path": "research/split-centres-kernel/stages/kernel-selection.json", + "git_blob": "6426b40cde286df8894a4c7740e8cd5b520130d1", + "sha256": "87994a173608a930c83bfb35a05994f9681031f1b79df148cc2e2579fec9ef1f" + }, + { + "path": "research/split-centres-kernel/vendor/kernel417/LICENSE", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "path": "research/split-centres-kernel/vendor/kernel417/e8core.py", + "git_blob": "f2874bae8ef044240211fd892afb457d13759c74", + "sha256": "3f4e25f700b7eb5821ab9cdfc65541f3f921baffeb8704beb21c6d7072052d29" + }, + { + "path": "research/split-centres-kernel/vendor/kernel417/engines/base_two_moment.py", + "git_blob": "14a90fa0e788217856f070382c9e61bd7c603c61", + "sha256": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098" + }, + { + "path": "research/split-centres-kernel/vendor/kernel417/engines/moment.py", + "git_blob": "7d697cb45203fe72d97037403d6da41f71f3b7fd", + "sha256": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482" + }, + { + "path": "research/split-centres-kernel/vendor/kernel417/engines/outer.py", + "git_blob": "43007488ad2c43187c77cc6798beff8b1cd76ad2", + "sha256": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c" + }, + { + "path": "research/split-centres-kernel/vendor/kernel417/stages.py", + "git_blob": "9ef95d52f4b2ba0389bb2edb15228da698dd75f4", + "sha256": "e73ab7836519510ed30dd7e3022dae557fa50fc513d723197929bff741859668" + } + ] + }, + "scope": "Filter and remap PR435/417 response relations after eleven early resets, then freshly reprice the combined emitted word." +} diff --git a/research/e8-early-reset-kernel/VALIDATION.json b/research/e8-early-reset-kernel/VALIDATION.json new file mode 100644 index 0000000000..d57a499ef8 --- /dev/null +++ b/research/e8-early-reset-kernel/VALIDATION.json @@ -0,0 +1,9 @@ +{ + "status": "PASS_FULL_PYTHON311_AND_314", + "validated_code_head": "98b2d164fe0d51253faa05b8fb14cd82e57ef841", + "kappa": "0.001133100552284434", + "scope": "Fresh parent construction, all phase pairs, reset reconstruction, both emitted bit compositions, independent source spans and banks, two moments, complete finite invoices and outer constraints.", + "pending": [ + "GitHub CI" + ] +} diff --git a/research/e8-early-reset-kernel/apply.py b/research/e8-early-reset-kernel/apply.py new file mode 100644 index 0000000000..f87dfda4b5 --- /dev/null +++ b/research/e8-early-reset-kernel/apply.py @@ -0,0 +1,43 @@ +"""Apply a source-bound subset of PR435/417 response relations after PR434 resets.""" +from pathlib import Path +import copy,hashlib,json,sys +from collections import defaultdict,Counter +ROOT=Path(__file__).resolve().parent + +def reconstruct(raw,s): + assert hashlib.sha256(raw).hexdigest()==s['input_sha256'];c=json.loads(raw);w=copy.deepcopy(c);v=c['v'];n=2*v+c['R'];frames=[sum(1<=2*v and f:first.setdefault(x,frames[f]) + pivots={};donors={};by=defaultdict(list) + for lines,p,ds in s['entries']: + E=sum(1<=0 + cur[x]=newf + if f: hist[f]+=1 + events.append([0,x,oldf,newf,f,int(reverse)]) + elif op==1: + assert cur[x]==cur[y]==f and x!=y and x0 + cutoff=max(ceil(36/gap**2),ceil(2*(4+charged_two)/gap)) + assert cutoff*gap**2>=36 and cutoff*gap>=2*(4+charged_two) + cutoffs.append(dict(gap=str(gap),cutoff_log2=str(cutoff)));chain.append(a) +q=chain[-1]*(1-2*eta);margin=(1-eta)*q/(1+q);ticks=margin/grid;k=grid*((ticks.numerator-1)//ticks.denominator) +bridge={'semantic':{'C0':{'base':2,'exponent':210000},'strict_literal_gap':1},'rows':{'degree_gap':Q(10**6)-Q(51*20161,25)}} +a=Outer.assembly(chain[-1],b,bridge,k,eta=eta,beta=beta) +assert len(a['strict_constraints'])==47 and all(x>0 for x in a['strict_constraints'].values()) +controls=[] +for name,kk,ee,bb in [('next_grid',k+grid,eta,beta),('zero_eta',k,Q(0),beta),('zero_beta',k,eta,Q(0)),('unit_beta',k,eta,Q(1))]: + try:Outer.assembly(chain[-1],b,bridge,kk,eta=ee,beta=bb) + except AssertionError:controls.append(name) + else:raise AssertionError(name) +result=dict(status='PASS_CONDITIONAL_EARLY_RESET_KERNEL_ASSEMBLY',kappa=str(k),kappa_decimal=format(float(k),'.18f'),bit_lower=str(c),complex_lower=str(b),binding_component='bit',gain_over_pr425_percent=float(100*(k/Q(1048005508028206,10**18)-1)),bit_invoice=dict(prefix_bits=prefix.bit_length(),charged_prefix_bits=charged_prefix,coefficient_bits=coefficient.bit_length(),two_level_coefficient_bits=two.bit_length(),charged_two_level_coefficient_bits=charged_two,row_coefficient=row,live=W,physical=physical),strict_outer_constraints={n:str(x) for n,x in a['strict_constraints'].items()},outer_controls=controls,bootstrap=cutoffs,bit_template_sha256=g['template_sha256'],complex_template_sha256=cx['global_template_sha256'],scope='Finite research composition with explicit changed words, exact local and global replay and incremental phase evidence. All-size correlated dirty-bank, compressed-window, compiler, restored-work, tape/common-grid, precision and analytic interfaces remain inherited assumptions. This certificate makes no unconditional integer-multiplication or Lean-kernel claim.') +(ROOT/'RESULT.json').write_text(json.dumps(result,indent=2)+'\n') +print(result['status'],result['kappa_decimal'],result['gain_over_pr425_percent'],result['bit_invoice']) diff --git a/research/e8-early-reset-kernel/local-evidence/ASSEMBLY.json b/research/e8-early-reset-kernel/local-evidence/ASSEMBLY.json new file mode 100644 index 0000000000..2d9275b4b3 --- /dev/null +++ b/research/e8-early-reset-kernel/local-evidence/ASSEMBLY.json @@ -0,0 +1,103 @@ +{ + "status": "PASS_CONDITIONAL_EARLY_RESET_KERNEL_ASSEMBLY", + "kappa": "566550276142217/500000000000000000", + "kappa_decimal": "0.001133100552284434", + "bit_lower": "1134385925603239057397/1000000000000000000000000", + "complex_lower": "1183986549206329/1000000000000000000", + "binding_component": "bit", + "gain_over_pr425_percent": 8.119713456118378, + "bit_invoice": { + "prefix_bits": 226, + "charged_prefix_bits": 256, + "coefficient_bits": 226, + "two_level_coefficient_bits": 488, + "charged_two_level_coefficient_bits": 512, + "row_coefficient": 18355, + "live": 14259, + "physical": 14268 + }, + "strict_outer_constraints": { + "bit_positive": "69237422216994571231731016394278971659481331432859237066649424129667134808630398853391912761178763207537908109793203831464837997733885657643609588447593436647051/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_above_bit": "3027381811712032772175233605721028340518668567140762933350575870332865191369601146608087238821236792462091890206796168535162002266114342356390411552406563352949/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_below_one_over32": "30066013450793671/1000000000000000000", + "beta_positive": "1/1000000000000000000", + "beta_below_one": "999999999999999999/1000000000000000000", + "leaf_saving_above_bit": "3027381811712032699910429577014424336612418567140762933350575870332865191369601146608087238821236792462091890206796168535162002266114342356390411552406563352949/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_positive": "34618711108497285546628085980144914598009649322150646873843380631974330337665775297028821571958982750377041293717838708194510889073738997356966796489911060679915911552406563352949/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_internal": "69237422216994571231731016394278971659481331432859237066649424129667134808630398853391912761178763207537908109793203831464837997733885657643609588447593436647051/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_leaf": "1513690905856016419192637005501783400037225677849353126156619368025669662334224702971178428041017249622958706282161291805489110926261002643033203510088939320084088447593436647051/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_positive": "34618711108497293176022617230144914598009649322150646873843380631974330337665775297028821571958982750377041293717838708194510889073738997356966796489911060679915911552406563352949/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_below_one": "30482959413891502706823977382769855085401990350677849353126156619368025669662334224702971178428041017249622958706282161291805489110926261002643033203510088939320084088447593436647051/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_reservations": "1/4000000000000000000", + "lambda_above_tau": "69237422216994571231731016394278971659481331432859237066649424129667134808630398853391912761178763207537908109793203831464837997733885657643609588447593436647051/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_sigma": "3027381811712032841412655822715599572249684961419734592831907303192102258019025276275222047451635645854004651385559376073070112059318173821228409286292220996558588447593436647051/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_internal": "69237422216994571231731016394278971659481331432859237066649424129667134808630398853391912761178763207537908109793203831464837997733885657643609588447593436647051/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_prime_above_lambda": "69237422216994571231731016394278971659481331432859237066649424129667134808630398853391912761178763207537908109793203831464837997733885657643609588447593436647051/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_leaf": "1513690905856016419192637005501783400037225677849353126156619368025669662334224702971178428041017249622958706282161291805489110926261002643033203510088939320084088447593436647051/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_reservations": "1/4000000000000000000", + "lambda_prime_below_one": "34618711108497285546628085980144914598009649322150646873843380631974330337665775297028821571958982750377041293717838708194510889073738997356966796489911060679915911552406563352949/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "epsilon_positive": "824799408783783782958984375000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/825735049624553980690449407729193105799946206738436503969563334611674981901017993926946724907350242777037217332262644289410662456461452405333972075580808407045403132744659636847377", + "epsilon_below_one": "935640840770197731465032729193105799946206738436503969563334611674981901017993926946724907350242777037217332262644289410662456461452405333972075580808407045403132744659636847377/825735049624553980690449407729193105799946206738436503969563334611674981901017993926946724907350242777037217332262644289410662456461452405333972075580808407045403132744659636847377", + "guard_width": "935640840770197731465032729193105799946206738436503969563334611674981901017993926946724907350242777037217332262644289410662456461452405333972075580808407045403132744659636847377/825735049624553980690449407729193105799946206738436503969563334611674981901017993926946724907350242777037217332262644289410662456461452405333972075580808407045403132744659636847377", + "K_geometry": "619535197428608034950703313979193105799946206738436503969563334611674981901017993926946724907350242777037217332262644289410662456461452405333972075580808407045403132744659636847377/825735049624553980690449407729193105799946206738436503969563334611674981901017993926946724907350242777037217332262644289410662456461452405333972075580808407045403132744659636847377000000000000000000", + "K_dominates_log": "30181962605490229417091461309195833846544927717528973213455737846402513917892235976507838913943511293241691126206500399143391103187358578171278036108258119723582489156491283934640879204527843633/26636614504017870344853206700941713090320845378659242063534301116505644577452193352482152416366136863775394107492343364174537498595530722752708776631638980872432359120795472156367000000000000000000", + "record_suffix": "935640840770197731465032729193105799946206738436503969563334611674981901017993926946724907350242777037217332262644289410662456461452405333972075580808407045403132744659636847377/825735049624553980690449407729193105799946206738436503969563334611674981901017993926946724907350242777037217332262644289410662456461452405333972075580808407045403132744659636847377", + "phase_local": "7485126726161581025985212208990865709120246178298925956560470154963351238580616803898817357783948289351013750750911538248082319428974953261114148185014851029252986376468687733612867255340363152623/6605880396996431845523595261833544846399569653907492031756506676893399855208143951415573799258801942216297738658101154315285299651691619242671776604646467256363225061957277094779016000000000000000000", + "phase_boundary": "1497025345232315544609002742154988589464523052305300551355128640243467072065455671439777950742394516312822824269988086019842598075679559123692864467841045938672936810647011910400067255340363152623/1321176079399286369104719052366708969279913930781498406351301335378679971041628790283114759851760388443259547731620230863057059930338323848534355320929293451272645012391455418955803200000000000000000", + "gamma_sublinear": "1/2000000000000000000", + "cell_above_band": "1649598817567567565092233700375446019309550592270806894200053793261563496030436665388325018098982006073053275092649757222962782667737355710589337543538547594666027924419191592954596867255340363152623/3302940198498215922761797630916772423199784826953746015878253338446699927604071975707786899629400971108148869329050577157642649825845809621335888302323233628181612530978638547389508000000000000000000", + "prime_interval_packing": "935640840770197731465032729193105799946206738436503969563334611674981901017993926946724907350242777037217332262644289410662456461452405333972075580808407045403132744659636847377/825735049624553980690449407729193105799946206738436503969563334611674981901017993926946724907350242777037217332262644289410662456461452405333972075580808407045403132744659636847377", + "alpha_positive": "1871281681540394637195015833832230909443005747679902139180462484913459832472653242218467913682491627127709757175045801784107580660260521257281694700164408756834189908510866649350867255340363152623/1651470099249107961380898815458386211599892413476873007939126669223349963802035987853893449814700485554074434664525288578821324912922904810667944151161616814090806265489319273694754000000000000000000", + "alpha_below_one": "1649598817567567566743703799624553980690449407729193105799946206738436503969563334611674981901017993926946724907350242777037217332262644289410662456461452405333972075580808407045403132744659636847377/1651470099249107961380898815458386211599892413476873007939126669223349963802035987853893449814700485554074434664525288578821324912922904810667944151161616814090806265489319273694754000000000000000000", + "alpha_below_one_fourth": "410996243130736595708029688030764321990530097621538349845601204820924031118036343721254894539992629761390898908956276342921223647570465681409704343090239794765867376463818951774337632744659636847377/1651470099249107961380898815458386211599892413476873007939126669223349963802035987853893449814700485554074434664525288578821324912922904810667944151161616814090806265489319273694754000000000000000000", + "delta_positive": "1/8000000000000000000", + "delta_below_one_eighth": "999999999999999999/8000000000000000000", + "short_record_fallback": "50284589023755639450550561947992852913465435982210087302859165385722658942883811531989641634516383968749221857814449882621435887501656295301706001999427642810130314654325274095462490292340911783154748095539039217711968081469021320817854289360191881492365590119398439280952169129815427826165501507629212226183536366779259610196729558300895864773/50398867774936156048001062483471258898922497969875274900486043372294615594544555293392744440145888841371900471939858660242350003446133569661497319066211450625329781051309792288047912597656250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "small_field_exposure": "1/1000000000000000000", + "artificial_boundary": "46248647905701184502994092243542020713267905454447515571451892035362508353573841615159615339773469519511222083986859962853394049210320886809606200206556095266907716722400641979368337398233978910542131/6605880396996431845523595261833544846399569653907492031756506676893399855208143951415573799258801942216297738658101154315285299651691619242671776604646467256363225061957277094779016000000000000000000", + "literal_scalar_guard": "1", + "row_product_gap": "23971789/25", + "balanced_prefix_above_kappa": "550042988388611688369205823989077886773965515878728726747932211633432067386799257451668462594712434857941333397055768012640812633662078222152713997053717290771577011531200424585191/412867524812276990345224703864596552899973103369218251984781667305837490950508996963473362453675121388518608666131322144705331228230726202666986037790404203522701566372329818423688500000000000000000", + "coordinate_movement_above_kappa": "78452961352847598918516394278971659481331432859237066649424129667134808630398853391912761178763207537908109793203831464837997733885657643609588447593436647051/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_phase_layer_above_kappa": "54870185430533879209592448049792533549596965003804189905260217731037830574516104195278040056414925387769089892369778347174192562172540807794291183705325234899550178063548242464601/165147009924910796138089881545838621159989241347687300793912666922334996380203598785389344981470048555407443466452528857882132491292290481066794415116161681409080626548931927369475400000000000000000", + "bulk_exposure_above_kappa": "78452961352847598918516394278971659481331432859237066649424129667134808630398853391912761178763207537908109793203831464837997733885657643609588447593436647051/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Gaussian_arithmetic_above_kappa": "4672012566095017110455046145179280659383717220367477108119098713076538168683698149591961776978647743841875247691579066755199689856285989527773563574955434617118216520775908609126171/6605880396996431845523595261833544846399569653907492031756506676893399855208143951415573799258801942216297738658101154315285299651691619242671776604646467256363225061957277094779016000000000000000000", + "scalar_work_above_kappa": "7974952764593233033216843776096053082583502047321223123997352051523238096287770125299748676608048714950024117020629643912842339682131799149109451877278668245299829051754547156515679/6605880396996431845523595261833544846399569653907492031756506676893399855208143951415573799258801942216297738658101154315285299651691619242671776604646467256363225061957277094779016000000000000000000", + "dimension_above_kappa": "411931883971506793163802659524015135469232720619859634789183848572891235797423214669958704933124136063149853928581112713236002168825041809973826595871674018630012430681387472347888511531200424585191/412867524812276990345224703864596552899973103369218251984781667305837490950508996963473362453675121388518608666131322144705331228230726202666986037790404203522701566372329818423688500000000000000000" + }, + "outer_controls": [ + "next_grid", + "zero_eta", + "zero_beta", + "unit_beta" + ], + "bootstrap": [ + { + "gap": "77700191184163087736308252660500911393801/62500000000000000000000000000000000000000000000", + "cutoff_log2": "23292621022833" + }, + { + "gap": "22035500823998869930507930842150868768654091410330107949400549/15625000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "18100755477578231773" + }, + { + "gap": "6249190499590723752847946110114538620601182257691815838869237387367034660501227601/3906250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "14066143459678166113736944" + }, + { + "gap": "1772248437287297768063758813231463857764748822643053531819635241254009676979099435670084333982024596749/976562500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "10930836123019037656056314603016" + }, + { + "gap": "502603420982761311539041506293808216479242223973462530201407562553643345749374692386480249099696279705752331693888441501401/244140625000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "8494380758365423758936869721476641843" + }, + { + "gap": "142536561730721028340518668567140762933350575870332865191369601146608087238821236792462091890206796168535162002266114342356390411552406563352949/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "6601005051767263055251893981415233874399241" + } + ], + "bit_template_sha256": "f9ce9ac945d9e8ea737dc5e456e366a7e2a21d8b989d24b742d7f124d26fb32f", + "complex_template_sha256": "942d030fa43316c560c88d7d7d904583446e1a96945b3ebd37a91c88a192ab4f", + "scope": "Finite research composition with explicit changed words, exact local and global replay and incremental phase evidence. All-size correlated dirty-bank, compressed-window, compiler, restored-work, tape/common-grid, precision and analytic interfaces remain inherited assumptions. This certificate makes no unconditional integer-multiplication or Lean-kernel claim." +} diff --git a/research/e8-early-reset-kernel/local-evidence/AUDIT.json b/research/e8-early-reset-kernel/local-evidence/AUDIT.json new file mode 100644 index 0000000000..643c814b0b --- /dev/null +++ b/research/e8-early-reset-kernel/local-evidence/AUDIT.json @@ -0,0 +1,34 @@ +{ + "status": "PASS_INDEPENDENT_COMPRESSED_BIT_TEMPLATE_AUDIT", + "template_sha256": "f9ce9ac945d9e8ea737dc5e456e366a7e2a21d8b989d24b742d7f124d26fb32f", + "source_frames": 944, + "exact_nested_frame_pairs": 3357, + "exact_reflected_pairs": 3357, + "orthogonal_lift_argument": "Adding the same orthogonal E_s leaves P_V-P_U unchanged; each audited projector is therefore the literal child projector in every one of the nine windows.", + "exact_bank_families": 6579, + "mixed_width_slots": true, + "entrance_rank_total": 128, + "mutations_rejected": [ + "omit an idle child", + "omit a bridge", + "omit terminal exchange", + "remove a local invocation", + "re-use a helper bank slot", + "understate live stock", + "omit a local paid move", + "wrong reflected copy charge" + ], + "profile": { + "1": 178560, + "2": 74232, + "3": 22248, + "4": 23328, + "5": 9576, + "7": 6768, + "8": 648, + "14": 3840, + "28": 3840, + "42": 3840 + }, + "seconds": 1.8856884160777554 +} diff --git a/research/e8-early-reset-kernel/local-evidence/BIT-PRICE.json b/research/e8-early-reset-kernel/local-evidence/BIT-PRICE.json new file mode 100644 index 0000000000..0339fa04e3 --- /dev/null +++ b/research/e8-early-reset-kernel/local-evidence/BIT-PRICE.json @@ -0,0 +1,17 @@ +{ + "lower": "0.001134385925603239057397", + "upper": "0.001134385925603239057398", + "lower_endpoint_residual_upper": "-1.208815110554072546890868962118806453466727141708111658528148771609217E-24", + "upper_endpoint_residual_lower": "1.206647999073094385830833942650340983281407775833257592984711501729879E-24", + "strict_rational_signs": true, + "moment_minus_one_at_current_k_required_rate": [ + "-0.001059935772403113935979679141367753634160753707351085784521072950941911", + "-0.001059935772403113935979679141367753634160753707351085784521072950867727" + ], + "nominal_k_ceiling_interval": [ + "0.001133100552284434337978314624649498572528216136568917723800228264595422", + "0.001133100552284434337979312359732310865246830293765932499225360045604731" + ], + "source_template_sha256": "f9ce9ac945d9e8ea737dc5e456e366a7e2a21d8b989d24b742d7f124d26fb32f", + "two_exact_engines": true +} diff --git a/research/e8-early-reset-kernel/local-evidence/FULL-PYTHON311.json b/research/e8-early-reset-kernel/local-evidence/FULL-PYTHON311.json new file mode 100644 index 0000000000..e78af127aa --- /dev/null +++ b/research/e8-early-reset-kernel/local-evidence/FULL-PYTHON311.json @@ -0,0 +1,49 @@ +{ + "status": "PASS_FULL_EARLY_RESET_KERNEL_COMPOSITION", + "kappa": "566550276142217/500000000000000000", + "kappa_decimal": "0.001133100552284434", + "source_manifest_sha256": "fcc4de6a0a0bc14011be74ce43402c20490c0441a8688534be23f0f86aa5bfea", + "checks": [ + { + "name": "full-early-reuse434", + "seconds": 120.78334466693923, + "log_sha256": "c0edbb5dd9975ae1879cf20f98ed89b925ff3f9b695f027aca13f4930a6f81a6" + }, + { + "name": "kernel-reconstruction", + "seconds": 0.07485416706185788, + "log_sha256": "3f693dcbe49585d9ce689315e42a81cc7e4a4e45f0990c938217fb43c5150f28" + }, + { + "name": "export", + "seconds": 0.5898666669381782, + "log_sha256": "6c647e3d28cf94ce9f8b9fdcfc5c10797c18d488d74fe09b8de8671dfd7ae107" + }, + { + "name": "integer-source-spans", + "seconds": 0.06577295798342675, + "log_sha256": "bdf95dbce8337be57aab8a3d3b42a711ee276496c40cbb4c5356fc9cc9b2e811" + }, + { + "name": "global-program", + "seconds": 2.7857714579440653, + "log_sha256": "7e97172f5d1a084d7e5b043f4cb772d5d42389a151211c114e5a4632638cc826" + }, + { + "name": "independent-audit", + "seconds": 3.3599830419989303, + "log_sha256": "4ea14031d43b401b0349f6ec33ff189f633e00cc89d1e10017b1df4438e17cf4" + }, + { + "name": "two-moments", + "seconds": 0.13630245893727988, + "log_sha256": "59229b1eb12d77f6e25381ed1715fb134898e731fb30ba564789d62a44253478" + }, + { + "name": "finite-assembly", + "seconds": 0.15192366705741733, + "log_sha256": "e9af1d9589b520a86e59f494ff0a0f18609be39722dc55dc28ed91951b7b2134" + } + ], + "parent_phase_mode": "full replay" +} diff --git a/research/e8-early-reset-kernel/local-evidence/FULL-PYTHON314.json b/research/e8-early-reset-kernel/local-evidence/FULL-PYTHON314.json new file mode 100644 index 0000000000..37155858c0 --- /dev/null +++ b/research/e8-early-reset-kernel/local-evidence/FULL-PYTHON314.json @@ -0,0 +1,49 @@ +{ + "status": "PASS_FULL_EARLY_RESET_KERNEL_COMPOSITION", + "kappa": "566550276142217/500000000000000000", + "kappa_decimal": "0.001133100552284434", + "source_manifest_sha256": "fcc4de6a0a0bc14011be74ce43402c20490c0441a8688534be23f0f86aa5bfea", + "checks": [ + { + "name": "full-early-reuse434", + "seconds": 111.79458600003272, + "log_sha256": "c0edbb5dd9975ae1879cf20f98ed89b925ff3f9b695f027aca13f4930a6f81a6" + }, + { + "name": "kernel-reconstruction", + "seconds": 0.06413062498904765, + "log_sha256": "3f693dcbe49585d9ce689315e42a81cc7e4a4e45f0990c938217fb43c5150f28" + }, + { + "name": "export", + "seconds": 0.37764429196249694, + "log_sha256": "6c647e3d28cf94ce9f8b9fdcfc5c10797c18d488d74fe09b8de8671dfd7ae107" + }, + { + "name": "integer-source-spans", + "seconds": 0.08005450002383441, + "log_sha256": "bdf95dbce8337be57aab8a3d3b42a711ee276496c40cbb4c5356fc9cc9b2e811" + }, + { + "name": "global-program", + "seconds": 2.7084261670242995, + "log_sha256": "8dd0f6c14d141094a7f0432bd7c2e065c7af228d161121e5355b7f6009a4f117" + }, + { + "name": "independent-audit", + "seconds": 1.9340536249801517, + "log_sha256": "e37173420f400387484e79ce9fa0309ea399ef891e44cbe28731b86c603f37a0" + }, + { + "name": "two-moments", + "seconds": 0.14735429198481143, + "log_sha256": "59229b1eb12d77f6e25381ed1715fb134898e731fb30ba564789d62a44253478" + }, + { + "name": "finite-assembly", + "seconds": 0.16268512490205467, + "log_sha256": "e9af1d9589b520a86e59f494ff0a0f18609be39722dc55dc28ed91951b7b2134" + } + ], + "parent_phase_mode": "full replay" +} diff --git a/research/e8-early-reset-kernel/local-evidence/GLOBAL.json b/research/e8-early-reset-kernel/local-evidence/GLOBAL.json new file mode 100644 index 0000000000..9d69b480fb --- /dev/null +++ b/research/e8-early-reset-kernel/local-evidence/GLOBAL.json @@ -0,0 +1,165 @@ +{ + "status": "PASS_SOURCE_BOUND_NINE_STAGE_BIT_TEMPLATE", + "h": 8, + "m": 64, + "v": 120, + "R": 747, + "replicas": 8, + "live": 14259, + "physical": 14268, + "word_sha256": "da4aa797d6dad909fd1faaa90abea749b026299ac8cad3ad0a4a248e16bdb5f5", + "source_records_sha256": "99cb283793818ad03f8f16f95a8eb23d0b18769d0657d58043fb7a427471c35d", + "local_checks": { + "forward": { + "copies": 9, + "adds": 14693, + "records": 19002, + "all_columns": 987, + "cancellation_free_row_l1": 4749881, + "profile": { + "1": 2480, + "2": 1031, + "3": 309, + "4": 324, + "5": 133, + "7": 14, + "8": 9 + }, + "sha256": "4ed9ed1f7756ea6ff2c299b61ed1dc3fe0fa5bbbb91b5170133596b452c8085e" + }, + "reverse": { + "copies": 9, + "adds": 14693, + "records": 19002, + "all_columns": 987, + "cancellation_free_row_l1": 18976518, + "profile": { + "1": 2480, + "2": 1031, + "3": 309, + "4": 324, + "5": 133, + "7": 14, + "8": 9 + }, + "sha256": "ceedc55929da7f5279c330cd9714e78a7c4e294f0cb8e446ace5707369440bd8" + } + }, + "scalar_stages": [ + { + "stage": 0, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": false + }, + { + "stage": 1, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": true + }, + { + "stage": 2, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": false + }, + { + "stage": 3, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": true + }, + { + "stage": 4, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": false + }, + { + "stage": 5, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": true + }, + { + "stage": 6, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": false + }, + { + "stage": 7, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": true + }, + { + "stage": 8, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": false + } + ], + "independent_unbanked_scalar_columns": 7683, + "all_scalar_columns_restored": true, + "geometry_sha256": "fc7b29b16ee754ca9717973b745d6322bbf8351a5e35e3fc9e0fbf7a88dc0317", + "template_sha256": "f9ce9ac945d9e8ea737dc5e456e366a7e2a21d8b989d24b742d7f124d26fb32f", + "emitted_program_sha256": "3c56fb306442103076c77a04ed28c2786c456ce3266808b1eeacf36b78a48475", + "emitted_events": 1368144, + "local_invocations": 72, + "bank_assignments": 53784, + "banks_per_stage": 731, + "entrance_rank_total": 128, + "mixed_width_slots": true, + "padding_calls": 0, + "profile": { + "1": 178560, + "2": 74232, + "3": 22248, + "4": 23328, + "5": 9576, + "7": 6768, + "8": 648, + "14": 3840, + "28": 3840, + "42": 3840 + }, + "paid_calls": 326880, + "rank_mass": 910080, + "deficit": 2496, + "maxchild": 42, + "halving_depth": 2, + "halving_integer_inequality": [ + 4096, + 3528 + ], + "local_additions": 14693, + "bridge_additions": 17280, + "copy_erase_episodes": 648, + "global_prefix_bound": "82190131489578773587585573345852919919075549029526266900008239366144", + "global_prefix_bits": 226, + "charged_prefix_bits": 256, + "omitted_bridge_shears_rejected": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17 + ], + "scope": "Complete source-bound finite cover template. Local and unbanked global F2 columns are replayed; arbitrary physical bank dirt follows by injective owner routes and the all-column local theorem. Astronomical cover enumeration and all-size compiler interfaces remain explicit inherited assumptions.", + "seconds": 2.6007981669390574 +} diff --git a/research/e8-early-reset-kernel/local-evidence/SOURCE-SPANS.log b/research/e8-early-reset-kernel/local-evidence/SOURCE-SPANS.log new file mode 100644 index 0000000000..d612f8c813 --- /dev/null +++ b/research/e8-early-reset-kernel/local-evidence/SOURCE-SPANS.log @@ -0,0 +1 @@ +{"status": "PASS_INDEPENDENT_F2_AND_INTEGER_SOURCE_SPANS", "columns": 987, "profile": {"1": 2480, "4": 324, "2": 1031, "3": 309, "5": 133, "8": 9, "7": 14}, "word_sha256": "da4aa797d6dad909fd1faaa90abea749b026299ac8cad3ad0a4a248e16bdb5f5"} diff --git a/research/e8-early-reset-kernel/source_span.py b/research/e8-early-reset-kernel/source_span.py new file mode 100644 index 0000000000..a8722a7e4f --- /dev/null +++ b/research/e8-early-reset-kernel/source_span.py @@ -0,0 +1,10 @@ +"""PR417/435 independent all-column replay, including integer source-span legality.""" +from pathlib import Path +import sys,json,hashlib +ROOT=Path(__file__).resolve().parent;sys.path.insert(0,str(ROOT/'vendor/kernel417')) +from e8core import Lat,replay +w=json.loads(Path(sys.argv[1]).read_text());frames=json.loads(Path(sys.argv[2]).read_text())['frames'];L=Lat(w['lines']);masks=[sum(1</2) for orthogonality + self.ip = [[sum(a * b for a, b in zip(x, y)) // 2 for y in self.lines] for x in self.lines] + + def close(self, mask): + """mask of all root lines in span(roots of mask)""" + if mask in self._close: return self._close[mask] + idx = [i for i in range(self.v) if mask >> i & 1] + basis = [] + for i in idx: + if rank([self.lines[j] for j in basis] + [self.lines[i]]) > len(basis): basis.append(i) + d = len(basis); out = 0 + if d == 8: out = (1 << self.v) - 1 + elif d: + B = [self.lines[j] for j in basis] + for i in range(self.v): + if rank(B + [self.lines[i]]) == d: out |= 1 << i + self._close[mask] = out; self._close[out] = out; self._dim[out] = d + return out + + def dim(self, mask): + if mask not in self._dim: self.close(mask) + return self._dim[mask] + + def basis(self, mask): + b = [] + for i in range(self.v): + if mask >> i & 1 and rank([self.lines[j] for j in b] + [self.lines[i]]) > len(b): b.append(i) + return b + + def perp(self, t): + return self.close(sum(1 << j for j in range(self.v) if self.ip[t][j] == 0)) + + +def to_masks(c, L): + return [L.close(sum(1 << i for i in fr)) for fr in c['frames']] + + +PHASES = ('D', 'A', 'B', 'C') + + +def replay(c, L=None, masks=None, check_f2=True, span=True, span_mode='z'): + """Exact legality + F2 replay + histogram of a bitE8/1 word. Returns dict(H_local, steps, ...). + Legality: each register's frames nested (mask inclusion = exact Q-subspace inclusion for root-spanned frames) and + strictly increasing at each move; every gate at one common frame; D compensation at frame 0; y at frame 0 at the + scatter; COPY of retained totals; final frames (x, helpers FULL; y_t at its cap t-perp). + Source-span: every non-target operand's x-support lies in the gate frame.""" + L = L or Lat(c['lines']); masks = masks or to_masks(c, L) + v, R, h = c['v'], c['R'], c['h']; n = 2 * v + R; FULL = (1 << v) - 1 + cur = [masks[f] for f in c['start']] + for r in range(v): assert cur[r] == L.close(1 << r), 'x start' + for r in range(v, 2 * v): assert cur[r] == 0, 'y start at 0' + sig = [L.dim(cur[r]) for r in range(n)] + H = Counter(); steps = 0; viol = [] + val = [1 << i for i in range(n)] + zsupp = [{i: 1} if i < v else {} for i in range(n)] # integer support of each register over the x columns (all ADDs are +1) + def climb(r, m): + nonlocal steps + if cur[r] == m: return + assert cur[r] & ~m == 0 and cur[r] != m, ('not nested', r) + H[L.dim(m) - L.dim(cur[r])] += 1; steps += 1; cur[r] = m + def run(gates, ph): + for k, (f, d, srcs) in enumerate(gates): + m = masks[f] + assert d not in srcs and len(set(srcs)) == len(srcs), (ph, k) # rohanarun: source destinations allowed (#433 source-basis gates); spans checked below + for x in [d] + srcs: climb(x, m) + for s in srcs: + val[d] ^= val[s] + if span: + if s < v or s >= 2 * v: + ms = sum(1 << i for i in zsupp[s]) + if ms & ~m: viol.append((ph, k, s)) + zd = zsupp[d] + for i, a in zsupp[s].items(): + w = zd.get(i, 0) + a + if w: zd[i] = w + else: zd.pop(i, None) + if span_mode == 'f2': + zsupp[d] = {i: 1 for i in range(v) if val[d] >> i & 1} + if span and (d >= 2 * v or d < v): + md = sum(1 << i for i in zsupp[d]) + if md & ~m: viol.append((ph, k, d)) + run(c['D'], 'D') + for r in range(v, n): assert cur[r] == masks[c['start'][r]], 'D compensation at frame 0 (helpers untouched otherwise)' + run(c['A'], 'A') + for t in range(v): assert cur[v + t] == 0, 'y at frame 0 at the scatter' + copies = [val[q] for q in c['ret']] + for q in c['ret']: + assert q >= 2 * v or q < v; H[L.dim(cur[q])] += 1 # rohanarun: #433 retains totals in source rows + for t, row in enumerate(c['scatter']): + for k in row: val[v + t] ^= copies[k] + run(c['B'], 'B'); run(c['C'], 'C') + for r in range(n): climb(r, masks[c['final'][r]]) + for r in range(v): assert cur[r] == FULL + for r in range(2 * v, n): assert cur[r] == FULL + for t in range(v): assert cur[v + t] == L.perp(t), 'y final at cap' + if check_f2: + for s in range(v): assert val[s] == 1 << s + for t in range(v): assert val[v + t] == (1 << (v + t)) | (1 << t), ('target', t) + for r in range(2 * v, n): assert val[r] == 1 << r, ('helper', r) + return dict(sig=sig, viol=viol, H=H, steps=steps, n=n, v=v, R=R, h=h, L=L, masks=masks, ncopy=len(c['ret'])) + + +def profile(H_local, v, h=8): + prof = Counter({j: 5 * c for j, c in H_local.items()}) + for j in (2 * h - 2, h - 1, 2 * h + 2, 4): prof[j] += 2 * v + return prof + + +def coarse(H, m, W): + grid = Q(1, 10**18) + root = moment.certify(dict(H), m, W, True); c = Q(int(Q(root['lower']) * 10**18), 10**18) + assert moment.moment(H, m, W, c, True)[1] < 1 < moment.moment(H, m, W, c + grid, True)[0] + fb = 32 * m * m * sum(H.values()) + _, up = other.moment(m, W, list(H.items()), c); _, bad = other.moment(m, W, [(1, fb)], c) + lo, _ = other.moment(m, W, list(H.items()), c + grid); blo, _ = other.moment(m, W, [(1, fb)], c + grid) + assert up + Q(1, 10**16) * bad < 1 < lo + Q(1, 10**16) * blo + return c + + +def kappa(c, b): + grid = Q(1, 10**18); eta = Q(1, 10**12); beta = Q(1, 10**9); cap = (1 - beta) * b + sv = min(c, Q(((cap - grid) * 10**18).__floor__(), 10**18)); binding = 'bit' if sv == c else 'complex' + chain = [Q(384599, 10**10)] + for _ in range(3): + a = (1 - sv) * sv + sv * chain[-1]; assert chain[-1] < a < sv < 1 - a; chain.append(a) + bit = chain[-1] + bridge = dict(proof='PROOF.md', representation='Exact powers with source-bound finite overcharges', + semantic=dict(G=dict(base=2, exponent=30000), E=dict(base=2, exponent=100000), B_upper=dict(base=2, exponent=100001), + C0=dict(base=2, exponent=210000), C1=1, strict_literal_gap=1, induction_gap_lower=1), + rows=dict(coefficient=20161, degree=10**6, suffix_slope=4 * 10**6, degree_gap=Q(10**6) - Q(51 * 20161, 25))) + q = bit * (1 - 2 * eta); mn = (1 - eta) * q / (1 + q); t = mn * 10**18; k = Q((t.numerator - 1) // t.denominator, 10**18) + asm = outer.assembly(bit, b, bridge, k, eta=eta, beta=beta) + assert len(asm['strict_constraints']) == 47 and min(asm['strict_constraints'].values()) > 0 + try: + outer.assembly(bit, b, bridge, k + grid, eta=eta, beta=beta); raise SystemExit('ADJACENT ADMITTED') + except AssertionError: pass + return k, binding + + +def price_word(c, **kw): + r = replay(c, **kw) + v, h, R = r['v'], r['h'], r['R']; m = 5 * h + resid = sum(h - r['sig'][x] for x in range(2 * v, 2 * v + R)) + T = 1 if resid % h == 0 else h + W = (4 * v * h + resid) * T // h; assert (4 * v * h + resid) * T % h == 0 + prof = Counter({j: T * k for j, k in profile(r['H'], v, h).items()}); mass = sum(a * b for a, b in prof.items()) + L_copy = h * r['ncopy'] + assert m * W - mass == T * (4 * v - 5 * L_copy), ('deficit', m * W - mass) + assert 2 * max(prof) < m + cc = coarse(prof, m, W) + return dict(c=cc, H=r['H'], prof=prof, W=W, T=T, resid=resid, m=m, deficit=m * W - mass, replay=r) + + +def phi_fn(m, W, a): + """linearized moment term per child of rank r (float), for search scoring""" + import math + return lambda r: r / (m * W) * math.exp(a * math.log(m / r)) diff --git a/research/e8-early-reset-kernel/vendor/kernel417/engines/base_two_moment.py b/research/e8-early-reset-kernel/vendor/kernel417/engines/base_two_moment.py new file mode 100644 index 0000000000..14a90fa0e7 --- /dev/null +++ b/research/e8-early-reset-kernel/vendor/kernel417/engines/base_two_moment.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +"""Maintainer arithmetic cross-check of the pinned PR39 certificate. + +Uses no producer/checker imports. Counts are inputs, not proved by this script. +80-term rational logarithms and 12-term exponentials independently enclose +the two moments. The accompanying written review addresses their realization. +""" +import argparse +from fractions import Fraction as Q +from hashlib import sha256 +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +GRID = 10**30 + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def log_unit(x): + require(1 <= x <= 2, "logarithm range") + z = (x-1)/(x+1) + lo = 2*sum((z**(2*j+1)/(2*j+1) for j in range(80)), Q(0)) + return lo, lo+2*z**161/(161*(1-z*z)) + + +def log_bounds(x): + k = 0 + while x > 2: + x /= 2 + k += 1 + lo, hi = log_unit(x) + l2, u2 = log_unit(Q(2)) + lo, hi = lo+k*l2, hi+k*u2 + # Outward rational rounding keeps later certificates compact. + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + + +def exp_bounds(x): + require(0 <= x < 1, "exponential range") + term = total = Q(1) + for j in range(1, 13): + term *= x/j + total += term + tail = term*x/13/(1-x/14) + return total, total+tail + + +def moment(m, W, entries, saving): + lo = hi = Q(0) + for t, count in entries: + t, count = int(t), int(count) + require(0 < t < m and count > 0, "improper child") + l, u = log_bounds(Q(m, t)) + lower = exp_bounds(saving*l)[0] + upper = exp_bounds(saving*u)[1] + lo += Q(t*count, m*W)*lower + hi += Q(t*count, m*W)*upper + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + diff --git a/research/e8-early-reset-kernel/vendor/kernel417/engines/moment.py b/research/e8-early-reset-kernel/vendor/kernel417/engines/moment.py new file mode 100644 index 0000000000..7d697cb452 --- /dev/null +++ b/research/e8-early-reset-kernel/vendor/kernel417/engines/moment.py @@ -0,0 +1,113 @@ +"""Independent prospective ordinary five-stage cost, never supplier admission. + +Consumes a raw one-invocation ledger made from the actual source/internal/target +paths. No packed profile is used as an input. Missing physical/finite/compiler +obligations must remain explicit in the accompanying report. +""" +from collections import Counter +from decimal import Decimal, localcontext, ROUND_FLOOR +from fractions import Fraction as F +from functools import lru_cache +from math import factorial +import hashlib, json, sys +from pathlib import Path + +DYAD = 1 << 224 + +def floor(x): return F(x.numerator*DYAD//x.denominator, DYAD) +def ceil(x): return -floor(-x) + +@lru_cache(None) +def logarithm(x): + """Mercator bounds after binary reduction; ln(2) via two Mercator sums. + + For 1 <= y < 2, log(y) is an alternating series in z=y-1. + We instead reduce to 1 <= y < 3/2, and bound log(3/2) and + log(2) by the same alternating series at z=1/2 and z=1/3, + using log(2)=log(3/2)+log(4/3). All sums are exact rationals. + """ + assert x >= 1 + k = 0 + while x >= 2: x /= 2; k += 1 + j = int(x >= F(3, 2)) + if j: x /= F(3, 2) + def mercator(y): + z=y-1 + assert 0 <= z <= F(1,2) + # An even partial sum is below log; the next term bounds its tail. + t=z; s=F(0) + for n in range(1, 225): + s += (t if n & 1 else -t)/n + t *= z + return s, s+t/225 + a,b=mercator(x); c,d=mercator(F(3,2)); e,f=mercator(F(4,3)) + return floor(a+(k+j)*c+k*e), ceil(b+(k+j)*d+k*f) + +def exponential(l,u): + assert 0 <= l <= u < F(1,10) + def poly(x): + s=t=F(1) + for j in range(1,25): t=t*x/j; s+=t + return s,t + lo,_=poly(l);hi,last=poly(u) + return floor(lo),ceil(hi+last*u/25/(1-u/26)) + +def moment(H,m,W,a,bad=False): + lo=hi=F(0) + for r,n in H.items(): + assert 0 < r < m and n > 0 + l,u=logarithm(F(m,r)); e,f=exponential(a*l,a*u) + p=F(r*n,m*W);lo+=p*e;hi+=p*f + if bad: + # Existing envelope shape, only conditionally portable to the new cover. + l,u=logarithm(F(m));e,f=exponential(a*l,a*u) + p=F(32*m*sum(H.values()),10**16*W) + lo+=p*e;hi+=p*f + return floor(lo),ceil(hi) + +def decimal(x): + with localcontext() as c: + c.prec=70 + return str(Decimal(x.numerator)/Decimal(x.denominator)) + +def certify(H,m,W,bad=False): + with localcontext() as c: + c.prec=70 + terms=[(Decimal(r*n)/Decimal(m*W),(Decimal(m)/Decimal(r)).ln()) for r,n in H.items()] + fallback=Decimal(32*m*sum(H.values()))/Decimal(10**16*W) if bad else Decimal(0) + lm=Decimal(m).ln();lo=Decimal(0);hi=Decimal('.003') + for _ in range(210): + a=(lo+hi)/2 + if sum(p*(a*l).exp() for p,l in terms)+fallback*(a*lm).exp()<1:lo=a + else:hi=a + q=int(((lo+hi)/2*10**24).to_integral_value(rounding=ROUND_FLOOR)) + lo=F(q,10**24);hi=lo+F(1,10**24) + lv=moment(H,m,W,lo,bad);hv=moment(H,m,W,hi,bad) + assert lv[1]<10 for v in slacks.values()),{k:str(v) for k,v in slacks.items() if v<=0} + assert min(margins.values())==minimum + assert margins['balanced_prefix']-minimum==eta and 1-eps-r==eta/2 + assert 1-eps*(1+c)==eta-eps*eta/4 + return dict(parameters=dict(a_bit=a,a_complex=b,tau=tau,sigma=sigma, + eta=eta,beta=beta,q=q,c=c,epsilon=eps,lambda_=lam, + lambda_prime=lp,alpha_squared_power=r,delta=delta, + C0=bridge['semantic']['C0'],C1=1,kappa=kappa), + strict_constraints=slacks,margins=margins,minimum_margin=minimum, + absorption_gap=minimum-kappa, + recurrence=dict(internal=internal,leaf=leaf,reservations=1-c)) diff --git a/research/e8-early-reset-kernel/vendor/kernel417/stages.py b/research/e8-early-reset-kernel/vendor/kernel417/stages.py new file mode 100644 index 0000000000..9ef95d52f4 --- /dev/null +++ b/research/e8-early-reset-kernel/vendor/kernel417/stages.py @@ -0,0 +1,143 @@ +"""Transcript stages on the E8 bit word (bitE8/1), applied from frozen selections, each bound to the exact input word. + +retime (our #329 descent2 / #287 concave retiming, ported to E8 frames): every selected gate g gets a new frame F with + close(LB_g + prev frames of its participants) <= F <= rootspan(AND of their next frames), where LB_g is the + x-support of the non-target operands (source-span rule); pinned: D gates (frame 0), y at frame 0 at the scatter, + retained totals at FULL at COPY, start and final frames. Checked on the joint retimed configuration. +kernel (our #320/#329 shared-donor response kernel; #272/#299/#319 lineage): entry = pivot p, entrance E, donors D with + resp(p) = XOR resp(D) over F2, where resp(h) = the targets whose frame-0 completion (D) gates read h; E inside the + first frame of p and of every donor. p starts at E and leaves the D gates; each donor climbs to E at the start of + A and pays d += (its pivots) at E; after C it pays d += (its pivots) again at FULL (F2: d -= p). + Exclusivity: pivots are never donors, a donor serves one entrance. Total entrance rank = 0 mod 8 (integral + B_4 width W; the residuals then tile width-72 banks with 9 replicas, checked separately). + +usage: stages.py retime|kernel IN.json.gz OUT.json.gz SELECTION.json +After applying, the full exact replay of e8core (legality, F2 on all columns, source spans) must pass and the output +must equal the frozen output content hash. (This package uses the kernel stage only: on PR #376's word our retiming +descent finds no move, before or after the kernel.) +Chafik Boukhalfa (chafreaky) with Anthropic Claude assistance; Apache-2.0.""" +import sys, os, json, hashlib +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from e8core import * + + +def content_sha(c): + return hashlib.sha256(json.dumps(c, sort_keys=True, separators=(',', ':')).encode()).hexdigest() + + +class Framer: + def __init__(self, c): + self.fl = c['frames']; self.key = {}; self.v = c['v'] + for k, fr in enumerate(self.fl): self.key.setdefault(sum(1 << i for i in fr), k) + def fid(self, m): + if m not in self.key: self.key[m] = len(self.fl); self.fl.append([i for i in range(self.v) if m >> i & 1]) + return self.key[m] + + +def mask_of(lines): return sum(1 << i for i in lines) + + +def occurrences(c, masks): + """per register: list of (kind, ref) with pins ('p', mask) and gates ('g', (phase, k)) in time order""" + v = c['v']; n = 2 * v + c['R']; FULL = (1 << v) - 1 + occ = [[('p', masks[c['start'][r]])] for r in range(n)] + for ph in ('D', 'A'): + for k, (f, d, s) in enumerate(c[ph]): + for x in [d] + s: occ[x].append(('g', (ph, k))) + for t in range(v): occ[v + t].append(('p', 0)) + for q in c['ret']: occ[q].append(('p', FULL)) + for ph in ('B', 'C'): + for k, (f, d, s) in enumerate(c[ph]): + for x in [d] + s: occ[x].append(('g', (ph, k))) + for r in range(n): occ[r].append(('p', masks[c['final'][r]])) + return occ + + +def lower_bounds(c, L): + v = c['v']; n = 2 * v + c['R']; sup = [1 << i if i < v else 0 for i in range(n)]; lb = {} + for ph in ('D', 'A', 'B', 'C'): + for k, (f, d, srcs) in enumerate(c[ph]): + need = 0 + for s in srcs: + sup[d] |= sup[s] + if s < v or s >= 2 * v: need |= sup[s] + if d >= 2 * v: need |= sup[d] + lb[(ph, k)] = L.close(need) if need else 0 + return lb + + +def retime(c, sel): + L = Lat(c['lines']); masks = to_masks(c, L); occ = occurrences(c, masks); lb = lower_bounds(c, L) + gm = {(ph, k): masks[g[0]] for ph in ('D', 'A', 'B', 'C') for k, g in enumerate(c[ph])} + pos = {} + for r, o in enumerate(occ): + for i, (kind, x) in enumerate(o): + if kind == 'g': pos.setdefault(x, []).append((r, i)) + def fr(r, i): + kind, x = occ[r][i]; return x if kind == 'p' else gm[x] + seen = set() + for ph, k, old_lines, new_lines in sel: + g = (ph, k); assert ph != 'D' and g not in seen; seen.add(g) + assert gm[g] == L.close(mask_of(old_lines)), ('selection not bound to this word', g) + F = L.close(mask_of(new_lines)); assert F == mask_of(new_lines), 'frame given as all its root lines' + gm[g] = F + for g in seen: # the joint retimed configuration: every moved gate inside its feasible interval + F = gm[g]; lo = lb[g]; hi = (1 << c['v']) - 1 + for r, i in pos[g]: lo |= fr(r, i - 1); hi &= fr(r, i + 1) + assert lo & ~F == 0 and F & ~hi == 0, ('outside the feasible interval', g) + out = json.loads(json.dumps(c)); fm = Framer(out) + for ph in ('D', 'A', 'B', 'C'): + out[ph] = [[fm.fid(gm[(ph, k)]), d, list(s)] for k, (f, d, s) in enumerate(c[ph])] + return out + + +def kernel(c, sel): + L = Lat(c['lines']); masks = to_masks(c, L); v = c['v']; n = 2 * v + c['R']; FULL = (1 << v) - 1 + occ = occurrences(c, masks) + gm = {(ph, k): masks[g[0]] for ph in ('D', 'A', 'B', 'C') for k, g in enumerate(c[ph])} + first = {} + for h in range(2 * v, n): + assert masks[c['start'][h]] == 0 + first[h] = next(x if kind == 'p' else gm[x] for kind, x in occ[h][1:] if (x if kind == 'p' else gm[x]) != 0) + resp = {} + for f, t, srcs in c['D']: + assert masks[f] == 0 + for s in srcs: resp[s] = resp.get(s, 0) ^ (1 << (t - v)) + ret = set(c['ret']); pivots = {}; donor_at = {}; tot = 0 + for E_lines, p, D in sel: + E = L.close(mask_of(E_lines)); assert E == mask_of(E_lines) and E != 0 + assert p not in ret and p not in pivots and p not in donor_at and 2 * v <= p < n + x = resp.get(p, 0) + for d in D: + assert d not in ret and d not in pivots and 2 * v <= d < n + assert donor_at.setdefault(d, E) == E, 'donor serves one entrance' + x ^= resp.get(d, 0) + assert x == 0, ('response relation fails', p) + for h in [p] + D: assert E & ~first[h] == 0, ('entrance not inside first frame', h) + pivots[p] = E; tot += L.dim(E) + assert not set(pivots) & set(donor_at) + assert tot % 8 == 0, 'total entrance rank 0 mod 8' + out = json.loads(json.dumps(c)); fm = Framer(out) + for p, E in pivots.items(): out['start'][p] = fm.fid(E) + out['D'] = [[f, t, [s for s in srcs if s not in pivots]] for f, t, srcs in c['D']] + byd = {} + for E_lines, p, D in sel: + for d in D: byd.setdefault((d, mask_of(E_lines)), []).append(p) + out['A'] = [[fm.fid(E), d, sorted(ps)] for (d, E), ps in sorted(byd.items())] + out['A'] + out['C'] = out['C'] + [[fm.fid(FULL), d, sorted(ps)] for (d, E), ps in sorted(byd.items())] + return out, len(sel), tot, len(byd) + + +if __name__ == '__main__': + st, inp, outp, selp = sys.argv[1:5] + c = load_word(inp); sel = json.load(open(selp)) + assert sel['input_sha256'] == content_sha(c), 'selection bound to a different input word' + if st == 'retime': + w = retime(c, sel['gates']); info = '%d gates retimed' % len(sel['gates']) + else: + w, ne, tot, nd = kernel(c, sel['entries']); info = '%d entries, total entrance rank %d, %d donor slots' % (ne, tot, nd) + r = replay(w, span_mode='z'); assert not r['viol'], r['viol'][:5] + assert content_sha(w) == sel['output_sha256'], 'output differs from the frozen stage output' + save_word(w, outp) + print(' stage %s: %s | exact replay PASS (legality, F2 on %d columns, source spans) | local histogram %s | output sha %s' + % (st, info, r['n'], dict(sorted(r['H'].items())), sel['output_sha256'][:16])) diff --git a/research/e8-early-reset-kernel/verify.py b/research/e8-early-reset-kernel/verify.py new file mode 100644 index 0000000000..2cb303ae52 --- /dev/null +++ b/research/e8-early-reset-kernel/verify.py @@ -0,0 +1,32 @@ +"""Fresh parent replay, chronological reset reconstruction, banks and exact assembly.""" +from pathlib import Path +import hashlib,json,os,subprocess,sys,time +assert __debug__ +ROOT=Path(__file__).resolve().parent;PARENT=ROOT.parent/'e8-early-reset-reuse';UPSTREAM=ROOT.parent/'split-centres-global';out=Path(sys.argv[1]).resolve();assert not out.exists() and not out.is_relative_to(ROOT.parent) +read=lambda p:json.loads(p.read_text());sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest() +def integrity(): + assert {p.relative_to(ROOT).as_posix():sha(p) for p in ROOT.rglob('*') if p.is_file() and p.name!='MANIFEST.json'}==read(ROOT/'MANIFEST.json')['files'] + assert sha(PARENT/'MANIFEST.json')==read(ROOT/'SOURCE.json')['parent_manifest_sha256'] +integrity();out.mkdir(parents=True);env=dict(os.environ,PYTHONDONTWRITEBYTECODE='1',PYTHONINTMAXSTRDIGITS='0');env.pop('PYTHONOPTIMIZE',None);steps=[] +def run(name,file,*args,cwd=None): + t=time.monotonic();log=out/(name+'.log');print('RUN',name,flush=True) + with log.open('w') as f:q=subprocess.run([sys.executable,'-B',str(file),*map(str,args)],cwd=cwd,env=env,stdout=f,stderr=subprocess.STDOUT) + if q.returncode:raise RuntimeError((name,q.returncode,log.read_text()[-2000:])) + steps.append(dict(name=name,seconds=time.monotonic()-t,log_sha256=sha(log)));print('PASS',name,flush=True) +try: + base=out/'baseline';run('full-early-reuse434',PARENT/'verify.py',base) + changed=out/'changed';changed.mkdir() + for name in ('work','inherited','split-centres'):(changed/name).symlink_to(base/'baseline'/name,target_is_directory=True) + bit=changed/'bit426-source-centres';bit.mkdir() + run('kernel-reconstruction',ROOT/'apply.py',base/'changed/bit426-source-centres/bit-source-centres.json',bit/'bit-source-centres.json') + run('export',UPSTREAM/'vendor/export_records.py',bit/'bit-source-centres.json',bit/'records') + run('integer-source-spans',ROOT/'source_span.py',bit/'bit-source-centres.json',bit/'records/frames.json') + run('global-program',ROOT/'bit_global.py','--source',bit,'--local-check',bit,'--out',bit/'global',cwd=changed) + run('independent-audit',ROOT/'bit_audit.py','--local-check',bit,'--out',bit/'global',cwd=changed) + run('two-moments',ROOT/'bit_price.py',cwd=changed) + env['E8_OUTPUT']=str(changed);run('finite-assembly',ROOT/'combined.py',cwd=changed) + actual=read(changed/'RESULT.json');expected=read(ROOT/'EXPECTED.json') + for k,v in expected.items():assert actual[k]==v,(k,actual[k],v) + integrity();result=dict(status='PASS_FULL_EARLY_RESET_KERNEL_COMPOSITION',kappa=actual['kappa'],kappa_decimal=actual['kappa_decimal'],source_manifest_sha256=sha(ROOT/'MANIFEST.json'),checks=steps,parent_phase_mode=read(base/'RESULT.json')['parent_phase_mode']);(out/'RESULT.json').write_text(json.dumps(result,indent=2)+'\n') +except BaseException as e: + (out/'FAILURE.json').write_text(json.dumps(dict(error=repr(e),completed=steps),indent=2)+'\n');raise diff --git a/research/e8-early-reset-reuse/EXPECTED.json b/research/e8-early-reset-reuse/EXPECTED.json new file mode 100644 index 0000000000..5cb40a0157 --- /dev/null +++ b/research/e8-early-reset-reuse/EXPECTED.json @@ -0,0 +1,10 @@ +{ + "status": "PASS_CONDITIONAL_EARLY_RESET_REUSE_ASSEMBLY", + "kappa": "1128250848293019/1000000000000000000", + "kappa_decimal": "0.001128250848293019", + "bit_lower": "1129525236098815991751/1000000000000000000000000", + "complex_lower": "1183986549206329/1000000000000000000", + "binding_component": "bit", + "bit_template_sha256": "10dfc644197ef152062bf69960ecdc2405c847ce47147b520c3172c51cd82bd9", + "complex_template_sha256": "942d030fa43316c560c88d7d7d904583446e1a96945b3ebd37a91c88a192ab4f" +} diff --git a/research/e8-early-reset-reuse/LICENSE b/research/e8-early-reset-reuse/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-early-reset-reuse/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/e8-early-reset-reuse/MANIFEST.json b/research/e8-early-reset-reuse/MANIFEST.json new file mode 100644 index 0000000000..1980f550b0 --- /dev/null +++ b/research/e8-early-reset-reuse/MANIFEST.json @@ -0,0 +1,30 @@ +{ + "files": { + "EXPECTED.json": "5521c7e995fec77941243b28e090f95f2188f193d5f61275275cfa11215eecc0", + "LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "NOTICE.md": "c4085541471fe63d8f735beacd397d356446376ad3e56b2673940a2df3b8437e", + "PROOF.md": "09388e2f9e6b8fcc626a5172d55c45a957835075c51c68d1e86fd42ff4655ae8", + "README.md": "442bf686c0b24b9d7781b7b138f32fddea5d4efffeddc6e41d04719d2545e0cd", + "SELECTION.json": "9d47ade3fb69b3ef62a1a3ae75cebdddd57d144923977c5f2a07848ab596ea32", + "SOURCE.json": "c52287239c43aece2b3533ef48ee204d845d652066bca716c288b0c47e779521", + "VALIDATION.json": "bcb864a6b73d4ff4a24ab70ad51287653723c2115ce1c81db7817b81df2d9e92", + "bit_audit.py": "219eb4dd8e5380fb0432daa6a30c265755a78834616b2c5fc7aa161feb0231ee", + "bit_global.py": "9c2178df133dc663416aac13d8c8da80a9e4f5f7174bb36413180fcbad994ffb", + "bit_price.py": "36bf15803567a95b139a908461541bf19efe1f5b85fb31c270021833ab1393ee", + "combined.py": "dc621dce9ac1634a2701318311b30dffee7cce7e0c6be7ae808f44b27eb17f0f", + "local-evidence/ASSEMBLY.json": "c9ce28f59a5e460d39a888bbbc464e3fd6dd1c0b2c54ae86baeeea99febc8176", + "local-evidence/BIT-AUDIT.json": "2e458c3936e42539095610a50c730266dddd96e94d1ead171a99dd5f1fe9ef47", + "local-evidence/BIT-GLOBAL.json": "39f89d1e5bf51e9b1f1155e123dc3226627e465a246d37bb00f55d44d20bcaa0", + "local-evidence/BIT-PRICE.json": "96ec606146b5157871048e28f6649c31c1b6117d43be732e6a96bcc269c0e1b6", + "local-evidence/FAILED-INLINING.json": "95cbb0e6df953d25a888198c1072edf03db85b7c967a234680db3e095abd2dc7", + "local-evidence/FAILED-LATE-RESET.json": "f6ed36b59de745d50f37fcb4c80d129d9a2de0dfe1fe3de2d18e678135f7d9b6", + "local-evidence/FULL-PORTABLE-PYTHON311.json": "1dcca855b20cbac311a435f23f60001c342083edbef3194ba42a30e1f24c1982", + "local-evidence/FULL-PORTABLE-PYTHON314.json": "5687ed9209e11e64304d008a4a10678dc07cdc3522f5112c9a80557d45125c4a", + "local-evidence/FULL-PYTHON314-INITIAL.json": "0966528d4b30459d8b35296f31dbadfa34cdc7792419b34ab2505b7098923325", + "local-evidence/PARENT-FULL-REPLAY.json": "0ba447d6de6edd9fbe2371c36e3605dffa0c6526a874cfcb9bd19285c056bf1e", + "local-evidence/PYTHON311-GZIP-FAILURE.log": "ec1937c575536aeebe8f9c22d673fd66d1355ff870e2fdc80346205b29e42784", + "local-evidence/PYTHON311-INITIAL-FAILURE.json": "7902e8ca1e167b98d1c29170f8d57c9896b38ccab89065e4ed4e2c3feea79076", + "replay.py": "e0782ba05dda36323500390349d1180f6117a9c6112b09b9e21e29f67c4e5f5f", + "verify.py": "4e2082878acc1298f4354325b28f3cf047006170a9883148e7cf23002f6f02f1" + } +} diff --git a/research/e8-early-reset-reuse/NOTICE.md b/research/e8-early-reset-reuse/NOTICE.md new file mode 100644 index 0000000000..ba47405801 --- /dev/null +++ b/research/e8-early-reset-reuse/NOTICE.md @@ -0,0 +1,3 @@ +Rohan Arun, with substantial OpenAI Codex assistance. Apache-2.0. + +New contribution: eleven earlier clean resets selected and composed on PR433's R758 bit word. The clean-reset reuse principle and base bit lineage are from ai-nanachi #426; the split-centre complex and mutable-source bit composition are from icekylinx #433. Zhihao Chen supplied #425/#386; Dylan Crow supplied #370; Jacob Sussman supplied E8 and compiler interfaces. All parent notices remain in the pinned sibling package. Adapted bit_global.py, bit_audit.py, bit_price.py and combined.py retain original author notices. diff --git a/research/e8-early-reset-reuse/PROOF.md b/research/e8-early-reset-reuse/PROOF.md new file mode 100644 index 0000000000..933ba6ab83 --- /dev/null +++ b/research/e8-early-reset-reuse/PROOF.md @@ -0,0 +1,9 @@ +# Earlier clean reset and physical slot reuse + +Select a helper whose last main read has completed and which is not read by the subsequent target decoder. Immediately after that last read, cancel its clean source content using the recorded three or four available parent rows. Parent frames must admit the reset before their next use. The slot may retain arbitrary helper dirt. A later logical helper whose first use has not occurred is assigned that physical slot. The selected intervals and eleven physical pairs are disjoint. + +The reconstruction checks each actual reset on source columns with the earlier physical aliases already applied. It emits every reset addition, including its frame transitions. The main helper word is inverted at the full frame after restoring the source basis. The initial target compensation is regenerated from the entire changed raw operator on every independent physical column; no old dirty response is reused. The full emitted forward and reflected words independently verify the target shear, restored sources, restored helpers, and erased private copy row. + +The global nine-stage dimension-64 geometry and data routes are inherited. New ownership is generated for R747: 6,723 complete rank-eight helper banks, 53,784 assignments, 14,403 live and 14,412 physical rows. All 72 invocations and reflected streams are emitted and independently decoded. The two exact moment engines use the reconstructed profile and positive fallback allowance. The changed prefix has 226 bits, charged at 256; the two-level coefficient has 488 bits, charged at 512. Six finite bootstrap levels and 47 strict outer inequalities give the selected conditional bound. + +The parent complex supplier is unchanged and fully replayed, including all Gaussian phase pairs, by verify.py. Parent all-size compiler, dirty-bank, compressed-window, restored-work, tape/common-grid, precision and analytic interfaces remain assumptions. This is not an unconditional multiplication theorem or new Lean proof. diff --git a/research/e8-early-reset-reuse/README.md b/research/e8-early-reset-reuse/README.md new file mode 100644 index 0000000000..5c976801cd --- /dev/null +++ b/research/e8-early-reset-reuse/README.md @@ -0,0 +1,11 @@ +# Earlier clean resets on PR433 + +Conditional kappa = 0.001128250848293019, approximately 0.659% above PR433. Eleven helpers removed, R758 to R747. The exact bit saving is 0.001129525236098815991751; the unchanged complex saving is 0.001183986549206329. + +Run `python -B research/e8-early-reset-reuse/verify.py /absolute/new/output` with Python 3.11 or 3.14. Standard library only. The wrapper freshly verifies the pinned parent with all phases before reconstructing and checking the changed bit program. + +At draft submission the changed emitted bit, independent bank audit, two rational moments and exact finite assembly passed locally against the previously fully replayed parent. The new uninterrupted wrapper and GitHub CI are pending. Local receipts distinguish that scope. + +The initial full Python3.14 wrapper passed. Python3.11 exposed the parent compressed-file metadata mismatch; the package now imports PR433's upstream decoded-witness hash fix at 6d9244518175caf9e0089f92486959bc2c317273. Fresh both-version replays are pending. The original failure and pass receipts are preserved. + +Both fresh portable full replays now passed locally on Python 3.11 and 3.14 against e48f24fd2393500c804a0cbab542e20de8ddee6e. See VALIDATION.json and local-evidence/FULL-PORTABLE-PYTHON*.json. diff --git a/research/e8-early-reset-reuse/SELECTION.json b/research/e8-early-reset-reuse/SELECTION.json new file mode 100644 index 0000000000..9df36fb9ef --- /dev/null +++ b/research/e8-early-reset-reuse/SELECTION.json @@ -0,0 +1,141 @@ +{ + "source_sha256": "015811014644ed62acba1da590d9cf6ebdfe834d89867f8ce2b68722609072ea", + "word_sha256": "98ffef9246c8bf6c537ab5e134321abea05cf0b7830c9e3fd92cbe4e88d8c308", + "R": 747, + "local_profile": { + "1": 2398, + "2": 865, + "3": 475, + "5": 153, + "4": 310, + "8": 9, + "7": 14 + }, + "global_profile": { + "1": 172656, + "2": 62280, + "3": 34200, + "5": 11016, + "4": 22320, + "8": 648, + "7": 6768, + "14": 3840, + "28": 3840, + "42": 3840 + }, + "live": 14403, + "entries": [ + { + "position": 1032, + "new_helper": 949, + "retired_helper": 406, + "parents": [ + 411, + 518 + ], + "frame": 458 + }, + { + "position": 1036, + "new_helper": 950, + "retired_helper": 252, + "parents": [ + 0, + 1, + 512, + 523 + ], + "frame": 458 + }, + { + "position": 1038, + "new_helper": 957, + "retired_helper": 532, + "parents": [ + 533, + 534 + ], + "frame": 459 + }, + { + "position": 1053, + "new_helper": 936, + "retired_helper": 310, + "parents": [ + 315, + 566 + ], + "frame": 461 + }, + { + "position": 1069, + "new_helper": 937, + "retired_helper": 422, + "parents": [ + 427, + 598 + ], + "frame": 463 + }, + { + "position": 1085, + "new_helper": 933, + "retired_helper": 294, + "parents": [ + 299, + 630 + ], + "frame": 465 + }, + { + "position": 1094, + "new_helper": 935, + "retired_helper": 374, + "parents": [ + 379, + 646 + ], + "frame": 466 + }, + { + "position": 1103, + "new_helper": 934, + "retired_helper": 444, + "parents": [ + 439, + 662 + ], + "frame": 467 + }, + { + "position": 1112, + "new_helper": 932, + "retired_helper": 492, + "parents": [ + 487, + 678 + ], + "frame": 468 + }, + { + "position": 1121, + "new_helper": 944, + "retired_helper": 476, + "parents": [ + 471, + 694 + ], + "frame": 469 + }, + { + "position": 1128, + "new_helper": 942, + "retired_helper": 710, + "parents": [ + 455, + 460 + ], + "frame": 470 + } + ] +} diff --git a/research/e8-early-reset-reuse/SOURCE.json b/research/e8-early-reset-reuse/SOURCE.json new file mode 100644 index 0000000000..d9ed13ac34 --- /dev/null +++ b/research/e8-early-reset-reuse/SOURCE.json @@ -0,0 +1,7 @@ +{ + "parent_pr": 433, + "parent_commit": "6d9244518175caf9e0089f92486959bc2c317273", + "parent_manifest_sha256": "3129eb4321f706542470f8443f66a6b4351a12a9ceec85e7f76aa19db1e1e32f", + "attribution": "Rohan Arun with substantial OpenAI Codex assistance. icekylinx PR433 split centres and source reuse; ai-nanachi PR426 clean reset principle and base bit word; Zhihao Chen PR425/386; Dylan Crow PR370; Jacob Sussman E8 and inherited framework.", + "parent_update": "Upstream PR433 gzip portability repair: bind decoded canonical witness rather than platform-dependent gzip header. No construction or price changes." +} diff --git a/research/e8-early-reset-reuse/VALIDATION.json b/research/e8-early-reset-reuse/VALIDATION.json new file mode 100644 index 0000000000..2cfd52731f --- /dev/null +++ b/research/e8-early-reset-reuse/VALIDATION.json @@ -0,0 +1,9 @@ +{ + "status": "PASS_BOTH_FULL_LOCAL_REPLAYS", + "validated_code_head": "e48f24fd2393500c804a0cbab542e20de8ddee6e", + "python": [ + "3.11", + "3.14" + ], + "scope": "Fresh full parent phases and changed bit program, independent audit, finite invoice and exact assembly; GitHub CI pending." +} diff --git a/research/e8-early-reset-reuse/bit_audit.py b/research/e8-early-reset-reuse/bit_audit.py new file mode 100644 index 0000000000..155faf40b0 --- /dev/null +++ b/research/e8-early-reset-reuse/bit_audit.py @@ -0,0 +1,126 @@ +# Adapted with exact rational span checks by icekylinx; Codex assistance. +"""Independent audit of the emitted bit template, including mutation controls. +Prepared by Zhihao Chen with OpenAI Codex assistance; Apache-2.0. +""" +import argparse, copy, gzip, hashlib, json, struct, time +from collections import Counter, defaultdict +from pathlib import Path +from fractions import Fraction as Q + +def sha(p): return hashlib.sha256(p.read_bytes()).hexdigest() + +def main(): + ap=argparse.ArgumentParser(); ap.add_argument('--local-check',type=Path,required=True); ap.add_argument('--out',type=Path,required=True) + a=ap.parse_args(); start=time.monotonic(); out=a.out + blob=gzip.decompress((out/'GLOBAL-TEMPLATE.json.gz').read_bytes()); t=json.loads(blob) + g=json.loads((out/'GLOBAL.json').read_text()); geo=json.loads((out/'GEOMETRY.json').read_text()) + assert hashlib.sha256(blob).hexdigest()==g['template_sha256'] + assert t['geometry_sha256']==sha(out/'GEOMETRY.json') and t['source_record_sha256']==sha(a.local_check/'records/249-records.bin') + fs=json.loads((a.local_check/'records/frames.json').read_text())['frames'] + records=list(struct.iter_unpack('<6i',(a.local_check/'records/249-records.bin').read_bytes())) + word=json.loads((a.local_check/'bit-source-centres.json').read_text()) + assert g['word_sha256']==sha(a.local_check/'bit-source-centres.json') + def rank(rows): + piv={} + for rr in rows: + row=list(map(Q,rr)) + for k,b in sorted(piv.items()): + q=row[k] + if q:row=[x-q*y for x,y in zip(row,b)] + k=next((j for j,x in enumerate(row) if x),None) + if k is not None: + q=row[k];piv[k]=[x/q for x in row] + return len(piv) + dimensions={};proj={} + for key,f in fs.items(): + k=int(key);B=f['B'];roots=[word['lines'][j] for j in word['frames'][k]] + assert rank(B)==f['dim']==rank(B+roots)==rank(roots) + dimensions[k]=f['dim'];proj[k]=B + sets=[set(f) for f in word['frames']];pairs={} + for op,x,y,c,r,z in records: + if op==0: + assert sets[y]<=sets[c] and dimensions[c]-dimensions[y]==r + pairs[y,c]=r + # Positive definite rational form: exact inclusion implies commuting + # orthogonal projectors and rank(P_V-P_U)=dim(V)-dim(U), also in reflection. + assert len(proj)==944 + expected={} + for rev in (False,True): + es=[] + for op,x,y,c,f,z in (reversed(records) if rev else records): + if op==0: es.append([0,x,c if rev else y,y if rev else c,f,int(rev)]) + elif op==1: es.append([1,x,y,-c if rev else c,f,int(rev)]) + elif op==(3 if rev else 2): es.append([2,x,y,c,f,abs(dimensions[c]-dimensions[f]),int(rev)]) + else: es.append([3,x,y,c,f,z,int(rev)]) + expected['reverse' if rev else 'forward']=es + assert t['local_programs']==expected + + def validate(q,check_profile=True): + assert (q['m'],q['live'],q['replicas'],q['stages'])==(64,14403,8,9) + assert q['bank_padding'] is None and q['local_programs']==expected + hist=Counter(); occupation=defaultdict(set); calls=set() + for c in q['calls']: + st,rep,p=c['stage'],c['replica'],c['pair']; rev=c['orientation']=='reverse' + assert 0<=st<9 and 0<=rep<8 and p==max(0,(st-1)//2) + assert rev==(st in (1,3,5,7)) and (st,rep) not in calls; calls.add((st,rep)) + own=c['owners']; assert len(own)==987 + assert len({(f,tuple(r)) for f,r in own})==987 + for i,(family,route) in enumerate(own): + assert 0<=family<14403 + if i<240: + side=i//120; side=1-side if rev else side + assert family==rep*960+(2*p+side)*120+i%120 and route==['data',st,i%120] + else: + j=i-240; bank,slot=divmod(rep*747+j,8) + assert family==7680+st*747+bank and route==['bank',slot] + assert slot not in occupation[family]; occupation[family].add(slot) + for e in q['local_programs'][c['orientation']]: + if e[0]==0 and e[4]: hist[e[4]]+=1 + if e[0]==2: hist[e[5]]+=1 + assert calls=={(s,r) for s in range(9) for r in range(8)} + assert set(occupation)==set(range(7680,14403)) and all(s==set(range(8)) for s in occupation.values()) + levels=[-1]*4; scalar=[1<=0 + cur[x]=newf + if f: hist[f]+=1 + events.append([0,x,oldf,newf,f,int(reverse)]) + elif op==1: + assert cur[x]==cur[y]==f and x!=y and x0 + cutoff=max(ceil(36/gap**2),ceil(2*(4+charged_two)/gap)) + assert cutoff*gap**2>=36 and cutoff*gap>=2*(4+charged_two) + cutoffs.append(dict(gap=str(gap),cutoff_log2=str(cutoff)));chain.append(a) +q=chain[-1]*(1-2*eta);margin=(1-eta)*q/(1+q);ticks=margin/grid;k=grid*((ticks.numerator-1)//ticks.denominator) +bridge={'semantic':{'C0':{'base':2,'exponent':210000},'strict_literal_gap':1},'rows':{'degree_gap':Q(10**6)-Q(51*20161,25)}} +a=Outer.assembly(chain[-1],b,bridge,k,eta=eta,beta=beta) +assert len(a['strict_constraints'])==47 and all(x>0 for x in a['strict_constraints'].values()) +controls=[] +for name,kk,ee,bb in [('next_grid',k+grid,eta,beta),('zero_eta',k,Q(0),beta),('zero_beta',k,eta,Q(0)),('unit_beta',k,eta,Q(1))]: + try:Outer.assembly(chain[-1],b,bridge,kk,eta=ee,beta=bb) + except AssertionError:controls.append(name) + else:raise AssertionError(name) +result=dict(status='PASS_CONDITIONAL_EARLY_RESET_REUSE_ASSEMBLY',kappa=str(k),kappa_decimal=format(float(k),'.18f'),bit_lower=str(c),complex_lower=str(b),binding_component='bit',gain_over_pr425_percent=float(100*(k/Q(1048005508028206,10**18)-1)),bit_invoice=dict(prefix_bits=prefix.bit_length(),charged_prefix_bits=charged_prefix,coefficient_bits=coefficient.bit_length(),two_level_coefficient_bits=two.bit_length(),charged_two_level_coefficient_bits=charged_two,row_coefficient=row,live=W,physical=physical),strict_outer_constraints={n:str(x) for n,x in a['strict_constraints'].items()},outer_controls=controls,bootstrap=cutoffs,bit_template_sha256=g['template_sha256'],complex_template_sha256=cx['global_template_sha256'],scope='Finite research composition with explicit changed words, exact local and global replay and incremental phase evidence. All-size correlated dirty-bank, compressed-window, compiler, restored-work, tape/common-grid, precision and analytic interfaces remain inherited assumptions. This certificate makes no unconditional integer-multiplication or Lean-kernel claim.') +(ROOT/'RESULT.json').write_text(json.dumps(result,indent=2)+'\n') +print(result['status'],result['kappa_decimal'],result['gain_over_pr425_percent'],result['bit_invoice']) diff --git a/research/e8-early-reset-reuse/local-evidence/ASSEMBLY.json b/research/e8-early-reset-reuse/local-evidence/ASSEMBLY.json new file mode 100644 index 0000000000..7899c12d17 --- /dev/null +++ b/research/e8-early-reset-reuse/local-evidence/ASSEMBLY.json @@ -0,0 +1,103 @@ +{ + "status": "PASS_CONDITIONAL_EARLY_RESET_REUSE_ASSEMBLY", + "kappa": "1128250848293019/1000000000000000000", + "kappa_decimal": "0.001128250848293019", + "bit_lower": "1129525236098815991751/1000000000000000000000000", + "complex_lower": "1183986549206329/1000000000000000000", + "binding_component": "bit", + "gain_over_pr425_percent": 7.656957873799007, + "bit_invoice": { + "prefix_bits": 226, + "charged_prefix_bits": 256, + "coefficient_bits": 226, + "two_level_coefficient_bits": 488, + "charged_two_level_coefficient_bits": 512, + "row_coefficient": 18355, + "live": 14403, + "physical": 14412 + }, + "strict_outer_constraints": { + "bit_positive": "18506141468243001171708721090504160753359281193270932320673716200550478228569658366279537613727959580145427271328281666596703824135534263924614730977/16384000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_above_bit": "892294153953493164291278909495839246640718806729067679326283799449521771430341633720462386272040419854572728671718333403296175864465736075385269023/16384000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_below_one_over32": "30066013450793671/1000000000000000000", + "beta_positive": "1/1000000000000000000", + "beta_below_one": "999999999999999999/1000000000000000000", + "leaf_saving_above_bit": "892294153953493144892843287299344910640718806729067679326283799449521771430341633720462386272040419854572728671718333403296175864465736075385269023/16384000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_positive": "9253070734121500567348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023/8192000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_internal": "18506141468243001171708721090504160753359281193270932320673716200550478228569658366279537613727959580145427271328281666596703824135534263924614730977/8192000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_leaf": "446147076976746590952563111892673627029080493868694593022423092995693206388887017410709421705678576206823978063818746847075359260514534634396458647034263924614730977/8192000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_positive": "9253070734121502615348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023/8192000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_below_one": "8182746929265878497384651780922990920795029080493868694593022423092995693206388887017410709421705678576206823978063818746847075359260514534634396458647034263924614730977/8192000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_reservations": "1/4000000000000000000", + "lambda_above_tau": "18506141468243001171708721090504160753359281193270932320673716200550478228569658366279537613727959580145427271328281666596703824135534263924614730977/16384000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_sigma": "892294153953493182797420377738840418349439897233228432685564992720454092104057834270940614841698786134110342399677913548723447192747402672089093158534263924614730977/16384000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_internal": "18506141468243001171708721090504160753359281193270932320673716200550478228569658366279537613727959580145427271328281666596703824135534263924614730977/16384000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_prime_above_lambda": "18506141468243001171708721090504160753359281193270932320673716200550478228569658366279537613727959580145427271328281666596703824135534263924614730977/16384000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_leaf": "446147076976746590952563111892673627029080493868694593022423092995693206388887017410709421705678576206823978063818746847075359260514534634396458647034263924614730977/8192000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_reservations": "1/4000000000000000000", + "lambda_prime_below_one": "9253070734121500567348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023/8192000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "epsilon_positive": "8191999999999999991808000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/8201253070734121500567348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023", + "epsilon_below_one": "9253070734121508759348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023/8201253070734121500567348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023", + "guard_width": "9253070734121508759348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023/8201253070734121500567348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023", + "K_geometry": "6153253070734121502615348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023/8201253070734121500567348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023000000000000000000", + "K_dominates_log": "298486152713596858261133817512502470632990336423297619419569593576548431826888260502741412409135756167867272375543865463217697380751748781054158084305815184186507344194653674987571967/264556550668842629050559619970226099329192610306649396948612179900225945380439068160728686792848203916896554065223747782359771762604499531140825920688805346325012428033000000000000000000", + "record_suffix": "9253070734121508759348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023/8201253070734121500567348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023", + "phase_local": "74024565872972061873532681881951133072419136972041364050849695749903148941911326953710017832743458407756117597195128601430221103979702469771903690084240423237478610831034263924614730977/65610024565872972004538785752616072633639767356049050443255820615256034454348888903860714324626354571390345408175489450025223397125915883722924828330823725888603082152184000000000000000000", + "phase_boundary": "14804913174594405813704079789093026160605252132801009446193203545075585462800203865138558131659801295479791056803568581251503403246995491432041025425259712355012889083834263924614730977/13122004913174594400907757150523214526727953471209810088651164123051206890869777780772142864925270914278069081635097890005044679425183176744584965666164745177720616430436800000000000000000", + "gamma_sublinear": "1/2000000000000000000", + "cell_above_band": "16383999999999999975414746929265878499432651780922990920795029080493868694593022423092995693206388887017410709421705678576206823978063818746847075359260514534634396458647034263924614730977/32805012282936486002269392876308036316819883678024525221627910307628017227174444451930357162313177285695172704087744725012611698562957941861462414165411862944301541076092000000000000000000", + "prime_interval_packing": "9253070734121508759348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023/8201253070734121500567348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023", + "alpha_positive": "18506141468243009317443367419896657842593619935253531608984234307877308180244649058174274362977529864997061465578041082512673259542789677578282441966446006785166996693034263924614730977/16402506141468243001134696438154018158409941839012262610813955153814008613587222225965178581156588642847586352043872362506305849281478970930731207082705931472150770538046000000000000000000", + "alpha_below_one": "16383999999999999991817253070734121500567348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023/16402506141468243001134696438154018158409941839012262610813955153814008613587222225965178581156588642847586352043872362506305849281478970930731207082705931472150770538046000000000000000000", + "alpha_below_one_fourth": "4082120393898817740966230742118607881759891839817812121094504554145624845216560907433120370926169630846899526545390049544063789060826953055104519328710036861252525637818465736075385269023/16402506141468243001134696438154018158409941839012262610813955153814008613587222225965178581156588642847586352043872362506305849281478970930731207082705931472150770538046000000000000000000", + "delta_positive": "1/8000000000000000000", + "delta_below_one_eighth": "999999999999999999/8000000000000000000", + "short_record_fallback": "134065954450456131888572404073222057587195605953853045459726979682067836030854839827324250112657359613753045411329984324417514991266327925496392926819076909098625880785159609317507266039991394147465325581857236255532115555519907868899367780890770924744091711832220085615353750878175230822142166392507469830641670083374529/134369330310907846665295433221357716753694243545188455307787920620044358562506524475106742936834774162207427395943402393651657517313875729864550048421526990619859112247672832000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "small_field_exposure": "1/1000000000000000000", + "artificial_boundary": "459344196526983776126450045233130945570820183505623430783661477680566669551012043961606727517391669910070531137138798564473166705073135613542857400568808263504921467841530897208226155807069/65610024565872972004538785752616072633639767356049050443255820615256034454348888903860714324626354571390345408175489450025223397125915883722924828330823725888603082152184000000000000000000", + "literal_scalar_guard": "1", + "row_product_gap": "23971789/25", + "balanced_prefix_above_kappa": "9220264634419749410126248485777003611646590040381762946804723855588412103267248597113917235579943540037407401432945273428716916281235826485632259566734279018802352149563/8201253070734121500567348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023000000000000000000", + "coordinate_movement_above_kappa": "20879569810177875708721090504160753359281193270932320673716200550478228569658366279537613727959580145427271328281666596703824135534263924614730977/16384000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_phase_layer_above_kappa": "50950578184281395477945013334999726622080956043781582069887313934070389823681874206566397250082460930680711270550454608778199582024817051013332801269065664136348344027/410062653536706075028367410953850453960248545975306565270348878845350215339680555649129464528914716071189658801096809062657646232036974273268280177067648286803769263451150000000000000000", + "bulk_exposure_above_kappa": "20879569810177875708721090504160753359281193270932320673716200550478228569658366279537613727959580145427271328281666596703824135534263924614730977/16384000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Gaussian_arithmetic_above_kappa": "32755851721687387778173246790830983497147865725523447047402902960172275292169933211998391431748076713180293331353881281163970707046189184558230058827109403470041890851389/65610024565872972004538785752616072633639767356049050443255820615256034454348888903860714324626354571390345408175489450025223397125915883722924828330823725888603082152184000000000000000000", + "scalar_work_above_kappa": "65560864004623873780442639667139019813967749403547972269030813267800292519344377663928748594061253998875466035441626006176582405609147126419692472992521266414343431927481/65610024565872972004538785752616072633639767356049050443255820615256034454348888903860714324626354571390345408175489450025223397125915883722924828330823725888603082152184000000000000000000", + "dimension_above_kappa": "8182746929265878492268916415342740330921277566270872306239612463474758640011112742605822812688954275690124059558007358784254476792205787963351312739882860749556874297711279018802352149563/8201253070734121500567348219077009079204970919506131305406977576907004306793611112982589290578294321423793176021936181253152924640739485465365603541352965736075385269023000000000000000000" + }, + "outer_controls": [ + "next_grid", + "zero_eta", + "zero_beta", + "unit_beta" + ], + "bootstrap": [ + { + "gap": "19718173301699986490442310099608577089/16000000000000000000000000000000000000000000", + "cutoff_log2": "23703316064509" + }, + { + "gap": "89088697416160189168478072742640881250923123343423452063/64000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "18578781647433489479" + }, + { + "gap": "402511727930897263492893481780029509017558469228965731102330904495255713921/256000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "14562145083988389157871807" + }, + { + "gap": "1818588618094756475300249931559443478956904117509927455038979846382951280845356947587831584607/1024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "11413884584645035881423129400187" + }, + { + "gap": "8216566952880397264033353325540771278429496754443877107508740488500708481207792267348207305960479962067658955969/4096000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "8946261732747165430949576222298741146" + }, + { + "gap": "37123278909495839246640718806729067679326283799449521771430341633720462386272040419854572728671718333403296175864465736075385269023/16384000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "7012126186950169517647508261689402518966285" + } + ], + "bit_template_sha256": "10dfc644197ef152062bf69960ecdc2405c847ce47147b520c3172c51cd82bd9", + "complex_template_sha256": "942d030fa43316c560c88d7d7d904583446e1a96945b3ebd37a91c88a192ab4f", + "scope": "Finite research composition with explicit changed words, exact local and global replay and incremental phase evidence. All-size correlated dirty-bank, compressed-window, compiler, restored-work, tape/common-grid, precision and analytic interfaces remain inherited assumptions. This certificate makes no unconditional integer-multiplication or Lean-kernel claim." +} diff --git a/research/e8-early-reset-reuse/local-evidence/BIT-AUDIT.json b/research/e8-early-reset-reuse/local-evidence/BIT-AUDIT.json new file mode 100644 index 0000000000..5acb750852 --- /dev/null +++ b/research/e8-early-reset-reuse/local-evidence/BIT-AUDIT.json @@ -0,0 +1,33 @@ +{ + "status": "PASS_INDEPENDENT_COMPRESSED_BIT_TEMPLATE_AUDIT", + "template_sha256": "10dfc644197ef152062bf69960ecdc2405c847ce47147b520c3172c51cd82bd9", + "source_frames": 944, + "exact_nested_frame_pairs": 3341, + "exact_reflected_pairs": 3341, + "orthogonal_lift_argument": "Adding the same orthogonal E_s leaves P_V-P_U unchanged; each audited projector is therefore the literal child projector in every one of the nine windows.", + "exact_bank_families": 6723, + "slots_per_bank": 8, + "mutations_rejected": [ + "omit an idle child", + "omit a bridge", + "omit terminal exchange", + "remove a local invocation", + "re-use a helper bank slot", + "understate live stock", + "omit a local paid move", + "wrong reflected copy charge" + ], + "profile": { + "1": 172656, + "2": 62280, + "3": 34200, + "4": 22320, + "5": 11016, + "7": 6768, + "8": 648, + "14": 3840, + "28": 3840, + "42": 3840 + }, + "seconds": 1.6600992910098284 +} diff --git a/research/e8-early-reset-reuse/local-evidence/BIT-GLOBAL.json b/research/e8-early-reset-reuse/local-evidence/BIT-GLOBAL.json new file mode 100644 index 0000000000..fd3faa8602 --- /dev/null +++ b/research/e8-early-reset-reuse/local-evidence/BIT-GLOBAL.json @@ -0,0 +1,164 @@ +{ + "status": "PASS_SOURCE_BOUND_NINE_STAGE_BIT_TEMPLATE", + "h": 8, + "m": 64, + "v": 120, + "R": 747, + "replicas": 8, + "live": 14403, + "physical": 14412, + "word_sha256": "98ffef9246c8bf6c537ab5e134321abea05cf0b7830c9e3fd92cbe4e88d8c308", + "source_records_sha256": "bd805894638e578daf4f057f61bf6c6810d4460ac98b6238619549a0b5af1b68", + "local_checks": { + "forward": { + "copies": 9, + "adds": 14586, + "records": 18819, + "all_columns": 987, + "cancellation_free_row_l1": 4749825, + "profile": { + "1": 2398, + "2": 865, + "3": 475, + "4": 310, + "5": 153, + "7": 14, + "8": 9 + }, + "sha256": "67a94cf0035c06591019042d3bbc1d62e435cd6e839a0c08afe98609607b0522" + }, + "reverse": { + "copies": 9, + "adds": 14586, + "records": 18819, + "all_columns": 987, + "cancellation_free_row_l1": 18975950, + "profile": { + "1": 2398, + "2": 865, + "3": 475, + "4": 310, + "5": 153, + "7": 14, + "8": 9 + }, + "sha256": "bcd0366700ed4a0f4717c54e5f330015d8f174636c6f0f5a9c42ff553396e931" + } + }, + "scalar_stages": [ + { + "stage": 0, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": false + }, + { + "stage": 1, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": true + }, + { + "stage": 2, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": false + }, + { + "stage": 3, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": true + }, + { + "stage": 4, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": false + }, + { + "stage": 5, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": true + }, + { + "stage": 6, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": false + }, + { + "stage": 7, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": true + }, + { + "stage": 8, + "all_columns": 7683, + "helper_columns": 6723, + "reverse": false + } + ], + "independent_unbanked_scalar_columns": 7683, + "all_scalar_columns_restored": true, + "geometry_sha256": "ec1742de8de83751f6c633e54d855a920645bcca40ce2a2d2e2a8349576a00db", + "template_sha256": "10dfc644197ef152062bf69960ecdc2405c847ce47147b520c3172c51cd82bd9", + "emitted_program_sha256": "ced149086bd620d31aa8b5f6a68999d3194a7e32fb2c47c0b9f8332dd961abf4", + "emitted_events": 1354968, + "local_invocations": 72, + "bank_assignments": 53784, + "banks_per_stage": 747, + "whole_rank8_slots_per_bank": 8, + "padding_calls": 0, + "profile": { + "1": 172656, + "2": 62280, + "3": 34200, + "4": 22320, + "5": 11016, + "7": 6768, + "8": 648, + "14": 3840, + "28": 3840, + "42": 3840 + }, + "paid_calls": 321408, + "rank_mass": 919296, + "deficit": 2496, + "maxchild": 42, + "halving_depth": 2, + "halving_integer_inequality": [ + 4096, + 3528 + ], + "local_additions": 14586, + "bridge_additions": 17280, + "copy_erase_episodes": 648, + "global_prefix_bound": "82175447241247327050912217435296917941221100975248000000000000000000", + "global_prefix_bits": 226, + "charged_prefix_bits": 256, + "omitted_bridge_shears_rejected": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17 + ], + "scope": "Complete source-bound finite cover template. Local and unbanked global F2 columns are replayed; arbitrary physical bank dirt follows by injective owner routes and the all-column local theorem. Astronomical cover enumeration and all-size compiler interfaces remain explicit inherited assumptions.", + "seconds": 2.408216124982573 +} diff --git a/research/e8-early-reset-reuse/local-evidence/BIT-PRICE.json b/research/e8-early-reset-reuse/local-evidence/BIT-PRICE.json new file mode 100644 index 0000000000..0ee06a110f --- /dev/null +++ b/research/e8-early-reset-reuse/local-evidence/BIT-PRICE.json @@ -0,0 +1,17 @@ +{ + "lower": "0.001129525236098815991751", + "upper": "0.001129525236098815991752", + "lower_endpoint_residual_upper": "-1.251774999433093430381353664521278818665250762780616345195836520018292E-25", + "upper_endpoint_residual_lower": "2.276366164350301667566734024087898004226996967249013754753469273066967E-24", + "strict_rational_signs": true, + "moment_minus_one_at_current_k_required_rate": [ + "-0.001042177813821591887548119068554528501744007073182525639912744635909457", + "-0.001042177813821591887548119068554528501744007073182525639912744635835273" + ], + "nominal_k_ceiling_interval": [ + "0.001128250848293019129894635265715588124139286669678372820580212187821160", + "0.001128250848293019129895633010486841514774944147064771313407964226126090" + ], + "source_template_sha256": "10dfc644197ef152062bf69960ecdc2405c847ce47147b520c3172c51cd82bd9", + "two_exact_engines": true +} diff --git a/research/e8-early-reset-reuse/local-evidence/FAILED-INLINING.json b/research/e8-early-reset-reuse/local-evidence/FAILED-INLINING.json new file mode 100644 index 0000000000..927c934e27 --- /dev/null +++ b/research/e8-early-reset-reuse/local-evidence/FAILED-INLINING.json @@ -0,0 +1,571 @@ +{ + "source_sha256": "015811014644ed62acba1da590d9cf6ebdfe834d89867f8ce2b68722609072ea", + "tested": 140, + "statuses": { + "frame": 106, + "source_identity": 34 + }, + "positive": [], + "results": [ + { + "helper": 246, + "status": "frame" + }, + { + "helper": 247, + "status": "frame" + }, + { + "helper": 252, + "status": "frame" + }, + { + "helper": 253, + "status": "frame" + }, + { + "helper": 254, + "status": "frame" + }, + { + "helper": 255, + "status": "frame" + }, + { + "helper": 258, + "status": "frame" + }, + { + "helper": 259, + "status": "frame" + }, + { + "helper": 260, + "status": "frame" + }, + { + "helper": 261, + "status": "frame" + }, + { + "helper": 262, + "status": "frame" + }, + { + "helper": 263, + "status": "frame" + }, + { + "helper": 264, + "status": "frame" + }, + { + "helper": 265, + "status": "frame" + }, + { + "helper": 267, + "status": "frame" + }, + { + "helper": 268, + "status": "frame" + }, + { + "helper": 270, + "status": "frame" + }, + { + "helper": 271, + "status": "frame" + }, + { + "helper": 272, + "status": "frame" + }, + { + "helper": 273, + "status": "frame" + }, + { + "helper": 274, + "status": "frame" + }, + { + "helper": 275, + "status": "frame" + }, + { + "helper": 276, + "status": "frame" + }, + { + "helper": 277, + "status": "frame" + }, + { + "helper": 278, + "status": "frame" + }, + { + "helper": 279, + "status": "frame" + }, + { + "helper": 280, + "status": "frame" + }, + { + "helper": 281, + "status": "frame" + }, + { + "helper": 282, + "status": "frame" + }, + { + "helper": 283, + "status": "frame" + }, + { + "helper": 284, + "status": "frame" + }, + { + "helper": 285, + "status": "frame" + }, + { + "helper": 286, + "status": "frame" + }, + { + "helper": 287, + "status": "frame" + }, + { + "helper": 517, + "status": "source_identity" + }, + { + "helper": 533, + "status": "source_identity" + }, + { + "helper": 549, + "status": "source_identity" + }, + { + "helper": 565, + "status": "source_identity" + }, + { + "helper": 581, + "status": "source_identity" + }, + { + "helper": 597, + "status": "source_identity" + }, + { + "helper": 613, + "status": "source_identity" + }, + { + "helper": 629, + "status": "source_identity" + }, + { + "helper": 645, + "status": "source_identity" + }, + { + "helper": 661, + "status": "source_identity" + }, + { + "helper": 677, + "status": "source_identity" + }, + { + "helper": 693, + "status": "source_identity" + }, + { + "helper": 714, + "status": "source_identity" + }, + { + "helper": 725, + "status": "source_identity" + }, + { + "helper": 750, + "status": "source_identity" + }, + { + "helper": 752, + "status": "frame" + }, + { + "helper": 764, + "status": "source_identity" + }, + { + "helper": 765, + "status": "source_identity" + }, + { + "helper": 766, + "status": "frame" + }, + { + "helper": 767, + "status": "frame" + }, + { + "helper": 778, + "status": "source_identity" + }, + { + "helper": 780, + "status": "frame" + }, + { + "helper": 792, + "status": "source_identity" + }, + { + "helper": 793, + "status": "source_identity" + }, + { + "helper": 794, + "status": "frame" + }, + { + "helper": 795, + "status": "frame" + }, + { + "helper": 806, + "status": "source_identity" + }, + { + "helper": 808, + "status": "frame" + }, + { + "helper": 810, + "status": "frame" + }, + { + "helper": 811, + "status": "frame" + }, + { + "helper": 812, + "status": "frame" + }, + { + "helper": 813, + "status": "frame" + }, + { + "helper": 820, + "status": "source_identity" + }, + { + "helper": 821, + "status": "source_identity" + }, + { + "helper": 822, + "status": "frame" + }, + { + "helper": 823, + "status": "frame" + }, + { + "helper": 824, + "status": "frame" + }, + { + "helper": 825, + "status": "frame" + }, + { + "helper": 826, + "status": "frame" + }, + { + "helper": 827, + "status": "frame" + }, + { + "helper": 834, + "status": "source_identity" + }, + { + "helper": 836, + "status": "frame" + }, + { + "helper": 848, + "status": "source_identity" + }, + { + "helper": 849, + "status": "source_identity" + }, + { + "helper": 850, + "status": "frame" + }, + { + "helper": 851, + "status": "frame" + }, + { + "helper": 862, + "status": "source_identity" + }, + { + "helper": 864, + "status": "frame" + }, + { + "helper": 866, + "status": "frame" + }, + { + "helper": 867, + "status": "frame" + }, + { + "helper": 868, + "status": "frame" + }, + { + "helper": 869, + "status": "frame" + }, + { + "helper": 876, + "status": "source_identity" + }, + { + "helper": 877, + "status": "source_identity" + }, + { + "helper": 878, + "status": "frame" + }, + { + "helper": 879, + "status": "frame" + }, + { + "helper": 880, + "status": "frame" + }, + { + "helper": 881, + "status": "frame" + }, + { + "helper": 882, + "status": "frame" + }, + { + "helper": 883, + "status": "frame" + }, + { + "helper": 890, + "status": "source_identity" + }, + { + "helper": 892, + "status": "frame" + }, + { + "helper": 896, + "status": "frame" + }, + { + "helper": 897, + "status": "frame" + }, + { + "helper": 898, + "status": "frame" + }, + { + "helper": 899, + "status": "frame" + }, + { + "helper": 900, + "status": "frame" + }, + { + "helper": 901, + "status": "frame" + }, + { + "helper": 902, + "status": "frame" + }, + { + "helper": 903, + "status": "frame" + }, + { + "helper": 904, + "status": "source_identity" + }, + { + "helper": 905, + "status": "source_identity" + }, + { + "helper": 906, + "status": "frame" + }, + { + "helper": 910, + "status": "frame" + }, + { + "helper": 911, + "status": "frame" + }, + { + "helper": 912, + "status": "frame" + }, + { + "helper": 913, + "status": "frame" + }, + { + "helper": 914, + "status": "frame" + }, + { + "helper": 915, + "status": "frame" + }, + { + "helper": 916, + "status": "frame" + }, + { + "helper": 917, + "status": "frame" + }, + { + "helper": 918, + "status": "source_identity" + }, + { + "helper": 919, + "status": "source_identity" + }, + { + "helper": 920, + "status": "frame" + }, + { + "helper": 921, + "status": "frame" + }, + { + "helper": 922, + "status": "frame" + }, + { + "helper": 923, + "status": "frame" + }, + { + "helper": 924, + "status": "frame" + }, + { + "helper": 925, + "status": "frame" + }, + { + "helper": 926, + "status": "frame" + }, + { + "helper": 927, + "status": "frame" + }, + { + "helper": 928, + "status": "frame" + }, + { + "helper": 929, + "status": "frame" + }, + { + "helper": 930, + "status": "frame" + }, + { + "helper": 931, + "status": "frame" + }, + { + "helper": 932, + "status": "frame" + }, + { + "helper": 933, + "status": "frame" + }, + { + "helper": 934, + "status": "frame" + }, + { + "helper": 935, + "status": "frame" + }, + { + "helper": 936, + "status": "frame" + }, + { + "helper": 937, + "status": "frame" + }, + { + "helper": 942, + "status": "frame" + }, + { + "helper": 943, + "status": "frame" + }, + { + "helper": 944, + "status": "frame" + }, + { + "helper": 950, + "status": "frame" + }, + { + "helper": 951, + "status": "frame" + } + ] +} diff --git a/research/e8-early-reset-reuse/local-evidence/FAILED-LATE-RESET.json b/research/e8-early-reset-reuse/local-evidence/FAILED-LATE-RESET.json new file mode 100644 index 0000000000..f01e4f53a2 --- /dev/null +++ b/research/e8-early-reset-reuse/local-evidence/FAILED-LATE-RESET.json @@ -0,0 +1,8 @@ +{ + "source_sha256": "015811014644ed62acba1da590d9cf6ebdfe834d89867f8ce2b68722609072ea", + "tested_retired_birth_pairs": 484, + "witnesses": 0, + "positive": [], + "rejections": {}, + "results": [] +} diff --git a/research/e8-early-reset-reuse/local-evidence/FULL-PORTABLE-PYTHON311.json b/research/e8-early-reset-reuse/local-evidence/FULL-PORTABLE-PYTHON311.json new file mode 100644 index 0000000000..b91e7cc182 --- /dev/null +++ b/research/e8-early-reset-reuse/local-evidence/FULL-PORTABLE-PYTHON311.json @@ -0,0 +1,44 @@ +{ + "status": "PASS_FULL_PARENT_AND_EARLY_RESET_REUSE", + "kappa": "1128250848293019/1000000000000000000", + "kappa_decimal": "0.001128250848293019", + "source_manifest_sha256": "06c5bd1afe07ebede7aaa13ae694ab7b345beab0a9d149c27fc992c92f3727f6", + "checks": [ + { + "name": "full-parent433", + "seconds": 114.39691066707019, + "log_sha256": "028a6067de8c3a61dfbf81c5d9c8d3629949b70cc118b64264f25df4b84a64ac" + }, + { + "name": "reconstruct", + "seconds": 0.05611987505108118, + "log_sha256": "ceeb567022f0746ceb350487a568b94cdfeacf3fb55cdc4088fecfab389caefa" + }, + { + "name": "export", + "seconds": 0.5730349159566686, + "log_sha256": "4be929eee47c06938fe228adcef2dff245a38d32c9bdcc44808376735c175f1b" + }, + { + "name": "global-program", + "seconds": 2.582935667014681, + "log_sha256": "c9ed76d601e121721dd1e540a5db45701b8a6b3d37920b72d3a300126e1624fd" + }, + { + "name": "independent-audit", + "seconds": 3.009822624968365, + "log_sha256": "e089d3fa06b37a96a4a998d27c28f3b62c5b88a7d4fe5e77e0ff6e2a9ca6ef76" + }, + { + "name": "two-moments", + "seconds": 0.13729891693219543, + "log_sha256": "6d556f02612ff9a8df2239e44b949bc8bf81e03102b54ca762966a7dbd7a598e" + }, + { + "name": "finite-assembly", + "seconds": 0.15405583300162107, + "log_sha256": "cd2459472bd6f540e6610b019907b7fc36b1058cc69b1b608e6254e33a8de603" + } + ], + "parent_phase_mode": "full replay" +} diff --git a/research/e8-early-reset-reuse/local-evidence/FULL-PORTABLE-PYTHON314.json b/research/e8-early-reset-reuse/local-evidence/FULL-PORTABLE-PYTHON314.json new file mode 100644 index 0000000000..773987c837 --- /dev/null +++ b/research/e8-early-reset-reuse/local-evidence/FULL-PORTABLE-PYTHON314.json @@ -0,0 +1,44 @@ +{ + "status": "PASS_FULL_PARENT_AND_EARLY_RESET_REUSE", + "kappa": "1128250848293019/1000000000000000000", + "kappa_decimal": "0.001128250848293019", + "source_manifest_sha256": "06c5bd1afe07ebede7aaa13ae694ab7b345beab0a9d149c27fc992c92f3727f6", + "checks": [ + { + "name": "full-parent433", + "seconds": 106.79119999997783, + "log_sha256": "028a6067de8c3a61dfbf81c5d9c8d3629949b70cc118b64264f25df4b84a64ac" + }, + { + "name": "reconstruct", + "seconds": 0.05519566696602851, + "log_sha256": "ceeb567022f0746ceb350487a568b94cdfeacf3fb55cdc4088fecfab389caefa" + }, + { + "name": "export", + "seconds": 0.3756797920214012, + "log_sha256": "4be929eee47c06938fe228adcef2dff245a38d32c9bdcc44808376735c175f1b" + }, + { + "name": "global-program", + "seconds": 2.8925695409998298, + "log_sha256": "e0c19f3d4a91706a47e43f67bcbed72bdbb4e46534476bfad7c6e069dccabefb" + }, + { + "name": "independent-audit", + "seconds": 1.761562458006665, + "log_sha256": "1c95eb8403c1b9bd0c405247001c8fdfc03ea58c1f991cae2497ee7cb3221538" + }, + { + "name": "two-moments", + "seconds": 0.15180487500037998, + "log_sha256": "6d556f02612ff9a8df2239e44b949bc8bf81e03102b54ca762966a7dbd7a598e" + }, + { + "name": "finite-assembly", + "seconds": 0.17741812497843057, + "log_sha256": "cd2459472bd6f540e6610b019907b7fc36b1058cc69b1b608e6254e33a8de603" + } + ], + "parent_phase_mode": "full replay" +} diff --git a/research/e8-early-reset-reuse/local-evidence/FULL-PYTHON314-INITIAL.json b/research/e8-early-reset-reuse/local-evidence/FULL-PYTHON314-INITIAL.json new file mode 100644 index 0000000000..39fe0d80ac --- /dev/null +++ b/research/e8-early-reset-reuse/local-evidence/FULL-PYTHON314-INITIAL.json @@ -0,0 +1,44 @@ +{ + "status": "PASS_FULL_PARENT_AND_EARLY_RESET_REUSE", + "kappa": "1128250848293019/1000000000000000000", + "kappa_decimal": "0.001128250848293019", + "source_manifest_sha256": "493f586b3c35dc0c2dacca23e58d81a8deff4f1187df2d2f6b18842ccb9568de", + "checks": [ + { + "name": "full-parent433", + "seconds": 103.98563337500673, + "log_sha256": "028a6067de8c3a61dfbf81c5d9c8d3629949b70cc118b64264f25df4b84a64ac" + }, + { + "name": "reconstruct", + "seconds": 0.050218041986227036, + "log_sha256": "ceeb567022f0746ceb350487a568b94cdfeacf3fb55cdc4088fecfab389caefa" + }, + { + "name": "export", + "seconds": 0.3637806250480935, + "log_sha256": "4be929eee47c06938fe228adcef2dff245a38d32c9bdcc44808376735c175f1b" + }, + { + "name": "global-program", + "seconds": 2.4805483330274, + "log_sha256": "20c0d8b5ce235496b9149639369284883c7ad245addabd6c364a115644b73913" + }, + { + "name": "independent-audit", + "seconds": 1.7047545410459861, + "log_sha256": "9e17c2b34dffc8eb7d63b6ed4d43bce0b872d6d9adfa0b1a64ec46379bbbda49" + }, + { + "name": "two-moments", + "seconds": 0.15184016700368375, + "log_sha256": "6d556f02612ff9a8df2239e44b949bc8bf81e03102b54ca762966a7dbd7a598e" + }, + { + "name": "finite-assembly", + "seconds": 0.15915608289651573, + "log_sha256": "cd2459472bd6f540e6610b019907b7fc36b1058cc69b1b608e6254e33a8de603" + } + ], + "parent_phase_mode": "full replay" +} diff --git a/research/e8-early-reset-reuse/local-evidence/PARENT-FULL-REPLAY.json b/research/e8-early-reset-reuse/local-evidence/PARENT-FULL-REPLAY.json new file mode 100644 index 0000000000..59ced26676 --- /dev/null +++ b/research/e8-early-reset-reuse/local-evidence/PARENT-FULL-REPLAY.json @@ -0,0 +1,120 @@ +{ + "status": "PASS_CONDITIONAL_SPLIT_CENTRE_ASSEMBLY", + "kappa": "560432476129139/500000000000000000", + "kappa_decimal": "0.001120864952258278", + "bit_lower": "561061350132569610283/500000000000000000000000", + "complex_lower": "1183986549206329/1000000000000000000", + "binding_component": "bit", + "gain_over_pr425_percent": 6.9522005058117555, + "bit_invoice": { + "prefix_bits": 223, + "charged_prefix_bits": 256, + "coefficient_bits": 223, + "two_level_coefficient_bits": 483, + "charged_two_level_coefficient_bits": 512, + "row_coefficient": 18355, + "live": 14502, + "physical": 14511 + }, + "strict_outer_constraints": { + "bit_positive": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_above_bit": "791857266447229204459483569705102945201339627252022591017013352985113602942786795000164759817249951996149235225861576966507630300630689893816878766552471016817/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_below_one_over32": "30066013450793671/1000000000000000000", + "beta_positive": "1/1000000000000000000", + "beta_below_one": "999999999999999999/1000000000000000000", + "leaf_saving_above_bit": "791857266447229189304455739864091745201339627252022591017013352985113602942786795000164759817249951996149235225861576966507630300630689893816878766552471016817/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_positive": "7181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_internal": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_leaf": "395928633223614609015398433325827868141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_positive": "7181585281696892583407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_below_one": "6392818414718303107416592912348246333468141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_reservations": "1/4000000000000000000", + "lambda_above_tau": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_sigma": "791857266447229218822654133098884940741856057546919645815673725733091011925773442015051156874463156995984475408611624970358395074769112927309248465921781123000121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_internal": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_prime_above_lambda": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_leaf": "395928633223614609015398433325827868141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_reservations": "1/4000000000000000000", + "lambda_prime_below_one": "7181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "epsilon_positive": "6399999999999999993600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "epsilon_below_one": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "guard_width": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "K_geometry": "4807181585281696892583407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817000000000000000000", + "K_dominates_log": "231664041345061050845983947421186256401668584010497584446258683699366907737186677571792433338340060113453513521617978855187267028104098984087218414251878140832554446748323117142213588175726741393/206683276944570867451077647988766247307479316572776744891925575256476111799662761934047904233001101994161357746522719973016545013550824072000632231965075950141464786411824273258607000000000000000000", + "record_suffix": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "phase_local": "57452682253575172660075115932332441271463422396879066665683849849996634666672126693120783994727674596531689914600391489101073218400050692643898107263289403063667839215065313749127621233447528983183/51257452682253575127867256701214029332254870510048632733197542663606075726316364959643880249784273294552016721137634553308103163360604369856156793527338835635083267030132419768134536000000000000000000", + "phase_boundary": "11490536450715029406269754961108975467567014357972880107649718965136053613580158978016584167309038954918313004492748842618542529916554807718463285392220894997054215109129499241498821233447528983183/10251490536450715025573451340242805866450974102009726546639508532721215145263272991928776049956854658910403344227526910661620632672120873971231358705467767127016653406026483953626907200000000000000000", + "gamma_sublinear": "1/2000000000000000000", + "cell_above_band": "12799999999999999980792818414718303109016592912348246333468141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/25628726341126787563933628350607014666127435255024316366598771331803037863158182479821940124892136647276008360568817276654051581680302184928078396763669417817541633515066209884067268000000000000000000", + "prime_interval_packing": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "alpha_positive": "14363170563393788359632590021810442080310539860404516767526852145439839929398406960210596656522703682519149061374476508023700697946773300526302961759162676751217566615750487648225621233447528983183/12814363170563393781966814175303507333063717627512158183299385665901518931579091239910970062446068323638004180284408638327025790840151092464039198381834708908770816757533104942033634000000000000000000", + "alpha_below_one": "12799999999999999993607181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/12814363170563393781966814175303507333063717627512158183299385665901518931579091239910970062446068323638004180284408638327025790840151092464039198381834708908770816757533104942033634000000000000000000", + "alpha_below_one_fourth": "3189227622077454657132070953804066391185618867017635029057319564329939892965374403017531918954994377226981896009727683073732747012090999815483496633699514550441486622767525747860182878766552471016817/12814363170563393781966814175303507333063717627512158183299385665901518931579091239910970062446068323638004180284408638327025790840151092464039198381834708908770816757533104942033634000000000000000000", + "delta_positive": "1/8000000000000000000", + "delta_below_one_eighth": "999999999999999999/8000000000000000000", + "short_record_fallback": "81827972558059963142482295831039750365059753405165839859500887157900070163784215146039541956047009515286378723945407637791323146319740145866082020356197908534083134290654194352838948148633280800174595114507063924980758679362172726895650066012032777455278212210736064133662717611940569491044304210260992667579958374711353997952140066809896811489/82011924291605720204587610721942446931607792816077812373116068261769721162106183935430208399654837271283226753820215285292965061376966991769850869643742137016133227248211871629015257600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "small_field_exposure": "1/1000000000000000000", + "artificial_boundary": "358859621458028601093359598365557325330989185343344322865175917750116843085479998176003320395642823216282588862770178911921831577311447916339793034478937323776724933813811421508232513136299657413050451/51257452682253575127867256701214029332254870510048632733197542663606075726316364959643880249784273294552016721137634553308103163360604369856156793527338835635083267030132419768134536000000000000000000", + "literal_scalar_guard": "1", + "row_product_gap": "23971789/25", + "balanced_prefix_above_kappa": "5122866517862023505724960619093421545844111701898553134698525509504383311993872387184513125657251444712150871805627114225726283245038727038504547469670408073428467093191496467269437/3203590792640848445491703543825876833265929406878039545824846416475379732894772809977742515611517080909501045071102159581756447710037773116009799595458677227192704189383276235508408500000000000000000", + "coordinate_movement_above_kappa": "16099174487823595540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_phase_layer_above_kappa": "3838551450442350120466514150535089425156364590041027177747358186058007158198199154413541220091468727605299653469049909287939671070001907844989495748423461692471525807616440463522057/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817000000000000000000", + "bulk_exposure_above_kappa": "16099174487823595540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Gaussian_arithmetic_above_kappa": "49929956359383891636682334467235976400846493161596454696927943987316335662954230095174784854400852306299403498179012231794056054820241901455974763560139756902928431597231181121226907/51257452682253575127867256701214029332254870510048632733197542663606075726316364959643880249784273294552016721137634553308103163360604369856156793527338835635083267030132419768134536000000000000000000", + "scalar_work_above_kappa": "3022347308020427168024638512713719642678957136664830842541068612764774941044496502999868999171719558143016474349913180337924305460021763455362126412952366988818802604491895640211767/2050298107290143005114690268048561173290194820401945309327901706544243029052654598385755209991370931782080668845505382132324126534424174794246271741093553425403330681205296790725381440000000000000000", + "dimension_above_kappa": "3196409207359151553231162974036146672459031212215382000019265285423173401803752699526640796382355306275012080586149285130394424095589341109716483649580049811311843280287131837920058593191496467269437/3203590792640848445491703543825876833265929406878039545824846416475379732894772809977742515611517080909501045071102159581756447710037773116009799595458677227192704189383276235508408500000000000000000" + }, + "outer_controls": [ + "next_grid", + "zero_eta", + "zero_beta", + "unit_beta" + ], + "bootstrap": [ + { + "gap": "48640105104416009930955104551272628756769/40000000000000000000000000000000000000000000000", + "cutoff_log2": "24346328299693" + }, + { + "gap": "10916033216189494908506938862091413300675156484737667525550897/8000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "19335382939135799529" + }, + { + "gap": "2449825733746901655394438404809502019511708753179325050819248403056515410563319361/1600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "15355787073969246541017124" + }, + { + "gap": "549801013506219857550281901936704203615404924098069138182437287931091972275689180385852832590942771793/320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "12195269025875323655994833423982" + }, + { + "gap": "123388839576821941106964776874551364767558290306753584545234931806617408234472738882773008179061080923160999418343337504609/64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "9685246734476302780854842486398253310" + }, + { + "gap": "27691483569705102945201339627252022591017013352985113602942786795000164759817249951996149235225861576966507630300630689893816878766552471016817/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "7691835588756193183914168151850588989363719" + } + ], + "bit_template_sha256": "c40f89a2ae3c2c5635ddf8f18d74f24567ddf67fc8c8e93a1fc7a1a8098e857e", + "complex_template_sha256": "942d030fa43316c560c88d7d7d904583446e1a96945b3ebd37a91c88a192ab4f", + "scope": "Finite research composition with explicit changed words, exact local and global replay and incremental phase evidence. All-size correlated dirty-bank, compressed-window, compiler, restored-work, tape/common-grid, precision and analytic interfaces remain inherited assumptions. This certificate makes no unconditional integer-multiplication or Lean-kernel claim.", + "verification_steps": [ + "hamming_packets", + "complex_construct", + "complex_audit", + "complex_emit", + "complex_phases", + "bit_construct", + "bit_export", + "bit_global", + "bit_audit", + "bit_price", + "complex_integrate", + "complex_replay", + "combined" + ], + "phase_mode": "full replay", + "manifest_sha256": "c903e548e42d04a243a034d320b15e6cb26b878c30f935181336ea6ea679a004" +} diff --git a/research/e8-early-reset-reuse/local-evidence/PYTHON311-GZIP-FAILURE.log b/research/e8-early-reset-reuse/local-evidence/PYTHON311-GZIP-FAILURE.log new file mode 100644 index 0000000000..20a1987364 --- /dev/null +++ b/research/e8-early-reset-reuse/local-evidence/PYTHON311-GZIP-FAILURE.log @@ -0,0 +1,5 @@ +Traceback (most recent call last): + File "/Volumes/SP AI 01_16/CodexWorkspaces/imb-retime2/frontier390/source433-review/research/split-centres-global/code/complex_phases.py", line 9, in + assert sha(O/'CANONICAL-WORD.json.gz')==r['canonical_word_sha256'] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +AssertionError diff --git a/research/e8-early-reset-reuse/local-evidence/PYTHON311-INITIAL-FAILURE.json b/research/e8-early-reset-reuse/local-evidence/PYTHON311-INITIAL-FAILURE.json new file mode 100644 index 0000000000..d82c79a260 --- /dev/null +++ b/research/e8-early-reset-reuse/local-evidence/PYTHON311-INITIAL-FAILURE.json @@ -0,0 +1,4 @@ +{ + "error": "RuntimeError(('full-parent433', 1, 'PASS hamming_packets\\nPASS complex_construct\\nPASS complex_audit\\nPASS complex_emit\\nTraceback (most recent call last):\\n File \"/Volumes/SP AI 01_16/CodexWorkspaces/imb-retime2/frontier390/early-reuse-publication/research/split-centres-global/verify.py\", line 39, in \\n for name in (\\'complex_construct\\',\\'complex_audit\\',\\'complex_emit\\',\\'complex_phases\\',\\'bit_construct\\'):run(name,\\'code/\\'+name+\\'.py\\')\\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n File \"/Volumes/SP AI 01_16/CodexWorkspaces/imb-retime2/frontier390/early-reuse-publication/research/split-centres-global/verify.py\", line 36, in run\\n assert r.returncode==0,(name,str(out/(name+\\'.log\\')))\\n ^^^^^^^^^^^^^^^\\nAssertionError: (\\'complex_phases\\', \\'/Volumes/SP AI 01_16/CodexWorkspaces/imb-retime2/frontier390/early-reuse-full311/baseline/complex_phases.log\\')\\n'))", + "completed": [] +} diff --git a/research/e8-early-reset-reuse/replay.py b/research/e8-early-reset-reuse/replay.py new file mode 100644 index 0000000000..84d4875764 --- /dev/null +++ b/research/e8-early-reset-reuse/replay.py @@ -0,0 +1,71 @@ +"""Reconstruct eleven chronological clean resets; regenerate arbitrary-dirt compensation. +Rohan Arun with OpenAI Codex assistance, using icekylinx's PR433 and ai-nanachi's PR426. +""" +import copy,hashlib,json,sys +from pathlib import Path +from collections import defaultdict +ROOT=Path(__file__).resolve().parent + +def reconstruct(raw,selection): + assert hashlib.sha256(raw).hexdigest()==selection['source_sha256'] + w=json.loads(raw);v=w['v'];n=2*v+w['R'];entries=selection['entries'];cut=len(w['A'])-w['source_basis_gates'];assert all(d>=2*v for f,d,ss in w['A'][:cut]) + removed={z['new_helper'] for z in entries};retired={z['retired_helper'] for z in entries} + assert len(removed)==len(retired)==len(entries) and not removed&retired + assert all(2*v<=x>i&1] + if ss:D.append([0,v+t,ss]) + c['D']=D;raw=json.dumps(c,sort_keys=True,separators=(',',':')).encode();assert hashlib.sha256(raw).hexdigest()==selection['word_sha256'];return raw + +def controls(raw,sel): + rejected=[] + cases=[] + for label in ('missing reset parent','wrong insertion time','duplicate physical reuse'): + s=copy.deepcopy(sel) + if label=='missing reset parent':s['entries'][0]['parents'].pop() + elif label=='wrong insertion time':s['entries'][0]['position']=0 + else:s['entries'][1]['new_helper']=s['entries'][0]['new_helper'] + cases.append((label,s)) + for label,s in cases: + try:reconstruct(raw,s) + except AssertionError:rejected.append(label) + else:raise AssertionError(label) + return rejected +if __name__=='__main__': + raw=Path(sys.argv[1]).read_bytes();s=json.loads((ROOT/'SELECTION.json').read_text());out=Path(sys.argv[2]);data=reconstruct(raw,s);out.write_bytes(data);print(json.dumps(dict(status='PASS_EXACT_CHRONOLOGICAL_RECONSTRUCTION',helpers_removed=len(s['entries']),R=s['R'],sha256=hashlib.sha256(data).hexdigest(),controls=controls(raw,s)))) diff --git a/research/e8-early-reset-reuse/verify.py b/research/e8-early-reset-reuse/verify.py new file mode 100644 index 0000000000..6fae5fc80e --- /dev/null +++ b/research/e8-early-reset-reuse/verify.py @@ -0,0 +1,31 @@ +"""Fresh parent replay, chronological reset reconstruction, banks and exact assembly.""" +from pathlib import Path +import hashlib,json,os,subprocess,sys,time +assert __debug__ +ROOT=Path(__file__).resolve().parent;PARENT=ROOT.parent/'split-centres-global';out=Path(sys.argv[1]).resolve();assert not out.exists() and not out.is_relative_to(ROOT.parent) +read=lambda p:json.loads(p.read_text());sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest() +def integrity(): + assert {p.relative_to(ROOT).as_posix():sha(p) for p in ROOT.rglob('*') if p.is_file() and p.name!='MANIFEST.json'}==read(ROOT/'MANIFEST.json')['files'] + assert sha(PARENT/'MANIFEST.json')==read(ROOT/'SOURCE.json')['parent_manifest_sha256'] +integrity();out.mkdir(parents=True);env=dict(os.environ,PYTHONDONTWRITEBYTECODE='1',PYTHONINTMAXSTRDIGITS='0');env.pop('PYTHONOPTIMIZE',None);steps=[] +def run(name,file,*args,cwd=None): + t=time.monotonic();log=out/(name+'.log');print('RUN',name,flush=True) + with log.open('w') as f:q=subprocess.run([sys.executable,'-B',str(file),*map(str,args)],cwd=cwd,env=env,stdout=f,stderr=subprocess.STDOUT) + if q.returncode:raise RuntimeError((name,q.returncode,log.read_text()[-2000:])) + steps.append(dict(name=name,seconds=time.monotonic()-t,log_sha256=sha(log)));print('PASS',name,flush=True) +try: + base=out/'baseline';run('full-parent433',PARENT/'verify.py',base,'--replay-phases') + changed=out/'changed';changed.mkdir() + for name in ('work','inherited','split-centres'):(changed/name).symlink_to(base/name,target_is_directory=True) + bit=changed/'bit426-source-centres';bit.mkdir() + run('reconstruct',ROOT/'replay.py',base/'bit426-source-centres/bit-source-centres.json',bit/'bit-source-centres.json') + run('export',PARENT/'vendor/export_records.py',bit/'bit-source-centres.json',bit/'records') + run('global-program',ROOT/'bit_global.py','--source',bit,'--local-check',bit,'--out',bit/'global',cwd=changed) + run('independent-audit',ROOT/'bit_audit.py','--local-check',bit,'--out',bit/'global',cwd=changed) + run('two-moments',ROOT/'bit_price.py',cwd=changed) + env['E8_OUTPUT']=str(changed);run('finite-assembly',ROOT/'combined.py',cwd=changed) + actual=read(changed/'RESULT.json');expected=read(ROOT/'EXPECTED.json') + for k,v in expected.items():assert actual[k]==v,(k,actual[k],v) + integrity();result=dict(status='PASS_FULL_PARENT_AND_EARLY_RESET_REUSE',kappa=actual['kappa'],kappa_decimal=actual['kappa_decimal'],source_manifest_sha256=sha(ROOT/'MANIFEST.json'),checks=steps,parent_phase_mode=read(base/'RESULT.json')['phase_mode']);(out/'RESULT.json').write_text(json.dumps(result,indent=2)+'\n') +except BaseException as e: + (out/'FAILURE.json').write_text(json.dumps(dict(error=repr(e),completed=steps),indent=2)+'\n');raise diff --git a/research/idle-axis-hosting/EXPECTED.json b/research/idle-axis-hosting/EXPECTED.json new file mode 100644 index 0000000000..1b0811df29 --- /dev/null +++ b/research/idle-axis-hosting/EXPECTED.json @@ -0,0 +1,10 @@ +{ + "status": "PASS_CONDITIONAL_IDLE_AXIS_HOSTING_ASSEMBLY", + "kappa": "618775866623647/500000000000000000", + "kappa_decimal": "0.001237551733247294", + "bit_lower": "1239085165241180038597/1000000000000000000000000", + "complex_lower": "1267453159029119/1000000000000000000", + "binding_component": "bit", + "bit_template_sha256": "dd7833dcaff8c84b258847f4c4d65b6402c702700ae37d2c464083ee37b24126", + "complex_template_sha256": "6f48c811e981bbd76436dfe19f497ed627794987fd4347daf123d0d698a5fe3f" +} diff --git a/research/idle-axis-hosting/LICENSE b/research/idle-axis-hosting/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/idle-axis-hosting/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/idle-axis-hosting/MANIFEST.json b/research/idle-axis-hosting/MANIFEST.json new file mode 100644 index 0000000000..542ee2f988 --- /dev/null +++ b/research/idle-axis-hosting/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "files": { + "EXPECTED.json": "ed83c1bf1ca2d01eaab5149a34520806a07ef375dfa9e3ed69d123f4be4c9960", + "LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "NOTICE.md": "027a868628d0408602dbeae688b031ed9b4abfd6e5401f6e8106a3eb25ebc4ca", + "PROOF.md": "cfe34bf0b64259661312dae22c3a23adc5bf6f6326951eee5c1488ccfc347542", + "README.md": "1151f74cad54ac4937282b7a8b5d1108ed4ce35944ef9b7bb7d17abfce1fe4a0", + "SELECTION.json": "315d54be472842707cce879618be477d8b897050e873bc136d114eec6a232f97", + "assemble.py": "f9a2e6a42aadcf971702a5a867760a092566ed03356f4f34387d38f4093ad1a6", + "audit.py": "38594423a401110bd430b734037c6ecba422ee6a94d71709984e0afa9cd1edf8", + "bit_hosted.py": "6dfbf26213e8adf87563b3575cfb722bd07ecd65627f056b3293411dd3d89a61", + "complex_hosted.py": "829c5c4f4bdfccedadd31505f1f0a394f7a208d1446b7bbf9cc92d3aa1530c0c", + "hosting_core.py": "d8b90cd5d152df3c7c351230863d9e61816ad5e1f21d69bea1a86a5daad559a3", + "verify.py": "737a974d79fdd232b6c4b9e059c56835079971447342ed7ca3b82a614e30cb53" + }, + "parent_manifest_sha256": "95a9570287b64d22de30e6ae3acf931d5f6daef1a163f0c99532e1a24639fbc2" +} diff --git a/research/idle-axis-hosting/NOTICE.md b/research/idle-axis-hosting/NOTICE.md new file mode 100644 index 0000000000..391e865e06 --- /dev/null +++ b/research/idle-axis-hosting/NOTICE.md @@ -0,0 +1,18 @@ +# Notice + +This package adds idle-axis hosting on top of the following work. Their packages are used unchanged and run fresh by +`verify.py`; their notices remain in their own directories. + +- #434, Rohan Arun with OpenAI Codex: early resets and the shared-donor kernel. This is the parent composition and its + verifier. +- #433, icekylinx with Codex: split centres (complex supplier) and source-centre bit composition, together with their + engines and invoices. +- #435 / #417, chafreaky: the response kernel and mixed-width banks. +- #426, ai-nanachi: clean-reset reuse. +- #425 and #386, Zhihao Chen with OpenAI Codex: the mutable-basis complex interface and the compressed nine-stage + geometry, routes and banks. +- #370, Dylan Crow with Anthropic Claude: the Hamming E8 bit producer. +- Jacob Sussman: the E8 unit and the frame/compiler interfaces. + +The hosting construction, its generators, audit and assembly scripts are new here, and were prepared with assistance +from Claude. They are released under the Apache-2.0 license in `LICENSE`. diff --git a/research/idle-axis-hosting/PROOF.md b/research/idle-axis-hosting/PROOF.md new file mode 100644 index 0000000000..4468a00349 --- /dev/null +++ b/research/idle-axis-hosting/PROOF.md @@ -0,0 +1,105 @@ +# Idle-axis hosting: helper residuals on pending idle coordinates + +This package changes only the global nine-stage templates of #434's two suppliers. Both local words are unchanged: + +- the complex word is #433's split-centre word, R = 560, m = 73; +- the bit word is #434's early-reset kernel word, R = 747, m = 64. + +So are their local programs, scalar replays, data routes, bridges, terminal exchange and cover correction. What +changes is where whole dirty-helper residuals live. Many of them move from bank streams onto coordinates of *idle* +data families that would otherwise be advanced later by an idle child. + +## 1. The two inherited facts used + +**(a) Dirty invocations act on a helper stream as its residual.** The complete dirty local invocation is block +diagonal on helpers at its endpoint and admits arbitrary correlated helper values (#425/#433, #386/#434). On the +physical stream that owns a helper residual of width w, it acts as an exact coordinate factor on w coordinates: + +- complex: P_g C_block P_g⁻¹ (PR425-COMPLEX §5, INHERITED-COMPLEX-GEOMETRY); +- bit: D_P with P the width-w coordinate projector (PR386-BIT-GEOMETRY; mixed widths 8 − entrance rank, #434). + +This holds whatever the stream held before. Banks rely on exactly this: eight sequential residuals and a pad tile a +bank stream. + +**(b) An idle child is a product of coordinate factors.** Advancing a data pair from level a to level b applies, on +every physical data stream (F, g) of that pair, the commuting product of coordinate factors on its pending set S: + +- complex: C over S, in the basis U_q ⊕ I used by the inherited idle factorisation; +- bit: D_{P_V−P_U}, an orthogonal coordinate projector difference. + +Factors on disjoint coordinate sets commute and multiply: + +- complex: C_{S'}·C_{S∖S'} = C_S; +- bit: D_{P'}·D_{P−P'} = D_P for P' ≤ P (the parent's identity D_I·D_P = D_{I−P}). + +## 2. Hosting lemma + +Fix a data family F (replica r, pair j, side, port) and an idle child Γ that advances pair j at recipe position τ. +Let λ be the position of the last local invocation or bridge that names pair j before τ; idle children do not +count as touches, since they act on other coordinates or on the other member. Let ι be any local invocation with +λ < ι < τ. Then: + +1. ι is an invocation on another pair, and nothing touches F between ι and τ. +2. A helper residual of ι, of width w, may be owned by stream (F, d·σ⁻¹) instead of a bank slot. Here d is the + invocation's cover class, and σ is a coordinate isometry carrying the local residual block onto a set S' ⊂ S of + w pending coordinates. When S' meets the local block of a level −1 advance, σ is composed with U_q ⊕ I. +3. Γ is replaced by Γ' acting on S ∖ ⋃S' over all hosted residuals of F, which have pairwise disjoint S'. + +The complete program's operator is unchanged: + +- By (a), ι applies exactly the factor on S' to (F, d·σ⁻¹), for any prior contents. +- Nothing else acts on F between ι and τ, so this factor may be moved to τ. +- By (b), the moved factors times Γ' equal Γ. + +Distinct slots of one invocation have distinct σ, so distinct physical classes for every d. They are also disjoint +from the invocation's own data owners, because pair j is not active, and from bank owners, because the families +differ. Residuals of different invocations on F occupy disjoint coordinates. They are sequential, exactly as the +parent's banks are co-owned sequentially by different cover classes. + +Two further points: + +- **Phases.** The stored Z₄ translations after Γ remain valid, because Γ'·∏(hosted factors) = Γ as exact operators. + The final X_δ(g) correction still applies to every live family; hosting changes no data endpoint. +- **Reflection.** The inverse-transpose program reverses chronology and reflects each factor. The window condition + (no touch strictly between ι and τ) is symmetric, so hosting commutes with reflection. + +## 3. What is checked here + +- `bit_hosted.py` and `complex_hosted.py` read #434's freshly regenerated templates and compute windows from each + recipe. They apply a frozen integer-programme selection (`SELECTION.json`; `--discover` recomputes it with scipy) + and emit new owners, remainder children and banks. + - Bit: unhosted residuals keep an exact width-64 tiling with no padding. + - Complex: eight per bank plus one paid pad; a final partial bank pays the larger pad. +- `audit.py` shares no code with the generators. It re-derives every window from the template schedule. For every + replica and invocation it checks that: + - each helper has exactly one owner; + - each hosted slot is inside its child's pending set, disjoint from other slots, outside the active pair, and in + window; + - every remainder child is exact, and the bank tiling is exact. + + It also recomputes the paid profile and the rank deficit 2496, and rejects nine mutations. +- `assemble.py` prices both suppliers with the two inherited rational moment engines and recomputes both finite + invoices with the hosted stock. Route charging is conservative: two extra route factors per helper selector, and + the parent's larger complex per-vertex bill is kept. It then runs #434's strict outer assembly: six bootstrap + levels and 47 inequalities. The next grid point and the zero-η, zero-β and unit-β controls are rejected. + +## 4. Result + +| | live stock | max child | hosted residuals | certified saving | +| --- | ---: | ---: | ---: | --- | +| bit | 14,259 → 9,457 | 42 → 8 | 39,568 of 53,784 | c = 1239085165241180038597/10²⁴ | +| complex | 12,720 → 8,400 | 48 → 8 | 34,560 of 40,320 | b = 1267453159029119/10¹⁸ | + +κ = 618775866623647/(5·10¹⁷) ≈ 1.237551733247294·10⁻³, bit-bound, +9.218% over #434. + +## 5. Scope + +This is a written finite extension of the inherited correlated dirty-bank and compressed-window interfaces. The +streams that own residuals now include data streams during idle windows. It is the principal new review point. + +All other interfaces remain inherited assumptions: the all-size compiler, restored-work, tape/common-grid, precision +and analytic interfaces. + +No Lean proof and no unconditional integer-multiplication theorem is claimed. The global operator identity is argued +from (a) and (b) and checked combinatorially. It is not replayed numerically on the 2⁷³- and 2⁶⁴-point address +spaces; neither parent does that either. diff --git a/research/idle-axis-hosting/README.md b/research/idle-axis-hosting/README.md new file mode 100644 index 0000000000..9d9b80cc3b --- /dev/null +++ b/research/idle-axis-hosting/README.md @@ -0,0 +1,42 @@ +# Idle-axis hosting on #434: conditional κ ≈ 1.2375517·10⁻³ + +This package moves whole dirty-helper residuals of both E8 suppliers from bank streams onto the pending coordinates of +idle data families. Those coordinates would otherwise be advanced by idle children later in the nine-stage template. + +Neither local word changes: + +- complex: #433's split-centre word, R = 560; +- bit: #434's early-reset kernel word, R = 747. + +**Result:** κ = 618775866623647/(5·10¹⁷) ≈ 1.237551733247294·10⁻³, bit-bound, **+9.218% over #434** +(1.133100552284434·10⁻³). + +| supplier | parent saving | hosted saving | live stock | max child | +| --- | --- | --- | --- | --- | +| bit, m = 64 | 1.134386·10⁻³ | **1.239085·10⁻³** | 14,259 → 9,457 | 42 → 8 | +| complex, m = 73 | 1.183987·10⁻³ | **1.267453·10⁻³** | 12,720 → 8,400 | 48 → 8 | + +**Why it gains.** Idle advance children are about a sixth of the paid cost of the compressed window. A dirty helper +residual acts on its stream as the same kind of coordinate factor an idle child applies. Hosting the residual there +removes the bank stream, its padding, and that part of the idle child, and the rank deficit stays at 2496. + +The validity condition is a window: the host family must be untouched between the hosting invocation and its +scheduled advance. [PROOF.md](PROOF.md) gives the argument and its scope. + +## Verify + +```sh +python3 -B research/idle-axis-hosting/verify.py /absolute/new/output +``` + +- Uses Python 3.11+ and the standard library only. +- The output directory must not exist. +- It runs #434's complete `verify.py` from scratch, then the bit and complex hosting generators, the independent + audit (nine mutation controls) and the exact assembly. It compares every value with `EXPECTED.json`. +- `SELECTION.json` freezes the integer-programme choice. `--discover` on either generator recomputes it with scipy. + +## Scope + +This is conditional, like its parents. The extension of the correlated dirty-bank interface to idle data streams is +the new review point. All-size compiler, compressed-window, restored-work, tape/common-grid, precision and analytic +interfaces are inherited. No Lean proof or unconditional theorem is claimed. diff --git a/research/idle-axis-hosting/SELECTION.json b/research/idle-axis-hosting/SELECTION.json new file mode 100644 index 0000000000..e3303cd97d --- /dev/null +++ b/research/idle-axis-hosting/SELECTION.json @@ -0,0 +1,553 @@ +{ + "bit": { + "patterns": [ + [ + 0, + [ + 7, + 7 + ], + 104 + ], + [ + 0, + [ + 8 + ], + 136 + ], + [ + 1, + [], + 136 + ], + [ + 1, + [ + 7 + ], + 104 + ], + [ + 2, + [ + 7, + 7, + 7, + 7 + ], + 26 + ], + [ + 2, + [ + 8, + 8, + 8 + ], + 190 + ], + [ + 2, + [ + 8, + 8, + 8, + 4 + ], + 24 + ], + [ + 3, + [], + 130 + ], + [ + 3, + [ + 4 + ], + 6 + ], + [ + 3, + [ + 7 + ], + 104 + ], + [ + 4, + [ + 8, + 8, + 8, + 8, + 8 + ], + 240 + ], + [ + 5, + [], + 136 + ], + [ + 5, + [ + 7 + ], + 104 + ], + [ + 6, + [ + 8, + 8, + 8, + 8, + 8 + ], + 240 + ], + [ + 7, + [ + 7, + 7, + 7, + 7 + ], + 26 + ], + [ + 7, + [ + 8, + 8, + 8 + ], + 190 + ], + [ + 7, + [ + 8, + 8, + 8, + 4 + ], + 24 + ], + [ + 8, + [ + 7, + 7 + ], + 104 + ], + [ + 8, + [ + 8 + ], + 136 + ] + ], + "proxy_saving": 23281.85835940203, + "stages": [ + [ + 0, + 7, + 0, + 104 + ], + [ + 0, + 7, + 1, + 104 + ], + [ + 0, + 8, + 1, + 136 + ], + [ + 1, + 7, + 2, + 104 + ], + [ + 2, + 4, + 0, + 6 + ], + [ + 2, + 4, + 1, + 6 + ], + [ + 2, + 4, + 2, + 6 + ], + [ + 2, + 4, + 3, + 6 + ], + [ + 2, + 7, + 3, + 104 + ], + [ + 2, + 8, + 1, + 5 + ], + [ + 2, + 8, + 2, + 637 + ], + [ + 3, + 4, + 4, + 6 + ], + [ + 3, + 7, + 4, + 104 + ], + [ + 4, + 8, + 3, + 637 + ], + [ + 4, + 8, + 5, + 563 + ], + [ + 5, + 7, + 6, + 104 + ], + [ + 6, + 8, + 4, + 563 + ], + [ + 6, + 8, + 6, + 637 + ], + [ + 7, + 4, + 5, + 6 + ], + [ + 7, + 4, + 6, + 6 + ], + [ + 7, + 4, + 7, + 6 + ], + [ + 7, + 4, + 8, + 6 + ], + [ + 7, + 7, + 5, + 104 + ], + [ + 7, + 8, + 7, + 501 + ], + [ + 7, + 8, + 8, + 141 + ], + [ + 8, + 7, + 7, + 104 + ], + [ + 8, + 7, + 8, + 104 + ], + [ + 8, + 8, + 7, + 136 + ] + ] + }, + "complex": { + "patterns": [ + [ + 0, + [ + 9 + ], + 120 + ], + [ + 2, + [ + 9 + ], + 120 + ], + [ + 4, + [ + 9, + 9, + 9 + ], + 120 + ], + [ + 6, + [ + 9, + 9, + 9 + ], + 120 + ], + [ + 8, + [ + 9, + 9, + 9, + 9, + 9 + ], + 120 + ], + [ + 10, + [ + 9, + 9, + 9, + 9, + 9 + ], + 120 + ], + [ + 12, + [ + 9, + 9, + 9, + 9, + 9 + ], + 120 + ], + [ + 13, + [ + 9, + 9, + 9, + 9, + 9 + ], + 120 + ], + [ + 14, + [ + 9, + 9, + 9 + ], + 120 + ], + [ + 15, + [ + 9, + 9, + 9 + ], + 120 + ], + [ + 16, + [ + 9 + ], + 120 + ], + [ + 17, + [ + 9 + ], + 120 + ] + ], + "proxy_saving": 17393.16581129622, + "stages": [ + [ + 0, + 9, + 0, + 120 + ], + [ + 2, + 9, + 0, + 80 + ], + [ + 2, + 9, + 1, + 40 + ], + [ + 4, + 9, + 3, + 360 + ], + [ + 6, + 9, + 0, + 360 + ], + [ + 8, + 9, + 1, + 520 + ], + [ + 8, + 9, + 5, + 80 + ], + [ + 10, + 9, + 2, + 560 + ], + [ + 10, + 9, + 3, + 40 + ], + [ + 12, + 9, + 4, + 560 + ], + [ + 12, + 9, + 7, + 40 + ], + [ + 13, + 9, + 5, + 360 + ], + [ + 13, + 9, + 6, + 200 + ], + [ + 13, + 9, + 7, + 40 + ], + [ + 14, + 9, + 6, + 360 + ], + [ + 15, + 9, + 7, + 360 + ], + [ + 16, + 9, + 8, + 120 + ], + [ + 17, + 9, + 7, + 120 + ] + ] + } +} diff --git a/research/idle-axis-hosting/assemble.py b/research/idle-axis-hosting/assemble.py new file mode 100644 index 0000000000..f07a598643 --- /dev/null +++ b/research/idle-axis-hosting/assemble.py @@ -0,0 +1,82 @@ +"""Two exact moments for both hosted suppliers, fresh finite invoices with the hosted stock, and the strict outer +assembly of #434 (six bootstrap levels, 47 inequalities, next-grid and parameter controls). +usage: assemble.py PARENT_CHANGED_DIR BIT_DIR COMPLEX_DIR AUDIT.json OUT.json""" +import gzip, hashlib, importlib.util, json, math, sys +from fractions import Fraction as Q +from pathlib import Path +par, bd, cd, ap, outp = map(Path, sys.argv[1:6]) +def load(name): + sp = importlib.util.spec_from_file_location('hosted_' + name, par / 'work/pr361/code/engines' / (name + '.py')) + mod = importlib.util.module_from_spec(sp); sp.loader.exec_module(mod); return mod +M, Other, Outer = load('moment'), load('base_two_moment'), load('outer') +audit = json.loads(ap.read_text()); bg = json.loads((bd / 'GLOBAL.json').read_text()); ch = json.loads((cd / 'HOSTED.json').read_text()) +assert audit['bit_template_sha256'] == bg['template_sha256'] and audit['complex_template_sha256'] == ch['template_sha256'] +# ---------------- bit: two moments and the parent's invoice formulas with the hosted stock +P = {int(r): n for r, n in audit['bit_profile'].items()}; m, W = 64, audit['bit_live']; E = sum(P.values()) +geo = json.loads((par / 'bit426-source-centres/global/GEOMETRY.json').read_text()) +pg = json.loads((par / 'bit426-source-centres/global/GLOBAL.json').read_text()) +T, L, R, V, K = 8, 9, 747, 120, 4 +mass = sum(r * z for r, z in P.items()); assert m * W - mass == 2496 +physical = W + 9; d = m * m; N = 2 * m +unit = L * T * pg['local_additions'] + pg['bridge_additions'] +J = 8 * T * L * (2 * V + R) + 8 * (2 * K * V * T) + 2 * L * T * R + 2 * pg['copy_erase_episodes'] # every helper route charged (bank or hosted) +high = 16 * (d + 1) ** 2; good = 8 * m * m + 8; compiler = 128 * N ** 3 +selectors = 2 * L * T * ((W - 1) + R * m * (geo['max_route_factors'] + 2 + (m - 1) + m)) # +2: hosted route may add a slot permutation and U_q +prefix = int(pg['global_prefix_bound']); charged_prefix = 64 * ((prefix.bit_length() + 63) // 64) +coefficient = unit + J * high + J * physical + E * (good + compiler) + 16 * m ** 3 + pg['copy_erase_episodes'] + selectors + prefix + 1 +two = (coefficient + 1) ** 2 * (E + 1) ** 2; charged_two = 64 * ((two.bit_length() + 63) // 64) +assert two < 1 << charged_two and 2 * max(P) ** 2 < m * m +row = 2 * (m * m + 1) + 9909 + 252; assert row == 18355 < 20161 +root = M.certify(P, m, W, True); c = Q(root['lower']); chi = Q(root['upper']) +fb = 32 * m * m * E +lo, hi = Other.moment(m, W, list(P.items()), c); bl, bh = Other.moment(m, W, [(1, fb)], c); assert hi + bh / 10 ** 16 < 1 +lo2, hi2 = Other.moment(m, W, list(P.items()), chi); bl2, bh2 = Other.moment(m, W, [(1, fb)], chi); assert lo2 + bl2 / 10 ** 16 > 1 +# ---------------- complex: two moments and the parent's invoice with the hosted stock +PC = {int(r): n for r, n in audit['complex_profile'].items()}; mc, WC = 73, audit['complex_live']; EC = sum(PC.values()) +massc = sum(r * z for r, z in PC.items()); assert mc * WC - massc == 2496 +rc = M.certify(PC, mc, WC, True); b = Q(int(Q(rc['lower']) * 10 ** 18), 10 ** 18) +fbc = 32 * mc * mc * EC +l3, h3 = Other.moment(mc, WC, list(PC.items()), b); b3, bh3 = Other.moment(mc, WC, [(1, fbc)], b); assert h3 + bh3 / 10 ** 16 < 1 +integ = json.loads((par / 'split-centres/INTEGRATION.json').read_text()); inv = integ['finite_invoice'] +physc = ch['physical']; Rc = 560; v = 120 +compilerc = 64 * (mc + 1) ** 3 +pervertex = inv['pervertex'] - integ['physical'] * (64 + 1) + physc * (64 + 1) - integ['live'] + WC # stock-dependent terms re-based +r_ = mc // 2; group = 2 ** (r_ * r_) * math.prod(2 ** (2 * i) - 1 for i in range(1, r_ + 1)); stock = group * physc +smass = group * massc; logical = group * max(pervertex, inv['pervertex']) + 64; router = compilerc * (logical + 1) * (stock + 1) ** 2 +GG, EE, C0 = 1 << 30000, 1 << 100000, 1 << 210000; BB = smass + EE +literal = 2 * GG * stock ** 2 + 8 * smass + 4 * stock + 4 + 32 * mc +assert logical < 1 << 6050 and router < GG and literal < EE and BB < 1 << 100001 and 32 * mc * BB * BB < C0 and 2 * BB + 18 < C0 +depth = 2; assert mc ** depth > 2 * max(PC) ** depth +rowc = depth * stock.bit_length() + 9909 + 252; assert rowc < 20161 +# ---------------- outer assembly exactly as #434's combined.py +eta = beta = Q(1, 10 ** 18); grid = Q(1, 10 ** 18); s = min(c, (1 - beta) * b) - Q(1, 10 ** 24) +assert 0 < s < c and s < (1 - beta) * b +chain = [Q(384599, 10 ** 10)]; cutoffs = [] +def ceil(x): return -((-x.numerator) // x.denominator) +for j in range(6): + old = chain[-1]; a = (1 - s) * s + s * old + gap = min(s - a, 1 - a - s, 1 - a - s * (1 - old), 1 - s); assert old < a < s < 1 - a and gap > 0 + cutoff = max(ceil(36 / gap ** 2), ceil(2 * (4 + charged_two) / gap)); assert cutoff * gap ** 2 >= 36 and cutoff * gap >= 2 * (4 + charged_two) + cutoffs.append(dict(gap=str(gap), cutoff_log2=str(cutoff))); chain.append(a) +q = chain[-1] * (1 - 2 * eta); margin = (1 - eta) * q / (1 + q); ticks = margin / grid; k = grid * ((ticks.numerator - 1) // ticks.denominator) +bridge = {'semantic': {'C0': {'base': 2, 'exponent': 210000}, 'strict_literal_gap': 1}, 'rows': {'degree_gap': Q(10 ** 6) - Q(51 * 20161, 25)}} +a = Outer.assembly(chain[-1], b, bridge, k, eta=eta, beta=beta) +assert len(a['strict_constraints']) == 47 and all(x > 0 for x in a['strict_constraints'].values()) +controls = [] +for name, kk, ee, bb in [('next_grid', k + grid, eta, beta), ('zero_eta', k, Q(0), beta), ('zero_beta', k, eta, Q(0)), ('unit_beta', k, eta, Q(1))]: + try: Outer.assembly(chain[-1], b, bridge, kk, eta=ee, beta=bb) + except AssertionError: controls.append(name) + else: raise AssertionError(name) +parent_k = Q(566550276142217, 500000000000000000) +res = dict(status='PASS_CONDITIONAL_IDLE_AXIS_HOSTING_ASSEMBLY', kappa=str(k), kappa_decimal=format(float(k), '.18f'), + bit_lower=str(c), complex_lower=str(b), binding_component='bit' if c < (1 - beta) * b else 'complex', + gain_over_pr434_percent=float(100 * (k / parent_k - 1)), + bit=dict(live=W, physical=physical, maxchild=max(P), rank_mass=mass, hosted_residuals=audit['bit_hosted_residuals'], + prefix_bits=prefix.bit_length(), charged_prefix_bits=charged_prefix, coefficient_bits=coefficient.bit_length(), + two_level_coefficient_bits=two.bit_length(), charged_two_level_coefficient_bits=charged_two, row_coefficient=row), + complex=dict(live=WC, physical=physc, maxchild=max(PC), rank_mass=massc, hosted_residuals=audit['complex_hosted_residuals'], + physical_stock_bits=stock.bit_length(), router_bits=router.bit_length(), literal_bits=literal.bit_length(), row_coefficient=rowc), + strict_outer_constraints={n: str(x) for n, x in a['strict_constraints'].items()}, outer_controls=controls, bootstrap=cutoffs, + bit_template_sha256=bg['template_sha256'], complex_template_sha256=ch['template_sha256']) +outp.write_text(json.dumps(res, indent=2) + '\n') +print(res['status'], res['kappa_decimal'], 'binding', res['binding_component'], 'gain over #434 %.4f%%' % res['gain_over_pr434_percent']) diff --git a/research/idle-axis-hosting/audit.py b/research/idle-axis-hosting/audit.py new file mode 100644 index 0000000000..bd40b9b791 --- /dev/null +++ b/research/idle-axis-hosting/audit.py @@ -0,0 +1,159 @@ +"""Independent audit of the two idle-axis-hosted templates (no code shared with the generators). +Re-derives hosting windows from each template's own schedule and checks, for every replica and invocation: + * every helper residual has exactly one owner: a bank slot or a hosted slot; + * a hosted slot lies on the data family of the idle child it names, inside that child's pending coordinates, + disjoint from every other hosted slot of the family, and its invocation lies strictly between the last + local invocation or bridge naming that pair and the child (the window); + * the child keeps exactly the remaining coordinates; banks are tiled exactly (bit) or padded (complex); + * the emitted paid profile, live stock and rank deficit 2496 are recomputed from scratch. +Mutation controls must be rejected. usage: audit.py PARENT_CHANGED_DIR BIT_DIR COMPLEX_DIR OUT.json""" +import copy, gzip, hashlib, json, sys +from collections import Counter, defaultdict +from pathlib import Path +V, K, T, L = 120, 4, 8, 9 +DATA = 2 * K * V * T + +def wins(events): + """events: ('local', stage, pair) | ('bridge', a, b) | ('idle', idx, pair); window = local stages after the last + local/bridge touch of the pair and before the child""" + last = {}; seen = []; w = {} + for pos, e in enumerate(events): + if e[0] == 'local': seen.append((pos, e[1], e[2])); last[e[2]] = pos + elif e[0] == 'bridge': last[e[1]] = pos; last[e[2]] = pos + else: + lo = last.get(e[2], -1); w[e[1]] = {s for q, s, p in seen if lo < q < pos and p != e[2]} + return w + +def audit_bit(t, parent_t, widths): + assert t['local_programs'] == parent_t['local_programs'] and len(t['calls']) == 72 + ev = []; rank = {}; pair = {} + for e in t['schedule']: + if e['kind'] == 'local_cover_sweep': ev.append(('local', e['stage'], e['pair'])) + elif e['kind'] == 'bridge': ev.append(('bridge', e['dst'], e['src'])) + elif e['kind'] == 'idle': + ev.append(('idle', e['idx'], e['pair'])); rank[e['idx']] = e['rank']; pair[e['idx']] = e['pair'] + W = wins(ev); hs = t['hosting'] + used = defaultdict(set); hosted = {} + for i, cp, off, w, s, h in hs['slots']: + assert s in W[i], ('window', i, s) + assert w == widths[h] and 0 <= off and off + w <= rank[i] + cells = set(range(off, off + w)); assert not cells & used[i, cp], ('overlap', i, cp); used[i, cp] |= cells + assert (s, h) not in hosted; hosted[s, h] = (i, cp, off, w) + rem = {} + for i in rank: + if rank[i] == 0: continue + for cp in range(2 * V): rem[i, cp] = rank[i] - len(used[i, cp]) + rr = Counter(rem[i, cp] for cp in range(2 * V)) + if str(i) in hs['remainders']: assert {int(k): v for k, v in hs['remainders'][str(i)].items()} == dict(rr) + else: assert rr == Counter({rank[i]: 2 * V}) + occ = defaultdict(set); LIVE = t['live']; bank_lo = {} + for c in t['calls']: + s, rep, p = c['stage'], c['replica'], c['pair']; own = c['owners']; assert len(own) == 2 * V + len(widths) + assert own[:2 * V] == next(q for q in parent_t['calls'] if (q['stage'], q['replica']) == (s, rep))['owners'][:2 * V] + for h, (f, r) in enumerate(own[2 * V:]): + if (s, h) in hosted: + i, cp, off, w = hosted[s, h]; side, port = divmod(cp, V) + assert r == ['hosted', i, off, w] and f == rep * 960 + (2 * pair[i] + side) * V + port + assert pair[i] != p + occ['h', f, i, s, rep, h] = True + else: + assert r[0] == 'bank' and r[2] == widths[h] and DATA <= f < LIVE + cells = set(range(r[1], r[1] + r[2])); assert cells <= set(range(64)) and not cells & occ[f]; occ[f] |= cells + bank_lo[f] = s + banks = [f for f in occ if isinstance(f, int)] + assert sorted(banks) == list(range(DATA, LIVE)) and all(occ[f] == set(range(64)) for f in banks) + paid = Counter() + for c in t['calls']: + for z in t['local_programs'][c['orientation']]: + if z[0] == 0 and z[4]: paid[z[4]] += 1 + if z[0] == 2: paid[z[5]] += 1 + for (i, cp), r_ in rem.items(): + if r_: paid[r_] += T + mass = sum(r * n for r, n in paid.items()); assert 64 * LIVE - mass == 2496 + assert 64 * 64 > 2 * max(paid) ** 2 + return paid, sum(1 for _ in hosted) * T + +def audit_complex(t, parent_t, local_checks): + R = 560; m = 73 + assert t['local_programs'] == parent_t['local_programs'] and len(t['calls']) == 72 + prank = {} + for it in parent_t['idle_children']: prank.setdefault(it['child'], it['rank']) + stage_pair = {e['stage']: e['pair'] for e in t['recipe'] if e['kind'] == 'local'} + ev = []; side = {}; pairs = {} + for e in t['execution_schedule']: + if e['kind'] == 'local_cover_sweep': ev.append(('local', e['stage'], stage_pair[e['stage']])) + elif e['kind'] == 'bridge': ev.append(('bridge', e['dst'], e['src'])) + elif e['kind'] == 'idle_cover_sweep': + for sd, ch in enumerate(e['child_indices']): + if ch in prank: ev.append(('idle', ch, e['pair'])); side[ch] = sd; pairs[ch] = e['pair'] + W = wins(ev); hs = t['hosting'] + used = defaultdict(set); hosted = {} + for i, port, off, w, s, h in hs['slots']: + assert w == 9 and s in W[i] and 0 <= off and off + 9 <= prank[i] + cells = set(range(off, off + 9)); assert not cells & used[i, port]; used[i, port] |= cells + assert (s, h) not in hosted; hosted[s, h] = (i, port, off) + rem = {} + for it in parent_t['idle_children']: rem[it['child'], it['port']] = it['rank'] - len(used[it['child'], it['port']]) + got = {(it['child'], it['port']): it['rank'] for it in t['idle_children']} + assert got == {k: r for k, r in rem.items() if r} and all(it['replicas'] == T for it in t['idle_children']) + LIVE = t['live']; occ = defaultdict(set) + for c in t['calls']: + s, rep, p = c['stage'], c['replica'], c['pair']; own = c['owners']; assert len(own) == 2 * V + R + assert own[:2 * V] == next(q for q in parent_t['calls'] if (q['stage'], q['replica']) == (s, rep))['owners'][:2 * V] + for h, (f, r) in enumerate(own[2 * V:]): + if (s, h) in hosted: + i, port, off = hosted[s, h] + assert r == [3, i, off] and f == rep * 960 + (2 * pairs[i] + side[i]) * V + port and pairs[i] != p + else: + assert r[0] == 2 and 0 <= r[1] < 8 and DATA <= f < LIVE and r[1] not in occ[f]; occ[f].add(r[1]) + banks = sorted(occ); assert banks == list(range(DATA, LIVE)) + paid = Counter() + for c in t['calls']: + for r_, z in local_checks[c['orientation']]['paid_profile'].items(): paid[int(r_)] += z + for (ch, port), r_ in rem.items(): + if r_: paid[r_] += T + for f in banks: paid[m - 9 * len(occ[f])] += 1 + mass = sum(r * n for r, n in paid.items()); assert m * LIVE - mass == 2496 + assert m * m > 2 * max(paid) ** 2 + return paid, len(hosted) * T + +def main(): + par, bd, cd, outp = map(Path, sys.argv[1:5]) + pbt = json.loads(gzip.decompress((par / 'bit426-source-centres/global/GLOBAL-TEMPLATE.json.gz').read_bytes())) + bt = json.loads(gzip.decompress((bd / 'GLOBAL-TEMPLATE.json.gz').read_bytes())) + bg = json.loads((bd / 'GLOBAL.json').read_text()) + assert hashlib.sha256(gzip.decompress((bd / 'GLOBAL-TEMPLATE.json.gz').read_bytes())).hexdigest() == bg['template_sha256'] + st = json.loads((par / 'bit426-source-centres/records/249-states.json').read_text()) + fs = json.loads((par / 'bit426-source-centres/records/frames.json').read_text())['frames'] + widths = [8 - fs[str(st['initial'][str(i)])]['dim'] for i in range(240, 987)] + pct = json.loads(gzip.decompress((par / 'split-centres/GLOBAL-TEMPLATE.json.gz').read_bytes())) + ct = json.loads(gzip.decompress((cd / 'GLOBAL-TEMPLATE.json.gz').read_bytes())) + ch = json.loads((cd / 'HOSTED.json').read_text()) + assert hashlib.sha256(gzip.decompress((cd / 'GLOBAL-TEMPLATE.json.gz').read_bytes())).hexdigest() == ch['template_sha256'] + lc = json.loads((par / 'split-centres/LOCAL-CHECKS.json').read_text()) + bp, bh = audit_bit(bt, pbt, widths); assert bp == Counter({int(k): v for k, v in bg['profile'].items()}) + cp, chh = audit_complex(ct, pct, lc); assert cp == Counter({int(k): v for k, v in ch['global_profile'].items()}) + controls = [] + def reject(name, fn, which): + q = copy.deepcopy(bt if which == 'bit' else ct); fn(q) + try: + (audit_bit(q, pbt, widths) if which == 'bit' else audit_complex(q, pct, lc)) + except (AssertionError, KeyError, IndexError, StopIteration): controls.append(name) + else: raise AssertionError('mutation accepted: ' + name) + def outside(q): # move one hosted residual to a stage outside its window + sl = q['hosting']['slots'][0]; i = sl[0]; s_bad = next(s for s in range(9) if s not in q['hosting']['windows'][str(i)][2]); sl[4] = s_bad + reject('bit: hosted residual outside its window', outside, 'bit') + reject('bit: overlapping hosted coordinates', lambda q: q['hosting']['slots'][1].__setitem__(2, q['hosting']['slots'][0][2]) if q['hosting']['slots'][1][:2] == q['hosting']['slots'][0][:2] else q['hosting']['slots'][1].__setitem__(1, q['hosting']['slots'][0][1]) or q['hosting']['slots'][1].__setitem__(2, q['hosting']['slots'][0][2]), 'bit') + reject('bit: understated live stock', lambda q: q.__setitem__('live', q['live'] - 1), 'bit') + reject('bit: hosted owner on the active pair', lambda q: q['calls'][0]['owners'].__setitem__(240 + next(h for h in range(747) if q['calls'][0]['owners'][240 + h][1][0] == 'hosted'), [0, ['hosted', 0, 0, 8]]), 'bit') + reject('bit: missing remainder child', lambda q: q['hosting']['slots'].pop(), 'bit') + reject('complex: hosted residual outside its window', lambda q: q['hosting']['slots'][0].__setitem__(4, next(s for s in range(9) if s not in q['hosting']['windows'][str(q['hosting']['slots'][0][0])][2])), 'complex') + reject('complex: remainder child understated', lambda q: q['idle_children'][0].__setitem__('rank', q['idle_children'][0]['rank'] - 1), 'complex') + reject('complex: dropped bank', lambda q: q.__setitem__('live', q['live'] - 1), 'complex') + reject('complex: duplicated hosted residual', lambda q: q['hosting']['slots'].append(list(q['hosting']['slots'][0])), 'complex') + res = dict(status='PASS_INDEPENDENT_IDLE_AXIS_HOSTING_AUDIT', bit_template_sha256=bg['template_sha256'], complex_template_sha256=ch['template_sha256'], + bit_profile={str(k): v for k, v in sorted(bp.items())}, complex_profile={str(k): v for k, v in sorted(cp.items())}, + bit_live=bt['live'], complex_live=ct['live'], bit_hosted_residuals=bh, complex_hosted_residuals=chh, + bit_maxchild=max(bp), complex_maxchild=max(cp), mutations_rejected=controls) + outp.write_text(json.dumps(res, indent=2) + '\n'); print(json.dumps({k: v for k, v in res.items() if 'profile' not in k})) +if __name__ == '__main__': main() diff --git a/research/idle-axis-hosting/bit_hosted.py b/research/idle-axis-hosting/bit_hosted.py new file mode 100644 index 0000000000..e2f015dbb7 --- /dev/null +++ b/research/idle-axis-hosting/bit_hosted.py @@ -0,0 +1,118 @@ +"""Idle-axis hosting for #434's compressed nine-stage bit template (m=64). +Reads the emitted parent template, keeps every local program and scalar replay unchanged, and moves whole helper +residuals from banks onto pending idle-advance coordinates of untouched data families. Emits a new template, +GLOBAL.json with the new live stock and paid profile. usage: bit_hosted.py PARENT_GLOBAL_DIR LOCAL_CHECK_DIR OUT""" +import gzip, hashlib, importlib.util, json, sys, time +from collections import Counter +from pathlib import Path +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +import hosting_core as HC +spec = importlib.util.spec_from_file_location('bitparent', HERE.parent / 'e8-early-reset-kernel/bit_global.py') +BP = importlib.util.module_from_spec(spec); spec.loader.exec_module(BP) +H, V, R, L, K, T, M = 8, 120, 747, 9, 4, 8, 64 +DATA = 2 * K * V * T +DISCOVER = False +sha = lambda p: hashlib.sha256(Path(p).read_bytes()).hexdigest() +def main(parent, local, out): + t0 = time.monotonic(); out.mkdir(parents=True, exist_ok=False) + blob = gzip.decompress((parent / 'GLOBAL-TEMPLATE.json.gz').read_bytes()); t = json.loads(blob) + g = json.loads((parent / 'GLOBAL.json').read_text()) + assert hashlib.sha256(blob).hexdigest() == g['template_sha256'] + st = json.loads((local / 'records/249-states.json').read_text()) + fs = json.loads((local / 'records/frames.json').read_text())['frames']; dims = {int(f): z['dim'] for f, z in fs.items()} + width = [H - dims[st['initial'][str(i)]] for i in range(2 * V, 2 * V + R)] + # schedule with indexed idle children + sched = []; idx = 0 + for e in t['schedule']: + if e['kind'] == 'local_cover_sweep': sched.append(dict(kind='local', stage=e['stage'], pair=e['pair'])) + elif e['kind'] == 'bridge': sched.append(dict(kind='bridge', dst=e['dst'], src=e['src'])) + elif e['kind'] == 'idle': + sched.append(dict(kind='idle', pair=e['pair'], rank=e['rank'], idx=idx)); e['idx'] = idx; idx += 1 + win = {k: x for k, x in HC.windows(sched).items() if x[1] > 0 and x[2]} + avail = Counter() + for s in range(L): + for w in width: avail[s, w] += 1 + sel = HERE / 'SELECTION.json'; key = 'bit' + if DISCOVER: + ys, zs, val = HC.solve(win, 2 * V, dict(avail), M, group={7: 8, 4: 2}); HC.save_selection(sel, key, ys, zs, val) + ys, zs, val = HC.load_selection(sel, key) + helpers = {s: [(h, width[h]) for h in range(R)] for s in range(L)} + slots, rem = HC.expand(win, ys, zs, helpers, 2 * V) + hosted = {(s, h): (i, c, off, w) for i, c, off, w, s, h in slots} + # remaining helpers -> exact width-64 banks (per stage, same set of helpers in every replica) + left = {s: [h for h in range(R) if (s, h) not in hosted] for s in range(L)} + nb = {}; place = {} + for s in range(L): + wl = {h: width[h] for h in left[s]} + slotsS = sorted(((wl[h], rep, h) for rep in range(T) for h in left[s]), key=lambda x: (-x[0], x[1], x[2])) + by = {} + for w_, rep, h in slotsS: by.setdefault(w_, []).append((rep, h)) + bins = [] + def take(w_): return by[w_].pop(0) + for w_ in sorted(by, reverse=True): + if w_ == 8: continue + while by.get(w_): + cont = []; off = 0 + if w_ == 7: + for _ in range(8): rep, h = take(7); cont.append((rep, h, off, 7)); off += 7 + rep, h = take(8); cont.append((rep, h, off, 8)); off += 8 + else: + for _ in range(64 // w_): rep, h = take(w_); cont.append((rep, h, off, w_)); off += w_ + assert off == 64; bins.append(cont) + while by.get(8): + cont = []; off = 0 + for _ in range(8): rep, h = take(8); cont.append((rep, h, off, 8)); off += 8 + bins.append(cont) + nb[s] = len(bins) + for b, cont in enumerate(bins): + for rep, h, off, w_ in cont: place[s, rep, h] = (b, off, w_) + base = [DATA] + for s in range(L): base.append(base[-1] + nb[s]) + LIVE = base[-1] + # owners + for c in t['calls']: + s, rep, p = c['stage'], c['replica'], c['pair']; own = c['owners'][:2 * V] + for h in range(R): + if (s, h) in hosted: + i, cp, off, w = hosted[s, h]; pair = win[i][0]; side, port = divmod(cp, V) + own.append([rep * 960 + (2 * pair + side) * V + port, ['hosted', i, off, w]]) + else: + b, off, w = place[s, rep, h]; own.append([base[s] + b, ['bank', off, w]]) + assert len({(f, tuple(r)) for f, r in own}) == 2 * V + R and all(0 <= f < LIVE for f, r in own) + c['owners'] = own + # profile: local programs unchanged; idle children replaced by remainders + paid = Counter() + for c in t['calls']: + for z in t['local_programs'][c['orientation']]: + if z[0] == 0 and z[4]: paid[z[4]] += 1 + if z[0] == 2: paid[z[5]] += 1 + remainder = {} + for e in t['schedule']: + if e['kind'] == 'idle' and e['rank']: + i = e['idx'] + if i in win: + rr = Counter(rem[i, cp] for cp in range(2 * V)); remainder[i] = {str(k): v for k, v in sorted(rr.items())} + for r_, n in rr.items(): + if r_: paid[r_] += n * T + else: + paid[e['rank']] += 2 * V * T + mass = sum(r * n for r, n in paid.items()); assert M * LIVE - mass == 2496, M * LIVE - mass + t.update(version='compressed-nine-e8-bit-v1+idle-axis-hosting', live=LIVE, + hosting=dict(windows={str(i): [w[0], w[1], sorted(w[2])] for i, w in win.items()}, + slots=[list(x) for x in slots], remainders=remainder, banks_per_stage=nb, + rule='helper (stage s, helper h) of replica r owns coordinates [off, off+w) of the pending idle-child ' + 'projector of data family r*960+(2*pair+side)*120+port (copy = side*120+port); s lies strictly between ' + 'the last local/bridge touch of that pair and the child; the child keeps the remaining coordinates.'), + helper_route='bank owner (exact width-64 tiling of the unhosted residuals of each stage) or hosted owner (data family, pending idle coordinates)') + tb = json.dumps(t, separators=(',', ':'), sort_keys=True).encode(); (out / 'GLOBAL-TEMPLATE.json.gz').write_bytes(gzip.compress(tb, mtime=0)) + res = dict(g); res.update(status='PASS_IDLE_AXIS_HOSTED_BIT_TEMPLATE', live=LIVE, physical=LIVE + 9, template_sha256=hashlib.sha256(tb).hexdigest(), + parent_template_sha256=g['template_sha256'], profile=dict(sorted(paid.items())), paid_calls=sum(paid.values()), rank_mass=mass, + maxchild=max(paid), banks_per_stage_hosted=nb, hosted_residuals_per_replica=len(slots), hosted_residuals=len(slots) * T, + hosted_coordinates_per_replica=sum(x[3] for x in slots), saved_idle_cost_proxy=val, seconds=time.monotonic() - t0) + res['bank_assignments'] = sum(1 for c in t['calls'] for f, r in c['owners'][2 * V:] if r[0] == 'bank') + (out / 'GLOBAL.json').write_text(json.dumps(res, indent=2) + '\n') + print(json.dumps({k: res[k] for k in ('live', 'maxchild', 'hosted_residuals', 'banks_per_stage_hosted', 'rank_mass')}), flush=True) +if __name__ == '__main__': + DISCOVER = '--discover' in sys.argv; args = [a for a in sys.argv[1:] if a != '--discover'] + main(Path(args[0]), Path(args[1]), Path(args[2])) diff --git a/research/idle-axis-hosting/complex_hosted.py b/research/idle-axis-hosting/complex_hosted.py new file mode 100644 index 0000000000..56e15c15ae --- /dev/null +++ b/research/idle-axis-hosting/complex_hosted.py @@ -0,0 +1,87 @@ +"""Idle-axis hosting for #433's compressed nine-stage complex template (m=73, R=560, whole rank-nine residuals). +Local programs, data routes and the cover correction are unchanged; bank slots of hosted residuals move onto pending +idle-child coordinates of untouched data families; unhosted residuals are re-tiled eight per bank with one paid pad +(a final partial bank pays the larger pad). usage: complex_hosted.py SPLIT_CENTRES_DIR OUT""" +import gzip, hashlib, json, math, sys, time +from collections import Counter +from pathlib import Path +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +import hosting_core as HC +V, K, T, L, M, R = 120, 4, 8, 9, 73, 560 +DATA = 2 * K * V * T +DISCOVER = False +def main(src, out): + t0 = time.monotonic(); out.mkdir(parents=True, exist_ok=False) + blob = gzip.decompress((src / 'GLOBAL-TEMPLATE.json.gz').read_bytes()); t = json.loads(blob) + integ = json.loads((src / 'INTEGRATION.json').read_text()); checks = json.loads((src / 'LOCAL-CHECKS.json').read_text()) + assert hashlib.sha256(blob).hexdigest() == integ['global_template_sha256'] and t['live'] == integ['live'] + rank = {} + for it in t['idle_children']: + assert it['replicas'] == T; rank.setdefault(it['child'], it['rank']); assert rank[it['child']] == it['rank'] + pair_of_stage = {e['stage']: e['pair'] for e in t['recipe'] if e['kind'] == 'local'} + sched = []; side_of = {}; pair_of = {} + for e in t['execution_schedule']: + if e['kind'] == 'local_cover_sweep': sched.append(dict(kind='local', stage=e['stage'], pair=pair_of_stage[e['stage']])) + elif e['kind'] == 'bridge': sched.append(dict(kind='bridge', dst=e['dst'], src=e['src'])) + elif e['kind'] == 'idle_cover_sweep': + for sd, ch in enumerate(e['child_indices']): + if ch in rank: + sched.append(dict(kind='idle', pair=e['pair'], rank=rank[ch], idx=ch)); side_of[ch] = sd; pair_of[ch] = e['pair'] + win = {k: x for k, x in HC.windows(sched).items() if x[1] >= 9 and x[2]} + avail = {(s, 9): R for s in range(L)} + sel = HERE / 'SELECTION.json'; key = 'complex' + if DISCOVER: + ys, zs, val = HC.solve(win, V, avail, M, pad_value=HC.cost(1, M) / 8); HC.save_selection(sel, key, ys, zs, val) + ys, zs, val = HC.load_selection(sel, key) + slots, rem = HC.expand(win, ys, zs, {s: [(h, 9) for h in range(R)] for s in range(L)}, V) + hosted = {(s, h): (i, port, off) for i, port, off, w, s, h in slots} + # re-tile unhosted residuals: per stage, z = rank among (replica, helper) unhosted pairs; eight per bank + base = [DATA]; tile = {}; partial = Counter() + for s in range(L): + left = [(rep, h) for rep in range(T) for h in range(R) if (s, h) not in hosted] + for z, (rep, h) in enumerate(left): tile[s, rep, h] = divmod(z, 8) + nb = -(-len(left) // 8); base.append(base[-1] + nb) + if len(left) % 8: partial[M - 9 * (len(left) % 8)] += 1 + full = len(left) // 8 + partial[M - 72] += full + W = base[-1] + for c in t['calls']: + s, rep, p = c['stage'], c['replica'], c['pair']; own = c['owners'][:2 * V] + for h in range(R): + if (s, h) in hosted: + i, port, off = hosted[s, h]; own.append([rep * 960 + (2 * pair_of[i] + side_of[i]) * V + port, [3, i, off]]) + else: + b, sl = tile[s, rep, h]; own.append([base[s] + b, [2, sl]]) + assert len({(f, tuple(r)) for f, r in own}) == 2 * V + R and all(f < W for f, r in own) + c['owners'] = own + paid = Counter() + for c in t['calls']: + for r_, z in checks[c['orientation']]['paid_profile'].items(): paid[int(r_)] += z + newidle = [] + for it in t['idle_children']: + ch, port = it['child'], it['port']; rr = rem.get((ch, port), it['rank']) if ch in win else it['rank'] + if rr: newidle.append(dict(child=ch, port=port, rank=rr, hosted=it['rank'] - rr, replicas=T)); paid[rr] += T + for r_, n in partial.items(): paid[r_] += L * n if False else n * 1 + # padding: one pad child per bank per stage (already per-stage counted above), the template replays all stages + mass = sum(r * n for r, n in paid.items()); D = M * W - mass + assert D == 2496, D + t.update(version='hamming-mutable-basis-nine-v1+idle-axis-hosting', live=W, idle_children=newidle, + physical=W + R + (integ['physical'] - integ['live'] - R), + hosting=dict(windows={str(i): [w[0], w[1], sorted(w[2])] for i, w in win.items()}, sides=side_of, pairs=pair_of, + slots=[list(x) for x in slots], banks=[base[s + 1] - base[s] for s in range(L)])) + t['bank_padding']['families'] = list(range(DATA, W)); t['cover_final_correction']['families'] = [0, W] + t['cover_final_correction']['charged_calls_per_cover'] = W + for e in t['execution_schedule']: + if e['kind'] == 'bank_padding_cover_sweep': e['families'] = [DATA, W] + elif e['kind'] == 'translate_every_live_family': e.update(t['cover_final_correction']) + tb = json.dumps(t, sort_keys=True, separators=(',', ':')).encode(); (out / 'GLOBAL-TEMPLATE.json.gz').write_bytes(gzip.compress(tb, mtime=0)) + res = dict(status='PASS_IDLE_AXIS_HOSTED_COMPLEX_TEMPLATE', parent_template_sha256=integ['global_template_sha256'], + template_sha256=hashlib.sha256(tb).hexdigest(), live=W, physical=t['physical'], global_profile=dict(sorted(paid.items())), + rank_mass=mass, deficit=D, maxchild=max(paid), hosted_residuals=len(slots) * T, banks_per_stage=t['hosting']['banks'], + saved_cost_proxy=val, seconds=time.monotonic() - t0) + (out / 'HOSTED.json').write_text(json.dumps(res, indent=2) + '\n') + print(json.dumps({k: res[k] for k in ('live', 'maxchild', 'hosted_residuals', 'banks_per_stage', 'deficit')})) +if __name__ == '__main__': + DISCOVER = '--discover' in sys.argv; args = [a for a in sys.argv[1:] if a != '--discover'] + main(Path(args[0]), Path(args[1])) diff --git a/research/idle-axis-hosting/hosting_core.py b/research/idle-axis-hosting/hosting_core.py new file mode 100644 index 0000000000..68b536daa9 --- /dev/null +++ b/research/idle-axis-hosting/hosting_core.py @@ -0,0 +1,138 @@ +"""Idle-axis hosting: place whole dirty-helper residuals on the pending coordinates of an idle data family. + +A data family that is advanced by an idle child from level a to level b receives the commuting coordinate factors of +that child. If the family is untouched (no local invocation on its pair and no bridge naming its pair) during an +interval of local invocations ending at the child, a helper residual of width w from an invocation inside that +interval may own w of those pending coordinates instead of a bank slot. The child keeps only the remaining +coordinates. This module computes the windows from the recipe and chooses, per replica, how many residuals of each +width each child hosts (exact integer programme), then expands that choice into explicit slot assignments. +Standard library plus scipy for the integer programme; the emitted assignment is re-checked without scipy.""" +import math +from collections import Counter, defaultdict + +def windows(schedule): + """schedule: ordered events dict(kind='local',stage,pair) | dict(kind='bridge',dst,src) | dict(kind='idle',pair,rank,idx). + Returns {idx: (pair, rank, frozenset(stages))} - stages whose invocation lies strictly between the last touch of + the pair and the idle child.""" + last = {}; out = {}; locals_ = [] + for pos, e in enumerate(schedule): + k = e['kind'] + if k == 'local': + locals_.append((pos, e['stage'], e['pair'])); last[e['pair']] = pos + elif k == 'bridge': + last[e['dst']] = pos; last[e['src']] = pos + elif k == 'idle': + p = e['pair']; lo = last.get(p, -1) + st = frozenset(s for q, s, pp in locals_ if lo < q < pos and pp != p) + out[e['idx']] = (p, e['rank'], st) # an idle child acts on other coordinates (or the other member): not a touch + return out + +def patterns(rank, widths, maxk=12): + """multisets of widths with sum <= rank (as sorted tuples)""" + ws = sorted(set(widths), reverse=True); res = [] + def rec(i, cur, s): + if i == len(ws): res.append(tuple(cur)); return + w = ws[i]; k = 0 + while s + k * w <= rank and len(cur) + k <= maxk: + rec(i + 1, cur + [w] * k, s + k * w); k += 1 + rec(0, [], 0) + return res + +def cost(r, m): + return r * math.log(m / r) if r else 0.0 + +def solve(win, copies, avail, m, pad_value=0.0, group=None): + """win: {idx: (pair, rank, stages)}; copies: piece copies per replica of each idx (2V); + avail: {(stage, width): count per replica}; maximise saved idle cost (+ pad_value per hosted residual). + group: optional {width: g} - remaining count of that width per stage must be a multiple of g (exact bank tiling). + Returns {(idx, pattern): copies} and {(idx, width, stage): count}.""" + import numpy as np + from scipy.optimize import milp, LinearConstraint, Bounds + widths = sorted({w for (_, w) in avail}) + var = []; index = {} + for idx, (p, r, st) in win.items(): + for pat in patterns(r, widths): + index[('y', idx, pat)] = len(var); var.append(('y', idx, pat)) + for w in widths: + for s in st: + if avail.get((s, w), 0): + index[('z', idx, w, s)] = len(var); var.append(('z', idx, w, s)) + stages = sorted({s for (s, _) in avail}) + if group: + for w, g in group.items(): + for s in stages: + index[('g', w, s)] = len(var); var.append(('g', w, s)) + n = len(var); c = np.zeros(n); integ = np.ones(n); lb = np.zeros(n); ub = np.full(n, np.inf) + for key, j in index.items(): + if key[0] == 'y': + _, idx, pat = key; r = win[idx][1]; c[j] = -(cost(r, m) - cost(r - sum(pat), m) + pad_value * len(pat)) + rows, lo, hi = [], [], [] + for idx in win: + row = np.zeros(n) + for key, j in index.items(): + if key[0] == 'y' and key[1] == idx: row[j] = 1 + rows.append(row); lo.append(copies); hi.append(copies) + for w in widths: + row = np.zeros(n) + for key, j in index.items(): + if key[0] == 'y' and key[1] == idx: row[j] = key[2].count(w) + if key[0] == 'z' and key[1] == idx and key[2] == w: row[j] = -1 + rows.append(row); lo.append(0); hi.append(0) + for (s, w), a in avail.items(): + row = np.zeros(n) + for key, j in index.items(): + if key[0] == 'z' and key[2] == w and key[3] == s: row[j] = 1 + if group and w in group: + row[index[('g', w, s)]] = group[w]; rows.append(row); lo.append(a); hi.append(a) # used + g*k = avail + else: + rows.append(row); lo.append(0); hi.append(a) + res = milp(c, constraints=LinearConstraint(np.array(rows), lo, hi), integrality=integ, bounds=Bounds(lb, ub), + options=dict(time_limit=600, disp=False)) + assert res.x is not None, res.message + x = [int(round(t)) for t in res.x] + ys = {(k[1], k[2]): x[j] for k, j in index.items() if k[0] == 'y' and x[j]} + zs = {(k[1], k[2], k[3]): x[j] for k, j in index.items() if k[0] == 'z' and x[j]} + return ys, zs, -res.fun + +def expand(win, ys, zs, helpers, V2): + """helpers: {stage: [(helper, width), ...]} for ONE replica; returns list of + (idx, copy, offset, width, stage, helper) and the remainder rank of every (idx, copy). + Copies of a piece are the 2V (side, port) data families; residuals packed from offset 0 in decreasing width.""" + pool = defaultdict(list) # (stage, width) -> helpers + for s, hs in helpers.items(): + for h, w in hs: pool[s, w].append(h) + for k in pool: pool[k].sort() + need = defaultdict(list) # (idx, width) -> stages multiset in deterministic order + for (idx, w, s), cnt in sorted(zs.items()): need[idx, w] += [s] * cnt + out = []; rem = {} + for idx in sorted(win): + pats = sorted([(pat, cnt) for (i, pat), cnt in ys.items() if i == idx], key=lambda t: (-sum(t[0]), t[0])) + copy = 0; ptr = Counter() + r = win[idx][1] + for pat, cnt in pats: + for _ in range(cnt): + off = 0 + for w in sorted(pat, reverse=True): + s = need[idx, w][ptr[idx, w]]; ptr[idx, w] += 1 + h = pool[s, w].pop(0) + out.append((idx, copy, off, w, s, h)); off += w + rem[idx, copy] = r - off; copy += 1 + while copy < V2: rem[idx, copy] = r; copy += 1 + return out, rem + +def save_selection(path, key, ys, zs, val): + """freeze the integer-programme choice (patterns per child, residual stages per child) for stdlib-only replay""" + import json + from pathlib import Path + p = Path(path); d = json.loads(p.read_text()) if p.exists() else {} + d[key] = dict(patterns=sorted([[i, list(pat), n] for (i, pat), n in ys.items()]), + stages=sorted([[i, w, s, n] for (i, w, s), n in zs.items()]), proxy_saving=val) + p.write_text(json.dumps(d, indent=1, sort_keys=True) + '\n') + +def load_selection(path, key): + import json + from pathlib import Path + d = json.loads(Path(path).read_text())[key] + ys = {(i, tuple(pat)): n for i, pat, n in d['patterns']} + zs = {(i, w, s): n for i, w, s, n in d['stages']} + return ys, zs, d['proxy_saving'] diff --git a/research/idle-axis-hosting/verify.py b/research/idle-axis-hosting/verify.py new file mode 100644 index 0000000000..0aa6cefd02 --- /dev/null +++ b/research/idle-axis-hosting/verify.py @@ -0,0 +1,38 @@ +"""Fresh replay: #434 in full, then idle-axis hosting of both suppliers, independent audit and exact assembly. +usage: python -B research/idle-axis-hosting/verify.py /absolute/new/output (Python 3.11+, standard library only)""" +from pathlib import Path +import gzip, hashlib, json, os, subprocess, sys, time +assert __debug__ +ROOT = Path(__file__).resolve().parent; PARENT = ROOT.parent / 'e8-early-reset-kernel' +out = Path(sys.argv[1]).resolve(); assert not out.exists() and not out.is_relative_to(ROOT.parent) +read = lambda p: json.loads(Path(p).read_text()); sha = lambda p: hashlib.sha256(Path(p).read_bytes()).hexdigest() +def integrity(): + files = {p.relative_to(ROOT).as_posix(): sha(p) for p in ROOT.rglob('*') if p.is_file() and p.name != 'MANIFEST.json' and '__pycache__' not in p.parts} + assert files == read(ROOT / 'MANIFEST.json')['files'], 'manifest mismatch' + assert sha(PARENT / 'MANIFEST.json') == read(ROOT / 'MANIFEST.json')['parent_manifest_sha256'], 'parent package changed' +integrity(); out.mkdir(parents=True) +env = dict(os.environ, PYTHONDONTWRITEBYTECODE='1', PYTHONINTMAXSTRDIGITS='0'); env.pop('PYTHONOPTIMIZE', None); steps = [] +def run(name, file, *args, cwd=None): + t = time.monotonic(); log = out / (name + '.log'); print('RUN', name, flush=True) + with log.open('w') as f: q = subprocess.run([sys.executable, '-B', str(file), *map(str, args)], cwd=cwd, env=env, stdout=f, stderr=subprocess.STDOUT) + if q.returncode: raise RuntimeError((name, q.returncode, log.read_text()[-3000:])) + steps.append(dict(name=name, seconds=round(time.monotonic() - t, 1), log_sha256=sha(log))); print('PASS', name, flush=True) +try: + run('parent-434-full', PARENT / 'verify.py', out / 'parent') + changed = out / 'parent/changed' + run('bit-hosting', ROOT / 'bit_hosted.py', 'bit426-source-centres/global', 'bit426-source-centres', out / 'bit', cwd=changed) + run('complex-hosting', ROOT / 'complex_hosted.py', 'split-centres', out / 'complex', cwd=changed) + run('independent-audit', ROOT / 'audit.py', changed, out / 'bit', out / 'complex', out / 'AUDIT.json') + run('exact-assembly', ROOT / 'assemble.py', changed, out / 'bit', out / 'complex', out / 'AUDIT.json', out / 'RESULT.json') + actual = read(out / 'RESULT.json'); expected = read(ROOT / 'EXPECTED.json') + for k, v in expected.items(): assert actual[k] == v, (k, actual[k], v) + for side, d in (('bit', 'bit'), ('complex', 'complex')): + h = hashlib.sha256(gzip.decompress((out / d / 'GLOBAL-TEMPLATE.json.gz').read_bytes())).hexdigest() + assert h == expected[side + '_template_sha256'], (side, h) + integrity() + receipt = dict(status='PASS_FULL_IDLE_AXIS_HOSTING_COMPOSITION', kappa=actual['kappa'], kappa_decimal=actual['kappa_decimal'], + gain_over_pr434_percent=actual['gain_over_pr434_percent'], manifest_sha256=sha(ROOT / 'MANIFEST.json'), checks=steps, + python=sys.version.split()[0]) + (out / 'RECEIPT.json').write_text(json.dumps(receipt, indent=2) + '\n'); print(json.dumps(receipt, indent=2)) +except BaseException as e: + (out / 'FAILURE.json').write_text(json.dumps(dict(error=repr(e), completed=steps), indent=2) + '\n'); raise diff --git a/research/split-centres-global/.gitattributes b/research/split-centres-global/.gitattributes new file mode 100644 index 0000000000..a251e913f2 --- /dev/null +++ b/research/split-centres-global/.gitattributes @@ -0,0 +1,6 @@ +# Hashes bind exact imported and generated bytes. +* -text +vendor/** -whitespace +inputs/** -whitespace +notices/** -whitespace +proofs/** -whitespace diff --git a/research/split-centres-global/CERTIFICATE.json b/research/split-centres-global/CERTIFICATE.json new file mode 100644 index 0000000000..7e807079c1 --- /dev/null +++ b/research/split-centres-global/CERTIFICATE.json @@ -0,0 +1,119 @@ +{ + "status": "PASS_CONDITIONAL_SPLIT_CENTRE_ASSEMBLY", + "kappa": "560432476129139/500000000000000000", + "kappa_decimal": "0.001120864952258278", + "bit_lower": "561061350132569610283/500000000000000000000000", + "complex_lower": "1183986549206329/1000000000000000000", + "binding_component": "bit", + "gain_over_pr425_percent": 6.9522005058117555, + "bit_invoice": { + "prefix_bits": 223, + "charged_prefix_bits": 256, + "coefficient_bits": 223, + "two_level_coefficient_bits": 483, + "charged_two_level_coefficient_bits": 512, + "row_coefficient": 18355, + "live": 14502, + "physical": 14511 + }, + "strict_outer_constraints": { + "bit_positive": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_above_bit": "791857266447229204459483569705102945201339627252022591017013352985113602942786795000164759817249951996149235225861576966507630300630689893816878766552471016817/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_below_one_over32": "30066013450793671/1000000000000000000", + "beta_positive": "1/1000000000000000000", + "beta_below_one": "999999999999999999/1000000000000000000", + "leaf_saving_above_bit": "791857266447229189304455739864091745201339627252022591017013352985113602942786795000164759817249951996149235225861576966507630300630689893816878766552471016817/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_positive": "7181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_internal": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_leaf": "395928633223614609015398433325827868141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_positive": "7181585281696892583407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_below_one": "6392818414718303107416592912348246333468141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_reservations": "1/4000000000000000000", + "lambda_above_tau": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_sigma": "791857266447229218822654133098884940741856057546919645815673725733091011925773442015051156874463156995984475408611624970358395074769112927309248465921781123000121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_internal": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_prime_above_lambda": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_leaf": "395928633223614609015398433325827868141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_reservations": "1/4000000000000000000", + "lambda_prime_below_one": "7181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "epsilon_positive": "6399999999999999993600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "epsilon_below_one": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "guard_width": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "K_geometry": "4807181585281696892583407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817000000000000000000", + "K_dominates_log": "231664041345061050845983947421186256401668584010497584446258683699366907737186677571792433338340060113453513521617978855187267028104098984087218414251878140832554446748323117142213588175726741393/206683276944570867451077647988766247307479316572776744891925575256476111799662761934047904233001101994161357746522719973016545013550824072000632231965075950141464786411824273258607000000000000000000", + "record_suffix": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "phase_local": "57452682253575172660075115932332441271463422396879066665683849849996634666672126693120783994727674596531689914600391489101073218400050692643898107263289403063667839215065313749127621233447528983183/51257452682253575127867256701214029332254870510048632733197542663606075726316364959643880249784273294552016721137634553308103163360604369856156793527338835635083267030132419768134536000000000000000000", + "phase_boundary": "11490536450715029406269754961108975467567014357972880107649718965136053613580158978016584167309038954918313004492748842618542529916554807718463285392220894997054215109129499241498821233447528983183/10251490536450715025573451340242805866450974102009726546639508532721215145263272991928776049956854658910403344227526910661620632672120873971231358705467767127016653406026483953626907200000000000000000", + "gamma_sublinear": "1/2000000000000000000", + "cell_above_band": "12799999999999999980792818414718303109016592912348246333468141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/25628726341126787563933628350607014666127435255024316366598771331803037863158182479821940124892136647276008360568817276654051581680302184928078396763669417817541633515066209884067268000000000000000000", + "prime_interval_packing": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "alpha_positive": "14363170563393788359632590021810442080310539860404516767526852145439839929398406960210596656522703682519149061374476508023700697946773300526302961759162676751217566615750487648225621233447528983183/12814363170563393781966814175303507333063717627512158183299385665901518931579091239910970062446068323638004180284408638327025790840151092464039198381834708908770816757533104942033634000000000000000000", + "alpha_below_one": "12799999999999999993607181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/12814363170563393781966814175303507333063717627512158183299385665901518931579091239910970062446068323638004180284408638327025790840151092464039198381834708908770816757533104942033634000000000000000000", + "alpha_below_one_fourth": "3189227622077454657132070953804066391185618867017635029057319564329939892965374403017531918954994377226981896009727683073732747012090999815483496633699514550441486622767525747860182878766552471016817/12814363170563393781966814175303507333063717627512158183299385665901518931579091239910970062446068323638004180284408638327025790840151092464039198381834708908770816757533104942033634000000000000000000", + "delta_positive": "1/8000000000000000000", + "delta_below_one_eighth": "999999999999999999/8000000000000000000", + "short_record_fallback": "81827972558059963142482295831039750365059753405165839859500887157900070163784215146039541956047009515286378723945407637791323146319740145866082020356197908534083134290654194352838948148633280800174595114507063924980758679362172726895650066012032777455278212210736064133662717611940569491044304210260992667579958374711353997952140066809896811489/82011924291605720204587610721942446931607792816077812373116068261769721162106183935430208399654837271283226753820215285292965061376966991769850869643742137016133227248211871629015257600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "small_field_exposure": "1/1000000000000000000", + "artificial_boundary": "358859621458028601093359598365557325330989185343344322865175917750116843085479998176003320395642823216282588862770178911921831577311447916339793034478937323776724933813811421508232513136299657413050451/51257452682253575127867256701214029332254870510048632733197542663606075726316364959643880249784273294552016721137634553308103163360604369856156793527338835635083267030132419768134536000000000000000000", + "literal_scalar_guard": "1", + "row_product_gap": "23971789/25", + "balanced_prefix_above_kappa": "5122866517862023505724960619093421545844111701898553134698525509504383311993872387184513125657251444712150871805627114225726283245038727038504547469670408073428467093191496467269437/3203590792640848445491703543825876833265929406878039545824846416475379732894772809977742515611517080909501045071102159581756447710037773116009799595458677227192704189383276235508408500000000000000000", + "coordinate_movement_above_kappa": "16099174487823595540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_phase_layer_above_kappa": "3838551450442350120466514150535089425156364590041027177747358186058007158198199154413541220091468727605299653469049909287939671070001907844989495748423461692471525807616440463522057/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817000000000000000000", + "bulk_exposure_above_kappa": "16099174487823595540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Gaussian_arithmetic_above_kappa": "49929956359383891636682334467235976400846493161596454696927943987316335662954230095174784854400852306299403498179012231794056054820241901455974763560139756902928431597231181121226907/51257452682253575127867256701214029332254870510048632733197542663606075726316364959643880249784273294552016721137634553308103163360604369856156793527338835635083267030132419768134536000000000000000000", + "scalar_work_above_kappa": "3022347308020427168024638512713719642678957136664830842541068612764774941044496502999868999171719558143016474349913180337924305460021763455362126412952366988818802604491895640211767/2050298107290143005114690268048561173290194820401945309327901706544243029052654598385755209991370931782080668845505382132324126534424174794246271741093553425403330681205296790725381440000000000000000", + "dimension_above_kappa": "3196409207359151553231162974036146672459031212215382000019265285423173401803752699526640796382355306275012080586149285130394424095589341109716483649580049811311843280287131837920058593191496467269437/3203590792640848445491703543825876833265929406878039545824846416475379732894772809977742515611517080909501045071102159581756447710037773116009799595458677227192704189383276235508408500000000000000000" + }, + "outer_controls": [ + "next_grid", + "zero_eta", + "zero_beta", + "unit_beta" + ], + "bootstrap": [ + { + "gap": "48640105104416009930955104551272628756769/40000000000000000000000000000000000000000000000", + "cutoff_log2": "24346328299693" + }, + { + "gap": "10916033216189494908506938862091413300675156484737667525550897/8000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "19335382939135799529" + }, + { + "gap": "2449825733746901655394438404809502019511708753179325050819248403056515410563319361/1600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "15355787073969246541017124" + }, + { + "gap": "549801013506219857550281901936704203615404924098069138182437287931091972275689180385852832590942771793/320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "12195269025875323655994833423982" + }, + { + "gap": "123388839576821941106964776874551364767558290306753584545234931806617408234472738882773008179061080923160999418343337504609/64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "9685246734476302780854842486398253310" + }, + { + "gap": "27691483569705102945201339627252022591017013352985113602942786795000164759817249951996149235225861576966507630300630689893816878766552471016817/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "7691835588756193183914168151850588989363719" + } + ], + "bit_template_sha256": "c40f89a2ae3c2c5635ddf8f18d74f24567ddf67fc8c8e93a1fc7a1a8098e857e", + "complex_template_sha256": "942d030fa43316c560c88d7d7d904583446e1a96945b3ebd37a91c88a192ab4f", + "scope": "Finite research composition with explicit changed words, exact local and global replay and incremental phase evidence. All-size correlated dirty-bank, compressed-window, compiler, restored-work, tape/common-grid, precision and analytic interfaces remain inherited assumptions. This certificate makes no unconditional integer-multiplication or Lean-kernel claim.", + "verification_steps": [ + "hamming_packets", + "complex_construct", + "complex_audit", + "complex_emit", + "complex_phases", + "bit_construct", + "bit_export", + "bit_global", + "bit_audit", + "bit_price", + "complex_integrate", + "complex_replay", + "combined" + ], + "phase_mode": "source-bound unchanged evidence" +} diff --git a/research/split-centres-global/EXPECTED.json b/research/split-centres-global/EXPECTED.json new file mode 100644 index 0000000000..de7c122419 --- /dev/null +++ b/research/split-centres-global/EXPECTED.json @@ -0,0 +1,9 @@ +{ + "kappa": "560432476129139/500000000000000000", + "kappa_decimal": "0.001120864952258278", + "bit_lower": "561061350132569610283/500000000000000000000000", + "complex_lower": "1183986549206329/1000000000000000000", + "binding_component": "bit", + "bit_template_sha256": "c40f89a2ae3c2c5635ddf8f18d74f24567ddf67fc8c8e93a1fc7a1a8098e857e", + "complex_template_sha256": "942d030fa43316c560c88d7d7d904583446e1a96945b3ebd37a91c88a192ab4f" +} diff --git a/research/split-centres-global/LICENSE b/research/split-centres-global/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/split-centres-global/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/split-centres-global/MANIFEST.json b/research/split-centres-global/MANIFEST.json new file mode 100644 index 0000000000..1695125698 --- /dev/null +++ b/research/split-centres-global/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "format": "split-centres-global-manifest/1", + "files": { + ".gitattributes": "2f9541c7c27f084baad73b4cd50ddaeb264cc3aa8dbf13ec21df5ab3f673ca7e", + "CERTIFICATE.json": "f71580f22193726fb582eae604807ff70a7302265e001d9484a718e63bbe14c4", + "EXPECTED.json": "9b8e56eee3d5bdabd2e3e6e4ba0d9eba537525fba25a54126f9f0e41d2491a06", + "LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "NOTICE.md": "66101a9e74d0ba9c2da4c8802bcb1968534adfa7130b954628eb8bf515fc0389", + "PROOF.md": "6983e75f29af6eeaab20a30b08307ec6fab75ccb8b10291df8f9eb04d497f894", + "README.md": "b432292594adf2fcba2a8ddd87eda6167c76ff055e85aa5e3e2af7dd7e0f976e", + "SOURCES.json": "11aa666d678fed084b01d1e8e47239e1674eaedbc6fe0cee7edb2753477af9be", + "VALIDATION.json": "656d9bd7bd66058fdeb60cc90bd887e7ce75c0e0f9a100514e2bd84b95de89b6", + "code/bit_audit.py": "7fdbc077b7501a53662769ff2bf2ab44cc2e32dafc34478d7ef2c10e3144503a", + "code/bit_construct.py": "a461e6c983531beb5c8ac82ff593f39ce4e056387d1d6061f6e6b294dde4395f", + "code/bit_global.py": "3b2cb3ba21e5cf9b4deddb9e606322f33e9d8082020c0ee9092c21f4ebd9ad48", + "code/bit_price.py": "36bf15803567a95b139a908461541bf19efe1f5b85fb31c270021833ab1393ee", + "code/combined.py": "9c5bc70f2331b7342ceb252adcddb993581c45f80c37bcc58642dbad3b9775c2", + "code/complex_audit.py": "adeba5ea113652b60105db2e8719b18ffa292d3cc23730cca614b40272348330", + "code/complex_construct.py": "0f7f45b2333ec7daf4291e2bf675b49bc330b97fb5965dd27220ba353c291d6f", + "code/complex_emit.py": "f56d5f01f7c121741f175814138dca7190d769920f0a27e2d5b99c21aebed0f1", + "code/complex_integrate.py": "3792f41e409383e6989bda22801a4836a646a530f99e99bbd7244a8f3a1a8b4f", + "code/complex_phases.py": "13a959c52092776ae217df554b51c0298fa9eb3a350279acff6dece651c3f9cc", + "code/complex_phases_full.py": "0f2795aaffafe0c64d77f3748ef2109a3c42c58da867e4cf269a0a8cb6109466", + "code/complex_replay.py": "be2dccce2d1ad2c4f5c01a851c9c3896cc88236b5aeae706aad2ab16d6bfdad9", + "inputs/bit-geometry.json.gz": "5c980202227859e8bb9b863f94503930c2a59d460c0421356688e2b0d828b4a1", + "inputs/bit-r767.json.gz": "bd3b84244528767b85d8d7fe423b155630b5c659e21e51563674b1dcb6305ad7", + "inputs/complex-data-phases.json.gz": "c972b5b60649c2a52354f5160f69adc0f4a270fa09d32012beff9888774ab84f", + "inputs/complex-phase-receipt.json": "01763fee5017745de982f2ff5ee68004e815d6684097cc88011dfbfb1e789581", + "inputs/complex-phase-recipes.json.gz": "b5472bb1d3f9ff41b0819780a42886a7686b4caf3c0617bb1dc86158b3fb8671", + "inputs/complex-ports.json.gz": "77b0c0fa19ef3da1c7316010e13493aa5eea1a50c3506eddc08f7480e659878b", + "inputs/complex-template.json.gz": "1b84904a31a733aab9bfdda3f528c06719f590d2133a43687a8bded955dc991e", + "inputs/e8-r865.json.gz": "1fb726ea3818fe0837cceb0dd22a71a0814f064e5e781628104610d6468e0e55", + "notices/NOTICE-PR352.md": "967e6d7e76e216e4898cf543c75b527e8d397ec1ddba3800cb20701f24c89524", + "notices/NOTICE.md": "025773f32fb43667395e64c627a1752877bdc93afbfe01b106703eee438d21d3", + "notices/PR386.txt": "ae2241615a23063b18a04f1b7a88a52e62b3d7d42e333fbd21e3668567ab83d1", + "notices/PR426-SOURCE-PINS.json": "18ace817f2f9af22511bb303e99656ed114e534b87f3dd95a65ca4ca670baf2f", + "notices/PR426.md": "6a5593d0f284a2f0865037f5c5fa9e5f76f9e12cf50ec5284486d3b8137c89da", + "notices/SUSSMAN-NOTICE": "9419dd03a2f52cf8bdfc4d18216ce29f263ab583b27f01ced8e420985bcb7c81", + "proofs/INHERITED-COMPLEX-GEOMETRY.txt": "c1ff55536594222a8d2a30bc0e0956959774e1be2d5420b7838ad553ee556df2", + "proofs/PR386-BIT-GEOMETRY.txt": "c5f077b849e9add9957ab4ee36095dd47bc678dee7e09baa146dac4c0a0d66b2", + "proofs/PR425-COMPLEX.txt": "2cda27b9b9a1eb24127c38c2c7a6e085155a2472183e220189a3ea2c2b7720dc", + "proofs/PR426.md": "5787738ceb6faf14d3d96e8452592860a6c6a469733a9bcf196e8d1562ba1ffb", + "vendor/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "vendor/engines/base_two_moment.py": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098", + "vendor/engines/moment.py": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482", + "vendor/engines/outer.py": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c", + "vendor/export_records.py": "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3", + "vendor/hamming_packets.py": "daa9301e2767a711cfe66c6bebaad68e1a3bdb97ec9e848c927527ab43b37ae5", + "verify.py": "12fcdb20a87f75812b09c4916fbfc86305982cb410247186a123b5c58d517b4c" + } +} diff --git a/research/split-centres-global/NOTICE.md b/research/split-centres-global/NOTICE.md new file mode 100644 index 0000000000..b7daf8de49 --- /dev/null +++ b/research/split-centres-global/NOTICE.md @@ -0,0 +1,41 @@ +# Attribution + +Copyright 2026 icekylinx. New split-centre cancellation, reversible source-centre +composition, integration and verification changes were prepared by icekylinx +with substantial OpenAI Codex assistance. Apache-2.0 applies to these changes. +Earlier private Pro exploration used GPT-6 Astra; the new construction and +composition in this package were developed with Codex. + +## Direct sources + +- Zhihao Chen, with OpenAI Codex assistance: PR425's mutable-basis Hamming packet + producer, common-frame scalar interface, exact phase lowering and verification; + PR386's compressed nine-stage bit geometry, owner template, audit and finite + accounting. These supply the immediate complex and geometric baselines. +- ai-nanachi, with OpenAI Codex assistance: PR426's R767 bit word, including 55 + clean-reset helper reuses and 54 frame changes. The complete selected word is + imported unchanged before the nine source-centre replacements. +- Dylan Crow (utcorvusvolat-dotcom), with Anthropic Claude assistance: PR370's + Hamming E8 bit producer, root table, record exporter and local format. +- Jacob Sussman: the E8 family, complex unit and underlying interchange framework. +- applecrusher, Dugongue, eumemic, Rohan Arun, Chafik Boukhalfa, DaysSky, + DreamingOfClouds, Henry Grant, Evan McKinney, LJH-217 and other contributors: + the source, frame, compiler, rational-pricing and analytic lineage detailed + in the preserved original notices. + +The current value is computed from the two actual resulting programs. +Independently published improvements are not added numerically. `SOURCES.json` +records original commits and file hashes; `notices/` preserves source notices. +Files under `proofs/` describe their original packages and retain their original +scope and attribution; the current statement is in `PROOF.md`. + +## Earlier contributions by icekylinx + +The earlier #10, #18, #24, #32 and #36 contributions developed projector batching, +partial-swap frames, endpoint gauges and conditional analytic/tape integration. +The subsequent #104, #115, #130 and #144 contributions covered stopped-product +integration, partial gauges, three-stage covers and paired-cube/source chronology. +These provide historical context, not additional savings in this ledger. The +source-centre idea from the preceding local round is used here on PR426's bit +word. Unselected research experiments and superseded submission candidates are +not part of this package. diff --git a/research/split-centres-global/PROOF.md b/research/split-centres-global/PROOF.md new file mode 100644 index 0000000000..8366a89e36 --- /dev/null +++ b/research/split-centres-global/PROOF.md @@ -0,0 +1,184 @@ +# Split centres and a joint conditional exponent + +The finite construction gives + +$$ +T(n)=O\!\left(n(\log n)^{1-\kappa}\right), +\qquad \kappa=0.001120864952258278, +$$ + +conditional on the retained all-size compiler, compressed-window, correlated +bank-dirt, restored-work, fixed-tape/common-grid, precision and analytic +interfaces. The changes below concern both finite suppliers. Original source +proofs and notices are retained; they do not replace the changed checks. + +## 1. Cancel coordinate terms before lifting the complex decoder + +Partition the 120 Hamming E8 root lines into the 112 code lines C and the eight +coordinate lines F, represented by 2e_i. Write r_s for a root representative and +G_ts = r_t · r_s / 2. The parent decoder is the rank-eight centre factorization +G/2 together with its negative off-diagonal entries. + +For each code target t, the coordinate-source centre contribution is +r_ti x_(2e_i)/2. Its side contribution is its negative. Cancel this pair before +constructing the lifted program. For code targets retain only + +$$ +Z_i=\sum_{s\in C}r_{si}x_s, +\qquad +\sum_i\frac{r_{ti}}4Z_i +-\sum_{\substack{s\in C\\s\ne t}}\frac{G_{ts}}2x_s=x_t. +$$ + +For coordinate targets, implement the identity x_(2e_i) directly. Thus the +entire 120-by-120 clean decoder is still the identity, including both cross +blocks between C and F. + +In the parent's binary address realization, + +$$ +p_s\cdot p_t=1+G_{st}\pmod2. +$$ + +Every code source contributing to Z_i is orthogonal to p_(2e_i), because its +ith root coordinate is ±1. The already constructed global sum Z_i lies in that +rank-eight hyperplane. Copy it there, lower the private copy to frame zero with +one rank-eight child, and scatter into the code targets. The eight coordinate +identities copy their source lines with one rank-one child each. Each private +copy has a sequential lifetime, and is erased before the next episode. + +The total copied rank is unchanged: + +$$ +8\cdot8+8\cdot1=72. +$$ + +The 112 coordinate-source helpers and eight dedicated full-centre helpers are +removed. Own-block corrections use their original source-copy rows directly; +all remaining signed packets and selected target butterflies are retained. +The actual helper count is 560. No rank-four recovered row is substituted for +a rank-three input. + +## 2. Arbitrary dirt and heterogeneous copy frames + +The explicit main word has block form z' = Uz and y' = Vy + x + Ks, where +z=(x,s), and U,V are invertible. No target feeds z. At the common initial frame, +apply V^-1 to the target basis and the literal correction -V^-1 Ks. Recompute K +from the new word. After all main gates and final climbs, apply the literal +inverse of the source/helper subword at the common full frame. This restores +all sources and arbitrary helpers while adding x to y. + +The parent common-frame proof applies to each copy separately. A private copy +created at label L(F) is lowered by the exact operator L(0)L(F)^-1, whether F +has rank one or eight. Scalar operations occur only at equal labels. Adding +the common exterior window to both labels cancels it exactly. The proof +therefore does not require a full-frame centre, or infer an operator from rank +alone. The inverse-transpose negates/transposes each scalar shear in the same +order and reverses each private gather/child/scatter operation as emitted. + +Both scalar orientations and the serialized private-work programs replay all +800 input columns. Both restore arbitrary source/helper inputs and erase private +work. The changed exact Gaussian recipes include the heterogeneous centre +transitions and their global phases. Of 2,918 selected directed pairs, 248 were +newly computed; 2,670 were unchanged source-bound exact pairs already checked in +the local phase run. The release optionally replays all selected pairs. + +The local paid profile is + +$$ +\{1:1912,\ 2:784,\ 3:168,\ 4:224,\ 5:392,\ 8:24\}. +$$ + +The compressed complex geometry uses m=73, eight replicas and nine stages. +There are 560 banks per stage, each holding eight whole rank-nine residuals and +one paid rank-one pad. Live width is 12,720; physical stock is 13,298, including +16 centre slots, the conservative 560-row tableau reserve and two coefficient +streams. The global rank deficit is 2,496. Explicit owner tables, padding, +terminal translations and the cover correction are independently decoded. +The largest child is 48; 73² > 2·48² gives two-level halving. + +The fresh invoice fits the retained 2^30000 router, 2^100000 literal and 2^210000 +precision reserves. Two exact rational engines certify + +$$ +b=0.001183986549206329. +$$ + +## 3. Source-centre bit composition + +Start with the exact R767 word from PR426. Its nine retained rows are written +only by original sources at the full frame and are not read by ordinary A/B +gates. Their nine independent binary forms have an invertible minor in source +columns 0,1,2,4,8,9,16,32,64. + +Replace those rows of the 120-dimensional identity by the nine retained forms. +Exact elimination produces an invertible source basis T, emitted as 559 XOR +additions. Delete the nine retained helper rows and their old-dirt columns. +After A apply T, perform the same nine sequential copies using the designated +source rows, and immediately apply T^-1 before B. The copies have unchanged +rank eight. All scalar operations of T and its inverse use the full frame. + +All 998 columns, arbitrary dirt, frame incidences and restoration pass. Omitting +T^-1 or the remaining old-dirt correction fails. The actual exported record +stream is reflected in reverse order with complementary frames. A reflected +ERASE becomes a fresh COPY at that chronological point; the original source +row remains unchanged within each copy episode. Both reflected programs and +all nine composed invocations are replayed, rather than assuming that mutable +source rows meet an old immutability restriction. + +Use the unchanged compressed bit windows in dimension 64: a local eight-space +and eight exterior seven-spaces. The root data, rational frame family, form, +port isometries and bank slots are source-bound to PR386. Every changed nested +pair is checked by exact rational spans; positive definiteness gives the +projector identity and its reflected version. There are 758 banks per stage, +each filled by eight rank-eight residuals, with no padding. Live width is 14,502 +and physical stock is 14,511. All 54,576 owner assignments are checked. The +unbanked global replay restores all 7,782 independent columns. + +The bit local profile is + +$$ +\{1:2367,\ 2:875,\ 3:475,\ 4:321,\ 5:164,\ 7:14,\ 8:9\}. +$$ + +Its global deficit is again 2,496. The maximum child is 42 and 64² > 2·42². +The actual cancellation-free prefix bound needs 223 bits; the new charge is +256 bits, replacing the parent's 192-bit allowance. The finite two-level +coefficient needs 483 bits and fits the retained 2^512 allowance. The row +coefficient is 18,355 < 20,161. These costs, including the basis operations, +are recomputed from the emitted word. Two exact rational moment engines give + +$$ +c=0.001122122700265139220566. +$$ + +## 4. Joint strict assembly + +Both moments include the inherited 10^-16 bad-branch allowance. The bit supplier +binds because c < b. Let eta=beta=10^-18 and + +$$ +s=\min\{c,(1-\beta)b\}-10^{-24}. +$$ + +Starting at a_0=384599/10^10, use six fixed ordinary bootstrap levels + +$$ +a_{j+1}=(1-s)s+sa_j. +$$ + +All bootstrap cutoff inequalities are checked with the actual charged finite +coefficient. With q=a_6(1-2eta), choose the greatest 10^-18 grid point strictly +below (1-eta)q/(1+q). It is + +$$ +\kappa=\frac{560432476129139}{500000000000000000} + =0.001120864952258278. +$$ + +All 47 retained strict outer inequalities pass. The next grid point, zero eta, +zero beta and unit beta are rejected. The candidate is computed from both +actual new templates; no independently reported savings are added together. + +The source-bound finite claims above do not discharge the inherited all-size +interfaces or establish unconditional integer-multiplication complexity. diff --git a/research/split-centres-global/README.md b/research/split-centres-global/README.md new file mode 100644 index 0000000000..1e31463921 --- /dev/null +++ b/research/split-centres-global/README.md @@ -0,0 +1,56 @@ +# Conditional κ = 0.001120864952258278 + +This package combines a split-centre Hamming complex construction with a +source-centre bit construction in compressed nine-stage windows. The resulting +conditional exponent saving is + +$$ +\kappa=\frac{560432476129139}{500000000000000000} + =0.001120864952258278. +$$ + +This is approximately **6.9522% above PR425**. Both components change: + +| Component | Helpers | Ambient width | Certified saving | +|---|---:|---:|---:| +| Complex | 560 | 73 | 0.001183986549206329 | +| Bit | 758 | 64 | 0.001122122700265139220566 | + +The bit component limits the final assembly. The complex construction removes +coordinate contributions that cancel in the decoder, replacing eight full +centres with eight rank-eight and eight rank-one copies. The bit construction +starts from PR426's R767 word, computes its nine retained forms reversibly in +source rows, and uses PR386's compressed windows. + +## Verification + +Python 3.11+ and its standard library suffice. Use a new output directory: + +```sh +python3 -B research/split-centres-global/verify.py /tmp/split-centres-check +``` + +The default replays both changed words, reflected/inverse-transpose programs, +bank ownership, costs, two rational moment engines and 47 strict outer +inequalities. Exact complex phase evidence is reused only when the regenerated +canonical word and complete recipe hashes match. To regenerate every selected +Gaussian phase pair as well: + +```sh +python3 -B research/split-centres-global/verify.py /tmp/split-centres-full-phases --replay-phases +``` + +The unchanged historical repository suite and PDF build are not required by +this package. `EXPECTED.json` binds the result to both emitted global templates; +`MANIFEST.json` binds the package files; `SOURCES.json` pins imported sources. + +## Scope + +[PROOF.md](PROOF.md) supplies the changed finite construction. The all-size +compressed-window and correlated dirty-bank semantics, recursive compiler, +restored-work/tape/common-grid precision, and analytic transfer interfaces remain +conditional. This does not claim unchanged legacy gx/gxcore acceptance, a new +Lean proof, or an unconditional multiplication theorem. + +Contributor history and AI assistance are recorded in [NOTICE.md](NOTICE.md). +Original notices and the inherited proofs are retained separately. diff --git a/research/split-centres-global/SOURCES.json b/research/split-centres-global/SOURCES.json new file mode 100644 index 0000000000..215f58a649 --- /dev/null +++ b/research/split-centres-global/SOURCES.json @@ -0,0 +1,134 @@ +{ + "upstream_base": "12a4934d15006e8c10f9b2264f13f8f341be802b", + "pr425": "e11ccea1d092beb1b01b4ee4ce49da478234254c", + "pr426": "88d552526893cd15325948bb1487e9a4d4bf32f6", + "imported_files": [ + { + "path": "vendor/hamming_packets.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/hamming_packets.py", + "sha256": "daa9301e2767a711cfe66c6bebaad68e1a3bdb97ec9e848c927527ab43b37ae5" + }, + { + "path": "vendor/clifford_exact.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/odd-stages/clifford_exact.py", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "inputs/complex-ports.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/higher-stage-e8/verified/gcert1-e8-retimed.json.gz", + "sha256": "77b0c0fa19ef3da1c7316010e13493aa5eea1a50c3506eddc08f7480e659878b" + }, + { + "path": "inputs/complex-template.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-nine-native/GLOBAL-TEMPLATE.json.gz", + "sha256": "1b84904a31a733aab9bfdda3f528c06719f590d2133a43687a8bded955dc991e" + }, + { + "path": "inputs/complex-data-phases.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-nine-native/DATA-PHASES.json", + "sha256": "c972b5b60649c2a52354f5160f69adc0f4a270fa09d32012beff9888774ab84f", + "source_sha256": "f621f6d4296cb215f334830356c5f79fe10d6d04d15b3ccda76ba0885ab67d0a", + "encoding": "gzip; decoded bytes identical to source" + }, + { + "path": "inputs/e8-r865.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr370-source/research/e8-bit/data/bit/bitE8-r865.json.gz", + "sha256": "1fb726ea3818fe0837cceb0dd22a71a0814f064e5e781628104610d6468e0e55" + }, + { + "path": "proofs/PR425-COMPLEX.txt", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/hamming/PROOF.txt", + "sha256": "2cda27b9b9a1eb24127c38c2c7a6e085155a2472183e220189a3ea2c2b7720dc" + }, + { + "path": "proofs/INHERITED-COMPLEX-GEOMETRY.txt", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-nine-native/PROOF.txt", + "sha256": "c1ff55536594222a8d2a30bc0e0956959774e1be2d5420b7838ad553ee556df2" + }, + { + "path": "vendor/engines/moment.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr361/code/engines/moment.py", + "sha256": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482" + }, + { + "path": "vendor/engines/base_two_moment.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr361/code/engines/base_two_moment.py", + "sha256": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098" + }, + { + "path": "vendor/engines/outer.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr361/code/engines/outer.py", + "sha256": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c" + }, + { + "path": "vendor/export_records.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit/code/bit/export_records.py", + "sha256": "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3" + }, + { + "path": "inputs/bit-geometry.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine-validation/GEOMETRY.json.gz", + "sha256": "5c980202227859e8bb9b863f94503930c2a59d460c0421356688e2b0d828b4a1" + }, + { + "path": "proofs/PR386-BIT-GEOMETRY.txt", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/PROOF.txt", + "sha256": "c5f077b849e9add9957ab4ee36095dd47bc678dee7e09baa146dac4c0a0d66b2" + }, + { + "path": "notices/PR386.txt", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/NOTICE.txt", + "sha256": "ae2241615a23063b18a04f1b7a88a52e62b3d7d42e333fbd21e3668567ab83d1" + }, + { + "path": "inputs/bit-r767.json.gz", + "source": "CrocSwap/integer-mult-bounds@88d552526893cd15325948bb1487e9a4d4bf32f6:research/e8-clean-reuse-extension/data/bit-candidate.json.gz", + "sha256": "bd3b84244528767b85d8d7fe423b155630b5c659e21e51563674b1dcb6305ad7" + }, + { + "path": "notices/PR426.md", + "source": "CrocSwap/integer-mult-bounds@88d552526893cd15325948bb1487e9a4d4bf32f6:research/e8-clean-reuse-extension/NOTICE.md", + "sha256": "6a5593d0f284a2f0865037f5c5fa9e5f76f9e12cf50ec5284486d3b8137c89da" + }, + { + "path": "proofs/PR426.md", + "source": "CrocSwap/integer-mult-bounds@88d552526893cd15325948bb1487e9a4d4bf32f6:research/e8-clean-reuse-extension/PROOF.md", + "sha256": "5787738ceb6faf14d3d96e8452592860a6c6a469733a9bcf196e8d1562ba1ffb" + }, + { + "path": "notices/PR426-SOURCE-PINS.json", + "source": "CrocSwap/integer-mult-bounds@88d552526893cd15325948bb1487e9a4d4bf32f6:research/e8-clean-reuse-extension/SOURCE-PINS.json", + "sha256": "18ace817f2f9af22511bb303e99656ed114e534b87f3dd95a65ca4ca670baf2f" + }, + { + "path": "notices/NOTICE-PR352.md", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr370-source/research/e8-bit/NOTICE-PR352.md", + "sha256": "967e6d7e76e216e4898cf543c75b527e8d397ec1ddba3800cb20701f24c89524" + }, + { + "path": "notices/NOTICE.md", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr370-source/research/e8-bit/NOTICE.md", + "sha256": "025773f32fb43667395e64c627a1752877bdc93afbfe01b106703eee438d21d3" + }, + { + "path": "LICENSE", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr370-source/research/e8-bit/LICENSE", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "path": "notices/SUSSMAN-NOTICE", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit/code/complex/inputs/complex/NOTICE", + "sha256": "9419dd03a2f52cf8bdfc4d18216ce29f263ab583b27f01ced8e420985bcb7c81" + } + ], + "adapted_sources": { + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/hamming_full.py": "613796df039dfc08de708831582533e553316eaf157485531e4df2d897bdb3bb", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/audit_full.py": "fdc1da8fa95716d60076383e691a5be1bf8bec0b229b7582bc056afac28951d0", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/integrate.py": "eb5b427f2095578f28a1fb320b4694047e20abdbe0c8bcdc65b1e9e05ab90d01", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/phase_full.py": "5c2bd267cc3106c9eee8787132c460614fdde8177c0c2653435f8a7b110ebac1", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/replay_ir.py": "f7a3829118581ee59fdeefc1f91166d8e7bb94686ea92e7743a2ef7d50139dcc", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/global_word.py": "2c438be46213e014170e607a745185e45e33c7b7240b833efc86a2330de0d1f6", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/audit.py": "75811327b0d6cbd56aae8e28d72abd42d57c7f3f3630781d045efee2d36446e9", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/certify.py": "550b1408fb3a581dd6b82c90e3f84ad7a9f78746d2be11ffa1cf543d719ae2d4" + } +} diff --git a/research/split-centres-global/VALIDATION.json b/research/split-centres-global/VALIDATION.json new file mode 100644 index 0000000000..70b00c0bc7 --- /dev/null +++ b/research/split-centres-global/VALIDATION.json @@ -0,0 +1,39 @@ +{ + "status": "PASS_CLEAN_DIRECTORY_INCREMENTAL_REPLAY", + "python": "3.14", + "tested_code_vendor_input_digest": "c15599626c4222a95ddb4f0a9da028cfce5c8636c7a737d6869155c2f33301ed", + "steps": [ + "hamming_packets", + "complex_construct", + "complex_audit", + "complex_emit", + "complex_phases", + "bit_construct", + "bit_export", + "bit_global", + "bit_audit", + "bit_price", + "complex_integrate", + "complex_replay", + "combined" + ], + "phase_mode": "source-bound unchanged evidence", + "new_complex_phase_pairs": 248, + "reused_verified_complex_phase_pairs": 2670, + "source_bound_bit_geometry": "PR386; exact unchanged root/frame/port/slot identities", + "historical_full_suite_rerun": false, + "pdf_built": false, + "ci_status": "Not yet run for this commit", + "post_replay_packaging": "Phase JSON gzip round-trip matched the verified decoded bytes; mathematical code and witnesses unchanged.", + "portability_validation": { + "python": "3.11.17", + "status": "PASS_ALL_PACKAGE_STEPS_AND_UNCHANGED_EXPECTED_RESULT", + "cause": "gzip OS header differs from Python 3.14; exact decoded canonical bytes agree", + "phase_binding": "SHA256 of exact decompressed bytes; current archive hash remains bound in downstream receipts", + "negative_control": "A modified canonical witness is rejected", + "python314_incremental": "Changed phase-binding step passed against the previously validated output", + "historical_full_suite_rerun": false + }, + "portability_code_vendor_input_digest": "a2534c803ecb3afb25662517ad542c1b05869046ced4ac78250625b1707014e4", + "portability_digest_format": "SHA256 of compact sorted JSON mapping package-relative code/vendor/inputs paths to file SHA256" +} diff --git a/research/split-centres-global/code/bit_audit.py b/research/split-centres-global/code/bit_audit.py new file mode 100644 index 0000000000..82e1663e58 --- /dev/null +++ b/research/split-centres-global/code/bit_audit.py @@ -0,0 +1,126 @@ +# Adapted with exact rational span checks by icekylinx; Codex assistance. +"""Independent audit of the emitted bit template, including mutation controls. +Prepared by Zhihao Chen with OpenAI Codex assistance; Apache-2.0. +""" +import argparse, copy, gzip, hashlib, json, struct, time +from collections import Counter, defaultdict +from pathlib import Path +from fractions import Fraction as Q + +def sha(p): return hashlib.sha256(p.read_bytes()).hexdigest() + +def main(): + ap=argparse.ArgumentParser(); ap.add_argument('--local-check',type=Path,required=True); ap.add_argument('--out',type=Path,required=True) + a=ap.parse_args(); start=time.monotonic(); out=a.out + blob=gzip.decompress((out/'GLOBAL-TEMPLATE.json.gz').read_bytes()); t=json.loads(blob) + g=json.loads((out/'GLOBAL.json').read_text()); geo=json.loads((out/'GEOMETRY.json').read_text()) + assert hashlib.sha256(blob).hexdigest()==g['template_sha256'] + assert t['geometry_sha256']==sha(out/'GEOMETRY.json') and t['source_record_sha256']==sha(a.local_check/'records/249-records.bin') + fs=json.loads((a.local_check/'records/frames.json').read_text())['frames'] + records=list(struct.iter_unpack('<6i',(a.local_check/'records/249-records.bin').read_bytes())) + word=json.loads((a.local_check/'bit-source-centres.json').read_text()) + assert g['word_sha256']==sha(a.local_check/'bit-source-centres.json') + def rank(rows): + piv={} + for rr in rows: + row=list(map(Q,rr)) + for k,b in sorted(piv.items()): + q=row[k] + if q:row=[x-q*y for x,y in zip(row,b)] + k=next((j for j,x in enumerate(row) if x),None) + if k is not None: + q=row[k];piv[k]=[x/q for x in row] + return len(piv) + dimensions={};proj={} + for key,f in fs.items(): + k=int(key);B=f['B'];roots=[word['lines'][j] for j in word['frames'][k]] + assert rank(B)==f['dim']==rank(B+roots)==rank(roots) + dimensions[k]=f['dim'];proj[k]=B + sets=[set(f) for f in word['frames']];pairs={} + for op,x,y,c,r,z in records: + if op==0: + assert sets[y]<=sets[c] and dimensions[c]-dimensions[y]==r + pairs[y,c]=r + # Positive definite rational form: exact inclusion implies commuting + # orthogonal projectors and rank(P_V-P_U)=dim(V)-dim(U), also in reflection. + assert len(proj)==944 + expected={} + for rev in (False,True): + es=[] + for op,x,y,c,f,z in (reversed(records) if rev else records): + if op==0: es.append([0,x,c if rev else y,y if rev else c,f,int(rev)]) + elif op==1: es.append([1,x,y,-c if rev else c,f,int(rev)]) + elif op==(3 if rev else 2): es.append([2,x,y,c,f,abs(dimensions[c]-dimensions[f]),int(rev)]) + else: es.append([3,x,y,c,f,z,int(rev)]) + expected['reverse' if rev else 'forward']=es + assert t['local_programs']==expected + + def validate(q,check_profile=True): + assert (q['m'],q['live'],q['replicas'],q['stages'])==(64,14502,8,9) + assert q['bank_padding'] is None and q['local_programs']==expected + hist=Counter(); occupation=defaultdict(set); calls=set() + for c in q['calls']: + st,rep,p=c['stage'],c['replica'],c['pair']; rev=c['orientation']=='reverse' + assert 0<=st<9 and 0<=rep<8 and p==max(0,(st-1)//2) + assert rev==(st in (1,3,5,7)) and (st,rep) not in calls; calls.add((st,rep)) + own=c['owners']; assert len(own)==998 + assert len({(f,tuple(r)) for f,r in own})==998 + for i,(family,route) in enumerate(own): + assert 0<=family<14502 + if i<240: + side=i//120; side=1-side if rev else side + assert family==rep*960+(2*p+side)*120+i%120 and route==['data',st,i%120] + else: + j=i-240; bank,slot=divmod(rep*758+j,8) + assert family==7680+st*758+bank and route==['bank',slot] + assert slot not in occupation[family]; occupation[family].add(slot) + for e in q['local_programs'][c['orientation']]: + if e[0]==0 and e[4]: hist[e[4]]+=1 + if e[0]==2: hist[e[5]]+=1 + assert calls=={(s,r) for s in range(9) for r in range(8)} + assert set(occupation)==set(range(7680,14502)) and all(s==set(range(8)) for s in occupation.values()) + levels=[-1]*4; scalar=[1<> p & 1: + row ^= q + assert row, 'Retained forms must be independent' + p = (row & -row).bit_length() - 1 + echelon[p] = row + pivots = sorted(echelon) + matrix = [1 << i for i in range(v)] + for p, row in zip(pivots, rows): + matrix[p] = row + target = matrix[:] + elimination = [] + def add(d, s): + matrix[d] ^= matrix[s] + elimination.append((d, s)) + for p in range(v): + q = next(i for i in range(p, v) if matrix[i] >> p & 1) + if q != p: + add(p, q); add(q, p); add(p, q) + for i in range(v): + if i != p and matrix[i] >> p & 1: + add(i, p) + assert matrix == [1 << i for i in range(v)] + forward = [[full, d, [s]] for d, s in reversed(elimination)] + inverse = list(reversed(forward)) + check = [1 << i for i in range(v)] + for f, d, ss in forward: + check[d] ^= check[ss[0]] + assert check == target + out = copy.deepcopy(old) + physical = [i for i in range(2*v+old['R']) if i not in retired] + index = {r: i for i, r in enumerate(physical)} + def remap(gs): + return [[f, index[d], [index[s] for s in ss if s not in retired]] + for f, d, ss in gs if d not in retired] + out['R'] -= len(retired) + out['ret'] = pivots + out['D'] = remap(old['D']) + out['A'] = remap(old['A']) + forward + out['B'] = inverse + remap(old['B']) + out['C'] = remap(old['C']) + out['start'] = [old['start'][i] for i in physical] + out['final'] = [old['final'][i] for i in physical] + out['source_basis_gates'] = len(forward) + assert replay(out), 'All independent source, target and dirty columns' + assert not replay(out, skip_inverse=True) + assert not replay(out, skip_dirt=True) + # Frame incidence inclusion uses the root-closed sets in this bit format. + frames = [set(f) for f in out['frames']] + cur = out['start'][:] + for phase in ['D', 'A', 'B', 'C']: + for f, d, ss in out[phase]: + for r in [d] + ss: + assert frames[cur[r]] <= frames[f], (phase, r, cur[r], f) + cur[r] = f + if phase == 'A': + assert all(cur[r] == full for r in out['ret']) + assert all(frames[f] <= frames[g] for f, g in zip(cur, out['final'])) + raw = json.dumps(out, sort_keys=True, separators=(',', ':')).encode() + (ROOT / 'bit-source-centres.json').write_bytes(raw) + result = dict(status='PASS_LOCAL_ALL_COLUMNS_AND_NESTED_FRAMES', + original_R=old['R'], new_R=out['R'], + removed_retained_helpers=sorted(retired), retained_source_rows=pivots, + formal_columns=2*v+out['R'], reversible_basis_gates_each_way=len(forward), + source_sha256=sha256(source.read_bytes()).hexdigest(), + output_sha256=sha256(raw).hexdigest(), + controls=['unmodified word passes', 'missing inverse rejected', 'missing dirt rejected'], + kappa_claimed=False, + remaining=['global ordinary-call and reflected integration', 'finite coefficient and tape invoice', 'exact priced component comparison']) + (ROOT / 'bit-source-centres-receipt.json').write_text(json.dumps(result, indent=2)+'\n') + print(json.dumps(result)) + + +if __name__ == '__main__': + main() diff --git a/research/split-centres-global/code/bit_global.py b/research/split-centres-global/code/bit_global.py new file mode 100644 index 0000000000..5ccf622825 --- /dev/null +++ b/research/split-centres-global/code/bit_global.py @@ -0,0 +1,226 @@ +# Adapted for the PR426/source-centre composition by icekylinx with Codex assistance. +"""Source-bound compressed nine-stage bit template and exact scalar audits. + +Prepared by Zhihao Chen with OpenAI Codex assistance, Apache-2.0. +The local E8 bit word is Dylan Crow's pinned PR #370 contribution. +""" +import argparse, gzip, hashlib, json, struct, time +from collections import Counter +from pathlib import Path + +H,V,R,L,K,T,M=8,120,758,9,4,8,64 +LOCAL=2*V+R; DATA=2*K*V*T; LIVE=DATA+L*R +def sha(p): return hashlib.sha256(p.read_bytes()).hexdigest() +def write(p,x): p.write_text(json.dumps(x,indent=2)+'\n') + +def recipe(): + out=[dict(kind='local',stage=0,pair=0,reverse=False)]; stage=1 + for j in range(K): + out.append(dict(kind='local',stage=stage,pair=j,reverse=True)); stage+=1 + if j=0 + cur[x]=newf + if f: hist[f]+=1 + events.append([0,x,oldf,newf,f,int(reverse)]) + elif op==1: + assert cur[x]==cur[y]==f and x!=y and x0 + cutoff=max(ceil(36/gap**2),ceil(2*(4+512)/gap)) + assert cutoff*gap**2>=36 and cutoff*gap>=2*(4+512) + cutoffs.append(dict(gap=str(gap),cutoff_log2=str(cutoff)));chain.append(a) +q=chain[-1]*(1-2*eta);margin=(1-eta)*q/(1+q);ticks=margin/grid;k=grid*((ticks.numerator-1)//ticks.denominator) +bridge={'semantic':{'C0':{'base':2,'exponent':210000},'strict_literal_gap':1},'rows':{'degree_gap':Q(10**6)-Q(51*20161,25)}} +a=Outer.assembly(chain[-1],b,bridge,k,eta=eta,beta=beta) +assert len(a['strict_constraints'])==47 and all(x>0 for x in a['strict_constraints'].values()) +controls=[] +for name,kk,ee,bb in [('next_grid',k+grid,eta,beta),('zero_eta',k,Q(0),beta),('zero_beta',k,eta,Q(0)),('unit_beta',k,eta,Q(1))]: + try:Outer.assembly(chain[-1],b,bridge,kk,eta=ee,beta=bb) + except AssertionError:controls.append(name) + else:raise AssertionError(name) +result=dict(status='PASS_CONDITIONAL_SPLIT_CENTRE_ASSEMBLY',kappa=str(k),kappa_decimal=format(float(k),'.18f'),bit_lower=str(c),complex_lower=str(b),binding_component='bit',gain_over_pr425_percent=float(100*(k/Q(1048005508028206,10**18)-1)),bit_invoice=dict(prefix_bits=prefix.bit_length(),charged_prefix_bits=256,coefficient_bits=coefficient.bit_length(),two_level_coefficient_bits=two.bit_length(),charged_two_level_coefficient_bits=512,row_coefficient=row,live=W,physical=physical),strict_outer_constraints={n:str(x) for n,x in a['strict_constraints'].items()},outer_controls=controls,bootstrap=cutoffs,bit_template_sha256=g['template_sha256'],complex_template_sha256=cx['global_template_sha256'],scope='Finite research composition with explicit changed words, exact local and global replay and incremental phase evidence. All-size correlated dirty-bank, compressed-window, compiler, restored-work, tape/common-grid, precision and analytic interfaces remain inherited assumptions. This certificate makes no unconditional integer-multiplication or Lean-kernel claim.') +(ROOT/'RESULT.json').write_text(json.dumps(result,indent=2)+'\n') +print(result['status'],result['kappa_decimal'],result['gain_over_pr425_percent'],result['bit_invoice']) diff --git a/research/split-centres-global/code/complex_audit.py b/research/split-centres-global/code/complex_audit.py new file mode 100644 index 0000000000..ba6789a3a6 --- /dev/null +++ b/research/split-centres-global/code/complex_audit.py @@ -0,0 +1,168 @@ +# Modified from PR425 by icekylinx with Codex assistance. +"""Read-back audit, independent of the Hamming producer and its row state.""" +import copy,gzip,hashlib,importlib.util,json,math,time +from collections import Counter +from fractions import Fraction as Q +from pathlib import Path + +OUT=Path('split-centres');p=OUT/'FULL-WORD.json.gz' +word=json.load(gzip.open(p));v=120;n=240+word['report']['R'];start=time.monotonic() +def apply(e,rows): + if e[0]=='scale': + _,t,a,b,*_=e;q=Q(a,b);assert q + rows[t]={j:q*x for j,x in rows[t].items()} + else: + _,t,s,a,b,*_=e;q=Q(a,b);assert t!=s + for j,x in list(rows[s].items()): + z=rows[t].get(j,Q(0))+q*x + if z:rows[t][j]=z + else:rows[t].pop(j,None) +def ident():return [{r:Q(1)} for r in range(n)] +def inv(e): + e=copy.deepcopy(e) + if e[0]=='add':e[3]*=-1 + else:e[2],e[3]=e[3],e[2] + return e +def dual(e): + e=inv(e) + if e[0]=='add':e[1],e[2]=e[2],e[1] + return e + +main=word['A']+word['cut']+word['B'] +assert all(not 120<=e[2]<240 for e in word['A']+word['B'] if e[0]=='add' and not 120<=e[1]<240) +matrix=ident() +for e in main:apply(e,matrix) +print('full main columns',n,'replayed',flush=True) +# Compute -A_Y^-1 B_S using only rows of the explicit main operator. +dirty=[{} for r in range(n)] +for r in range(v,2*v):dirty[r]={j:x for j,x in matrix[r].items() if j>=2*v} +for e in word['precondition']:apply(e,dirty) +comp=[] +for r in range(v,2*v): + for j,q in sorted(dirty[r].items()):comp.append(['add',r,j,-q.numerator,q.denominator,[]]) + +cleanup=[inv(e) for e in reversed(word['A']+word['B']) if not v<=e[1]<2*v] +assert [e[:-1] for e in cleanup]==[e[:-1] for e in word['cleanup']] +program=word['precondition']+comp+main+cleanup +actual=ident() +for e in program:apply(e,actual) +expected=ident() +for t in range(v):expected[v+t][t]=Q(1) +assert actual==expected +print('PASS exact arbitrary dirt and restored sources/helpers',flush=True) +back=ident() +for e in program:apply(dual(e),back) +expected_back=ident() +for t in range(v):expected_back[t][v+t]=Q(-1) +assert back==expected_back +print('PASS exact inverse-transpose on every column',flush=True) +# Independent sparse vector controls avoid repeating a dense full replay. +def vector(es,x): + x=list(map(Q,x)) + for e in es: + if e[0]=='scale':x[e[1]]*=Q(e[2],e[3]) + else:x[e[1]]+=Q(e[3],e[4])*x[e[2]] + return x +sample=[((i*137+13)%101)-50 for i in range(n)] +want=vector(program,sample) +controls={ + 'missing_dirty_compensation':word['precondition']+main+cleanup, + 'missing_Y_inverse_basis':comp+main+cleanup, + 'missing_source_cleanup':word['precondition']+comp+main, + 'wrong_dual_event_order':[dual(e) for e in reversed(program)], +} +for name,es in controls.items(): + expected_sample=vector([dual(e) for e in program],sample) if name=='wrong_dual_event_order' else want + assert vector(es,sample)!=expected_sample,name + +# Orthogonal transvection and a port permutation bring the new geometry onto +# the already fixed 120-port routing family. Every incidence is transformed. +old=json.load(gzip.open('work/higher-stage-e8/verified/gcert1-e8-retimed.json.gz')) +def tau(x):return x^(43 if (x&43).bit_count()%2 else 0) +assert 43 .bit_count()%2==0 +assert set(map(tau,word['ports']))==set(old['ports']) +mapping={i:old['ports'].index(tau(q)) for i,q in enumerate(word['ports'])} +mapping.update({v+i:v+mapping[i] for i in range(v)}) +mapping.update({r:r for r in range(2*v,n)}) +def basis(vs): + b={} + for x in vs: + for k in sorted(b,reverse=True): + if x>>k&1:x^=b[k] + if x: + k=x.bit_length()-1 + for j in b: + if b[j]>>k&1:b[j]^=x + b[k]=x + return tuple(b[k] for k in sorted(b,reverse=True)) +def perp(x):return basis([z for z in range(1,512) if not (x&z).bit_count()%2]) +full=tuple(1<0 + edges.add((old,f));paid[delta]+=1;cur[r]=f +for part in ('A','B'): + if part=='B': + assert all(cur[r]==f for r,f in zip(can['centers'],can['center_frames'])) + assert all(cur[r]==0 for r in range(v,2*v)) + for f in can['center_frames']:paid[len(frames[f])]+=1 + for e in can[part]: + rs=[e[1]]+([e[2]] if e[0]=='add' else []) + for r in rs:climb(r,e[-1]);incidences+=1 +for r,f in enumerate(can['final']):climb(r,f) +assert dict(paid)=={int(r):x for r,x in word['report']['local_profile'].items()} +assert sum(r*x for r,x in paid.items())==9*can['R']+240*8+72 +can['local_profile']=dict(sorted(paid.items()));can['edges']=sorted(edges) +cp=OUT/'CANONICAL-WORD.json.gz';cp.write_bytes(gzip.compress(json.dumps(can,sort_keys=True,separators=(',',':')).encode(),mtime=0)) + +def engine(name): + p=Path('work/pr361/code/engines')/(name+'.py');s=importlib.util.spec_from_file_location('hamming_'+name,p) + m=importlib.util.module_from_spec(s);s.loader.exec_module(m);return m +M,M2=engine('moment'),engine('base_two_moment');m,W=73,12720 +HG={int(r):z for r,z in word['report']['global_profile'].items()} +root=M.certify(HG,m,W,True);b=Q(int(Q(root['lower'])*10**18),10**18);grid=Q(1,10**18) +assert M.moment(HG,m,W,b,True)[1]<1>p&1:x^=b[p] + if x: + p=x.bit_length()-1 + for q in b: + if b[q]>>p&1:b[q]^=x + b[p]=x + return tuple(b[p] for p in sorted(b,reverse=True)) +def inside(a,b):return basis(a+b)==b +def hyper(p):return basis([x for x in range(1,512) if (x&p).bit_count()%2==0]) +FULL=basis([1<>p&1:x^=b[p] + if x: + p=x.bit_length()-1 + for q in b: + if b[q]>>p&1:b[q]^=x + b[p]=x + return tuple(b[p] for p in sorted(b,reverse=True)) +def dual(e): + e=list(e) + if e[0]=='add':e[1],e[2]=e[2],e[1];e[3]*=-1 + else:e[2],e[3]=e[3],e[2] + return e +def scalar(e,back): + e=dual(e) if back else list(e) + if e[0]=='add':return ['add',['L',e[1]],['L',e[2]],e[3],e[4]] + return ['scale',['L',e[1]],e[2],e[3]] +def primitive_bound(e): + if e[0] in ('clear','copy'):return 1 + q=Q(e[3],e[4]) if e[0]=='add' else Q(e[2],e[3]) + a,b=abs(q.numerator),q.denominator + assert b&(b-1)==0 + if e[0]=='scale': + assert a&(a-1)==0 + return abs(a.bit_length()-b.bit_length())+int(q<0) + # Exact binary Horner multiplication on a cleared private stream, repeated + # halving, signed accumulation into the target, then clear the private stream. + return 3+(a.bit_length()-1)+a.bit_count()+(b.bit_length()-1) + +def emit(back): + out=[];cur=c['start'].copy() + def event(e):out.append(e) + def scal(e,f):event(['scalar',e,f]) + event(['phase','zero_frame_precondition']) + for e in c['precondition']+c['compensation']: + regs=[e[1]]+([e[2]] if e[0]=='add' else []) + assert all(c['start'][r]==0 for r in regs) + scal(scalar(e,back),0) + event(['phase','entry_adapters']) + for r,f in enumerate(c['start']):event(['adapter','old_to_new',r,f]) + def climb(r,f,part): + old=cur[r] + if old==f:return + assert basis(frames[old]+frames[f])==tuple(frames[f]) + rank=len(frames[f])-len(frames[old]);assert rank>0 + event(['climb',part,r,old,f,rank]);cur[r]=f + for part in ('A','centers','B','final'): + event(['phase',part]) + if part in ('A','B'): + for e in c[part]: + regs=[e[1]]+([e[2]] if e[0]=='add' else []) + for r in regs:climb(r,e[-1],part) + scal(scalar(e,back),e[-1]) + elif part=='centers': + assert all(cur[r]==0 for r in range(v,2*v)) + for k,r in enumerate(c['centers']): + cf=c['center_frames'][k];rank=len(frames[cf]);assert cur[r]==cf + C=['C',k];scal(['clear',C],0 if back else cf) + terms=[e for e in c['cut'] if e[2]==r] + if back: + for e in terms:scal(['add',C,['L',e[1]],e[3],e[4]],0) + else:scal(['copy',C,['L',r]],cf) + event(['center',k,0 if back else cf,cf if back else 0,rank]) + if back:scal(['add',['L',r],C,-1,1],cf) + else: + for e in terms:scal(['add',['L',e[1]],C,e[3],e[4]],0) + scal(['clear',C],cf if back else 0) + else: + for r,f in enumerate(c['final']):climb(r,f,part) + event(['phase','exit_adapters']) + for r,f in enumerate(c['final']):event(['adapter','new_to_old',r,f]) + event(['phase','full_frame_cleanup']) + for e in c['cleanup']: + regs=[e[1]]+([e[2]] if e[0]=='add' else []) + assert all(c['final'][r]==1 for r in regs) + scal(scalar(e,back),1) + event(['phase','done']) + return out + +def check_local(events,back): + # Literal scalar replay of the emitted stream, including center lifetimes. + state={('L',r):{r:Q(1)} for r in range(n)};live=[];paid=Counter();prims=0;macros=0 + for e in events: + if e[0]=='climb':assert not live;paid[e[5]]+=1 + elif e[0]=='center':assert live==[e[1]];paid[e[4]]+=1 + elif e[0]=='scalar': + op=e[1];tag=op[0];t=tuple(op[1]);macros+=1;prims+=2*primitive_bound(op) + if tag=='clear': + state[t]={} + if t[0]=='C' and t[1] in live:live.remove(t[1]) + elif tag=='copy':state[t]=dict(state.get(tuple(op[2]),{}));live.append(t[1]) + elif tag=='scale':state[t]={j:Q(op[2],op[3])*x for j,x in state[t].items()} + else: + s=tuple(op[2]);q=Q(op[3],op[4]);row=state.setdefault(t,{}) + if t[0]=='C' and t[1] not in live:live.append(t[1]) + for j,x in list(state.get(s,{}).items()): + z=row.get(j,Q(0))+q*x + if z:row[j]=z + else:row.pop(j,None) + assert not live and all(not row for r,row in state.items() if r[0]=='C') + for r in range(n): + expected={r:Q(1)} + if back and r2*maxchild**depth +assert local_bound<1<<48 and logical<1<<6050 and router0 + bound=max(math.ceil(36/gap**2),math.ceil(2*(4+512)/gap)) + assert bound*gap**2>=36 and bound*gap>=2*(4+512) + cutoffs.append(str(bound));chain.append(z) +bridge={'semantic':{'C0':{'base':2,'exponent':210000},'strict_literal_gap':1}, + 'rows':{'degree_gap':Q(10**6)-Q(51*20161,25)}} +q=chain[-1]*(1-2*eta);ticks=(1-eta)*q/(1+q)/grid;kap=Q((ticks.numerator-1)//ticks.denominator,10**18) +assembly=Outer.assembly(chain[-1],b,bridge,kap,eta=eta,beta=beta) +try:Outer.assembly(chain[-1],b,bridge,kap+grid,eta=eta,beta=beta) +except AssertionError:pass +else:raise AssertionError('next kappa grid accepted') +result={'status':'PASS_NEW_STRUCTURAL_PROGRAM_AND_FINITE_ASSEMBLY_PENDING_REPLAY', + 'canonical_word_sha256':sha(cp),'scalar_audit_sha256':sha(OUT/'SCALAR-FRAME-AUDIT.json'), + 'exact_phase_receipt_sha256':sha(OUT/'CLIFFORD-REVIEW.json'),'global_template_sha256':hashlib.sha256(blob).hexdigest(), + 'local_program_checks':checks,'R':R,'m':m,'live':W,'physical':physical, + 'bank_assignments':len(assignments),'rank_mass':mass,'deficit':2496, + 'global_profile':dict(sorted(paid.items())),'emitted_local_events_all_calls':event_count, + 'finite_invoice':{'local_primitive_bound':local_bound,'local_adapters':adapters, + 'pervertex':pervertex,'physical_stock_bits':stock.bit_length(), + 'router_bits':router.bit_length(),'literal_bits':literal.bit_length(), + 'physical_row_coefficient':row,'retained_row_coefficient':20161, + 'compiler':compiler,'G_exponent':30000,'E_exponent':100000,'C0_exponent':210000, + 'required_C0_bits':(32*m*BB*BB).bit_length(),'halving_degree':depth, + 'halving_integer_inequality':[m**depth,2*maxchild**depth]}, + 'complex_b':str(b),'bit_c':str(bit),'prospective_kappa':str(kap),'kappa_float':float(kap), + 'log2_kappa':math.log2(float(kap)), + 'kappa_gain_percent':float(100*(kap/Q(998390813251625,10**18)-1)), + 'strict_outer_constraints':{name:str(z) for name,z in assembly['strict_constraints'].items()}, + 'next_kappa_grid_rejected':True,'bootstrap_cutoffs_log2':cutoffs, + 'scope':'New finite scalar interface with a written conjugation proof, conditional on inherited all-size compiler, precision/tape and analytic transfer. Independent emitted-program replay and fresh package replay still required before final promotion.'} +(OUT/'INTEGRATION.json').write_text(json.dumps(result,indent=2)+'\n') +print('PASS prospective kappa',float(kap),'gain',result['kappa_gain_percent'],'percent',flush=True) diff --git a/research/split-centres-global/code/complex_phases.py b/research/split-centres-global/code/complex_phases.py new file mode 100644 index 0000000000..88d6afa045 --- /dev/null +++ b/research/split-centres-global/code/complex_phases.py @@ -0,0 +1,24 @@ +"""Bind unchanged exact phase evidence, or regenerate all selected phase pairs.""" +import gzip,hashlib,json,os,subprocess,sys +from pathlib import Path +P=Path(__file__).resolve().parent.parent;O=Path('split-centres') +def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest() +c=json.load(gzip.open(O/'CANONICAL-WORD.json.gz')) +r=json.loads((P/'inputs/complex-phase-receipt.json').read_text()) +raw=gzip.decompress((P/'inputs/complex-phase-recipes.json.gz').read_bytes());recipes=json.loads(raw) +# Bind the exact decoded witness, independently of gzip implementation metadata. +assert hashlib.sha256(gzip.decompress((O/'CANONICAL-WORD.json.gz').read_bytes())).hexdigest()==r['canonical_word_payload_sha256'] +r['canonical_word_sha256']=sha(O/'CANONICAL-WORD.json.gz') +assert hashlib.sha256(raw).hexdigest()==r['recipe_sha256'] +edges=set(map(tuple,c['edges']))|{(a,b) for f in c['center_frames'] for a,b in ((f,0),(0,f))} +assert {(z['old'],z['new']) for z in recipes['children']}==edges +assert len(recipes['children'])==len(edges) and len(recipes['endpoint_adapters'])==240 +for z in recipes['children']:assert z['rank']==abs(len(c['frames'][z['old']])-len(c['frames'][z['new']])) +if os.environ.get('E8_REPLAY_PHASES')=='1': + subprocess.run([sys.executable,'-B',str(P/'code/complex_phases_full.py')],check=True) + assert (O/'CLIFFORD-RECIPES.json').read_bytes()==raw +else: + (O/'CLIFFORD-RECIPES.json').write_bytes(raw) + r['validation_mode']='Reuse exact phase evidence bound to the unchanged canonical word and recipe hashes' + (O/'CLIFFORD-REVIEW.json').write_text(json.dumps(r,indent=2)+'\n') +print('PASS source-bound phase recipes',len(edges)) diff --git a/research/split-centres-global/code/complex_phases_full.py b/research/split-centres-global/code/complex_phases_full.py new file mode 100644 index 0000000000..b5a5bd64b4 --- /dev/null +++ b/research/split-centres-global/code/complex_phases_full.py @@ -0,0 +1,39 @@ +# Adapted from PR425 for heterogeneous centres by icekylinx with Codex assistance. +"""Exact phase-aware lowering of every used edge of the new structural word.""" +import gzip,hashlib,json,sys,time +from collections import Counter +from pathlib import Path +sys.path.insert(0,str(Path('work/odd-stages').resolve())) +from clifford_exact import * + +OUT=Path('split-centres');P=OUT/'CANONICAL-WORD.json.gz' +c=json.load(gzip.open(P));n=c['h'];frames=c['frames'];start=time.monotonic();ops=[] +for U in frames: + op=canonical_frame(n,U) + L=[u|(u<>(y.bit_length()-1)&1:x^=y + if x:return False + return True +def local(events,back): + rows={('L',r):{r:Q(1)} for r in range(n)} + norm={('L',r):Q(1) for r in range(n)};prefix=Q(1);cur=c['start'].copy();private={} + hist=Counter();phases=[];entry=[];exit=[];centers=[];matrix_hash=hashlib.sha256() + allowed=['zero_frame_precondition','entry_adapters','A','centers','B','final','exit_adapters','full_frame_cleanup','done'] + for event in events: + tag=event[0] + if tag=='phase': + phases.append(event[1]);assert phases==allowed[:len(phases)] + if event[1]=='A':assert entry==list(enumerate(c['start'])) + if event[1]=='centers':assert all(cur[r]==0 for r in range(v,2*v)) + if event[1]=='full_frame_cleanup':assert cur==c['final'] and exit==list(enumerate(c['final'])) + assert not private + elif tag=='adapter': + assert event[3]==(c['start'] if event[1]=='old_to_new' else c['final'])[event[2]] + (entry if event[1]=='old_to_new' else exit).append((event[2],event[3])) + elif tag=='climb': + _,part,r,a,b,rank=event + assert not private and phases[-1]==part and cur[r]==a + assert contains(frames[a],frames[b]) and rank==len(frames[b])-len(frames[a])>0 + hist[rank]+=1;cur[r]=b + elif tag=='center': + _,k,a,b,rank=event + assert phases[-1]=='centers' and private=={('C',k):a} + cf=c['center_frames'][k];cr=len(frames[cf]) + assert (a,b,rank)==((0,cf,cr) if back else (cf,0,cr)) + private['C',k]=b;hist[rank]+=1;centers.append(k) + elif tag=='scalar': + _,e,f=event;op=e[0];target=tuple(e[1]);source=tuple(e[2]) if op in ('copy','add') else None + if target[0]=='C' and op=='clear': + assert private.get(target,f)==f + private.pop(target,None) + else: + for r in (target,source): + if r is None:continue + if r[0]=='L':assert cur[r[1]]==f,('common frame',r,cur[r[1]],f) + else: + if r==target and r not in private:private[r]=f + assert private[r]==f + if op=='clear':rows[target]={};norm[target]=Q(0) + elif op=='copy':rows[target]=dict(rows[source]);norm[target]=norm[source] + elif op=='scale': + q=Q(e[2],e[3]);a,b=abs(q.numerator),q.denominator + assert a&(a-1)==0 and b&(b-1)==0 + rows[target]={j:q*x for j,x in rows[target].items()};norm[target]*=abs(q) + else: + q=Q(e[3],e[4]);a,b=abs(q.numerator),q.denominator + assert source!=target and b&(b-1)==0 + # Independent symbolic replay of the cleared coefficient work. + w=0 + for bit in bin(a)[2:]:w=2*w+int(bit) + assert Q(w,b)*(1 if q>0 else -1)==q + prefix=max(prefix,Q(a)*norm[source]) + norm[target]=norm.get(target,Q(0))+abs(q)*norm[source] + row=rows.setdefault(target,{}) + for j,x in list(rows[source].items()): + z=row.get(j,Q(0))+q*x + if z:row[j]=z + else:row.pop(j,None) + prefix=max(prefix,norm[target]) + else:raise AssertionError(tag) + assert phases==allowed and centers==list(range(len(c['centers']))) and not private + assert all(not row for reg,row in rows.items() if reg[0]=='C') + for r in range(n): + expected={r:Q(1)} + if back and r x + ((q+e_j).x)(q+e_j). Its remaining columns are an orthonormal basis +of q^perp. For s>0, rho_s,q exchanges that complement in the local block +with exterior block s and fixes q and all other exterior coordinates. +It is a symmetric orthogonal involution. The stage data owners are +g=d*rho_s,q, with rho_0,q=I, so the right factors are bijections of O(73,2). + +Use canonical data levels X_s=C_[0,9+8s), Y_s=X_s C_q^(-1), and initially +X_(-1)=C_q, Y_(-1)=I. The routed stage starts at level s-1 and ends at level s. +Their binary preimages agree with the window endpoints. Exact phase +polynomials determine the translation that reconciles each endpoint, and +the template applies that translation. There are 3840 nonzero such +translations across the 120 port types and nine stages, before replica +multiplicity. These operators are not silently identified from equal +binary matrices. + +Four-pair scalar chain and idle children + +Starting with F_0 (Y_0 += X_0), for j=0,1,2,3 apply B_j (X_j -= Y_j), +then for j<3 apply X_j += X_(j+1), Y_(j+1) -= Y_j, apply F_j, and undo +that bridge. The last pair has B_3,F_3 without a following bridge. +Afterwards apply, in descending j=2,1,0, X_(j+1)+=X_j and Y_j-=Y_(j+1). +Finally exchange each pair by newX=oldY, newY=-oldX. The complete signed +integer scalar matrix is the identity; omission of every bridge fails. + +Before a bridge, advance the idle pair to the active pair's level. The +two advances for the newly used pairs have ranks (16,8), (32,8), (48,8). +The final advances have ranks 48,32,16,0. Each rank occurs on both members +of the pair, each of 120 ports, and each of eight replicas. A nested idle +transition is factored in the explicit orthonormal basis U_q direct_sum I. +Its exact Z4 phase is reconciled by the stored translation after that child. + +The final Y endpoint is C_all C_q^(-1). A source began at C_q, so its +unadjusted exchange route would be C_all C_q^(-2)=C_all X_q. Applying the +literal X_q to each final Y before the signed exchange removes this factor. +The corresponding 120 omission controls fail. This correction is charged. + +Banks and arbitrary correlated dirt + +There are eight replicas of each of the four data pairs, hence 7680 data +families. Each stage has 783 independent bank families. Number a local +helper occurrence by z=783*replica+helper. It uses bank floor(z/8) and slot +z mod 8, with its nine-dimensional residual assigned to coordinates +[9*slot,9*slot+9). A paid coordinate C child at coordinate 72 completes +each bank. All eight whole residuals and this padding fill dimension 73. +Thus there are 9*783=7047 bank families and live stock 14727. + +Let Pi_slot swap the first nine coordinates with the assigned block. The +local invocation at class d uses the bank class g=d*Pi_slot^(-1). Its +residual at that owner is P_g C_block P_g^(-1). Right multiplication is a +bijection. Local helpers sharing one bank have distinct slots, hence +different right factors and different actual bank classes for every d. +All data and private families are disjoint from banks. The checker verifies +these injections for all 72 invocation/replica templates and 56376 residual +assignments. A complete cover sweep for one replica finishes before the +next begins. The local dirty invocation is block diagonal on helpers at +its endpoint and permits arbitrary correlated helper values. Therefore +overlap between different invocations does not impose a cleanliness or +independence assumption. At each bank class, the eight residuals and the +padding are coordinate factors in one common conjugated basis, and their +exact product is P_g C_all P_g^(-1). + +One more exact correction is essential. Orthogonality alone does not imply +that P_g commutes with C_all as an exact operator. In fact + P_g C_all P_g^(-1) = C_all X_delta(g), + delta(g)_i = (weight(row_i(g))-1)/2 mod 2. +The quadratic terms cancel by row orthogonality and the remaining even +linear terms give the displayed translation. Both sides fix the uniform +vector, fixing the global scalar. Apply X_delta(g) to EVERY final live +family in cover class g, after the bank padding and signed data exchange. +The template includes and charges all 14727 corrections per cover. This +identity is also checked on every orthogonal matrix in dimensions 1..5. + +Finite work and recurrence charges + +The source emitter is regenerated and revalidated in both orientations. +It accounts for 1242936 local events over 72 invocations, with all copied +center and dirty-tableau lifetimes intact. Forward and backward scalar +words freshly replay all 1023 independent dirty live columns. Only the +private work starts at zero. Work comprises 783 tableau streams, nine +reserved center streams (eight used), and one coefficient stream. Each +invocation completes and erases its private work before the next. Physical +stock is therefore 15520 per cover; scalar-only work is excluded from the +recursion-volume denominator. + +GLOBAL-REVIEW.json records the complete recomputed finite overcharge, with +64*(73+1)^3 compiler groups per rank-zero adapter, source-counted scalar +primitives, and overcharges for all data routes, bank selectors, phases, +padding, bridges, exchanges and cover corrections. The O(73,2) order is +2^(36^2)*product(2^(2i)-1,i=1..36); its bit length is 2628. The recomputed +router fits 2^30000, the literal charge fits 2^100000, and the precision +guard fits C0=2^210000. No even-dimensional orthogonal-order formula is used. + +Largest child 48 does not satisfy one-layer halving. Instead +73^2=5329>2*48^2=4608, so two nested children have width strictly below +half the parent, including floors. The general depth is bounded by +2*ceil(log2 e), with direct small leaves. For B=s+E the completed-child +semantic induction has 2B(73-48)-s-E=49B>0. The resulting conservative +complete-row coefficient is 2*2642+9909+252=15445<20161, retaining the +external bit/base-row allowance as an explicit interface assumption. +The inherited bad-branch envelope is priced conservatively as before. + +Two independent rational moment engines admit +b=999240641319551/10^18 and exclude b+10^-18 for the source-bound profile. +The rank mass is 1072575, and 73*14727-1072575=2496=8*(8*120-9*72). +This complex component exceeds 1/1024 but does not improve the current +bit bottleneck. No improved final kappa or completed PR milestone follows. diff --git a/research/split-centres-global/proofs/PR386-BIT-GEOMETRY.txt b/research/split-centres-global/proofs/PR386-BIT-GEOMETRY.txt new file mode 100644 index 0000000000..31efe31268 --- /dev/null +++ b/research/split-centres-global/proofs/PR386-BIT-GEOMETRY.txt @@ -0,0 +1,191 @@ +Compressed nine-stage E8 bit supplier and combined conditional bound + +Claim and source assumptions + +The conditional combined value is + kappa = 998243154231047 / 10^18 = 0.000998243154231047 > 1/1024. +It is approximately 2^-9.9683211064. This is a conditional finite construction +in the inherited supplier framework, not a Lean proof of integer multiplication. +No priority claim is made. + +The E8 bit word, its 120 root lines, all 865 helpers, and nine retained totals +are taken without modification from Dylan Crow's PR #370, commit +b7fe9cdf2da009c947ff6b334c562bc190b30373. Its raw word has SHA256 +1fb726ea3818fe0837cceb0dd22a71a0814f064e5e781628104610d6468e0e55. +The original verification is rerun, including regeneration, independent +1105-column F2 checking, official record legality/formal columns, all-frame +Gram and prime witnesses, negative controls, and the original regression set. +Its five-stage c is 904072820242522/10^18, insufficient by itself for -10. + +The complex supplier is the separately reconstructed compressed nine-stage +component from PR #377, with b = 999240641319551/10^18. Its complete source, +notices, exact Clifford and Z4 phase checks, global template and finite bill +remain included. In particular, its terminal X_q and every-live-family +X_delta(g) corrections are retained; equality of binary matrices is not +substituted for equality of complex operators. + +The inherited all-size weighted bit compiler, tape/prime/precision and +analytic transfer interfaces remain conditional. PR #370's explicit admission +of nine copied totals at h=8 is retained. The complex local E8 theorem, +Clifford compiler, common fine-grid, restored-row and analytic interfaces +remain conditional exactly as stated in the companion component. The new +window, banking and two-level finite charges are described below rather +than inferred from a rank histogram. + +Exact bit operators and compressed ambient space + +Over an admitted odd address field, the E8 form is G=I_8/2. For a nondegenerate +subspace U, write P_U for its orthogonal projector. On the doubled address +space define + D_U = [[I-P_U, P_U], [P_U, I-P_U]]. +Thus D_U is an exact involution. If U is contained in V then +D_V D_U = D_(V intersect U-perp), with rank dim(V)-dim(U). Also + D_I D_P = D_(I-P). +These are literal address matrices. Unlike the complex C operators, they +have no hidden scalar phase. The auditor reconstructs all 944 rational +projectors and checks all 3289 used nested pairs, in both orientations. + +Set V_global = Q^8 direct_sum (Q^7)^8, m=64, with form I_64/2. +Let E_s be the first s exterior 7-blocks, s=0,...,8. At stage s lift the +entire local word by replacing U with U direct_sum E_s. Both ends of every +local transition contain the same E_s, so it cancels exactly; the child +projector and rank are unchanged. This holds for copied totals as well: +the temporary transforms between the source and scatter frames, whose +common E_s cancels. COPY/ERASE windows remain sequential and immutable. +No assumption that m is a multiple of 9h is used. + +Port routes + +The reference root is q*=2e_0. For every root q, the checked product g_q +of at most two E8 root reflections sends q* to plus or minus q. Let A_q be +its last seven columns. They form an orthonormal basis of q-perp: + A_q^T A_q=I_7, A_q A_q^T=I_8-P_q, P_q=q q^T/4. +For stage s>0 use, on the local block and exterior block s, + rho_(s,q) = [[P_q, A_q], [A_q^T, 0]], +and fix all other coordinates. For s=0 use the identity. These matrices +are orthogonal involutions. Conjugating the lifted endpoints gives + (P_q,E_s) -> (I_8,E_(s-1)), (I_8,E_s) -> (I_8,E_s), + (0,E_s) -> (I_8-P_q,E_(s-1)), + (I_8-P_q,E_s) -> (I_8-P_q,E_s). +These equalities are checked as exact rational matrices for every port. +Each nontrivial route has a replayed elementary factorization, at most +77 factors, with denominators 1,2,4. Omitting a factor fails. Thus all +routes remain defined at every odd address prime; there is no new odd +exceptional prime. The existing local prime witnesses are rerun separately. + +Nine-stage scalar recipe and deferred endpoint completion + +Use four data pairs (X_j,Y_j). Start with F_0: Y_0 += X_0. For j=0,...,3, +apply B_j: X_j -= Y_j; when j<3 insert the two shears + X_j += X_(j+1), Y_(j+1) -= Y_j; +apply F_j; then undo those two shears. After all stages, for j=2,1,0 apply + X_(j+1) += X_j, Y_j -= Y_(j+1). +Finally replace (X_j,Y_j) by (Y_j,-X_j). The complete signed integer +8-by-8 scalar matrix is the identity. Omitting any of the eighteen +individual bridge shears changes it. + +Each B_j is the reflected inverse of the actual local record stream: +reverse the order, negate ADD coefficients, replace U by U-perp, and +turn ERASE into a fresh COPY from the original unchanged center. No erase +is inverted. PR #370 stores zero in the ERASE rank field; the reflected +COPY rank is freshly derived from its two frames, giving rank 8. Both +oriented streams replay all 1105 independent input columns and close work. + +Before each bridge the newly used pair is advanced to the active level. +The two idle increments are (14,7), (28,7), (42,7). Endpoint completion of +the earlier pairs is deferred to the final stage, with ranks 42,28,14,0. +Every increment acts on both members of every port pair and every replica. +The schedule checker requires equal complete frames at every bridge. +The signed terminal exchange completes the data transform using the exact +identity D_I D_P=D_(I-P). Scalar replay on 8745 independent columns includes +960 data and 7785 separate stage-helper inputs. All are restored after +the exchange; the reflected copy work closes to zero. + +Whole-block banks and arbitrary correlated dirt + +Use eight replicas. There are 4*2*120*8=7680 data families. For each stage, +number a local helper occurrence by z=865*replica+helper, and assign it +to bank floor(z/8), slot z mod 8. There are 865 banks at each of nine +stages. Each slot is one whole 8-dimensional coordinate block in Q^64. +The eight slots are mutually perpendicular and fill the ambient space; +no padding child is needed. Live recursion stock is 7680+9*865=15465. +Nine private center slots are reserved and excluded from recursion volume, +so charged physical stock is 15474. Only one such slot is used at a time. + +Let Pi_slot exchange the first eight coordinates with its bank block. +For a cover class d in O(I_64/2,F_q), the helper owner is the bank class +g=d Pi_slot^-1, and a data owner is d rho_(s,q). Right multiplication is a +bijection of the finite cover. Within every local invocation, helpers in +the same bank have different slots, hence different actual cover classes; +all data and work families are disjoint from banks. All 62280 assignments +are checked, and every physical bank receives each of its eight slots once. + +The local all-column theorem permits arbitrary helper inputs, including +correlations created by earlier invocations. After its endpoint each helper +has only the known residual D_H. The common E_s cancels, so no cleanliness +assumption is imposed by a previous bank action. Complete cover sweeps run +sequentially. At a fixed bank owner g the residuals are D on the eight +orthogonal coordinate blocks conjugated by g. They commute and multiply +to D_I. Since diag(g,g) commutes with the literal head/tail exchange D_I, +no complex-style cover phase correction is needed on the bit side. +This is a symbolic finite cover proof, not an enumeration of O(64,F_q). + +Actual emitted ledger + +The source-bound template emits 72 local invocations and 1355328 events. +All local COPY/ERASE and helper lifetimes are rechecked. Its paid profile is + 1:149472, 2:67824, 3:32256, 4:30096, 5:22176, 6:144, + 7:5760, 8:1296, 14:3840, 28:3840, 42:3840. +There are 320544 paid children, rank mass 987264 and deficit + 64*15465-987264 = 2496 = 8*(8*120-9*72). +The independent auditor recomputes the profile from the emitted template +and rejects missing idle/bridge/exchange/invocation events, bank-slot aliasing, +understated stock, a missing local MOVE and a wrong reflected COPY charge. + +Finite cost, precision allowance and two-level halving + +The largest child is 42, so one-level halving is false. Two levels suffice: + 2*42^2=3528 < 64^2=4096. +Floors only reduce descendant widths. The exact one-level moment, including +the inherited 10^-16 bad-branch envelope, is strictly below one; composing +two levels squares this contraction. The finite composite may be used with +the inherited halving-based compiler and direct small leaves. + +The old five-stage 104-bit payload-prefix guard is not reused. Fresh local +cancellation-free row bounds are 742 forward and 6308 reverse. For five +forward calls, four reflected calls and eighteen bridge shears, the bound + 2^18 * 742^5 * 6308^4 +has 117 bits. We explicitly charge 192 bits per nine-stage block. The actual +source operations, copy episodes, 77-factor routes, selectors, all owner +adapters and this prefix bound enter certify.py's finite coefficient. It +has 117 bits; the charged two-level coefficient has 269 bits and is bounded +by 2^512. This deliberately increases the finite cutoff, rather than passing +the old 104-bit assertion. The exact three bootstrap cutoff inequalities +are checked using the changed coefficient. + +For cover/routing enumeration use the inherited coarse q^(m^2+1) bound; +two levels and the retained additive row charges give + 2*(64^2+1)+9909+252 = 18355 < 20161. +The explicit rational bit routes introduce only powers of two. The new +finite constants fit well below the companion bridge's 2^30000 reserve, +and the common external C0=2^210000 and row allowance 20161 are retained. +As for the companion complex component, the general compiler/common-grid +interfaces are assumptions; no new Lean formalization is asserted. + +Exact price and combined assembly + +Two independent rational moment engines, both with the 10^-16 envelope, +admit c=1057833103534317/10^18 and reject c+10^-18. The complex supplier +therefore binds. With eta=10^-12 and beta=10^-9 choose + s=999240640320309/10^18 < (1-beta)*b < c. +Start a0=384599/10^10 and apply a_(j+1)=(1-s)s+s*a_j three times. The retained +outer assembly at (a3,b) admits kappa=998243154231047/10^18. All 47 strict +constraints are positive; the next 10^-18 kappa grid point is rejected. +The strict excess over 1/1024 is 21680654231047/10^18. Final kappa is about +24.0286% above frozen #361, within the explicitly retained assumptions. + +Attribution: Dylan Crow / Anthropic Claude for PR #370's new local bit word; +Jacob Sussman for E8 and the complex unit; the inherited source527, PR234, +PR266, PR315, PR346, PR352 and PR363 contributors as listed in the preserved +notices; Zhihao Chen with OpenAI Codex assistance for this compressed bit +composition, its independent audit, and the combined nine-stage package. diff --git a/research/split-centres-global/proofs/PR425-COMPLEX.txt b/research/split-centres-global/proofs/PR425-COMPLEX.txt new file mode 100644 index 0000000000..41061757ce --- /dev/null +++ b/research/split-centres-global/proofs/PR425-COMPLEX.txt @@ -0,0 +1,211 @@ +Hamming packets with mutable source and target bases +Conditional finite extension of the complex E8 supplier + +1. What is new + +The old r783 word keeps source values fixed and does not read target registers. +Those are sufficient restrictions on a scalar word, not necessary conditions +for a common-frame linear program. The new word uses 680 helper registers: + + * source registers themselves carry one branch of a simultaneous signed + packet computation; + * retired packet registers retain a full source basis, from which the eight + central coordinate sums are reconstructed; + * 56 pairs of targets carry a first two-output butterfly, with its input + basis explicitly compensated at frame zero and in the center decoder; + * an exact inverse on all source/helper registers is executed at their + common full frame after the last recursive climb. + +No recursive work is deleted from the ledger. A helper is counted for its +entire lifetime, including unused final climbs. All 120 sources and targets +retain their original line/full and zero/hyperplane endpoint ranks. + +The new local histogram is + {1:2248, 2:896, 3:168, 4:336, 5:392, 8:24, 9:8}. +Its rank mass is 9*680 + 240*8 + 72 = 8112. There are 4072 local children. +There are more local children than in the old r783 word, but substantially +less helper rank mass; the complete moment, not a count proxy, decides gain. + +2. Exact Hamming geometry and signed packet algebra + +Use the pinned PR370 table of 120 E8 root lines in Construction-A coordinates: +eight coordinate lines 2e_i and 112 sign lines on the 14 weight-four Hamming +blocks. For integer representatives r_s, let G_st = r_s dot r_t / 2. +The matrix C_st = 1 + G_st mod 2 has binary rank nine. The construction gives +an explicit orthonormal realization p_s in F_2^9 with + + p_s dot p_t = C_st, and p_s dot p_s = 1. + +Consequently the nonzero off-diagonal entries of G/2 occur only where a source +line lies in the target hyperplane. The rank-eight central factorization is + + (G/2)_ts = sum_i r_ti r_si / 4. + +For a source Hamming block d, a coordinate pair {i,j} in d, and epsilon=+-1, +define the signed face packet + + P(d,ij,epsilon) = sum_{s in d, r_si*r_sj=epsilon} r_si x_s. + +Each packet has four terms and its binary port span has rank three. Split +the eight sign lines of a block into its two parity tetrads. Each tetrad pair +occurs in two face packets with independent signed coefficient rows. The two +rows are formed simultaneously by two determinant-one shears, rather than +forming independent one-output sums. The packet factory uses its eight source +registers and sixteen additional helpers. Its twelve retired registers can +be oriented to retain a full rank-eight source basis. Exact elimination on +that stock produces four coordinate sums without allocating more helpers. + +This comparison of an individual factory is not a claim that the whole old +supplier used 48 helpers per block. The relevant complete counts are 783 and +680, both charged with their full actual profiles. + +For two target/source blocks whose intersection is {i,j}, the contribution +to target t is -r_ti P(d,ij,r_ti*r_tj)/2. The remaining within-block and +coordinate-line contributions are explicit four-output signed transforms. +Every one of the 14400 rational decoder entries is rechecked. Adding the +eight coordinate centers leaves precisely the identity matrix on sources. + +The binary transvection x -> x+(x dot 43)*43 is orthogonal because 43 has +even weight. It maps the constructed port set exactly to the old fixed E8 +port set. All frames and register indices are transported, so the old nine- +window data routes and their global phase correction apply to exactly the +same ordered ports, without introducing an unproved new covering geometry. + +3. General scalar-interface lemma + +Write z=(x,s) for the source and arbitrary dirty helper streams, and y for +the targets. Permit scalar additions and invertible dyadic scalings between +registers at the same current label. No target may feed a z register. The +raw A/center/B word therefore has block form + + z' = U z, + y' = V y + J x + K s, + +where U and V are invertible, and the retained-center operations are included +in J and K. The actual word has J=I after its adjusted center scatter. The +checks compute every coefficient over Q, rather than inferring it from a +desired sparsity pattern. + +At frame zero, before entry adapters or recursive children, execute + + y <- V^{-1} y - V^{-1} K s. + +Both y and s have label zero there. The code emits the literal inverse of +the 56 disjoint two-output target bases and a direct, charged dyadic old- +response matrix with 13216 additions. There is no uncharged oracle for K. +It is computed from the explicit scalar word and serialized. All coefficient +work is cleared immediately after its use. + +After the last main gate, finish every z register's climb to the full frame, +then execute U^{-1} by reversing and inverting the non-target gates. These +gates are legal at one common full frame, including helper-to-source gates. +The result is exactly + + (x,s,y) -> (x,s,y+x). + +The second orientation is the inverse transpose: negate and transpose every +addition and invert every scale in the SAME event order. Each retained +center is implemented by the transposed gather/child/scatter stream. The +result is (x,s,y) -> (x-y,s,y). Both orientations are replayed on all 920 +independent live columns, including all 680 arbitrary helper columns. +Missing compensation, missing output preconditioning, missing cleanup and +the wrong inverse-transpose order are rejected. + +Why the scalar argument lifts to exact complex labels: for each binary +subspace F use the exact canonical representative L(F). A climb from A to B +acts as L(B)L(A)^{-1}. If two registers share F, a scalar addition commutes +with their common L(F), as does a scalar scaling. Induction through the +actual stream therefore gives the block-diagonal conjugation of its scalar +matrix by the current labels. Center copies explicitly move from full to +zero, or zero to full in the other orientation. The preconditioner uses +only label-zero registers, and the z cleanup uses only full-label registers. +Thus the proof never moves a scalar operation across unequal labels or +identifies two frames merely because their ranks agree. + +Every used canonical frame, nested transition, center direction and endpoint +adapter is independently lowered by the exact Gaussian Clifford compiler. +Equalities include global phase. The old restricted gx gate-shape checker +is not used to admit this new interface; the stronger explicit matrix and +common-frame checks replace its source-immutability/target-read restrictions. +This is a written finite algebraic extension, not a new Lean theorem. + +4. Complete programs and work lifetimes + +Each orientation emits 27537 events, including startup, entry/exit adapters, +all recursive climbs, eight sequential center children, scalar operations +and final cleanup. Temporary centers are initialized, used and erased one +at a time. No center or coefficient work stream survives a live child. + +All added coefficients are dyadic. To apply a/2^j, compute |a| times the +source by binary Horner additions on a cleared private stream, halve j +times, accumulate with its sign, and clear the private stream. In-place +scales are signed powers of two. Every such primitive is charged. This +introduces no new denominator prime. Independent replay bounds the actual +cancellation-free prefix norms, including coefficient work; a 192-bit local +payload allowance is retained conservatively. + +5. Nine-window composition and finite bill + +Use the previously verified m=73 compressed nine-window geometry, four data +pairs, eight replicas, and the original signed bridges, idle children, +terminal exchange, terminal translations and full-cover phase correction. +The source scalar identity and its negative inverse-transpose are exactly +the two local interfaces consumed by that unchanged geometry. + +There are 680 whole-block banks per stage, each containing eight rank-nine +helper blocks plus one paid rank-one padding child. The live width is + + W = 240*4*8 + 9*680 = 13800. + +The conservative physical width is W+680+9+2=14491. The old-response matrix +uses no persistent tableau, but the old-size reserve is still charged. +The emitted owner table has 48960 distinct stage/replica/helper assignments. +The new global profile is + + {1:167976, 2:64512, 3:12096, 4:24192, 5:28224, + 8:7488, 9:576, 16:3840, 32:3840, 48:3840}. + +Its rank deficit is 73*13800 - sum(r*H_r) = 2496. The maximum child is 48, +and 73^2 > 2*48^2 supplies the same charged two-level halving argument. + +The finite bill is recomputed from the new scalar programs, bank owners, +work stock and adapter counts. It is not asserted unchanged. The local +primitive bound fits 2^48; the tape router fits 2^30000; the literal envelope +fits 2^100000; the precision envelope fits 2^210000. The physical row +coefficient is 15445, below the explicitly inherited external allowance +20161. Full-cover corrections apply to all 13800 live families. + +6. Conditional numerical conclusion and retained assumptions + +Two independent rational moment engines, with the inherited 10^-16 bad- +branch envelope, accept + + b = 1049104978040580 / 10^18 = 0.001049104978040580 + +and reject the next 10^-18 grid point. With the unchanged bit parameter +c=0.001057833103534317, three bootstrap steps and all 47 strict outer +conditions give the prospective finite-assembly value + + kappa = 1048005508028206 / 10^18 + = 0.001048005508028206, approximately 2^-9.898137985359. + +The finite statement is conditional on the same all-size weighted compiler, +common fine grid, restored-row/base allowance, tape/prime/precision and +analytic transfer interfaces as the retained nine-stage result. The new +scalar-interface lemma above and its serialized program are additional +reviewable material, not an appeal to gx accepting a program outside its +grammar. No unconditional integer-multiplication theorem is claimed. +The result is approximately +4.97% over the locally verified retimed bound, +and remains well short of 2^-9. A fresh extracted-package replay is required +by this research workflow before publication or final promotion. + +Attribution + +The root table and the motivation to use Hamming coordinates come from the +already pinned PR370 bit package (Dylan Crow, with Anthropic Claude assistance). +The E8 complex label family, original scalar word and gx interfaces are due +to Jacob Sussman. The retained complex admission, pricing and global analytic +interfaces are credited in the original package notices and PROOF.txt. +The mutable-basis packet word, transported geometry, expanded scalar proof, +new finite program and the present checks were developed in this local +research session by Zhihao Chen with OpenAI Codex assistance. diff --git a/research/split-centres-global/proofs/PR426.md b/research/split-centres-global/proofs/PR426.md new file mode 100644 index 0000000000..e589cfbf50 --- /dev/null +++ b/research/split-centres-global/proofs/PR426.md @@ -0,0 +1,108 @@ +# Construction, dependencies and sufficient argument + +The fixed complex witness starts from Chafik Boukhalfa's far-retimed E8 word +and applecrusher's two equal-helper substitutions and two frame refinements. +It additionally replaces helper 556 by -2 times helpers 354 and 461, then +helper 576 by -2 times helpers 402 and 478 after compaction. Exact clean +linear forms agree at every substituted read. The backward upper-frame and +forward nested repairs retain copied-total pins and final address caps. +R is 779. The actual new dirty response and cleanup are regenerated: equality +on clean values alone is not the arbitrary-dirt proof. + +The signed prefix restoration is the PR390/395 bracket. For 25 disjoint +targets, subtract lambda times the donor before the prefix, emit the exact +source/write-version/frame difference, and restore lambda times that donor +at the common recovery frame. Lambda is +1 or -1. The full rational main +operator and all retained totals agree with the explicit same-width R779 +baseline on all 1,019 independent columns. Source/helper subwords agree +exactly, so the new baseline's explicit dirty response and cleanup remain +valid. The changed compiler permits a main Y read only when its target is Y; +helper-to-X remains forbidden. Both signed orientations and private lifetimes +are freshly admitted, with all actual Clifford phases and physical incidences. + +The shared entrance construction follows PR401/404. Each pivot p satisfies +K_p + sum_d a_pd K_d = 0 in the explicit baseline response. Four re-pivots +from PR412 replace the basis of these same relations, including the +half-valued donor that otherwise fails the original sixths-denominator +condition. PR410 enlarges eight entrance subspaces. Removed original helpers +556 and 577 are mapped explicitly onto our R779 word. The shared layer has +192 pivots, rank mass 350, and 496 literal unit shears. Its pivots and donors +are disjoint, so this layer alone has (S-I)^2=0. + +PR409's four ordered groups, with PR412's two additional re-pivots, prepend +55 more shears and admit ten further pivots. The combined word has 202 +gauges of rank mass 360 and 551 entrance shears. The complete chronological +prefix need not have (S-I)^2=0. We check its actual product M S, all retained +totals, and that every gauged target-response column is zero. Every entrance +source is read before any earlier entrance operation writes it. + +Every one of the 551 omission controls is recomputed from the suffix +response. If shear t += q s is removed, its suffix response is multiplied +by -q times the original independent s column: earlier operations leave s +unchanged by the read-before-write condition. A nonzero response is required +for each omission; the entire changed scalar schedule is also replayed for +sampled omissions. No global donor/pivot disjointness is assumed here. Both +unchanged original gx.check1 and gxcore.mirror checkers pass, including the +native denominator conditions. Every actual nested transition is charged. + +PR376's additional target201/helper491 frame change from rank eight to seven +is checked for full operator equality and nested paid paths before gauging. +PR404's target125/124 overlapping-prefix recovery requires a different +chronological input and is not imported. Its numerical gain is not included. + +Each entrance chart is normalized explicitly. Even and degenerate E_p use +the full two-sided exact Clifford factorization of F T_E inverse. The right +inverse adapter precedes the entire old-response invocation; the left inverse +adapter follows all main and helper cleanup. Both orientations retain every +unitary address operator in the inverse-adjoint chronology. Rank-zero adapters +are costed. All old/new/reflected Gaussian child pairs are recomputed, +including Pauli signs and global phase. Newly assigned mixed-bank coordinate +permutations and inverse owners are emitted and independently decoded. +Padding is an exact fixed integer witness, not a claim of solver optimality. + +The new bit operation differs from the preceding all-dirt reset: a retired +helper only needs its clean X-content zeroed before a new logical helper is +placed in the same slot. An arbitrary residual helper value is allowed. The +new helper basis determines a newly computed initial D compensation. C is +the reversed helper subword, restoring every physical helper, including its +original independent dirt. Each reset is checked exactly before reuse; the +retired slot has no later original use, the new helper has no earlier use, +and copied totals are protected. The combined word is checked over every +independent binary column. It uses 55 fewer helpers (822 to 767). The initial 27 reuses and 26 frame +moves are followed by two fixed rounds of 14 reuses and 14 frame moves. +The later resets use exact two- or three-parent clean forms; every parent +and all rebuilt dirty compensation are charged and independently checked. Integer signed-prefix bounds, lifting, +copied-center controls, routes and whole-bank packing are recomputed rather +than inferred from the clean calculation. + +The complex assembly has dimension 73, 14,286 live and +15,075 physical families, 734 banks per stage, deficit 2,496, +maximum child rank 48 and halving degree two. The bit assembly has dimension +56, 10,409 live families, deficit 1,512 and halving degree two. Actual row +coefficients fit the common 20,161 reserve. Both finite invoices and both +exact rational moment engines retain the positive 10^-16 fallback. Adjacent +10^-24 complex coarse grid points are rejected; the unchanged bit coarse +grid remains 10^-18. The exact outer assembly uses positive eta=10^-24, +beta=10^-18, eight finite bootstrap continuations and a 10^-27 grid; it +checks 47 strict constraints and invalid eta/beta/adjacent-point controls. + +The complex coefficient is 254951444354246755323/250000000000000000000000. The bit coefficient is +104575879789097/100000000000000000. The resulting conditional kappa is 40750673324589432209923/40000000000000000000000000. +Using the preceding unchanged bit supplier with this same complex coefficient +gives 203354853562950029967497/200000000000000000000000000, where the bit side +binds. The new clean-reuse bit supplier removes that bottleneck. Its exact +additional kappa contribution is recorded as the difference from this fair +control; the combined witness is limited by the new complex coefficient. + +All original files are manifest-bound and immutable. A copied supplier tree +is changed only through asserted literal edits. DERIVATION.json records every +old/new digest, changed pin and textual difference. Both full predecessor +supplier suites run before the changed admission. Expected records are checked +after recomputation, rather than used to obtain a PASS. + +This is a sufficient finite conditional construction. The inherited all-size +recursive suppliers, canonical/rank-zero compiler, compressed Clifford windows, +dirty banking/cover, routing, restored-row, fixed tape, common-grid, Gaussian +precision/recovery and analytic interfaces remain assumptions. No new full +Lean theorem or unconditional integer-multiplication exponent is asserted. +The target kappa > 0.002 is not attained by this witness. diff --git a/research/split-centres-global/vendor/clifford_exact.py b/research/split-centres-global/vendor/clifford_exact.py new file mode 100644 index 0000000000..166841a037 --- /dev/null +++ b/research/split-centres-global/vendor/clifford_exact.py @@ -0,0 +1,149 @@ +"""Small exact Gaussian-dyadic Clifford compiler, independent of gx internals. +Paulis use i^p X^x Z^z. State vectors use integer Gaussian numerators / 2^d. +The tableau is supplemented by a literal circuit, so global phases are kept. +""" +from dataclasses import dataclass + +def parity(x):return x.bit_count()&1 +def rank(rows): + p={} + for x in rows: + while x: + b=x.bit_length()-1 + if b not in p:p[b]=x;break + x^=p[b] + return len(p) +def transpose(rows,n):return tuple(sum(((rows[j]>>i)&1)<>j&1);a[j],a[k]=a[k],a[j] + for i in range(n): + if i!=j and a[i]>>j&1:a[i]^=a[j] + assert [r&((1<>n for r in a) +def basis_extend(cols,n): + out=[] + for x in list(cols)+[1<len(out):out.append(x) + assert len(out)==n + return tuple(out) +def nullspace(rows,n): + a=list(rows);p=[];k=0 + for j in range(n): + t=next((i for i in range(k,len(a)) if a[i]>>j&1),None) + if t is None:continue + a[t],a[k]=a[k],a[t] + for i in range(len(a)): + if i!=k and a[i]>>j&1:a[i]^=a[k] + p.append(j);k+=1 + return tuple((1<>j)&1)<>i&1:out=pmul(out,T[i]) + for i in range(n): + if z>>i&1:out=pmul(out,T[n+i]) + return out +def compose(A,B):return tuple(apply(A,p) for p in B) +def inverse(T): + n=len(T)//2;cols=[x|(z<>n;u,v,p=apply(T,(x,z,0));assert (u,v)==identity(n)[j][:2];out.append((x,z,(-p)%4)) + return tuple(out) +def qvalue(Q,alpha,x,n): + return (sum(alpha[i] for i in range(n) if x>>i&1)+2*sum(parity((Q[i]>>(i+1))&(x>>(i+1))) for i in range(n) if x>>i&1))%4 +def mul_i(a,p): + x,y=a;p%=4 + return [(x,y),(-y,x),(-x,-y),(y,-x)][p] +@dataclass +class Op: + n:int + tab:tuple + circuit:list + def then(self,b): + assert self.n==b.n + return Op(self.n,compose(b.tab,self.tab),self.circuit+b.circuit) + def adjoint(self): + circ=[] + for e in reversed(self.circuit): + if e[0]=='P':circ.append(('P',inv(e[1],self.n))) + elif e[0]=='D':circ.append(('D',e[1],tuple((-x)%4 for x in e[2]))) + elif e[0]=='C':circ.append(('C',e[1],-e[2])) + elif e[0]=='phase':circ.append(('phase',(-e[1])%4)) + else:circ.append(e) + return Op(self.n,inverse(self.tab),circ) + def zero_state(self,basis=0): + N=1<>i)&1 for i in range(n)) + assert all(alpha[i]%2==(Q[i]>>i)&1 for i in range(n)) + return Op(n,tuple([(1<>i&1 else 0,1<>i&1 else 0) for i in range(n)]),[('C',q,sgn)]) +def xgate(n,b):return Op(n,tuple([(1<>i)&1)) for i in range(n)]),[('X',b)]) +def fourier(n,axes=None): + out=ident(n) + for i in range(n) if axes is None else axes:out=out.then(cgate(n,1<len(selected):picks.append(j);selected.append(x) + assert len(picks)==r and all(x>>r==0 for x in Bcols) + Br=transpose(selected,r);Bi=inv(Br,r);Dr=transpose([Dcols[j]&((1< 2: + x /= 2 + k += 1 + lo, hi = log_unit(x) + l2, u2 = log_unit(Q(2)) + lo, hi = lo+k*l2, hi+k*u2 + # Outward rational rounding keeps later certificates compact. + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + + +def exp_bounds(x): + require(0 <= x < 1, "exponential range") + term = total = Q(1) + for j in range(1, 13): + term *= x/j + total += term + tail = term*x/13/(1-x/14) + return total, total+tail + + +def moment(m, W, entries, saving): + lo = hi = Q(0) + for t, count in entries: + t, count = int(t), int(count) + require(0 < t < m and count > 0, "improper child") + l, u = log_bounds(Q(m, t)) + lower = exp_bounds(saving*l)[0] + upper = exp_bounds(saving*u)[1] + lo += Q(t*count, m*W)*lower + hi += Q(t*count, m*W)*upper + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + diff --git a/research/split-centres-global/vendor/engines/moment.py b/research/split-centres-global/vendor/engines/moment.py new file mode 100644 index 0000000000..7d697cb452 --- /dev/null +++ b/research/split-centres-global/vendor/engines/moment.py @@ -0,0 +1,113 @@ +"""Independent prospective ordinary five-stage cost, never supplier admission. + +Consumes a raw one-invocation ledger made from the actual source/internal/target +paths. No packed profile is used as an input. Missing physical/finite/compiler +obligations must remain explicit in the accompanying report. +""" +from collections import Counter +from decimal import Decimal, localcontext, ROUND_FLOOR +from fractions import Fraction as F +from functools import lru_cache +from math import factorial +import hashlib, json, sys +from pathlib import Path + +DYAD = 1 << 224 + +def floor(x): return F(x.numerator*DYAD//x.denominator, DYAD) +def ceil(x): return -floor(-x) + +@lru_cache(None) +def logarithm(x): + """Mercator bounds after binary reduction; ln(2) via two Mercator sums. + + For 1 <= y < 2, log(y) is an alternating series in z=y-1. + We instead reduce to 1 <= y < 3/2, and bound log(3/2) and + log(2) by the same alternating series at z=1/2 and z=1/3, + using log(2)=log(3/2)+log(4/3). All sums are exact rationals. + """ + assert x >= 1 + k = 0 + while x >= 2: x /= 2; k += 1 + j = int(x >= F(3, 2)) + if j: x /= F(3, 2) + def mercator(y): + z=y-1 + assert 0 <= z <= F(1,2) + # An even partial sum is below log; the next term bounds its tail. + t=z; s=F(0) + for n in range(1, 225): + s += (t if n & 1 else -t)/n + t *= z + return s, s+t/225 + a,b=mercator(x); c,d=mercator(F(3,2)); e,f=mercator(F(4,3)) + return floor(a+(k+j)*c+k*e), ceil(b+(k+j)*d+k*f) + +def exponential(l,u): + assert 0 <= l <= u < F(1,10) + def poly(x): + s=t=F(1) + for j in range(1,25): t=t*x/j; s+=t + return s,t + lo,_=poly(l);hi,last=poly(u) + return floor(lo),ceil(hi+last*u/25/(1-u/26)) + +def moment(H,m,W,a,bad=False): + lo=hi=F(0) + for r,n in H.items(): + assert 0 < r < m and n > 0 + l,u=logarithm(F(m,r)); e,f=exponential(a*l,a*u) + p=F(r*n,m*W);lo+=p*e;hi+=p*f + if bad: + # Existing envelope shape, only conditionally portable to the new cover. + l,u=logarithm(F(m));e,f=exponential(a*l,a*u) + p=F(32*m*sum(H.values()),10**16*W) + lo+=p*e;hi+=p*f + return floor(lo),ceil(hi) + +def decimal(x): + with localcontext() as c: + c.prec=70 + return str(Decimal(x.numerator)/Decimal(x.denominator)) + +def certify(H,m,W,bad=False): + with localcontext() as c: + c.prec=70 + terms=[(Decimal(r*n)/Decimal(m*W),(Decimal(m)/Decimal(r)).ln()) for r,n in H.items()] + fallback=Decimal(32*m*sum(H.values()))/Decimal(10**16*W) if bad else Decimal(0) + lm=Decimal(m).ln();lo=Decimal(0);hi=Decimal('.003') + for _ in range(210): + a=(lo+hi)/2 + if sum(p*(a*l).exp() for p,l in terms)+fallback*(a*lm).exp()<1:lo=a + else:hi=a + q=int(((lo+hi)/2*10**24).to_integral_value(rounding=ROUND_FLOOR)) + lo=F(q,10**24);hi=lo+F(1,10**24) + lv=moment(H,m,W,lo,bad);hv=moment(H,m,W,hi,bad) + assert lv[1]<10 for v in slacks.values()),{k:str(v) for k,v in slacks.items() if v<=0} + assert min(margins.values())==minimum + assert margins['balanced_prefix']-minimum==eta and 1-eps-r==eta/2 + assert 1-eps*(1+c)==eta-eps*eta/4 + return dict(parameters=dict(a_bit=a,a_complex=b,tau=tau,sigma=sigma, + eta=eta,beta=beta,q=q,c=c,epsilon=eps,lambda_=lam, + lambda_prime=lp,alpha_squared_power=r,delta=delta, + C0=bridge['semantic']['C0'],C1=1,kappa=kappa), + strict_constraints=slacks,margins=margins,minimum_margin=minimum, + absorption_gap=minimum-kappa, + recurrence=dict(internal=internal,leaf=leaf,reservations=1-c)) diff --git a/research/split-centres-global/vendor/export_records.py b/research/split-centres-global/vendor/export_records.py new file mode 100644 index 0000000000..3632d37048 --- /dev/null +++ b/research/split-centres-global/vendor/export_records.py @@ -0,0 +1,72 @@ +"""Export a bitE8/1 word to the PR249 record format read by PR #266's official cohort checkers and PR #315's engines. +usage: python3 export_records.py word.json[.gz] OUTDIR -> OUTDIR/{249-records.bin,249-states.json,frames.json} +Records are int32 six-tuples: MOVE(0,role,old,new,rank,0), ADD(1,dst,src,1,frame,phase), COPY(2,centre,temp,frame,ZERO,rank), +ERASE(3,centre,temp,frame,ZERO,0). A multi-source gate becomes one ADD per source, preceded by the MOVEs of every +register of the gate to the gate frame. Frames: integer basis rows B (label vectors of the frame's root lines in the +word's coordinates, a rational basis) and integer annihilator rows A (standard dot product), as PR #266 expects. +Dylan Crow, with Anthropic Claude assistance; Apache-2.0.""" +import sys, json, gzip, struct, os +from fractions import Fraction as Fr +from math import gcd +def load(p): + with (gzip.open(p,'rt') if p.endswith('.gz') else open(p)) as f: return json.load(f) +c=load(sys.argv[1]); out=sys.argv[2]; os.makedirs(out,exist_ok=True) +v,R,h=c['v'],c['R'],c['h']; n=2*v+R; lines=c['lines'] +def basis(idx): + rows=[]; piv=[]; B=[] + for i in idx: + x=[Fr(a) for a in lines[i]] + for p,r in zip(piv,rows): + if x[p]: f=x[p]/r[p]; x=[a-f*b for a,b in zip(x,r)] + nz=[k for k in range(h) if x[k]] + if nz: rows.append(x); piv.append(nz[0]); B.append(list(lines[i])) + return B,rows,piv +def annihilator(rows,piv): + # rows in echelon (pivot columns piv); free columns give the null space of the row space under the dot product + # reduce to RREF + R_=[r[:] for r in rows] + for i,(p,r) in enumerate(zip(piv,R_)): + R_[i]=[a/r[p] for a in r] + for i,p in enumerate(piv): + for j in range(len(R_)): + if j!=i and R_[j][p]: f=R_[j][p]; R_[j]=[a-f*b for a,b in zip(R_[j],R_[i])] + free=[k for k in range(h) if k not in piv]; A=[] + for f in free: + a=[Fr(0)]*h; a[f]=Fr(1) + for i,p in enumerate(piv): a[p]=-R_[i][f] + L=1 + for x in a: L=L*x.denominator//gcd(L,x.denominator) + ai=[int(x*L) for x in a]; g=0 + for x in ai: g=gcd(g,abs(x)) + A.append([x//g for x in ai]) + return A +frames={} +for k,idx in enumerate(c['frames']): + B,rows,piv=basis(idx); A=annihilator(rows,piv) if B else [[int(i==j) for j in range(h)] for i in range(h)] + assert all(sum(a*b for a,b in zip(x,y))==0 for x in A for y in B) and len(A)+len(B)==h + frames[str(k)]=dict(dim=len(B),B=B,A=A) +dim=[frames[str(k)]['dim'] for k in range(len(c['frames']))] +ZERO=[k for k in range(len(dim)) if dim[k]==0]; assert len(ZERO)==1; ZERO=ZERO[0] +cur=list(c['start']); rec=[] +def move(r,f): + if cur[r]!=f: rec.append((0,r,cur[r],f,dim[f]-dim[cur[r]],0)); cur[r]=f +def run(gates,ph): + for f,d,srcs in gates: + for r in [d]+srcs: move(r,f) + for s in srcs: rec.append((1,d,s,1,f,ph)) +run(c['D'],1); run(c['A'],2) +temp=n +for k,q in enumerate(c['ret']): + fq=cur[q]; rec.append((2,q,temp,fq,ZERO,dim[fq])) + for t,row in enumerate(c['scatter']): + if k in row: rec.append((1,v+t,temp,1,ZERO,3)) + rec.append((3,q,temp,fq,ZERO,0)) +run(c['B'],4); run(c['C'],5) +for r in range(n): move(r,c['final'][r]) +with open(out+'/249-records.bin','wb') as f: + for e in rec: f.write(struct.pack('<6i',*e)) +st=dict(n=n,v=v,h=h,R=R,ZERO=ZERO,initial={str(r):c['start'][r] for r in range(n)},final={str(r):c['final'][r] for r in range(n)}, + retained_totals=c['ret'],source_owned_roles=[],regs=[]) +json.dump(st,open(out+'/249-states.json','w'),sort_keys=True,separators=(',',':')) +json.dump(dict(frames=frames),open(out+'/frames.json','w'),sort_keys=True,separators=(',',':')) +print('exported',len(rec),'records,',len(frames),'frames, n',n,'ZERO',ZERO) diff --git a/research/split-centres-global/vendor/hamming_packets.py b/research/split-centres-global/vendor/hamming_packets.py new file mode 100644 index 0000000000..c129996656 --- /dev/null +++ b/research/split-centres-global/vendor/hamming_packets.py @@ -0,0 +1,253 @@ +"""A structural prototype: mutable source bases and simultaneous signed packets. + +Input geometry is the pinned PR370 Hamming E8 root table. The binary realization, +packet construction, two-shear synthesis and arbitrary-dirt replay below are new +local experiments. This does NOT produce a complete improved E8 supplier. +""" +import gzip +import hashlib +import itertools as it +import json +import random +from collections import Counter,defaultdict +from fractions import Fraction as Q +from pathlib import Path + +OUT=Path('work/complex-network/hamming');OUT.mkdir(parents=True,exist_ok=True) +SRC=Path('work/pr370-source/research/e8-bit/data/bit/bitE8-r865.json.gz') +word=json.load(gzip.open(SRC));roots=word['lines'];v=len(roots) +G=[[sum(x*y for x,y in zip(a,b))//2 for b in roots] for a in roots] +C=[sum((1^(G[i][j]&1))<>p&1:x^=b[p] + if x: + p=x.bit_length()-1 + for q in b: + if b[q]>>p&1:b[q]^=x + b[p]=x + return tuple(b[p] for p in sorted(b,reverse=True)) + +def inside(a,b):return basis(a+b)==b + +indices=[] +for i,row in enumerate(C): + if len(basis([C[j] for j in indices]+[row]))>len(indices):indices.append(i) +assert len(indices)==9 +gram=[sum(((C[i]>>j)&1)<>i)&1)*((gram[i]&b).bit_count()&1) for i in range(9))&1 +orth=[] +for step in range(9): + choices=[x for x in range(1,512) if ip(x,x) and all(not ip(x,y) for y in orth)] + chosen=next(x for x in choices if step==8 or any(y!=x and not ip(x,y) for y in choices)) + orth.append(chosen) +assert all(ip(x,y)==int(i==j) for i,x in enumerate(orth) for j,y in enumerate(orth)) +ports=[] +for i in range(v): + row=sum(((C[i]>>j)&1)<>j)&1) for i in range(v) for j in range(v)) + +blocks=defaultdict(list);frame_lines={} +for i,r in enumerate(roots): + support=tuple(k for k,x in enumerate(r) if x) + if len(support)==4:blocks[support].append(i) + else:assert len(support)==1;frame_lines[support[0]]=i +assert len(blocks)==14 and all(len(xs)==8 for xs in blocks.values()) + +def sparse_add(rows,t,s,q): + for j,x in list(rows[s].items()): + z=rows[t].get(j,Q(0))+q*x + if z:rows[t][j]=z + else:rows[t].pop(j,None) + +def simulate(n,events): + rows=[{r:Q(1)} for r in range(n)] + for t,s,q in events:sparse_add(rows,t,s,q) + return rows + +def serialize(events):return [[t,s,q.numerator,q.denominator] for t,s,q in events] + +packet_table={};module_receipts=[];all_programs=[] +for block,ids in sorted(blocks.items()): + ids=sorted(ids);pos={s:i for i,s in enumerate(ids)} + tetrads=[sorted(s for s in ids if sum(roots[s][k]<0 for k in block)%2==p) for p in (0,1)] + assert all(len(t)==4 for t in tetrads) + faces=[] + for i,j in it.combinations(block,2): + for epsilon in (-1,1): + support=[s for s in ids if roots[s][i]*roots[s][j]==epsilon] + content={s:Q(roots[s][i]) for s in support} + frame=basis([ports[s] for s in support]);assert len(frame)==3 + key=(block,(i,j),epsilon);packet_table[key]=(content,frame) + faces.append((key,content,frame)) + pair_uses=defaultdict(list) + for f,(_,content,frame) in enumerate(faces): + for tet in tetrads: + pair=tuple(s for s in tet if s in content) + assert len(pair)==2 + pair_uses[pair].append(f) + assert len(pair_uses)==12 and all(len(fs)==2 for fs in pair_uses.values()) + bysource=defaultdict(list) + for pair in sorted(pair_uses): + for s in pair:bysource[s].append(pair) + # One of the three pair branches is carried by x itself, two by helpers. + regs={};nextreg=8;events=[];event_frames=[];cur=[basis([ports[s]]) for s in ids] + start=list(cur);dead=[] + def add(t,s,q,F): + assert t!=s and inside(cur[t],F) and inside(cur[s],F) + cur[t]=cur[s]=F;events.append((t,s,Q(q)));event_frames.append(F) + for s in ids: + for j,pair in enumerate(sorted(bysource[s])): + if j==0:reg=pos[s] + else: + reg=nextreg;nextreg+=1;cur.append(());start.append(()) + add(reg,pos[s],1,basis([ports[s]])) + regs[pair,s]=reg + assert nextreg==24 + partial={} + for pair,fs in sorted(pair_uses.items()): + s,t=pair;a,b=regs[pair,s],regs[pair,t];f,g=fs + alpha,beta=faces[f][1][s],faces[f][1][t] + gamma,delta=faces[g][1][s],faces[g][1][t] + assert alpha*delta-beta*gamma in (-2,2) + F=basis([ports[s],ports[t]]);assert len(F)==2 + add(a,b,beta/alpha,F) + k=gamma/(delta-gamma*beta/alpha) + add(b,a,k,F) + partial[f,pair]=(a,alpha) + partial[g,pair]=(b,delta-gamma*beta/alpha) + pre_packets=simulate(24,events) + def clean_rank(registers): + piv={} + for reg in registers: + row=[pre_packets[reg].get(i,Q(0)) for i in range(8)] + for j in sorted(piv): + q=row[j] + if q:row=[a-q*b for a,b in zip(row,piv[j])] + j=next((i for i,q in enumerate(row) if q),None) + if j is not None: + q=row[j];piv[j]=[a/q for a in row] + return len(piv) + choices=[[value for (ff,pair),value in partial.items() if ff==f] for f in range(12)] + rng=random.Random(38639);orientation=None + for trial in range(4096): + bits=rng.randrange(1<<12) + if clean_rank([pieces[1-((bits>>f)&1)][0] for f,pieces in enumerate(choices)])==8: + orientation=bits;break + assert orientation is not None + outputs=[] + for f,(key,content,F) in enumerate(faces): + pieces=[value for (ff,pair),value in partial.items() if ff==f] + assert len(pieces)==2 + if orientation>>f&1:pieces.reverse() + (a,alpha),(b,beta)=pieces + add(a,b,beta/alpha,F) + outputs.append((a,alpha));dead.append(b) + assert len(set(r for r,a in outputs))==12 and len(set(dead))==12 + assert not set(dead)&{r for r,a in outputs} + core=simulate(24,events) + for f,(reg,scale) in enumerate(outputs): + clean={ids[j]:scale*x for j,x in core[reg].items() if j<8 and x} + assert clean==faces[f][1] + + # Probe complete borrowing: output each packet, cancel its old dirt at label + # zero, then undo every source/helper operation at the full frame. + # Actual supplier consumers and their remaining chronology are NOT inferred. + n=36;main=events.copy();dirt=[];chosen_targets=[] + for f,(reg,scale) in enumerate(outputs): + main.append((24+f,reg,scale)) + for j,q in core[reg].items(): + if j>=8:dirt.append((24+f,j,-scale*q)) + valid=[t for t in range(v) if all((ports[t]&x).bit_count()%2==0 for x in faces[f][2])] + assert valid;chosen_targets.append(valid[0]) + cleanup=[(t,s,-q) for t,s,q in reversed(events)] + actual=simulate(n,dirt+main+cleanup) + for r in range(24):assert actual[r]=={r:Q(1)} + for f in range(12): + expected={24+f:Q(1)} + expected.update({pos[s]:q for s,q in faces[f][1].items()}) + assert actual[24+f]==expected + # A mutation of the compensator must corrupt at least one arbitrary dirt column. + wrong=simulate(n,main+cleanup) + assert any(wrong[r]!=actual[r] for r in range(24,36)) + # Inverse-transpose: transpose and negate each elementary shear in the SAME + # event order. Reversing as well would generally compute the wrong map. + dual=simulate(n,[(s,t,-q) for t,s,q in dirt+main+cleanup]) + for r in range(n): + expected={r:Q(1)} + if r<8: + expected.update({24+f:-content[ids[r]] for f,(_,content,F) in enumerate(faces) if ids[r] in content}) + assert dual[r]==expected + receipt={'block':block,'source_lines':ids,'packets':12,'pair_butterflies':12, + 'packet_additions':len(events),'live_source_registers_borrowed':8, + 'helper_registers':16,'total_source_and_helper_registers':24, + 'retired_register_clean_rank':8, + 'independent_pair_branch_comparison_helpers':48, + 'comparison_scope':'48 is a specified independent two-input-form implementation, not the helper count of the current r783 supplier.', + 'frame_rank_counts':dict(Counter(map(len,event_frames))), + 'all_dirty_columns_forward_and_inverse_transpose':n, + 'compensator_omission_rejected':True, + 'scope':'A 12-output packet factory and probe sinks. Not a complete 120-port supplier or global frame schedule.'} + module_receipts.append(receipt) + all_programs.append({'receipt':receipt,'start_frames':start,'events':serialize(events), + 'event_frames':event_frames,'outputs':[[r,str(q)] for r,q in outputs], + 'dead_registers':dead, + 'dirt':serialize(dirt),'cleanup':serialize(cleanup), + 'probe_target_ports':[ports[t] for t in chosen_targets]}) + +# Reconstruct the entire signed E8 neighbour correction from the packet family. +# This proves all 120 rational source columns of the abstract decomposition. +decomposition=[] +for target,r in enumerate(roots): + row=defaultdict(Q);terms=[];support=[i for i,x in enumerate(r) if x] + if len(support)==4: + c=tuple(support) + for d in blocks: + inter=tuple(sorted(set(c)&set(d))) + if len(inter)!=2:continue + i,j=inter;epsilon=r[i]*r[j];content,F=packet_table[d,inter,epsilon] + coefficient=-Q(r[i],2) + assert all((ports[target]&p).bit_count()%2==0 for p in F) + for s,a in content.items():row[s]+=coefficient*a + terms.append({'source_block':d,'pair':inter,'epsilon':epsilon,'coefficient':str(coefficient)}) + for s in blocks[c]+list(frame_lines.values()): + if s!=target and G[target][s]:row[s]-=Q(G[target][s],2) + else: + i=support[0] + for d in blocks: + if i in d: + for s in blocks[d]:row[s]-=Q(roots[s][i],2) + expected={s:-Q(G[target][s],2) for s in range(v) if s!=target and G[target][s]} + assert {s:a for s,a in row.items() if a}==expected + # Eight coordinate centers recover the diagonal after side corrections. + for s in range(v): + center=sum(Q(r[i]*roots[s][i],4) for i in range(8)) + assert center+row.get(s,Q(0))==int(s==target) + decomposition.append({'target':target,'cross_block_packets':terms,'side_support':len(expected)}) + +program_path=OUT/'PACKET-PROGRAMS.json.gz' +program_path.write_bytes(gzip.compress(json.dumps(all_programs,sort_keys=True,separators=(',',':')).encode(),mtime=0)) +report={'status':'PASS_STRUCTURAL_PACKET_PROTOTYPE_NOT_A_NEW_SUPPLIER', + 'source_sha256':hashlib.sha256(SRC.read_bytes()).hexdigest(), + 'binary_address_dimension':9,'binary_gram_rank':len(indices), + 'binary_ports':ports,'root_lines':roots, + 'binary_gram_identity':'p_s dot p_t = 1 + (root_s dot root_t / 2) mod 2', + 'modules':module_receipts,'signed_packets':len(packet_table), + 'full_target_decomposition_columns':120,'full_target_decomposition_entries':120*120, + 'program_sha256':hashlib.sha256(program_path.read_bytes()).hexdigest(), + 'decomposition':decomposition, + 'remaining':['Joint scheduling and charging of all packet fan-outs and target accumulations', + 'Forming all eight centers from the available mixed source basis without an uncharged restore', + 'Full 120-port arbitrary-dirt forward/backward program and restored work stocks', + 'Exact complex adapters and global phases; finite invoice; two independent prices and outer assembly'], + 'no_new_coarse_b_or_kappa_claim':True} +(OUT/'PROTOTYPE.json').write_text(json.dumps(report,indent=2)+'\n') +print('PASS: 14 factories, 168 signed packets; each factory uses 8 source + 16 helper registers') +print('PASS: exact dirty forward and inverse-transpose columns, omission controls, all 14400 decoder entries') +print('NOT A SUPPLIER: global scheduling, mixed-basis centers, phase and full price remain open') diff --git a/research/split-centres-global/verify.py b/research/split-centres-global/verify.py new file mode 100644 index 0000000000..01d78bf0d1 --- /dev/null +++ b/research/split-centres-global/verify.py @@ -0,0 +1,51 @@ +"""Verify the selected two-supplier composition using Python's standard library.""" +import argparse,gzip,hashlib,json,os,shutil,subprocess,sys +from pathlib import Path +assert __debug__, 'Assertions must remain enabled' +ROOT=Path(__file__).resolve().parent +ap=argparse.ArgumentParser(description=__doc__) +ap.add_argument('output',type=Path,help='A new output directory outside this package') +ap.add_argument('--replay-phases',action='store_true',help='Recompute all selected Gaussian phase pairs instead of reusing their source-bound evidence') +a=ap.parse_args();out=a.output.resolve() +assert not out.exists() and not out.is_relative_to(ROOT) +def snapshot(): + return {p.relative_to(ROOT).as_posix():hashlib.sha256(p.read_bytes()).hexdigest() for p in ROOT.rglob('*') if p.is_file() and p.name!='MANIFEST.json'} +manifest=json.loads((ROOT/'MANIFEST.json').read_text());assert snapshot()==manifest['files'],'Source manifest mismatch' +sources=json.loads((ROOT/'SOURCES.json').read_text()) +for z in sources['imported_files']: + data=(ROOT/z['path']).read_bytes();assert hashlib.sha256(data).hexdigest()==z['sha256'] + if 'source_sha256' in z:assert hashlib.sha256(gzip.decompress(data)).hexdigest()==z['source_sha256'] +out.mkdir(parents=True) +def copy(src,dst): + p=out/dst;p.parent.mkdir(parents=True,exist_ok=True) + data=(ROOT/src).read_bytes();p.write_bytes(gzip.decompress(data) if src.endswith('.gz') and not dst.endswith('.gz') else data) +for src,dst in [ + ('inputs/e8-r865.json.gz','work/pr370-source/research/e8-bit/data/bit/bitE8-r865.json.gz'), + ('inputs/complex-ports.json.gz','work/higher-stage-e8/verified/gcert1-e8-retimed.json.gz'), + ('inputs/complex-template.json.gz','work/complex-nine-native/GLOBAL-TEMPLATE.json.gz'), + ('inputs/complex-data-phases.json.gz','work/complex-nine-native/DATA-PHASES.json'), + ('inputs/bit-geometry.json.gz','inherited/bit-geometry.json.gz'), + ('vendor/clifford_exact.py','work/odd-stages/clifford_exact.py')]:copy(src,dst) +for name in ('moment','base_two_moment','outer'):copy('vendor/engines/'+name+'.py','work/pr361/code/engines/'+name+'.py') +p=out/'bit426-source-centres';p.mkdir();(p/'bit-input.json').write_bytes(gzip.decompress((ROOT/'inputs/bit-r767.json.gz').read_bytes())) +env=dict(os.environ,E8_OUTPUT=str(out),E8_REPLAY_PHASES=str(int(a.replay_phases)),PYTHONDONTWRITEBYTECODE='1');env.pop('PYTHONOPTIMIZE',None) +steps=[] +def run(name,file,*args): + with (out/(name+'.log')).open('w') as log: + r=subprocess.run([sys.executable,'-B',str(ROOT/file),*map(str,args)],cwd=out,env=env,stdout=log,stderr=subprocess.STDOUT) + if r.returncode: + print((out/(name+'.log')).read_text()[-16000:],file=sys.stderr,flush=True) + raise RuntimeError((name,r.returncode,str(out/(name+'.log')))) + steps.append(name);print('PASS',name,flush=True) +run('hamming_packets','vendor/hamming_packets.py') +for name in ('complex_construct','complex_audit','complex_emit','complex_phases','bit_construct'):run(name,'code/'+name+'.py') +run('bit_export','vendor/export_records.py',p/'bit-source-centres.json',p/'records') +run('bit_global','code/bit_global.py','--source',p,'--local-check',p,'--out',p/'global') +run('bit_audit','code/bit_audit.py','--local-check',p,'--out',p/'global') +for name in ('bit_price','complex_integrate','complex_replay','combined'):run(name,'code/'+name+'.py') +assert snapshot()==manifest['files'],'Package modified during verification' +r=json.loads((out/'RESULT.json').read_text());expected=json.loads((ROOT/'EXPECTED.json').read_text()) +for key,value in expected.items():assert r[key]==value,(key,r[key],value) +r['verification_steps']=steps;r['phase_mode']='full replay' if a.replay_phases else 'source-bound unchanged evidence';r['manifest_sha256']=hashlib.sha256((ROOT/'MANIFEST.json').read_bytes()).hexdigest() +(out/'RESULT.json').write_text(json.dumps(r,indent=2)+'\n') +print('PASS conditional kappa',r['kappa_decimal'])