diff --git a/research/literal-source-affine-move/CHECKSUMS.sha256 b/research/literal-source-affine-move/CHECKSUMS.sha256 new file mode 100644 index 0000000000..829e697d63 --- /dev/null +++ b/research/literal-source-affine-move/CHECKSUMS.sha256 @@ -0,0 +1,95 @@ +f3c7d834839f3b66b66693c974abc5125c316400bae3f9a4e9d76ba473273d26 PR-DESCRIPTION.md +9f54ed10e2da6da6c8a01689cdab948abecc6bae0ea355167f6d8f2b802c19e0 PR-TITLE.txt +7977e2dae342a2590df6322c8d96615d8868fc9ffc5c14124e7d934265bed1ab README.md +341ccdabc22fbc35c65066838426bbcba47fc145d6c70ba878d19dc93754a7c8 SOURCES.json +210c8c04e5f613bd3327c5412daaa47cb181a466bc39175b9fc0a27dcd64e4ce TASK.json +11facac97cce2d8f661ba0d318c1c5e9be6fb7d9837e8e7ed46009272187ddb0 VERIFY.json +cdd05c875966beb50b73fa70fc0f7658fb66fc14574651ed0af6844517845498 appendix/fixed-recipe/BUDGET.json +ca460ef6a5b3759950a26f6463f3edec1431469b871fe500950699fe5ade6b9a appendix/fixed-recipe/INTEGRATION-NOTE.md +e1fdba2481bcc6970fdfe0a26635a5deb03bf0e8d2e700bfaa42e14ba5728d63 appendix/fixed-recipe/PROOF-DRAFT.md +723b1c71cf11c6c16c2b4ada70c8f7c5a7d9705386ed6ba3b8ec592aef386c57 appendix/fixed-recipe/PROOF.md +92db396942623d292b52062369ed6a51648c883b3dddec1ffaa6254cc0c672ff appendix/fixed-recipe/REVIEW.md +0b1247a92207e456b11915706bbfee378f110eb949845f25cc251664ee2a00bd appendix/fixed-recipe/SOURCE-REVIEW.json +97e1a944d9e51f8070eb2f85c08eab14bb56174e06f714add329d56fcb3dbdc3 implementation/CHECKPOINT.md +7eaebda9dfdf28631ccd752e296289e5e6763ecc759d334f2b8570f7212f6a20 implementation/ENVIRONMENT.json +9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde implementation/FREEZE.json +91b207a27c0d9d16cfff8e42332e04126d73a9797fc312f19762297fde04cd8b implementation/GRAPH.json +46825d46977c64429b21108df57fbbcac1a3262cc15010eb3bcab8c62d2dfbfd implementation/NOTICE.md +95faf01d82e6abdd57fcdd1ddbea115e28a72e49cb2bb7b546fc00b4c63eca4e implementation/OVERLAP.md +739c4183d830bb1b2b18e9918e76091ab51c9ff0aa1ae886323df8ac765d9dca implementation/PR-DESCRIPTION.md +30eb220651420201a57a089b34f6b54b55f995dfc7b6758910da10d87c15e86e implementation/PROOF.md +1460287ec82d51caab6b6de764afb7c306e81a21e4ea0326db334cea45a7ed29 implementation/README.md +8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79 implementation/RECIPE.json +42e904c679a3df89e0f88a6cc8d46132fd830705ef5a13cecdfcadba2f2ef1e0 implementation/RESULT.json +2e5c028dde3da98aabd5ebe2daa9bd53effca33e2157a2954b893db36ce0ef83 implementation/SOURCE-BINDING.json +b3a2d73ae575c840a1ebd85e0734def9330c3afaecf862b75edd62387870b382 implementation/SOURCES.json +e18b1e320a4f00177e5bc437867b906e4e63bbedd40bab668b14428fa67969bf implementation/adapter.py +0ceaa9f378eb17743aff2ba71b86be163cf841cf97609f90eb2aed77e9a10f34 implementation/bind_source.py +abbbd21565ff67a5268d30c034ad33f2143c8b2699bbcccc68569a326ff020b6 implementation/engines/SOURCES.json +9387d4caa6ea6ad9e232f4a2a07112fa1a681d34af19e5aae64d1d8adc5ebd2c implementation/engines/affine.py +971080f6254cfaf44b01a412533818ffdff78ea925452c76a02524092b3ccff6 implementation/engines/join.py +ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee implementation/engines/machine.py +072dfea997d4db796d492eaf746e0bd99630964741b88862d0f10f5fc1e00275 implementation/engines/reference/rank2/FREEZE.json +93e1ad8a92c3624df064e4f39119ccbb5c96391ea8dd5f7af58edc7ca9638352 implementation/engines/reference/rank2/PROOF.md +b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702 implementation/engines/reference/rank2/RECIPE.json +659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641 implementation/engines/reference/rank2/SOURCES.json +ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee implementation/engines/reference/rank2/machine.py +3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a implementation/engines/reference/rank2/rank2.py +b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842 implementation/engines/reference/rank2/reference/home/NOTICE.md +04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099 implementation/engines/reference/rank2/reference/home/parent_adapter.py +7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54 implementation/engines/reference/rank2/reference/home/tape_graph.py +773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf implementation/engines/reference/rank2/reference/leaf/NOTICE.md +e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73 implementation/engines/reference/rank2/reference/leaf/inputs/controller_reference.py +bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744 implementation/engines/reference/rank2/reference/leaf/leaf.py +2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50 implementation/engines/reference/rank2/reference/linear/NOTICE.md +e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73 implementation/engines/reference/rank2/reference/linear/inputs/controller_reference.py +d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33 implementation/engines/reference/rank2/reference/linear/linear.py +5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0 implementation/engines/reference/rank2/reference/phase/NOTICE +e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73 implementation/engines/reference/rank2/reference/phase/inputs/controller_reference.py +2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7 implementation/engines/reference/rank2/reference/phase/phase.py +2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962 implementation/engines/reference/rank2/reference/source/clifford_exact.py +3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38 implementation/engines/reference/rank2/reference/source/native_verify.py +24f5e9957fcd8f6cfdc021ff5bc91bf89e50587997e2a2cb18053949c0e0d205 implementation/engines/reference/translation/NOTICE.md +6b76d348203aed15cbc30d104c59571111ccf6cb7bb4592936e9170f736b68e0 implementation/engines/reference/translation/PROOF.md +e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73 implementation/engines/reference/translation/reference/inputs/controller_reference.py +4b516d85baf3303db809bc1174394009b1fc71a8f7d17fb6c729ec8bb6aba245 implementation/engines/reference/translation/reference/reverse.py +e2750fef8c2b9c8019d67285df3ca0d04340cd241782c7845665b7de621ca3bd implementation/engines/reference/translation/translate.py +ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee implementation/machine.py +b213325a652dc91630a50fb63d573108a04a2b7a07e587f25b0ecf0db8ffd668 implementation/move.py +c4a63b2d0d03e45640d9560a8669b4d01626cd1d10ab6574535240d72cd498fa implementation/normal.log +e3e236bf82f77eb577c0737aec35ff59c40bddbb58ec84d1e4bbb01ceff907bf implementation/optimized.log +762847697ca3fa50e69eb146c157fa888a3687dd552c5b75bccb917f1a65b17a implementation/oracle.py +de2753cb42a012e07aa7ace263bedce5c4be8506ae30ab768af9e165a6edd6e0 implementation/reference/affine-FREEZE.json +f43040c6331dc29ecf3f435e980cc71f00a60e421f50f4e843192a23e733bd44 implementation/reference/affine-PROOF.md +abbbd21565ff67a5268d30c034ad33f2143c8b2699bbcccc68569a326ff020b6 implementation/reference/affine-SOURCES.json +5735c401ba981a7af4d3a146eb047d04fa0c87dbf7ed49bd82dc57df8d6cb2ef implementation/reference/central-FREEZE.json +48899c607452daccd0998f4005ae2a6ed85a723969f474bf796496303ad4d4bb implementation/reference/central-PROOF.md +496948cd8d2b5134ceed6b48b870be73f6415b5f70e97ab35b744ded5a2a3c03 implementation/reference/central-SOURCES.json +6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b implementation/reference/prefix-bridge/INDEPENDENT-REVIEW.md +84a30aeff471af36e182840b2c6605e0fdf8aa3a5d829c656b21d16df682f595 implementation/reference/prefix-bridge/PROOF.md +f8be476176747afb154859cb2a3c09cf5154e413fde8b8f9c95e23ce26806645 implementation/reference/prefix-bridge/SOURCE-REVIEW.json +4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055 implementation/reference/prefix-bridge/retained-selected-proof.md +d9abc11899582ff4d37adf32e3de3406b82cc26d797780b98a30e529e418d374 implementation/select_source.py +354cf3527c6881f4b7946722bc6942e51d32973ee801489599a8274bb4e898b8 implementation/verify.py +87ce0928603b4fc3b463e0494ce1b80eb91fddab1f40f95bd53471ef3c909f1a review/independent/DERIVATIVE-AST.normal.json +87ce0928603b4fc3b463e0494ce1b80eb91fddab1f40f95bd53471ef3c909f1a review/independent/DERIVATIVE-AST.optimized.json +219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e review/independent/RESULT.normal.json +219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e review/independent/RESULT.optimized.json +16193b2daba4f0699de22513410a79030db5914aeaf6a395f8f9f79dd956c6ad review/independent/REVIEW.md +d891f992c6e32e4fcc918a3ffbddae43aac0bf5c76536cd193ea5a7afa0e305f review/independent/check_derivative_ast.py +6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b review/independent/common-grid-prefix-bridge-review.md +845922900c157d4eff6c70b9407408fa2dd8b1cae40bb53d9a7de4d017ff2d80 review/independent/kernel_check.py +88bc2ce27922bd2e004cb5c5aafaa2c0a00a6a915fe701b8265726a005a404b0 review/independent/original/CHECKSUMS.sha256 +219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e review/independent/original/RESULT.normal.json +219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e review/independent/original/RESULT.optimized.json +a7627cc4cc3d54725f1a4b77d4a716a3320888b7f8ebda06577fe6d2292c210e review/independent/original/REVIEW.md +6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b review/independent/original/common-grid-prefix-bridge-review.md +cf35d8df98feb1774e53f2e493141479a01f798ebba0dd745ff9b7f6bb7025aa review/independent/original/kernel_check.py +1da2c3512495b7ef66a95afdf36a7dd6df0668bef019b02b06ace49f2340dc68 review/packaging/BASE-CHECKSUMS.sha256 +8386424089c82752da129717c93c89af68f1cabc039ae6d6664989c1e7a3f345 review/packaging/BASE-FREEZE.json +89d45bfd265f8c62c21dcf4ff8cf6eed322302d857f40071d04a6611e2042a88 review/root/INTEGRATION-NOTE.md +508ce98e70e9e0bef11432635f814a793f3165a3f1b9ded2822381ca3e2b87c7 review/root/RESULT.json +49fe59a035d1ca9c085f426696a4be241450a03247cc9fbe5ffa564e00262dc4 review/root/ROOT-REVIEW.md +a73f01b60fa83140ae29398342e2185b3cc6b0356dcdb939274b95a4eea31089 review/root/check_source_move_root.py +08137daaf65d0bccefcf6474d3807cea13accaf95a317219491d51e84d1ebe24 review/root/original/ROOT-REVIEW.md +2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883 source/selected-final.json.gz diff --git a/research/literal-source-affine-move/FREEZE.json b/research/literal-source-affine-move/FREEZE.json new file mode 100644 index 0000000000..f4f062c9a1 --- /dev/null +++ b/research/literal-source-affine-move/FREEZE.json @@ -0,0 +1,496 @@ +{ + "schema": "literal-source-affine-move-publication-freeze/1", + "canonical_base": "e54523517d0f03e58352e647c403a5af3e525a57", + "author_freeze_sha256": "9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde", + "root_review_original_sha256": "08137daaf65d0bccefcf6474d3807cea13accaf95a317219491d51e84d1ebe24", + "root_review_packaged_sha256": "49fe59a035d1ca9c085f426696a4be241450a03247cc9fbe5ffa564e00262dc4", + "excluded_generated_paths": [ + "Python bytecode caches; none present" + ], + "base_packaging_freeze_sha256": "8386424089c82752da129717c93c89af68f1cabc039ae6d6664989c1e7a3f345", + "reviewed_appendix": "appendix/fixed-recipe/PROOF.md", + "files_count": 96, + "files_total_bytes": 906993, + "files": [ + { + "path": "CHECKSUMS.sha256", + "bytes": 10295, + "sha256": "0e7acbd35c4cd56894df51c3c675b250a7fca5a68406772dc98c64b49d91196b" + }, + { + "path": "PR-DESCRIPTION.md", + "bytes": 3894, + "sha256": "f3c7d834839f3b66b66693c974abc5125c316400bae3f9a4e9d76ba473273d26" + }, + { + "path": "PR-TITLE.txt", + "bytes": 95, + "sha256": "9f54ed10e2da6da6c8a01689cdab948abecc6bae0ea355167f6d8f2b802c19e0" + }, + { + "path": "README.md", + "bytes": 6411, + "sha256": "7977e2dae342a2590df6322c8d96615d8868fc9ffc5c14124e7d934265bed1ab" + }, + { + "path": "SOURCES.json", + "bytes": 8598, + "sha256": "341ccdabc22fbc35c65066838426bbcba47fc145d6c70ba878d19dc93754a7c8" + }, + { + "path": "TASK.json", + "bytes": 8674, + "sha256": "210c8c04e5f613bd3327c5412daaa47cb181a466bc39175b9fc0a27dcd64e4ce" + }, + { + "path": "VERIFY.json", + "bytes": 2992, + "sha256": "11facac97cce2d8f661ba0d318c1c5e9be6fb7d9837e8e7ed46009272187ddb0" + }, + { + "path": "appendix/fixed-recipe/BUDGET.json", + "bytes": 257, + "sha256": "cdd05c875966beb50b73fa70fc0f7658fb66fc14574651ed0af6844517845498" + }, + { + "path": "appendix/fixed-recipe/INTEGRATION-NOTE.md", + "bytes": 555, + "sha256": "ca460ef6a5b3759950a26f6463f3edec1431469b871fe500950699fe5ade6b9a" + }, + { + "path": "appendix/fixed-recipe/PROOF-DRAFT.md", + "bytes": 4984, + "sha256": "e1fdba2481bcc6970fdfe0a26635a5deb03bf0e8d2e700bfaa42e14ba5728d63" + }, + { + "path": "appendix/fixed-recipe/PROOF.md", + "bytes": 5415, + "sha256": "723b1c71cf11c6c16c2b4ada70c8f7c5a7d9705386ed6ba3b8ec592aef386c57" + }, + { + "path": "appendix/fixed-recipe/REVIEW.md", + "bytes": 4854, + "sha256": "92db396942623d292b52062369ed6a51648c883b3dddec1ffaa6254cc0c672ff" + }, + { + "path": "appendix/fixed-recipe/SOURCE-REVIEW.json", + "bytes": 855, + "sha256": "0b1247a92207e456b11915706bbfee378f110eb949845f25cc251664ee2a00bd" + }, + { + "path": "implementation/CHECKPOINT.md", + "bytes": 1895, + "sha256": "97e1a944d9e51f8070eb2f85c08eab14bb56174e06f714add329d56fcb3dbdc3" + }, + { + "path": "implementation/ENVIRONMENT.json", + "bytes": 462, + "sha256": "7eaebda9dfdf28631ccd752e296289e5e6763ecc759d334f2b8570f7212f6a20" + }, + { + "path": "implementation/FREEZE.json", + "bytes": 10111, + "sha256": "9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde" + }, + { + "path": "implementation/GRAPH.json", + "bytes": 899, + "sha256": "91b207a27c0d9d16cfff8e42332e04126d73a9797fc312f19762297fde04cd8b" + }, + { + "path": "implementation/NOTICE.md", + "bytes": 1476, + "sha256": "46825d46977c64429b21108df57fbbcac1a3262cc15010eb3bcab8c62d2dfbfd" + }, + { + "path": "implementation/OVERLAP.md", + "bytes": 1862, + "sha256": "95faf01d82e6abdd57fcdd1ddbea115e28a72e49cb2bb7b546fc00b4c63eca4e" + }, + { + "path": "implementation/PR-DESCRIPTION.md", + "bytes": 2329, + "sha256": "739c4183d830bb1b2b18e9918e76091ab51c9ff0aa1ae886323df8ac765d9dca" + }, + { + "path": "implementation/PROOF.md", + "bytes": 13067, + "sha256": "30eb220651420201a57a089b34f6b54b55f995dfc7b6758910da10d87c15e86e" + }, + { + "path": "implementation/README.md", + "bytes": 3746, + "sha256": "1460287ec82d51caab6b6de764afb7c306e81a21e4ea0326db334cea45a7ed29" + }, + { + "path": "implementation/RECIPE.json", + "bytes": 1433, + "sha256": "8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79" + }, + { + "path": "implementation/RESULT.json", + "bytes": 3843, + "sha256": "42e904c679a3df89e0f88a6cc8d46132fd830705ef5a13cecdfcadba2f2ef1e0" + }, + { + "path": "implementation/SOURCE-BINDING.json", + "bytes": 522, + "sha256": "2e5c028dde3da98aabd5ebe2daa9bd53effca33e2157a2954b893db36ce0ef83" + }, + { + "path": "implementation/SOURCES.json", + "bytes": 12367, + "sha256": "b3a2d73ae575c840a1ebd85e0734def9330c3afaecf862b75edd62387870b382" + }, + { + "path": "implementation/adapter.py", + "bytes": 4750, + "sha256": "e18b1e320a4f00177e5bc437867b906e4e63bbedd40bab668b14428fa67969bf" + }, + { + "path": "implementation/bind_source.py", + "bytes": 3988, + "sha256": "0ceaa9f378eb17743aff2ba71b86be163cf841cf97609f90eb2aed77e9a10f34" + }, + { + "path": "implementation/engines/SOURCES.json", + "bytes": 7336, + "sha256": "abbbd21565ff67a5268d30c034ad33f2143c8b2699bbcccc68569a326ff020b6" + }, + { + "path": "implementation/engines/affine.py", + "bytes": 3859, + "sha256": "9387d4caa6ea6ad9e232f4a2a07112fa1a681d34af19e5aae64d1d8adc5ebd2c" + }, + { + "path": "implementation/engines/join.py", + "bytes": 6778, + "sha256": "971080f6254cfaf44b01a412533818ffdff78ea925452c76a02524092b3ccff6" + }, + { + "path": "implementation/engines/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee" + }, + { + "path": "implementation/engines/reference/rank2/FREEZE.json", + "bytes": 5633, + "sha256": "072dfea997d4db796d492eaf746e0bd99630964741b88862d0f10f5fc1e00275" + }, + { + "path": "implementation/engines/reference/rank2/PROOF.md", + "bytes": 16634, + "sha256": "93e1ad8a92c3624df064e4f39119ccbb5c96391ea8dd5f7af58edc7ca9638352" + }, + { + "path": "implementation/engines/reference/rank2/RECIPE.json", + "bytes": 4468, + "sha256": "b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702" + }, + { + "path": "implementation/engines/reference/rank2/SOURCES.json", + "bytes": 10337, + "sha256": "659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641" + }, + { + "path": "implementation/engines/reference/rank2/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee" + }, + { + "path": "implementation/engines/reference/rank2/rank2.py", + "bytes": 8253, + "sha256": "3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a" + }, + { + "path": "implementation/engines/reference/rank2/reference/home/NOTICE.md", + "bytes": 2093, + "sha256": "b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842" + }, + { + "path": "implementation/engines/reference/rank2/reference/home/parent_adapter.py", + "bytes": 5353, + "sha256": "04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099" + }, + { + "path": "implementation/engines/reference/rank2/reference/home/tape_graph.py", + "bytes": 12069, + "sha256": "7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54" + }, + { + "path": "implementation/engines/reference/rank2/reference/leaf/NOTICE.md", + "bytes": 1900, + "sha256": "773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf" + }, + { + "path": "implementation/engines/reference/rank2/reference/leaf/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "implementation/engines/reference/rank2/reference/leaf/leaf.py", + "bytes": 17526, + "sha256": "bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744" + }, + { + "path": "implementation/engines/reference/rank2/reference/linear/NOTICE.md", + "bytes": 2180, + "sha256": "2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50" + }, + { + "path": "implementation/engines/reference/rank2/reference/linear/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "implementation/engines/reference/rank2/reference/linear/linear.py", + "bytes": 13102, + "sha256": "d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33" + }, + { + "path": "implementation/engines/reference/rank2/reference/phase/NOTICE", + "bytes": 808, + "sha256": "5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0" + }, + { + "path": "implementation/engines/reference/rank2/reference/phase/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "implementation/engines/reference/rank2/reference/phase/phase.py", + "bytes": 11734, + "sha256": "2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7" + }, + { + "path": "implementation/engines/reference/rank2/reference/source/clifford_exact.py", + "bytes": 6824, + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "implementation/engines/reference/rank2/reference/source/native_verify.py", + "bytes": 12323, + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38" + }, + { + "path": "implementation/engines/reference/translation/NOTICE.md", + "bytes": 1201, + "sha256": "24f5e9957fcd8f6cfdc021ff5bc91bf89e50587997e2a2cb18053949c0e0d205" + }, + { + "path": "implementation/engines/reference/translation/PROOF.md", + "bytes": 19690, + "sha256": "6b76d348203aed15cbc30d104c59571111ccf6cb7bb4592936e9170f736b68e0" + }, + { + "path": "implementation/engines/reference/translation/reference/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "implementation/engines/reference/translation/reference/reverse.py", + "bytes": 6649, + "sha256": "4b516d85baf3303db809bc1174394009b1fc71a8f7d17fb6c729ec8bb6aba245" + }, + { + "path": "implementation/engines/reference/translation/translate.py", + "bytes": 7703, + "sha256": "e2750fef8c2b9c8019d67285df3ca0d04340cd241782c7845665b7de621ca3bd" + }, + { + "path": "implementation/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee" + }, + { + "path": "implementation/move.py", + "bytes": 4503, + "sha256": "b213325a652dc91630a50fb63d573108a04a2b7a07e587f25b0ecf0db8ffd668" + }, + { + "path": "implementation/normal.log", + "bytes": 2630, + "sha256": "c4a63b2d0d03e45640d9560a8669b4d01626cd1d10ab6574535240d72cd498fa" + }, + { + "path": "implementation/optimized.log", + "bytes": 2630, + "sha256": "e3e236bf82f77eb577c0737aec35ff59c40bddbb58ec84d1e4bbb01ceff907bf" + }, + { + "path": "implementation/oracle.py", + "bytes": 1768, + "sha256": "762847697ca3fa50e69eb146c157fa888a3687dd552c5b75bccb917f1a65b17a" + }, + { + "path": "implementation/reference/affine-FREEZE.json", + "bytes": 7062, + "sha256": "de2753cb42a012e07aa7ace263bedce5c4be8506ae30ab768af9e165a6edd6e0" + }, + { + "path": "implementation/reference/affine-PROOF.md", + "bytes": 12681, + "sha256": "f43040c6331dc29ecf3f435e980cc71f00a60e421f50f4e843192a23e733bd44" + }, + { + "path": "implementation/reference/affine-SOURCES.json", + "bytes": 7336, + "sha256": "abbbd21565ff67a5268d30c034ad33f2143c8b2699bbcccc68569a326ff020b6" + }, + { + "path": "implementation/reference/central-FREEZE.json", + "bytes": 6301, + "sha256": "5735c401ba981a7af4d3a146eb047d04fa0c87dbf7ed49bd82dc57df8d6cb2ef" + }, + { + "path": "implementation/reference/central-PROOF.md", + "bytes": 12196, + "sha256": "48899c607452daccd0998f4005ae2a6ed85a723969f474bf796496303ad4d4bb" + }, + { + "path": "implementation/reference/central-SOURCES.json", + "bytes": 5445, + "sha256": "496948cd8d2b5134ceed6b48b870be73f6415b5f70e97ab35b744ded5a2a3c03" + }, + { + "path": "implementation/reference/prefix-bridge/INDEPENDENT-REVIEW.md", + "bytes": 3970, + "sha256": "6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b" + }, + { + "path": "implementation/reference/prefix-bridge/PROOF.md", + "bytes": 6282, + "sha256": "84a30aeff471af36e182840b2c6605e0fdf8aa3a5d829c656b21d16df682f595" + }, + { + "path": "implementation/reference/prefix-bridge/SOURCE-REVIEW.json", + "bytes": 758, + "sha256": "f8be476176747afb154859cb2a3c09cf5154e413fde8b8f9c95e23ce26806645" + }, + { + "path": "implementation/reference/prefix-bridge/retained-selected-proof.md", + "bytes": 25533, + "sha256": "4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055" + }, + { + "path": "implementation/select_source.py", + "bytes": 2584, + "sha256": "d9abc11899582ff4d37adf32e3de3406b82cc26d797780b98a30e529e418d374" + }, + { + "path": "implementation/verify.py", + "bytes": 8606, + "sha256": "354cf3527c6881f4b7946722bc6942e51d32973ee801489599a8274bb4e898b8" + }, + { + "path": "review/independent/DERIVATIVE-AST.normal.json", + "bytes": 1515, + "sha256": "87ce0928603b4fc3b463e0494ce1b80eb91fddab1f40f95bd53471ef3c909f1a" + }, + { + "path": "review/independent/DERIVATIVE-AST.optimized.json", + "bytes": 1515, + "sha256": "87ce0928603b4fc3b463e0494ce1b80eb91fddab1f40f95bd53471ef3c909f1a" + }, + { + "path": "review/independent/RESULT.normal.json", + "bytes": 1518, + "sha256": "219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e" + }, + { + "path": "review/independent/RESULT.optimized.json", + "bytes": 1518, + "sha256": "219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e" + }, + { + "path": "review/independent/REVIEW.md", + "bytes": 2950, + "sha256": "16193b2daba4f0699de22513410a79030db5914aeaf6a395f8f9f79dd956c6ad" + }, + { + "path": "review/independent/check_derivative_ast.py", + "bytes": 1385, + "sha256": "d891f992c6e32e4fcc918a3ffbddae43aac0bf5c76536cd193ea5a7afa0e305f" + }, + { + "path": "review/independent/common-grid-prefix-bridge-review.md", + "bytes": 3970, + "sha256": "6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b" + }, + { + "path": "review/independent/kernel_check.py", + "bytes": 12789, + "sha256": "845922900c157d4eff6c70b9407408fa2dd8b1cae40bb53d9a7de4d017ff2d80" + }, + { + "path": "review/independent/original/CHECKSUMS.sha256", + "bytes": 653, + "sha256": "88bc2ce27922bd2e004cb5c5aafaa2c0a00a6a915fe701b8265726a005a404b0" + }, + { + "path": "review/independent/original/RESULT.normal.json", + "bytes": 1518, + "sha256": "219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e" + }, + { + "path": "review/independent/original/RESULT.optimized.json", + "bytes": 1518, + "sha256": "219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e" + }, + { + "path": "review/independent/original/REVIEW.md", + "bytes": 5585, + "sha256": "a7627cc4cc3d54725f1a4b77d4a716a3320888b7f8ebda06577fe6d2292c210e" + }, + { + "path": "review/independent/original/common-grid-prefix-bridge-review.md", + "bytes": 3970, + "sha256": "6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b" + }, + { + "path": "review/independent/original/kernel_check.py", + "bytes": 12935, + "sha256": "cf35d8df98feb1774e53f2e493141479a01f798ebba0dd745ff9b7f6bb7025aa" + }, + { + "path": "review/packaging/BASE-CHECKSUMS.sha256", + "bytes": 9156, + "sha256": "1da2c3512495b7ef66a95afdf36a7dd6df0668bef019b02b06ace49f2340dc68" + }, + { + "path": "review/packaging/BASE-FREEZE.json", + "bytes": 15781, + "sha256": "8386424089c82752da129717c93c89af68f1cabc039ae6d6664989c1e7a3f345" + }, + { + "path": "review/root/INTEGRATION-NOTE.md", + "bytes": 503, + "sha256": "89d45bfd265f8c62c21dcf4ff8cf6eed322302d857f40071d04a6611e2042a88" + }, + { + "path": "review/root/RESULT.json", + "bytes": 1429, + "sha256": "508ce98e70e9e0bef11432635f814a793f3165a3f1b9ded2822381ca3e2b87c7" + }, + { + "path": "review/root/ROOT-REVIEW.md", + "bytes": 5498, + "sha256": "49fe59a035d1ca9c085f426696a4be241450a03247cc9fbe5ffa564e00262dc4" + }, + { + "path": "review/root/check_source_move_root.py", + "bytes": 7856, + "sha256": "a73f01b60fa83140ae29398342e2185b3cc6b0356dcdb939274b95a4eea31089" + }, + { + "path": "review/root/original/ROOT-REVIEW.md", + "bytes": 5467, + "sha256": "08137daaf65d0bccefcf6474d3807cea13accaf95a317219491d51e84d1ebe24" + }, + { + "path": "source/selected-final.json.gz", + "bytes": 350722, + "sha256": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883" + } + ] +} diff --git a/research/literal-source-affine-move/PR-DESCRIPTION.md b/research/literal-source-affine-move/PR-DESCRIPTION.md new file mode 100644 index 0000000000..09f8b484f5 --- /dev/null +++ b/research/literal-source-affine-move/PR-DESCRIPTION.md @@ -0,0 +1,36 @@ +## Summary + +This package implements one authenticated selected MOVE, event24476 `[MOVE,727,3,470,false]`, as a literal Gamma6/HOME graph. Its exact map is `M_left C^tensor3 M_right`; the right monomial has output offset 5 and absolute phase 2. It also proves and implements generic fixed nine-coordinate monomial factors under explicit phase, prefix-integrality, signed-width, and supplied-owner promises. + +## Uniform fixed-recipe composition + +The reviewed appendix proves that every valid pair of fixed nine-coordinate monomials and every fixed central rank rho=1..9 admit the same flattened31-tape construction. The complete core bounds are `T <= 2^25(fV+E+1)` and incremental history `4096(V+E+1)`. The fixed-table HOME wrapper schema adds `128(F+1)` time and `64(F+1)` backing on35 tapes. Its stored API remains event24476-specific: no arbitrary-recipe dispatcher or additional physical execution is claimed. The actual rank-three event retains the tighter2048 core-history bound. + +The common-root prefix corollary also identifies the exact sufficient row/view invariant from #7000 for completed Clifford prefixes; the selected producer and address view still have to supply it. + +## Evidence + +- The source archive is bound to canonical main `e54523517d0f03e58352e647c403a5af3e525a57`, Git blob `74563a7867d9d762b6588f65362369668841bb3e`, compressed SHA-256 `2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883`, and canonical-word SHA-256 `91429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097`. +- The exact independent kernel checker matches the direct source-frame Gaussian kernel for all 512 one-column basis inputs and 4,096 nonzero amplitudes. Its five orientation/order/phase/offset/central-sign negative controls reject. +- Root's separate sparse HOME replay checks a fresh `f=1`, `P=2`, `w=10` packet in 118,744,836 tape steps, with 20,496 late HOME writes, complete return and all 35 heads/private bodies/exteriors restored. The full reported cost and history ceilings are in `implementation/PROOF.md` and `review/root/ROOT-REVIEW.md`. +- Registered replays include author normal and `-O`, portable independent checker normal and `-O`, AST identity checks for all mathematical kernel/negative-control functions, and the root sparse machine review. + +## Reproduction + +```sh +python3 -B scripts/research_package.py --package research/literal-source-affine-move +``` + +The seven registered commands pass; expected frozen JSON receipts are packaged beside each checker. Metadata/pin validation is separate from mathematical review. No hosted CI or selected cold replay is claimed. + +## Scope limits + +This is a fixed-recipe direct leaf, not a full source dispatcher or selected caller. The proof assumes that the caller supplies a complete packet, correct six-Gamma header, owner entry, cutoff and numerical prefix promises. It does not establish that an actual selected producer supplies the required common-grid row, that B1 gathering/return/setup fit a faster recurrence, or that any selected framework assumption or kappa changes. + +The event has both a multibit offset and nonzero phase, but #7000's retained source shows an earlier selected MOVE (event24472) already had both. The contribution here is the source-bound rank-three recipe and physical composition in the existing ABI, not “first nonzero offset/phase.” + +## Related work and credit + +The exact source family/all-column algebra and central fixed-rank service are retained from #7000 and #6978. The fixed offset and binary-map primitives retain #7428 and #7430. Upstream commit/blob pins and notices remain in `implementation/SOURCES.json`. + +Prepared for @CubeJerry with substantial OpenAI ChatGPT/Codex assistance. Root's machine and source-kernel review are separately implemented but assess the shared proposed construction; this is not blind or human peer review, nor formal-kernel verification. diff --git a/research/literal-source-affine-move/PR-TITLE.txt b/research/literal-source-affine-move/PR-TITLE.txt new file mode 100644 index 0000000000..9b53e08eb3 --- /dev/null +++ b/research/literal-source-affine-move/PR-TITLE.txt @@ -0,0 +1 @@ +Implement a source-bound rank-three affine MOVE and prove uniform fixed-recipe literal closure diff --git a/research/literal-source-affine-move/README.md b/research/literal-source-affine-move/README.md new file mode 100644 index 0000000000..9e8bd108ab --- /dev/null +++ b/research/literal-source-affine-move/README.md @@ -0,0 +1,41 @@ +# Literal source-bound affine MOVE join + +## Result + +This package supplies a literal Gamma6/HOME implementation for one authenticated selected MOVE, event24476 `[MOVE,727,3,470,false]`, and a generic fixed nine-coordinate monomial service. For that event, the exact source map is $M_L C^{\otimes3}M_R$. The right monomial has output offset $5$ and absolute phase $2$; the left has zero offset and phase. A direct source-kernel cross-check and a separate sparse HOME execution agree with the original frame map. + +The theorem starts with a complete owned packet and explicit numerical prefix promises. Require $3f\le cutoff$, the actual phase operations to fit the signed width, and every output of each positive $C$ prefix to be integral on the same grid and fit the signed width. The simple sufficient reserve in the proof is divisibility by $2^{3f}$ with $2^{3f}M\le 2^{w-1}-1$. This package does not show that a selected producer supplies these promises. + +For $V=2PScw2^{9f}$, header length $E$, and $F=V+E$, the complete actual core costs at most $2^{25}(fV+E+1)$ and increases retained backing by at most $2048(V+E+1)$. The 35-tape HOME adapter adds $128(F+1)$ time and $64(F+1)$ backing. General B1 full-bank gathering, setup, source production and whole-caller costs remain separately paid. This direct leaf has no faster recursive tariff. + +## Uniform fixed-recipe corollary + +[The reviewed appendix](appendix/fixed-recipe/PROOF.md) composes the same literal components for every construction-time rank rho in1..9 and every pair of valid fixed nine-coordinate monomial recipes. A flattened31-tape core has time at most2^25(fV+E+1) and incremental historical backing at most4096(V+E+1), uniformly over those fixed recipes. The proved fixed-table HOME wrapper schema adds128(F+1) time and64(F+1) backing on35 tapes. The stored compile_home API remains specialized to event24476. This is a universal composition proof, not a new all-recipe dispatcher or machine execution; recipe authentication, actual entry/numerical promises and the full source caller remain separate obligations. The exact reviewed draft, independent review, component sum and final clarification are retained. + +The common-root prefix bridge in implementation/reference/prefix-bridge/ derives completed Clifford-prefix grid/range conditions from the retained selected row invariant, provided a producer supplies the complete root row and the correct view. It leaves that actual producer/view obligation explicit and does not replace helper arithmetic or scratch-width proofs. + +## Evidence and source binding + +Canonical base is `e54523517d0f03e58352e647c403a5af3e525a57`. The source archive is `research/shared-wire-split-composition/data/final.json.gz`, Git blob `74563a7867d9d762b6588f65362369668841bb3e`, 350,722 bytes, compressed SHA-256 `2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883`, and canonical-word SHA-256 `91429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097`. The authenticated event uses frame3 `[]` and frame470 `[75,137,265]`. + +`implementation/` is the original author package copied unchanged, freeze SHA-256 `9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde`. `review/independent/` contains an exact one-column Gaussian kernel check written separately from the author compiler, plus a portable derivative that loads the bundled archive and explicit recipe path. The mathematical kernel and negative-control functions are AST-identical to the original checker; `DERIVATIVE-AST-*.json` records that check. `review/root/` contains a separate sparse CPU/address oracle and review: it executes the complete 138,933-instruction core graph on a fresh two-outer-row packet, checks the original frame kernel, commits only after return, and verifies all 35 heads/private bodies/exteriors restore. + +The root receipt's six-field shape is `[f,c,P,S,w,cutoff]=[1,1,2,1,10,3]`; the packaged root review labels the second field `c=1` and states central rank 3. `review/root/INTEGRATION-NOTE.md` records the one-word metadata correction and preserves the original review copy. + +The fixture proves one concrete source-bound recipe and physical lifecycle. It does not establish an all-event dispatcher, producer, actual caller, kappa change, or discharge of the selected framework assumptions. The finite event has a nonzero multibit offset and nonzero phase, but it is not the first selected MOVE with both: event24472 already has a nonzero offset and phase. + +## Prior work and credit + +The source family and exact all-column algebra come from #7000. Rank-scaled coded children are covered by #6978. The fixed first-slot positive-C service and Gamma6/HOME lifecycle are retained from the positive-join package. Fixed affine translation and CNOT services build on #7428 and #7430. This result binds one actual source event and combines its fixed binary maps, phases, output offset, and rank-three positive center in the literal ABI. See `implementation/SOURCES.json` for exact predecessor and source pins. + +Prepared for @CubeJerry with substantial OpenAI ChatGPT/Codex assistance. The author construction and author checks were reviewed separately by root, which also ran a distinct sparse machine and original-frame oracle. The independent checker and construction share the proposed factorization; this is not blind review, human peer review, or formal-kernel verification. + +## Reproduction + +From the repository root, run the registered commands in `VERIFY.json`. The command set includes author normal and optimized replays, the independent exact-kernel checker normal and optimized, the derivative AST identity check normal and optimized, and the root sparse machine replay. No external Python packages are required. + +The bundled `source/selected-final.json.gz` is an exact copy of the pinned canonical archive. The independent checker verifies its Git blob SHA-1, compressed SHA-256, canonical-word SHA-256, source event, frame pair, and recipe hash. The bundle is package-local and is not a declared live repository input. + +## Open next questions + +See the structured questions in `TASK.json`. In particular, an actual selected producer still needs to supply the complete root-row packet, address view, cutoff, and every phase/C-prefix integrality and signed-range promise; and a full caller bill still needs to pay for acquisition, placement, return, backing, and any recursive supplier. diff --git a/research/literal-source-affine-move/SOURCES.json b/research/literal-source-affine-move/SOURCES.json new file mode 100644 index 0000000000..7fa3d6647e --- /dev/null +++ b/research/literal-source-affine-move/SOURCES.json @@ -0,0 +1,225 @@ +{ + "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" + }, + { + "path": "research/shared-wire-split-composition/data/final.json.gz", + "usage": "provenance", + "git_blob": "74563a7867d9d762b6588f65362369668841bb3e", + "sha256": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883" + } + ], + "external_primary_provenance": { + "selected_source_archive": { + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/shared-wire-split-composition/data/final.json.gz", + "git_blob": "74563a7867d9d762b6588f65362369668841bb3e", + "bytes": 350722, + "compressed_sha256": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883", + "canonical_word_sha256": "91429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097" + }, + "upstream_work": [ + { + "pr": 6978, + "commit": "12e58dfdad9371a26f9978c814779da344fd80b4", + "path": "research/current-coded-all-source-leaf/PROOF.md", + "git_blob": "5d619cfc2d3b7bc51e6fcc8e7a46ecd1e313e23d", + "sha256": "2943afc32745929374e8e55daff82b5fa78baa8a557d82b231d04b936c63c10d", + "relation": "rank-scaled coded child algebra is prior work" + }, + { + "pr": 7000, + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md", + "git_blob": "3dd1af2285e597676725e85ad4f65e7ad326d695", + "sha256": "4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055", + "relation": "selected source family and all-column algebra; conditional common-grid theorem" + }, + { + "pr": 7428, + "commit": "1dbdaa414cfe4a4a0f015e88a04b52e146566786", + "path": "research/native-translation-descriptor/PROOF.md", + "git_blob": "5c6325471aaed465737491870443f063c821b7a0", + "sha256": "6b76d348203aed15cbc30d104c59571111ccf6cb7bb4592936e9170f736b68e0", + "relation": "fixed affine offset service retained" + }, + { + "pr": 7430, + "commit": "39b40c465f7636a4bb6d70af28595fe8f70f4f3f", + "path": "research/literal-selected-linear-maps/linear.py", + "git_blob": "6aad40a6c47ed4415917c86fabbd5227a3819a41", + "sha256": "d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33", + "relation": "fixed nine-coordinate CNOT service retained" + } + ] + }, + "author_freeze": { + "path": "implementation/FREEZE.json", + "sha256": "9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde" + }, + "local_scientific_artifacts": [ + { + "path": "implementation/FREEZE.json", + "bytes": 10111, + "sha256": "9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde" + }, + { + "path": "implementation/PROOF.md", + "bytes": 13067, + "sha256": "30eb220651420201a57a089b34f6b54b55f995dfc7b6758910da10d87c15e86e" + }, + { + "path": "implementation/RECIPE.json", + "bytes": 1433, + "sha256": "8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79" + }, + { + "path": "implementation/move.py", + "bytes": 4503, + "sha256": "b213325a652dc91630a50fb63d573108a04a2b7a07e587f25b0ecf0db8ffd668" + }, + { + "path": "implementation/adapter.py", + "bytes": 4750, + "sha256": "e18b1e320a4f00177e5bc437867b906e4e63bbedd40bab668b14428fa67969bf" + }, + { + "path": "implementation/RESULT.json", + "bytes": 3843, + "sha256": "42e904c679a3df89e0f88a6cc8d46132fd830705ef5a13cecdfcadba2f2ef1e0" + }, + { + "path": "implementation/SOURCE-BINDING.json", + "bytes": 522, + "sha256": "2e5c028dde3da98aabd5ebe2daa9bd53effca33e2157a2954b893db36ce0ef83" + }, + { + "path": "implementation/SOURCES.json", + "bytes": 12367, + "sha256": "b3a2d73ae575c840a1ebd85e0734def9330c3afaecf862b75edd62387870b382" + }, + { + "path": "source/selected-final.json.gz", + "bytes": 350722, + "sha256": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883" + }, + { + "path": "review/independent/REVIEW.md", + "bytes": 2950, + "sha256": "16193b2daba4f0699de22513410a79030db5914aeaf6a395f8f9f79dd956c6ad" + }, + { + "path": "review/independent/kernel_check.py", + "bytes": 12789, + "sha256": "845922900c157d4eff6c70b9407408fa2dd8b1cae40bb53d9a7de4d017ff2d80" + }, + { + "path": "review/independent/original/kernel_check.py", + "bytes": 12935, + "sha256": "cf35d8df98feb1774e53f2e493141479a01f798ebba0dd745ff9b7f6bb7025aa" + }, + { + "path": "review/independent/RESULT.normal.json", + "bytes": 1518, + "sha256": "219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e" + }, + { + "path": "review/independent/RESULT.optimized.json", + "bytes": 1518, + "sha256": "219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e" + }, + { + "path": "review/independent/check_derivative_ast.py", + "bytes": 1385, + "sha256": "d891f992c6e32e4fcc918a3ffbddae43aac0bf5c76536cd193ea5a7afa0e305f" + }, + { + "path": "review/independent/DERIVATIVE-AST.normal.json", + "bytes": 1515, + "sha256": "87ce0928603b4fc3b463e0494ce1b80eb91fddab1f40f95bd53471ef3c909f1a" + }, + { + "path": "review/independent/DERIVATIVE-AST.optimized.json", + "bytes": 1515, + "sha256": "87ce0928603b4fc3b463e0494ce1b80eb91fddab1f40f95bd53471ef3c909f1a" + }, + { + "path": "review/independent/common-grid-prefix-bridge-review.md", + "bytes": 3970, + "sha256": "6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b" + }, + { + "path": "review/root/ROOT-REVIEW.md", + "bytes": 5498, + "sha256": "49fe59a035d1ca9c085f426696a4be241450a03247cc9fbe5ffa564e00262dc4" + }, + { + "path": "review/root/check_source_move_root.py", + "bytes": 7856, + "sha256": "a73f01b60fa83140ae29398342e2185b3cc6b0356dcdb939274b95a4eea31089" + }, + { + "path": "review/root/RESULT.json", + "bytes": 1429, + "sha256": "508ce98e70e9e0bef11432635f814a793f3165a3f1b9ded2822381ca3e2b87c7" + }, + { + "path": "review/root/INTEGRATION-NOTE.md", + "bytes": 503, + "sha256": "89d45bfd265f8c62c21dcf4ff8cf6eed322302d857f40071d04a6611e2042a88" + }, + { + "path": "README.md", + "bytes": 5208, + "sha256": "fe2a441667029813698bd83aca10fde348a60d3f70350abb769927f06aff0052" + }, + { + "path": "TASK.json", + "bytes": 8034, + "sha256": "ea30a211c71a157ad0c03cdfea60cd0dd077c74450e636c3ca537c2b1980c12d" + }, + { + "path": "VERIFY.json", + "bytes": 2992, + "sha256": "11facac97cce2d8f661ba0d318c1c5e9be6fb7d9837e8e7ed46009272187ddb0" + }, + { + "path": "PR-TITLE.txt", + "bytes": 44, + "sha256": "9ee6728020a2df7365cae6410b5aaf63dab74cb6288cfb528b1d2fdf61fa8caf" + }, + { + "path": "PR-DESCRIPTION.md", + "bytes": 2792, + "sha256": "d87afc51c96f76b7dc46eb0e940d4a04c75af2d449aa642b55f16af5a123e5fb" + }, + { + "path": "review/root/original/ROOT-REVIEW.md", + "bytes": 5467, + "sha256": "08137daaf65d0bccefcf6474d3807cea13accaf95a317219491d51e84d1ebe24" + } + ], + "verification_roles": { + "independent_review": "review/independent/REVIEW.md; separate exact source kernel plus portable derivative and AST identity check", + "root_review": "review/root/ROOT-REVIEW.md, review/root/check_source_move_root.py, review/root/RESULT.json; separate sparse HOME machine and direct frame kernel" + }, + "bundle_policy": "The package-local source/selected-final.json.gz is an exact copied canonical Git blob. It is not a live VERIFY input; the independent checker verifies blob SHA-1, compressed SHA-256 and canonical word SHA-256 against the provenance row." +} diff --git a/research/literal-source-affine-move/TASK.json b/research/literal-source-affine-move/TASK.json new file mode 100644 index 0000000000..0364805886 --- /dev/null +++ b/research/literal-source-affine-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 inherited-assumption card is narrowed to one constructive source-bound sublemma: a literal Gamma6/HOME composition for selected MOVE24476, with explicit numerical prefix and supplied-owner promises. This package does not prove any inherited assumption at its actual caller. A final evidence-driven composition within the same fixed-nine-coordinate boundary records the uniform component theorem; it adds no runtime dispatcher or source-family admission.", + "actual_scope": "For selected event24476 [MOVE,727,3,470,false], authenticate the complete source frame pair and prove/emit the actual rank-three operator M_left C^tensor3 M_right in the existing 9-coordinate Gamma6/HOME ABI. Also supply a generic fixed-nine-coordinate monomial implementation over f columns under explicit phase and numerical-prefix promises, exact direct-leaf cost/history, and one independently checked physical packet. No selected caller/producer or nonleaf admission is included. The reviewed compositional appendix extends the fixed-table existence/cost theorem to every valid fixed nine-coordinate monomial pair and central rank1..9, while preserving every supplied-entry premise and event-specific API limitation.", + "bottleneck_link": "This supplies one concrete source-specific affine/phase/positive-center join touching native_all_columns, precision_tape and owned_erasure. The direct core cost is O(fV+E); all producer, full-bank B1, setup, return, global ownership, recursive and caller costs remain separate.", + "stop_rule": "Stop after the source archive/event binding, rank-three recipe theorem, generic fixed monomial theorem, complete direct-leaf bill/history, portable exact kernel review and independent physical HOME packet. Do not infer a full event dispatcher, actual selected numerical promise, nonleaf recurrence, selected assumption discharge or kappa change. The final appendix may sum and compose these same reviewed components, but must not add an unreviewed algorithm or claim a generic runtime API.", + "evidence": "implementation/PROOF.md; implementation/FREEZE.json; implementation/SOURCE-BINDING.json; implementation/RESULT.json; review/independent/REVIEW.md and receipts; review/root/ROOT-REVIEW.md and RESULT.json; the registered commands in VERIFY.json. appendix/fixed-recipe/PROOF.md, REVIEW.md, SOURCE-REVIEW.json and BUDGET.json.", + "author": "@CubeJerry", + "ai_assistance": "Substantial OpenAI ChatGPT/Codex assistance. The author construction and checks, the independent direct source-kernel implementation, and root sparse-machine review are disclosed. The roles examine the shared proposed factorization; this is not blind review, human peer review or formal-kernel verification.", + "outcome": "completed", + "open_questions": [ + { + "question": "Can an actual selected producer supply a complete source-root packet and satisfy every signed-phase and positive-C prefix integrality/range promise for this MOVE?", + "why_it_matters": "The fixed leaf begins after the full packet, owner entry, header, cutoff and numerical conditions are supplied; a local finite fixture does not discharge precision_tape or producer obligations.", + "first_step": "Bind one actual selected source producer output to the six Gamma fields, complete 9f coordinate view, coefficient/spectator layout, all C-prefix rows and the returned owner.", + "blocked_by": "This package supplies no selected caller producer, source-to-packet view or proof that the actual caller meets its numerical premise." + }, + { + "question": "Can the finite source MOVE family be installed as one source-bound dispatcher with complete event chronology, job ownership and typed packet acquisition?", + "why_it_matters": "One source event and a generic fixed monomial engine do not build the 6,310-event chronology, place owners or close the full public/private lifetime.", + "first_step": "Choose a second authenticated event with its ordered frames and owner state, then bind its full recipe and surrounding source transitions before generalizing the dispatcher.", + "blocked_by": "The package implements one event only and has no event producer, archive-wide dispatch table or public/private ownership closure." + }, + { + "question": "Can an enclosing supplier meet the selected nonleaf movement tariff after paying for the full bank, setup, producer and return?", + "why_it_matters": "The direct fixed-r leaf costs O(fV+E), and its HOME adapter is not a faster recursive supplier or a full B1 invoice.", + "first_step": "Write the complete selected caller invoice with B1 bank sizes/history, setup, acquisition, primitive, retirement and return terms before proposing a faster recurrence.", + "blocked_by": "No nonleaf recurrence, whole-bank supplier or selected caller cost proof is included." + } + ] +} diff --git a/research/literal-source-affine-move/VERIFY.json b/research/literal-source-affine-move/VERIFY.json new file mode 100644 index 0000000000..39a92e866e --- /dev/null +++ b/research/literal-source-affine-move/VERIFY.json @@ -0,0 +1,99 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "-W", + "error", + "{package}/implementation/verify.py" + ], + "timeout_seconds": 240, + "checks": "Original author verifier: authenticates the frozen source package and runs the actual event24476 source binding, phase-lift probes, literal core/HOME fixture, cutoff and late-prefix rejection, wrong-phase graph, returns and history." + }, + { + "argv": [ + "{python}", + "-O", + "-B", + "-W", + "error", + "{package}/implementation/verify.py" + ], + "timeout_seconds": 240, + "checks": "The same unchanged author verifier under optimized Python; it compares against the frozen exact result with explicit require checks." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "-W", + "error", + "{package}/review/independent/kernel_check.py", + "{package}/implementation/RECIPE.json", + "{package}/source/selected-final.json.gz" + ], + "timeout_seconds": 60, + "checks": "Independent exact one-column frame kernel on all 512 basis inputs; authenticates the explicit recipe and bundled source archive and rejects five order/orientation/phase/offset/central-sign mutations." + }, + { + "argv": [ + "{python}", + "-O", + "-I", + "-B", + "-W", + "error", + "{package}/review/independent/kernel_check.py", + "{package}/implementation/RECIPE.json", + "{package}/source/selected-final.json.gz" + ], + "timeout_seconds": 60, + "checks": "The same independent exact kernel and negative controls under optimized Python; explicit require checks remain active." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "-W", + "error", + "{package}/review/independent/check_derivative_ast.py" + ], + "timeout_seconds": 30, + "checks": "Checks the portable derivative preserves AST-identical mathematical kernel and negative-control functions from the original independent checker." + }, + { + "argv": [ + "{python}", + "-O", + "-I", + "-B", + "-W", + "error", + "{package}/review/independent/check_derivative_ast.py" + ], + "timeout_seconds": 30, + "checks": "The same AST-identity check under optimized Python." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "-W", + "error", + "{package}/review/root/check_source_move_root.py", + "{package}/implementation" + ], + "timeout_seconds": 300, + "checks": "Separate sparse CPU runs the complete source-bound HOME graph on a fresh f=1, P=2, w=10 packet; direct original-frame kernel, late commit, 35-head/private/exterior return, full time and history bounds." + } + ] +} diff --git a/research/literal-source-affine-move/appendix/fixed-recipe/BUDGET.json b/research/literal-source-affine-move/appendix/fixed-recipe/BUDGET.json new file mode 100644 index 0000000000..31baa4df12 --- /dev/null +++ b/research/literal-source-affine-move/appendix/fixed-recipe/BUDGET.json @@ -0,0 +1,11 @@ +{ + "status": "EXACT_COMPONENT_SUM_ONLY_NOT_PROOF", + "CNOTs": 286, + "word_envelopes": 22, + "fV_coefficient": 9949215, + "E_coefficient": 974848, + "constant": 974875, + "history_coefficient": 2632, + "time_reserve": 33554432, + "history_reserve": 4096 +} diff --git a/research/literal-source-affine-move/appendix/fixed-recipe/INTEGRATION-NOTE.md b/research/literal-source-affine-move/appendix/fixed-recipe/INTEGRATION-NOTE.md new file mode 100644 index 0000000000..b8b97c812c --- /dev/null +++ b/research/literal-source-affine-move/appendix/fixed-recipe/INTEGRATION-NOTE.md @@ -0,0 +1,3 @@ +# Integration of the reviewed corollary + +The exact reviewed draft and budget are preserved. SOURCE-REVIEW.json pins their hashes. PROOF.md changes pending to reviewed, renames coefficient multiplicity r to c, and adds the reviewer-requested distinction between the fixed-table HOME wrapper schema and the stored event24476-specific compile_home API. No bound, primitive, execution or numerical premise changes. The universal core history4096 differs from the tighter actual-instance2048; HOME adds64(F+1) separately. No assumption or kappa is discharged. diff --git a/research/literal-source-affine-move/appendix/fixed-recipe/PROOF-DRAFT.md b/research/literal-source-affine-move/appendix/fixed-recipe/PROOF-DRAFT.md new file mode 100644 index 0000000000..8d073c606b --- /dev/null +++ b/research/literal-source-affine-move/appendix/fixed-recipe/PROOF-DRAFT.md @@ -0,0 +1,93 @@ +# Uniform fixed-recipe native MOVE closure from reviewed literal components + +Status: proposed compositional corollary; independent review pending. +Base e54523517d0f03e58352e647c403a5af3e525a57. +Dependency: frozen source-affine MOVE package +9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde, +including its unchanged generic positive and arbitrary-offset engines. +This is a proposed appendix, not a separate PR or new Clifford algebra. + +## Fixed recipe and supplied boundary + +Fix rho in1..9 and two valid nine-coordinate monomial recipes (G,b,Q,alpha,a): +G invertible overF2, b a nine-bit output mask, Q a symmetric binary9x9 matrix, +alpha inZ4^9 with alpha_i mod2=Q_ii, and a inZ4. All recipe parameters are +construction-time constants. Let M|x> = i^(a+sum alpha_i x_i+ +2sum_(i. The one-column operator is + + U = M_left (C_0 C_1 ... C_(rho-1)) M_right. + +Supply the reviewed complete Gamma6/DATA entry: f,r,P,S,cutoff positive, +w>=2, V=2PSrw2^(9f), header lengthE andF=E+V; distinct owners/origins, +blank required private windows and retained old history. Require rho*f<=cutoff +and actual phase-fit and every completed C-prefix integrality/range promises. +The selected common-root corollary supplies the latter only if its actual +row/view premises hold. A valid abstract recipe is not a source frame binding. + +## Flattened construction and semantics + +Using existing offline emitters, concatenate one fixed-rho joint guard, +`monomial_components(right,'right_')`, the fixed-rho positive component list +with its duplicate guard omitted, and `monomial_components(left,'left_')`. +Prefix central labels distinctly and apply the unchanged `transaction` emitter. +This is the construction used for authenticated MOVE24476 with other fixed +recipe parameters. It flattens component instruction lists; it does not nest +whole31-tape transactions. + +Each component's public DATA is the single outer WORK stream; private port +t>=2 maps to t+2. Highest leaf port28 maps to30, so31 tapes suffice. Fixed PC +relocation and successful-halt continuation preserve literal local operations. +The outer transaction alone writes original DATA after all factors return. +Retired private ports are reused without refunding historical backing. The +same Gamma6/HOME adapter gives35 tapes and same-owner successful return. + +The generic monomial theorem supplies phase->G->X_b, scalar i^(af), and the +per-column input quadratic phase. The positive theorem supplies every rho*f +C axis with unchanged f/nine-slot geometry. Composition gives U^(tensor f) +in the canonical slot-major address convention, preserving all external, +coefficient and component spectators. This is a written universal composition +argument, not extrapolation from a dense fixture. All successful return/cleanup +contracts and explicit failure limits are inherited. No runtime recipe loader, +rank selection or source-manifest interpreter is introduced. + +## Complete uniform local bill + +The two monomials and rho<=9 use at most198 matrix CNOTs,40 offset-conjugator +CNOTs and48 central slot-swap CNOTs:286 total. They use at most22 fixed word +envelopes (2 matrix,4 offset,16 central),2 phase passes,2 X0 reversals,9 C +leaves,1 joint guard and1 outer transaction. + +Adding the dependency proof's complete helper ceilings, including descriptor +production, arithmetic, copying, return and retirement, and using +f(V+1)<=2fV andV<=fV, gives + + 9,949,215 fV +974,848 E +974,875 <=2^25(fV+E+1). + +The conservative incremental history sum is + + 2*256 +22*64 +9*64 +2*32 +64 +8 =2632 <4096 + +times(V+E+1). Thus T_core<=2^25(fV+E+1) and +K_final<=K_entry+4096(V+E+1). HOME adds128(F+1) time and64(F+1) history. +Setup/program/origin provisioning, typed entry and B1 whole-bank transport +remain separate. No E=O(V) or numeric-cutoff loop assumption is introduced. + +## Exact scope + +This makes a common literal template and uniform local constants explicit +for every valid fixed9-slot positive-rank recipe. For any source event whose +one-column recipe and phase are independently authenticated, the existing +tensor lift supplies this primitive's all-column semantics. Applying that +implication to every catalogue entry still requires preserving its exact +source proof and entry/view premises; a finite recipe census is not a +substitute. Only actual event24476 has the complete source and physical +checks in this new package. + +No additional full physical execution for every recipe or large f is claimed. +Rank-zero/non-nested variants, variable ambient dimension, whole-job153-axis +or root adapters, actual producers, view packing, cutoff policy, full ownership +lifetime and faster nonleaf tariffs remain outside this corollary. It does not +discharge native_all_columns in its full retained scope or any other selected +assumption, and gives no new kappa. Credit all predecessor literal engines +and #6978/#7000 algebra/precision work. Prepared with substantial OpenAI +assistance; independent review is not formal acceptance. diff --git a/research/literal-source-affine-move/appendix/fixed-recipe/PROOF.md b/research/literal-source-affine-move/appendix/fixed-recipe/PROOF.md new file mode 100644 index 0000000000..9f6b650e39 --- /dev/null +++ b/research/literal-source-affine-move/appendix/fixed-recipe/PROOF.md @@ -0,0 +1,97 @@ +# Uniform fixed-recipe native MOVE closure from reviewed literal components + +Status: reviewed compositional corollary under the explicit supplied-entry and numerical premises. See REVIEW.md and SOURCE-REVIEW.json. +Base e54523517d0f03e58352e647c403a5af3e525a57. +Dependency: frozen source-affine MOVE package +9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde, +including its unchanged generic positive and arbitrary-offset engines. +This appendix records a universal composition of the reviewed components. It is not a separate implementation or a new Clifford algebra result. + +## Fixed recipe and supplied boundary + +Fix rho in1..9 and two valid nine-coordinate monomial recipes (G,b,Q,alpha,a): +G invertible overF2, b a nine-bit output mask, Q a symmetric binary9x9 matrix, +alpha inZ4^9 with alpha_i mod2=Q_ii, and a inZ4. All recipe parameters are +construction-time constants. Let M|x> = i^(a+sum alpha_i x_i+ +2sum_(i. The one-column operator is + + U = M_left (C_0 C_1 ... C_(rho-1)) M_right. + +Supply the reviewed complete Gamma6/DATA entry: f,c,P,S,cutoff positive, +w>=2, V=2PScw2^(9f), header lengthE andF=E+V; distinct owners/origins, +blank required private windows and retained old history. Require rho*f<=cutoff +and actual phase-fit and every completed C-prefix integrality/range promises. +The selected common-root corollary supplies the latter only if its actual +row/view premises hold. A valid abstract recipe is not a source frame binding. + +## Flattened construction and semantics + +Using existing offline emitters, concatenate one fixed-rho joint guard, +`monomial_components(right,'right_')`, the fixed-rho positive component list +with its duplicate guard omitted, and `monomial_components(left,'left_')`. +Prefix central labels distinctly and apply the unchanged `transaction` emitter. +This is the construction used for authenticated MOVE24476 with other fixed +recipe parameters. It flattens component instruction lists; it does not nest +whole31-tape transactions. + +Each component's public DATA is the single outer WORK stream; private port +t>=2 maps to t+2. Highest leaf port28 maps to30, so31 tapes suffice. Fixed PC +relocation and successful-halt continuation preserve literal local operations. +The outer transaction alone writes original DATA after all factors return. +Retired private ports are reused without refunding historical backing. The +proved fixed-table Gamma6/HOME wrapper schema gives35 tapes and same-owner +successful return after binding the newly constructed fixed core at setup. +The stored `compile_home` entrypoint remains specialized to event24476; +this corollary does not introduce or execute an arbitrary-recipe dispatcher +API. The statement concerns that fixed-table wrapper construction. + +The generic monomial theorem supplies phase->G->X_b, scalar i^(af), and the +per-column input quadratic phase. The positive theorem supplies every rho*f +C axis with unchanged f/nine-slot geometry. Composition gives U^(tensor f) +in the canonical slot-major address convention, preserving all external, +coefficient and component spectators. This is a written universal composition +argument, not extrapolation from a dense fixture. All successful return/cleanup +contracts and explicit failure limits are inherited. No runtime recipe loader, +rank selection or source-manifest interpreter is introduced. + +## Complete uniform local bill + +The two monomials and rho<=9 use at most198 matrix CNOTs,40 offset-conjugator +CNOTs and48 central slot-swap CNOTs:286 total. They use at most22 fixed word +envelopes (2 matrix,4 offset,16 central),2 phase passes,2 X0 reversals,9 C +leaves,1 joint guard and1 outer transaction. + +Adding the dependency proof's complete helper ceilings, including descriptor +production, arithmetic, copying, return and retirement, and using +f(V+1)<=2fV andV<=fV, gives + + 9,949,215 fV +974,848 E +974,875 <=2^25(fV+E+1). + +The conservative incremental history sum is + + 2*256 +22*64 +9*64 +2*32 +64 +8 =2632 <4096 + +times(V+E+1). Thus T_core<=2^25(fV+E+1) and +K_final<=K_entry+4096(V+E+1). HOME adds128(F+1) time and64(F+1) history. +Setup/program/origin provisioning, typed entry and B1 whole-bank transport +remain separate. No E=O(V) or numeric-cutoff loop assumption is introduced. + +## Exact scope + +This makes a common literal template and uniform local constants explicit +for every valid fixed9-slot positive-rank recipe. For any source event whose +one-column recipe and phase are independently authenticated, the existing +tensor lift supplies this primitive's all-column semantics. Applying that +implication to every catalogue entry still requires preserving its exact +source proof and entry/view premises; a finite recipe census is not a +substitute. Only actual event24476 has the complete source and physical +checks in this new package. + +No additional full physical execution for every recipe or large f is claimed. +Rank-zero/non-nested variants, variable ambient dimension, whole-job153-axis +or root adapters, actual producers, view packing, cutoff policy, full ownership +lifetime and faster nonleaf tariffs remain outside this corollary. It does not +discharge native_all_columns in its full retained scope or any other selected +assumption, and gives no new kappa. Credit all predecessor literal engines +and #6978/#7000 algebra/precision work. Prepared with substantial OpenAI +assistance; independent review is not formal acceptance. diff --git a/research/literal-source-affine-move/appendix/fixed-recipe/REVIEW.md b/research/literal-source-affine-move/appendix/fixed-recipe/REVIEW.md new file mode 100644 index 0000000000..2ceeac4647 --- /dev/null +++ b/research/literal-source-affine-move/appendix/fixed-recipe/REVIEW.md @@ -0,0 +1,90 @@ +# Independent review of the uniform fixed-recipe closure appendix + +**PASS as a compositional corollary under the stated supplied-entry and +numerical premises.** I found no composition, phase, port/lifetime or +uniform-cost defect. This is AI proof review, not human/kernel acceptance. +No primitive, original freeze or scientific execution was changed or added. + +Reviewed root-work/fixed-recipe-closure/PROOF-DRAFT.md and BUDGET.json, +canonical e54523517d0f03e58352e647c403a5af3e525a57, relative to source-affine +freeze9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde. +The companion SOURCE-REVIEW.json records exact draft/budget hashes. + +## Composition, phase and ownership + +For each valid fixed rho1..9 and two valid9-coordinate monomials, existing +monomial_components provides phase(q+a*f), then G, then post-G X_b. Moving +the scalar before permutations is exact; the variable input phase remains +before G. The existing initializer proves a*f by scanning the f guide. +This is not a once-per-call constant or a phase defined on output coordinates. + +One joint guard followed by right components, positive components[1:] and +left components has the correct L C_rho R chronology. The omitted element +is exactly the duplicate joint guard. rho*f<=cutoff implies each first-slot +leaf's weaker f<=cutoff, while every consumer retains original9f geometry. +Fixed slot swaps supply all requested axes without dropping spectators. +The tensor lift of products is licensed; it does not tensor exterior sums +or scalar register coefficients. + +Calling transaction on flattened component lists gives one protected +original DATA owner, not nested whole31-tape transactions. HEADER is retained, +component DATA maps to WORK, private t>=2 maps to t+2. Maximum leaf port28 +therefore maps to30, giving31 tapes. WORK/TRACE are separate from the reused +27 module-private owners. Every successful component returns/cleans its +cohort before reuse, and only the final outer commit writes original DATA. +Retiring bodies does not refund old historical intervals. + +The35-tape HOME conclusion is the same proved fixed-table wrapper schema, +with the newly constructed fixed core bound at setup. The frozen stored +compile_home entrypoint itself remains specialized to24476; this appendix +does not create or certify an executed arbitrary-recipe dispatcher. I +recommend stating that distinction explicitly to avoid an API-level reading. +It does not affect the compositional port/return/cost theorem. + +## Uniform complete bill + +The fixed binary elimination bounds each matrix word by99 CNOTs. Two matrix +words cost at most198; two offset translations add at most40; at rho9 the +central swaps add48. Total286. The word count is2+4+16=22. Zero/identity +components can be omitted; retaining their envelopes is conservative. + +Using the dependency's complete guard, word, phase, translation and leaf +ceilings gives the explicit upper sum + +`65536(V+E+1)+1024*286*f(V+1)+22*8192(V+E+1)` +`+2*65536(E+65V+1)+2*4096(V+E+1)` +`+9*65536(fV+E+1)+31V+27`. + +With f(V+1)<=2fV and V<=fV, its coefficients are exactly + +`9949215 fV +974848 E +974875`. + +Each is below2^25. No descriptor, arithmetic stage, body copy, return or +retirement is omitted. Setup/program/origin provisioning and B1 whole-bank +work remain separate. Arbitrarily long cutoff syntax stays charged by E; +its numeric value is not expanded or assumed bounded by V. + +History is2*256+22*64+9*64+2*32+64+8=2632, below4096 times(V+E+1). +This sums all component increments despite shared cleaned owners, so it +cannot undercount by refunding retired factors. HOME adds64(F+1); it is +not implicitly inside the4096 core statement. Its128(F+1) time also remains +explicit. Fixed9 dimensions and fixed recipe parameters make these uniform +local constants legitimate without a runtime loader. + +## Numerical and source scope + +Actual complete phase rotations and every C-axis prefix must satisfy the +retained signed/grid guards. Validity of the abstract recipe alone does +not imply those numerical entry promises or source-frame equality. The +reviewed common-root corollary applies only if an actual producer supplies +all its full-root/view premises. Partial words, mixed buffers, descriptors, +accumulators and scratch retain independent physical helper bounds. + +The theorem defines an operator for every fixed valid recipe. Identifying +that operator with each source event still needs its exact authenticated +one-column/absolute-phase certificate, owner/view and entry. Only24476 has +the new complete source/physical evidence. Rank0, variable ambient dimension, +whole-job153/root adapters, actual producers/packing, owned lifetimes, +nonleaf tariffs and full assumption discharge remain excluded. This is a +useful universal composition statement, not new Clifford algebra, a new +physical algorithm, an all-source execution or a kappa change. diff --git a/research/literal-source-affine-move/appendix/fixed-recipe/SOURCE-REVIEW.json b/research/literal-source-affine-move/appendix/fixed-recipe/SOURCE-REVIEW.json new file mode 100644 index 0000000000..f3576c18b0 --- /dev/null +++ b/research/literal-source-affine-move/appendix/fixed-recipe/SOURCE-REVIEW.json @@ -0,0 +1,19 @@ +{ + "status": "PASS_COMPOSITIONAL_COROLLARY", + "utc": "2026-11-13T14:44:19.679691+00:00", + "pins": [ + { + "path": "/workspace/scratch/92c9920affc2/root-work/fixed-recipe-closure/PROOF-DRAFT.md", + "bytes": 4984, + "sha256": "e1fdba2481bcc6970fdfe0a26635a5deb03bf0e8d2e700bfaa42e14ba5728d63" + }, + { + "path": "/workspace/scratch/92c9920affc2/root-work/fixed-recipe-closure/BUDGET.json", + "bytes": 257, + "sha256": "cdd05c875966beb50b73fa70fc0f7658fb66fc14574651ed0af6844517845498" + } + ], + "dependency_freeze": "9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde", + "review_sha256": "92db396942623d292b52062369ed6a51648c883b3dddec1ffaa6254cc0c672ff", + "qualification": "HOME theorem is fixed-table wrapper-schema reuse; stored compile_home API remains24476-specific. No execution/algorithm added." +} diff --git a/research/literal-source-affine-move/implementation/CHECKPOINT.md b/research/literal-source-affine-move/implementation/CHECKPOINT.md new file mode 100644 index 0000000000..4b9d69375c --- /dev/null +++ b/research/literal-source-affine-move/implementation/CHECKPOINT.md @@ -0,0 +1,16 @@ +Wave15 started13:53 UTC; stop14:35. Exact event24476=[MOVE,727,3,470,false], frames[]->[75,137,265], positive rank3. Right offset5/globalphase2; distinct from already implemented24472 offset1/phase1. No first nonzero-offset/phase claim. Original attempt preferredrank<=2 and foundnone amongfirst200 distinctpairs; removingthat preference selectsrank3 atsecondpair. No fullcensus repeated. + +Optimistic scope: generic fixed monomial q(input)+a*f phase then binaryG then outputoffsetX_b, flattened underone complete outertransaction. Joint3f cutoff first; three positiveC passes withslot swaps. Everyphase rotation andall3f C prefixes suppliedintegral/signedfit. All9f geometry/full spectators preserved, source727false ispublic/productive, notowned/inverse. Fixedsetup,B1 routing/history separate. Retainold#6978 allsource algebra/codedchild credit; no faster nonleaf/caller/assumptiondischarge. Conservative fullgraph bill2^25(fV+E+1), historical4096(V+E+1), subjectexactcomponentcount below. + +Completion14:20 UTC: normal/-O dense full f1 source-MOVE and wrong-phase +graphs pass; late second-C rejection/public preservation passes after right +monomial,C0,swap. Exact source archive reextraction/recompile and independent +full-matrix/phase/source controls pass. Final exact bill uses73CNOTs in8words, +2phase,3C,1X0,1guard,1outer; T<=2^25(fV+E+1), history1320 envelope registered +2048(V+E+1). The earlier4096 was optimistic slack, superseded. Role727 is +source-public; productive_count2 is only supplied two-home fixture bookkeeping, +not a source/global productive-credit theorem. Reviewed common-root bridge +copied unchanged with explicit physical partial-memory/scratch limitations. +All earlier frozen packages untouched. SOURCE-BINDING/GRAPH/FREEZE record +pins, predecessor graph equality, complete graph and source hashes. No known +defect; independent parent/C source/numerical review pending. diff --git a/research/literal-source-affine-move/implementation/ENVIRONMENT.json b/research/literal-source-affine-move/implementation/ENVIRONMENT.json new file mode 100644 index 0000000000..8aff66e49d --- /dev/null +++ b/research/literal-source-affine-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_runtime": "elapsed_seconds 29.608", + "optimized_runtime": "elapsed_seconds 29.937", + "normal_optimized_receipts": "identical", + "source_auth": "40 pinned files plus exact RECIPE SHA; fresh required-absent bytecode cache prefixes", + "review": "author checks completed; independent parent/C source/numerical review pending" +} diff --git a/research/literal-source-affine-move/implementation/FREEZE.json b/research/literal-source-affine-move/implementation/FREEZE.json new file mode 100644 index 0000000000..b0174fedf6 --- /dev/null +++ b/research/literal-source-affine-move/implementation/FREEZE.json @@ -0,0 +1,304 @@ +{ + "status": "FROZEN", + "utc": "2026-11-13T14:20:19.517558+00:00", + "canonical_main": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "CHECKPOINT.md", + "bytes": 1895, + "sha256": "97e1a944d9e51f8070eb2f85c08eab14bb56174e06f714add329d56fcb3dbdc3" + }, + { + "path": "ENVIRONMENT.json", + "bytes": 462, + "sha256": "7eaebda9dfdf28631ccd752e296289e5e6763ecc759d334f2b8570f7212f6a20" + }, + { + "path": "GRAPH.json", + "bytes": 899, + "sha256": "91b207a27c0d9d16cfff8e42332e04126d73a9797fc312f19762297fde04cd8b" + }, + { + "path": "NOTICE.md", + "bytes": 1476, + "sha256": "46825d46977c64429b21108df57fbbcac1a3262cc15010eb3bcab8c62d2dfbfd" + }, + { + "path": "OVERLAP.md", + "bytes": 1862, + "sha256": "95faf01d82e6abdd57fcdd1ddbea115e28a72e49cb2bb7b546fc00b4c63eca4e" + }, + { + "path": "PR-DESCRIPTION.md", + "bytes": 2329, + "sha256": "739c4183d830bb1b2b18e9918e76091ab51c9ff0aa1ae886323df8ac765d9dca" + }, + { + "path": "PROOF.md", + "bytes": 13067, + "sha256": "30eb220651420201a57a089b34f6b54b55f995dfc7b6758910da10d87c15e86e" + }, + { + "path": "README.md", + "bytes": 3746, + "sha256": "1460287ec82d51caab6b6de764afb7c306e81a21e4ea0326db334cea45a7ed29" + }, + { + "path": "RECIPE.json", + "bytes": 1433, + "sha256": "8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79" + }, + { + "path": "RESULT.json", + "bytes": 3843, + "sha256": "42e904c679a3df89e0f88a6cc8d46132fd830705ef5a13cecdfcadba2f2ef1e0" + }, + { + "path": "SOURCE-BINDING.json", + "bytes": 522, + "sha256": "2e5c028dde3da98aabd5ebe2daa9bd53effca33e2157a2954b893db36ce0ef83" + }, + { + "path": "SOURCES.json", + "bytes": 12367, + "sha256": "b3a2d73ae575c840a1ebd85e0734def9330c3afaecf862b75edd62387870b382" + }, + { + "path": "adapter.py", + "bytes": 4750, + "sha256": "e18b1e320a4f00177e5bc437867b906e4e63bbedd40bab668b14428fa67969bf" + }, + { + "path": "bind_source.py", + "bytes": 3988, + "sha256": "0ceaa9f378eb17743aff2ba71b86be163cf841cf97609f90eb2aed77e9a10f34" + }, + { + "path": "engines/SOURCES.json", + "bytes": 7336, + "sha256": "abbbd21565ff67a5268d30c034ad33f2143c8b2699bbcccc68569a326ff020b6" + }, + { + "path": "engines/affine.py", + "bytes": 3859, + "sha256": "9387d4caa6ea6ad9e232f4a2a07112fa1a681d34af19e5aae64d1d8adc5ebd2c" + }, + { + "path": "engines/join.py", + "bytes": 6778, + "sha256": "971080f6254cfaf44b01a412533818ffdff78ea925452c76a02524092b3ccff6" + }, + { + "path": "engines/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee" + }, + { + "path": "engines/reference/rank2/FREEZE.json", + "bytes": 5633, + "sha256": "072dfea997d4db796d492eaf746e0bd99630964741b88862d0f10f5fc1e00275" + }, + { + "path": "engines/reference/rank2/PROOF.md", + "bytes": 16634, + "sha256": "93e1ad8a92c3624df064e4f39119ccbb5c96391ea8dd5f7af58edc7ca9638352" + }, + { + "path": "engines/reference/rank2/RECIPE.json", + "bytes": 4468, + "sha256": "b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702" + }, + { + "path": "engines/reference/rank2/SOURCES.json", + "bytes": 10337, + "sha256": "659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641" + }, + { + "path": "engines/reference/rank2/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee" + }, + { + "path": "engines/reference/rank2/rank2.py", + "bytes": 8253, + "sha256": "3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a" + }, + { + "path": "engines/reference/rank2/reference/home/NOTICE.md", + "bytes": 2093, + "sha256": "b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842" + }, + { + "path": "engines/reference/rank2/reference/home/parent_adapter.py", + "bytes": 5353, + "sha256": "04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099" + }, + { + "path": "engines/reference/rank2/reference/home/tape_graph.py", + "bytes": 12069, + "sha256": "7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54" + }, + { + "path": "engines/reference/rank2/reference/leaf/NOTICE.md", + "bytes": 1900, + "sha256": "773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf" + }, + { + "path": "engines/reference/rank2/reference/leaf/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "engines/reference/rank2/reference/leaf/leaf.py", + "bytes": 17526, + "sha256": "bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744" + }, + { + "path": "engines/reference/rank2/reference/linear/NOTICE.md", + "bytes": 2180, + "sha256": "2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50" + }, + { + "path": "engines/reference/rank2/reference/linear/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "engines/reference/rank2/reference/linear/linear.py", + "bytes": 13102, + "sha256": "d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33" + }, + { + "path": "engines/reference/rank2/reference/phase/NOTICE", + "bytes": 808, + "sha256": "5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0" + }, + { + "path": "engines/reference/rank2/reference/phase/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "engines/reference/rank2/reference/phase/phase.py", + "bytes": 11734, + "sha256": "2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7" + }, + { + "path": "engines/reference/rank2/reference/source/clifford_exact.py", + "bytes": 6824, + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "engines/reference/rank2/reference/source/native_verify.py", + "bytes": 12323, + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38" + }, + { + "path": "engines/reference/translation/NOTICE.md", + "bytes": 1201, + "sha256": "24f5e9957fcd8f6cfdc021ff5bc91bf89e50587997e2a2cb18053949c0e0d205" + }, + { + "path": "engines/reference/translation/PROOF.md", + "bytes": 19690, + "sha256": "6b76d348203aed15cbc30d104c59571111ccf6cb7bb4592936e9170f736b68e0" + }, + { + "path": "engines/reference/translation/reference/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "engines/reference/translation/reference/reverse.py", + "bytes": 6649, + "sha256": "4b516d85baf3303db809bc1174394009b1fc71a8f7d17fb6c729ec8bb6aba245" + }, + { + "path": "engines/reference/translation/translate.py", + "bytes": 7703, + "sha256": "e2750fef8c2b9c8019d67285df3ca0d04340cd241782c7845665b7de621ca3bd" + }, + { + "path": "machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee" + }, + { + "path": "move.py", + "bytes": 4503, + "sha256": "b213325a652dc91630a50fb63d573108a04a2b7a07e587f25b0ecf0db8ffd668" + }, + { + "path": "oracle.py", + "bytes": 1768, + "sha256": "762847697ca3fa50e69eb146c157fa888a3687dd552c5b75bccb917f1a65b17a" + }, + { + "path": "reference/affine-FREEZE.json", + "bytes": 7062, + "sha256": "de2753cb42a012e07aa7ace263bedce5c4be8506ae30ab768af9e165a6edd6e0" + }, + { + "path": "reference/affine-PROOF.md", + "bytes": 12681, + "sha256": "f43040c6331dc29ecf3f435e980cc71f00a60e421f50f4e843192a23e733bd44" + }, + { + "path": "reference/affine-SOURCES.json", + "bytes": 7336, + "sha256": "abbbd21565ff67a5268d30c034ad33f2143c8b2699bbcccc68569a326ff020b6" + }, + { + "path": "reference/central-FREEZE.json", + "bytes": 6301, + "sha256": "5735c401ba981a7af4d3a146eb047d04fa0c87dbf7ed49bd82dc57df8d6cb2ef" + }, + { + "path": "reference/central-PROOF.md", + "bytes": 12196, + "sha256": "48899c607452daccd0998f4005ae2a6ed85a723969f474bf796496303ad4d4bb" + }, + { + "path": "reference/central-SOURCES.json", + "bytes": 5445, + "sha256": "496948cd8d2b5134ceed6b48b870be73f6415b5f70e97ab35b744ded5a2a3c03" + }, + { + "path": "reference/prefix-bridge/INDEPENDENT-REVIEW.md", + "bytes": 3970, + "sha256": "6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b" + }, + { + "path": "reference/prefix-bridge/PROOF.md", + "bytes": 6282, + "sha256": "84a30aeff471af36e182840b2c6605e0fdf8aa3a5d829c656b21d16df682f595" + }, + { + "path": "reference/prefix-bridge/SOURCE-REVIEW.json", + "bytes": 758, + "sha256": "f8be476176747afb154859cb2a3c09cf5154e413fde8b8f9c95e23ce26806645" + }, + { + "path": "reference/prefix-bridge/retained-selected-proof.md", + "bytes": 25533, + "sha256": "4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055" + }, + { + "path": "select_source.py", + "bytes": 2584, + "sha256": "d9abc11899582ff4d37adf32e3de3406b82cc26d797780b98a30e529e418d374" + }, + { + "path": "verify.py", + "bytes": 8606, + "sha256": "354cf3527c6881f4b7946722bc6942e51d32973ee801489599a8274bb4e898b8" + } + ], + "excluded_generated_paths": [ + "normal.log", + "optimized.log" + ], + "known_defects": [], + "independent_review": "parent/C source/numerical review pending", + "scope": "generic fixed monomial and one source-bound24476 Gamma6 direct MOVE; no caller/nonleaf/global admission" +} diff --git a/research/literal-source-affine-move/implementation/GRAPH.json b/research/literal-source-affine-move/implementation/GRAPH.json new file mode 100644 index 0000000000..9af5c15361 --- /dev/null +++ b/research/literal-source-affine-move/implementation/GRAPH.json @@ -0,0 +1,22 @@ +{ + "core_locations": 138933, + "core_sha256": "f5a94e975d699c19b11a1a9a5c101b49bbc001fab44ebee5ef0b9f1d1bd92807", + "HOME_states": 139100, + "HOME_json_bytes": 8944174, + "HOME_sha256": "349f3f3e7eb3dbc32839c15e31221ed59c0ae3851c58f0bfad81e5a049482520", + "HOME_encoding": "UTF8 JSON separators comma/colon of [start, [[state, [[target,tests,writes,moves],...]],...]] in emitted insertion order", + "monomial_tables": [ + { + "side": "right", + "locations": 48033, + "sha256": "e8658aaf9fc9fcd1dad8e1887627610ab74a6c3df5b385542b461a0d2b30bd99" + }, + { + "side": "left", + "locations": 48771, + "sha256": "43c726ce25618f8297929fd28f4e8ea8290dfd4425002018818252c7b298672f" + } + ], + "installed_predecessor_tables": "exact original central3 and affine511 hashes matched", + "prefix_bridge_sha256": "84a30aeff471af36e182840b2c6605e0fdf8aa3a5d829c656b21d16df682f595" +} diff --git a/research/literal-source-affine-move/implementation/NOTICE.md b/research/literal-source-affine-move/implementation/NOTICE.md new file mode 100644 index 0000000000..5b9405f35d --- /dev/null +++ b/research/literal-source-affine-move/implementation/NOTICE.md @@ -0,0 +1,25 @@ +# Attribution and immutable sources + +Prepared for CubeJerry with substantial OpenAI assistance. Apache-2.0, +following retained sources. Author and parent/C mathematical checks are +disclosed AI work, not independent human or proof-kernel acceptance. + +Credit the selected #7000 native source/framework, #6978 all-source coded +positive child, existing selected rank1/rank2 literal joins, #7426 phase, +#7430 linear/CNOT, #7428 translation and #7427 reversal lineages. The frozen +generic positive and arbitrary-affine Gamma6 joins are reused byte-exact; +all original transitive notices/manifests remain. Their complete proofs, +freeze manifests and original source Git/SHA pins are retained here. + +The newly written move.py composes generic fixed monomial phase/G/X blocks +and binds actual24476. The source/fixture/oracle/binder are new adaptations +of the previously credited native engine and B1 graph interpreter. B's +permanent HOME dispatch b4fcc9d64971fdabd0b1d82cfb749d8aac920437 and bridge +13c29e2df66ba46402d4da5f1d2489ebf333e5fe supply the unchanged local transport +pattern; no complete caller is attributed to this module. + +Root's reviewed common-grid bridge applies the existing #7000 section5 +theorem. Its proof/review/source pins are copied unchanged under +reference/prefix-bridge/ with their explicit conditional/partial-memory +limitations. No new numerical theorem or actual producer is claimed. +No earlier frozen package or remote branch was modified by this worker. diff --git a/research/literal-source-affine-move/implementation/OVERLAP.md b/research/literal-source-affine-move/implementation/OVERLAP.md new file mode 100644 index 0000000000..bf5d619fd1 --- /dev/null +++ b/research/literal-source-affine-move/implementation/OVERLAP.md @@ -0,0 +1,30 @@ +# Scope and overlap gate + +Pinned context is canonical e54523517d0f03e58352e647c403a5af3e525a57 and C's +authenticated selected-native-generic-preflight census. No census is repeated +as a contribution. A bounded preference search found no qualifying rank<=2 +pair in its first200 distinct pairs; allowing source rank3 selects24476 as +the second pair under the final reproducible criterion. The intended target +is a distinct source recipe, not another proof of rank/tensor algebra. + +The frozen selected rank1 MOVE24472 already includes right offset1 AND +phase1. Rank2 MOVE28141 has zero offsets/constants. Credit both complete +literal joins, #7428's first-slot translation, #7426's fixed phase body, +#7430's CNOT body and the new frozen generic positive/affine modules. +New scope: generic fixed monomial phase/G/X composition plus this actual +rank3 multibit-offset source binding and one complete physical HOME trace. + +#6978, head12e58dfdad9371a26f9978c814779da344fd80b4, already establishes the +coded direct child, rank-times-column geometry/cutoff and prior all-source +algebra; its supplier-free monomial/literal lifecycle boundary remains +credited. The current selected #7000 proof already establishes all-f +algebra. Existing physical/serial Gaussian monomial and phase work in other +Count/coded ABIs precedes this exact Gamma6 export. No first general phase +algorithm or variable-dimension phase producer is claimed. + +Root's fresh metadata reports #7501 shares phase/egress banks, and #7503 +gives a tensorphase information lower bound, neither this source-bound +generic-monomial lifecycle. The bounded earlier searches for literal rank +and translation packages and exact retained scopes are documented in the +frozen central/affine predecessors. No exhaustive literature-priority claim +is made. A complete-source dispatcher and faster nonleaf tariff remain open. diff --git a/research/literal-source-affine-move/implementation/PR-DESCRIPTION.md b/research/literal-source-affine-move/implementation/PR-DESCRIPTION.md new file mode 100644 index 0000000000..6d7c7f27ed --- /dev/null +++ b/research/literal-source-affine-move/implementation/PR-DESCRIPTION.md @@ -0,0 +1,36 @@ +Title: Join generic fixed monomials to actual affine MOVE24476 on literal tapes + +Compose complete input phase q+a*f, fixed binary G and post-G X_b into a +generic fixed nine-coordinate monomial, then flatten right monomial, +positive rank3 center and left monomial under one original-owner transaction. +Bind actual selected event24476=[MOVE,727,3,470,false], frames[]->[75,137,265]. +Its right offset5/globalphase2 distinguishes it from the existing source +anchors. The rank1 predecessor already handles offset1/phase1; no first +nonzero-offset/phase claim is made. #6978/current selected all-f algebra +and the original phase/CNOT/reversal methods remain credited. + +The complete31-tape graph checks3f<=actual cutoff and preserves the full9f +geometry, all spectators/coefficient bits, header/width/grid and original +owner. It commits only after every factor returns; all private work retires +on success. Complete direct time is2^25(fV+E+1), historical increment +2048(V+E+1). The35-tape HOME layer adds128(F+1) time/64(F+1) +backing. B1 bank routing, setup/program storage, typed producers and every +actual arithmetic prefix promise remain paid or explicit. No faster +nonleaf tariff, complete caller, global assumption discharge or kappa change. + +Normal/-O author checks run a complete dense f1 packet against the original +frame Gaussian kernel, restore all35 heads/private/exteriors and separate +an executed wrong-phase graph returning i times the expected image. A late +numerical control completes the right monomial,C0 and swap before rejecting +C1 with public HOME unchanged. Joint cutoff and wrong offset/inverse source +controls discriminate;28 physical phase-initializer probes check a*f. The +whole canonical archive is authenticated/reextracted and the exact recipe +can be regenerated in normal mode. No full f2 packet is claimed. + +The unchanged reviewed common-root bridge is bundled conditionally: an +actual producer supplying the retained full-root/common-grid row and correct +view also supplies completed C-prefix bounds. Partially written words, +mixed buffers, accumulators, descriptors and helper scratch stay outside +that semantic corollary and retain their own bounds. No actual selected +producer/view is supplied. Independent parent/C source/numerical review is +pending and must remain distinct from these author checks. diff --git a/research/literal-source-affine-move/implementation/PROOF.md b/research/literal-source-affine-move/implementation/PROOF.md new file mode 100644 index 0000000000..ea64173cd1 --- /dev/null +++ b/research/literal-source-affine-move/implementation/PROOF.md @@ -0,0 +1,223 @@ +# Generic fixed monomials and actual affine MOVE24476 + +## Source, prior scope and statement + +Canonical main is e54523517d0f03e58352e647c403a5af3e525a57. Its selected +archive `research/shared-wire-split-composition/data/final.json.gz` has +Git blob74563a7867d9d762b6588f65362369668841bb3e,350722 bytes, compressed +SHA2562b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883 and +canonical word SHA25691429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097. +Event24476 is `[MOVE,727,3,470,false]`, with complete frames3=[] and +470=[75,137,265]. The ordered operator is U=T470 T3*. The Boolean records +private-owner metadata, not inverse orientation; it is false here. + +The source compiler gives U=L(C0 C1 C2)R, with positive +C=1/2[[1+i,1-i],[1-i,1+i]]. RECIPE.json retains every source parameter. +R has offset5 (output/native slots0,2) and constant phase2; L has offset +and constant0. Fixed words have26 right and33 left CNOTs. bind_source.py +authenticates/reextracts the whole archive and optionally recompiles this +pair. Its separate explicit-check Gaussian/Pauli engine certifies full +matrix and absolute phase against original frame circuits, using the +credited signed-generator/separating-column lemma. All1024 binary columns +are checked too. Wrong offset/phase/inverse controls reject. Only the +optional canonical assertion-based compiler rebind requires normal Python; +the independent acceptance and numerical replay work under -O. + +Existing literal MOVE24472 already has right offset1 AND phase1. This is +not the first nonzero-offset/phase MOVE. The new scope is generic fixed +nine-coordinate monomial composition and this different multibit-offset +rank3 source binding. #6978 already proves rank-rf/coded-child algebra and +the selected proofs already give the all-f algebraic lift; neither is new. + +Supply positive f,c,P,S,cutoff, width w>=2 and six canonical Gamma codes +(f,c,P,S,w,cutoff), length E. DATA is the complete lexicographic +[P]x[2^f]^9x[S] array with c Gaussian coefficients per address, real then +imaginary, each signed w-bit MSB-first on one unchanged common quantum. +Let V=2PScw2^(9f), F=E+V. c is not native rank. All owners are distinct, +heads begin at origins, required private bodies/guards are blank, and +opaque exteriors/previous backing remain separately charged. + +Require3f<=cutoff, actual right/left complete phase rotations to fit w bits, +and every output of each actual3f C-axis prefix to be integral on the same +grid and fit w bits. Final fit alone is insufficient. The concrete leaf's +w+2 temporary numerator and exact-half/range guards remain unchanged. + +**Generic monomial theorem.** For fixed invertible binary9x9 G, b in0..511, +alpha inZ4^9, symmetric Q with alpha_i mod2=Q_ii, and a inZ4, +compile_monomial emits its all-column monomial under its actual signed-phase +promise, with complete original-owner return,31 tapes, time2^24(fV+E+1) +and historical increment512(V+E+1). All recipe values are offline constants. + +**Actual MOVE theorem.** compile_move emits one138933-location31-tape +four-symbol graph for U^(tensor f). It checks the joint cutoff, preserves +all header/width/grid/spectator/owner data, returns heads and retires private +work on success. One original-owner transaction encloses all factors. +There is no original DATA write until all components return; finite valid +cutoff/numerical failures preserve original DATA. Failure cleanup, general +malformed-input termination, interruption/retry and failure reuse are unclaimed. + +Complete successful bounds are T_core<=2^25(fV+E+1) and +K_final<=K_entry+2048(V+E+1). The35-tape HOME adapter adds128(F+1) time and +64(F+1) backing, hence2112(F+1) total increment for this actual recipe. +General B1 full-bank gathering/return/backing retains its separately paid +O(R_bank K_bank(F+1)) contract. Fixed program construction/authentication, +storage and origin provisioning are setup charges if not supplied. + +The fixture has two already supplied public homes: parked input and source +role727. productive_count=2 is bookkeeping for those initial fields, not a +proof of global selected productive stock or new productive credit. No +typed INIT727, actual large-bank selector, job packing or caller producer +is built. Private=false does not supply such a producer invariant. + +## Monomial order, constant phase and complete geometry + +Write q(x)=sum alpha_i x_i+2sum_(i -> i^(a+q(x))|Gx xor b>, with q on input and b on output coordinates. +On f columns the exponent is a*f+sum_l q(x_l). The generic list executes +one complete phase for this exponent, then G, then X_b. Moving only scalar +i^(a*f) into the first pass is exact since it commutes with both permutations; +the input-dependent q is not moved. Q's diagonal is not counted twice. + +The retained initializer scans unary f, appends one zero to each of nine +counters per mark and advances its four-state mode by a. Its mode is a*f +mod4. The retained synchronized counter algorithm supplies sum q(x_l) on +complete rows and c/P/S fields. It performs the net unit phase directly, +without introducing separate serial negations for each source phase record. +Twenty-eight actual prefix probes cover all a and f=1,2,3,4,5,16,65; +a2,f2 gives0 rather than a once-per-call2. The invariant proves all f. + +Fixed binary Gaussian elimination emits chronological G; reversing CNOTs +gives its inverse. A nine-coordinate word has at most99 gates (at most9 +three-gate swaps plus9*8 row additions); identity omits the word. The +unchanged affine emitter has fixed H e0=b and chronological H^-1,X0,H, +one reversal and at most20 CNOTs. Every numerical component retains original +f and9f geometry. Its first-five-field parser accepts the unchanged sixth +cutoff as opaque data, as already proved in #7428/prior Gamma6 joins. + +The actual list is: joint3f guard; right complete phase including2f; +right26-CNOT G; right offset5 (one CNOT on either side of X0); C0; +S01,C0,S01; S02,C0,S02; left complete phase; left33-CNOT G. Every Si is +three exact phase-free CNOTs, hence Si C0 Si=Ci. The central product is +C0 C1 C2 and the total order is L C3 R with its exact absolute phase. + +Each fixed row addition acts on matching native bits of each f-column; +each Xi complements its entire slot; each phase sums the same per-column +polynomial. Their individual coordinate actions prove the arbitrary-f lift, +including every complete P/S/coefficient/component spectator. This tensors +products of fixed operators, not sums or exterior register coefficients. + +## Guard, transaction and helper invariants + +The unchanged fixed-rank guard multiplies captured f by3 with carry0..2 +and q=ceil(log2(3)) leading positions, canonically repacks and compares to +the actual binary cutoff. It retains original unary f/header. Its inherited +65536(V+E+1) envelope explicitly includes3q padded-parser rewind steps. +The potentially huge cutoff is never expanded to its numeric value. + +The whole core clones original DATA once to WORK, records TRACE and restores +the original head. Component HEADER0 remains original HEADER, DATA1 maps +to WORK, private t>=2 maps to t+2. PC labels are relocated injectively; +successful halt becomes local goto. Every runtime instruction is local +read/write/unit-move/goto/halt. Leaf port28 maps to30, so31 tapes suffice. + +Every successful component returns public factor heads and erases private +bodies/guards, enabling reuse of the same27 module-private owners. Internal +commits alter only WORK. After all succeed, one V-bit copy writes original +DATA, erases WORK, restores heads and disposes WORK/TRACE guards. Rejection +can dirty scratch but cannot reach an original write before this commit. + +HOME splits six codes/full DATA at B-relative2, blank guard1, permanent^0; +native ports map to3..33 and GUIDE is34. Successful repacking returns the +identical header and transformed body, erases copies and restores all35 +heads before B1 scatter. Parked field and opaque exteriors are preserved. + +The unchanged affine.py and join.py share an engine directory whose manifest +is the exact frozen affine manifest: all21 central pins plus five extra +translation/proof pins. Both original manifests/proofs/freezes are retained. +This installation changes no source bytes; regenerated predecessor graph +checks pin the same emitted tables under the shared manifest. + +## Numerical promises and retained common-root corollary + +The phase body rejects requested negation of a most-negative component; +copy/permutation of it is allowed. The C body retains actual w+2 numerator +rows and exact parity/range guards. No scaling, rounding or new grid is +installed. A simple sufficient reserve is input divisibility by2^(3f), +maximum M and2^(3f)M<=2^(w-1)-1. Unit phases/permutations preserve magnitude +and divisibility; each C axis spends at most one divisibility bit and grows +component maximum by at most2. Induction proves all actual prefix promises. +This stronger sufficient condition is not asserted for a selected producer. + +The unchanged note in reference/prefix-bridge/ conditionally applies existing +#7000 review section5, blob3dd1af2285e597676725e85ad4f65e7ad326d695. If an +actual producer supplies the retained complete D-bit root row, all source +coefficient/grid/mass/height/exterior-context premises and a correct injective +9f-bit view retaining complementary root bits, completed exact prefixes +retain the same grid/range: y=sum c_nu U_nu x_nu implies +Vy=sum c_nu(VU_nu)x_nu in the same Gaussian-dyadic Clifford class. Its format +has fractional bits p+D and width p+h+2D+3. This is an application of the +retained theorem, not a new precision or producer theorem. + +Partially written words, mixed scan buffers, accumulators, descriptors and +scratch need not be Clifford images and are excluded. Fully assembled and +committed components may inherit preceding/next complete-prefix bounds; +private arithmetic still needs its independently proved widened-helper +bounds. An arbitrary packet on a chosen grid does not supply the root-row +invariant. Packing/view/header/owner production, cutoff, helper validity, +cost/history and caller/nonleaf admission remain explicit. The included +bridge/review are disclosed AI review, not human or proof-kernel acceptance. + +## Complete successful bill and rolewise history + +Each local read/write/unit move/goto/halt costs one. Credited complete +envelopes include descriptors, copies, seeks, arithmetic, returns/retirement: + +| Component | Complete ceiling | +|---|---| +|Joint guard|65536(V+E+1)| +|Fixed k-CNOT word|1024k f(V+1)+8192(V+E+1)| +|Nine-coordinate complete phase|65536(E+65V+1)| +|Positive first-slot C|65536(fV+E+1)| +|X0 with descriptor production/reversal|4096(V+E+1)| +|One outer transaction|31V+27| + +A generic monomial has one phase, matrix word k<=99, and if b nonzero two +offset words of length<=10 plus X0. Its complete sum including outer staging +is at most4532255fV+94208E+94235, below2^24(fV+E+1). Use f(V+1)<=2fV and +V<=fV. Private increments sum phase256+matrix64+affine160+outer8=488<512, +times(V+E+1). + +Actual24476 has73 CNOTs in8 words:26 right,33 left,2 offset,12 central +swaps. It has2 phase passes,3 C leaves,1 X0,1 guard and1 outer transaction: + +`65536(V+E+1)+1024*73*f(V+1)+8*8192(V+E+1)` +`+2*65536(E+65V+1)+3*65536(fV+E+1)+4096(V+E+1)+31V+27`. + +This is at most9000991fV+462848E+462875, below2^25(fV+E+1). No child, +offset descriptor, full copy, arithmetic or return is a free callback. +It is direct fV work; no faster nonleaf tariff or recurrence amortization +follows. History sums guard64+8words*64+3leaves*64+2phases*256+X0*32+outer8 +=1320, below2048 times(V+E+1). Retired factors are not refunded. K_entry +includes older/opaque regions. Shorter clean calls at fixed origins retain +old maxima; new origins need actual interval unions/paid corridors. HOME +adds128(F+1) time/64(F+1) backing; B1/setup/program charges stay separate. + +## Executed evidence and limits + +The138933-location table passes all port/PC/unit-move bounds and has no +original DATA WRITE before commit. The139100-state HOME graph executes all +512 addresses at f1,w8, dense components divisible by8. The original-frame +oracle uses T470 T3*, not emitted factors. It returns in48976485 steps with +8206 final HOME writes only after primitive return; all35 heads/private +bodies/guards/exteriors restore. Visited increment143757 retains older history. + +The f1,cutoff2 case rejects at189419 steps without public writes. A source- +constructed input completes right monomial,C0,S01 at21526897 steps with its +whole intermediate WORK checked, then C1 rejects an odd numerator at21833563 +steps with zero HOME writes. Failure cleanup/retry is unclaimed. An executed +wrong-constant graph returns exactly i times the correct f1 answer. Changed +retained source bytes reject. Normal/-O replays compare exact receipts and +28 physical constant*f probes. The all-size proof is the preceding invariant +argument, not finite interpolation. No full f2 MOVE, all6310-event dispatcher, +owned lifetime, actual producer/view, recursive caller, assumption discharge +or new kappa is claimed. diff --git a/research/literal-source-affine-move/implementation/README.md b/research/literal-source-affine-move/implementation/README.md new file mode 100644 index 0000000000..c005b69f5c --- /dev/null +++ b/research/literal-source-affine-move/implementation/README.md @@ -0,0 +1,62 @@ +# Source-bound literal affine MOVE24476 + +This package composes generic fixed9-coordinate monomials and a positive +central join into the exact selected event24476, `[MOVE,727,3,470,false]`. +Its frames are3=[] and470=[75,137,265], operator T470 T3*, positive rank3. +The right monomial has output offset5 and global phase2. It is a different +source pair from the already implemented24472, whose offset1/phase1 receive +explicit credit; this is not the first nonzero-offset/phase literal MOVE. + +One complete phase pass uses input q plus a*f, then the fixed binary map G, +then post-G X_b. Joint3f<=cutoff is physically checked before the right +monomial. Three positive first-slot passes with exact slot swaps implement +the central C3. One outer transaction encloses all factors and commits on +the same original owner only after success. All9f bits and complete +P/S/coefficient/component spectators, header, width and common grid remain. + +The supplied Gamma6 entry is (f,c,P,S,w,cutoff), w>=2, +V=2PScw2^(9f), E full header length. Actual phase rotations and all3f C +prefixes must be integral/signed-fit as appropriate. No scaling or rounding +is installed. For31 core tapes, complete successful bounds are +T<=2^25(fV+E+1), historical increment2048(V+E+1). HOME uses35 tapes and +adds128(F+1) time/64(F+1) backing. B1 full-bank work and fixed setup/program +storage remain separately paid. Failure public preservation is proved; +failure cleanup/retry is unclaimed. + +The generic `compile_monomial` interface also supports any fixed valid9-slot +G/Q/alpha/a/b, under its phase-fit entry promise, with one original-owner +transaction, time2^24(fV+E+1) and historical increment512(V+E+1). All recipe +parameters are offline data; no runtime matrix loader exists. This does not +export an all-source MOVE dispatcher. + +Reproduce with the standard library; numerical runs take about30 seconds: + +```sh +python -B /workspace/scratch/92c9920affc2/worker-a/research/source-bound-affine-move-join/bind_source.py --source-repo /workspace/scratch/92c9920affc2/repo --recompile +python -B /workspace/scratch/92c9920affc2/worker-a/research/source-bound-affine-move-join/verify.py +python -O -B /workspace/scratch/92c9920affc2/worker-a/research/source-bound-affine-move-join/verify.py +``` + +The optional canonical recompile requires normal Python because that source +compiler has assertions. Independent acceptance and numerical checks remain +active under -O. All retained imports use fresh bytecode isolation and +source authentication. A complete dense f1 packet matches an original-frame +Gaussian oracle, restores all35 heads/private/exteriors and delays public +writes until primitive return. Cutoff, late nonintegral second-C, wrong +offset/phase/inverse source and executed wrong-phase controls discriminate. +Twenty-eight actual prefix probes verify a*f rather than a once per call. + +The unchanged reviewed common-root bridge is retained under reference/: +the existing #7000 numerical theorem supplies completed-prefix bounds if +an actual producer supplies its full-root invariant and correct view. +Partially written words/accumulators/descriptors/scratch remain excluded. +This is neither a new precision theorem nor an actual producer/caller proof. +The source role727 field and parked HOME are supplied initially; fixture +stock bookkeeping supplies no global productive-credit theorem. + +Open questions remain actual source producer/packing/ownership, complete +caller/B1 routing, exact source-family dispatcher and selected nonleaf rate. +#6978 already proves coded-child/source algebra. No global assumption or +kappa changes. PROOF.md, SOURCES.json, GRAPH.json and the draft PR description +record the exact scope, cost, provenance and evidence. Earlier freezes remain +unchanged. diff --git a/research/literal-source-affine-move/implementation/RECIPE.json b/research/literal-source-affine-move/implementation/RECIPE.json new file mode 100644 index 0000000000..8bd3a50946 --- /dev/null +++ b/research/literal-source-affine-move/implementation/RECIPE.json @@ -0,0 +1,99 @@ +{ + "canonical_main": "e54523517d0f03e58352e647c403a5af3e525a57", + "event_index": 24476, + "event": [ + "MOVE", + 727, + 3, + 470, + false + ], + "frames": { + "3": [], + "470": [ + 75, + 137, + 265 + ] + }, + "recipe": { + "rank": 3, + "left": { + "matrix_rows": [ + 15, + 19, + 32, + 71, + 128, + 256, + 3, + 5, + 1 + ], + "offset": 0, + "quadratic_rows": [ + 5, + 2, + 1, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "linear_Z4": [ + 3, + 3, + 2, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "phase": 0 + }, + "right": { + "matrix_rows": [ + 395, + 11, + 137, + 449, + 66, + 4, + 456, + 16, + 32 + ], + "offset": 5, + "quadratic_rows": [ + 201, + 448, + 0, + 201, + 0, + 0, + 11, + 395, + 130 + ], + "linear_Z4": [ + 3, + 0, + 0, + 3, + 0, + 0, + 2, + 1, + 2 + ], + "phase": 2 + } + }, + "targeted_distinct_pairs_examined": 2, + "source_compressed_sha256": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883", + "canonical_word_sha256": "91429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097" +} diff --git a/research/literal-source-affine-move/implementation/RESULT.json b/research/literal-source-affine-move/implementation/RESULT.json new file mode 100644 index 0000000000..b875f934c6 --- /dev/null +++ b/research/literal-source-affine-move/implementation/RESULT.json @@ -0,0 +1,232 @@ +{ + "HOME_states": 139100, + "core_locations": 138933, + "core_sha256": "f5a94e975d699c19b11a1a9a5c101b49bbc001fab44ebee5ef0b9f1d1bd92807", + "core_tapes": 31, + "cutoff_rejection_steps": 189419, + "full_f1": { + "E": 14, + "F": 8206, + "HOME_writes": 8206, + "V": 8192, + "core_return_steps": 48910757, + "output_sha256": "cecd27593587afc2498b053c536285ccf46b16b84bdf7351aa5ecf5d2e3e0b82", + "shape": [ + 1, + 1, + 1, + 1, + 8, + 3 + ], + "steps": 48976485, + "visited_increment": 143757 + }, + "late_rejection": { + "HOME_writes": 0, + "first_C_and_R_completed": 21526897, + "steps": 21833563 + }, + "marker": "PASS_SOURCE_BOUND_AFFINE_MOVE_HOME", + "phase_lift_probes": [ + { + "constant": 0, + "f": 1, + "mode": 0, + "steps": 164 + }, + { + "constant": 0, + "f": 2, + "mode": 0, + "steps": 305 + }, + { + "constant": 0, + "f": 3, + "mode": 0, + "steps": 373 + }, + { + "constant": 0, + "f": 4, + "mode": 0, + "steps": 544 + }, + { + "constant": 0, + "f": 5, + "mode": 0, + "steps": 612 + }, + { + "constant": 0, + "f": 16, + "mode": 0, + "steps": 1806 + }, + { + "constant": 0, + "f": 65, + "mode": 0, + "steps": 6664 + }, + { + "constant": 1, + "f": 1, + "mode": 1, + "steps": 164 + }, + { + "constant": 1, + "f": 2, + "mode": 2, + "steps": 305 + }, + { + "constant": 1, + "f": 3, + "mode": 3, + "steps": 373 + }, + { + "constant": 1, + "f": 4, + "mode": 0, + "steps": 544 + }, + { + "constant": 1, + "f": 5, + "mode": 1, + "steps": 612 + }, + { + "constant": 1, + "f": 16, + "mode": 0, + "steps": 1806 + }, + { + "constant": 1, + "f": 65, + "mode": 1, + "steps": 6664 + }, + { + "constant": 2, + "f": 1, + "mode": 2, + "steps": 164 + }, + { + "constant": 2, + "f": 2, + "mode": 0, + "steps": 305 + }, + { + "constant": 2, + "f": 3, + "mode": 2, + "steps": 373 + }, + { + "constant": 2, + "f": 4, + "mode": 0, + "steps": 544 + }, + { + "constant": 2, + "f": 5, + "mode": 2, + "steps": 612 + }, + { + "constant": 2, + "f": 16, + "mode": 0, + "steps": 1806 + }, + { + "constant": 2, + "f": 65, + "mode": 2, + "steps": 6664 + }, + { + "constant": 3, + "f": 1, + "mode": 3, + "steps": 164 + }, + { + "constant": 3, + "f": 2, + "mode": 2, + "steps": 305 + }, + { + "constant": 3, + "f": 3, + "mode": 1, + "steps": 373 + }, + { + "constant": 3, + "f": 4, + "mode": 0, + "steps": 544 + }, + { + "constant": 3, + "f": 5, + "mode": 3, + "steps": 612 + }, + { + "constant": 3, + "f": 16, + "mode": 0, + "steps": 1806 + }, + { + "constant": 3, + "f": 65, + "mode": 3, + "steps": 6664 + } + ], + "scope": "one supplied public-role727 Gamma6 direct MOVE; no caller/source-producer/nonleaf admission", + "source": { + "canonical_recipe_recompiled": false, + "controls": [ + "wrong_phase", + "wrong_offset", + "inverse_orientation" + ], + "event_index": 24476, + "factors": { + "left": { + "CNOTs": 33, + "offset": 0, + "phase": 0 + }, + "right": { + "CNOTs": 26, + "offset": 5, + "phase": 2 + } + }, + "full_archive_reextracted": false, + "marker": "PASS_ACTUAL_AFFINE_MOVE_SOURCE", + "matrix_columns": 1024, + "owner": 727, + "private": false, + "private_flag_is_not_inversion": true, + "rank": 3 + }, + "tapes": 35, + "wrong_phase_steps": 48976485 +} diff --git a/research/literal-source-affine-move/implementation/SOURCE-BINDING.json b/research/literal-source-affine-move/implementation/SOURCE-BINDING.json new file mode 100644 index 0000000000..456a9066f5 --- /dev/null +++ b/research/literal-source-affine-move/implementation/SOURCE-BINDING.json @@ -0,0 +1,28 @@ +{ + "marker": "PASS_ACTUAL_AFFINE_MOVE_SOURCE", + "event_index": 24476, + "owner": 727, + "private": false, + "private_flag_is_not_inversion": true, + "rank": 3, + "factors": { + "right": { + "CNOTs": 26, + "offset": 5, + "phase": 2 + }, + "left": { + "CNOTs": 33, + "offset": 0, + "phase": 0 + } + }, + "matrix_columns": 1024, + "full_archive_reextracted": true, + "canonical_recipe_recompiled": true, + "controls": [ + "wrong_phase", + "wrong_offset", + "inverse_orientation" + ] +} diff --git a/research/literal-source-affine-move/implementation/SOURCES.json b/research/literal-source-affine-move/implementation/SOURCES.json new file mode 100644 index 0000000000..a62d92a55c --- /dev/null +++ b/research/literal-source-affine-move/implementation/SOURCES.json @@ -0,0 +1,294 @@ +{ + "canonical_main": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "local": "engines/affine.py", + "bytes": 3859, + "sha256": "9387d4caa6ea6ad9e232f4a2a07112fa1a681d34af19e5aae64d1d8adc5ebd2c", + "source_package": "frozen generic affine translation", + "original": "affine.py" + }, + { + "local": "engines/SOURCES.json", + "bytes": 7336, + "sha256": "abbbd21565ff67a5268d30c034ad33f2143c8b2699bbcccc68569a326ff020b6", + "source_package": "frozen generic affine translation", + "original": "SOURCES.json" + }, + { + "local": "engines/reference/rank2/rank2.py", + "bytes": 8253, + "sha256": "3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/rank2.py" + }, + { + "local": "engines/reference/rank2/SOURCES.json", + "bytes": 10337, + "sha256": "659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/SOURCES.json" + }, + { + "local": "engines/reference/rank2/RECIPE.json", + "bytes": 4468, + "sha256": "b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/RECIPE.json" + }, + { + "local": "engines/reference/rank2/reference/linear/linear.py", + "bytes": 13102, + "sha256": "d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/linear/linear.py" + }, + { + "local": "engines/reference/rank2/reference/linear/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/linear/inputs/controller_reference.py" + }, + { + "local": "engines/reference/rank2/reference/linear/NOTICE.md", + "bytes": 2180, + "sha256": "2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/linear/NOTICE.md" + }, + { + "local": "engines/reference/rank2/reference/phase/phase.py", + "bytes": 11734, + "sha256": "2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/phase/phase.py" + }, + { + "local": "engines/reference/rank2/reference/phase/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/phase/inputs/controller_reference.py" + }, + { + "local": "engines/reference/rank2/reference/phase/NOTICE", + "bytes": 808, + "sha256": "5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/phase/NOTICE" + }, + { + "local": "engines/reference/rank2/reference/leaf/leaf.py", + "bytes": 17526, + "sha256": "bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/leaf/leaf.py" + }, + { + "local": "engines/reference/rank2/reference/leaf/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/leaf/inputs/controller_reference.py" + }, + { + "local": "engines/reference/rank2/reference/leaf/NOTICE.md", + "bytes": 1900, + "sha256": "773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/leaf/NOTICE.md" + }, + { + "local": "engines/reference/rank2/reference/source/clifford_exact.py", + "bytes": 6824, + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/source/clifford_exact.py" + }, + { + "local": "engines/reference/rank2/reference/source/native_verify.py", + "bytes": 12323, + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/source/native_verify.py" + }, + { + "local": "engines/reference/rank2/reference/home/tape_graph.py", + "bytes": 12069, + "sha256": "7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/home/tape_graph.py" + }, + { + "local": "engines/reference/rank2/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/machine.py" + }, + { + "local": "engines/reference/rank2/reference/home/parent_adapter.py", + "bytes": 5353, + "sha256": "04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/home/parent_adapter.py" + }, + { + "local": "engines/reference/rank2/reference/home/NOTICE.md", + "bytes": 2093, + "sha256": "b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/reference/home/NOTICE.md" + }, + { + "local": "engines/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee", + "source_package": "frozen generic affine translation", + "original": "machine.py" + }, + { + "local": "engines/reference/rank2/PROOF.md", + "bytes": 16634, + "sha256": "93e1ad8a92c3624df064e4f39119ccbb5c96391ea8dd5f7af58edc7ca9638352", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/PROOF.md" + }, + { + "local": "engines/reference/rank2/FREEZE.json", + "bytes": 5633, + "sha256": "072dfea997d4db796d492eaf746e0bd99630964741b88862d0f10f5fc1e00275", + "source_package": "frozen generic affine translation", + "original": "reference/rank2/FREEZE.json" + }, + { + "local": "engines/reference/translation/translate.py", + "bytes": 7703, + "sha256": "e2750fef8c2b9c8019d67285df3ca0d04340cd241782c7845665b7de621ca3bd", + "source_package": "frozen generic affine translation", + "original": "reference/translation/translate.py" + }, + { + "local": "engines/reference/translation/reference/reverse.py", + "bytes": 6649, + "sha256": "4b516d85baf3303db809bc1174394009b1fc71a8f7d17fb6c729ec8bb6aba245", + "source_package": "frozen generic affine translation", + "original": "reference/translation/reference/reverse.py" + }, + { + "local": "engines/reference/translation/reference/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "source_package": "frozen generic affine translation", + "original": "reference/translation/reference/inputs/controller_reference.py" + }, + { + "local": "engines/reference/translation/NOTICE.md", + "bytes": 1201, + "sha256": "24f5e9957fcd8f6cfdc021ff5bc91bf89e50587997e2a2cb18053949c0e0d205", + "source_package": "frozen generic affine translation", + "original": "reference/translation/NOTICE.md" + }, + { + "local": "engines/reference/translation/PROOF.md", + "bytes": 19690, + "sha256": "6b76d348203aed15cbc30d104c59571111ccf6cb7bb4592936e9170f736b68e0", + "source_package": "frozen generic affine translation", + "original": "reference/translation/PROOF.md" + }, + { + "local": "engines/join.py", + "bytes": 6778, + "sha256": "971080f6254cfaf44b01a412533818ffdff78ea925452c76a02524092b3ccff6", + "source_package": "frozen generic positive central join", + "original": "join.py" + }, + { + "local": "reference/affine-SOURCES.json", + "bytes": 7336, + "sha256": "abbbd21565ff67a5268d30c034ad33f2143c8b2699bbcccc68569a326ff020b6", + "source_package": "generic-affine-native-translation", + "original": "SOURCES.json" + }, + { + "local": "reference/affine-PROOF.md", + "bytes": 12681, + "sha256": "f43040c6331dc29ecf3f435e980cc71f00a60e421f50f4e843192a23e733bd44", + "source_package": "generic-affine-native-translation", + "original": "PROOF.md" + }, + { + "local": "reference/affine-FREEZE.json", + "bytes": 7062, + "sha256": "de2753cb42a012e07aa7ace263bedce5c4be8506ae30ab768af9e165a6edd6e0", + "source_package": "generic-affine-native-translation", + "original": "FREEZE.json" + }, + { + "local": "reference/central-SOURCES.json", + "bytes": 5445, + "sha256": "496948cd8d2b5134ceed6b48b870be73f6415b5f70e97ab35b744ded5a2a3c03", + "source_package": "generic-positive-native-join-gate", + "original": "SOURCES.json" + }, + { + "local": "reference/central-PROOF.md", + "bytes": 12196, + "sha256": "48899c607452daccd0998f4005ae2a6ed85a723969f474bf796496303ad4d4bb", + "source_package": "generic-positive-native-join-gate", + "original": "PROOF.md" + }, + { + "local": "reference/central-FREEZE.json", + "bytes": 6301, + "sha256": "5735c401ba981a7af4d3a146eb047d04fa0c87dbf7ed49bd82dc57df8d6cb2ef", + "source_package": "generic-positive-native-join-gate", + "original": "FREEZE.json" + }, + { + "local": "machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee", + "source_package": "13c29e2df66ba46402d4da5f1d2489ebf333e5fe HOME interpreter" + }, + { + "local": "reference/prefix-bridge/PROOF.md", + "bytes": 6282, + "sha256": "84a30aeff471af36e182840b2c6605e0fdf8aa3a5d829c656b21d16df682f595", + "source_package": "reviewed common-grid conditional bridge", + "original": "PROOF.md" + }, + { + "local": "reference/prefix-bridge/INDEPENDENT-REVIEW.md", + "bytes": 3970, + "sha256": "6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b", + "source_package": "reviewed common-grid conditional bridge", + "original": "INDEPENDENT-REVIEW.md" + }, + { + "local": "reference/prefix-bridge/retained-selected-proof.md", + "bytes": 25533, + "sha256": "4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055", + "source_package": "reviewed common-grid conditional bridge", + "original": "retained-selected-proof.md" + }, + { + "local": "reference/prefix-bridge/SOURCE-REVIEW.json", + "bytes": 758, + "sha256": "f8be476176747afb154859cb2a3c09cf5154e413fde8b8f9c95e23ce26806645", + "source_package": "reviewed common-grid conditional bridge", + "original": "SOURCE-REVIEW.json" + } + ], + "event_archive": { + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/shared-wire-split-composition/data/final.json.gz", + "bytes": 350722, + "blob": "74563a7867d9d762b6588f65362369668841bb3e", + "sha256": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883", + "canonical_sha256": "91429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097" + }, + "installation": "unchanged affine.py and join.py share the unchanged affine manifest, a strict superset of central runtime pins; original manifests retained under reference/", + "recipe_sha256": "8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79" +} diff --git a/research/literal-source-affine-move/implementation/adapter.py b/research/literal-source-affine-move/implementation/adapter.py new file mode 100644 index 0000000000..786844648e --- /dev/null +++ b/research/literal-source-affine-move/implementation/adapter.py @@ -0,0 +1,118 @@ +"""Paid Gamma6/HOME adapter for actual selected affine MOVE24476. + +Derived from the frozen rank2 adapter; Apache-2.0; Codex-assisted. +""" +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') +import move as C +B1=HERE/'engines/reference/rank2/reference/home/tape_graph.py' +D=C.load('actual_affine_home_dispatch', B1) +CORE_BASE,GUIDE,TAPES=3,34,35 + + +@cache +def core(mutation=None): + code,alphabet,_=C.compile_move(mutation) + if alphabet!=('_','0','1','|'): + raise ValueError('changed fixed alphabet') + 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('MOVE24476') for _ in code] + for pc,(op,*args) in enumerate(code): + state=labels[pc];g.rules.setdefault(state,[]) + nxt=labels[pc+1] if pc+1>c)&1)<>slot)&1) + return tuple(word) + + +def components(offset,mutation=None): + offset=fixed_offset(offset) + if offset==0: + return [] + word=conjugator(offset) + if mutation=='omit_last_conjugator_gate' and word: + word=word[:-1] + flip=('X0_',T.compile_translation()) + if not word: + return [flip] + before=('G_inverse_',P.compile_word(tuple(reversed(word)))) + after=('G_',P.compile_word(word)) + return [before,after,flip] if mutation=='wrong_conjugation_order' else [before,flip,after] + + +def compile_translation(offset,mutation=None): + """One complete original-owner transaction for a fixed offset, even zero.""" + factors,a=components(offset,mutation),Builder() + for tape in (WORK,TRACE): + a.op('move',tape,-1);a.op('write',tape,MARK);a.op('move',tape,1) + a.mark('clone') + a.op('read',DATA,{'0':'clone0',ONE:'clone1',BLANK:'cloned'}) + for bit in BITS: + a.mark('clone'+bit) + a.op('write',WORK,bit);a.op('move',WORK,1);a.op('move',DATA,1) + a.op('write',TRACE,ONE);a.op('move',TRACE,1);a.op('goto','clone') + a.mark('cloned');P.return_source(a);a.rewind(WORK,BITS) + entries={} + for index,(name,(code,alphabet)) in enumerate(factors): + entries[name]=len(a.code) + after=factors[index+1][0]+'0' if index+1budget: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]=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-source-affine-move/implementation/engines/reference/rank2/RECIPE.json b/research/literal-source-affine-move/implementation/engines/reference/rank2/RECIPE.json new file mode 100644 index 0000000000..04f5dc8367 --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/rank2/SOURCES.json b/research/literal-source-affine-move/implementation/engines/reference/rank2/SOURCES.json new file mode 100644 index 0000000000..0ea6091131 --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/rank2/machine.py b/research/literal-source-affine-move/implementation/engines/reference/rank2/machine.py new file mode 100644 index 0000000000..fcd4ac01f0 --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/rank2/reference/leaf/NOTICE.md b/research/literal-source-affine-move/implementation/engines/reference/rank2/reference/leaf/NOTICE.md new file mode 100644 index 0000000000..71c5f6dae2 --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/rank2/reference/leaf/inputs/controller_reference.py b/research/literal-source-affine-move/implementation/engines/reference/rank2/reference/leaf/inputs/controller_reference.py new file mode 100644 index 0000000000..3ab6d0361f --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/rank2/reference/leaf/leaf.py b/research/literal-source-affine-move/implementation/engines/reference/rank2/reference/leaf/leaf.py new file mode 100644 index 0000000000..bdcc80cbd8 --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/rank2/reference/linear/NOTICE.md b/research/literal-source-affine-move/implementation/engines/reference/rank2/reference/linear/NOTICE.md new file mode 100644 index 0000000000..3a3030f23d --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/rank2/reference/linear/inputs/controller_reference.py b/research/literal-source-affine-move/implementation/engines/reference/rank2/reference/linear/inputs/controller_reference.py new file mode 100644 index 0000000000..3ab6d0361f --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/rank2/reference/linear/linear.py b/research/literal-source-affine-move/implementation/engines/reference/rank2/reference/linear/linear.py new file mode 100644 index 0000000000..6aad40a6c4 --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/rank2/reference/phase/NOTICE b/research/literal-source-affine-move/implementation/engines/reference/rank2/reference/phase/NOTICE new file mode 100644 index 0000000000..7a1f1da9c5 --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/rank2/reference/phase/inputs/controller_reference.py b/research/literal-source-affine-move/implementation/engines/reference/rank2/reference/phase/inputs/controller_reference.py new file mode 100644 index 0000000000..3ab6d0361f --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/rank2/reference/phase/phase.py b/research/literal-source-affine-move/implementation/engines/reference/rank2/reference/phase/phase.py new file mode 100644 index 0000000000..d489781458 --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/rank2/reference/source/clifford_exact.py b/research/literal-source-affine-move/implementation/engines/reference/rank2/reference/source/clifford_exact.py new file mode 100644 index 0000000000..166841a037 --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/rank2/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-source-affine-move/implementation/engines/reference/translation/NOTICE.md b/research/literal-source-affine-move/implementation/engines/reference/translation/NOTICE.md new file mode 100644 index 0000000000..903e332da2 --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/translation/NOTICE.md @@ -0,0 +1,20 @@ +# Credit and assistance + +Prepared for Jerry Chen / @CubeJerry with substantial OpenAI assistance. +New work is Apache-2.0. Exact retained sources preserve their original notices. + +The selected #7000 source, its application and predecessor native/Clifford +contributors supply the actual event and operator decomposition. The published +literal-native-quadratic-phase package supplies the exact current recipe +binding and five-Gamma/raw packed ABI. The published literal-row-reversal +package supplies the unchanged literal record-reversal graph, classical +two-stack implementation and exact cost/history theorem. The phase lineage +supplies the retained Gamma/unary helpers, and #7349 supplies the finite +machine grammar and builder. The earlier serial monomial descriptor iterator +is a distinct predecessor, not a solved numerical join on this ABI. + +This package contributes literal collapsed-descriptor production and the +actual fixed-graph join for one source-bound post-matrix translation. It does +not claim the source recipe, tensor translation identity, reversal algorithm, +or classical unary/binary conversion as new. Independent AI review, where +recorded, is not human or formal-kernel acceptance. diff --git a/research/literal-source-affine-move/implementation/engines/reference/translation/PROOF.md b/research/literal-source-affine-move/implementation/engines/reference/translation/PROOF.md new file mode 100644 index 0000000000..5c6325471a --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/translation/PROOF.md @@ -0,0 +1,377 @@ +# A literal descriptor join for one selected native translation + +**Scoped enabling lemma; no new kappa.** Prepared for Jerry Chen / @CubeJerry +with substantial OpenAI assistance. Canonical base: +`e54523517d0f03e58352e647c403a5af3e525a57`. + +## 1. Actual source factor and exact boundary + +The selected native word is +`research/shared-wire-split-composition/data/final.json.gz`, compressed SHA256 +`2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883`. +Its zero-based event 24472 is `["MOVE",415,3,99,false]`. The exact lowering of +the frame-3 to frame-99 operator has rank 1. Its right monomial has affine +offset **1**, with matrix rows +`(239,129,130,132,136,16,160,192,256)`. + +The retained Clifford constructor produces `diag; perm(G); xgate(offset); +global_phase`. Rows of G are indexed by output bits: the image integer is +`sum_i parity(G_i & x)*2^i`, then XOR offset. Therefore offset 1 flips +**output coordinate 0 after G**. It does not identify bit zero with the +fastest packed coordinate. The complete authenticated recipe is retained in +`RECIPE.json`; `bind_source.py` recomputes it and checks the post-matrix +translation with the separate retained signed-Pauli/Gaussian evaluator. + +The supplied entry ABI is exactly the five-Gamma/raw packed ABI of +[literal-native-quadratic-phase](https://github.com/CubeJerry/integer-mult-bounds/tree/172f4535ce8dcff79f626410af845f757c1563be/research/literal-native-quadratic-phase). +Its coordinate tuple is `a=(a_0,...,a_8)` with a_0 the slow coordinate, a_8 +the fast coordinate, and each `a_i` an f-bit nonnegative integer. For each +tensor column j, native coordinate bit i is `(a_i >> j)&1`. + +Consequently the source's lifted X_1 acts by + +`(a_0,a_1,...,a_8) -> (a_0 XOR (2^f-1),a_1,...,a_8)`. + +This package implements that translation alone at the stated post-matrix +boundary. It does not implement G, the source quadratic phase, the central +rank-one child, or the whole MOVE. In particular the existing phase pass +cannot simply be followed by this translation while omitting G. + +## 2. The joined literal theorem + +Supply positive integers `f,r,P,S,w` as five consecutive canonical Elias +Gamma codes on HEADER. Gamma(n) consists of `ell(n)-1` zeroes followed by +the ell(n) ordinary binary digits of n. Let E be their total bit length. +DATA is the complete lexicographic array + +`[P] x [2^f]^9 x [S]`, + +with r Gaussian coefficients per array entry and 2w raw bits per coefficient, +real component then imaginary component, each MSB first. The word contains +exactly + +`V = 2*P*2^(9f)*S*r*w` + +bits and then a physical blank. The payload may be arbitrary; no arithmetic +or signed headroom is needed for this permutation. HEADER can have opaque +data immediately after its fifth code. DATA can have opaque data after the +blank endpoint. All such exteriors remain unchanged. + +The fixed ports are HEADER=0, DATA=1, three private binary descriptors at +2,3,4, the nine retained reversal work roles at 5,...,13, and eleven producer +roles at 14,...,24. Thus there are **25 tapes**, of which 23 are private. +Each head begins at its own arbitrary origin, possibly negative. On private +roles, the guard at origin minus one and the active windows in Section 7 are +blank. This is an explicit allocation/blankness premise, not something two +local probes certify. Opaque cells outside those windows are preserved. + +**Theorem.** `compile_translation()` emits one fixed 1,878-location graph, +alphabet `{blank,0,1,|}`, using only scanned-symbol branches, one-cell writes, +unit moves, fixed jumps and halt. It has no runtime shape, integer, coordinate +array, source callback, multiplication service or graph-generation argument. +On every legal packet it applies the source translation above, commits to +the same DATA owner and exact original field, restores HEADER and every head, +and erases all private bodies and guards. + +For every successful call its complete local instruction count obeys + +`T <= 4096*(V+E+1)`, + +and its private historical backing obeys + +`K_final <= K0 + 32*(V+E+1)`. + +K0 is actual previous private backing, including currently blank retained +cells. No erasure reduces it. Both bounds are O(V) on this complete ABI. + +Missing DATA bits, an extra immediate DATA bit, or a malformed finite header +encountered by the literal parser cause rejection before any DATA write. +General malformed-input termination, failure cleanup, interrupted-call +recovery and later reuse after failure are not claimed. The normal runtime +graph contains no verifier step budget. + +## 3. Producing the correct collapsed lengths + +Collapse the complete packet as `[P'] x [R] x [B]`, taking + +`P'=P`, `R=2^f`, `B=2*S*r*w*2^(8f)`. + +The remaining eight coordinates, all spectator copies, r coefficients and +both complete w-bit components are in the B-bit suffix record. This includes +every real/imaginary bit; reversing B-bit records must preserve their internal +order. The identity `P' R B = V` is exact. + +The producer obtains these encodings from the actual HEADER as follows. + +1. The retained Gamma pattern creates unary guides of lengths f,r,P,S,w. + LENGTH counts prefix zeroes. Each tail digit b changes an existing unary + prefix v to `2v+b` using DOUBLE and physical scans. HTRACE records every + HEADER step and returns HEADER to its entry origin with erasure. +2. RDESC receives one `1`, then exactly f zeroes while scanning the F guide. + This is the canonical MSB-first encoding of `2^f`; it does not construct + an uncharged host power or require a supplied binary R. +3. Three literal nested scans over S, r and w append two unary marks per + innermost visit. PRODUCT therefore has exactly `B0=2Srw` marks. +4. For every mark of F, the fixed program executes eight unary doublings of + PRODUCT. Induction on the scanned F prefix gives the final length + `B=B0*2^(8f)`. Each doubling physically copies, clears, restores and + erases its scratch. Eight is a fixed property of this source geometry; + the number of iterations over f is discovered by local scans. +5. The routine in Section 4 consumes OUTER=P and PRODUCT=B and emits their + canonical binary words on PDESC and BDESC. RDESC is already canonical. + +At the reversal join all 25 heads are at their original origins. DATA has +not been written or moved. The three generated descriptor words are +canonical, positive, terminated by physical blanks, and on distinct owners. +The reversal's nine private windows are untouched and blank. Producer guards +at descriptor origin minus one are opaque exterior symbols to the reversal; +that routine neither reads nor changes them. + +## 4. A charged unary-to-binary bridge + +The descriptor routine `unary_binary` takes one positive unary run of length +n, a blank quotient role HALF, a blank DIGITS stack, and a blank destination. +Their roles and guards are distinct. Two fixed control copies alternate +which of the source/HALF roles holds the current positive quotient. This +does not allocate a changing family of tapes. + +While scanning the current run, a parity control bit toggles on every mark. +Every second mark appends one mark to the other role; all current marks are +erased. Thus at the scan end the other role has floor(n/2) marks and the +parity is n mod 2. The routine restores both unary heads and appends the +parity as one bit to DIGITS. A local read of the quotient distinguishes a +positive next iteration from termination. At termination both unary roles +are blank and restored. + +The resulting DIGITS word contains the remainders of repeated exact division +by two, least significant first. Its last bit is 1 because the last positive +quotient is 1. Popping DIGITS backward into the destination therefore writes +the canonical MSB-first binary representation, with no leading zero and no +external length. The pop erases DIGITS; guarded rewind restores destination +and all scratch heads. + +This is the classical division-by-two conversion with an explicit local +implementation and complete charge, not a claimed new numeral algorithm. +Here its linear cost matters: materializing unary B is affordable because +B is a complete suffix volume, and binary production must not add a hidden +quadratic rescan. + +For an iteration with current value n_i and quotient q_i=floor(n_i/2), the +literal instruction count is `7n_i+5q_i+10`. This includes the parity scan, +all writes, both rewinds, digit append and next-iteration test. If +`ell=ell(n)` and `s=popcount(n)`, then + +`sum_i n_i=2n-s`, `sum_i q_i=n-s`. + +The initial jump and final digit reversal/rewind add `9ell+7`. Hence the +routine's exact cost, excluding its caller's guard installation/removal, is + +`19n - 12s + 19ell + 7 <= 38n+7`. + +The current unary run never exceeds n, HALF never exceeds floor(n/2), and +DIGITS/destination never exceed ell(n). These are all-size loop invariants. +The finite encoder tests independently check the exact census; they are not +used as a universal interpolation argument. + +## 5. Actual reversal invocation and successful retirement + +The invoked graph is the exact +[literal-row-reversal](https://github.com/CubeJerry/integer-mult-bounds/tree/7662d01d827c95d90032579c168cae78aa531f2f/research/literal-row-reversal) +program, source SHA256 +`4b516d85baf3303db809bc1174394009b1fc71a8f7d17fb6c729ec8bb6aba245`. +Its 524 instructions are included in the joined graph with a fixed tape and +label relabeling. The single successful halt becomes a fixed jump to the +descriptor-retirement epilogue, of the same one-instruction cost. No runtime +call, decoded size, computed target or interpreter callback is inserted. +The verifier checks every instruction of this embedded subgraph against the +retained graph, including its rejection branch. + +The predecessor theorem maps each `[P] x [R] x [B]` packet to +`A'(p,a,b)=A(p,R-1-a,b)`, preserving the internal order of each complete +B-bit suffix record. For R=2^f, `R-1-a=a XOR (R-1)`. Combined with Section 3, +this is exactly the source tensor X_1 and preserves all other coordinates, +Gaussian coefficients and individual component bits. + +The predecessor stages its entire output, checks exact DATA cardinality, +then installs only on the same DATA owner. It restores descriptor heads and +its nine private roles before jumping to the epilogue. The epilogue erases +all generated descriptor bodies and remaining unary parameter bodies, then +all fourteen producer guards. Each clearing scan stops at its current blank +frontier and rewinds to its local guard. At halt every private body and guard +is blank and all heads have returned to their entry origins. + +If the header parser or the reversal rejects, the producer has made no DATA +write and the reversal has not started commit. Public values are therefore +preserved, but private work and heads can remain dirty. The proof requires +successful cleanup before a subsequent clean call. + +## 6. Exact complete instruction bill and linear envelope + +Each local instruction, including a read, write, unit move, jump or halt, +costs one. Let `s(n)=popcount(n)`, `ell(n)=floor(log2(n))+1`, and set + +`E'=ell(P)+ell(R)+ell(B)`. + +Define two exact helper counts: + +`g(n)=47n-30s(n)+33ell(n)-42`, + +`h(n)=19n-12s(n)+19ell(n)+7`. + +The first is Gamma decoding before the shared HEADER return and guards; +the second is Section 4's complete unary-to-binary conversion. To verify +the first directly, each leading zero uses seven instructions. A binary +prefix update from v by b uses `47v+17b+18` instructions in its three unary +copy/clear helpers, plus eight in the Gamma wrapper. The strict prefix sum +is `n-s(n)`. Counting the leading one and terminal LENGTH read gives g(n). +The proof uses finite control states and local scans throughout. + +The exact predecessor reversal count is + +`C(P,R,B)=53V+23PR+71P+54R+54B+28E'` + +` -30(s(P)+s(R)+s(B))-8`. + +The entire joined program has the following additive census: + +| Executed region | Exact instruction count | +|---|---| +| Install fourteen producer guards | `42` | +| Decode the five Gamma values | `g(f)+g(r)+g(P)+g(S)+g(w)` | +| Return HEADER and erase its trace | `5E+3` | +| Produce RDESC and restore F/RDESC | `11f+12` | +| Produce B0 by complete nested scans | `16Srw+10Sr+10S+7` | +| Execute eight doublings per F mark | `47(B-B0)+150f+4` | +| Produce PDESC and BDESC | `h(P)+h(B)` | +| Complete retained reversal | `C(P,R,B)` | +| Erase producer bodies/guards and halt | `7(E'+f+r+S+w)+99` | + +For the doubling row, a zero-bit update costs `47v+18`; there are 8f such +updates and their previous values sum to B-B0. Scanning and returning F +adds `6f+4`. For the last row, OUTER and PRODUCT have been consumed and all +temporary guides are blank; the only remaining body lengths are the three +descriptors and f,r,S,w. Clearing a body of length n costs `7n+4`, including +its return. Fourteen guard removals and the final halt give the constant 99. + +This census includes source acquisition, every unary expansion, record load, +copy, two-stack reversal, full output stage, DATA returns, complete commit, +descriptor returns, setup and erasure. It is independent of payload bits and +absolute origins. The graph is built once at a fixed finite setup cost before +the numerical inputs vary; the displayed bill is for each execution of that +fixed graph. No input-dependent compilation is hidden. + +For a convenient envelope, put `Sigma=f+r+P+S+w`. Gamma acquisition plus +HEADER return is at most `256(E+Sigma+1)`. RDESC costs at most `32(f+1)`; +the nested product at most `18B0+7`; the doubling stage at most +`47B+286f+4`; the two encoders at most `38(P+B)+14`; and the reversal at +most `256(V+E'+1)`. The exact epilogue is as above. Since every parameter, +B and B0 is at most V, Sigma<=5V. Moreover `E'<=log2(V)+3<=V`, as V>=1024. +These bounds sum to less than `4096(V+E+1)`. + +Finally `E<=2log2(frPSw)+5<=2log2(V)+5`, so E is O(log V) and the complete +execution is O(V). A unary parameter unrelated to the packet volume would +not justify this argument. Here the exact complete-array product pays every +expanded guide, including the large suffix B. + +## 7. Private backing, exteriors and repeated calls + +Every private role has a guard at relative position -1. The table below +gives its largest possible body/end position; hence its visited interval is +contained in `[-1,cap]`. Define `M=max(P,B)` and `L=ell(M)`. + +| Producer role | Cap | +|---|---| +| PDESC, RDESC, BDESC | `ell(P)`, `f+1`, `ell(B)` respectively | +| HTRACE, LENGTH | `E` each | +| DOUBLE | `M` | +| F, COEFF, OUTER, SPECTATOR, WIDTH | `f,r,P,S,w` respectively | +| PRODUCT | `B` | +| HALF | `floor(M/2)` | +| DIGITS | `L` | + +B dominates f,r,S,w because `B=2Srw*2^(8f)` and all parameters are positive. +Thus DOUBLE never needs more than max(P,B), whether during Gamma acquisition +or suffix doubling. The encoder alternates source/HALF, and its quotient +can never exceed half its initial source length. Its digit stack is bounded +by L. These caps include all intermediate formats, not just final contents. + +The predecessor's nine reversal roles retain their proved windows: OUTPUT +and DTRACE cap V; prefix and row guides cap P and R; suffix guide and record +scratch cap B; doubling scratch caps max(P,R,B); descriptor trace caps the +largest descriptor length; and group scratch caps RB. Its private history +increment is at most `8V+E'+18`. + +Adding the fourteen producer intervals gives the explicit union bound + +`K_final <= K0 + 8V + 2E' + 2E + M + Sigma + B + floor(M/2) + L + 46`. + +This is below `K0+32(V+E+1)`. Public heads visit exactly HEADER's consumed +interval `[0,E]` and DATA's complete interval `[0,V]`; their input backing +and endpoints are separately part of the supplied public field storage. +All opaque exteriors are preserved by the guard/frontier invariants. + +Erasure leaves previous backing allocated. After successful reuse at fixed +origins, retain the per-role maximum cap reached and combine it with actual +initial history; do not replace that sum by equality with a maximum of +per-call sums. A coarse valid sequence bound is +`K_initial+32(V_max+E_max+1)`. A shorter call scans only its current bodies, +so its exact current-shape instruction bill is unaffected by old blank +capacity. If caller origins change, keep the per-role absolute unions and +pay caller transport corridors; there is no bound on arbitrary relocated +histories by current V alone. + +## 8. Evidence, novelty and remaining obligations + +The complete author receipt contains nine successful runs, totaling 702,464 +payload bits and 57,517,967 local transitions. This includes a full selected +nine-coordinate f=2 packet: 262,144 Gaussian coefficients and 524,288 bits. +It is complete coverage of that fixture, not a higher-width prefix. All +104 standalone encoder cases, through n=1024, satisfy the exact encoder +census. Whole-packet expected outputs use a separate source-coordinate XOR +formula at coefficient addresses, not the reversal algorithm. + +The checker inspects the actual three produced descriptor words before the +retained subgraph starts, verifies every embedded predecessor instruction, +and checks exact HEADER/DATA read, write and movement counts, all origins, +private retirement and opaque exteriors. The same physical Tape objects are +kept across a longer/shorter/regrowing chain. The shorter call has the exact +same instruction count as its fresh counterpart, with old history retained. + +Controls omit the real/imaginary factor, interchange collapsed prefix/suffix +descriptors while preserving total volume, and omit descriptor retirement. +The wrong-axis control runs past the descriptor check and fails the source +coordinate output oracle. Separate malformed-header, short-DATA and extra-DATA +cases reject with unchanged public contents. Source binding changes offset 1 +to bit 8 and requires the independent full-kernel comparison to reject it. +Independent review and its exact receipt are recorded separately when ready. + +The predecessor row-reversal theorem already proves the complete-record map, +its translation corollary and cost. Its caller supplied collapsed binary +lengths. The serial monomial predecessor already provides literal descriptor +iteration for a different view ABI, while its numerical service remains +structured control. This contribution is the actual runtime descriptor +producer and fixed-graph composition on the current supplied five-Gamma ABI, +with source-specific axis/order binding and complete costs. It does not +claim a new reversal, tensor identity, numeral-conversion method or faster +monomial tariff. + +The five-Gamma/raw entry packet is still supplied. Production of this ABI +from the selected caller, its actual physical owner selector, conversion from +other component encodings, the source matrix G, remaining monomial factors, +recursive children, global stock and analytic recovery remain separate. +In particular the source owner number 415 binds which native operation +contains the factor; it does not identify the physical DATA tape of a full +selected compiler invocation. The theorem's same-owner statement begins at +its explicit DATA entry owner. + +All five selected assumptions remain retained: `native_all_columns`, +`owned_erasure`, `compiler`, `precision_tape`, and `analytic_recovery`. +The complete selected kappa remains 0.00363005817. This is one removed local +descriptor-production premise, not an unconditional multiplication theorem. + +Credit the selected #7000 source and its retained Clifford/native contributors; +the exact source-binding and packed ABI in the published B3 package; the +published C3 literal-row-reversal program and its classical two-stack lineage; +the prior literal phase's Gamma/unary helpers; and #7349's literal machine. +The retained references preserve their notices. Independent AI review does +not constitute human or proof-kernel acceptance. diff --git a/research/literal-source-affine-move/implementation/engines/reference/translation/reference/inputs/controller_reference.py b/research/literal-source-affine-move/implementation/engines/reference/translation/reference/inputs/controller_reference.py new file mode 100644 index 0000000000..3ab6d0361f --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/translation/reference/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-source-affine-move/implementation/engines/reference/translation/reference/reverse.py b/research/literal-source-affine-move/implementation/engines/reference/translation/reference/reverse.py new file mode 100644 index 0000000000..60fce51dd8 --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/translation/reference/reverse.py @@ -0,0 +1,207 @@ +"""Literal complete-record reversal from three encoded binary descriptors. + +Prepared for Jerry Chen / CubeJerry with substantial OpenAI assistance. +Apache-2.0. The two-stack algorithm is classical and already in 02-streams; +the unary/trace helper patterns come from the credited literal S_D package. +This zero-argument compiler emits one fixed local-symbol instruction graph. +""" +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 + +(PDESC, RDESC, BDESC, DATA, OUTPUT, PTR, RTR, BTR, DOUBLE, + HTRACE, GROUP, RECORD, DTRACE) = range(13) +PRIVATE = tuple(range(4, 13)) +BITS = ('0', ONE) + + +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 descriptor_step(a, descriptor): + a.op('write', HTRACE, ONE) + a.op('move', HTRACE, 1) + a.op('move', descriptor, 1) + + +def binary_descriptor(a, descriptor, target): + """A positive canonical MSB-first binary word to a unary guide.""" + k = fresh(a, 'binary') + a.op('read', descriptor, {ONE: k+'first'}) + a.mark(k+'first') + a.op('write', target, ONE) + descriptor_step(a, descriptor) + a.mark(k+'digit') + a.op('read', descriptor, {str(b): k+str(b) for b in (0, 1)} | + {BLANK: k+'done'}) + for bit in (0, 1): + a.mark(k+str(bit)) + unary_copy(a, target, DOUBLE, repeat=2, extra=bit) + clear(a, target) + unary_copy(a, DOUBLE, target, erase=True) + descriptor_step(a, descriptor) + a.op('goto', k+'digit') + a.mark(k+'done') + trace_return(a, descriptor, HTRACE) + + +def compile_reverse(): + """Compile once; no descriptor, shape, payload or origin argument.""" + a = Builder() + for tape in PRIVATE: + a.op('move', tape, -1) + a.op('write', tape, MARK) + a.op('move', tape, 1) + for descriptor, target in ((PDESC, PTR), (RDESC, RTR), (BDESC, BTR)): + binary_descriptor(a, descriptor, target) + a.mark('prefix') + a.op('read', PTR, {ONE: 'load_record', BLANK: 'finish'}) + a.mark('load_record') + a.op('read', RTR, {ONE: 'load_bit', BLANK: 'group_loaded'}) + a.mark('load_bit') + a.op('read', BTR, {ONE: 'read_bit', BLANK: 'record_loaded'}) + a.mark('read_bit') + a.op('read', DATA, {str(b): 'load'+str(b) for b in (0, 1)}) + for bit in ('0', ONE): + a.mark('load'+bit) + a.op('write', GROUP, bit) + a.op('move', GROUP, 1) + a.op('move', DATA, 1) + a.op('write', DTRACE, ONE) + a.op('move', DTRACE, 1) + a.op('move', BTR, 1) + a.op('goto', 'load_bit') + a.mark('record_loaded') + a.rewind(BTR, (ONE,)) + a.op('move', RTR, 1) + a.op('goto', 'load_record') + a.mark('group_loaded') + a.rewind(RTR, (ONE,)) + a.op('move', GROUP, -1) + a.mark('pop_record') + a.op('read', RTR, {ONE: 'pop_bit', BLANK: 'group_popped'}) + a.mark('pop_bit') + a.op('read', BTR, {ONE: 'pop_read', BLANK: 'record_popped'}) + a.mark('pop_read') + a.op('read', GROUP, {str(b): 'pop'+str(b) for b in (0, 1)}) + for bit in ('0', ONE): + a.mark('pop'+bit) + a.op('write', RECORD, bit) + a.op('move', RECORD, 1) + a.op('write', GROUP, BLANK) + a.op('move', GROUP, -1) + a.op('move', BTR, 1) + a.op('goto', 'pop_bit') + a.mark('record_popped') + a.rewind(BTR, (ONE,)) + a.op('move', RECORD, -1) + a.mark('emit_record') + a.op('read', RECORD, {str(b): 'emit'+str(b) for b in (0, 1)} | + {MARK: 'record_emitted'}) + for bit in ('0', ONE): + a.mark('emit'+bit) + a.op('write', OUTPUT, bit) + a.op('move', OUTPUT, 1) + a.op('write', RECORD, BLANK) + a.op('move', RECORD, -1) + a.op('goto', 'emit_record') + a.mark('record_emitted') + a.op('move', RECORD, 1) + a.op('move', RTR, 1) + a.op('goto', 'pop_record') + a.mark('group_popped') + a.op('read', GROUP, {MARK: 'prefix_done'}) + a.mark('prefix_done') + a.op('move', GROUP, 1) + a.rewind(RTR, (ONE,)) + a.op('move', PTR, 1) + a.op('goto', 'prefix') + a.mark('finish') + # Exact cardinality is derived from descriptor guides before DATA writes. + 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(PTR, (ONE,)) + for tape in (PTR, RTR, BTR): + clear(a, tape) + 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', DATA, {}) + return a.finish((BLANK, '0', ONE, MARK)) + diff --git a/research/literal-source-affine-move/implementation/engines/reference/translation/translate.py b/research/literal-source-affine-move/implementation/engines/reference/translation/translate.py new file mode 100644 index 0000000000..5e1149f8ab --- /dev/null +++ b/research/literal-source-affine-move/implementation/engines/reference/translation/translate.py @@ -0,0 +1,221 @@ +"""Literal descriptor production and selected post-matrix X_1 translation. + +Prepared for Jerry Chen / CubeJerry with substantial OpenAI assistance. +Apache-2.0. Gamma/unary patterns are credited to the retained native phase; +the complete-record permutation is the unchanged retained row-reversal graph. +All integer arithmetic below is fixed-table construction, never runtime work. +""" +from pathlib import Path +import hashlib +import importlib.util +import sys + +HERE = Path(__file__).resolve().parent +PINS = { + 'reference/reverse.py': '4b516d85baf3303db809bc1174394009b1fc71a8f7d17fb6c729ec8bb6aba245', + 'reference/inputs/controller_reference.py': 'e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73', +} +for path, expected in PINS.items(): + if hashlib.sha256((HERE / path).read_bytes()).hexdigest() != expected: + raise ValueError('frozen source bytes: ' + path) +spec = importlib.util.spec_from_file_location('translation_retained_reverse', HERE / 'reference/reverse.py') +REV = importlib.util.module_from_spec(spec) +sys.modules[spec.name] = REV +spec.loader.exec_module(REV) +Builder, BLANK, ONE, MARK = REV.Builder, REV.BLANK, REV.ONE, REV.MARK +clear, unary_copy, trace_return, fresh = REV.clear, REV.unary_copy, REV.trace_return, REV.fresh +BITS = ('0', ONE) + +HEADER, DATA, PDESC, RDESC, BDESC = range(5) +# The retained reversal's nine private ports become 5,...,13. +HTRACE, LENGTH, DOUBLE, F, COEFF, OUTER, SPECTATOR, WIDTH, PRODUCT, HALF, DIGITS = range(14, 25) +PRODUCER_PRIVATE = (PDESC, RDESC, BDESC) + tuple(range(14, 25)) +ALL_PRIVATE = tuple(range(2, 25)) +REVERSE_PORTS = (PDESC, RDESC, BDESC, DATA) + tuple(range(5, 14)) + + +def header_step(a): + a.op('write', HTRACE, ONE) + a.op('move', HTRACE, 1) + a.op('move', HEADER, 1) + + +def gamma(a, target): + """Retained five-Gamma decoding pattern on this fixed private inventory.""" + 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 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) + header_step(a) + a.op('move', LENGTH, -1) + a.op('goto', k+'tail') + a.mark(k+'done') + a.op('move', LENGTH, 1) + + +def power_descriptor(a): + """Write the canonical descriptor 1 followed by f zeroes, not unary 2^f.""" + a.op('write', RDESC, ONE) + a.op('move', RDESC, 1) + k = fresh(a, 'power') + a.mark(k) + a.op('read', F, {ONE: k+'bit', BLANK: k+'done'}) + a.mark(k+'bit') + a.op('write', RDESC, '0') + a.op('move', RDESC, 1) + a.op('move', F, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(F, (ONE,)) + a.rewind(RDESC, BITS) + + +def product_guide(a): + """Generate exactly 2*S*r*w unary marks by actual nested local scans.""" + k = fresh(a, 'product') + a.mark(k+'s') + a.op('read', SPECTATOR, {ONE: k+'r', BLANK: k+'done'}) + a.mark(k+'r') + a.op('read', COEFF, {ONE: k+'w', BLANK: k+'r_done'}) + a.mark(k+'w') + a.op('read', WIDTH, {ONE: k+'bit', BLANK: k+'w_done'}) + a.mark(k+'bit') + for _ in range(2): + a.op('write', PRODUCT, ONE) + a.op('move', PRODUCT, 1) + a.op('move', WIDTH, 1) + a.op('goto', k+'w') + a.mark(k+'w_done') + a.rewind(WIDTH, (ONE,)) + a.op('move', COEFF, 1) + a.op('goto', k+'r') + a.mark(k+'r_done') + a.rewind(COEFF, (ONE,)) + a.op('move', SPECTATOR, 1) + a.op('goto', k+'s') + a.mark(k+'done') + a.rewind(SPECTATOR, (ONE,)) + a.rewind(PRODUCT, (ONE,)) + + +def suffix_power(a): + """Multiply the PRODUCT guide by 2^(8f), in eight fixed doublings per mark.""" + k = fresh(a, 'suffix') + a.mark(k) + a.op('read', F, {ONE: k+'bit', BLANK: k+'done'}) + a.mark(k+'bit') + for _ in range(8): + unary_copy(a, PRODUCT, DOUBLE, repeat=2) + clear(a, PRODUCT) + unary_copy(a, DOUBLE, PRODUCT, erase=True) + a.op('move', F, 1) + a.op('goto', k) + a.mark(k+'done') + a.rewind(F, (ONE,)) + + +def unary_binary(a, source, destination): + """Consume positive unary n; emit canonical MSB-first binary n in O(n). + + source, HALF, DIGITS and destination are distinct guarded physical roles. + Every parity, quotient and termination choice is a local scanned branch. + """ + k = fresh(a, 'encode') + a.op('goto', k+'p0q0') + for phase, (current, quotient) in enumerate(((source, HALF), (HALF, source))): + for parity in (0, 1): + name = k+f'p{phase}q{parity}' + a.mark(name) + a.op('read', current, {ONE: name+'bit', BLANK: name+'done'}) + a.mark(name+'bit') + a.op('write', current, BLANK) + if parity: + a.op('write', quotient, ONE) + a.op('move', quotient, 1) + a.op('move', current, 1) + a.op('goto', k+f'p{phase}q{1-parity}') + a.mark(name+'done') + a.rewind(current, (BLANK,)) + a.rewind(quotient, (ONE,)) + a.op('write', DIGITS, str(parity)) + a.op('move', DIGITS, 1) + a.op('read', quotient, {ONE: k+f'p{1-phase}q0', BLANK: k+'emit_start'}) + a.mark(k+'emit_start') + a.op('move', DIGITS, -1) + a.mark(k+'emit') + a.op('read', DIGITS, {str(b): k+'emit'+str(b) for b in (0, 1)} | {MARK: k+'done'}) + for bit in (0, 1): + a.mark(k+'emit'+str(bit)) + a.op('write', destination, str(bit)) + a.op('move', destination, 1) + a.op('write', DIGITS, BLANK) + a.op('move', DIGITS, -1) + a.op('goto', k+'emit') + a.mark(k+'done') + a.op('move', DIGITS, 1) + a.rewind(destination, BITS) + + +def retained_reversal(a, after): + """Construction-only relabeling; every retained runtime instruction remains local.""" + code, alphabet = REV.compile_reverse() + if alphabet != (BLANK, '0', ONE, MARK): + raise ValueError('retained alphabet') + for pc, instruction in enumerate(code): + a.mark('reverse_'+str(pc)) + op, *args = instruction + if op == 'read': + a.op(op, REVERSE_PORTS[args[0]], {s: 'reverse_'+str(dst) for s, dst in args[1].items()}) + elif op in ('write', 'move'): + a.op(op, REVERSE_PORTS[args[0]], args[1]) + elif op == 'goto': + a.op(op, 'reverse_'+str(args[0])) + elif op == 'halt': + a.op('goto', after) + else: + raise ValueError('nonlocal retained opcode') + + +def compile_translation(): + """One fixed 25-tape program; no runtime integer or recipe argument.""" + a = Builder() + for tape in PRODUCER_PRIVATE: + a.op('move', tape, -1) + a.op('write', tape, MARK) + a.op('move', tape, 1) + for target in (F, COEFF, OUTER, SPECTATOR, WIDTH): + gamma(a, target) + trace_return(a, HEADER, HTRACE) + power_descriptor(a) + product_guide(a) + suffix_power(a) + unary_binary(a, OUTER, PDESC) + unary_binary(a, PRODUCT, BDESC) + retained_reversal(a, 'retire_descriptors') + a.mark('retire_descriptors') + for tape in PRODUCER_PRIVATE: + clear(a, tape, BITS) + for tape in PRODUCER_PRIVATE: + a.op('move', tape, -1) + a.op('write', tape, BLANK) + a.op('move', tape, 1) + a.op('halt') + return a.finish((BLANK, '0', ONE, MARK)) diff --git a/research/literal-source-affine-move/implementation/machine.py b/research/literal-source-affine-move/implementation/machine.py new file mode 100644 index 0000000000..fcd4ac01f0 --- /dev/null +++ b/research/literal-source-affine-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, first exchange slots0 and p using `(0<-0 xor p), + (p<-p xor0),(0<-0 xor p)`. +- For every other supported coordinate j, append `(j<-j xor p)`. + +The slot exchange sends e0 to ep. All following gates leave its p bit1 +and set exactly the other supported coordinates. Thus G e0=b. If p=0, +the initial exchange is absent. Every CNOT is an involution, so reversing +the word gives G^{-1}. If b0=1 the word has popcount(b)-1<=8 gates; if +b0=0 it has3+popcount(b)-1<=10. No minimality claim is made. + +Chronologically execute G^{-1}, X0, G. For one nine-bit column x this gives + +`G(G^{-1}x XOR e0) = x XOR G e0 = x XOR b`. + +The retained generic CNOT body applies its fixed slot pair to all matching +f columns in the unchanged nine-slot geometry. The retained X0 complements +every one of slot0's f bits. Therefore the same identity holds separately +on each actual column. Equivalently, every supported full slot is XORed +with2^f-1. All other native bits and complete P/S/coefficient/component +factors remain spectators. There is no address-space enlargement or +changed f header. + +Every component is a pure permutation of complete records and has scalar +phase exactly1. The construction changes no sign, Gaussian component, bit +order within a record or grid. It accepts the most-negative signed bit +pattern because it never negates an arithmetic value. In the source ket +convention `|x> -> i^q(x)|G_source x XOR b>`, this X_b is applied after the +source binary map; its coordinate bit i denotes output packed slot i. +This observation fixes the intended offset convention but does not bind a +complete source monomial or MOVE. + +## 4. Literal relocation, owner return and helper reuse + +The old first-slot translation remains the same1878-location graph. The +two fixed CNOT words use immutable rank2 `compile_word` and unchanged +generic `cnot_columns`. Word generation is an offline function of b; no +runtime branch reads b, chooses p, loads a matrix or computes a jump. +For b=1 the word is empty and both CNOT modules are omitted. Otherwise one +reverse word, one X0 body and one forward word execute, at most20 CNOTs. + +The outer transaction clones original DATA once to WORK and restores its +head with TRACE. Immutable `insert` maps component HEADER0 to original +HEADER, component DATA1 to WORK, and private t>=2 to t+2. Fixed PC labels +are relocated and successful halt becomes a one-step continuation goto. +Thus every runtime operation is read/write/unit move/goto/halt. The largest +component port is26 from the CNOT module, mapping to28;31 ports are retained +for compatibility with the shared native cohort. Unused ports stay blank. + +Each completed component preserves HEADER, returns its public factor DATA +to origin and clears private bodies/guards. Therefore the same private +owners can be reused by the next component. Module commits affect only +WORK. After all components succeed, one V-bit final copy commits on original +DATA, erases WORK and records/restores both heads. WORK/TRACE guards then +retire. No component can write original DATA through its relocated ports. +Structural checks confirm this before the final commit for15 mask templates. + +HOME uses the retained six-code split/return with native origins at +B-relative2, blank guard1 and permanent^ at0. Core ports map injectively +to3..33; GUIDE is34. On success unchanged header and transformed body are +repacked, all split copies erase, and all35 heads return to their B origins. +B1 scatters only after primitive return, to the same immutable HOME. This +is a supplied owned operand; the parked productive fixture is unchanged. + +## 5. Complete successful invoice and retained history + +Use the credited complete translation bound +`T_X<=4096(V+E5+1)<=4096(V+E+1)` and generic fixed-word bound +`T_G(k)<=1024 k f(V+1)+8192(V+E+1)`, including all descriptor acquisition, +full body/bit copying, actual arithmetic-free record routing, returns and +retirement. Let k<=10 be this b's fixed conjugator length. The complete +nonzero-offset sum, allowing two word envelopes even when k0, is + +`4096(V+E+1)+2048k f(V+1)+16384(V+E+1)+31V+27`. + +With f(V+1)<=2fV and V<=fV this is bounded by + +`(4096k+20511)fV+20480E+20507` +`<=61471fV+20480E+20507<=2^20(fV+E+1)`. + +The zero-offset transaction costs31V+27 and also fits. The full cutoff +syntax is charged by E and the HOME overhead. There are no unpaid supplied +reversal descriptors: X0 physically produces P,2^f and2Scw2^(8f), including +unary expansion, linear-time unary/binary conversion, complete record +reversal and descriptor retirement. No helper, outer copy or return is an +oracle callback or an unpriced recursive child. + +Incremental private visited backing is at most32(V+E+1) for X0, +64(V+E+1) per fixed binary word and8(V+E+1) for WORK/TRACE. Summing rather +than refunding completed factors gives168(V+E+1)<256(V+E+1). The identity +uses only the outer increment. HOME adds64(F+1), giving the stated320(F+1) +envelope. Fixed setup/program storage and B1 full-bank delivery remain +separate charges. K_entry retains every older visited region and opaque +owner allocation. Shorter successful calls reuse erased current bodies +without refunding previous maxima. Changed origins require actual interval +unions and paid transport corridors. + +This is a direct O_b(fV+E) routine. It does not inherit the faster selected +nonleaf monomial tariff, establish amortization in a full recurrence, bind +the source recipe/owner, or supply a producer of the Gamma6 ABI. + +## 6. Evidence and exact limitations + +The algebra checker independently evaluates every nonzero b on all512 +addresses:261632 conjugation/inverse pairs, all512 masks including identity, +and an actual maximum conjugator length10. It does not compile512 large +graphs for code-coverage credit. Fifteen emitted mask templates, including +every single coordinate, identity, full511 and maximum-word510, pass port, +PC, unit-move and no-early-original-write checks. + +Five complete retained-X0 runs use five-field prefix length11 and Gamma6 +cutoffs with bit lengths1,2,64,513,4097. A read observer records HEADER +read offsets exactly0..10 and head maximum11 in every run; no HEADER write +occurs. All five take exactly681487 steps, return the expected complete +8192-bit raw permutation and restore all25 heads/private bodies/exteriors. +These observers never affect execution control. + +The full-offset511 packet uses all512 addresses with distinct10-bit real +labels and imaginary labels including the minimum signed value. Its10240 +DATA bits return against direct address-XOR oracle in13648484 transitions, +with10252 final HOME writes only after complete primitive return. A mixed +far-slot b264 packet exercises slots3 and8 plus two outer rows, three +spectators and two Gaussian coefficients. It returns36864 DATA bits in +28973166 transitions with37004 final HOME writes. Identity and smaller +same-owner reuse also pass; earlier guide history remains charged. All35 +heads/private bodies/guards/exteriors restore on successful complete runs. + +Actual graph mutants remove the last conjugator gate (returning offset255 +instead of511), or reorder the block as G^{-1},G,X0 (returning offset1). +Both complete cleanly but fail the correct XOR oracle. A changed retained +translation source byte rejects at authentication. Normal and optimized +author replays compare exact receipts. These are finite evidence; the +all-size result uses the preceding invariants and inherited helper proofs. + +No full large-f DATA execution is claimed here; the original first-slot +predecessor already includes a complete f2 fixture, credited as inherited +evidence. No generic source monomial dispatcher, all-MOVE implementation, +full owned lifetime, caller admission, selected rate, assumption discharge +or new kappa follows from this isolated bit-permutation interface. diff --git a/research/literal-source-affine-move/implementation/reference/affine-SOURCES.json b/research/literal-source-affine-move/implementation/reference/affine-SOURCES.json new file mode 100644 index 0000000000..425edf16d6 --- /dev/null +++ b/research/literal-source-affine-move/implementation/reference/affine-SOURCES.json @@ -0,0 +1,182 @@ +{ + "canonical_main": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "local": "reference/rank2/rank2.py", + "bytes": 8253, + "sha256": "3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a", + "parent_local": "rank2.py" + }, + { + "local": "reference/rank2/SOURCES.json", + "bytes": 10337, + "sha256": "659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641", + "parent_local": "SOURCES.json" + }, + { + "local": "reference/rank2/RECIPE.json", + "bytes": 4468, + "sha256": "b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702", + "parent_local": "RECIPE.json" + }, + { + "local": "reference/rank2/reference/linear/linear.py", + "bytes": 13102, + "sha256": "d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33", + "parent_local": "reference/linear/linear.py" + }, + { + "local": "reference/rank2/reference/linear/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "parent_local": "reference/linear/inputs/controller_reference.py" + }, + { + "local": "reference/rank2/reference/linear/NOTICE.md", + "bytes": 2180, + "sha256": "2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50", + "parent_local": "reference/linear/NOTICE.md" + }, + { + "local": "reference/rank2/reference/phase/phase.py", + "bytes": 11734, + "sha256": "2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7", + "parent_local": "reference/phase/phase.py" + }, + { + "local": "reference/rank2/reference/phase/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "parent_local": "reference/phase/inputs/controller_reference.py" + }, + { + "local": "reference/rank2/reference/phase/NOTICE", + "bytes": 808, + "sha256": "5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0", + "parent_local": "reference/phase/NOTICE" + }, + { + "local": "reference/rank2/reference/leaf/leaf.py", + "bytes": 17526, + "sha256": "bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744", + "parent_local": "reference/leaf/leaf.py" + }, + { + "local": "reference/rank2/reference/leaf/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "parent_local": "reference/leaf/inputs/controller_reference.py" + }, + { + "local": "reference/rank2/reference/leaf/NOTICE.md", + "bytes": 1900, + "sha256": "773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf", + "parent_local": "reference/leaf/NOTICE.md" + }, + { + "local": "reference/rank2/reference/source/clifford_exact.py", + "bytes": 6824, + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "parent_local": "reference/source/clifford_exact.py" + }, + { + "local": "reference/rank2/reference/source/native_verify.py", + "bytes": 12323, + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38", + "parent_local": "reference/source/native_verify.py" + }, + { + "local": "reference/rank2/reference/home/tape_graph.py", + "bytes": 12069, + "sha256": "7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54", + "parent_local": "reference/home/tape_graph.py" + }, + { + "local": "reference/rank2/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee", + "parent_local": "machine.py" + }, + { + "local": "reference/rank2/reference/home/parent_adapter.py", + "bytes": 5353, + "sha256": "04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099", + "parent_local": "reference/home/parent_adapter.py" + }, + { + "local": "reference/rank2/reference/home/NOTICE.md", + "bytes": 2093, + "sha256": "b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842", + "parent_local": "reference/home/NOTICE.md" + }, + { + "local": "machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee", + "parent_local": "machine.py" + }, + { + "local": "reference/rank2/PROOF.md", + "bytes": 16634, + "sha256": "93e1ad8a92c3624df064e4f39119ccbb5c96391ea8dd5f7af58edc7ca9638352", + "parent_local": "PROOF.md", + "role": "frozen parent proof/manifest" + }, + { + "local": "reference/rank2/FREEZE.json", + "bytes": 5633, + "sha256": "072dfea997d4db796d492eaf746e0bd99630964741b88862d0f10f5fc1e00275", + "parent_local": "FREEZE.json", + "role": "frozen parent proof/manifest" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "1dbdaa414cfe4a4a0f015e88a04b52e146566786", + "path": "research/native-translation-descriptor/translate.py", + "local": "reference/translation/translate.py", + "bytes": 7703, + "sha256": "e2750fef8c2b9c8019d67285df3ca0d04340cd241782c7845665b7de621ca3bd", + "blob": "5e1149f8ab45e0d5b4ecd963674ff8659d7f014b" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "1dbdaa414cfe4a4a0f015e88a04b52e146566786", + "path": "research/native-translation-descriptor/reference/reverse.py", + "local": "reference/translation/reference/reverse.py", + "bytes": 6649, + "sha256": "4b516d85baf3303db809bc1174394009b1fc71a8f7d17fb6c729ec8bb6aba245", + "blob": "60fce51dd8c3336e2bcf2873df254190e2203e14" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "1dbdaa414cfe4a4a0f015e88a04b52e146566786", + "path": "research/native-translation-descriptor/reference/inputs/controller_reference.py", + "local": "reference/translation/reference/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "blob": "3ab6d0361f35038ffcdf0cf81a157f7a17b40e72" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "1dbdaa414cfe4a4a0f015e88a04b52e146566786", + "path": "research/native-translation-descriptor/NOTICE.md", + "local": "reference/translation/NOTICE.md", + "bytes": 1201, + "sha256": "24f5e9957fcd8f6cfdc021ff5bc91bf89e50587997e2a2cb18053949c0e0d205", + "blob": "903e332da2844843fbb1ad716b6d470f175e8de9" + }, + { + "repository": "CubeJerry/integer-mult-bounds", + "commit": "1dbdaa414cfe4a4a0f015e88a04b52e146566786", + "path": "research/native-translation-descriptor/PROOF.md", + "local": "reference/translation/PROOF.md", + "bytes": 19690, + "sha256": "6b76d348203aed15cbc30d104c59571111ccf6cb7bb4592936e9170f736b68e0", + "blob": "5c6325471aaed465737491870443f063c821b7a0" + } + ], + "parent_rank2_freeze_sha256": "072dfea997d4db796d492eaf746e0bd99630964741b88862d0f10f5fc1e00275", + "translation_head": "1dbdaa414cfe4a4a0f015e88a04b52e146566786", + "translation_proof_blob": "5c6325471aaed465737491870443f063c821b7a0", + "translation_proof_path": "research/native-translation-descriptor/PROOF.md" +} diff --git a/research/literal-source-affine-move/implementation/reference/central-FREEZE.json b/research/literal-source-affine-move/implementation/reference/central-FREEZE.json new file mode 100644 index 0000000000..b440dc0dec --- /dev/null +++ b/research/literal-source-affine-move/implementation/reference/central-FREEZE.json @@ -0,0 +1,191 @@ +{ + "status": "FROZEN", + "utc": "2026-11-13 13:30 UTC", + "canonical_main": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "CHECKPOINT.md", + "bytes": 1877, + "sha256": "ae52c89420cbc468543b35bb41a258a39359328e3686e2b845a6b65e21209baa" + }, + { + "path": "ENVIRONMENT.json", + "bytes": 468, + "sha256": "77869ff81b59231e03707b857a5b0336c3ea3561e3894dc7e8132a6a12549c7b" + }, + { + "path": "NOTICE.md", + "bytes": 1756, + "sha256": "4b90ab2e285248e040eb497a518c91de76075bee805a44d7f864483a5fa0a940" + }, + { + "path": "OVERLAP.md", + "bytes": 2859, + "sha256": "d25f870593857f4355838107b9e474190098d06f57dc658403f07e6643d4271c" + }, + { + "path": "PR-DESCRIPTION.md", + "bytes": 2398, + "sha256": "794daab8467df555f4891249d664487210137434d408ce11566efc3a2dab5885" + }, + { + "path": "PROOF.md", + "bytes": 12196, + "sha256": "48899c607452daccd0998f4005ae2a6ed85a723969f474bf796496303ad4d4bb" + }, + { + "path": "README.md", + "bytes": 3479, + "sha256": "7317240902788d46180bf9fea949197b66853c462a5f81d6598b603d085a748c" + }, + { + "path": "RESULT.json", + "bytes": 28741, + "sha256": "95c830d899981e4bb56174d1eebeff72e55629170c55b1f045f990218b4f86a3" + }, + { + "path": "SOURCE-BINDING.json", + "bytes": 1772, + "sha256": "ce90103e2981238badcb8adba444808c785af91ca4092b3390abdc989de03232" + }, + { + "path": "SOURCES.json", + "bytes": 5445, + "sha256": "496948cd8d2b5134ceed6b48b870be73f6415b5f70e97ab35b744ded5a2a3c03" + }, + { + "path": "adapter.py", + "bytes": 4845, + "sha256": "e7247705c4440b09b71a4a460fc169fc29e1bfbe36de2320ee3a09c9582c8534" + }, + { + "path": "bind_sources.py", + "bytes": 2850, + "sha256": "c4613ea17767bf8e82251d36cea9023b1436dc6e602c9378e456652598e816b6" + }, + { + "path": "join.py", + "bytes": 6778, + "sha256": "971080f6254cfaf44b01a412533818ffdff78ea925452c76a02524092b3ccff6" + }, + { + "path": "machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee" + }, + { + "path": "reference/pr6978-PROOF.md", + "bytes": 20312, + "sha256": "2943afc32745929374e8e55daff82b5fa78baa8a557d82b231d04b936c63c10d" + }, + { + "path": "reference/rank2/FREEZE.json", + "bytes": 5633, + "sha256": "072dfea997d4db796d492eaf746e0bd99630964741b88862d0f10f5fc1e00275" + }, + { + "path": "reference/rank2/PROOF.md", + "bytes": 16634, + "sha256": "93e1ad8a92c3624df064e4f39119ccbb5c96391ea8dd5f7af58edc7ca9638352" + }, + { + "path": "reference/rank2/RECIPE.json", + "bytes": 4468, + "sha256": "b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702" + }, + { + "path": "reference/rank2/SOURCES.json", + "bytes": 10337, + "sha256": "659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641" + }, + { + "path": "reference/rank2/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee" + }, + { + "path": "reference/rank2/rank2.py", + "bytes": 8253, + "sha256": "3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a" + }, + { + "path": "reference/rank2/reference/home/NOTICE.md", + "bytes": 2093, + "sha256": "b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842" + }, + { + "path": "reference/rank2/reference/home/parent_adapter.py", + "bytes": 5353, + "sha256": "04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099" + }, + { + "path": "reference/rank2/reference/home/tape_graph.py", + "bytes": 12069, + "sha256": "7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54" + }, + { + "path": "reference/rank2/reference/leaf/NOTICE.md", + "bytes": 1900, + "sha256": "773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf" + }, + { + "path": "reference/rank2/reference/leaf/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "reference/rank2/reference/leaf/leaf.py", + "bytes": 17526, + "sha256": "bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744" + }, + { + "path": "reference/rank2/reference/linear/NOTICE.md", + "bytes": 2180, + "sha256": "2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50" + }, + { + "path": "reference/rank2/reference/linear/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "reference/rank2/reference/linear/linear.py", + "bytes": 13102, + "sha256": "d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33" + }, + { + "path": "reference/rank2/reference/phase/NOTICE", + "bytes": 808, + "sha256": "5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0" + }, + { + "path": "reference/rank2/reference/phase/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "reference/rank2/reference/phase/phase.py", + "bytes": 11734, + "sha256": "2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7" + }, + { + "path": "reference/rank2/reference/source/clifford_exact.py", + "bytes": 6824, + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "reference/rank2/reference/source/native_verify.py", + "bytes": 12323, + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38" + }, + { + "path": "verify.py", + "bytes": 9469, + "sha256": "b83d5cc25712b08c67061de8262d2abe7c5872387ceb62b202b8207c9b117471" + } + ], + "excluded_generated_paths": [], + "known_defects": [], + "independent_review": "parent proof/microcount inspected; separate numerical/routing review pending", + "scope": "fixed-rank1..9 positive central Gamma6/HOME direct leaf; no monomial/source-MOVE/caller/nonleaf admission" +} diff --git a/research/literal-source-affine-move/implementation/reference/central-PROOF.md b/research/literal-source-affine-move/implementation/reference/central-PROOF.md new file mode 100644 index 0000000000..3aa9caacf0 --- /dev/null +++ b/research/literal-source-affine-move/implementation/reference/central-PROOF.md @@ -0,0 +1,219 @@ +# Literal fixed-rank positive central join + +## 1. Prior result, exact boundary and claim + +Canonical context is `e54523517d0f03e58352e647c403a5af3e525a57`. +PR #6978 at `12e58dfdad9371a26f9978c814779da344fd80b4`, retained canonically +as `research/current-coded-all-source-leaf/PROOF.md` (Git blob +`5d619cfc2d3b7bc51e6fcc8e7a46ecd1e313e23d`), already proves positive rank-rf +geometry, joint cutoff, exact phase and source-family equality in its23-value +coded ABI. Its388-port child and provider-relative whole MOVE retain the +ordinary-facing monomial premises. Section7 item3 explicitly leaves literal +numerical lifecycle export open. `selected-native-tensor-closure` already +proves the all-column selected algebra and excludes the physical dispatcher +and owned reset. No such algebra is claimed new here. + +Fix construction-time native rank `rho` in1..9. It is not a decoded runtime +rank. Supply positive `f,c,P,S,cutoff`, width `w>=2`, and canonical header +`Gamma(f) Gamma(c) Gamma(P) Gamma(S) Gamma(w) Gamma(cutoff)` of full length E. +c is Gaussian coefficient multiplicity, distinct from rho. DATA is the +complete lexicographic array `[P] x [2^f]^9 x [S]`, with c coefficients at +each address, real then imaginary, each component signed w-bit MSB-first. +Thus `V=2 P S c 2^(9f) w`, `F=E+V`. Its common quantum is supplied and fixed. + +Require `rho*f<=cutoff`, and require every intermediate result of the actual +rho*f positive C axes to be Gaussian-integral on that grid and fit signed +w bits. Owners are distinct, heads start at origins, required private +bodies/guards are blank, and opaque exteriors/old backing remain separately +supplied. Malformed streams are outside this entry contract. + +**Theorem.** One emitted31-tape four-symbol local program per fixed rho +returns exactly `product_(slot0, the three-CNOT word +`(0<-0 xor i),(i<-i xor0),(0<-0 xor i)` exchanges slots0 and i. The +unchanged generic `cnot_columns(target,control)` applies each gate to all +corresponding f columns. Its inherited proof covers any distinct fixed +pair in0..8. The word sends (a,b) to (b,a), preserving other coordinates, +and has no Gaussian phase. Write this permutation Si. Exactly `Si C0 Si=Ci`. + +Chronologically the program executes joint guard,C0, then Si,C0,Si for +i=1..rho-1, then commit/retirement. The Ci act on disjoint bits and commute. +This is positive C on all rho*f requested axes, including the factor1/2 +and absolute phase. It is not projective equality. Every factor uses the +original header for full prefix/middle/suffix/component strides; all P/S, +c coefficients and inactive native bits remain complete spectators. The +all-f tensor statement follows from these individual coordinate operators, +not by tensor-powering a register scalar sum. + +## 3. Literal rank-times-f guard + +Let n be f's bit length, `q=ceil(log2(rho))`, with q=0 at rho1. Prefix FBIN +with q zero digits before the unchanged Gamma parser appends f's canonical +n MSB-first bits. The same parser retains original unary F and n marks on +FLEN. The public header is read-only throughout. + +Clear FLEN and scan FBIN from its low end. Fixed carry a in0..rho-1 on +digit b writes `(rho*b+a) mod2` and changes to `floor((rho*b+a)/2)`. +Induction on processed low digits proves multiplication. Every new carry +stays in0..rho-1. Since rho<=2^q and f<2^n, the product fits n+q positions. +The carry at the original left marker is therefore zero. A nonzero carry +there rejects; no left guard or opaque neighbor is overwritten/crossed. + +Skip/erase leading product zeros; copy the positive canonical suffix to +PREFIX while rebuilding FLEN and erasing old FBIN. Return FBIN across its +now blank body and move PREFIX back into it, erasing PREFIX. FBIN/FLEN now +hold canonical rho*f and its length at the original origins. The product +has n..n+q digits, so at most q leading zeros are skipped. Unary F remains f. +The loops are literal fixed-state operations; no host decoding occurs. + +Decode c,P,S,w using the inherited parser. Read cutoff only as binary +digits/length. The retained length-first and lexicographic comparison now +tests rho*f<=cutoff, clears its binary guides, and returns. Restore HEADER +with its trace; clear all other guides and local markers. In particular, +an arbitrarily large encoded cutoff is charged by E, never its numeric value. + +## 4. Transaction and inherited-helper invariants + +The core clones original DATA once to WORK and restores its original head +using TRACE. Immutable rank2 `insert` maps component HEADER port0 to original +HEADER, component DATA port1 to WORK, and private t>=2 to t+2. Program +counters get disjoint fixed labels and successful halts become local gotos +to the next component. Every emitted operation is read/write/unit move/goto +or halt. Leaf port28 maps to30, so31 tapes suffice independently of rho/f. + +On successful return the new guard leaves module scratch blank at origins. +Each inherited leaf and swap word has the same invariant: original HEADER +and its DATA at their origins, module-private bodies/guards erased, opaque +exterior preserved. All components can therefore reuse the same27 private +owners. Their commits affect only WORK. No owner is created per column/slot. + +After every requested axis succeeds, one V-bit final commit writes original +DATA, erases WORK and records/restores heads. WORK/TRACE markers retire. +This is the frozen rank2 outer transaction. The table checker independently +confirms no original DATA WRITE before the final commit in all nine graphs. + +HOME splits exactly six Gamma codes and complete DATA onto native private +tapes at B-relative2, retaining a blank guard at1 and permanent^ at0. Ports +map injectively to3..33; GUIDE is34. On success header/data copy back to +the complete operand, split copies erase and all35 heads return to B origins. +B1 scatters exactly F bits to the same immutable HOME. The parked fixture +is preserved; the owned field gains no productive credit. Typed creation, +placement, later scalar services and full caller remain outside the module. + +## 5. Exact numerical promises + +Permutations preserve every signed component, including its minimum. The +concrete leaf uses w+2-bit temporary numerator rows and actual exact-half +and signed-range guards. Invoke that proved domain at every C stage: +intermediate integrality/fit, not merely final fit. No scale, widened header, +rounding, precision producer or promise checker is supplied here. + +One elementary sufficient reserve is that original components are divisible +by2^(rho*f), bounded by M, and `2^(rho*f) M <= 2^(w-1)-1`. A C row is a +four-term signed sum divided by2: each axis spends at most one divisibility +bit and grows component maximum by at most2. Induction proves all prefix +promises. The exact admitted domain is larger. This reserve is not a new +norm theorem or an assertion about an actual selected producer. + +## 6. Complete direct-leaf bill and historical backing + +All local reads/writes/unit moves/gotos/halts cost one. Let +`Z=f+c+P+S+w<=5V`. Inherited Gamma conversions, trace work and final clears +have the same envelopes as the frozen rank2 proof. The new multiplication, +including its q leading writes, clear, forward/backward scans, canonical +copy/length, move-back and every rewind, costs at most64(n+q+1). For example +expanding the loops gives at most43n+38q+27. Padding also lengthens Gamma's +final captured-FBIN rewind by3q transitions. Charging that explicitly gives +43n+41q+27, still below64(n+q+1). Since n<=E,q<=4 this fits128(E+1). +The total guard fits1024(E+Z+1), below the reserved +**65536(V+E+1)**. Its visited increment is below6V+10E+100, hence below +64(V+E+1) on this positive nine-slot domain; the extra product prefix is +at most E+4 cells and no opaque boundary is traversed. + +Complete inherited bounds, including descriptors, cloning/commit, seeks, +arithmetic and retirement, are + +`T_G(k)<=1024 k f(V+1)+8192(V+E+1)`, +`T_C<=65536(fV+E+1)`. + +There are rho leaves and2(rho-1) swap words of k=3. The outer transaction +costs31V+27. Adding everything gives + +`65536(V+E+1)+65536rho(fV+E+1)` +` +6144(rho-1)f(V+1)+16384(rho-1)(V+E+1)+31V+27`. + +Using f(V+1)<=2fV and V<=fV gives + +`(94208rho+36895)fV+(81920rho+49152)E+(81920rho+49179)`. + +At rho<=9 the coefficients are bounded by884767,786432,786459. The +registered2^24 envelope covers them separately. No child, swap, conversion, +return, full-body copy or helper retirement is paid implicitly. + +Guard and every leaf/word each have64(V+E+1) incremental visited backing; +WORK/TRACE adds8(V+E+1). Sum increments rather than refund retired factors: + +`[64+64rho+128(rho-1)+8](V+E+1)` +`=(192rho-56)(V+E+1)<=1672(V+E+1)<2048(V+E+1)`. + +Older history remains in K_entry. Smaller successful calls at fixed origins +can reuse blank bodies while retaining old maxima. Changed origins require +actual interval unions and paid corridors. Adapter128(F+1)/64(F+1), B1 +full-bank work and fixed setup/program storage remain separately charged. + +This is direct O_r(fV+E). At a genuinely fixed active-axis cutoff q, +rho*f<=q makes it O_q(F+1), while full E stays charged. No faster selected +nonleaf monomial tariff follows and the prior serial-column gate is intact. + +## 7. Evidence and remaining interface + +All nine tables are checked for alphabet, port/PC bounds, unit moves and +no early original DATA write. There are233 physical guard cases: ranks1..9, +f=1,2,3,5,16,65,129, cutoff immediately below/at/above rho*f when positive, +plus64/258/513/1025/4097-bit cutoff syntax at signed distinct origins. These +are header tests, not full large-f DATA runs. Every success restores all +guard private bytes/heads and preserves original header/exteriors. + +A complete f1,rho3 dense nonzero Gaussian packet spans all512 addresses. +The oracle applies the C formula directly to actual slot bits, without +simulating the emitted swaps. Exact output returns in13663028 steps, with +8206 HOME writes only after complete primitive return. All35 heads, private +bodies/guards/exteriors restore. An actually executed omitted-third-C graph +returns a different rank-two tensor answer. The legal-format cutoff f1,t2 +rejects in189419 steps with zero public writes; a weak old-f guard physically +accepts its header. An actually changed retained leaf byte fails source +authentication. Normal and optimized replay are required. + +This is a central primitive, not a complete MOVE. Surrounding arbitrary +affine translations, linear/quadratic/global phases, binary maps, exact +source/frame orientation, ownership, grid producers, nonleaf rates and +caller placement remain. No all-source MOVE family, recursive substitution, +owned lifetime or foundational assumption is discharged by this package. diff --git a/research/literal-source-affine-move/implementation/reference/central-SOURCES.json b/research/literal-source-affine-move/implementation/reference/central-SOURCES.json new file mode 100644 index 0000000000..0cf874beeb --- /dev/null +++ b/research/literal-source-affine-move/implementation/reference/central-SOURCES.json @@ -0,0 +1,143 @@ +{ + "canonical_main": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "local": "reference/rank2/rank2.py", + "bytes": 8253, + "sha256": "3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a", + "parent_local": "rank2.py" + }, + { + "local": "reference/rank2/SOURCES.json", + "bytes": 10337, + "sha256": "659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641", + "parent_local": "SOURCES.json" + }, + { + "local": "reference/rank2/RECIPE.json", + "bytes": 4468, + "sha256": "b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702", + "parent_local": "RECIPE.json" + }, + { + "local": "reference/rank2/reference/linear/linear.py", + "bytes": 13102, + "sha256": "d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33", + "parent_local": "reference/linear/linear.py" + }, + { + "local": "reference/rank2/reference/linear/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "parent_local": "reference/linear/inputs/controller_reference.py" + }, + { + "local": "reference/rank2/reference/linear/NOTICE.md", + "bytes": 2180, + "sha256": "2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50", + "parent_local": "reference/linear/NOTICE.md" + }, + { + "local": "reference/rank2/reference/phase/phase.py", + "bytes": 11734, + "sha256": "2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7", + "parent_local": "reference/phase/phase.py" + }, + { + "local": "reference/rank2/reference/phase/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "parent_local": "reference/phase/inputs/controller_reference.py" + }, + { + "local": "reference/rank2/reference/phase/NOTICE", + "bytes": 808, + "sha256": "5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0", + "parent_local": "reference/phase/NOTICE" + }, + { + "local": "reference/rank2/reference/leaf/leaf.py", + "bytes": 17526, + "sha256": "bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744", + "parent_local": "reference/leaf/leaf.py" + }, + { + "local": "reference/rank2/reference/leaf/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73", + "parent_local": "reference/leaf/inputs/controller_reference.py" + }, + { + "local": "reference/rank2/reference/leaf/NOTICE.md", + "bytes": 1900, + "sha256": "773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf", + "parent_local": "reference/leaf/NOTICE.md" + }, + { + "local": "reference/rank2/reference/source/clifford_exact.py", + "bytes": 6824, + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "parent_local": "reference/source/clifford_exact.py" + }, + { + "local": "reference/rank2/reference/source/native_verify.py", + "bytes": 12323, + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38", + "parent_local": "reference/source/native_verify.py" + }, + { + "local": "reference/rank2/reference/home/tape_graph.py", + "bytes": 12069, + "sha256": "7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54", + "parent_local": "reference/home/tape_graph.py" + }, + { + "local": "reference/rank2/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee", + "parent_local": "machine.py" + }, + { + "local": "reference/rank2/reference/home/parent_adapter.py", + "bytes": 5353, + "sha256": "04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099", + "parent_local": "reference/home/parent_adapter.py" + }, + { + "local": "reference/rank2/reference/home/NOTICE.md", + "bytes": 2093, + "sha256": "b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842", + "parent_local": "reference/home/NOTICE.md" + }, + { + "local": "machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee", + "parent_local": "machine.py" + }, + { + "local": "reference/rank2/PROOF.md", + "bytes": 16634, + "sha256": "93e1ad8a92c3624df064e4f39119ccbb5c96391ea8dd5f7af58edc7ca9638352", + "parent_local": "PROOF.md", + "role": "frozen parent proof/manifest" + }, + { + "local": "reference/rank2/FREEZE.json", + "bytes": 5633, + "sha256": "072dfea997d4db796d492eaf746e0bd99630964741b88862d0f10f5fc1e00275", + "parent_local": "FREEZE.json", + "role": "frozen parent proof/manifest" + } + ], + "prior_proof": { + "repository": "CrocSwap/integer-mult-bounds", + "commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "path": "research/current-coded-all-source-leaf/PROOF.md", + "blob": "5d619cfc2d3b7bc51e6fcc8e7a46ecd1e313e23d", + "sha256": "2943afc32745929374e8e55daff82b5fa78baa8a557d82b231d04b936c63c10d", + "local": "reference/pr6978-PROOF.md" + }, + "pr6978_head": "12e58dfdad9371a26f9978c814779da344fd80b4", + "parent_rank2_freeze_sha256": "072dfea997d4db796d492eaf746e0bd99630964741b88862d0f10f5fc1e00275" +} diff --git a/research/literal-source-affine-move/implementation/reference/prefix-bridge/INDEPENDENT-REVIEW.md b/research/literal-source-affine-move/implementation/reference/prefix-bridge/INDEPENDENT-REVIEW.md new file mode 100644 index 0000000000..73042bd7ae --- /dev/null +++ b/research/literal-source-affine-move/implementation/reference/prefix-bridge/INDEPENDENT-REVIEW.md @@ -0,0 +1,42 @@ +# Cross-review: common-grid prefix bridge + +## Pins and conclusion + +Canonical base: `e54523517d0f03e58352e647c403a5af3e525a57`. + +- Retained premise: `docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md`, Git blob `3dd1af2285e597676725e85ad4f65e7ad326d695`, SHA-256 `4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055`. +- Reviewed application: `root-work/common-grid-prefix-bridge/PROOF-DRAFT.md` (local proposal; no external source substituted). + +**Conclusion: the complete-prefix closure argument is valid under its retained full-root hypotheses.** No new precision theorem or actual producer theorem follows. One partial-memory sentence should be read narrowly, as specified below. + +## Why the closure is licensed by #7000 §5 + +The retained §5 ideal row has the form + +`y = sum_nu c_nu U_nu x_nu`, + +where each `U_nu` acts on the same complete `D`-bit root factor and has the retained Gaussian-dyadic Clifford form. Its numerator-grid and component-magnitude bounds are uniform over that Clifford class, for the source-specific coefficients, complete input rows and exterior unfinished-context debt fixed by the section. + +Let `V_j` be a completed mathematical prefix acting as one exact Clifford on an injectively selected subset of those same `D` root coordinates, with identity on every other root coordinate. Then + +`V_j y = sum_nu c_nu (V_j U_nu) x_nu`. + +The class is closed under multiplication. `V_j` changes neither `c_nu`, `x_nu`, the outer ROW fiber nor any exterior coefficient/context. The product still acts on the same complete root factor, so the uniform §5 estimate applies without adding a new per-gate denominator or magnitude debt. This includes an arbitrary fixed finite number of complete prefixes; no bound is obtained by multiplying a per-gate error term. + +The source operations cited in the draft fit this mathematical class: CNOT, affine X, S, CZ and Gaussian-unit phase are Clifford operations; the positive central matrix + +`C = 1/2 [[1+i,1-i],[1-i,1+i]] = H S H` + +is itself a Gaussian-dyadic Clifford. A coordinate reordering is allowed only if it is a bijective relabeling of the entire retained factor; projecting away a complementary root coordinate, mixing an external control into the root operation, or replacing the row by an arbitrary rational isometry would invalidate this application. + +Thus the assertion that each **completed exact C-prefix output** is on the retained grid and inside the same signed `W` range is redundant, conditional on the actual row already satisfying every #7000 §5 source-specific premise. + +## Partial-memory limit + +The theorem controls the complete vectors `V_j y`; it does not make a fine-grained physical instruction prefix a Clifford image. A buffer during an in-place scan may mix old and new addresses. The draft's “completed component values” statement is valid only when each cited value is a fully assembled numerical component already committed from either the preceding or next complete prefix. + +It does not cover partially written component words, add/divide accumulators, partially updated descriptor encodings, or any helper scratch. Those may lie outside the endpoint row invariant and must be bounded by the relevant literal helper and widened-scratch proofs. I recommend making “fully assembled and committed” explicit next to “at each position”; the later scratch caveat is necessary and must remain. + +## What remains conditional + +The bridge does not produce the row/view/header or prove that a particular selected source packet lies in the §5 admissible class. A valid actual producer must still establish the complete-root representation, common grid, source coefficients/debt, owner/header, cutoff and physical entry promises. Paid packing/unpacking, B1 routing, initialization/erasure, literal helper costs, history and nonleaf tariff remain separate. This is a premise-reuse lemma only; it proves no selected framework assumption by itself. diff --git a/research/literal-source-affine-move/implementation/reference/prefix-bridge/PROOF.md b/research/literal-source-affine-move/implementation/reference/prefix-bridge/PROOF.md new file mode 100644 index 0000000000..ad64bcc4d9 --- /dev/null +++ b/research/literal-source-affine-move/implementation/reference/prefix-bridge/PROOF.md @@ -0,0 +1,111 @@ +# A numerical prefix bridge from the retained complete-root invariant + +Status: reviewed conditional application lemma. This is not a +new precision theorem or a standalone publication. Exact canonical base is +`e54523517d0f03e58352e647c403a5af3e525a57`. The retained premise is section 5 of +`docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md`, Git blob +`3dd1af2285e597676725e85ad4f65e7ad326d695`, SHA256 +`4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055`. +Credit its common-grid induction, source constants and original authors. + +## The exact retained premise + +At one genuine external ROW fiber, keep the entire original selected D-bit +root factor, including completed remainders. The retained common-grid +induction represents an ideal row as + + y = sum_nu c_nu U_nu x_nu, + +where every U_nu is a Gaussian-dyadic Clifford on that same complete factor. +All source-specific coefficient, unfinished-context, height, mass, input-grid +and root-boundary premises of that induction are retained. In particular this +note does not replace those premises by merely bounding absolute coefficient +values, or admit arbitrary rational coefficients. For the admissible class, +uniformly over its Clifford factors, the established bounds are fractional +bits at most p+D and magnitude bits strictly below h+D+2. The selected format +is F=p+D, signed component width W=p+h+2D+3 and temporary width W+26. + +## Closure lemma + +Let V_j be any finite prefix of exact elementary Gaussian-dyadic Clifford +gates on an injectively selected subset of the D retained root bits, extended +by identity on the remaining root bits. For a row y satisfying the preceding +invariant, V_j y satisfies the same invariant with the same coefficients, +input rows, height/mass parameters and unfinished exterior-context debt. +Consequently every exact completed prefix V_j y is integral on the same +common grid and fits the same signed W-bit format. + +Proof: write + + V_j y = sum_nu c_nu (V_j U_nu) x_nu. + +The Gaussian-dyadic Clifford class is closed under multiplication. Extension +by identity and permutation of named root coordinates preserve that class. +No exterior coefficient changes, and no new unfinished *exterior algebraic* +context is opened by absorbing V_j into U_nu. Physical subroutine nesting is +not the numerical debt counted by that invariant. Apply its uniform grid and +magnitude bounds to the new Clifford factors. There is no sum of fresh +per-gate denominator debts here: the existing theorem bounds the complete +Clifford row on the same D-bit factor. This argument does not assume that the +partially completed primitive has returned its final answer. QED. + +## Application to the literal native joins + +Suppose an actual selected source occurrence already supplies an identified, +packed native view of such a row, on an injective set of 9f root coordinates. +The complementary root coordinates remain in S_native and are not projected +or forgotten; genuine external controls/ROW coordinates remain spectators. +The source-to-packed view is a coordinate reordering, not an arbitrary +isometry or a deletion of axes. + +Every complete fixed CNOT, affine X, linear S, quadratic CZ and constant +Gaussian-unit phase is a Clifford on those root coordinates. The central +C=(1/2)[[1+i,1-i],[1-i,1+i]] is H S H and is Gaussian-dyadic; each elementary +C on each column is therefore also in the class. Thus the closure lemma +applies at every mathematical C-prefix of the fixed-rho literal positive +service and of a source-bound monomial/positive/monomial join. The source +constant phase must still be lifted as i^(a f); numerical closure by itself +does not certify the correct source scalar or chronology. + +A physical scan can leave a mixture of old and new component positions before +the entire corresponding gate returns. Such a mixed buffer need not be a +Clifford image. That fact is not used: after a numerical component has been fully assembled and committed, its +mathematical value belongs either to the preceding full prefix or to the next +full prefix, both of which satisfy the same bounds. This does not bound a +partially written bit string, an unfinished accumulator, a descriptor or any +scratch representation. Whole-record copies and +permutations preserve those values; unit phases only exchange or negate real +and imaginary components. Temporary arithmetic and its widened scratch must +still satisfy the independently retained helper proofs and complete costs. +This note does not replace those physical proofs with the semantic closure. + +The resulting contract is conditional on an *actual row satisfying the +retained root invariant*, together with its correctly produced view/header, +owner, physical scratch, cutoff and all relevant helper promises. Under that +contract the separate assertion that every completed C-prefix is integral +and fits W is redundant: it follows from the retained numerical theorem. +An arbitrary W-bit body on grid 2^-F does not suffice. For example with F=1, +a one-hot numerator1 is on that grid but C produces half-integral numerators; +it need not arise from the required coarse-grid input/root-row class. + +## Remaining obligations and scope + +An actual producer/view bridge is still required. No header can be invented +from a successful isolated packet test. The cutoff rho*f<=cutoff remains a +separate source-controller obligation, as do paid packing/unpacking, B1 +routing, creation/erasure, inherited helper validity and full history. The +closure lemma establishes neither the selected faster nonleaf tariff nor any +complete multiplication bound. All five selected framework assumptions remain. + +The selected review already proves the uniform common-grid assertion. The +only proposed use here is to connect that assertion to the newly emitted +literal primitive's exact intermediate numerical contract, while separating +semantic prefix closure from physical mixed-buffer and scratch obligations. + +## Review record + +The independent algebra role checked the retained source and complete-prefix +closure, and requested the explicit partial-bit/scratch limitation above. Its +review is retained beside this note. Root accepted that correction. This is +disclosed AI review, not blind/human or formal-kernel verification. No new +precision theorem is claimed. diff --git a/research/literal-source-affine-move/implementation/reference/prefix-bridge/SOURCE-REVIEW.json b/research/literal-source-affine-move/implementation/reference/prefix-bridge/SOURCE-REVIEW.json new file mode 100644 index 0000000000..d4dc2a9e15 --- /dev/null +++ b/research/literal-source-affine-move/implementation/reference/prefix-bridge/SOURCE-REVIEW.json @@ -0,0 +1,22 @@ +{ + "canonical_main": "e54523517d0f03e58352e647c403a5af3e525a57", + "source_git_blob": "3dd1af2285e597676725e85ad4f65e7ad326d695", + "classification": "Conditional application of prior uniform common-grid theorem to literal complete Clifford prefixes; no new precision theorem", + "files": [ + { + "path": "PROOF.md", + "bytes": 6282, + "sha256": "84a30aeff471af36e182840b2c6605e0fdf8aa3a5d829c656b21d16df682f595" + }, + { + "path": "INDEPENDENT-REVIEW.md", + "bytes": 3970, + "sha256": "6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b" + }, + { + "path": "retained-selected-proof.md", + "bytes": 25533, + "sha256": "4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055" + } + ] +} diff --git a/research/literal-source-affine-move/implementation/reference/prefix-bridge/retained-selected-proof.md b/research/literal-source-affine-move/implementation/reference/prefix-bridge/retained-selected-proof.md new file mode 100644 index 0000000000..3dd1af2285 --- /dev/null +++ b/research/literal-source-affine-move/implementation/reference/prefix-bridge/retained-selected-proof.md @@ -0,0 +1,420 @@ +# Current-source conditional application of #7000 and #7001 + +This continuation applies the five assumptions of selected #6030 to Jerry +Chen / CubeJerry's #7000 (`93effe2a135bf57b9e484cb630d8dd057159aec9`) and +#7001 (`d777f3a0aa2878bea0478918923dabcf86b9878b`). It supplies the owner, +geometry, exact-scalar, root-boundary and finite-cost substitutions left open +by [the preceding review](../pr7000-admission/PROOF-REVIEW.md). +The claimed complex saving is **κ=.00363005817**. + +**Decision: admit κ=.00363005817 under the same five retained assumptions.** +All 18 required executions have completed: eleven source-bound receipts from +the preceding review and seven new executions. The complete native catalogue +parts pass in 222.34, 249.59 and 338.04 seconds; their peak sampled descendant +memory is below 60,000 KiB. Normal and optimized application/scalar checks pass. +The 600-second monolithic timeout is separately retained and contributes no +completed coverage. The source manifest, claim and replay driver bind this +decision to the exact construction and the 134-axis BIT repair. + +This is a conditional application theorem. The native/owned-storage, +compiler, fixed-tape movement and analytic/recovery assumptions are retained, +not proved here. No complete uniform word, literal multiplier execution, +independent human proof or formal-kernel proof is asserted. Execution status +and the admission decision are recorded in VALIDATION.json; prose does not +turn an unfinished check into a pass. + +## 1. Exact coverage and the admission standard + +The previous five registered replays, two supporting local checks and four +normal/optimized review checks are reused only at their recorded scientific +input hashes. They cover cold construction, scalar endpoints, current frame +and owned chronology, COPY into ideal zero, the complete formal caller, +paid/target invoices, independent rational interval inequalities and finite +512-component corroboration. Their original limits remain explicit. + +New `check_application.py` imports no contributor scientific code. It checks +the actual mixed caller's port/owner allocation and all 14,400 native boundary +contacts through degree-two phase polynomials modulo four; it also checks +636 rational BIT frames and 111 main charts. Its ordered job digests bind +117,612 complex and 107,352 BIT paid positions to their actual owners. +Aliased mains, wrong stages, singular spectator bases and omitted contact +translations are rejected. Normal and optimized runs agree. + +The candidate's chart-delta check covered 73 new maps; archive status did +not establish the remaining maps. `check_native_catalogue.py` therefore +checks the complete current union of paid and helper maps, including the +inherited ones, plus every main boundary pair. It uses the pinned Clifford +compiler and the distinct signed-Pauli/Gaussian-phase interpreter. Equal +signed Pauli action fixes a Clifford up to scalar; an exact Gaussian state +fixes that scalar, so this determines the full matrix, not a random sample. +The generic nested-frame factorization and its product lift then apply. +The 3,057-map catalogue is partitioned into the disjoint index intervals +[0,1000), [1000,2000), [2000,3057) of one authenticated sorted catalogue; +the final part also checks all 104 main-boundary pairs. An earlier monolithic +run reached its 600-second limit and is retained as a failed execution, not +reused as completed coverage. Each part repeats the global-phase fault control. + +The exact fixed-rational scalar reference is separate from those engines. +It exercises all 4,469 source/conversion coefficients on 100,148 signed +bit-state cases and rejects 4,149 nonexact division controls. The all-width +argument below follows from the finite carry/remainder invariants, not from +extrapolation of those finite tests. + +## 2. Complex local words and complete physical caller + +For a live field with frame U, write its physical value as +`T_U^(tensor f) z`, on all nine native slots and complete spectators. +Every MOVE applies the exact quotient of its two frames; every scalar +contact is between equal current frames. Consequently the source's exact +scalar endpoint is an identity on arbitrary full arrays at every f, with +the exterior rational coefficients unchanged. A nested quotient factors +as `L C_r R`; tensor the product to obtain one positive rank-rf child with +its two monomial adapters. Absolute phase `i^a` becomes `i^(af)`. +No tensor power is distributed over an ADD or a matrix sum. + +Every autonomous helper is normalized only around the whole completed +native invocation. Its two-sided factors need not be inverses. The new +splits retain their independently checked arbitrary-input cut identities. +There are 400 mains, 1,080 independent helpers and 51 owned native labels. +The 23 owned rises have the exact recipes checked in the preceding review; +the current word's peak is 43 and its 54 lifetimes are checked chronologically. +The retained completed-child rule permits correlated current owned contents; +it does not permit aliasing fields or resuming before complete return. + +For the caller use nine central axes and eighteen disjoint eight-axis stage +blocks, ambient **153**. For each actual odd central direction q, the source +provides an orthonormal basis `[q,b1,...,b8]`. At stage s the map R exchanges +the b directions with that stage's eight standard axes, fixes q and fixes +every other coordinate. The checker verifies its full inverse and spectators. + +Here is the absolute-phase test. Write `Γ(t)=product_v C_v^(t_v)`. +Its character phase is `sum_v t_v parity(v·x) mod4`. Expanding parity gives +linear coefficients and quadratic coefficients modulo four; there are no +higher terms. A residual is an ordinary translation exactly when all +quadratic coefficients vanish and all linear coefficients are even. The +checker computes these coefficients, installs the translation and verifies +both directions of each contact. These Γ frames are auxiliary expressions +for proving the intertwining identities; they are not extra uncharged +Fourier operations executed at the caller entrance. + +After the retained main-boundary monomials, the native endpoint is exactly + +``` +type A, first plane: D_s (x, y + Q^-1 x) +type A, second plane: D_s (u - Q v, v) +type B: D_s (x - Q y, (Q^-1 x + y)/2). +``` + +The second-plane native boundary frames equal the first-plane frames; the +four physical fields are nevertheless distinct. The checker binds all +18 invocations, 96 type-A ports and eight type-B ports. For every invocation, +400 main slots map injectively to the named current caller owners; all 1,080 +helpers have fresh `(invocation, native slot)` tags. No equality of frames +or values merges two owners. The complete raw unit has **23,392** productive +fields: 3,952 root fields and 19,440 helpers. + +Each native MOVE retains its actual position and owner. QUERY uses a separate +full scratch, copies by ADD, executes the signed positive rank-one child and +its adapters, adds the result and clears before proceeding. Its 416 uses +are paid. The 3,616 whole idles act on the union of their distinct selected +stage blocks and are paid once on that owner. The 14,480 global LAMBDA uses +have the ordinary translation-and-scalar lowering established previously; +they create no child or target. A single full query/normalizer bank can be +reused serially; conservatively reserve all 18·51 native banks separately. + +The checked caller identity is in `Q(i)[q,D1,...,D18]/(q^4-1)`, retaining +free body powers. The actual Q has order four, and the stage factors commute +on disjoint complete axes, so substitution is valid at every f. Each output +is a product of distinct stage factors and Q or Q^-1. The latter has the +exact ordinary correction Q². Thus every target is a positive whole job +with charged boundaries and complete spectators. The resulting complete +invoice agrees with the independently replayed P,T and has surplus 1,520. + +## 3. BIT frame, paired-call and delayed-cover application + +A BIT frame supplies rational row bases B for its selected space and A for +its annihilating complement. The new check verifies their dimensions, +annihilation and invertibility of `G=[B^T A^T]` for **all 636 frames**. +It therefore defines the rational projector +`P=G diag(I_dim,0) G^-1`. On the two complete address chunks, the partial +interchange has block matrix `[[I-P,P],[P,I-P]]`. For nested frames, +the projectors commute and their product is the smaller projector; their +interchange quotient is the interchange on the positive-rank difference. +Changing to a basis of that difference and back is precisely the retained +rational whole-job interface. Source XOR contacts commute with a common +current address permutation. The already replayed binary endpoint therefore +lifts to complete chunks and arbitrary payloads, with owned erasures retained. + +For each of the 111 main ports, `[u,B_body]` is an invertible rational basis +with one head and seven complementary body directions. At a stage, exchange +those seven basis directions with seven fresh stage coordinates, fixing u +and all external spectators. In this basis that map is a coordinate +involution; conjugating it gives the explicit rational map on actual fields. +It conjugates the body projector to the stage projector and fixes the head +projector. These equations prove the simultaneous main/body interface; +orthonormality of the seven rational body vectors is not needed. + +The paired caller executes two real native invocations at each stage on +disjoint main pairs. Each invocation receives its own 437 helpers and 237 +owned labels. The full allocation gives **19,950** distinct productive +fields, 107,352 paid positions, 8,532 conservatively reserved native banks +and one serial query bank, before compiler/primitive workspace. The four +queries and every whole idle are charged. Integral transfer occurs before +reduction modulo two; no fraction 1/2 is reduced in characteristic two. +The finite caller equality in `F2[q,D1,...,D18]/(q²-1)` consequently supplies +the stated completed positive outputs without empty-root credit. + +The complete working cap is **134**, as repaired previously. Rational native +maps and subsequent finite compiler matchers form a finite catalogue before +the cover prime is chosen. Choose q larger than the retained cover bound and +avoiding all denominators, nonzero determinants and fixed rank witnesses of +that entire catalogue. The checker's finite witness list concerns the raw +source only; it is not claimed to contain the later compiler's exclusions. +The delayed whole-cover theorem handles right routes `g -> gS` with fixed +rational S. It does not exclude q-dependent cover entries, discard nonunit +pivots without charging the bad classes, or permit weights depending on a +child's fresh cover/roles. External weights may depend on exposed ancestors. + +Use the repaired power 768, cutoff 15, floor 16, logarithm power 617, +`H_B=296630000000000`, and the two separate 10^-10 losses. The covered +saving is .0038525298. Freeze two ordinary backends in order: + +``` +.0034 -> .0038507 -> .00385248. +``` + +The first backend is the selected completed .0034 interface, including its +spectators, restored stock and radix boundary. Each subsequent algorithm +uses only its completed predecessor for ordinary maps/high-part exchanges, +with atom exponent ρ=1/250. Its source-bound cost is +`O(C V [e^(1-ρ) + e^((1-ρ)(1-covered)+ρ(1-previous)) + e^ρ log e])`. +The exact positive bootstrap gaps were checked previously. C is the new +finite constant, not one. Freeze each backend's threshold before using it +in the next step; smaller widths use the predecessor. This dependency is +acyclic and supplies the weaker .00376669 used by the complex outer ledger. + +Reserve the full input-dependent row stock with +`D_stock(e)=2+ceil(log_(N_B)(max(1,ceil(e/ceil(e^ρ)))))` and +`W(w)^D_stock(e) S_old`, as in the pinned delayed-cover proof. The high-digit +reserve is `O_fixed(w log e)`. Internal BIT recursion preserves the entire +external complex factor and restores its own borrowed stock. The fixed two +backend levels are not substituted for the input-dependent recursion depth. + +## 4. Exact fixed-rational scalar service + +Choose the per-native-call scale-1125 route, not the independently rounded +ADD implementation. Multiply each actual public entrance by S=1125, execute +the literal word, and divide each completed output by S. All 53,280 boundary +conversions are counted. The previously checked row and pre-product invariant +proves odd divisibility on the common grid described below. + +For a fixed reduced scalar a/b, multiply an unsigned magnitude bit stream +least-significant-bit first. Its state is carry c, and the transition on bit +u emits `(c+|a|u) mod2` and retains `floor((c+|a|u)/2)`. The carry remains +between 0 and |a|; append `bitlength(|a|)+1` zero bits. Reverse direction +for division by fixed positive b. From remainder r and bit u, form `2r+u`, +emit its comparison with b, and keep the remainder after subtracting b when +necessary. Here `0<=r=1, +integer logarithmic degree d0 and positive rational slack δ in the retained +outer bounds, choose an integer j beyond `4d0/δ` with +`C(j+1)^d0 <= 2^(δj)` and freeze the input threshold at least 2^j. Subsequent +ratios decrease, so the inequality holds thereafter. Choose j on a multiple +of δ's denominator to make this an integer comparison. Likewise the retained +record fiber `2^(Omega(p^(1-epsilon)))` eventually exceeds every new fixed +descriptor polynomial; choose the cutoff after its constants/degrees. +Take the maximum of these finitely many cutoffs, the scalar-fit boundary, +stock conditions and the primitive-family cutoffs. No input-dependent +algorithm or growing tape alphabet is introduced by this choice. + +## 7. Compiler funding and outer conclusion + +The independently checked complex invoice has tested price +`C=.00363005817007=κ+7g`, `g=10^-14`. Use product power 1920, cutoff 11, +completion floor 12, offset 1/7 and actual ambient `153^1920`. +The certified bounds give `alpha<1-10^-27`, `gamma,delta<31/32` and +`1/(1+1920·10^-27)+4(31/32)^1920<1`. The separated paid ceiling is below +the target floor. Whole-job completion and integer splitting retain all +their arrays, paid positions and fresh adapters. + +The ambient-cap proof supplies the source band `(N/A,N]` with A=153^1920; +no target of rank A is needed. Logarithm power 2228 and +`H_C=14174600000000000000` give the checked uniform saving `κ+6g`. +All 54 strict and four functional outer predicates pass; their minimum +positive margin is 10^-15. The completed BIT saving .00385248 supplies the +weaker .00376669 premise with ample positive margin. Section 6 changes finite +constants and eventual thresholds, leaving these rank and exponent inequalities +unchanged. The resulting conclusion is the conditional bound + +`T(n)=O(n (log n)^(1-.00363005817))`. + +The five assumptions are still native_all_columns, owned_erasure, compiler, +precision_tape and analytic_recovery. Local owned ascent, global LAMBDA, +mixed/shared native calls and exact odd division have explicit applications +within those assumptions above. The conclusion does not admit arbitrary +rounded providers, the old numerical tape-cost cap, or newer words with the +same headline/interface names. Any changed source needs its affected checks. + +## Attribution and open next questions + +CubeJerry supplied #7000/#7001 and the precision, owned-ascent, global-LAMBDA +and compiler-application work. DreamingOfClouds supplied the shared native, +two-chain and helper constructions; Ali Romman supplied the helper-basis +lineage. Retain zxv's rational BIT/native/compiler work, Jacob Alan Sussman's +mixed integer compiler, icekylinx/Dugongue's frame theory, Cinna Davis, +Matarener, Chris R/Clear1nsight and all unchanged NOTICE attributions. +The phase-polynomial route method and common-grid induction are credited +reuses; the current occurrence map, complete catalogue closure, exact-scalar +application and finite-cost/root-boundary substitutions are this review's work. +Prepared for Douglas Colkitt with substantial OpenAI Codex assistance, +Apache-2.0; no separate human or formal-kernel verification. + +Open next questions: implement the complete fixed-tape dispatcher rather than +its conditional grammar; tighten the deliberately loose scalar/route constants; +and transfer this application to later changed words using exact-source deltas. +Those questions do not turn an archived successor into an admitted result. diff --git a/research/literal-source-affine-move/implementation/select_source.py b/research/literal-source-affine-move/implementation/select_source.py new file mode 100644 index 0000000000..7d9f79635b --- /dev/null +++ b/research/literal-source-affine-move/implementation/select_source.py @@ -0,0 +1,48 @@ +"""Bounded source selection only; not another full selected recipe census.""" +from pathlib import Path +from hashlib import sha256 +import argparse +import atexit +import gzip +import importlib.util +import json +import subprocess +import sys +import tempfile + +HERE=Path(__file__).resolve().parent +_cache=tempfile.TemporaryDirectory(prefix='move-source-select-') +atexit.register(_cache.cleanup) +sys.dont_write_bytecode=True;sys.pycache_prefix=str(Path(_cache.name)/'absent') +if not __debug__:raise RuntimeError('canonical compiler selection requires normal mode') +parser=argparse.ArgumentParser();parser.add_argument('repo',type=Path);args=parser.parse_args() +repo=args.repo +raw=subprocess.check_output(['git','show','e54523517d0f03e58352e647c403a5af3e525a57:research/shared-wire-split-composition/data/final.json.gz'],cwd=repo) +if len(raw)!=350722 or sha256(raw).hexdigest()!='2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883': + raise ValueError('selected source archive drift') +word=json.loads(gzip.decompress(raw)) +path=HERE/'engines/reference/rank2/reference/source/clifford_exact.py' +source=path.read_bytes() +if sha256(source).hexdigest()!='2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962': + raise ValueError('canonical compiler bytes drift') +spec=importlib.util.spec_from_file_location('bounded_move_selector',path) +c=importlib.util.module_from_spec(spec);sys.modules[spec.name]=c;spec.loader.exec_module(c) +seen=set() +for index,event in enumerate(word['program']): + if event[0]!='MOVE':continue + pair=tuple(event[2:4]) + if pair in seen:continue + seen.add(pair);a,b=pair + recipe,_=c.lower_child(c.canonical_frame(9,tuple(word['frames'][a])).adjoint().then( + c.canonical_frame(9,tuple(word['frames'][b])))) + factors=(recipe['left'],recipe['right']) + if any(side['offset'].bit_count()>=2 and side['phase'] for side in factors): + out={'canonical_main':'e54523517d0f03e58352e647c403a5af3e525a57', + 'event_index':index,'event':event,'frames':{str(j):word['frames'][j] for j in pair}, + 'recipe':recipe,'targeted_distinct_pairs_examined':len(seen), + 'source_compressed_sha256':sha256(raw).hexdigest(), + 'canonical_word_sha256':sha256(json.dumps(word,separators=(',',':'),sort_keys=True).encode()).hexdigest()} + (HERE/'RECIPE.json').write_text(json.dumps(out,indent=2)+'\n') + print(json.dumps(out,indent=2));break + if len(seen)>=200:raise ValueError('no scoped candidate in first200 distinct pairs') +else:raise ValueError('no candidate') diff --git a/research/literal-source-affine-move/implementation/verify.py b/research/literal-source-affine-move/implementation/verify.py new file mode 100644 index 0000000000..1ba834b781 --- /dev/null +++ b/research/literal-source-affine-move/implementation/verify.py @@ -0,0 +1,137 @@ +"""Full source-bound affine MOVE replay and physical phase-lift probes.""" +from pathlib import Path +import atexit,json,random,shutil,subprocess,sys,tempfile,time +from hashlib import sha256 +HERE=Path(__file__).resolve().parent +_cache=tempfile.TemporaryDirectory(prefix='source-move-verify-');atexit.register(_cache.cleanup) +sys.dont_write_bytecode=True;sys.pycache_prefix=str(Path(_cache.name)/'absent') +import adapter as A +import move as C +from machine import Program,initial,fields,check_retired,Rejected +from oracle import header,encode,image,reverse9,gamma +from bind_source import verify as bind_source + + +def need(ok,label): + if not ok:raise ValueError(label) + + +def phase_lift_probes(): + from controller_reference import Tape,Machine + h=C.P.PHASE;records=[] + for constant in range(4): + a=C.Builder() + for t in h.PRIVATE: + a.op('move',t,-1);a.op('write',t,C.MARK);a.op('move',t,1) + h.gamma(a,h.COLUMNS);h.trace_return(a,h.HEADER,h.HTRACE) + h.initialize(a,h.COUNTERS,constant) + for mode in range(4):a.mark('record'+str(mode));a.op('halt') + terminals={a.labels['record'+str(mode)]:mode for mode in range(4)} + code,_=a.finish(('_','0','1','|')) + for f in (1,2,3,4,5,16,65): + origins=[5*t-77 for t in range(23)] + tapes=[Tape({},o) for o in origins];text=gamma(f) + tapes[0].cells.update({origins[0]+i:b for i,b in enumerate(text)}) + machine=Machine(code,tapes).run(2000000);mode=terminals[machine.pc-1] + need(mode==(constant*f)%4,'literal constant phase times f') + for tape in h.COUNTERS: + need(all(tapes[tape].cells.get(origins[tape]+i)=='0' for i in range(f)), + 'literal f-bit phase counters') + need(tapes[tape].head==origins[tape],'phase counter origin') + need(tapes[0].head==origins[0],'phase prefix header return') + records.append({'constant':constant,'f':f,'mode':mode,'steps':machine.steps}) + need(next(r for r in records if r['constant']==2 and r['f']==2)['mode']!=2,'constant once control') + return records + + +def source_corruption(): + with tempfile.TemporaryDirectory(prefix='actual-move-corruption-') as tmp: + dst=Path(tmp) + for name in ('move.py','SOURCES.json','RECIPE.json'):shutil.copy2(HERE/name,dst/name) + for pin in json.loads((HERE/'SOURCES.json').read_text())['files']: + q=dst/pin['local'];q.parent.mkdir(parents=True,exist_ok=True);shutil.copy2(HERE/pin['local'],q) + q=dst/'engines/reference/translation/translate.py';q.write_bytes(q.read_bytes()+b'\n# altered actual retained bytes\n') + launch=('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(dst))+');import move') + r=subprocess.run([sys.executable,'-I','-B','-c',launch],capture_output=True,text=True) + need(r.returncode!=0 and 'frozen source drift' in r.stderr,'actual source corruption accepted') + + +def run(): + source=bind_source();probes=phase_lift_probes() + 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']]),'early original core write') + for op,*args in code: + if op in ('read','write','move'):need(0<=args[0]=y for x,y in zip(state.highs,old)),'old history refunded') + increment=sum((hi-lo)-(ehi-elo) for lo,hi,elo,ehi in zip(state.lows,state.highs,state.entry_lows,state.entry_highs)) + need(increment<=2112*(len(bits)+1),'actual recipe complete backing envelope') + first={'shape':shape,'F':len(bits),'E':len(h),'V':len(data),'steps':state.steps, + 'core_return_steps':core_steps,'HOME_writes':state.writes[0],'visited_increment':increment, + 'output_sha256':sha256(expected.encode()).hexdigest()} + # Invalid joint rank cutoff, otherwise the same completely encoded packet. + bad=header((1,1,1,1,8,2))+data;rejected=initial(('0'*len(bad),bad),A.TAPES);before=bytes(rejected.tapes[0]) + try:program.run(rejected) + except Rejected:pass + else:raise ValueError('joint3f cutoff accepted') + need(rejected.writes[0]==0 and bytes(rejected.tapes[0])==before,'bad cutoff changed original HOME') + # Construct R*x supported on native basis0/e0 with equal unit values. + # First C0 and swap complete, then C1 encounters a genuine odd numerator. + right=C.SOURCE['recipe']['right'];numeric=[(0,0)]*512 + for x in range(512): + target=sum(((row&x).bit_count()&1)<>i)&1) + q+=2*sum(1 for i in range(9) for j in range(i+1,9) + if (x>>i)&(x>>j)&1 and (right['quadratic_rows'][i]>>j)&1) + numeric[reverse9(x)]=((1,0),(0,-1),(-1,0),(0,1))[q%4] + late_bits=h+encode(numeric,8);late=initial(('0'*len(late_bits),late_bits),A.TAPES);saved=bytes(late.tapes[0]) + base=int(stages['core_entry'].rsplit('.',1)[1]);second='MOVE24476.'+str(base+entries['center_C1_']) + program.run(late,stop=second);completed=late.steps + 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,8)),'actual right monomial and first C/swap image') + try:program.run(late,start=second) + except Rejected:pass + else:raise ValueError('late nonintegral C prefix accepted') + need(late.writes[0]==0 and bytes(late.tapes[0])==saved,'late numerical failure changed HOME') + 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 answer],8) + need(fields(wrong)==(parked,rotated) and rotated!=expected,'actual absolute-phase graph control') + check_retired(wrong);source_corruption() + return {'marker':'PASS_SOURCE_BOUND_AFFINE_MOVE_HOME','source':source,'phase_lift_probes':probes, + 'core_locations':len(code),'core_sha256':sha256(repr(code).encode()).hexdigest(), + 'HOME_states':len(graph.rules),'tapes':A.TAPES,'core_tapes':C.TAPES,'full_f1':first, + 'cutoff_rejection_steps':rejected.steps,'late_rejection':{'first_C_and_R_completed':completed, + 'steps':late.steps,'HOME_writes':late.writes[0]},'wrong_phase_steps':wrong.steps, + 'scope':'one supplied public-role727 Gamma6 direct MOVE; no caller/source-producer/nonleaf admission'} + + +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)),'receipt drift') + print(json.dumps(result,sort_keys=True));print('elapsed_seconds',round(time.monotonic()-start,3)) diff --git a/research/literal-source-affine-move/review/independent/DERIVATIVE-AST.normal.json b/research/literal-source-affine-move/review/independent/DERIVATIVE-AST.normal.json new file mode 100644 index 0000000000..9f9a1e2410 --- /dev/null +++ b/research/literal-source-affine-move/review/independent/DERIVATIVE-AST.normal.json @@ -0,0 +1,33 @@ +{ + "function_ast_sha256": { + "apply_monomial": "91a4446a35f7cf48aab704a62f9df6a1de93345af7aaedeb6ff1c6c6a8a03a3c", + "canonical_source_kernel": "186024098477c016512210e9fde01615201a1274619c11a6165f8f16bd602623", + "extend_basis": "f1a9e127bea112548e771a73ea4426065fe224742a3a4068f044641238123c1a", + "factorized_kernel": "49917a48cd6fb4eee14953ff483f902441b3630dc32043809a81ca3e8f25018b", + "inverse_rows": "99937026238bd06d44872906e725d96f6046aec62e6d859d7910e017383827fc", + "linear": "dca205752acbdc97c50921c7fb016ad8394e50d6f3be573e016e68efe3436607", + "mul_gaussian": "fda71c98a681c56d4ae0efd36ba4f72cacefa50e1e9106cf13bd2dd3eb911de5", + "parity": "799d35f0e19c3d24186b6882abf9d47e06d2f0a64f2ae27bda56ca63af1c74d6", + "quadratic_phase": "b873e414e765b68ad85104a12f3c72a752dae8fb0014121ad9ad279cb5821fa7", + "rank": "66259d151848faf6bffe1a715ad02f62bad4d0af951cb089dc2332d90c7f4a73", + "rows_from_columns": "a30d3fbef7daacb2a75c67c22039c53ddd884751507ba42e35a4fa1ab08f192c", + "same_kernel": "86a65de2fea58edcee3788185cd62a4a80f5e360585499a9e7913648c0804ca9", + "times_i": "80b6669a2a250eb82d6da3b95a7a64cbf2125af4ebba3ce887e6dee43e95fe21" + }, + "functions_identical": [ + "parity", + "rank", + "extend_basis", + "rows_from_columns", + "inverse_rows", + "linear", + "quadratic_phase", + "mul_gaussian", + "times_i", + "canonical_source_kernel", + "apply_monomial", + "factorized_kernel", + "same_kernel" + ], + "schema": "source-kernel-derivative-ast/1" +} diff --git a/research/literal-source-affine-move/review/independent/DERIVATIVE-AST.optimized.json b/research/literal-source-affine-move/review/independent/DERIVATIVE-AST.optimized.json new file mode 100644 index 0000000000..9f9a1e2410 --- /dev/null +++ b/research/literal-source-affine-move/review/independent/DERIVATIVE-AST.optimized.json @@ -0,0 +1,33 @@ +{ + "function_ast_sha256": { + "apply_monomial": "91a4446a35f7cf48aab704a62f9df6a1de93345af7aaedeb6ff1c6c6a8a03a3c", + "canonical_source_kernel": "186024098477c016512210e9fde01615201a1274619c11a6165f8f16bd602623", + "extend_basis": "f1a9e127bea112548e771a73ea4426065fe224742a3a4068f044641238123c1a", + "factorized_kernel": "49917a48cd6fb4eee14953ff483f902441b3630dc32043809a81ca3e8f25018b", + "inverse_rows": "99937026238bd06d44872906e725d96f6046aec62e6d859d7910e017383827fc", + "linear": "dca205752acbdc97c50921c7fb016ad8394e50d6f3be573e016e68efe3436607", + "mul_gaussian": "fda71c98a681c56d4ae0efd36ba4f72cacefa50e1e9106cf13bd2dd3eb911de5", + "parity": "799d35f0e19c3d24186b6882abf9d47e06d2f0a64f2ae27bda56ca63af1c74d6", + "quadratic_phase": "b873e414e765b68ad85104a12f3c72a752dae8fb0014121ad9ad279cb5821fa7", + "rank": "66259d151848faf6bffe1a715ad02f62bad4d0af951cb089dc2332d90c7f4a73", + "rows_from_columns": "a30d3fbef7daacb2a75c67c22039c53ddd884751507ba42e35a4fa1ab08f192c", + "same_kernel": "86a65de2fea58edcee3788185cd62a4a80f5e360585499a9e7913648c0804ca9", + "times_i": "80b6669a2a250eb82d6da3b95a7a64cbf2125af4ebba3ce887e6dee43e95fe21" + }, + "functions_identical": [ + "parity", + "rank", + "extend_basis", + "rows_from_columns", + "inverse_rows", + "linear", + "quadratic_phase", + "mul_gaussian", + "times_i", + "canonical_source_kernel", + "apply_monomial", + "factorized_kernel", + "same_kernel" + ], + "schema": "source-kernel-derivative-ast/1" +} diff --git a/research/literal-source-affine-move/review/independent/RESULT.normal.json b/research/literal-source-affine-move/review/independent/RESULT.normal.json new file mode 100644 index 0000000000..5aca4457cf --- /dev/null +++ b/research/literal-source-affine-move/review/independent/RESULT.normal.json @@ -0,0 +1,55 @@ +{ + "all_f_phase_lift": { + "checked_target_right_phase": 2, + "residues_by_f_1_to_8": [ + 2, + 0, + 2, + 0, + 2, + 0, + 2, + 0 + ], + "statement": "(i^a) tensor-f = i^(a*f)" + }, + "central": "C^tensor3, C=((1+i)I+(1-i)X)/2, exact Gaussian numerators over 2^3", + "denominator": 8, + "event": [ + "MOVE", + 727, + 3, + 470, + false + ], + "event_index": 24476, + "formula_checked": "K C^tensor3 K^-1 = M_left C^tensor3 M_right; K=D_Q P_G from the source frame basis", + "frames": { + "3": [], + "470": [ + 75, + 137, + 265 + ] + }, + "negative_controls_rejected": [ + "adjoint_central_kernel", + "inverse_orientation", + "offset_before_linear_map", + "reverse_factor_order", + "wrong_absolute_phase" + ], + "nonzero_kernel_entries_checked": 4096, + "one_column_basis_inputs_checked": 512, + "rank": 3, + "recipe_sha256": "8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79", + "right_constant_phase": 2, + "right_offset_applied_after_G": true, + "schema": "source-affine-move-independent-kernel-check/1", + "scope": "Exact one-column source-kernel check only; fixed-f tensor lift follows by tensor product. It is not an all-f tape execution or tariff review.", + "source": { + "canonical_sha256": "91429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097", + "compressed_sha256": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883", + "git_blob": "74563a7867d9d762b6588f65362369668841bb3e" + } +} diff --git a/research/literal-source-affine-move/review/independent/RESULT.optimized.json b/research/literal-source-affine-move/review/independent/RESULT.optimized.json new file mode 100644 index 0000000000..5aca4457cf --- /dev/null +++ b/research/literal-source-affine-move/review/independent/RESULT.optimized.json @@ -0,0 +1,55 @@ +{ + "all_f_phase_lift": { + "checked_target_right_phase": 2, + "residues_by_f_1_to_8": [ + 2, + 0, + 2, + 0, + 2, + 0, + 2, + 0 + ], + "statement": "(i^a) tensor-f = i^(a*f)" + }, + "central": "C^tensor3, C=((1+i)I+(1-i)X)/2, exact Gaussian numerators over 2^3", + "denominator": 8, + "event": [ + "MOVE", + 727, + 3, + 470, + false + ], + "event_index": 24476, + "formula_checked": "K C^tensor3 K^-1 = M_left C^tensor3 M_right; K=D_Q P_G from the source frame basis", + "frames": { + "3": [], + "470": [ + 75, + 137, + 265 + ] + }, + "negative_controls_rejected": [ + "adjoint_central_kernel", + "inverse_orientation", + "offset_before_linear_map", + "reverse_factor_order", + "wrong_absolute_phase" + ], + "nonzero_kernel_entries_checked": 4096, + "one_column_basis_inputs_checked": 512, + "rank": 3, + "recipe_sha256": "8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79", + "right_constant_phase": 2, + "right_offset_applied_after_G": true, + "schema": "source-affine-move-independent-kernel-check/1", + "scope": "Exact one-column source-kernel check only; fixed-f tensor lift follows by tensor product. It is not an all-f tape execution or tariff review.", + "source": { + "canonical_sha256": "91429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097", + "compressed_sha256": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883", + "git_blob": "74563a7867d9d762b6588f65362369668841bb3e" + } +} diff --git a/research/literal-source-affine-move/review/independent/REVIEW.md b/research/literal-source-affine-move/review/independent/REVIEW.md new file mode 100644 index 0000000000..d8bfc404e4 --- /dev/null +++ b/research/literal-source-affine-move/review/independent/REVIEW.md @@ -0,0 +1,32 @@ +# Independent source and kernel review + +## Decision + +Pass for the scoped source identity, factor orientation, absolute phase, affine placement, and one-column original-frame kernel. The independent exact checker re-extracts the event and frames from the bundled canonical archive, then compares (K C^{\otimes3}K^{-1}) with the recipe's (M_L C^{\otimes3}M_R) across all 512 basis addresses and 4,096 nonzero Gaussian entries over denominator 8. + +The checker rejects inverse orientation, reversed factor order, a wrong absolute phase, moving the offset before (G), and (C^\dagger). It is separate from the author compiler and literal emitter. The original workspace checker is preserved at `original/kernel_check.py`; the portable derivative is `kernel_check.py`. Their mathematical and negative-control functions have identical ASTs, checked by `check_derivative_ast.py`. + +## Source binding and phase lift + +The selected event is `[MOVE,727,3,470,false]`, frame3 is empty, and frame470 is `[75,137,265]`. The false field is ownership metadata, not inverse orientation. For the source chart (K=D_QP_G), the target operator is (K C^{\otimes3}K^{-1}), with (C=((1+i)I+(1-i)X)/2). + +The runtime ordering is right phase → right (G) → right (X_b) → the three positive (C) leaves → left phase → left (G) → left (X_b). The selected right offset (b=5) is applied after (G), and its global phase is (i^2). `phase.py` initializes its four-state mode by scanning the (f) columns and incrementing by (a) on each; the scalar is therefore (i^{af}), while the input polynomial is summed independently over columns. The (f)-extension is tensor-product algebra plus code inspection, not an all-(f) graph run. + +## Reproduction + +From the repository root: + +```sh +python3 -I -B review/independent/kernel_check.py implementation/RECIPE.json source/selected-final.json.gz +python3 -O -I -B review/independent/kernel_check.py implementation/RECIPE.json source/selected-final.json.gz +python3 -I -B review/independent/check_derivative_ast.py +python3 -O -I -B review/independent/check_derivative_ast.py +``` + +The bundle is authenticated by its Git blob SHA-1, compressed SHA-256, canonical-word SHA-256, and exact selected event/frame fields. The normal and optimized receipts are byte-identical. + +The conditional complete-root prefix bridge review is in [`common-grid-prefix-bridge-review.md`](common-grid-prefix-bridge-review.md). It applies only to completed and committed numerical components acting on an injective view that retains complementary root coordinates; it does not establish that a selected producer supplies those premises. + +## Limits + +This is not an independent full literal-machine execution. Root's separate physical replay and proof review are in `../root/`. Neither review establishes that an actual caller meets the stated numerical prefix promises or pays for the source producer, bank transport, global ownership, cutoff, or nonleaf recurrence. diff --git a/research/literal-source-affine-move/review/independent/check_derivative_ast.py b/research/literal-source-affine-move/review/independent/check_derivative_ast.py new file mode 100644 index 0000000000..73a1a43822 --- /dev/null +++ b/research/literal-source-affine-move/review/independent/check_derivative_ast.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +"""Check that only the derivative's input interface changed.""" +import ast +import hashlib +import json +from pathlib import Path + + +HERE = Path(__file__).resolve().parent +NAMES = ( + "parity", "rank", "extend_basis", "rows_from_columns", "inverse_rows", + "linear", "quadratic_phase", "mul_gaussian", "times_i", + "canonical_source_kernel", "apply_monomial", "factorized_kernel", + "same_kernel", +) + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def functions(path): + tree = ast.parse(path.read_text(encoding="utf-8")) + return {node.name: ast.dump(node, include_attributes=False) + for node in tree.body if isinstance(node, ast.FunctionDef)} + + +def main(): + original = functions(HERE / "original/kernel_check.py") + derivative = functions(HERE / "kernel_check.py") + result = {} + for name in NAMES: + require(name in original and name in derivative, "missing function " + name) + a, b = original[name], derivative[name] + require(a == b, "mathematical AST changed: " + name) + result[name] = hashlib.sha256(a.encode()).hexdigest() + print(json.dumps({"schema": "source-kernel-derivative-ast/1", + "functions_identical": list(NAMES), + "function_ast_sha256": result}, indent=2, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/literal-source-affine-move/review/independent/common-grid-prefix-bridge-review.md b/research/literal-source-affine-move/review/independent/common-grid-prefix-bridge-review.md new file mode 100644 index 0000000000..73042bd7ae --- /dev/null +++ b/research/literal-source-affine-move/review/independent/common-grid-prefix-bridge-review.md @@ -0,0 +1,42 @@ +# Cross-review: common-grid prefix bridge + +## Pins and conclusion + +Canonical base: `e54523517d0f03e58352e647c403a5af3e525a57`. + +- Retained premise: `docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md`, Git blob `3dd1af2285e597676725e85ad4f65e7ad326d695`, SHA-256 `4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055`. +- Reviewed application: `root-work/common-grid-prefix-bridge/PROOF-DRAFT.md` (local proposal; no external source substituted). + +**Conclusion: the complete-prefix closure argument is valid under its retained full-root hypotheses.** No new precision theorem or actual producer theorem follows. One partial-memory sentence should be read narrowly, as specified below. + +## Why the closure is licensed by #7000 §5 + +The retained §5 ideal row has the form + +`y = sum_nu c_nu U_nu x_nu`, + +where each `U_nu` acts on the same complete `D`-bit root factor and has the retained Gaussian-dyadic Clifford form. Its numerator-grid and component-magnitude bounds are uniform over that Clifford class, for the source-specific coefficients, complete input rows and exterior unfinished-context debt fixed by the section. + +Let `V_j` be a completed mathematical prefix acting as one exact Clifford on an injectively selected subset of those same `D` root coordinates, with identity on every other root coordinate. Then + +`V_j y = sum_nu c_nu (V_j U_nu) x_nu`. + +The class is closed under multiplication. `V_j` changes neither `c_nu`, `x_nu`, the outer ROW fiber nor any exterior coefficient/context. The product still acts on the same complete root factor, so the uniform §5 estimate applies without adding a new per-gate denominator or magnitude debt. This includes an arbitrary fixed finite number of complete prefixes; no bound is obtained by multiplying a per-gate error term. + +The source operations cited in the draft fit this mathematical class: CNOT, affine X, S, CZ and Gaussian-unit phase are Clifford operations; the positive central matrix + +`C = 1/2 [[1+i,1-i],[1-i,1+i]] = H S H` + +is itself a Gaussian-dyadic Clifford. A coordinate reordering is allowed only if it is a bijective relabeling of the entire retained factor; projecting away a complementary root coordinate, mixing an external control into the root operation, or replacing the row by an arbitrary rational isometry would invalidate this application. + +Thus the assertion that each **completed exact C-prefix output** is on the retained grid and inside the same signed `W` range is redundant, conditional on the actual row already satisfying every #7000 §5 source-specific premise. + +## Partial-memory limit + +The theorem controls the complete vectors `V_j y`; it does not make a fine-grained physical instruction prefix a Clifford image. A buffer during an in-place scan may mix old and new addresses. The draft's “completed component values” statement is valid only when each cited value is a fully assembled numerical component already committed from either the preceding or next complete prefix. + +It does not cover partially written component words, add/divide accumulators, partially updated descriptor encodings, or any helper scratch. Those may lie outside the endpoint row invariant and must be bounded by the relevant literal helper and widened-scratch proofs. I recommend making “fully assembled and committed” explicit next to “at each position”; the later scratch caveat is necessary and must remain. + +## What remains conditional + +The bridge does not produce the row/view/header or prove that a particular selected source packet lies in the §5 admissible class. A valid actual producer must still establish the complete-root representation, common grid, source coefficients/debt, owner/header, cutoff and physical entry promises. Paid packing/unpacking, B1 routing, initialization/erasure, literal helper costs, history and nonleaf tariff remain separate. This is a premise-reuse lemma only; it proves no selected framework assumption by itself. diff --git a/research/literal-source-affine-move/review/independent/kernel_check.py b/research/literal-source-affine-move/review/independent/kernel_check.py new file mode 100644 index 0000000000..efd67f05d6 --- /dev/null +++ b/research/literal-source-affine-move/review/independent/kernel_check.py @@ -0,0 +1,286 @@ +#!/usr/bin/env python3 +"""Portable derivative of the independent exact one-column kernel checker. + +The mathematical kernel and negative-control functions are unchanged from +original/kernel_check.py. Only the two input paths and source-byte loading are +adapted so this published copy needs no repository subprocess. +""" +from __future__ import annotations + +import gzip +import hashlib +import json +from pathlib import Path +import sys + + +COMMIT = "e54523517d0f03e58352e647c403a5af3e525a57" +SOURCE = "research/shared-wire-split-composition/data/final.json.gz" +BLOB = "74563a7867d9d762b6588f65362369668841bb3e" +COMPRESSED_SIZE = 350722 +COMPRESSED_SHA = "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883" +CANONICAL_SHA = "91429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097" +EVENT_INDEX = 24476 +EVENT = ["MOVE", 727, 3, 470, False] +START_FRAME = [] +END_FRAME = [75, 137, 265] +RECIPE_SHA = "8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79" + + +def require(ok: bool, message: str) -> None: + if not ok: + raise ValueError(message) + + +def parity(x: int) -> int: + return x.bit_count() & 1 + + +def rank(vectors: list[int]) -> int: + pivots: dict[int, int] = {} + for value in vectors: + x = value + while x: + bit = x.bit_length() - 1 + if bit not in pivots: + pivots[bit] = x + break + x ^= pivots[bit] + return len(pivots) + + +def extend_basis(selected: list[int], n: int) -> list[int]: + out: list[int] = [] + for v in selected + [1 << i for i in range(n)]: + if rank(out + [v]) > len(out): + out.append(v) + require(len(out) == n, "basis extension did not span the source space") + return out + + +def rows_from_columns(columns: list[int], n: int) -> list[int]: + return [sum(((columns[j] >> i) & 1) << j for j in range(n)) for i in range(n)] + + +def inverse_rows(rows: list[int], n: int) -> list[int]: + a = [rows[i] | (1 << (n + i)) for i in range(n)] + for col in range(n): + pivot = next((r for r in range(col, n) if (a[r] >> col) & 1), None) + require(pivot is not None, "singular source basis") + a[col], a[pivot] = a[pivot], a[col] + for r in range(n): + if r != col and ((a[r] >> col) & 1): + a[r] ^= a[col] + require([a[i] & ((1 << n) - 1) for i in range(n)] == [1 << i for i in range(n)], "GF(2) inverse check failed") + return [a[i] >> n for i in range(n)] + + +def linear(rows: list[int], x: int) -> int: + return sum(parity(row & x) << i for i, row in enumerate(rows)) + + +def quadratic_phase(rows: list[int], linear_z4: list[int], constant: int, x: int) -> int: + p = constant + n = len(rows) + for i in range(n): + if (x >> i) & 1: + p += linear_z4[i] + for j in range(i + 1, n): + p += 2 * (((rows[i] >> j) & 1) * ((x >> j) & 1)) + return p & 3 + + +def mul_gaussian(a: tuple[int, int], b: tuple[int, int]) -> tuple[int, int]: + return (a[0] * b[0] - a[1] * b[1], a[0] * b[1] + a[1] * b[0]) + + +def times_i(a: tuple[int, int], exponent: int) -> tuple[int, int]: + exponent &= 3 + return ((a[0], a[1]), (-a[1], a[0]), (-a[0], -a[1]), (a[1], -a[0]))[exponent] + + +def canonical_source_kernel(columns: list[int], r: int, n: int, *, inverse_orientation: bool = False, adjoint_center: bool = False) -> list[dict[int, tuple[int, int]]]: + """Return columns of K C^r K^-1 as exact Gaussian numerators / 2^r.""" + basis = extend_basis(columns, n) + g = rows_from_columns(basis, n) + gi = inverse_rows(g, n) + gi_columns = rows_from_columns(gi, n) + qrows = [] + for i, col_i in enumerate(gi_columns): + qrows.append((1 << i) ^ sum(parity(col_i & col_j) << j for j, col_j in enumerate(gi_columns))) + alpha = [(qrows[i] >> i) & 1 for i in range(n)] + + def q(x: int) -> int: + return quadratic_phase(qrows, alpha, 0, x) + + # Inverse orientation is a negative control, not the source convention. + out_cols: list[dict[int, tuple[int, int]]] = [] + for x in range(1 << n): + col: dict[int, tuple[int, int]] = {} + if not inverse_orientation: + # K^-1: D_Q^-1 then P_G^-1; C^r; then K=D_Q P_G. + z = linear(gi, x) + start_phase = (-q(x)) & 3 + for low_out in range(1 << r): + v = low_out | (z & ~((1 << r) - 1)) + amp = (1, 0) + for bit in range(r): + same = ((low_out >> bit) & 1) == ((z >> bit) & 1) + # C=(1+i)I/2 + (1-i)X/2. C^dagger swaps these signs. + factor = (1, 1) if same else (1, -1) + if adjoint_center: + factor = (factor[0], -factor[1]) + amp = mul_gaussian(amp, factor) + y = linear(g, v) + amp = times_i(amp, (start_phase + q(y)) & 3) + col[y] = (col.get(y, (0, 0))[0] + amp[0], col.get(y, (0, 0))[1] + amp[1]) + else: + # K C^r K^-1 with K and K^-1 exchanged: K^-1 C^r K. + z = linear(g, x) + start_phase = q(x) + for low_out in range(1 << r): + v = low_out | (z & ~((1 << r) - 1)) + amp = (1, 0) + for bit in range(r): + same = ((low_out >> bit) & 1) == ((z >> bit) & 1) + factor = (1, 1) if same else (1, -1) + amp = mul_gaussian(amp, factor) + y = linear(gi, v) + amp = times_i(amp, (start_phase - q(y)) & 3) + col[y] = (col.get(y, (0, 0))[0] + amp[0], col.get(y, (0, 0))[1] + amp[1]) + out_cols.append({y: a for y, a in col.items() if a != (0, 0)}) + return out_cols + + +def apply_monomial(factor: dict, x: int, *, phase_mode: str = "as_written", offset_mode: str = "after") -> tuple[int, int]: + rows = factor["matrix_rows"] + b = factor["offset"] + p = quadratic_phase(factor["quadratic_rows"], factor["linear_Z4"], factor["phase"], x) + if phase_mode == "negate": + p = (-p) & 3 + if offset_mode == "after": + y = linear(rows, x) ^ b + elif offset_mode == "before": + y = linear(rows, x ^ b) + else: + raise ValueError("unknown offset mode") + return y, p + + +def factorized_kernel(recipe: dict, *, reverse_factors: bool = False, wrong_phase: bool = False, wrong_offset: bool = False, phase_mode: str = "as_written", center_adjoint: bool = False) -> list[dict[int, tuple[int, int]]]: + n = len(recipe["left"]["matrix_rows"]) + r = recipe["rank"] + left, right = recipe["left"], recipe["right"] + if right is None: + raise ValueError("rank-three recipe must have two monomial factors") + if wrong_phase: + right = dict(right) + right["phase"] = (right["phase"] + 1) & 3 + # Denominator 2^r is common to every central C^r amplitude. + result: list[dict[int, tuple[int, int]]] = [] + for x in range(1 << n): + if not reverse_factors: + z, p0 = apply_monomial(right, x, phase_mode=phase_mode, offset_mode="before" if wrong_offset else "after") + phase0 = p0 + col: dict[int, tuple[int, int]] = {} + for low_out in range(1 << r): + v = low_out | (z & ~((1 << r) - 1)) + amp = (1, 0) + for bit in range(r): + same = ((low_out >> bit) & 1) == ((z >> bit) & 1) + factor = (1, 1) if same else (1, -1) + if center_adjoint: + factor = (factor[0], -factor[1]) + amp = mul_gaussian(amp, factor) + y, p1 = apply_monomial(left, v, phase_mode=phase_mode) + amp = times_i(amp, (phase0 + p1) & 3) + col[y] = (col.get(y, (0, 0))[0] + amp[0], col.get(y, (0, 0))[1] + amp[1]) + else: + z, p0 = apply_monomial(left, x, phase_mode=phase_mode) + col = {} + for low_out in range(1 << r): + v = low_out | (z & ~((1 << r) - 1)) + amp = (1, 0) + for bit in range(r): + same = ((low_out >> bit) & 1) == ((z >> bit) & 1) + factor = (1, 1) if same else (1, -1) + amp = mul_gaussian(amp, factor) + y, p1 = apply_monomial(right, v, phase_mode=phase_mode) + amp = times_i(amp, (p0 + p1) & 3) + col[y] = (col.get(y, (0, 0))[0] + amp[0], col.get(y, (0, 0))[1] + amp[1]) + result.append({y: a for y, a in col.items() if a != (0, 0)}) + return result + + +def source_input(archive_path: Path) -> tuple[dict, dict]: + raw = archive_path.read_bytes() + git_blob = hashlib.sha1(b"blob " + str(len(raw)).encode() + b"\0" + raw).hexdigest() + require(git_blob == BLOB, "bundled Git blob hash changed") + require(len(raw) == COMPRESSED_SIZE, "compressed byte count changed") + require(hashlib.sha256(raw).hexdigest() == COMPRESSED_SHA, "compressed source hash changed") + word = json.loads(gzip.decompress(raw)) + canon = json.dumps(word, separators=(",", ":"), sort_keys=True).encode() + require(hashlib.sha256(canon).hexdigest() == CANONICAL_SHA, "canonical source hash changed") + require(word["program"][EVENT_INDEX] == EVENT, "source event identity changed") + require(word["frames"][3] == START_FRAME and word["frames"][470] == END_FRAME, "source frame identity changed") + return word, {"git_blob": git_blob, "compressed_sha256": hashlib.sha256(raw).hexdigest(), "canonical_sha256": hashlib.sha256(canon).hexdigest()} + + +def same_kernel(a: list[dict[int, tuple[int, int]]], b: list[dict[int, tuple[int, int]]]) -> bool: + return len(a) == len(b) and all(a[i] == b[i] for i in range(len(a))) + + +def run(recipe_path: Path, archive_path: Path) -> dict: + _, source_receipt = source_input(archive_path) + raw = recipe_path.read_bytes() + require(hashlib.sha256(raw).hexdigest() == RECIPE_SHA, "RECIPE hash changed") + recipe_doc = json.loads(raw) + require(recipe_doc["canonical_main"] == COMMIT and recipe_doc["event_index"] == EVENT_INDEX and recipe_doc["event"] == EVENT, "RECIPE source identity mismatch") + require(recipe_doc["frames"] == {"3": START_FRAME, "470": END_FRAME}, "RECIPE frame binding mismatch") + recipe = recipe_doc["recipe"] + require(recipe["rank"] == 3 and recipe["left"]["offset"] == 0 and recipe["right"]["offset"] == 5, "rank/offset binding mismatch") + require(recipe["left"]["phase"] == 0 and recipe["right"]["phase"] == 2, "absolute phase binding mismatch") + direct = canonical_source_kernel(END_FRAME, 3, 9) + factored = factorized_kernel(recipe) + require(same_kernel(direct, factored), "source kernel differs from L C^3 R") + + # Five deliberately wrong conventions must be rejected by the complete kernel comparison. + mutants = { + "inverse_orientation": canonical_source_kernel(END_FRAME, 3, 9, inverse_orientation=True), + "reverse_factor_order": factorized_kernel(recipe, reverse_factors=True), + "wrong_absolute_phase": factorized_kernel(recipe, wrong_phase=True), + "offset_before_linear_map": factorized_kernel(recipe, wrong_offset=True), + "adjoint_central_kernel": factorized_kernel(recipe, center_adjoint=True), + } + for label, kernel in mutants.items(): + require(not same_kernel(direct, kernel), f"negative control unexpectedly passed: {label}") + return { + "schema": "source-affine-move-independent-kernel-check/1", + "source": source_receipt, + "event_index": EVENT_INDEX, + "event": EVENT, + "frames": {"3": START_FRAME, "470": END_FRAME}, + "recipe_sha256": hashlib.sha256(raw).hexdigest(), + "rank": 3, + "central": "C^tensor3, C=((1+i)I+(1-i)X)/2, exact Gaussian numerators over 2^3", + "formula_checked": "K C^tensor3 K^-1 = M_left C^tensor3 M_right; K=D_Q P_G from the source frame basis", + "one_column_basis_inputs_checked": 1 << 9, + "nonzero_kernel_entries_checked": sum(map(len, direct)), + "denominator": 1 << 3, + "right_offset_applied_after_G": True, + "right_constant_phase": 2, + "negative_controls_rejected": sorted(mutants), + "all_f_phase_lift": {"statement": "(i^a) tensor-f = i^(a*f)", "checked_target_right_phase": 2, "residues_by_f_1_to_8": [((2*f) & 3) for f in range(1, 9)]}, + "scope": "Exact one-column source-kernel check only; fixed-f tensor lift follows by tensor product. It is not an all-f tape execution or tariff review.", + } + + +def main() -> None: + if len(sys.argv) != 3: + raise SystemExit("usage: python3 kernel_check.py IMPLEMENTATION_RECIPE.json SELECTED_FINAL.json.gz") + result = run(Path(sys.argv[1]), Path(sys.argv[2])) + print(json.dumps(result, indent=2, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/literal-source-affine-move/review/independent/original/CHECKSUMS.sha256 b/research/literal-source-affine-move/review/independent/original/CHECKSUMS.sha256 new file mode 100644 index 0000000000..6ec031aba9 --- /dev/null +++ b/research/literal-source-affine-move/review/independent/original/CHECKSUMS.sha256 @@ -0,0 +1,5 @@ +a7627cc4cc3d54725f1a4b77d4a716a3320888b7f8ebda06577fe6d2292c210e worker-c/research/source-affine-move-review/REVIEW.md +cf35d8df98feb1774e53f2e493141479a01f798ebba0dd745ff9b7f6bb7025aa worker-c/research/source-affine-move-review/kernel_check.py +219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e worker-c/research/source-affine-move-review/RESULT.normal.json +219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e worker-c/research/source-affine-move-review/RESULT.optimized.json +6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b worker-c/research/source-affine-move-review/common-grid-prefix-bridge-review.md diff --git a/research/literal-source-affine-move/review/independent/original/RESULT.normal.json b/research/literal-source-affine-move/review/independent/original/RESULT.normal.json new file mode 100644 index 0000000000..5aca4457cf --- /dev/null +++ b/research/literal-source-affine-move/review/independent/original/RESULT.normal.json @@ -0,0 +1,55 @@ +{ + "all_f_phase_lift": { + "checked_target_right_phase": 2, + "residues_by_f_1_to_8": [ + 2, + 0, + 2, + 0, + 2, + 0, + 2, + 0 + ], + "statement": "(i^a) tensor-f = i^(a*f)" + }, + "central": "C^tensor3, C=((1+i)I+(1-i)X)/2, exact Gaussian numerators over 2^3", + "denominator": 8, + "event": [ + "MOVE", + 727, + 3, + 470, + false + ], + "event_index": 24476, + "formula_checked": "K C^tensor3 K^-1 = M_left C^tensor3 M_right; K=D_Q P_G from the source frame basis", + "frames": { + "3": [], + "470": [ + 75, + 137, + 265 + ] + }, + "negative_controls_rejected": [ + "adjoint_central_kernel", + "inverse_orientation", + "offset_before_linear_map", + "reverse_factor_order", + "wrong_absolute_phase" + ], + "nonzero_kernel_entries_checked": 4096, + "one_column_basis_inputs_checked": 512, + "rank": 3, + "recipe_sha256": "8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79", + "right_constant_phase": 2, + "right_offset_applied_after_G": true, + "schema": "source-affine-move-independent-kernel-check/1", + "scope": "Exact one-column source-kernel check only; fixed-f tensor lift follows by tensor product. It is not an all-f tape execution or tariff review.", + "source": { + "canonical_sha256": "91429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097", + "compressed_sha256": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883", + "git_blob": "74563a7867d9d762b6588f65362369668841bb3e" + } +} diff --git a/research/literal-source-affine-move/review/independent/original/RESULT.optimized.json b/research/literal-source-affine-move/review/independent/original/RESULT.optimized.json new file mode 100644 index 0000000000..5aca4457cf --- /dev/null +++ b/research/literal-source-affine-move/review/independent/original/RESULT.optimized.json @@ -0,0 +1,55 @@ +{ + "all_f_phase_lift": { + "checked_target_right_phase": 2, + "residues_by_f_1_to_8": [ + 2, + 0, + 2, + 0, + 2, + 0, + 2, + 0 + ], + "statement": "(i^a) tensor-f = i^(a*f)" + }, + "central": "C^tensor3, C=((1+i)I+(1-i)X)/2, exact Gaussian numerators over 2^3", + "denominator": 8, + "event": [ + "MOVE", + 727, + 3, + 470, + false + ], + "event_index": 24476, + "formula_checked": "K C^tensor3 K^-1 = M_left C^tensor3 M_right; K=D_Q P_G from the source frame basis", + "frames": { + "3": [], + "470": [ + 75, + 137, + 265 + ] + }, + "negative_controls_rejected": [ + "adjoint_central_kernel", + "inverse_orientation", + "offset_before_linear_map", + "reverse_factor_order", + "wrong_absolute_phase" + ], + "nonzero_kernel_entries_checked": 4096, + "one_column_basis_inputs_checked": 512, + "rank": 3, + "recipe_sha256": "8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79", + "right_constant_phase": 2, + "right_offset_applied_after_G": true, + "schema": "source-affine-move-independent-kernel-check/1", + "scope": "Exact one-column source-kernel check only; fixed-f tensor lift follows by tensor product. It is not an all-f tape execution or tariff review.", + "source": { + "canonical_sha256": "91429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097", + "compressed_sha256": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883", + "git_blob": "74563a7867d9d762b6588f65362369668841bb3e" + } +} diff --git a/research/literal-source-affine-move/review/independent/original/REVIEW.md b/research/literal-source-affine-move/review/independent/original/REVIEW.md new file mode 100644 index 0000000000..07577d07dc --- /dev/null +++ b/research/literal-source-affine-move/review/independent/original/REVIEW.md @@ -0,0 +1,57 @@ +# Independent review: source-bound affine MOVE24476 + +## Decision + +**Pass for the scoped source, phase, affine-order, and one-column kernel claims.** I found no mathematical mismatch between the authenticated source MOVE and the frozen (M_L C^{\otimes3}M_R) recipe. The result does not validate the selected caller's numerical promises or add a caller/nonleaf tariff. + +## Pins and method + +The reviewed package is `worker-a/research/source-bound-affine-move-join`, frozen at `FREEZE.json` SHA-256 `9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde`. Relevant exact file hashes are: + +| File | SHA-256 | +|---|---| +| `PROOF.md` | `30eb220651420201a57a089b34f6b54b55f995dfc7b6758910da10d87c15e86e` | +| `move.py` | `b213325a652dc91630a50fb63d573108a04a2b7a07e587f25b0ecf0db8ffd668` | +| `RECIPE.json` | `8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79` | +| `bind_source.py` | `0ceaa9f378eb17743aff2ba71b86be163cf841cf97609f90eb2aed77e9a10f34` | +| `oracle.py` | `762847697ca3fa50e69eb146c157fa888a3687dd552c5b75bccb917f1a65b17a` | +| `SOURCE-BINDING.json` | `2e5c028dde3da98aabd5ebe2daa9bd53effca33e2157a2954b893db36ce0ef83` | +| `GRAPH.json` | `91b207a27c0d9d16cfff8e42332e04126d73a9797fc312f19762297fde04cd8b` | + +The independent checker is [`kernel_check.py`](kernel_check.py), with the frozen receipt in [`RESULT.normal.json`](RESULT.normal.json) (normal and `-O` outputs are byte-identical; SHA-256 `219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e`). It reads the pinned Git blob directly, authenticates the compressed and canonical-word hashes, and binds event24476 and its two complete frames. It does not import A's compiler, tape emitter, or source oracle. + +Reproduce from the workspace root: + +```sh +python3 -I -B worker-c/research/source-affine-move-review/kernel_check.py /workspace/scratch/92c9920affc2/repo +python3 -O -I -B worker-c/research/source-affine-move-review/kernel_check.py /workspace/scratch/92c9920affc2/repo +``` + +Both commands return the same exact result. + +## Findings + +The source object is canonical main `e54523517d0f03e58352e647c403a5af3e525a57`, archive path `research/shared-wire-split-composition/data/final.json.gz`, Git blob `74563a7867d9d762b6588f65362369668841bb3e`. Its compressed SHA-256 is `2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883`; canonical word SHA-256 is `91429a6b96729292a8764836e00c87a6f7cd3b76f05159033f4867f69a98d097`. Direct extraction gives event24476 `[MOVE,727,3,470,false]`, frame3 `[]`, and frame470 `[75,137,265]`. The `false` field is the source's private/ownership flag; it does not reverse the ordered frame map. + +For the target frame, extend the ordered basis columns `(75,137,265)` by standard basis vectors to form the source chart (G), and let (K=D_QP_G) be its phase/permutation chart. The pinned frame rule gives (T_{470}=K C^{\otimes3}K^{-1}), where + +\[ +C=\frac12\begin{pmatrix}1+i&1-i\\1-i&1+i\end{pmatrix}. +\] + +I evaluated that kernel directly: for each of the 512 input basis addresses, apply (K^{-1}), expand the first three bits with exact (C) entries, and apply (K). All 4,096 resulting nonzero Gaussian amplitudes (common denominator 8) match the recipe's (M_L C^{\otimes3}M_R) action. The check confirms factor order: runtime applies right monomial, then the three positive (C) leaves, then left monomial. Five controls fail as expected: inverse frame orientation, reversed monomial order, wrong absolute phase, moving the offset before its linear map, and (C^\dagger) in place of (C). + +The fixed monomial convention is +\[ +|x\rangle\longmapsto i^{a+q(x)}|Gx\oplus b\rangle, +\qquad q(x)=\sum_i\alpha_i x_i+2\sum_{i None: + if not ok: + raise ValueError(message) + + +def parity(x: int) -> int: + return x.bit_count() & 1 + + +def rank(vectors: list[int]) -> int: + pivots: dict[int, int] = {} + for value in vectors: + x = value + while x: + bit = x.bit_length() - 1 + if bit not in pivots: + pivots[bit] = x + break + x ^= pivots[bit] + return len(pivots) + + +def extend_basis(selected: list[int], n: int) -> list[int]: + out: list[int] = [] + for v in selected + [1 << i for i in range(n)]: + if rank(out + [v]) > len(out): + out.append(v) + require(len(out) == n, "basis extension did not span the source space") + return out + + +def rows_from_columns(columns: list[int], n: int) -> list[int]: + return [sum(((columns[j] >> i) & 1) << j for j in range(n)) for i in range(n)] + + +def inverse_rows(rows: list[int], n: int) -> list[int]: + a = [rows[i] | (1 << (n + i)) for i in range(n)] + for col in range(n): + pivot = next((r for r in range(col, n) if (a[r] >> col) & 1), None) + require(pivot is not None, "singular source basis") + a[col], a[pivot] = a[pivot], a[col] + for r in range(n): + if r != col and ((a[r] >> col) & 1): + a[r] ^= a[col] + require([a[i] & ((1 << n) - 1) for i in range(n)] == [1 << i for i in range(n)], "GF(2) inverse check failed") + return [a[i] >> n for i in range(n)] + + +def linear(rows: list[int], x: int) -> int: + return sum(parity(row & x) << i for i, row in enumerate(rows)) + + +def quadratic_phase(rows: list[int], linear_z4: list[int], constant: int, x: int) -> int: + p = constant + n = len(rows) + for i in range(n): + if (x >> i) & 1: + p += linear_z4[i] + for j in range(i + 1, n): + p += 2 * (((rows[i] >> j) & 1) * ((x >> j) & 1)) + return p & 3 + + +def mul_gaussian(a: tuple[int, int], b: tuple[int, int]) -> tuple[int, int]: + return (a[0] * b[0] - a[1] * b[1], a[0] * b[1] + a[1] * b[0]) + + +def times_i(a: tuple[int, int], exponent: int) -> tuple[int, int]: + exponent &= 3 + return ((a[0], a[1]), (-a[1], a[0]), (-a[0], -a[1]), (a[1], -a[0]))[exponent] + + +def canonical_source_kernel(columns: list[int], r: int, n: int, *, inverse_orientation: bool = False, adjoint_center: bool = False) -> list[dict[int, tuple[int, int]]]: + """Return columns of K C^r K^-1 as exact Gaussian numerators / 2^r.""" + basis = extend_basis(columns, n) + g = rows_from_columns(basis, n) + gi = inverse_rows(g, n) + gi_columns = rows_from_columns(gi, n) + qrows = [] + for i, col_i in enumerate(gi_columns): + qrows.append((1 << i) ^ sum(parity(col_i & col_j) << j for j, col_j in enumerate(gi_columns))) + alpha = [(qrows[i] >> i) & 1 for i in range(n)] + + def q(x: int) -> int: + return quadratic_phase(qrows, alpha, 0, x) + + # Inverse orientation is a negative control, not the source convention. + out_cols: list[dict[int, tuple[int, int]]] = [] + for x in range(1 << n): + col: dict[int, tuple[int, int]] = {} + if not inverse_orientation: + # K^-1: D_Q^-1 then P_G^-1; C^r; then K=D_Q P_G. + z = linear(gi, x) + start_phase = (-q(x)) & 3 + for low_out in range(1 << r): + v = low_out | (z & ~((1 << r) - 1)) + amp = (1, 0) + for bit in range(r): + same = ((low_out >> bit) & 1) == ((z >> bit) & 1) + # C=(1+i)I/2 + (1-i)X/2. C^dagger swaps these signs. + factor = (1, 1) if same else (1, -1) + if adjoint_center: + factor = (factor[0], -factor[1]) + amp = mul_gaussian(amp, factor) + y = linear(g, v) + amp = times_i(amp, (start_phase + q(y)) & 3) + col[y] = (col.get(y, (0, 0))[0] + amp[0], col.get(y, (0, 0))[1] + amp[1]) + else: + # K C^r K^-1 with K and K^-1 exchanged: K^-1 C^r K. + z = linear(g, x) + start_phase = q(x) + for low_out in range(1 << r): + v = low_out | (z & ~((1 << r) - 1)) + amp = (1, 0) + for bit in range(r): + same = ((low_out >> bit) & 1) == ((z >> bit) & 1) + factor = (1, 1) if same else (1, -1) + amp = mul_gaussian(amp, factor) + y = linear(gi, v) + amp = times_i(amp, (start_phase - q(y)) & 3) + col[y] = (col.get(y, (0, 0))[0] + amp[0], col.get(y, (0, 0))[1] + amp[1]) + out_cols.append({y: a for y, a in col.items() if a != (0, 0)}) + return out_cols + + +def apply_monomial(factor: dict, x: int, *, phase_mode: str = "as_written", offset_mode: str = "after") -> tuple[int, int]: + rows = factor["matrix_rows"] + b = factor["offset"] + p = quadratic_phase(factor["quadratic_rows"], factor["linear_Z4"], factor["phase"], x) + if phase_mode == "negate": + p = (-p) & 3 + if offset_mode == "after": + y = linear(rows, x) ^ b + elif offset_mode == "before": + y = linear(rows, x ^ b) + else: + raise ValueError("unknown offset mode") + return y, p + + +def factorized_kernel(recipe: dict, *, reverse_factors: bool = False, wrong_phase: bool = False, wrong_offset: bool = False, phase_mode: str = "as_written", center_adjoint: bool = False) -> list[dict[int, tuple[int, int]]]: + n = len(recipe["left"]["matrix_rows"]) + r = recipe["rank"] + left, right = recipe["left"], recipe["right"] + if right is None: + raise ValueError("rank-three recipe must have two monomial factors") + if wrong_phase: + right = dict(right) + right["phase"] = (right["phase"] + 1) & 3 + # Denominator 2^r is common to every central C^r amplitude. + result: list[dict[int, tuple[int, int]]] = [] + for x in range(1 << n): + if not reverse_factors: + z, p0 = apply_monomial(right, x, phase_mode=phase_mode, offset_mode="before" if wrong_offset else "after") + phase0 = p0 + col: dict[int, tuple[int, int]] = {} + for low_out in range(1 << r): + v = low_out | (z & ~((1 << r) - 1)) + amp = (1, 0) + for bit in range(r): + same = ((low_out >> bit) & 1) == ((z >> bit) & 1) + factor = (1, 1) if same else (1, -1) + if center_adjoint: + factor = (factor[0], -factor[1]) + amp = mul_gaussian(amp, factor) + y, p1 = apply_monomial(left, v, phase_mode=phase_mode) + amp = times_i(amp, (phase0 + p1) & 3) + col[y] = (col.get(y, (0, 0))[0] + amp[0], col.get(y, (0, 0))[1] + amp[1]) + else: + z, p0 = apply_monomial(left, x, phase_mode=phase_mode) + col = {} + for low_out in range(1 << r): + v = low_out | (z & ~((1 << r) - 1)) + amp = (1, 0) + for bit in range(r): + same = ((low_out >> bit) & 1) == ((z >> bit) & 1) + factor = (1, 1) if same else (1, -1) + amp = mul_gaussian(amp, factor) + y, p1 = apply_monomial(right, v, phase_mode=phase_mode) + amp = times_i(amp, (p0 + p1) & 3) + col[y] = (col.get(y, (0, 0))[0] + amp[0], col.get(y, (0, 0))[1] + amp[1]) + result.append({y: a for y, a in col.items() if a != (0, 0)}) + return result + + +def source_input(repo: Path) -> tuple[dict, dict]: + rev = f"{COMMIT}:{SOURCE}" + blob = subprocess.check_output(["git", "-C", str(repo), "rev-parse", rev], text=True).strip() + raw = subprocess.check_output(["git", "-C", str(repo), "show", rev]) + require(blob == BLOB, "Git object changed") + require(len(raw) == COMPRESSED_SIZE, "compressed byte count changed") + require(hashlib.sha256(raw).hexdigest() == COMPRESSED_SHA, "compressed source hash changed") + word = json.loads(gzip.decompress(raw)) + canon = json.dumps(word, separators=(",", ":"), sort_keys=True).encode() + require(hashlib.sha256(canon).hexdigest() == CANONICAL_SHA, "canonical source hash changed") + require(word["program"][EVENT_INDEX] == EVENT, "source event identity changed") + require(word["frames"][3] == START_FRAME and word["frames"][470] == END_FRAME, "source frame identity changed") + return word, {"git_blob": blob, "compressed_sha256": hashlib.sha256(raw).hexdigest(), "canonical_sha256": hashlib.sha256(canon).hexdigest()} + + +def same_kernel(a: list[dict[int, tuple[int, int]]], b: list[dict[int, tuple[int, int]]]) -> bool: + return len(a) == len(b) and all(a[i] == b[i] for i in range(len(a))) + + +def run(repo: Path) -> dict: + word, source_receipt = source_input(repo) + raw = RECIPE_PATH.read_bytes() + require(hashlib.sha256(raw).hexdigest() == RECIPE_SHA, "RECIPE hash changed; update only after A's freeze") + recipe_doc = json.loads(raw) + require(recipe_doc["canonical_main"] == COMMIT and recipe_doc["event_index"] == EVENT_INDEX and recipe_doc["event"] == EVENT, "RECIPE source identity mismatch") + require(recipe_doc["frames"] == {"3": START_FRAME, "470": END_FRAME}, "RECIPE frame binding mismatch") + recipe = recipe_doc["recipe"] + require(recipe["rank"] == 3 and recipe["left"]["offset"] == 0 and recipe["right"]["offset"] == 5, "rank/offset binding mismatch") + require(recipe["left"]["phase"] == 0 and recipe["right"]["phase"] == 2, "absolute phase binding mismatch") + direct = canonical_source_kernel(END_FRAME, 3, 9) + factored = factorized_kernel(recipe) + require(same_kernel(direct, factored), "source kernel differs from L C^3 R") + + # Four deliberately wrong conventions must be rejected by the complete kernel comparison. + mutants = { + "inverse_orientation": canonical_source_kernel(END_FRAME, 3, 9, inverse_orientation=True), + "reverse_factor_order": factorized_kernel(recipe, reverse_factors=True), + "wrong_absolute_phase": factorized_kernel(recipe, wrong_phase=True), + "offset_before_linear_map": factorized_kernel(recipe, wrong_offset=True), + "adjoint_central_kernel": factorized_kernel(recipe, center_adjoint=True), + } + for label, kernel in mutants.items(): + require(not same_kernel(direct, kernel), f"negative control unexpectedly passed: {label}") + return { + "schema": "source-affine-move-independent-kernel-check/1", + "source": source_receipt, + "event_index": EVENT_INDEX, + "event": EVENT, + "frames": {"3": START_FRAME, "470": END_FRAME}, + "recipe_sha256": hashlib.sha256(raw).hexdigest(), + "rank": 3, + "central": "C^tensor3, C=((1+i)I+(1-i)X)/2, exact Gaussian numerators over 2^3", + "formula_checked": "K C^tensor3 K^-1 = M_left C^tensor3 M_right; K=D_Q P_G from the source frame basis", + "one_column_basis_inputs_checked": 1 << 9, + "nonzero_kernel_entries_checked": sum(map(len, direct)), + "denominator": 1 << 3, + "right_offset_applied_after_G": True, + "right_constant_phase": 2, + "negative_controls_rejected": sorted(mutants), + "all_f_phase_lift": {"statement": "(i^a) tensor-f = i^(a*f)", "checked_target_right_phase": 2, "residues_by_f_1_to_8": [((2*f) & 3) for f in range(1, 9)]}, + "scope": "Exact one-column source-kernel check only; fixed-f tensor lift follows by tensor product. It is not an all-f tape execution or tariff review.", + } + + +def main() -> None: + if len(sys.argv) != 2: + raise SystemExit("usage: python3 kernel_check.py /path/to/canonical-repo") + result = run(Path(sys.argv[1])) + print(json.dumps(result, indent=2, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/literal-source-affine-move/review/packaging/BASE-CHECKSUMS.sha256 b/research/literal-source-affine-move/review/packaging/BASE-CHECKSUMS.sha256 new file mode 100644 index 0000000000..683a0705a3 --- /dev/null +++ b/research/literal-source-affine-move/review/packaging/BASE-CHECKSUMS.sha256 @@ -0,0 +1,84 @@ +d87afc51c96f76b7dc46eb0e940d4a04c75af2d449aa642b55f16af5a123e5fb PR-DESCRIPTION.md +9ee6728020a2df7365cae6410b5aaf63dab74cb6288cfb528b1d2fdf61fa8caf PR-TITLE.txt +fe2a441667029813698bd83aca10fde348a60d3f70350abb769927f06aff0052 README.md +341ccdabc22fbc35c65066838426bbcba47fc145d6c70ba878d19dc93754a7c8 SOURCES.json +ea30a211c71a157ad0c03cdfea60cd0dd077c74450e636c3ca537c2b1980c12d TASK.json +11facac97cce2d8f661ba0d318c1c5e9be6fb7d9837e8e7ed46009272187ddb0 VERIFY.json +97e1a944d9e51f8070eb2f85c08eab14bb56174e06f714add329d56fcb3dbdc3 implementation/CHECKPOINT.md +7eaebda9dfdf28631ccd752e296289e5e6763ecc759d334f2b8570f7212f6a20 implementation/ENVIRONMENT.json +91b207a27c0d9d16cfff8e42332e04126d73a9797fc312f19762297fde04cd8b implementation/GRAPH.json +46825d46977c64429b21108df57fbbcac1a3262cc15010eb3bcab8c62d2dfbfd implementation/NOTICE.md +95faf01d82e6abdd57fcdd1ddbea115e28a72e49cb2bb7b546fc00b4c63eca4e implementation/OVERLAP.md +739c4183d830bb1b2b18e9918e76091ab51c9ff0aa1ae886323df8ac765d9dca implementation/PR-DESCRIPTION.md +30eb220651420201a57a089b34f6b54b55f995dfc7b6758910da10d87c15e86e implementation/PROOF.md +1460287ec82d51caab6b6de764afb7c306e81a21e4ea0326db334cea45a7ed29 implementation/README.md +8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79 implementation/RECIPE.json +42e904c679a3df89e0f88a6cc8d46132fd830705ef5a13cecdfcadba2f2ef1e0 implementation/RESULT.json +2e5c028dde3da98aabd5ebe2daa9bd53effca33e2157a2954b893db36ce0ef83 implementation/SOURCE-BINDING.json +b3a2d73ae575c840a1ebd85e0734def9330c3afaecf862b75edd62387870b382 implementation/SOURCES.json +e18b1e320a4f00177e5bc437867b906e4e63bbedd40bab668b14428fa67969bf implementation/adapter.py +0ceaa9f378eb17743aff2ba71b86be163cf841cf97609f90eb2aed77e9a10f34 implementation/bind_source.py +abbbd21565ff67a5268d30c034ad33f2143c8b2699bbcccc68569a326ff020b6 implementation/engines/SOURCES.json +9387d4caa6ea6ad9e232f4a2a07112fa1a681d34af19e5aae64d1d8adc5ebd2c implementation/engines/affine.py +971080f6254cfaf44b01a412533818ffdff78ea925452c76a02524092b3ccff6 implementation/engines/join.py +ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee implementation/engines/machine.py +93e1ad8a92c3624df064e4f39119ccbb5c96391ea8dd5f7af58edc7ca9638352 implementation/engines/reference/rank2/PROOF.md +b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702 implementation/engines/reference/rank2/RECIPE.json +659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641 implementation/engines/reference/rank2/SOURCES.json +ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee implementation/engines/reference/rank2/machine.py +3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a implementation/engines/reference/rank2/rank2.py +b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842 implementation/engines/reference/rank2/reference/home/NOTICE.md +04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099 implementation/engines/reference/rank2/reference/home/parent_adapter.py +7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54 implementation/engines/reference/rank2/reference/home/tape_graph.py +773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf implementation/engines/reference/rank2/reference/leaf/NOTICE.md +e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73 implementation/engines/reference/rank2/reference/leaf/inputs/controller_reference.py +bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744 implementation/engines/reference/rank2/reference/leaf/leaf.py +2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50 implementation/engines/reference/rank2/reference/linear/NOTICE.md +e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73 implementation/engines/reference/rank2/reference/linear/inputs/controller_reference.py +d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33 implementation/engines/reference/rank2/reference/linear/linear.py +5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0 implementation/engines/reference/rank2/reference/phase/NOTICE +e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73 implementation/engines/reference/rank2/reference/phase/inputs/controller_reference.py +2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7 implementation/engines/reference/rank2/reference/phase/phase.py +2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962 implementation/engines/reference/rank2/reference/source/clifford_exact.py +3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38 implementation/engines/reference/rank2/reference/source/native_verify.py +24f5e9957fcd8f6cfdc021ff5bc91bf89e50587997e2a2cb18053949c0e0d205 implementation/engines/reference/translation/NOTICE.md +6b76d348203aed15cbc30d104c59571111ccf6cb7bb4592936e9170f736b68e0 implementation/engines/reference/translation/PROOF.md +e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73 implementation/engines/reference/translation/reference/inputs/controller_reference.py +4b516d85baf3303db809bc1174394009b1fc71a8f7d17fb6c729ec8bb6aba245 implementation/engines/reference/translation/reference/reverse.py +e2750fef8c2b9c8019d67285df3ca0d04340cd241782c7845665b7de621ca3bd implementation/engines/reference/translation/translate.py +ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee implementation/machine.py +b213325a652dc91630a50fb63d573108a04a2b7a07e587f25b0ecf0db8ffd668 implementation/move.py +c4a63b2d0d03e45640d9560a8669b4d01626cd1d10ab6574535240d72cd498fa implementation/normal.log +e3e236bf82f77eb577c0737aec35ff59c40bddbb58ec84d1e4bbb01ceff907bf implementation/optimized.log +762847697ca3fa50e69eb146c157fa888a3687dd552c5b75bccb917f1a65b17a implementation/oracle.py +de2753cb42a012e07aa7ace263bedce5c4be8506ae30ab768af9e165a6edd6e0 implementation/reference/affine-FREEZE.json +f43040c6331dc29ecf3f435e980cc71f00a60e421f50f4e843192a23e733bd44 implementation/reference/affine-PROOF.md +abbbd21565ff67a5268d30c034ad33f2143c8b2699bbcccc68569a326ff020b6 implementation/reference/affine-SOURCES.json +5735c401ba981a7af4d3a146eb047d04fa0c87dbf7ed49bd82dc57df8d6cb2ef implementation/reference/central-FREEZE.json +48899c607452daccd0998f4005ae2a6ed85a723969f474bf796496303ad4d4bb implementation/reference/central-PROOF.md +496948cd8d2b5134ceed6b48b870be73f6415b5f70e97ab35b744ded5a2a3c03 implementation/reference/central-SOURCES.json +6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b implementation/reference/prefix-bridge/INDEPENDENT-REVIEW.md +84a30aeff471af36e182840b2c6605e0fdf8aa3a5d829c656b21d16df682f595 implementation/reference/prefix-bridge/PROOF.md +f8be476176747afb154859cb2a3c09cf5154e413fde8b8f9c95e23ce26806645 implementation/reference/prefix-bridge/SOURCE-REVIEW.json +4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055 implementation/reference/prefix-bridge/retained-selected-proof.md +d9abc11899582ff4d37adf32e3de3406b82cc26d797780b98a30e529e418d374 implementation/select_source.py +354cf3527c6881f4b7946722bc6942e51d32973ee801489599a8274bb4e898b8 implementation/verify.py +87ce0928603b4fc3b463e0494ce1b80eb91fddab1f40f95bd53471ef3c909f1a review/independent/DERIVATIVE-AST.normal.json +87ce0928603b4fc3b463e0494ce1b80eb91fddab1f40f95bd53471ef3c909f1a review/independent/DERIVATIVE-AST.optimized.json +219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e review/independent/RESULT.normal.json +219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e review/independent/RESULT.optimized.json +16193b2daba4f0699de22513410a79030db5914aeaf6a395f8f9f79dd956c6ad review/independent/REVIEW.md +d891f992c6e32e4fcc918a3ffbddae43aac0bf5c76536cd193ea5a7afa0e305f review/independent/check_derivative_ast.py +6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b review/independent/common-grid-prefix-bridge-review.md +845922900c157d4eff6c70b9407408fa2dd8b1cae40bb53d9a7de4d017ff2d80 review/independent/kernel_check.py +219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e review/independent/original/RESULT.normal.json +219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e review/independent/original/RESULT.optimized.json +a7627cc4cc3d54725f1a4b77d4a716a3320888b7f8ebda06577fe6d2292c210e review/independent/original/REVIEW.md +6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b review/independent/original/common-grid-prefix-bridge-review.md +cf35d8df98feb1774e53f2e493141479a01f798ebba0dd745ff9b7f6bb7025aa review/independent/original/kernel_check.py +89d45bfd265f8c62c21dcf4ff8cf6eed322302d857f40071d04a6611e2042a88 review/root/INTEGRATION-NOTE.md +508ce98e70e9e0bef11432635f814a793f3165a3f1b9ded2822381ca3e2b87c7 review/root/RESULT.json +49fe59a035d1ca9c085f426696a4be241450a03247cc9fbe5ffa564e00262dc4 review/root/ROOT-REVIEW.md +a73f01b60fa83140ae29398342e2185b3cc6b0356dcdb939274b95a4eea31089 review/root/check_source_move_root.py +08137daaf65d0bccefcf6474d3807cea13accaf95a317219491d51e84d1ebe24 review/root/original/ROOT-REVIEW.md +2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883 source/selected-final.json.gz diff --git a/research/literal-source-affine-move/review/packaging/BASE-FREEZE.json b/research/literal-source-affine-move/review/packaging/BASE-FREEZE.json new file mode 100644 index 0000000000..66e3a8085c --- /dev/null +++ b/research/literal-source-affine-move/review/packaging/BASE-FREEZE.json @@ -0,0 +1,444 @@ +{ + "schema": "literal-source-affine-move-publication-freeze/1", + "canonical_base": "e54523517d0f03e58352e647c403a5af3e525a57", + "author_freeze_sha256": "9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde", + "root_review_original_sha256": "08137daaf65d0bccefcf6474d3807cea13accaf95a317219491d51e84d1ebe24", + "root_review_packaged_sha256": "49fe59a035d1ca9c085f426696a4be241450a03247cc9fbe5ffa564e00262dc4", + "files_count": 86, + "files_total_bytes": 845257, + "files": [ + { + "path": "CHECKSUMS.sha256", + "bytes": 9156, + "sha256": "1da2c3512495b7ef66a95afdf36a7dd6df0668bef019b02b06ace49f2340dc68" + }, + { + "path": "PR-DESCRIPTION.md", + "bytes": 2792, + "sha256": "d87afc51c96f76b7dc46eb0e940d4a04c75af2d449aa642b55f16af5a123e5fb" + }, + { + "path": "PR-TITLE.txt", + "bytes": 44, + "sha256": "9ee6728020a2df7365cae6410b5aaf63dab74cb6288cfb528b1d2fdf61fa8caf" + }, + { + "path": "README.md", + "bytes": 5208, + "sha256": "fe2a441667029813698bd83aca10fde348a60d3f70350abb769927f06aff0052" + }, + { + "path": "SOURCES.json", + "bytes": 8598, + "sha256": "341ccdabc22fbc35c65066838426bbcba47fc145d6c70ba878d19dc93754a7c8" + }, + { + "path": "TASK.json", + "bytes": 8034, + "sha256": "ea30a211c71a157ad0c03cdfea60cd0dd077c74450e636c3ca537c2b1980c12d" + }, + { + "path": "VERIFY.json", + "bytes": 2992, + "sha256": "11facac97cce2d8f661ba0d318c1c5e9be6fb7d9837e8e7ed46009272187ddb0" + }, + { + "path": "implementation/CHECKPOINT.md", + "bytes": 1895, + "sha256": "97e1a944d9e51f8070eb2f85c08eab14bb56174e06f714add329d56fcb3dbdc3" + }, + { + "path": "implementation/ENVIRONMENT.json", + "bytes": 462, + "sha256": "7eaebda9dfdf28631ccd752e296289e5e6763ecc759d334f2b8570f7212f6a20" + }, + { + "path": "implementation/GRAPH.json", + "bytes": 899, + "sha256": "91b207a27c0d9d16cfff8e42332e04126d73a9797fc312f19762297fde04cd8b" + }, + { + "path": "implementation/NOTICE.md", + "bytes": 1476, + "sha256": "46825d46977c64429b21108df57fbbcac1a3262cc15010eb3bcab8c62d2dfbfd" + }, + { + "path": "implementation/OVERLAP.md", + "bytes": 1862, + "sha256": "95faf01d82e6abdd57fcdd1ddbea115e28a72e49cb2bb7b546fc00b4c63eca4e" + }, + { + "path": "implementation/PR-DESCRIPTION.md", + "bytes": 2329, + "sha256": "739c4183d830bb1b2b18e9918e76091ab51c9ff0aa1ae886323df8ac765d9dca" + }, + { + "path": "implementation/PROOF.md", + "bytes": 13067, + "sha256": "30eb220651420201a57a089b34f6b54b55f995dfc7b6758910da10d87c15e86e" + }, + { + "path": "implementation/README.md", + "bytes": 3746, + "sha256": "1460287ec82d51caab6b6de764afb7c306e81a21e4ea0326db334cea45a7ed29" + }, + { + "path": "implementation/RECIPE.json", + "bytes": 1433, + "sha256": "8303e04baa838553257773a6d0e7d9b57389f2f9adf0de183a6d6c644d243a79" + }, + { + "path": "implementation/RESULT.json", + "bytes": 3843, + "sha256": "42e904c679a3df89e0f88a6cc8d46132fd830705ef5a13cecdfcadba2f2ef1e0" + }, + { + "path": "implementation/SOURCE-BINDING.json", + "bytes": 522, + "sha256": "2e5c028dde3da98aabd5ebe2daa9bd53effca33e2157a2954b893db36ce0ef83" + }, + { + "path": "implementation/SOURCES.json", + "bytes": 12367, + "sha256": "b3a2d73ae575c840a1ebd85e0734def9330c3afaecf862b75edd62387870b382" + }, + { + "path": "implementation/adapter.py", + "bytes": 4750, + "sha256": "e18b1e320a4f00177e5bc437867b906e4e63bbedd40bab668b14428fa67969bf" + }, + { + "path": "implementation/bind_source.py", + "bytes": 3988, + "sha256": "0ceaa9f378eb17743aff2ba71b86be163cf841cf97609f90eb2aed77e9a10f34" + }, + { + "path": "implementation/engines/SOURCES.json", + "bytes": 7336, + "sha256": "abbbd21565ff67a5268d30c034ad33f2143c8b2699bbcccc68569a326ff020b6" + }, + { + "path": "implementation/engines/affine.py", + "bytes": 3859, + "sha256": "9387d4caa6ea6ad9e232f4a2a07112fa1a681d34af19e5aae64d1d8adc5ebd2c" + }, + { + "path": "implementation/engines/join.py", + "bytes": 6778, + "sha256": "971080f6254cfaf44b01a412533818ffdff78ea925452c76a02524092b3ccff6" + }, + { + "path": "implementation/engines/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee" + }, + { + "path": "implementation/engines/reference/rank2/PROOF.md", + "bytes": 16634, + "sha256": "93e1ad8a92c3624df064e4f39119ccbb5c96391ea8dd5f7af58edc7ca9638352" + }, + { + "path": "implementation/engines/reference/rank2/RECIPE.json", + "bytes": 4468, + "sha256": "b1386ad613213a01f736bc2e7fc7de5a25d2c700c3d577dfb396a266278ae702" + }, + { + "path": "implementation/engines/reference/rank2/SOURCES.json", + "bytes": 10337, + "sha256": "659ff7da20d16ece71aabbe240986e884fcaa6f53b5b0f082151e541e0534641" + }, + { + "path": "implementation/engines/reference/rank2/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee" + }, + { + "path": "implementation/engines/reference/rank2/rank2.py", + "bytes": 8253, + "sha256": "3ca027f80b6cb973fa064612b8fb18b1306498e064a01e97ff7f9b6aa40b301a" + }, + { + "path": "implementation/engines/reference/rank2/reference/home/NOTICE.md", + "bytes": 2093, + "sha256": "b51b8fd0773a1bbe988c8a98d951dc34b175bf56bac772ef65997f1df7ed3842" + }, + { + "path": "implementation/engines/reference/rank2/reference/home/parent_adapter.py", + "bytes": 5353, + "sha256": "04462e141548c6a86c500d40b4aee8c446c539bd9269098d7516fa13400ef099" + }, + { + "path": "implementation/engines/reference/rank2/reference/home/tape_graph.py", + "bytes": 12069, + "sha256": "7d3cee3e79ba5fe410e1a6b5f4cf6a2fbe5e274f838b798cd8860344ff258b54" + }, + { + "path": "implementation/engines/reference/rank2/reference/leaf/NOTICE.md", + "bytes": 1900, + "sha256": "773921ac301cf7e37de97ed8a0066e6bbb69ec1150cc2b5f74a12cb20103f3cf" + }, + { + "path": "implementation/engines/reference/rank2/reference/leaf/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "implementation/engines/reference/rank2/reference/leaf/leaf.py", + "bytes": 17526, + "sha256": "bb46c1a55f1119957a52cd61f2cd957f3f7ad1e9b818c54a852bde09a0773744" + }, + { + "path": "implementation/engines/reference/rank2/reference/linear/NOTICE.md", + "bytes": 2180, + "sha256": "2ac2051c0fbedfd9d11348493456bf479dbdd3104a4e106c8bf36251a72b6a50" + }, + { + "path": "implementation/engines/reference/rank2/reference/linear/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "implementation/engines/reference/rank2/reference/linear/linear.py", + "bytes": 13102, + "sha256": "d56704082b82e37d4a360b8aad7e0af63499f4160c6bbcfd338804453c46fa33" + }, + { + "path": "implementation/engines/reference/rank2/reference/phase/NOTICE", + "bytes": 808, + "sha256": "5654eeb7fdc1acd6a6d246ef87b1155812efdcd0949f54be78e048fe905fbae0" + }, + { + "path": "implementation/engines/reference/rank2/reference/phase/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "implementation/engines/reference/rank2/reference/phase/phase.py", + "bytes": 11734, + "sha256": "2be149aa1be504509bb480f85396f0be302082d638e81422f747daee5a3c1ce7" + }, + { + "path": "implementation/engines/reference/rank2/reference/source/clifford_exact.py", + "bytes": 6824, + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "implementation/engines/reference/rank2/reference/source/native_verify.py", + "bytes": 12323, + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38" + }, + { + "path": "implementation/engines/reference/translation/NOTICE.md", + "bytes": 1201, + "sha256": "24f5e9957fcd8f6cfdc021ff5bc91bf89e50587997e2a2cb18053949c0e0d205" + }, + { + "path": "implementation/engines/reference/translation/PROOF.md", + "bytes": 19690, + "sha256": "6b76d348203aed15cbc30d104c59571111ccf6cb7bb4592936e9170f736b68e0" + }, + { + "path": "implementation/engines/reference/translation/reference/inputs/controller_reference.py", + "bytes": 5938, + "sha256": "e664a748e6b6797d4b60f60a7a7dd68b59a5608acf56b9c5d8b466f363755f73" + }, + { + "path": "implementation/engines/reference/translation/reference/reverse.py", + "bytes": 6649, + "sha256": "4b516d85baf3303db809bc1174394009b1fc71a8f7d17fb6c729ec8bb6aba245" + }, + { + "path": "implementation/engines/reference/translation/translate.py", + "bytes": 7703, + "sha256": "e2750fef8c2b9c8019d67285df3ca0d04340cd241782c7845665b7de621ca3bd" + }, + { + "path": "implementation/machine.py", + "bytes": 6041, + "sha256": "ffe2677bb5b82932873cb08b05f890a1218070215ebe670a0b05079518e8baee" + }, + { + "path": "implementation/move.py", + "bytes": 4503, + "sha256": "b213325a652dc91630a50fb63d573108a04a2b7a07e587f25b0ecf0db8ffd668" + }, + { + "path": "implementation/normal.log", + "bytes": 2630, + "sha256": "c4a63b2d0d03e45640d9560a8669b4d01626cd1d10ab6574535240d72cd498fa" + }, + { + "path": "implementation/optimized.log", + "bytes": 2630, + "sha256": "e3e236bf82f77eb577c0737aec35ff59c40bddbb58ec84d1e4bbb01ceff907bf" + }, + { + "path": "implementation/oracle.py", + "bytes": 1768, + "sha256": "762847697ca3fa50e69eb146c157fa888a3687dd552c5b75bccb917f1a65b17a" + }, + { + "path": "implementation/reference/affine-FREEZE.json", + "bytes": 7062, + "sha256": "de2753cb42a012e07aa7ace263bedce5c4be8506ae30ab768af9e165a6edd6e0" + }, + { + "path": "implementation/reference/affine-PROOF.md", + "bytes": 12681, + "sha256": "f43040c6331dc29ecf3f435e980cc71f00a60e421f50f4e843192a23e733bd44" + }, + { + "path": "implementation/reference/affine-SOURCES.json", + "bytes": 7336, + "sha256": "abbbd21565ff67a5268d30c034ad33f2143c8b2699bbcccc68569a326ff020b6" + }, + { + "path": "implementation/reference/central-FREEZE.json", + "bytes": 6301, + "sha256": "5735c401ba981a7af4d3a146eb047d04fa0c87dbf7ed49bd82dc57df8d6cb2ef" + }, + { + "path": "implementation/reference/central-PROOF.md", + "bytes": 12196, + "sha256": "48899c607452daccd0998f4005ae2a6ed85a723969f474bf796496303ad4d4bb" + }, + { + "path": "implementation/reference/central-SOURCES.json", + "bytes": 5445, + "sha256": "496948cd8d2b5134ceed6b48b870be73f6415b5f70e97ab35b744ded5a2a3c03" + }, + { + "path": "implementation/reference/prefix-bridge/INDEPENDENT-REVIEW.md", + "bytes": 3970, + "sha256": "6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b" + }, + { + "path": "implementation/reference/prefix-bridge/PROOF.md", + "bytes": 6282, + "sha256": "84a30aeff471af36e182840b2c6605e0fdf8aa3a5d829c656b21d16df682f595" + }, + { + "path": "implementation/reference/prefix-bridge/SOURCE-REVIEW.json", + "bytes": 758, + "sha256": "f8be476176747afb154859cb2a3c09cf5154e413fde8b8f9c95e23ce26806645" + }, + { + "path": "implementation/reference/prefix-bridge/retained-selected-proof.md", + "bytes": 25533, + "sha256": "4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055" + }, + { + "path": "implementation/select_source.py", + "bytes": 2584, + "sha256": "d9abc11899582ff4d37adf32e3de3406b82cc26d797780b98a30e529e418d374" + }, + { + "path": "implementation/verify.py", + "bytes": 8606, + "sha256": "354cf3527c6881f4b7946722bc6942e51d32973ee801489599a8274bb4e898b8" + }, + { + "path": "review/independent/DERIVATIVE-AST.normal.json", + "bytes": 1515, + "sha256": "87ce0928603b4fc3b463e0494ce1b80eb91fddab1f40f95bd53471ef3c909f1a" + }, + { + "path": "review/independent/DERIVATIVE-AST.optimized.json", + "bytes": 1515, + "sha256": "87ce0928603b4fc3b463e0494ce1b80eb91fddab1f40f95bd53471ef3c909f1a" + }, + { + "path": "review/independent/RESULT.normal.json", + "bytes": 1518, + "sha256": "219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e" + }, + { + "path": "review/independent/RESULT.optimized.json", + "bytes": 1518, + "sha256": "219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e" + }, + { + "path": "review/independent/REVIEW.md", + "bytes": 2950, + "sha256": "16193b2daba4f0699de22513410a79030db5914aeaf6a395f8f9f79dd956c6ad" + }, + { + "path": "review/independent/check_derivative_ast.py", + "bytes": 1385, + "sha256": "d891f992c6e32e4fcc918a3ffbddae43aac0bf5c76536cd193ea5a7afa0e305f" + }, + { + "path": "review/independent/common-grid-prefix-bridge-review.md", + "bytes": 3970, + "sha256": "6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b" + }, + { + "path": "review/independent/kernel_check.py", + "bytes": 12789, + "sha256": "845922900c157d4eff6c70b9407408fa2dd8b1cae40bb53d9a7de4d017ff2d80" + }, + { + "path": "review/independent/original/CHECKSUMS.sha256", + "bytes": 653, + "sha256": "88bc2ce27922bd2e004cb5c5aafaa2c0a00a6a915fe701b8265726a005a404b0" + }, + { + "path": "review/independent/original/RESULT.normal.json", + "bytes": 1518, + "sha256": "219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e" + }, + { + "path": "review/independent/original/RESULT.optimized.json", + "bytes": 1518, + "sha256": "219c61bfb47f48d9e63012fae2bd0000f37dcb8720db8e9090c5b4b5eb62662e" + }, + { + "path": "review/independent/original/REVIEW.md", + "bytes": 5585, + "sha256": "a7627cc4cc3d54725f1a4b77d4a716a3320888b7f8ebda06577fe6d2292c210e" + }, + { + "path": "review/independent/original/common-grid-prefix-bridge-review.md", + "bytes": 3970, + "sha256": "6c5a89ee22960bbd65979ac8620fdf261bd44ae07dfb370c1e35699d19045a0b" + }, + { + "path": "review/independent/original/kernel_check.py", + "bytes": 12935, + "sha256": "cf35d8df98feb1774e53f2e493141479a01f798ebba0dd745ff9b7f6bb7025aa" + }, + { + "path": "review/root/INTEGRATION-NOTE.md", + "bytes": 503, + "sha256": "89d45bfd265f8c62c21dcf4ff8cf6eed322302d857f40071d04a6611e2042a88" + }, + { + "path": "review/root/RESULT.json", + "bytes": 1429, + "sha256": "508ce98e70e9e0bef11432635f814a793f3165a3f1b9ded2822381ca3e2b87c7" + }, + { + "path": "review/root/ROOT-REVIEW.md", + "bytes": 5498, + "sha256": "49fe59a035d1ca9c085f426696a4be241450a03247cc9fbe5ffa564e00262dc4" + }, + { + "path": "review/root/check_source_move_root.py", + "bytes": 7856, + "sha256": "a73f01b60fa83140ae29398342e2185b3cc6b0356dcdb939274b95a4eea31089" + }, + { + "path": "review/root/original/ROOT-REVIEW.md", + "bytes": 5467, + "sha256": "08137daaf65d0bccefcf6474d3807cea13accaf95a317219491d51e84d1ebe24" + }, + { + "path": "source/selected-final.json.gz", + "bytes": 350722, + "sha256": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883" + } + ], + "excluded_generated_paths": [ + "Python bytecode caches; none present" + ] +} diff --git a/research/literal-source-affine-move/review/root/INTEGRATION-NOTE.md b/research/literal-source-affine-move/review/root/INTEGRATION-NOTE.md new file mode 100644 index 0000000000..acc034bb5f --- /dev/null +++ b/research/literal-source-affine-move/review/root/INTEGRATION-NOTE.md @@ -0,0 +1,3 @@ +# Packaging correction to the root review + +The root replay receipt records shape `[1,1,2,1,10,3]` in the established order `[f,c,P,S,w,cutoff]`. At root's request, the packaged `ROOT-REVIEW.md` corrects one parameter label from `r=1` to `c=1` and states the selected central rank is `3`. The original review is preserved byte-for-byte at `original/ROOT-REVIEW.md` (SHA-256 `08137daaf65d0bccefcf6474d3807cea13accaf95a317219491d51e84d1ebe24`). The root checker and receipt remain byte-for-byte unchanged. diff --git a/research/literal-source-affine-move/review/root/RESULT.json b/research/literal-source-affine-move/review/root/RESULT.json new file mode 100644 index 0000000000..7752572b1b --- /dev/null +++ b/research/literal-source-affine-move/review/root/RESULT.json @@ -0,0 +1,71 @@ +{ + "E": 16, + "F": 20496, + "V": 20480, + "core_instructions": 138933, + "core_sha256": "f5a94e975d699c19b11a1a9a5c101b49bbc001fab44ebee5ef0b9f1d1bd92807", + "event_index": 24476, + "frame": [ + 75, + 137, + 265 + ], + "input_sha256": "b16893a69a97cb22b5a7a6d25535708f5cd313b5bc5a79a8ceeecb46df6d8c2a", + "oracle": "Closed original-frame Gaussian kernel from an explicit span-set chart and Hamming powers; no author factor recipe/circuit-state oracle imported", + "output_sha256": "481557bc9f43052f6ba46466d8709fac16793e2fa7f73b2464adedfba8258b86", + "receipt": { + "HOME_writes": 20496, + "checkpoints": { + "MOVE24476.71": { + "home_writes": 0, + "steps": 164067 + }, + "jump.5": { + "home_writes": 0, + "steps": 118642346 + }, + "jump.70": { + "home_writes": 0, + "steps": 118580788 + } + }, + "early_HOME_writes": 0, + "entry_head_history": 141033, + "final_head_history": 433541, + "steps": 118744836 + }, + "scope": "Fresh complete f1 two-outer-row packet; all-f proof and actual caller remain separate.", + "shape": [ + 1, + 1, + 2, + 1, + 10, + 3 + ], + "source_chart_basis": [ + 75, + 137, + 265, + 1, + 2, + 4, + 8, + 16, + 32 + ], + "source_chart_diagonal": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0 + ], + "states": 139100, + "status": "PASS_ROOT_SOURCE_AFFINE_MOVE", + "tapes": 35 +} diff --git a/research/literal-source-affine-move/review/root/ROOT-REVIEW.md b/research/literal-source-affine-move/review/root/ROOT-REVIEW.md new file mode 100644 index 0000000000..2d428b1c37 --- /dev/null +++ b/research/literal-source-affine-move/review/root/ROOT-REVIEW.md @@ -0,0 +1,97 @@ +# Root proof and separate physical review of MOVE24476 + +Base: e54523517d0f03e58352e647c403a5af3e525a57. +Author freeze SHA256:9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde. + +## Decision and exact scope + +The frozen generic fixed monomial composition and actual selected public +MOVE24476, frames3=[] to470=[75,137,265], pass this scoped proof/source and +physical review. The false Boolean is ownership metadata, not inversion. +The right monomial has offset5 and constant2. Prior MOVE24472 already has +offset1/phase1, so this is not the first nonzero-offset or constant-phase +join. Earlier algebra/coded-child work in #6978 is retained and credited. + +The construction requires supplied Gamma6/DATA, owners, origins, scratch, +actual3f cutoff and numerical prefix/phase-fit conditions. The separately +reviewed complete-root corollary derives the numerical conditions only if +an actual producer supplies the retained selected row invariant and correct +view. It does not provide that producer, packing, owner grant or cutoff. +No selected assumption or complete multiplication bound is discharged. + +## Mathematical and implementation obligations inspected + +For a monomial |x> -> i^(a+q(x)) |Gx XOR b>, phase precedes G and output +translation follows G. On f columns the scalar becomes i^(af). The retained +phase initializer cycles by a for each unary-f mark; its per-column quadratic +term retains its input coordinates. The outer chronology is right monomial, +three positive selected-slot C services, then left monomial. It tensors +products, never exterior sums or register coefficients. The signed phase +promise includes every actual component negation, not just a final endpoint. + +The source-bound core flattens all components into one original-owner +transaction: helpers act only on WORK and reuse retired private ports. +The leaf's highest port28 maps to30, preserving31 core tapes. The joint guard +is3f<=cutoff while the original f and all9f axes remain unchanged. The +cutoff's bit length is paid; its numeric value is not a runtime loop bound. +The successful HOME wrapper embeds the complete native table on35 tapes. +All setup/reservation/B1 transport and old historical backing remain explicit. + +The complete actual component sum has73 CNOTs in8 fixed words, two phase +passes, three C leaves, one X0, one joint guard and one outer transaction. +I independently added the retained ceilings:9,000,991 fV +462,848 E +462,875, +which is below2^25(fV+E+1). The history sum is1320(V+E+1), below2048; +HOME adds64(F+1), giving2112(F+1). A generic fixed monomial's corresponding +sum4,532,255 fV+94,208 E+94,235 fits2^24, with488<512 history units. +These are direct leaf bills; they do not supply the selected nonleaf tariff. + +## Separate exact oracle and machine execution + +The root checker imports the emitted adapter/core graph, not the author's +CPU, factor-action oracle or native gate-state interpreter. Every native +instruction is independently checked against its Graph embedding. A separate +sparse CPU interprets the local rules with independently shifted origins, +opaque exteriors, a retained old guide span and a parked productive HOME. + +For the arithmetic oracle, an explicit set-of-span-values procedure completes +the original ordered frame (75,137,265) to a binary basis B. Inverse coordinates +are enumerated, not obtained from the contributor's Clifford compiler. +For K=D_Q P_B, the original frame is K C^tensor3 K^-1. Direct matrix entries +are computed as + + i^(q(y)-q(x)) (1+i)^(3-h) (1-i)^h /8, + +when y XOR x is a combination of the first3 basis vectors with Hamming weight +h, and zero otherwise. This is a closed original-frame kernel; it does not +apply the emitted right/left monomials, their affine offsets or their CNOT +lists. The source convention and absolute phase are separately checked by the +independent review role on all512 basis inputs with convention mutants. + +The fresh root packet has f=1, c=1, P=2, S=1, width10 and cutoff3; its selected central rank is3. Its1024 +Gaussian entries are multiples of8 with absolute components at most24, so +the simple3-axis sufficient prefix reserve fits signed10bits. V=20,480 and +E=16. The independent CPU executes118,744,836 transitions through139,100 +Graph states. Exactly20,496 HOME writes occur after complete primitive +return, and none earlier. All35 heads/private bodies/guards/exteriors return; +the parked HOME is unchanged. Recorded visited-span history grows from +141,033 to433,541 without refunding the prior guide span. Input/output/core +hashes and the source chart are retained in RESULT.json. + +This is one complete f1 execution with two outer rows, not an all-f machine +execution or proof of operator identity from one dense input. The separate +exact512-column source review and written tensor/loop invariants supply the +remaining mathematical evidence. Numerical rejection cleanup/retry remains +unclaimed; the author checks valid-format cutoff, late arithmetic and wrong +phase behavior separately. + +Run with the explicit implementation directory: + +```sh +python3 -I -B -W error review/root/check_source_move_root.py implementation +``` + +Prepared for @CubeJerry with substantial OpenAI ChatGPT/Codex assistance. +The construction is shared across review roles. This is disclosed independent +implementation/arithmetic checking, not blind or human review and not a +formal-kernel proof. The actual caller, source/header/view production, +complete owned lifetime and faster recursive supplier remain open. No new kappa. diff --git a/research/literal-source-affine-move/review/root/check_source_move_root.py b/research/literal-source-affine-move/review/root/check_source_move_root.py new file mode 100644 index 0000000000..68263800d5 --- /dev/null +++ b/research/literal-source-affine-move/review/root/check_source_move_root.py @@ -0,0 +1,135 @@ +"""Separate sparse graph CPU and closed original-frame Gaussian kernel for MOVE24476.""" +from pathlib import Path +import hashlib,json,sys +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 gamma(n): + b=bin(n)[2:];return '0'*(len(b)-1)+b +def word(x,w): + require(-(1<<(w-1))<=x<(1<<(w-1)),'signed oracle fit') + return format(x%(1<>i)&1:B[x]^=v + inverse=[None]*512 + for x,y in enumerate(B): + require(inverse[y] is None,'source chart bijective');inverse[y]=x + inverse_columns=[inverse[1<>i)&1)+ + 2*sum((inverse_columns[i]&inverse_columns[j]).bit_count()%2 + for i in range(9) for j in range(i+1,9) if (x>>i)&1 and (x>>j)&1))%4 + kernel=[] + for physical_source in range(512): + x=rev9(physical_source);entries=[] + for delta in range(8): + y=x^B[delta];h=delta.bit_count() + z=rotate(mul(power((1,1),3-h),power((1,-1),h)),q(y)-q(x)) + entries.append((rev9(y),z[0],z[1])) + kernel.append(entries) + # The chart diagonal changes phase but not the support; each row/column + # has8entries of modulus squared1/8, directly at denominator8. + require(all(sum(a*a+b*b for _,a,b in row)==64 for row in kernel),'kernel column norm') + return kernel,tuple(basis),tuple(diagonal) + +def image(values,outer,kernel): + out=[[0,0] for _ in values] + for p in range(outer): + for x,row in enumerate(kernel): + u,v=values[p*512+x] + for y,a,b in row: + out[p*512+y][0]+=a*u-b*v;out[p*512+y][1]+=b*u+a*v + require(all(a%8==0 and b%8==0 for a,b in out),'closed frame output integral') + return [(a//8,b//8) for a,b in out] + +def embedding(graph,stages,core): + labels=[s for s in graph.rules if s.startswith('MOVE24476.')] + require(len(labels)==len(core),'full core state count') + for i,(op,*args) in enumerate(core): + nxt=labels[i+1] if i+1>3)^x))%7-3),8*((3*x+2*p+(x>>5))%7-3)) for p in range(outer) for x in range(512)] + kernel,basis,diagonal=original_frame_kernel();expected_values=image(values,outer,kernel) + require(expected_values!=values and any(z!=(0,0) for z in expected_values),'nontrivial frame fixture') + data=''.join(word(c,width) for z in values for c in z) + expected_data=''.join(word(c,width) for z in expected_values for c in z) + header=''.join(gamma(x) for x in (1,1,outer,1,width,3));packet=header+data + parked=('011001001'*((len(packet)+8)//9))[:len(packet)] + actual,receipt=interpret(graph,(parked,packet),stages,budget=250000000) + require(actual==[parked,header+expected_data],'complete original-frame output') + require(receipt['HOME_writes']==len(packet) and receipt['early_HOME_writes']==0,'late whole HOME scatter') + V,E=len(data),len(header);F=V+E + require(receipt['steps']<=(1<<25)*(V+E+1)+128*(F+1),'complete stated direct time') + require(receipt['final_head_history']<=receipt['entry_head_history']+2112*(F+1),'stated history') + print(json.dumps({'status':'PASS_ROOT_SOURCE_AFFINE_MOVE','event_index':24476,'frame':list((75,137,265)),'source_chart_basis':basis,'source_chart_diagonal':diagonal,'shape':[1,1,outer,1,width,3],'V':V,'E':E,'F':F,'states':len(graph.rules),'tapes':a.TAPES,'core_instructions':len(core),'core_sha256':hashlib.sha256(repr(core).encode()).hexdigest(),'receipt':receipt,'input_sha256':hashlib.sha256(packet.encode()).hexdigest(),'output_sha256':hashlib.sha256((header+expected_data).encode()).hexdigest(),'oracle':'Closed original-frame Gaussian kernel from an explicit span-set chart and Hamming powers; no author factor recipe/circuit-state oracle imported','scope':'Fresh complete f1 two-outer-row packet; all-f proof and actual caller remain separate.'},indent=2,sort_keys=True)) +if __name__=='__main__':main() diff --git a/research/literal-source-affine-move/review/root/original/ROOT-REVIEW.md b/research/literal-source-affine-move/review/root/original/ROOT-REVIEW.md new file mode 100644 index 0000000000..ce7fab993b --- /dev/null +++ b/research/literal-source-affine-move/review/root/original/ROOT-REVIEW.md @@ -0,0 +1,97 @@ +# Root proof and separate physical review of MOVE24476 + +Base: e54523517d0f03e58352e647c403a5af3e525a57. +Author freeze SHA256:9645d873c995412d0ef6ab8287ae10eb63350add45263883c3cd574b4e1a1bde. + +## Decision and exact scope + +The frozen generic fixed monomial composition and actual selected public +MOVE24476, frames3=[] to470=[75,137,265], pass this scoped proof/source and +physical review. The false Boolean is ownership metadata, not inversion. +The right monomial has offset5 and constant2. Prior MOVE24472 already has +offset1/phase1, so this is not the first nonzero-offset or constant-phase +join. Earlier algebra/coded-child work in #6978 is retained and credited. + +The construction requires supplied Gamma6/DATA, owners, origins, scratch, +actual3f cutoff and numerical prefix/phase-fit conditions. The separately +reviewed complete-root corollary derives the numerical conditions only if +an actual producer supplies the retained selected row invariant and correct +view. It does not provide that producer, packing, owner grant or cutoff. +No selected assumption or complete multiplication bound is discharged. + +## Mathematical and implementation obligations inspected + +For a monomial |x> -> i^(a+q(x)) |Gx XOR b>, phase precedes G and output +translation follows G. On f columns the scalar becomes i^(af). The retained +phase initializer cycles by a for each unary-f mark; its per-column quadratic +term retains its input coordinates. The outer chronology is right monomial, +three positive selected-slot C services, then left monomial. It tensors +products, never exterior sums or register coefficients. The signed phase +promise includes every actual component negation, not just a final endpoint. + +The source-bound core flattens all components into one original-owner +transaction: helpers act only on WORK and reuse retired private ports. +The leaf's highest port28 maps to30, preserving31 core tapes. The joint guard +is3f<=cutoff while the original f and all9f axes remain unchanged. The +cutoff's bit length is paid; its numeric value is not a runtime loop bound. +The successful HOME wrapper embeds the complete native table on35 tapes. +All setup/reservation/B1 transport and old historical backing remain explicit. + +The complete actual component sum has73 CNOTs in8 fixed words, two phase +passes, three C leaves, one X0, one joint guard and one outer transaction. +I independently added the retained ceilings:9,000,991 fV +462,848 E +462,875, +which is below2^25(fV+E+1). The history sum is1320(V+E+1), below2048; +HOME adds64(F+1), giving2112(F+1). A generic fixed monomial's corresponding +sum4,532,255 fV+94,208 E+94,235 fits2^24, with488<512 history units. +These are direct leaf bills; they do not supply the selected nonleaf tariff. + +## Separate exact oracle and machine execution + +The root checker imports the emitted adapter/core graph, not the author's +CPU, factor-action oracle or native gate-state interpreter. Every native +instruction is independently checked against its Graph embedding. A separate +sparse CPU interprets the local rules with independently shifted origins, +opaque exteriors, a retained old guide span and a parked productive HOME. + +For the arithmetic oracle, an explicit set-of-span-values procedure completes +the original ordered frame (75,137,265) to a binary basis B. Inverse coordinates +are enumerated, not obtained from the contributor's Clifford compiler. +For K=D_Q P_B, the original frame is K C^tensor3 K^-1. Direct matrix entries +are computed as + + i^(q(y)-q(x)) (1+i)^(3-h) (1-i)^h /8, + +when y XOR x is a combination of the first3 basis vectors with Hamming weight +h, and zero otherwise. This is a closed original-frame kernel; it does not +apply the emitted right/left monomials, their affine offsets or their CNOT +lists. The source convention and absolute phase are separately checked by the +independent review role on all512 basis inputs with convention mutants. + +The fresh root packet has f=1, r=1, P=2, S=1, width10 and cutoff3. Its1024 +Gaussian entries are multiples of8 with absolute components at most24, so +the simple3-axis sufficient prefix reserve fits signed10bits. V=20,480 and +E=16. The independent CPU executes118,744,836 transitions through139,100 +Graph states. Exactly20,496 HOME writes occur after complete primitive +return, and none earlier. All35 heads/private bodies/guards/exteriors return; +the parked HOME is unchanged. Recorded visited-span history grows from +141,033 to433,541 without refunding the prior guide span. Input/output/core +hashes and the source chart are retained in RESULT.json. + +This is one complete f1 execution with two outer rows, not an all-f machine +execution or proof of operator identity from one dense input. The separate +exact512-column source review and written tensor/loop invariants supply the +remaining mathematical evidence. Numerical rejection cleanup/retry remains +unclaimed; the author checks valid-format cutoff, late arithmetic and wrong +phase behavior separately. + +Run with the explicit implementation directory: + +```sh +python3 -I -B -W error review/root/check_source_move_root.py implementation +``` + +Prepared for @CubeJerry with substantial OpenAI ChatGPT/Codex assistance. +The construction is shared across review roles. This is disclosed independent +implementation/arithmetic checking, not blind or human review and not a +formal-kernel proof. The actual caller, source/header/view production, +complete owned lifetime and faster recursive supplier remain open. No new kappa. diff --git a/research/literal-source-affine-move/source/selected-final.json.gz b/research/literal-source-affine-move/source/selected-final.json.gz new file mode 100644 index 0000000000..74563a7867 Binary files /dev/null and b/research/literal-source-affine-move/source/selected-final.json.gz differ