diff --git a/research/modular-port-borrowing/BASE-SELECTION.json b/research/modular-port-borrowing/BASE-SELECTION.json new file mode 100644 index 0000000000..f451ced662 --- /dev/null +++ b/research/modular-port-borrowing/BASE-SELECTION.json @@ -0,0 +1,194 @@ +{ + "status": "Maintainer-reviewed conditional finite construction; see the integration receipt for publication and PR resolution status", + "kappa": "1672188119205421/1000000000000000000", + "decimal": "0.001672188119205421", + "source_prs": [ + 1042, + 1031, + 1028, + 1022, + 1018, + 1005, + 1004, + 987, + 942, + 890, + 870, + 869, + 858, + 799, + 741, + 699, + 685, + 676, + 664, + 660, + 659, + 656, + 655, + 653, + 658, + 649, + 645, + 635, + 589, + 555, + 545, + 626, + 623, + 622, + 620, + 617, + 615, + 604, + 601, + 596, + 592, + 591, + 593, + 599, + 588, + 543, + 584, + 586, + 583, + 582, + 579, + 576, + 575, + 574, + 571, + 569, + 568, + 567, + 564, + 562, + 561, + 559, + 558, + 552, + 550, + 548, + 541, + 535, + 510, + 503, + 531, + 523, + 493, + 514, + 507, + 484, + 496, + 505, + 522, + 520, + 472, + 458, + 445, + 442, + 425, + 433, + 370, + 361, + 315 + ], + "source_manifest": "research/community-frontier1042-audit/SELECTED-SOURCE.json", + "certificate": "research/community-frontier1042-audit/ASSEMBLY.json", + "certificate_sha256": "093f35445812ea96fe1bfe6a3af7d769cb7f274e08f4fb30f71a17ed1161e54e", + "proof": "docs/research/community-batch1047-review.md", + "proof_supplements": { + "research/e8-bit-r420/README.md": "9807be57c6adf26b30e4f54e2f8160075bbc05091f1a6d157e43d2a4620c1c9f", + "research/complex-571-free4fc8/NOTICE.md": "a4c084abdc1c7a9ac683eeb11124335d51cff8a6deba6ee92ba5a12bceaa2c97", + "research/complex-multicold/proof/CONSTRUCTION.md": "27ece5e1c11b90d97a808b56eff897b998c10e61016db95867f84e6e6aef132f", + "research/complex-multicold/vendor/pr559/PROOF.md": "d5d498edc56fdef8c5798af7f5ec66948bd2f66c553b9efe366cdaab01bd3453", + "research/structural-gain/frontier-composition/README.md": "70f0f791cbe3b2603f85d85bb9055aa0ee1df6dc06ba82fc1921356948312887", + "research/complex-joint-prefix/proof/CONSTRUCTION.md": "a92e610e7a598d99c612d1b63d1a03a49c0cd1e15ddd29fa55c465ddd8c18105", + "research/kernel-frame-coalescing/PROOF.md": "fa8b2f36b9590ee80ff45d3f7724f8c7de8ad29a29f366d5133010c77e41fe1b", + "research/complex-571-hpeq5/README.md": "4000b37f6c07c09d971dc4010ceb137c13340f3a8809d3272046ccaf746c3e2b", + "research/hyperplane-end-lean/PROOF.md": "1cbce5cf0ff0152f71e8ae7bef25841d1ce13010af248ff7209182d2328c21c9", + "docs/research/community-hyperplane599-review.md": "3298cd0d451541508af232cac72efbd7c10580e6c6ad493a855ab0faa01ade8c", + "research/complex-571-cold14-b3/README.md": "1945785785c153c7d0e8d4c071adabe626c1091b71721ff85d2d67191b376b96", + "research/complex-571-cold14-b3/PROOF-NOTE.md": "1cf592cbc8ab8e21d2dd8c1e945a5c64c6d5cde1216fb06e05a36c1c6ec6613d", + "scripts/verify_cold617_interface.py": "95d7a9094c05ad975fb72f5ab7605593003245a503c8456764987e512028fa6a", + "docs/research/community-cold617-review.md": "b3f2bcbae1249f1f651032022ce1e6e2bfb3f563ce580bf53671f50a074d7046", + "research/complex-k492-owner-repair/README.md": "ee5a1ace4828f7a073be97e95c2d931988774dd3a29a877e65abdf429aeec902", + "research/complex-k492-owner-repair/PROOF-NOTE.md": "337d70fe7abd9afca1d90954c23bde87f4dc27888cc1a6b4bb80506fd6fbf8c5", + "research/complex-k492-owner-repair/PROOF-NOTE-R.md": "22312bb347bdf159e6a01a45c47675e6170d33b258e2fd9ed52aee88fb92c0ed", + "docs/research/community-k492-review.md": "3b731d30e80010b15408a289b0b32192700885474c8b36d48ee3320a7a8c5c47", + "scripts/verify_frontier626.py": "2207bd0ef04a19ef276869085afdedad80a0938fa75db5e1aa7ab73fd3429444", + "scripts/verify_frontier626_bindings.py": "cda63ff41c6d6e2e352c7bf75b84e690c0ce57e4ec6c0355573bb5d9b1f98280", + "scripts/verify_frontier588_bindings.py": "6d1932eea7b1936598118ea8e607b09c29b6e31b749ec41bbe0744ea4f0b606d", + "scripts/verify_hpe_lean_binding.py": "52aa1d23641e4c716b43c98f6b883ad042087dd03a9d01369e8e6a735b07aa03", + "research/hyperplane-end-lean/HyperplaneEnd/Exact.lean": "eebf3a3982af7ab9be45777b272a6aaa523206fa7667ceb6df63ad6589fd8183", + "docs/research/community-frontier741-review.md": "4634694fa75ea9e749ecf19d3db3e4d82effe3b61a2efdf08ac5a97275fb676a", + "research/complex-sw4-frame8/PROVENANCE.md": "c7648719b01dd93af2c3a2c6e951a54711d13892dc4bd4339d16edb4c37c9bf0", + "research/e8-bit-p111-tuned/tune/README.md": "46c7917fb252949f38b7bcd88cf568efc282e3ea065b61d11e457e41673d0b2d", + "scripts/verify_frontier741.py": "215ee6a12de8dc2392e6811a1b8f2140035f6b2d2a0d2100ff4bd2fdcb8bb39b", + "scripts/verify_frontier741_bindings.py": "eff455167e2fd0bc9a67d35241d0e69d8edc58f3a23e776dcfe8f500ca8e8d67", + "docs/research/community-frontier799-review.md": "bd91c10c67f2a873fd456b95cbb43f715a43dac0e0a66938737d591c6b754052", + "scripts/verify_frontier799.py": "19fe1b32079095160dc00fe2f7df75e0fcbc82cff37f7159b755c8a63bd5ce99", + "scripts/verify_frontier799_bindings.py": "43897b3c99212d6134870898a1840f32898aa1b3679b299e654901568ad7e19b", + "research/gauge44-frames-x/PROOF-NOTE-FRAMES-X4.md": "39c50420ebb6e8813706a49b2cf759f277c4afac9f6780fc0a7ac6a5fb86e036", + "docs/research/community-frontier890-review.md": "cd03b7c2c6c09db2cfa89ae40133ae44e1deb6e32ec5ddd23aacecc9c50f2fea", + "scripts/verify_frontier890.py": "88ea38dbef62dd7c0dd46e212618520cc89213edddb2032800e5509993958175", + "scripts/verify_replay_coverage.py": "babe5941d7e6dac4248613ef01f950ee7bb6199e7355021aea4cf854fd1b91c5", + "scripts/verify_frontier741_bridge_coverage.py": "9a14f26762b6126eb54ed43db90371773374fe98733ada80ee871a74afa3b836", + "certificates/replay-coverage/pr741-sw4-v1.json": "7acd5033bc78e3f473718269edaa267c2785d84fbe95ccf6815a33dcf58c2756", + "research/complex-t21-owners/PROOF.md": "78721b32fceb34b21b8e77c95381c38c60276e72e6d9c2e9c6262cb347457def", + "research/complex-t21-owner-bound/PROOF.md": "2aa0aa6ec1d87402138564c38749b5ca0f058c16817efdf58a2685d2d90cb417", + "research/gauge44-barch/PROOF-NOTE-BARCH.md": "c24f211b09358b25d6cf47dd18e4bbd8bcf4ecf279e6f1c6c90613cfa230818d", + "research/complex-double-replica-owners/PROOF.md": "db99599e3966bec253c577c23915e2a2899c4c4e8568044efc11c7918b137bbc", + "docs/research/community-batch952-review.md": "04db59dfc2c31453229b6061bbf59547e71ce3abdc0ce0f6779144bb0dde127b", + "scripts/verify_frontier942.py": "27c6713532d9f53f55dfff4884d55a2d9ae74b68156e37a44596c0418fbed5b7", + "research/complex-t37-owners/PROOF.md": "09b39ad0d5f1f59f54dcff15c16640f7a7acf27e6597660acaf957b95c7e8510", + "research/complex-t37-owners/ALL-T-PROOF.md": "4c0c71ccd0afb850538af1b467e5208b7eb3edd0260fded84e02a8c01dfc868b", + ".github/workflows/t37-owners.yml": "c13acc2902c007237103072b7ec10caf5ca21c1b319d27934f194af2f7d87026", + "docs/research/community-batch1047-review.md": "a6271faf5db0afe3ff7d24a34a3be7a959cdc33ee37784572fba014ee5358787", + "scripts/verify_frontier1042.py": "700fdcaeb6e8f57f6e63c71c2dd1652fc5b183e8d706cd092779bdc0d271e854" + }, + "review": "docs/research/community-batch1047-review.md", + "validation": "docs/research/community-batch1047-integration.json", + "reproduce": "make frontier1042-verify", + "scope": "Finite composition under inherited all-size/compiler, common-label/mutable-source, whole-call hosting, precision/tape, analytic and bit H1-H5 assumptions. Not a full Lean multiplication theorem.", + "previous_kappa": "1661960547713947/1000000000000000000", + "previous_record": "certificates/checkpoints/frontier942.json", + "audited_source_head": "7e8ef087c02a77038a28a337a7ee3a77039cac0d", + "reviewed_dependency_heads": { + "588": "6d0e53b66c29abd17981881a09eaff41ac862d85", + "543": "2065fe4f72a914d907f1046603f5a36f17018535", + "568": "71c99ac935a33bb7b59a1b4a7af8725a939b0b90", + "569": "1424da81263a5305b35e4cf74ef686c275f03f3f", + "571": "b7bdc5a8de18fcf418cfb9c7d83a2b1097a5e4a3", + "575": "eac6f7e378ab622dac50a2fd4b7ef6eab014de44", + "583": "89be768f0157f5a3d8e4db69cf1748768605eac9", + "586": "4846fee5b06af770e9b3a10c36200f673d656725", + "591": "f622547244bf6d895a571a7b035142ba66279806", + "592": "1f471c445c06a45a32e2c47e8d74c8264b68356b", + "593": "fdb6dcc6d7bc29764c5b6b4d32b7fa050acf74a4", + "596": "7732dd5e46863ff294b5e443661cb9d99abf4e01", + "599": "bc13c8a3e000442606bd2dbe8583a17649ba6c32", + "601": "529ab7dcb59d5ea7a5798e9e06cf5b3aee8a1550", + "604": "1b795c5d7dea746ba310572585c0ef067574b4a6", + "615": "bf8a49a34350599763cced8592db81dc62c2c1c0", + "617": "904d62855723c00f8acef9a287a10768598fdeb2", + "622": "f69477f4f6d3c7eb1f740b166881bffed4ffa9f6", + "623": "e39a615ca601ce5d62abeb24f3fcdb8644ca1005", + "626": "660de893d27bb7abd1d5b01b1640207528a5c851", + "589": "a5afc8c6169ea61ba7c51dfd3cade02cc7b13b46", + "741": "e516b1463606840a15f80aac1995d64ce0092e89", + "799": "80e6463157cfc80b85af09e7e2f14748fe2dac60", + "858": "ae2e25fee91540c83ceee5a60e3b07422ce21c7d", + "869": "73e86f69bf9a391e3c334999f7bbe3825dc42759", + "870": "b734850dc348800942f0ffd1f0723fdec7539b2b", + "890": "4b3bd8cbe8e3e81c44161017c9b72c905a8040a8", + "942": "1960cfa919a0945d0ca4cb14ea96237000037903", + "1004": "1974578f82a30158dd5fcdcdf226b83df8e7196f", + "1005": "779e80aef469bc3a28b19f1adde199871a9a22e3", + "1018": "eac7547cb191f875d5f5ea5f9bbb1d2b8c51c4ef", + "1022": "58618bcbfe88a252467755fc283c04c3db5ca4fd", + "1028": "be4bd89cb4483dcee43257200cd27601f938f13d", + "1031": "e900534f0beda892c726723524203b97471fb9a3", + "1042": "7e8ef087c02a77038a28a337a7ee3a77039cac0d" + } +} diff --git a/research/modular-port-borrowing/CASE.json.gz b/research/modular-port-borrowing/CASE.json.gz new file mode 100644 index 0000000000..70700a5b01 Binary files /dev/null and b/research/modular-port-borrowing/CASE.json.gz differ diff --git a/research/modular-port-borrowing/CERTIFICATE.json b/research/modular-port-borrowing/CERTIFICATE.json new file mode 100644 index 0000000000..cabc1a65a9 --- /dev/null +++ b/research/modular-port-borrowing/CERTIFICATE.json @@ -0,0 +1,1938 @@ +{ + "additional_dense": { + "cases": 144, + "sha256": "60847f37185f85e52fb61b5cc0f1a3605fc7c14968bbb6104a57e95d8b3c369e" + }, + "all_trees": { + "cases": 5280, + "columns_per_case": 10, + "leaf_prefixes": 528302, + "long_cases": [ + { + "columns": 10, + "integer_basis_prefix_peak": "58", + "leaves": 48, + "n": 8, + "recursive_returns": 57, + "sign": 1, + "transcript_sha256": "4ce860be73a90e7cb36921292eb40e0554eef6e08414aaa8e121058c6fab36a1", + "width": 12 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "52", + "leaves": 48, + "n": 8, + "recursive_returns": 57, + "sign": -1, + "transcript_sha256": "80a1a08a3d0a15106770e182bf0631eb4e240ce7fdeb0cc274bef89301689c23", + "width": 12 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "92", + "leaves": 60, + "n": 9, + "recursive_returns": 73, + "sign": 1, + "transcript_sha256": "179ebb9af12f65cd1ba9e75a1711b7078dab77b17d49614933bcad32372d0f53", + "width": 13 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "100", + "leaves": 60, + "n": 9, + "recursive_returns": 73, + "sign": -1, + "transcript_sha256": "0c1fc215f8835747df28eba1221ce3aaca831f08a2778e3be09ae8bd315d9d3c", + "width": 13 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "152", + "leaves": 72, + "n": 10, + "recursive_returns": 89, + "sign": 1, + "transcript_sha256": "b919f89f8b37ff8212280605b2bc265fe93e55c8f692520ebe412219fbd113d3", + "width": 14 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "162", + "leaves": 72, + "n": 10, + "recursive_returns": 89, + "sign": -1, + "transcript_sha256": "cf90a2f1ea316126cf48163b7097ce18624083f98b8699353da401a9c7733629", + "width": 14 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "329", + "leaves": 84, + "n": 11, + "recursive_returns": 105, + "sign": 1, + "transcript_sha256": "d6ff2d46ed6448b36f9fb0d5b544bf0e583061bbb58dd4f7165ce159c0bd7978", + "width": 15 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "317", + "leaves": 84, + "n": 11, + "recursive_returns": 105, + "sign": -1, + "transcript_sha256": "1eda2213e3d3c26da27bfd780dad35e6f07476c635e530b1e40a10f2d897f6f7", + "width": 15 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "887", + "leaves": 96, + "n": 12, + "recursive_returns": 121, + "sign": 1, + "transcript_sha256": "ddaea405a565f9ce26590a5736d798fbf2587cb376e7b52246ea17a047483852", + "width": 16 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "909", + "leaves": 96, + "n": 12, + "recursive_returns": 121, + "sign": -1, + "transcript_sha256": "d9f104e5d4ea9dc563be3a806a91f8a7bb25e9f8b1defb6411dd0b2b0438f058", + "width": 16 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "1586", + "leaves": 112, + "n": 13, + "recursive_returns": 137, + "sign": 1, + "transcript_sha256": "8fd5e0240d5b7f993d1000a41bd0562afb4d52d418e2380db6aaf603c4c70cad", + "width": 17 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "1608", + "leaves": 112, + "n": 13, + "recursive_returns": 137, + "sign": -1, + "transcript_sha256": "ea471ee7ba81427e71d240f11e62a7cc1a619c4c4632696eb77bdf99f42fcfd2", + "width": 17 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "2340", + "leaves": 128, + "n": 14, + "recursive_returns": 153, + "sign": 1, + "transcript_sha256": "057c5de47f694334657354c5e624d4d7d3407b74f97657ba6ca98730a81a928c", + "width": 18 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "2362", + "leaves": 128, + "n": 14, + "recursive_returns": 153, + "sign": -1, + "transcript_sha256": "08c1034ed8501d9cafa5d70f7f68df8074ed6115bb1f751d2b545aaabc05f7b9", + "width": 18 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "4192", + "leaves": 144, + "n": 15, + "recursive_returns": 169, + "sign": 1, + "transcript_sha256": "783c8a3d1d3ff550ca555ec659a40526f5e6baec11650ca0513647c1a91a3434", + "width": 19 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "4170", + "leaves": 144, + "n": 15, + "recursive_returns": 169, + "sign": -1, + "transcript_sha256": "ffb5741b2dfa233152fde29ef946dc7f722e33708d7c60c6ad9a0e28b2a70b8a", + "width": 19 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "9745", + "leaves": 160, + "n": 16, + "recursive_returns": 185, + "sign": 1, + "transcript_sha256": "714d2a32a922a6df461314256e8a24f14e0762da7bdaf465406583958d1aac19", + "width": 20 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "9707", + "leaves": 160, + "n": 16, + "recursive_returns": 185, + "sign": -1, + "transcript_sha256": "6eb8adc1b7ae99209523eeb58b6ddeba36d7c7d177617e4c7140cae9aef9392b", + "width": 20 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "21567", + "leaves": 176, + "n": 17, + "recursive_returns": 201, + "sign": 1, + "transcript_sha256": "23a3ea8b626182a0e26e77ee8a4c218dc761c6a9dfcbed954110118b70bb0358", + "width": 21 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "21463", + "leaves": 176, + "n": 17, + "recursive_returns": 201, + "sign": -1, + "transcript_sha256": "5bd5bae334710b2292714f9837817f2c4fe6f04a93da7b0a106141c013708f78", + "width": 21 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "39655", + "leaves": 200, + "n": 18, + "recursive_returns": 233, + "sign": 1, + "transcript_sha256": "afa6d8c777051b1e6be158879ef5b206500999b8bfb4ae5a26e496cb0aacb2d4", + "width": 22 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "39551", + "leaves": 200, + "n": 18, + "recursive_returns": 233, + "sign": -1, + "transcript_sha256": "c4b2add2ab094c1de1abb7bbdb39770252a83d0fc65689ad7f6792ad84a45a8b", + "width": 22 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "56275", + "leaves": 224, + "n": 19, + "recursive_returns": 265, + "sign": 1, + "transcript_sha256": "d62585c816ccb5641142e047d98c18386ebbf69d18ed40bb922d157125c38210", + "width": 23 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "56379", + "leaves": 224, + "n": 19, + "recursive_returns": 265, + "sign": -1, + "transcript_sha256": "a907c0164cf862e9544a2a168ffa247dd66bd1673f172475e33902e79f1af297", + "width": 23 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "103630", + "leaves": 248, + "n": 20, + "recursive_returns": 297, + "sign": 1, + "transcript_sha256": "373aedee983f37abae33d0ee0f63b619b215cccd920d305e1120264dcefb85cf", + "width": 24 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "103734", + "leaves": 248, + "n": 20, + "recursive_returns": 297, + "sign": -1, + "transcript_sha256": "6887174d14efe860d6cc577d54574ab50fa219e1b0bef734d3c2c319356a4774", + "width": 24 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "147414", + "leaves": 272, + "n": 21, + "recursive_returns": 329, + "sign": 1, + "transcript_sha256": "e7c57f6f26d3e7e404b8471a7a68bee871ce95ee8f9a48a4f6e5c934a24c83f1", + "width": 25 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "147518", + "leaves": 272, + "n": 21, + "recursive_returns": 329, + "sign": -1, + "transcript_sha256": "0357e0c59fa3b1bd77e4f15c6f2d36c25a0daa78066e3f11aadfdfba6dd40d36", + "width": 25 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "271495", + "leaves": 296, + "n": 22, + "recursive_returns": 361, + "sign": 1, + "transcript_sha256": "ced75687f994ba9f6cba525b1d0f3d3ffd8e63236fe8186ec110805f1641055c", + "width": 26 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "271391", + "leaves": 296, + "n": 22, + "recursive_returns": 361, + "sign": -1, + "transcript_sha256": "ff48d2447f9ea356368ba0b35b9efcbc856de6017d8bc77752bdfcc1d98ab598", + "width": 26 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "386123", + "leaves": 320, + "n": 23, + "recursive_returns": 393, + "sign": 1, + "transcript_sha256": "1c03883c19f27c15f5ecedfe45ec3e5923982ffac6c7f513ed9323f9327b0713", + "width": 27 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "386019", + "leaves": 320, + "n": 23, + "recursive_returns": 393, + "sign": -1, + "transcript_sha256": "d4c17b643367b34d906a97199e9762b55d04ed8dc268a829fb97187ad7dc84fb", + "width": 27 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "710699", + "leaves": 344, + "n": 24, + "recursive_returns": 425, + "sign": 1, + "transcript_sha256": "af0349772b774befe05d20583bc069095e2aa9647889af00272de3b2ac1da8ac", + "width": 28 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "710595", + "leaves": 344, + "n": 24, + "recursive_returns": 425, + "sign": -1, + "transcript_sha256": "3d618dcbf27e0c2a7ea2dd5601a9fcb5af120b390e713d398f34fd4567124197", + "width": 28 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "1871523", + "leaves": 368, + "n": 25, + "recursive_returns": 457, + "sign": 1, + "transcript_sha256": "983de73899de274af40a8e5c60dc2a977569a3be7c1ed53b3c5aa160cbac407e", + "width": 29 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "1871365", + "leaves": 368, + "n": 25, + "recursive_returns": 457, + "sign": -1, + "transcript_sha256": "780f2531b087317353f7d590c32db8a989a1d2f5fdd29750365cdc1f06e57e52", + "width": 29 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "6020551", + "leaves": 392, + "n": 26, + "recursive_returns": 489, + "sign": 1, + "transcript_sha256": "241d8f1f2839a25de0e8cf22580c692df9a257826ed8ae05d4ade8d4a3d95c74", + "width": 30 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "6020845", + "leaves": 392, + "n": 26, + "recursive_returns": 489, + "sign": -1, + "transcript_sha256": "3f99b7876ce80e77ec868a5c427eaad8fc3e5b820013637be0a938ba51ea7b5c", + "width": 30 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "7367169", + "leaves": 416, + "n": 27, + "recursive_returns": 521, + "sign": 1, + "transcript_sha256": "83fc9b0ebfa1e6432a5f0f92118f70f513d1089337d279748d421457d1f94196", + "width": 31 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "7366765", + "leaves": 416, + "n": 27, + "recursive_returns": 521, + "sign": -1, + "transcript_sha256": "e558dd152343514b61be128826b3291e365b812814d93af5aac1d0d9e231939d", + "width": 31 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "32039863", + "leaves": 440, + "n": 28, + "recursive_returns": 553, + "sign": 1, + "transcript_sha256": "9bd5ace3b4712c656f6024b93f269a601baf75123df8e49a8bb143ea233bdad0", + "width": 32 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "32038165", + "leaves": 440, + "n": 28, + "recursive_returns": 553, + "sign": -1, + "transcript_sha256": "c62c384ab739b26d4e042cbd6a8fb764c88f68a23a34503f5bdda116fd9ebba8", + "width": 32 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "57541746", + "leaves": 464, + "n": 29, + "recursive_returns": 585, + "sign": 1, + "transcript_sha256": "63d969151732495a976e89a5ebd39901caf2f44a69a99f8740c702afd23cec1d", + "width": 33 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "57544452", + "leaves": 464, + "n": 29, + "recursive_returns": 585, + "sign": -1, + "transcript_sha256": "82b721a5051ab786c6bd21236dbb97d9a933691c9ba0f298290752ed87cef597", + "width": 33 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "83334986", + "leaves": 496, + "n": 30, + "recursive_returns": 617, + "sign": 1, + "transcript_sha256": "332052d445e549e73cf1e26865ea65b7afc23f10659cb00c794d5c84f8debd4f", + "width": 34 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "83337692", + "leaves": 496, + "n": 30, + "recursive_returns": 617, + "sign": -1, + "transcript_sha256": "b5b0e60a1173779afe1e19aad10ce92adf48ea4c4e1c42a9b19e3fc4b653bf0e", + "width": 34 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "150648436", + "leaves": 528, + "n": 31, + "recursive_returns": 649, + "sign": 1, + "transcript_sha256": "ee22dba460c2053d1bdcbef85cb6fb2b4488b43a036894a29f09d38cb9ed2122", + "width": 35 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "150651142", + "leaves": 528, + "n": 31, + "recursive_returns": 649, + "sign": -1, + "transcript_sha256": "3cb48d78047a1de973a36930acffa3cbb599c685859230044c10a91f275d8b5b", + "width": 35 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "218176015", + "leaves": 560, + "n": 32, + "recursive_returns": 681, + "sign": 1, + "transcript_sha256": "42ecafab3a459fa63bce311f0128e07be88a5f44fd36cb7f464ca36451464ce3", + "width": 36 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "218178721", + "leaves": 560, + "n": 32, + "recursive_returns": 681, + "sign": -1, + "transcript_sha256": "bcbf7438ca025f7590cef03ffc6804159b7ead4f12eb0ddeee7cf301745afc67", + "width": 36 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "394407621", + "leaves": 592, + "n": 33, + "recursive_returns": 713, + "sign": 1, + "transcript_sha256": "227a49d632e164b645b669a3a6326551cea0b40f3c416f581c83e0e7e73b5598", + "width": 37 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "394404915", + "leaves": 592, + "n": 33, + "recursive_returns": 713, + "sign": -1, + "transcript_sha256": "e067caea4e00e8743105e11d3171bb9c73f0c8348cc43b09f4f290441f70e418", + "width": 37 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "571197118", + "leaves": 624, + "n": 34, + "recursive_returns": 745, + "sign": 1, + "transcript_sha256": "74a44b4e1ef356ee1a1bd22ba4573b6081916d0d44edf135638c12efb34532ec", + "width": 38 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "571194412", + "leaves": 624, + "n": 34, + "recursive_returns": 745, + "sign": -1, + "transcript_sha256": "3ab2ee4d72cbf5a57332bcb2ed5be7d4d8b7517c257e6148ce89e1170b2c2fda", + "width": 38 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "1032570368", + "leaves": 656, + "n": 35, + "recursive_returns": 777, + "sign": 1, + "transcript_sha256": "9f2bd2c14fe1484308949a45e783c9fd5963bdfa5dc1245c36f361dc976cce59", + "width": 39 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "1032567662", + "leaves": 656, + "n": 35, + "recursive_returns": 777, + "sign": -1, + "transcript_sha256": "32fbb41eb54241e3ef2b30fc4e8ae78c958289d0245eb77f42fb22d212676283", + "width": 39 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "1495408574", + "leaves": 688, + "n": 36, + "recursive_returns": 809, + "sign": 1, + "transcript_sha256": "0c4d94bf433613eefde18f49d1fc63955a862465c491e4166def02baacc9227a", + "width": 40 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "1495411280", + "leaves": 688, + "n": 36, + "recursive_returns": 809, + "sign": -1, + "transcript_sha256": "5b0c58ad2a6f2d34f86a1bbd33a998a60ae972a19574d59ca8de332fe91de53a", + "width": 40 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "4003782036", + "leaves": 720, + "n": 37, + "recursive_returns": 841, + "sign": 1, + "transcript_sha256": "08f7290addbd3e1d7c544ea4ffa8308a117a93162df7414b1538e830b21d4c17", + "width": 41 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "4003786140", + "leaves": 720, + "n": 37, + "recursive_returns": 841, + "sign": -1, + "transcript_sha256": "d4c7c78af74a8b1eee522cf8d6f9d5b277acd6d18ade77472ab28df92687929d", + "width": 41 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "9858292642", + "leaves": 752, + "n": 38, + "recursive_returns": 873, + "sign": 1, + "transcript_sha256": "4a44bd7cded02120b2b5696ffaead2f0af13cd1ed5c6b8c9adf5ede4ee4db242", + "width": 42 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "9858299762", + "leaves": 752, + "n": 38, + "recursive_returns": 873, + "sign": -1, + "transcript_sha256": "209e1dc42e70f001f50a8132f1ace8bc38bf30d495e55a483ca80f0c2b3f8f31", + "width": 42 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "14972513244", + "leaves": 784, + "n": 39, + "recursive_returns": 905, + "sign": 1, + "transcript_sha256": "00b9172ea17ebb41b055bd08cfbd1dba79d8b7cf8095568f43cc741ce116458c", + "width": 43 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "14972502420", + "leaves": 784, + "n": 39, + "recursive_returns": 905, + "sign": -1, + "transcript_sha256": "5e83621364485a3f54847c1f9eddb6e850ce99fea92e86d1a582ae7c386fda7d", + "width": 43 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "44394234396", + "leaves": 816, + "n": 40, + "recursive_returns": 937, + "sign": 1, + "transcript_sha256": "7055337c86a0d3c6f826e249b7e49bc5f9c11a2dcb097dd5e80a10f5bbec6e73", + "width": 44 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "44394266662", + "leaves": 816, + "n": 40, + "recursive_returns": 937, + "sign": -1, + "transcript_sha256": "316b3af7d3fcab0625b04692a523eee17852d08131a26a0b3ee279b297112d3b", + "width": 44 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "120118349651", + "leaves": 848, + "n": 41, + "recursive_returns": 969, + "sign": 1, + "transcript_sha256": "c7acdd0700660bb2568e08d006aed9725cfa17a5c1048ec77511924453cbc276", + "width": 45 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "120118437323", + "leaves": 848, + "n": 41, + "recursive_returns": 969, + "sign": -1, + "transcript_sha256": "0658d9054bdcaa7dbfbbfbec4fb0101b6c2a4d56eb413d76e711affa8a88ddd5", + "width": 45 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "217371239099", + "leaves": 896, + "n": 42, + "recursive_returns": 1033, + "sign": 1, + "transcript_sha256": "62ddfdf883faaa937f64b73b414f5939631e2d690b04337e34a4945272fc8f59", + "width": 46 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "217371326771", + "leaves": 896, + "n": 42, + "recursive_returns": 1033, + "sign": -1, + "transcript_sha256": "30dcd5a23486b7b3e7bac7e58434b0bb6dafbc6b9b463823afe3fecc72f4bb8c", + "width": 46 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "314474080659", + "leaves": 944, + "n": 43, + "recursive_returns": 1097, + "sign": 1, + "transcript_sha256": "8ad979eb55a758a25e1ac22e67f64268804ce1ad6306caf23444d3ad2c94ddc1", + "width": 47 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "314473992987", + "leaves": 944, + "n": 43, + "recursive_returns": 1097, + "sign": -1, + "transcript_sha256": "0e4446e5bf42b98b90d6b1d0d48abf191fa98bff693f983d5c2d7acf643a35fb", + "width": 47 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "569085450738", + "leaves": 992, + "n": 44, + "recursive_returns": 1161, + "sign": 1, + "transcript_sha256": "4282c8a44a9608fb3ab382c2df1f570b6601ea8b6cb090fd5e12e24ba85fc03a", + "width": 48 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "569085363066", + "leaves": 992, + "n": 44, + "recursive_returns": 1161, + "sign": -1, + "transcript_sha256": "4cfcdfb6e3c4e5a2191da4b4fab881e122a4b3eaff6edc373d1fdfea55c37fbb", + "width": 48 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "823303760818", + "leaves": 1040, + "n": 45, + "recursive_returns": 1225, + "sign": 1, + "transcript_sha256": "8debc630da67f452e3a329d3e68ede1a4d722f190b6a4b9bd44c829449df78f1", + "width": 49 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "823303673146", + "leaves": 1040, + "n": 45, + "recursive_returns": 1225, + "sign": -1, + "transcript_sha256": "93154b92ab2830c7daf58f645e18a35818181e21431e164e040445b210ce5e4c", + "width": 49 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "1489884981607", + "leaves": 1088, + "n": 46, + "recursive_returns": 1289, + "sign": 1, + "transcript_sha256": "87cccdef3c33f84839b43fafee03248f91b38c8782ef54a905189eb39b6430ac", + "width": 50 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "1489884893935", + "leaves": 1088, + "n": 46, + "recursive_returns": 1289, + "sign": -1, + "transcript_sha256": "059b1d4c96ebcba7da35183c8c6df6def3167fd522ed5ba14b58499d0bf7664c", + "width": 50 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "2155437070287", + "leaves": 1136, + "n": 47, + "recursive_returns": 1353, + "sign": 1, + "transcript_sha256": "28a2f675be8d10b465047878d6ca853cdce3bba9aeef591cefe7d230eefdfe08", + "width": 51 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "2155437157959", + "leaves": 1136, + "n": 47, + "recursive_returns": 1353, + "sign": -1, + "transcript_sha256": "ab264e6f9cc13396c554c9fa1931114c42a8ff5368ca9875cd7782b36a390827", + "width": 51 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "3900569362575", + "leaves": 1184, + "n": 48, + "recursive_returns": 1417, + "sign": 1, + "transcript_sha256": "9ff916fee7c50d6b4e75d96083a33e107aea76a2f2e782924f3af3d712f709b0", + "width": 52 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "3900569450247", + "leaves": 1184, + "n": 48, + "recursive_returns": 1417, + "sign": -1, + "transcript_sha256": "1b15d675b848ba08033d2454f28900c03123470fe0a515f8826bd4a5ae9974bb", + "width": 52 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "5643007581551", + "leaves": 1232, + "n": 49, + "recursive_returns": 1481, + "sign": 1, + "transcript_sha256": "cec4bcd337f933e84bdc7aeb41126ac73456f669ec76581e587eeac411714f9c", + "width": 53 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "5643007669223", + "leaves": 1232, + "n": 49, + "recursive_returns": 1481, + "sign": -1, + "transcript_sha256": "854d33db46cfcbe26e6963af345f85b915dc90746d6f1af345fdb796ef6c846f", + "width": 53 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "10211823325298", + "leaves": 1280, + "n": 50, + "recursive_returns": 1545, + "sign": 1, + "transcript_sha256": "74add013db5d8c5123ba7d5c7f403a51459ec250f17fbe636e09e74c59ad1e0c", + "width": 54 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "10211823237626", + "leaves": 1280, + "n": 50, + "recursive_returns": 1545, + "sign": -1, + "transcript_sha256": "387be952652fd682115cef3321a851704e8c3d0497944255d70ae0262f1942af", + "width": 54 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "14773585805874", + "leaves": 1328, + "n": 51, + "recursive_returns": 1609, + "sign": 1, + "transcript_sha256": "8bcb9db7c7808de72bd30557166c9c14c2ab8502a4ac1f6f0e90b762a9169d32", + "width": 55 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "14773585718202", + "leaves": 1328, + "n": 51, + "recursive_returns": 1609, + "sign": -1, + "transcript_sha256": "1a636b63ad1be3df44bbdc9e96b50d4a9a416288ac5b7b588f9313805e6ed5d4", + "width": 55 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "26734900481811", + "leaves": 1376, + "n": 52, + "recursive_returns": 1673, + "sign": 1, + "transcript_sha256": "655fece64b860b52ea0954e98f4ce68a004d9f1bfa78bcdb903d6bb253aa9625", + "width": 56 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "26734900394139", + "leaves": 1376, + "n": 52, + "recursive_returns": 1673, + "sign": -1, + "transcript_sha256": "094cbdef017620884a0344eb641675ee7be67c709dd3ce2cc1b2a609c7c31cd8", + "width": 56 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "38677749704563", + "leaves": 1424, + "n": 53, + "recursive_returns": 1737, + "sign": 1, + "transcript_sha256": "86c26aa0b5c04548b250c107bcbce4a041fda4b4f373fe794f893d3bf5630629", + "width": 57 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "38677749616891", + "leaves": 1424, + "n": 53, + "recursive_returns": 1737, + "sign": -1, + "transcript_sha256": "3010cd5abf204646392fad8a22946b4bf229ad6b6542702146fa06e66118a1a7", + "width": 57 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "69992877988627", + "leaves": 1472, + "n": 54, + "recursive_returns": 1801, + "sign": 1, + "transcript_sha256": "c99a8127f122b5b471786e2d852a013bf3e7afa1b61d1c94ab2bfd5f47e7ff41", + "width": 58 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "69992878076299", + "leaves": 1472, + "n": 54, + "recursive_returns": 1801, + "sign": -1, + "transcript_sha256": "1a1ba56076d74587cb4f4c2a11393fbc30db1728345f8832729319cca9a246d1", + "width": 58 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "101259663176307", + "leaves": 1520, + "n": 55, + "recursive_returns": 1865, + "sign": 1, + "transcript_sha256": "60a736e5ee1e9a6f4e4c6cee568659926ebd67b8e6735012c6b70d8a38ee3866", + "width": 59 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "101259663263979", + "leaves": 1520, + "n": 55, + "recursive_returns": 1865, + "sign": -1, + "transcript_sha256": "71a2e769f2518b066a876b149948bc93ec8eba9838d55ca57b1b152565e01881", + "width": 59 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "183243733615578", + "leaves": 1568, + "n": 56, + "recursive_returns": 1929, + "sign": 1, + "transcript_sha256": "8a5b5476bd283fdfea9eeded35f4aff2d3eb4a540672d4534bb57083c7899c4c", + "width": 60 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "183243733703250", + "leaves": 1568, + "n": 56, + "recursive_returns": 1929, + "sign": -1, + "transcript_sha256": "68ad782fff72f08e9ca3e7d07b9c3dc2edc0da1250edc52e326fc69ef6f23eaf", + "width": 60 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "265101240043538", + "leaves": 1616, + "n": 57, + "recursive_returns": 1993, + "sign": 1, + "transcript_sha256": "f75e2e845f59df360a4204a3ea3462e671bdfb3f8e7dd04c6d11d5d3e335d614", + "width": 61 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "265101239955866", + "leaves": 1616, + "n": 57, + "recursive_returns": 1993, + "sign": -1, + "transcript_sha256": "b45d253976a6a8a015e553d50bc81ef3ca2ba6193ec1e4005f200ab89900be78", + "width": 61 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "479738322989615", + "leaves": 1664, + "n": 58, + "recursive_returns": 2057, + "sign": 1, + "transcript_sha256": "33b2e5640b4ac8f722e2dbff44b0dd51a0cbc56fcaa0c67fb48dd12b546a3a12", + "width": 62 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "479738322901943", + "leaves": 1664, + "n": 58, + "recursive_returns": 2057, + "sign": -1, + "transcript_sha256": "56796904daff820f1546f2029c8493b93929d1639c3b99b6a6caac596f68150c", + "width": 62 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "1015766267834039", + "leaves": 1712, + "n": 59, + "recursive_returns": 2121, + "sign": 1, + "transcript_sha256": "ba83d536887f7d25af01b07442317162d3b591355862ab5749e1dd4c312ee9e3", + "width": 63 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "1015766267705023", + "leaves": 1712, + "n": 59, + "recursive_returns": 2121, + "sign": -1, + "transcript_sha256": "e889320b0a46da911a1c5b408cd2d2cfdb6c420afa6f1895a0345fd0ed3a7f01", + "width": 63 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "3202336981814741", + "leaves": 1760, + "n": 60, + "recursive_returns": 2185, + "sign": 1, + "transcript_sha256": "fdb35603376f0370360d987353e102d54054e1fb8db17eded3096d5e8cb92a13", + "width": 64 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "3202336981585589", + "leaves": 1760, + "n": 60, + "recursive_returns": 2185, + "sign": -1, + "transcript_sha256": "da028ecd22dafdac57f6a69689c613a81cff36175fed7019ef72372ee44aac5b", + "width": 64 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "6839469687179633", + "leaves": 1808, + "n": 61, + "recursive_returns": 2249, + "sign": 1, + "transcript_sha256": "14d1fb4749ecafd236ca18af56e7e63e36158ec7aca6bfefd0fe9f140f1f5d0e", + "width": 65 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "6839469687517025", + "leaves": 1808, + "n": 61, + "recursive_returns": 2249, + "sign": -1, + "transcript_sha256": "742d16a7bd1d84546aec4f93d062fc62a9f78b48d3a17bb8dffe0bd1191e9741", + "width": 65 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "22049645552848562", + "leaves": 1856, + "n": 62, + "recursive_returns": 2313, + "sign": 1, + "transcript_sha256": "d452c488e42927cde5c1c1b654cf1d58ca63d11e11e4d654bfcf1b5c5dbe2820", + "width": 66 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "22049645553448658", + "leaves": 1856, + "n": 62, + "recursive_returns": 2313, + "sign": -1, + "transcript_sha256": "befe8e9d47882bddb500307fbe80470deff3a7b781727f3fb2339cf6e4aea05c", + "width": 66 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "47197442404245470", + "leaves": 1904, + "n": 63, + "recursive_returns": 2377, + "sign": 1, + "transcript_sha256": "d251fa69ddfd793293afe734f97aaec0577186395a911460d075d2036e8921fc", + "width": 67 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "47197442405129150", + "leaves": 1904, + "n": 63, + "recursive_returns": 2377, + "sign": -1, + "transcript_sha256": "2d0c774df45ab45d2ac12ab24321c56ed6498c719c76e1798933aea85cb16e25", + "width": 67 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "83940862753008575", + "leaves": 1952, + "n": 64, + "recursive_returns": 2441, + "sign": 1, + "transcript_sha256": "7a5402f3070202794b29e773c16190a4360e9c2e3b39d6ff8a7ae6ca38a3338b", + "width": 68 + }, + { + "columns": 10, + "integer_basis_prefix_peak": "83940862751437127", + "leaves": 1952, + "n": 64, + "recursive_returns": 2441, + "sign": -1, + "transcript_sha256": "76cfc5e83e2d551473392d8e39d24b547461d8e7294a0f6404876962c230169b", + "width": 68 + } + ], + "recursive_returns": 667416, + "shapes": 861, + "small_trees": [ + { + "cases": 6, + "n": 1, + "receipt_sha256": "da9057ce755d47678c2b8d2ba7e38a48610d1704d47cfbc252ed121c621c061f", + "shapes": 1 + }, + { + "cases": 6, + "n": 2, + "receipt_sha256": "0b059b442e31c214ea812021e198f3b53869310f40da2f6409429b5a1acdc0de", + "shapes": 1 + }, + { + "cases": 18, + "n": 3, + "receipt_sha256": "7a133136f7df979c097cb6f380005c17e23aa51147ece0f73b3ed31664ee60ed", + "shapes": 3 + }, + { + "cases": 60, + "n": 4, + "receipt_sha256": "c7050bff40e479ce5517d77f6cb04c68e055d3700b38a8859490d07d27b91763", + "shapes": 10 + }, + { + "cases": 228, + "n": 5, + "receipt_sha256": "66385d1be93f320c12eb8185e33515dfd7f1a42c284a6384d7e98fae28c14f59", + "shapes": 38 + }, + { + "cases": 924, + "n": 6, + "receipt_sha256": "0746919ff155780310fcf29d5d2d968178626238e4fbfd128f1125915fd2572d", + "shapes": 154 + }, + { + "cases": 3924, + "n": 7, + "receipt_sha256": "30fd34a4a4aa5d9e33e0d20969e65a5cfb91fa6ee01503ef0330fb97bfb9aac5", + "shapes": 654 + } + ] + }, + "case_sha256": "ed3ff7af1243172307a86648324cff314c95a7ef7cd58c9b40186d2e6909653c", + "concrete": { + "bounded_negative": { + "execution": { + "accesses": 16512, + "commands": 52292, + "counts": { + "add": 8256, + "add_a": 5504, + "add_v": 2752, + "coeff": 5504, + "low": 13760, + "low_a": 5504, + "low_p": 5504, + "low_v": 2752, + "mul": 5504, + "read": 8256, + "write": 2752, + "zero": 8260, + "zero_a": 4129, + "zero_c": 1377, + "zero_p": 1377, + "zero_v": 1377 + }, + "data_bit_actions": 924672, + "head_bit_moves": 76431616, + "intercell_steps": 1332416, + "leaves": 1376, + "nontrivial_reductions": { + "a": 772, + "p": 1196, + "v": 1397 + }, + "work_bits": 283, + "work_peaks": { + "a": 144115188075855867, + "c": 72057594037927935, + "p": 5192296858534827340300120177508355, + "v": 144115188075855868 + }, + "work_widths": { + "a": 57, + "c": 56, + "p": 112, + "v": 58 + } + }, + "final": [ + [ + 72057594037927929, + 7 + ], + [ + 88103883182, + 142555077511 + ], + [ + 72057594037927933, + 72057594037927929 + ], + [ + 7, + 4 + ], + [ + 1, + 0 + ] + ], + "initial": [ + [ + 72057594037927929, + 7 + ], + [ + 7, + 72057594037927929 + ], + [ + 72057594037927933, + 72057594037927929 + ], + [ + 7, + 4 + ], + [ + 1, + 0 + ] + ], + "invoice": { + "accesses": 16512, + "address_bits": 8, + "address_events": 16512, + "coefficient_bits": 11648, + "commands": 52292, + "counts": { + "add": 8256, + "add_a": 5504, + "add_v": 2752, + "coeff": 5504, + "low": 13760, + "low_a": 5504, + "low_p": 5504, + "low_v": 2752, + "mul": 5504, + "read": 8256, + "write": 2752, + "zero": 8260, + "zero_a": 4129, + "zero_c": 1377, + "zero_p": 1377, + "zero_v": 1377 + }, + "data_bit_actions": 924672, + "data_bits": 560, + "decoded_target_cells": 2, + "head_bit_moves": 76431616, + "intercell_steps": 1332416, + "leaves": 1376, + "preparation_reductions": 212, + "program_bits": 17888, + "program_forward_and_rewind_bits": 35776, + "program_read_bits": 17888, + "program_record_bits": 13, + "work_bits": 283 + }, + "observed_integer_prefix_bits": 48, + "observed_integer_prefix_peak": "71482762837659", + "sign": -1, + "signed_output": [ + 88103883182, + 142555077511 + ], + "transcript_sha256": "80bceed93666f8876b2beb2991502ada1095af8f15defcb7e0b87258b050fdab" + }, + "bounded_positive": { + "execution": { + "accesses": 16512, + "commands": 52292, + "counts": { + "add": 8256, + "add_a": 5504, + "add_v": 2752, + "coeff": 5504, + "low": 13760, + "low_a": 5504, + "low_p": 5504, + "low_v": 2752, + "mul": 5504, + "read": 8256, + "write": 2752, + "zero": 8260, + "zero_a": 4129, + "zero_c": 1377, + "zero_p": 1377, + "zero_v": 1377 + }, + "data_bit_actions": 924672, + "head_bit_moves": 76431616, + "intercell_steps": 1332416, + "leaves": 1376, + "nontrivial_reductions": { + "a": 775, + "p": 1196, + "v": 1460 + }, + "work_bits": 283, + "work_peaks": { + "a": 144115188075855862, + "c": 72057594037927935, + "p": 5192296858534827340300120177508355, + "v": 144115188075855862 + }, + "work_widths": { + "a": 57, + "c": 56, + "p": 112, + "v": 58 + } + }, + "final": [ + [ + 72057594037927929, + 7 + ], + [ + 72057505934044768, + 72057451482850411 + ], + [ + 72057594037927933, + 72057594037927929 + ], + [ + 7, + 4 + ], + [ + 1, + 0 + ] + ], + "initial": [ + [ + 72057594037927929, + 7 + ], + [ + 7, + 72057594037927929 + ], + [ + 72057594037927933, + 72057594037927929 + ], + [ + 7, + 4 + ], + [ + 1, + 0 + ] + ], + "invoice": { + "accesses": 16512, + "address_bits": 8, + "address_events": 16512, + "coefficient_bits": 11648, + "commands": 52292, + "counts": { + "add": 8256, + "add_a": 5504, + "add_v": 2752, + "coeff": 5504, + "low": 13760, + "low_a": 5504, + "low_p": 5504, + "low_v": 2752, + "mul": 5504, + "read": 8256, + "write": 2752, + "zero": 8260, + "zero_a": 4129, + "zero_c": 1377, + "zero_p": 1377, + "zero_v": 1377 + }, + "data_bit_actions": 924672, + "data_bits": 560, + "decoded_target_cells": 2, + "head_bit_moves": 76431616, + "intercell_steps": 1332416, + "leaves": 1376, + "preparation_reductions": 212, + "program_bits": 17888, + "program_forward_and_rewind_bits": 35776, + "program_read_bits": 17888, + "program_record_bits": 13, + "work_bits": 283 + }, + "observed_integer_prefix_bits": 48, + "observed_integer_prefix_peak": "71535465267659", + "sign": 1, + "signed_output": [ + -88103883168, + -142555077525 + ], + "transcript_sha256": "043e79c20ff7eb0d84df7ca54a32f1656e687baca9c98f49fd0e65b7c38e2df8" + }, + "dirty_bits_negative": { + "execution": { + "accesses": 16512, + "commands": 52292, + "counts": { + "add": 8256, + "add_a": 5504, + "add_v": 2752, + "coeff": 5504, + "low": 13760, + "low_a": 5504, + "low_p": 5504, + "low_v": 2752, + "mul": 5504, + "read": 8256, + "write": 2752, + "zero": 8260, + "zero_a": 4129, + "zero_c": 1377, + "zero_p": 1377, + "zero_v": 1377 + }, + "data_bit_actions": 924672, + "head_bit_moves": 76431616, + "intercell_steps": 1332416, + "leaves": 1376, + "nontrivial_reductions": { + "a": 699, + "p": 1200, + "v": 1274 + }, + "work_bits": 283, + "work_peaks": { + "a": 144114957416895179, + "c": 72057594037927935, + "p": 5192296858534827052069744025796615, + "v": 142549348570570319 + }, + "work_widths": { + "a": 57, + "c": 56, + "p": 112, + "v": 58 + } + }, + "final": [ + [ + 72057594037927929, + 7 + ], + [ + 88103883182, + 142555077511 + ], + [ + 38668552545597125, + 53469933108250195 + ], + [ + 4907693372841381, + 20215122225234527 + ], + [ + 63348393985569636, + 162992423163564 + ] + ], + "initial": [ + [ + 72057594037927929, + 7 + ], + [ + 7, + 72057594037927929 + ], + [ + 38668552545597125, + 53469933108250195 + ], + [ + 4907693372841381, + 20215122225234527 + ], + [ + 63348393985569636, + 162992423163564 + ] + ], + "invoice": { + "accesses": 16512, + "address_bits": 8, + "address_events": 16512, + "coefficient_bits": 11648, + "commands": 52292, + "counts": { + "add": 8256, + "add_a": 5504, + "add_v": 2752, + "coeff": 5504, + "low": 13760, + "low_a": 5504, + "low_p": 5504, + "low_v": 2752, + "mul": 5504, + "read": 8256, + "write": 2752, + "zero": 8260, + "zero_a": 4129, + "zero_c": 1377, + "zero_p": 1377, + "zero_v": 1377 + }, + "data_bit_actions": 924672, + "data_bits": 560, + "decoded_target_cells": 2, + "head_bit_moves": 76431616, + "intercell_steps": 1332416, + "leaves": 1376, + "preparation_reductions": 212, + "program_bits": 17888, + "program_forward_and_rewind_bits": 35776, + "program_read_bits": 17888, + "program_record_bits": 13, + "work_bits": 283 + }, + "observed_integer_prefix_bits": 90, + "observed_integer_prefix_peak": "329983502477123724038305459", + "sign": -1, + "signed_output": [ + 88103883182, + 142555077511 + ], + "transcript_sha256": "164aa30d939f5142e13959f5ada768818c2a32b8c57f80b121a94c39e219d03c" + }, + "dirty_bits_positive": { + "execution": { + "accesses": 16512, + "commands": 52292, + "counts": { + "add": 8256, + "add_a": 5504, + "add_v": 2752, + "coeff": 5504, + "low": 13760, + "low_a": 5504, + "low_p": 5504, + "low_v": 2752, + "mul": 5504, + "read": 8256, + "write": 2752, + "zero": 8260, + "zero_a": 4129, + "zero_c": 1377, + "zero_p": 1377, + "zero_v": 1377 + }, + "data_bit_actions": 924672, + "head_bit_moves": 76431616, + "intercell_steps": 1332416, + "leaves": 1376, + "nontrivial_reductions": { + "a": 699, + "p": 1200, + "v": 1360 + }, + "work_bits": 283, + "work_peaks": { + "a": 144114957416895179, + "c": 72057594037927935, + "p": 5192296858534827052069744025796615, + "v": 142724718810515102 + }, + "work_widths": { + "a": 57, + "c": 56, + "p": 112, + "v": 58 + } + }, + "final": [ + [ + 72057594037927929, + 7 + ], + [ + 72057505934044768, + 72057451482850411 + ], + [ + 38668552545597125, + 53469933108250195 + ], + [ + 4907693372841381, + 20215122225234527 + ], + [ + 63348393985569636, + 162992423163564 + ] + ], + "initial": [ + [ + 72057594037927929, + 7 + ], + [ + 7, + 72057594037927929 + ], + [ + 38668552545597125, + 53469933108250195 + ], + [ + 4907693372841381, + 20215122225234527 + ], + [ + 63348393985569636, + 162992423163564 + ] + ], + "invoice": { + "accesses": 16512, + "address_bits": 8, + "address_events": 16512, + "coefficient_bits": 11648, + "commands": 52292, + "counts": { + "add": 8256, + "add_a": 5504, + "add_v": 2752, + "coeff": 5504, + "low": 13760, + "low_a": 5504, + "low_p": 5504, + "low_v": 2752, + "mul": 5504, + "read": 8256, + "write": 2752, + "zero": 8260, + "zero_a": 4129, + "zero_c": 1377, + "zero_p": 1377, + "zero_v": 1377 + }, + "data_bit_actions": 924672, + "data_bits": 560, + "decoded_target_cells": 2, + "head_bit_moves": 76431616, + "intercell_steps": 1332416, + "leaves": 1376, + "preparation_reductions": 212, + "program_bits": 17888, + "program_forward_and_rewind_bits": 35776, + "program_read_bits": 17888, + "program_record_bits": 13, + "work_bits": 283 + }, + "observed_integer_prefix_bits": 90, + "observed_integer_prefix_peak": "329983502477195206801275693", + "sign": 1, + "signed_output": [ + -88103883168, + -142555077525 + ], + "transcript_sha256": "e053ed7f1ad760ad99956940b9ae9c283a81764f53b8e122eddefecd8b9c4a27" + } + }, + "controls": { + "half_division": { + "congruent_lifts": [ + 1, + 5 + ], + "modulus": 4, + "outputs": [ + 0, + 2 + ], + "rounded_echo_increment": 1, + "wanted_increment": 0 + }, + "out_of_range": { + "decoded": -4, + "residue": 12, + "true_integer": 12, + "width": 4 + }, + "rejected": [ + "undersized endpoint allowance", + "signed guard equality", + "zero product hides unrepresentable input", + "unjustified input bound", + "noncanonical dirty input", + "rounded fractional leaf", + "boolean coefficient", + "aliased ports", + "global input used as target", + "omitted helper restoration", + "wrong inverse sign", + "negation without reversal", + "unpaid product reduction", + "unpaid accumulator reductions", + "uncleared private coefficient work", + "undercharged reductions", + "modular success does not imply integer recovery", + "saturation loses restoration", + "unreduced integer lift in endpoint-sized registers" + ], + "saturation": { + "helper": 5, + "target": -3, + "wanted_helper": 7, + "wanted_target": 4 + } + }, + "endpoint_bound": { + "endpoint_radius": 31525197391593479, + "norms": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "product": 4503599627370496, + "width": 56 + }, + "historical": { + "comparison": { + "all_entry_cells_bounded_7": { + "coefficient_bits": 23712, + "commands": 38532, + "data_bits": 1140, + "entry_bound": 7, + "inherited_sufficient_width": 114, + "scalar_work_bits": 456 + }, + "arbitrary_signed_width_bit_dirt": { + "coefficient_bits": 34736, + "commands": 38532, + "data_bits": 1670, + "entry_bound": 36028797018963968, + "inherited_sufficient_width": 167, + "scalar_work_bits": 668 + } + }, + "minimality_claim": false, + "norm_majorant": "1460333491462920270524202092593152" + }, + "no_new_kappa": true, + "predecessor56": { + "inherited_width": 119, + "leaf_calls": 1568, + "modular_width": 60, + "n": 56 + }, + "program_sha256": "eb88663379c1412a915af9b545b9f8934aa2d9d20a4f89be2f89ec6c73b632ca", + "scalar_exhaustion": [ + { + "cases": 32768, + "commands": 2097152, + "factors": 2, + "sha256": "3edc8b7fb07173588b8b2c88444a38153622be15d04277a47e3dde9cb010e1f1", + "width": 2 + }, + { + "cases": 512, + "commands": 63488, + "factors": 3, + "sha256": "b3b74c0012ee0b4cc2044427bcbbe9b7c4fe1782790710f02b39536c9d8218b8", + "width": 1 + } + ], + "sources": { + "base_commit": "ba82555c64e1879e4b7decce28186f208fcb8262", + "files": { + "BASE-SELECTION.json": { + "commit": "ba82555c64e1879e4b7decce28186f208fcb8262", + "git_blob": "f451ced6626a1f03aba6915ce23a136b01ebe51d", + "path": "certificates/selected-result.json", + "sha256": "207d1f49f113c585024b9d3c17eadbb8b1be17c1321e3d190aabe2f18ce1c5b7" + }, + "vendor/pr1057/LICENSE": { + "commit": "78a062df1dcab2bffea5ff4d8243f3da6e465414", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "path": "research/linear-port-borrowing/LICENSE", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + "vendor/pr1057/NOTICE.md": { + "commit": "78a062df1dcab2bffea5ff4d8243f3da6e465414", + "git_blob": "e718ab189a0eb51cb1bdadf0f898598f72815600", + "path": "research/linear-port-borrowing/NOTICE.md", + "sha256": "1f8ce68b254b6c40fe6255bffd2975ef8cf7c0df1de7414cd59353eea80f1e37" + }, + "vendor/pr1057/PROOF.md": { + "commit": "78a062df1dcab2bffea5ff4d8243f3da6e465414", + "git_blob": "96e13812019eaf39a86b265ca96c552300bfbe15", + "path": "research/linear-port-borrowing/PROOF.md", + "sha256": "790fb2c67d9e59c7e80e212cb025d643a5315636f977ab9269e96cc7eef5556e" + }, + "vendor/pr1057/README.md": { + "commit": "78a062df1dcab2bffea5ff4d8243f3da6e465414", + "git_blob": "59c4167f89533a588808262af98420e4500f55c9", + "path": "research/linear-port-borrowing/README.md", + "sha256": "a1fac70b54269a93b136da727a9db81f15f2fdd5d7ca792b102157ad575d71b7" + }, + "vendor/pr1057/borrow.py": { + "commit": "78a062df1dcab2bffea5ff4d8243f3da6e465414", + "git_blob": "b5014c9eb26adad166e4021a430eebfc2ca10d55", + "path": "research/linear-port-borrowing/borrow.py", + "sha256": "14f267a3a6b85b08f0d23326cdb6de8c27f70ad8d156359c01fdf93bf19682d0" + } + }, + "source_pr1057": "78a062df1dcab2bffea5ff4d8243f3da6e465414" + }, + "status": "PASS_MODULAR_PORT_BORROWING" +} diff --git a/research/modular-port-borrowing/CLAIM.json b/research/modular-port-borrowing/CLAIM.json new file mode 100644 index 0000000000..a93c5ce208 --- /dev/null +++ b/research/modular-port-borrowing/CLAIM.json @@ -0,0 +1,54 @@ +{ + "status": "submitted", + "assignment": { + "pass_number": 20, + "seed": 52, + "track": "recursive interfaces", + "drawn_at_utc": "2026-10-13T18:40:38.911439+00:00", + "source": "secrets.randbelow(100), OS randomness" + }, + "base": "ba82555c64e1879e4b7decce28186f208fcb8262", + "candidates": [ + { + "task": "Exact modular backend for borrowed-port echoes, endpoint-only recovery width", + "decision": "chosen: PR1057 requires integer prefix headroom and excludes rounded leaves; congruence-preserving arithmetic changes that interface and has an explicit reduction price" + }, + { + "task": "Rectangular output borrowing to remove repeated restoration", + "decision": "deferred: PR1103 already supplies the new two-axis interface, recurrence and complete census" + }, + { + "task": "Cancel compact-control repeated boundaries", + "decision": "deferred: PR1108 precisely audits the unrepaired-return obstruction; no new mechanism selected" + } + ], + "scope": "Instantiate PR1057 integer-matrix echoes over Z/(2^w), prove all-tree exact dirty-bit restoration and signed endpoint recovery from 2^(w-1)>max(X,Y+X product(K_i)), without any transient integer bound. Supply a literal finite-width dense backend with every reduction, access, private clear and conversion charged; compare inherited exact-integer sufficient widths, not minimal widths or measured speed.", + "seed_use": "52 selects the 52-factor primary fixture and deterministic integer matrix/input cases; use all trees through seven leaves and both signs, plus 56-factor credited comparison and sizes through64. Novelty is the concrete modular contract and full accounting, not another tree or seed.", + "domain": "One bounded exact backend experiment, no circuit search. Binary/ternary integer-linear factors only; arbitrary w-bit dirty rows, protected global input, three-row dirty pool. Independently check all prefixes modulo the integer lift and all child return boundaries.", + "optimistic_complete_cost": "Same 1376 leaf calls on the 52-factor plan. For K=2 and X=Y=7, endpoint width56 versus inherited sufficient114 bits when all entry rows are bounded by7. Per L=2 leaf add10 explicit reductions to old28 scalar/access commands, giving38; four private registers require 5w+3 bits. Every frame, coefficient/input conversion, program, routing and dispatch remains billed explicitly. No call-count, optimality, timing or kappa gain inferred.", + "coordination": "Authenticated pinnedIssues query returned none. Recent queue through1122 and all-state modular/overflow searches inspected; PR835 is a modular verification method for a different complex endpoint, not an implementation of this recursive backend.", + "source_pr1057": "78a062df1dcab2bffea5ff4d8243f3da6e465414", + "related": [ + 628, + 673, + 730, + 822, + 887, + 896, + 1057, + 1103, + 1108, + 835 + ], + "claimed_at_utc": "2026-10-13T18:46:24.008326+00:00", + "expected_finish_utc": "2026-10-13T19:35:00Z", + "pr": 1159, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1159", + "mathematical_head": "a66a9cf044a0953f714b4545f6a2f59066662f97", + "submitted_at_utc": "2026-10-13T19:21:22.803538+00:00", + "result": "Exact modular backend: 52 factors, 1376 unchanged leaf calls, three dirty length-two arrays, 56-bit data, 283 bits private work. Inherited sufficient integer widths are 114 for entry bound 7 or 167 for arbitrary signed 56-bit dirt; actual stress lift reaches 90 bits. All dirty bits restore and the signed endpoint recovers under the explicit input/output guard. 13760 reductions are paid; total 52292 kernel commands. No width-minimum, speedup, rounded-supplier or kappa claim.", + "validation": "5280 matrix cases, 528302 leaf prefixes, 667416 recursive returns, 33280 exhaustive scalar cases, 144 dense cases, 19 mathematical controls, 12 package tests and 25 selected tests pass. CPython 3.14 normal and final read-only relocated isolated optimized 3.12 receipts byte-identical; all six Git source/context pins verified.", + "guard_refinement": "A zero factor can shrink the output radius below the input radius; the final guard separately preserves external-input representability. Source bytes are authenticated before executing the copied emitter.", + "upstream_refresh": "ce7ad1b6ab09452c3478723a2e96ed5ff212dc08 selects PR1094, conditional kappa 0.001672660197076918. Frozen base context retained; no moving root dependencies.", + "overlap_refresh": "Initial final scan through 1152, immediate pre-submit scan through 1157. Read PR1135 proof at 4c35687d7c0da8e6cf33f17e418ecf31c95ff3ad: rounded/rational-grid lift is distinct and its denominator costs remain. PR1155 defers batch restorations; this construction restores every child boundary. PR1057 source head remains unchanged/open." +} diff --git a/research/modular-port-borrowing/LICENSE b/research/modular-port-borrowing/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/modular-port-borrowing/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/modular-port-borrowing/NOTICE.md b/research/modular-port-borrowing/NOTICE.md new file mode 100644 index 0000000000..3beacc2be6 --- /dev/null +++ b/research/modular-port-borrowing/NOTICE.md @@ -0,0 +1,41 @@ +# Attribution and license + +New modular register protocol, recovery guard, literal dense backend, +independent control-stack/matrix replay and complete resource invoice: +**Gareth Davidson (@bitplane)**, with substantial **OpenAI Codex assistance** +in mathematics, implementation, verification and writing. Apache-2.0. +No subagents or independent human peer reviewers were used. + +The five files under vendor/pr1057 are unchanged copies from Gareth +Davidson's PR1057 at `78a062df1dcab2bffea5ff4d8243f3da6e465414`. +Its additive-group theorem, fixed pool, emitter, optimizer, sufficient +integer headroom and explicit backend model are credited predecessor work. +Their notices preserve **shhxera PR822**, **androolloyd PR673**, **Sagar +Thakrar PR730**, **Chafik Boukhalfa PR628** and the broader research lineage. + +The constant-register algebraic principle is classical: Michael Ben-Or and +Richard Cleve, *Computing Algebraic Formulas Using a Constant Number of +Registers*, SIAM J. Comput. 21(1), 54–58 (1992), +[doi:10.1137/0221006](https://epubs.siam.org/doi/abs/10.1137/0221006). +Reduction modulo an integer and bounded signed reconstruction are standard +algebraic tools. No priority claim is made for these principles. + +Adjacent **PR835** checks a historical complex endpoint by modular matrices +and an exact reconstruction bound; its modular-verification/recovery +distinction is acknowledged. **PR1103**, prepared for @steph4n-gh, changes +rectangular output borrowing and restoration multiplicities. **PR1108**, +prepared for @martinxxx9, distinguishes a compact-control return from its +inverse. Those packages are separate contributions; their code or savings +are not imported here. + +**Ali Romman PR1135**, at `4c35687d7c0da8e6cf33f17e418ecf31c95ff3ad`, +concurrently characterizes rounded borrowing and prices a common-denominator +rational lift. Its proof and the difference from this integer quotient-ring +backend were inspected before publication. No rounded-leaf repair or +denominator-cost saving is claimed here. + +The selected context at the recorded base is **Jeremy Kothe PR1042**, with +the credited mutable-leaver/slot and T16 lineage including **Rohan Arun +PR987** and **Hao Yan PR858**, retaining **DreamingOfClouds PR589** on +**eumemic PR555/543** for bits. This package does not change that selection. +All copied material retains its original license and disclosures. diff --git a/research/modular-port-borrowing/PROGRAM.json.gz b/research/modular-port-borrowing/PROGRAM.json.gz new file mode 100644 index 0000000000..32113e7fdf Binary files /dev/null and b/research/modular-port-borrowing/PROGRAM.json.gz differ diff --git a/research/modular-port-borrowing/PROOF.md b/research/modular-port-borrowing/PROOF.md new file mode 100644 index 0000000000..76c923f5bb --- /dev/null +++ b/research/modular-port-borrowing/PROOF.md @@ -0,0 +1,217 @@ +# Quotient-ring execution and complete cost + +## Interface + +Fix integer L-by-L matrices A_0,...,A_(n−1), an ordered binary/ternary factor +tree, and w >= 1. Let M = 2^w and V = (Z/MZ)^L. Data registers contain +canonical residues 0,...,M−1. Each matrix induces an additive endomorphism +of V, with its coefficients reduced modulo M. A complete leaf on distinct +ports s,t performs + +``` +row[t] <- row[t] + q A_i row[s] (mod M), q in {+1, -1}, +``` + +preserving its source and all other arrays and clearing its owned private +work. No inverse of a matrix, field assumption or division by two is used. + +Use PR1057's fixed mutable pool [2,3,1,4], excluding the current source and +target before choosing one or two connectors. Row zero is the external +source and never a mutable port. Three dirty arrays plus the output leave +enough ports for every binary/ternary node at every depth. Internal children +may temporarily modify other ancestor ports; they restore them on return. +All recursive boundaries exchange residues, without signed decoding. + +## All-tree restoration + +This is an instantiation of the credited PR1057 additive-group contract. +For a binary node with child maps B,C, the four completed shears execute + +``` +z += Bx; y += Cz; z -= Bx; y -= Cz. +``` + +The connector restores, and the target increment is +`C(z+Bx) - Cz = CBx`. All statements hold in V for arbitrary initial z +and y. For three children B,C,D, the eight completed shears + +``` +U; V; W; V^-1; U^-1; V; W^-1; V^-1 +``` + +give the difference `D(z2 + C z1 + CBx) - D(z2 + C z1) = DCBx` and +restore both connectors. The child induction hypothesis supplies these +boundary shears independently of all borrowed dirt. Thus the full tree +adds `A_(n−1)...A_0 x` to y and restores every other data row, modulo M. +The negative call reverses the literal leaf word and negates each sign. +Factors need not commute. A finite-width residue has a unique canonical bit +pattern, so equality in V gives bitwise restoration of all dirty arrays. + +Equivalently, reduction Z -> Z/MZ commutes with integer addition, +subtraction and multiplication. Reducing every intermediate of the literal +integer program gives the same final residue as reducing only its result. +The integer lift may exceed w bits arbitrarily. Only the reduced state is +stored, and the temporary arithmetic capacities below are bounded locally. + +This does not license arbitrary nonlinear operations. For example, 1 and 5 +are congruent modulo four, while floor(1/2) and floor(5/2) give different +residues. Saturating signed arithmetic also fails the group law. The retained +counterexamples test those boundaries explicitly. + +## Integer recovery without an intermediate bound + +Assume the external integer input and initial output satisfy +`||x||_infinity <= X` and `||y||_infinity <= Y`, with X,Y nonnegative. +Let `K_i = max_r sum_j |A_i[r,j]|`, and `G = product_i K_i`. +The triangle inequality gives `||A_i v|| <= K_i ||v||`, hence both signs +of the desired final output have norm at most `R = Y + GX`. + +Choose + +``` +2^(w-1) > max(X, R), +w = max(1, bit_length(max(X,R)) + 1) is sufficient. +``` + +The X term preserves representation of the unchanged external input even +when a zero factor makes G = 0. R >= Y already covers the initial output. +Signed decoding chooses the representative in `[-2^(w-1), 2^(w-1)-1]`. +Because the true final integer lies strictly inside this interval, its +residue determines it uniquely. Dirty rows have no small-norm hypothesis: +they can begin as arbitrary w-bit patterns and are returned unchanged. + +For the 52-factor fixture, every K_i = 2, X=Y=7 and +`R = 31,525,197,391,593,479 < 2^55 = 36,028,797,018,963,968`; w=56 +suffices. The inherited PR1057 prefix majorant for the same tree is + +``` +H(leaf) = 1 + K, +H(node) = (arity+1) K^(number of factors below node) max H(child). +``` + +It gives 114 sufficient signed bits when every initial cell is bounded by +seven, and 167 for arbitrary signed 56-bit dirty values. These are comparisons +to a proved sufficient majorant, not integer-width lower bounds. The stress +fixture's independently executed integer lift actually reaches 90 signed +bits. The credited 56-factor plan retains 1,568 calls and gives a separate +119-to-60 comparison of sufficient widths. + +## Literal dense leaf and private work + +The reference machine has five data arrays of length L and a read-only +residue coefficient table. Its four private scalar registers have capacities: + +| Register | Use | Capacity | +|---|---|---:| +| a | row accumulator | w+1 unsigned bits | +| v | source/target value and signed target update | w+2 signed bits | +| c | coefficient residue | w unsigned bits | +| p | unreduced product | 2w unsigned bits | + +For each output coordinate, zero a. For each source coordinate, read v and +c, multiply into p, reduce p to its low w bits, add p to a, and reduce a to +its low w bits. Then read the current target into v, add or subtract a, +reduce v to its low w bits, and write it back. Finally zero all four private +registers. Four startup zero assignments are explicit too. + +Before each multiplication both operands lie in [0,M−1], so p < M^2 fits +2w bits. After product reduction, the accumulator addition is at most +2M−2 and fits w+1 unsigned bits. The signed target update lies between +−(M−1) and 2M−2 and fits w+2 signed bits. The next reduction returns a +canonical w-bit value. These bounds do not depend on recursion depth or +the magnitude of the integer lift. The private storage is **5w+3 bits**. + +`LOW(b,w)` is a paid operation replacing a b-bit work value by its low w +bits. On an explicit bit representation it can overwrite the upper b−w +bits with zero, with its access/routing work charged by the implementation. +The reference interpreter uses a mask and checks all register capacities. +Neither LOW nor private clearing is treated as free or asserted reversible. +The private registers are owned work with a zero exit contract; the arbitrary +dirty restoration theorem applies to the five data arrays. + +Per leaf, the exact command bill is + +``` +L^2 multiplies +L^2 + L adds/subtracts +2L^2 + L reductions +L + 4 zero assignments +2L^2 + L reads (including coefficient reads) +L writes. +``` + +This is `6L^2 + 5L + 4` commands, compared to the inherited integer leaf's +`4L^2 + 4L + 4`. For L=2 it is 38 versus 28. With N=1,376 calls, including +startup, the modular execution has 5,504 multiplies, 8,256 adds/subtracts, +13,760 reductions, 8,260 zero assignments, 13,760 reads and 2,752 writes: +**52,292 commands**. Preparation and output decoding are additional below. + +## Recurrence and full conditional price + +If `C_t(s,d,q,w)` is the actual cost of a completed subtree at its specified +ports, define it by summing the child costs over the displayed four- or +eight-call template, including each negative call. Address-dependent costs +are evaluated at their actual ports. When the completed-child prices are +sign-symmetric and independent of ports, this reduces to + +``` +binary: 2 C_0 + 2 C_1, +ternary: 2 C_0 + 4 C_1 + 2 C_2. +``` + +No array copy, zeroing, width conversion or additional data-restoration work +is required at an internal boundary. Control/routing costs are still paid. +The leaf multiplicities and planner are exactly those of PR1057; this pass +does not optimize them or alter the direct all-role call obstruction. + +For N dense leaves at a common w, let MUL(w) include the implementation of +a w-by-w product with its 2w-bit destination, ADD(b) its indicated unsigned +or signed operation, Z(b) clearing, and LOW(b,w) reduction. The arithmetic +and private-clearing term is exactly + +``` +N L^2 [MUL(w) + ADD_unsigned(w+1) + LOW(2w,w) + LOW(w+1,w)] ++ N L [ADD_signed(w+2) + LOW(w+2,w)] ++ [N(L+1)+1] Z(w+1) ++ (N+1) [Z(w+2) + Z(w) + Z(2w)]. +``` + +Original coefficient access/preparation, input encoding and decoding are +separate paid terms. Setup reads the nL^2 original signed coefficients, +reduces them and writes the residue table; it encodes the 2L input/output +cells. Thus it includes **nL^2+2L reductions** (212 in the main fixture), +their reads/writes and the original coefficient/input widths. Computing +norms and G, the width, the parent plan and the unrolled program is paid +setup too, with its own integer/control storage. Original coefficient +descriptors or source storage retained by the caller must be added to the +table's nL^2 w bits. Final signed decoding costs L instances of a declared +decode/read/write routine. No conversion is inserted inside recursion. + +The exact data itinerary uses cells `sL+j`, `tL+i` and +`5L+(factor*L+i)L+j`. Each leaf returns the data head to cell zero. Let D be +the measured intercell distance and E the number of reads plus writes. +For the specified full-cell scans and returns, add + +``` +w E bit actions, +w D + 2(w-1)E data-head moves, +E Address(a) address/control cost, a = ceil(log2(5L+nL^2)). +``` + +The interpreter and a separate closed itinerary agree on D=1,332,416, +E=16,512, a=8: 924,672 data bit actions and 76,431,616 data-head moves at +w=56. Private-register arithmetic travel is included in the implementation +of MUL/ADD/LOW/Z, not in this data-region head count. + +An unrolled leaf record uses `b=max(1,ceil(log2 n))+2*3+1` bits for factor, +two ports and sign. Charge Nb storage/read bits, 2Nb forward-and-rewind +program-head moves and N calls of an explicit dispatcher `Dispatch(b,a,log L)`. +Here b=13 and Nb=17,888. Backend control storage, any additional frame or +supplier source-access adapter, and coefficient/input setup and decoding +must be added. No fixed-tape compiler or measured timing is claimed. + +This full conditional bill exposes the trade: narrower data and arithmetic +operands, unchanged recursive calls, more reduction commands and wider +private product storage than the data width. Its benefit depends on actual +MUL/ADD/LOW, preparation and routing implementations. There is no inferred +new kappa or asymptotic supplier improvement. diff --git a/research/modular-port-borrowing/README.md b/research/modular-port-borrowing/README.md new file mode 100644 index 0000000000..c55a507a2e --- /dev/null +++ b/research/modular-port-borrowing/README.md @@ -0,0 +1,133 @@ +# Exact modular echoes with 56-bit data registers + +**Recursive-interface construction; no new kappa.** This supplies an explicit +modular backend for PR1057's borrowed-port echo. Integer matrix factors act +on fixed-width residues modulo `2^w`. Every dirty array is restored bit for +bit, and the final integer answer is recovered from a bound on the input +and final output. Large unreduced intermediate integers need not fit the +data registers. + +The 52-factor fixture retains **1,376 complete leaf calls and three dirty +length-two arrays**, with **56-bit data**. PR1057's sufficient integer-prefix +allowance is **114 bits** when every entry value has magnitude at most seven, +or **167 bits** when the dirty entries range over all signed 56-bit values. +Those are sufficient allowances, not proven minimum integer widths. In the +retained full-dirt fixture, the actual integer lift reaches **90 signed bits** +while the modular execution and every recursive return remain exact. + +| Resource, 52-factor fixture | Integer backend, entry bound 7 | Modular backend | +|---|---:|---:| +| Complete leaf calls | 1,376 | 1,376 | +| Common data width | 114 sufficient bits | 56 bits | +| Five length-two data arrays | 1,140 bits | 560 bits | +| Dense coefficient table | 23,712 bits | 11,648 residue bits | +| Four private scalar registers | 456 bits | 283 bits | +| Unrolled leaf-record storage | 17,888 bits | 17,888 bits | +| Executed scalar/access commands, including startup | 38,532 | **52,292** | +| Explicit modular reductions within those commands | 0 | **13,760** | + +The modular leaf pays **38 commands instead of 28** for dimension two. +Its product register has 112 bits; all four private widths and their clearing +are charged. Coefficient/input conversion, final decoding, original input +storage, address/control routines and any physical supplier adapter remain +explicit setup or backend costs. The table is a model invoice, not measured +Python memory or a runtime speedup. [PROOF.md](PROOF.md) gives the complete +recurrence and price, including these terms. + +## Reproduce + +Python 3.10+ and the standard library, from any working directory: + +```sh +python3 -I -B research/modular-port-borrowing/verify.py +python3 -I -B research/modular-port-borrowing/test_package.py -v +``` + +Expected final marker: + +```text +PASS_MODULAR_PORT_BORROWING: 52 factors; 1376 calls; 56-bit data; 5280 matrix cases; 33280 scalar states; 144 dense cases; paid reductions; no new kappa +``` + +The first command regenerates the entire case, literal primitive program and +certificate. `--receipt NEW_FILE` retains its deterministic receipt; an +existing file is refused. It also runs under `-O` and from a relocated, +read-only package. No repository imports, native compiler, solver or network +are required. + +Evidence includes **5,280 exact matrix-map cases**: all **861 ordered +binary/ternary trees through seven factors**, both signs at widths 1, 2 and +5, then the pinned parent's chosen plans for every size 8 through 64 in +both directions. Independent control-stack and matrix implementations check +**528,302 leaf prefixes and 667,416 recursive returns**, including children +temporarily borrowing ancestor ports. Each matrix case covers all ten data +columns, hence all residue inputs for those instantiated factors. + +The literal scalar backend also exhausts **33,280 complete cases**: every +coefficient tuple and all five-array states for binary scalar echoes modulo +four and ternary scalar echoes modulo two, in both directions. These execute +**2,160,640 scalar/access commands**. Another **144** dense cases vary +dimension, signs, zero factors and width, with independent endpoint and +complete address invoices. Four main fixtures compare every leaf with its +unbounded integer lift and execute the literal inverse. + +**19 mathematical/admission controls** cover lost restoration, insufficient +recovery width, signed-bound equality, unrepresentable input after a zero +product, rounded coefficients, missing reductions, private clearing, +aliasing, inverse order, undercharging and actual integer-prefix overflow. +**12 package tests** cover artifact/source corruption and portable encoding. +For example, a correct modulo-16 endpoint with residue 12 decodes to −4, +not the true integer 12, when the recovery guard is omitted. Saturating +arithmetic corrupts a helper; division by two fails to define a map on the +chosen quotient. These operations cannot replace the specified modular leaf. + +## Sources and scope + +Base **ba82555c64e1879e4b7decce28186f208fcb8262** selects conditional PR1042, +kappa `1672188119205421 / 10^18`, with PR589 still the bit supplier. +BASE-SELECTION.json freezes that context. The exact pending PR1057 source is +**78a062df1dcab2bffea5ff4d8243f3da6e465414**. Five files are vendored +unchanged; SOURCES.json gives their Git blobs and SHA-256 hashes, plus the +selected-context pin. The existing emitter and planner are reused with +credit; this pass does not claim a new borrowing identity or tree optimum. + +The algebraic identity already holds for additive endomorphisms of an +abelian group, including finite residue groups. This contribution supplies +its concrete bounded-register realization, exact recovery condition, paid +reduction/access invoice and independent prefix/return evidence. The written +argument applies to every finite ordered binary/ternary tree of **integer +linear factors**. The finite tests support that proof; they are not a formal +verification of the full multiplication theorem. + +The external source remains read-only at every prefix. Internal source +ports are restored on return; their values are opaque residues inside the +recursion. No internal signed decode or numerical rounding is allowed. +Rounded, irrational and general dyadic factors need another interface. +The Python interpreter checks capacities of the specified register machine; +its own host allocations are not the stated data-space bound. Physical +fixed-tape implementation, supplier placement, frame/source-access adapters, +common-label realization, hosting and outer analytic transfer remain open. +The unchanged call multiplicities retain the direct all-role obstruction. + +Assignment seed **52** selects the primary size and seeded fixtures. The +domain and stopping rule are in CLAIM.json; no search or restart is used. +PR1103's rectangular batching changes restoration multiplicities, and +PR1108's compact-control return obstruction is a different interface. +PR835 uses modular reconstruction to verify a historical complex word; it +does not implement this borrowed-port backend. Their distinct evidence is +credited, with no claim of priority for modular arithmetic. + +The final overlap check also found **Ali Romman's PR1135**, which studies +rounded borrowing contracts and a common-denominator rational lift. Its +Section 7 retains numerator headroom and a `q^D` coarse-lattice embedding. +The present integer-factor backend uses quotient residues throughout the +recursion; it does not remove that lift's denominator costs or solve the +rounded-leaf obstruction. Upstream advanced during publication to selected +PR1094 at `ce7ad1b6ab09452c3478723a2e96ed5ff212dc08`; the experimental base +and frozen context above are retained. + +Prepared by **Gareth Davidson (@bitplane)** with substantial **OpenAI Codex +assistance**. Credit PR1057, **shhxera PR822**, **androolloyd PR673**, **Sagar +Thakrar PR730**, **Chafik Boukhalfa PR628**, the classical Ben-Or–Cleve +constant-register principle, and retained predecessor notices. New material +is Apache-2.0. See NOTICE.md and VALIDATION.md. diff --git a/research/modular-port-borrowing/SOURCES.json b/research/modular-port-borrowing/SOURCES.json new file mode 100644 index 0000000000..6643223523 --- /dev/null +++ b/research/modular-port-borrowing/SOURCES.json @@ -0,0 +1,42 @@ +{ + "base_commit": "ba82555c64e1879e4b7decce28186f208fcb8262", + "source_pr1057": "78a062df1dcab2bffea5ff4d8243f3da6e465414", + "files": { + "vendor/pr1057/borrow.py": { + "commit": "78a062df1dcab2bffea5ff4d8243f3da6e465414", + "path": "research/linear-port-borrowing/borrow.py", + "git_blob": "b5014c9eb26adad166e4021a430eebfc2ca10d55", + "sha256": "14f267a3a6b85b08f0d23326cdb6de8c27f70ad8d156359c01fdf93bf19682d0" + }, + "vendor/pr1057/PROOF.md": { + "commit": "78a062df1dcab2bffea5ff4d8243f3da6e465414", + "path": "research/linear-port-borrowing/PROOF.md", + "git_blob": "96e13812019eaf39a86b265ca96c552300bfbe15", + "sha256": "790fb2c67d9e59c7e80e212cb025d643a5315636f977ab9269e96cc7eef5556e" + }, + "vendor/pr1057/README.md": { + "commit": "78a062df1dcab2bffea5ff4d8243f3da6e465414", + "path": "research/linear-port-borrowing/README.md", + "git_blob": "59c4167f89533a588808262af98420e4500f55c9", + "sha256": "a1fac70b54269a93b136da727a9db81f15f2fdd5d7ca792b102157ad575d71b7" + }, + "vendor/pr1057/NOTICE.md": { + "commit": "78a062df1dcab2bffea5ff4d8243f3da6e465414", + "path": "research/linear-port-borrowing/NOTICE.md", + "git_blob": "e718ab189a0eb51cb1bdadf0f898598f72815600", + "sha256": "1f8ce68b254b6c40fe6255bffd2975ef8cf7c0df1de7414cd59353eea80f1e37" + }, + "vendor/pr1057/LICENSE": { + "commit": "78a062df1dcab2bffea5ff4d8243f3da6e465414", + "path": "research/linear-port-borrowing/LICENSE", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + "BASE-SELECTION.json": { + "commit": "ba82555c64e1879e4b7decce28186f208fcb8262", + "path": "certificates/selected-result.json", + "git_blob": "f451ced6626a1f03aba6915ce23a136b01ebe51d", + "sha256": "207d1f49f113c585024b9d3c17eadbb8b1be17c1321e3d190aabe2f18ce1c5b7" + } + } +} diff --git a/research/modular-port-borrowing/VALIDATION.md b/research/modular-port-borrowing/VALIDATION.md new file mode 100644 index 0000000000..3c1cbd0a44 --- /dev/null +++ b/research/modular-port-borrowing/VALIDATION.md @@ -0,0 +1,102 @@ +# Executed checks and scope + +The complete mathematical replay passed on Linux under CPython **3.14.4** +and isolated optimized CPython **3.12.3**. The final 3.12 replay used a +relocated package with write permission removed from every source file and +directory; its receipt was written outside that tree. The complete receipts +are byte-identical, SHA-256: + +`789e1b6ae36d56de38010c0824f320682f4246125417bcf71f4243d8bea3a27a` + +The main case's full canonical decoded SHA-256 is +`ed3ff7af1243172307a86648324cff314c95a7ef7cd58c9b40186d2e6909653c`. +The complete primitive program's is +`eb88663379c1412a915af9b545b9f8934aa2d9d20a4f89be2f89ec6c73b632ca`. +Generated gzip artifacts are compared by every decoded field, while copied +source files retain exact Git-blob and SHA-256 pins. + +## Mathematical coverage + +- **5,280 matrix cases**, each with all ten independent data columns: + 861 ordered binary/ternary trees through seven factors at widths 1, 2, 5 + and both signs, plus each parent's chosen plan at sizes 8–64, both signs. + A separate explicit control stack agrees with the pinned emitter's full + word. Every leaf prefix agrees with an integer matrix lift modulo `2^w`; + every recursive return agrees with the direct child-product shear. + Coverage: **528,302 leaf prefixes and 667,416 recursive returns**. +- **33,280 exhaustive scalar cases**: binary echoes over Z/4Z for every + coefficient tuple and every five-row input, and ternary echoes over Z/2Z + under the same complete domain, in both directions. The actual primitive + backend executes **2,160,640 commands** in these checks. +- **144 dense cases** with dimensions 1, 2, 3 and sizes 1, 2, 3, 5, 8, 13; + four seeded coefficient fixtures and both signs, including zero factors. + Independent endpoints, unique signed recovery, operation counts, private + widths and data-head invoices all agree. +- Four 52-factor fixtures: bounded-seven or arbitrary 56-bit dirty inputs, + each sign. Every literal leaf is compared with the separately executed + integer lift. The literal inverse restores every bit pattern. The stress + integer lift reaches **90 signed bits**, while data storage remains 56. +- The primary bill is independently counted from scalar execution and from + a closed operation formula and separate address itinerary. This includes + 13,760 reductions, all private clears, 16,512 data/coefficient accesses, + 1,332,416 intercell steps, 924,672 bit actions and 76,431,616 data-head + moves. Setup, program/control and adapter obligations are stated separately + in PROOF.md, rather than assumed free. + +**19 mathematical/admission controls** reject insufficient endpoint width, +strict signed-cap equality, a zero product hiding an unrepresentable external +input, unjustified source bounds, noncanonical dirt, fractional or boolean +coefficients, aliased ports, writes to the protected source, missing helper +restoration, wrong inverse signs/order, omitted product or accumulator +reductions, uncleared private work, undercharged reductions, decoding an +out-of-range integer, saturation and an overflowing unreduced integer lift. +The separate floor-by-two example shows why quotient arithmetic does not +validate rounded rational factors. + +## Artifact and repository checks + +All **12 package tests** pass in normal and optimized Python. They exercise +offline relocation; level-1/level-9 recompression of both generated gzip +files; source/context mutation; changed width or removed reduction with +rebound digests; undercharged reductions or product storage; omitted +directions/coverage; boolean receipt fields; and duplicate/nonfinite JSON. +A modified parent containing an executable exception is rejected by its pin +before the parent module can execute. All rejection predicates use explicit +checks and remain active under `-O`. + +All **25 existing selected-record, inventory-link and proof-binding tests** +passed at the experimental base. The final working-tree scope and whitespace +were checked. No existing generator, selected record or `upstream/` file is +changed. + +Review after the first complete replay identified the zero-factor case: +the width must also represent the unchanged input if the product norm is +zero. The guard now uses `max(X, Y + X product(K_i))`; a specific rejection +control checks that boundary. Both final mathematical replays include it. +Source admission was additionally moved before importing the copied emitter, +and the final portable replay and executable-source corruption test passed. + +## Overlap and remaining obligations + +The initial pinned-issue query returned none. The final queue was checked +through **PR1152**, including Ali Romman's **PR1135** and its exact-lift proof +at `4c35687d7c0da8e6cf33f17e418ecf31c95ff3ad`. That proof prices a +common-denominator rational embedding and rounded-interface obstructions; +it does not supply this integer modular backend or invoice. This package +does not solve those rounded obligations. PR1144's bounded modular recovery +accelerates a separate determinant audit. No code from either is imported. + +The experiment remains based on **ba82555c64e1879e4b7decce28186f208fcb8262**. +At publication upstream is **ce7ad1b6ab09452c3478723a2e96ed5ff212dc08**, +selecting PR1094's conditional kappa **0.001672660197076918**. PR1057 remains +open at the exact pinned head. This self-contained package does not consume +the moving selected pointer or any newly changed root source. + +No physical fixed-tape compiler, rounded/dyadic/irrational supplier adapter, +whole hosted supplier, outer assembly, selected cold replay, full repository +suite, measured runtime gain, unrestricted optimum, formal theorem proof or +independent human peer review is claimed. Hosted CI remains separate from +local validation. The all-size/compiler, common-label realization, hosting, +source routing, exact recovery for any different coefficient domain, and +analytic-transfer obligations remain inherited or open. The unchanged leaf +multiplicities give no new multiplication exponent. diff --git a/research/modular-port-borrowing/common.py b/research/modular-port-borrowing/common.py new file mode 100644 index 0000000000..f27258c847 --- /dev/null +++ b/research/modular-port-borrowing/common.py @@ -0,0 +1,67 @@ +"""Strict local artifact I/O; Apache-2.0. Gareth Davidson, with Codex assistance.""" +import gzip +import hashlib +import importlib.util +import json +from pathlib import Path + +HERE = Path(__file__).resolve().parent + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def pairs(items): + out = {} + for key, value in items: + need(key not in out, "duplicate JSON key: " + key) + out[key] = value + return out + + +def invalid(value): + raise ValueError("nonfinite JSON: " + value) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":"), allow_nan=False).encode() + + +def digest(value): + return hashlib.sha256(canonical(value)).hexdigest() + + +def same(a, b, message): + need(canonical(a) == canonical(b), message) + + +def load(path): + path = Path(path) + data = path.read_bytes() + if path.suffix == ".gz": + data = gzip.decompress(data) + return json.loads(data, object_pairs_hook=pairs, parse_constant=invalid) + + +def write(path, value): + path = Path(path) + with path.open("xb") as stream: + stream.write(gzip.compress(canonical(value), mtime=0) if path.suffix == ".gz" else + (json.dumps(value, indent=2, sort_keys=True, allow_nan=False) + "\n").encode()) + + +def module(name, path): + spec = importlib.util.spec_from_file_location(name, path) + result = importlib.util.module_from_spec(spec) + spec.loader.exec_module(result) + return result + + +def pins(): + manifest = load(HERE / "SOURCES.json") + for name, pin in manifest["files"].items(): + need(hashlib.sha256((HERE / name).read_bytes()).hexdigest() == pin["sha256"], + "source hash mismatch: " + name) + return manifest diff --git a/research/modular-port-borrowing/dense.py b/research/modular-port-borrowing/dense.py new file mode 100644 index 0000000000..47de063265 --- /dev/null +++ b/research/modular-port-borrowing/dense.py @@ -0,0 +1,205 @@ +#!/usr/bin/env python3 +"""Literal finite-width integer-matrix echo backend. Apache-2.0. + +Gareth Davidson (@bitplane), with substantial OpenAI Codex assistance. +Uses the unchanged credited PR1057 address word; does not synthesize a new tree. +""" +from collections import Counter +from pathlib import Path +import runpy + +C = runpy.run_path(str(Path(__file__).with_name("common.py"))) +need = C["need"] + + +def dimensions(factors): + need(type(factors) is list and len(factors) > 0, "nonempty factors") + length = len(factors[0]) + need(length > 0 and all(type(a) is list and len(a) == length for a in factors), "matrix dimensions") + need(all(type(row) is list and len(row) == length and all(type(x) is int for x in row) + for a in factors for row in a), "integer matrix coefficients") + return length + + +def bound(factors, x_bound, y_bound): + dimensions(factors) + need(type(x_bound) is int and type(y_bound) is int and min(x_bound, y_bound) >= 0, + "nonnegative integer endpoint bounds") + norms = [max(sum(abs(x) for x in row) for row in a) for a in factors] + growth = 1 + for k in norms: + growth *= k + radius = y_bound + x_bound * growth + return dict(norms=norms, product=growth, endpoint_radius=radius, + width=max(1, max(x_bound, radius).bit_length() + 1)) + + +def signed(value, width): + return value if value < 1 << (width - 1) else value - (1 << width) + + +def admit(factors, initial, width, x_bound, y_bound): + length = dimensions(factors) + need(type(width) is int and width > 0, "positive integer width") + modulus = 1 << width + need(type(initial) is list and len(initial) == 5 + and all(type(row) is list and len(row) == length for row in initial), "five data arrays") + need(all(type(x) is int and 0 <= x < modulus for row in initial for x in row), "canonical data residues") + info = bound(factors, x_bound, y_bound) + need(max(x_bound, info["endpoint_radius"]) < modulus // 2, "strict signed recovery guard") + need(max(abs(signed(x, width)) for x in initial[0]) <= x_bound, "input bound") + need(max(abs(signed(x, width)) for x in initial[1]) <= y_bound, "output entry bound") + return info + + +def primitive_word(word, length): + """Yield commands; only four scalar work registers, no array clear/copy.""" + for role in ("a", "v", "c", "p"): + yield ("zero", role) + for source, target, factor, sign in word: + need(type(sign) is int and sign in (-1, 1), "leaf sign") + need(type(source) is int and type(target) is int and 0 <= source < 5 + and 0 < target < 5 and source != target, "distinct protected leaf ports") + need(type(factor) is int and factor >= 0, "factor id") + for i in range(length): + yield ("zero", "a") + for j in range(length): + yield ("read", "v", source, j) + yield ("coeff", "c", factor, i, j) + yield ("mul", "p", "c", "v") + yield ("low", "p") + yield ("add", "a", "p", 1) + yield ("low", "a") + yield ("read", "v", target, i) + yield ("add", "v", "a", sign) + yield ("low", "v") + yield ("write", target, i, "v") + for role in ("a", "v", "c", "p"): + yield ("zero", role) + yield ("boundary", source, target, factor, sign) + + +def execute(program, factors, initial, width, observer=None): + """Run every literal scalar command, checking declared work widths. + + Initial work is deliberately nonzero. Startup and per-leaf zeroing are + explicit commands. Python integers model bounded register operations; + checks reject overflow of the specified intermediate work capacities. + """ + length = dimensions(factors) + need(type(width) is int and width > 0, "positive integer width") + modulus, mask = 1 << width, (1 << width) - 1 + need(len(initial) == 5 and all(len(row) == length for row in initial), "data shape") + need(all(type(x) is int and 0 <= x < modulus for row in initial for x in row), "canonical data residues") + data = [row[:] for row in initial] + coefficients = [[[x & mask for x in row] for row in a] for a in factors] + work = dict(a=1, v=1, c=1, p=1) + counts, reduced, maxima = Counter(), Counter(), dict(a=0, v=0, c=0, p=0) + widths = dict(a=width + 1, v=width + 2, c=width, p=2 * width) + head, distance, accesses, boundaries = 0, 0, 0, 0 + leaf_size = length * (6 * length + 5) + 4 + commands = 0 + + def visit(address): + nonlocal head, distance, accesses + distance += abs(address - head) + head = address + accesses += 1 + + for command in program: + op, *args = command + if op == "boundary": + need(commands == 4 + (boundaries + 1) * leaf_size, "complete leaf primitive count") + need(all(x == 0 for x in work.values()), "private work not cleared") + need(data[0] == initial[0], "external input changed") + distance += head + head = 0 + if observer: + observer(boundaries, tuple(args), data) + boundaries += 1 + continue # Annotation, not an executed data primitive; dispatcher is billed separately. + commands += 1 + counts[op] += 1 + if op == "zero": + role, = args + work[role] = 0 + counts["zero_" + role] += 1 + elif op == "read": + role, row, col = args + work[role] = data[row][col] + visit(row * length + col) + elif op == "coeff": + role, f, i, j = args + need(type(f) is int and 0 <= f < len(factors), "coefficient factor range") + work[role] = coefficients[f][i][j] + visit(5 * length + (f * length + i) * length + j) + elif op == "mul": + role, a, b = args + work[role] = work[a] * work[b] + elif op == "add": + role, source, sign = args + need(type(sign) is int and sign in (-1, 1), "ADD sign") + work[role] += sign * work[source] + counts["add_" + role] += 1 + elif op == "low": + role, = args + reduced[role] += not 0 <= work[role] < modulus + work[role] &= mask + counts["low_" + role] += 1 + elif op == "write": + row, col, role = args + need(0 < row < 5 and 0 <= col < length, "protected output write") + need(0 <= work[role] < modulus, "unreduced data write") + data[row][col] = work[role] + visit(row * length + col) + continue + else: + raise ValueError("unknown primitive " + op) + need(role in widths, "private register id") + value = work[role] + if role == "v": + need(-(1 << (widths[role] - 1)) <= value < 1 << (widths[role] - 1), "signed work overflow") + else: + need(0 <= value < 1 << widths[role], "unsigned work overflow") + maxima[role] = max(maxima[role], abs(value)) + need(all(x == 0 for x in work.values()) and head == 0, "final work/head closure") + need(commands == 4 + boundaries * leaf_size, "complete program count") + return data, dict(counts=dict(counts), commands=commands, leaves=boundaries, + nontrivial_reductions=dict(reduced), work_peaks=maxima, + work_widths=widths, work_bits=sum(widths.values()), + intercell_steps=distance, accesses=accesses, + head_bit_moves=width * distance + 2 * (width - 1) * accesses, + data_bit_actions=width * accesses) + + +def invoice(word, length, n, width): + """Closed operation formulas and separate address itinerary, no primitive compiler.""" + count = len(word) + square = count * length * length + rows = count * length + counts = dict(zero=count * (length + 4) + 4, + zero_a=rows + count + 1, zero_v=count + 1, zero_c=count + 1, zero_p=count + 1, + read=square + rows, coeff=square, mul=square, + low=2 * square + rows, low_a=square, low_p=square, low_v=rows, + add=square + rows, add_a=square, add_v=rows, write=rows) + distance = 0 + for source, target, factor, _ in word: + itinerary = [0] + for i in range(length): + for j in range(length): + itinerary += [source * length + j, 5 * length + (factor * length + i) * length + j] + itinerary += [target * length + i] * 2 + itinerary += [0] + distance += sum(abs(a - b) for a, b in zip(itinerary, itinerary[1:])) + access = 2 * square + 2 * rows + b = max(1, (n - 1).bit_length()) + 2 * 3 + 1 + return dict(counts=counts, commands=count * (6 * length * length + 5 * length + 4) + 4, + leaves=count, intercell_steps=distance, accesses=access, + head_bit_moves=width * distance + 2 * (width - 1) * access, + data_bit_actions=width * access, data_bits=5 * length * width, + coefficient_bits=n * length * length * width, work_bits=5 * width + 3, + program_record_bits=b, program_bits=count * b, program_read_bits=count * b, + program_forward_and_rewind_bits=2 * count * b, + address_events=access, address_bits=max(1, (5 * length + n * length * length - 1).bit_length()), + preparation_reductions=n * length * length + 2 * length, + decoded_target_cells=length) diff --git a/research/modular-port-borrowing/independent.py b/research/modular-port-borrowing/independent.py new file mode 100644 index 0000000000..7113b56235 --- /dev/null +++ b/research/modular-port-borrowing/independent.py @@ -0,0 +1,177 @@ +"""Separate recursive event and exact matrix checker; no backend imports. + +Apache-2.0. Gareth Davidson, with substantial OpenAI Codex assistance. +""" +from functools import lru_cache +import hashlib +import json + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +@lru_cache(None) +def shapes(n): + if n == 1: + return (None,) + result = [] + for a in range(1, n): + for left in shapes(a): + for right in shapes(n - a): + result.append((left, right)) + for a in range(1, n - 1): + for b in range(1, n - a): + for left in shapes(a): + for middle in shapes(b): + for right in shapes(n - a - b): + result.append((left, middle, right)) + return tuple(result) + + +def label(shape): + index = 0 + + def walk(node): + nonlocal index + if node is None: + result = index + index += 1 + return result + return tuple(walk(child) for child in node) + + return walk(shape) + + +def interval(node): + if type(node) is int: + return node, node + 1 + return interval(node[0])[0], interval(node[-1])[1] + + +def events(tree, sign=1): + """Explicit binary/ternary templates, independently implemented control stack.""" + templates = {2: ((0, 1), (1, 1), (0, -1), (1, -1)), + 3: ((0, 1), (1, 1), (2, 1), (1, -1), (0, -1), (1, 1), (2, -1), (1, -1))} + stack = [("call", tree, 0, 1, sign)] + while stack: + action, node, source, target, q = stack.pop() + lo, hi = interval(node) + if action == "return": + yield "return", source, target, lo, hi, q + continue + require(source != target and target != 0, "invalid event ports") + yield "enter", source, target, lo, hi, q + stack.append(("return", node, source, target, q)) + if type(node) is int: + yield "leaf", source, target, node, q + continue + ports = [source] + [r for r in (2, 3, 1, 4) if r not in (source, target)][:len(node) - 1] + [target] + require(len(ports) == len(node) + 1 and len(set(ports)) == len(ports), "connector availability") + word = templates[len(node)] + if q < 0: + word = tuple((i, -s) for i, s in reversed(word)) + for child, direction in reversed(word): + stack.append(("call", node[child], ports[child], ports[child + 1], direction)) + + +def multiply(a, b): + return [[sum(x * y for x, y in zip(row, column)) for column in zip(*b)] for row in a] + + +def product(factors, lo=0, hi=None): + length = len(factors[0]) + result = [[int(i == j) for j in range(length)] for i in range(length)] + for factor in factors[lo:len(factors) if hi is None else hi]: + result = multiply(factor, result) + return result + + +def matvec(matrix, vector): + return [sum(a * b for a, b in zip(row, vector)) for row in matrix] + + +def endpoint(factors, entry, sign, modulus=None): + value = matvec(product(factors), entry[0]) + result = [row[:] for row in entry] + result[1] = [y + sign * x for y, x in zip(entry[1], value)] + if modulus: + result = [[x % modulus for x in row] for row in result] + return result + + +def basis_trace(tree, factors, width, sign, expected_word=None): + """All ordinary data columns; integer lift and residue maps at every leaf. + + Snapshot every recursive entry and compare every return to its direct + product shear, including children borrowing ancestor ports. + """ + length = len(factors[0]) + dimension, modulus = 5 * length, 1 << width + integer = [[int(i == j) for j in range(dimension)] for i in range(dimension)] + residue = [row[:] for row in integer] + stack, leaves, returns, seen, peak = [], 0, 0, [], 1 + transcript = hashlib.sha256() + products = {} + for event in events(tree, sign): + action, source, target, *rest = event + if action == "enter": + lo, hi, q = rest + stack.append((event, [row[:] for row in residue])) + elif action == "leaf": + factor, q = rest + seen.append([source, target, factor, q]) + for state, reduce in ((integer, False), (residue, True)): + before = [row[:] for row in state[source * length:(source + 1) * length]] + increment = multiply(factors[factor], before) + for i in range(length): + state[target * length + i] = [a + q * b for a, b in zip(state[target * length + i], increment[i])] + if reduce: + state[target * length + i] = [x % modulus for x in state[target * length + i]] + require(residue == [[x % modulus for x in row] for row in integer], "prefix quotient mismatch") + require(residue[:length] == [[int(i == j) for j in range(dimension)] for i in range(length)], + "external source overwritten") + peak = max(peak, max(abs(x) for row in integer for x in row)) + transcript.update(json.dumps([seen[-1], residue], separators=(",", ":")).encode()) + leaves += 1 + else: + lo, hi, q = rest + start, saved = stack.pop() + require(start == ("enter", source, target, lo, hi, q), "return nesting") + key = (lo, hi) + if key not in products: + products[key] = product(factors, lo, hi) + increment = multiply(products[key], saved[source * length:(source + 1) * length]) + expected = [row[:] for row in saved] + for i in range(length): + expected[target * length + i] = [(a + q * b) % modulus for a, b in + zip(expected[target * length + i], increment[i])] + require(residue == expected, "recursive return contract") + returns += 1 + require(not stack, "unclosed recursive stack") + if expected_word is not None: + require(seen == [list(row) for row in expected_word], "independent literal word") + identity = [[int(i == j) for j in range(dimension)] for i in range(dimension)] + expected = [row[:] for row in identity] + matrix = product(factors) + for i in range(length): + for j in range(length): + expected[length + i][j] += sign * matrix[i][j] + require(integer == expected, "integer whole-word endpoint") + require(residue == [[x % modulus for x in row] for row in expected], "residue whole-word endpoint") + return dict(leaves=leaves, recursive_returns=returns, columns=dimension, + transcript_sha256=transcript.hexdigest(), integer_basis_prefix_peak=str(peak)) + + +def concrete_prefixes(word, factors, initial, width): + """Direct integer matrix updates, independent of scalar lowering/reductions.""" + modulus = 1 << width + signed = lambda x: x if x < modulus // 2 else x - modulus + data = [[signed(x) for x in row] for row in initial] + peak = max(abs(x) for row in data for x in row) + for source, target, factor, sign in word: + increment = matvec(factors[factor], data[source]) + data[target] = [a + sign * b for a, b in zip(data[target], increment)] + peak = max(peak, max(abs(x) for row in data for x in row)) + yield [row[:] for row in data], peak diff --git a/research/modular-port-borrowing/test_package.py b/research/modular-port-borrowing/test_package.py new file mode 100644 index 0000000000..b457c8679e --- /dev/null +++ b/research/modular-port-borrowing/test_package.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python3 +"""Fault injection into the same fast admission used by the complete replay.""" +import gzip +import json +from pathlib import Path +import runpy +import shutil +import tempfile +import unittest + +HERE = Path(__file__).resolve().parent + + +class PackageTests(unittest.TestCase): + def setUp(self): + self.temp = tempfile.TemporaryDirectory(prefix="modular-package-") + self.addCleanup(self.temp.cleanup) + self.path = Path(self.temp.name) / "relocated" + shutil.copytree(HERE, self.path, ignore=shutil.ignore_patterns("__pycache__")) + self.v = runpy.run_path(str(self.path / "verify.py")) + + def admit(self): + case, program, _ = self.v["admit_artifacts"]() + self.v["admit_certificate"](case, program) + + def put(self, name, value): + raw = json.dumps(value, sort_keys=True).encode() + (self.path / name).write_bytes(gzip.compress(raw, mtime=0) if name.endswith(".gz") else raw) + + def test_offline_relocation(self): + self.admit() + + def test_generated_recompression(self): + for name in ("CASE.json.gz", "PROGRAM.json.gz"): + path = self.path / name + raw = gzip.decompress(path.read_bytes()) + for level in (1, 9): + path.write_bytes(gzip.compress(raw, compresslevel=level, mtime=12345)) + self.admit() + + def test_source_code_pin(self): + path = self.path / "vendor/pr1057/borrow.py" + path.write_bytes(path.read_bytes() + b"\nraise RuntimeError('unpinned parent executed')\n") + with self.assertRaisesRegex(ValueError, "source hash mismatch"): + runpy.run_path(str(self.path / "verify.py")) + with self.assertRaisesRegex(ValueError, "source hash mismatch"): + self.admit() + + def test_selected_context_pin(self): + path = self.path / "BASE-SELECTION.json" + path.write_bytes(path.read_bytes() + b" ") + with self.assertRaisesRegex(ValueError, "source hash mismatch"): + self.admit() + + def test_wrong_width_with_rebound_digest(self): + case = self.v["C"]["load"](self.path / "CASE.json.gz") + case["width"] -= 1 + self.put("CASE.json.gz", case) + receipt = self.v["C"]["load"](self.path / "CERTIFICATE.json") + receipt["case_sha256"] = self.v["C"]["digest"](case) + self.put("CERTIFICATE.json", receipt) + with self.assertRaisesRegex(ValueError, "case regeneration"): + self.admit() + + def test_removed_reduction_with_rebound_digest(self): + program = self.v["C"]["load"](self.path / "PROGRAM.json.gz") + program.remove(["low", "p"]) + self.put("PROGRAM.json.gz", program) + receipt = self.v["C"]["load"](self.path / "CERTIFICATE.json") + receipt["program_sha256"] = self.v["C"]["digest"](program) + self.put("CERTIFICATE.json", receipt) + with self.assertRaisesRegex(ValueError, "primitive regeneration"): + self.admit() + + def test_undercharged_reductions(self): + receipt = self.v["C"]["load"](self.path / "CERTIFICATE.json") + for key in ("invoice", "execution"): + receipt["concrete"]["bounded_positive"][key]["counts"]["low"] -= 1 + self.put("CERTIFICATE.json", receipt) + with self.assertRaisesRegex(ValueError, "complete invoice"): + self.admit() + + def test_free_product_work(self): + receipt = self.v["C"]["load"](self.path / "CERTIFICATE.json") + receipt["concrete"]["dirty_bits_positive"]["invoice"]["work_bits"] = 4 * 56 + self.put("CERTIFICATE.json", receipt) + with self.assertRaisesRegex(ValueError, "complete invoice"): + self.admit() + + def test_omitted_negative_direction(self): + receipt = self.v["C"]["load"](self.path / "CERTIFICATE.json") + del receipt["concrete"]["dirty_bits_negative"] + self.put("CERTIFICATE.json", receipt) + with self.assertRaisesRegex(ValueError, "concrete inventory"): + self.admit() + + def test_dropped_tree_coverage(self): + receipt = self.v["C"]["load"](self.path / "CERTIFICATE.json") + receipt["all_trees"]["cases"] -= 1 + self.put("CERTIFICATE.json", receipt) + with self.assertRaisesRegex(ValueError, "matrix coverage"): + self.admit() + + def test_boolean_numeric_receipt(self): + receipt = self.v["C"]["load"](self.path / "CERTIFICATE.json") + receipt["endpoint_bound"]["width"] = True + self.put("CERTIFICATE.json", receipt) + with self.assertRaisesRegex(ValueError, "endpoint allowance"): + self.admit() + + def test_duplicate_nonfinite_json(self): + for raw in ('{"x":1,"x":2}', '{"x":NaN}', '{"x":Infinity}', '{"x":-Infinity}'): + with self.subTest(raw=raw): + (self.path / "CERTIFICATE.json").write_text(raw) + with self.assertRaisesRegex(ValueError, "duplicate JSON|nonfinite JSON"): + self.admit() + + +if __name__ == "__main__": + unittest.main() diff --git a/research/modular-port-borrowing/vendor/pr1057/LICENSE b/research/modular-port-borrowing/vendor/pr1057/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/modular-port-borrowing/vendor/pr1057/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/modular-port-borrowing/vendor/pr1057/NOTICE.md b/research/modular-port-borrowing/vendor/pr1057/NOTICE.md new file mode 100644 index 0000000000..e718ab189a --- /dev/null +++ b/research/modular-port-borrowing/vendor/pr1057/NOTICE.md @@ -0,0 +1,42 @@ +# Attribution and license + +Prepared for **bitplane** with substantial **OpenAI Codex assistance** in +mathematical reasoning, implementation, verification and writing. No +independent human review or formal verification is claimed. No delegated +agent was used. New files are Apache-2.0 under the copied repository LICENSE. + +- **shhxera, PR822**: sibling-connector reuse, the strong nonlinear contract, + its ancestor-target counterexample, fixed-budget optimizer and exact + comparison implementation. Original `reuse.py`, `PROOF.md` and `NOTICE.md` + are retained byte-for-byte at commit + `8c5e1b557f59bca29139c4c2dcc65edfb808372b`; Git blobs and SHA-256 digests + appear in SOURCES.json. Their historical relative links refer to the + original package layout. The new emitter adapts that credited echo word + and changes its allocator and admissible contract. +- **androolloyd, PR673**: multiway dirty echo, nonlinear restoration analysis + and the direct all-role integration obstruction. **Sagar Thakrar + (@thakrarsagar), PR730**: ordered binary/ternary dynamic programming and + the reserved-connector comparison. **Chafik Boukhalfa (@chafreaky), PR628**: + rounded inverse leaves and the binary commutator. All predecessor credits + retained in the original PR822 notice continue to apply. +- **Michael Ben-Or and Richard Cleve**, *Computing Algebraic Formulas Using a + Constant Number of Registers*, SIAM J. Comput. 21(1), 54–58 (1992), + [doi:10.1137/0221006](https://epubs.siam.org/doi/abs/10.1137/0221006): + prior constant-register algebraic computation. No priority is claimed + for the general principle or the elementary transvection identity. +- **Alexander Schwartzman (@AlexS-scale), PR784**, and **bitplane, PR887**: + the reserved-tree scratch/call lower bound and its Lean formalization + concern a different allocator. **bitplane, PR896**: formalized nonlinear + restoration for the excluded-ancestor interface, also a different contract. +- **Jerry Chen (@CubeJerry), PR889**; **Ross Richardson, PR982**; and + **CinnaDavis1337isnot1337, PR997**, together with PR934/943/944, provide + concurrent common-factor, output-borrowing and signed source batching. + Those inspected interfaces are comparison context, not source inputs or + a claim that this package improves their query bounds. +- The selected PR942 result remains credited to **Jonathan Capalbo + (@jon314159)** and all supplier, owner and predecessor contributors in + its retained maintainer review. Its frontier and assumptions are unchanged. + +The new scope is exact additive ancestor-port borrowing with a globally +protected external source, independent noncommuting replay, an explicit +nonlinear failure boundary and a fully stated conditional backend bill. diff --git a/research/modular-port-borrowing/vendor/pr1057/PROOF.md b/research/modular-port-borrowing/vendor/pr1057/PROOF.md new file mode 100644 index 0000000000..96e1381201 --- /dev/null +++ b/research/modular-port-borrowing/vendor/pr1057/PROOF.md @@ -0,0 +1,238 @@ +# A fixed pool under an exact additive contract + +## Contract and allocator + +Let V be an abelian group and let A_0,...,A_(n-1) be exact additive +endomorphisms of V. A leaf on distinct rows s,t performs +`row[t] += q A_i(row[s])`, with q in {+1,-1}, restoring its source and its +separately supplied private workspace. There are no aliased row views, +mutable coefficient descriptors, hidden state, concurrent observers or +exceptions midway through a leaf. Coefficients and descriptors are read-only. +Represented arithmetic is exact, with sufficient headroom. This is stronger +than merely requiring a reversible shear with a deterministic nonlinear +increment. Factors need not commute. + +Global row zero is the external input. Row one is the output. For ternary +and binary nodes, retain the fixed mutable pool `{1,2,3,4}` and choose k-1 +connectors from it after excluding the current source and target. The fixed +priority `[2,3,1,4]` specifies the emitted addresses. Every child receives +this same global pool; ancestor ports may be selected when they are not that +child's immediate ports. Global row zero is never a connector or target. + +At most two pool rows are excluded, leaving at least two connectors. Thus +three dirty rows suffice for every finite ordered binary/ternary tree. +For binary-only trees the pool `{1,2,3}` leaves at least one connector, so +two dirty rows suffice. These are upper bounds, not necessity claims. +Small trees can use fewer. No row copy, row initialization or row clear +occurs when a physical row is lent to another invocation. + +The external input is read-only at every prefix. An internal invocation's +source is guaranteed restored **on return**; deeper descendants can modify +it temporarily. This weaker internal source interface is part of the change. +Leaf calls still have distinct immediate ports and preserve their immediate +source throughout that atomic leaf. + +## Induction and the echo word + +Induct on the supplied finite tree. A leaf satisfies the contract. At an +internal node, let B_i be the ordered product represented by child i. By +induction, every completed child changes exactly its target by `q B_i(source)` +and restores every other row, independently of the incoming dirty values. +Consequently the state at child boundaries is precisely the state of ideal +shears on the chain of ports `(x,z_1,...,z_(k-1),y)`. Borrowing other ancestor +ports inside a child does not change these boundary maps. + +Write U_i for the shear from chain port i to port i+1. With execution order +left to right, let `C = U_0 ... U_(k-2)` and `D = U_1 ... U_(k-2)`. +Use the credited PR673/PR822 word + +``` +C; U_(k-1); inverse(C); D; inverse(U_(k-1)); inverse(D). +``` + +For k=2 the word is `U; V; U^-1; V^-1`. After U, the connector is +`z + B_0 x`. The two V calls add +`B_1(z+B_0 x) - B_1 z = B_1 B_0 x` to y, and the connector restores. + +For k=3 the word is `U; V; W; V^-1; U^-1; V; W^-1; V^-1`. +The first W reads `z_2 + B_1 z_1 + B_1 B_0 x`; the second reads +`z_2 + B_1 z_1`. Their difference is `B_2 B_1 B_0 x`. The inverse +ladders restore both connectors. No commutation of B_i is used. All +non-chain rows restore by the induction hypothesis. This proves the +positive call; reversing all leaf records and negating each sign proves +the negative call. Deterministic address selection makes this inverse +literal, even when ancestor ports are reused. + +The result holds for arbitrary initial output and dirty rows. Its essential +step is that a completed child is an additive shear independent of its +incoming private pool. PR822's nonlinear contract permits that increment +to depend on private dirt. Lending an ancestor target can then change the +increment that a later inverse call must subtract. The eight-factor +certificate exhibits this failure, rather than extending the theorem to +rounded or arbitrary nonlinear leaves. + +The general constant-register algebraic phenomenon is classical; see +Michael Ben-Or and Richard Cleve, *Computing Algebraic Formulas Using a +Constant Number of Registers*, SIAM J. Comput. 21(1), 54–58 (1992), +[doi:10.1137/0221006](https://epubs.siam.org/doi/abs/10.1137/0221006). +The contribution here is the specific allocator/contract comparison, +literal noncommuting replay and explicit resource bill, not priority for +constant-register computation. + +## Calls, planning and the comparison class + +For per-factor prices c_i valid for both signs, every occurrence, the common +precision and all required private work, a leaf has bill c_i. Binary nodes +have bill `2 W_0 + 2 W_1`; ternary nodes have bill `2 W_0 + 4 W_1 + 2 W_2`. +These include both target updates and every inverse ladder. Address-dependent +leaf costs must instead be summed over the actual emitted `(s,t,i,q)` records; +they cannot be replaced by a uniform c_i without justification. + +For unit prices, let F(1)=1. For n>1 take the minimum of + +``` +2 F(a) + 2 F(n-a), 1 <= a < n, +2 F(a) + 4 F(b) + 2 F(n-a-b), a,b >= 1, a+b < n. +``` + +Every admitted root has one listed partition, and joining minimizers attains +each candidate. Induction proves optimality within these fixed echo templates +over binary/ternary ordered trees. It says nothing about other algebraic +identities, higher arities or arbitrary programs. Ties are resolved by +`(bill, arity, split sizes)`, and leaves are labeled consecutively. + +The planner through 64 examines exactly 43,680 candidates. Its DP has O(n) +entries and O(n^3) arithmetic/comparison steps on their actual integer bit +lengths. The public routine also materializes all plans through n, using +O(n^2) tree storage; a single selected tree has O(n) nodes. Planning, tree +construction, precision calculation, coefficient preparation and word +compilation are paid separately. No reuse of planning is assumed. + +For the 56-factor chosen tree: `N = 1,568`, depth five, 91 tree nodes. +The pinned PR822 sibling allocator has S=5, while the reserved allocator +has S=9 for this same tree. PR822's exact optimizer at cap five also costs +1,568; cap four is infeasible. Its proved capacity recurrence gives +`M_4 = 29 < 56 <= M_5 = 70`. This does not contradict that theorem because +its excluded-ancestor contract has changed. A balanced binary 56-factor +tree has 3,328 calls and six reserved dirty rows; our binary allocator can +emit that different word with two dirty rows. It is a separate space/time +choice, not a claim that three arrays are minimal. + +With a fixed pool the generator uses O(h) control frames for tree depth h, +besides the read-only tree. Its Python validation/list construction and +yield propagation have the conservative record-operation bound +`O((n+N)h)`. The verifier deliberately materializes words, polynomial states +and receipts; its memory usage is not the theorem's data-space bound. + +## Exact integer headroom + +For a normed linear realization choose an integer `K >= 1` bounding every factor's induced +infinity norm. Define + +``` +H(leaf) = 1 + K, +H(node) = (k+1) K^n max_i H(child_i), +``` + +where n counts leaves below that node. At a completed-child boundary of +either the positive or negative k=2 or k=3 ladder, each chain row is a sum +of at most k+1 signed products applied to entry rows. Each product has +degree at most n; cancellation is exact. All other rows retain their entry +values. Hence the joint maximum norm is at most `(k+1) K^n` times the +node's entry norm at every such boundary. During a child, its inductively +bounded prefix multiplies this estimate by at most H(child). This proves +the displayed majorant for all prefixes, including borrowed ancestor ports. + +For a dense integer leaf, each product and each partial row sum is bounded +by K times its incoming source norm, and the final target by 1+K times the +joint incoming norm. Thus the same majorant bounds scalar work as well as +data. If initial joint norm is at most a nonnegative integer D, sufficient signed payload width is + +``` +P = bit_length(max(K, D H(root))) + 1. +``` + +The maximum includes immutable coefficient values. This uses exact integer +arithmetic; no numerical error estimate or rounded restoration follows. +The independent free-module interpreter also computes weighted coefficient +l1 norms (`K^degree` per monomial) at every leaf boundary and checks the +majorant. In the main fixture the bound gives P=119 for D=7, K=2. +Observed dense maxima are evidence for those fixtures, not a replacement +for the majorant. Intermediate products can have degree greater than n +under port borrowing (69 at n=56), so a simple `K^n` global-prefix claim +would be unjustified. + +## A complete, conditional price + +For any actual backend, the complete execution price is + +``` +planning + coefficient/descriptor preparation + word compilation ++ sum over emitted leaves of C_i(s,t,q,L,P) ++ dispatch/control + any routing/frame work outside C_i ++ private-work initialization/final restoration. +``` + +`C_i` must include source/coefficient accesses, the chosen leaf's arithmetic, +its private work and both signs at the required precision. If a supplier +requires copies, physical frame changes or additional recursive children, +they belong in C_i or an explicit additional term. Port borrowing makes no +such adapter free and does not change those supplier requirements. + +To make the accounting concrete, the certificate executes dense integer +matrix-vector leaves with four **clean scalar** P-bit work registers: +accumulator, source/target value, coefficient and product. Each matrix row +zeros its accumulator, reads L source entries and L coefficients, multiplies +and sums them, reads and updates one target entry and writes it back. After +each leaf all four scalar registers are explicitly zeroed. These are paid +ordinary assignments; no reversible-gate implementation of clearing is claimed. +The external arrays are arbitrary dirty data, while this small private/control +workspace has its separately stated clean contract. The same workspace is +charged to every allocator in the comparison. + +Per leaf this executes `L^2` multiplies, `L^2+L` add/subtracts, `L+4` scalar +zero assignments, `2L^2+L` reads and L writes: `4L^2+4L+4` commands. +Initialize the four scalar registers once as four more paid zero assignments. +No length-L copy or clear is hidden here. Distinct leaf source and target +make the row-by-row target writes safe. + +Data has `(S+2)L` P-bit cells, and read-only coefficients follow in `nL^2` +P-bit cells. Addresses are `sL+j`, `tL+i`, and +`(S+2)L+(factor*L+i)L+j`. The specified itinerary alternates source and +coefficient reads, visits the target for its read/write, and returns the +data head to address zero after **every** leaf. Literal replay and a separate +invoice calculation agree on every intercell distance. At each access a +bit head can scan a full P-bit cell and return to its left edge, adding +`2(P-1)` within-cell moves. Thus the explicit head bill is +`P * intercell_steps + 2(P-1) * accesses`, in addition to `P * accesses` +read/write bit actions. Address calculation is also paid: the receipt gives +the number of address events E and the address width a. With a specified +address routine of cost R(a) per event, add `E R(a)`. + +The read-only unrolled program has N records of +`b = max(1,ceil(log2 n)) + 2 max(1,ceil(log2(S+2))) + 1` bits. +Charge Nb bits of storage and reads and 2Nb bits of forward-and-rewind +traversal. With a specified dispatcher of cost Q(b,a,log L) per record, +add `N Q(b,a,log L)` and its control workspace. Neither the dispatcher nor +the address routine is a proven fixed-tape compiler here. They remain +explicit backend parameters, not omitted constant-time pointer operations. + +Writing M(P), A(P), Z(P) for scalar multiply, add/subtract and zero-assignment +costs, the dense arithmetic term is exactly + +``` +N L^2 M(P) + N(L^2+L) A(P) + (N(L+4)+4) Z(P). +``` + +Add the stated bit accesses/head travel, program preparation/read/travel, +`E R(a)`, `N Q(b,a,log L)`, coefficients, scalar workspace and backend control +storage. This gives an instantiated, conditional bill with no silent free +source access, restoration, scalar clearing or metadata. It does not prove +that the array saving improves runtime on another machine model. + +PR673/730/822's call obstruction for the direct all-role adapter survives: +for n>=2 these echo trees have `N >= 4n-4`, so its optimistic moment +`3N / (2 n^(1-b))` is already at least three at b=0. Our fixed-tree call +multiplicities are unchanged. Selected supplier assumptions, exact recovery, +all-size realization, physical hosting, fixed-tape and analytic transfer +obligations remain inherited or open. No selected certificate is edited. diff --git a/research/modular-port-borrowing/vendor/pr1057/README.md b/research/modular-port-borrowing/vendor/pr1057/README.md new file mode 100644 index 0000000000..59c4167f89 --- /dev/null +++ b/research/modular-port-borrowing/vendor/pr1057/README.md @@ -0,0 +1,83 @@ +# Borrowing ancestor ports for exact additive echoes + +**Research note / recursive interface, seed 56.** Exact additive leaves allow +the binary/ternary dirty echo to run with at most **three dirty length-L arrays, +at any tree depth**, in addition to its input, output and separately charged +leaf workspace. The external input stays read-only at every prefix. Each +completed call restores its other rows, but an ancestor's input or output may +be temporary scratch inside a descendant. This changes the contract relative +to PR822, whose stronger nonlinear restoration guarantee excludes those ports. + +For the selected 56-factor tree, the literal word still contains **1,568 leaf +calls**. PR822's sibling allocator requires **five** dirty arrays; the fully +reserved allocator requires nine for this same tree. The new allocator uses +three. PR822's pinned optimizer independently returns 1,568 calls at cap five +and rejects cap four. These are comparisons within explicit allocator and +echo-template classes, not a lower bound for arbitrary reversible programs. + +This applies the classical constant-register algebraic principle to the +repository's concrete allocator, contract and accounting. It claims no +priority for that principle. There is **no new kappa**, physical tape compiler, +rounded-leaf guarantee or wall-time speedup claim. At the exact base +`2921874911956718fcaaaf9396fe8267b3cfa9f0`, the selected conditional kappa is +`1661960547713947 / 1000000000000000000` from PR942. + +Run from the repository root, with Python 3.12 or newer and no dependencies: + +```sh +python3 -B research/linear-port-borrowing/verify.py +python3 -B research/linear-port-borrowing/test_package.py +``` + +Expected: `PASS`, 861 exhaustive small trees, 1,752 free-module checks, +1,568 primary calls, three primary dirty rows, and `kappa_changed: false`. +The second command rejects 13 deliberately corrupted packages. Verification +reads committed sources and regenerates every proof-relevant receipt field; +it writes nothing unless an explicit `--receipt PATH` is supplied. `--write` +is an author-only certificate regeneration option, not part of cold replay. + +The finite domain is all ordered binary/ternary trees through seven factors, +and the unit-optimal trees at 1, 2, 3, 4, 5, 8, 16, 27, 56 and 64 factors. +The independent free-module interpreter retains noncommuting factor words +and a different formal symbol for every initial dirty row. Both orientations +are checked. Dense integer matrices of dimensions two and three provide +120 further signed allocator/layout replays. This evidence supports the +all-tree induction in [PROOF.md](PROOF.md); it is not a machine-checked proof +of the full multiplication theorem. + +The main exact dense example has `L = 2`, factor norm at most two, initial +norm at most seven and a common sufficient signed width of **119 bits**: + +| Charged item | Borrow ancestor ports | PR822 sibling pool | Reserved pool | +| --- | ---: | ---: | ---: | +| Dirty arrays | 3 | 5 | 9 | +| Leaf calls | 1,568 | 1,568 | 1,568 | +| Data bits, including input/output | 1,190 | 1,666 | 2,618 | +| Intercell head travel, in cells | 1,609,024 | 1,614,016 | 1,666,048 | +| Head travel, including within-cell scans, in bits | 195,914,432 | 196,508,480 | 202,700,288 | +| Unrolled program bits | 20,384 | 20,384 | 23,520 | + +All three additionally pay 6,272 scalar multiplies, 9,408 additions or +subtractions, **9,408 scalar zero assignments**, 15,680 reads, 3,136 writes, +four startup scalar zero assignments, 476 scalar-work bits, 26,656 coefficient +bits, program preparation/dispatch and address calculation. The 43,904 +primitive commands include returning all four clean scalar work registers to +zero after every leaf. The routing bill includes a data-head return to home +after every leaf. These are explicit counts for the described abstract dense +backend, not a certified implementation on the paper's fixed-tape machine. +The common width is a sufficient proof majorant, not an optimal precision. +Ancestor borrowing can enlarge intermediate values; array counts alone do +not prove an improvement in the best possible bit-space or running time. + +The nonlinear boundary is concrete. For the eight-factor fixture and +`f_i(z) = (z mod 17)^2 + (i+1)(z mod 7) - 3`, initial rows +`[-7, -4, -1, 2, 5]` become `[-7, 23, 5, 2, 5]`: a helper is corrupted. +PR822 restores all helpers on that same input. Reversing the new literal word +still restores the entire initial state; reversibility alone is insufficient +for the completed-call restoration contract. Rounded and nonlinear leaves +must retain their original obligations and cannot be substituted here. + +Source pins and original notices are in [SOURCES.json](SOURCES.json) and +[NOTICE.md](NOTICE.md). [VALIDATION.md](VALIDATION.md) records environments, +receipt hashes and remaining obligations. The selected construction and +`upstream/` are unchanged. diff --git a/research/modular-port-borrowing/vendor/pr1057/borrow.py b/research/modular-port-borrowing/vendor/pr1057/borrow.py new file mode 100644 index 0000000000..b5014c9eb2 --- /dev/null +++ b/research/modular-port-borrowing/vendor/pr1057/borrow.py @@ -0,0 +1,152 @@ +"""Exact additive echo with ancestor ports borrowed from a fixed dirty pool. + +Apache-2.0. Prepared for bitplane with substantial OpenAI Codex assistance. +The echo word and sibling allocator are credited to PR673/730/822; see NOTICE. +""" +from functools import lru_cache + + +def leaves(tree): + if type(tree) is int and tree >= 0: + return [tree] + if not isinstance(tree, (tuple, list)) or len(tree) not in (2, 3): + raise ValueError("an ordered binary/ternary tree is required") + return [i for child in tree for i in leaves(child)] + + +def validate(tree): + ids = leaves(tree) + if ids != list(range(len(ids))): + raise ValueError("ordered consecutive leaf indices required") + return len(ids) + + +def macro(arity): + chain = [(i, 1) for i in range(arity - 1)] + inv = lambda word: [(i, -q) for i, q in reversed(word)] + return (chain + [(arity - 1, 1)] + inv(chain) + chain[1:] + + [(arity - 1, -1)] + inv(chain[1:])) + + +def instructions(tree, dirty_rows=3, sign=1): + """Yield (source, target, factor, sign); row zero is globally read-only. + + Four mutable rows suffice for all binary/ternary trees. Three suffice for + binary trees. Smaller supplied pools can fail during iteration; callers + needing atomic validation must materialize the word before executing it. + """ + validate(tree) + if type(dirty_rows) is not int or dirty_rows < 0: + raise ValueError("nonnegative integer dirty row count required") + if type(sign) is not int or sign not in (-1, 1): + raise ValueError("integer sign +1 or -1 required") + # This fixed priority makes the nonlinear boundary witness reproducible. + pool = [r for r in [2, 3, 1, 4] if r < dirty_rows + 2] + pool += list(range(5, dirty_rows + 2)) + + def emit(node, src, dst, direction): + if type(node) is int: + yield src, dst, node, direction + return + connectors = [r for r in pool if r not in (src, dst)][:len(node)-1] + if len(connectors) != len(node)-1: + raise ValueError("insufficient mutable ports") + ports = [src] + connectors + [dst] + word = macro(len(node)) + if direction < 0: + word = [(i, -q) for i, q in reversed(word)] + for i, q in word: + yield from emit(node[i], ports[i], ports[i+1], q) + + yield from emit(tree, 0, 1, sign) + + +def unit_plan(limit): + """Minimize unit leaf calls over the stated binary/ternary echo class. + + Ties use (bill, arity, split sizes). Planning is separate from execution. + """ + if type(limit) is not int or limit < 1: + raise ValueError("positive integer limit required") + bills, splits = [0, 1], [None, None] + candidates = 0 + for n in range(2, limit+1): + best = None + for a in range(1, n): + candidate = (2*(bills[a]+bills[n-a]), 2, (a, n-a)) + candidates += 1 + if best is None or candidate < best: + best = candidate + for a in range(1, n-1): + for b in range(1, n-a): + c = n-a-b + candidate = (2*bills[a]+4*bills[b]+2*bills[c], 3, (a, b, c)) + candidates += 1 + if candidate < best: + best = candidate + bills.append(best[0]) + splits.append(best[2]) + + def build(n, start=0): + if n == 1: + return start + children = [] + for size in splits[n]: + children.append(build(size, start)) + start += size + return tuple(children) + + return bills, [build(n) for n in range(1, limit+1)], candidates + + +def resources(tree): + """(leaves, calls, reserved dirty rows, sibling dirty rows, depth).""" + if type(tree) is int: + return 1, 1, 0, 0, 0 + children = [resources(t) for t in tree] + k = len(tree) + weights = [2, 2] if k == 2 else [2, 4, 2] + return (sum(r[0] for r in children), + sum(w*r[1] for w, r in zip(weights, children)), + k-1+max(r[2] for r in children), + max([k-1]+[r[3]+(1 if i in (0, k-1) else 2) + for i, r in enumerate(children)]), + 1+max(r[4] for r in children)) + + +def norm_bound(tree, factor_norm): + """Bound every prefix on the joint maximum norm, including scalar work.""" + if type(factor_norm) is not int or factor_norm < 1: + raise ValueError("positive integer factor norm required") + if type(tree) is int: + return 1+factor_norm + return ((len(tree)+1)*factor_norm**len(leaves(tree)) + * max(norm_bound(child, factor_norm) for child in tree)) + + +def reserved_instructions(tree, sign=1): + """Old fully reserved allocator, used only as an address-cost comparator.""" + validate(tree) + + def emit(node, src, dst, pool, q): + if type(node) is int: + yield src, dst, node, q + return + connectors = pool[:len(node)-1] + ports = [src]+connectors+[dst] + word = macro(len(node)) + if q < 0: + word = [(i, -s) for i, s in reversed(word)] + for i, s in word: + yield from emit(node[i], ports[i], ports[i+1], + pool[len(node)-1:], s) + + yield from emit(tree, 0, 1, list(range(2, resources(tree)[2]+2)), sign) + + +@lru_cache(None) +def balanced_binary(n, offset=0): + if n == 1: + return offset + left = n//2 + return balanced_binary(left, offset), balanced_binary(n-left, offset+left) diff --git a/research/modular-port-borrowing/verify.py b/research/modular-port-borrowing/verify.py new file mode 100644 index 0000000000..fa5bc58a70 --- /dev/null +++ b/research/modular-port-borrowing/verify.py @@ -0,0 +1,367 @@ +#!/usr/bin/env python3 +"""Check exact modular borrowed-port execution, recovery, and its complete bill. + +Gareth Davidson (@bitplane), with substantial OpenAI Codex assistance. +Apache-2.0. Standard library only; all rejection checks survive -O. +""" +import argparse +import copy +import hashlib +import itertools +from pathlib import Path +import random +import runpy + +C = runpy.run_path(str(Path(__file__).with_name("common.py"))) +HERE, need, same = C["HERE"], C["need"], C["same"] +D = C["module"]("modular_dense", HERE / "dense.py") +I = C["module"]("modular_independent", HERE / "independent.py") +C["pins"]() # Authenticate copied source bytes before executing the parent emitter. +P = C["module"]("pinned_borrowing", HERE / "vendor/pr1057/borrow.py") + + +def factors(n): + result = [] + for i in range(n): + a = [[1, 1], [0, 1]] if i % 2 == 0 else [[1, 0], [1, 1]] + sign = -1 if (i + 52) % 7 in (0, 3) else 1 + result.append([[sign * x for x in row] for row in a]) + return result + + +def main_artifacts(): + _, plans, comparisons = P.unit_plan(64) + tree, matrices = plans[51], factors(52) + width = D.bound(matrices, 7, 7)["width"] + word = list(P.instructions(tree)) + case = dict(format="modular-port-borrowing/1", assignment_seed=52, n=52, length=2, + tree=tree, factors=matrices, word=word, width=width, x_bound=7, y_bound=7, + plan_comparisons_through64=comparisons) + program = list(D.primitive_word(word, 2)) + return case, program, plans + + +def admit_artifacts(): + C["pins"]() + case, program, plans = main_artifacts() + same(C["load"](HERE / "CASE.json.gz"), case, "complete case regeneration") + same(C["load"](HERE / "PROGRAM.json.gz"), program, "complete primitive regeneration") + return case, program, plans + + +def concrete(case, program, full_dirty_bits, sign=1): + matrices, w, length = case["factors"], case["width"], case["length"] + modulus = 1 << w + rng = random.Random(52) + entry = [[-7, 7], [7, -7]] + [[rng.randrange(modulus) if full_dirty_bits else rng.randrange(-7, 8) + for _ in range(length)] for _ in range(3)] + initial = [[x % modulus for x in row] for row in entry] + D.admit(matrices, initial, w, 7, 7) + word = list(P.instructions(case["tree"], sign=sign)) + if sign < 0: + program = list(D.primitive_word(word, length)) + prefix = iter(I.concrete_prefixes(word, matrices, initial, w)) + transcript, largest = hashlib.sha256(), 0 + + def observe(index, leaf, data): + nonlocal largest + same(list(leaf), list(word[index]), "leaf event order") + integer, largest = next(prefix) + same(data, [[x % modulus for x in row] for row in integer], "literal/integer prefix quotient") + transcript.update(C["canonical"](data)) + + final, execution = D.execute(program, matrices, initial, w, observe) + need(next(prefix, None) is None, "complete independent prefix coverage") + signed_entry = [[D.signed(x, w) for x in row] for row in initial] + expected = I.endpoint(matrices, signed_entry, sign) + same(final, [[x % modulus for x in row] for row in expected], "complete modular endpoint") + same([D.signed(x, w) for x in final[1]], expected[1], "unique signed integer recovery") + need(all(final[i] == initial[i] for i in (0, 2, 3, 4)), "bitwise dirty restoration") + invoice = D.invoice(word, length, len(matrices), w) + for key in ("counts", "commands", "leaves", "intercell_steps", "accesses", "head_bit_moves", + "data_bit_actions", "work_bits"): + same(execution[key], invoice[key], "literal/closed invoice: " + key) + inverse = [(s, t, f, -q) for s, t, f, q in reversed(word)] + undone, _ = D.execute(D.primitive_word(inverse, length), matrices, final, w) + same(undone, initial, "literal inverse restores all bit patterns") + return dict(initial=initial, final=final, signed_output=expected[1], sign=sign, + observed_integer_prefix_peak=str(largest), observed_integer_prefix_bits=largest.bit_length() + 1, + transcript_sha256=transcript.hexdigest(), execution=execution, invoice=invoice) + + +def all_tree_checks(plans): + records, shapes_total, cases, leaves, returns = [], 0, 0, 0, 0 + for n in range(1, 8): + digest = hashlib.sha256() + shapes = I.shapes(n) + shapes_total += len(shapes) + subtotal = 0 + for shape in shapes: + tree = I.label(shape) + for width in (1, 2, 5): + for sign in (1, -1): + word = list(P.instructions(tree, sign=sign)) + checked = I.basis_trace(tree, factors(n), width, sign, word) + digest.update(C["canonical"](checked)) + cases += 1 + subtotal += 1 + leaves += checked["leaves"] + returns += checked["recursive_returns"] + records.append(dict(n=n, shapes=len(shapes), cases=subtotal, receipt_sha256=digest.hexdigest())) + long_cases = [] + for n in range(8, 65): + matrices = factors(n) + width = D.bound(matrices, 7, 7)["width"] + for sign in (1, -1): + checked = I.basis_trace(plans[n - 1], matrices, width, sign, + list(P.instructions(plans[n - 1], sign=sign))) + long_cases.append(dict(n=n, width=width, sign=sign, **checked)) + cases += 1 + leaves += checked["leaves"] + returns += checked["recursive_returns"] + need(shapes_total == 861 and cases == 5280, "complete tree/sign/width coverage") + return dict(shapes=shapes_total, cases=cases, leaf_prefixes=leaves, + recursive_returns=returns, columns_per_case=10, small_trees=records, long_cases=long_cases) + + +def exhaustive_scalar(): + """Every raw data state and coefficient tuple for two small quotient rings.""" + rows = [] + for width, tree, n in ((2, (0, 1), 2), (1, (0, 1, 2), 3)): + modulus, count, commands = 1 << width, 0, 0 + digest = hashlib.sha256() + for coefficients in itertools.product(range(modulus), repeat=n): + matrices = [[[x]] for x in coefficients] + for sign in (1, -1): + word = list(P.instructions(tree, sign=sign)) + program = list(D.primitive_word(word, 1)) + for state in itertools.product(range(modulus), repeat=5): + initial = [[x] for x in state] + final, receipt = D.execute(program, matrices, initial, width) + same(final, I.endpoint(matrices, initial, sign, modulus), "exhaustive scalar endpoint") + need(receipt["leaves"] == len(word), "exhaustive complete word") + digest.update(C["canonical"]([coefficients, sign, state, final])) + count += 1 + commands += receipt["commands"] + need(count == modulus**(n + 5) * 2, "exhaustive state coverage") + rows.append(dict(width=width, factors=n, cases=count, commands=commands, sha256=digest.hexdigest())) + need(sum(row["cases"] for row in rows) == 33280, "complete small quotient census") + return rows + + +def additional_dense(): + """Vary dimensions, zero norms, signs and modulus widths, with exact lifting.""" + rng, cases, digest = random.Random(52), 0, hashlib.sha256() + for length in (1, 2, 3): + for n in (1, 2, 3, 5, 8, 13): + for trial in range(4): + matrices = [[[rng.randrange(-2, 3) for _ in range(length)] for _ in range(length)] for _ in range(n)] + if trial == 0: + matrices[n // 2] = [[0] * length for _ in range(length)] + tree = P.unit_plan(n)[1][-1] + info = D.bound(matrices, 7, 7) + w, modulus = info["width"], 1 << info["width"] + signed_entry = [[rng.randrange(-7, 8) for _ in range(length)] for _ in range(2)] + initial = [[x % modulus for x in row] for row in signed_entry] + initial += [[rng.randrange(modulus) for _ in range(length)] for _ in range(3)] + D.admit(matrices, initial, w, 7, 7) + for sign in (1, -1): + word = list(P.instructions(tree, sign=sign)) + final, receipt = D.execute(D.primitive_word(word, length), matrices, initial, w) + expected = I.endpoint(matrices, initial, sign, modulus) + same(final, expected, "dense modular endpoint") + signed_initial = [[D.signed(x, w) for x in row] for row in initial] + same([D.signed(x, w) for x in final[1]], I.endpoint(matrices, signed_initial, sign)[1], + "dense signed endpoint recovery") + invoice = D.invoice(word, length, n, w) + for key in ("counts", "commands", "intercell_steps", "head_bit_moves", "work_bits"): + same(receipt[key], invoice[key], "dense full invoice") + digest.update(C["canonical"]([n, length, trial, sign, info, final, receipt])) + cases += 1 + need(cases == 144, "dense fixture coverage") + return dict(cases=cases, sha256=digest.hexdigest()) + + +def controls(case, program, concrete_cases): + rejected = [] + + def reject(label, action, message): + try: + action() + except ValueError as exc: + need(message in str(exc), "wrong control rejection: " + label + ": " + str(exc)) + rejected.append(label) + else: + raise ValueError("negative control accepted: " + label) + + initial = concrete_cases["bounded_positive"]["initial"] + reject("undersized endpoint allowance", lambda: D.admit(case["factors"], + [[x % (1 << (case["width"] - 1)) for x in row] for row in initial], case["width"] - 1, 7, 7), + "signed recovery guard") + reject("signed guard equality", lambda: D.admit([[[1]]], [[0]] * 5, 2, 1, 1), "signed recovery guard") + need(D.bound([[[0]]], 2, 0)["width"] == 3, "zero factor still needs representable external input") + reject("zero product hides unrepresentable input", lambda: D.admit([[[0]]], [[0]] * 5, 1, 2, 0), + "signed recovery guard") + reject("unjustified input bound", lambda: D.admit([[[1]]], [[1], [0], [0], [0], [0]], 4, 0, 0), "input bound") + reject("noncanonical dirty input", lambda: D.admit([[[1]]], [[0], [0], [16], [0], [0]], 4, 0, 0), + "canonical data residues") + for value, label in ((0.5, "rounded fractional leaf"), (True, "boolean coefficient")): + reject(label, lambda x=value: D.bound([[[x]]], 1, 1), "integer matrix coefficients") + reject("aliased ports", lambda: list(D.primitive_word([(1, 1, 0, 1)], 1)), "leaf ports") + reject("global input used as target", lambda: list(D.primitive_word([(1, 0, 0, 1)], 1)), "leaf ports") + matrices, small_initial, w = [[[2]], [[3]]], [[1], [0], [7], [5], [3]], 7 + word = list(P.instructions((0, 1))) + + def boundary(changed): + final, _ = D.execute(D.primitive_word(changed, 1), matrices, small_initial, w) + same(final, I.endpoint(matrices, small_initial, 1, 1 << w), "dirty endpoint") + + reject("omitted helper restoration", lambda: boundary(word[:2] + word[3:]), "dirty endpoint") + wrong = list(word) + s, t, f, q = wrong[-1] + wrong[-1] = s, t, f, -q + reject("wrong inverse sign", lambda: boundary(wrong), "dirty endpoint") + final, _ = D.execute(D.primitive_word(word, 1), matrices, small_initial, w) + wrong_inverse = [(s, t, f, -q) for s, t, f, q in word] + bad_final, _ = D.execute(D.primitive_word(wrong_inverse, 1), matrices, final, w) + reject("negation without reversal", lambda: same(bad_final, small_initial, "inverse order"), "inverse order") + small_program = list(D.primitive_word([(0, 1, 0, 1)], 1)) + no_low = list(small_program) + no_low.remove(("low", "p")) + reject("unpaid product reduction", lambda: D.execute(no_low, [[[3]]], [[15], [0], [0], [0], [0]], 4), + "unsigned work overflow") + long_program = [x for x in D.primitive_word([(0, 1, 0, 1)], 3) if x != ("low", "a")] + reject("unpaid accumulator reductions", lambda: D.execute(long_program, [[[15] * 3 for _ in range(3)]], + [[1] * 3] + [[0] * 3 for _ in range(4)], 4), "unsigned work overflow") + no_clear = list(small_program) + last_c = max(i for i, x in enumerate(no_clear) if x == ("zero", "c")) + no_clear[last_c] = ("low", "c") + reject("uncleared private coefficient work", lambda: D.execute(no_clear, [[[3]]], [[1], [0], [0], [0], [0]], 4), + "private work not cleared") + invoice = copy.deepcopy(concrete_cases["bounded_positive"]["invoice"]) + invoice["counts"]["low"] -= 1 + reject("undercharged reductions", lambda: same(invoice["counts"], + concrete_cases["bounded_positive"]["execution"]["counts"], "reduction invoice"), "reduction invoice") + # The quotient ring endpoint is exact, yet decoding cannot identify an out-of-range integer. + wrapped, _ = D.execute(D.primitive_word([(0, 1, 0, 1)], 1), [[[3]]], [[3], [3], [0], [0], [0]], 4) + need(wrapped[1] == [12] and D.signed(12, 4) == -4, "out-of-range witness") + reject("modular success does not imply integer recovery", lambda: D.admit([[[3]]], + [[3], [3], [0], [0], [0]], 4, 3, 3), "signed recovery guard") + # Saturation is not reduction modulo 2^w; integer division by two does not descend to this quotient. + sat = lambda x: max(-8, min(7, x)) + x, y, z = 1, 0, 7 + z = sat(z + 2 * x) + y = sat(y + 2 * z) + z = sat(z - 2 * x) + y = sat(y - 2 * z) + need((y, z) == (-3, 5), "saturation witness") + reject("saturation loses restoration", lambda: same([y, z], [4, 7], "saturation endpoint"), "saturation endpoint") + need(1 % 4 == 5 % 4 and (1 // 2) % 4 != (5 // 2) % 4, "division does not descend") + rounded_delta = (1 + 1) // 2 - 1 // 2 + need(rounded_delta == 1 and 1 // 2 == 0, "dirty-dependent rounded echo") + stress = concrete_cases["dirty_bits_positive"] + need(stress["observed_integer_prefix_bits"] > case["width"], "actual overflow stress required") + reject("unreduced integer lift in endpoint-sized registers", lambda: need( + int(stress["observed_integer_prefix_peak"]) < 1 << (case["width"] - 1), "integer prefix overflow"), + "integer prefix overflow") + return dict(rejected=rejected, out_of_range=dict(true_integer=12, residue=12, decoded=-4, width=4), + saturation=dict(target=y, helper=z, wanted_target=4, wanted_helper=7), + half_division=dict(congruent_lifts=[1, 5], modulus=4, outputs=[0, 2], + rounded_echo_increment=1, wanted_increment=0)) + + +def historical_comparison(case): + n, length, width = case["n"], case["length"], case["width"] + h = P.norm_bound(case["tree"], 2) + rows = {} + for name, dirty_bound in (("all_entry_cells_bounded_7", 7), + ("arbitrary_signed_width_bit_dirt", 1 << (width - 1))): + p = max(2, dirty_bound * h).bit_length() + 1 + rows[name] = dict(entry_bound=dirty_bound, inherited_sufficient_width=p, + data_bits=5 * length * p, coefficient_bits=n * length * length * p, + scalar_work_bits=4 * p, + commands=len(case["word"]) * (4 * length * length + 4 * length + 4) + 4) + need(rows["all_entry_cells_bounded_7"]["inherited_sufficient_width"] == 114 + and rows["arbitrary_signed_width_bit_dirt"]["inherited_sufficient_width"] == 167, + "credited sufficient-width comparison") + return dict(norm_majorant=str(h), comparison=rows, minimality_claim=False) + + +def admit_certificate(case, program): + """Fast envelope/invoice checks before the complete mathematical replay.""" + receipt = C["load"](HERE / "CERTIFICATE.json") + same(receipt["sources"], C["pins"](), "certificate source binding") + same(receipt["case_sha256"], C["digest"](case), "case digest") + same(receipt["program_sha256"], C["digest"](program), "program digest") + same(receipt["endpoint_bound"], D.bound(case["factors"], 7, 7), "endpoint allowance") + same(receipt["historical"], historical_comparison(case), "historical sufficient widths") + for name, row in receipt["concrete"].items(): + sign = -1 if name.endswith("negative") else 1 + same(row["sign"], sign, "concrete sign") + invoice = D.invoice(list(P.instructions(case["tree"], sign=sign)), 2, 52, case["width"]) + same(row["invoice"], invoice, "complete invoice") + for key in ("counts", "commands", "leaves", "intercell_steps", "accesses", "head_bit_moves", + "data_bit_actions", "work_bits"): + same(row["execution"][key], invoice[key], "literal receipt invoice") + same(sorted(receipt["concrete"]), ["bounded_negative", "bounded_positive", + "dirty_bits_negative", "dirty_bits_positive"], "concrete inventory") + same({k: receipt["all_trees"][k] for k in ("shapes", "cases", "columns_per_case")}, + dict(shapes=861, cases=5280, columns_per_case=10), "matrix coverage declaration") + need(receipt["no_new_kappa"] is True, "scope declaration") + return receipt + + +def run(write_artifacts=False): + manifest = C["pins"]() + if write_artifacts: + case, program, plans = main_artifacts() + else: + case, program, plans = admit_artifacts() + admit_certificate(case, program) + print("52-factor literal backend: every prefix, signed recovery, inverse and full invoice", flush=True) + concrete_cases = {name: concrete(case, program, dirty, sign) for name, dirty, sign in ( + ("bounded_positive", False, 1), ("bounded_negative", False, -1), + ("dirty_bits_positive", True, 1), ("dirty_bits_negative", True, -1))} + need(case["width"] == 56 and len(case["word"]) == 1376, "primary fixture") + print("861 trees and all parent plans through64: quotient maps and every recursive return", flush=True) + trees = all_tree_checks(plans) + print("exhaust every scalar state and coefficient tuple in the declared two quotient rings", flush=True) + scalar = exhaustive_scalar() + additional = additional_dense() + negatives = controls(case, program, concrete_cases) + # Credited predecessor's 56-factor fixture, with its exact same leaf count. + old_tree = plans[55] + predecessor = dict(n=56, leaf_calls=len(list(P.instructions(old_tree))), + inherited_width=(7 * P.norm_bound(old_tree, 2)).bit_length() + 1, + modular_width=D.bound(factors(56), 7, 7)["width"]) + same(predecessor, dict(n=56, leaf_calls=1568, inherited_width=119, modular_width=60), + "credited 56-factor comparison") + receipt = dict(status="PASS_MODULAR_PORT_BORROWING", sources=manifest, + case_sha256=C["digest"](case), program_sha256=C["digest"](program), + endpoint_bound=D.bound(case["factors"], 7, 7), concrete=concrete_cases, + all_trees=trees, scalar_exhaustion=scalar, additional_dense=additional, + controls=negatives, historical=historical_comparison(case), + predecessor56=predecessor, no_new_kappa=True) + if write_artifacts: + C["write"](HERE / "CASE.json.gz", case) + C["write"](HERE / "PROGRAM.json.gz", program) + C["write"](HERE / "CERTIFICATE.json", receipt) + else: + same(receipt, C["load"](HERE / "CERTIFICATE.json"), "complete deterministic certificate") + return receipt + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--write-artifacts", action="store_true", help="initial production; refuses existing artifacts") + parser.add_argument("--receipt", type=Path) + args = parser.parse_args() + receipt = run(args.write_artifacts) + if args.receipt: + C["write"](args.receipt, receipt) + print("PASS_MODULAR_PORT_BORROWING: 52 factors; 1376 calls; 56-bit data; " + "5280 matrix cases; 33280 scalar states; 144 dense cases; paid reductions; no new kappa") + + +if __name__ == "__main__": + main()