diff --git a/research/involutory-producer-raw-dual/.gitattributes b/research/involutory-producer-raw-dual/.gitattributes new file mode 100644 index 0000000000..2f1f52747f --- /dev/null +++ b/research/involutory-producer-raw-dual/.gitattributes @@ -0,0 +1,4 @@ +# Frozen source and scientific evidence must retain their exact input bytes. +inputs/** -text +science/** -text +independent/** -text diff --git a/research/involutory-producer-raw-dual/BUDGET.md b/research/involutory-producer-raw-dual/BUDGET.md new file mode 100644 index 0000000000..1eaaae48c3 --- /dev/null +++ b/research/involutory-producer-raw-dual/BUDGET.md @@ -0,0 +1,46 @@ +# Complete local repair bill and unfunded caller obligations + +The repaired typed word and RESULT.paid are authoritative. The artifact's +canonical.local_profile intentionally remains4929 baseline metadata. + +|Item|Exact local bill/status| +|---|---| +|4929 backward Gaussian profile|2201H1+412H2+510H3+127H4+40H5| +|New suffix|8H1; no other recursive job| +|Complete repaired profile|2209H1+412H2+510H3+127H4+40H5, matching4935 forward| +|Productive helpers retained|28H4+7H7+47H8+326H9:408 original independent jobs, once each| +|New independent reward|None| +|New storage arrays|None; reuse already owned C0, reset to zero| +|Literal suffix|456 events:8 COPY,16 CLEAR,8 lifts,424 weighted ADDs| +|Scatter coefficients|-12×8,-6×268,+6×148| +|Scalar-primitive ADD allowance|2976, distinct from424 weighted instructions and8 Gaussian calls| +|Conservative added array passes|3064=2976+24 COPY/CLEAR+64 emitted monomial primitives, beyond8 paid H1| +|Normalized prefix L1|258 backward,457 forward; not an error-amplification certificate| + +Relative to the older632 producer, eight H8 centres become eight H1 repairs, +but the target transfer changed. This is not an unchanged-output saving. +Every original helper remains an independent job; none is consumed or credited +twice. Source X inputs are not mutated into the excluded UNIT-TRANSFER variant. + +Each new lift is a literal compiled phase-bound word. Array volume is the +inherited supplier embedding volume, with normal columnwise O(f) index/phase +work. Counting all emitted identity/phase primitives is deliberately conservative. + +The finite repair suffix can amplify error. A conservative maximum-fiber-field +norm bound is13^8*7^416 for its weighted ADDs; multiply by the inherited suffix +bound when allocating errors inside the old prefix. New Gaussian/local errors +need an explicit allocation after that amplification. Entrywise norms also need +the relevant square-root volume conversion. Fixed constants can permit +logarithmic guard precision under the admitted convention, but no complete +caller/compiler reserve or multiplier precision theorem is funded here. + +The separate one-bank price screen grants an explicitly UNREALIZED224H17+2H +reward against two repaired profiles. Its margin at C=.0030217758 is in +[150.262158203082210620506138658847,150.262158203082210620506138658848]. +The source-specific112H2 floor makes this +[-73.269156882594712940928576503039,-73.269156882594712940928576503038], +and it stays negative through C=.0034 by the written normalized-moment argument. +The package independently regenerates these intervals. They are necessary +price-only tests for the stated one-bank architecture, not a completed target +or a universal caller ceiling. Finite costs cannot rescue that negative bill; +a different caller remains an open contract with unknown costs. diff --git a/research/involutory-producer-raw-dual/CEILING.md b/research/involutory-producer-raw-dual/CEILING.md new file mode 100644 index 0000000000..0aac89a434 --- /dev/null +++ b/research/involutory-producer-raw-dual/CEILING.md @@ -0,0 +1,87 @@ +# Scoped one-parallel-bank ceiling for the source-restored involution + +This is a separate read/derive corollary for the actual source-restored F in +PR4935 head `64c9f99693c92fb370096fb43dbc58a085b30e36`. It does not obstruct +the newly constructed physical raw dual or an eventual direct coded consumer. +Credit the parent for the projection/rank and determinant-lemma argument; +this agent independently checked the actual matrix, grades and intervals. + +Let J={0,7,20,23,86,93,108,111} and D_J its diagonal selector. Exact source +checks give F²=I, diag(F)=12D_J and F_JJ=12I8. Write G=F−12D_J. The matrix +determinant lemma gives det(G)=det(F)det(I8−12F_JJ)=det(F)(−143)^8≠0; +symmetry of F is not assumed. The checker additionally verifies the two-sided +integer witness + + G(143F−12F D_J F)=(143F−12F D_J F)G=143I. + +For the actual X entrance frames U_i, every nonzero off-diagonal F_ij has +Fourier grade2 for U_i U_j*. There are 5,824 such supported pairs, all directly +recomputed from the exact source Clifford library and checked by independent +binary row reduction. The pure diagonal12D_J is monomial. Thus + + pi2(U F U*)=U G U*, + +which is invertible. Since F^-1=F, the source-restored forward uncoding +adapter is U F U*, with scalar exitF on the common-full X chart. The raw-dual +adapter has entrance bar(U) F^T bar(U)* and scalar exitF^T; its projected +matrix is likewise invertible. Fixed nonzero scalar rescaling preserves the +same projected-rank argument. No free ordinary implementation of those exit +matrices is asserted. + +Here is the exact all-width algebra boundary. Fix a finite-phase one-column +Clifford group Gc on the declared address space and its central scalar subgroup +Z. Impose the actual scalar character z=ζ^f at width f; the resulting twisted +algebra A_f has one basis class per projective Clifford Gc/Z. Let H be the +full admitted monomial-Clifford subgroup and B_f its subgroup algebra. Fourier +grade is invariant under both left and right monomial multiplication, so +projection pi2 onto pure grade2 basis classes is a B_f-bimodule map. Phases +are retained, and no integral-domain or commuting-coefficient premise is used. + +The projective algebra faithfully evaluates into columnwise tensor action for +all sufficiently large f. Indeed, choose nonproportional matrix representatives +v_t for the finitely many projective classes. For each t, a product of linear +forms vanishing on each other v_u but not v_t isolates v_t in homogeneous +degree |Gc/Z|−1. Multiply by a linear form nonzero at v_t to obtain an isolating +polynomial at every larger degree. Thus v_t^tensor(f) are linearly independent +at those widths, with their scalar character retained. An exact identity at +all positive widths must therefore hold in A_f at sufficiently large widths, +even with width-dependent owner scalar coefficients. No operator sum is +incorrectly tensor-powered. + +Grant arbitrary rectangular B_f-valued owner pre/post controls L,R, zero +scratch, output selection, copies and a free identity bypass B0. A standalone +ONE parallel bank D of pure Gaussian-Clifford channels satisfies + + pi2(L D R+B0)=L pi2(D) R. + +If the bank has r grade-two channels, its right-hand side has regular-module +rank at most r dim(A_f). All other pure grades project to zero; each grade-two +channel is a group unit. The required adapter projection has rank 112dim(A_f). +Consequently r≥112. This is the same restricted architecture ceiling even +though the scalar port matrix F is now an involution. + +The explicitly UNREALIZED two-call grant 224H17+2H versus two copies of +P={1:2209,2:412,3:510,4:127,5:40} has margin +[150.262158203082210620506138658847,150.262158203082210620506138658848] +at C=.0030217758. Subtracting the necessary 112H2 gives +[−73.269156882594712940928576503039,−73.269156882594712940928576503038]; +at C=.0034 it gives +[−80.401921647290247704383966403396,−80.401921647290247704383966403395]. +All negative coefficient ranks are ≤5 and all positive ranks ≥7. Therefore +M(t)/5^t strictly increases in t=1−C, and negativity at the lower-C endpoint +excludes this stated bill over the entire interval. All 816 inherited helper +jobs are included exactly once. No productive Gaussian endpoint is supplied +by this price grant, and finite scalar/storage/precision/outer costs cannot +rescue its negative relaxation. + +Scope excludes chronological multibank circuits, native absorption or +interleaving, source-prefix access, direct coded consumers, approximate/border +endpoints, nonlinear operations, non-Clifford monomial gates and arbitrary +noncolumnwise address controllers. The actual new raw-dual repair is not +such an uncoding adapter and remains a positive local interface result. +No caller, κ or universal producer ceiling follows. + +Reproduce normal/O with `check_ceiling.py`. This is a source-specific finite +matrix/grade/interval verification supporting the written all-width proof, +not a formal proof-kernel certificate. Apache-2.0; substantial OpenAI Codex +assistance; upstream contributor credit is retained in REVIEW.md/SOURCES.json. diff --git a/research/involutory-producer-raw-dual/HANDOFF.md b/research/involutory-producer-raw-dual/HANDOFF.md new file mode 100644 index 0000000000..75f68b82df --- /dev/null +++ b/research/involutory-producer-raw-dual/HANDOFF.md @@ -0,0 +1,22 @@ +HANDOFF + +Research discussion / PR / artifact: +LOCAL-ONLY `research/involutory-producer-raw-dual`, branch `research/involutory-producer-raw-dual-20261023`; final public artifact pending parent publication. One fixed physical raw-dual repair plus a separately scoped one-parallel-bank price/ceiling obligation. No complete caller, source-mutating UNIT-TRANSFER dual or new kappa. Existing green modules remain unchanged. + +Exact commit: +Scientific base/fresh main `cef4b52f2a59009865bf8eabde1be3f159063703`; exact source-retention ancestor `984e02db73bc2d814e20cbe3830b26ff0c3b09fe`. Consumed source heads are4935 `64c9f99693c92fb370096fb43dbc58a085b30e36`,4929 `361f5d4100640177d6a983dd2f336021c75bfd5e` and native `20bb93cd990d2ff683e4d0fc56b87a42cd5d3296`. The4935 head is not claimed ancestral: its exact raw bytes, Git blob/SHA and original path/head metadata are retained in our real publication ancestry, and SOURCES binds those actual retained paths. Final publication commit remains pending. + +What is established: +The actual4929 backward typed prefix plus8 owned H1 lifts and424 ADDs returns X'=X-F^T Y,Y'=Y for the actual4935 source-restored F, retaining all408 independent helper jobs and clearing existing ownedC0 with no new array. All632 original rows,12544 transpose coefficients and complete paid bill are checked. RESULT.paid and the replayed word are authoritative2209H1+412H2+510H3+127H4+40H5; canonical.local_profile is stale retained4929 baseline metadata. B independently reconstructs F, interprets all632 normalized owner rows without A/native_core, checks all4096NEWlift phase columns and7 semantic controls. The separate self-contained one-bank proof rechecks F premises, exact off-diagonal inverse witness,5824 grade2 supports and interval prices; its112H2 floor makes even the unrealized224H17+2H grant negative on the stated C interval. + +What remains uncertain: +Inherited original physical warp semantics remain source premises; new-lift phases were freshly independently expanded. This is a physical producer dual, not a complete profitable caller or full multiplier theorem. No source-mutating variant, caller capacity, native absorption, chronological multibank construction, precision/compiler reserve, stock or outer recovery is supplied. The one-bank ceiling is restricted to a fixed finite columnwise Clifford alphabet with pure Gaussian channels and admitted monomial controls; it does not cover excluded chronological, approximate or noncolumnwise architectures. The positive pre-adapter price grant has no realized224H17 endpoint. + +Smallest useful next task: +Write a complete direct chronological coded caller for the actual forward/raw-dual source pair, with every arbitrary owner, helper return, paid call, scalar/storage cost and precision obligation. Derive the full bill before downstream optimization or capacity expansion. The present package stops at the fixed repaired interface and its separate one-bank obligation; no additional family search is included. + +Reproduction command and expected runtime: +Run `python3 scripts/research_package.py --package research/involutory-producer-raw-dual` for all8 registered normal/O commands. Direct launchers are `python3 -I -W error -B research/involutory-producer-raw-dual/verify.py` and `verify_independent.py derive`, `audit`, or `ceiling` under the same package path, then with `-O`; expected individual times are roughly5/25/36/2 seconds with90/120/180/60-second bounds respectively. Launchers authenticate frozen bytes, run read-only/private-scratch, compare scientific receipts and support Git-free export replay. Exact runtime/source/coverage qualifications are in VALIDATION.md and BUDGET.md. + +Predecessor credit: +Credit Dugongue4935/4929; Rohan Arun1931; Ali Romman1862; Cinna Davis /1337isnot1337's4694/4698 and retained4470 lineage; Cao Yifan /intqwq native source beyond4610; zxv, Jacob Alan Sussman and retained E8/scalar/Clifford/compiler/precision/outer contributors. The parent proposed the physical repair and one-bank transfer, A emitted the word, B independently audited it and packaging preserved their science. Prepared for Chris R / Clear1nsight with substantial OpenAI Codex gpt-6.1-sol/high assistance. Apache-2.0; no independent human or proof-kernel acceptance claimed. diff --git a/research/involutory-producer-raw-dual/LICENSE b/research/involutory-producer-raw-dual/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/involutory-producer-raw-dual/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/involutory-producer-raw-dual/ORIGINS.json b/research/involutory-producer-raw-dual/ORIGINS.json new file mode 100644 index 0000000000..b65d615f89 --- /dev/null +++ b/research/involutory-producer-raw-dual/ORIGINS.json @@ -0,0 +1,127 @@ +{ + "schema_version": 1, + "scientific_base": "cef4b52f2a59009865bf8eabde1be3f159063703", + "source_policy": "Original pending-source bytes retained in our own publication ancestry; original4935head is not claimed ancestral. Final SOURCES binds foreign provenance to retained ancestor paths.", + "files": [ + { + "label": "R", + "local_path": "inputs/R/R.json", + "original_commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "original_path": "research/native-involutive-port-transfer/R.json", + "git_blob": "691598d8775cb6949c867449eec1da0a5e19e81d", + "sha256": "7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1", + "original_commit_ancestral_to_scientific_base": false + }, + { + "label": "ce", + "local_path": "inputs/ce/clifford_exact.py", + "original_commit": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296", + "original_path": "research/t74-native-fast/vendor/native/new/code/borrow/vendor/clifford/clifford_exact.py", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "original_commit_ancestral_to_scientific_base": true + }, + { + "label": "code", + "local_path": "inputs/code/CODE.json", + "original_commit": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "original_path": "research/native-center-free-code/CODE.json", + "git_blob": "03170f4a31f7a8a3db7228f1cd5a6fdcb32720ae", + "sha256": "8be7f3f073b7981ec91c6af43edff0ac8a89f4824ef6026ae758c287dd6c03d0", + "original_commit_ancestral_to_scientific_base": true + }, + { + "label": "coded", + "local_path": "inputs/coded/CODED-WORDS.json.gz", + "original_commit": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "original_path": "research/native-center-free-code/CODED-WORDS.json.gz", + "git_blob": "935fedd9c9a77f870dd6afbabbf56c8ea6e321d4", + "sha256": "797bad53122f84aa0f05b602f2bdceb6b50f95a64023799d4f24560d9c61aad6", + "original_commit_ancestral_to_scientific_base": true + }, + { + "label": "core", + "local_path": "inputs/core/native_core.py", + "original_commit": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "original_path": "research/native-center-free-code/native_core.py", + "git_blob": "5d8a8f0a6382c66449f76b6f57bdd380c057ddc1", + "sha256": "178ff80824a012970fc9435f122152da03c7e6bdc3a7de12136fe03e05cf24fe", + "original_commit_ancestral_to_scientific_base": true + }, + { + "label": "forward", + "local_path": "inputs/forward/INVOLUTIVE-WORD.json.gz", + "original_commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "original_path": "research/native-involutive-port-transfer/INVOLUTIVE-WORD.json.gz", + "git_blob": "eac634fb1d09428aa6715a47d652ae701dd0efc5", + "sha256": "ff2999f022e93e05a250160808aa3c32a08041039d7edfb01068c0308f50c138", + "original_commit_ancestral_to_scientific_base": false + }, + { + "label": "original", + "local_path": "inputs/original/ACTUAL-WORD.json.gz", + "original_commit": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296", + "original_path": "research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz", + "git_blob": "46d929df83817b85a5387bcdb9745e0627d6366e", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05", + "original_commit_ancestral_to_scientific_base": true + }, + { + "label": "proof", + "local_path": "inputs/proof/PROOF.md", + "original_commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "original_path": "research/native-involutive-port-transfer/PROOF.md", + "git_blob": "d0adf358c5a3ddaefc68a083eb9dd1430e1e89df", + "sha256": "baeb220fa1b0a649ab87b5234925e16e32fb47d92a588e8a8c5c75d0f2b08da3", + "original_commit_ancestral_to_scientific_base": false + }, + { + "label": "prune", + "local_path": "inputs/prune/prune_native.py", + "original_commit": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296", + "original_path": "research/kappa-function-composition/complex/prune_native.py", + "git_blob": "8c3e11b2408fa96eefa3ebe7952d1b11b90b772b", + "sha256": "f2b37c183a10922eabc8e0436b426a08866430e96bd0adc7e178951c7fbb5257", + "original_commit_ancestral_to_scientific_base": true + }, + { + "label": "source4935", + "local_path": "inputs/source4935/SOURCE-WORD.json.gz", + "original_commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "original_path": "research/native-involutive-port-transfer/SOURCE-WORD.json.gz", + "git_blob": "46d929df83817b85a5387bcdb9745e0627d6366e", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05", + "original_commit_ancestral_to_scientific_base": false + } + ], + "science": [ + { + "path": "science/check.py", + "sha256": "8ec1616bc7336f7999e0139ef0fa1c390a61f52db40c5f87bbc325a3febd0065" + }, + { + "path": "science/RAWDUAL-WORD.json.gz", + "sha256": "b82a423cf4a44669d44b168dab3459e9bdb646cefd96c4e4d5f401c567eec6a2" + }, + { + "path": "science/RESULT.json", + "sha256": "2fced35c17ecad163657d9ed2f05aeb3bf0ef158b06b6c9e33dbff2200fd2751" + }, + { + "path": "science/SOURCES.json", + "sha256": "fe5ab0fc5bb76b4c88cf94df7efc1bb10c19fc8bcabe5116354f2186c014ff61" + }, + { + "path": "science/REPORT.md", + "sha256": "3c24acbd1eafbf72dec8936d9f2c641a6160587094141b87ede0da1dfce9d39d" + }, + { + "path": "science/normal.log", + "sha256": "ae7a2b064d74fb40dfa0112196d06a006fc09d7eb0a0875886d650e2faa824f3" + }, + { + "path": "science/optimized.log", + "sha256": "ae7a2b064d74fb40dfa0112196d06a006fc09d7eb0a0875886d650e2faa824f3" + } + ] +} diff --git a/research/involutory-producer-raw-dual/README.md b/research/involutory-producer-raw-dual/README.md new file mode 100644 index 0000000000..afa208d02a --- /dev/null +++ b/research/involutory-producer-raw-dual/README.md @@ -0,0 +1,131 @@ +# A physical raw dual for the source-restored involutory producer + +**One physical source interface completed; no complete caller or new kappa.** +The literal backward word returns `X'=X-F^T Y`, `Y'=Y` in the retained raw-dual +source gauges, preserving all408 independent helper jobs and clearing the +already owned C0. F is exactly the source-restored involution emitted by +[PR4935](https://github.com/CrocSwap/integer-mult-bounds/pull/4935), head +`64c9f99693c92fb370096fb43dbc58a085b30e36`. The source-mutating UNIT-TRANSFER +variant is excluded. + +The construction starts with the unchanged typed backward prefix of +[PR4929](https://github.com/CrocSwap/integer-mult-bounds/pull/4929), head +`361f5d4100640177d6a983dd2f336021c75bfd5e`, then appends eight owned rank1 +lifts and424 weighted ADDs. It checks all632 arbitrary original input rows. +The complete paid profile is `{1:2209,2:412,3:510,4:127,5:40}`, matching the +4935 forward producer. This is a changed transfer contract, not an +unchanged-output saving against the older native word. + +**Use the replayed typed word and `science/RESULT.json.paid` for that invoice.** +The artifact's `canonical.local_profile` is intentionally retained4929 baseline +metadata. It is not the repaired profile and must not override the fresh census. + +## Literal construction and duality + +Let R be the exact4935 eight-row observation, K=R^T/4, and P equal K on selected +rows J={0,7,20,23,86,93,108,111}, zero elsewhere. The inherited code is A and +`F=A+Delta`, `Delta=12PR`. After the actual4929 backward program, selected Y_j +is in its original rank8 exit chart and every X_i is in the common full chart. +For each j, CLEAR/COPY Y_j into already owned C0, apply the actual raw-dual +rank1 lift to the full chart, scatter `-Delta[j,i] C0` into X_i, and CLEAR C0. +Y is read-only, helpers are untouched, and C0 earns no productive credit. + +The emitter freshly replays the actual4935 forward,4929 coded backward and +new repaired backward programs. Its exact phase compiler lowers every new +lift with its native translations, permutations, diagonal phases and Gaussian +sign. The raw-dual convention is primitive-wise conjugation in unchanged +circuit order, not a general adjoint/reversed-frame substitution. + +Writing the source frame maps as U_in,U_out and the normalized forward shear +as S_F, the endpoint is `M_f=U_out S_F U_in^-1`. The new program gives +`M_b=bar(U_out) S_F^-T bar(U_in)^-1=M_f^-T` on the632 original-owner map, +with the explicit owned-zero/reset workspace ABI. It does not claim that the +COPY/CLEAR instruction listing is a literal reversed-transpose circuit. +Every Clifford identity is a single absolute-phase word and lifts columnwise; +scalar owner coefficients remain outside tensor powers. No operator sum is +incorrectly tensor-powered. [The frozen science report](science/REPORT.md) +gives the construction, source equations and all-width argument. + +## Independent validation and supporting ceiling + +[B's independent review](independent/REVIEW.md) passes. Its own chronological +interpreter imports neither A's checker nor upstream native_core and checks +all632 source-forward/coded-backward/repaired-backward rows, the literal prefix, +workspace ABI, helpers and full bill. Its separate sparse Gaussian-integer +interpreter checks all4096 basis columns of the eight NEW lifts, including +absolute phase. Complete physical semantics for the inherited old warps remain +source premises; the normalized-word replay is not a fresh phase expansion of +every historical warp. Seven independent semantic mutations exercise sign, +omitted lift/repair, borrowed COPY/CLEAR, transpose and global-phase errors. +See [VALIDATION.md](VALIDATION.md) for exact coverage and commands. + +The separate [CEILING.md](CEILING.md) is self-contained and source-specific: +actual F satisfies diag(F)=12D_J and F_JJ=12I; its off-diagonal part is invertible. +All5824 supported off-diagonal source transports have grade2. In the stated +fixed finite columnwise Clifford grammar, a standalone ONE parallel bank of +pure Gaussian channels needs112 grade2 channels, even with rectangular free +monomial controls, zero scratch and a free bypass. Paying112H2 defeats the +explicitly UNREALIZED224H17+2H price grant throughout C∈[.0030217758,.0034]. +The checker regenerates the matrix/grade/interval evidence internally. This +ceiling does not obstruct the new raw-dual repair, a direct coded caller, +chronological multibank circuit or native absorption. + +## Sources, preservation and portability + +Scientific base is `cef4b52f2a59009865bf8eabde1be3f159063703`. Native source +is `20bb93cd990d2ff683e4d0fc56b87a42cd5d3296`. Exact4935/4929/native raw blobs +and A's seven frozen science files are retained in ancestor commit +`984e02db73bc2d814e20cbe3830b26ff0c3b09fe`. Original heads, paths, Git blob IDs +and SHA256 hashes remain in ORIGINS.json. The pending4935 head is **not** +claimed ancestral to main: SOURCES binds its actual retained paths to our real +source-retention ancestor. Package-local attributes preserve exact CRLF inputs. +There is no runtime dependency on a fork-only Git object or network fetch. + +B's29-file packet is preserved byte-for-byte under `independent/`. Its original +local descriptions, commands and timing records are archive evidence; use the +current commands below and package HANDOFF for this portable submission. +Both replay launchers authenticate frozen files. A's launcher changes only +fetch(pin,path) in an in-memory AST and executes an exact checker-byte copy in +private scratch, preserving its __file__ hash guard. It regenerates artifacts, +compares every proof-relevant field and exact decompressed word payload, and +checks each compressed container against its own receipt. B's unchanged +Git-free scripts compare printed results to frozen receipts. Replays are +read-only with respect to this package. + +## Reproduce + +Python3.12 standard library, from repository root: + +```sh +python3 -I -W error -B research/involutory-producer-raw-dual/verify.py +python3 -I -W error -B research/involutory-producer-raw-dual/verify_independent.py derive +python3 -I -W error -B research/involutory-producer-raw-dual/verify_independent.py audit +python3 -I -W error -B research/involutory-producer-raw-dual/verify_independent.py ceiling +python3 scripts/research_package.py --package research/involutory-producer-raw-dual +``` + +VERIFY.json registers each direct command normally and with `-O`. Direct +commands also work without Git after export. Expected runtimes are roughly +5s,25s,36s and2s respectively on the development machine. No Lean, full +multiplier cold replay, compiler reserve or outer recovery is invoked. +[BUDGET.md](BUDGET.md) records the recursive, finite and precision obligations. + +## Open next questions + +A complete chronological caller must bind all arbitrary-owner equations and +original helper jobs and provide its full paid/scalar/storage/precision ledger. +That is a different task from this one repaired backward producer. Stop before +capacity or compiler expansion without that endpoint and bill. TASK.json +records the smallest next gate and fixed one-bank exclusions. + +## Credit + +Credit Dugongue's4935/4929 producers; Rohan Arun's1931 eight-repair construction; +Ali Romman's1862 ordered-family framework; Cinna Davis /1337isnot1337's4694/4698 +and retained4470 lineage; Cao Yifan /intqwq's native source beyond4610; zxv, +Jacob Alan Sussman and the retained E8/scalar/Clifford/precision/outer contributors. +The parent proposed the backward COPY-lift-scatter repair and one-bank transfer; +A emitted and checked the physical word; B independently audited it and the +ceiling; packaging preserves their exact science. Prepared for Chris R / +Clear1nsight with substantial OpenAI Codex gpt-6.1-sol/high assistance. +Apache-2.0. No independent human or proof-kernel acceptance is claimed. diff --git a/research/involutory-producer-raw-dual/SOURCES.json b/research/involutory-producer-raw-dual/SOURCES.json new file mode 100644 index 0000000000..644a720327 --- /dev/null +++ b/research/involutory-producer-raw-dual/SOURCES.json @@ -0,0 +1,101 @@ +{ + "schema_version": 1, + "base_commit": "cef4b52f2a59009865bf8eabde1be3f159063703", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "c35482cd9035843b15a634cc8276a7e1e40e8395", + "sha256": "6fe0a099b89aa2aed796a13c3a21dafc63f3388ebf397464e44e0451893b9375" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "f126dd2e2dad2b669e75d1d0d0bd05c600725602", + "sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72" + }, + { + "path": "research/involutory-producer-raw-dual/inputs/R/R.json", + "usage": "provenance", + "pin": "head:984e02db73bc2d814e20cbe3830b26ff0c3b09fe:research/involutory-producer-raw-dual/inputs/R/R.json", + "git_blob": "691598d8775cb6949c867449eec1da0a5e19e81d", + "sha256": "7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1" + }, + { + "path": "research/involutory-producer-raw-dual/inputs/ce/clifford_exact.py", + "usage": "provenance", + "pin": "head:984e02db73bc2d814e20cbe3830b26ff0c3b09fe:research/involutory-producer-raw-dual/inputs/ce/clifford_exact.py", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "research/involutory-producer-raw-dual/inputs/code/CODE.json", + "usage": "provenance", + "pin": "head:984e02db73bc2d814e20cbe3830b26ff0c3b09fe:research/involutory-producer-raw-dual/inputs/code/CODE.json", + "git_blob": "03170f4a31f7a8a3db7228f1cd5a6fdcb32720ae", + "sha256": "8be7f3f073b7981ec91c6af43edff0ac8a89f4824ef6026ae758c287dd6c03d0" + }, + { + "path": "research/involutory-producer-raw-dual/inputs/coded/CODED-WORDS.json.gz", + "usage": "provenance", + "pin": "head:984e02db73bc2d814e20cbe3830b26ff0c3b09fe:research/involutory-producer-raw-dual/inputs/coded/CODED-WORDS.json.gz", + "git_blob": "935fedd9c9a77f870dd6afbabbf56c8ea6e321d4", + "sha256": "797bad53122f84aa0f05b602f2bdceb6b50f95a64023799d4f24560d9c61aad6" + }, + { + "path": "research/involutory-producer-raw-dual/inputs/core/native_core.py", + "usage": "provenance", + "pin": "head:984e02db73bc2d814e20cbe3830b26ff0c3b09fe:research/involutory-producer-raw-dual/inputs/core/native_core.py", + "git_blob": "5d8a8f0a6382c66449f76b6f57bdd380c057ddc1", + "sha256": "178ff80824a012970fc9435f122152da03c7e6bdc3a7de12136fe03e05cf24fe" + }, + { + "path": "research/involutory-producer-raw-dual/inputs/forward/INVOLUTIVE-WORD.json.gz", + "usage": "provenance", + "pin": "head:984e02db73bc2d814e20cbe3830b26ff0c3b09fe:research/involutory-producer-raw-dual/inputs/forward/INVOLUTIVE-WORD.json.gz", + "git_blob": "eac634fb1d09428aa6715a47d652ae701dd0efc5", + "sha256": "ff2999f022e93e05a250160808aa3c32a08041039d7edfb01068c0308f50c138" + }, + { + "path": "research/involutory-producer-raw-dual/inputs/original/ACTUAL-WORD.json.gz", + "usage": "provenance", + "pin": "head:984e02db73bc2d814e20cbe3830b26ff0c3b09fe:research/involutory-producer-raw-dual/inputs/original/ACTUAL-WORD.json.gz", + "git_blob": "46d929df83817b85a5387bcdb9745e0627d6366e", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05" + }, + { + "path": "research/involutory-producer-raw-dual/inputs/proof/PROOF.md", + "usage": "provenance", + "pin": "head:984e02db73bc2d814e20cbe3830b26ff0c3b09fe:research/involutory-producer-raw-dual/inputs/proof/PROOF.md", + "git_blob": "d0adf358c5a3ddaefc68a083eb9dd1430e1e89df", + "sha256": "baeb220fa1b0a649ab87b5234925e16e32fb47d92a588e8a8c5c75d0f2b08da3" + }, + { + "path": "research/involutory-producer-raw-dual/inputs/prune/prune_native.py", + "usage": "provenance", + "pin": "head:984e02db73bc2d814e20cbe3830b26ff0c3b09fe:research/involutory-producer-raw-dual/inputs/prune/prune_native.py", + "git_blob": "8c3e11b2408fa96eefa3ebe7952d1b11b90b772b", + "sha256": "f2b37c183a10922eabc8e0436b426a08866430e96bd0adc7e178951c7fbb5257" + }, + { + "path": "research/involutory-producer-raw-dual/inputs/source4935/SOURCE-WORD.json.gz", + "usage": "provenance", + "pin": "head:984e02db73bc2d814e20cbe3830b26ff0c3b09fe:research/involutory-producer-raw-dual/inputs/source4935/SOURCE-WORD.json.gz", + "git_blob": "46d929df83817b85a5387bcdb9745e0627d6366e", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05" + }, + { + "path": "research/higher-moment-strictification/verify.py", + "usage": "provenance", + "pin": "head:20bb93cd990d2ff683e4d0fc56b87a42cd5d3296:research/higher-moment-strictification/verify.py", + "git_blob": "4b24a5096154736ce060474eb8c72dc64c303699", + "sha256": "0ce7e7137422d5ffeda22085c81fa88471bbe963100fdad62e659f1e3bf89326" + } + ], + "source_retention_commit": "984e02db73bc2d814e20cbe3830b26ff0c3b09fe", + "original_source_heads_metadata_only": { + "4935": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "4929": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "native": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296" + } +} diff --git a/research/involutory-producer-raw-dual/TASK.json b/research/involutory-producer-raw-dual/TASK.json new file mode 100644 index 0000000000..39f5709b5f --- /dev/null +++ b/research/involutory-producer-raw-dual/TASK.json @@ -0,0 +1,68 @@ +{ + "schema_version": 1, + "task_id": "complex-new-helper-inventory", + "priority_revision": 7, + "base_commit": "cef4b52f2a59009865bf8eabde1be3f159063703", + "original_card": { + "id": "complex-new-helper-inventory", + "question": "Can a new local cost interface change the deficit-to-recursive-cost ratio beyond current packing?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/complex-local-word-ceiling/README.md", + "research/heterogeneous-owner-assembly/README.md", + "certificates/selected-result.json", + "research/selected-k8-unrestricted-ends/README.md" + ], + "methods": [ + "Propose a changed helper inventory and derive an optimistic exact moment.", + "Design a small completed instance and independently verify its endpoint and rank bill." + ], + "acceptance_gate": "A new physically realizable contract outside the frozen catalogue whose per-call profile, screened with ceiling.ceiling(), beats the selected word's packing ceiling; a lower cap does not establish identical circuitry or order attainable optima, and is insufficient to pass the stronger-budget target under this model. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "research/complex-local-word-ceiling/verify.py" + ], + "expected": "PASS_COMPLEX_LOCAL_WORD_CEILING", + "inspect": "Read the selected word's per-call local profile, its packing ceiling and the lever table; run levers.py for the ideal budget of the lever you target.", + "scope": "Positive control and planning budget only; this is not a new construction or full cold replay." + }, + "first_experiment": "Before any synthesis, write the candidate per-call local profile (and centre charge / unpaid coordinates if changed) and screen it with ceiling.ceiling(); reject it if even the ideal ceiling does not beat the selected word's by your stated margin.", + "bottleneck_link": "Packing of the selected word is capped at +0.87% (ceiling model); only a lower local excess spend or a changed coverage law raises the cap.", + "allowed_variations": [ + "Narrow to one changed boundary or helper type with explicit counts.", + "If the coverage law, template or guard changes, derive an applicable fully charged replacement bound instead of applying the incumbent ceiling outside its scope." + ], + "scope_change_triggers": [ + "Mixing only providers already inside the pinned catalogue.", + "Only changing helper terminal subspaces and monotone frames within the fixed scalar word, entrances and cleanup contract already covered by #1995/#2013.", + "Continuing a partial cost improvement while leaving the same unpriced consumer, restoration or central-readout obligation unresolved; refresh the family expansion decision first. Local product-retiming evidence has a narrow scope and is not a ban on changed graphs or contracts." + ], + "overlap_terms": [ + "helper inventory", + "heterogeneous-owner", + "mutable leaver" + ] + }, + "scope_status": "changed", + "actual_scope": "One literal physical raw dual for PR4935 source-restored involutory transfer, using the actual4929 backward word plus eight owned rank1 lifts and424 ADDs. All632 original inputs and408 independent helpers checked, ownedC0 cleared. Supporting fixed ONE-parallel-bank source-specific ceiling and internally regenerated price screen; no caller/new kappa.", + "scope_change_reason": "Explicit prospective Discussion4902 assignment changes the helper-inventory card to a missing physical backward source interface, with a separate bounded uncoding-architecture obligation. It does not change source X inputs or construct a complete profitable caller.", + "bottleneck_link": "A physical M_f^-T endpoint was missing for the emitted source-restored involution. The repair supplies that endpoint with a complete bill; its one-bank uncoding alternative still requires112H2 and fails the stated optimistic price screen.", + "budget_minutes": 60, + "stop_rule": "Stop after the single fixed repair, independent source/operator/bill review, one-bank corollary and portable publication checks. No source-mutating UNIT-TRANSFER variant, family search, complete caller or kappa claim.", + "outcome": "partial", + "evidence": "Unchanged A science regenerates actual word and all632-row receipts. B independently reconstructs F, checks4096 new-lift phase columns, interprets all632 normalized word rows, seven ownership/phase mutations, and actual F matrix/5824 grade/interval premises. Original physical warp semantics remain inherited source premises.", + "author": "Prepared for Chris R / Clear1nsight", + "ai_assistance": "Substantial OpenAI Codex assistance. User-authorized gpt-6.1-sol/high agents separately emitted repair, independently reviewed source/operator/bill/ceiling and packaged portable replay. No independent human or proof-kernel acceptance.", + "open_questions": [ + { + "question": "Can a direct chronological coded caller use this actual source-restored forward/raw-dual pair with all original helper jobs and a complete profitable paid/finite bill?", + "why_it_matters": "The physical dual now exists, while the standalone one-parallel-bank uncoding route fails its optimistic price screen.", + "first_step": "Write the complete arbitrary-owner chronological endpoint and full paid/scalar/storage/precision ledger before optimizing any downstream stage.", + "blocked_by": "No complete caller, useful112-channel native absorption, precision/compiler reserve or outer recovery is supplied; the one-bank theorem excludes different chronological/multibank architectures." + } + ], + "source_retention_commit": "984e02db73bc2d814e20cbe3830b26ff0c3b09fe", + "fresh_main": "cef4b52f2a59009865bf8eabde1be3f159063703" +} diff --git a/research/involutory-producer-raw-dual/VALIDATION.md b/research/involutory-producer-raw-dual/VALIDATION.md new file mode 100644 index 0000000000..bf88ac4e67 --- /dev/null +++ b/research/involutory-producer-raw-dual/VALIDATION.md @@ -0,0 +1,46 @@ +# Validation coverage and limits + +The exact source-restored4935 forward, unchanged4929 backward prefix and new +backward word are source-pinned. A checks all632 original input rows using the +retained native_core normalized free-word interpreter. The literal suffix is +8 COPY,16 CLEAR,8 rank1 lifts and424 ADDs, with all112 Y and408 helper jobs +retained and already owned C0 cleared. All12544 transpose coefficients are +compared to the actual nonsymmetric F. The source-mutating variant is excluded. + +B independently reconstructs F from R/code and checks all632 rows with a +separate chronological normalized-word interpreter, importing neither A nor +native_core. Its independent sparse Gaussian-integer interpreter checks all +4096 columns of the NEW lift circuits and their absolute phases. Physical +semantics of the inherited original warps remain authenticated source premises; +this is not a new expansion of every original physical warp. All-width coverage +comes from exact individual phase-word identities and source polynomial word +identities, keeping scalar owner coefficients outside tensor powers. + +A's four controls reject repair sign, missing physical lifts, wrong transpose +and erased repair. B's seven controls independently exercise scatter sign, +omitted lifts, erased repairs, borrowed COPY, borrowed CLEAR, wrong transpose +and phase-only corruption. These are semantic falsification controls, not +merely hash mismatches. B's matrix/grade/price checker independently tests the +new F premises, exact off-diagonal inverse witness, all5824 supported grade2 +transports and exact interval bounds; the written CEILING proof supplies the +universal one-bank/all-width quantifiers. + +Eight registered commands run the emitter, independent derivation, independent +audit and ceiling normally and with optimized Python. The emitter loader +changes only source acquisition in memory and regenerates artifacts in scratch; +B's scripts are unchanged and already Git-free. Both launchers authenticate +frozen science before/after replay and compare regenerated scientific receipts. +Gzip-container provenance is exact for retained inputs; regeneration comparison +uses exact decompressed payload and all proof-relevant RESULT fields, with each +container hash independently checked against its own receipt. + +Use README commands or `python3 scripts/research_package.py --package +research/involutory-producer-raw-dual`. Expected individual runtimes are about +5/25/36/2 seconds, with90/120/180/60-second CI timeouts respectively. Source-history and official +export checks are additional transport/publication checks, not mathematics. + +Not run or supplied: complete caller; capacity/stock construction; source-mutating +UNIT-TRANSFER dual; native absorption or chronological multibank implementation; +full precision/compiler allocation; outer recovery; full multiplication cold +replay; independent human or proof-kernel acceptance. The fixed one-bank +obstruction does not generalize to those excluded models. diff --git a/research/involutory-producer-raw-dual/VERIFY.json b/research/involutory-producer-raw-dual/VERIFY.json new file mode 100644 index 0000000000..8b0bc13a6e --- /dev/null +++ b/research/involutory-producer-raw-dual/VERIFY.json @@ -0,0 +1,115 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 90, + "checks": "Exact retained-source/frozen-science authentication; fetch-only AST adaptation; private-scratch regeneration of physical source-restored rawdual. Fresh all632 sourceforward/codedbackward/repairedbackward rows,8 phase-exact H1 lifts,424 ADDs, owned-C0 reset and complete paid bill;4 semantic controls. Gzip payload comparison follows repository policy. No caller/kappa." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 90, + "checks": "Exact retained-source/frozen-science authentication; fetch-only AST adaptation; private-scratch regeneration of physical source-restored rawdual. Fresh all632 sourceforward/codedbackward/repairedbackward rows,8 phase-exact H1 lifts,424 ADDs, owned-C0 reset and complete paid bill;4 semantic controls. Gzip payload comparison follows repository policy. No caller/kappa." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify_independent.py", + "derive" + ], + "timeout_seconds": 120, + "checks": "Independent reconstruction of actual F from R/code, eight native lifts and4096 Gaussian-integer phase columns; no candidate emitter import. Source premises for inherited warps remain explicit." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify_independent.py", + "derive" + ], + "timeout_seconds": 120, + "checks": "Independent reconstruction of actual F from R/code, eight native lifts and4096 Gaussian-integer phase columns; no candidate emitter import. Source premises for inherited warps remain explicit." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify_independent.py", + "audit" + ], + "timeout_seconds": 180, + "checks": "Independent chronological normalized free-word interpreter on all632 old/new rows, exact typed backward prefix, suffix/owned-workspace/helper retention, complete paid bill and7 semantic mutations. Does not import A/native_core; inherited original physical warp semantics remain source premises." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify_independent.py", + "audit" + ], + "timeout_seconds": 180, + "checks": "Independent chronological normalized free-word interpreter on all632 old/new rows, exact typed backward prefix, suffix/owned-workspace/helper retention, complete paid bill and7 semantic mutations. Does not import A/native_core; inherited original physical warp semantics remain source premises." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify_independent.py", + "ceiling" + ], + "timeout_seconds": 60, + "checks": "Self-contained fixed one-parallel-bank corollary: actual F diagonal/F_JJ, exact two-sided offdiagonal inverse witness, all5824 supported grade2 transports and internally regenerated interval price screen. Not a general caller or multiplier ceiling." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify_independent.py", + "ceiling" + ], + "timeout_seconds": 60, + "checks": "Self-contained fixed one-parallel-bank corollary: actual F diagonal/F_JJ, exact two-sided offdiagonal inverse witness, all5824 supported grade2 transports and internally regenerated interval price screen. Not a general caller or multiplier ceiling." + } + ] +} diff --git a/research/involutory-producer-raw-dual/independent/CANDIDATE-HASHES.json b/research/involutory-producer-raw-dual/independent/CANDIDATE-HASHES.json new file mode 100644 index 0000000000..115afa8125 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/CANDIDATE-HASHES.json @@ -0,0 +1,6 @@ +{ + "check.py": "8ec1616bc7336f7999e0139ef0fa1c390a61f52db40c5f87bbc325a3febd0065", + "RAWDUAL-WORD.json.gz": "b82a423cf4a44669d44b168dab3459e9bdb646cefd96c4e4d5f401c567eec6a2", + "RESULT.json": "2fced35c17ecad163657d9ed2f05aeb3bf0ef158b06b6c9e33dbff2200fd2751", + "SOURCES.json": "fe5ab0fc5bb76b4c88cf94df7efc1bb10c19fc8bcabe5116354f2186c014ff61" +} diff --git a/research/involutory-producer-raw-dual/independent/CEILING-NORMAL.log b/research/involutory-producer-raw-dual/independent/CEILING-NORMAL.log new file mode 100644 index 0000000000..d71ff8986e --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/CEILING-NORMAL.log @@ -0,0 +1,70 @@ +{ + "status": "PASS_SCOPED_ONE_BANK_TRANSFER", + "F_diagonal": "12D_J", + "F_JJ": "12I8", + "G": "F-12D_J", + "determinant_lemma_factor": "(-143)^8", + "inverse_witness": "G(143F-12F D_J F)=(143F-12F D_J F)G=143I", + "supported_offdiagonal_grade2": 5824, + "regular_module_rank": "112dimA_f", + "minimum_parallel_grade2_channels": 112, + "interval_proof": "M(t)/5^t increasing; negativeatfundedlowerC coversfullCinterval", + "models": { + "unrealized224H17": { + "target": { + "4": 56, + "7": 14, + "8": 94, + "9": 652, + "17": 224 + }, + "paid": { + "1": 4418, + "2": 824, + "3": 1020, + "4": 254, + "5": 80 + }, + "intervals": { + ".0030217758": [ + "150.262158203082210620506138658847", + "150.262158203082210620506138658848" + ], + ".0034": [ + "143.070799023745749761534310198754", + "143.070799023745749761534310198755" + ] + }, + "endpoint_constructed": false + }, + "after112H2": { + "target": { + "4": 56, + "7": 14, + "8": 94, + "9": 652, + "17": 224 + }, + "paid": { + "1": 4418, + "2": 936, + "3": 1020, + "4": 254, + "5": 80 + }, + "intervals": { + ".0030217758": [ + "-73.269156882594712940928576503039", + "-73.269156882594712940928576503038" + ], + ".0034": [ + "-80.401921647290247704383966403396", + "-80.401921647290247704383966403395" + ] + }, + "endpoint_constructed": false + } + }, + "scope": "FixedfinitecolumnwiseCliffordalphabet. ONEstandaloneparallelbank plusrectangular monomialCliffordcontrols/zero scratch/freebypass. No multibank/nativeabsorption/prefix/directcodedconsumer/approximation or noncolumnwisegeneralization.", + "new_kappa": null +} diff --git a/research/involutory-producer-raw-dual/independent/CEILING-O.log b/research/involutory-producer-raw-dual/independent/CEILING-O.log new file mode 100644 index 0000000000..d71ff8986e --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/CEILING-O.log @@ -0,0 +1,70 @@ +{ + "status": "PASS_SCOPED_ONE_BANK_TRANSFER", + "F_diagonal": "12D_J", + "F_JJ": "12I8", + "G": "F-12D_J", + "determinant_lemma_factor": "(-143)^8", + "inverse_witness": "G(143F-12F D_J F)=(143F-12F D_J F)G=143I", + "supported_offdiagonal_grade2": 5824, + "regular_module_rank": "112dimA_f", + "minimum_parallel_grade2_channels": 112, + "interval_proof": "M(t)/5^t increasing; negativeatfundedlowerC coversfullCinterval", + "models": { + "unrealized224H17": { + "target": { + "4": 56, + "7": 14, + "8": 94, + "9": 652, + "17": 224 + }, + "paid": { + "1": 4418, + "2": 824, + "3": 1020, + "4": 254, + "5": 80 + }, + "intervals": { + ".0030217758": [ + "150.262158203082210620506138658847", + "150.262158203082210620506138658848" + ], + ".0034": [ + "143.070799023745749761534310198754", + "143.070799023745749761534310198755" + ] + }, + "endpoint_constructed": false + }, + "after112H2": { + "target": { + "4": 56, + "7": 14, + "8": 94, + "9": 652, + "17": 224 + }, + "paid": { + "1": 4418, + "2": 936, + "3": 1020, + "4": 254, + "5": 80 + }, + "intervals": { + ".0030217758": [ + "-73.269156882594712940928576503039", + "-73.269156882594712940928576503038" + ], + ".0034": [ + "-80.401921647290247704383966403396", + "-80.401921647290247704383966403395" + ] + }, + "endpoint_constructed": false + } + }, + "scope": "FixedfinitecolumnwiseCliffordalphabet. ONEstandaloneparallelbank plusrectangular monomialCliffordcontrols/zero scratch/freebypass. No multibank/nativeabsorption/prefix/directcodedconsumer/approximation or noncolumnwisegeneralization.", + "new_kappa": null +} diff --git a/research/involutory-producer-raw-dual/independent/CEILING.json b/research/involutory-producer-raw-dual/independent/CEILING.json new file mode 100644 index 0000000000..d71ff8986e --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/CEILING.json @@ -0,0 +1,70 @@ +{ + "status": "PASS_SCOPED_ONE_BANK_TRANSFER", + "F_diagonal": "12D_J", + "F_JJ": "12I8", + "G": "F-12D_J", + "determinant_lemma_factor": "(-143)^8", + "inverse_witness": "G(143F-12F D_J F)=(143F-12F D_J F)G=143I", + "supported_offdiagonal_grade2": 5824, + "regular_module_rank": "112dimA_f", + "minimum_parallel_grade2_channels": 112, + "interval_proof": "M(t)/5^t increasing; negativeatfundedlowerC coversfullCinterval", + "models": { + "unrealized224H17": { + "target": { + "4": 56, + "7": 14, + "8": 94, + "9": 652, + "17": 224 + }, + "paid": { + "1": 4418, + "2": 824, + "3": 1020, + "4": 254, + "5": 80 + }, + "intervals": { + ".0030217758": [ + "150.262158203082210620506138658847", + "150.262158203082210620506138658848" + ], + ".0034": [ + "143.070799023745749761534310198754", + "143.070799023745749761534310198755" + ] + }, + "endpoint_constructed": false + }, + "after112H2": { + "target": { + "4": 56, + "7": 14, + "8": 94, + "9": 652, + "17": 224 + }, + "paid": { + "1": 4418, + "2": 936, + "3": 1020, + "4": 254, + "5": 80 + }, + "intervals": { + ".0030217758": [ + "-73.269156882594712940928576503039", + "-73.269156882594712940928576503038" + ], + ".0034": [ + "-80.401921647290247704383966403396", + "-80.401921647290247704383966403395" + ] + }, + "endpoint_constructed": false + } + }, + "scope": "FixedfinitecolumnwiseCliffordalphabet. ONEstandaloneparallelbank plusrectangular monomialCliffordcontrols/zero scratch/freebypass. No multibank/nativeabsorption/prefix/directcodedconsumer/approximation or noncolumnwisegeneralization.", + "new_kappa": null +} diff --git a/research/involutory-producer-raw-dual/independent/CEILING.md b/research/involutory-producer-raw-dual/independent/CEILING.md new file mode 100644 index 0000000000..0aac89a434 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/CEILING.md @@ -0,0 +1,87 @@ +# Scoped one-parallel-bank ceiling for the source-restored involution + +This is a separate read/derive corollary for the actual source-restored F in +PR4935 head `64c9f99693c92fb370096fb43dbc58a085b30e36`. It does not obstruct +the newly constructed physical raw dual or an eventual direct coded consumer. +Credit the parent for the projection/rank and determinant-lemma argument; +this agent independently checked the actual matrix, grades and intervals. + +Let J={0,7,20,23,86,93,108,111} and D_J its diagonal selector. Exact source +checks give F²=I, diag(F)=12D_J and F_JJ=12I8. Write G=F−12D_J. The matrix +determinant lemma gives det(G)=det(F)det(I8−12F_JJ)=det(F)(−143)^8≠0; +symmetry of F is not assumed. The checker additionally verifies the two-sided +integer witness + + G(143F−12F D_J F)=(143F−12F D_J F)G=143I. + +For the actual X entrance frames U_i, every nonzero off-diagonal F_ij has +Fourier grade2 for U_i U_j*. There are 5,824 such supported pairs, all directly +recomputed from the exact source Clifford library and checked by independent +binary row reduction. The pure diagonal12D_J is monomial. Thus + + pi2(U F U*)=U G U*, + +which is invertible. Since F^-1=F, the source-restored forward uncoding +adapter is U F U*, with scalar exitF on the common-full X chart. The raw-dual +adapter has entrance bar(U) F^T bar(U)* and scalar exitF^T; its projected +matrix is likewise invertible. Fixed nonzero scalar rescaling preserves the +same projected-rank argument. No free ordinary implementation of those exit +matrices is asserted. + +Here is the exact all-width algebra boundary. Fix a finite-phase one-column +Clifford group Gc on the declared address space and its central scalar subgroup +Z. Impose the actual scalar character z=ζ^f at width f; the resulting twisted +algebra A_f has one basis class per projective Clifford Gc/Z. Let H be the +full admitted monomial-Clifford subgroup and B_f its subgroup algebra. Fourier +grade is invariant under both left and right monomial multiplication, so +projection pi2 onto pure grade2 basis classes is a B_f-bimodule map. Phases +are retained, and no integral-domain or commuting-coefficient premise is used. + +The projective algebra faithfully evaluates into columnwise tensor action for +all sufficiently large f. Indeed, choose nonproportional matrix representatives +v_t for the finitely many projective classes. For each t, a product of linear +forms vanishing on each other v_u but not v_t isolates v_t in homogeneous +degree |Gc/Z|−1. Multiply by a linear form nonzero at v_t to obtain an isolating +polynomial at every larger degree. Thus v_t^tensor(f) are linearly independent +at those widths, with their scalar character retained. An exact identity at +all positive widths must therefore hold in A_f at sufficiently large widths, +even with width-dependent owner scalar coefficients. No operator sum is +incorrectly tensor-powered. + +Grant arbitrary rectangular B_f-valued owner pre/post controls L,R, zero +scratch, output selection, copies and a free identity bypass B0. A standalone +ONE parallel bank D of pure Gaussian-Clifford channels satisfies + + pi2(L D R+B0)=L pi2(D) R. + +If the bank has r grade-two channels, its right-hand side has regular-module +rank at most r dim(A_f). All other pure grades project to zero; each grade-two +channel is a group unit. The required adapter projection has rank 112dim(A_f). +Consequently r≥112. This is the same restricted architecture ceiling even +though the scalar port matrix F is now an involution. + +The explicitly UNREALIZED two-call grant 224H17+2H versus two copies of +P={1:2209,2:412,3:510,4:127,5:40} has margin +[150.262158203082210620506138658847,150.262158203082210620506138658848] +at C=.0030217758. Subtracting the necessary 112H2 gives +[−73.269156882594712940928576503039,−73.269156882594712940928576503038]; +at C=.0034 it gives +[−80.401921647290247704383966403396,−80.401921647290247704383966403395]. +All negative coefficient ranks are ≤5 and all positive ranks ≥7. Therefore +M(t)/5^t strictly increases in t=1−C, and negativity at the lower-C endpoint +excludes this stated bill over the entire interval. All 816 inherited helper +jobs are included exactly once. No productive Gaussian endpoint is supplied +by this price grant, and finite scalar/storage/precision/outer costs cannot +rescue its negative relaxation. + +Scope excludes chronological multibank circuits, native absorption or +interleaving, source-prefix access, direct coded consumers, approximate/border +endpoints, nonlinear operations, non-Clifford monomial gates and arbitrary +noncolumnwise address controllers. The actual new raw-dual repair is not +such an uncoding adapter and remains a positive local interface result. +No caller, κ or universal producer ceiling follows. + +Reproduce normal/O with `check_ceiling.py`. This is a source-specific finite +matrix/grade/interval verification supporting the written all-width proof, +not a formal proof-kernel certificate. Apache-2.0; substantial OpenAI Codex +assistance; upstream contributor credit is retained in REVIEW.md/SOURCES.json. diff --git a/research/involutory-producer-raw-dual/independent/DERIVATION-O.log b/research/involutory-producer-raw-dual/independent/DERIVATION-O.log new file mode 100644 index 0000000000..d58386e906 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/DERIVATION-O.log @@ -0,0 +1,115 @@ +{ + "status": "PASS_INDEPENDENT_RAW_DUAL_DERIVATION", + "upstream_head": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "selected_ports": [ + 0, + 7, + 20, + 23, + 86, + 93, + 108, + 111 + ], + "phase_columns": 4096, + "repairs": [ + { + "port": 0, + "Y_owner": 112, + "frame": 142, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "571fa96965fd18bf0327b03d058ae0afa40e5fbe5e657623b424b099782de0da" + }, + { + "port": 7, + "Y_owner": 119, + "frame": 149, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "4bce2acdc60d2ce082cb380a40cd12b643bb80cda28f927f30eec18d92782b2b" + }, + { + "port": 20, + "Y_owner": 132, + "frame": 162, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "f28c4845bac1676ebfb1601029dca5be8a42df70ad27c6ea8deed11cae789eb5" + }, + { + "port": 23, + "Y_owner": 135, + "frame": 165, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "770587040735d9d6c8c0a4bb1ef3ab33e4fa2409c76552aa9315f29e8591a029" + }, + { + "port": 86, + "Y_owner": 198, + "frame": 228, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "d1df0ebdd67da270b84f4fd909e8642905f1ba4b95aef67ae6bb7677dee2f478" + }, + { + "port": 93, + "Y_owner": 205, + "frame": 235, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "a0b0c9a09957696f68c096f51e78772ef21f6f57be12269a1f774208b01ecf65" + }, + { + "port": 108, + "Y_owner": 220, + "frame": 250, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "30e499de43d6ad9285b0020885775e2f376c00a1d4ae7b7bb0ff8bbf41df6ea9" + }, + { + "port": 111, + "Y_owner": 223, + "frame": 253, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "cb057dc6812268d29f87fb5f999d6adf4f805ac5d3ebf44a1a8c0d15dad462f9" + } + ], + "scatter_coefficients": { + "-12": 8, + "-6": 268, + "6": 148 + }, + "added_paid": { + "1": 8 + }, + "complete_expected_paid": { + "1": 2209, + "2": 412, + "3": 510, + "4": 127, + "5": 40 + }, + "owned_scratch": "Only C0 COPY/CLEAR; Y/main/helper owners never overwritten or cleared", + "suffix": "COPY barV_j y_j; apply barF9 barV_j^*; scatter -12(PR)_(j,i); CLEAR C0", + "endpoint": "x-F^T y, y unchanged; all independent helper jobs unchanged", + "semantic_controls": [ + "wrong correction sign", + "unconjugated physical lift", + "adjoint/reversed physical lift" + ], + "full_source_replay": "Pending independent replay of frozen A word; inherited4929 physical event semantics distinct from new4096 phase checks", + "source_mutating_variant": false, + "new_kappa": null +} diff --git a/research/involutory-producer-raw-dual/independent/DERIVATION.json b/research/involutory-producer-raw-dual/independent/DERIVATION.json new file mode 100644 index 0000000000..d58386e906 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/DERIVATION.json @@ -0,0 +1,115 @@ +{ + "status": "PASS_INDEPENDENT_RAW_DUAL_DERIVATION", + "upstream_head": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "selected_ports": [ + 0, + 7, + 20, + 23, + 86, + 93, + 108, + 111 + ], + "phase_columns": 4096, + "repairs": [ + { + "port": 0, + "Y_owner": 112, + "frame": 142, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "571fa96965fd18bf0327b03d058ae0afa40e5fbe5e657623b424b099782de0da" + }, + { + "port": 7, + "Y_owner": 119, + "frame": 149, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "4bce2acdc60d2ce082cb380a40cd12b643bb80cda28f927f30eec18d92782b2b" + }, + { + "port": 20, + "Y_owner": 132, + "frame": 162, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "f28c4845bac1676ebfb1601029dca5be8a42df70ad27c6ea8deed11cae789eb5" + }, + { + "port": 23, + "Y_owner": 135, + "frame": 165, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "770587040735d9d6c8c0a4bb1ef3ab33e4fa2409c76552aa9315f29e8591a029" + }, + { + "port": 86, + "Y_owner": 198, + "frame": 228, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "d1df0ebdd67da270b84f4fd909e8642905f1ba4b95aef67ae6bb7677dee2f478" + }, + { + "port": 93, + "Y_owner": 205, + "frame": 235, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "a0b0c9a09957696f68c096f51e78772ef21f6f57be12269a1f774208b01ecf65" + }, + { + "port": 108, + "Y_owner": 220, + "frame": 250, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "30e499de43d6ad9285b0020885775e2f376c00a1d4ae7b7bb0ff8bbf41df6ea9" + }, + { + "port": 111, + "Y_owner": 223, + "frame": 253, + "rank": 1, + "phase_columns": 512, + "scatter_count": 53, + "compiled_circuit_sha256": "cb057dc6812268d29f87fb5f999d6adf4f805ac5d3ebf44a1a8c0d15dad462f9" + } + ], + "scatter_coefficients": { + "-12": 8, + "-6": 268, + "6": 148 + }, + "added_paid": { + "1": 8 + }, + "complete_expected_paid": { + "1": 2209, + "2": 412, + "3": 510, + "4": 127, + "5": 40 + }, + "owned_scratch": "Only C0 COPY/CLEAR; Y/main/helper owners never overwritten or cleared", + "suffix": "COPY barV_j y_j; apply barF9 barV_j^*; scatter -12(PR)_(j,i); CLEAR C0", + "endpoint": "x-F^T y, y unchanged; all independent helper jobs unchanged", + "semantic_controls": [ + "wrong correction sign", + "unconjugated physical lift", + "adjoint/reversed physical lift" + ], + "full_source_replay": "Pending independent replay of frozen A word; inherited4929 physical event semantics distinct from new4096 phase checks", + "source_mutating_variant": false, + "new_kappa": null +} diff --git a/research/involutory-producer-raw-dual/independent/DERIVATION.md b/research/involutory-producer-raw-dual/independent/DERIVATION.md new file mode 100644 index 0000000000..f8c4c46604 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/DERIVATION.md @@ -0,0 +1,24 @@ +# Independent physical raw-dual derivation for PR4935 + +Exact upstream head: `64c9f99693c92fb370096fb43dbc58a085b30e36`. +The review uses only this source, #4929 head `361f5d4100640177d6a983dd2f336021c75bfd5e`, and an independently written interpreter. A candidate emitter is not imported. + +Let R be the actual eight-by-112 observation matrix, K=R^T/4, and P equal K on selected rows 0,7,20,23,86,93,108,111 and zero elsewhere. Direct exact checks give RK=14I and RP=I. Thus A=I−KR and F=A+12PR agree with the frozen 4935 forward coefficient matrix, and F²=I. The source-mutating unit-transfer variant is excluded. + +The #4929 physical raw-dual main endpoint is Xi=bar(F9)(xi−Σj Aji yj), and Yj=bar(Vj)yj. Every helper is autonomous. For each selected j: + +1. Clear only the already owned C0, assigning its chart to the zero state at bar(Vj). +2. COPY the pure physical Yj into C0. Yj remains unchanged. +3. Apply Lj=bar(F9)bar(Vj)^*, a single rank-one Gaussian transport with its actual monomial factors and phase. +4. Scatter −12(PR)ji C0 into Xi at the common bar(F9) chart. +5. CLEAR C0. No arbitrary owner is erased or overwritten. + +The endpoint is Xi=bar(F9)(xi−Σj Fji yj), Y unchanged, with every original helper output unchanged. This route is derived directly from pure physical Y; it is not obtained by treating COPY/CLEAR as an automatically transposable instruction. + +All eight selected Y frames are rank8: 142,149,162,165,228,235,250,253. The exact Clifford lowering has rank1 for every lift. A separately written sparse Gaussian-integer gate interpreter checks all512 basis columns per lift, including the global phase of bar(Vj) followed by the compiled lift, against bar(F9):4,096 equalities. Wrong unconjugated lifts and reversed-adjoint lifts fail. + +There are424 scatters, each selected source having53. Coefficients are8×−12,268×−6 and148×+6. The initial external summary208/208 was incorrect; this independent audit flagged the difference, and A independently caught and corrected its expectation before freezing any receipt. The coefficient word itself was generated from −12PR. The simple fixed-scalar primitive allowance is2,976 for these scatters; signs do not change that tariff. Add8COPY and16CLEAR, eight Gaussian child protocols and all literal monomial/routing/precision costs. A final bill of {1:2209,2:412,3:510,4:127,5:40} is consistent with the eight added H1 children, but the full emitted program still requires chronological replay. + +This derivation establishes new lift phases and exact coefficient/ownership feasibility. The inherited #4929 full native event semantics and full source632 physical phase audit are separate premises. Normal and optimized derivation checks pass. No caller, decoder, finite compiler reserve, outer admission or κ improvement is claimed. Full frozen-candidate review follows separately. + +Prepared for Chris R/Clear1nsight with substantial OpenAI Codex assistance. Credit Dugongue #4935/#4929, Rohan Arun #1931, Ali Romman #1862, Cinna Davis/1337isnot1337 #4694/#4698 and Cao Yifan/intqwq #4610/native round-three source; all retained notices apply. diff --git a/research/involutory-producer-raw-dual/independent/FILES.json b/research/involutory-producer-raw-dual/independent/FILES.json new file mode 100644 index 0000000000..3ff1cb7ab0 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/FILES.json @@ -0,0 +1,33 @@ +{ + "scope": "Independent one-repair review and separately scoped one-bank corollary; no caller/new kappa", + "files": { + "CANDIDATE-HASHES.json": "4b4a9f51d6369f7517181912e1f26ee0767e0dbf0b394497d08d24bdc212bb62", + "CEILING-NORMAL.log": "8b893bc265c571359e70edb175bde39f0c263c69ecef8bf3e735ef570f281bb2", + "CEILING-O.log": "8b893bc265c571359e70edb175bde39f0c263c69ecef8bf3e735ef570f281bb2", + "CEILING.json": "8b893bc265c571359e70edb175bde39f0c263c69ecef8bf3e735ef570f281bb2", + "CEILING.md": "9f8b76ccba24914a9324092962a516e446bf443f4ab5af1aed454a2e3f7c70e4", + "DERIVATION-O.log": "a0418d2fb9e3413c3a48a52e13e53e8737ca97a606c9d15a4c20d258b3108afb", + "DERIVATION.json": "a0418d2fb9e3413c3a48a52e13e53e8737ca97a606c9d15a4c20d258b3108afb", + "DERIVATION.md": "2f1b8bb0dafab9f5a481d3f53491999b820ec61d0efba4a17841b85320eba55e", + "OFFLINE-RUNS.json": "526949c501aafb4b73391feeca272f67c187e45b5b92cc0209f7bef0a7591f90", + "REVIEW-O.log": "21f199a3d9e48c0332150b2b81a7d0e68521cf3b0aabeafafcb1f2c84e4bcdd4", + "REVIEW.json": "21f199a3d9e48c0332150b2b81a7d0e68521cf3b0aabeafafcb1f2c84e4bcdd4", + "REVIEW.md": "292977896a48f2b18996d6a01d5dde565c8858e38b34033afec7ff74d7698019", + "SOURCES.json": "675de8021fb081cbda64342f2b22071c84a8ee25cd0c242918eefde48644b90d", + "audit.py": "6cfeb5d029ddaf6a737b4f1b9c478282e3542c6ba16f8cba2cf218aa2b58a18a", + "candidate-inputs/RAWDUAL-WORD.json.gz": "b82a423cf4a44669d44b168dab3459e9bdb646cefd96c4e4d5f401c567eec6a2", + "candidate-inputs/REPORT.md": "3c24acbd1eafbf72dec8936d9f2c641a6160587094141b87ede0da1dfce9d39d", + "candidate-inputs/RESULT.json": "2fced35c17ecad163657d9ed2f05aeb3bf0ef158b06b6c9e33dbff2200fd2751", + "candidate-inputs/SOURCES.json": "fe5ab0fc5bb76b4c88cf94df7efc1bb10c19fc8bcabe5116354f2186c014ff61", + "candidate-inputs/check.py": "8ec1616bc7336f7999e0139ef0fa1c390a61f52db40c5f87bbc325a3febd0065", + "check_ceiling.py": "61222ce3b7eb3efc3bcc050f32cac47026035ba0b5d277e4bd309933ed3c2659", + "derive.py": "93234a9697e16c5ff97718ce3b983cb97de96f5e8ffa84990836113f56a0b40b", + "inputs/CODED-WORDS.json.gz": "797bad53122f84aa0f05b602f2bdceb6b50f95a64023799d4f24560d9c61aad6", + "inputs/INVOLUTIVE-WORD.json.gz": "ff2999f022e93e05a250160808aa3c32a08041039d7edfb01068c0308f50c138", + "inputs/R.json": "7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1", + "inputs/SOURCE-WORD.json.gz": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05", + "inputs/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "inputs/intervals.py": "0ce7e7137422d5ffeda22085c81fa88471bbe963100fdad62e659f1e3bf89326", + "replay_independent.py": "89089672e7e71884fc82b16d3df86a4d65e596c30b78dd846545201a1e4ccfa8" + } +} diff --git a/research/involutory-producer-raw-dual/independent/OFFLINE-RUNS.json b/research/involutory-producer-raw-dual/independent/OFFLINE-RUNS.json new file mode 100644 index 0000000000..2b187f0d03 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/OFFLINE-RUNS.json @@ -0,0 +1,53 @@ +{ + "status": "PASS_ALL6_INDEPENDENT_NORMAL_OPTIMIZED_GITFREE_RUNS", + "runs": [ + { + "script": "derive.py", + "optimized": false, + "exit_code": 0, + "seconds": 25.16, + "PATH": "/nonexistent", + "frozen_result_equal": true + }, + { + "script": "derive.py", + "optimized": true, + "exit_code": 0, + "seconds": 24.915, + "PATH": "/nonexistent", + "frozen_result_equal": true + }, + { + "script": "audit.py", + "optimized": false, + "exit_code": 0, + "seconds": 36.206, + "PATH": "/nonexistent", + "frozen_result_equal": true + }, + { + "script": "audit.py", + "optimized": true, + "exit_code": 0, + "seconds": 35.766, + "PATH": "/nonexistent", + "frozen_result_equal": true + }, + { + "script": "check_ceiling.py", + "optimized": false, + "exit_code": 0, + "seconds": 2.116, + "PATH": "/nonexistent", + "frozen_result_equal": true + }, + { + "script": "check_ceiling.py", + "optimized": true, + "exit_code": 0, + "seconds": 2.085, + "PATH": "/nonexistent", + "frozen_result_equal": true + } + ] +} diff --git a/research/involutory-producer-raw-dual/independent/REVIEW-O.log b/research/involutory-producer-raw-dual/independent/REVIEW-O.log new file mode 100644 index 0000000000..34fc9b309f --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/REVIEW-O.log @@ -0,0 +1,40 @@ +{ + "status": "PASS_INDEPENDENT_FROZEN_RAWDUAL_ONE_REPAIR", + "all632_backward_rows": true, + "all632_source_forward_rows": true, + "all632_coded_backward_rows": true, + "target_source_restored": true, + "source_mutating_variant": false, + "literal4929_backward_prefix_unchanged": true, + "owned_C0_final_zero": true, + "all112Y_and408helpers_retained": true, + "paid": { + "1": 2209, + "3": 510, + "2": 412, + "4": 127, + "5": 40 + }, + "source_prefix_l1": "258", + "new_prefix_l1": "258", + "forward_prefix_l1": "457", + "suffix_events": 456, + "scatter_counts": { + "-12": 8, + "-6": 268, + "6": 148 + }, + "actual_frozen_phase_columns": 4096, + "semantic_controls": { + "scatter_sign": true, + "omit_lifts": true, + "erase_all_repairs": true, + "borrowed_copy": true, + "borrowed_clear": true, + "wrong_transpose": true, + "global_phase_only": true + }, + "replay_inherited_phase_scope": "Independent normalized free-word event interpreter. Complete inherited source physical warp semantics remain source premises; all4096NEWlift columns independentlychecked as Gaussian integers.", + "candidate_checker_imported": false, + "new_kappa": null +} diff --git a/research/involutory-producer-raw-dual/independent/REVIEW.json b/research/involutory-producer-raw-dual/independent/REVIEW.json new file mode 100644 index 0000000000..34fc9b309f --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/REVIEW.json @@ -0,0 +1,40 @@ +{ + "status": "PASS_INDEPENDENT_FROZEN_RAWDUAL_ONE_REPAIR", + "all632_backward_rows": true, + "all632_source_forward_rows": true, + "all632_coded_backward_rows": true, + "target_source_restored": true, + "source_mutating_variant": false, + "literal4929_backward_prefix_unchanged": true, + "owned_C0_final_zero": true, + "all112Y_and408helpers_retained": true, + "paid": { + "1": 2209, + "3": 510, + "2": 412, + "4": 127, + "5": 40 + }, + "source_prefix_l1": "258", + "new_prefix_l1": "258", + "forward_prefix_l1": "457", + "suffix_events": 456, + "scatter_counts": { + "-12": 8, + "-6": 268, + "6": 148 + }, + "actual_frozen_phase_columns": 4096, + "semantic_controls": { + "scatter_sign": true, + "omit_lifts": true, + "erase_all_repairs": true, + "borrowed_copy": true, + "borrowed_clear": true, + "wrong_transpose": true, + "global_phase_only": true + }, + "replay_inherited_phase_scope": "Independent normalized free-word event interpreter. Complete inherited source physical warp semantics remain source premises; all4096NEWlift columns independentlychecked as Gaussian integers.", + "candidate_checker_imported": false, + "new_kappa": null +} diff --git a/research/involutory-producer-raw-dual/independent/REVIEW.md b/research/involutory-producer-raw-dual/independent/REVIEW.md new file mode 100644 index 0000000000..4ce6087d2e --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/REVIEW.md @@ -0,0 +1,92 @@ +# Independent review: one source-restored physical raw dual + +**PASS, with no unresolved correctness finding in the reviewed new repair.** +The frozen candidate is A's `RAWDUAL-WORD.json.gz`, SHA256 +`b82a423cf4a44669d44b168dab3459e9bdb646cefd96c4e4d5f401c567eec6a2`. +Reviewed checker `8ec1616bc7336f7999e0139ef0fa1c390a61f52db40c5f87bbc325a3febd0065`, +RESULT `2fced35c17ecad163657d9ed2f05aeb3bf0ef158b06b6c9e33dbff2200fd2751`, +SOURCES `fe5ab0fc5bb76b4c88cf94df7efc1bb10c19fc8bcabe5116354f2186c014ff61`. +The checker is retained for inspection, not imported or executed by the +independent scientific replay. `CANDIDATE-HASHES.json` fixes the full bytes. + +The independent derivation preceded reading A's implementation. Exact R/K/P +identities, backward sign/transpose, physical conjugation and scratch lifecycle +are recorded in DERIVATION.md/DERIVATION.json. The actual coefficient census +is 8×−12,268×−6,148×+6; the incorrect preliminary 208/208 summary was caught +independently by both agents before any erroneous receipt was frozen. + +`replay_independent.py` is a separately written chronological event interpreter, +with no import from A or upstream native_core. `audit.py` confirms: + +- Literal byte-structure equality of the 4929 backward prefix and every + canonical boundary field; all 456 suffix events match the independently + reconstructed coefficient/owner/chart sequence. +- All 632 rows of the inherited 4935 forward word, all 632 rows of the 4929 + coded backward word, and all 632 rows of the new backward word match their + respective source-restored/raw-dual targets on arbitrary original inputs. +- All 112 original Y owners and 408 independent helper owners remain their + prescribed pure returned jobs; only already owned C0 is copied/cleared. + No source-mutating UNIT-TRANSFER variant or extra storage owner is used. +- All original output charts and owned-zero completion are preserved. The + complete paid bill is {1:2209,2:412,3:510,4:127,5:40}. Backward prefix l1 + remains258, forward457; those state bounds are not rounding suffix bounds. +- Every 512 basis columns of all 8 FROZEN native lift circuits satisfy + bar(V_j) followed by the lift =bar(F9), including global phase. These + 4,096 comparisons use a separately written sparse Gaussian-integer gate + interpreter, not ce.zero_state or equality of compiler tableaus. +- Seven semantic controls reject a scatter-sign corruption, omitted lifts, + absent repairs, a borrowed-owner COPY, a borrowed-owner CLEAR, missing + transpose and a global-phase-only circuit corruption. Derivation controls + additionally reject unconjugated and reversed-adjoint physical lifts. + +Normal and optimized derivation/audit/ceiling checks pass locally on +CPython 3.12.3 using only the standard library. Source files are authenticated +before use. There is no remote mutation or caller search in this review. + +The full inherited native physical warp/phase semantics remain the pinned +source contract. The independently implemented all 632 replay checks its +normalized chronological free-word identities and actual typed chart events; +it does not replace a fresh physical amplitude audit of every old source +warp. All NEW lift phases are directly checked as above. Single-word +absolute-phase equalities tensor-lift to every positive column width; scalar +owner coefficients stay outside tensor powers. The result is a physical +source-restored raw dual under those explicitly inherited source premises. +It is not obtained by formally transposing COPY/CLEAR instructions. + +The finite invoice separately retains 424 weighted scatters, conservative +2,976 elementary scalar primitives,8COPY+16CLEAR and emitted monomial passes. +These are ordinary work, not extra Gaussian targets or zero-cost storage. +The bound 13^8*7^416 controls amplification from repair-suffix ADD macros in +the maximum fiber-Euclidean field norm; a future caller still needs the +inherited suffix/error bounds, actual scalar lowering and precision reserve. +No uniform compiler, outer admission or κ is funded by the local endpoint. + +CEILING.md/CEILING.json separately verify the parent's requested standalone +one-bank corollary. Actual diag(F)=12D_J and F_JJ=12I; an exact two-sided +inverse witness proves G=F−12D_J invertible without assuming symmetry. +All 5,824 supported offdiagonal grades are recomputed directly. The scoped +112H2 bound and complete unrealized price relaxation lose across the stated +C interval. This does not invalidate the new repair and excludes direct coded +consumers, chronological native absorption and multibank architectures. + +Reproduction from this directory: + +```sh +python3 -I -W error -B derive.py +python3 -I -W error -B audit.py +python3 -I -W error -B check_ceiling.py +``` + +Repeat with `-O`. The scripts read the local authenticated snapshots; they do +not invoke Git or import the candidate checker. This output folder is an +independent review artifact, not a registered research package or hosted CI. +No independent human or formal proof-kernel acceptance is claimed. + +Credit Dugongue #4935/#4929, Rohan Arun #1931, Ali Romman #1862, +Cinna Davis/1337isnot1337 #4694/#4698/#4470, Cao Yifan/intqwq's actual native +round-three source beyond #4610, zxv, Jacob Alan Sussman and all retained +contributors. Parent proposed the physical COPY/lift/scatter route and the +one-bank rank argument; A emitted it; this agent independently derived and +reviewed the new operator, coefficient invoice, chronology and phases. +Prepared for Chris R/Clear1nsight with substantial OpenAI Codex assistance. +Apache-2.0; source-specific notices remain authoritative. diff --git a/research/involutory-producer-raw-dual/independent/SOURCES.json b/research/involutory-producer-raw-dual/independent/SOURCES.json new file mode 100644 index 0000000000..4f58cd185f --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/SOURCES.json @@ -0,0 +1,47 @@ +{ + "scope": "Independent review inputs, upstream code only; no A emitter imported", + "files": [ + { + "path": "inputs/R.json", + "source_commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "source_path": "research/native-involutive-port-transfer/R.json", + "git_blob": "691598d8775cb6949c867449eec1da0a5e19e81d", + "sha256": "7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1" + }, + { + "path": "inputs/SOURCE-WORD.json.gz", + "source_commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "source_path": "research/native-involutive-port-transfer/SOURCE-WORD.json.gz", + "git_blob": "46d929df83817b85a5387bcdb9745e0627d6366e", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05" + }, + { + "path": "inputs/clifford_exact.py", + "source_commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "source_path": "research/native-involutive-port-transfer/clifford_exact.py", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "inputs/INVOLUTIVE-WORD.json.gz", + "source_commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "source_path": "research/native-involutive-port-transfer/INVOLUTIVE-WORD.json.gz", + "git_blob": "eac634fb1d09428aa6715a47d652ae701dd0efc5", + "sha256": "ff2999f022e93e05a250160808aa3c32a08041039d7edfb01068c0308f50c138" + }, + { + "path": "inputs/CODED-WORDS.json.gz", + "source_commit": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "source_path": "research/native-center-free-code/CODED-WORDS.json.gz", + "git_blob": "935fedd9c9a77f870dd6afbabbf56c8ea6e321d4", + "sha256": "797bad53122f84aa0f05b602f2bdceb6b50f95a64023799d4f24560d9c61aad6" + }, + { + "path": "inputs/intervals.py", + "source_commit": "624de9dc66858af0945e5f8a0942488d62280d43", + "source_path": "research/higher-moment-strictification/verify.py", + "git_blob": "4b24a5096154736ce060474eb8c72dc64c303699", + "sha256": "0ce7e7137422d5ffeda22085c81fa88471bbe963100fdad62e659f1e3bf89326" + } + ] +} diff --git a/research/involutory-producer-raw-dual/independent/audit.py b/research/involutory-producer-raw-dual/independent/audit.py new file mode 100644 index 0000000000..4a7b2fbaf0 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/audit.py @@ -0,0 +1,87 @@ +"""Independent frozen-word review, not importing candidate checker/native_core. +Apache-2.0; substantial OpenAI Codex assistance; source credit in REVIEW.md. +""" +from pathlib import Path +from fractions import Fraction as Q +from hashlib import sha256 +from collections import Counter +import json,gzip,sys,types +HERE=Path(__file__).resolve().parent +def load_own(name): + env={'__file__':str(HERE/(name+'.py')),'__name__':'independent_'+name} + exec(compile((HERE/(name+'.py')).read_bytes(),str(HERE/(name+'.py')),'exec'),env) + return types.SimpleNamespace(**env) +def need(v,m): + if not v:raise ValueError(m) +def read(path):return json.loads(gzip.decompress(path.read_bytes())) +def main(): + for n,h in json.loads((HERE/'CANDIDATE-HASHES.json').read_text()).items():need(sha256((HERE/'candidate-inputs'/n).read_bytes()).hexdigest()==h,'Candidate freeze '+n) + derive=load_own('derive');engine=load_own('replay_independent') + for row in json.loads((HERE/'SOURCES.json').read_text())['files']:need(sha256((HERE/row['path']).read_bytes()).hexdigest()==row['sha256'],'Pinned upstream '+row['path']) + coded=read(HERE/'inputs/CODED-WORDS.json.gz');forward=read(HERE/'inputs/INVOLUTIVE-WORD.json.gz');w=read(HERE/'candidate-inputs/RAWDUAL-WORD.json.gz') + c=coded['canonical'];F=[[Q(x) for x in row] for row in forward['F']] + need(w['canonical']==c,'Entire canonical boundary unchanged') + need(w['target_F']==forward['F'],'Frozen source-restored F unchanged') + need(w['selected_ports']==list(derive.S),'Selected sources unchanged') + n=len(coded['programs']['backward']);need(w['program'][:n]==coded['programs']['backward'],'Literal4929 backward prefix unchanged') + need(w['program'][n:]==w['repair_suffix'],'Literal suffix declared exactly') + # Independently reconstruct only the audited correction, from source R. + R=[[Q(x) for x in row] for row in json.loads((HERE/'inputs/R.json').read_text())] + K=[[R[k][i]/4 for k in range(8)] for i in range(112)] + P=[K[j] if j in derive.S else [Q(0)]*8 for j in range(112)] + D=[[12*x for x in row] for row in derive.mm(P,R)] + expected_suffix=[] + for j in derive.S: + f=c['final'][112+j] + expected_suffix.extend([['scalar',['clear',['C',0]],f],['scalar',['copy',['C',0],['L',112+j]],f],['center',0,f,1,1]]) + for i,v in enumerate(D[j]): + if v:expected_suffix.append(['scalar',['add',['L',i],['C',0],(-v).numerator,(-v).denominator],1]) + expected_suffix.append(['scalar',['clear',['C',0]],0]) + need(w['repair_suffix']==expected_suffix,'Actual coefficient/sign/owners/suffix chronology') + old,op,om,oe=engine.replay(c,coded['programs']['backward']) + A=[[Q(i==j)-v for j,v in enumerate(row)] for i,row in enumerate(derive.mm(K,R))] + need(old[:632]==engine.expected(A,True),'Independent all632 coded backward rows') + fr,fp,fm,fe=engine.replay(forward['canonical'],forward['program']) + need(fr[:632]==engine.expected(F,False),'Independent all6324935 forward rows') + rows,paid,mx,ev=engine.replay(c,w['program']) + target=engine.expected(F,True) + need(rows[:632]==target,'Independent all632 physical-normalized rawdual rows') + need(paid==fp==Counter({1:2209,2:412,3:510,4:127,5:40}),'Complete paid source+suffix bill') + need(all(rows[i]=={(i,()):Q(1)} for i in range(112,632)),'Every Y/helper original owner retained') + ce=types.ModuleType('independent_candidate_ce');sys.modules[ce.__name__]=ce + exec(compile((HERE/'inputs/clifford_exact.py').read_bytes(),'pinned_ce','exec'),ce.__dict__) + barT=derive.conjugate(ce.canonical_frame(9,c['frames'][1]),ce) + need(len(w['native_lifts'])==8,'Exactly8 actual native maps') + phase_columns=0 + for j,rec in zip(derive.S,w['native_lifts']): + fi=c['final'][112+j] + need((rec['port'],rec['source_owner'],rec['from'],rec['to'],rec['rank'])==(j,112+j,fi,1,1),'Literal native boundary identity') + need(rec['lowering']['rank']==1 and rec['actual_raw_dual_conjugation'] is True,'Native rank/actualbar binding') + barV=derive.conjugate(ce.canonical_frame(9,c['frames'][fi]),ce) + for k in range(512): + need(derive.sparse(barV.circuit+rec['literal_circuit'],k)==derive.sparse(barT.circuit,k),'Actual frozen lift including phase') + phase_columns+=1 + controls={} + def rejected(name,word,error=None): + try:r,_,_,_=engine.replay(c,word) + except ValueError as e: + if error:need(error in str(e),name+' intended rejection') + controls[name]=True + else: + need(r[:632]!=target,name+' must change endpoint');controls[name]=True + bad=json.loads(json.dumps(w['program']));idx=next(i for i in range(n,len(bad)) if bad[i][0]=='scalar' and bad[i][1][0]=='add');bad[idx][1][3]*=-1;rejected('scatter_sign',bad) + bad=w['program'][:n]+[e for e in w['repair_suffix'] if e[0]!='center'];rejected('omit_lifts',bad,'Scalar source chart') + rejected('erase_all_repairs',w['program'][:n]) + bad=json.loads(json.dumps(w['program']));idx=next(i for i in range(n,len(bad)) if bad[i][0]=='scalar' and bad[i][1][0]=='copy');bad[idx][1][1]=['L',112];rejected('borrowed_copy',bad,'Borrowed overwrite') + bad=json.loads(json.dumps(w['program']));idx=next(i for i in range(n,len(bad)) if bad[i][0]=='scalar' and bad[i][1][0]=='clear');bad[idx][1][1]=['L',224];rejected('borrowed_clear',bad,'Borrowed erasure') + need(target!=engine.expected([list(x) for x in zip(*F)],True),'F transpose distinction') + controls['wrong_transpose']=True + # Frozen actual circuit corruption, separate from symbolic chart replay. + rec=w['native_lifts'][0];badcirc=rec['literal_circuit']+[['phase',1]];fi=rec['from'];barV=derive.conjugate(ce.canonical_frame(9,c['frames'][fi]),ce) + need(derive.sparse(barV.circuit+badcirc,0)!=derive.sparse(barT.circuit,0),'Globalphase-only semantic corruption') + controls['global_phase_only']=True + coeff=Counter(Q(e[1][3],e[1][4]) for e in expected_suffix if e[0]=='scalar' and e[1][0]=='add') + result={'status':'PASS_INDEPENDENT_FROZEN_RAWDUAL_ONE_REPAIR','all632_backward_rows':True,'all632_source_forward_rows':True,'all632_coded_backward_rows':True,'target_source_restored':True,'source_mutating_variant':False,'literal4929_backward_prefix_unchanged':True,'owned_C0_final_zero':not rows[632],'all112Y_and408helpers_retained':True,'paid':dict(paid),'source_prefix_l1':str(om),'new_prefix_l1':str(mx),'forward_prefix_l1':str(fm),'suffix_events':len(expected_suffix),'scatter_counts':{str(v):count for v,count in sorted(coeff.items())},'actual_frozen_phase_columns':phase_columns,'semantic_controls':controls,'replay_inherited_phase_scope':'Independent normalized free-word event interpreter. Complete inherited source physical warp semantics remain source premises; all4096NEWlift columns independentlychecked as Gaussian integers.','candidate_checker_imported':False,'new_kappa':None} + print(json.dumps(result,indent=2)) + if '--emit' in sys.argv:(HERE/'REVIEW.json').write_text(json.dumps(result,indent=2)+'\n') +if __name__=='__main__':main() diff --git a/research/involutory-producer-raw-dual/independent/candidate-inputs/RAWDUAL-WORD.json.gz b/research/involutory-producer-raw-dual/independent/candidate-inputs/RAWDUAL-WORD.json.gz new file mode 100644 index 0000000000..d6343a134e Binary files /dev/null and b/research/involutory-producer-raw-dual/independent/candidate-inputs/RAWDUAL-WORD.json.gz differ diff --git a/research/involutory-producer-raw-dual/independent/candidate-inputs/REPORT.md b/research/involutory-producer-raw-dual/independent/candidate-inputs/REPORT.md new file mode 100644 index 0000000000..d211108a00 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/candidate-inputs/REPORT.md @@ -0,0 +1,196 @@ +# A literal physical raw dual for the source-restored eight-repair transfer + +The one bounded candidate succeeds. Starting from the actual backward word of +PR #4929, eight owned rank1 lifts and424 common-full-chart ADDs return + + X' = X - F^T Y, Y' = Y, helpers' = helpers, + +in the retained raw-dual source gauges. F is exactly the source-restored +involution emitted by PR #4935. Every one of632 arbitrary input rows is +checked; all408 independent helper jobs survive once. The complete paid +profile is {1:2209,2:412,3:510,4:127,5:40}, matching that forward producer. +This supplies its previously open physical raw dual, not a profitable caller +or improved kappa. The source-mutating UNIT-TRANSFER variant is excluded. + +## Consumed contracts and source bytes + +The fixed prospective scope was authorized by the root's public4902 claim +before emitting this word. Exact consumed heads are + +- #4935:64c9f99693c92fb370096fb43dbc58a085b30e36, + research/native-involutive-port-transfer/INVOLUTIVE-WORD.json.gz; +- #4929:361f5d4100640177d6a983dd2f336021c75bfd5e, + research/native-center-free-code/CODED-WORDS.json.gz; +- native source:20bb93cd990d2ff683e4d0fc56b87a42cd5d3296, + research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz. + +SOURCES.json records exact source bytes, paths and the checker hash. The +4935 SOURCE-WORD payload decompresses byte-for-byte to the authenticated +native payload, whose compressed hash is7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05. +The frame, start, finish and port data agree. The compiler is the native +exact Clifford engine at that source pin. The actual raw-dual convention is +primitive-wise conjugation from prune_native.conjugate, preserving circuit +order. It is not an adjoint/reversed-frame approximation. + +The emitter consumes the already emitted4929 backward program unchanged as +an identical typed chronological prefix; it does not regenerate an abstract transpose +of the forward program. It then appends the concrete suffix below. It also +freshly replays the actual4935 source-restored forward artifact, the actual +4929 backward prefix and the complete new backward word on all632 original +owner columns. This reuses the pinned native_core semantic interpreter; +it is not a separately implemented interpreter of the entire inherited word. +B's separate review supplies the independent interpreter and phase checks. + +## Exact matrix and physical construction + +Use4935's exact8-by112 observation R, K=R^T/4, and P equal to K on rows +J={0,7,20,23,86,93,108,111}, zero elsewhere. The inherited code is A, and + + Delta=12PR, F=A+Delta. + +All correction coefficients are dyadic. The checker authenticates R and +compares F entry-by-entry to the committed4935 forward F; the matrix is +non-symmetric, so a missing transpose is a discriminating error. It does not +infer a physical backward word from F^2=I. + +After the actual4929 backward program, every Y_j has the pure physical +returned value bar(V_j)y_j in its actual rank8 exit chart, while every X_i +is in the common bar(FULL) chart. Helpers are already restored. For each +selected j, the suffix is literally + +1. CLEAR the already owned C0 and tag it with Y_j's actual exit chart. +2. COPY the returned Y_j into C0, without changing Y_j. +3. Apply L_j=bar(FULL)bar(V_j)^-1 to C0, an ordinary rank1 Gaussian child. +4. At the common full chart, perform X_i+=-Delta[j,i] C0 for every nonzero + coefficient in that selected row. +5. CLEAR C0 to its final empty owned state. + +The eight source Y exit frames are142,149,162,165,228,235,250,253. Every L_j +is constructed by actual primitive-wise conjugation of the forward +V_j-to-FULL word and lowered to two monomial maps and one rank1 Gaussian. +All eight compiled words agree with the direct words in both tableau and +zero-input state, fixing absolute phase. Each circuit has exactly two each +of native D,P,X,phase primitives and one C primitive. These are actual +lowered words in RAWDUAL-WORD, not a rank-only bill. + +In normalized coordinates the added X_i term is exactly +-Delta[j,i]y_j. Thus the new endpoint is X-A^TY-Delta^TY=X-F^TY. All112 +physical Y output arrays are read-only during the suffix, all408 helpers +are untouched, and no other arbitrary input is overwritten. C0 already +belongs to the source and earns no productive credit. No new arbitrary +owner or extra storage array is introduced. + +## Exact raw duality and allwidth phase + +Let U_in,U_out be the block-diagonal source input/output frame operators. +The physical source-restored forward endpoint is + + M_f = U_out S_F U_in^-1, + S_F = [I 0; F I] on mains, identity on helpers. + +Unitary source frames give U^-T=bar(U). The new literal backward program is +verified in the conjugated source gauges, with + + M_b = bar(U_out) S_F^-T bar(U_in)^-1. + +Consequently M_b=M_f^-T including the actual native phases. All12544 entries +of the backward main transfer are compared to the transposed forward F, +and all632 original owner rows are checked. This is source-restored duality; +no relation to4935's explicitly source-mutating second word is asserted. + +Each native frame identity and compiled lift is an equality of single +absolute-phase Clifford words. At column multiplicity f, lift each word by +its actual columnwise tensor power; conjugation, products and inverse +relations persist. Scalar owner-space coefficients remain outside those +tensor powers. The semantic replay retains native free-word order, so it +proves polynomial identities for the source assignment at every positive +width. No one-column equality of an operator sum is tensor-powered, and no +global phase is discarded. The added COPY/CLEAR contract is explicit; we do +not claim that these owned instructions are a literal reversed-transpose +instruction listing of the forward repairs. + +## Complete recursive and finite invoice + +The4929 backward baseline pays {1:2201,2:412,3:510,4:127,5:40}. The suffix +adds exactly8H1 and no other Gaussian job. Final paid profile is therefore +{1:2209,2:412,3:510,4:127,5:40}, the exact4935 forward profile. There are +still408 helper targets with profile {4:28,7:7,8:47,9:326}; none is consumed, +identified, subtracted or credited twice. The artifact canonical.local_profile is inherited4929 metadata; downstream +users must use the freshly counted RESULT.json paid field for the new bill, +not that baseline metadata. The changed main transfer is F^T, +not the old A^T. No additional independent main Gaussian target is claimed. +Relative to the old632 producer, eight H8 centre calls have become eight +H1 repairs; this is a changed transfer contract, not unchanged-output saving. + +The complete new backward word has28501 typed events, with the old28045 +coded events as an identical typed prefix and456 appended events: +8 COPY,16 CLEAR,8 paid Gaussian lifts and424 weighted ADDs. The ADD +coefficient census is -12 eight times,-6 268 times,+6 148 times. +These424 weighted ADD instructions are not2976 extra Gaussian calls. + +For comparison with the inherited scalar allowance, use the same integer +coefficient tariff + + tariff(c)=3+(bit_length(abs(numerator))-1)+popcount(abs(numerator)) + +(bit_length(denominator)-1). + +A coefficient of magnitude6 has tariff7, magnitude12 has tariff8. Hence +416*7+8*8=2976 is a conservative elementary scalar-primitive allowance for +those424 weighted ADDs. Signs do not change that tariff. Charging every +COPY/CLEAR one array pass and every one of the64 emitted monomial circuit +primitives one pass gives at most2976+24+64=3064 additional elementary +whole-array passes, besides the8 recursively paid H1 jobs. This deliberately +retains identity/phase primitives rather than silently subtracting them. +Columnwise index/phase evaluation retains its O(f) work per entry. The array +volume N is the inherited supplier embedding's volume, not an extra small +standalone nine-bit cost. Peak owned storage stays at the one existing C0. + +The frozen semantic prefix norm remains258 backward (4935 forward457). +That coefficient bound is not a suffix rounding-error bound. In the maximum +of fiber Euclidean field norms, a weighted ADD by c has norm at most1+|c|; +owned COPY/CLEAR under their declared workspace contract and exact unitary +maps have norm at most1. A conservative bound for every repair-suffix error +amplification is therefore13^8*7^416, independent of f. Multiply it by an +appropriate inherited suffix bound when assigning errors inside the old +prefix. One may allocate the added eight Gaussian/local rounding errors so +their sum after this finite amplification fits the chosen reserve. This +requires an actual precision allocation by a future caller; no recursive +compiler reserve or outer recovery is funded here. Fiber entrywise norms +also require the relevant square-root volume conversion. Fixed constants +permit the usual logarithmic guard precision under the admitted source +convention; they are not a new precision theorem for a multiplier. + +## Replay, controls and audit history + +From this worktree root, read-only: + + python3 -I -B outputs/pr4935-rawdual-repair/check.py + python3 -I -O -B outputs/pr4935-rawdual-repair/check.py + +Both reproduce identical frozen artifact and receipt bytes. Explicit --emit +writes only this local folder. Four controls reject a repair sign error, +omitted physical rank1 lifts, wrong transpose and absent repair. These are +finite rejection controls, not a proof-kernel or complete multiplier audit. + +During development an assumed balanced -6/+6 sign census208/208 was rejected +by the guard. Direct R reconstruction gives268/148, independently confirmed +by B. The generated scatter always used exact -12PR; endpoint/paid checks +had already passed before that census guard. No incorrect frozen receipt was +issued. The current normal/optimized receipts contain the corrected census. + +The rawdual artifact hash is +b82a423cf4a44669d44b168dab3459e9bdb646cefd96c4e4d5f401c567eec6a2. +No remote writes, family scan, fresh decoder, complete caller or new kappa +claim is part of this local finding. + +## Credit + +Credit Dugongue's4935 current-source involutive transfer and4929 autonomous +coded producer; Rohan Arun's1931 eight-repair/source-reflection construction; +Ali Romman's1862 ordered-family/native-transfer framework; Cinna Davis / +1337isnot1337's4694/4698 and retained4470 lineage; Cao Yifan/intqwq's actual +round-three source beyond4610; and the retained E8/scalar/Clifford/compiler/ +precision/outer contributors, zxv and Jacob Alan Sussman. The root proposed +this physical backward COPY-lift-scatter repair; this agent emitted and +checked it, and B independently audits it. Substantial OpenAI Codex +assistance; no human or Lean/kernel acceptance is claimed. Apache-2.0. diff --git a/research/involutory-producer-raw-dual/independent/candidate-inputs/RESULT.json b/research/involutory-producer-raw-dual/independent/candidate-inputs/RESULT.json new file mode 100644 index 0000000000..9f157fd273 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/candidate-inputs/RESULT.json @@ -0,0 +1,59 @@ +{ + "Y_owners_retained": 112, + "added_rank1_calls": 8, + "all12544_transpose_coefficients_checked": true, + "all632_forward_and_backward_rows_checked": true, + "arbitrary_original_inputs": 632, + "compiler_or_outer_funded": false, + "controls": { + "erase_repair": true, + "omit_rank1_lift": true, + "repair_sign": true, + "wrong_transpose": true + }, + "events": 28501, + "extra_owned_arrays": 0, + "forward_prefix_l1": "457", + "full_caller": false, + "independent_helpers_retained": 408, + "new_kappa": false, + "new_prefix_l1": "258", + "owned_C0_final_zero": true, + "paid": { + "1": 2209, + "2": 412, + "3": 510, + "4": 127, + "5": 40 + }, + "pins": { + "4929": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "4935": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "native": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296" + }, + "scatter_coefficient_counts": { + "-12": 8, + "-6": 268, + "6": 148 + }, + "scatter_scalar_primitive_allowance": 2976, + "single_word_phase_checks": 8, + "source_X_mutation": false, + "source_backward_paid": { + "1": 2201, + "2": 412, + "3": 510, + "4": 127, + "5": 40 + }, + "source_backward_prefix_l1": "258", + "status": "PASS_ONE_ACTUAL632_SOURCE_RESTORED_RAWDUAL_NOT_CALLER", + "suffix_census": { + "ADD": 424, + "CLEAR": 16, + "COPY": 8, + "GaussianH1": 8 + }, + "suffix_events": 456, + "word_sha256": "b82a423cf4a44669d44b168dab3459e9bdb646cefd96c4e4d5f401c567eec6a2" +} diff --git a/research/involutory-producer-raw-dual/independent/candidate-inputs/SOURCES.json b/research/involutory-producer-raw-dual/independent/candidate-inputs/SOURCES.json new file mode 100644 index 0000000000..a961a85f44 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/candidate-inputs/SOURCES.json @@ -0,0 +1,56 @@ +{ + "checker_sha256": "8ec1616bc7336f7999e0139ef0fa1c390a61f52db40c5f87bbc325a3febd0065", + "consumed": { + "R": { + "commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "path": "research/native-involutive-port-transfer/R.json", + "sha256": "7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1" + }, + "ce": { + "commit": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296", + "path": "research/t74-native-fast/vendor/native/new/code/borrow/vendor/clifford/clifford_exact.py", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + "code": { + "commit": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "path": "research/native-center-free-code/CODE.json", + "sha256": "8be7f3f073b7981ec91c6af43edff0ac8a89f4824ef6026ae758c287dd6c03d0" + }, + "coded": { + "commit": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "path": "research/native-center-free-code/CODED-WORDS.json.gz", + "sha256": "797bad53122f84aa0f05b602f2bdceb6b50f95a64023799d4f24560d9c61aad6" + }, + "core": { + "commit": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "path": "research/native-center-free-code/native_core.py", + "sha256": "178ff80824a012970fc9435f122152da03c7e6bdc3a7de12136fe03e05cf24fe" + }, + "forward": { + "commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "path": "research/native-involutive-port-transfer/INVOLUTIVE-WORD.json.gz", + "sha256": "ff2999f022e93e05a250160808aa3c32a08041039d7edfb01068c0308f50c138" + }, + "original": { + "commit": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296", + "path": "research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05" + }, + "proof": { + "commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "path": "research/native-involutive-port-transfer/PROOF.md", + "sha256": "baeb220fa1b0a649ab87b5234925e16e32fb47d92a588e8a8c5c75d0f2b08da3" + }, + "prune": { + "commit": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296", + "path": "research/kappa-function-composition/complex/prune_native.py", + "sha256": "f2b37c183a10922eabc8e0436b426a08866430e96bd0adc7e178951c7fbb5257" + }, + "source4935": { + "commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "path": "research/native-involutive-port-transfer/SOURCE-WORD.json.gz", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05" + } + }, + "schema_version": 1 +} diff --git a/research/involutory-producer-raw-dual/independent/candidate-inputs/check.py b/research/involutory-producer-raw-dual/independent/candidate-inputs/check.py new file mode 100644 index 0000000000..c394264aa1 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/candidate-inputs/check.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +"""One physical source-restored4935 raw dual. Apache-2.0; Codex assistance. +Pinned sources are read only. This script writes only here with --emit. +""" +from pathlib import Path +from fractions import Fraction as Q +from collections import Counter +from hashlib import sha256 +import ast,gzip,json,subprocess,sys,types +HERE=Path(__file__).resolve().parent +P4935='64c9f99693c92fb370096fb43dbc58a085b30e36' +P4929='361f5d4100640177d6a983dd2f336021c75bfd5e' +NATIVE='20bb93cd990d2ff683e4d0fc56b87a42cd5d3296' +PORTS=[0,7,20,23,86,93,108,111] +SPECS={ + 'forward':(P4935,'research/native-involutive-port-transfer/INVOLUTIVE-WORD.json.gz'), + 'R':(P4935,'research/native-involutive-port-transfer/R.json'), + 'proof':(P4935,'research/native-involutive-port-transfer/PROOF.md'), + 'source4935':(P4935,'research/native-involutive-port-transfer/SOURCE-WORD.json.gz'), + 'coded':(P4929,'research/native-center-free-code/CODED-WORDS.json.gz'), + 'core':(P4929,'research/native-center-free-code/native_core.py'), + 'code':(P4929,'research/native-center-free-code/CODE.json'), + 'original':(NATIVE,'research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz'), + 'ce':(NATIVE,'research/t74-native-fast/vendor/native/new/code/borrow/vendor/clifford/clifford_exact.py'), + 'prune':(NATIVE,'research/kappa-function-composition/complex/prune_native.py'), +} +def need(c,m): + if not c:raise ValueError(m) +def fetch(pin,path):return subprocess.check_output(['git','--no-replace-objects','show',pin+':'+path]) +def module(name,data): + m=types.ModuleType(name);m.__file__=name+'.py';sys.modules[name]=m + exec(compile(data,name+'.py','exec'),m.__dict__);return m +def encode(x):return (json.dumps(x,indent=2,sort_keys=True)+'\n').encode() +def main(): + raw={k:fetch(*v)for k,v in SPECS.items()} + need(sha256(raw['original']).hexdigest()=='7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05','native source hash') + need(sha256(raw['R']).hexdigest()=='7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1','4935 R source hash') + need(sha256(raw['ce']).hexdigest()=='2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962','native compiler hash') + need(gzip.decompress(raw['source4935'])==gzip.decompress(raw['original']),'4935 exact underlying source') + V=module('rawdual4935_native_core',raw['core']);ce=module('rawdual4935_exact',raw['ce']) + definitions=[x for x in ast.parse(raw['prune']).body if isinstance(x,ast.FunctionDef)and x.name=='conjugate'] + env={};exec(compile(ast.Module(body=definitions,type_ignores=[]),'pinned_conjugate','exec'),env) + bar=lambda op:env['conjugate'](ce,op) + forward=json.loads(gzip.decompress(raw['forward']));coded=json.loads(gzip.decompress(raw['coded']));original=json.loads(gzip.decompress(raw['original'])) + c=coded['canonical'];need(c['frames']==original['canonical']['frames'] and c['start']==original['canonical']['start'] and c['final']==original['canonical']['final'],'native boundary identity') + need(forward['canonical']==c or all(forward['canonical'][k]==c[k]for k in ('frames','start','final','ports')),'4935 unchanged physical boundaries') + need(forward['selected_ports']==PORTS,'source-restored selected ports') + A=[[Q(x)for x in row]for row in json.loads(raw['code'])['A']] + F=[[Q(x)for x in row]for row in forward['F']] + R=[[Q(x)for x in row]for row in json.loads(raw['R'])] + correction=[[12*sum((R[k][j]/4)*R[k][i]for k in range(8)) if j in PORTS else Q(0)for i in range(112)]for j in range(112)] + need(F==[[A[j][i]+correction[j][i]for i in range(112)]for j in range(112)],'exact source-restored F=A+12PR') + need(F!=[list(x)for x in zip(*F)],'transpose distinction is nontrivial') + def target(matrix,back): + out=[V.identity(i)for i in range(632)] + for j in range(112): + for i,v in enumerate(matrix[j]): + if v:V.add(out[i]if back else out[112+j],V.identity(112+j)if back else V.identity(i),-v if back else v) + return out + oldrows,oldpaid,oldmax=V.replay(c,coded['programs']['backward'],True) + need([oldrows[i]for i in range(632)]==target(A,True),'fresh all632 coded backward endpoint') + frows,fpaid,fmax=V.replay(forward['canonical'],forward['program'],False) + need([frows[i]for i in range(632)]==target(F,False),'fresh all632 source-restored4935 forward endpoint') + suffix=[];lifts=[];allcoeff=[] + for j in PORTS: + fi=c['final'][112+j];need(c['final'][:112]==[1]*112,'common full X exits') + # Chronological inverse source-Y frame then full frame, then actual bar. + op=bar(ce.canonical_frame(9,c['frames'][fi]).adjoint().then(ce.canonical_frame(9,c['frames'][1]))) + cert,compiled=ce.lower_child(op) + need(cert['rank']==1 and op.tab==compiled.tab and op.zero_state()==compiled.zero_state(),'raw-dual lifting including global phase') + lifts.append({'port':j,'source_owner':112+j,'from':fi,'to':1,'rank':1,'lowering':cert,'literal_circuit':compiled.circuit,'actual_raw_dual_conjugation':True}) + suffix += [['scalar',['clear',['C',0]],fi],['scalar',['copy',['C',0],['L',112+j]],fi],['center',0,fi,1,1]] + for i,v in enumerate(correction[j]): + if v: + z=-v;allcoeff.append(z);suffix.append(['scalar',['add',['L',i],['C',0],z.numerator,z.denominator],1]) + suffix.append(['scalar',['clear',['C',0]],0]) + program=coded['programs']['backward']+suffix + rows,paid,maxnorm=V.replay(c,program,True);expected=target(F,True) + need([rows[i]for i in range(632)]==expected,'all632 exact rawinverse-transpose endpoint') + need(all(rows[i]==V.identity(i)for i in range(112,632)),'Y and all408 independent helpers unchanged logically') + need(paid==Counter({1:2209,2:412,3:510,4:127,5:40}) and paid==fpaid,'complete paid profile matches forward') + need(Counter(map(str,allcoeff))==Counter({'-12':8,'-6':268,'6':148}),'424 fixed dyadic scatter coefficients') + # Every coefficient of the normalized transpose product is checked directly: + # forward upper/lower shear cancellation is exact with arbitrary F. + need(all(expected[i].get((112+j,()),Q(0))+F[j][i]==0 for i in range(112)for j in range(112)),'all12544 transpose coefficients') + controls={} + bad=json.loads(json.dumps(program));k=next(i for i in range(len(coded['programs']['backward']),len(bad))if bad[i][0]=='scalar'and bad[i][1][0]=='add');bad[k][1][3]*=-1 + rr,_,_=V.replay(c,bad,True);controls['repair_sign']=any(rr[i]!=expected[i]for i in range(632)) + bad=[e for e in program if not(e[0]=='center'and e[4]==1)] + try:V.replay(c,bad,True) + except ValueError:controls['omit_rank1_lift']=True + else:controls['omit_rank1_lift']=False + controls['wrong_transpose']=expected!=target([list(x)for x in zip(*F)],True) + controls['erase_repair']=any(oldrows[i]!=expected[i]for i in range(632)) + need(all(controls.values()),'semantic controls') + artifact={'schema_version':1,'scope':'Source-restored4935physicalrawdual; source-mutatingvariant excluded','canonical':c,'program':program,'selected_ports':PORTS,'target_F':[[str(x)for x in row]for row in F],'native_lifts':lifts,'repair_suffix':suffix} + artifact=json.loads(json.dumps(artifact));word=gzip.compress(json.dumps(artifact,sort_keys=True,separators=(',',':')).encode(),mtime=0) + tariff=lambda z:3+abs(z.numerator).bit_length()-1+abs(z.numerator).bit_count()+z.denominator.bit_length()-1 + result={'status':'PASS_ONE_ACTUAL632_SOURCE_RESTORED_RAWDUAL_NOT_CALLER','pins':{'4935':P4935,'4929':P4929,'native':NATIVE},'arbitrary_original_inputs':632,'independent_helpers_retained':408,'Y_owners_retained':112,'source_X_mutation':False,'owned_C0_final_zero':True,'extra_owned_arrays':0,'added_rank1_calls':8,'paid':dict(paid),'source_backward_paid':dict(oldpaid),'source_backward_prefix_l1':str(oldmax),'new_prefix_l1':str(maxnorm),'forward_prefix_l1':str(fmax),'events':len(program),'suffix_events':len(suffix),'suffix_census':{'COPY':8,'CLEAR':16,'GaussianH1':8,'ADD':424},'scatter_coefficient_counts':dict(Counter(map(str,allcoeff))),'scatter_scalar_primitive_allowance':sum(tariff(z)for z in allcoeff),'single_word_phase_checks':8,'all12544_transpose_coefficients_checked':True,'all632_forward_and_backward_rows_checked':True,'word_sha256':sha256(word).hexdigest(),'controls':controls,'new_kappa':False,'full_caller':False,'compiler_or_outer_funded':False} + sources={'schema_version':1,'consumed':{k:{'commit':SPECS[k][0],'path':SPECS[k][1],'sha256':sha256(v).hexdigest()}for k,v in raw.items()},'checker_sha256':sha256(Path(__file__).read_bytes()).hexdigest()} + outputs={'RAWDUAL-WORD.json.gz':word,'RESULT.json':encode(result),'SOURCES.json':encode(sources)} + for name,data in outputs.items(): + if '--emit' in sys.argv:(HERE/name).write_bytes(data) + else:need((HERE/name).read_bytes()==data,'frozen bytes '+name) + print(json.dumps(result,sort_keys=True)) +if __name__=='__main__':main() diff --git a/research/involutory-producer-raw-dual/independent/check_ceiling.py b/research/involutory-producer-raw-dual/independent/check_ceiling.py new file mode 100644 index 0000000000..79da79fe8c --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/check_ceiling.py @@ -0,0 +1,61 @@ +"""Read/derive transfer of the standalone one-bank ceiling, no search. +Apache-2.0; substantial OpenAI Codex assistance. Rank proof credited to parent. +""" +from pathlib import Path +from fractions import Fraction as Q +from collections import Counter +from hashlib import sha256 +import json,gzip,types,sys +HERE=Path(__file__).resolve().parent +def need(v,m): + if not v:raise ValueError(m) +def main(): + f=json.loads(gzip.decompress((HERE/'inputs/INVOLUTIVE-WORD.json.gz').read_bytes())) + F=[[Q(x) for x in row] for row in f['F']];S=f['selected_ports'];N=112 + need(S==[0,7,20,23,86,93,108,111],'Selected source coordinates') + need(all(F[i][i]==(12 if i in S else 0) for i in range(N)),'ActualF diagonal12D_J') + need(all(F[i][j]==(12 if i==j else 0) for i in S for j in S),'ActualF_JJ=12I') + # Integer witness for G^-1=(143F-12F D_J F)/143, no determinant oracle. + B=[[int(2*x) for x in row] for row in F] + need(all(Q(B[i][j],2)==F[i][j] for i in range(N) for j in range(N)),'Half-integer matrix') + C=[[B[i][j]-24*int(i==j and i in S) for j in range(N)] for i in range(N)] + Z=[[143*B[i][j]-6*sum(B[i][k]*B[k][j] for k in S) for j in range(N)] for i in range(N)] + def product(X,Y):return [[sum(x*y for x,y in zip(row,col)) for col in zip(*Y)] for row in X] + need(product(C,Z)==product(Z,C)==[[572*int(i==j) for j in range(N)] for i in range(N)],'Exact two-sided inverse witness offdiagonalG') + # Directly recheck every supported offdiagonal transport of actual F. + ce=types.ModuleType('independent_ceiling_ce');sys.modules[ce.__name__]=ce + source=(HERE/'inputs/clifford_exact.py').read_bytes() + need(sha256(source).hexdigest()=='2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962','Exact Clifford source') + exec(compile(source,'pinned_ce','exec'),ce.__dict__) + c=f['canonical'];U=[ce.canonical_frame(9,c['frames'][c['start'][i]]) for i in range(N)] + def grade(op): + pivots={} + for x,z,p in op.tab[9:]: + while x: + bit=x.bit_length()-1 + if bit not in pivots:pivots[bit]=x;break + x^=pivots[bit] + return len(pivots) + grades=Counter(grade(U[j].adjoint().then(U[i])) for i in range(N) for j in range(N) if i!=j and F[i][j]) + need(grades==Counter({2:5824}),'AllactualsupportedFoffdiagonalgrades') + engine=(HERE/'inputs/intervals.py').read_bytes() + need(sha256(engine).hexdigest()=='0ce7e7137422d5ffeda22085c81fa88471bbe963100fdad62e659f1e3bf89326','Exact intervalengine source') + scope={'__name__':'independent_ceiling_intervals','__file__':str(HERE/'inputs/intervals.py')};exec(compile(engine,'intervals','exec'),scope) + H=Counter({4:28,7:7,8:47,9:326});T=Counter({r:2*v for r,v in H.items()});T[17]=224 + P=Counter({1:4418,2:824,3:1020,4:254,5:80});models={} + def outward(v): + z=10**30;lo=(v[0]*z).__floor__();hi=-((-v[1]*z).__floor__()) + def fmt(n):s=str(abs(n)).rjust(31,'0');return ('-' if n<0 else '')+s[:-30]+'.'+s[-30:] + return [fmt(lo),fmt(hi)] + for name,extra in [('unrealized224H17',{}),('after112H2',{2:112})]: + paid=P+Counter(extra);coeff={r:T.get(r,0)-paid.get(r,0) for r in T.keys()|paid.keys() if T.get(r,0)!=paid.get(r,0)} + need(all((n<0 and r<=5) or (n>0 and r>=7) for r,n in coeff.items()),'Signseparation normalizedmoment at5') + values={} + for cs in ('.0030217758','.0034'): + a=scope['moment'](dict(T),1-Q(cs));b=scope['moment'](dict(paid),1-Q(cs));v=(a[0]-b[1],a[1]-b[0]);need(v[0]>0 if not extra else v[1]<0,'Price sign') + values[cs]=outward(v) + models[name]={'target':dict(T),'paid':dict(paid),'intervals':values,'endpoint_constructed':False} + result={'status':'PASS_SCOPED_ONE_BANK_TRANSFER','F_diagonal':'12D_J','F_JJ':'12I8','G':'F-12D_J','determinant_lemma_factor':'(-143)^8','inverse_witness':'G(143F-12F D_J F)=(143F-12F D_J F)G=143I','supported_offdiagonal_grade2':5824,'regular_module_rank':'112dimA_f','minimum_parallel_grade2_channels':112,'interval_proof':'M(t)/5^t increasing; negativeatfundedlowerC coversfullCinterval','models':models,'scope':'FixedfinitecolumnwiseCliffordalphabet. ONEstandaloneparallelbank plusrectangular monomialCliffordcontrols/zero scratch/freebypass. No multibank/nativeabsorption/prefix/directcodedconsumer/approximation or noncolumnwisegeneralization.','new_kappa':None} + print(json.dumps(result,indent=2)) + if '--emit' in __import__('sys').argv:(HERE/'CEILING.json').write_text(json.dumps(result,indent=2)+'\n') +if __name__=='__main__':main() diff --git a/research/involutory-producer-raw-dual/independent/derive.py b/research/involutory-producer-raw-dual/independent/derive.py new file mode 100644 index 0000000000..4b9aa161c7 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/derive.py @@ -0,0 +1,99 @@ +"""Independent source-restored raw-dual derivation; no candidate emitter import. +Substantial OpenAI Codex assistance; Apache-2.0; upstream pins in SOURCES.json. +""" +from pathlib import Path +from fractions import Fraction as Q +from hashlib import sha256 +from collections import Counter +import types, json, gzip, sys +ROOT=Path(__file__).resolve().parent +S=(0,7,20,23,86,93,108,111) +def require(v,m): + if not v: raise ValueError(m) +def mm(A,B): + return [[sum((x*y for x,y in zip(row,col)),Q(0)) for col in zip(*B)] for row in A] +def sub(A,B):return [[x-y for x,y in zip(a,b)] for a,b in zip(A,B)] +def conjugate(op,ce): + circ=[] + for e in op.circuit: + if e[0]=='C':circ.append(('C',e[1],-e[2])) + elif e[0]=='D':circ.append(('D',e[1],tuple((-a)%4 for a in e[2]))) + elif e[0]=='phase':circ.append(('phase',(-e[1])%4)) + else:circ.append(e) + return ce.Op(op.n,tuple((x,z,(-a)%4) for x,z,a in op.tab),circ) +def sparse(circuit,k,n=9): + # Gaussian-integer interpreter, independent of ce.zero_state/tableau code. + values={k:(1,0)};power=0 + for e in circuit: + tag=e[0] + if tag=='P':values={sum(((x&r).bit_count()%2)<>j)&1) + phase+=2*sum(((M[j]>>(j+1))&(x>>(j+1))).bit_count()%2 for j in range(n) if (x>>j)&1) + new[x]=((a,b),(-b,a),(-a,-b),(b,-a))[phase%4] + values=new + elif tag=='C': + q,sgn=e[1:];new={} + for x,(a,b) in values.items(): + for y,v in ((x,(a-sgn*b,b+sgn*a)),(x^q,(a+sgn*b,b-sgn*a))): + u=new.get(y,(0,0));new[y]=(u[0]+v[0],u[1]+v[1]) + values={x:v for x,v in new.items() if v!=(0,0)};power+=1 + else:raise ValueError(('unsupported exact gate',tag)) + while power and all(a%2==b%2==0 for a,b in values.values()): + values={x:(a//2,b//2) for x,(a,b) in values.items()};power-=1 + return values,power + +def main(): + origins=json.loads((ROOT/'SOURCES.json').read_text()) + for row in origins['files']:require(sha256((ROOT/row['path']).read_bytes()).hexdigest()==row['sha256'],'Pinned bytes '+row['path']) + source=json.loads(gzip.decompress((ROOT/'inputs/SOURCE-WORD.json.gz').read_bytes())) + coded=json.loads(gzip.decompress((ROOT/'inputs/CODED-WORDS.json.gz').read_bytes())) + forward=json.loads(gzip.decompress((ROOT/'inputs/INVOLUTIVE-WORD.json.gz').read_bytes())) + c=source['canonical'];require(coded['canonical']['frames']==c['frames'],'Same physical frames') + R=[[Q(v) for v in row] for row in json.loads((ROOT/'inputs/R.json').read_text())] + K=[[R[k][i]/4 for k in range(8)] for i in range(112)] + P=[K[i] if i in S else [Q(0)]*8 for i in range(112)] + I8=[[Q(i==j) for j in range(8)] for i in range(8)] + require(mm(R,K)==[[14*x for x in r] for r in I8],'RK=14I') + require(mm(R,P)==I8,'RP=I') + KR=mm(K,R);I=[[Q(i==j) for j in range(112)] for i in range(112)] + A=sub(I,KR);D=[[12*x for x in row] for row in mm(P,R)] + F=[[a+d for a,d in zip(ar,dr)] for ar,dr in zip(A,D)] + require(F==[[Q(v) for v in row] for row in forward['F']],'Actual4935 target F') + require(mm(F,F)==I,'F involution') + require({j for j,row in enumerate(D) if any(row)}==set(S),'Only selected Y source rows') + coeff=Counter(-x for row in D for x in row if x) + # Backward normalized x is x-A^T y. The suffix adds -D^T y. + require(sub([[A[j][i] for j in range(112)] for i in range(112)], + [[-D[j][i] for j in range(112)] for i in range(112)])==[[F[j][i] for j in range(112)] for i in range(112)],'Backward sign/transpose') + require(any(A[j][i]-D[j][i]!=F[j][i] for i in range(112) for j in range(112)),'Wrong-sign semantic control') + ce=types.ModuleType('independent_rawdual_ce');sys.modules[ce.__name__]=ce + exec(compile((ROOT/'inputs/clifford_exact.py').read_bytes(),'pinned_ce','exec'),ce.__dict__) + barT=conjugate(ce.canonical_frame(9,c['frames'][1]),ce) + require(c['final'][:112]==[1]*112,'Common full X exit') + repairs=[];wrong_conjugation=False;wrong_adjoint=False + for j in S: + frame=c['final'][112+j];V=ce.canonical_frame(9,c['frames'][frame]);barV=conjugate(V,ce) + require(len(c['frames'][frame])==8,'Pure selected rank8Y source') + L=barV.adjoint().then(barT);cert,compiled=ce.lower_child(L) + require(cert['rank']==1,'Actual rank1 lift') + require(L.tab==compiled.tab,'Literal compiler tableau') + # C0=barV y; lifted C0 must equal barT y including global phase. + for k in range(512): + target=sparse(barT.circuit,k) + require(sparse(barV.circuit+compiled.circuit,k)==target,'All512 actual phase/composition columns') + if not wrong_conjugation: + wrong_conjugation=sparse(barV.circuit+V.adjoint().then(ce.canonical_frame(9,c['frames'][1])).circuit,k)!=target + if not wrong_adjoint:wrong_adjoint=sparse(barV.circuit+L.adjoint().circuit,k)!=target + repairs.append({'port':j,'Y_owner':112+j,'frame':frame,'rank':cert['rank'],'phase_columns':512,'scatter_count':sum(bool(x) for x in D[j]),'compiled_circuit_sha256':sha256(json.dumps(compiled.circuit,separators=(',',':')).encode()).hexdigest()}) + require(wrong_conjugation,'No-conjugation mutation rejected') + require(wrong_adjoint,'Adjoint/reversed lift mutation rejected') + out={'status':'PASS_INDEPENDENT_RAW_DUAL_DERIVATION','upstream_head':'64c9f99693c92fb370096fb43dbc58a085b30e36','selected_ports':S,'phase_columns':4096,'repairs':repairs,'scatter_coefficients':{str(v):n for v,n in sorted(coeff.items())},'added_paid':{'1':8},'complete_expected_paid':{'1':2209,'2':412,'3':510,'4':127,'5':40},'owned_scratch':'Only C0 COPY/CLEAR; Y/main/helper owners never overwritten or cleared','suffix':'COPY barV_j y_j; apply barF9 barV_j^*; scatter -12(PR)_(j,i); CLEAR C0','endpoint':'x-F^T y, y unchanged; all independent helper jobs unchanged','semantic_controls':['wrong correction sign','unconjugated physical lift','adjoint/reversed physical lift'],'full_source_replay':'Pending independent replay of frozen A word; inherited4929 physical event semantics distinct from new4096 phase checks','source_mutating_variant':False,'new_kappa':None} + print(json.dumps(out,indent=2)) + if '--emit' in sys.argv:(ROOT/'DERIVATION.json').write_text(json.dumps(out,indent=2)+'\n') +if __name__=='__main__':main() diff --git a/research/involutory-producer-raw-dual/independent/inputs/CODED-WORDS.json.gz b/research/involutory-producer-raw-dual/independent/inputs/CODED-WORDS.json.gz new file mode 100644 index 0000000000..935fedd9c9 Binary files /dev/null and b/research/involutory-producer-raw-dual/independent/inputs/CODED-WORDS.json.gz differ diff --git a/research/involutory-producer-raw-dual/independent/inputs/INVOLUTIVE-WORD.json.gz b/research/involutory-producer-raw-dual/independent/inputs/INVOLUTIVE-WORD.json.gz new file mode 100644 index 0000000000..eac634fb1d Binary files /dev/null and b/research/involutory-producer-raw-dual/independent/inputs/INVOLUTIVE-WORD.json.gz differ diff --git a/research/involutory-producer-raw-dual/independent/inputs/R.json b/research/involutory-producer-raw-dual/independent/inputs/R.json new file mode 100644 index 0000000000..691598d877 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/inputs/R.json @@ -0,0 +1 @@ +[["1", "0", "1", "0", "0", "0", "0", "1", "0", "1", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0", "0", "1", "1", "1", "1", "0", "1", "0", "0", "0", "1", "1", "1", "1", "1", "0", "0", "1", "1", "1", "0", "0", "0", "0", "1", "0", "0", "1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "1", "1", "0", "1", "0", "1", "0", "0", "0", "1", "0", "1", "0", "1", "1", "1", "1", "0", "1", "0", "0", "0", "1", "0", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "-1", "1", "-1", "-1", "-1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "-1", "1", "1", "1", "-1", "-1", "-1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "-1", "1", "-1", "1", "1", "1", "0", "1", "1", "1", "1", "1", "1", "-1", "1", "-1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "0", "1", "1", "1", "1", "1", "-1", "-1", "-1", "0", "0", "0", "0", "0", "0", "0", "-1", "-1", "-1", "-1", "1", "0", "0", "0", "0", "0", "0", "-1", "-1", "-1", "1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "-1", "-1", "-1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "-1", "1", "0", "0", "-1", "1", "1", "1", "0", "-1", "-1", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "0", "0", "1", "1", "1", "1", "-1", "1", "1", "1", "0", "0", "0", "0", "0"], ["1", "0", "0", "1", "1", "1", "0", "1", "-1", "0", "0", "0", "0", "1", "1", "1", "-1", "0", "0", "0", "0", "0", "-1", "-1", "-1", "0", "-1", "-1", "0", "0", "0", "0", "1", "1", "1", "-1", "0", "0", "0", "0", "0", "-1", "-1", "-1", "-1", "-1", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0", "-1", "0", "0", "0", "0", "0", "0", "-1", "-1", "-1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "-1", "0", "1", "0", "1", "-1", "0", "0", "0", "1", "0", "1", "1", "0", "0", "0", "1", "0", "0", "-1", "-1", "-1", "1", "1", "0", "0", "0", "0", "-1", "-1", "-1", "-1", "-1", "-1", "0", "0"], ["0", "-1", "0", "-1", "0", "0", "1", "0", "1", "0", "-1", "-1", "1", "0", "1", "1", "0", "1", "0", "0", "1", "1", "0", "0", "-1", "0", "-1", "0", "-1", "0", "0", "-1", "-1", "0", "0", "-1", "1", "1", "-1", "0", "0", "1", "1", "0", "0", "1", "1", "1", "1", "0", "0", "0", "-1", "-1", "0", "0", "-1", "0", "1", "0", "0", "0", "1", "1", "0", "0", "-1", "1", "0", "0", "1", "1", "0", "0", "0", "-1", "0", "-1", "0", "0", "1", "0", "1", "0", "0", "-1", "-1", "0", "-1", "0", "-1", "-1", "0", "1", "0", "1", "0", "0", "1", "0", "1", "0", "0", "1", "0", "-1", "-1", "1", "0", "0", "1", "1"], ["0", "0", "0", "0", "-1", "1", "0", "0", "0", "0", "1", "-1", "0", "0", "-1", "1", "0", "0", "1", "-1", "-1", "1", "1", "-1", "0", "0", "0", "0", "0", "-1", "1", "0", "0", "-1", "1", "0", "1", "-1", "0", "-1", "1", "1", "-1", "0", "0", "0", "-1", "1", "0", "1", "-1", "0", "1", "-1", "1", "-1", "0", "0", "0", "1", "-1", "0", "-1", "1", "1", "-1", "0", "0", "1", "-1", "1", "-1", "0", "1", "-1", "0", "0", "0", "0", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "1", "-1", "0", "0", "1", "-1", "0", "1", "-1", "-1", "1"], ["0", "0", "1", "1", "0", "0", "0", "0", "1", "-1", "0", "0", "1", "1", "0", "0", "1", "-1", "0", "0", "1", "1", "-1", "-1", "0", "-1", "-1", "0", "0", "-1", "-1", "-1", "0", "-1", "-1", "0", "1", "1", "1", "0", "0", "0", "0", "1", "-1", "0", "-1", "-1", "0", "1", "1", "-1", "0", "0", "0", "0", "1", "0", "0", "1", "1", "1", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "0", "1", "-1", "-1", "0", "0", "-1", "1", "-1", "1", "0", "0", "1", "1", "0", "0", "0", "-1", "-1", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "-1", "-1", "0", "0", "1", "-1", "0", "0", "0", "1", "1", "-1", "-1"], ["0", "-1", "-1", "0", "-1", "-1", "1", "0", "0", "-1", "0", "0", "0", "1", "0", "0", "-1", "0", "1", "1", "-1", "-1", "0", "0", "1", "1", "0", "0", "1", "0", "0", "0", "1", "0", "0", "-1", "1", "1", "0", "-1", "-1", "0", "0", "1", "1", "1", "1", "1", "-1", "0", "0", "-1", "0", "0", "-1", "-1", "0", "0", "-1", "0", "0", "1", "0", "0", "-1", "-1", "0", "0", "1", "1", "0", "0", "1", "0", "0", "1", "0", "0", "-1", "1", "0", "0", "-1", "0", "0", "-1", "-1", "0", "0", "-1", "0", "0", "0", "1", "-1", "0", "1", "1", "1", "1", "0", "1", "1", "0", "-1", "0", "0", "-1", "0", "0", "-1", "-1"]] \ No newline at end of file diff --git a/research/involutory-producer-raw-dual/independent/inputs/SOURCE-WORD.json.gz b/research/involutory-producer-raw-dual/independent/inputs/SOURCE-WORD.json.gz new file mode 100644 index 0000000000..46d929df83 Binary files /dev/null and b/research/involutory-producer-raw-dual/independent/inputs/SOURCE-WORD.json.gz differ diff --git a/research/involutory-producer-raw-dual/independent/inputs/clifford_exact.py b/research/involutory-producer-raw-dual/independent/inputs/clifford_exact.py new file mode 100644 index 0000000000..166841a037 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/inputs/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< 0, 'positive interval denominator') + return mul(a, rounded(1/b[1], 1/b[0])) + + +@lru_cache(None) +def log_bounds(n): + """Exact atanh series, binary reduction; round only the final interval.""" + need(isinstance(n, int) and n >= 1, 'positive integer logarithm') + + def series(x): + u = (x-1)/(x+1) + term, total = u, Q(0) + for j in range(80): + total += 2*term/(2*j+1) + term *= u*u + tail = 2*term/(161*(1-u*u)) + return total, total+tail + + k = n.bit_length()-1 + a, b = series(Q(2)) + c, d = series(Q(n, 2**k)) + return rounded(k*a+c, k*b+d) + + +def exp_point(x): + """Outward fixed-point Taylor enclosure, with binary scaling/squaring.""" + need(abs(x) < 16, 'bounded exponential argument') + if x < 0: + a, b = exp_point(-x) + return rounded(1/b, 1/a) + divisions = 0 + while x > Q(1, 2): + x /= 2 + divisions += 1 + term = total = (Q(1), Q(1)) + for j in range(1, 65): + term = scale(term, x/j) + total = rounded(total[0]+term[0], total[1]+term[1]) + following = scale(term, x/65) + # Every remaining ratio is <= 1/132. Twice the next term is safe. + result = rounded(total[0], total[1]+2*following[1]) + for _ in range(divisions): + result = mul(result, result) + return result + + +def exp_interval(a): + return exp_point(a[0])[0], exp_point(a[1])[1] + + +@lru_cache(None) +def power(n, exponent): + return exp_interval(scale(log_bounds(n), exponent)) + + +def moment(histogram, exponent): + low = high = Q(0) + for n, count in histogram.items(): + a, b = power(n, exponent) + low += count*a + high += count*b + return rounded(low, high) + + +def display(a): + unit = 10**30 + + def fixed(n): + sign = '-' if n < 0 else '' + s = str(abs(n)).rjust(31, '0') + return sign+s[:-30]+'.'+s[-30:] + + return {'lower': fixed((a[0]*unit).__floor__()), + 'upper': fixed(-((-a[1]*unit).__floor__()))} + + +def encoded(x): + if isinstance(x, Q): + return str(x) + if isinstance(x, dict): + return {str(k): encoded(v) for k, v in x.items()} + if isinstance(x, (list, tuple)): + return [encoded(v) for v in x] + return x + + +def source_environment(path): + env = {'__file__': str(path), '__name__': 'pinned_source_oracle'} + exec(compile(path.read_bytes(), str(path), 'exec'), env) + return env + + +def authenticate(): + result = {} + for row in json.loads((HERE/'VENDOR.json').read_text())['files']: + path = HERE/'vendor'/Path(row['path']).relative_to( + 'research/higher-moment-strictification/vendor') + digest = sha256(path.read_bytes()).hexdigest() + need(digest == row['sha256'], 'changed source: '+row['path']) + raw = path.read_bytes() + need(sha1(b'blob '+str(len(raw)).encode()+b'\0'+raw).hexdigest() + == row['git_blob'], 'changed Git source blob') + result[row['path']] = digest + return result + + +def invoice_oracle(): + """Run #4426 unchanged, rebinding only its two file-location globals.""" + path = HERE/'vendor/invoice-review/verify.py' + env = source_environment(path) + env.update(ROOT=path.parent, PHASES='DATA-PHASES.json') + output = io.StringIO() + with redirect_stdout(output): + env['main']() + result = json.loads(output.getvalue()) + need(result['status'] == 'PASS_PR4416_INVOICE_REBUILD', 'source invoice oracle') + need({int(k): v for k, v in result['targets'].items()} == T + and {int(k): v for k, v in result['paid'].items()} == P, + 'exact literal-word invoice') + return result + + +def tail_certificate(v=150, cutoff=10, floor=15, u=Q(3, 10)): + t = 1-C + need(v >= 1 and 1 < cutoff < floor < 121, 'strict finite ranks') + need(t+u >= 1, 'tail moment exponent at least one') + target, paid = moment(T, t), moment(P, t) + alpha = divide(paid, target) + gamma = divide(moment(P, t+u), mul(power(cutoff, u), target)) + delta = divide((Q(sum(T.values())*floor),)*2, + mul(power(cutoff, C), target)) + limits = (1-Q(1, 10**8), Q(181, 200), Q(439, 500)) + for name, bounds, limit in zip(('alpha', 'gamma', 'delta'), + (alpha, gamma, delta), limits): + need(0 < bounds[0] <= bounds[1] < limit < 1, name+' certified limit') + a, g, d = limits + bound = 1/(1+v*(1-a))+2*g**v+2*d**v + need(bound < 1, 'complete charged normalized moment') + old_gamma = divide((Q(sum(k*n for k, n in P.items())),)*2, + mul(power(cutoff, C), target)) + old_lower = alpha[0]**v+2*old_gamma[0]**v + need(old_lower > 1, 'rank-one-tail estimate fails at this tensor power') + return {'tensor_power': v, 'cutoff_base': cutoff, 'floor_base': floor, + 'paid_moment_exponent': t+u, 'tail_offset_u': u, + 'tested_saving': C, 'alpha': display(alpha), 'gamma': display(gamma), + 'delta': display(delta), 'rational_upper_limits': limits, + 'normalized_paid_upper': bound, 'strict_moment_gap': display((1-bound,)*2), + 'old_rank_one_gamma': display(old_gamma), + 'old_rank_one_bound_lower': display((old_lower, old_lower)), + 'ambient': '121^'+str(v), 'minimum_target': str(floor)+'^'+str(v), + 'maximum_paid': str(cutoff)+'^'+str(v), + 'productive_fields_before_uniform_compiler': '7688^'+str(v), + 'rank_one_surplus': '131723^'+str(v)+'-131115^'+str(v), + 'materialized_product_or_uniform_word': False} + + +def uniform_rank(v): + t, p, theta = 1-C, 13, Q(6, 7) + gap = (C-KAPPA)/7 + uniform_saving = C-gap + need(10**7 < 15**6, 'theta upper bound') + need(2*(10**v)**7 <= (121**v)**6, 'shifted logarithm inequality') + eta = scale(exp_interval(scale(log_bounds(121), -v*C)), t) + need(eta[0] > theta**p, 'exit contraction below complement capacity') + base = exp_interval(scale(log_bounds(121), v*C)) + need(base[1] < 2**p, 'entire ordinary base range fits') + # Integer grid: gap*H is integral, avoiding enormous rational powers. + step = gap.denominator + need(gap.numerator == 1, 'chosen rational gap grid') + + def passes(j): + H = step*j + return (H+1)**p < 2**j + + lo, hi = 1, 2 + while not passes(hi): + lo, hi = hi, 2*hi + while hi-lo > 1: + mid = (lo+hi)//2 + if passes(mid): + hi = mid + else: + lo = mid + H = step*hi + need(H > 7*v and passes(hi) and not passes(hi-1), 'final integer comparison') + need(eta[1] < theta**(p-1), 'one smaller logarithmic power fails') + return {'t': t, 'uniform_saving': uniform_saving, 'gap': gap, + 'logarithm_power': p, 'theta_upper': theta, 'eta': display(eta), + 'eta_minus_theta_to_p': display((eta[0]-theta**p, eta[1]-theta**p)), + 'm_to_saving': display(base), 'H': H, 'N': '2^'+str(H), + 'integer_test': {'left_base': H+1, 'left_exponent': p, + 'right_base': 2, 'right_exponent': hi}, + 'grid_step': step, 'previous_grid_point_rejected': True, + 'smaller_logarithmic_power_rejected': True} + + +def power_majorant_comparison(v, uniform_saving): + """Retain #4416's older power proof, changing only the new unit's ranks.""" + t, z, h = 1-C, 1-uniform_saving, Q(1, 7) + z0 = (t+z)/2 + delta = z0-t + B, debt = (4+7*h)*v, 1+7*v*(1-z0) + ratio = (delta*B+debt)/(h*delta) + H0 = -((-ratio.numerator)//ratio.denominator) + ratio = H0*(1-z0)/(z-z0) + H1 = ratio.numerator//ratio.denominator+1 + need(H0 >= 7*v and H0*h*delta >= delta*B+debt, 'power majorant threshold') + need((H0-1)*h*delta < delta*B+debt, 'previous power threshold rejected') + need(H1*(z-z0) > H0*(1-z0) >= (H1-1)*(z-z0), + 'strict power-majorant comparison and previous-rank control') + return {'H0': H0, 'H1': H1, 'N': '2^'+str(H1), 'theta_upper': 1-h, + 'scope': 'Tail transformation alone, retaining the older power majorant.'} + + +def outer_ledger(uniform_saving): + d = (C-KAPPA)/7 + params = {'kappa': KAPPA, 'tested_saving': C, + 'complex_uniform_saving': uniform_saving, 'b': KAPPA+5*d, + 'a': KAPPA+4*d, 'q': KAPPA+3*d, 'bit_saving': Q('0.0027'), + 'epsilon': 1-d, 'beta': 1-3*d, 'r0': d/10, + 'stop': d, 'layout': d, 'd': d} + env = source_environment(HERE/'vendor/outer_endpoint.py') + row = env['ledger'](params) + need(len(row['strict_checks']) == 54 and len(row['functional_checks']) == 3, + 'complete first outer ledger') + need(all(v > 0 for group in ('strict_checks', 'functional_checks') + for v in row[group].values()), 'all outer predicates') + frozen = json.loads((HERE/'vendor/p7-RESULT.json').read_text())['endpoint']['outer'] + need(encoded(row) == frozen, 'unchanged full p7 endpoint ledger') + parsed = ast.parse((HERE/'vendor/check_ledger.py').read_bytes()) + function = next(n for n in parsed.body + if isinstance(n, ast.FunctionDef) and n.name == 'ledger') + constants = [n for n in parsed.body if isinstance(n, ast.Assign) + and any(isinstance(t, ast.Name) and t.id.startswith('KAPPA_') + for t in n.targets)] + eps, beta, q, a = (params[k] for k in ('epsilon', 'beta', 'q', 'a')) + grid = 10**10 + backoff = Q((eps*q*grid).__floor__(), grid)-KAPPA + need(backoff > 0, 'strict derived oracle grid backoff') + oracle = {'Q': Q, 'R0': params['r0'], 'ZETA': Q(1, 10**8), + 'SLACK': d, 'STOP': d, 'FLOOR': grid, 'BACKOFF': backoff, + 'EPS': eps, 'BETA': beta, 'THETA_POWER': Q(2), + 'HALO_POWER': 48, 'CORE_POWER': 128, 'STRASSEN_TAU': Q(45, 16), + 'b': params['b'], 'q': q, 'a': a, 'bit': params['bit_saving'], + 'online': Q('0.001730970419199163702738'), + 'old': Q('0.001730970419199163702738')} + code = ast.fix_missing_locations(ast.Module(body=constants+[function], type_ignores=[])) + exec(compile(code, 'pinned 63-predicate ledger', 'exec'), oracle) + second = oracle['ledger']('higher_moment_smaller_ranks') + need(second['kappa'] == KAPPA and second['margins'] == row['margins'], + 'all nine rows match both ledgers') + need(len(second['strict_checks']) == 63 and + all(v > 0 for v in second['strict_checks'].values()), 'all 63 legacy predicates') + controls = {} + for name, updates in [('closed_epsilon', {'epsilon': Q(1)}), + ('missing_layout', {'layout': Q(0)}), + ('unfunded_kappa', {'kappa': C}), + ('closed_uniform_gap', {'complex_uniform_saving': params['b']}), + ('insufficient_BIT', {'bit_saving': Q('0.0023')})]: + bad = env['ledger'](dict(params, **updates)) + failed = sorted(k for k, v in bad['strict_checks'].items() if v <= 0) + need(failed, 'outer control rejected: '+name) + controls[name] = failed + for name, options in [('old_per_axis_scan', {'old_scan': True}), + ('group_equals_dimension', {'beta_': eps})]: + bad = oracle['ledger']('reject_'+name, **options) + failed = sorted(k for k, v in bad['strict_checks'].items() if v <= 0) + need(failed, 'legacy control rejected: '+name) + controls[name] = failed + return {'ledger': row, 'legacy_63_checks': second['strict_checks'], + 'legacy_grid': grid, 'legacy_backoff': backoff, + 'minimum_margin_minus_kappa': min(row['margins'].values())-KAPPA, + 'rejected_controls': controls} + + +def finite_controls(): + def tensor(histogram): + out = Counter() + for k, n in histogram.items(): + for h, b in histogram.items(): + out[k*h] += n*b + return out + + def split(histogram, cutoff): + out = Counter() + for k, n in histogram.items(): + q, r = divmod(k, cutoff) + out[cutoff] += q*n + if r: + out[r] += n + return +out + + target, paid = tensor({2:1, 5:1}), tensor({1:2, 4:1}) + padded, completion = Counter(), Counter() + for k, n in target.items(): + padded[max(k, 9)] += n + if k < 9: + completion[9-k] += n + final = split(paid+completion, 4) + mass = lambda x: sum(k*n for k, n in x.items()) + need(mass(padded)-mass(final) == 7**2-6**2 == 13, 'exact paid padding mass') + need(min(padded) > max(final), 'exact toy separation') + need(final == Counter({1:5, 4:9}), 'literal toy expanded inventory') + # t=1/2, sigma=3/4, R=100, J=1 refutes a sublinear tail extension. + invalid = power(100, Q(1, 2))[1]+2*power(100, Q(3, 4))[1] + need(invalid < 100, 'sublinear upper-tail moment cannot bound splitting') + return {'toy_targets': padded, 'toy_paid': final, 'rank_one_surplus': 13, + 'sublinear_tail_counterexample': {'R': 100, 'J': 1, 't': '1/2', + 'sigma': '3/4', 'actual_charge': 100, + 'invalid_upper': display((invalid, invalid))}} + + +def verify(): + sources = authenticate() + invoice = invoice_oracle() + tail = tail_certificate() + rank = uniform_rank(tail['tensor_power']) + endpoint = outer_ledger(rank['uniform_saving']) + controls = finite_controls() + rejected = [] + for name, updates, expected in [ + ('too_short_product', {'v': 100}, 'complete charged normalized moment'), + ('sublinear_tail', {'u': C/2}, 'tail moment exponent at least one'), + ('lost_separation', {'floor': 10}, 'strict finite ranks'), + ]: + try: + tail_certificate(**updates) + except ValueError as error: + need(str(error) == expected, 'wrong rejection: '+name) + rejected.append({'mutation': name, 'failed_at': str(error)}) + else: + raise ValueError('accepted mutation: '+name) + old = json.loads((HERE/'vendor/p7-RESULT.json').read_text())['endpoint']['compiler'] + return encoded({'schema': 'higher-moment-native-strictification/1', + 'status': 'PASS_HIGHER_MOMENT_STRICTIFICATION', 'kappa': KAPPA, + 'invoice_oracle': invoice, 'strictification': tail, + 'uniform_rank': rank, 'outer': endpoint, + 'tail_only_power_majorant': power_majorant_comparison( + tail['tensor_power'], rank['uniform_saving']), + 'finite_controls': controls, 'rejected_mutations': rejected, + 'predecessor_H': old['H1'], + 'rank_exponent_reduction_factor': Q(old['H1'], rank['H']), + 'tensor_power_reduction_factor': Q(6240, tail['tensor_power']), + 'source_sha256': sources, + 'verifier_sha256': sha256(Path(__file__).read_bytes()).hexdigest(), + 'scope': 'Conditional charged transformation and finite compiler rank. Native all-column, physical, analytic, precision, storage, fixed-tape and recovery premises remain inherited. No new kappa, selected frontier or practical word.'}) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--out', type=Path) + args = parser.parse_args() + result = verify() + if args.out: + need(not args.out.exists(), 'new output path required') + args.out.write_text(json.dumps(result, indent=2, sort_keys=True)+'\n') + else: + need(json.loads((HERE/'RESULT.json').read_text()) == result, 'changed saved receipt') + print(json.dumps({'status': result['status'], 'tensor_power': result['strictification']['tensor_power'], + 'uniform_rank': result['uniform_rank']['N'], + 'strict_moment_gap': result['strictification']['strict_moment_gap'], + 'kappa': result['kappa']})) + + +if __name__ == '__main__': + main() diff --git a/research/involutory-producer-raw-dual/independent/replay_independent.py b/research/involutory-producer-raw-dual/independent/replay_independent.py new file mode 100644 index 0000000000..e6adaa33b5 --- /dev/null +++ b/research/involutory-producer-raw-dual/independent/replay_independent.py @@ -0,0 +1,73 @@ +"""Independent literal-event interpreter for the frozen candidate review. +No imports from A emitter or upstream native_core. Normalized inherited source +warp semantics are a premise, not an independent physical audit of those warps. +Apache-2.0; substantial OpenAI Codex assistance. +""" +from fractions import Fraction as Q +from collections import Counter + +def need(v,m): + if not v: raise ValueError(m) +def accumulate(dst,src,factor): + for key,value in tuple(src.items()): + result=dst.get(key,Q(0))+factor*value + if result:dst[key]=result + elif key in dst:del dst[key] +def owner(ref): + kind,index=ref + need(kind in ('C','L'),'Unknown owner kind') + if kind=='C':need(index==0,'Only existing ownedC0');return 632 + need(0<=index<632,'Arbitrary persistent owner index');return index + +def replay(c,program): + states=[{(i,()):Q(1)} for i in range(632)]+[{}] + frames=list(c['start'])+[None] + bill=Counter();maximum=Q(1);events=Counter() + for at,e in enumerate(program): + kind=e[0];events[kind]+=1 + if kind=='scalar': + gate,frame=e[1:];op=gate[0];dst=owner(gate[1]) + if op=='clear': + need(dst==632,'Borrowed erasure');states[dst]={};frames[dst]=frame + else: + need(frames[dst]==frame,('Scalar target chart',at)) + if op in ('add','copy'): + src=owner(gate[2]);need(frames[src]==frame,('Scalar source chart',at)) + if op=='copy':need(dst==632,'Borrowed overwrite');states[dst]=states[src].copy() + else: + need(src!=dst,'Self ADD') + accumulate(states[dst],states[src],Q(gate[3],gate[4])) + elif op=='scale':states[dst]={k:Q(gate[2],gate[3])*v for k,v in states[dst].items()} + else:raise ValueError('Unknown scalar gate') + maximum=max(maximum,sum(abs(v) for v in states[dst].values())) + elif kind=='warp': + _,ref,gate,start,end=e;dst=owner(ref) + need(frames[dst]==start,('Warp source chart',at)) + updated={} + for (i,word),v in states[dst].items(): + new=word[:-1] if word and word[-1]==-gate else word+(gate,) + k=(i,new);updated[k]=updated.get(k,Q(0))+v + states[dst]={k:v for k,v in updated.items() if v};frames[dst]=end + elif kind=='climb': + _,_,dst,start,end,r=e + need(0<=dst<632,'Persistent climb owner') + need(frames[dst]==start,('Climb source chart',at)) + need(r>0 and r==len(c['frames'][end])-len(c['frames'][start]),'Climb paid rank') + frames[dst]=end;bill[r]+=1 + elif kind=='center': + _,index,start,end,r=e;need(index==0,'Existing owned center only');dst=632 + need(frames[dst]==start,('Owned transport source chart',at)) + need(r==abs(len(c['frames'][end])-len(c['frames'][start])),'Owned Gaussian paid rank') + bill[r]+=1;frames[dst]=end + else:need(kind in ('phase','adapter','residual_adapter'),'Unknown literal event') + need(frames[:632]==c['final'],'All632 output charts') + need(not states[632],'Owned C0 returnedzero') + return states,bill,maximum,events + +def expected(F,back): + out=[{(i,()):Q(1)} for i in range(632)] + for i in range(112): + for j in range(112): + coeff=-F[j][i] if back else F[i][j] + if coeff:accumulate(out[i if back else 112+i],{((112+j) if back else j,()):Q(1)},coeff) + return out diff --git a/research/involutory-producer-raw-dual/inputs/R/R.json b/research/involutory-producer-raw-dual/inputs/R/R.json new file mode 100644 index 0000000000..691598d877 --- /dev/null +++ b/research/involutory-producer-raw-dual/inputs/R/R.json @@ -0,0 +1 @@ +[["1", "0", "1", "0", "0", "0", "0", "1", "0", "1", "1", "1", "1", "0", "0", "0", "0", "1", "1", "1", "0", "0", "1", "1", "1", "1", "0", "1", "0", "0", "0", "1", "1", "1", "1", "1", "0", "0", "1", "1", "1", "0", "0", "0", "0", "1", "0", "0", "1", "1", "1", "0", "0", "0", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "1", "1", "0", "1", "0", "1", "0", "0", "0", "1", "0", "1", "0", "1", "1", "1", "1", "0", "1", "0", "0", "0", "1", "0", "1", "1", "1", "1", "0", "0", "0", "1", "1", "1", "0", "0"], ["1", "1", "1", "1", "1", "1", "1", "-1", "1", "-1", "-1", "-1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "-1", "1", "1", "1", "-1", "-1", "-1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "-1", "1", "-1", "1", "1", "1", "0", "1", "1", "1", "1", "1", "1", "-1", "1", "-1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"], ["1", "1", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "0", "1", "1", "1", "1", "1", "-1", "-1", "-1", "0", "0", "0", "0", "0", "0", "0", "-1", "-1", "-1", "-1", "1", "0", "0", "0", "0", "0", "0", "-1", "-1", "-1", "1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "-1", "-1", "-1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "-1", "1", "0", "0", "-1", "1", "1", "1", "0", "-1", "-1", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "0", "0", "1", "1", "1", "1", "-1", "1", "1", "1", "0", "0", "0", "0", "0"], ["1", "0", "0", "1", "1", "1", "0", "1", "-1", "0", "0", "0", "0", "1", "1", "1", "-1", "0", "0", "0", "0", "0", "-1", "-1", "-1", "0", "-1", "-1", "0", "0", "0", "0", "1", "1", "1", "-1", "0", "0", "0", "0", "0", "-1", "-1", "-1", "-1", "-1", "0", "0", "1", "1", "1", "1", "1", "1", "0", "0", "0", "-1", "0", "0", "0", "0", "0", "0", "-1", "-1", "-1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "-1", "0", "1", "0", "1", "-1", "0", "0", "0", "1", "0", "1", "1", "0", "0", "0", "1", "0", "0", "-1", "-1", "-1", "1", "1", "0", "0", "0", "0", "-1", "-1", "-1", "-1", "-1", "-1", "0", "0"], ["0", "-1", "0", "-1", "0", "0", "1", "0", "1", "0", "-1", "-1", "1", "0", "1", "1", "0", "1", "0", "0", "1", "1", "0", "0", "-1", "0", "-1", "0", "-1", "0", "0", "-1", "-1", "0", "0", "-1", "1", "1", "-1", "0", "0", "1", "1", "0", "0", "1", "1", "1", "1", "0", "0", "0", "-1", "-1", "0", "0", "-1", "0", "1", "0", "0", "0", "1", "1", "0", "0", "-1", "1", "0", "0", "1", "1", "0", "0", "0", "-1", "0", "-1", "0", "0", "1", "0", "1", "0", "0", "-1", "-1", "0", "-1", "0", "-1", "-1", "0", "1", "0", "1", "0", "0", "1", "0", "1", "0", "0", "1", "0", "-1", "-1", "1", "0", "0", "1", "1"], ["0", "0", "0", "0", "-1", "1", "0", "0", "0", "0", "1", "-1", "0", "0", "-1", "1", "0", "0", "1", "-1", "-1", "1", "1", "-1", "0", "0", "0", "0", "0", "-1", "1", "0", "0", "-1", "1", "0", "1", "-1", "0", "-1", "1", "1", "-1", "0", "0", "0", "-1", "1", "0", "1", "-1", "0", "1", "-1", "1", "-1", "0", "0", "0", "1", "-1", "0", "-1", "1", "1", "-1", "0", "0", "1", "-1", "1", "-1", "0", "1", "-1", "0", "0", "0", "0", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "1", "-1", "0", "0", "1", "-1", "0", "1", "-1", "-1", "1"], ["0", "0", "1", "1", "0", "0", "0", "0", "1", "-1", "0", "0", "1", "1", "0", "0", "1", "-1", "0", "0", "1", "1", "-1", "-1", "0", "-1", "-1", "0", "0", "-1", "-1", "-1", "0", "-1", "-1", "0", "1", "1", "1", "0", "0", "0", "0", "1", "-1", "0", "-1", "-1", "0", "1", "1", "-1", "0", "0", "0", "0", "1", "0", "0", "1", "1", "1", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "0", "1", "-1", "-1", "0", "0", "-1", "1", "-1", "1", "0", "0", "1", "1", "0", "0", "0", "-1", "-1", "0", "0", "0", "0", "1", "-1", "0", "0", "0", "-1", "-1", "0", "0", "1", "-1", "0", "0", "0", "1", "1", "-1", "-1"], ["0", "-1", "-1", "0", "-1", "-1", "1", "0", "0", "-1", "0", "0", "0", "1", "0", "0", "-1", "0", "1", "1", "-1", "-1", "0", "0", "1", "1", "0", "0", "1", "0", "0", "0", "1", "0", "0", "-1", "1", "1", "0", "-1", "-1", "0", "0", "1", "1", "1", "1", "1", "-1", "0", "0", "-1", "0", "0", "-1", "-1", "0", "0", "-1", "0", "0", "1", "0", "0", "-1", "-1", "0", "0", "1", "1", "0", "0", "1", "0", "0", "1", "0", "0", "-1", "1", "0", "0", "-1", "0", "0", "-1", "-1", "0", "0", "-1", "0", "0", "0", "1", "-1", "0", "1", "1", "1", "1", "0", "1", "1", "0", "-1", "0", "0", "-1", "0", "0", "-1", "-1"]] \ No newline at end of file diff --git a/research/involutory-producer-raw-dual/inputs/ce/clifford_exact.py b/research/involutory-producer-raw-dual/inputs/ce/clifford_exact.py new file mode 100644 index 0000000000..166841a037 --- /dev/null +++ b/research/involutory-producer-raw-dual/inputs/ce/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<0 else -1)*(abs(op)+(1000000 if back else 0));out={} + for (v,w),a in row.items(): + ww=w[1:]if w and w[0]==-s else(s,)+w;out[v,ww]=out.get((v,ww),Q(0))+a + return {k:a for k,a in out.items()if a} +def expected(i,back): + r=identity(i) + if back and i<112:add(r,identity(i+112),-1) + if not back and 112<=i<224:add(r,identity(i-112),1) + return r + +def replay(c,program,back=False,check_frames=True): + rows={i:identity(i)for i in range(632)};rows[632]={};cur=c['start'][:]+[None];paid=Counter();maxnorm=Q(1) + for e in program: + if e[0]=='scalar': + g,f=e[1:];r=g[1][1]+(632 if g[1][0]=='C'else 0) + if g[0]=='clear':need(r==632,'Borrowed erasure');rows[r]={};cur[r]=f + else: + if check_frames:need(cur[r]==f,'Scalar target frame') + if g[0]in('add','copy'): + v=g[2][1]+(632 if g[2][0]=='C'else 0) + if check_frames:need(cur[v]==f,'Scalar source frame') + if g[0]=='copy':need(r==632,'Borrowed overwrite');rows[r]=rows[v].copy() + else:need(r!=v,'Self add');add(rows[r],rows[v],Q(g[3],g[4])) + elif g[0]=='scale':rows[r]={k:Q(g[2],g[3])*v for k,v in rows[r].items()} + else:raise ValueError('Scalar opcode') + maxnorm=max(maxnorm,sum(map(abs,rows[r].values()),Q(0))) + elif e[0]=='warp': + _,r,op,x,y=e;r=r[1]+(632 if r[0]=='C'else 0) + if check_frames:need(cur[r]==x,'Warp source frame') + rows[r]=warp(rows[r],op,back);cur[r]=y + elif e[0]=='climb': + _,_,r,x,y,k=e + if check_frames:need(cur[r]==x,'Climb source frame') + need(k==len(c['frames'][y])-len(c['frames'][x])and k>0,'Ascending paid rank');cur[r]=y;paid[k]+=1 + elif e[0]=='center': + _,r,x,y,k=e;r+=632 + if check_frames:need(cur[r]==x,'Center source frame') + need(k==abs(len(c['frames'][y])-len(c['frames'][x])),'Center paid rank');cur[r]=y;paid[k]+=1 + else:need(e[0]in('phase','adapter','residual_adapter'),'Unknown opcode') + need(cur[:632]==c['final'],'Final frames');need(not rows[632],'Owned field cleared') + return rows,paid,maxnorm + +def clear_centers(program):return [['scalar',['clear',['C',e[1]]],e[3]]if e[0]=='center'else copy.deepcopy(e)for e in program] +def error_kernel(a): + rows,paid,_=replay(a['canonical'],clear_centers(a['programs']['forward']));E=[] + for i in range(632): + err=rows[i].copy();add(err,expected(i,False),-1) + for (j,w),v in sorted(err.items()): + need(112<=i<224 and(j<112 or j>=224),'Strict triangular error block');need(not w,'Constant owner kernel') + need(a['canonical']['final'][j]==1,'Repair source final full frame');need(j<112 or a['canonical']['start'][j]==0,'Pre-repair source initial ground') + E.append((i,j,v)) + need(len(E)==12532,'Frozen error term count') + return E + diff --git a/research/involutory-producer-raw-dual/inputs/forward/INVOLUTIVE-WORD.json.gz b/research/involutory-producer-raw-dual/inputs/forward/INVOLUTIVE-WORD.json.gz new file mode 100644 index 0000000000..eac634fb1d Binary files /dev/null and b/research/involutory-producer-raw-dual/inputs/forward/INVOLUTIVE-WORD.json.gz differ diff --git a/research/involutory-producer-raw-dual/inputs/original/ACTUAL-WORD.json.gz b/research/involutory-producer-raw-dual/inputs/original/ACTUAL-WORD.json.gz new file mode 100644 index 0000000000..46d929df83 Binary files /dev/null and b/research/involutory-producer-raw-dual/inputs/original/ACTUAL-WORD.json.gz differ diff --git a/research/involutory-producer-raw-dual/inputs/proof/PROOF.md b/research/involutory-producer-raw-dual/inputs/proof/PROOF.md new file mode 100644 index 0000000000..d0adf358c5 --- /dev/null +++ b/research/involutory-producer-raw-dual/inputs/proof/PROOF.md @@ -0,0 +1,50 @@ +# An actual involutive transfer on the current 632-field source + +This ports the eight supported line-repair mechanism of PR #1931 to the current Cao Yifan round-three source, through PR #4929's helper-clean center-free word. It proves a forward local producer with its actual paid profile. It does not establish a new κ or a physical raw-dual implementation. + +Let R be the checked 8 × 112 E8 observation matrix, K = Rᵀ/4, and A = I − KR. The verifier binds these matrices to the actual deleted-center error on all 632 independent input fields: E_X = −KR. It checks RK = 14 I. + +Choose the eight ports 0, 7, 20, 23, 86, 93, 108 and 111. Let P equal K on these eight rows and zero elsewhere. The exact check RP = I certifies a supported right inverse. Put U = K − 12P and F = I − UR = A + 12PR. Then RU = 2 I, so + + F² = I − 2UR + U(RU)R = I. + +Both U and R have rank 8 because RU = 2 I. Hence F − I has rank 8, its negative eigenspace has dimension 8 and its positive eigenspace has dimension 104. This is an involution, not a claim of orthogonality or unit condition number. All coefficients are fixed rationals; fixed-word multiplication/division must use the project's admitted scalar tariff. + +## The actual forward word + +First execute the source-bound center-free forward word with the signed ground helper precompensation from PR #4929. Its exact normalized endpoints are X unchanged, Y ← Y + AX, and every arbitrary helper unchanged. Physically, every X exit is the common full frame, whereas Y_i exits at its rank 8 hyperplane F_i. + +For each of the eight selected rows i: + +1. Clear the already owned C0 at the common full frame. +2. Gather C0 = 12 Σ_j (PR)_ij X_j there, using ordinary ADDs between equal frames. +3. Apply the exact full-to-F_i Gaussian transport to C0. Its child rank is 1. +4. Add C0 into Y_i at F_i and clear C0. + +The repair affects only those eight Y fields. Consequently the complete endpoint is X unchanged and Y ← Y + FX; all 408 borrowed helpers retain their arbitrary inputs and original exit charts, all 632 persistent fields retain their original physical ABI, and C0 is zero. No borrowed field is erased or overwritten. + +The complete paid profile is 2,209 rank 1, 412 rank 2, 510 rank 3, 127 rank 4 and 40 rank 5 children. In particular, the eight original rank 8 center children remain absent and eight rank 1 repairs have been added. The full literal word, its frame IDs, repairs and finite-code lowering circuits are retained in INVOLUTIVE-WORD.json.gz. + +The compiler separately constructs each lowering operator as C(F_i) C(FULL)⁻¹ and factors it into two native monomial maps and one rank 1 Gaussian child. Explicit checks compare both the complete Clifford tableau and the exact zero-input state; together these check the operator including its global phase. The kernel identity is fixed on the nine-axis native block and extends by its admitted native tensor interpretation; it is not an empirical numerical comparison. The semantic replay checks every arbitrary persistent input column, not only zero helpers. Sign mutation and omission of the paid lowering are rejected. The replay is not a Lean kernel certificate. + +## Precision and scope + +This is a fixed finite word with fixed coefficients, monomial maps and unitary Gaussian children. In the maximum over fields of the fiber Euclidean norm, each ADD by c has operator norm at most 1 + |c|, COPY and CLEAR have norm at most 1 under their owned-field contracts, and the native unitary maps have norm 1. The product of these finitely many factors bounds every contiguous suffix independently of the fiber width. Thus a standard per-operation rounding allocation uses O(log n) guard precision for n-bit inputs under the source's precision convention. An entrywise norm conversion additionally includes the square root of the fiber volume; its logarithm is linear in the fiber width. The recorded prefix bound 457 is a state bound, not a claimed bound for every rounding suffix. + +The abstract inverse-transpose of the normalized forward shear is X ← X − FᵀY, Y unchanged. Although (Fᵀ)² = I, that fact alone does not supply the correctly typed physical backward word. This release does not claim one. Distinct routed stages have different normalizers, so F² = I does not by itself close a recursive controller. No new κ is claimed. + +## Predecessor credit + +Rohan Arun’s PR #1931, head d043a01b222365a951853904c001761921bb843b, supplies this involutive reflection formula, its supported eight rank 1 repairs and the source-restored forward interface. Ali Romman’s PR #1862 supplies the ordered source-family and native boundary-transfer framework on which it builds; PR #1800 supplies its older source. This release is a checked port to the newer 632-field source, not a first involution construction. + +PR #4929 supplies the current exact helper precompensation, rank 8 source-code extraction and source-bound replay. Cinna Davis's PR #4694 already supplies center removal and the cache-kernel decomposition; PR #4698 supplies its helper basis and local consumer framework. Cao Yifan's canonical research/kappa-round3-warp-20261022 package contains the actual joint helper/native source improvements beyond PR #4610. Retained source notices remain authoritative. Prepared by Dugongue with substantial OpenAI Codex assistance. + +## Source-mutating unit-transfer corollary + +The separate UNIT-TRANSFER-WORD.json.gz appends eight serial source updates I - u_k r_k at the common full X exit frame. Since r_l u_k = 2 delta_lk, the cross terms between distinct updates vanish, and their product is F. Its exact endpoint is X_new = FX, Y_new = Y + X_new. It preserves all 408 independent helpers and the same paid profile; the source mutation is explicit. This is the current-source port of the additional interface already supplied by PR #1931, not a new controller admission. + +## Artifact metadata and check coverage + +The word retains the original source canonical boundary object, including its historical local_profile field. That inherited field is not the price of the changed program. The changed invoice is computed from every literal event and frozen in INVOLUTIVE-EXPECTED.json; downstream users must use that explicit verified invoice. The same distinction applies to the unit-transfer word. + +A separate coefficient audit reconstructs F as eight serial rank-one reflections and checks its indefinite diagonal form. A separate sparse Gaussian-integer interpreter compares all 4,096 repair basis columns, including phases. These checks do not constitute a second independent interpreter for the entire inherited 632-field word or an independent human audit. diff --git a/research/involutory-producer-raw-dual/inputs/prune/prune_native.py b/research/involutory-producer-raw-dual/inputs/prune/prune_native.py new file mode 100644 index 0000000000..8c3e11b240 --- /dev/null +++ b/research/involutory-producer-raw-dual/inputs/prune/prune_native.py @@ -0,0 +1,253 @@ +#!/usr/bin/env python3 +"""Delete exact unconsumed centre-assembly/inverse pairs, including dirty state. + +Apache-2.0; substantial OpenAI assistance. The native writer and final verifier +are reused with attribution from the frozen causal-continuation package. The +new search checks literal rational perturbations, never numerical similarity. +""" +from collections import Counter +from copy import deepcopy +from fractions import Fraction as Q +from hashlib import sha256 +from pathlib import Path +import argparse +import gzip +import importlib.util +import json +import sys +sys.dont_write_bytecode = True +HERE = Path(__file__).resolve().parent +RESEARCH = HERE.parents[1] +BASE = RESEARCH / 'kappa-global-routing/integrated-complex' +CHECKER = RESEARCH / 'kappa-causal-continuation/buffer-borrowing/verify_buffers.py' +CHECKER_SHA = '106b4d5e052427230df452f0c901d5390a0583782960b80a8af94d9a984022c7' +CLIFFORD = RESEARCH / 't74-native-fast/vendor/native/new/code/borrow/vendor/clifford/clifford_exact.py' +TAGS = ('THREE-base', 'THREE-extra', 'FOUR-base', 'FOUR-extra') + + +def need(ok, why): + if not ok: raise ValueError(why) + + +def digest(path): return sha256(path.read_bytes()).hexdigest() + + +def read(path): + data = path.read_bytes() + return json.loads(gzip.decompress(data) if path.suffix == '.gz' else data) + + +def save(path, value): + data = json.dumps(value, sort_keys=True, separators=(',', ':')).encode() + path.write_bytes(gzip.compress(data, mtime=0)) + + +def load(path, name): + spec = importlib.util.spec_from_file_location(name, path) + obj = importlib.util.module_from_spec(spec) + sys.modules[name] = obj + spec.loader.exec_module(obj) + return obj + + +def apply(v, rows, event, backward=False): + if event[0] == 'warp': + r = tuple(event[1]); rows[r] = v.warp(rows[r], event[2], backward) + elif event[0] == 'scalar': + g = event[1]; r = tuple(g[1]) + if g[0] == 'add': v.add(rows[r], rows[tuple(g[2])], Q(g[3], g[4])) + else: + need(g[0] == 'scale', 'No owned field in the clean-J baseline') + rows[r] = {k: Q(g[2], g[3])*x for k, x in rows[r].items()} + + +def index_sections(program): + phase = None; result = {'A': [], 'full_frame_cleanup': []} + for i, e in enumerate(program): + if e[0] == 'phase': phase = e[1] + if phase in result and e[0] in ('scalar', 'warp'): result[phase].append(i) + return result + + +def exact_candidate_screen(v, canonical, program, R): + """Test the final 48 assembly gates, with their actual scheduled inverses.""" + indices = index_sections(program) + need(len(indices['A']) == len(canonical['A']), 'Native A gate correspondence') + need(len(indices['full_frame_cleanup']) == len(canonical['cleanup']), 'Cleanup gate correspondence') + options = []; unmatched = [] + for j in range(len(canonical['A']) - 48, len(canonical['A'])): + g = canonical['A'][j] + need(g[0] == 'add' and len(canonical['frames'][g[-1]]) in (7, 8), 'Final centre-assembly grammar') + inverse = g[:]; inverse[3] *= -1; inverse[-1] = 1 + hits = [i for i, h in enumerate(canonical['cleanup']) if h == inverse] + if len(hits) == 1: + cj = hits[0] + options.append((j, cj, indices['A'][j], indices['full_frame_cleanup'][cj])) + else: unmatched.append({'A_index': j, 'gate': g, 'matching_inverse_occurrences': hits}) + sites = {k for option in options for k in option[2:]} + effects = {}; rows = {('L', i): v.identity(('L', i)) for i in range(632)} + for i, e in enumerate(program): + if i in sites: + g = e[1] + effects[i] = (tuple(g[1]), {k: -Q(g[3], g[4])*x for k, x in rows[tuple(g[2])].items()}) + apply(v, rows, e) + need(all(row == v.expected(r, R, False, True) for r, row in rows.items()), 'Pinned baseline endpoint') + accepted = []; rejected = [] + for aj, cj, ai, ci in options: + delta = {('L', i): {} for i in range(632)} + live_data_effect = False + for i in range(ai, len(program)): + if i in (ai, ci): + target, effect = effects[i]; v.add(delta[target], effect, Q(1)) + else: apply(v, delta, program[i]) + if i < indices['full_frame_cleanup'][0]: + e = program[i] + if e[0] == 'scalar' and e[1][0] in ('add', 'scale'): + r = tuple(e[1][1]) + if r[0] == 'L' and 112 <= r[1] < 224 and delta[r]: live_data_effect = True + bad = [(r, row) for r, row in delta.items() if row] + item = {'A_index': aj, 'cleanup_index': cj, 'A_gate': canonical['A'][aj], + 'cleanup_gate': canonical['cleanup'][cj], + 'native_scalar_sites': [ai, ci], 'Y_difference_before_cleanup': live_data_effect} + if not bad: + item['all_632_arbitrary_input_columns_exactly_preserved'] = True + accepted.append(item) + else: + r, row = bad[0]; key, value = next(iter(sorted(row.items()))) + item['first_exact_nonzero_residual'] = {'output': list(r), 'input': list(key[0]), + 'operator_word': list(key[1]), 'coefficient': str(value)} + item['changed_output_fields'] = len(bad) + rejected.append(item) + need(all(not a['Y_difference_before_cleanup'] for a in accepted), 'No changed data consumer before cleanup') + return accepted, rejected, unmatched + + +def prefix_growth(v, program, backward): + rows = {('L', i): v.identity(('L', i)) for i in range(632)} + maximum_l1 = Q(1); max_coefficient = Q(1); max_numerator = 1; max_denominator = 1 + witness = {'event': -1, 'register': ['L', 0]} + for i, event in enumerate(program): + apply(v, rows, event, backward) + if event[0] not in ('scalar', 'warp'): continue + role = tuple(event[1] if event[0] == 'warp' else event[1][1]) + values = [abs(x) for x in rows[role].values()] + norm = sum(values, Q(0)) + if norm > maximum_l1: + maximum_l1 = norm; witness = {'event': i, 'register': list(role)} + if values: + max_coefficient = max(max_coefficient, max(values)) + max_numerator = max(max_numerator, max(x.numerator for x in values)) + max_denominator = max(max_denominator, max(x.denominator for x in values)) + return {'max_formal_row_l1': str(maximum_l1), 'max_abs_coefficient': str(max_coefficient), + 'max_abs_numerator': max_numerator, 'max_denominator': max_denominator, + 'l1_witness': witness, 'independent_input_columns': 632, + 'scope': 'Exact logical scalar/monomial prefixes over arbitrary inputs; no rounded child error bound.'} + + +def monomial(ce, recipe, n): + result = ce.diag(n, tuple(recipe['quadratic_rows']), tuple(recipe['linear_Z4'])) + result = result.then(ce.perm(n, tuple(recipe['matrix_rows']))).then(ce.xgate(n, recipe['offset'])) + return result.then(ce.Op(n, ce.identity(n), [('phase', recipe['phase'])])) + + +def conjugate(ce, op): + n = op.n; result = ce.ident(n) + for g in op.circuit: + if g[0] == 'P': part = ce.perm(n, g[1]) + elif g[0] == 'X': part = ce.xgate(n, g[1]) + elif g[0] == 'C': part = ce.cgate(n, g[1], -g[2]) + elif g[0] == 'D': part = ce.diag(n, g[1], tuple(-x % 4 for x in g[2])) + else: + need(g[0] == 'phase', 'Known Clifford primitive') + part = ce.Op(n, ce.identity(n), [('phase', -g[1] % 4)]) + result = result.then(part) + return result + + +def check_new_edges(canonical, old_program, new_program, cache): + ce = load(CLIFFORD, 'function_composition_clifford') + old = {(e[3], e[4]) for e in old_program if e[0] == 'climb'} + new = {(e[3], e[4]) for e in new_program if e[0] == 'climb'} + reports = [] + for a, b in sorted(new - old): + A, B = canonical['frames'][a], canonical['frames'][b] + key = tuple(A), tuple(B) + if key not in cache: + source = ce.canonical_frame(9, A).adjoint().then(ce.canonical_frame(9, B)) + records = {} + for name, op in (('forward', source), ('inverse_transpose', conjugate(ce, source))): + recipe, _ = ce.lower_child(op) + need(recipe['rank'] == len(B)-len(A), 'Exact new physical child rank') + decoded = monomial(ce, recipe['right'], 9).then(ce.fourier(9, range(recipe['rank']))).then(monomial(ce, recipe['left'], 9)) + need(decoded.tab == op.tab and decoded.zero_state() == op.zero_state(), 'Decoded Clifford equality including global phase') + records[name] = recipe + cache[key] = records + reports.append({'old_frame': a, 'new_frame': b, 'old_basis': A, 'new_basis': B, + 'rank': len(B)-len(A), 'exact_physical_recipes': cache[key]}) + return reports + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--out', type=Path, default=HERE/'pruned-native') + args = parser.parse_args(); args.out.mkdir(parents=True, exist_ok=True) + need(digest(CHECKER) == CHECKER_SHA, 'Frozen independent checker') + v = load(CHECKER, 'function_composition_independent'); v.authenticate() + base_receipt = read(BASE/'RESULT.json') + R = [{int(k): Q(x) for k, x in row.items()} for row in v.read(v.PACKET)['R_rows']] + providers = {}; phase_cache = {} + for tag in TAGS: + path = BASE/(tag+'-CANONICAL.json.gz') + need(digest(path) == base_receipt['providers'][tag]['artifacts'][path.name], 'Pinned baseline canonical') + old = read(path); old_native = v.emit_original(old) + yes, no, unmatched = exact_candidate_screen(v, old, old_native['forward'], R) + candidate = deepcopy(old) + a_drop = {r['A_index'] for r in yes}; c_drop = {r['cleanup_index'] for r in yes} + candidate['A'] = [g for i, g in enumerate(old['A']) if i not in a_drop] + candidate['cleanup'] = [g for i, g in enumerate(old['cleanup']) if i not in c_drop] + native = v.emit_original(candidate) + histogram = Counter(e[5] for e in native['forward'] if e[0] == 'climb') + candidate['local_profile'] = {str(r): n for r, n in sorted(histogram.items())} + candidate['edges'] = [list(e) for e in sorted({(e[3], e[4]) for e in native['forward'] if e[0] == 'climb'})] + checks = {} + for name in ('forward', 'backward'): + checks[name] = {'independent_literal_replay': v.replay(native[name], candidate, R, name == 'backward', True), + 'baseline_prefix_growth': prefix_growth(v, old_native[name], name == 'backward'), + 'new_prefix_growth': prefix_growth(v, native[name], name == 'backward')} + phases = check_new_edges(candidate, old_native['forward'], native['forward'], phase_cache) + # Removing the computation while retaining its inverse must be rejected. + negative = deepcopy(candidate) + first = yes[0] + negative['cleanup'].insert(0, first['cleanup_gate']) + bad_program = v.emit_original(negative) + rejected_control = False + try: v.replay(bad_program['forward'], negative, R, False, True) + except ValueError as error: + rejected_control = 'operator mismatch' in str(error) + need(rejected_control, 'Unpaired deletion negative control') + cp = args.out/(tag+'-CANONICAL.json.gz'); np = args.out/(tag+'-NATIVE-WORD.json.gz') + save(cp, candidate); save(np, native) + providers[tag] = {'baseline_canonical_sha256': digest(path), 'candidate_pairs_tested': len(yes)+len(no), + 'accepted_pairs': yes, 'rejected_pairs': no, 'unmatched_pairs': unmatched, + 'old_paid_profile': old['local_profile'], 'new_paid_profile': candidate['local_profile'], + 'old_paid_rank_mass': sum(int(r)*n for r, n in old['local_profile'].items()), + 'new_paid_rank_mass': sum(int(r)*n for r, n in candidate['local_profile'].items()), + 'recursive_calls_removed': sum(old['local_profile'].values())-sum(histogram.values()), + 'scalar_ADDs_removed': 2*len(yes), 'checks': checks, + 'new_physical_edges': phases, 'unpaired_deletion_negative_control_rejected': True, + 'artifacts': {cp.name: digest(cp), np.name: digest(np)}} + print('PASS pruned native', tag, len(yes), 'pairs;', dict(sorted(histogram.items())), flush=True) + result = {'schema': 'consumer-driven-clean-J-native-pruning/1', + 'status': 'PASS_ALL_FOUR_BOTH_DIRECTIONS_632_ARBITRARY_FIELDS', + 'generator_sha256': digest(Path(__file__)), 'baseline_receipt_sha256': digest(BASE/'RESULT.json'), + 'independent_interpreter_sha256': CHECKER_SHA, 'phase_compiler_path': str(CLIFFORD.relative_to(RESEARCH.parent)), + 'phase_compiler_sha256': digest(CLIFFORD), 'providers': providers, + 'native_word_new_children_phase_lowered': True, 'local_data_and_helper_endpoints_unchanged': True, + 'same_632_field_inventory': True, 'zero_owned_fields': True, 'zero_external_cleanup_fields': True, + 'no_new_kappa_claimed': True, 'query_producer_contract_preserved': False, + 'scope': 'Exact ideal clean-J local endpoints only. Final historical query assemblies are partially removed because this local word has no centre consumers. A caller that reads those historical queries cannot substitute this word without reconstructing and pricing its producer interface. The full caller and rounded induction remain open.'} + (args.out/'RESULT.json').write_text(json.dumps(result, indent=2, sort_keys=True)+'\n') + print(result['status'], flush=True) + + +if __name__ == '__main__': main() diff --git a/research/involutory-producer-raw-dual/inputs/source4935/SOURCE-WORD.json.gz b/research/involutory-producer-raw-dual/inputs/source4935/SOURCE-WORD.json.gz new file mode 100644 index 0000000000..46d929df83 Binary files /dev/null and b/research/involutory-producer-raw-dual/inputs/source4935/SOURCE-WORD.json.gz differ diff --git a/research/involutory-producer-raw-dual/science/RAWDUAL-WORD.json.gz b/research/involutory-producer-raw-dual/science/RAWDUAL-WORD.json.gz new file mode 100644 index 0000000000..d6343a134e Binary files /dev/null and b/research/involutory-producer-raw-dual/science/RAWDUAL-WORD.json.gz differ diff --git a/research/involutory-producer-raw-dual/science/REPORT.md b/research/involutory-producer-raw-dual/science/REPORT.md new file mode 100644 index 0000000000..d211108a00 --- /dev/null +++ b/research/involutory-producer-raw-dual/science/REPORT.md @@ -0,0 +1,196 @@ +# A literal physical raw dual for the source-restored eight-repair transfer + +The one bounded candidate succeeds. Starting from the actual backward word of +PR #4929, eight owned rank1 lifts and424 common-full-chart ADDs return + + X' = X - F^T Y, Y' = Y, helpers' = helpers, + +in the retained raw-dual source gauges. F is exactly the source-restored +involution emitted by PR #4935. Every one of632 arbitrary input rows is +checked; all408 independent helper jobs survive once. The complete paid +profile is {1:2209,2:412,3:510,4:127,5:40}, matching that forward producer. +This supplies its previously open physical raw dual, not a profitable caller +or improved kappa. The source-mutating UNIT-TRANSFER variant is excluded. + +## Consumed contracts and source bytes + +The fixed prospective scope was authorized by the root's public4902 claim +before emitting this word. Exact consumed heads are + +- #4935:64c9f99693c92fb370096fb43dbc58a085b30e36, + research/native-involutive-port-transfer/INVOLUTIVE-WORD.json.gz; +- #4929:361f5d4100640177d6a983dd2f336021c75bfd5e, + research/native-center-free-code/CODED-WORDS.json.gz; +- native source:20bb93cd990d2ff683e4d0fc56b87a42cd5d3296, + research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz. + +SOURCES.json records exact source bytes, paths and the checker hash. The +4935 SOURCE-WORD payload decompresses byte-for-byte to the authenticated +native payload, whose compressed hash is7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05. +The frame, start, finish and port data agree. The compiler is the native +exact Clifford engine at that source pin. The actual raw-dual convention is +primitive-wise conjugation from prune_native.conjugate, preserving circuit +order. It is not an adjoint/reversed-frame approximation. + +The emitter consumes the already emitted4929 backward program unchanged as +an identical typed chronological prefix; it does not regenerate an abstract transpose +of the forward program. It then appends the concrete suffix below. It also +freshly replays the actual4935 source-restored forward artifact, the actual +4929 backward prefix and the complete new backward word on all632 original +owner columns. This reuses the pinned native_core semantic interpreter; +it is not a separately implemented interpreter of the entire inherited word. +B's separate review supplies the independent interpreter and phase checks. + +## Exact matrix and physical construction + +Use4935's exact8-by112 observation R, K=R^T/4, and P equal to K on rows +J={0,7,20,23,86,93,108,111}, zero elsewhere. The inherited code is A, and + + Delta=12PR, F=A+Delta. + +All correction coefficients are dyadic. The checker authenticates R and +compares F entry-by-entry to the committed4935 forward F; the matrix is +non-symmetric, so a missing transpose is a discriminating error. It does not +infer a physical backward word from F^2=I. + +After the actual4929 backward program, every Y_j has the pure physical +returned value bar(V_j)y_j in its actual rank8 exit chart, while every X_i +is in the common bar(FULL) chart. Helpers are already restored. For each +selected j, the suffix is literally + +1. CLEAR the already owned C0 and tag it with Y_j's actual exit chart. +2. COPY the returned Y_j into C0, without changing Y_j. +3. Apply L_j=bar(FULL)bar(V_j)^-1 to C0, an ordinary rank1 Gaussian child. +4. At the common full chart, perform X_i+=-Delta[j,i] C0 for every nonzero + coefficient in that selected row. +5. CLEAR C0 to its final empty owned state. + +The eight source Y exit frames are142,149,162,165,228,235,250,253. Every L_j +is constructed by actual primitive-wise conjugation of the forward +V_j-to-FULL word and lowered to two monomial maps and one rank1 Gaussian. +All eight compiled words agree with the direct words in both tableau and +zero-input state, fixing absolute phase. Each circuit has exactly two each +of native D,P,X,phase primitives and one C primitive. These are actual +lowered words in RAWDUAL-WORD, not a rank-only bill. + +In normalized coordinates the added X_i term is exactly +-Delta[j,i]y_j. Thus the new endpoint is X-A^TY-Delta^TY=X-F^TY. All112 +physical Y output arrays are read-only during the suffix, all408 helpers +are untouched, and no other arbitrary input is overwritten. C0 already +belongs to the source and earns no productive credit. No new arbitrary +owner or extra storage array is introduced. + +## Exact raw duality and allwidth phase + +Let U_in,U_out be the block-diagonal source input/output frame operators. +The physical source-restored forward endpoint is + + M_f = U_out S_F U_in^-1, + S_F = [I 0; F I] on mains, identity on helpers. + +Unitary source frames give U^-T=bar(U). The new literal backward program is +verified in the conjugated source gauges, with + + M_b = bar(U_out) S_F^-T bar(U_in)^-1. + +Consequently M_b=M_f^-T including the actual native phases. All12544 entries +of the backward main transfer are compared to the transposed forward F, +and all632 original owner rows are checked. This is source-restored duality; +no relation to4935's explicitly source-mutating second word is asserted. + +Each native frame identity and compiled lift is an equality of single +absolute-phase Clifford words. At column multiplicity f, lift each word by +its actual columnwise tensor power; conjugation, products and inverse +relations persist. Scalar owner-space coefficients remain outside those +tensor powers. The semantic replay retains native free-word order, so it +proves polynomial identities for the source assignment at every positive +width. No one-column equality of an operator sum is tensor-powered, and no +global phase is discarded. The added COPY/CLEAR contract is explicit; we do +not claim that these owned instructions are a literal reversed-transpose +instruction listing of the forward repairs. + +## Complete recursive and finite invoice + +The4929 backward baseline pays {1:2201,2:412,3:510,4:127,5:40}. The suffix +adds exactly8H1 and no other Gaussian job. Final paid profile is therefore +{1:2209,2:412,3:510,4:127,5:40}, the exact4935 forward profile. There are +still408 helper targets with profile {4:28,7:7,8:47,9:326}; none is consumed, +identified, subtracted or credited twice. The artifact canonical.local_profile is inherited4929 metadata; downstream +users must use the freshly counted RESULT.json paid field for the new bill, +not that baseline metadata. The changed main transfer is F^T, +not the old A^T. No additional independent main Gaussian target is claimed. +Relative to the old632 producer, eight H8 centre calls have become eight +H1 repairs; this is a changed transfer contract, not unchanged-output saving. + +The complete new backward word has28501 typed events, with the old28045 +coded events as an identical typed prefix and456 appended events: +8 COPY,16 CLEAR,8 paid Gaussian lifts and424 weighted ADDs. The ADD +coefficient census is -12 eight times,-6 268 times,+6 148 times. +These424 weighted ADD instructions are not2976 extra Gaussian calls. + +For comparison with the inherited scalar allowance, use the same integer +coefficient tariff + + tariff(c)=3+(bit_length(abs(numerator))-1)+popcount(abs(numerator)) + +(bit_length(denominator)-1). + +A coefficient of magnitude6 has tariff7, magnitude12 has tariff8. Hence +416*7+8*8=2976 is a conservative elementary scalar-primitive allowance for +those424 weighted ADDs. Signs do not change that tariff. Charging every +COPY/CLEAR one array pass and every one of the64 emitted monomial circuit +primitives one pass gives at most2976+24+64=3064 additional elementary +whole-array passes, besides the8 recursively paid H1 jobs. This deliberately +retains identity/phase primitives rather than silently subtracting them. +Columnwise index/phase evaluation retains its O(f) work per entry. The array +volume N is the inherited supplier embedding's volume, not an extra small +standalone nine-bit cost. Peak owned storage stays at the one existing C0. + +The frozen semantic prefix norm remains258 backward (4935 forward457). +That coefficient bound is not a suffix rounding-error bound. In the maximum +of fiber Euclidean field norms, a weighted ADD by c has norm at most1+|c|; +owned COPY/CLEAR under their declared workspace contract and exact unitary +maps have norm at most1. A conservative bound for every repair-suffix error +amplification is therefore13^8*7^416, independent of f. Multiply it by an +appropriate inherited suffix bound when assigning errors inside the old +prefix. One may allocate the added eight Gaussian/local rounding errors so +their sum after this finite amplification fits the chosen reserve. This +requires an actual precision allocation by a future caller; no recursive +compiler reserve or outer recovery is funded here. Fiber entrywise norms +also require the relevant square-root volume conversion. Fixed constants +permit the usual logarithmic guard precision under the admitted source +convention; they are not a new precision theorem for a multiplier. + +## Replay, controls and audit history + +From this worktree root, read-only: + + python3 -I -B outputs/pr4935-rawdual-repair/check.py + python3 -I -O -B outputs/pr4935-rawdual-repair/check.py + +Both reproduce identical frozen artifact and receipt bytes. Explicit --emit +writes only this local folder. Four controls reject a repair sign error, +omitted physical rank1 lifts, wrong transpose and absent repair. These are +finite rejection controls, not a proof-kernel or complete multiplier audit. + +During development an assumed balanced -6/+6 sign census208/208 was rejected +by the guard. Direct R reconstruction gives268/148, independently confirmed +by B. The generated scatter always used exact -12PR; endpoint/paid checks +had already passed before that census guard. No incorrect frozen receipt was +issued. The current normal/optimized receipts contain the corrected census. + +The rawdual artifact hash is +b82a423cf4a44669d44b168dab3459e9bdb646cefd96c4e4d5f401c567eec6a2. +No remote writes, family scan, fresh decoder, complete caller or new kappa +claim is part of this local finding. + +## Credit + +Credit Dugongue's4935 current-source involutive transfer and4929 autonomous +coded producer; Rohan Arun's1931 eight-repair/source-reflection construction; +Ali Romman's1862 ordered-family/native-transfer framework; Cinna Davis / +1337isnot1337's4694/4698 and retained4470 lineage; Cao Yifan/intqwq's actual +round-three source beyond4610; and the retained E8/scalar/Clifford/compiler/ +precision/outer contributors, zxv and Jacob Alan Sussman. The root proposed +this physical backward COPY-lift-scatter repair; this agent emitted and +checked it, and B independently audits it. Substantial OpenAI Codex +assistance; no human or Lean/kernel acceptance is claimed. Apache-2.0. diff --git a/research/involutory-producer-raw-dual/science/RESULT.json b/research/involutory-producer-raw-dual/science/RESULT.json new file mode 100644 index 0000000000..9f157fd273 --- /dev/null +++ b/research/involutory-producer-raw-dual/science/RESULT.json @@ -0,0 +1,59 @@ +{ + "Y_owners_retained": 112, + "added_rank1_calls": 8, + "all12544_transpose_coefficients_checked": true, + "all632_forward_and_backward_rows_checked": true, + "arbitrary_original_inputs": 632, + "compiler_or_outer_funded": false, + "controls": { + "erase_repair": true, + "omit_rank1_lift": true, + "repair_sign": true, + "wrong_transpose": true + }, + "events": 28501, + "extra_owned_arrays": 0, + "forward_prefix_l1": "457", + "full_caller": false, + "independent_helpers_retained": 408, + "new_kappa": false, + "new_prefix_l1": "258", + "owned_C0_final_zero": true, + "paid": { + "1": 2209, + "2": 412, + "3": 510, + "4": 127, + "5": 40 + }, + "pins": { + "4929": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "4935": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "native": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296" + }, + "scatter_coefficient_counts": { + "-12": 8, + "-6": 268, + "6": 148 + }, + "scatter_scalar_primitive_allowance": 2976, + "single_word_phase_checks": 8, + "source_X_mutation": false, + "source_backward_paid": { + "1": 2201, + "2": 412, + "3": 510, + "4": 127, + "5": 40 + }, + "source_backward_prefix_l1": "258", + "status": "PASS_ONE_ACTUAL632_SOURCE_RESTORED_RAWDUAL_NOT_CALLER", + "suffix_census": { + "ADD": 424, + "CLEAR": 16, + "COPY": 8, + "GaussianH1": 8 + }, + "suffix_events": 456, + "word_sha256": "b82a423cf4a44669d44b168dab3459e9bdb646cefd96c4e4d5f401c567eec6a2" +} diff --git a/research/involutory-producer-raw-dual/science/SOURCES.json b/research/involutory-producer-raw-dual/science/SOURCES.json new file mode 100644 index 0000000000..a961a85f44 --- /dev/null +++ b/research/involutory-producer-raw-dual/science/SOURCES.json @@ -0,0 +1,56 @@ +{ + "checker_sha256": "8ec1616bc7336f7999e0139ef0fa1c390a61f52db40c5f87bbc325a3febd0065", + "consumed": { + "R": { + "commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "path": "research/native-involutive-port-transfer/R.json", + "sha256": "7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1" + }, + "ce": { + "commit": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296", + "path": "research/t74-native-fast/vendor/native/new/code/borrow/vendor/clifford/clifford_exact.py", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + "code": { + "commit": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "path": "research/native-center-free-code/CODE.json", + "sha256": "8be7f3f073b7981ec91c6af43edff0ac8a89f4824ef6026ae758c287dd6c03d0" + }, + "coded": { + "commit": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "path": "research/native-center-free-code/CODED-WORDS.json.gz", + "sha256": "797bad53122f84aa0f05b602f2bdceb6b50f95a64023799d4f24560d9c61aad6" + }, + "core": { + "commit": "361f5d4100640177d6a983dd2f336021c75bfd5e", + "path": "research/native-center-free-code/native_core.py", + "sha256": "178ff80824a012970fc9435f122152da03c7e6bdc3a7de12136fe03e05cf24fe" + }, + "forward": { + "commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "path": "research/native-involutive-port-transfer/INVOLUTIVE-WORD.json.gz", + "sha256": "ff2999f022e93e05a250160808aa3c32a08041039d7edfb01068c0308f50c138" + }, + "original": { + "commit": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296", + "path": "research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05" + }, + "proof": { + "commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "path": "research/native-involutive-port-transfer/PROOF.md", + "sha256": "baeb220fa1b0a649ab87b5234925e16e32fb47d92a588e8a8c5c75d0f2b08da3" + }, + "prune": { + "commit": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296", + "path": "research/kappa-function-composition/complex/prune_native.py", + "sha256": "f2b37c183a10922eabc8e0436b426a08866430e96bd0adc7e178951c7fbb5257" + }, + "source4935": { + "commit": "64c9f99693c92fb370096fb43dbc58a085b30e36", + "path": "research/native-involutive-port-transfer/SOURCE-WORD.json.gz", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05" + } + }, + "schema_version": 1 +} diff --git a/research/involutory-producer-raw-dual/science/check.py b/research/involutory-producer-raw-dual/science/check.py new file mode 100644 index 0000000000..c394264aa1 --- /dev/null +++ b/research/involutory-producer-raw-dual/science/check.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +"""One physical source-restored4935 raw dual. Apache-2.0; Codex assistance. +Pinned sources are read only. This script writes only here with --emit. +""" +from pathlib import Path +from fractions import Fraction as Q +from collections import Counter +from hashlib import sha256 +import ast,gzip,json,subprocess,sys,types +HERE=Path(__file__).resolve().parent +P4935='64c9f99693c92fb370096fb43dbc58a085b30e36' +P4929='361f5d4100640177d6a983dd2f336021c75bfd5e' +NATIVE='20bb93cd990d2ff683e4d0fc56b87a42cd5d3296' +PORTS=[0,7,20,23,86,93,108,111] +SPECS={ + 'forward':(P4935,'research/native-involutive-port-transfer/INVOLUTIVE-WORD.json.gz'), + 'R':(P4935,'research/native-involutive-port-transfer/R.json'), + 'proof':(P4935,'research/native-involutive-port-transfer/PROOF.md'), + 'source4935':(P4935,'research/native-involutive-port-transfer/SOURCE-WORD.json.gz'), + 'coded':(P4929,'research/native-center-free-code/CODED-WORDS.json.gz'), + 'core':(P4929,'research/native-center-free-code/native_core.py'), + 'code':(P4929,'research/native-center-free-code/CODE.json'), + 'original':(NATIVE,'research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz'), + 'ce':(NATIVE,'research/t74-native-fast/vendor/native/new/code/borrow/vendor/clifford/clifford_exact.py'), + 'prune':(NATIVE,'research/kappa-function-composition/complex/prune_native.py'), +} +def need(c,m): + if not c:raise ValueError(m) +def fetch(pin,path):return subprocess.check_output(['git','--no-replace-objects','show',pin+':'+path]) +def module(name,data): + m=types.ModuleType(name);m.__file__=name+'.py';sys.modules[name]=m + exec(compile(data,name+'.py','exec'),m.__dict__);return m +def encode(x):return (json.dumps(x,indent=2,sort_keys=True)+'\n').encode() +def main(): + raw={k:fetch(*v)for k,v in SPECS.items()} + need(sha256(raw['original']).hexdigest()=='7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05','native source hash') + need(sha256(raw['R']).hexdigest()=='7b33b6dfb494c6eafe6d87a08d6a2c2e0681e56429495b2b27949040f0f63cd1','4935 R source hash') + need(sha256(raw['ce']).hexdigest()=='2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962','native compiler hash') + need(gzip.decompress(raw['source4935'])==gzip.decompress(raw['original']),'4935 exact underlying source') + V=module('rawdual4935_native_core',raw['core']);ce=module('rawdual4935_exact',raw['ce']) + definitions=[x for x in ast.parse(raw['prune']).body if isinstance(x,ast.FunctionDef)and x.name=='conjugate'] + env={};exec(compile(ast.Module(body=definitions,type_ignores=[]),'pinned_conjugate','exec'),env) + bar=lambda op:env['conjugate'](ce,op) + forward=json.loads(gzip.decompress(raw['forward']));coded=json.loads(gzip.decompress(raw['coded']));original=json.loads(gzip.decompress(raw['original'])) + c=coded['canonical'];need(c['frames']==original['canonical']['frames'] and c['start']==original['canonical']['start'] and c['final']==original['canonical']['final'],'native boundary identity') + need(forward['canonical']==c or all(forward['canonical'][k]==c[k]for k in ('frames','start','final','ports')),'4935 unchanged physical boundaries') + need(forward['selected_ports']==PORTS,'source-restored selected ports') + A=[[Q(x)for x in row]for row in json.loads(raw['code'])['A']] + F=[[Q(x)for x in row]for row in forward['F']] + R=[[Q(x)for x in row]for row in json.loads(raw['R'])] + correction=[[12*sum((R[k][j]/4)*R[k][i]for k in range(8)) if j in PORTS else Q(0)for i in range(112)]for j in range(112)] + need(F==[[A[j][i]+correction[j][i]for i in range(112)]for j in range(112)],'exact source-restored F=A+12PR') + need(F!=[list(x)for x in zip(*F)],'transpose distinction is nontrivial') + def target(matrix,back): + out=[V.identity(i)for i in range(632)] + for j in range(112): + for i,v in enumerate(matrix[j]): + if v:V.add(out[i]if back else out[112+j],V.identity(112+j)if back else V.identity(i),-v if back else v) + return out + oldrows,oldpaid,oldmax=V.replay(c,coded['programs']['backward'],True) + need([oldrows[i]for i in range(632)]==target(A,True),'fresh all632 coded backward endpoint') + frows,fpaid,fmax=V.replay(forward['canonical'],forward['program'],False) + need([frows[i]for i in range(632)]==target(F,False),'fresh all632 source-restored4935 forward endpoint') + suffix=[];lifts=[];allcoeff=[] + for j in PORTS: + fi=c['final'][112+j];need(c['final'][:112]==[1]*112,'common full X exits') + # Chronological inverse source-Y frame then full frame, then actual bar. + op=bar(ce.canonical_frame(9,c['frames'][fi]).adjoint().then(ce.canonical_frame(9,c['frames'][1]))) + cert,compiled=ce.lower_child(op) + need(cert['rank']==1 and op.tab==compiled.tab and op.zero_state()==compiled.zero_state(),'raw-dual lifting including global phase') + lifts.append({'port':j,'source_owner':112+j,'from':fi,'to':1,'rank':1,'lowering':cert,'literal_circuit':compiled.circuit,'actual_raw_dual_conjugation':True}) + suffix += [['scalar',['clear',['C',0]],fi],['scalar',['copy',['C',0],['L',112+j]],fi],['center',0,fi,1,1]] + for i,v in enumerate(correction[j]): + if v: + z=-v;allcoeff.append(z);suffix.append(['scalar',['add',['L',i],['C',0],z.numerator,z.denominator],1]) + suffix.append(['scalar',['clear',['C',0]],0]) + program=coded['programs']['backward']+suffix + rows,paid,maxnorm=V.replay(c,program,True);expected=target(F,True) + need([rows[i]for i in range(632)]==expected,'all632 exact rawinverse-transpose endpoint') + need(all(rows[i]==V.identity(i)for i in range(112,632)),'Y and all408 independent helpers unchanged logically') + need(paid==Counter({1:2209,2:412,3:510,4:127,5:40}) and paid==fpaid,'complete paid profile matches forward') + need(Counter(map(str,allcoeff))==Counter({'-12':8,'-6':268,'6':148}),'424 fixed dyadic scatter coefficients') + # Every coefficient of the normalized transpose product is checked directly: + # forward upper/lower shear cancellation is exact with arbitrary F. + need(all(expected[i].get((112+j,()),Q(0))+F[j][i]==0 for i in range(112)for j in range(112)),'all12544 transpose coefficients') + controls={} + bad=json.loads(json.dumps(program));k=next(i for i in range(len(coded['programs']['backward']),len(bad))if bad[i][0]=='scalar'and bad[i][1][0]=='add');bad[k][1][3]*=-1 + rr,_,_=V.replay(c,bad,True);controls['repair_sign']=any(rr[i]!=expected[i]for i in range(632)) + bad=[e for e in program if not(e[0]=='center'and e[4]==1)] + try:V.replay(c,bad,True) + except ValueError:controls['omit_rank1_lift']=True + else:controls['omit_rank1_lift']=False + controls['wrong_transpose']=expected!=target([list(x)for x in zip(*F)],True) + controls['erase_repair']=any(oldrows[i]!=expected[i]for i in range(632)) + need(all(controls.values()),'semantic controls') + artifact={'schema_version':1,'scope':'Source-restored4935physicalrawdual; source-mutatingvariant excluded','canonical':c,'program':program,'selected_ports':PORTS,'target_F':[[str(x)for x in row]for row in F],'native_lifts':lifts,'repair_suffix':suffix} + artifact=json.loads(json.dumps(artifact));word=gzip.compress(json.dumps(artifact,sort_keys=True,separators=(',',':')).encode(),mtime=0) + tariff=lambda z:3+abs(z.numerator).bit_length()-1+abs(z.numerator).bit_count()+z.denominator.bit_length()-1 + result={'status':'PASS_ONE_ACTUAL632_SOURCE_RESTORED_RAWDUAL_NOT_CALLER','pins':{'4935':P4935,'4929':P4929,'native':NATIVE},'arbitrary_original_inputs':632,'independent_helpers_retained':408,'Y_owners_retained':112,'source_X_mutation':False,'owned_C0_final_zero':True,'extra_owned_arrays':0,'added_rank1_calls':8,'paid':dict(paid),'source_backward_paid':dict(oldpaid),'source_backward_prefix_l1':str(oldmax),'new_prefix_l1':str(maxnorm),'forward_prefix_l1':str(fmax),'events':len(program),'suffix_events':len(suffix),'suffix_census':{'COPY':8,'CLEAR':16,'GaussianH1':8,'ADD':424},'scatter_coefficient_counts':dict(Counter(map(str,allcoeff))),'scatter_scalar_primitive_allowance':sum(tariff(z)for z in allcoeff),'single_word_phase_checks':8,'all12544_transpose_coefficients_checked':True,'all632_forward_and_backward_rows_checked':True,'word_sha256':sha256(word).hexdigest(),'controls':controls,'new_kappa':False,'full_caller':False,'compiler_or_outer_funded':False} + sources={'schema_version':1,'consumed':{k:{'commit':SPECS[k][0],'path':SPECS[k][1],'sha256':sha256(v).hexdigest()}for k,v in raw.items()},'checker_sha256':sha256(Path(__file__).read_bytes()).hexdigest()} + outputs={'RAWDUAL-WORD.json.gz':word,'RESULT.json':encode(result),'SOURCES.json':encode(sources)} + for name,data in outputs.items(): + if '--emit' in sys.argv:(HERE/name).write_bytes(data) + else:need((HERE/name).read_bytes()==data,'frozen bytes '+name) + print(json.dumps(result,sort_keys=True)) +if __name__=='__main__':main() diff --git a/research/involutory-producer-raw-dual/science/normal.log b/research/involutory-producer-raw-dual/science/normal.log new file mode 100644 index 0000000000..1f8af6fd5c --- /dev/null +++ b/research/involutory-producer-raw-dual/science/normal.log @@ -0,0 +1 @@ +{"Y_owners_retained": 112, "added_rank1_calls": 8, "all12544_transpose_coefficients_checked": true, "all632_forward_and_backward_rows_checked": true, "arbitrary_original_inputs": 632, "compiler_or_outer_funded": false, "controls": {"erase_repair": true, "omit_rank1_lift": true, "repair_sign": true, "wrong_transpose": true}, "events": 28501, "extra_owned_arrays": 0, "forward_prefix_l1": "457", "full_caller": false, "independent_helpers_retained": 408, "new_kappa": false, "new_prefix_l1": "258", "owned_C0_final_zero": true, "paid": {"1": 2209, "2": 412, "3": 510, "4": 127, "5": 40}, "pins": {"4929": "361f5d4100640177d6a983dd2f336021c75bfd5e", "4935": "64c9f99693c92fb370096fb43dbc58a085b30e36", "native": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296"}, "scatter_coefficient_counts": {"-12": 8, "-6": 268, "6": 148}, "scatter_scalar_primitive_allowance": 2976, "single_word_phase_checks": 8, "source_X_mutation": false, "source_backward_paid": {"1": 2201, "2": 412, "3": 510, "4": 127, "5": 40}, "source_backward_prefix_l1": "258", "status": "PASS_ONE_ACTUAL632_SOURCE_RESTORED_RAWDUAL_NOT_CALLER", "suffix_census": {"ADD": 424, "CLEAR": 16, "COPY": 8, "GaussianH1": 8}, "suffix_events": 456, "word_sha256": "b82a423cf4a44669d44b168dab3459e9bdb646cefd96c4e4d5f401c567eec6a2"} diff --git a/research/involutory-producer-raw-dual/science/optimized.log b/research/involutory-producer-raw-dual/science/optimized.log new file mode 100644 index 0000000000..1f8af6fd5c --- /dev/null +++ b/research/involutory-producer-raw-dual/science/optimized.log @@ -0,0 +1 @@ +{"Y_owners_retained": 112, "added_rank1_calls": 8, "all12544_transpose_coefficients_checked": true, "all632_forward_and_backward_rows_checked": true, "arbitrary_original_inputs": 632, "compiler_or_outer_funded": false, "controls": {"erase_repair": true, "omit_rank1_lift": true, "repair_sign": true, "wrong_transpose": true}, "events": 28501, "extra_owned_arrays": 0, "forward_prefix_l1": "457", "full_caller": false, "independent_helpers_retained": 408, "new_kappa": false, "new_prefix_l1": "258", "owned_C0_final_zero": true, "paid": {"1": 2209, "2": 412, "3": 510, "4": 127, "5": 40}, "pins": {"4929": "361f5d4100640177d6a983dd2f336021c75bfd5e", "4935": "64c9f99693c92fb370096fb43dbc58a085b30e36", "native": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296"}, "scatter_coefficient_counts": {"-12": 8, "-6": 268, "6": 148}, "scatter_scalar_primitive_allowance": 2976, "single_word_phase_checks": 8, "source_X_mutation": false, "source_backward_paid": {"1": 2201, "2": 412, "3": 510, "4": 127, "5": 40}, "source_backward_prefix_l1": "258", "status": "PASS_ONE_ACTUAL632_SOURCE_RESTORED_RAWDUAL_NOT_CALLER", "suffix_census": {"ADD": 424, "CLEAR": 16, "COPY": 8, "GaussianH1": 8}, "suffix_events": 456, "word_sha256": "b82a423cf4a44669d44b168dab3459e9bdb646cefd96c4e4d5f401c567eec6a2"} diff --git a/research/involutory-producer-raw-dual/verify.py b/research/involutory-producer-raw-dual/verify.py new file mode 100644 index 0000000000..c5afcf96a1 --- /dev/null +++ b/research/involutory-producer-raw-dual/verify.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python3 +"""Read-only portable replay of the unchanged physical raw-dual emitter. + +Only fetch(pin,path) is rebound in memory. An exact checker copy is executed +with --emit in private scratch, preserving its __file__ source-hash guard. +Apache-2.0; substantial OpenAI Codex assistance; credit in retained report. +""" +import ast +from contextlib import redirect_stdout +from hashlib import sha256, sha1 +import gzip +import io +import json +from pathlib import Path +import sys +from tempfile import TemporaryDirectory + +HERE = Path(__file__).resolve().parent +ORIGINS_SHA = '96c10111ce6d0af4c99969b9e6789d47251a906c0ac5640fc1478886a70b6d60' +FETCH_SOURCE = "def fetch(pin,path):return subprocess.check_output(['git','--no-replace-objects','show',pin+':'+path])" + + +def need(test, why): + if not test: + raise ValueError(why) + + +def authenticate(): + original = (HERE / 'ORIGINS.json').read_bytes() + need(sha256(original).hexdigest() == ORIGINS_SHA, 'Exact retained source origins') + origins = json.loads(original) + sources = {} + for row in origins['files']: + raw = (HERE / row['local_path']).read_bytes() + need(sha256(raw).hexdigest() == row['sha256'], 'Source SHA256: ' + row['label']) + need(sha1(b'blob ' + str(len(raw)).encode() + b'\0' + raw).hexdigest() == row['git_blob'], 'Source Git blob: ' + row['label']) + sources[row['original_commit'], row['original_path']] = raw + need(len(sources) == 10, 'Ten exact consumed sources') + for row in origins['science']: + need(sha256((HERE / row['path']).read_bytes()).hexdigest() == row['sha256'], 'Unchanged A science: ' + row['path']) + need(len(origins['science']) == 7, 'Seven unchanged scientific files') + return sources + + +def adapted_tree(body): + tree = ast.parse(body) + candidates = [n for n in tree.body if isinstance(n, ast.FunctionDef) and n.name == 'fetch'] + need(len(candidates) == 1, 'Single source loader') + original = candidates[0] + need(ast.dump(original) == ast.dump(ast.parse(FETCH_SOURCE).body[0]), 'Exact documented fetch function') + position = tree.body.index(original) + before = [ast.dump(n) for n in tree.body] + tree.body[position] = ast.parse('def fetch(pin,path): return FROZEN_SOURCES[pin,path]').body[0] + after = [ast.dump(n) for n in tree.body] + need([i for i,(a,b) in enumerate(zip(before,after)) if a != b] == [position], 'Only source fetch AST differs') + return ast.fix_missing_locations(tree) + + +def run(): + sources = authenticate() + body = (HERE / 'science/check.py').read_bytes() + tree = adapted_tree(body) + with TemporaryDirectory(prefix='involutory-rawdual-private-') as temporary: + folder = Path(temporary) + checker = folder / 'check.py' + checker.write_bytes(body) + saved_arguments = sys.argv[:] + try: + sys.argv = [str(checker), '--emit'] + env = {'__file__': str(checker), '__name__': '__main__', 'FROZEN_SOURCES': sources} + with redirect_stdout(io.StringIO()): + exec(compile(tree, 'unchanged_rawdual_science_with_vendored_fetch', 'exec'), env) + finally: + sys.argv = saved_arguments + actual_word = (folder / 'RAWDUAL-WORD.json.gz').read_bytes() + expected_word = (HERE / 'science/RAWDUAL-WORD.json.gz').read_bytes() + need(gzip.decompress(actual_word) == gzip.decompress(expected_word), 'Exact decompressed raw-dual payload') + actual = json.loads((folder / 'RESULT.json').read_text()) + expected = json.loads((HERE / 'science/RESULT.json').read_text()) + need(actual.pop('word_sha256') == sha256(actual_word).hexdigest(), 'Regenerated container binds its receipt') + need(expected.pop('word_sha256') == sha256(expected_word).hexdigest(), 'Frozen container binds its receipt') + need(actual == expected, 'Every proof-relevant RESULT field') + need(json.loads((folder / 'SOURCES.json').read_text()) == json.loads((HERE / 'science/SOURCES.json').read_text()), 'Original checker hash and consumed-source receipt') + need(checker.read_bytes() == body, 'Exact original __file__ bytes') + need(authenticate() == sources, 'Read-only replay preserved all retained bytes') + return dict(status='PASS_PORTABLE_INVOLUTORY_SOURCE_RAWDUAL', all632_rows=True, + independent_helpers=408, new_owned_arrays=0, added_H1=8, + gzip_payload_equal=True, container_equal=actual_word == expected_word, + source_loader_only_adapted=True, new_kappa=False, complete_caller=False) + + +if __name__ == '__main__': + need(len(sys.argv) == 1, 'Read-only verifier accepts no generation arguments') + print(json.dumps(run(), sort_keys=True)) diff --git a/research/involutory-producer-raw-dual/verify_independent.py b/research/involutory-producer-raw-dual/verify_independent.py new file mode 100644 index 0000000000..80bb8aae16 --- /dev/null +++ b/research/involutory-producer-raw-dual/verify_independent.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 +"""Authenticate and replay the unchanged independent packet, read-only. + +Independent scripts are already Git-free. Their printed scientific output is +compared to the retained receipt. Apache-2.0; substantial Codex assistance. +""" +import argparse +from contextlib import redirect_stdout +from hashlib import sha256 +import io +import json +from pathlib import Path +import runpy +import sys + +HERE = Path(__file__).resolve().parent +ROOT = HERE / 'independent' +MANIFEST_SHA = 'fb4e1ca6ebc1e03b071cb8e49159a235a107d5a5fc86ff67afe6220e48366ef9' +PARTS = {'derive': ('derive.py', 'DERIVATION.json'), + 'audit': ('audit.py', 'REVIEW.json'), + 'ceiling': ('check_ceiling.py', 'CEILING.json')} + + +def need(test, why): + if not test: + raise ValueError(why) + + +def authenticate(): + raw = (ROOT / 'FILES.json').read_bytes() + need(sha256(raw).hexdigest() == MANIFEST_SHA, 'Exact independent archive manifest') + files = json.loads(raw)['files'] + actual = {p.relative_to(ROOT).as_posix() for p in ROOT.rglob('*') if p.is_file() and '__pycache__' not in p.parts} + need(actual == set(files) | {'FILES.json'}, 'Exact independent file inventory') + for path, digest in files.items(): + need(sha256((ROOT / path).read_bytes()).hexdigest() == digest, 'Independent frozen file: ' + path) + return files + + +def run(part): + before = authenticate() + script, receipt = PARTS[part] + captured = io.StringIO() + saved = sys.argv[:] + try: + sys.argv = [str(ROOT / script)] + with redirect_stdout(captured): + runpy.run_path(str(ROOT / script), run_name='__main__') + finally: + sys.argv = saved + need(json.loads(captured.getvalue()) == json.loads((ROOT / receipt).read_text()), 'Exact independent scientific receipt: ' + receipt) + need(authenticate() == before, 'Read-only independent replay') + return {'status': 'PASS_PORTABLE_INDEPENDENT_RAWDUAL_' + part.upper(), + 'receipt': receipt, 'new_kappa': False, 'complete_caller': False} + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('part', choices=sorted(PARTS)) + args = parser.parse_args() + print(json.dumps(run(args.part), sort_keys=True))