diff --git a/research/literal-owned-rank-two-move/PR-DESCRIPTION.md b/research/literal-owned-rank-two-move/PR-DESCRIPTION.md new file mode 100644 index 0000000000..8073b03f45 --- /dev/null +++ b/research/literal-owned-rank-two-move/PR-DESCRIPTION.md @@ -0,0 +1,55 @@ +## What this implements + +This implements selected #7000's actual owned MOVE at event 28141: bank 1526, from frame 601 = `[137]` to frame 470 = `[75,137,265]`. The exact operator is `T470 T601*`, including its source phases. The Boolean `true` denotes ownership. + +A fixed 115,776-instruction core on 31 tapes joins the credited 36/44-record monomial factors with two positive first-slot C passes and two literal slot swaps. A new guard checks **2f <= cutoff**, preserving the original f, nine-slot geometry and six-Gamma header. The complete HOME adapter has 115,953 states on 35 tapes. It writes the original owned HOME only after every factor returns; successful private storage, heads and opaque exteriors are restored. + +## Exact bounds and novelty + +With `V=2PSr 2^(9f) w`, header bit count E and `F=E+V`, the complete direct bounds are + +```text +T_core <= 2^24(fV+E+1) +K_core <= K_entry + 1024(V+E+1) +T_HOME <= 128(F+1) + 2^24(fV+E+1) +K_HOME <= K_entry + 1088(F+1) +``` + +Both C blocks, all 66 CNOTs, phase arithmetic, descriptors, copies, comparisons, returns and retirement are charged. General B1 full-bank delivery remains separately payable. This is a direct leaf primitive; its fV rate is not a faster nonleaf tariff. + +#6978 already supplies source-complete positive rank-two children in a different 23-value coded ABI and leaves the monomial-provider/literal whole-MOVE join open. This contribution supplies the actual source-owned Gamma6/HOME join. It does not claim new rank-two algebra or a first rank-two leaf. The phase/G/C tables and earlier rank-one transaction retain their credit. + +## Independent checks + +A separate root sparse graph CPU checked every embedded instruction and executed a fresh dense width-six packet against a newly written dense rational oracle for the original frame definition. The oracle uses span-set basis completion and inverse permutations; it imports neither the author's oracle/native verifier nor the emitted recipe for expected arithmetic. + +That replay passed **30,838,694 transitions**, exactly **6,156 late HOME writes**, and complete successful retirement. The author's normal and optimized checks also pass on the frozen publication bytes. They cover two complete nonzero calls on the same owners, smaller reuse with historical backing retained, cutoff rejection, a later second-child numerical failure, complete wrong-phase execution and source corruption. The later failure occurs after a completed first C pass and slot swap, with zero original HOME writes. + +The full canonical archive, exact source records and eight predecessor proof pins were authenticated. Guard-only cases through f=129 and 4,097-bit cutoff syntax are labelled separately from complete DATA execution. The all-size theorem rests on the written retained helper invariants and composition proof, not finite extrapolation. + +## Base and reproduction + +Canonical base: `e54523517d0f03e58352e647c403a5af3e525a57`. The core graph SHA256 is `6f440702d6d0b2428df1016f8006ae339699e8b9fe1cf9fe5dc0d2c111821adf`. + +Python 3.12, standard library only: + +```sh +python3 -B scripts/research_package.py --package research/literal-owned-rank-two-move --check-only +python3 -B scripts/research_package.py --package research/literal-owned-rank-two-move +``` + +Expected markers include `PASS_LITERAL_OWNED_RANK2_HOME`, `PASS_ROOT_RANK2_HOME` and `PASS_REGISTERED_RESEARCH_PACKAGE`. Standalone commands, retained normal/optimized receipts, source pins and role boundaries are in the package. The original author freeze remains under `implementation/`; the root review is at the top level. + +## Supplied premises and remaining obligations + +Entry is an already-reserved live typed owned packet with canonical positive Gamma6 geometry, w >= 2, common grid, full spectators, phase fit, integral/fitting outputs at all 2f C prefixes, distinct physical owners and blank required private windows. No endpoint scale or rounding is installed. Rejection protects original DATA/HOME but does not promise failure cleanup or retry. + +The original header, grid, width and F return unchanged, providing compatibility with the following signed HOME ADD when its other operand is supplied in frame 470 on the same grid. Actual producers, receiver INIT, preceding SUB producers, SCALE, dirty CLEAR and the complete interleaved lifetime remain open. No arbitrary malformed-input or interruption-rollback guarantee is claimed. + +## Kappa and credit + +**No new kappa.** The selected `363005817/100000000000` and all five framework assumptions remain unchanged. This is a source-bound primitive sub-lemma, not a completed supplier or unconditional multiplication theorem. + +Prepared for **@CubeJerry**, with substantial OpenAI ChatGPT/Codex assistance. One worker developed the implementation/proof; the root separately reviewed the exact embedding, complete cost sum and original-frame arithmetic. No blind, human or formal-kernel review is claimed. + +Credit #6978, #7426, #7430, #7429, the earlier rank-one join, B1/HOME bridge, signed-ADD ABI and their retained native/compiler/physical authors. Exact notices and source hashes are preserved. Apache-2.0. diff --git a/research/literal-owned-rank-two-move/PUBLICATION-CHECKS.json b/research/literal-owned-rank-two-move/PUBLICATION-CHECKS.json new file mode 100644 index 0000000000..23d94965e3 --- /dev/null +++ b/research/literal-owned-rank-two-move/PUBLICATION-CHECKS.json @@ -0,0 +1,44 @@ +{ + "base": "e54523517d0f03e58352e647c403a5af3e525a57", + "registered": [ + { + "label": "metadata", + "exit": 0, + "seconds": 0.294, + "stdout_sha256": "5873404cb4424dca918a00d503569f3c29a3190fd029a007e1afb2006399f647", + "stdout_bytes": 69, + "stderr": "" + }, + { + "label": "registered", + "exit": 0, + "seconds": 70.78, + "stdout_sha256": "af66802a06160a7c393fef230971ec1f77f396b6ec1bdebc34b5f50c24663a64", + "stdout_bytes": 12548, + "stderr": "" + } + ], + "author_replay": { + "checks": [ + { + "mode": "normal", + "exit": 0, + "seconds": 23.524, + "stdout_sha256": "8d7f5cbaeed49ab4616ba1a1cf6152ed1da7b7ca856980171022847490285876", + "stderr": "" + }, + { + "mode": "optimized", + "exit": 0, + "seconds": 22.62, + "stdout_sha256": "713e6e89d21d1851779f7c84547ecf9249d1a0a655a0286025f3704cdc2c6cb6", + "stderr": "" + } + ], + "read_only": true + }, + "root_independent_status": "PASS_ROOT_RANK2_HOME", + "author_freeze_preserved": true, + "public_runtime_inputs_local": true, + "full_source_binder_executed": true +} diff --git a/research/literal-owned-rank-two-move/PUBLICATION-MANIFEST.json b/research/literal-owned-rank-two-move/PUBLICATION-MANIFEST.json new file mode 100644 index 0000000000..e87bdeb3aa --- /dev/null +++ b/research/literal-owned-rank-two-move/PUBLICATION-MANIFEST.json @@ -0,0 +1,287 @@ +{ + "files": [ + { + "path": "PR-DESCRIPTION.md", + "bytes": 5126, + "sha256": "76a1f686f68f650776d3ace743417b6772d91c09366e2625237d0f6df9f146fb", + "git_blob": "8073b03f452a177d438d8c226d661ad00c20494d" + }, + { + "path": "PUBLICATION-CHECKS.json", + "bytes": 1162, + "sha256": "a3e9ed9935ae964b83e6ea38c8e9569dd6c3bd373e2f10136e93ebde44400920", + "git_blob": "23d94965e3ed7e23593e2ff556501b10289b5043" + }, + { + "path": "README.md", + "bytes": 5807, + "sha256": "30af55a8aa246e129bde4a44671ec8d95075cdf5fd334e0b014e9bb163214e1b", + "git_blob": "25df01e75e7197c0a3a8792118727b093d823e12" + }, + { + "path": "ROOT-REVIEW.md", + "bytes": 3981, + "sha256": "bc23215d7b3ccbaa9fcdbe6a08081bb159fcba46975491cf49b7541a17e43be5", + "git_blob": "164ce25745d40da647b067d60eea681dc6ebc597" + }, + { + "path": "SOURCES.json", + "bytes": 1287, + "sha256": "0863dacf986d149549c01243598789f9e8acdcaebe90eb5e8f1b121ab06e1cdc", + "git_blob": "5ead17321a27feb005b75d8fdb8793d86e58d5fe" + }, + { + "path": "TASK.json", + "bytes": 6610, + "sha256": "d493f77f68f65e1d72f3ded7acbe75bde3306746d1b730614389530db5abf94e", + "git_blob": "d541534ec3b22df7186cad4c781e5a9666ecf3d7" + }, + { + "path": "VERIFY.json", + "bytes": 1273, + "sha256": "9a018382b039c6138331681f79ac7e2f4d9a3821708927834932d900bfa9dfc2", + "git_blob": "8f54cf1463cbd0fdc28b507538ab1c89c29af971" + }, + { + "path": "implementation/CHECKPOINT.md", + "bytes": 891, + "sha256": "096e7a8a1551ae6b9887ab5010a8f4026b6de78d97322c00a5380a0c9a72349c", + "git_blob": "0d6c1f5d1d7b0bff655f22c0d4c8172a6eae1547" + }, + { + "path": "implementation/ENVIRONMENT.json", + "bytes": 353, + "sha256": "41bebc6ecaf5e64b7d1075c62c30fead6efbd24e930933efa5095ad60554b660", + "git_blob": "a06e0f756978260f28ec89b44015f5a46ac53b38" + }, + { + "path": "implementation/FREEZE.json", + "bytes": 5633, + "sha256": "072dfea997d4db796d492eaf746e0bd99630964741b88862d0f10f5fc1e00275", + "git_blob": "f8b32e26117bc678bd8003a4567200783e8496af" + }, + { + "path": "implementation/GRAPH.json", + "bytes": 552, + "sha256": "d5b676671717a930bbc5796904e424f40a3aabbcaeebb61d84cdab6b4d30bd53", + "git_blob": "f072a8314009b9cec836db1d4409471aba62426e" + }, + { + "path": "implementation/NOTICE.md", + "bytes": 3215, + "sha256": "8e4464c37453cede80b45ca5735a1aab22acd15d8796a78ba48713cc4717313a", + "git_blob": "50044df32f67335f0cc12c9ef1dd2ac67e0a5fd3" + }, + { + "path": "implementation/OVERLAP.md", + "bytes": 2767, + "sha256": "43aeda8f27c34eafc18b2c93b25a8128eefed7cf7b152dd13eaf925a7cc8ac34", + "git_blob": "3e152db589c825dc95d49c88bea81eb06b370ba9" + }, + { + "path": "implementation/PR-DESCRIPTION.md", + "bytes": 4206, + "sha256": "be862b0e585a1d74bb70369489358b21a0ec3ca06946977b839401a3bc6cef8b", + "git_blob": "40c6964e29fee1cf0ff5cbfdf883027577af6708" + }, + { + "path": "implementation/PR-TITLE.txt", + "bytes": 73, + "sha256": "43e1c0e57941afc23d29d877488440eccfee1b4ec8a0c908ade46361543957a3", + "git_blob": "de696ca3837ee0fdf63e5b92bfa247eae3df5160" + }, + { + "path": "implementation/PROOF.md", + "bytes": 16634, + "sha256": "93e1ad8a92c3624df064e4f39119ccbb5c96391ea8dd5f7af58edc7ca9638352", + "git_blob": "627e54e031945e3cc269b255669c999a0f5995e3" + }, + { + "path": "implementation/README.md", + "bytes": 5822, + "sha256": "90d9ed2f26ade3fed562f7b930fd60fe56b75cef1b43cb2a24a0e99a52150210", + "git_blob": "37a32e3dd45875d3dd2cef312991fb67a78c5944" + }, + { + "path": "implementation/RECIPE.json", + "bytes": 4468, + "sha256": "b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702", + "git_blob": "04f5dc8367585afbf272ea2ecbb49cd28ce10919" + }, + { + "path": "implementation/REMOTE-BINDINGS.json", + "bytes": 967, + "sha256": "c3b16896601fc024e832ed7abb3266e16de170ed72a93f702a1a5e98e0f24694", + "git_blob": "107687b0206e354d83c763522fd6037a0c14e82e" + }, + { + "path": "implementation/RESULT.json", + "bytes": 5098, + "sha256": "1673bf5ca1d1d46762a67085e5dfc1d72d5e31a211bc2f56f8946efc6b07f127", + "git_blob": "c0f00d70f83f5633486c3b48981e1f592bc0fef7" + }, + { + "path": "implementation/SOURCE-BINDING.json", + "bytes": 515, + "sha256": "6eb220b27c95f6d104e1b51dfd79314905cb6dc84a81ca8d115b709d9416a945", + "git_blob": "7048caf474fde87db864860668fc0254c6285698" + }, + { + "path": "implementation/SOURCES.json", + "bytes": 10337, + "sha256": "659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641", + "git_blob": "0ea6091131b526591e5757c56c0a50b50b170b83" + }, + { + "path": "implementation/adapter.py", + "bytes": 5777, + "sha256": "b0d60256c88ce106d3463a5f5b3cc6f7d1d11d3fad8f0fcb332bfcca3cdb1dcc", + "git_blob": "d3da08da10d634f492054e1ab2a1a91af05464ed" + }, + { + "path": "implementation/bind_source.py", + "bytes": 5125, + "sha256": "b4feddf21f9c693d8537218ed28c073d7a5d18e7d0cd9d35b0d9333e3386e76a", + "git_blob": "3840b7e03de77abca6868758b9c2bdd478b2ea0d" + }, + { + "path": "implementation/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee", + "git_blob": "fcd4ac01f03a4689fe9fa45d4ca5ea95950103da" + }, + { + "path": "implementation/oracle.py", + "bytes": 2460, + "sha256": "93c7964163fe0b9f7977703a78a456e81117d9d3f63e64ce213407a963c7b6ff", + "git_blob": "991a1cb4eddd4b874f4d35d736537a4dbff3ec2f" + }, + { + "path": "implementation/rank2.py", + "bytes": 8253, + "sha256": "3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a", + "git_blob": "ed3ef68167456e0322314762dab6eb725d9f3a37" + }, + { + "path": "implementation/reference/home/NOTICE.md", + "bytes": 2093, + "sha256": "b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842", + "git_blob": "db83fd95e175c90a2f9e51545b4be4557fbb919e" + }, + { + "path": "implementation/reference/home/parent_adapter.py", + "bytes": 5353, + "sha256": "04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099", + "git_blob": "10606f87dcfa0781bcae900d95cb86925961d453" + }, + { + "path": "implementation/reference/home/tape_graph.py", + "bytes": 12069, + "sha256": "7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54", + "git_blob": "f307133f2b0bba2e5969825cb814503d819322e7" + }, + { + "path": "implementation/reference/leaf/NOTICE.md", + "bytes": 1900, + "sha256": "773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf", + "git_blob": "71c5f6dae2c799ce5d76c544e98d1ee7c52ef76c" + }, + { + "path": "implementation/reference/leaf/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "git_blob": "3ab6d0361f35038ffcdf0cf81a157f7a17b40e72" + }, + { + "path": "implementation/reference/leaf/leaf.py", + "bytes": 17526, + "sha256": "bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744", + "git_blob": "bdcc80cbd8b64c601e6d69b7d25ece444b8b1ae2" + }, + { + "path": "implementation/reference/linear/NOTICE.md", + "bytes": 2180, + "sha256": "2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50", + "git_blob": "3a3030f23df347c1e45ddf92d2083f89ed16cc67" + }, + { + "path": "implementation/reference/linear/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "git_blob": "3ab6d0361f35038ffcdf0cf81a157f7a17b40e72" + }, + { + "path": "implementation/reference/linear/linear.py", + "bytes": 13102, + "sha256": "d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33", + "git_blob": "6aad40a6c47ed4415917c86fabbd5227a3819a41" + }, + { + "path": "implementation/reference/phase/NOTICE", + "bytes": 808, + "sha256": "5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0", + "git_blob": "7a1f1da9c59d40b1e72905fee5344a8db9ca4353" + }, + { + "path": "implementation/reference/phase/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "git_blob": "3ab6d0361f35038ffcdf0cf81a157f7a17b40e72" + }, + { + "path": "implementation/reference/phase/phase.py", + "bytes": 11734, + "sha256": "2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7", + "git_blob": "d48978145821fc4a62d534bef2bef9449bda883a" + }, + { + "path": "implementation/reference/source/clifford_exact.py", + "bytes": 6824, + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2" + }, + { + "path": "implementation/reference/source/native_verify.py", + "bytes": 12323, + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38", + "git_blob": "2c209dfa9cfade3bc20ac5fc9d876b433a147f8c" + }, + { + "path": "implementation/verify.py", + "bytes": 12019, + "sha256": "c023806283adf2e1aec156b6a909a7620a0a6db70898baa0b3926a1f90a7cf83", + "git_blob": "ea89b1951ed0d8bbda5cc11f60eeb81e5c8ae6c1" + }, + { + "path": "review/root/FINAL-AUTHOR-REPLAY.json", + "bytes": 422, + "sha256": "6f813940f41a5716d9007f11bcc58ac54bef0ffa184b09e5b66a11f77298f3b0", + "git_blob": "77025c9fdb6e6291f0485e98f46a297dc5c0e5bc" + }, + { + "path": "review/root/FINAL-SOURCE-BINDING.json", + "bytes": 515, + "sha256": "6eb220b27c95f6d104e1b51dfd79314905cb6dc84a81ca8d115b709d9416a945", + "git_blob": "7048caf474fde87db864860668fc0254c6285698" + }, + { + "path": "review/root/RESULT.json", + "bytes": 1739, + "sha256": "d203bb53a4db8da5ca57e0b8ebbe944477eae031b8045f717c510d0343b18aa4", + "git_blob": "5e7ffc27ed75d52de8d203c406044b00521614b9" + }, + { + "path": "review/root/SNAPSHOT.json", + "bytes": 3108, + "sha256": "68e04285f9a48729c0c0d13b5fd9b2af062100e99ec4b891e555ce5770e3034c", + "git_blob": "547c4c32cb7cd48bd2d7925b257fe8a6be43854a" + }, + { + "path": "review/root/check_rank2_root.py", + "bytes": 7587, + "sha256": "7d14f37a1ad110bfa953d2828a19f60da118117b2ba2579c3b6515060d127922", + "git_blob": "ba52c3bf015960c1e8cef50093e3f7e3780ac301" + } + ], + "scope": "All files except this manifest; original frozen implementation bytes unchanged." +} diff --git a/research/literal-owned-rank-two-move/README.md b/research/literal-owned-rank-two-move/README.md new file mode 100644 index 0000000000..25df01e75e --- /dev/null +++ b/research/literal-owned-rank-two-move/README.md @@ -0,0 +1,60 @@ +# Literal selected rank-two MOVE with an owned HOME boundary + +This package implements selected event `[MOVE,1526,601,470,true]` at index 28141, from frame `[137]` to `[75,137,265]`. The Boolean denotes ownership. A fixed 115,776-instruction program on 31 tapes executes the complete quotient `T470 T601*`, including its nontrivial phases. A 115,953-state adapter on 35 tapes returns the completed six-Gamma header and DATA to the identical owned HOME. + +The new step is the actual source-specific monomial/positive-leaf join in the Gamma6/HOME format. #6978 already supplies rank-two positive children in a different coded ABI; this is not a new rank-two factorization or a first rank-two leaf. Exact source pins, predecessor notices and the bounded overlap report are preserved under [implementation/](implementation/). + +## Result and supplied premises + +The primitive retains all nine `f`-bit address slots, all spectators and `r` Gaussian coefficients. Two positive first-slot C passes, conjugated by two literal three-CNOT slot swaps, realize `C^(tensor 2f)` without changing the header's `f`. A new physical guard checks `2f <= cutoff`. All 66 CNOTs in the two source factors and slot swaps are paid. + +For `V=2PSr 2^(9f) w`, header bit count `E` and complete field length `F=E+V`, the proof gives + +```text +T_core <= 2^24 (fV+E+1) +K_core <= K_entry + 1024 (V+E+1) +T_HOME <= 128 (F+1) + 2^24 (fV+E+1) +K_HOME <= K_entry + 1088 (F+1) +``` + +This direct bill includes descriptors, copies, phase arithmetic, both C passes, every CNOT, returns and cleanup. General B1 full-bank gathering and scattering remain separately charged. Earlier backing is retained after erasure and shorter reuse. + +Entry is supplied: an already-reserved live typed owned packet, canonical six-Gamma header, signed `w>=2` fields on a common grid, matching geometry, distinct owners, complete spectators, blank required private windows, phase fit and integrality/range of every central C prefix. The source and receiver must carry the correct frames. No typed INIT, endpoint scaling, packet producer or receiver is synthesized. Rejection protects original DATA/HOME but does not promise private cleanup or retry. See the [proof](implementation/PROOF.md) and [root review](ROOT-REVIEW.md). + +## Independent evidence + +The root executed a fresh dense width-six packet using a separate sparse signed-origin graph interpreter. Its oracle is a separately written dense rational evaluation of the original frame definition, using span-set basis extension and inverse permutations. It imports neither the author's oracle nor its native verifier or lowered recipe as the arithmetic oracle. + +That replay completed **30,838,694** transitions, with exactly **6,156** HOME writes, all after primitive return. It checked all 115,776 embedded instructions and restored all 35 heads, private bodies and opaque exterior sentinels. The author checker additionally exercises smaller same-owner reuse, cutoff rejection, later second-child numerical rejection, complete wrong-phase execution, actual source corruption and original operator binding. These finite checks corroborate the quantified proof. + +Author normal and optimized checks were replayed on the frozen publication snapshot. The optional full-source binder authenticated the complete canonical archive and eight proof pins. Receipts and hashes accompany the package. No human or formal-kernel acceptance is claimed. + +## Reproduction + +Python 3.12, standard library only, from the repository root: + +```sh +python3 -I -B -W error research/literal-owned-rank-two-move/implementation/verify.py +python3 -I -O -B -W error research/literal-owned-rank-two-move/implementation/verify.py +python3 -I -B -W error research/literal-owned-rank-two-move/review/root/check_rank2_root.py research/literal-owned-rank-two-move/implementation +python3 -B scripts/research_package.py --package research/literal-owned-rank-two-move --check-only +python3 -B scripts/research_package.py --package research/literal-owned-rank-two-move +``` + +Expected markers are `PASS_LITERAL_OWNED_RANK2_HOME` and `PASS_ROOT_RANK2_HOME`. Default replays are read-only; `--write` explicitly regenerates the author's receipt. Runtime inputs are local. The optional full-source command is: + +```sh +python3 -I -B research/literal-owned-rank-two-move/implementation/bind_source.py --source-repo /path/to/reference/checkout +``` + +The top-level `VERIFY.json` is a registered manifest. The nested author freeze remains unchanged, including its historical status and proposed PR description; the current independent review is at the top level. + +## Open next questions + +[TASK.json](TASK.json) gives first steps and blockers for three questions: bind the actual selected producer and receiver to this supplied entry; close the complete owned interval with INIT, SCALE, dirty CLEAR and every intervening cost; and develop a faster nonleaf mechanism whose full joint-parameter bill meets the selected tariff. The direct `fV` method is a leaf implementation and does not supply that faster tariff. + +## Kappa, scope and credit + +**No new kappa.** The selected value remains `363005817/100000000000`, and all five framework assumptions remain. This is a source-bound primitive sub-lemma relevant to native execution, ownership and precision/storage; it is not an unconditional multiplication theorem, a full owned lifetime or a complete supplier. + +Prepared for **@CubeJerry**, with substantial OpenAI ChatGPT/Codex assistance. One worker developed the implementation and composition proof; the root independently checked graph embedding, the cost sum and original-frame arithmetic. Credit #6978, the retained phase/G/C literal tables, the earlier rank-one join and permanent-HOME dispatcher, and [implementation/NOTICE.md](implementation/NOTICE.md). Apache-2.0. diff --git a/research/literal-owned-rank-two-move/ROOT-REVIEW.md b/research/literal-owned-rank-two-move/ROOT-REVIEW.md new file mode 100644 index 0000000000..164ce25745 --- /dev/null +++ b/research/literal-owned-rank-two-move/ROOT-REVIEW.md @@ -0,0 +1,33 @@ +# Independent review of the actual owned rank-two primitive + +Base: `e54523517d0f03e58352e647c403a5af3e525a57`. + +## Universal implications reviewed + +The root checked that the true field denotes ownership, that the original frames are `[137]` and `[75,137,265]`, and that the complete operation is the ordered positive quotient `T470 T601*`. Source binding retains all 36/44 records and phase fields. + +The chronology `C0, S01, C0, S01` applies positive C on both complete f-bit slots while preserving the nine-slot geometry. The separate guard appends zero to captured binary f and one mark to its bit length. It compares 2f with the actual encoded cutoff while retaining the original unary geometry and header. + +All relocated module DATA operations address private WORK. Every original DATA write lies after all components return; HOME scatter follows primitive return. This proves successful same-owner behavior and original-owner preservation on the stated failures. It does not imply private cleanup after failure, interruption rollback or retry. + +The independent complete time sum is `8884255 fV + 360448 E + 360475`, below `2^24(fV+E+1)`: 66 CNOTs, four fixed-word setup/retirement terms, two leaves, two phases, rank guard and outer transaction. Historical-backing increments sum to 968 times `V+E+1`, below 1024. The HOME adapter adds its retained bounds. B1 bank delivery remains explicitly payable. + +The divisibility/range reserve is a sufficient caller promise, not an emitted producer. The direct leaf rate cannot be substituted for the selected nonleaf tariff. The following ADD requires the correct typed frame/grid on its other operand; matching header bits alone do not prove that premise. + +## Independent execution and provenance + +`review/root/check_rank2_root.py` contains a separate sparse dictionary graph CPU, retaining the earlier root interpreter's published design. It uses signed origins, opaque exterior sentinels and nonzero historical backing, and checks every embedded instruction before execution. + +The newly written oracle evaluates the original frame construction as dense rational pairs. Basis completion uses span sets and original directions; inversion uses the complete binary permutation. The oracle imports neither the author's arithmetic oracle, native verification engine nor emitted recipe. The original frame definition and source conventions are shared mathematical inputs. + +The fresh width-six packet passed 30,838,694 transitions, 6,156 HOME writes only after return, all heads/private/exteriors restored and exact equality with the original-frame result. Forward and inverse source orientations differ on this fixture. The core hash is `6f440702d6d0b2428df1016f8006ae339699e8b9fe1cf9fe5dc0d2c111821adf`. + +The initial implementation snapshot preceded the documentation freeze. Final comparison found only `bind_source.py` and `CHECKPOINT.md` changed; critical runtime code, recipe and source manifest were identical. The final binder was then executed against the canonical reference repository. The frozen author inventory and final package integrity were checked separately. + +## Controls and limits + +Author replays, run again normally and under `-O`, cover the false old f-only guard, complete wrong-phase execution, inverse orientation, one-C substitution, source corruption, early owner writes and rejection after first C plus slot swap. Their optimized CPU complements the independent sparse CPU. + +No full f=2 DATA run was needed to resolve an observed defect. Guard-only large-f cases remain separately labelled. The universal result rests on retained helper invariants and the composition proof. Actual producers, source/history and numerical entry promises, full ownership lifetime, faster recursion and all full-framework assumptions remain explicit. + +Prepared for @CubeJerry with substantial OpenAI assistance. This is separate AI mathematical and implementation review; blind, human and formal-kernel acceptance are unclaimed. diff --git a/research/literal-owned-rank-two-move/SOURCES.json b/research/literal-owned-rank-two-move/SOURCES.json new file mode 100644 index 0000000000..5ead17321a --- /dev/null +++ b/research/literal-owned-rank-two-move/SOURCES.json @@ -0,0 +1,26 @@ +{ + "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" + }, + { + "path": "docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md", + "usage": "provenance", + "git_blob": "3dd1af2285e597676725e85ad4f65e7ad326d695", + "sha256": "4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055" + } + ], + "external_primary_provenance": "implementation/SOURCES.json pins every retained module, current source and predecessor proof. Local retained bytes are authenticated before imports; no remote runtime inputs are required.", + "local_inputs": "All proof-relevant runtime bytes are committed under implementation/ and review/. The optional binder --source-repo authenticates full canonical Git archives and is separately recorded." +} diff --git a/research/literal-owned-rank-two-move/TASK.json b/research/literal-owned-rank-two-move/TASK.json new file mode 100644 index 0000000000..d541534ec3 --- /dev/null +++ b/research/literal-owned-rank-two-move/TASK.json @@ -0,0 +1,93 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "task_id": "uniform-transfer-audit", + "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", + "scope_change_reason": "The user directed foundational work. This refines uniform-transfer-audit to the previously missing actual rank-two monomial/positive-leaf whole-MOVE join at a supplied native/HOME boundary; full selected caller and nonleaf tariff remain open.", + "actual_scope": "Implement and independently verify the exact selected owned rank-two MOVE28141 as a literal fixed-tape Gamma6/HOME primitive under its stated supplied-entry and numerical-prefix promises.", + "bottleneck_link": "A concrete sub-lemma for native_all_columns, owned_erasure and precision_tape: actual source phases,2f cutoff, complete operands, cleanup and historical backing.", + "stop_rule": "Stop after the literal source-bound direct-leaf primitive, complete costs and independent checks; do not infer endpoint conversion, producer admission, full owned lifetime or a nonleaf supplier.", + "evidence": "implementation/PROOF.md; implementation/SOURCE-BINDING.json; implementation/RESULT.json; ROOT-REVIEW.md; review/root/RESULT.json.", + "author": "@CubeJerry", + "ai_assistance": "Substantial OpenAI ChatGPT/Codex assistance; root construction and arithmetic, separate proof role and independent implementation role; shared proposed formulas disclosed.", + "outcome": "completed", + "open_questions": [ + { + "question": "Does an actual selected producer and receiver satisfy this supplied Gamma6 common-grid numerical-prefix entry?", + "why_it_matters": "The literal table alone does not establish an end-to-end native caller.", + "first_step": "Materialize one producer of bank1526 and receiver1515 at the pinned source event, retaining grid,frame,width and complete spectators.", + "blocked_by": "No actual producer/receiver is installed; the module starts from an already-reserved live owned field." + }, + { + "question": "Can the complete owned interval be closed with dirty retirement and all intervening costs?", + "why_it_matters": "Successful primitive cleanup is narrower than owned_erasure for the full source program.", + "first_step": "Join the actual four SUB contacts, rank-two MOVE and following ADD with the real INIT, SCALE, CLEAR and full-bank dispatcher.", + "blocked_by": "Current package proves only supplied local interfaces; earlier zero-at-CLEAR strengthening was false and is not reused." + }, + { + "question": "Can a faster nonleaf movement implementation meet the selected joint parameter tariff?", + "why_it_matters": "The direct fV rate cannot automatically inherit the selected nonleaf monomial rate.", + "first_step": "Specify a new movement mechanism and prove its optimistic complete cost before constructing it.", + "blocked_by": "No recursive supplier, nonleaf recurrence or global exponent improvement is proved." + } + ] +} diff --git a/research/literal-owned-rank-two-move/VERIFY.json b/research/literal-owned-rank-two-move/VERIFY.json new file mode 100644 index 0000000000..8f54cf1463 --- /dev/null +++ b/research/literal-owned-rank-two-move/VERIFY.json @@ -0,0 +1,47 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "-W", + "error", + "{package}/implementation/verify.py" + ], + "timeout_seconds": 180, + "checks": "Exact source-bound rank-two graph, two complete successful HOME calls and stale-history reuse; cutoff, later numerical, phase,source-corruption and orientation controls." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "-W", + "error", + "{package}/implementation/verify.py" + ], + "timeout_seconds": 180, + "checks": "Same frozen scientific receipt under explicit optimized Python; required checks remain active." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "-W", + "error", + "{package}/review/root/check_rank2_root.py", + "{package}/implementation" + ], + "timeout_seconds": 180, + "checks": "Independent sparse graph CPU and separately written dense rational original-frame oracle on a fresh full-width packet; every embedded instruction and all successful private/head/exterior returns." + } + ] +} diff --git a/research/literal-owned-rank-two-move/implementation/CHECKPOINT.md b/research/literal-owned-rank-two-move/implementation/CHECKPOINT.md new file mode 100644 index 0000000000..0d6c1f5d1d --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/CHECKPOINT.md @@ -0,0 +1,3 @@ +Actual owned MOVE28141 construction, allocated about11:58UTC; stop for review by12:58UTC. Canonical e545. Exact601→470 rank2, true denotes ownership. New guard2f<=cutoff; all9f geometry/header preserved. No endpoint scaling or full lifetime. Current modules copied byte-for-byte under SOURCES.json. Complete preflight found44 right/36 left records, offsets0 and constants0; first-slot leaf twice via slot01 swap gives bare positive C_(2f). #6978 supplies prior rank2 coded child, not this supplier-free Gamma6/HOME table. Prior worker packages untouched. + +Author completion checkpoint2026-11-13 about12:45UTC: exact source binding, normal/optimized full literal replay, proof, costs, README/NOTICE/overlap and PR draft complete. Core31 tapes115776 locations; HOME35 tapes115953 states. No frozen predecessor edited, endpoint scale or full lifetime added. Ready for independent root audit. diff --git a/research/literal-owned-rank-two-move/implementation/ENVIRONMENT.json b/research/literal-owned-rank-two-move/implementation/ENVIRONMENT.json new file mode 100644 index 0000000000..a06e0f7569 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/ENVIRONMENT.json @@ -0,0 +1,9 @@ +{ + "python": "3.12.14 (main, Aug 25 2026, 14:00:49) [Clang 22.1.3 ]", + "platform": "Linux-6.18.57-x86_64-with-glibc2.41", + "normal_replay_seconds": 21.719, + "optimized_replay_seconds": 22.249, + "scientific_receipts_identical": true, + "core_executed_in_both_modes": true, + "scope": "Observed author replay times; no primitive tariff inference." +} diff --git a/research/literal-owned-rank-two-move/implementation/FREEZE.json b/research/literal-owned-rank-two-move/implementation/FREEZE.json new file mode 100644 index 0000000000..f8b32e2611 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/FREEZE.json @@ -0,0 +1,179 @@ +{ + "schema": "literal-owned-rank2-freeze/1", + "canonical_main": "e54523517d0f03e58352e647c403a5af3e525a57", + "status": "author-frozen for independent review; no new scientific scope", + "core_graph": "6f440702d6d0b2428df1016f8006ae339699e8b9fe1cf9fe5dc0d2c111821adf", + "HOME_graph": "f2f957292847995587c2c269a19a72876e7f74a52f26b07f807eb50f09816e5f", + "files": [ + { + "path": "CHECKPOINT.md", + "bytes": 891, + "sha256": "096e7a8a1551ae6b9887ab5010a8f4026b6de78d97322c00a5380a0c9a72349c" + }, + { + "path": "ENVIRONMENT.json", + "bytes": 353, + "sha256": "41bebc6ecaf5e64b7d1075c62c30fead6efbd24e930933efa5095ad60554b660" + }, + { + "path": "GRAPH.json", + "bytes": 552, + "sha256": "d5b676671717a930bbc5796904e424f40a3aabbcaeebb61d84cdab6b4d30bd53" + }, + { + "path": "NOTICE.md", + "bytes": 3215, + "sha256": "8e4464c37453cede80b45ca5735a1aab22acd15d8796a78ba48713cc4717313a" + }, + { + "path": "OVERLAP.md", + "bytes": 2767, + "sha256": "43aeda8f27c34eafc18b2c93b25a8128eefed7cf7b152dd13eaf925a7cc8ac34" + }, + { + "path": "PR-DESCRIPTION.md", + "bytes": 4206, + "sha256": "be862b0e585a1d74bb70369489358b21a0ec3ca06946977b839401a3bc6cef8b" + }, + { + "path": "PR-TITLE.txt", + "bytes": 73, + "sha256": "43e1c0e57941afc23d29d877488440eccfee1b4ec8a0c908ade46361543957a3" + }, + { + "path": "PROOF.md", + "bytes": 16634, + "sha256": "93e1ad8a92c3624df064e4f39119ccbb5c96391ea8dd5f7af58edc7ca9638352" + }, + { + "path": "README.md", + "bytes": 5822, + "sha256": "90d9ed2f26ade3fed562f7b930fd60fe56b75cef1b43cb2a24a0e99a52150210" + }, + { + "path": "RECIPE.json", + "bytes": 4468, + "sha256": "b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702" + }, + { + "path": "REMOTE-BINDINGS.json", + "bytes": 967, + "sha256": "c3b16896601fc024e832ed7abb3266e16de170ed72a93f702a1a5e98e0f24694" + }, + { + "path": "RESULT.json", + "bytes": 5098, + "sha256": "1673bf5ca1d1d46762a67085e5dfc1d72d5e31a211bc2f56f8946efc6b07f127" + }, + { + "path": "SOURCE-BINDING.json", + "bytes": 515, + "sha256": "6eb220b27c95f6d104e1b51dfd79314905cb6dc84a81ca8d115b709d9416a945" + }, + { + "path": "SOURCES.json", + "bytes": 10337, + "sha256": "659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641" + }, + { + "path": "adapter.py", + "bytes": 5777, + "sha256": "b0d60256c88ce106d3463a5f5b3cc6f7d1d11d3fad8f0fcb332bfcca3cdb1dcc" + }, + { + "path": "bind_source.py", + "bytes": 5125, + "sha256": "b4feddf21f9c693d8537218ed28c073d7a5d18e7d0cd9d35b0d9333e3386e76a" + }, + { + "path": "machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee" + }, + { + "path": "oracle.py", + "bytes": 2460, + "sha256": "93c7964163fe0b9f7977703a78a456e81117d9d3f63e64ce213407a963c7b6ff" + }, + { + "path": "rank2.py", + "bytes": 8253, + "sha256": "3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a" + }, + { + "path": "reference/home/NOTICE.md", + "bytes": 2093, + "sha256": "b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842" + }, + { + "path": "reference/home/parent_adapter.py", + "bytes": 5353, + "sha256": "04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099" + }, + { + "path": "reference/home/tape_graph.py", + "bytes": 12069, + "sha256": "7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54" + }, + { + "path": "reference/leaf/NOTICE.md", + "bytes": 1900, + "sha256": "773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf" + }, + { + "path": "reference/leaf/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "reference/leaf/leaf.py", + "bytes": 17526, + "sha256": "bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744" + }, + { + "path": "reference/linear/NOTICE.md", + "bytes": 2180, + "sha256": "2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50" + }, + { + "path": "reference/linear/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "reference/linear/linear.py", + "bytes": 13102, + "sha256": "d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33" + }, + { + "path": "reference/phase/NOTICE", + "bytes": 808, + "sha256": "5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0" + }, + { + "path": "reference/phase/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "reference/phase/phase.py", + "bytes": 11734, + "sha256": "2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7" + }, + { + "path": "reference/source/clifford_exact.py", + "bytes": 6824, + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "reference/source/native_verify.py", + "bytes": 12323, + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38" + }, + { + "path": "verify.py", + "bytes": 12019, + "sha256": "c023806283adf2e1aec156b6a909a7620a0a6db70898baa0b3926a1f90a7cf83" + } + ] +} diff --git a/research/literal-owned-rank-two-move/implementation/GRAPH.json b/research/literal-owned-rank-two-move/implementation/GRAPH.json new file mode 100644 index 0000000000..f072a83140 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/GRAPH.json @@ -0,0 +1,11 @@ +{ + "schema": "literal-owned-rank2-graphs/1", + "core_locations": 115776, + "core_sha256_repr": "6f440702d6d0b2428df1016f8006ae339699e8b9fe1cf9fe5dc0d2c111821adf", + "HOME_states": 115953, + "HOME_tapes": 35, + "HOME_entry": "jump.115942", + "HOME_sha256": "f2f957292847995587c2c269a19a72876e7f74a52f26b07f807eb50f09816e5f", + "HOME_hash_encoding": "UTF8 JSON separators comma/colon of [graph.start, [[state, [[target,tests,writes,moves],...]],...]] in emitted insertion order; tuples serialize as JSON arrays", + "HOME_serialization_bytes": 7423218 +} diff --git a/research/literal-owned-rank-two-move/implementation/NOTICE.md b/research/literal-owned-rank-two-move/implementation/NOTICE.md new file mode 100644 index 0000000000..50044df32f --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/NOTICE.md @@ -0,0 +1,55 @@ +# Attribution and source scope + +Apache-2.0. Prepared with substantial OpenAI Codex assistance for the +integer-multiplication project. No independent human or formal-kernel +acceptance is claimed. + +The new object is the literal actual selected owned MOVE28141, complete +rank-aware2f cutoff, fixed source words and conjugated second-slot C pass, +whole-call transaction, supplied-owned HOME return, proof and verifier. +The rank-two frame factorization, tensor identities, Gaussian prefix facts, +binary row elimination, classical Gamma coding and carry methods are reused. + +Exact source MOVE/frame/ownership semantics are those of the selected +#7000 word and current application review, together with the retained +owned-ascent-contract recipe. Current role1526/event28141 is distinct from +that recipe's older role1421/event19592. Jerry Chen/CubeJerry and the +selected source's DreamingOfClouds, Ali Romman, Cinna Davis, zxv, unpaidmoon +and cumulative native/compiler/physical lineage retain their credit. + +#7426 at172f4535ce8dcff79f626410af845f757c1563be supplies the immutable +literal phase/compiler/source-evaluator files. #7430 at +39b40c465f7636a4bb6d70af28595fe8f70f4f3f supplies the immutable literal +CNOT geometry, unary helpers and fixed linear-word lifecycle. #7429 at +1a555e469b89af70d309bc966f8f813ac11dc887 supplies the immutable positive +first-slot leaf and concrete signed numerator guards. Their notices remain +under reference/. Preserve Jose Manuel Barranco, alejandrozu, the earlier +Gaussian/phase/counter writers and the #2772/#3089/#3091 norm/reserve lineage. + +The previous literal selected MOVE join, at +3a27ab1d302d13b1ce52411f8a174e7a32baab77, supplies the transaction and fixed +PC/port relocation scaffold, reused here for a different actual rank-two +operator. Its files and graph are unchanged. + +B1's permanent HOME constructor at +b4fcc9d64971fdabd0b1d82cfb749d8aac920437 and the MOVE/HOME bridge at +13c29e2df66ba46402d4da5f1d2489ebf333e5fe supply the retained tape graph, +simulation engine and six-code splitting/repacking/shifted-origin pattern. +Their exact small files/notices are retained. Credit the source-format, +Jacob Alan Sussman/#4268, zxv/#4359, Mihir Srivastava/#4507/#5071, +Matarener/#4691 and #6878 occurrence-layout lineage. The current signed +HOME ADD atdcd6352db7e5a5353498203c0c2699334019ba56 supplies the separately +charged following scalar ABI; it is not copied or executed as this MOVE. + +#6978 at12e58dfdad9371a26f9978c814779da344fd80b4 already implements +source-complete positive rank-rf leaves in its own coded descriptor and +states a provider-relative protected MOVE theorem. Its rank-two executions, +rank/header guard, source algebra and stated open literal/monomial join +retain priority. No first rank-two or algebra novelty is claimed here. +The clean square-zero/Pauli rank-two compiler packages concern different +contracts; their authors' scalar/reflection identities are not claimed new. + +Python performs finite table construction and verification only. The +executed service consists solely of local fixed-table instructions on a +fixed finite number of tapes. Source operator and simulation reuses are +identified as reuses, not independent newly authored mathematics. diff --git a/research/literal-owned-rank-two-move/implementation/OVERLAP.md b/research/literal-owned-rank-two-move/implementation/OVERLAP.md new file mode 100644 index 0000000000..3e152db589 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/OVERLAP.md @@ -0,0 +1,48 @@ +# Bounded source and novelty gate + +Main was e54523517d0f03e58352e647c403a5af3e525a57 throughout this wave. +The parent freshly checked #7494 atcc207c27143162efd9265e6792618d6646cdbcab +and #7493 at257e2e940900c04fa81ba391cc32fbf8f720b58e: fixed source/receiver +retiming obstructions, not this literal primitive. No exhaustive novelty +claim about unpublished work is made. + +Public pulls/issues searches on2026-11-13: + +* `28141`: zero results; +* `rank-two` plus `literal`:331 results, first30 titles inspected; +* `rank2` plus `tape`:five results, all titles inspected; +* `literal rank-two`:23 results, all titles inspected; +* `rank-2f` plus `literal`:two results; +* `rank-two` plus `fixed-tape`:47 results, first30 titles inspected. + +These are bounded GitHub search results; quoted-phrase matching can be +broader than exact phrase semantics. The exact direct predecessor #6978 +was read in full at12e58dfdad9371a26f9978c814779da344fd80b4, +research/current-coded-all-source-leaf/PROOF.md. It already gives arbitrary +rank-scaled positive children, including complete rank-two executions, +in the23-value coded native ABI. Section6 retains both monomial-provider +contracts and section7 explicitly leaves supplier-free monomial join and +flattened whole-MOVE lifecycle tables open. It is substantive prior work, +not relabelled as this package's algebra or a missing positive rank-two leaf. + +#7349 at9dfe6747b8553fd11b408f2b045c5954ef1e6eaa gives a literal rank-one +recursion controller with supplied payload hooks/row grants; it supplies +neither this actual kernel nor this HOME ABI. #5857/clean-rank-two-conjugators +and #3989/selected-rank2-intertwiner were compared through their canonical +README scopes: clean scalar/reflection compilation and Pauli/donor retiming, +with physical native primitives or macro/caller admission still separate. +They are not fixed tables for this bank/frame pair. + +The closest reusable literal modules are #7426 phase, #7430 two selected +binary words, #7429 first-slot C, the previous MOVE24472 transaction and +HOME bridge. Their exact source bytes are retained/pinned. The new matrix +words differ, and unchanged compile_linear accepts only its two original +matrix names. A small fixed-word emitter reuses its complete generic CNOT +routine. The new positive2f child is two unchanged first-slot leaves with +two explicit three-CNOT slot swaps; no header f-doubling is passed to those +nine-slot consumers. A new physical2f cutoff guard is required. + +The gate therefore permits this one source-bound fixed-table owned MOVE +and supplied Gamma6/HOME join, with O(fV+E) direct cost and numerical caller +premises. It permits no general catalogue expansion, faster nonleaf claim, +new kappa, full bank lifetime, typed INIT/receiver or endpoint-scale claim. diff --git a/research/literal-owned-rank-two-move/implementation/PR-DESCRIPTION.md b/research/literal-owned-rank-two-move/implementation/PR-DESCRIPTION.md new file mode 100644 index 0000000000..40c6964e29 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/PR-DESCRIPTION.md @@ -0,0 +1,74 @@ +The installed exact Gamma6/HOME MOVE handled a different rank-one event. +This contribution implements selected #7000's actual owned MOVE28141, +bank1526 from chart601=[137] to470=[75,137,265], with full source phase, +one positive C_(2f) action and same-owner return. The Boolean true records +owned storage; it is not an inversion selector. + +The new115776-location,31-tape local core uses the credited36 left/44 right +source records, two unchanged positive first-slot leaves and two explicit +three-CNOT slot swaps. A new literal guard compares2f with the actual encoded +cutoff. The original f, nine-slot9f geometry and six-Gamma header stay fixed. +The HOME graph has115953 states on35 tapes and commits only after every +factor returns. Cutoff and numerical failures leave original HOME unchanged. +Successful heads, private bodies/guards and opaque exteriors restore. + +The complete direct bounds are + +``` +T_core <=2^24(fV+E+1), K_core <=K_entry+1024(V+E+1), +T_HOME <=128(F+1)+2^24(fV+E+1), +K_HOME <=K_entry+1088(F+1), F=E+V. +``` + +These include both C blocks, all66 CNOTs, phases, encoded acquisition, +geometry, copies, staging, source returns and retirement. B1's full-bank +delivery/return remains separately paid. The theorem supplies a direct +reference/leaf primitive, with no faster nonleaf rate or changed kappa. + +Reproduce with Python3.12+ and the standard library: + +```sh +python -I -B research/literal-rank-two-owned-move/bind_source.py --source-repo /path/to/reference/repo +python -I -B research/literal-rank-two-owned-move/verify.py +python -I -O -B research/literal-rank-two-owned-move/verify.py +``` + +Normal/optimized scientific receipts agree. A full actual m=9,f=1 dense +Gaussian packet takes25854536 literal transitions and makes5132 HOME writes, +all after primitive return. A smaller nonzero packet reuses the same owners +in20881778 steps while retaining previous backing. A wrong full-graph phase +returns exactly i times the correct answer. f=1,cutoff=1 rejects with no +HOME writes. A separately constructed packet completes first C plus slot +swap, has its full intermediate WORK checked, and rejects the second C at +12803606 steps with no HOME writes. Source equality,1024 binary-map columns, +positive-C2 conjugation, inverse/phase/wrong-rank faults, changed retained +source bytes and26 guard-only headers through f129/4097-bit cutoff syntax +are covered. The latter are not full large-f DATA executions. Each complete +replay takes about22 seconds locally; the all-size proof is in PROOF.md. + +Source pins bind canonical e54523517d0f03e58352e647c403a5af3e525a57 and the +whole current archive. The source recipe's older role1421/event19592 is +distinguished from current1526/28141. Authenticated retained modules and +their notices are unchanged. Fresh absent bytecode prefixes protect source +imports. The core graph SHA256 is +6f440702d6d0b2428df1016f8006ae339699e8b9fe1cf9fe5dc0d2c111821adf. + +Supplied entry promises remain: a live typed owned packet, common grid, +positive Gamma6 geometry,2f<=cutoff, full spectators, phase fit, all2f +C-prefixes integral/fit, distinct physical owners and blank required private +windows. No endpoint scale or rounding is added. Original header/grid/width/F +return unchanged, allowing the existing following signed HOME ADD when its +receiver is supplied in the same frame470 and matching header/grid. The +actual typed producer, receiver INIT, four preceding SUB producers, dirty +CLEAR and full interleaved lifetime are not implemented or admitted here. +Failure cleanup/retry, arbitrary malformed inputs and interruption rollback +are unclaimed. All five selected assumptions remain. + +#6978 already supplies source-complete positive rank-two children in its +different23-value coded ABI and explicitly leaves the supplier-free monomial +and flattened whole-MOVE join open. This is the actual source-owned +Gamma6/HOME fixed table; no new rank-two algebra or first-leaf claim is made. +Credit #7426/#7430/#7429, the prior rank1 transaction, B1/HOME bridge, the +current signed-ADD ABI, #6978 and their retained Gaussian/native/compiler/ +physical authors. Prepared with substantial OpenAI Codex assistance, +Apache-2.0. No human or formal-kernel acceptance is asserted. diff --git a/research/literal-owned-rank-two-move/implementation/PR-TITLE.txt b/research/literal-owned-rank-two-move/implementation/PR-TITLE.txt new file mode 100644 index 0000000000..de696ca383 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/PR-TITLE.txt @@ -0,0 +1 @@ +Implement actual owned rank-two MOVE28141 on complete Gamma6 HOME fields diff --git a/research/literal-owned-rank-two-move/implementation/PROOF.md b/research/literal-owned-rank-two-move/implementation/PROOF.md new file mode 100644 index 0000000000..627e54e031 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/PROOF.md @@ -0,0 +1,316 @@ +# Actual owned rank-two MOVE28141 on the complete Gamma6/HOME boundary + +## 1. Source, orientation and quantified statement + +Canonical main is e54523517d0f03e58352e647c403a5af3e525a57. The actual +selected #7000 record at zero-based index28141 is +`[MOVE,1526,601,470,true]`. Its complete frames are `[137]` and +`[75,137,265]` in nine coordinates. The Boolean marks owned/private +storage. The operator is determined by the ordered frame pair: + +`U=T_470 T_601^*`, `U=L (C_0 C_1) R`. + +Here `C=(1/2)[[1+i,1-i],[1-i,1+i]]` is positive. The rank is two. +No inverse orientation is inferred from the Boolean. The retained owned +recipe has the same pair but old role1421/event19592; these are not the +current event/owner. `bind_source.py --source-repo` authenticates the whole +350722-byte archive and canonical word, extracts current28141, reconstructs +the lowering and checks full signed Pauli action and exact Gaussian phase. +The independent engine's separating-column argument determines the entire +512-column operator. All1024 columns of the two binary maps are also checked. + +Supply positive f,r,P,S,cutoff and w>=2, the exact six positive canonical +Gamma codes `(f,r,P,S,w,cutoff)`, and the complete lexicographic packed array + +`[P] x [2^f]^9 x [S]`, `V=2PSr2^(9f)w`, `F=E+V`. + +E counts every header bit, including a potentially enormous cutoff code. +At each address there are r Gaussian coefficients, real then imaginary, +each signed w-bit MSB-first. Their common caller quantum Delta is unchanged. +r is coefficient multiplicity. The native rank two changes neither r nor +the nine f-bit slots. The direct entry condition is **2f<=cutoff**. + +Require the right and left phase rotations to fit signed w bits, and every +output of each of the actual2f central C axes to be Gaussian-integral on +the same grid and fit signed w bits. Final fit alone does not supply these +prefix conditions. All complete spectators and coefficient fields remain. +The native local boundary supplies distinct owners, heads at their origins, +blank required private windows/guards and preserved opaque exteriors, as in +the retained factors. Existing historical backing remains charged. + +**Theorem.** One fixed115776-location,31-tape four-symbol local program +returns `U^(tensor f)` on the original DATA owner, restores HEADER, all heads, +private bodies/guards and opaque exteriors, under these promises. It checks +2f against the actual cutoff. A valid-format cutoff or numerical rejection +precedes every original DATA write; failure cleanup/retry is unclaimed. +Its complete successful direct bounds are + +`T_core<=2^24(fV+E+1)`, +`K_final<=K_entry+1024(V+E+1)`. + +The supplied packed HOME adapter emits115953 states on35 fixed tapes. It +returns the identical Gamma6 header and transformed DATA to the same owned +HOME1526, with + +`T_HOME<=128(F+1)+2^24(fV+E+1)`, +`K_final<=K_entry+1088(F+1)`. + +B1's general full-bank gathering/return is separately charged at its +`O(R K(F+1))` invoice. The test graph uses an already-reserved typed owned +entry. It constructs neither INIT1526 nor a complete enclosing caller. + +## 2. Exact nontrivial factors and all-column geometry + +The complete matrices, alpha/Q fields and80 retained records are in +RECIPE.json. In the source convention a monomial sends +`|x> -> i^q(x) |Gx>`; both offsets and constant phases are zero. The rows are + +``` +G_R=(258,11,321,66,4,328,16,32,128), +G_L=(6,11,16,34,64,128,3,256,1). +``` + +Its right phase is + +`q_R=x0+2x1+x3+2x6` +` +2(x0x1+x0x3+x0x6+x0x8+x1x3+x1x6+x1x8+x3x6+x3x8) mod4`. + +Its left phase is `q_L=2x0+3x1 mod4`. Q's diagonal is already encoded in +alpha and is not added twice. The left36 records consist of five S records +and31 CNOTs. The right44 consist of six S, nine CZ and29 CNOTs. The literal +phase compiler handles each complete phase in one body pass, retaining the +actual simultaneous residue and signed range guards. It does not serially +negate an intermediate component just to realize that record list. + +For columns x_j the phase is `sum_j q(x_j)` (the constant term is zero). +Each binary row addition acts on the matching bit j in its two complete +f-bit slots. The retained CNOT routine derives every prefix/middle/suffix +length from the original header and executes all f columns. Fixed word +order is preserved. The generic fixed-word emitter in rank2.py changes +only which fixed source CNOTs call that unchanged routine. Its proof applies +to any distinct fixed slot pair in0..8; no runtime matrix loader is used. + +Let S01 exchange slots0 and1 through the fixed CNOT word +`(0<-0 xor1),(1<-1 xor0),(0<-0 xor1)`. It is an exact permutation with no +phase. The chronological factor list is + +| Order | Literal component | +|---:|---| +|1|Rank-aware entry guard, original header retained| +|2|Right complete phase| +|3|Right29-CNOT binary map| +|4|Unchanged positive first-slot C leaf on all f axes| +|5|S01, three CNOTs on every column| +|6|Unchanged positive first-slot C leaf again| +|7|S01 again| +|8|Left complete phase| +|9|Left31-CNOT binary map| + +Because S01 C0 S01=C1 and the two disjoint C blocks commute, the central +time sequence C0,S01,C0,S01 is exactly `C0 C1`. This retains all9f address +bits and implements the desired positive `C^(tensor2f)` on the first two +slots. Setting the existing leaf header's f to2f would instead change its +hard-coded nine-slot volume to2^(18f); that is not this construction. + +The independent source engine checks the exact interleaved central circuit, +including its phase, against C0 C1. Tensoring this fixed product proves the +all-f result, including arbitrary full spectators and r coefficients. No +tensor power is distributed over a sum or scalar ADD. + +## 3. Literal rank-aware entry and complete transaction + +The new guard uses the retained Gamma/unary/binary comparison routines on +their same29 ports. It decodes f and captures its canonical binary digits +and length. It appends one physical zero to the captured binary word and +one mark to its length. These are exactly the digits/length of2f. The +original unary F guide and public header are unchanged. It decodes the other +four bounded integers, reads cutoff only in binary, compares length then +lexicographic digits, and returns/clears its complete work. It never loops +over the numerical cutoff. Thus f<=cutoff<2f rejects even though both +unchanged single-slot leaves would individually accept. + +The whole core clones original DATA once onto WORK and uses TRACE to return +the original head. Every factor's public DATA port is WORK, its HEADER port +is original HEADER, and private port t>=2 maps to t+2. WORK and TRACE are +distinct from all reused module-private owners. The maximum module port28 +maps to30, so ports0..30 suffice. Each retained instruction's port and PC +are relocated; its successful halt is a one-step goto continuation. No +runtime callback, scalar oracle, size-specialized table or free return +implements a component. + +Every completed factor returns all its heads and clears its private work. +Consequently the same27 module-private tapes can be reused by the next +factor. An intermediate public commit of a retained module changes only +WORK. The original DATA receives no write until all nine components have +returned. The single final V-bit copy installs the complete result on the +same original owner, records its return trace, erases WORK and disposes +WORK/TRACE guards. No owner is replaced, relabelled or given productive credit. + +Rejection may leave private data/heads dirty. The core has no original-DATA +WRITE before its final commit location115742. The HOME adapter similarly +keeps all core activity private and scatters only after complete successful +return. This proves original public preservation on the stated finite +cutoff/numerical failures, including failure in the second C pass after a +completed first C and swap. It does not prove interruption rollback or retry. + +## 4. Exact numerical domain and sufficient reserve + +The retained leaf uses actual w+2-bit signed temporary numerators and exact +parity/range guards. Its four real rows have three plus signs and one minus, +so their actual values lie within the proved w+2 range for signed w-bit +inputs. Each retained phase rejects a requested negation of the unique +most-negative component. Copying or swapping that component without +negation is permitted. These concrete conditions, not an abstract fused +Gaussian primitive, are the numerical premises in section1. + +A useful sufficient caller condition is: all original components are +divisible by2^f, bounded in absolute value by M, and + +`2^f M <= 2^(w-1)-1`. + +The credited denominator/component-norm facts for a j-axis C prefix give +denominator dividing2^ceil(j/2) and component maximum norm2^ceil(j/2). +For j<=2f, both exponents are at most f. R preserves divisibility and +component magnitude, so every actual central prefix is integral and +symmetric-range bounded; permutations and L's unit phase remain safe. +This is a sufficient reserve, not a necessary domain or new norm theorem. + +No scale, width converter or rounding is installed. The original common +quantum, w and all header bits return unchanged. The selected application +review's common grid p+D and width p+h+2D+3 provide a conditional semantic +route, but this module does not emit its actual parameter/header producer +or assert that it supplies the sufficient divisibility condition above. +A caller may instead prove the precise correlated-prefix premises. + +## 5. Complete time and historical backing + +Every local read, write, unit move, goto and halt costs one step. All scans, +descriptor production, source copies, arithmetic, component seeks, history +returns and retirement below are included. Source helper prices are exact: +rewind3n+3, unary clear7n+4, unary copy +`(6+5t+z)n+5e+7`, doubling47n+18. Gamma prefix values sum to less than the +decoded value. Set Z=f+r+P+S+w<=5V. + +For the rank guard, five conversions including their trace/capture work +fit256(E+Z+1), the appended binary/length marks fit32(E+1), binary cutoff +decoding and the length/lexicographic comparison fit128(E+1), and all +remaining guide/guard returns and erasure fit128(E+Z+1). These follow by +the displayed helper prices and constant-depth prefix/tail loops; every +extra retained binary track is at most E+1. The larger envelope +`1024(E+Z+1)<=6144(V+E+1)` therefore covers the guard. Reserve +`65536(V+E+1)` to simplify the aggregate. + +The unchanged per-CNOT geometry/pass/retirement proof gives a bound for any +fixed k-gate nine-slot word: + +`T_G(k)<=1024 k f(V+1)+8192(V+E+1)`. + +The per-gate price does not depend on the old selected19/27-word counts. +The new four words have k=29,3,3,31, for a total66 CNOTs. Their shapes, +geometry construction, complete clone/commit and cleanup are all paid. +The other credited complete bounds are + +* two first-slot leaves: each65536(fV+E+1); +* each m=9 phase: at most65536(E+65V+1); +* outer whole-call transaction: exactly31V+27. + +Their sum, with f(V+1)<=2fV and V<=fV, is at most + +`8884255 fV +360448 E +360475 <=2^24(fV+E+1)`. + +This counts both active C blocks and every helper; no separately unpaid +recursive child is hidden in the bill. It is a direct-leaf rate. At a fixed +admitted active-axis cutoff q,2f<=q makes it O_q(F+1). Encoded cutoff value +and E are not made constants by that statement. No faster nonleaf tariff, +global kappa or complete selected dispatcher follows. + +For historical backing, the guard visits at most6V+7E+57 additional cells: +five decoded unary guides, DOUBLE, header trace/length, binary words and +lengths, all guard/end cells and public header positions. This is below +64(V+E+1). Each fixed binary word and each C leaf has credited complete +increment64(V+E+1), independent of its fixed word length. Each phase fits +256(V+E+1). The outer WORK/TRACE transaction adds8(V+E+1). Adding rather +than refunding successive increments gives + +`(64+4*64+2*64+2*256+8)(V+E+1)=968(V+E+1)<1024(V+E+1)`. + +K_entry includes every owner's complete earlier/opaque backing. At fixed +origins shorter successful calls scan only current live bodies and reuse +already blank tails, while earlier visited maxima remain. Changed origins +require actual interval unions and separately paid corridors; erasure or +new virtual names do not refund backing. + +## 6. Supplied owned HOME and following scalar contacts + +The retained B1 adapter copies/splits exactly six Gamma codes and complete +DATA onto private native HEADER/DATA. Its native origins are B-relative2, +leaving guard cell1 blank and preserving permanent B origin marker^ at0. +Core ports map injectively to3..33 and the header-length guide uses34. +Thus35 fixed tapes suffice. A larger consumer may reuse these after return; +the rank2 service does not allocate one tape per column or coefficient. + +On successful core return, it copies HEADER then DATA back to the complete +operand, erases copies and restores all heads/guards to B origins. The +unchanged scan/count proof gives adapter time128(F+1) and increment64(F+1). +B1 scatters exactly F bits to the same immutable HOME. Its general +full-bank delivery/return remains O(R K(F+1)); one local adapter is not an +unpriced complete source caller. The test's two homes contain one parked +productive input and the supplied live owned1526 packet. Entry is +graph.execution_start, after reservation, and productive_count=1 is fixture +bookkeeping. Owned1526 receives no productive credit or typed INIT here. + +Because the operation returns the exact original header, w/grid, geometry +and F, the existing signed HOME ADD can consume1526 after this return if +receiver1515 is supplied in frame470 with the identical header/common grid. +Frame/grid equality is a typed premise, not inferred from header bits. +That ADD preserves source1526 and costs4096(F+1), with increment8(F+2). +The four exterior SUBs at28041/28129/28135/28139 require matching frame601 +packets beforehand. Their coefficients stay-1 for every f; they are not +tensor-powered scalar signs. The ADD at28159 stays+1. + +For just these five arithmetic contacts and one MOVE, a conservative +standalone primitive bill is + +`20608(F+1)+2^24(fV+E+1)`, + +plus actual B1 delivery/reservation and all source/receiver production. +This is a boundary compatibility/ledger, not a six-event execution or the +full9582-event interval. INIT28037, receiver INIT28153, subsequent-1/4 SCALE, +dirty CLEAR37618, all intervening events and their producers remain separate. +No zero-at-CLEAR or free release theorem is asserted. + +## 7. Evidence, overlap and limits + +The full actual m=9,f=1 dense Gaussian packet returns on its owned HOME in +25854536 transitions, with5132 HOME writes only after complete primitive +return. A smaller nonzero packet reuses the same owners in20881778 steps +and retains the larger previous guide history. A wrong full-graph constant +phase returns exactly i times the expected image, so the oracle separates +the actual absolute phase. All35 heads, bodies/guards and opaque exteriors +return on successful cases. The forward oracle uses the original two frame +circuits and complete numerator accumulation, not the emitted factor word. + +The cutoff rejection f=1,cutoff=1 takes118370 transitions with no HOME write. +A source-constructed numerical case completes first C plus slot swap after +12601857 steps, has its complete intermediate WORK checked, then rejects +the second C at12803606 steps, again with no HOME write. Its failure cleanup +is deliberately unclaimed. Twenty-six guard-only header cases reach f129 +and4097-bit cutoff syntax at distinct signed origins; those are not full +f2/f129 DATA executions. Actual changed retained bytes, wrong source phase, +inverse quotient and a one-C substitute are rejected/separated. + +Source-complete positive rank-two leaves and their rank-scaled23-value +descriptor/cutoff already exist in #6978. Its protected whole MOVE retains +the two monomial/ordinary-provider premises and explicitly leaves their +supplier-free/literal join open. The present object is this actual owned +601→470 fixed-table join and unchanged Gamma6/HOME packet, not new C tensor +algebra, new rank-two factorization or first rank-two leaf. The prior selected +rank1 join, phase/G/leaf tables and HOME adapter retain their credit. Related +rank-two clean scalar conjugators/Pauli fusion macros do not supply these +complete stream tables. Bounded searches and exact pins are in OVERLAP.md. + +No endpoint scaling, full lifetime, format producer, arbitrary malformed +packet guarantee, rejection reuse, materialized uniform source word or +nonleaf supplier is supplied. All five selected assumptions and +kappa=.00363005817 remain. This is an AI-authored proof and finite replay, +not human or formal-kernel acceptance. diff --git a/research/literal-owned-rank-two-move/implementation/README.md b/research/literal-owned-rank-two-move/implementation/README.md new file mode 100644 index 0000000000..37a32e3dd4 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/README.md @@ -0,0 +1,113 @@ +# Literal actual owned rank-two MOVE28141 + +This package implements selected #7000's actual +`[MOVE,1526,601,470,true]`: complete frames `[137]` to `[75,137,265]`. +The true Boolean denotes owned storage. The exact operator is +`T470 T601*`, including every source phase; it is a positive rank-two +quotient. Canonical main remains e54523517d0f03e58352e647c403a5af3e525a57. + +One fixed115776-location,31-tape four-symbol core joins the credited +36/44-record monomials and two positive first-slot C passes conjugated by +fixed slot swaps. It physically checks **2f<=cutoff** while preserving f, +all9f native address bits and the original six-Gamma header. Both affine +offsets and constant phases of this source recipe are zero; its nontrivial +quadratic/input phases are fully retained. + +The HOME adapter emits115953 states on35 fixed tapes. It installs the +completed packet on the identical owned HOME1526 and restores successful +private bodies, guards, heads and opaque exteriors. A single whole-call +private stage protects the original owner across both C passes. Cutoff or +numerical rejection precedes every HOME write. Failure retirement/retry is +unclaimed. + +Core graph SHA256: +`6f440702d6d0b2428df1016f8006ae339699e8b9fe1cf9fe5dc0d2c111821adf`. + +## Supplied entry and complete bounds + +Supply an already-reserved typed HOME body consisting of six positive Gamma +codes `(f,r,P,S,w,cutoff)` and complete packed DATA on +`[P] x [2^f]^9 x [S]`, with r Gaussian coefficients per address. Components +are signed w-bit MSB-first, real then imaginary, on a common unchanged grid. +Let `V=2PSr2^(9f)w`, E be all six code bits and F=E+V. Require w>=2, +2f<=cutoff, phase-rotation fit and every2f central C-prefix integral/fit. +Distinct physical owners, complete spectators, blank private windows and +the B1 permanent-origin/opaque-exterior boundary are supplied premises. + +Complete successful bounds, including encoded descriptors, every CNOT/C +axis, copying, source returns, staging, comparisons and retirement, are + +``` +T_core <= 2^24(fV+E+1), +K_core <= K_entry+1024(V+E+1), +T_HOME <= 128(F+1)+2^24(fV+E+1), +K_HOME <= K_entry+1088(F+1). +``` + +B1's full-bank gathering/return is separately paid. At a fixed active-axis +leaf cutoff q,2f<=q gives O_q(F+1). No faster nonleaf rate is claimed. +Earlier backing remains charged after erasure and shorter reuse. + +One sufficient numerical reserve is input components divisible by2^f and +bounded by M with `2^f M<=2^(w-1)-1`. The exact correlated-prefix domain is +larger. No endpoint scale, widened format or rounding is installed, and no +claim is made that the selected packet producer supplies that reserve. + +## Reproduction and evidence + +Python3.12+, standard library. From this directory: + +```sh +python -I -B bind_source.py --source-repo /path/to/read-only/reference/repo +python -I -B verify.py +python -I -O -B verify.py +``` + +The execution checker needs only retained local files; source-repo is an +optional full-archive authentication for the binder. Imports use fresh +absent cache prefixes before project/retained code, so old bytecode is not +substituted for authenticated source. `--write` explicitly regenerates +RESULT.json. Normal and optimized scientific receipts agree. Each complete +replay takes about22 seconds locally; timing is not a tariff proof. + +The actual m=9,f=1 dense Gaussian packet takes25854536 transitions and +writes exactly5132 HOME bits after complete primitive return. A smaller +nonzero packet reuses the same owners in20881778 steps, retaining previous +history. A full wrong-phase graph returns exactly i times the correct image. +The f=1,cutoff=1 case rejects in118370 steps without HOME writes. Another +case completes first C plus swap, checks the entire intermediate WORK, and +then rejects the second C at12803606 steps without HOME writes. Twenty-six +guard-only headers reach f129 and4097-bit cutoff syntax at distinct signed +origins. Those are not full f2/f129 DATA runs. + +The source binder checks full Pauli/Gaussian operator equality, all1024 +binary matrix columns, exact positive C2 conjugation, and phase/orientation/ +wrong-rank controls. Actual retained-source corruption is rejected. No huge +f2 execution, full selected cold replay, human or formal-kernel review is +claimed. The quantified result follows from PROOF.md and retained helper +invariants, with these finite replays as corroboration. + +## Compatibility, overlap and open work + +The original header/grid/width/geometry and F return unchanged, so the +existing signed HOME ADD/SUB ABI can consume this packet when its distinct +other operand has the identical header and supplied same frame/grid. +The following source ADD1526→1515 at28159 requires frame470; the four prior +SUBs require frame601. Typed initialization, real header/view production, +receiver1515, subsequent-1/4 SCALE, dirty retirement and the full interleaved +bank lifetime remain separate services. The restricted fixture has one +parked productive field and a supplied live owned packet; owned storage +does not earn productive credit. + +#6978 already supplies source-complete positive rank-two direct children in +its different23-value coded ABI and leaves the supplier-free monomial and +literal whole-MOVE join open. This contribution is this exact source-owned +Gamma6/HOME table, not new rank-two algebra or a first rank-two leaf. The +phase/G/C tables, original rank1 transaction and HOME adapter are credited +reuses. See NOTICE.md, OVERLAP.md, SOURCES.json and PROOF.md. + +Open next questions: independently audit this fixed graph and cost proof; +then bind an actual selected typed producer/receiver to this supplied entry. +Only after that should a complete owned lifetime or changed precision +wrapper be considered. All five selected assumptions and conditional +kappa=.00363005817 remain unchanged. Nothing is published by this worker. diff --git a/research/literal-owned-rank-two-move/implementation/RECIPE.json b/research/literal-owned-rank-two-move/implementation/RECIPE.json new file mode 100644 index 0000000000..04f5dc8367 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/RECIPE.json @@ -0,0 +1,490 @@ +{ + "source_event_index": 28141, + "source_event": [ + "MOVE", + 1526, + 601, + 470, + true + ], + "frames": { + "601": [ + 137 + ], + "470": [ + 75, + 137, + 265 + ] + }, + "retained_event": 19592, + "retained_role": 1421, + "rank": 2, + "left": { + "linear_Z4": [ + 2, + 3, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "matrix_rows": [ + 6, + 11, + 16, + 34, + 64, + 128, + 3, + 256, + 1 + ], + "offset": 0, + "phase": 0, + "quadratic_rows": [ + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + "right": { + "linear_Z4": [ + 1, + 2, + 0, + 1, + 0, + 0, + 2, + 0, + 0 + ], + "matrix_rows": [ + 258, + 11, + 321, + 66, + 4, + 328, + 16, + 32, + 128 + ], + "offset": 0, + "phase": 0, + "quadratic_rows": [ + 331, + 329, + 0, + 331, + 0, + 0, + 11, + 0, + 11 + ] + }, + "left_records": [ + [ + "S", + 0 + ], + [ + "S", + 0 + ], + [ + "S", + 1 + ], + [ + "S", + 1 + ], + [ + "S", + 1 + ], + [ + "XROW", + 7, + 8 + ], + [ + "XROW", + 8, + 7 + ], + [ + "XROW", + 7, + 8 + ], + [ + "XROW", + 2, + 5 + ], + [ + "XROW", + 1, + 5 + ], + [ + "XROW", + 0, + 5 + ], + [ + "XROW", + 5, + 8 + ], + [ + "XROW", + 8, + 5 + ], + [ + "XROW", + 5, + 8 + ], + [ + "XROW", + 4, + 6 + ], + [ + "XROW", + 6, + 4 + ], + [ + "XROW", + 4, + 6 + ], + [ + "XROW", + 8, + 3 + ], + [ + "XROW", + 0, + 3 + ], + [ + "XROW", + 3, + 6 + ], + [ + "XROW", + 6, + 3 + ], + [ + "XROW", + 3, + 6 + ], + [ + "XROW", + 8, + 2 + ], + [ + "XROW", + 1, + 2 + ], + [ + "XROW", + 0, + 2 + ], + [ + "XROW", + 2, + 3 + ], + [ + "XROW", + 3, + 2 + ], + [ + "XROW", + 2, + 3 + ], + [ + "XROW", + 8, + 1 + ], + [ + "XROW", + 3, + 1 + ], + [ + "XROW", + 0, + 1 + ], + [ + "XROW", + 8, + 0 + ], + [ + "XROW", + 6, + 0 + ], + [ + "XROW", + 0, + 1 + ], + [ + "XROW", + 1, + 0 + ], + [ + "XROW", + 0, + 1 + ] + ], + "right_records": [ + [ + "S", + 0 + ], + [ + "S", + 1 + ], + [ + "S", + 1 + ], + [ + "S", + 3 + ], + [ + "S", + 6 + ], + [ + "S", + 6 + ], + [ + "CZ", + 0, + 1 + ], + [ + "CZ", + 0, + 3 + ], + [ + "CZ", + 0, + 6 + ], + [ + "CZ", + 0, + 8 + ], + [ + "CZ", + 1, + 3 + ], + [ + "CZ", + 1, + 6 + ], + [ + "CZ", + 1, + 8 + ], + [ + "CZ", + 3, + 6 + ], + [ + "CZ", + 3, + 8 + ], + [ + "XROW", + 6, + 8 + ], + [ + "XROW", + 3, + 8 + ], + [ + "XROW", + 1, + 8 + ], + [ + "XROW", + 7, + 8 + ], + [ + "XROW", + 8, + 7 + ], + [ + "XROW", + 7, + 8 + ], + [ + "XROW", + 3, + 6 + ], + [ + "XROW", + 0, + 6 + ], + [ + "XROW", + 5, + 7 + ], + [ + "XROW", + 7, + 5 + ], + [ + "XROW", + 5, + 7 + ], + [ + "XROW", + 4, + 6 + ], + [ + "XROW", + 6, + 4 + ], + [ + "XROW", + 4, + 6 + ], + [ + "XROW", + 5, + 3 + ], + [ + "XROW", + 0, + 3 + ], + [ + "XROW", + 3, + 4 + ], + [ + "XROW", + 4, + 3 + ], + [ + "XROW", + 3, + 4 + ], + [ + "XROW", + 2, + 4 + ], + [ + "XROW", + 4, + 2 + ], + [ + "XROW", + 2, + 4 + ], + [ + "XROW", + 3, + 1 + ], + [ + "XROW", + 2, + 1 + ], + [ + "XROW", + 0, + 1 + ], + [ + "XROW", + 2, + 0 + ], + [ + "XROW", + 0, + 1 + ], + [ + "XROW", + 1, + 0 + ], + [ + "XROW", + 0, + 1 + ] + ] +} diff --git a/research/literal-owned-rank-two-move/implementation/REMOTE-BINDINGS.json b/research/literal-owned-rank-two-move/implementation/REMOTE-BINDINGS.json new file mode 100644 index 0000000000..107687b020 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/REMOTE-BINDINGS.json @@ -0,0 +1,26 @@ +{ + "scope": "Exact source strings compared with public GitHub commit:path resources on2026-11-13; not an independent science proof.", + "files": [ + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "13c29e2df66ba46402d4da5f1d2489ebf333e5fe", + "path": "research/source-bound-move-home-primitive/adapter.py", + "local": "reference/home/parent_adapter.py", + "remote_text_exact": true + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "13c29e2df66ba46402d4da5f1d2489ebf333e5fe", + "path": "research/source-bound-move-home-primitive/machine.py", + "local": "machine.py", + "remote_text_exact": true + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "b4fcc9d64971fdabd0b1d82cfb749d8aac920437", + "path": "research/compiler-permanent-home-dispatch/tape_graph.py", + "local": "reference/home/tape_graph.py", + "remote_text_exact": true + } + ] +} diff --git a/research/literal-owned-rank-two-move/implementation/RESULT.json b/research/literal-owned-rank-two-move/implementation/RESULT.json new file mode 100644 index 0000000000..c0f00d70f8 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/RESULT.json @@ -0,0 +1,265 @@ +{ + "HOME_states": 115953, + "controls": [ + "2f cutoff vs old f guard", + "full graph absolute phase", + "actual retained source corruption", + "inverse source orientation", + "one C instead of two", + "no early original-owner writes", + "second-child rejection after completed first C and slot swap" + ], + "core_graph_sha256": "6f440702d6d0b2428df1016f8006ae339699e8b9fe1cf9fe5dc0d2c111821adf", + "core_locations": 115776, + "core_tapes": 31, + "cutoff_rejection_steps": 118370, + "full_f1": { + "E": 12, + "F": 5132, + "HOME_writes": 5132, + "V": 5120, + "core_return_steps": 25813400, + "output_sha256": "86bc0bb8b0917c84613ffd1fb446237efb75a0f19924462803010117704e9d7e", + "shape": [ + 1, + 1, + 1, + 1, + 5, + 2 + ], + "steps": 25854536 + }, + "guard_cases": [ + { + "E": 16, + "accepted": false, + "cutoff_bitlength": 1, + "f": 1, + "steps": 679 + }, + { + "E": 18, + "accepted": true, + "cutoff_bitlength": 2, + "f": 1, + "steps": 1289 + }, + { + "E": 18, + "accepted": true, + "cutoff_bitlength": 2, + "f": 1, + "steps": 1278 + }, + { + "E": 20, + "accepted": false, + "cutoff_bitlength": 2, + "f": 2, + "steps": 811 + }, + { + "E": 22, + "accepted": true, + "cutoff_bitlength": 3, + "f": 2, + "steps": 1493 + }, + { + "E": 22, + "accepted": true, + "cutoff_bitlength": 3, + "f": 2, + "steps": 1482 + }, + { + "E": 22, + "accepted": false, + "cutoff_bitlength": 3, + "f": 3, + "steps": 889 + }, + { + "E": 22, + "accepted": true, + "cutoff_bitlength": 3, + "f": 3, + "steps": 1517 + }, + { + "E": 22, + "accepted": true, + "cutoff_bitlength": 3, + "f": 3, + "steps": 1506 + }, + { + "E": 26, + "accepted": false, + "cutoff_bitlength": 4, + "f": 5, + "steps": 1079 + }, + { + "E": 26, + "accepted": true, + "cutoff_bitlength": 4, + "f": 5, + "steps": 1775 + }, + { + "E": 26, + "accepted": true, + "cutoff_bitlength": 4, + "f": 5, + "steps": 1764 + }, + { + "E": 32, + "accepted": false, + "cutoff_bitlength": 5, + "f": 16, + "steps": 1724 + }, + { + "E": 34, + "accepted": true, + "cutoff_bitlength": 6, + "f": 16, + "steps": 2699 + }, + { + "E": 34, + "accepted": true, + "cutoff_bitlength": 6, + "f": 16, + "steps": 2688 + }, + { + "E": 42, + "accepted": false, + "cutoff_bitlength": 8, + "f": 65, + "steps": 4283 + }, + { + "E": 42, + "accepted": true, + "cutoff_bitlength": 8, + "f": 65, + "steps": 5615 + }, + { + "E": 42, + "accepted": true, + "cutoff_bitlength": 8, + "f": 65, + "steps": 5604 + }, + { + "E": 46, + "accepted": false, + "cutoff_bitlength": 9, + "f": 129, + "steps": 7387 + }, + { + "E": 46, + "accepted": true, + "cutoff_bitlength": 9, + "f": 129, + "steps": 9221 + }, + { + "E": 46, + "accepted": true, + "cutoff_bitlength": 9, + "f": 129, + "steps": 9210 + }, + { + "E": 142, + "accepted": true, + "cutoff_bitlength": 64, + "f": 1, + "steps": 4297 + }, + { + "E": 530, + "accepted": true, + "cutoff_bitlength": 258, + "f": 1, + "steps": 13803 + }, + { + "E": 1040, + "accepted": true, + "cutoff_bitlength": 513, + "f": 1, + "steps": 26298 + }, + { + "E": 2064, + "accepted": true, + "cutoff_bitlength": 1025, + "f": 1, + "steps": 51386 + }, + { + "E": 8208, + "accepted": true, + "cutoff_bitlength": 4097, + "f": 1, + "steps": 201914 + } + ], + "marker": "PASS_LITERAL_OWNED_RANK2_HOME", + "owned_entry": "supplied already-reserved raw-native-owned28141/1526; no INIT producer", + "same_owner_reuse": { + "F": 4232, + "entry_guide_high": 15419, + "retained_guide_high": 15419, + "shape": [ + 1, + 1, + 1, + 1, + 4, + 9223372036854775808 + ], + "steps": 20881778 + }, + "scope": "Exact supplied Gamma6/HOME leaf primitive only; no full lifetime, endpoint conversion or nonleaf rate.", + "second_child_rejection": { + "HOME_writes": 0, + "first_child_completed_steps": 12601857, + "rejection_steps": 12803606 + }, + "source": { + "controls": [ + "absolute_phase", + "inverse_orientation", + "one_C_instead_of_two" + ], + "event_index": 28141, + "exact_equality": "signed Pauli action and exact Gaussian separating column", + "frames": [ + 601, + 470 + ], + "full_archive_reextracted": false, + "left_CNOT": 31, + "left_records": 36, + "marker": "PASS_OWNED_RANK2_SOURCE", + "matrix_columns": 1024, + "owner": 1526, + "private": true, + "private_flag_is_not_inversion": true, + "rank": 2, + "right_CNOT": 29, + "right_records": 44 + }, + "tapes": 35, + "wrong_phase_full_steps": 25854536 +} diff --git a/research/literal-owned-rank-two-move/implementation/SOURCE-BINDING.json b/research/literal-owned-rank-two-move/implementation/SOURCE-BINDING.json new file mode 100644 index 0000000000..7048caf474 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/SOURCE-BINDING.json @@ -0,0 +1,24 @@ +{ + "controls": [ + "absolute_phase", + "inverse_orientation", + "one_C_instead_of_two" + ], + "event_index": 28141, + "exact_equality": "signed Pauli action and exact Gaussian separating column", + "frames": [ + 601, + 470 + ], + "full_archive_reextracted": true, + "left_CNOT": 31, + "left_records": 36, + "marker": "PASS_OWNED_RANK2_SOURCE", + "matrix_columns": 1024, + "owner": 1526, + "private": true, + "private_flag_is_not_inversion": true, + "rank": 2, + "right_CNOT": 29, + "right_records": 44 +} diff --git a/research/literal-owned-rank-two-move/implementation/SOURCES.json b/research/literal-owned-rank-two-move/implementation/SOURCES.json new file mode 100644 index 0000000000..0ea6091131 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/SOURCES.json @@ -0,0 +1,232 @@ +{ + "schema": "literal-rank2-source-pins/1", + "canonical_main": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "39b40c465f7636a4bb6d70af28595fe8f70f4f3f", + "path": "research/literal-selected-linear-maps/linear.py", + "local": "reference/linear/linear.py", + "bytes": 13102, + "sha256": "d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33", + "blob": "6aad40a6c47ed4415917c86fabbd5227a3819a41" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "39b40c465f7636a4bb6d70af28595fe8f70f4f3f", + "path": "research/literal-selected-linear-maps/inputs/controller_reference.py", + "local": "reference/linear/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "blob": "3ab6d0361f35038ffcdf0cf81a157f7a17b40e72" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "39b40c465f7636a4bb6d70af28595fe8f70f4f3f", + "path": "research/literal-selected-linear-maps/NOTICE.md", + "local": "reference/linear/NOTICE.md", + "bytes": 2180, + "sha256": "2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50", + "blob": "3a3030f23df347c1e45ddf92d2083f89ed16cc67" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "172f4535ce8dcff79f626410af845f757c1563be", + "path": "research/literal-native-quadratic-phase/phase.py", + "local": "reference/phase/phase.py", + "bytes": 11734, + "sha256": "2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7", + "blob": "d48978145821fc4a62d534bef2bef9449bda883a" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "172f4535ce8dcff79f626410af845f757c1563be", + "path": "research/literal-native-quadratic-phase/inputs/controller_reference.py", + "local": "reference/phase/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "blob": "3ab6d0361f35038ffcdf0cf81a157f7a17b40e72" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "172f4535ce8dcff79f626410af845f757c1563be", + "path": "research/literal-native-quadratic-phase/NOTICE", + "local": "reference/phase/NOTICE", + "bytes": 808, + "sha256": "5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0", + "blob": "7a1f1da9c59d40b1e72905fee5344a8db9ca4353" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "1a555e469b89af70d309bc966f8f813ac11dc887", + "path": "research/literal-positive-c-leaf/leaf.py", + "local": "reference/leaf/leaf.py", + "bytes": 17526, + "sha256": "bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744", + "blob": "bdcc80cbd8b64c601e6d69b7d25ece444b8b1ae2" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "1a555e469b89af70d309bc966f8f813ac11dc887", + "path": "research/literal-positive-c-leaf/inputs/controller_reference.py", + "local": "reference/leaf/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "blob": "3ab6d0361f35038ffcdf0cf81a157f7a17b40e72" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "1a555e469b89af70d309bc966f8f813ac11dc887", + "path": "research/literal-positive-c-leaf/NOTICE.md", + "local": "reference/leaf/NOTICE.md", + "bytes": 1900, + "sha256": "773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf", + "blob": "71c5f6dae2c799ce5d76c544e98d1ee7c52ef76c" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "172f4535ce8dcff79f626410af845f757c1563be", + "path": "research/literal-native-quadratic-phase/reference/clifford_exact.py", + "local": "reference/source/clifford_exact.py", + "bytes": 6824, + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "blob": "166841a037f069249f6f7f6dedb89248812f59e2" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "172f4535ce8dcff79f626410af845f757c1563be", + "path": "research/literal-native-quadratic-phase/reference/native_verify.py", + "local": "reference/source/native_verify.py", + "bytes": 12323, + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38", + "blob": "2c209dfa9cfade3bc20ac5fc9d876b433a147f8c" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "b4fcc9d64971fdabd0b1d82cfb749d8aac920437", + "path": "research/compiler-permanent-home-dispatch/tape_graph.py", + "local": "reference/home/tape_graph.py", + "bytes": 12069, + "sha256": "7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54", + "blob": "f307133f2b0bba2e5969825cb814503d819322e7" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "13c29e2df66ba46402d4da5f1d2489ebf333e5fe", + "path": "research/source-bound-move-home-primitive/machine.py", + "local": "machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee", + "blob": "fcd4ac01f03a4689fe9fa45d4ca5ea95950103da" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "13c29e2df66ba46402d4da5f1d2489ebf333e5fe", + "path": "research/source-bound-move-home-primitive/adapter.py", + "local": "reference/home/parent_adapter.py", + "bytes": 5353, + "sha256": "04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099", + "blob": "10606f87dcfa0781bcae900d95cb86925961d453" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "13c29e2df66ba46402d4da5f1d2489ebf333e5fe", + "path": "research/source-bound-move-home-primitive/NOTICE.md", + "local": "reference/home/NOTICE.md", + "bytes": 2093, + "sha256": "b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842", + "blob": "db83fd95e175c90a2f9e51545b4be4557fbb919e" + } + ], + "generated": [ + { + "local": "RECIPE.json", + "sha256": "b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702" + } + ], + "upstream_artifacts": [ + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "172f4535ce8dcff79f626410af845f757c1563be", + "path": "research/literal-native-quadratic-phase/reference/selected-native.json.gz", + "bytes": 350722, + "sha256": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883", + "blob": "74563a7867d9d762b6588f65362369668841bb3e", + "canonical_sha256": "91429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097" + } + ], + "proof_inputs": [ + { + "repository": "CrocSwap/integer-mult-bounds", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/owned-ascent-contract/RECIPES.json", + "bytes": 126616, + "sha256": "d6753d91211e7c919519835b1e3da04bb165674ab3c93cd74e4768ca0c7e444f", + "blob": "bde1249d259e8633c9a5eb6afceae12bfb3cd351", + "role": "exact retained36/44 record recipe and older identity" + }, + { + "repository": "CrocSwap/integer-mult-bounds", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/owned-ascent-contract/PROOF.md", + "bytes": 17222, + "sha256": "6479ac35c78a773adde421fdb1127472554c7687f038c4516d5ae8a962f4120d", + "blob": "32ff104fa88f7968ac5f66f804f28565bfcd84aa", + "role": "owned quotient/lifetime and dirty-return scope" + }, + { + "repository": "CrocSwap/integer-mult-bounds", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/owned-ascent-contract/verify.py", + "bytes": 12434, + "sha256": "748bcd3a4d78002ff065c67872650bf9bfae8f0ab87fef8af2bfda4d4a31d2e6", + "blob": "b3683d81a1b4b6f7468cf3cb52f6144375d3377f", + "role": "ownership flag source semantics" + }, + { + "repository": "CrocSwap/integer-mult-bounds", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md", + "bytes": 25533, + "sha256": "4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055", + "blob": "3dd1af2285e597676725e85ad4f65e7ad326d695", + "role": "current exact common grid, full factor and exterior scalar contract" + }, + { + "repository": "CrocSwap/integer-mult-bounds", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/current-coded-all-source-leaf/PROOF.md", + "bytes": 20312, + "sha256": "2943afc32745929374e8e55daff82b5fa78baa8a557d82b231d04b936c63c10d", + "blob": "5d619cfc2d3b7bc51e6fcc8e7a46ecd1e313e23d", + "role": "prior source-complete rank-two coded child and open supplier-free/literal join" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "39b40c465f7636a4bb6d70af28595fe8f70f4f3f", + "path": "research/literal-selected-linear-maps/PROOF.md", + "bytes": 17153, + "sha256": "217b6bbe9271aa5d5c0f0999a231d7386c7ba3fc432a88e3796d70ca283eb322", + "blob": "38f9adc04e3fb87d43dd92cfd3bd667a65d04238", + "role": "generic fixed CNOT geometry, per-gate cost and backing" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "172f4535ce8dcff79f626410af845f757c1563be", + "path": "research/literal-native-quadratic-phase/PROOF.md", + "bytes": 17878, + "sha256": "55f0a575f618bf467d0e25a25802053455d701cee1f23fb8811a671a1bd59ff3", + "blob": "46a43bf214d828aa972db66ad35e41b9cd07a964", + "role": "generic fixed m9 phase and complete cost/backing" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "1a555e469b89af70d309bc966f8f813ac11dc887", + "path": "research/literal-positive-c-leaf/PROOF.md", + "bytes": 16608, + "sha256": "c99157c3c43ae490b858cdbce04d85f3661ca5d9752770506d18ec4876c4ed6c", + "blob": "a8ae6684d55e3a1aaa7f2aa432f15ae9db580b11", + "role": "first-slot C exact numerator/prefix/cutoff/cost/backing" + } + ] +} diff --git a/research/literal-owned-rank-two-move/implementation/adapter.py b/research/literal-owned-rank-two-move/implementation/adapter.py new file mode 100644 index 0000000000..d3da08da10 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/adapter.py @@ -0,0 +1,134 @@ +"""Paid six-Gamma||DATA ABI for actual MOVE28141. Apache-2.0; Codex-assisted. + +Python constructors run only offline. Runtime is local Graph transitions. +""" +from functools import cache +from hashlib import sha256 +import importlib.util +from pathlib import Path +import sys +import json + +HERE=Path(__file__).resolve().parent +sys.dont_write_bytecode=True +sys.pycache_prefix=str(HERE/'_unwritten_bytecode_cache') +if Path(sys.pycache_prefix).exists(): + raise ValueError('bytecode isolation path must remain absent') +NATIVE=HERE +B1=HERE/'reference/home/tape_graph.py' +for pin in json.loads((HERE/'SOURCES.json').read_text())['files']: + raw=(HERE/pin['local']).read_bytes() + if len(raw)!=pin['bytes'] or sha256(raw).hexdigest()!=pin['sha256']: + raise ValueError('frozen source drift: '+pin['local']) + + +def load(name,path): + spec=importlib.util.spec_from_file_location(name,path) + module=importlib.util.module_from_spec(spec);sys.modules[name]=module + spec.loader.exec_module(module) + return module + + +if sha256(B1.read_bytes()).hexdigest()!='7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54': + raise ValueError('B1 graph source drift') +D=load('home_move_dispatch',B1) +C=load('home_move_native',NATIVE/'rank2.py') +CORE_BASE,GUIDE,TAPES=3,34,35 +HOME_OWNERS=(('parked-productive-input',0),('raw-native-owned-occurrence',28141,1526)) + + +@cache +def core(mutation=None): + code,alphabet,_=C._compile_move(mutation) + if (mutation is None and len(code)!=115776) or alphabet!=('_','0','1','|'): + raise ValueError('changed actual selected table') + if mutation is None and sha256(repr(code).encode()).hexdigest()!='6f440702d6d0b2428df1016f8006ae339699e8b9fe1cf9fe5dc0d2c111821adf': + raise ValueError('changed actual rank-two instruction graph') + return code + + +def steps(g,tape,count,target): + for _ in range(abs(count)): + target=g.jump(target,((tape,1 if count>0 else -1),)) + return target + + +def copy_out(g,source,target,after): + state=g.state('repack') + g.add(state,after,tests=((source,'_'),)) + for bit in '01': + g.add(state,state,tests=((source,bit),),writes=((target,bit),(source,'_')), + moves=((source,1),(target,1))) + return state + + +def embed(g,code,after): + labels=[g.state('MOVE28141') for _ in code] + for pc,(op,*args) in enumerate(code): + state=labels[pc];g.rules.setdefault(state,[]) + nxt=labels[pc+1] if pc+1> record[2]) & 1) << record[1] + wanted = sum(((row & x).bit_count() & 1) << i for i, row in enumerate(r[side]['matrix_rows'])) + need(z == wanted, side + ' complete binary matrix') + # Independently compare the exact interleaved central circuit, including + # its phase, with two positive coordinate C operators. + swap = (2, 1, 4, 8, 16, 32, 64, 128, 256) + interleaved = [('C', 1, 1), ('P', swap), ('C', 1, 1), ('P', swap)] + exact.equal(interleaved, [('C', 1, 1), ('C', 2, 1)], 'rank-two conjugated child') + controls = [] + wrong = copy.deepcopy(recipe) + wrong['right']['phase'] = (wrong['right']['phase'] + 1) % 4 + for label, actual, expected in ( + ('absolute_phase', exact.recipe(wrong), target), + ('inverse_orientation', exact.recipe(recipe), exact.adjoint(target)), + ('one_C_instead_of_two', [('C', 1, 1)], [('C', 1, 1), ('C', 2, 1)]), + ): + try: + exact.equal(actual, expected, label) + except ValueError: + controls.append(label) + else: + raise ValueError('missed source control ' + label) + return dict(marker='PASS_OWNED_RANK2_SOURCE', event_index=28141, owner=1526, + private=True, private_flag_is_not_inversion=True, frames=[601, 470], rank=2, + left_records=36, right_records=44, left_CNOT=31, right_CNOT=29, + matrix_columns=1024, full_archive_reextracted=repo is not None, + exact_equality='signed Pauli action and exact Gaussian separating column', + controls=controls) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--source-repo', type=Path) + args = parser.parse_args() + print(json.dumps(verify(args.source_repo), indent=2, sort_keys=True)) diff --git a/research/literal-owned-rank-two-move/implementation/machine.py b/research/literal-owned-rank-two-move/implementation/machine.py new file mode 100644 index 0000000000..fcd4ac01f0 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/machine.py @@ -0,0 +1,129 @@ +"""Dense interpreter of literal Graphs; observers never drive control. Apache-2.0.""" +from dataclasses import dataclass +SYMBOLS={s:i for i,s in enumerate('_01^|$')} + + +class Rejected(ValueError):pass +class MonitorViolation(ValueError):pass + + +@dataclass +class State: + tapes:list + heads:list + origins:list + lows:list + highs:list + entry_lows:list + entry_highs:list + writes:list + steps:int=0 + + def clone(self): + return State([bytearray(t) for t in self.tapes],self.heads.copy(),self.origins.copy(), + self.lows.copy(),self.highs.copy(),self.entry_lows.copy(),self.entry_highs.copy(), + self.writes.copy(),self.steps) + + +def initial(payloads,tape_count,*,old_history=0): + if len(payloads)!=2 or len(payloads[0])!=len(payloads[1]) or not payloads[0]: + raise ValueError('two complete same-F source homes') + f=len(payloads[0]);capacity=16*(f+128)+256 + origins=[17+(t%7) for t in range(tape_count)] + text='^'+'|'.join(payloads)+'|$' + tapes=[bytearray(capacity) for _ in range(tape_count)] + for tape,o in zip(tapes,origins): + tape[o]=SYMBOLS['^'];tape[o-3:o]=bytes([2,1,4]);tape[-3:]=bytes([1,4,2]) + o=origins[0];tapes[0][o:o+len(text)]=bytes(SYMBOLS[s] for s in text) + lows=origins.copy();highs=origins.copy();highs[0]=o+len(text)-1 + if old_history:highs[-1]=origins[-1]+old_history + return State(tapes,origins.copy(),origins,lows.copy(),highs.copy(),lows,highs,[0]*tape_count) + + +class Program: + def __init__(self,graph): + names=list(graph.rules);self.labels={name:i for i,name in enumerate(names)} + self.labels['HALT']=-1;self.start=self.labels[graph.start];self.rows=[] + for name in names: + rules=[(tuple((t,SYMBOLS[s]) for t,s in r.tests), + tuple((t,SYMBOLS[s]) for t,s in r.writes),r.moves, + self.labels[r.target]) for r in graph.rules[name]] + if rules and all(len(r[0])==1 and not r[1] and not r[2] for r in rules) and len({r[0][0][0] for r in rules})==1: + branch=[-2]*6 + for r in rules:branch[r[0][0][1]]=r[3] + self.rows.append((0,rules[0][0][0][0],branch)) + elif len(rules)==1 and not rules[0][0]: + _,writes,moves,nxt=rules[0] + if len(writes)==1 and not moves:self.rows.append((1,writes[0][0],(writes[0][1],nxt))) + elif len(moves)==1 and not writes:self.rows.append((2,moves[0][0],(moves[0][1],nxt))) + elif not moves and not writes:self.rows.append((3,nxt,None)) + else:self.rows.append((4,rules,None)) + else:self.rows.append((4,rules,None)) + + def run(self,state,*,start=None,stop=None,budget=100000000): + pc=self.start if start is None else self.labels[start] + stop_pc=None if stop is None else self.labels[stop] + rows=self.rows;tapes=state.tapes;heads=state.heads + lows=state.lows;highs=state.highs;writes=state.writes + while pc!=-1 and pc!=stop_pc: + op,t,arg=rows[pc] + if op==0: + pc=arg[tapes[t][heads[t]]] + if pc==-2:raise Rejected('literal scanned-symbol rejection') + elif op==1: + value,pc=arg + if heads[t]==state.origins[t] and value!=3: + raise MonitorViolation('attempted permanent B origin marker overwrite') + tapes[t][heads[t]]=value;writes[t]+=1 + elif op==2: + delta,pc=arg + if delta not in (-1,0,1):raise ValueError('nonunit emitted move') + heads[t]+=delta + if not 0<=heads[t]budget:raise ValueError('finite execution budget') + return state + + def _general(self,state,rules): + tapes=state.tapes;heads=state.heads;lows=state.lows;highs=state.highs;writes=state.writes + found=None + for rule in rules: + if all(tapes[t][heads[t]]==symbol for t,symbol in rule[0]): + if found is not None:raise ValueError('nondeterministic emitted table') + found=rule + if found is None:raise Rejected('literal scanned-symbol rejection') + for t,value in found[1]: + if heads[t]==state.origins[t] and value!=SYMBOLS['^']: + raise MonitorViolation('attempted permanent B origin marker overwrite') + tapes[t][heads[t]]=value;writes[t]+=1 + for t,delta in found[2]: + if delta not in (-1,0,1):raise ValueError('nonunit emitted move') + heads[t]+=delta + if not 0<=heads[t]0 else -1),)) + return target + + +def copy_out(g,source,target,after): + state=g.state('repack') + g.add(state,after,tests=((source,'_'),)) + for bit in '01': + g.add(state,state,tests=((source,bit),),writes=((target,bit),(source,'_')), + moves=((source,1),(target,1))) + return state + + +def embed(g,code,after): + labels=[g.state('MOVE24472') for _ in code] + for pc,(op,*args) in enumerate(code): + state=labels[pc];g.rules.setdefault(state,[]) + nxt=labels[pc+1] if pc+1= len(self.cells): + self.cells.extend('_' for _ in range(self.head+1-len(self.cells))) + self.cells[self.head] = value + self.peak = max(self.peak, len(self.cells)) + + def move(self, delta): + if delta not in (-1,0,1): + raise ValueError('one physical transition moves at most one cell') + if self.head+delta < 0: + raise ValueError('head crossed permanent origin') + self.head += delta + self.visited.add(self.head) + self.peak = max(self.peak,self.head+1) + + def contents(self): + return ''.join(self.cells) + + +@dataclass(frozen=True) +class Rule: + tests: tuple + writes: tuple + moves: tuple + target: str + + +class Graph: + def __init__(self): + self.rules = {} + self.serial = 0 + self.start = None + self.execution_start = None + self.checkpoints = {} + + def state(self, stem): + result = f'{stem}.{self.serial}' + self.serial += 1 + return result + + def add(self, state, target, tests=(), writes=(), moves=()): + self.rules.setdefault(state, []).append(Rule(tuple(tests), tuple(writes), + tuple(moves), target)) + + def jump(self, target, moves=()): + state = self.state('jump') + self.add(state, target, moves=moves) + return state + + def rewind(self, tape, target, erase=False): + state = self.state('erase' if erase else 'rewind') + self.add(state, target, tests=((tape, '^'),)) + for symbol in ALPHABET.replace('^', ''): + self.add(state, state, tests=((tape, symbol),), + writes=((tape, '_'),) if erase else (), moves=((tape, -1),)) + return state + + def validate(self): + # Exact symbolic determinism: two patterns overlap iff every shared + # tested tape has the same symbol. No wildcard expansion is needed. + for state, rules in self.rules.items(): + for i, a in enumerate(rules): + if a.target not in self.rules and a.target != 'HALT': + raise ValueError('undefined graph continuation') + for b in rules[:i]: + left, right = dict(a.tests), dict(b.tests) + if all(left[t] == right[t] for t in left.keys() & right.keys()): + raise ValueError('nondeterministic graph state '+state) + + def run(self, tapes, limit=10000000, checkpoint=None, start=None): + state, steps = self.start if start is None else start, 0 + while state != 'HALT': + if checkpoint and state in self.checkpoints: + checkpoint(self.checkpoints[state], tapes) + if steps >= limit: + raise ValueError('literal graph execution capacity') + matches = [r for r in self.rules[state] + if all(tapes[t].read() == value for t, value in r.tests)] + if len(matches) != 1: + raise ValueError('malformed tape or nondeterministic transition '+state) + rule, = matches + for tape, value in rule.writes: + tapes[tape].write(value) + for tape, delta in rule.moves: + tapes[tape].move(delta) + state, steps = rule.target, steps+1 + if checkpoint and 'HALT' in self.checkpoints: + checkpoint(self.checkpoints['HALT'], tapes) + return steps + + +def service(graph, name, arity, target): + """Four small supplied primitive graphs used ONLY by finite fixtures. + + Real scientific scalar/route/leaf graphs are still premises of the theorem. + Tapes 1,2 are operands; tape 3 is retained private primitive scratch. + """ + if name == 'REV': + if arity != 1: + raise ValueError('unary reversal') + cleanup = graph.rewind(3, target, erase=True) + back_operand = graph.rewind(1, cleanup) + copy = graph.state('reverse-install') + graph.add(copy, back_operand, tests=((3, '|'),), writes=((1, '|'),)) + for bit in '01': + graph.add(copy, copy, tests=((3, bit),), writes=((1, bit),), + moves=((1, 1), (3, 1))) + install = graph.jump(copy, ((1, 1), (3, 1))) + rewind_scratch = graph.rewind(3, install) + reverse = graph.state('reverse-copy') + graph.add(reverse, rewind_scratch, tests=((1, '^'),), writes=((3, '|'),)) + for bit in '01': + graph.add(reverse, reverse, tests=((1, bit),), writes=((3, bit),), + moves=((1, -1), (3, 1))) + begin_reverse = graph.jump(reverse, ((1, -1), (3, 1))) + seek = graph.state('reverse-seek') + graph.add(seek, begin_reverse, tests=((1, '|'),)) + for bit in '01': + graph.add(seek, seek, tests=((1, bit),), moves=((1, 1),)) + return graph.jump(seek, ((1, 1),)) + if name == 'FIRST': + if arity != 1: + raise ValueError('unary leaf fixture') + at = graph.state('first-bit') + for bit in '01': + graph.add(at, target, tests=((1, bit),), writes=((1, str(1-int(bit))),), + moves=((1, -1),)) + return graph.jump(at, ((1, 1),)) + if name not in ('ZERO', 'NOT', 'XOR') or arity != (2 if name == 'XOR' else 1): + raise ValueError('missing supplied primitive graph') + cleanup = target + for tape in range(arity, 0, -1): + cleanup = graph.rewind(tape, cleanup) + loop = graph.state('primitive-'+name) + graph.add(loop, cleanup, tests=tuple((t, '|') for t in range(1, arity+1))) + if name == 'XOR': + for a in '01': + for b in '01': + graph.add(loop, loop, tests=((1, a), (2, b)), + writes=((2, str(int(a)^int(b))),), moves=((1, 1), (2, 1))) + else: + for bit in '01': + graph.add(loop, loop, tests=((1, bit),), + writes=((1, '0' if name == 'ZERO' else str(1-int(bit))),), + moves=((1, 1),)) + return graph.jump(loop, tuple((t, 1) for t in range(1, arity+1))) + + +def scan(graph, homes, selected, gather, target): + """Unroll finite home order; scan arbitrary F only by field delimiters.""" + next_state = graph.rewind(0, target) + for home in range(homes-1, -1, -1): + work = selected.get(home) + after = next_state + loop = graph.state('gather' if gather else 'return') + if work: + graph.add(loop, after, tests=((0, '|'),) if gather else ((0, '|'), (work, '|')), + writes=((work, '|'),) if gather else (), moves=((0, 1),)) + else: + graph.add(loop, after, tests=((0, '|'),), moves=((0, 1),)) + for bit in '01': + if not work: + graph.add(loop, loop, tests=((0, bit),), moves=((0, 1),)) + elif gather: + graph.add(loop, loop, tests=((0, bit),), writes=((work, bit),), + moves=((0, 1), (work, 1))) + else: + for output in '01': + graph.add(loop, loop, tests=((0, bit), (work, output)), + writes=((0, output),), moves=((0, 1), (work, 1))) + next_state = graph.jump(loop, ((work, 1),)) if work else loop + return graph.jump(next_state, ((0, 1),)) + + +def reserve(graph, extra_homes, target): + """Append full zero homes by copying first-field extent, without F arithmetic.""" + if not extra_homes: + return target + return_home = graph.rewind(0, target) + finish = graph.state('reserve-finish') + graph.add(finish, return_home, writes=((0, '$'),)) + next_state = graph.rewind(3, finish, erase=True) + for position in range(extra_homes-1,-1,-1): + loop = graph.state('reserve-zero-home') + graph.add(loop, loop, tests=((3, '0'),), writes=((0, '0'),), moves=((0, 1),(3, 1))) + graph.add(loop, next_state, tests=((3, '|'),), writes=((0, '|'),), moves=((0, 1),)) + begin = graph.jump(loop, ((3, 1),)) + next_state = graph.rewind(3, begin) if position else begin + seek = graph.state('reserve-seek-end') + graph.add(seek, next_state, tests=((0, '$'),)) + for symbol in '^01|': + graph.add(seek, seek, tests=((0, symbol),), moves=((0, 1),)) + rewind_template = graph.rewind(3, seek) + rewind_home = graph.rewind(0, rewind_template) + copy = graph.state('reserve-copy-extent') + for bit in '01': + graph.add(copy, copy, tests=((0, bit),), writes=((3, '0'),), moves=((0, 1),(3, 1))) + graph.add(copy, rewind_home, tests=((0, '|'),), writes=((3, '|'),)) + return graph.jump(copy, ((0, 1),(3, 1))) + + +def compile_graph(events, owners, primitive=service, productive_count=None): + """Return a real transition graph on four tapes for the fixture family. + + General theorem: replace primitive by supplied finite graphs using m + scratch tapes; tape count is 1+b+m, independently of Q,K,F. + """ + graph, next_state = Graph(), 'HALT' + home_index = {owner: i for i, owner in enumerate(owners)} + if len(home_index) != len(owners): + raise ValueError('permanent home owner identities must be distinct') + for index in range(len(events)-1, -1, -1): + event = events[index] + if not event.service: + continue + graph.checkpoints[next_state] = index + if not 1 <= len(event.owners) <= 2 or len(set(event.owners)) != len(event.owners): + raise ValueError('bounded distinct physical operands') + selected = {home_index[owner]: i+1 for i, owner in enumerate(event.owners)} + cleanup = next_state + for tape in range(len(event.owners), 0, -1): + cleanup = graph.rewind(tape, cleanup, erase=True) + scatter = scan(graph, len(owners), selected, False, cleanup) + invoke = primitive(graph, event.service, len(event.owners), scatter) + origin = invoke + for tape in range(len(event.owners), 0, -1): + origin = graph.rewind(tape, origin) + next_state = scan(graph, len(owners), selected, True, origin) + graph.execution_start = next_state + productive_count = len(owners) if productive_count is None else productive_count + if not 1 <= productive_count <= len(owners): + raise ValueError('positive productive count within permanent bank') + graph.start = reserve(graph,len(owners)-productive_count,next_state) + graph.validate() + return graph + + +def initial_tapes(payloads, home_count, preformatted=False): + if not payloads or len({len(x) for x in payloads}) != 1 or not payloads[0]: + raise ValueError('positive common full field format') + if len(payloads) > home_count or any(set(x)-set('01') for x in payloads): + raise ValueError('binary productive bank in declared homes') + # Only productive fields are supplied. New private extents are prepared + # by the literal reserve graph. Optional preformatting is for fault tests. + fields = list(payloads) + if preformatted: + fields += ['0'*len(payloads[0])]*(home_count-len(payloads)) + return [Tape('^'+'|'.join(fields)+'|$'), Tape(), Tape(), Tape()] + + +def decoded(tapes, home_count): + raw = tapes[0].contents() + if raw[0] != '^' or not raw.endswith('|$'): + raise ValueError('home boundaries changed') + fields = tuple(raw[1:-2].split('|')) + if len(fields) != home_count: + raise ValueError('permanent home count changed') + return fields diff --git a/research/literal-owned-rank-two-move/implementation/reference/leaf/NOTICE.md b/research/literal-owned-rank-two-move/implementation/reference/leaf/NOTICE.md new file mode 100644 index 0000000000..71c5f6dae2 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/reference/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/literal-owned-rank-two-move/implementation/reference/leaf/inputs/controller_reference.py b/research/literal-owned-rank-two-move/implementation/reference/leaf/inputs/controller_reference.py new file mode 100644 index 0000000000..3ab6d0361f --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/reference/leaf/inputs/controller_reference.py @@ -0,0 +1,112 @@ +"""Finite three-tape online rank-recursion control; Apache-2.0. +Only PC and local symbols affect execution. Metrics/event logs are observers. +""" +from dataclasses import dataclass, field +BLANK, ONE, MARK = '_', '1', '|' +WIDTH, CHILD, STACK = range(3) + +class Builder: + def __init__(self): self.code, self.labels, self.serial = [], {}, 0 + def mark(self,n): + if n in self.labels: raise ValueError('duplicate label') + self.labels[n]=len(self.code) + def op(self,*x): self.code.append(x) + def rewind(self,t,symbols): + self.serial+=1; loop=f'rw{self.serial}'; done=loop+'done' + self.op('move',t,-1); self.mark(loop) + self.op('read',t,{s:loop+'step' for s in symbols}|{MARK:done}) + self.mark(loop+'step'); self.op('move',t,-1); self.op('goto',loop) + self.mark(done); self.op('move',t,1) + def finish(self,alphabet): + result=[] + for op,*a in self.code: + if op=='goto': a[0]=self.labels[a[0]] + elif op=='read': a[1]={s:self.labels[n] for s,n in a[1].items()} + result.append((op,*a)) + return tuple(result),tuple(alphabet) + +def compile_controller(m,ranks): + """Parameters are compile-time constants, absent from run-time state.""" + if type(m) is not int or m<2 or not ranks: raise ValueError('bad fixed profile') + if any(type(r) is not int or not 1<=r=budget: raise ValueError('finite verifier budget') + self.step() + return self + +def initial_tapes(width,origins=(0,0,0),ancestor=('0','1','t0','_','|','0')): + if width<1: raise ValueError('positive width') + u,c,p=origins + return [Tape({u-1:MARK,**{u+i:ONE for i in range(width)}},u),Tape({c-1:MARK},c), + Tape({p-1:MARK,**{p-2-i:s for i,s in enumerate(ancestor) if s!=BLANK}},p)] diff --git a/research/literal-owned-rank-two-move/implementation/reference/leaf/leaf.py b/research/literal-owned-rank-two-move/implementation/reference/leaf/leaf.py new file mode 100644 index 0000000000..bdcc80cbd8 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/reference/leaf/leaf.py @@ -0,0 +1,564 @@ +"""Literal positive rank-one Gaussian C tensor leaf on a packed m=9 field. + +Prepared for Jerry Chen / CubeJerry with substantial OpenAI assistance. +Apache-2.0. C arithmetic and tensor algebra are credited #3091 predecessors. +Only fixed local instructions execute; encoded inputs do not specialize code. +""" +from pathlib import Path +import hashlib +import sys + +HERE = Path(__file__).resolve().parent +MACHINE = HERE / 'inputs' / 'controller_reference.py' +EXPECTED_MACHINE = 'e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73' +if hashlib.sha256(MACHINE.read_bytes()).hexdigest() != EXPECTED_MACHINE: + raise ValueError('frozen literal machine source drift') +sys.path.insert(0, str(MACHINE.parent)) +from controller_reference import Builder, Machine, Tape, BLANK, ONE, MARK + +(HEADER, DATA, A, B, MODE, HTRACE, LENGTH, DOUBLE, F, R, P, S, WIDTH, + FBIN, FLEN, TBIN, TLEN, PREFIX, SUFFIX, LEFT, RIGHT, LOUT, ROUT, + AR, AI, BR, BI, NUM, DTRACE) = range(29) +PRIVATE = tuple(range(2, 29)) +BITS = ('0', ONE) +INPUTS = (AR, AI, BR, BI) +ROWS = ((1, -1, 1, 1), (1, 1, -1, 1), + (1, 1, 1, -1), (-1, 1, 1, 1)) +NATIVE_DIMENSION = 9 + + +def fresh(a, stem): + a.serial += 1 + return stem + str(a.serial) + + +def clear(a, tape, symbols=(ONE,)): + k = fresh(a, 'clear') + a.mark(k) + a.op('read', tape, {s: k+'bit' for s in symbols} | {BLANK: k+'done'}) + a.mark(k+'bit') + a.op('write', tape, BLANK) + a.op('move', tape, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(tape, (BLANK,)) + + +def unary_copy(a, source, target, *, repeat=1, extra=0, erase=False): + k = fresh(a, 'copy') + a.mark(k) + a.op('read', source, {ONE: k+'bit', BLANK: k+'done'}) + a.mark(k+'bit') + for _ in range(repeat): + a.op('write', target, ONE) + a.op('move', target, 1) + if erase: + a.op('write', source, BLANK) + a.op('move', source, 1) + a.op('goto', k) + a.mark(k+'done') + for _ in range(extra): + a.op('write', target, ONE) + a.op('move', target, 1) + a.rewind(source, (BLANK,) if erase else (ONE,)) + a.rewind(target, (ONE,)) + + +def trace_return(a, tape, trace): + k = fresh(a, 'return') + a.op('move', trace, -1) + a.mark(k) + a.op('read', trace, {ONE: k+'bit', MARK: k+'done'}) + a.mark(k+'bit') + a.op('write', trace, BLANK) + a.op('move', trace, -1) + a.op('move', tape, -1) + a.op('goto', k) + a.mark(k+'done') + a.op('move', trace, 1) + + +def header_step(a): + a.op('write', HTRACE, ONE) + a.op('move', HTRACE, 1) + a.op('move', HEADER, 1) + + +def gamma(a, target, capture=None): + """Unary decode for parameters bounded by the actual field volume.""" + k = fresh(a, 'gamma') + a.mark(k+'prefix') + a.op('read', HEADER, {'0': k+'zero', ONE: k+'one'}) + a.mark(k+'zero') + a.op('write', LENGTH, ONE) + a.op('move', LENGTH, 1) + header_step(a) + a.op('goto', k+'prefix') + a.mark(k+'one') + header_step(a) + a.op('write', target, ONE) + if capture: + for tape, bit in ((capture[0], ONE), (capture[1], ONE)): + a.op('write', tape, bit) + a.op('move', tape, 1) + a.op('move', LENGTH, -1) + a.mark(k+'tail') + a.op('read', LENGTH, {ONE: k+'tailbit', MARK: k+'done'}) + a.mark(k+'tailbit') + a.op('write', LENGTH, BLANK) + a.op('read', HEADER, {str(b): k+'digit'+str(b) for b in (0, 1)}) + for bit in (0, 1): + a.mark(k+'digit'+str(bit)) + unary_copy(a, target, DOUBLE, repeat=2, extra=bit) + clear(a, target) + unary_copy(a, DOUBLE, target, erase=True) + if capture: + for tape, symbol in ((capture[0], str(bit)), (capture[1], ONE)): + a.op('write', tape, symbol) + a.op('move', tape, 1) + header_step(a) + a.op('move', LENGTH, -1) + a.op('goto', k+'tail') + a.mark(k+'done') + a.op('move', LENGTH, 1) + if capture: + a.rewind(capture[0], BITS) + a.rewind(capture[1], (ONE,)) + + +def gamma_binary(a): + """Keep cutoff in binary: its represented value can exceed V arbitrarily.""" + k = fresh(a, 'threshold') + a.mark(k+'prefix') + a.op('read', HEADER, {'0': k+'zero', ONE: k+'one'}) + a.mark(k+'zero') + a.op('write', LENGTH, ONE) + a.op('move', LENGTH, 1) + header_step(a) + a.op('goto', k+'prefix') + a.mark(k+'one') + a.op('write', TBIN, ONE) + a.op('move', TBIN, 1) + a.op('write', TLEN, ONE) + a.op('move', TLEN, 1) + header_step(a) + a.op('move', LENGTH, -1) + a.mark(k+'tail') + a.op('read', LENGTH, {ONE: k+'read', MARK: k+'done'}) + a.mark(k+'read') + a.op('write', LENGTH, BLANK) + a.op('read', HEADER, {str(b): k+str(b) for b in (0, 1)}) + for bit in ('0', ONE): + a.mark(k+bit) + a.op('write', TBIN, bit) + a.op('move', TBIN, 1) + a.op('write', TLEN, ONE) + a.op('move', TLEN, 1) + header_step(a) + a.op('move', LENGTH, -1) + a.op('goto', k+'tail') + a.mark(k+'done') + a.op('move', LENGTH, 1) + a.rewind(TBIN, BITS) + a.rewind(TLEN, (ONE,)) + + +def cutoff_guard(a): + k = fresh(a, 'compare') + a.mark(k+'length') + a.op('read', FLEN, {ONE: k+'fmore', BLANK: k+'fend'}) + a.mark(k+'fmore') + a.op('read', TLEN, {ONE: k+'step', BLANK: 'reject'}) + a.mark(k+'step') + a.op('move', FLEN, 1) + a.op('move', TLEN, 1) + a.op('goto', k+'length') + a.mark(k+'fend') + a.op('read', TLEN, {ONE: k+'done', BLANK: k+'equal_length'}) + a.mark(k+'equal_length') + a.rewind(FLEN, (ONE,)) + a.rewind(TLEN, (ONE,)) + a.mark(k+'lex') + a.op('read', FBIN, {'0': k+'f0', ONE: k+'f1', BLANK: k+'equal'}) + a.mark(k+'f0') + a.op('read', TBIN, {'0': k+'same', ONE: k+'done'}) + a.mark(k+'f1') + a.op('read', TBIN, {'0': 'reject', ONE: k+'same'}) + a.mark(k+'same') + a.op('move', FBIN, 1) + a.op('move', TBIN, 1) + a.op('goto', k+'lex') + a.mark(k+'equal') + a.op('read', TBIN, {BLANK: k+'done'}) + a.mark(k+'done') + for tape, symbols in ((FLEN, (ONE,)), (TLEN, (ONE,)), (FBIN, BITS), (TBIN, BITS)): + a.rewind(tape, symbols) + clear(a, tape, symbols) + + +def double(a, tape): + unary_copy(a, tape, DOUBLE, repeat=2) + clear(a, tape) + unary_copy(a, DOUBLE, tape, erase=True) + + +def halve(a, tape): + k = fresh(a, 'halve') + a.mark(k) + a.op('read', tape, {ONE: k+'first', BLANK: k+'done'}) + a.mark(k+'first') + a.op('write', tape, BLANK) + a.op('move', tape, 1) + a.op('read', tape, {ONE: k+'second', BLANK: 'reject'}) + a.mark(k+'second') + a.op('write', tape, BLANK) + a.op('move', tape, 1) + a.op('write', DOUBLE, ONE) + a.op('move', DOUBLE, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(tape, (BLANK,)) + a.rewind(DOUBLE, (ONE,)) + unary_copy(a, DOUBLE, tape, erase=True) + + +def product(a, left, right, target): + k = fresh(a, 'product') + a.mark(k+'outer') + a.op('read', left, {ONE: k+'inner', BLANK: k+'done'}) + a.mark(k+'inner') + a.op('read', right, {ONE: k+'bit', BLANK: k+'row'}) + a.mark(k+'bit') + a.op('write', target, ONE) + a.op('move', target, 1) + a.op('move', right, 1) + a.op('goto', k+'inner') + a.mark(k+'row') + a.rewind(right, (ONE,)) + a.op('move', left, 1) + a.op('goto', k+'outer') + a.mark(k+'done') + a.rewind(left, (ONE,)) + a.rewind(target, (ONE,)) + + +def geometry(a): + product(a, S, R, SUFFIX) + unary_copy(a, P, PREFIX) + k = fresh(a, 'geometry') + a.mark(k+'suffix') + a.op('read', F, {ONE: k+'block', BLANK: k+'suffix_done'}) + a.mark(k+'block') + for _ in range(NATIVE_DIMENSION-1): + double(a, SUFFIX) + a.op('move', F, 1) + a.op('goto', k+'suffix') + a.mark(k+'suffix_done') + a.rewind(F, (ONE,)) + a.op('move', F, 1) + a.mark(k+'prefix') + a.op('read', F, {ONE: k+'more', BLANK: k+'done'}) + a.mark(k+'more') + double(a, PREFIX) + a.op('move', F, 1) + a.op('goto', k+'prefix') + a.mark(k+'done') + a.rewind(F, (ONE,)) + for tape in (P, R, S): + clear(a, tape) + + +def copy_width(a, source, target, *, rewind_target=False): + k = fresh(a, 'widthcopy') + a.mark(k) + a.op('read', WIDTH, {ONE: k+'read', BLANK: k+'done'}) + a.mark(k+'read') + a.op('read', source, {str(b): k+str(b) for b in (0, 1)}) + for bit in ('0', ONE): + a.mark(k+bit) + a.op('write', target, bit) + a.op('move', target, 1) + a.op('write', source, BLANK) + a.op('move', source, 1) + a.op('move', WIDTH, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(WIDTH, (ONE,)) + if rewind_target: + a.rewind(target, BITS) + + +def load_suffix(a, source, target): + k = fresh(a, 'suffix') + a.mark(k) + a.op('read', SUFFIX, {ONE: k+'pair', BLANK: k+'done'}) + a.mark(k+'pair') + for _ in range(2): + copy_width(a, source, target) + a.op('move', SUFFIX, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(SUFFIX, (ONE,)) + a.rewind(target, BITS) + + +def emit_stream(a, source, target): + k = fresh(a, 'stream') + a.mark(k) + a.op('read', source, {str(b): k+str(b) for b in (0, 1)} | {BLANK: k+'done'}) + for bit in ('0', ONE): + a.mark(k+bit) + a.op('write', target, bit) + a.op('move', target, 1) + a.op('write', source, BLANK) + a.op('move', source, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(source, (BLANK,)) + + +def tuple_branch(a, label, emit, prefix=()): + """Compile the fixed sixteen branches of a four-symbol read.""" + name = label+''.join(map(str, prefix)) + a.mark(name) + if len(prefix) == 4: + emit(prefix) + else: + a.op('read', INPUTS[len(prefix)], {str(b): name+str(b) for b in (0, 1)}) + for bit in (0, 1): + tuple_branch(a, label, emit, prefix+(bit,)) + + +def c_component(a, signs, output): + """Exact four-input numerator, two sign extensions, halving and fit.""" + k = fresh(a, 'C') + a.mark(k+'seek') + a.op('read', WIDTH, {ONE: k+'seekbit', BLANK: k+'seekend'}) + a.mark(k+'seekbit') + for tape in INPUTS: + a.op('move', tape, 1) + a.op('move', WIDTH, 1) + a.op('goto', k+'seek') + a.mark(k+'seekend') + a.rewind(WIDTH, (ONE,)) + for tape in INPUTS: + a.op('move', tape, -1) + a.op('goto', k+'digit0') + for carry in (-1, 0, 1, 2): + label = k+'digit'+str(carry) + a.mark(label) + a.op('read', WIDTH, {ONE: label+'read', BLANK: k+'extend'+str(carry)}) + def digit(bits, carry=carry): + total = carry+sum(s*b for s, b in zip(signs, bits)) + a.op('write', NUM, str(total % 2)) + a.op('move', NUM, 1) + for tape in INPUTS: + a.op('move', tape, -1) + a.op('move', WIDTH, 1) + a.op('goto', k+'digit'+str(total//2)) + tuple_branch(a, label+'read', digit) + a.mark(k+'extend'+str(carry)) + for tape in INPUTS: + a.op('move', tape, 1) + a.rewind(WIDTH, (ONE,)) + a.op('goto', k+'sign1c'+str(carry)) + for stage in (1, 2): + for carry in (-1, 0, 1, 2): + def extension(bits, carry=carry, stage=stage): + total = carry+sum(s*b for s, b in zip(signs, bits)) + a.op('write', NUM, str(total % 2)) + a.op('move', NUM, 1) + a.op('goto', k+'sign2c'+str(total//2) if stage == 1 else k+'check') + tuple_branch(a, k+'sign'+str(stage)+'c'+str(carry), extension) + a.mark(k+'check') + a.rewind(NUM, BITS) + a.op('read', NUM, {'0': k+'even', ONE: 'reject'}) + a.mark(k+'even') + a.op('write', NUM, BLANK) + a.op('move', NUM, 1) + a.mark(k+'highseek') + a.op('read', NUM, {'0': k+'highstep', ONE: k+'highstep', BLANK: k+'highend'}) + a.mark(k+'highstep') + a.op('move', NUM, 1) + a.op('goto', k+'highseek') + a.mark(k+'highend') + a.op('move', NUM, -1) + a.op('read', NUM, {str(b): k+'top'+str(b) for b in (0, 1)}) + for bit in ('0', ONE): + a.mark(k+'top'+bit) + a.op('write', NUM, BLANK) + a.op('move', NUM, -1) + a.op('read', NUM, {bit: k+'emit'}) + a.mark(k+'emit') + a.op('read', WIDTH, {ONE: k+'emitread', BLANK: k+'done'}) + a.mark(k+'emitread') + a.op('read', NUM, {str(b): k+'emit'+str(b) for b in (0, 1)}) + for bit in ('0', ONE): + a.mark(k+'emit'+bit) + a.op('write', output, bit) + a.op('move', output, 1) + a.op('write', NUM, BLANK) + a.op('move', NUM, -1) + a.op('move', WIDTH, 1) + a.op('goto', k+'emit') + a.mark(k+'done') + a.rewind(WIDTH, (ONE,)) + + +def clone_source(a): + """Clone exactly the generated volume; reject short/excess cardinality.""" + k = fresh(a, 'clone') + a.mark(k+'prefix') + a.op('read', PREFIX, {ONE: k+'blocks', BLANK: k+'done'}) + a.mark(k+'blocks') + for side in range(2): + name = k+'side'+str(side) + a.mark(name) + a.op('read', SUFFIX, {ONE: name+'coefficient', BLANK: name+'done'}) + a.mark(name+'coefficient') + for component in range(2): + field = name+'field'+str(component) + a.mark(field) + a.op('read', WIDTH, {ONE: field+'read', BLANK: field+'done'}) + a.mark(field+'read') + a.op('read', DATA, {str(b): field+str(b) for b in (0, 1)}) + for bit in ('0', ONE): + a.mark(field+bit) + a.op('write', A, bit) + a.op('move', A, 1) + a.op('move', DATA, 1) + a.op('write', DTRACE, ONE) + a.op('move', DTRACE, 1) + a.op('move', WIDTH, 1) + a.op('goto', field) + a.mark(field+'done') + a.rewind(WIDTH, (ONE,)) + a.op('move', SUFFIX, 1) + a.op('goto', name) + a.mark(name+'done') + a.rewind(SUFFIX, (ONE,)) + a.op('move', PREFIX, 1) + a.op('goto', k+'prefix') + a.mark(k+'done') + a.rewind(PREFIX, (ONE,)) + a.op('read', DATA, {BLANK: k+'verified'}) + a.mark(k+'verified') + trace_return(a, DATA, DTRACE) + a.rewind(A, BITS) + + +def commit(a, source): + k = fresh(a, 'commit') + a.mark(k) + a.op('read', source, {str(b): k+str(b) for b in (0, 1)} | {BLANK: k+'done'}) + for bit in ('0', ONE): + a.mark(k+bit) + a.op('write', DATA, bit) + a.op('write', source, BLANK) + a.op('move', source, 1) + a.op('move', DATA, 1) + a.op('write', DTRACE, ONE) + a.op('move', DTRACE, 1) + a.op('goto', k) + a.mark(k+'done') + trace_return(a, DATA, DTRACE) + a.rewind(source, (BLANK,)) + + +def compile_leaf(): + a = Builder() + for tape in PRIVATE: + a.op('move', tape, -1) + a.op('write', tape, MARK) + a.op('move', tape, 1) + gamma(a, F, (FBIN, FLEN)) + for tape in (R, P, S, WIDTH): + gamma(a, tape) + gamma_binary(a) + trace_return(a, HEADER, HTRACE) + cutoff_guard(a) + for i in range(2): + a.op('read', WIDTH, {ONE: 'width'+str(i)}) + a.mark('width'+str(i)) + a.op('move', WIDTH, 1) + a.rewind(WIDTH, (ONE,)) + geometry(a) + clone_source(a) + a.op('write', MODE, '0') + a.mark('prefix') + a.op('read', PREFIX, {ONE: 'load_select', BLANK: 'axis_end'}) + a.mark('load_select') + a.op('read', MODE, {'0': 'loadA', ONE: 'loadB'}) + for mode, source in enumerate((A, B)): + a.mark('load'+('A' if mode == 0 else 'B')) + load_suffix(a, source, LEFT) + load_suffix(a, source, RIGHT) + a.op('goto', 'pairs') + a.mark('pairs') + a.op('read', SUFFIX, {ONE: 'pair', BLANK: 'pairs_done'}) + a.mark('pair') + for source, target in ((LEFT, AR), (LEFT, AI), (RIGHT, BR), (RIGHT, BI)): + copy_width(a, source, target, rewind_target=True) + for signs, output in zip(ROWS, (LOUT, LOUT, ROUT, ROUT)): + c_component(a, signs, output) + for tape in INPUTS: + clear(a, tape, BITS) + a.op('move', SUFFIX, 1) + a.op('goto', 'pairs') + a.mark('pairs_done') + a.rewind(SUFFIX, (ONE,)) + for tape in (LEFT, RIGHT): + a.rewind(tape, (BLANK,)) + for tape in (LOUT, ROUT): + a.rewind(tape, BITS) + a.op('read', MODE, {'0': 'mergeB', ONE: 'mergeA'}) + for name, target in (('mergeB', B), ('mergeA', A)): + a.mark(name) + emit_stream(a, LOUT, target) + emit_stream(a, ROUT, target) + a.op('goto', 'prefix_done') + a.mark('prefix_done') + a.op('move', PREFIX, 1) + a.op('goto', 'prefix') + a.mark('axis_end') + a.op('read', MODE, {'0': 'endA', ONE: 'endB'}) + for mode, source, target in ((0, A, B), (1, B, A)): + name = 'end'+('A' if mode == 0 else 'B') + a.mark(name) + a.op('read', source, {BLANK: name+'valid'}) + a.mark(name+'valid') + a.rewind(source, (BLANK,)) + a.rewind(target, BITS) + a.op('write', MODE, str(1-mode)) + a.op('goto', 'axis_done') + a.mark('axis_done') + a.rewind(PREFIX, (ONE,)) + a.op('move', F, 1) + a.op('read', F, {ONE: 'next_axis', BLANK: 'finish'}) + a.mark('next_axis') + double(a, SUFFIX) + halve(a, PREFIX) + a.op('goto', 'prefix') + a.mark('finish') + a.op('read', MODE, {'0': 'commitA', ONE: 'commitB'}) + for name, source in (('commitA', A), ('commitB', B)): + a.mark(name) + commit(a, source) + a.op('goto', 'retire') + a.mark('retire') + a.rewind(F, (ONE,)) + for tape in (F, WIDTH, PREFIX, SUFFIX): + clear(a, tape) + clear(a, MODE, BITS) + for tape in PRIVATE: + a.op('move', tape, -1) + a.op('write', tape, BLANK) + a.op('move', tape, 1) + a.op('halt') + a.mark('reject') + a.op('read', HEADER, {}) + return a.finish((BLANK, '0', ONE, MARK)) + + + + diff --git a/research/literal-owned-rank-two-move/implementation/reference/linear/NOTICE.md b/research/literal-owned-rank-two-move/implementation/reference/linear/NOTICE.md new file mode 100644 index 0000000000..3a3030f23d --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/reference/linear/NOTICE.md @@ -0,0 +1,36 @@ +# Attribution and scope + +New construction, source binding, uniform complete-cost proof, author checks +and packaging were prepared for Jerry Chen (@CubeJerry), with substantial +OpenAI assistance. Independent receipts identify the separate executing +reviewer and distinct methods. No human or proof-kernel verification of the +multiplication theorem is claimed. New work is Apache-2.0. + +Credit Matarener's #3825 controlled reversal and #3834's finite identity +check; David Arias's #2776/fixed-tape-ordered-shear split/merge, unary conversion +and local return method; the fixed-tape-affine-shear runtime-coefficient +extension and its credited Charles Bethin unit-carry predecessor; JoyboyBrian's +#5188 complete literal interchange and binary-alphabet successor; Jose Manuel's +physical Gaussian monomial and #3087/#4172 lineage; the selected monomial +record lift; and #6992's current serial-column implication and conditional +bill. These algebraic and routing methods are not new claims here. + +The #7000 selected native/compiler/application-review authors supply the +actual word, exact Clifford lowering, signed Gaussian interpreter and phase +conventions. Their retained source notices are unchanged. + +The published controller `9dfe6747b8553fd11b408f2b045c5954ef1e6eaa` supplies +Builder/Machine/Tape. The literal layer phase +`8b549ca6557ccbb3017b104b27ea35051f990416`, selected quadratic phase +`172f4535ce8dcff79f626410af845f757c1563be`, and positive C leaf +`1a555e469b89af70d309bc966f8f813ac11dc887` supply the shared packed interface +and reusable local acquisition/copy/return patterns. Exact reference copies +and source pins are retained. The new `fresh` adds a label delimiter to avoid +decimal label collisions in the larger compile-time word. + +C4's dense author-test interpreter is retained as a source reference. This +package changes its fixed inventory from 29 to 27 and raises only its external +watchdog. That reuse is not presented as independently written review. Root's +independent interpreter/oracle were written separately and are retained +unchanged. No invented PR number is used for newly published fork branches; +they are identified by exact commits until a PR exists. diff --git a/research/literal-owned-rank-two-move/implementation/reference/linear/inputs/controller_reference.py b/research/literal-owned-rank-two-move/implementation/reference/linear/inputs/controller_reference.py new file mode 100644 index 0000000000..3ab6d0361f --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/reference/linear/inputs/controller_reference.py @@ -0,0 +1,112 @@ +"""Finite three-tape online rank-recursion control; Apache-2.0. +Only PC and local symbols affect execution. Metrics/event logs are observers. +""" +from dataclasses import dataclass, field +BLANK, ONE, MARK = '_', '1', '|' +WIDTH, CHILD, STACK = range(3) + +class Builder: + def __init__(self): self.code, self.labels, self.serial = [], {}, 0 + def mark(self,n): + if n in self.labels: raise ValueError('duplicate label') + self.labels[n]=len(self.code) + def op(self,*x): self.code.append(x) + def rewind(self,t,symbols): + self.serial+=1; loop=f'rw{self.serial}'; done=loop+'done' + self.op('move',t,-1); self.mark(loop) + self.op('read',t,{s:loop+'step' for s in symbols}|{MARK:done}) + self.mark(loop+'step'); self.op('move',t,-1); self.op('goto',loop) + self.mark(done); self.op('move',t,1) + def finish(self,alphabet): + result=[] + for op,*a in self.code: + if op=='goto': a[0]=self.labels[a[0]] + elif op=='read': a[1]={s:self.labels[n] for s,n in a[1].items()} + result.append((op,*a)) + return tuple(result),tuple(alphabet) + +def compile_controller(m,ranks): + """Parameters are compile-time constants, absent from run-time state.""" + if type(m) is not int or m<2 or not ranks: raise ValueError('bad fixed profile') + if any(type(r) is not int or not 1<=r=budget: raise ValueError('finite verifier budget') + self.step() + return self + +def initial_tapes(width,origins=(0,0,0),ancestor=('0','1','t0','_','|','0')): + if width<1: raise ValueError('positive width') + u,c,p=origins + return [Tape({u-1:MARK,**{u+i:ONE for i in range(width)}},u),Tape({c-1:MARK},c), + Tape({p-1:MARK,**{p-2-i:s for i,s in enumerate(ancestor) if s!=BLANK}},p)] diff --git a/research/literal-owned-rank-two-move/implementation/reference/linear/linear.py b/research/literal-owned-rank-two-move/implementation/reference/linear/linear.py new file mode 100644 index 0000000000..6aad40a6c4 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/reference/linear/linear.py @@ -0,0 +1,435 @@ +"""Literal selected nine-coordinate linear maps on a packed Gaussian field. + +Prepared for Jerry Chen / CubeJerry with substantial OpenAI assistance. +Apache-2.0. Split/merge, unary clocks and CNOT decomposition are credited +predecessor methods; this is their exact encoded all-column selected join. +""" +from pathlib import Path +import hashlib +import sys + +HERE = Path(__file__).resolve().parent +MACHINE = HERE/'inputs/controller_reference.py' +EXPECTED_MACHINE = 'e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73' +if hashlib.sha256(MACHINE.read_bytes()).hexdigest() != EXPECTED_MACHINE: + raise ValueError('frozen local machine source drift') +sys.path.insert(0, str(MACHINE.parent)) +from controller_reference import Builder, Machine, Tape, BLANK, ONE, MARK + +(HEADER, DATA, A, B, MODE, HTRACE, LENGTH, DOUBLE, F, R, P, S, WIDTH, + VOLUME, AUX, PREFIX, MIDDLE, BLOCK, LEFT, RIGHT, LOUT, ROUT, + Q0, Q1, Q2, Q3, DTRACE) = range(27) +PRIVATE = tuple(range(2, 27)) +BITS = ('0', ONE) +CHUNKS = (Q0, Q1, Q2, Q3) +MATRICES = { + 'right': (239,129,130,132,136,16,160,192,256), + 'left': (3,5,9,17,32,65,129,1,256), +} +DIMENSION = 9 + + +def cnot_word(rows): + """Fixed-data Gaussian elimination; no input header is consulted.""" + if len(rows) != DIMENSION or any(type(x) is not int or not 0 <= x < 1 << DIMENSION for x in rows): + raise ValueError('fixed nine-coordinate matrix') + choices = [] + for order in (range(DIMENSION), range(DIMENSION-1, -1, -1)): + a, eliminated, word = list(rows), set(), [] + def add(target, control): + a[target] ^= a[control] + word.append((target, control)) + for j in order: + if not (a[j] >> j) & 1: + candidates = [i for i in range(DIMENSION) if i not in eliminated and (a[i] >> j) & 1] + if not candidates: + raise ValueError('singular fixed matrix') + k = candidates[0] + add(j, k); add(k, j); add(j, k) + for i in range(DIMENSION): + if i != j and (a[i] >> j) & 1: + add(i, j) + eliminated.add(j) + if a != [1 << i for i in range(DIMENSION)]: + raise ValueError('fixed elimination invariant') + choices.append(tuple(reversed(word))) + return min(choices, key=lambda x: (len(x), x)) + + +def fresh(a, stem): + a.serial += 1 + return stem + str(a.serial) + '_' + + + +def clear(a, tape, symbols=(ONE,)): + k = fresh(a, 'clear') + a.mark(k) + a.op('read', tape, {s: k+'bit' for s in symbols} | {BLANK: k+'done'}) + a.mark(k+'bit') + a.op('write', tape, BLANK) + a.op('move', tape, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(tape, (BLANK,)) + + + +def unary_copy(a, source, target, *, repeat=1, extra=0, erase=False): + k = fresh(a, 'copy') + a.mark(k) + a.op('read', source, {ONE: k+'bit', BLANK: k+'done'}) + a.mark(k+'bit') + for _ in range(repeat): + a.op('write', target, ONE) + a.op('move', target, 1) + if erase: + a.op('write', source, BLANK) + a.op('move', source, 1) + a.op('goto', k) + a.mark(k+'done') + for _ in range(extra): + a.op('write', target, ONE) + a.op('move', target, 1) + a.rewind(source, (BLANK,) if erase else (ONE,)) + a.rewind(target, (ONE,)) + + + +def header_step(a): + a.op('write', HTRACE, ONE) + a.op('move', HTRACE, 1) + a.op('move', HEADER, 1) + + + +def gamma(a, target): + """Actual positive Gamma code to unary, using only literal operations.""" + k = fresh(a, 'gamma') + a.mark(k+'prefix') + a.op('read', HEADER, {'0': k+'zero', ONE: k+'one'}) + a.mark(k+'zero') + a.op('write', LENGTH, ONE) + a.op('move', LENGTH, 1) + header_step(a) + a.op('goto', k+'prefix') + a.mark(k+'one') + header_step(a) + a.op('write', target, ONE) + a.op('move', LENGTH, -1) + a.mark(k+'tail') + a.op('read', LENGTH, {ONE: k+'tailbit', MARK: k+'done'}) + a.mark(k+'tailbit') + a.op('write', LENGTH, BLANK) + a.op('read', HEADER, {str(b): k+'digit'+str(b) for b in (0, 1)}) + for b in (0, 1): + a.mark(k+'digit'+str(b)) + unary_copy(a, target, DOUBLE, repeat=2, extra=b) + clear(a, target) + unary_copy(a, DOUBLE, target, erase=True) + header_step(a) + a.op('move', LENGTH, -1) + a.op('goto', k+'tail') + a.mark(k+'done') + a.op('move', LENGTH, 1) + + + +def trace_return(a, tape, trace): + k = fresh(a, 'return') + a.op('move', trace, -1) + a.mark(k) + a.op('read', trace, {ONE: k+'bit', MARK: k+'done'}) + a.mark(k+'bit') + a.op('write', trace, BLANK) + a.op('move', trace, -1) + a.op('move', tape, -1) + a.op('goto', k) + a.mark(k+'done') + a.op('move', trace, 1) + + + +def double(a, tape): + unary_copy(a, tape, DOUBLE, repeat=2) + clear(a, tape) + unary_copy(a, DOUBLE, tape, erase=True) + + + +def halve(a, tape): + k = fresh(a, 'halve') + a.mark(k) + a.op('read', tape, {ONE: k+'first', BLANK: k+'done'}) + a.mark(k+'first') + a.op('write', tape, BLANK) + a.op('move', tape, 1) + a.op('read', tape, {ONE: k+'second', BLANK: 'reject'}) + a.mark(k+'second') + a.op('write', tape, BLANK) + a.op('move', tape, 1) + a.op('write', DOUBLE, ONE) + a.op('move', DOUBLE, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(tape, (BLANK,)) + a.rewind(DOUBLE, (ONE,)) + unary_copy(a, DOUBLE, tape, erase=True) + + + +def product(a, left, right, target): + k = fresh(a, 'product') + a.mark(k+'outer') + a.op('read', left, {ONE: k+'inner', BLANK: k+'done'}) + a.mark(k+'inner') + a.op('read', right, {ONE: k+'bit', BLANK: k+'row'}) + a.mark(k+'bit') + a.op('write', target, ONE) + a.op('move', target, 1) + a.op('move', right, 1) + a.op('goto', k+'inner') + a.mark(k+'row') + a.rewind(right, (ONE,)) + a.op('move', left, 1) + a.op('goto', k+'outer') + a.mark(k+'done') + a.rewind(left, (ONE,)) + a.rewind(target, (ONE,)) + + + +def emit_stream(a, source, target): + k = fresh(a, 'stream') + a.mark(k) + a.op('read', source, {str(b): k+str(b) for b in (0, 1)} | {BLANK: k+'done'}) + for bit in ('0', ONE): + a.mark(k+bit) + a.op('write', target, bit) + a.op('move', target, 1) + a.op('write', source, BLANK) + a.op('move', source, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(source, (BLANK,)) + + + +def commit(a, source): + k = fresh(a, 'commit') + a.mark(k) + a.op('read', source, {str(b): k+str(b) for b in (0, 1)} | {BLANK: k+'done'}) + for bit in ('0', ONE): + a.mark(k+bit) + a.op('write', DATA, bit) + a.op('write', source, BLANK) + a.op('move', source, 1) + a.op('move', DATA, 1) + a.op('write', DTRACE, ONE) + a.op('move', DTRACE, 1) + a.op('goto', k) + a.mark(k+'done') + trace_return(a, DATA, DTRACE) + a.rewind(source, (BLANK,)) + + + +def multiply_guide(a, target, factor): + product(a, target, factor, AUX) + clear(a, target) + unary_copy(a, AUX, target, erase=True) + + +def column_doublings(a, target, times): + """times is fixed construction data; the actual F loop survives.""" + k = fresh(a, 'column_double') + a.mark(k) + a.op('read', F, {ONE: k+'more', BLANK: k+'done'}) + a.mark(k+'more') + for _ in range(times): + double(a, target) + a.op('move', F, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(F, (ONE,)) + + +def volume(a): + unary_copy(a, P, VOLUME) + for factor in (R, S, WIDTH): + multiply_guide(a, VOLUME, factor) + column_doublings(a, VOLUME, DIMENSION) + double(a, VOLUME) + + +def geometry(a, high, low): + # At j=0: A=P*2^((high+1)f-1), M=2^((low-high)f-1), + # B=2wrS*2^((8-low)f). Temporary doubles are also paid. + unary_copy(a, P, PREFIX) + column_doublings(a, PREFIX, high+1) + halve(a, PREFIX) + a.op('write', MIDDLE, ONE) + column_doublings(a, MIDDLE, low-high) + halve(a, MIDDLE) + product(a, R, S, BLOCK) + multiply_guide(a, BLOCK, WIDTH) + double(a, BLOCK) + column_doublings(a, BLOCK, DIMENSION-1-low) + + +def clone(a): + k = fresh(a, 'clone') + a.mark(k) + a.op('read', VOLUME, {ONE: k+'read', BLANK: k+'done'}) + a.mark(k+'read') + a.op('read', DATA, {str(b): k+str(b) for b in (0, 1)}) + for bit in BITS: + a.mark(k+bit) + a.op('write', A, bit) + a.op('move', A, 1) + a.op('move', DATA, 1) + a.op('write', DTRACE, ONE) + a.op('move', DTRACE, 1) + a.op('move', VOLUME, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(VOLUME, (ONE,)) + a.op('read', DATA, {BLANK: k+'valid'}) + a.mark(k+'valid') + trace_return(a, DATA, DTRACE) + a.rewind(A, BITS) + + +def copy_block(a, source, target, *, return_target=False): + k = fresh(a, 'block_copy') + a.mark(k) + a.op('read', BLOCK, {ONE: k+'read', BLANK: k+'done'}) + a.mark(k+'read') + a.op('read', source, {str(b): k+str(b) for b in (0, 1)}) + for bit in BITS: + a.mark(k+bit) + a.op('write', target, bit) + a.op('move', target, 1) + a.op('write', source, BLANK) + a.op('move', source, 1) + a.op('move', BLOCK, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(BLOCK, (ONE,)) + if return_target: + a.rewind(target, BITS) + + +def load_half(a, source, target): + k = fresh(a, 'half') + a.mark(k) + a.op('read', MIDDLE, {ONE: k+'two', BLANK: k+'done'}) + a.mark(k+'two') + for _ in range(2): + copy_block(a, source, target) + a.op('move', MIDDLE, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(MIDDLE, (ONE,)) + a.rewind(target, BITS) + + +def cnot_columns(a, target, control): + """All encoded F columns of one fixed CNOT, both physical directions.""" + high, low = min(target, control), max(target, control) + permutation = (0, 1, 3, 2) if control == high else (0, 3, 2, 1) + geometry(a, high, low) + k = fresh(a, 'cnot') + a.mark(k+'prefix') + a.op('read', PREFIX, {ONE: k+'load_select', BLANK: k+'end'}) + a.mark(k+'load_select') + a.op('read', MODE, {'0': k+'loadA', ONE: k+'loadB'}) + for source, label in ((A, 'A'), (B, 'B')): + a.mark(k+'load'+label) + load_half(a, source, LEFT) + load_half(a, source, RIGHT) + a.op('goto', k+'middle') + a.mark(k+'middle') + a.op('read', MIDDLE, {ONE: k+'chunks', BLANK: k+'middle_done'}) + a.mark(k+'chunks') + for source, chunk in ((LEFT, Q0), (LEFT, Q1), (RIGHT, Q2), (RIGHT, Q3)): + copy_block(a, source, chunk, return_target=True) + for i, index in enumerate(permutation): + emit_stream(a, CHUNKS[index], LOUT if i < 2 else ROUT) + a.op('move', MIDDLE, 1) + a.op('goto', k+'middle') + a.mark(k+'middle_done') + a.rewind(MIDDLE, (ONE,)) + for tape in (LEFT, RIGHT): + a.rewind(tape, (BLANK,)) + for tape in (LOUT, ROUT): + a.rewind(tape, BITS) + a.op('read', MODE, {'0': k+'mergeB', ONE: k+'mergeA'}) + for label, destination in (('mergeB', B), ('mergeA', A)): + a.mark(k+label) + emit_stream(a, LOUT, destination) + emit_stream(a, ROUT, destination) + a.op('goto', k+'prefix_done') + a.mark(k+'prefix_done') + a.op('move', PREFIX, 1) + a.op('goto', k+'prefix') + a.mark(k+'end') + a.op('read', MODE, {'0': k+'endA', ONE: k+'endB'}) + for mode, source, destination in ((0, A, B), (1, B, A)): + label = k+'end'+('A' if mode == 0 else 'B') + a.mark(label) + a.op('read', source, {BLANK: label+'valid'}) + a.mark(label+'valid') + a.rewind(source, (BLANK,)) + a.rewind(destination, BITS) + a.op('write', MODE, str(1-mode)) + a.op('goto', k+'column_done') + a.mark(k+'column_done') + a.rewind(PREFIX, (ONE,)) + a.op('move', F, 1) + a.op('read', F, {ONE: k+'next_column', BLANK: k+'finished'}) + a.mark(k+'next_column') + double(a, BLOCK) + halve(a, PREFIX) + a.op('goto', k+'prefix') + a.mark(k+'finished') + a.rewind(F, (ONE,)) + for tape in (PREFIX, MIDDLE, BLOCK): + clear(a, tape) + + +def compile_linear(side): + """side is fixed construction data: exactly 'left' or 'right'.""" + if side not in MATRICES: + raise ValueError('one of the two selected fixed linear maps is required') + word = cnot_word(MATRICES[side]) + a = Builder() + for tape in PRIVATE: + a.op('move', tape, -1) + a.op('write', tape, MARK) + a.op('move', tape, 1) + for target in (F, R, P, S, WIDTH): + gamma(a, target) + trace_return(a, HEADER, HTRACE) + volume(a) + clone(a) + a.op('write', MODE, '0') + for target, control in word: + cnot_columns(a, target, control) + a.op('read', MODE, {'0': 'commitA', ONE: 'commitB'}) + for label, source in (('commitA', A), ('commitB', B)): + a.mark(label) + commit(a, source) + a.op('goto', 'retire') + a.mark('retire') + for tape in (F, R, P, S, WIDTH, VOLUME): + clear(a, tape) + clear(a, MODE, BITS) + for tape in PRIVATE: + a.op('move', tape, -1) + a.op('write', tape, BLANK) + a.op('move', tape, 1) + a.op('halt') + a.mark('reject') + a.op('read', HEADER, {}) + return a.finish((BLANK, '0', ONE, MARK)) diff --git a/research/literal-owned-rank-two-move/implementation/reference/phase/NOTICE b/research/literal-owned-rank-two-move/implementation/reference/phase/NOTICE new file mode 100644 index 0000000000..7a1f1da9c5 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/reference/phase/NOTICE @@ -0,0 +1,11 @@ +Prepared for Jerry Chen / CubeJerry with substantial OpenAI assistance. +Apache-2.0. New contribution: literal local lowering, scoped proof and package. +Ali Romman/#5375 supplies the incremental phase and repeated constant. +The retained reference files preserve original source text. +#7000 and its native/Gaussian lineage supply the selected source and engines; +credit DreamingOfClouds, Ali Romman, Cinna Davis, zxv, unpaidmoon, icekylinx, +CubeJerry and earlier authors named by the retained source. +C2 literal-layer-phase supplies Gamma and signed staging/return. B1 literal- +layer-egress supplies owner staging, and #7349 the retained literal machine. +Exact original/copy source pins are in SOURCES.json. No predecessor identity, +compiler, source construction or general monomial theorem is claimed as new. diff --git a/research/literal-owned-rank-two-move/implementation/reference/phase/inputs/controller_reference.py b/research/literal-owned-rank-two-move/implementation/reference/phase/inputs/controller_reference.py new file mode 100644 index 0000000000..3ab6d0361f --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/reference/phase/inputs/controller_reference.py @@ -0,0 +1,112 @@ +"""Finite three-tape online rank-recursion control; Apache-2.0. +Only PC and local symbols affect execution. Metrics/event logs are observers. +""" +from dataclasses import dataclass, field +BLANK, ONE, MARK = '_', '1', '|' +WIDTH, CHILD, STACK = range(3) + +class Builder: + def __init__(self): self.code, self.labels, self.serial = [], {}, 0 + def mark(self,n): + if n in self.labels: raise ValueError('duplicate label') + self.labels[n]=len(self.code) + def op(self,*x): self.code.append(x) + def rewind(self,t,symbols): + self.serial+=1; loop=f'rw{self.serial}'; done=loop+'done' + self.op('move',t,-1); self.mark(loop) + self.op('read',t,{s:loop+'step' for s in symbols}|{MARK:done}) + self.mark(loop+'step'); self.op('move',t,-1); self.op('goto',loop) + self.mark(done); self.op('move',t,1) + def finish(self,alphabet): + result=[] + for op,*a in self.code: + if op=='goto': a[0]=self.labels[a[0]] + elif op=='read': a[1]={s:self.labels[n] for s,n in a[1].items()} + result.append((op,*a)) + return tuple(result),tuple(alphabet) + +def compile_controller(m,ranks): + """Parameters are compile-time constants, absent from run-time state.""" + if type(m) is not int or m<2 or not ranks: raise ValueError('bad fixed profile') + if any(type(r) is not int or not 1<=r=budget: raise ValueError('finite verifier budget') + self.step() + return self + +def initial_tapes(width,origins=(0,0,0),ancestor=('0','1','t0','_','|','0')): + if width<1: raise ValueError('positive width') + u,c,p=origins + return [Tape({u-1:MARK,**{u+i:ONE for i in range(width)}},u),Tape({c-1:MARK},c), + Tape({p-1:MARK,**{p-2-i:s for i,s in enumerate(ancestor) if s!=BLANK}},p)] diff --git a/research/literal-owned-rank-two-move/implementation/reference/phase/phase.py b/research/literal-owned-rank-two-move/implementation/reference/phase/phase.py new file mode 100644 index 0000000000..d489781458 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/reference/phase/phase.py @@ -0,0 +1,335 @@ +"""Literal selected native quadratic phase, with complete owner commit. + +Prepared for Jerry Chen / CubeJerry with substantial OpenAI assistance. +Apache-2.0. The multi-counter phase algorithm is credited to #5375. Header, +signed staging and return helpers are retained from the frozen C2 phase. +Only fixed-table read/write/unit-move/goto/halt instructions execute. +""" +from pathlib import Path +import hashlib +import sys + +HERE = Path(__file__).resolve().parent +MACHINE = HERE / 'inputs' / 'controller_reference.py' +EXPECTED_MACHINE = 'e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73' +if hashlib.sha256(MACHINE.read_bytes()).hexdigest() != EXPECTED_MACHINE: + raise ValueError('frozen literal machine source drift') +sys.path.insert(0, str(MACHINE.parent)) +from controller_reference import Builder, Machine, Tape, BLANK, ONE, MARK + +(HEADER, DATA, OUTPUT, HTRACE, LENGTH, DOUBLE, COLUMNS, COEFF, OUTER, + SPECTATOR, WIDTH, REAL, IMAG, DTRACE) = range(14) +COUNTERS = tuple(range(14, 23)) +PRIVATE = tuple(range(2, 23)) +BITS = ('0', ONE) +SELECTED_LINEAR = (3, 3, 3, 3, 0, 3, 3, 2, 0) +SELECTED_ROWS = (111, 111, 111, 111, 0, 111, 111, 0, 0) +SELECTED_CONSTANT = 1 + + +def fresh(a, stem): + a.serial += 1 + return stem + str(a.serial) + + +def clear(a, tape, symbols=(ONE,)): + k = fresh(a, 'clear') + a.mark(k) + a.op('read', tape, {s: k+'bit' for s in symbols} | {BLANK: k+'done'}) + a.mark(k+'bit') + a.op('write', tape, BLANK) + a.op('move', tape, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(tape, (BLANK,)) + + +def unary_copy(a, source, target, *, repeat=1, extra=0, erase=False): + k = fresh(a, 'copy') + a.mark(k) + a.op('read', source, {ONE: k+'bit', BLANK: k+'done'}) + a.mark(k+'bit') + for _ in range(repeat): + a.op('write', target, ONE) + a.op('move', target, 1) + if erase: + a.op('write', source, BLANK) + a.op('move', source, 1) + a.op('goto', k) + a.mark(k+'done') + for _ in range(extra): + a.op('write', target, ONE) + a.op('move', target, 1) + a.rewind(source, (BLANK,) if erase else (ONE,)) + a.rewind(target, (ONE,)) + + +def header_step(a): + a.op('write', HTRACE, ONE) + a.op('move', HTRACE, 1) + a.op('move', HEADER, 1) + + +def gamma(a, target): + """Actual positive Gamma code to unary, using only literal operations.""" + k = fresh(a, 'gamma') + a.mark(k+'prefix') + a.op('read', HEADER, {'0': k+'zero', ONE: k+'one'}) + a.mark(k+'zero') + a.op('write', LENGTH, ONE) + a.op('move', LENGTH, 1) + header_step(a) + a.op('goto', k+'prefix') + a.mark(k+'one') + header_step(a) + a.op('write', target, ONE) + a.op('move', LENGTH, -1) + a.mark(k+'tail') + a.op('read', LENGTH, {ONE: k+'tailbit', MARK: k+'done'}) + a.mark(k+'tailbit') + a.op('write', LENGTH, BLANK) + a.op('read', HEADER, {str(b): k+'digit'+str(b) for b in (0, 1)}) + for b in (0, 1): + a.mark(k+'digit'+str(b)) + unary_copy(a, target, DOUBLE, repeat=2, extra=b) + clear(a, target) + unary_copy(a, DOUBLE, target, erase=True) + header_step(a) + a.op('move', LENGTH, -1) + a.op('goto', k+'tail') + a.mark(k+'done') + a.op('move', LENGTH, 1) + + +def trace_return(a, tape, trace): + k = fresh(a, 'return') + a.op('move', trace, -1) + a.mark(k) + a.op('read', trace, {ONE: k+'bit', MARK: k+'done'}) + a.mark(k+'bit') + a.op('write', trace, BLANK) + a.op('move', trace, -1) + a.op('move', tape, -1) + a.op('goto', k) + a.mark(k+'done') + a.op('move', trace, 1) + + +def load_component(a, target): + k = fresh(a, 'load') + a.mark(k) + a.op('read', WIDTH, {ONE: k+'bit', BLANK: k+'done'}) + a.mark(k+'bit') + a.op('read', DATA, {str(b): k+str(b) for b in (0, 1)}) + for b in (0, 1): + a.mark(k+str(b)) + a.op('write', target, str(b)) + a.op('move', target, 1) + a.op('move', DATA, 1) + a.op('write', DTRACE, ONE) + a.op('move', DTRACE, 1) + a.op('move', WIDTH, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(WIDTH, (ONE,)) + a.rewind(target, BITS) + + +def negate(a, tape): + """Exact w-bit integer negation; reject the unrepresentable minimum.""" + k = fresh(a, 'neg') + a.mark(k+'seek') + a.op('read', tape, {'0': k+'step', ONE: k+'step', BLANK: k+'last'}) + a.mark(k+'step') + a.op('move', tape, 1) + a.op('goto', k+'seek') + a.mark(k+'last') + a.op('move', tape, -1) + a.op('goto', k+'c1x0y0') + for carry in (0, 1): + for old_sign in (0, 1): + for new_sign in (0, 1): + name = k+f'c{carry}x{old_sign}y{new_sign}' + a.mark(name) + a.op('read', tape, {str(b): name+'b'+str(b) for b in (0, 1)} | + {MARK: 'reject' if old_sign and new_sign else k+'done'}) + for bit in (0, 1): + total = 1-bit+carry + digit, nxt = total % 2, total//2 + a.mark(name+'b'+str(bit)) + a.op('write', tape, str(digit)) + a.op('move', tape, -1) + a.op('goto', k+f'c{nxt}x{bit}y{digit}') + a.mark(k+'done') + a.op('move', tape, 1) + + +def stage_component(a, tape): + k = fresh(a, 'stage') + a.mark(k) + a.op('read', tape, {str(b): k+str(b) for b in (0, 1)} | {BLANK: k+'done'}) + for b in (0, 1): + a.mark(k+str(b)) + a.op('write', OUTPUT, str(b)) + a.op('move', OUTPUT, 1) + a.op('write', tape, BLANK) + a.op('move', tape, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(tape, (BLANK,)) + + +def initialize(a, counters, constant): + """Generate f zero bits on each counter and retain constant*f mod 4.""" + a.op('goto', 'initialize0') + for mode in range(4): + name = 'initialize'+str(mode) + a.mark(name) + a.op('read', COLUMNS, {ONE: name+'bit', BLANK: name+'done'}) + a.mark(name+'bit') + for tape in counters: + a.op('write', tape, '0') + a.op('move', tape, 1) + a.op('move', COLUMNS, 1) + a.op('goto', 'initialize'+str((mode+constant) % 4)) + a.mark(name+'done') + a.rewind(COLUMNS, (ONE,)) + for tape in counters: + a.rewind(tape, BITS) + a.op('goto', 'record'+str(mode)) + + +def advance(a, counters, linear, rows): + """Fixed finite lowering of the credited synchronized counter updater.""" + m = len(counters) + for i in range(m): + neighbors = tuple(j for j in range(m) if j != i and + (rows[min(i, j)] >> max(i, j)) & 1) + for mode in range(4): + name = f'advance{i}q{mode}' + a.mark(name) + a.op('read', counters[i], {str(b): name+'b'+str(b) for b in (0, 1)} | + {BLANK: name+'overflow'}) + for bit in (0, 1): + stem = name+'b'+str(bit) + a.mark(stem) + nxt = (mode+(1-2*bit)*linear[i]) % 4 + a.op('goto', stem+f'n0q{nxt}') + for k, j in enumerate(neighbors): + for value in range(4): + label = stem+f'n{k}q{value}' + a.mark(label) + a.op('read', counters[j], { + str(b): stem+f'n{k+1}q{(value+2*b) % 4}' + for b in (0, 1)}) + for value in range(4): + a.mark(stem+f'n{len(neighbors)}q{value}') + a.op('write', counters[i], str(1-bit)) + for tape in counters: + a.op('move', tape, 1) + a.op('goto', f'advance{i}q{value}' if bit else + 'advanced'+str(value)) + a.mark(name+'overflow') + for tape in counters: + target = fresh(a, 'all_end') + a.op('read', tape, {BLANK: target}) + a.mark(target) + for tape in counters: + a.rewind(tape, BITS) + if i: + a.op('goto', f'advance{i-1}q{mode}') + else: + a.op('move', OUTER, 1) + a.op('read', OUTER, {ONE: 'record'+str(mode), BLANK: 'finish'}) + for mode in range(4): + a.mark('advanced'+str(mode)) + for tape in counters: + a.rewind(tape, BITS) + a.op('goto', 'record'+str(mode)) + + +def compile_phase(linear=SELECTED_LINEAR, rows=SELECTED_ROWS, + constant=SELECTED_CONSTANT): + """Recipe is finite construction-time data; no runtime size is an argument.""" + m = len(linear) + if not 1 <= m <= len(COUNTERS) or len(rows) != m: + raise ValueError('fixed recipe dimension') + if type(constant) is not int or not 0 <= constant < 4: + raise ValueError('fixed constant phase') + if any(type(x) is not int or not 0 <= x < 4 for x in linear): + raise ValueError('fixed linear phase') + if any(type(x) is not int or not 0 <= x < 1 << m for x in rows): + raise ValueError('fixed quadratic rows') + if any(((rows[i] >> j) ^ (rows[j] >> i)) & 1 + for i in range(m) for j in range(m)): + raise ValueError('symmetric source quadratic matrix') + if any((linear[i] ^ (rows[i] >> i)) & 1 for i in range(m)): + raise ValueError('source diagonal parity') + counters = COUNTERS[:m] + a = Builder() + for tape in PRIVATE: + a.op('move', tape, -1) + a.op('write', tape, MARK) + a.op('move', tape, 1) + # Supplied local ABI: Gamma(f), Gamma(r), Gamma(P), Gamma(S), Gamma(w). + for target in (COLUMNS, COEFF, OUTER, SPECTATOR, WIDTH): + gamma(a, target) + trace_return(a, HEADER, HTRACE) + initialize(a, counters, constant) + for mode in range(4): + a.mark('record'+str(mode)) + a.op('read', SPECTATOR, {ONE: 'coefficient'+str(mode), BLANK: 'record_end'+str(mode)}) + a.mark('coefficient'+str(mode)) + a.op('read', COEFF, {ONE: 'payload'+str(mode), BLANK: 'coefficient_end'+str(mode)}) + a.mark('payload'+str(mode)) + load_component(a, REAL) + load_component(a, IMAG) + if mode in (2, 3): + negate(a, REAL) + if mode in (1, 2): + negate(a, IMAG) + order = (IMAG, REAL) if mode % 2 else (REAL, IMAG) + for tape in order: + stage_component(a, tape) + a.op('move', COEFF, 1) + a.op('goto', 'coefficient'+str(mode)) + a.mark('coefficient_end'+str(mode)) + a.rewind(COEFF, (ONE,)) + a.op('move', SPECTATOR, 1) + a.op('goto', 'record'+str(mode)) + a.mark('record_end'+str(mode)) + a.rewind(SPECTATOR, (ONE,)) + a.op('goto', f'advance{m-1}q{mode}') + advance(a, counters, linear, rows) + a.mark('finish') + a.op('read', DATA, {BLANK: 'verified', '0': 'reject', ONE: 'reject'}) + a.mark('verified') + trace_return(a, DATA, DTRACE) + a.rewind(OUTPUT, BITS) + a.mark('commit') + a.op('read', OUTPUT, {str(b): 'commit'+str(b) for b in (0, 1)} | {BLANK: 'committed'}) + for bit in ('0', ONE): + a.mark('commit'+bit) + a.op('write', DATA, bit) + a.op('write', OUTPUT, BLANK) + a.op('move', OUTPUT, 1) + a.op('move', DATA, 1) + a.op('write', DTRACE, ONE) + a.op('move', DTRACE, 1) + a.op('goto', 'commit') + a.mark('committed') + trace_return(a, DATA, DTRACE) + a.rewind(OUTPUT, (BLANK,)) + a.rewind(OUTER, (ONE,)) + for tape in (COLUMNS, OUTER, COEFF, SPECTATOR, WIDTH): + clear(a, tape) + for tape in counters: + clear(a, tape, BITS) + for tape in PRIVATE: + a.op('move', tape, -1) + a.op('write', tape, BLANK) + a.op('move', tape, 1) + a.op('halt') + a.mark('reject') + a.op('read', HEADER, {}) + return a.finish((BLANK, '0', ONE, MARK)) diff --git a/research/literal-owned-rank-two-move/implementation/reference/source/clifford_exact.py b/research/literal-owned-rank-two-move/implementation/reference/source/clifford_exact.py new file mode 100644 index 0000000000..166841a037 --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/reference/source/clifford_exact.py @@ -0,0 +1,149 @@ +"""Small exact Gaussian-dyadic Clifford compiler, independent of gx internals. +Paulis use i^p X^x Z^z. State vectors use integer Gaussian numerators / 2^d. +The tableau is supplemented by a literal circuit, so global phases are kept. +""" +from dataclasses import dataclass + +def parity(x):return x.bit_count()&1 +def rank(rows): + p={} + for x in rows: + while x: + b=x.bit_length()-1 + if b not in p:p[b]=x;break + x^=p[b] + return len(p) +def transpose(rows,n):return tuple(sum(((rows[j]>>i)&1)<>j&1);a[j],a[k]=a[k],a[j] + for i in range(n): + if i!=j and a[i]>>j&1:a[i]^=a[j] + assert [r&((1<>n for r in a) +def basis_extend(cols,n): + out=[] + for x in list(cols)+[1<len(out):out.append(x) + assert len(out)==n + return tuple(out) +def nullspace(rows,n): + a=list(rows);p=[];k=0 + for j in range(n): + t=next((i for i in range(k,len(a)) if a[i]>>j&1),None) + if t is None:continue + a[t],a[k]=a[k],a[t] + for i in range(len(a)): + if i!=k and a[i]>>j&1:a[i]^=a[k] + p.append(j);k+=1 + return tuple((1<>j)&1)<>i&1:out=pmul(out,T[i]) + for i in range(n): + if z>>i&1:out=pmul(out,T[n+i]) + return out +def compose(A,B):return tuple(apply(A,p) for p in B) +def inverse(T): + n=len(T)//2;cols=[x|(z<>n;u,v,p=apply(T,(x,z,0));assert (u,v)==identity(n)[j][:2];out.append((x,z,(-p)%4)) + return tuple(out) +def qvalue(Q,alpha,x,n): + return (sum(alpha[i] for i in range(n) if x>>i&1)+2*sum(parity((Q[i]>>(i+1))&(x>>(i+1))) for i in range(n) if x>>i&1))%4 +def mul_i(a,p): + x,y=a;p%=4 + return [(x,y),(-y,x),(-x,-y),(y,-x)][p] +@dataclass +class Op: + n:int + tab:tuple + circuit:list + def then(self,b): + assert self.n==b.n + return Op(self.n,compose(b.tab,self.tab),self.circuit+b.circuit) + def adjoint(self): + circ=[] + for e in reversed(self.circuit): + if e[0]=='P':circ.append(('P',inv(e[1],self.n))) + elif e[0]=='D':circ.append(('D',e[1],tuple((-x)%4 for x in e[2]))) + elif e[0]=='C':circ.append(('C',e[1],-e[2])) + elif e[0]=='phase':circ.append(('phase',(-e[1])%4)) + else:circ.append(e) + return Op(self.n,inverse(self.tab),circ) + def zero_state(self,basis=0): + N=1<>i)&1 for i in range(n)) + assert all(alpha[i]%2==(Q[i]>>i)&1 for i in range(n)) + return Op(n,tuple([(1<>i&1 else 0,1<>i&1 else 0) for i in range(n)]),[('C',q,sgn)]) +def xgate(n,b):return Op(n,tuple([(1<>i)&1)) for i in range(n)]),[('X',b)]) +def fourier(n,axes=None): + out=ident(n) + for i in range(n) if axes is None else axes:out=out.then(cgate(n,1<len(selected):picks.append(j);selected.append(x) + assert len(picks)==r and all(x>>r==0 for x in Bcols) + Br=transpose(selected,r);Bi=inv(Br,r);Dr=transpose([Dcols[j]&((1<> j) & 1) << i for i, row in enumerate(matrix)) for j in range(len(matrix))) + + +def inverse(matrix): + n = len(matrix) + rows = [row | (1 << (n+i)) for i, row in enumerate(matrix)] + for j in range(n): + pivot = next((i for i in range(j, n) if rows[i] >> j & 1), None) + require(pivot is not None, 'singular binary chart') + rows[j], rows[pivot] = rows[pivot], rows[j] + for i in range(n): + if i != j and rows[i] >> j & 1: + rows[i] ^= rows[j] + require([row & ((1 << n)-1) for row in rows] == [1 << i for i in range(n)], 'binary inverse') + return tuple(row >> n for row in rows) + + +def extend(vectors, n): + columns, pivots = [], {} + for value in tuple(vectors) + tuple(1 << i for i in range(n)): + reduced = value + while reduced: + j = reduced.bit_length()-1 + if j not in pivots: + pivots[j] = reduced + columns.append(value) + break + reduced ^= pivots[j] + require(len(columns) == n, 'frame basis extension') + return tuple(columns) + + +def adjoint(circuit): + out = [] + for gate in reversed(circuit): + if gate[0] == 'P': + out.append(('P', inverse(gate[1]))) + elif gate[0] == 'D': + out.append(('D', gate[1], tuple(-a % 4 for a in gate[2]))) + elif gate[0] == 'C': + out.append(('C', gate[1], -gate[2])) + elif gate[0] == 'phase': + out.append(('phase', -gate[1] % 4)) + else: + require(gate[0] == 'X', 'adjoint gate type') + out.append(gate) + return tuple(out) + + +def fourier(rank): + return tuple(('C', 1 << i, 1) for i in range(rank)) + + +def frame(vectors, n): + rank = len(vectors) + if rank == 0: + return () + if rank == n: + return fourier(n) + matrix = transpose(extend(vectors, n)) + columns = transpose(inverse(matrix)) + quadratic = tuple((1 << i) ^ sum(parity(a & b) << j for j, b in enumerate(columns)) for i, a in enumerate(columns)) + diagonal = tuple((row >> i) & 1 for i, row in enumerate(quadratic)) + chart = (('P', matrix), ('D', quadratic, diagonal)) + return adjoint(chart) + fourier(rank) + chart + + +def monomial(record): + matrix = tuple(record['matrix_rows']) + quadratic = tuple(record['quadratic_rows']) + linear = tuple(record['linear_Z4']) + require(transpose(quadratic) == quadratic, 'quadratic symmetry') + require(len(matrix) == len(quadratic) == len(linear) == 9, 'monomial dimension') + require(all(a % 2 == (quadratic[i] >> i) & 1 for i, a in enumerate(linear)), 'diagonal parity') + inverse(matrix) + return (('D', quadratic, linear), ('P', matrix), ('X', record['offset']), ('phase', record['phase'])) + + +def recipe(record): + rank = record['rank'] + require(isinstance(rank, int) and 0 <= rank <= 9, 'child rank') + if rank == 0: + require(record['right'] is None, 'rank zero right factor') + return monomial(record['left']) + return monomial(record['right']) + fourier(rank) + monomial(record['left']) + + +def tableau(circuit, n=9): + rows = [(1 << i, 0, 0) for i in range(n)] + [(0, 1 << i, 0) for i in range(n)] + for gate in circuit: + tag = gate[0] + out = [] + inverse_transpose = transpose(inverse(gate[1])) if tag == 'P' else None + for x, z, phase in rows: + if tag == 'P': + x, z = mul(gate[1], x), mul(inverse_transpose, z) + elif tag == 'X': + phase += 2 * parity(z & gate[1]) + elif tag == 'C': + if parity(z & gate[1]): + x ^= gate[1] + phase += 3 * gate[2] + elif tag == 'D': + quadratic, linear = gate[1:] + phase += sum(linear[i] for i in range(n) if x >> i & 1) + phase += 2 * sum(parity((quadratic[i] >> (i+1)) & (x >> (i+1))) for i in range(n) if x >> i & 1) + z ^= mul(quadratic, x) + else: + require(tag == 'phase', 'tableau gate type') + out.append((x, z, phase % 4)) + rows = out + return tuple(rows) + + +@lru_cache(maxsize=512) +def action(gate): + if gate[0] == 'P': + return tuple(mul(gate[1], x) for x in range(512)) + require(gate[0] == 'D', 'state action type') + quadratic, linear = gate[1:] + return tuple((sum(linear[i] for i in range(9) if x >> i & 1) + + 2 * sum(parity((quadratic[i] >> (i+1)) & (x >> (i+1))) for i in range(9) if x >> i & 1)) % 4 for x in range(512)) + + +def rotate(pair, power): + a, b = pair + return ((a, b), (-b, a), (-a, -b), (b, -a))[power % 4] + + +def state(circuit, basis=0): + value, denominator = {basis: (1, 0)}, 0 + for gate in circuit: + tag = gate[0] + result = {} + if tag == "C": + direction, sign = gate[1:] + for address, (a, b) in value.items(): + for target, pair in ((address, (a - sign*b, b + sign*a)), + (address ^ direction, (a + sign*b, b - sign*a))): + old = result.get(target, (0, 0)) + result[target] = (old[0] + pair[0], old[1] + pair[1]) + denominator += 1 + else: + for address, pair in value.items(): + if tag == "P": + target = mul(gate[1], address) + elif tag == "X": + target = address ^ gate[1] + else: + target = address + if tag == "D": + pair = rotate(pair, action(gate)[address]) + else: + require(tag == "phase", "Unknown Gaussian state gate") + pair = rotate(pair, gate[1]) + require(target not in result, "A monomial address map is not injective") + result[target] = pair + value = {address: pair for address, pair in result.items() if pair != (0, 0)} + while denominator and all((a | b) % 2 == 0 for a, b in value.values()): + denominator -= 1 + value = {address: (a//2, b//2) for address, (a, b) in value.items()} + return value, denominator + + +def equal(actual, expected, label): + require(tableau(actual) == tableau(expected), label + ": signed Pauli action") + require(state(actual) == state(expected), label + ": exact global phase") + + +def verify(data, certificate): + word = data["word"] + original, clean = data["programs"], data["clean_programs"] + source_recipes = data["recipes"] + residuals = data["residuals"]["recipes"] + native_tags = {"climb", "adapter", "residual_adapter"} + for orientation in ("forward", "backward"): + native = [event for event in clean[orientation] if event[0] in native_tags] + require(native == [event for event in original[orientation] if event[0] in native_tags], + "A retained native event changed") + require(len(native) == 5056, "The retained native event count changed") + frames = [frame(tuple(vectors), 9) for vectors in word["frames"]] + used = {(event[3], event[4]) for program in clean.values() + for event in program if event[0] == "climb"} + children = {(record["old"], record["new"]): record for record in source_recipes["children"]} + require(len(children) == len(source_recipes["children"]) and used <= set(children), + "The retained child recipe coverage is incomplete") + for old, new in sorted(used): + record = children[old, new] + require(record["rank"] == len(word["frames"][new]) - len(word["frames"][old]), + "A retained child has the wrong rank") + equal(recipe(record), adjoint(frames[old]) + frames[new], "Retained child") + endpoints = {(record["role"], record["port"]): record + for record in source_recipes["endpoint_adapters"]} + require(len(endpoints) == len(source_recipes["endpoint_adapters"]) + and set(endpoints) == {(role, p) for role in ("source", "target") for p in range(112)}, + "The endpoint adapter coverage is incomplete") + for (role, port), record in endpoints.items(): + direction = word["ports"][port] + conventional = (("C", direction, 1),) if role == "source" else ( + ("C", direction, -1),) + fourier(9) + index = word["start"][port] if role == "source" else word["final"][112 + port] + require(record["frame"] == index and record["rank"] == 0, "An endpoint frame changed") + equal(recipe(record), adjoint(conventional) + frames[index], "Endpoint adapter") + used_residuals = set() + for program in clean.values(): + for event in program: + if event[0] != "residual_adapter": + continue + _, position, register, entry, *tail = event + terminal = tail[0] if tail else 1 + key = str(entry) if terminal == 1 else str(entry) + ":" + str(terminal) + require(key in residuals and position in ("pre", "post"), "A residual binding changed") + require(entry == word["start"][register] and terminal == word["final"][register], + "A residual endpoint changed") + used_residuals.add(key) + for key in sorted(used_residuals): + record = residuals[key] + equal(recipe(record), adjoint(frames[record["frame"]]) + frames[record.get("terminal", 1)], + "Residual adapter") + records = certificate["input_recipes"] + ports = certificate["compensation_ports"] + require([record["port"] for record in records] == ports and len(records) == 8, + "The eight input recipes changed") + columns = 0 + for item in records: + port, label = item["port"], item["label"] + require(label == word["ports"][port] and item["canonical_start_frame_id"] == word["start"][port], + "An input recipe has the wrong supplier label") + record = item["recipe"] + require(record["rank"] == 1, "An input copy has the wrong child rank") + for side in ("left", "right"): + factor = record[side] + require(factor["quadratic_rows"] == [0] * 9 and factor["linear_Z4"] == [0] * 9 + and factor["offset"] == factor["phase"] == 0, + "An input factor is not an address permutation") + actual, expected = recipe(record), (("C", label, 1),) + equal(actual, expected, "Positive inherited input line") + for basis in range(512): + require(state(actual, basis) == state(expected, basis), "A complete input Gaussian column differs") + columns += 1 + negative = monomial(record["right"]) + (("C", 1, -1),) + monomial(record["left"]) + require(tableau(negative) != tableau(expected) or state(negative) != state(expected), + "An inverse input child was not detected") + phased = actual + (("phase", 1),) + require(tableau(phased) == tableau(actual) and state(phased) != state(expected), + "An input phase-only error was not detected") + return {"status": "PASS_EXACT_INPUT_NATIVE_FRAMES", "retained_native_events_per_orientation": 5056, + "retained_child_recipes": len(used), "endpoint_adapter_recipes": len(endpoints), + "residual_adapter_recipes": len(used_residuals), "new_input_recipes": len(records), + "new_exact_gaussian_columns": columns, "inverse_input_child_controls": len(records), + "phase_only_controls": len(records), "address_permutation_factors": 2 * len(records), + "method": "Independent signed Pauli and exact Gaussian interpretation; no compiler import", + "scope": "Positive inherited input frames before every retained adapter. No recursive hosting claim."} diff --git a/research/literal-owned-rank-two-move/implementation/verify.py b/research/literal-owned-rank-two-move/implementation/verify.py new file mode 100644 index 0000000000..ea89b1951e --- /dev/null +++ b/research/literal-owned-rank-two-move/implementation/verify.py @@ -0,0 +1,233 @@ +"""Literal rank2/HOME replay, source binding and discriminating controls.""" +from pathlib import Path +import atexit +import hashlib +import json +import random +import shutil +import subprocess +import sys +import tempfile +import time + +HERE = Path(__file__).resolve().parent +_cache = tempfile.TemporaryDirectory(prefix='rank2-verifier-source-') +atexit.register(_cache.cleanup) +sys.dont_write_bytecode = True +sys.pycache_prefix = str(Path(_cache.name) / 'required-absent') +if Path(sys.pycache_prefix).exists(): + raise ValueError('fresh source cache') +sys.path.insert(0, str(HERE)) +import adapter as A +import rank2 as C +from machine import Program, initial, fields, check_retired, Rejected +from oracle import header, encode, image_f1, expected_f1, reverse9 +from bind_source import verify as bind_source + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def guards(): + from controller_reference import Machine, Tape + code, _ = C.compile_guard() + rows = [] + cases = [(f, t) for f in (1, 2, 3, 5, 16, 65, 129) + for t in (2 * f - 1, 2 * f, 2 * f + 1)] + cases += [(1, 1 << n) for n in (63, 257, 512, 1024, 4096)] + for f, cutoff in cases: + shape = (f, 2, 3, 2, 5, cutoff) + text = header(shape) + origins = [7 * i - 103 for i in range(29)] + tapes = [Tape({o - 5: '0', o + 1000000: '1'}, o) for o in origins] + tapes[0].cells.update({origins[0] + i: b for i, b in enumerate(text)}) + before = [t.cells.copy() for t in tapes] + cpu = Machine(code, tapes) + try: + cpu.run(5000000) + accepted = True + except ValueError as exc: + need(str(exc) == 'invalid scanned symbol', 'guard failed for unrelated reason') + accepted = False + need(accepted == (2 * f <= cutoff), 'actual 2f cutoff decision') + need(tapes[0].cells == before[0], 'guard changed original header') + if accepted: + need([t.head for t in tapes] == origins and + [t.cells for t in tapes] == before, 'guard full retirement') + rows.append(dict(f=f, cutoff_bitlength=cutoff.bit_length(), E=len(text), + accepted=accepted, steps=cpu.steps)) + # This executes the wrong guard, demonstrating why two old f guards are + # insufficient to enforce the direct rank-two source branch. + weak, _ = C.compile_guard(weak=True) + ts = [Tape({}, 0) for _ in range(29)] + ts[0] = Tape(dict(enumerate(header((1, 1, 1, 1, 5, 1)))), 0) + Machine(weak, ts).run() + return rows + + +def supplied_replacement(state, payloads): + """Explicit caller work outside the primitive bill; retain all history.""" + text = '^' + '|'.join(payloads) + '|$' + symbols = {s: i for i, s in enumerate('_01^|$')} + o = state.origins[0] + state.tapes[0][o + 1:-3] = bytes(len(state.tapes[0]) - o - 4) + state.tapes[0][o:o + len(text)] = bytes(symbols[s] for s in text) + + +def source_corruption(): + with tempfile.TemporaryDirectory(prefix='rank2-source-control-') as directory: + target = Path(directory) + for name in ('rank2.py', 'SOURCES.json', 'RECIPE.json'): + shutil.copy2(HERE / name, target / name) + for pin in json.loads((HERE / 'SOURCES.json').read_text())['files']: + dest = target / pin['local']; dest.parent.mkdir(parents=True, exist_ok=True) + shutil.copy2(HERE / pin['local'], dest) + source = target / 'reference/linear/linear.py' + source.write_bytes(source.read_bytes() + b'\n# actual changed retained byte\n') + launcher = ('import sys,tempfile;from pathlib import Path;' + 'd=tempfile.TemporaryDirectory();sys.dont_write_bytecode=True;' + 'sys.pycache_prefix=str(Path(d.name)/"absent");' + 'sys.path.insert(0,' + repr(str(target)) + ');import rank2') + r = subprocess.run([sys.executable, '-I', '-B', '-c', launcher], capture_output=True, text=True) + need(r.returncode != 0 and 'source drift' in r.stderr, 'actual source corruption imported') + + +def run(): + source = bind_source() + guard_rows = guards() + code, alphabet, entries = C._compile_move() + need(alphabet == ('_', '0', '1', '|'), 'fixed alphabet') + need(not any(op == 'write' and args[0] == C.DATA for op, *args in code[:entries['commit']]), + 'core original owner write before final commit') + for pc, (op, *args) in enumerate(code): + if op in ('read', 'write', 'move'): + need(0 <= args[0] < C.TAPES, 'core port bound') + if op == 'read': + need(all(0 <= target < len(code) for target in args[1].values()), 'core branch bound') + if op == 'goto': + need(0 <= args[0] < len(code), 'core goto bound') + if op == 'move': + need(args[1] in (-1, 1), 'unit core move') + g, stages = A.compile_home() + program = Program(g) + rng = random.Random(28141) + shape = (1, 1, 1, 1, 5, 2) + values = [(2 * rng.randrange(-2, 3), 2 * rng.randrange(-2, 3)) for _ in range(512)] + h, data = header(shape), encode(values, shape[4]) + bits = h + data + output_values = image_f1(values, shape) + expected = h + encode(output_values, shape[4]) + need(expected != bits and any(a or b for a, b in output_values), 'nontrivial dense owned packet') + parked = ''.join(str(rng.randrange(2)) for _ in bits) + state = initial((parked, bits), A.TAPES, old_history=3 * len(bits)) + entry_history = state.highs.copy() + program.run(state, stop=stages['core_return']) + need(fields(state) == (parked, bits) and state.writes[0] == 0, 'HOME changed before core return') + prefix_steps = state.steps + program.run(state, start=stages['core_return'], stop=stages['primitive_return']) + need(fields(state) == (parked, bits) and state.writes[0] == 0, 'HOME changed before B1 scatter') + program.run(state, start=stages['primitive_return']) + need(fields(state) == (parked, expected), 'actual complete rank2 HOME image') + check_retired(state) + first = dict(shape=shape, F=len(bits), E=len(h), V=len(data), steps=state.steps, + core_return_steps=prefix_steps, HOME_writes=state.writes[0], + output_sha256=hashlib.sha256(expected.encode()).hexdigest()) + need(state.writes[0] == len(bits), 'complete same owned HOME commit') + need(state.steps <= 128 * (len(bits) + 1) + (1 << 24) * (len(data) + len(h) + 1), 'complete MOVE bill') + # Same actual owners/private tapes; caller supplies a smaller new packet. + smaller = (1, 1, 1, 1, 4, 1 << 63) + small_values = [(2 * rng.choice((-1, 1)), 2 * rng.choice((-1, 1))) for _ in range(512)] + small_bits = header(smaller) + encode(small_values, 4) + small_expected = header(smaller) + expected_f1(small_values, smaller) + need(len(small_bits) < len(bits), 'shorter actual reuse') + small_parked = ('10' * len(small_bits))[:len(small_bits)] + old_highs = state.highs.copy(); before_steps = state.steps + supplied_replacement(state, (small_parked, small_bits)) + program.run(state) + need(fields(state) == (small_parked, small_expected), 'same-owner smaller packet') + check_retired(state) + need(all(a >= b for a, b in zip(state.highs, old_highs)), 'prior backing was refunded') + reuse = dict(shape=smaller, F=len(small_bits), steps=state.steps - before_steps, + retained_guide_high=state.highs[-1], entry_guide_high=entry_history[-1]) + # The physical rank guard rejects where the old f guard would accept. + bad_shape = (1, 1, 1, 1, 5, 1) + bad_bits = header(bad_shape) + data + rejected = initial(('0' * len(bad_bits), bad_bits), A.TAPES) + saved = bytes(rejected.tapes[0]) + try: + program.run(rejected) + except Rejected: + pass + else: + raise ValueError('f<=cutoff<2f accepted') + need(rejected.writes[0] == 0 and bytes(rejected.tapes[0]) == saved, 'bad cutoff changed HOME') + # Manufacture R*x with value one on both first-slot bits and zero + # elsewhere. The first C pass and slot swap complete; the second pass + # then has a genuine half-integral result. This exercises whole-call + # staging after a completed child, without assuming rollback/retry. + right = C.RECIPE['right'] + numeric = [(0, 0)] * 512 + for x in range(512): + target = sum(((row & x).bit_count() & 1) << i for i, row in enumerate(right['matrix_rows'])) + if target in (0, 1): + q = sum(right['linear_Z4'][i] for i in range(9) if (x >> i) & 1) + q += 2 * sum(1 for i in range(9) for j in range(i + 1, 9) + if (x >> i) & (x >> j) & (right['quadratic_rows'][i] >> j) & 1) + numeric[reverse9(x)] = ((1, 0), (0, -1), (-1, 0), (0, 1))[q % 4] + numeric_bits = h + encode(numeric, shape[4]) + late = initial(('0' * len(numeric_bits), numeric_bits), A.TAPES) + saved_late_home = bytes(late.tapes[0]) + base = int(stages['core_entry'].rsplit('.', 1)[1]) + second = 'MOVE28141.' + str(base + entries['second_C_']) + need(second in program.labels, 'literal second-child location') + program.run(late, stop=second) + first_child_completed_steps = late.steps + need(late.writes[0] == 0, 'HOME changed before second child') + middle = [(0, 0)] * 512 + middle[0] = middle[128] = (1, 0) + start = late.origins[A.CORE_BASE + C.WORK] + 2 + need(bytes(late.tapes[A.CORE_BASE + C.WORK][start:start + len(data)]) == + bytes(1 if b == '0' else 2 for b in encode(middle, shape[4])), + 'first C and exact slot swap did not complete') + try: + program.run(late, start=second) + except Rejected: + pass + else: + raise ValueError('second-child nonintegral prefix accepted') + need(late.writes[0] == 0 and bytes(late.tapes[0]) == saved_late_home, + 'later numerical rejection changed original HOME') + # Full actual graph with a wrong constant phase: should complete cleanly + # but produce exactly i times the correct f=1 image, proving separation. + wrong_graph, _ = A.compile_home(mutation='wrong_phase') + wrong = initial((parked, bits), A.TAPES) + Program(wrong_graph).run(wrong) + rotated = h + encode([(-b, a) for a, b in output_values], shape[4]) + need(fields(wrong) == (parked, rotated) and rotated != expected, 'absolute-phase graph control') + check_retired(wrong) + source_corruption() + return dict(marker='PASS_LITERAL_OWNED_RANK2_HOME', source=source, + core_locations=len(code), core_graph_sha256=hashlib.sha256(repr(code).encode()).hexdigest(), + HOME_states=len(g.rules), tapes=A.TAPES, core_tapes=C.TAPES, + owned_entry='supplied already-reserved raw-native-owned28141/1526; no INIT producer', + full_f1=first, same_owner_reuse=reuse, cutoff_rejection_steps=rejected.steps, + second_child_rejection=dict(first_child_completed_steps=first_child_completed_steps, + rejection_steps=late.steps, HOME_writes=late.writes[0]), + wrong_phase_full_steps=wrong.steps, guard_cases=guard_rows, + controls=['2f cutoff vs old f guard', 'full graph absolute phase', 'actual retained source corruption', + 'inverse source orientation', 'one C instead of two', 'no early original-owner writes', + 'second-child rejection after completed first C and slot swap'], + scope='Exact supplied Gamma6/HOME leaf primitive only; no full lifetime, endpoint conversion or nonleaf rate.') + + +if __name__ == '__main__': + start = time.monotonic() + result = run() + if '--write' in sys.argv: + (HERE / 'RESULT.json').write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + elif (HERE / 'RESULT.json').exists(): + need(json.loads((HERE / 'RESULT.json').read_text()) == json.loads(json.dumps(result)), 'scientific receipt changed') + print(json.dumps(result, indent=2, sort_keys=True)) + print('elapsed_seconds', round(time.monotonic() - start, 3)) diff --git a/research/literal-owned-rank-two-move/review/root/FINAL-AUTHOR-REPLAY.json b/research/literal-owned-rank-two-move/review/root/FINAL-AUTHOR-REPLAY.json new file mode 100644 index 0000000000..77025c9fdb --- /dev/null +++ b/research/literal-owned-rank-two-move/review/root/FINAL-AUTHOR-REPLAY.json @@ -0,0 +1,19 @@ +{ + "checks": [ + { + "mode": "normal", + "exit": 0, + "seconds": 23.524, + "stdout_sha256": "8d7f5cbaeed49ab4616ba1a1cf6152ed1da7b7ca856980171022847490285876", + "stderr": "" + }, + { + "mode": "optimized", + "exit": 0, + "seconds": 22.62, + "stdout_sha256": "713e6e89d21d1851779f7c84547ecf9249d1a0a655a0286025f3704cdc2c6cb6", + "stderr": "" + } + ], + "read_only": true +} diff --git a/research/literal-owned-rank-two-move/review/root/FINAL-SOURCE-BINDING.json b/research/literal-owned-rank-two-move/review/root/FINAL-SOURCE-BINDING.json new file mode 100644 index 0000000000..7048caf474 --- /dev/null +++ b/research/literal-owned-rank-two-move/review/root/FINAL-SOURCE-BINDING.json @@ -0,0 +1,24 @@ +{ + "controls": [ + "absolute_phase", + "inverse_orientation", + "one_C_instead_of_two" + ], + "event_index": 28141, + "exact_equality": "signed Pauli action and exact Gaussian separating column", + "frames": [ + 601, + 470 + ], + "full_archive_reextracted": true, + "left_CNOT": 31, + "left_records": 36, + "marker": "PASS_OWNED_RANK2_SOURCE", + "matrix_columns": 1024, + "owner": 1526, + "private": true, + "private_flag_is_not_inversion": true, + "rank": 2, + "right_CNOT": 29, + "right_records": 44 +} diff --git a/research/literal-owned-rank-two-move/review/root/RESULT.json b/research/literal-owned-rank-two-move/review/root/RESULT.json new file mode 100644 index 0000000000..5e7ffc27ed --- /dev/null +++ b/research/literal-owned-rank-two-move/review/root/RESULT.json @@ -0,0 +1,48 @@ +{ + "status": "PASS_ROOT_RANK2_HOME", + "states": 115953, + "tapes": 35, + "embedded_instructions": 115776, + "core_sha256": "6f440702d6d0b2428df1016f8006ae339699e8b9fe1cf9fe5dc0d2c111821adf", + "shape": [ + 1, + 1, + 1, + 1, + 6, + 2 + ], + "F": 6156, + "receipt": { + "steps": 30838694, + "HOME_writes": 6156, + "early_HOME_writes": 0, + "entry_head_history": 112353, + "final_head_history": 195946, + "checkpoints": { + "MOVE28141.71": { + "steps": 49345, + "home_writes": 0 + }, + "jump.70": { + "steps": 30789366, + "home_writes": 0 + }, + "jump.5": { + "steps": 30807904, + "home_writes": 0 + } + } + }, + "input_sha256": "d033ff7aa943299b76b99ffa64bf35c1d6520fac7f95deb22d470766468d4044", + "output_sha256": "ab1142f1883f0746afb98d28df01cacd8df2286b03be212ffd5c432b30106e20", + "source_oracle": "Separate dense Fraction frame definition using span-set basis extension and inverse permutations; no author oracle/native verifier/recipe import.", + "independence": "Sparse signed-origin graph interpreter retained from prior independent root review; original-frame arithmetic independently written for this task.", + "scope": "One fresh dense full f=1 packet, exact embedding of every instruction, original ownership and all heads/private/exterior restored; universal proof separate.", + "files": { + "adapter.py": "b0d60256c88ce106d3463a5f5b3cc6f7d1d11d3fad8f0fcb332bfcca3cdb1dcc", + "rank2.py": "3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a", + "SOURCES.json": "659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641", + "RECIPE.json": "b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702" + } +} diff --git a/research/literal-owned-rank-two-move/review/root/SNAPSHOT.json b/research/literal-owned-rank-two-move/review/root/SNAPSHOT.json new file mode 100644 index 0000000000..547c4c32cb --- /dev/null +++ b/research/literal-owned-rank-two-move/review/root/SNAPSHOT.json @@ -0,0 +1,36 @@ +{ + "scope": "critical implementation snapshot for independent review; author documentation not yet frozen", + "files": { + "SOURCES.json": "659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641", + "README.md": "90d9ed2f26ade3fed562f7b930fd60fe56b75cef1b43cb2a24a0e99a52150210", + "RESULT.json": "1673bf5ca1d1d46762a67085e5dfc1d72d5e31a211bc2f56f8946efc6b07f127", + "verify.py": "c023806283adf2e1aec156b6a909a7620a0a6db70898baa0b3926a1f90a7cf83", + "bind_source.py": "2dee631ed6ee1bb479e9f56f965b50181125823f1beaac251a46c92c3ffcc8a0", + "adapter.py": "b0d60256c88ce106d3463a5f5b3cc6f7d1d11d3fad8f0fcb332bfcca3cdb1dcc", + "oracle.py": "93c7964163fe0b9f7977703a78a456e81117d9d3f63e64ce213407a963c7b6ff", + "RECIPE.json": "b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702", + "REMOTE-BINDINGS.json": "c3b16896601fc024e832ed7abb3266e16de170ed72a93f702a1a5e98e0f24694", + "machine.py": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee", + "rank2.py": "3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a", + "PR-TITLE.txt": "43e1c0e57941afc23d29d877488440eccfee1b4ec8a0c908ade46361543957a3", + "PROOF.md": "93e1ad8a92c3624df064e4f39119ccbb5c96391ea8dd5f7af58edc7ca9638352", + "PR-DESCRIPTION.md": "be862b0e585a1d74bb70369489358b21a0ec3ca06946977b839401a3bc6cef8b", + "OVERLAP.md": "43aeda8f27c34eafc18b2c93b25a8128eefed7cf7b152dd13eaf925a7cc8ac34", + "NOTICE.md": "8e4464c37453cede80b45ca5735a1aab22acd15d8796a78ba48713cc4717313a", + "CHECKPOINT.md": "d84a61f43fe1ecbb40d6251e93b3ba06c03f2f55be20bb3db44c79f111be282e", + "reference/leaf/leaf.py": "bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744", + "reference/leaf/NOTICE.md": "773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf", + "reference/source/native_verify.py": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38", + "reference/source/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "reference/home/parent_adapter.py": "04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099", + "reference/home/tape_graph.py": "7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54", + "reference/home/NOTICE.md": "b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842", + "reference/linear/linear.py": "d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33", + "reference/linear/NOTICE.md": "2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50", + "reference/phase/NOTICE": "5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0", + "reference/phase/phase.py": "2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7", + "reference/leaf/inputs/controller_reference.py": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "reference/linear/inputs/controller_reference.py": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "reference/phase/inputs/controller_reference.py": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + } +} diff --git a/research/literal-owned-rank-two-move/review/root/check_rank2_root.py b/research/literal-owned-rank-two-move/review/root/check_rank2_root.py new file mode 100644 index 0000000000..ba52c3bf01 --- /dev/null +++ b/research/literal-owned-rank-two-move/review/root/check_rank2_root.py @@ -0,0 +1,130 @@ +"""Independent sparse Graph CPU and dense rational original-frame oracle for MOVE28141.""" +from pathlib import Path +from fractions import Fraction +import hashlib,json,sys,time +P=Path(sys.argv[1]).resolve() if len(sys.argv)>1 else Path(__file__).with_name('source').resolve() +sys.path.insert(0,str(P)) +import adapter as a +def require(ok,why): + if not ok:raise ValueError(why) +def word(x,w):return format(x%(1<>j&1:z^=c + perm.append(z) + inverse=[0]*512 + for j,k in enumerate(perm):inverse[k]=j + dual=[inverse[1<>j&1 for j in range(9)] + phases.append((sum(q[j][j]*bits[j] for j in range(9))+2*sum(q[j][k]*bits[j]*bits[k] for j in range(9) for k in range(j+1,9)))%4) + v=[(Fraction(0),Fraction(0))]*512 + for n,z in enumerate(values):v[inverse[n]]=rotate(z,-phases[n]) + for axis in range(len(directions)): + w=[None]*512;bit=1<