diff --git a/research/selected-move-packed-codec/INDEPENDENT-RESULT-OPTIMIZED.txt b/research/selected-move-packed-codec/INDEPENDENT-RESULT-OPTIMIZED.txt new file mode 100644 index 0000000000..dab0e86eeb --- /dev/null +++ b/research/selected-move-packed-codec/INDEPENDENT-RESULT-OPTIMIZED.txt @@ -0,0 +1,48 @@ +{ + "machine_sha256": "119b69594a2a33550eec9b6e083db8f496c3fb3d9c1214b6703d687a0a662eba", + "table_sha256": "ac852be823d484cdb0d10e8fb8cd063c7f0c4351789ea0516bf5fd23a475ce1b", + "full": { + "steps": 9611543, + "V_old": 24576, + "E": 405, + "width": 3, + "coefficients": 2 + }, + "shuffle": [ + { + "geometry": [ + 8, + 1, + 2, + 1, + 3, + 2 + ], + "steps": 1588986 + }, + { + "geometry": [ + 9, + 0, + 3, + 2, + 3, + 1 + ], + "steps": 1902986 + }, + { + "geometry": [ + 7, + 2, + 1, + 0, + 4, + 3 + ], + "steps": 1409890 + } + ], + "codeword_branch_mutation": "detected" +} +PASS_INDEPENDENT_CODEC_SPARSE_TAPE diff --git a/research/selected-move-packed-codec/INDEPENDENT-RESULT.txt b/research/selected-move-packed-codec/INDEPENDENT-RESULT.txt new file mode 100644 index 0000000000..dab0e86eeb --- /dev/null +++ b/research/selected-move-packed-codec/INDEPENDENT-RESULT.txt @@ -0,0 +1,48 @@ +{ + "machine_sha256": "119b69594a2a33550eec9b6e083db8f496c3fb3d9c1214b6703d687a0a662eba", + "table_sha256": "ac852be823d484cdb0d10e8fb8cd063c7f0c4351789ea0516bf5fd23a475ce1b", + "full": { + "steps": 9611543, + "V_old": 24576, + "E": 405, + "width": 3, + "coefficients": 2 + }, + "shuffle": [ + { + "geometry": [ + 8, + 1, + 2, + 1, + 3, + 2 + ], + "steps": 1588986 + }, + { + "geometry": [ + 9, + 0, + 3, + 2, + 3, + 1 + ], + "steps": 1902986 + }, + { + "geometry": [ + 7, + 2, + 1, + 0, + 4, + 3 + ], + "steps": 1409890 + } + ], + "codeword_branch_mutation": "detected" +} +PASS_INDEPENDENT_CODEC_SPARSE_TAPE diff --git a/research/selected-move-packed-codec/INDEPENDENT-REVIEW.md b/research/selected-move-packed-codec/INDEPENDENT-REVIEW.md new file mode 100644 index 0000000000..6b1ea611b5 --- /dev/null +++ b/research/selected-move-packed-codec/INDEPENDENT-REVIEW.md @@ -0,0 +1,43 @@ +# Separate orchestrator review + +The lead orchestrator independently reviewed the frozen graph generator +at SHA256 +`119b69594a2a33550eec9b6e083db8f496c3fb3d9c1214b6703d687a0a662eba`. +The regenerated literal graph has 6,003 instructions, 43 tapes and digest +`ac852be823d484cdb0d10e8fb8cd063c7f0c4351789ea0516bf5fd23a475ce1b`. +The graph was not changed after that review. + +The reviewer wrote `independent_check.py` separately from the author's +CPU and numerical/address fixtures. It uses sparse dictionary tapes, +independent head movement and instruction execution, and tuple sorting +to calculate the address permutation. Only its import path and exact-byte +module loader were adapted for this portable package; its scientific +checks are retained. + +The full independent packet has f=1, r=2, b=3, 512 addresses, 24,576 old +physical bits and a 405-bit descriptor containing a 138-bit cutoff value. +It executes 9,611,543 transitions, changes the packed data by a supplied +same-width function, and checks the complete returned old image, descriptor, +relative origins, opaque left exteriors and all private historical cells. +This is a codec service fixture, not native C arithmetic. + +Three additional subprogram cases use uniquely labeled records and K=2/3, +rho>0, external rows and fixed prefixes. Their exact forward result agrees +with tuple sorting, and their reverse result recovers the original word. +They execute 1,588,986, 1,902,986 and 1,409,890 transitions respectively. +A mutation swapping a decoded input-bit branch is detected by the full +packet's independent image check. + +The reviewer separately checked the increasing-position rotation argument, +guide update/halving conditions, inverse ordering, complete copied-field +cost and retained backing. No defect was found. One prose correction was +made: nine old shape values are unary-expanded; the tenth kept field, +cutoff, remains binary and may exceed the payload's numerical size. + +The resulting portable normal and optimized receipts are +INDEPENDENT-RESULT.txt and INDEPENDENT-RESULT-OPTIMIZED.txt. The final +VALIDATION.json records their executed commands and exact output hashes. +No full f>1 or K>1 nine-slot packet, source native operator, whole selected +caller or global foundation was verified by these checks. This is a +separately conducted model-assisted review, not human or proof-kernel +acceptance. diff --git a/research/selected-move-packed-codec/LICENSE b/research/selected-move-packed-codec/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/selected-move-packed-codec/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/selected-move-packed-codec/NOTICE.md b/research/selected-move-packed-codec/NOTICE.md new file mode 100644 index 0000000000..8c3beaf115 --- /dev/null +++ b/research/selected-move-packed-codec/NOTICE.md @@ -0,0 +1,28 @@ +Selected MOVE complete packed codec and strided transport +Prepared for Jerry Chen / CubeJerry with substantial OpenAI assistance. +Copyright 2026. Licensed under Apache License 2.0; see LICENSE. + +The new literal instruction graph, runtime guide composition, complete +format/return proof and source-specific tests were prepared for @CubeJerry. +OpenAI assistance contributed to research, implementation, proof, tests +and packaging. Separate model-assisted checks are not human or formal +proof-kernel acceptance. + +Credit CrocSwap/integer-mult-bounds#7578 for the exact semantic packing +permutation, volume obstruction and selected numerical premise; #7429 for +the literal positive packed C provider; #6967 and #6974 for the older coded +leaf/MOVE and exact 23-field/three-bit-coded boundary; and #7000 for the +selected source construction. The wider compiler, Clifford, Gaussian, +precision and tape lineage retains its original authorship. + +In particular retain all original notices in inputs/notices/: +- grid-interface-NOTICE: the predecessor interface package and attribution; +- old-coded-NOTICE.md: current codec and physical monomial/leaf predecessors; +- literal-leaf-NOTICE.md: pending literal positive provider and its lineage; +- common-grid-NOTICE.md: odd scalar/common-root precision predecessors; +- selected-NOTICE: selected shared-native source and compiler/caller lineage. + +Stable partition, positional integer encodings and elementary tape-copy +algorithms are classical. Their general invention, the Gaussian C identity, +the common-root Clifford theorem, existing algebraic tensor closure and +the selected conditional kappa are not claimed as new work here. diff --git a/research/selected-move-packed-codec/OVERLAP.md b/research/selected-move-packed-codec/OVERLAP.md new file mode 100644 index 0000000000..cfbdcdd4c3 --- /dev/null +++ b/research/selected-move-packed-codec/OVERLAP.md @@ -0,0 +1,33 @@ +# Bounded overlap and source audit + +Canonical main: e54523517d0f03e58352e647c403a5af3e525a57. The selected +certificate and actual application review retain kappa .00363005817 and +all five assumptions. Repository instructions and the uniform-transfer-audit +card were read from the pinned shared source. + +The parent checked current PRs and discussion/handoff entry points. This +worker fetched live #7578 head e9b6d75397e3553af77bab81d5816e4b8708a501 +and #7429 head 1a555e469b89af70d309bc966f8f813ac11dc887. Targeted PR +queries were `repo:CrocSwap/integer-mult-bounds codec` and +`repo:CrocSwap/integer-mult-bounds "packing" "selected"`. + +- #7578 exact proof/README/source contracts already specify the semantic + permutation, numerical implication and length obstruction, while explicitly + leaving physical old-codec/strided transport open. This is the claimed task. +- #7429 exact contract and header checker supply the packed literal positive + C service and exclude the older 23-field/coded/LSB bridge. +- #6967 canonical current header/ABI and #6974 retained MOVE proof already + supply structured old-format services. They are credited; this result + is a literal format boundary, not a new Gaussian identity or codec invention. +- #7561/#7566/#7568 descriptions cover fixed-rank C, HOME and rounded packed + MOVE services. Their supplied packed entrance remains distinct. #7563's + endpoint scaling/width result is unchanged. These metadata reads are not + scientific replays or acceptance. +- #7346/#7347 descriptions concern symbolic compiler occurrence/owner codecs, + not this complete numerical bit-field permutation. + +No broad archive, native catalogue or optimization search was rerun. Stable +partition is classical and the semantic bijection is credited to #7578. +The new claims concern the literal controller, uniform physical guides, +inverse/retirement bill and a graph-specific time lower bound. This bounded +search does not guarantee coverage of all archival or concurrent work. diff --git a/research/selected-move-packed-codec/PR-DESCRIPTION.md b/research/selected-move-packed-codec/PR-DESCRIPTION.md new file mode 100644 index 0000000000..9c317f3215 --- /dev/null +++ b/research/selected-move-packed-codec/PR-DESCRIPTION.md @@ -0,0 +1,63 @@ +## Problem and result + +The selected native literal providers accept a packed six-Gamma ABI, while +the older current caller carries a 23-field descriptor and three-bit-coded +LSB numerical records. #7578 specifies their semantic packing and leaves +the actual paid codec/strided bridge open. Its length ratio greater than +three rules out a header-only substitution. + +This package supplies an input-independent **6,003-location, 43-tape graph** +for the complete old-to-packed bridge and inverse return. It parses every +old header field, physically infers width/coefficient multiplicity, gathers +all **9f** selected bits while preserving spectators, and stages the entire +old-format result before same-owner commit. Success restores every private +body/head. For complete old payload V and header E: + +`T <= 2^20 ((9f+1)V+E+1)`, +`K_after <= K_entry+64(V+E+1)`. + +## Novelty and dependencies + +The semantic permutation/volume obstruction are #7578's; the structured old +positive service is #6967's; the packed literal positive service is #7429's. +The new contribution is their literal format/transport boundary with a +uniform physical guide proof and complete direct-order invoice. Stable +partition and the retained Gaussian/common-grid facts are credited prior +work. Exact predecessor head: #7578 at +`e9b6d75397e3553af77bab81d5816e4b8708a501`; canonical base: +`e54523517d0f03e58352e647c403a5af3e525a57`. SOURCE-PINS.json binds every +retained file at exact Git/SHA256 bytes. + +## Reproduction and evidence + +`python3 -B scripts/research_package.py --package research/selected-move-packed-codec` + +Normal and optimized direct commands run four full rank-nine f=1 packets, +five nontrivially strided extracted-subprogram cases, direct-index/codec +oracles, complete owner/head/retirement checks, thirteen fault controls and +ten source-mutation controls. Complete f>1 and K>1 nine-slot packets are +unrun; the uniform statement is the written proof. Native C is not executed +by these codec fixtures. Separate verification and package gates are +recorded in VALIDATION.json and the review files when completed. + +## Limitations and kappa + +Supplied disjoint blank banks, complete legal geometry and a successful +same-width packed-service return remain premises. The #7429 positive child +is a source-relative corollary under #7578's numerical domain, with its full +bill additionally paid. Enclosing source/HOME/dispatcher integration, +failure cleanup, global ownership/stock and accelerated nonleaf tariff +remain open. **No new kappa; all five global assumptions remain.** The +selected conditional kappa stays 0.00363005817. + +## Credit and review + +Prepared for **@CubeJerry** with substantial OpenAI assistance. Credit +#7578, #7429, #6967, #6974, #7000 and the authors in the retained notices. +Independent human and formal proof-kernel acceptance are unclaimed. +Only this isolated research package is added; selected certificates, +predecessor sources and shared runtime are unchanged. + +## Publication checks + +Registered normal/optimized primary and independent replay, committed bytes/modes, exact base ancestry, and portable export input checks pass. VALIDATION.json records the scoped evidence. Full-history gate success is not claimed for the intentionally shallow checkout; exact originating source bytes are separately authenticated. diff --git a/research/selected-move-packed-codec/PR-TITLE.txt b/research/selected-move-packed-codec/PR-TITLE.txt new file mode 100644 index 0000000000..d7a4b63e24 --- /dev/null +++ b/research/selected-move-packed-codec/PR-TITLE.txt @@ -0,0 +1 @@ +Implement the complete old-format native packing bridge with literal strided transport and restored owners diff --git a/research/selected-move-packed-codec/PROOF.md b/research/selected-move-packed-codec/PROOF.md new file mode 100644 index 0000000000..b0f7372959 --- /dev/null +++ b/research/selected-move-packed-codec/PROOF.md @@ -0,0 +1,426 @@ +# A literal paid bridge from the old coded field to the complete native packet + +This is a source-specific implementation lemma for the `precision_tape` +obligation, at canonical main +`e54523517d0f03e58352e647c403a5af3e525a57`. It answers the payload bridge +left open in #7578, exact head +`e9b6d75397e3553af77bab81d5816e4b8708a501`. It proves no new kappa and does +not discharge any of the five selected assumptions at its full scope. + +The semantic coordinate bijection and the incompatible old/new lengths +were already stated in #7578. The old coded positive leaf #6967 already +has a structured physical implementation. The new result is the explicit +input-independent literal controller for this particular codec and strided +layout boundary, including old header parsing, inverse transport, physical +retirement and a complete direct-service bill. Stable binary partition is a +classical algorithm; no novelty is claimed for that general idea. + +## 1. Exact old and new interfaces + +The source header schema is copied verbatim from the canonical current +provider and checked against it: + +``` +outer, rows, stock, row_bits, within_bits, record_bits, p, d, +K, G, H, q0, qF, qB, D, f, rho, active_start, back_start, +selected_axes, entry_start, remainder, cutoff. +``` + +A nonnegative value uses `1^ell 0` followed by its ell binary digits, +least significant first. Zero has one digit. Every nonzero value has +leading (last written) digit one. The old descriptor is exactly these +twenty-three codes followed by physical blank. Let E be its actual bit +length, including values irrelevant to this bridge. All twenty-three +values are scanned and checked for canonical coding; ignored fields are +not interpreted as arithmetic promises. + +Write + +``` +a = within_bits, u = active_start, +C_rows = outer*rows, g = 9f, +N = C_rows*2^a, L = 2rb. +``` + +The bridge needs `outer, rows, f, K, cutoff > 0`, `0 <= rho < K`, +`u+9fK <= a`, and the complete old row relation +`row_bits = 2^a record_bits`. Each address record has r positive complex +coefficients, each with b>=2 real bits followed by b imaginary bits, +least significant first, and virtual delimiter 2 after each component. +The literal physical codes are 000 for 0, 001 for 1, and 010 for delimiter +2, as in the retained CodedPort. Therefore + +``` +record_bits = 6r(b+1), +V_old = C_rows*2^a*6r(b+1), +V_packed = C_rows*2^a*2rb = N L. +``` + +The bridge's geometric premises are weaker than the complete historical +monomial producer geometry: it does not use G, H, the back reservation or +the hidden row supplier. A caller of the older provider still owes those +additional premises. No permission to reinterpret its source tokens or +owner namespace follows from this local lemma. + +The old numeric width b and coefficient multiplicity r are **not** separate +members of the twenty-three-field header. The controller reads the first +component to its delimiter, counts b physically and returns the old head. +It then divides the encoded `record_bits` exactly by `6(b+1)`. A zero or +nonintegral quotient rejects. Every later component is checked to have +exactly that b and a delimiter, so inference from the first component is +not an unchecked uniformity assumption. The component quantum is external +to both ABIs and is unchanged. + +The output is exactly the supplied ABI of #7429: six positive canonical +Gamma codes `(f,r,P,S,b,cutoff)`, where + +``` +P = C_rows*2^u, S = 2^(a-u-9f), +DATA = [P] x [2^f]^9 x [S], with r Gaussian coefficients per address. +``` + +Its components are signed MSB-first b-bit words, with no delimiters or +three-bit code expansion. Gamma is `0^(ell-1)` followed by the MSB-first +binary value, exactly as in the literal leaf's checker. The literal graph +preserves cutoff in binary: a cutoff of enormous numerical value costs +its encoded length, not its value. The bridge does not itself execute +the provider's f<=cutoff test; the same supplied cutoff reaches it. + +## 2. The actual literal controller + +`compile_bridge()` takes no runtime argument and produces 6,003 locations +on 43 fixed tapes. Instructions are only a scanned-symbol branch, a write +of one fixed symbol, a one-cell move, a fixed jump, or a halt. The alphabet +is `{blank,0,1,LEFT}`. LEFT is the common finite-alphabet renaming of the +old physical left guard and the literal provider's local guard; numeric +delimiter 2 is still the three physical bits 010, never a physical guard. +For a joint hardware table the two fixed marker names are relabelled once +at compilation to that hardware's blank/LEFT symbols. This is a fixed +injective change of instruction labels, not a runtime rewriting of public +markers or a conversion of numerical codeword 010. +No address, width, stride, payload value, list length or Python integer +selects a runtime instruction. Python arrays and numerical positions +exist only in the checker hardware and independent fixtures. + +The finite subroutine macros in Builder are expanded at compilation. There +is no runtime call stack or unbounded inventory of registers. Literal +branches check the relevant symbolic invariants. A missing branch is an +explicit rejection. This contribution exports the complete finite table +by deterministic compilation from its small source; its digest is recorded +in the verification receipt. + +The two original public tapes are OLD and CONTEXT. PACK and GAMMA are a +new supplied service bank and its header. All remaining tapes are private +counter, staging and shuttle banks. They enter at their local origins with +LEFT immediately before each origin, and physically blank bodies through +the stated capacity. Genuinely disjoint physical segments and the supply +of these guards/windows are premises. Object-identity alias checks in the +reference binder reject an obvious alias; they do not prove disjointness +of arbitrary external wrappers. + +The parser reads all old header codes. It retains the used scalar values +as unary guides and cutoff as a binary word. It checks positivity, the +selected-position bounds, the exact row size and the recovered r. It +constructs the six Gamma values, converts every old component into its +MSB-first word, and checks the exact old data frontier. Conversion uses +one component tape, reverses that tape physically, and erases it before +the next component. Both original heads return to their origins; OLD +has not been written. The complete unsigned bit pattern is preserved, +including the most-negative signed word. No arithmetic rounding occurs. + +## 3. All 9f selected positions and the stable-partition invariant + +Number within-row bits from the left, beginning at zero. The old selected +position at native slot i and column j is + +``` +p_(i,j) = u+(if+j)K+rho, 0<=i<9, 0<=j= K`; `a-u-k-1 >= 1`; and the guides have the displayed powers +of two. No guide is updated after the last pass. The first actual native +service therefore sees the complete Gamma packet and DATA at their origins. +The bridge keeps its final guides while the service runs; the service may +not access them or reuse their owners. + +For return, start with the last guide values. Within each prefix, copy +HALF consecutive bits to ZERO and then HALF to ONE; replay CHUNKS pairs +of RUN bits from those banks, interleaving them into the next full bank +and erasing the consumed buffers. This is exactly the inverse rotation. +The reverse updates are + +``` +PREFIX <- PREFIX/2, HALF <- 2 HALF, +RUN <- RUN*2^K, CHUNKS <- CHUNKS/2^(K-1). +``` + +They are applied only before another reverse pass. In reverse pass k>=1, +PREFIX is even and `m_k >= K-1`, so the divisions are exact. The original +order is restored by induction down to k=0. No reverse routing table or +input-size family of tapes is materialized. + +## 5. Successful return, retirement and ownership + +Suppose the packed service returns the same complete b-bit format and +length at the original PACK/GAMMA heads, preserves GAMMA and all bridge +private tapes, and restores its own distinct private owners. Its numerical +action may be any function on those packed words; codec correctness is a +bitwise statement and needs no independence of input coefficients. + +After inverse routing, the controller creates the complete old-format +image on STAGE: it physically reverses each b-bit component, emits its +three-bit digit codes and restores the delimiter. It checks the complete +packed frontier. Only then does a linear successful commit replace OLD +with the same number of physical bits. CONTEXT is never written. Every +bridge-owned body is erased and every head returns to its initial relative +origin. The LEFT markers and exterior symbols remain unchanged. + +OLD is a protected backup through the entire forward codec, service and +inverse preparation. PACK is a paid temporary representation, with no new +productive-target credit. Parent and child owners are distinct physical +segments; the theorem does not infer that equal values or equal frames +permit aliasing. This construction supplies a local transfer/return +service; it does not establish the enclosing compiler's ownership naming +or allocation contract. + +On the explicitly exercised malformed entrances, rejection precedes any +OLD write. General malformed-input retirement, interrupted computation, +corrupt service returns and failure cleanup of #7429 remain outside this +successful-call theorem. In particular a numerical rejection by a child +whose failure contract does not restore its banks cannot be promoted to a +successful full owned return. The #7578 common-root numerical premise is +one separate way to guarantee that the actual positive child succeeds. + +## 6. Complete uniform time and backing bounds + +Count every R/W/M/J/H transition, including tests and jumps. The following +coarse constants are obtained directly by counting the emitted loop bodies: + +| Macro | Sufficient charged form | +|---|---| +| Copy, erase or rewind an ell-cell word | `16(ell+1)` transitions | +| Unary doubling or halving with cleanup | `128(ell+1)` | +| Canonical binary-to-unary conversion of v | `1024(v+encoded_length+1)` | +| Unary x-by-y product, all head returns | `128(xy+x+y+1)` | +| Unary-to-binary and one Gamma output | `256(v+1)` | +| One complete routing pass, including copies, retirement and guide updates | `8192(V_packed+1)` | + +Here ell includes the span actually crossed on a return from a formerly +occupied, now-erased word. Erasing a buffer does not make its head's +physical return distance zero. + +For binary-to-unary conversion, strict binary prefixes sum to less than +the final positive value; the sole zero word is handled separately. For +unary-to-binary conversion, an increment changes its trailing ones and +the next bit, then physically returns. The total trailing-one count over +v increments is less than v, so this is linear rather than v log v. + +All nine unary-expanded old shape values are at most V_old on legal input. +For example `row_bits <= V_old`, `record_bits <= V_old`, +`K,u,9f <= a <= 2^a`, and outer and rows are at most C_rows. Products +constructed during preparation are either at most a or at most V_old. +The gK product is bounded by a-u. The row-size product is checked against +the supplied row_bits. Prefix counts, N, all shuttles and every unary +run/half/chunk guide are bounded by V_old. The unused header fields and +cutoff are scanned/copied in their encoded lengths and never unary-expanded. + +In each routing pass the total number of payload bits copied to the two +half buffers is V_packed. Buffer readback, full-bank retirement, full-bank +replacement and all rewinds are linear in the same volume. The numbers of +prefixes and runs are also bounded by V_packed because every run contains +at least one bit. The geometric update sums in section 4 and K<=a<=V_old +cover the runtime counter work. Preparation and the two codec sweeps cost +O(V_old+E), and there are exactly 2g routing passes. + +A conservative explicit whole-bridge envelope, deliberately much larger +than the preceding macro totals, is + +``` +T_bridge <= 2^20 ((9f+1)V_old + E + 1), +K_after <= K_entry + 64(V_old + E + 1). +``` + +The order of this particular controller is also necessary. Each of its +2g routing passes erases all V_packed cells of PACK and writes all of them +back from OUT. These alone are 4g V_packed=36f V_packed writes. Since +`V_packed/V_old=b/(3(b+1))>=2/9` for b>=2, there are at least 8f V_old +PACK writes. The E old header reads are distinct additional transitions. +Thus `T_bridge>=8f V_old+E`, and this controller has +**Theta(f V_old+E)** complete time. This is a lower bound for this graph, +not for every possible packing algorithm. + +The second line counts the union of newly visited cells of all 41 private +tapes; each body has at most V_old+E+1 cells. Erasure does not subtract any +earlier history. K_entry retains every previous extent, including public +owners, suspended ancestors and old private high-water regions. The supplied +relative windows must cover these new extents; supplying those windows is +an explicit allocation premise. No ancestor sweep or absolute-origin access +is hidden in a rewind, which stops at its own LEFT guard. + +For the Gamma bank specifically, g>=9 implies N>=512, +P<=N/512 and S<=N/512. Since b>=2 and r>=1, V_old>=18N, +and b,r,f are also bounded by the corresponding positive payload factors. +Using `length(Gamma(v))<=2v` for the five non-cutoff fields gives a total +less than V_old; the cutoff Gamma is shorter than its own old header code. +Thus the claimed per-bank V_old+E+1 cap also covers Gamma, rather than +assuming every output header is only as long as the original header. + +The bound is for legal promised shapes, not a guarantee that malicious +enormous inconsistent header values are rejected within the valid-data bill. +This distinction is immaterial to the successful selected-occurrence theorem +but relevant when interpreting rejection tests as more than fault detection. + +## 7. Source-relative central-service corollary and remaining obligations + +The six generated values and complete data word meet precisely the packed +entrance required by #7429. In the selected event 24472 application of +#7578, use `b=p+h+2n+3`, the same common quantum, complete spectators and +f<=cutoff. Its complete-root Clifford-prefix argument supplies every +numerical integrality/width premise of the literal positive child. Its +local bill remains + +``` +T_C <= 65536(f V_packed + E_Gamma + 1), +K_C_after <= K_C_entry + 64(V_packed + E_Gamma + 1). +``` + +Using PACK/GAMMA as its two public ports and 27 additional genuinely +distinct private owners gives a 70-tape direct central-service composition. +The honest combined successful invoice is `T_bridge + T_C`; both historical +backing allowances are retained. The old-to-new length ratio +`3(b+1)/b > 3` remains exactly the predecessor's calculation. The physical +codec now pays for it; no header-only substitution is asserted. + +This supplies a literal **direct/leaf-order** upper tariff O(f V_old+E), +uniformly in the complete valid old format. It does not produce the faster +nonleaf recurrence used by the selected conditional theorem. It does not +execute the right or left monomial, connect a HOME packet wrapper, prove +enclosing cutoff/stock/owner admission, or validate analytic recovery. +The exact source token and full selected compiler still need an admitted +dispatcher. All five global assumptions remain, and the selected conditional +bound remains kappa=0.00363005817. + +More sharply, the preceding lower bound excludes using this unchanged +graph as a uniform `O(V_old f^(1-kappa)+E)` nonleaf service for kappa>0 +on valid unbounded-f families with negligible descriptor term. For example +the bridge domain permits `a=9f,u=rho=0,K=r=1,b=2,outer=rows=1,cutoff=f`, +where E=O(f) and V_old=18*2^(9f). This is a scoped obstruction to this +direct controller's rate, not a restriction on a different representation, +ordinary supplier, changed caller or the selected conditional theorem. +In particular the selected tariff also has logarithmic precision factors; +this pure-power comparison does not exclude that full tariff without a +separate cofinal relation between f and precision p. Bounded leaf f gives +no contradiction to an accelerated asymptotic caller. + +## 8. What the finite checks establish + +The primary checker executes the actual fixed table on four complete +nine-slot f=1 packets. It independently reconstructs the bit-index +permutation, six Gamma values, component reversal, same-owner return, +private retirement and relative head positions. One packet has the old +reservation-compatible geometry a=12,u=2,K=1; another infers r=2,b=3 and +retains a 201-bit cutoff; another uses b=22. Two tests replace the packed +words with a supplied same-width function to distinguish correct inverse +transport from merely undoing untouched data. That supplied function is a +codec fixture, not an executed native C service. + +Five extracted shuffle subprogram tests exercise nontrivial K=2/3, rho>0, +multiple prefixes/rows and different record widths against direct indexing. +They execute the same literal macro on small general rotation geometries; +they are not complete nine-slot f>1 or K>1 packets. The universal statement +rests on sections 3-6. Such complete packets are exponentially larger and +are explicitly unrun. Wrong-position/global-prefix controls, exact-length +and source-code controls, and alias binding distinguish the main seams. +Separate review must assess the proof and physical program, rather than +calling the author's own replay an independent proof. + +Prepared for Jerry Chen / CubeJerry with substantial OpenAI assistance. +The retained source authors and originating PRs are credited in NOTICE.md. +No independent human review or formal proof-kernel acceptance is claimed. diff --git a/research/selected-move-packed-codec/README.md b/research/selected-move-packed-codec/README.md new file mode 100644 index 0000000000..c1e8c3fd53 --- /dev/null +++ b/research/selected-move-packed-codec/README.md @@ -0,0 +1,106 @@ +# Implement the complete old-format to packed native bridge with literal strided transport and paid restoration + +**Scoped all-size implementation lemma. No new kappa.** This package closes +the old-codec/strided-packing interface specifically left open by #7578, +at its exact head `e9b6d75397e3553af77bab81d5816e4b8708a501`. The current +selected #7000 bound remains conditional on all five global assumptions. + +An input-independent graph with **6,003 locations and 43 fixed tapes** +converts the exact old twenty-three-field descriptor and three-bit-coded, +LSB-first complete numerical field to the six-Gamma packed native ABI and +back. It physically infers component width and coefficient multiplicity, +gathers **all 9f selected bits**, preserves every spectator/row/coefficient, +and prepares the entire old-format return before committing to its original +owner. Every private body and head is restored on successful return. + +For old payload V_old and old header E, the complete bridge satisfies + +``` +T <= 2^20 ((9f+1)V_old + E + 1), +K_after <= K_entry + 64(V_old + E + 1). +``` + +This includes header decoding, unary guides, codec/component reversal, +2ยท9f stable-partition passes, full-bank copies, commit, erasure and returns. +Erasure never reduces already incurred historical backing. The selected +positive leaf #7429 can consume the resulting packed packet under #7578's +separate common-root numerical premise; its complete child bill remains +additional. This is a direct/leaf-order O(f V_old+E) completion. The fast +nonleaf recurrence and full selected occurrence/owner admission remain open. +The graph's complete time is also **Omega(f V_old+E)**: its repeated full +PACK erasures/rewrites alone cost at least 8f V_old writes. It therefore +requires a changed transport implementation before use at an accelerated +unbounded nonleaf tariff; this lower bound is specific to the new graph. + +## Why this is different from the predecessors + +#7578 already specifies the semantic permutation and proves that +`V_old/V_packed=3(b+1)/b>3`, so a header-only substitution fails. #6967 +already supplies a structured old-coded positive service; #7429 supplies +a literal packed positive service. This package implements their missing +physical format boundary. Stable partition itself, the native C identity, +the Gaussian row bounds and the selected common-grid argument are credited +predecessor results, not new claims here. + +The core invariant is that selected position `p_k=u+kK+rho` remains at +that position after the earlier shorter rotations. It can therefore be +extracted to `u+k` by a stable binary separation **within each fixed +prefix**. The exact runtime guide formulas and reverse induction are in +[PROOF.md](PROOF.md). Runtime instructions never inspect a host address, +decoded width/stride, array length or arbitrary-precision value. + +## Reproduce + +Python 3.12 and the standard library suffice. From this directory, without +Git, network access or any source outside the package: + +``` +python3 -I -W error -B verify.py +python3 -I -W error -O -B verify.py +``` + +Both print deterministic JSON ending in status +`PASS_SELECTED_MOVE_PACKED_CODEC`. From a repository checkout use: + +``` +python3 -B scripts/research_package.py --package research/selected-move-packed-codec +``` + +Four complete rank-nine f=1 packets execute the real table, including +reservation-compatible geometry a=12,u=2,K=1, recovered r=2/b=3, +a 201-bit cutoff, and b=22. Two same-width service fixtures change the +packed words to test the inverse return; they are **not native C runs**. +Five smaller extracted shuffle tests cover nontrivial K=2/3, rho>0, +multiple prefixes/rows and different record widths against direct indexing. +Thirteen layout/format/ownership controls and ten source mutations detect +the named failures. Complete f>1 or K>1 nine-slot packets are unrun; the +uniform theorem rests on the written invariant and cost proof. + +`SOURCE-PINS.json` authenticates all bundled evidence at exact Git/SHA256 +bytes. These retained texts are not imported as scientific executables. +`SOURCES.json` binds the canonical catalogue and selected record as +historical provenance. `VERIFY.json` lists every bundled live input. + +## Open next questions + +The caller supplies complete legal old geometry, disjoint blank private +windows and relative origins. A packed service must return the same width, +extent and heads, preserve the Gamma/bridge state and restore its own +distinct private owners. Malformed-service and interruption rollback, +failure cleanup of a rejecting child, global stock allocation and source +dispatcher/HOME integration are separate obligations. A successful codec +does not prove the full `precision_tape` assumption or a new multiplication +bound. Independent human or formal-kernel acceptance is unclaimed. + +1. Bind the bridge to the exact complete selected packed MOVE and actual + source/owner token, with its numerical domain, private inventory and + successful return contract. This would connect more than the positive + middle factor; the enclosing dispatcher still needs a precise ABI. +2. Find an admitted nonleaf implementation whose **complete** packing, + source access, ordinary children and inverse return fit the selected + accelerated recurrence. The present direct bill supplies no such gain. + +Structured first steps and blockers are in TASK.json. Prepared for +**Jerry Chen / @CubeJerry** with substantial OpenAI assistance. Full +predecessor credit and unchanged original notices are retained in NOTICE.md +and inputs/notices/. No upstream PR was submitted by this package. diff --git a/research/selected-move-packed-codec/RESULT-OPTIMIZED.json b/research/selected-move-packed-codec/RESULT-OPTIMIZED.json new file mode 100644 index 0000000000..6e0c50f534 --- /dev/null +++ b/research/selected-move-packed-codec/RESULT-OPTIMIZED.json @@ -0,0 +1,132 @@ +{ + "full_packets": [ + { + "changed_service_fixture": true, + "geometry": {}, + "header_bits": 127, + "incremental_history_cells": 41362, + "old_bits": 9216, + "packed_bank_writes": 77824, + "packed_bits": 2048, + "transitions": 3403133 + }, + { + "changed_service_fixture": false, + "geometry": { + "a": 12, + "b": 2, + "u": 2 + }, + "header_bits": 135, + "incremental_history_cells": 304299, + "old_bits": 73728, + "packed_bank_writes": 622592, + "packed_bits": 16384, + "transitions": 25598342 + }, + { + "changed_service_fixture": true, + "geometry": { + "b": 3, + "cutoff": 1606938044258990275541962092341162602522202993782792835301383, + "r": 2, + "rows": 2 + }, + "header_bits": 533, + "incremental_history_cells": 150168, + "old_bits": 49152, + "packed_bank_writes": 466944, + "packed_bits": 12288, + "transitions": 16212905 + }, + { + "changed_service_fixture": false, + "geometry": { + "b": 22 + }, + "header_bits": 139, + "incremental_history_cells": 338668, + "old_bits": 70656, + "packed_bank_writes": 856064, + "packed_bits": 22528, + "transitions": 32322900 + } + ], + "locations": 6003, + "negative_controls": [ + "short-last-code", + "extra-field-bit", + "bad-first-code", + "truncated-header", + "extra-header-bit", + "wrong-row-size", + "nonintegral-r", + "rho-outside-K", + "selected-bits-outside-row", + "zero-f", + "binding-object-alias", + "header-only-frontier", + "component-orientation" + ], + "scope": "No native C execution, f>1 full packet, recursive tariff or global assumption discharge.", + "source_checks": { + "authenticated_retained_files": 10, + "rejected_source_mutations": 10, + "source_schema_checked": true + }, + "status": "PASS_SELECTED_MOVE_PACKED_CODEC", + "strided_subprograms": [ + { + "K": 1, + "a": 4, + "record_bits": 3, + "rho": 0, + "rows": 1, + "selected_bits": 3, + "transitions": 18309, + "u": 0 + }, + { + "K": 2, + "a": 5, + "record_bits": 5, + "rho": 1, + "rows": 2, + "selected_bits": 2, + "transitions": 68659, + "u": 1 + }, + { + "K": 2, + "a": 8, + "record_bits": 2, + "rho": 1, + "rows": 3, + "selected_bits": 3, + "transitions": 480060, + "u": 1 + }, + { + "K": 3, + "a": 9, + "record_bits": 1, + "rho": 2, + "rows": 2, + "selected_bits": 3, + "transitions": 346845, + "u": 0 + }, + { + "K": 1, + "a": 7, + "record_bits": 7, + "rho": 0, + "rows": 2, + "selected_bits": 4, + "transitions": 739558, + "u": 2 + } + ], + "table_sha256": "ac852be823d484cdb0d10e8fb8cd063c7f0c4351789ea0516bf5fd23a475ce1b", + "tapes": 43 +} diff --git a/research/selected-move-packed-codec/RESULT.json b/research/selected-move-packed-codec/RESULT.json new file mode 100644 index 0000000000..6e0c50f534 --- /dev/null +++ b/research/selected-move-packed-codec/RESULT.json @@ -0,0 +1,132 @@ +{ + "full_packets": [ + { + "changed_service_fixture": true, + "geometry": {}, + "header_bits": 127, + "incremental_history_cells": 41362, + "old_bits": 9216, + "packed_bank_writes": 77824, + "packed_bits": 2048, + "transitions": 3403133 + }, + { + "changed_service_fixture": false, + "geometry": { + "a": 12, + "b": 2, + "u": 2 + }, + "header_bits": 135, + "incremental_history_cells": 304299, + "old_bits": 73728, + "packed_bank_writes": 622592, + "packed_bits": 16384, + "transitions": 25598342 + }, + { + "changed_service_fixture": true, + "geometry": { + "b": 3, + "cutoff": 1606938044258990275541962092341162602522202993782792835301383, + "r": 2, + "rows": 2 + }, + "header_bits": 533, + "incremental_history_cells": 150168, + "old_bits": 49152, + "packed_bank_writes": 466944, + "packed_bits": 12288, + "transitions": 16212905 + }, + { + "changed_service_fixture": false, + "geometry": { + "b": 22 + }, + "header_bits": 139, + "incremental_history_cells": 338668, + "old_bits": 70656, + "packed_bank_writes": 856064, + "packed_bits": 22528, + "transitions": 32322900 + } + ], + "locations": 6003, + "negative_controls": [ + "short-last-code", + "extra-field-bit", + "bad-first-code", + "truncated-header", + "extra-header-bit", + "wrong-row-size", + "nonintegral-r", + "rho-outside-K", + "selected-bits-outside-row", + "zero-f", + "binding-object-alias", + "header-only-frontier", + "component-orientation" + ], + "scope": "No native C execution, f>1 full packet, recursive tariff or global assumption discharge.", + "source_checks": { + "authenticated_retained_files": 10, + "rejected_source_mutations": 10, + "source_schema_checked": true + }, + "status": "PASS_SELECTED_MOVE_PACKED_CODEC", + "strided_subprograms": [ + { + "K": 1, + "a": 4, + "record_bits": 3, + "rho": 0, + "rows": 1, + "selected_bits": 3, + "transitions": 18309, + "u": 0 + }, + { + "K": 2, + "a": 5, + "record_bits": 5, + "rho": 1, + "rows": 2, + "selected_bits": 2, + "transitions": 68659, + "u": 1 + }, + { + "K": 2, + "a": 8, + "record_bits": 2, + "rho": 1, + "rows": 3, + "selected_bits": 3, + "transitions": 480060, + "u": 1 + }, + { + "K": 3, + "a": 9, + "record_bits": 1, + "rho": 2, + "rows": 2, + "selected_bits": 3, + "transitions": 346845, + "u": 0 + }, + { + "K": 1, + "a": 7, + "record_bits": 7, + "rho": 0, + "rows": 2, + "selected_bits": 4, + "transitions": 739558, + "u": 2 + } + ], + "table_sha256": "ac852be823d484cdb0d10e8fb8cd063c7f0c4351789ea0516bf5fd23a475ce1b", + "tapes": 43 +} diff --git a/research/selected-move-packed-codec/SOURCE-PINS.json b/research/selected-move-packed-codec/SOURCE-PINS.json new file mode 100644 index 0000000000..9640e7bb46 --- /dev/null +++ b/research/selected-move-packed-codec/SOURCE-PINS.json @@ -0,0 +1,96 @@ +{ + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "retained": [ + { + "local_path": "inputs/grid-interface-PROOF.md", + "repository": "CubeJerry/integer-mult-bounds", + "commit": "e9b6d75397e3553af77bab81d5816e4b8708a501", + "path": "research/selected-move-packed-grid-interface/PROOF.md", + "originating_pr": 7578, + "git_blob": "a9c224b2f94b20b1eaae22553cdc121231322d9d", + "sha256": "ceb2cd71379644ab2c4f8e36489996436a11eb345a275d21ea487de59264e308" + }, + { + "local_path": "inputs/literal-leaf-contract.md", + "repository": "CubeJerry/integer-mult-bounds", + "commit": "e9b6d75397e3553af77bab81d5816e4b8708a501", + "path": "research/selected-move-packed-grid-interface/inputs/literal-leaf-contract.md", + "originating_pr": 7429, + "git_blob": "a8ae6684d55e3a1aaa7f2aa432f15ae9db580b11", + "sha256": "c99157c3c43ae490b858cdbce04d85f3661ca5d9752770506d18ec4876c4ed6c" + }, + { + "local_path": "inputs/old-coded-move-contract.md", + "repository": "CubeJerry/integer-mult-bounds", + "commit": "e9b6d75397e3553af77bab81d5816e4b8708a501", + "path": "research/selected-move-packed-grid-interface/inputs/old-coded-move-contract.md", + "originating_pr": 6974, + "git_blob": "4303bc7de83739a7c9294436dd70eab278f86aca", + "sha256": "e39f25a054aab42b0c866f09131ee2ac752e77f1fcd1bfe2269bd04798203857" + }, + { + "local_path": "inputs/old-header-provider.py", + "repository": "CrocSwap/integer-mult-bounds", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/current-coded-gaussian-leaf/vendor/binding/provider.py", + "originating_pr": 6967, + "git_blob": "481013b988e5ae8189a0dddfcbb2f521e3142cab", + "sha256": "3b7bb4f7940ffa9fafd34d25bbb1a9225e1b671924ed194ad012cb26251d7460" + }, + { + "local_path": "inputs/old-abi-machine.py", + "repository": "CrocSwap/integer-mult-bounds", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/current-coded-gaussian-leaf/vendor/binding/vendor/lifecycle/machine.py", + "originating_pr": 6967, + "git_blob": "acf475e4fccaff2fb64bd5b0b3f3fc0d246dc592", + "sha256": "ec597bce13275003ff30e4be481c936401826c1d4af642b55eec0c410774d1df" + }, + { + "local_path": "inputs/notices/old-coded-NOTICE.md", + "repository": "CubeJerry/integer-mult-bounds", + "commit": "e9b6d75397e3553af77bab81d5816e4b8708a501", + "path": "research/selected-move-packed-grid-interface/inputs/notices/old-coded-NOTICE.md", + "originating_pr": 7578, + "git_blob": "9ec74ef6051fcd53f11b569b232b639261daf81f", + "sha256": "db63191f6fbf8d5b3b577ba7afb07c15bd0a89a7446626217cadf401acc4ffde" + }, + { + "local_path": "inputs/notices/literal-leaf-NOTICE.md", + "repository": "CubeJerry/integer-mult-bounds", + "commit": "e9b6d75397e3553af77bab81d5816e4b8708a501", + "path": "research/selected-move-packed-grid-interface/inputs/notices/literal-leaf-NOTICE.md", + "originating_pr": 7578, + "git_blob": "71c5f6dae2c799ce5d76c544e98d1ee7c52ef76c", + "sha256": "773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf" + }, + { + "local_path": "inputs/notices/common-grid-NOTICE.md", + "repository": "CubeJerry/integer-mult-bounds", + "commit": "e9b6d75397e3553af77bab81d5816e4b8708a501", + "path": "research/selected-move-packed-grid-interface/inputs/notices/common-grid-NOTICE.md", + "originating_pr": 7578, + "git_blob": "51fa9d494c79e6c5a113bc09f2852bfacece6b52", + "sha256": "3a3d353a0fb41ce5688c8ae2bcc82306f4499ffc19f0c44eeaa85679f895a5d3" + }, + { + "local_path": "inputs/notices/grid-interface-NOTICE", + "repository": "CubeJerry/integer-mult-bounds", + "commit": "e9b6d75397e3553af77bab81d5816e4b8708a501", + "path": "research/selected-move-packed-grid-interface/NOTICE", + "originating_pr": 7578, + "git_blob": "dcfe84cbdd5f93d92f1970718c21e04833e8c36e", + "sha256": "3d176e19ad6f1280427563ed5279827afd194a0d25ce400863e0fe7b7d185774" + }, + { + "local_path": "inputs/notices/selected-NOTICE", + "repository": "CubeJerry/integer-mult-bounds", + "commit": "e9b6d75397e3553af77bab81d5816e4b8708a501", + "path": "research/selected-move-packed-grid-interface/inputs/notices/selected-NOTICE", + "originating_pr": 7578, + "git_blob": "a3687d65a00794277cdaad37558d24008cbc37f5", + "sha256": "da12736e2e824167ff56f2ecb623a5f88f75a270410360890f61dffc33bab249" + } + ], + "note": "Retained text is source evidence; no predecessor executable is imported or scientifically replayed." +} diff --git a/research/selected-move-packed-codec/SOURCES.json b/research/selected-move-packed-codec/SOURCES.json new file mode 100644 index 0000000000..89b7c5747a --- /dev/null +++ b/research/selected-move-packed-codec/SOURCES.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + } + ] +} diff --git a/research/selected-move-packed-codec/TASK.json b/research/selected-move-packed-codec/TASK.json new file mode 100644 index 0000000000..8066931349 --- /dev/null +++ b/research/selected-move-packed-codec/TASK.json @@ -0,0 +1,90 @@ +{ + "schema_version": 1, + "task_id": "uniform-transfer-audit", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "uniform-transfer-audit", + "question": "Can one of the selected record's five inherited assumptions be proved at its actual caller?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose one assumption ID (native_all_columns, owned_erasure, compiler, precision_tape, analytic_recovery), one quantified implication and exact dependency closure. Check current handoffs, including #5625 row reentry and #5707 root-prefix lowering, without treating their partial scope as the whole theorem. Prove or falsify that implication with a caller-bound argument; stop at the chosen obligation. Finite tests or root digits do not discharge an all-size statement.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "existing_checks": [ + { + "scope": "PR #4100: proposed unconditional construction and finite checks, without independent acceptance.", + "evidence": "research/unconditional-batched-crt/README.md", + "remaining": "Independent proof audit of one caller-bound all-size implication; all other premises remain explicit.", + "status": "author-checked", + "source_commit": "337d04939571a637aeab54a0f58f54fde811663a", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "refined", + "actual_scope": "Construct the literal full old-codec/strided-packing bridge explicitly left open by #7578, under the exact complete field/descriptor and supplied-owner premises, with successful inverse and complete direct-order cost.", + "scope_change_reason": "The broad assumption audit is narrowed to one source-specific physical interface. The semantic permutation and lower bound were already given; the new work is an input-independent finite machine and all-size guide/return proof.", + "bottleneck_link": "The newer literal selected native providers accept an incompatible packed ABI. Their use at the older coded boundary requires real paid payload conversion and strided transport.", + "budget_minutes": 90, + "stop_rule": "Freeze and verify the complete codec; do not infer an accelerated nonleaf tariff, full selected caller, or assumption discharge.", + "outcome": "completed", + "evidence": "PROOF.md, machine.py, verify.py, SOURCE-PINS.json and INDEPENDENT-REVIEW.md", + "result_summary": "Verified scoped implementation theorem; primary and separate sparse-tape normal/optimized checks pass. No global assumption discharged.", + "author": "Jerry Chen / @CubeJerry", + "ai_assistance": "Substantial OpenAI ChatGPT assistance in research, implementation, independent verification and packaging.", + "open_questions": [ + { + "question": "Join this exact bridge to the complete selected same-width packed MOVE and actual source/owner token.", + "why_it_matters": "A correct codec and correct factor services must still share one occurrence and ownership lifecycle.", + "first_step": "Bind the exact current complete packed MOVE input/return contract, numerical prefix admission and disjoint private inventory.", + "blocked_by": "Source/dispatcher/HOME and failure-return contracts are separate." + }, + { + "question": "Provide a faster recursive nonleaf packing/transport tariff.", + "why_it_matters": "The complete literal direct bill O(f V_old+E) does not prove the selected accelerated recurrence.", + "first_step": "Choose one nonleaf caller and charge every packed-bank scan, source access, ordinary child and inverse restore.", + "blocked_by": "An admitted faster provider and compatible storage/owner interface are absent from this package." + } + ] +} diff --git a/research/selected-move-packed-codec/VALIDATION.json b/research/selected-move-packed-codec/VALIDATION.json new file mode 100644 index 0000000000..d664f1e9d8 --- /dev/null +++ b/research/selected-move-packed-codec/VALIDATION.json @@ -0,0 +1,84 @@ +{ + "status": "PASS", + "commands": [ + { + "command": [ + "python3", + "-I", + "-W", + "error", + "-B", + "/workspace/scratch/a91d12abea4e/worker-c/verify.py" + ], + "exit_code": 0, + "elapsed_seconds": 19.6, + "receipt": "RESULT.json", + "stdout_sha256": "409cd2db0b5819815c2cf2eef713ef1cbd130a6d5557814010f0718fc0ab3524", + "stderr": "" + }, + { + "command": [ + "python3", + "-I", + "-W", + "error", + "-O", + "-B", + "/workspace/scratch/a91d12abea4e/worker-c/verify.py" + ], + "exit_code": 0, + "elapsed_seconds": 18.219, + "receipt": "RESULT-OPTIMIZED.json", + "stdout_sha256": "409cd2db0b5819815c2cf2eef713ef1cbd130a6d5557814010f0718fc0ab3524", + "stderr": "" + }, + { + "command": [ + "python3", + "-I", + "-W", + "error", + "-B", + "/workspace/scratch/a91d12abea4e/worker-c/independent_check.py" + ], + "exit_code": 0, + "elapsed_seconds": 2.506, + "receipt": "INDEPENDENT-RESULT.txt", + "stdout_sha256": "d7bedc2491fe24d5fc19b9e39686e4770e8257530562950bf32275a9105a59fc", + "stderr": "" + }, + { + "command": [ + "python3", + "-I", + "-W", + "error", + "-O", + "-B", + "/workspace/scratch/a91d12abea4e/worker-c/independent_check.py" + ], + "exit_code": 0, + "elapsed_seconds": 2.613, + "receipt": "INDEPENDENT-RESULT-OPTIMIZED.txt", + "stdout_sha256": "d7bedc2491fe24d5fc19b9e39686e4770e8257530562950bf32275a9105a59fc", + "stderr": "" + } + ], + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "classification": "scoped all-size implementation lemma; no new kappa", + "machine_sha256": "119b69594a2a33550eec9b6e083db8f496c3fb3d9c1214b6703d687a0a662eba", + "table_sha256": "ac852be823d484cdb0d10e8fb8cd063c7f0c4351789ea0516bf5fd23a475ce1b", + "python": "3.12.14", + "normal_optimized_identical": true, + "independent_normal_optimized_identical": true, + "global_assumptions_discharged": [], + "independent_review": "Separate root sparse-tape implementation and guide/cost review; see INDEPENDENT-REVIEW.md.", + "publication_checks": { + "registered_replay": "PASS_REGISTERED_RESEARCH_PACKAGE; four normal/optimized commands executed in publication checkout", + "committed_bytes_modes": "PASS_RESEARCH_COMMIT_BYTES: 30 files", + "base_ancestry": "git merge-base --is-ancestor canonical base HEAD passed", + "export": "PASS_RESEARCH_EXPORT: all30 files and10 declared inputs", + "source_history_boundary": "Generic full-history check is not claimed for the intentionally shallow checkout. Canonical provenance is checked at the exact base; bundled source evidence is separately checked against exact originating commit/blob/SHA256 pins." + } +} diff --git a/research/selected-move-packed-codec/VERIFY.json b/research/selected-move-packed-codec/VERIFY.json new file mode 100644 index 0000000000..adef7ff82c --- /dev/null +++ b/research/selected-move-packed-codec/VERIFY.json @@ -0,0 +1,70 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/selected-move-packed-codec/inputs/grid-interface-PROOF.md", + "research/selected-move-packed-codec/inputs/literal-leaf-contract.md", + "research/selected-move-packed-codec/inputs/old-coded-move-contract.md", + "research/selected-move-packed-codec/inputs/old-header-provider.py", + "research/selected-move-packed-codec/inputs/old-abi-machine.py", + "research/selected-move-packed-codec/inputs/notices/old-coded-NOTICE.md", + "research/selected-move-packed-codec/inputs/notices/literal-leaf-NOTICE.md", + "research/selected-move-packed-codec/inputs/notices/common-grid-NOTICE.md", + "research/selected-move-packed-codec/inputs/notices/grid-interface-NOTICE", + "research/selected-move-packed-codec/inputs/notices/selected-NOTICE" + ], + "commands": [ + { + "argv": [ + "{python}", + "-W", + "error", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Literal graph, four complete f=1 packets, five strided subprograms, direct-index oracles, header/owner/retirement controls and source authentication." + }, + { + "argv": [ + "{python}", + "-W", + "error", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Same source and semantic gates with assertions disabled; the verifier uses explicit guards." + }, + { + "argv": [ + "{python}", + "-W", + "error", + "-I", + "-B", + "{package}/independent_check.py" + ], + "timeout_seconds": 90, + "checks": "Separately written sparse-dictionary tape interpreter; full changed-output packet, tuple-sort strided oracles, opaque exteriors, exact history restoration and codeword-branch mutation." + }, + { + "argv": [ + "{python}", + "-W", + "error", + "-I", + "-B", + "-O", + "{package}/independent_check.py" + ], + "timeout_seconds": 90, + "checks": "Separately written sparse-dictionary tape interpreter; full changed-output packet, tuple-sort strided oracles, opaque exteriors, exact history restoration and codeword-branch mutation." + } + ] +} diff --git a/research/selected-move-packed-codec/independent_check.py b/research/selected-move-packed-codec/independent_check.py new file mode 100644 index 0000000000..a38f50cb44 --- /dev/null +++ b/research/selected-move-packed-codec/independent_check.py @@ -0,0 +1,89 @@ +"""Separate orchestrator review: sparse-tape interpreter and tuple-sort oracle. +Prepared for @CubeJerry with OpenAI assistance. Apache-2.0. +Only import paths/loading are adapted for this portable package. +""" +from pathlib import Path +import hashlib, importlib.util, json, sys +ROOT=Path(__file__).resolve().parent +spec=importlib.util.spec_from_file_location('checked_codec',ROOT/'machine.py') +m=importlib.util.module_from_spec(spec);sys.modules[spec.name]=m;exec(compile((ROOT/'machine.py').read_bytes(),str(ROOT/'machine.py'),'exec'),m.__dict__) +def need(x,s): + if not x:raise ValueError(s) +def run(code,mem,heads,pc=0,cap=20000000): + lo=heads[:];steps=0 + while steps>j)&1] for j in range(w)]+[[0,1,0]] for z in sym] +def bits(values,w):return [int(c) for v in values for c in format(v,f'0{w}b')] +def supplied(payloads): + origins=[5+2*(i%3) for i in range(43)];mem=[] + for i,o in enumerate(origins): + cells={o-1:3,o-3:1};cells.update({o+j:b for j,b in enumerate(payloads.get(i,[]))});mem.append(cells) + return mem,origins[:],origins +def word(mem,i,o,n):return [mem[i].get(o+j,2) for j in range(n)] +def full(code,labels): + a=9;w=3;r=2;n=1<=origins[i]-1,'origin/guard') + need(mem[i].get(origins[i]-3)==1 and mem[i].get(origins[i]-1)==3,'opaque exterior') + if i>=2:need(mem[i]==before[i],'all private histories erased') + return {'steps':s1+s2,'V_old':len(packet),'E':len(context),'width':w,'coefficients':r} +def shuffle(): + b=m.Builder();b.label('ENTER');b.shuffle();b.halt('PACKED');b.label('EXIT');b.shuffle(True);b.halt('DONE');code,labels=b.finish();receipts=[] + for a,u,K,rho,g,rows in [(8,1,2,1,3,2),(9,0,3,2,3,1),(7,2,1,0,4,3)]: + L=a+2;N=1<=0. +* Every ideal current field is a finite sum c U x on that same complete + n-bit factor. U is a Gaussian-dyadic Clifford; all genuine spectators + and external rows remain complete. Exterior coefficients have denominator + height at most 178t and total Gaussian coefficient mass at most + 2*2^(161t). The selected depth condition is 356t3. + +This immediately refutes a header-only drop-in adapter on the unchanged old +physical DATA word. The literal leaf's clone expects exactly V_packed bits +and a blank; the old word still has physical bits there. Its cardinality +guard rejects before numerical execution. Changing the descriptor width to +make lengths match would change the coefficient arithmetic interpretation. +This is a concrete interface obstruction, not a counterexample to the +selected conditional theorem or to a correctly implemented bridge. + +A correct bridge owes physical source access, complete codec conversion, +component orientation, all selected and spectator address transport, the +six Gamma values with actual cutoff, one common quantum and width, genuinely +separate bank ownership, head returns and inverse conversion to the original +owner. In the explicit separate packed-bank model it has worst-case payload +work at least Omega(V_old+V_packed): arbitrary last input coefficients force +the old source head to visit its far data end, and the new full field has +to be materialized. In particular E-only descriptor work cannot pay it. +This lower bound does not preclude an admissible linear or fast ordinary +bridge; no such complete upper tariff is proved here. Reentry retains the +absolute per-role history union, not merely current field sizes. + +## 5. Exact premise-to-conclusion map and remaining gap + +| Premise/source | What it supplies | What it does not supply | +| --- | --- | --- | +| Selected #7000 application, sections 2 and 5 | Full normalized source products, exterior scalars, phase, complete root/spectators, exact-grid/depth specialization | Literal occurrence packing and physical tariff | +| Earlier #6890 | Already proved source-specific algebraic tensor/caller closure for older #6030 | A new #7000 physical provider | +| #6974 | Protected raw #6030 current_local event 9896 join under its 23-field format and direct-leaf premises | New selected source token, enclosing placement, nonleaf service | +| #7426/#7428/#7430 | Literal phase, post-matrix translation descriptor, and both binary linear factors for #7000 event 24472 | Their complete same-occurrence join and old-format acquisition | +| #7429 plus section 2 above | Exact literal positive C on every column; common-root precision forces every-axis admission on its supplied packed ABI | Codec/strided packing, whole MOVE failure retirement, fast nonleaf dispatch | + +The still-missing uniform interface is a selected-occurrence paid physical +bridge and dispatcher from actual retained field/owner/descriptor state to +that packed ABI and back, with complete monomial/child composition, complete +stock and recursive return. Algebraic A tensor identity normalization is +already settled conditional on exact primitive actions; it cannot replace +this bridge. No operator may be silently evaluated on a projected role or +partial spectator view. A literal final-image calculation alone cannot +establish the numerical domain either, as the exact control below shows. + +The enabling implication above removes a separate per-axis numerical +precondition once the selected complete-root invariant and faithful bridge +are supplied. It leaves physical all-column admission, owned erasure, +compiler closure, precision/tape implementation and analytic recovery +explicit. The selected conditional kappa remains 0.00363005817. + +## 6. Bounded evidence and controls + +`verify.py` authenticates the exact selected source exports and remote Git +blobs, regenerates the actual event 24472 recipe, and executes exact sparse +Gaussian-rational controls. Starting after the actual right monomial with +the f=2 fibre [1,0,0,1], it constructs the exact pre-right native entrance. +Both complete native entrance and complete native endpoint are integral, +while the first central Gaussian prefix is half-integral. This rejects the +weaker endpoint-only provider premise. It is not asserted reachable from +the selected guarded root pipeline. Multiplying the full native entrance +by 2^18 under the explicit n=18,p=0,h=1,F=18,w=40 control admits both prefixes. +The script also checks complete spectator-preserving packing permutations +and exact volumes for three legal strided geometries. A 5,000-value integer +scan corroborates the depth inequalities; their universal proof is section2. +No heavy literal f=2 packet or historical native catalogue was rerun. + +The remote overlap check covered exact #7421 through #7430 metadata and +targeted all-column, native dispatch, coded-remap and MOVE24472 PR queries. +#7462 shortens the left linear word, and #7503 proves a phase-observation +lower bound; neither claims the remaining bridge. Metadata coverage is +recorded in README.md and is not a proof that no unsearched work exists. +All predecessors keep their authorship; no already settled Kronecker or +Clifford-row lemma is claimed as new. Prepared for Jerry Chen / CubeJerry +with substantial OpenAI assistance; no independent human or proof-kernel +acceptance is claimed. diff --git a/research/selected-move-packed-codec/inputs/literal-leaf-contract.md b/research/selected-move-packed-codec/inputs/literal-leaf-contract.md new file mode 100644 index 0000000000..a8ae6684d5 --- /dev/null +++ b/research/selected-move-packed-codec/inputs/literal-leaf-contract.md @@ -0,0 +1,297 @@ +# A literal positive C tensor leaf on the packed selected native field + +## 1. Source-bound scope and exact ABI + +At canonical `e54523517d0f03e58352e647c403a5af3e525a57`, the selected #7000 +native word has zero-based event 24472 `["MOVE",415,3,99,false]`. +Recomputing its actual before/after Clifford frames and source lowering gives +rank one. The retained independent Gaussian interpreter confirms that the +positive central factor has columns `((1+i)/2,(1-i)/2)` and +`((1-i)/2,(1+i)/2)`. Thus it is exactly + +`C = (1/2) [[1+i,1-i],[1-i,1+i]]`. + +This is the same C as Jose Manuel's #3091 and the current coded leaf #6967. +It is not an unnormalized Walsh butterfly. Entrance/exit monomials are still +separate; this package does not execute the complete MOVE. Source pins and +credit are in SOURCES.json and NOTICE.md. Rank one is one selected coordinate +per column: for positive column width f the central operator is +`C^(tensor f)`, not a single C. Every f factor is implemented, low bit first. + +The supplied packed ABI is the first-five-field interface of the literal +native phase package at CubeJerry commit +`172f4535ce8dcff79f626410af845f757c1563be`, extended by one cutoff field. +HEADER contains six positive canonical Gamma codes, in order: + +`f, r, P, S, w, cutoff`. + +Here r is coefficient multiplicity, not source Fourier rank. Let E be the +total length of these codes. DATA is the complete lexicographic array +`[P] x [2^f]^9 x [S]`, with r Gaussian coefficients per address. Each has +w signed two's-complement real bits followed by w signed imaginary bits, +MSB first. All coefficients share an arbitrary fixed common grid, unchanged +by this program. Write `N=P S r 2^(9f)` and `V=2Nw`. + +Require `w>=2` and `f<=cutoff`; both are physically checked. DATA is exactly +V bits followed by a blank. HEADER may have opaque symbols after the sixth +code. Both public heads start at their origins. Supply 27 genuinely distinct +private tape owners, blank from one cell before each origin through the caps +in Section 6. Opaque exteriors are preserved on successful legal calls. +Origins may differ or be negative; the controller never decodes them. + +This is an explicit packed boundary, not the full old #6967 ABI. That provider +uses a 23-value length/unary-prefix/LSB descriptor and three-bit coded LSB +component fields with delimiters. A caller must supply the exact semantic +packing, component orientation, delimiter and header bridge, with its full +cost and ownership contract. Reversing individual already packed components +is linear, but the old codec and arbitrary strided packing are not silently +implemented here. The first five new fields match the published phase ABI; +its opaque-tail contract permits preservation of the added cutoff code. + +## 2. Universal accepting and failure contract + +For every legal encoded entry, suppose each output component of every +executed C axis is integral on the common grid and lies in +`[-2^(w-1),2^(w-1)-1]`. Then the fixed graph replaces DATA by the exact positive +`C^(tensor f)` on all f bits of coordinate zero. All eight other coordinates, +prefixes, suffixes, coefficient indices and absolute phase are preserved. +HEADER, every head, private body/guard and opaque exterior is restored; +DATA remains its original owner. + +At each executed scalar row the program rejects exactly a nonintegral half +or an out-of-range w-bit result. A finite missing or extra DATA bit is detected +by the header-derived clone before numerical execution. Width/cutoff failures +reject before the clone. These rejections precede every DATA write, so the +original public field/header remain intact. Missing local branches are +explicit reject endpoints in the reference interpreter. Failure-time private +retirement, head return and same-bank retry are not claimed. This is a weaker +failure lifecycle than structured #6967, not its full drop-in export. + +The domain is a prefix condition: final tensor-image fit alone does not +establish it. A credited sufficient condition from #3091 and its Gaussian +reserve/norm predecessors is that input components are divisible by +`2^ceil(f/2)`, bounded by M, and `2^ceil(f/2) M <= 2^(w-1)-1`. +This supplies all integral signed prefixes. Those reserve/norm results are +inherited, not new claims here. A caller can instead prove its actual +correlated prefix conditions. + +For a concrete obstruction to endpoint-only admission, the real f=2 fibre +`[1,0,0,1]` has final `C tensor C` image `[0,1,1,0]`. Its first low-bit-axis +pair `(1,0)` nevertheless produces nonintegral halves. The exact program +must reject it even though the final image is integral and fits at w=2. + +## 3. Literal acquisition and generated geometry + +`compile_leaf()` has no runtime arguments. Its 6,826-location graph uses 29 +fixed tapes and `{blank,0,1,|}`, with only scanned-symbol branches, one-cell +writes, unit moves, fixed jumps and halt. Compile-time loops enumerate fixed +bit/carry possibilities, never input-sized code. Varying counts and geometry +stay on tapes. + +The first five Gamma codes become unary guides by repeated `v -> 2v+b` +copies. Strict binary prefixes sum to less than the represented value, so +these conversions cost `O(f+r+P+S+w+E)=O(V+E)`. The first value's canonical +binary word and bit length are also copied. Cutoff is copied only in binary, +with a unary bit length. Comparing lengths and, only if equal, MSB words +checks `f<=cutoff`. An arbitrarily large represented cutoff thus costs O(E), +not its value. HTRACE records every public header advance and restores its +head without an origin oracle. All comparison words are retired afterwards. + +For axis j, `0<=j=2: the initial width-guided seek, w digit transitions, +two sign extensions, parity/range scans, output emission and all returns are +included. Each ordinary digit uses at most thirteen instructions. The four +input loads plus clears cost at most `84w+44`. Four scalar rows, pair control +and component handling therefore cost at most 640w per pair. There are +N/2 pairs per complete axis. All half loads, stream merges, whole-field +returns, suffix/prefix loops and their resets are linear scans of V; their +loops have fixed depth and every range is nonempty. A conservative count +places a complete axis, including its geometry update when present, below +`8192(V+1)` instructions. The actual table has no per-bit scan of a full +descriptor or whole address word. + +Separately, header/initial geometry/source clone and final commit/retirement +are each below `8192(V+E+1)`: the preceding exact unary-helper prices and +constant-many full scans give much smaller coefficients, and this allowance +also covers all fixed guard and branch instructions. Hence + +`T <=8192[f(V+1)+2(V+E+1)] <=65536(fV+E+1)`. + +The second inequality uses f,V>=1. This is a complete direct-leaf bill: +source access and return, geometry, every axis, copying, full staging, +installation and erasure are charged. It is not a faster nonleaf tariff. +The fixed program construction is input independent. Entry acquisition, +old-format conversion, source packing and transport to the entry heads are +supplied caller work and must be added where required. + +For backing, put `U*=Sr 2^(9f-1)`, `A*=P 2^(f-1)`, and +`C*=max(A*,U*,f,r,P,S,w)`. Relative to its own origin, each private role visits +only `[-1,cap]`, including the guard and blank endpoint, with these caps: + +| Role | cap | +| --- | --- | +| A, B, DTRACE | V on each role | +| MODE | 1 | +| HTRACE, LENGTH | E on each role | +| DOUBLE | C* | +| F, R, P, S, WIDTH | f,r,P,S,w respectively | +| FBIN, FLEN | ell(f) on each role | +| TBIN, TLEN | ell(cutoff) on each role | +| PREFIX, SUFFIX | A*, U* respectively | +| LEFT, RIGHT, LOUT, ROUT | `2w U*` on each role, using the maximum U* | +| AR, AI, BR, BI | w on each role | +| NUM | w+2 | + +Every cap in the twenty volume-type roles is <=V, except NUM's harmless +additional two cells; six code-type roles are <=E, and MODE needs one cell. +Including 27 guards/endpoints, their total allowance is at most +`20V+6E+57 <=64(V+E+1)`. Here K0 counts the actual pre-entry historical +backing of the 27 private owners only. Their backing at every time is at most + +`K0+64(V+E+1)`. + +For a complete 29-owner history statement, include all public history in K0 +and add at most `E+V+2` public head positions. The same loose envelope remains +valid, since `21V+7E+59 <=64(V+E+1)`. Supplied source/opaque entry backing is +included in actual K0; a test fixture's unpriced construction is not a theorem +about free caller acquisition. + +Erasure never subtracts historical cells. All successful-call writes are +blank again at return; older tails are already blank from prior successes. +Thus a smaller clean call needs no scan of old capacity and retains its own +current-shape time bound. At fixed origins repeated calls use per-role maxima, +then sum. Under changing origins retain absolute per-role history unions and +the caller's paid transport corridors; do not replace them by maximum current +volume. Whole-tail blankness and genuinely distinct owned windows are entry +premises, not inferred from a few local reads or fresh wrapper identities. + +## 7. Exact source transfer, evidence and unresolved interfaces + +The selected native tensor convention packs coordinate i as +`a_i=sum_j x_(j,i) 2^j`. The central rank-one compiler factor acts on i=0 in +each column j. The identity of its two source columns, with denominator two, +therefore identifies the operator implemented above exactly, including phase +and normalization. The source binder checks the entire retained local recipe; +this does not claim that this package implements its two surrounding factors. + +For a current coded caller, an admitted semantic bridge must identify these +actual bits, preserve the complete other coordinate/spectator/coefficient +fields, preserve the common grid and signed width, and supply the six values +above, including the actual cutoff. It must price real packing and coefficient +orientation. The generic #6967 domain contains shapes that are not already +this complete packed nine-coordinate tensor; those calls are not silently +included. A supplied view cannot make strided payload movement free. + +The author checker uses a direct tensor-row Gaussian polynomial oracle, +not the executable butterfly/carry algorithm. It tests complete m=9,f=1 +packets, endpoint values, coefficient/spectator multiplicities, both named +arithmetic failures, cardinality/width/cutoff failures and a 2049-bit threshold. +The separate C++ interpreter executes the same fixed 6,826-location table on +the complete actual m=9,f=2 array: 262,144 addresses, 2,621,440 bits, and +704,382,528 table instructions. Its output matches the independent direct +tensor formula, and every header/head/private/exterior check passes. It +cross-checks the original interpreter at f=1. A mutant that executes only +the first axis still retires correctly but fails the f=2 tensor oracle, +directly detecting rank-one/f=1 conflation. No reduced dimension substitutes +for that actual full-field f=2 execution. + +Independent root/peer evidence is recorded separately in REVIEW.md. Finite +tests support, but do not replace, the universal graph invariants and cost +proof above. Open obligations remain: full old-codec and placement bridges, +failure retirement if required, entire source MOVE/caller composition, +global producer/cutoff/precision admission, nonleaf speed and the other +foundational assumptions. No selected certificate, new kappa or unconditional +integer-multiplication theorem is claimed. diff --git a/research/selected-move-packed-codec/inputs/notices/common-grid-NOTICE.md b/research/selected-move-packed-codec/inputs/notices/common-grid-NOTICE.md new file mode 100644 index 0000000000..51fa9d494c --- /dev/null +++ b/research/selected-move-packed-codec/inputs/notices/common-grid-NOTICE.md @@ -0,0 +1,20 @@ +# Credit and retained source notice + +Prepared for @CubeJerry with substantial OpenAI assistance. Apache-2.0. + +The five files under `source/` are unchanged snapshots from DreamingOfClouds' +`research/p104-shared-odd-native` at +`4e13b7acdbea1c9f12aa88126435360eecea7401`. Their original LICENSE and NOTICE +are retained alongside them. The original word, caller, scale1125 certificate, +strictification parameters and candidate bound are their contributors' work. + +The proof explicitly credits #104's odd clearing and #6901's fixed-root +precision theorem, with the #4586/#5443/#6878 compiler and occurrence lineage. +Credit icekylinx, Ross Richardson, zxv, Jacob Alan Sussman and all authors +identified by those predecessor packages. No predecessor method, endpoint +identity or independent human acceptance is claimed as a new result here. + +The rational audit and fixed-grid/transfer-matrix audit were authored by +different same-session AI research agents. That separation supplies an +independent method and review; it does not imply external authorship or +formal proof verification. diff --git a/research/selected-move-packed-codec/inputs/notices/grid-interface-NOTICE b/research/selected-move-packed-codec/inputs/notices/grid-interface-NOTICE new file mode 100644 index 0000000000..dcfe84cbdd --- /dev/null +++ b/research/selected-move-packed-codec/inputs/notices/grid-interface-NOTICE @@ -0,0 +1,28 @@ +Selected MOVE packed-grid numerical interface +Prepared for Jerry Chen / CubeJerry with substantial OpenAI assistance. +Copyright 2026. Licensed under Apache License 2.0; see LICENSE. + +This package applies, rather than reclaims, the complete-root Clifford, +common-grid and depth invariants, selected source lowering and literal-leaf +contracts of its predecessors. The bundled inputs retain exact source bytes. + +Retain the notices in inputs/notices/: +- selected-NOTICE: selected shared-native construction, frame/compiler, + helper split and caller predecessors. +- common-grid-NOTICE.md: odd scalar precision, complete-root Clifford and + compiler-depth lineage. +- old-coded-NOTICE.md: current coded Gaussian MOVE/codec and physical + monomial/positive leaf predecessors. +- literal-leaf-NOTICE.md: the pending literal positive C provider and its + numerical, layout and machine predecessors. + +The source includes the retained exact Clifford compiler. Its source hash, +Git blob and canonical path are listed in SOURCES.json; source authors keep +their original credit. The Gaussian row kernel follows Jose Manuel's #3091 +lineage; common-root and odd clearing follow the authors identified in the +retained precision proof. Classical tensor, Clifford norm and fixed-rational +arguments are not claimed as new. + +No physical full bridge, whole MOVE, nonleaf dispatcher, foundational +assumption discharge, independent human/formal acceptance or new kappa is +asserted. All original selected five assumptions remain explicit. diff --git a/research/selected-move-packed-codec/inputs/notices/literal-leaf-NOTICE.md b/research/selected-move-packed-codec/inputs/notices/literal-leaf-NOTICE.md new file mode 100644 index 0000000000..71c5f6dae2 --- /dev/null +++ b/research/selected-move-packed-codec/inputs/notices/literal-leaf-NOTICE.md @@ -0,0 +1,34 @@ +# Attribution and license + +Prepared for Jerry Chen / @CubeJerry with substantial OpenAI assistance. +New material is Apache-2.0; copied predecessors retain their original notices. + +Jose Manuel (jmbarrancoml), CrocSwap/integer-mult-bounds#3091, supplies the +Gaussian C numerator rows, exact carry/parity/signed-fit argument, physical +complete-axis strategy and direct tensor tariff. Credit its #3055/#3087 +physical lineage, Alejandro Zarzuelo Urdiales's #45 Gaussian tensor reserve +and norm results, James Chang's #1869 ripple arithmetic, AAAmirinu's #2327 +prefix audit, and Nick Petalas's #2772/#3089 prefix/capacity work. + +@CubeJerry's #6967 current-coded leaf supplies the earlier source/format/ +lifecycle binding and explicitly leaves literal numerical export open. +#6978, #6986 and #6989 provide distinct all-source, cutoff-transport and +rounded wrappers. Their stronger failure-retirement and old coded interfaces +are not silently inherited by this packed component. + +The actual #7000 source, Clifford compiler and retained independent Gaussian +verifier are credited to DreamingOfClouds, Ali Romman, Cinna Davis, zxv, +unpaidmoon, icekylinx, CubeJerry and the earlier authors named by the retained +sources. The construction, lowering and matrix identities are not claimed anew. + +The packed ABI is published at +`172f4535ce8dcff79f626410af845f757c1563be`. Unary/Gamma/trace patterns follow +literal-layer-phase at `8b549ca6557ccbb3017b104b27ea35051f990416`, which credits +literal-layer-egress at `51ab0539059214fcfa044938c36a0b6017232be5`. The exact +Builder/Machine originates in #7349, head +`9dfe6747b8553fd11b408f2b045c5954ef1e6eaa`. + +The parent's dense execution/oracle and literal_layer_boundary's independent +source/Gaussian/universal-cost review are separately attributed in REVIEW.md. +Their artifacts are unchanged. Independent AI work is not human approval or +formal proof-kernel acceptance. diff --git a/research/selected-move-packed-codec/inputs/notices/old-coded-NOTICE.md b/research/selected-move-packed-codec/inputs/notices/old-coded-NOTICE.md new file mode 100644 index 0000000000..9ec74ef605 --- /dev/null +++ b/research/selected-move-packed-codec/inputs/notices/old-coded-NOTICE.md @@ -0,0 +1,25 @@ +# Attribution and scope + +Prepared for @CubeJerry with substantial OpenAI assistance in source analysis, +composition proof, implementation, independent matrix/arithmetic checks and +documentation. Apache-2.0. Same-session lead review is author-side evidence, +not independent human or formal-kernel acceptance. + +The published current coded monomial and positive leaf are exact dependencies, +not new algorithms in this package. Their computational files and attribution +are retained unchanged; public source pins are in DEPENDENCIES.json and +REMOTE-SOURCE-TREES.json. Shared runtime copies inside the monomial closure +retain their original notices. The thin leaf source closure is connected by +this package's discovery shim to that identical shared physical vocabulary. + +Credit Jose Manuel (`jmbarrancoml`) for #3087 and #3091 with OpenAI assistance, +and the #3055/#2250/#2378/#2422 physical permutation and coefficient lineage. +Credit Chris R (`Clear1nsight`) for #4129's older prepared common-grid binding. +Credit DreamingOfClouds and the selected #6030 construction, Ali Romman and +the retained native compiler/source lineage, #6293, unpaidmoon #6930, and +Ali Romman's distinct stochastic-rounding use of event9896 in #6532. + +Only the whole-occurrence protected current join, its explicit full invoice, +independent original-source matrix evaluation and bounded verification +composition are claimed here. No new kappa or universal selected assumption +discharge follows. diff --git a/research/selected-move-packed-codec/inputs/notices/selected-NOTICE b/research/selected-move-packed-codec/inputs/notices/selected-NOTICE new file mode 100644 index 0000000000..a3687d65a0 --- /dev/null +++ b/research/selected-move-packed-codec/inputs/notices/selected-NOTICE @@ -0,0 +1,9 @@ +New shared-wire composition, seventeenth wire, and two enabling splits: developed with substantial OpenAI assistance, 2026. Apache-2.0. + +Frozen predecessor native words and odd verifier: DreamingOfClouds, with Claude Opus 5.5 (Anthropic), from #6936 and #6937. + +Retained Clifford compiler and exact native interpreter retain their original headers and lineage from #6833: native source by DreamingOfClouds; independent-helper mechanism by Ali Romman; inventory, retiming and helper-retirement extensions by Jerry Chen / @CubeJerry with OpenAI assistance. + +Helper-split lemma: Ali Romman (#5599). Shared native applications: CubeJerry (#6916). Caller blocks: CubeJerry (#6912). Owned-rise argument: CubeJerry (#6914). Width-2 phase convention: unpaidmoon (#6930). Odd-grid precedent: icekylinx (#104). + +The higher-level caller and BIT integration require their own source attribution and pins. diff --git a/research/selected-move-packed-codec/inputs/old-abi-machine.py b/research/selected-move-packed-codec/inputs/old-abi-machine.py new file mode 100644 index 0000000000..acf475e4fc --- /dev/null +++ b/research/selected-move-packed-codec/inputs/old-abi-machine.py @@ -0,0 +1,406 @@ +"""Literal lifecycle control on fixed sequential tapes. + +Prepared for @CubeJerry with substantial OpenAI assistance. Apache-2.0. +Stack is the authenticated #5356 implementation supplied by the loader. +Algorithms never read tape addresses, extents, hardware arrays or a host stack. +Instruction and primitive tables are fixed before runtime inputs vary. +""" +from dataclasses import dataclass + +ZERO, ONE, LEFT, SEP, END, BASE, BLANK = range(7) +COMPONENT = 2 + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def emit(tape, symbol): + tape.write(symbol) + tape.move(1) + + +def origin(tape, marker=LEFT): + tape.move(-1) + while tape.read() != marker: + tape.move(-1) + tape.move(1) + + +def retire(tape, marker=LEFT): + """Erase all coded bytes, including encoded logical blanks.""" + origin(tape, marker) + while (symbol := tape.read()) != BLANK: + need(symbol in (ZERO, ONE), "contiguous binary body") + emit(tape, BLANK) + origin(tape, marker) + + +def transfer(source, target, source_marker=LEFT, target_marker=LEFT): + """Administrative actual-byte copy; never an arithmetic COPY.""" + origin(source, source_marker) + origin(target, target_marker) + need(target.read() == BLANK, "administrative transfer needs empty target") + while (symbol := source.read()) != BLANK: + need(symbol in (ZERO, ONE), "binary transfer") + emit(target, symbol) + source.move(1) + origin(source, source_marker) + origin(target, target_marker) + + +class CodedPort: + """Seven virtual symbols encoded as three nonblank physical bits. + + The physical LEFT before the current body is never exposed as data. + A left step at its local origin rejects. Two-sided routines first use + the standard translation to two one-sided ports. + """ + __slots__ = ("tape",) + + def __init__(self, tape): + self.tape = tape + + def read(self): + t = self.tape + if t.read() == BLANK: + return 4 + value = 0 + for _ in range(3): + bit = t.read() + need(bit in (ZERO, ONE), "whole virtual codeword") + value = 2 * value + bit + t.move(1) + for _ in range(3): + t.move(-1) + need(value < 7, "unused virtual codeword") + return value + + def write(self, value): + need(type(value) is int and 0 <= value < 7, "virtual alphabet") + for shift in (2, 1, 0): + emit(self.tape, (value >> shift) & 1) + for _ in range(3): + self.tape.move(-1) + + def move(self, direction): + need(direction in (-1, 1), "virtual unit move") + t = self.tape + if direction == 1: + if t.read() == BLANK: + self.write(4) + for _ in range(3): + t.move(1) + else: + t.move(-1) + if t.read() == LEFT: + t.move(1) + raise ValueError("native routine crossed its local origin") + t.move(-1) + t.move(-1) + + +class BinaryContextPort: + """Read-only raw binary descriptor, with its own physical alphabet. + + Unlike CodedPort, read returns physical BLANK=6 at the frontier. A table + may inspect that frontier but cannot pass it or the current LEFT marker. + This supplies runtime e/f/K/rho data through counted local operations. + """ + __slots__ = ("tape",) + + def __init__(self, tape): + self.tape = tape + + def read(self): + symbol = self.tape.read() + need(symbol in (ZERO, ONE, BLANK), "binary context alphabet") + return symbol + + def write(self, value): + raise ValueError("native context is read-only") + + def move(self, direction): + need(direction in (-1, 1), "binary context unit move") + t = self.tape + if direction == 1: + need(t.read() in (ZERO, ONE), "context frontier cannot be crossed") + t.move(1) + else: + t.move(-1) + if t.read() == LEFT: + t.move(1) + raise ValueError("native context crossed its local origin") + + +def read_code(tape): + """Consume a numeric-format code; physical frontier returns None.""" + if tape.read() == BLANK: + return None + value = 0 + for _ in range(3): + bit = tape.read() + need(bit in (ZERO, ONE), "numeric codeword") + value = 2 * value + bit + tape.move(1) + need(value < 7, "unused numeric codeword") + return value + + +def write_code(tape, value): + for shift in (2, 1, 0): + emit(tape, (value >> shift) & 1) + + +def initialize(target, shape): + """Dispose of arbitrary old bytes, then zero the complete common format.""" + need(target is not shape, "private initialization cannot destroy its guide") + retire(target) + origin(shape) + in_component = False + while (symbol := read_code(shape)) is not None: + need(symbol in (ZERO, ONE, COMPONENT), "canonical signed components") + if symbol == COMPONENT: + need(in_component, "positive component width") + write_code(target, COMPONENT) + in_component = False + else: + write_code(target, ZERO) + in_component = True + need(not in_component, "component terminator") + origin(shape) + origin(target) + + +def copy_as_add(target, source): + """Signed addition into the actual destination, including any residue. + + Components are little-endian two's complement followed by COMPONENT. + Carries reset at delimiters; equal-sign signed overflow rejects. + No ideal-zero test or exact-value overwrite substitutes for addition. + """ + need(target is not source, "distinct COPY/ADD ports") + origin(source) + origin(target) + carry = 0 + last_a = last_b = last_out = 0 + in_component = False + while True: + a = read_code(source) + b = read_code(target) + need((a is None) == (b is None), "same complete numerical extent") + if a is None: + need(not in_component, "complete signed component") + break + need(a in (ZERO, ONE, COMPONENT) and b in (ZERO, ONE, COMPONENT), + "canonical signed addition operands") + need((a == COMPONENT) == (b == COMPONENT), "same component boundaries") + if a == COMPONENT: + need(in_component, "positive signed component width") + need(last_a != last_b or last_out == last_a, "signed addition overflow") + carry = 0 + in_component = False + continue + value = a + b + carry + last_a, last_b, last_out = a, b, value & 1 + carry = value >> 1 + for _ in range(3): + target.move(-1) + write_code(target, last_out) + in_component = True + origin(source) + origin(target) + + +def execute_table(table, ports, readonly_context=()): + """Run a supplied finite native table with every port confined. + + These tables retain explicit semantics/time/space premises. Fixture + tables are not advertised as Gaussian implementations. + """ + views = (tuple(CodedPort(t) for t in ports) + + tuple(BinaryContextPort(t) for t in readonly_context)) + pc = 0 + while True: + row = table[pc] + op = row[0] + if op == "halt": + break + if op == "reject": + raise ValueError(row[1]) + if op == "goto": + pc = row[1] + continue + view = views[row[1]] + if op == "branch": + pc = dict(row[2]).get(view.read(), row[3]) + continue + if op == "write": + view.write(row[2]) + elif op == "move": + view.move(row[2]) + else: + raise ValueError("native table opcode") + pc += 1 + for tape in tuple(ports)+tuple(readonly_context): + origin(tape) + + +@dataclass(frozen=True) +class Instruction: + op: str + ports: tuple = () + token: tuple = () + + +class Controller: + """Fixed finite controller of a fixed flat compiled template. + + rows implements the separately priced row/shape interface; all its + dynamic state belongs on the supplied tapes. services contains fixed + finite transition tables. Payload ports include metadata and all scratch. + The only runtime continuation is the physical Stack. + """ + def __init__(self, program, public_count, payloads, control, descriptor, + bridge, child_header, rows, services, stack_class, protected_ports=(), + primitive_work=(), primitive_context=()): + self.program = tuple(program) + self.public_count = public_count + self.payloads = tuple(payloads) + self.control = control + self.descriptor = descriptor + self.bridge = bridge + self.child_header = child_header + self.rows = rows + self.services = services + need(len({id(t) for t in self.payloads+(control,descriptor,bridge,child_header)}) + == len(self.payloads)+4, "all physical ports distinct") + self.stack = stack_class(self.payloads, control, descriptor) + self.protected_ports = tuple(protected_ports) + owned = {e.ports[0] for e in self.program if e.op == "INIT"} + need(all(public_count <= i < len(self.payloads) for i in owned), "INIT only private physical slots") + need(owned.isdisjoint(self.protected_ports), "owned fields cannot be borrowed descriptors") + self.root_cleanup = tuple(i for i in range(public_count,len(self.payloads)) + if i not in self.protected_ports) + self.primitive_work = tuple(primitive_work) + self.primitive_context = tuple(primitive_context) + data_ports = {i for e in self.program for i in e.ports} + need(all(0 <= i < len(self.payloads) for i in data_ports), "compiled port range") + need(all(i >= public_count and i < len(self.payloads) and i not in data_ports + and i not in self.protected_ports for i in self.primitive_work), "separate primitive scratch") + need(len(set(self.primitive_work)) == len(self.primitive_work), "distinct primitive work ports") + need(len(set(self.primitive_context)) == len(self.primitive_context) + and all(i in self.protected_ports and 0 <= i < len(self.payloads) + and i not in data_ports for i in self.primitive_context), "borrowed binary context ports") + self.pc_bits = max(1, (len(self.program) - 1).bit_length()) + self.pc_words = tuple(tuple((pc >> j) & 1 for j in range(self.pc_bits)) + for pc in range(len(self.program))) + need(self.program and self.program[-1].op == "RET", "finite completed program") + + def save_pc(self, pc): + need(self.descriptor.read() == BLANK, "empty active PC descriptor") + for bit in self.pc_words[pc]: + emit(self.descriptor, bit) + origin(self.descriptor, BASE) + + def consume_pc(self): + pc = 0 + for shift in range(self.pc_bits): + bit = self.descriptor.read() + need(bit in (ZERO, ONE), "binary return PC") + pc |= bit << shift + emit(self.descriptor, BLANK) + need(self.descriptor.read() == BLANK, "exact fixed return PC width") + origin(self.descriptor, BASE) + need(pc < len(self.program) and pc > 0 and self.program[pc-1].op == "PAID", + "return PC designates a paid continuation") + return pc + + def has_parent(self): + self.control.move(-1) + symbol = self.control.read() + self.control.move(1) + need(symbol in (BASE, END), "complete continuation top") + return symbol == END + + def descend(self, pc): + event = self.program[pc] + source = self.payloads[event.ports[0]] + transfer(source, self.bridge, target_marker=BASE) + self.rows.prepare(event.token, self.child_header) + self.save_pc(pc + 1) + self.stack.push((True,) * len(self.payloads)) + self.rows.install(self.bridge, self.child_header, + self.payloads[:self.public_count]) + retire(self.bridge, BASE) + retire(self.child_header, BASE) + + def primitive(self, token, fields): + for i in self.primitive_work: + retire(self.payloads[i]) + execute_table(self.services[token], + tuple(self.payloads[i] for i in fields+self.primitive_work), + tuple(self.payloads[i] for i in self.primitive_context)) + for i in self.primitive_work: + retire(self.payloads[i]) + + def ascend(self): + self.rows.collect(self.payloads[:self.public_count], self.bridge) + for tape in self.payloads: + retire(tape) + self.stack.pop() # ignore observer sizes and heads + pc = self.consume_pc() + target = self.payloads[self.program[pc-1].ports[0]] + retire(target) + transfer(self.bridge, target, source_marker=BASE) + retire(self.bridge, BASE) + return pc + + def run(self, observe=None): + pc = 0 + while True: + event = self.program[pc] + if observe is not None: + observe("before", pc, event) # checker only; ignores return value + if event.op == "INIT": + initialize(self.payloads[event.ports[0]], self.payloads[0]) + pc += 1 + elif event.op == "CLEAR": + retire(self.payloads[event.ports[0]]) + pc += 1 + elif event.op == "COPY": + copy_as_add(self.payloads[event.ports[0]], self.payloads[event.ports[1]]) + pc += 1 + elif event.op == "SERVICE": + self.primitive(event.token,event.ports) + pc += 1 + elif event.op == "PAID": + if self.rows.is_leaf(event.token): + self.primitive(("leaf",)+event.token,event.ports) + pc += 1 + else: + self.descend(pc) + pc = 0 + elif event.op == "RET": + if not self.has_parent(): + for i in self.root_cleanup: + retire(self.payloads[i]) + break + pc = self.ascend() + else: + raise ValueError("compiled opcode") + if observe is not None: + observe("after", pc, event) + + +def boundary_actions(q, b, parent_total, child_total, input_length, + output_length, staged_header_length): + """Exact descend+ascend actions, excluding the three row-service calls. + + Also excludes caller leaf/top tests. All heads are at local origins. + Includes PC, all retirement, occupied-target replacement and both relays. + """ + return (4 * parent_total + 5 * child_total + 18 * input_length + + 13 * output_length + 5 * staged_header_length + + 38 * q + 27 * b + 103) diff --git a/research/selected-move-packed-codec/inputs/old-coded-move-contract.md b/research/selected-move-packed-codec/inputs/old-coded-move-contract.md new file mode 100644 index 0000000000..4303bc7de8 --- /dev/null +++ b/research/selected-move-packed-codec/inputs/old-coded-move-contract.md @@ -0,0 +1,399 @@ +# Protected composition of the current raw MOVE 9896 + +Prepared for **@CubeJerry**, with substantial OpenAI assistance. Apache-2.0. +This is a source-level fixed-control composition theorem under the stated +service premises. No new kappa or complete selected-assumption admission. + +## 1. Exact object and novelty + +The canonical base is `7c49fe32c55de02c2c873655c804b16e4c3fef0a`. +The selected #6030 word has raw event 9896 +`["MOVE",236,3,7,false]`. The unchanged lifecycle lowering emits consecutively + +1. `SERVICE`, owner 236, token `("move-in","local",9896,raw)`; +2. positive `PAID`, rank 1, owner 236, token `("local",9896,raw)`; +3. `SERVICE`, owner 236, token `("move-out","local",9896,raw)`. + +The source representation has native rank nine. The canonical transition from +frame 3 to frame 7 lowers as `M_right`, positive C on coordinate zero, then +`M_left`. The full record's canonical SHA-256 is +`0fb29a9ddca346f0b17d11f720d80607a0a64859d75afb50e9680be7a4647ac4`. +The positive middle matrix is exactly + + C = 1/2 [[1+i, 1-i], [1-i, 1+i]]. + +The two implemented source services are independently published at: + +- current monomial: CubeJerry commit + `7d1ff23714e6f9182c1d0ff9214f65def2f30e04`, + `research/current-coded-gaussian-monomial`; +- current positive leaf: CubeJerry commit + `61edc4fe348f0aeadc82a3b642a802cbfb03aed8`, + `research/current-coded-gaussian-leaf`. + +The monomial depends on unchanged #3087; the leaf depends on unchanged #3091. +Their shared current codec/header/lifecycle export is the published +`5629e7772d1720d6727465e328a45694f8620538` binding. Computational bytes are +retained unchanged. `move_sources.py` shares only discovery so every factor +uses the same actual Count, Tape, codec and header classes. The thin leaf +discovery object supplies the same objects its provider previously received; +it changes no arithmetic, layout, scratch, error or cleanup body. + +This package adds the complete current-coded **raw-source occurrence join** +and a protected whole-occurrence commit. Neither predecessor supplied the +three-factor physical join. A leaf-local failure guarantee alone is insufficient: +the entrance monomial may already have changed the original input before the +leaf rejects. Our one extra complete field protects that earlier state. + +The phase identity and all-width convention belong to #3087/#6293, and the +primary event's phase inspection to #6930. The source circuit identity and +Clifford lowering are inherited. #6532 concerns unbiased stochastic rounding +of this same event, a different operation and numerical contract. + +## 2. Quantified current interface and retained premises + +Fix the source triple and two completed ordinary supplier instances before +runtime input varies. They must satisfy the monomial predecessor's exact +ordinary interface, source access, return, erasure and backing contracts. +Their complete bills are retained below; constructing an object of the right +class or replaying its elementary branch does not admit a faster supplier. + +Supply one complete `CodedPort` field for actual owner 236 and one read-only +`BinaryContextPort` with the unchanged twenty-three-field schema. Let Q_R +and Q_L be the inventories of those two constructed monomial providers. +Supply Q=1+Q_R+349+Q_L fixed private physical ports with genuinely disjoint +segments. The exercised binary ordinary template with register capacity 64 +has Q_R=Q_L=1878 and Q=4106; changing the compiled ordinary inventory changes +these constants. All public, +descriptor and private heads start at their local origins. Every private body, +including the extra staging field, starts physically blank, with its local +LEFT marker already provided by the caller's charged allocation contract. +Ancestors before these markers are protected. Object-identity tests reject +obvious aliases; actual disjointness of different wrappers remains a premise. + +Use the monomial notation + + a = within_bits, u = active_start, z = back_start, + C_rows = outer*rows, n=f-1, t=nG. + +The exact common geometry is + + outer, rows, f, K, G, H > 0, 0 <= rho < K, + t <= H, 2H <= u, u+9fK <= z, z+H <= a, + selected_axes=9f+remainder <= d, 0 <= remainder < 9, + cutoff > 0, f <= cutoff. + +Positions are already normalized within-row positions counted from the left. +This package does not establish them from an enclosing caller's global prefix. +It accepts the exact raw `current_local` tokens above. The different nested +tokens emitted by `source_ir.remap` are rejected, rather than guessed at. + +Each record contains r>=1 complex coefficients. Each real/imaginary component +has h>=2 least-significant-first two's-complement bits and delimiter 2. Each +virtual symbol is represented by the current three-bit code. Consequently + + b=record_bits=6r(h+1), row_bits=2^a b, V=C_rows*2^a*b. + +The field has precisely V physical data bits followed by the physical blank +frontier. All components share one caller-supplied quantum. Header values, +width h, coefficient ordering and quantum remain unchanged across the factors. +The root common-grid theorem, actual producer conditions such as H=dG and +K=128G, placement services, suspended-owner stack and complete caller are +separate premises when this local service is used there. + +The numerical admission domain requires every phase negation selected by the +two monomials to fit the signed h-bit component and every complete C pair +division and intermediate result to be exact and signed-representable. Final +output representability by itself does not imply this domain. These are the +inherited arithmetic guards; this wrapper does not round or repair a failure. + +A sufficient, conservative common-grid condition is that every input integer +component is divisible by 2^f and has absolute value strictly below +2^(h-f-1). A monomial preserves the component bound and divisibility. Each C +stage uses four signed summands divided by two, so it doubles the component +bound at most and spends one binary divisibility bit. After k stages the +components remain divisible by 2^(f-k) and bounded by 2^k times the initial +bound. All f stages and both monomials therefore fit strictly inside signed +range. The exact guard domain is larger; the finite fixture uses that larger +domain and is checked pair by pair by the actual kernel. + +## 3. Complete-coordinate algebra and current geometry + +For each j in 0,...,f-1, its rank-nine column consists of current address bits + + p_(i,j) = u+(if+j)K+rho, 0<=i<9. + +The monomial predecessor applies the source affine map and its Gaussian phase +independently to every such column. Its old low-bit residue is K-1-rho. +Its folded suffix comprises complete original coefficient fibres; no original +coefficient, delimiter, spectator, row or outer-row label is omitted. + +The leaf receives the **same unchanged descriptor**. Its selected interval is +the first fK-bit vector interval beginning at u. It acts at +u+jK+rho, precisely p_(0,j). Every other address bit, including all other eight +vector intervals and the front/back reservations, is a complete spectator. +The leaf visits these disjoint factors in reversed column order after the +low-bit conversion; they commute. It therefore implements C on coordinate +zero in every rank-nine column, with the exact positive normalization above. + +Let U be the authenticated original frame transition. The source lowering gives + + U = M_left (C tensor I_8) M_right. + +Tensor functoriality on the f disjoint selected columns now gives + + M_left^[f] C_0^[f] M_right^[f] = U^(tensor f). + +This is an equality of linear maps on the complete 9f selected factor, +tensored with identity on every spectator; hence it holds on dirty, +correlated and entangled input coefficients as well. No input independence is +needed for the numerical equality. Both monomials already repeat their +constant phase per column. In particular the right constant 1 contributes +i^f, not one factor i independent of f. C's half denominator and absolute +phase are retained. No projective-phase identification is used. + +## 4. Protected execution and named failure return + +`AtomicMove.bind` partitions the fixed private inventory into the one raw +staging port and disjoint complete entrance, leaf and exit cohorts. Each +provider sees the staging port as its current field; it never receives the +public original. Its own work roles are distinct from that field and the +descriptor, as required by its predecessor. The three provider inventories +are not reused as if erased backing were free capacity. + +The executed sequence is: + +1. Use the retained administrative `transfer` to copy all V physical data + bits into the initially blank stage and restore both heads. +2. Run the right monomial, the positive leaf, then the left monomial on that + complete stage and the same read-only descriptor. +3. Only after all three return successfully, copy all stage bits back over + the same-length public field. Restore the public and stage heads. +4. Physically retire every stage byte, restoring its head. Each factor has + already retired every byte in its own complete private cohort. + +Administrative copying preserves encoded zeros and delimiters literally; +it is not a free arithmetic COPY and is fully charged in section 5. Runtime +control reads only physical symbols and moves one cell at a time. It does not +inspect a host address, extent, payload array or decoded numerical value. + +On admitted input, induction over the three completed services gives the +endpoint of section 3, unchanged length/format/header, restored field/context +origins and clean completed private cohorts. This proves the conditions for +the commit loop: every source and target position contains a physical bit, +and their blank frontiers coincide. The final retirement erases the entire +protected copy including all physical codewords. + +For a named signed-phase or Gaussian parity/headroom rejection on otherwise +valid input, the failing provider preserves its entrance stage, restores its +field/context heads and cleans its own cohort. Earlier factors have already +returned and cleaned; later factors have not run. The public original has +not been written at all. The final retirement erases the stage at its returned +origin. The original complete public word, descriptor and every ancestor are +unchanged; every owned private body is blank and can be reused. A valid-format +f>cutoff rejection at the positive leaf has the same outer staging conclusion. + +This is the precise atomicity claim. A corrupted or truncated supposedly +successful result could make the late commit fail after writing a prefix; +hardware interruption can do likewise. Neither is a named inherited +arithmetic rejection, and arbitrary malformation/crash rollback is not claimed. +The protected-stage blankness and origin premises are necessary even before +the first transfer. + +## 5. Complete physical bill and retained backing + +Count one raw physical read, write or unit move as one action. On a contiguous +binary body of V bits at its origin, the retained functions give: + +| Administrative step | Physical actions | +|---|---:| +| Borrowed field to blank stage, with both heads restored | 8V+14 | +| Successful same-length commit, with both heads restored | 9V+14 | +| Stage retirement from its returned origin | 5V+7 | + +For example `origin` from displacement L>=0 costs 2L+3 actions. Transfer pays +its two starting origins, blank-target check, every source read/target write/ +unit move, and both terminal rewinds. The commit similarly pays both complete +rewinds and its two frontier checks. Retirement includes all encoded bytes. +Thus the new wrapper contributes exactly **22V+35** on successful return and +**13V+21** on the named rejection path after a factor restores the stage head. +These constants exclude the executed factor bills, not their shared-field +accesses. A direct independent arithmetic count and executable administrative +controls check the formulas. + +Let T_R,T_C,T_L be the complete current-physical bills of the three factor +providers, including their stage and descriptor accesses, format conversions, +source construction, setup, restoration, private cleanup and their native +children. The complete successful invoice is + + F_join + T_R + T_C + T_L + 22V+35. + +F_join is the positive fixed source/port preparation cost. A rejecting invoice +includes each actually executed complete factor bill and 13V+21. No unfinished +factor or failed scan is free. Each current factor already reads and charges +the full E-bit descriptor, including otherwise unused large metadata. + +For the leaf, + + T_C = F_C + O(fV+(E+1)^4+349), f<=cutoff. + +It is a direct positive leaf, with no ordinary call. For each monomial retain +its **entire** predecessor invoice. Write s=a-z-(f-1)G, a'=z+(f-1)G, +R=2hr*2^s, M=C_rows*2^a', v0=2^a'R, and +A=2+a'+ceil(log2(R+1)). If its affine word has g_E early and g_L late gates, +g=g_E+g_L and S=4g_E+12g_L, its old-symbol bill for f>1 is + + S * sum_(row=1)^C_rows T_B(v0,(f-1)G) + + O_9((g+1)*(Vraw+M*A^6) + +g*delta*M*A*(R+A)), + +where Vraw=C_rows*v0 and +delta=min(1,(f-1)*(2*2^(-G)+8*2^(G-K))). Apply the predecessor's fixed +whole-source codec factor, add O_9(V+(E+1)^4+Q), and its explicit +64*(Z+Q) retirement allowance for this call's reached extents. At f=1 the +ordinary and exceptional terms disappear; the complete affine, phase, +metadata, conversion and retirement work remains. The exact source census is + +| Factor | Early gates | Late gates | Total gates | Ordinary calls per row, f>1 | +|---|---:|---:|---:|---:| +| Right entrance | 5 | 6 | 11 | 92 | +| Left exit | 5 | 7 | 12 | 104 | + +Thus the two factors together retain 196 ordinary calls per outer-row when +f>1. At f=1 both counts are zero. Neither a finite fixture nor this join +strengthens the inherited ordinary exponent 99830289/100000000. + +For clarity, these are worst-case source bounds, separate from any measured +fixture. They can be written without asymptotic notation by retaining the +fixed positive constants from the predecessor proofs. For i in {R,L}, let +g_R=11, g_L=12, S_R=92, S_L=104. Choose fixed program constants c_old,i, +c_codec,i, c_wrap,i, c_reach,i that dominate the corresponding proved source, +codec, wrapper and reached-extent bounds. Their existence and independence of +all runtime parameters are inherited premises, not measured from the traces. +Define + + B_i = c_old,i*((g_i+1)*Vraw+M*A^6), f=1, + B_i = S_i*sum_rows T_B(v0,(f-1)G) + +c_old,i*((g_i+1)*(Vraw+M*A^6) + +g_i*delta*M*A*(R+A)), f>1, + B_C = c_old,C*f*Vraw, + U_i = F_i + c_codec,i*B_i + +c_wrap,i*(V+(E+1)^4+Q_i) + +64*(c_reach,i*(B_i+V+(E+1)^4+Q_i)+Q_i). + +Use the actual constructed Q_R,Q_L and Q_C=349, with the leaf's own fixed +constants for U_C. The exercised capacity-64 template has Q_R=Q_L=1878. +Each complete factor is bounded by its U_i. Hence a finite symbolic upper +bound for the successful whole service is + + F_join+U_R+U_C+U_L+22V+35. + +This states the complete inherited constant-dependent bound explicitly. It +does not claim an extracted numerical value for the predecessor program +constants or a supplied numerical ordinary-service ceiling. The literal +finite action counts below are exact observations on one input and are not +used as replacements for any of these worst-case bounds. + +The constructor-fixed inventory is 1+Q_R+349+Q_L private ports, equal to +4106 for the exercised capacity-64 binary template. The capacity-65 control +has Q_R=Q_L=1884 and 4118 total ports, so 4106 is not a universal constant for +every ordinary constructor. No per-input tape allocation is introduced. +Fresh occupied/ +backing bounds add the actual public field V and header E, the new V-bit +stage with constant frontier/origin allowance, and **both** monomial cohorts' +and the leaf cohort's source backing allowances. Summing the per-family +allowances is safe; taking only the largest active family would forget the +other families' retained blank allocations. After repeated calls, each role +is charged by its historical maximum reached extent. The new stage similarly +retains max_previous V plus its fixed origin/frontier allowance. Erasure +does not shrink backing. A smaller later call stops at its own fresh blank +frontier and pays only its current V; it does not rescan an older blank tail. + +## 6. Evidence, model limits and remaining work + +`check_move.py` independently evaluates the original source P/D/C circuit on +all 512 basis columns, covering all 262,144 matrix coefficient positions and +all absolute phases. It never computes the expected complete answer by +executing the lowered monomial/C/monomial recipe. The source's direct matrix +routine is a second comparison. The resulting sparse matrix has exactly +1,024 nonzero entries, each with the exact half denominator. +The literal monomial/positive-C/monomial map is then compared with this +independent original-source oracle on all 512 columns. Every zero and +nonzero position and absolute phase agrees. Four changed-phase, reversed-C, +wrong-axis and omitted-exit controls are rejected by that complete matrix +comparison and separately by the full reference-packet comparison. + +The smallest permitted local fixture still has 4,096 original records: +H>=1, f,K>=1, u>=2H, z>=u+9fK and a>=z+H imply a>=12. The proposed +512/1024-record fixtures would violate the published adapter's reservation +guards and were rejected as a test design, not reported as reductions. +H=G=K=1 is a reduced **local** descriptor; it is not the actual producer's +H=dG, K=128G allocation. Even a complete successful local packet would not +execute that enclosing caller. + +Exact completed finite evidence and interrupted attempts are recorded in +`VERIFICATION.md` and generated receipts. An interrupted run is not a +completed whole-MOVE witness. Any bounded factor-wise evidence is labelled +sliced execution and joined by exact intermediate bytes; it is not described +as a completed uninterrupted process. The all-width theorem above instead +uses the explicit predecessor contracts and current interface join. + +The actual physical evidence in this package is **partial**: the complete +4,096-record entrance and leaf slices passed, as did a separately seeded +reachable final-pair leaf rejection. The exit slice timed out with no +complete receipt. Therefore no complete three-factor sliced witness and no +uninterrupted whole-MOVE receipt is claimed. The exact original-source matrix +factorization and reviewed predecessor-contract composition establish the +scoped mathematical statement independently of that unfinished finite run. + +The sliced join has a state equivalence stronger than matching payload +hashes. The returned stage and unchanged descriptor are compared byte for +byte with the complete next-slice inputs, with their heads at their origins. +The original public field and every protected ancestor agree. Completed +providers have closed engines, empty live-role pools and completely blank +private bodies, with every private head at its origin. The next provider's +cohort and finite control are still unused at the actual composite boundary, +so they agree with its fresh slice state. Earlier completed providers may +retain different diagnostic call counters and historical highwater values; +their disjoint roles are never read again by this invocation. These values +are observations, not numerical inputs or runtime control read by a later +provider. Reinsert their blank retained tails into the fresh slice state: +the later sequence of literal actions and numerical result is unchanged. +The corresponding backing invoice is the componentwise maximum extent of +each fixed role over all compatible slices, then the sum over roles. Taking +the maximum total slice size would omit other cohorts' retained backing. + +The recorded arrays measure materialized cells, not the largest head position +ever visited: a unit move can traverse an implicit blank without extending +the array. The receipt therefore gives separately the exact rolewise union +of materialized extents and a conservative upper bound on all visited cells. +Start from the fixed local origins, one blank private body cell per role, +and the complete public/header regions with a frontier cell. Each additional +visited cell requires at least one literal unit move, and hence at least one +action. Adding the complete joined action count to those initial regions +is a valid, deliberately loose visited-backing upper bound. No asymptotic +space improvement is inferred from it; the predecessor's per-role source +backing proof remains the size-dependent bound used in section 5. + +`physical_hardware.py` changes only Python observation overhead. Its legal +read, write and unit-move definitions have the same state transition and +counter increments as the retained primitive hardware, as can be inspected +directly. The 30,000-command comparison is finite regression evidence for +those literal definitions; it is not a new implementation theorem, bulk tape +operation or algorithmic time improvement. + +The controller remains a source-level structured finite-control refinement. +No literal `Controller.execute_table` export is supplied. Enclosing caller +token normalization, live placement/stock, the producer's common-grid proof, +full ordinary tariff, nonleaf recursion, analytic recovery and complete +selected multiplication admission remain open. All five selected assumptions +and the selected certificate are unchanged. No new kappa follows. + +## Open next questions + +1. Bind the real nested caller token and its normalized descriptor to this + source triple, including the suspended owner and complete placement bill. +2. Export the complete protected join and its numerical factors into literal + lifecycle tables with the same error and head-return interface. +3. Admit the completed ordinary supplier and nonleaf positive child at the + current full recurrence, retaining all format, stock and precision costs. diff --git a/research/selected-move-packed-codec/inputs/old-header-provider.py b/research/selected-move-packed-codec/inputs/old-header-provider.py new file mode 100644 index 0000000000..481013b988 --- /dev/null +++ b/research/selected-move-packed-codec/inputs/old-header-provider.py @@ -0,0 +1,189 @@ +"""Current descriptor to retained Compact: a structured finite-control service. + +This is an executable source-level refinement, not an emitted A transition +table. It accepts precisely A's numeric/context port views and fixed blank +work ports. Runtime numerical values remain in Count tapes throughout. +Prepared for @CubeJerry with substantial OpenAI assistance. Apache-2.0. +""" +from contextlib import ExitStack +from binding_sources import need +from codec import S,A,Cohort,collect_tapes,execution +from cardinal_counts import Count,positive +from compact_counts import power_two,copy_bits,append_bits +from compact_layout import Layout +from compact_streams import digit_permutation +from encoded import compare,subtract +from records import Tape +from stream import Counter +from session import OuterScope,borrowed_count,borrowed_tape,erase_marker,sealed_constructors +from scratch_pool import ScratchPool + +SCHEMA=('outer','rows','stock','row_bits','within_bits','record_bits','p','d','K','G','H', + 'q0','qF','qB','D','f','rho','active_start','back_start','selected_axes', + 'entry_start','remainder','cutoff') +NAMES=('u','u_rest','t','t_rest','before','x','middle','y','after','b') + +def scale(value,constant): + need(type(constant) is int and constant>=0,'compiled nonnegative multiplier') + if constant==0:return Count.literal(0) + out=Count(value) + if constant>1:out.multiply_small(constant) + return out + +class Provider: + def __init__(self,rank,source_block,target_block,native_factory): + need(type(rank) is int and rank>=2,'fixed compiled rank') + need(0<=source_blocktarget_block + # native_factory constructs a fixed precompiled Ordinary supplier. + # It receives no runtime parameter or payload and is never called again. + with collect_tapes() as tapes: + native=native_factory() + need(type(native) is S.ordinary.Ordinary and native.observe is None + and native.runtime.observe is None,'unchanged ordinary engine without payload callbacks') + self.engine=S.engine.CompactEngine(NAMES,'y' if self.late else 'x', + 'x' if self.late else 'y',self.late,native) + self.pool=ScratchPool(160);self.scope=OuterScope(self.pool) + self.bridge,self.field_guide,self.header_guide,self.length_guide=(Tape() for _ in range(4)) + self.cohort=Cohort(tapes,native) + self.observed_calls=0 + + @property + def port_count(self):return self.cohort.port_count + + def bind(self,work):self.cohort.bind(work) + + def read_header(self,context): + result={} + def advance(): + self.header_guide.append(1);context.move(1) + for name in SCHEMA: + self.length_guide.rewind() + while context.read()==1: + self.length_guide.append(1);advance() + need(context.read()==0,'self-delimiting current header length');advance() + self.length_guide.rewind() + value=object.__new__(Count);value.tape=self.pool.acquire() + any_digit=multiple=False;last=0 + while self.length_guide.read()!=4: + need(self.length_guide.read()==1,'unary current header length') + bit=context.read();need(bit in (0,1),'binary current header digit') + multiple=multiple or any_digit;any_digit=True;last=bit + value.tape.append(bit);advance();self.length_guide.step(1) + need(any_digit and (last==1 or not multiple),'canonical LSF current header value') + value.tape.append(3);value.rewind();result[name]=value + self.length_guide.clear() + need(context.read()==6,'exact current header frontier') + self.header_guide.rewind() + while self.header_guide.read()!=4: + context.move(-1);self.header_guide.step(1) + self.header_guide.clear() + return result + + def prepare(self,header,cleanup): + def own(x):cleanup.callback(x.close);return x + for key in ('outer','rows','row_bits','record_bits','f','K','G','H'): + positive(header[key]) + one=own(Count.literal(1));twoH=own(scale(header['H'],2)) + need(compare(header['rho'],header['K'])<0,'selected offset inside one chunk') + n=own(subtract(header['f'],one)) + compact=own(Count.product(n,header['G'])) + rest=own(subtract(header['H'],compact)) + chunk=own(Count.product(header['f'],header['K'])) + left=own(scale(chunk,min(self.source_block,self.target_block))) + right=own(scale(chunk,max(self.source_block,self.target_block))) + left.add(header['active_start']);right.add(header['active_start']) + before=own(subtract(left,twoH)) + difference=own(subtract(right,left));middle=own(subtract(difference,chunk)) + right_end=own(Count(right));right_end.add(chunk) + after=own(subtract(header['back_start'],right_end)) + tail=own(subtract(header['within_bits'],header['back_start'])) + suffix=own(subtract(tail,compact)) + # The full reserved back field exists, including its unused suffix. + need(compare(tail,header['H'])>=0,'complete root back reservation') + reduced=own(subtract(header['K'],one));rho=own(subtract(reduced,header['rho'])) + fibre=own(power_two(suffix));record=own(Count.product(fibre,header['record_bits'])) + rows=own(Count.product(header['outer'],header['rows'])) + full=own(power_two(header['within_bits']));expected=own(Count.product(full,header['record_bits'])) + need(compare(expected,header['row_bits'])==0,'exact complete physical row length') + active=own(scale(header['f'],self.rank));active.add(header['remainder']) + need(compare(active,header['selected_axes'])==0,'current f/remainder geometry') + rank=own(Count.literal(self.rank)) + need(compare(header['remainder'],rank)<0,'ordinary remainder below fixed rank') + need(compare(header['selected_axes'],header['d'])<=0,'ordinary width within root budget') + active_end=own(scale(chunk,self.rank));active_end.add(header['active_start']) + need(compare(active_end,header['back_start'])<=0,'complete active block list precedes back field') + widths=(compact,rest,compact,rest,before,chunk,middle,chunk,after,compact) + return widths,n,rho,record,rows + + def import_field(self,field): + while (symbol:=field.read())!=4: + need(symbol in (0,1,2),'complete canonical numerical field') + for shift in (2,1,0):self.bridge.append((symbol>>shift)&1) + self.field_guide.append(1);field.move(1) + self.bridge.rewind();self.field_guide.rewind() + while self.field_guide.read()!=4: + field.move(-1);self.field_guide.step(1) + self.field_guide.rewind() + + def export_field(self,field,output): + output.rewind();self.field_guide.rewind() + while self.field_guide.read()!=4: + value=0 + for _ in range(3): + bit=output.read();need(bit in (0,1),'complete returned physical codeword') + value=2*value+bit;output.step(1) + need(value in (0,1,2),'returned complete numerical record format') + need(field.read() in (0,1,2),'returned field has original exact extent') + field.write(value);field.move(1);self.field_guide.step(1) + need(output.read()==4 and field.read()==4,'exact full-field return frontier') + self.field_guide.rewind() + while self.field_guide.read()!=4: + field.move(-1);self.field_guide.step(1) + self.field_guide.clear();output.rewind() + + def single(self,widths,rho,record,rows): + """f=1: the actual retained four-bucket bit gate, with no n>0 guard.""" + e=self.engine;e.rearm();source=borrowed_tape(self.bridge) + with sealed_constructors(),e.scope.installed(),ExitStack() as cleanup: + plan=Layout(NAMES,widths,record);cleanup.callback(plan.close) + remaining=Counter(rows);cleanup.callback(remaining.close) + source_bit=plan.bit_position(e.source,rho);cleanup.callback(source_bit.close) + target_bit=plan.bit_position(e.target,rho);cleanup.callback(target_bit.close) + early=compare(source_bit,target_bit)<0 + first,second=(source_bit,target_bit) if early else (target_bit,source_bit) + mapping=(0,1,3,2) if early else (0,3,2,1) + while not remaining.finished: + current=e.pool.acquire() + copy_bits(source,current,plan.row_bits);current.rewind() + following=digit_permutation(current,plan,first,second,mapping,e.pool.acquire) + append_bits(following,e.output);following.clear();remaining.decrement() + e.calls['rows']+=1 + need(source.read()==4,'complete f=1 outer-row packet');source.rewind() + e.pool.empty() + for tape in e.pool.tapes:erase_marker(tape) + e.output.rewind();e.closed=True + return e.output + + def run(self,field,context): + """field=A.CodedPort, context=A.BinaryContextPort; both start at origin. + + The successful-input theorem leaves only field's exact output, context + unchanged, and every work port physically blank at its current origin. + No interrupted-service rollback contract is claimed. + """ + self.cohort.start() + with execution(),self.scope.installed(),ExitStack() as cleanup: + header=self.read_header(context) + for value in header.values():cleanup.callback(value.close) + widths,n,rho,record,rows=self.prepare(header,cleanup) + self.import_field(field) + with self.scope.suspended(): + returned=(self.single(widths,rho,record,rows) if n.zero() else + self.engine.run(self.bridge,widths,n,header['K'],header['G'],rho,record,rows)) + self.export_field(field,returned) + returned.clear();erase_marker(returned);self.bridge.clear() + self.pool.empty() + self.cohort.finish();self.observed_calls+=1 diff --git a/research/selected-move-packed-codec/machine.py b/research/selected-move-packed-codec/machine.py new file mode 100644 index 0000000000..68701de074 --- /dev/null +++ b/research/selected-move-packed-codec/machine.py @@ -0,0 +1,328 @@ +"""Input-independent literal tape bridge. Prepared for @CubeJerry with OpenAI assistance. Apache-2.0.""" +from dataclasses import dataclass +from hashlib import sha256 +import json + +BLANK, LEFT = 2, 3 +SCHEMA = ('outer','rows','stock','row_bits','within_bits','record_bits','p','d', + 'K','G','H','q0','qF','qB','D','f','rho','active_start','back_start', + 'selected_axes','entry_start','remainder','cutoff') +NAMES = ('OLD','CONTEXT','PACK','GAMMA','OUT','ZERO','ONE','STAGE','COMP','BIN', + 'LEN','TMP','TMP2','CUTOFF','OUTER','ROWS','ROWCLAIM','A','REC','F','K', + 'RHO','U','W','DEN','R','R2','G','GK','END','KM1','CROWS','N','L', + 'ROWEXPECTED','BASEP','S','EXP','HALF','RUN','CHUNKS','PREFIX','ONECOUNT') +PORT = {name:i for i,name in enumerate(NAMES)} + + +class Builder: + def __init__(self): + self.code=[]; self.labels={}; self.serial=0 + def fresh(self,stem='q'): + self.serial+=1; return stem+str(self.serial) + def label(self,name): + if name in self.labels: raise ValueError('duplicate label') + self.labels[name]=len(self.code) + def r(self,t,branches): self.code.append(('R',PORT[t],branches)) + def w(self,t,v): self.code.append(('W',PORT[t],v)) + def m(self,t,d): self.code.append(('M',PORT[t],d)) + def j(self,q): self.code.append(('J',q)) + def halt(self,status): self.code.append(('H',status)) + def expect(self,t,v): + q=self.fresh(); self.r(t,{v:q}); self.label(q) + def rewind(self,t): + q=self.fresh(); done=self.fresh(); step=self.fresh() + self.m(t,-1); self.label(q); self.r(t,{LEFT:done,BLANK:step,0:step,1:step}) + self.label(step); self.m(t,-1); self.j(q); self.label(done); self.m(t,1) + def end(self,t): + q=self.fresh(); step=self.fresh(); done=self.fresh() + self.label(q); self.r(t,{0:step,1:step,BLANK:done}) + self.label(step); self.m(t,1); self.j(q); self.label(done) + def clear(self,t): + self.rewind(t); q=self.fresh(); step=self.fresh(); done=self.fresh() + self.label(q); self.r(t,{0:step,1:step,BLANK:done}) + self.label(step); self.w(t,BLANK); self.m(t,1); self.j(q) + self.label(done); self.rewind(t) + def append_one(self,t): + self.end(t); self.w(t,1); self.m(t,1); self.rewind(t) + def positive(self,t): self.expect(t,1) + def copy(self,src,dst,erase=False): + q=self.fresh(); done=self.fresh(); z=self.fresh(); o=self.fresh() + self.label(q); self.r(src,{0:z,1:o,BLANK:done}) + for bit,target in ((0,z),(1,o)): + self.label(target); self.w(dst,bit) + if erase:self.w(src,BLANK) + self.m(src,1); self.m(dst,1); self.j(q) + self.label(done) + def copy_reset(self,src,dst): + self.copy(src,dst); self.rewind(src) + def equal(self,x,y): + q=self.fresh(); step=self.fresh(); done=self.fresh() + self.label(q); self.r(x,{1:step,BLANK:done}) + self.label(step); self.expect(y,1); self.m(x,1); self.m(y,1); self.j(q) + self.label(done); self.expect(y,BLANK); self.rewind(x); self.rewind(y) + def less(self,x,y,strict=False): + q=self.fresh(); step=self.fresh(); done=self.fresh() + self.label(q); self.r(x,{1:step,BLANK:done}) + self.label(step); self.expect(y,1); self.m(x,1); self.m(y,1); self.j(q) + self.label(done) + if strict:self.expect(y,1) + self.rewind(x); self.rewind(y) + def sub(self,x,y,z): + q=self.fresh(); step=self.fresh(); done=self.fresh() + self.label(q); self.r(y,{1:step,BLANK:done}) + self.label(step); self.expect(x,1); self.m(x,1); self.m(y,1); self.j(q) + self.label(done); self.copy(x,z); self.rewind(x); self.rewind(y); self.rewind(z) + def sum(self,x,y,z): + self.copy_reset(x,z); self.copy_reset(y,z); self.rewind(z) + def multiply(self,x,y,z): + q=self.fresh(); step=self.fresh(); done=self.fresh() + self.label(q); self.r(y,{1:step,BLANK:done}) + self.label(step); self.copy_reset(x,z); self.m(y,1); self.j(q) + self.label(done); self.rewind(y); self.rewind(z) + def scale(self,x,k,z): + for _ in range(k):self.copy_reset(x,z) + self.rewind(z) + def double(self,x): + self.copy_reset(x,'TMP'); self.rewind('TMP'); self.end(x) + self.copy_reset('TMP',x); self.clear('TMP'); self.rewind(x) + def halve(self,x): + q=self.fresh(); step=self.fresh(); done=self.fresh() + self.label(q); self.r(x,{1:step,BLANK:done}) + self.label(step); self.m(x,1); self.expect(x,1); self.m(x,1) + self.w('TMP',1); self.m('TMP',1); self.j(q) + self.label(done); self.clear(x); self.rewind('TMP') + self.copy('TMP',x,erase=True); self.rewind('TMP'); self.rewind(x) + def repeat_shift(self,x,n,up=True): + q=self.fresh(); step=self.fresh(); done=self.fresh() + self.label(q); self.r(n,{1:step,BLANK:done}); self.label(step) + (self.double if up else self.halve)(x) + self.m(n,1); self.j(q); self.label(done); self.rewind(n) + def unary(self,binary,target): + self.end(binary); self.m(binary,-1) + q=self.fresh(); z=self.fresh(); o=self.fresh(); done=self.fresh(); common=self.fresh() + self.label(q); self.r(binary,{0:z,1:o,LEFT:done}) + self.label(z); self.double(target); self.j(common) + self.label(o); self.double(target); self.append_one(target) + self.label(common); self.m(binary,-1); self.j(q) + self.label(done); self.m(binary,1) + def binary(self,unary,target='BIN'): + q=self.fresh(); step=self.fresh(); done=self.fresh() + carry=self.fresh(); zero=self.fresh(); one=self.fresh(); incremented=self.fresh() + self.label(q); self.r(unary,{1:step,BLANK:done}); self.label(step) + self.label(carry); self.r(target,{0:zero,BLANK:zero,1:one}) + self.label(one); self.w(target,0); self.m(target,1); self.j(carry) + self.label(zero); self.w(target,1); self.j(incremented) + self.label(incremented); self.rewind(target); self.m(unary,1); self.j(q) + self.label(done); self.rewind(unary) + def positive_binary(self,t): + self.end(t); self.m(t,-1); self.expect(t,1); self.rewind(t) + def gamma_binary(self,binary): + self.positive_binary(binary) + q=self.fresh(); step=self.fresh(); done=self.fresh() + self.label(q); self.r(binary,{0:step,1:step,BLANK:done}) + self.label(step); self.w('LEN',1); self.m('LEN',1); self.m(binary,1); self.j(q) + self.label(done); self.rewind('LEN'); self.m('LEN',1) + q=self.fresh(); step=self.fresh(); done=self.fresh() + self.label(q); self.r('LEN',{1:step,BLANK:done}) + self.label(step); self.w('GAMMA',0); self.m('GAMMA',1); self.m('LEN',1); self.j(q) + self.label(done); self.m(binary,-1) + q=self.fresh(); z=self.fresh(); o=self.fresh(); done=self.fresh() + self.label(q); self.r(binary,{0:z,1:o,LEFT:done}) + for bit,label in ((0,z),(1,o)): + self.label(label); self.w('GAMMA',bit); self.m('GAMMA',1); self.m(binary,-1); self.j(q) + self.label(done); self.m(binary,1); self.clear('LEN') + def gamma(self,unary): + self.binary(unary); self.gamma_binary('BIN'); self.clear('BIN') + def take(self,src,dst,guide,erase=False): + q=self.fresh(); step=self.fresh(); done=self.fresh(); z=self.fresh(); o=self.fresh() + self.label(q); self.r(guide,{1:step,BLANK:done}); self.label(step); self.r(src,{0:z,1:o}) + for bit,label in ((0,z),(1,o)): + self.label(label); self.w(dst,bit) + if erase:self.w(src,BLANK) + self.m(src,1); self.m(dst,1); self.m(guide,1); self.j(q) + self.label(done); self.rewind(guide) + def parse(self,target): + q=self.fresh(); step=self.fresh(); done=self.fresh() + self.label(q); self.r('CONTEXT',{1:step,0:done}) + self.label(step); self.w('LEN',1); self.m('LEN',1); self.m('CONTEXT',1); self.j(q) + self.label(done); self.m('CONTEXT',1); self.rewind('LEN'); self.positive('LEN') + self.take('CONTEXT','BIN','LEN'); self.m('BIN',-1) + good=self.fresh(); lastzero=self.fresh() + self.r('BIN',{1:good,0:lastzero}); self.label(lastzero) + self.m('BIN',-1); self.expect('BIN',LEFT); self.m('BIN',1); self.j(good) + self.label(good); self.rewind('BIN'); self.clear('LEN') + if target=='CUTOFF': + self.positive_binary('BIN'); self.copy_reset('BIN','CUTOFF'); self.rewind('CUTOFF') + elif target is not None:self.unary('BIN',target) + self.clear('BIN') + def codeword(self,zero,one,delimiter): + self.expect('OLD',0); self.m('OLD',1) + q0=self.fresh(); q1=self.fresh(); self.r('OLD',{0:q0,1:q1}) + self.label(q0); self.m('OLD',1) + z=self.fresh(); o=self.fresh(); self.r('OLD',{0:z,1:o}) + self.label(z); self.m('OLD',1); self.j(zero) + self.label(o); self.m('OLD',1); self.j(one) + self.label(q1); self.m('OLD',1); self.expect('OLD',0); self.m('OLD',1); self.j(delimiter) + def infer_width(self): + q=self.fresh(); bit=self.fresh(); done=self.fresh() + self.label(q); self.codeword(bit,bit,done) + self.label(bit); self.w('W',1); self.m('W',1); self.j(q) + self.label(done); self.rewind('W'); self.positive('W'); self.m('W',1) + self.positive('W'); self.rewind('W'); self.rewind('OLD') + def quotient(self,x,y,z): + q=self.fresh(); step=self.fresh(); inner=self.fresh(); take=self.fresh(); complete=self.fresh(); done=self.fresh() + self.label(q); self.r(x,{1:step,BLANK:done}); self.label(step) + self.label(inner); self.r(y,{1:take,BLANK:complete}) + self.label(take); self.expect(x,1); self.m(x,1); self.m(y,1); self.j(inner) + self.label(complete); self.w(z,1); self.m(z,1); self.rewind(y); self.j(q) + self.label(done); self.rewind(x); self.rewind(z); self.positive(z) + def decode(self): + outer=self.fresh(); record=self.fresh(); end=self.fresh(); comps=self.fresh(); component=self.fresh(); next_record=self.fresh() + self.label(outer); self.r('N',{1:record,BLANK:end}); self.label(record) + self.label(comps); self.r('R2',{1:component,BLANK:next_record}); self.label(component) + bits=self.fresh(); take=self.fresh(); delimiter=self.fresh(); z=self.fresh(); o=self.fresh(); wrong=self.fresh(); decoded=self.fresh() + self.label(bits); self.r('W',{1:take,BLANK:delimiter}); self.label(take) + self.codeword(z,o,wrong) + for bit,label in ((0,z),(1,o)): + self.label(label); self.w('COMP',bit); self.m('COMP',1); self.m('W',1); self.j(bits) + self.label(wrong); self.halt('REJECT') + self.label(delimiter); self.codeword(wrong,wrong,decoded); self.label(decoded) + self.reverse_component('COMP','PACK'); self.rewind('W'); self.m('R2',1); self.j(comps) + self.label(next_record); self.rewind('R2'); self.m('N',1); self.j(outer) + self.label(end); self.expect('OLD',BLANK); self.rewind('OLD'); self.rewind('N'); self.rewind('PACK') + def reverse_component(self,src,dst,coded=False): + self.m(src,-1); q=self.fresh(); z=self.fresh(); o=self.fresh(); done=self.fresh() + self.label(q); self.r(src,{0:z,1:o,LEFT:done}) + for bit,label in ((0,z),(1,o)): + self.label(label) + if coded: + self.w(dst,0); self.m(dst,1); self.w(dst,0); self.m(dst,1) + self.w(dst,bit); self.m(dst,1); self.w(src,BLANK); self.m(src,-1); self.j(q) + self.label(done); self.m(src,1) + if coded: + for bit in (0,1,0):self.w(dst,bit); self.m(dst,1) + def encode(self): + outer=self.fresh(); record=self.fresh(); end=self.fresh(); comps=self.fresh(); component=self.fresh(); next_record=self.fresh() + self.label(outer); self.r('N',{1:record,BLANK:end}); self.label(record) + self.label(comps); self.r('R2',{1:component,BLANK:next_record}); self.label(component) + self.take('PACK','COMP','W'); self.reverse_component('COMP','STAGE',coded=True) + self.m('R2',1); self.j(comps) + self.label(next_record); self.rewind('R2'); self.m('N',1); self.j(outer) + self.label(end); self.expect('PACK',BLANK); self.rewind('PACK'); self.rewind('N'); self.rewind('STAGE') + def partition(self,inverse=False): + outer=self.fresh(); block=self.fresh(); end=self.fresh(); inner=self.fresh(); run=self.fresh(); block_done=self.fresh() + self.label(outer); self.r('PREFIX',{1:block,BLANK:end}); self.label(block) + if inverse: + self.take('PACK','ZERO','HALF'); self.take('PACK','ONE','HALF'); self.rewind('ZERO'); self.rewind('ONE') + self.label(inner); self.r('CHUNKS',{1:run,BLANK:block_done}); self.label(run) + if inverse: + self.take('ZERO','OUT','RUN',erase=True); self.take('ONE','OUT','RUN',erase=True) + else: + self.take('PACK','ZERO','RUN'); self.take('PACK','ONE','RUN') + self.m('CHUNKS',1); self.j(inner); self.label(block_done); self.rewind('CHUNKS') + if not inverse: + self.rewind('ZERO'); self.rewind('ONE'); self.copy('ZERO','OUT',erase=True); self.copy('ONE','OUT',erase=True) + self.rewind('ZERO'); self.rewind('ONE'); self.m('PREFIX',1); self.j(outer) + self.label(end); self.expect('PACK',BLANK); self.clear('PACK'); self.rewind('OUT') + self.copy('OUT','PACK',erase=True); self.rewind('OUT'); self.rewind('PACK'); self.rewind('PREFIX') + def shuffle(self,inverse=False): + q=self.fresh(); step=self.fresh(); update=self.fresh(); done=self.fresh() + self.label(q); self.r('G',{1:step,BLANK:done}); self.label(step); self.partition(inverse) + self.m('G',1); self.r('G',{1:update,BLANK:done}); self.label(update) + if inverse: + self.halve('PREFIX'); self.double('HALF'); self.repeat_shift('RUN','K',True); self.repeat_shift('CHUNKS','KM1',False) + else: + self.double('PREFIX'); self.halve('HALF'); self.repeat_shift('RUN','K',False); self.repeat_shift('CHUNKS','KM1',True) + self.j(q); self.label(done); self.rewind('G') + def finish(self): + out=[] + for ins in self.code: + if ins[0]=='R':out.append(('R',ins[1],{s:self.labels[q] for s,q in ins[2].items()})) + elif ins[0]=='J':out.append(('J',self.labels[ins[1]])) + else:out.append(ins) + return tuple(out),dict(self.labels) + + +def compile_bridge(): + b=Builder(); b.label('ENTER') + kept={'outer':'OUTER','rows':'ROWS','row_bits':'ROWCLAIM','within_bits':'A', + 'record_bits':'REC','f':'F','K':'K','rho':'RHO','active_start':'U','cutoff':'CUTOFF'} + for name in SCHEMA:b.parse(kept.get(name)) + b.expect('CONTEXT',BLANK); b.rewind('CONTEXT') + for t in ('OUTER','ROWS','ROWCLAIM','REC','F','K'):b.positive(t) + b.w('ONECOUNT',1); b.scale('F',9,'G'); b.multiply('G','K','GK'); b.sum('U','GK','END'); b.less('END','A'); b.less('RHO','K',True) + b.sub('K','ONECOUNT','KM1'); b.infer_width() + b.sum('W','ONECOUNT','TMP2'); b.scale('TMP2',6,'DEN'); b.clear('TMP2'); b.quotient('REC','DEN','R'); b.scale('R',2,'R2') + b.copy_reset('REC','ROWEXPECTED'); b.rewind('ROWEXPECTED'); b.repeat_shift('ROWEXPECTED','A'); b.equal('ROWEXPECTED','ROWCLAIM') + b.multiply('OUTER','ROWS','CROWS'); b.copy_reset('CROWS','N'); b.rewind('N'); b.repeat_shift('N','A') + b.multiply('W','R2','L'); b.copy_reset('CROWS','BASEP'); b.rewind('BASEP'); b.repeat_shift('BASEP','U') + b.sub('A','U','TMP2'); b.sub('TMP2','G','EXP'); b.clear('TMP2'); b.w('S',1); b.repeat_shift('S','EXP'); b.clear('EXP') + b.copy_reset('BASEP','PREFIX'); b.rewind('PREFIX') + b.sub('A','U','TMP2'); b.sub('TMP2','ONECOUNT','EXP'); b.clear('TMP2') + b.copy_reset('L','HALF'); b.rewind('HALF'); b.repeat_shift('HALF','EXP'); b.clear('EXP') + b.copy_reset('HALF','RUN'); b.rewind('RUN'); b.repeat_shift('RUN','RHO',False) + b.w('CHUNKS',1); b.repeat_shift('CHUNKS','RHO') + for t in ('F','R','BASEP','S','W'):b.gamma(t) + b.gamma_binary('CUTOFF'); b.rewind('GAMMA') + b.decode(); b.shuffle(); b.halt('PACKED') + b.label('EXIT'); b.shuffle(inverse=True); b.encode() + q=b.fresh(); z=b.fresh(); o=b.fresh(); done=b.fresh() + b.label(q); b.r('STAGE',{0:z,1:o,BLANK:done}) + for bit,label in ((0,z),(1,o)): + b.label(label); valid=b.fresh(); b.r('OLD',{0:valid,1:valid}); b.label(valid) + b.w('OLD',bit); b.m('OLD',1); b.m('STAGE',1); b.j(q) + b.label(done); b.expect('OLD',BLANK); b.rewind('OLD'); b.rewind('STAGE') + for t in NAMES[2:]:b.clear(t) + b.halt('DONE'); return b.finish() + + +@dataclass +class Tape: + """Checker hardware; runtime only receives read/write/unit move.""" + cells:list + head:int=1 + high:int=1 + low:int=0 + reads:int=0 + writes:int=0 + moves:int=0 + @classmethod + def supplied(cls,bits=(),origin=1): + if origin<1:raise ValueError('fixture origin') + values=[BLANK]*(origin-1)+[LEFT]+list(bits) + return cls(values,origin,len(values),origin-1) + def read(self): + self.reads+=1 + return self.cells[self.head] if self.head=len(self.cells):self.cells.extend([BLANK]*(self.head+1-len(self.cells))) + self.cells[self.head]=v; self.high=max(self.high,self.head+1) + def move(self,d): + if d not in (-1,1):raise ValueError('nonunit move') + self.moves+=1; self.head+=d; self.low=min(self.low,self.head) + if self.head<0:raise ValueError('crossed physical boundary') + + +class CPU: + def __init__(self,program,tapes): + if len(tapes)!=len(NAMES) or len({id(t) for t in tapes})!=len(tapes): + raise ValueError('genuinely distinct physical owners required') + self.program=program; self.tapes=tuple(tapes); self.steps=0 + def run(self,entry=0,limit=100_000_000): + pc=entry; code=self.program; tapes=self.tapes + while self.steps>bit)&1)) + result.extend((0,1,0)) + return result + + +def packed_data(values,b): + return [value>>bit&1 for value in values for bit in range(b-1,-1,-1)] + + +def fixtures(a=9,u=0,K=1,rho=0,f=1,rows=1,r=1,b=2,cutoff=1): + h=dict.fromkeys(m.SCHEMA,0) + h.update(outer=1,rows=rows,row_bits=(1<>2)*7+3)&((1<>(a-1-j))&1)<<(a-1-position) + result.append(old) + return result + + +def oracle_pack(values,h,r,b): + a,u,K,rho,f=(h[k] for k in ('within_bits','active_start','K','rho','f')) + order=direct_indices(a,u,K,rho,9*f); out=[] + for row in range(h['outer']*h['rows']): + for old in order: + start=(row*(1<=origins[i]-1,'every relative origin and left exterior') + need(t.cells[origins[i]-1]==m.LEFT,'left guard preserved') + if i>=2:need(all(v==m.BLANK for v in t.cells[origins[i]:]),'complete private retirement') + V=len(data);E=len(header);g=9*h['f'] + need(cpu.steps<=2**20*((g+1)*V+E+1),'stated conservative complete time envelope') + need(tapes[m.PORT['PACK']].writes>=4*g*len(packed)*b,'full-pass PACK-write lower bound') + backing=sum(max(0,t.high-origins[i]) for i,t in enumerate(tapes) if i>=2) + need(backing<=64*(V+E+1),'complete incremental history envelope') + return {'geometry':params,'old_bits':V,'packed_bits':len(packed)*b,'header_bits':E, + 'transitions':cpu.steps,'packed_bank_writes':tapes[m.PORT['PACK']].writes, + 'incremental_history_cells':backing,'changed_service_fixture':change} + + +def shuffle_checks(): + b=m.Builder();b.label('FORWARD');b.shuffle();b.halt('PACKED');b.label('REVERSE');b.shuffle(True);b.halt('DONE') + code,labels=b.finish();receipts=[] + cases=[(4,0,1,0,3,1,3),(5,1,2,1,2,2,5),(8,1,2,1,3,3,2),(9,0,3,2,3,2,1),(7,2,1,0,4,2,7)] + wrong_position_detected=False;global_partition_detected=False + for a,u,K,rho,g,rows,L in cases: + values=[(j*11+(j>>3)*5+1)&1 for j in range(rows*(1<packed_len and data[packed_len] in (0,1),'header-only old DATA fails exact packed blank frontier') + out.append('header-only-frontier') + need(packed_data([1],2)!=[1,0],'unreversed component control') + out.append('component-orientation') + return out + + +def authenticate(): + manifest=HERE/'SOURCE-PINS.json' + need(manifest.is_file(),'source manifest present') + pins=json.loads(manifest.read_text());count=0 + def check(raw,item): + need(sha256(raw).hexdigest()==item['sha256'] + and sha1(b'blob '+str(len(raw)).encode()+b'\0'+raw).hexdigest()==item['git_blob'], + 'source authentication '+item['local_path']) + for item in pins['retained']: + raw=(HERE/item['local_path']).read_bytes();check(raw,item);count+=1 + try:check(raw+b'\n',item) + except ValueError:pass + else:raise ValueError('source mutation accepted') + module=ast.parse((HERE/'inputs/old-header-provider.py').read_text()) + schema=next(ast.literal_eval(n.value) for n in module.body if isinstance(n,ast.Assign) + and any(isinstance(t,ast.Name) and t.id=='SCHEMA' for t in n.targets)) + need(schema==m.SCHEMA,'exact old source header schema') + return {'authenticated_retained_files':count,'rejected_source_mutations':count,'source_schema_checked':True} + + +def main(): + code,labels=m.compile_bridge();again,_=m.compile_bridge();need(code==again,'input-independent deterministic graph') + for pc,ins in enumerate(code): + need(ins[0] in ('R','W','M','J','H'),'only literal operations') + if ins[0]=='R':need(all(0<=qlabels['EXIT'],'public writes only in exit suffix') + full=[complete_case(code,labels,{},True), + complete_case(code,labels,{'a':12,'u':2,'b':2}), + complete_case(code,labels,{'rows':2,'r':2,'b':3,'cutoff':(1<<200)+7},True), + complete_case(code,labels,{'b':22})] + print(json.dumps({'status':'PASS_SELECTED_MOVE_PACKED_CODEC','locations':len(code),'tapes':len(m.NAMES), + 'table_sha256':m.table_digest(code),'source_checks':authenticate(),'full_packets':full, + 'strided_subprograms':shuffle_checks(),'negative_controls':rejecting_controls(code), + 'scope':'No native C execution, f>1 full packet, recursive tariff or global assumption discharge.'},sort_keys=True,indent=2)) + + +if __name__=='__main__':main()