diff --git a/research/selected-compiler-source-bridge/AUTHENTICATION.json b/research/selected-compiler-source-bridge/AUTHENTICATION.json new file mode 100644 index 0000000000..ddeaf10f35 --- /dev/null +++ b/research/selected-compiler-source-bridge/AUTHENTICATION.json @@ -0,0 +1,838 @@ +{ + "declared_main": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "declared_published_head": "eb89e7a7884ccacb82b5d5120d7f83be269748c0", + "package_sha256": { + "research/selected-compiler-visitation-audit/accounting.py": "109a452dd0d9339b4ef7349afee5c00de7c1b86c0d63aa50e085513a41a7451c", + "research/selected-compiler-visitation-audit/EXPECTED.json": "68d9a80dd341f03b4d9d3c674aa9444ba87a81afd68bd66dd88525002fe401a5", + "research/selected-compiler-visitation-audit/export.py": "a26d5edcaf66d46fce43aca81f0080373b4106ca8b4336872216e54a5b24bbce", + "research/selected-compiler-visitation-audit/PROOF.md": "f1cbb9df9f21887d7346b0efb6ae74ebb6fc6e31f3bcadbc26ed5249bd0eed52", + "research/selected-compiler-visitation-audit/README.md": "a205a33577bc60628f82606c47d3ee471e6e107db552e45e5c4e9466b4863f31", + "research/selected-compiler-visitation-audit/SOURCES.json": "3ff6ae8c4a46592015a22fd9deea8dae4e98763e25e0487468fdaf4471283031", + "research/selected-compiler-visitation-audit/source_audit.py": "eae67c8818d18fca26ee6e101e03f5c4fac1ef7c035b3d2c7e9707574cc2b959", + "research/selected-compiler-visitation-audit/TASK.json": "4affad2ebc2f931ce49a6e4c1c21cda75ca4705abdd3e25d7aef088f7a6927c6", + "research/selected-compiler-visitation-audit/test_accounting.py": "7682d2e30a4f2d5f313e902f26d7c310643677693dec8a7749bb301f8b50674f", + "research/selected-compiler-visitation-audit/VALIDATION.md": "502fa36ff882449ebb5b547264e07d94c583a39eca58057f5c8c1b0f9e708af8", + "research/selected-compiler-visitation-audit/VERIFY.json": "f3a16adc4d4adaad7f5e0aecf067742e22e752b70e64d9b8c732bb83cbbafac0", + "research/selected-compiler-visitation-audit/verify.py": "e26b73a6b11b5479f0838e6775f6684c6f6649d8b8b105427c92d2319aece7bc", + "research/selected-compiler-visitation-audit/lean/.gitignore": "36a4c113772dc3e38226e24bdde29021b56a76a34b8f2a0e367928dea8070a8b", + "research/selected-compiler-visitation-audit/lean/CERTIFICATE-CONTRACT.md": "96954bede4623d75b623f2fe370e6f333f54363b770d0c096ae52f3fdda8d930", + "research/selected-compiler-visitation-audit/lean/check.py": "7f93b2c00db7c65b39359f2361b77c3903bb297817b6b25b6d8b6234d0b56e45", + "research/selected-compiler-visitation-audit/lean/CompilerAudit.lean": "3883991717fcfff245e90355439acb8884b3f58a943fc0fd473a037cee213dde", + "research/selected-compiler-visitation-audit/lean/extract_census.py": "c4a357cce70481a76dac88bd137ebe7270415c0c2bfe9cb989da10658821902f", + "research/selected-compiler-visitation-audit/lean/lake-manifest.json": "f0e42d04edd670ffa604a770562c9dc400e21809bb5809a69c2c1cb342fe1579", + "research/selected-compiler-visitation-audit/lean/lakefile.toml": "efacc633cf25b8f18df232bc2094a9a76813ad7676a9bf88e2df836891f9995c", + "research/selected-compiler-visitation-audit/lean/lean-toolchain": "d5edba4e4b8faad9c1baeadb265716d20d03be4d1a2647dc5e35b0c0325bea7b", + "research/selected-compiler-visitation-audit/lean/README.md": "44f8b77c9c28f3c3d4d819eae309915874c9d0834b2f37442eecc9335b7a49e1", + "research/selected-compiler-visitation-audit/lean/SelectedCensus.json": "07844fafe457b69c1b63c61680d130ea3c9166bafa32f313077e4bd734782887", + "research/selected-compiler-visitation-audit/lean/CompilerAudit/Composition.lean": "022caba159e2034d9f09c92145a47caa849c46edeead5766d58a066abf47621f", + "research/selected-compiler-visitation-audit/lean/CompilerAudit/Result.lean": "e9499bac894329f28e9fc491ac00fd640f8e25fdf7f80ad5883954ff2bcc15d5", + "research/selected-compiler-visitation-audit/lean/CompilerAudit/Retention.lean": "081a35b411fe31442f727f38ab3dfdda103bd25e0c5950cf2b1733b5f426bbca", + "research/selected-compiler-visitation-audit/lean/CompilerAudit/Selected.lean": "3b77f822e939d2d2cd3b38d92a7b73836a764eaa939aa840711bbbab7f2037e0", + "research/selected-compiler-visitation-audit/lean/CompilerAudit/SelectedData.lean": "7c767cf2d63aab6d46c6a2075c283eeb816781158fce90cfd13eedd1000eda88", + "research/selected-compiler-visitation-audit/lean/CompilerAudit/Visit.lean": "9746c2e876bcee27770fd215129cd72fc52003736cf5c088913c99d2ea1bc4d1" + }, + "live_inputs": [ + { + "path": "LICENSE", + "usage": "input", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "path": "NOTICE", + "usage": "input", + "git_blob": "59d8e0cf3102e15bd11db430838365531e2d7f18", + "sha256": "b49022cb4104d90b182e4c335f670faf45529025b15db77bf0291835083c28bd" + }, + { + "path": "certificates/selected-result.json", + "usage": "input", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "research/community-hyperplane599-audit/pr589/bit589/v9/hosted/GLOBAL-TEMPLATE.json.gz", + "usage": "input", + "git_blob": "9eafb8776cbf78c72124f833534469ddfa5e98ec", + "sha256": "0357b7cfbd7c29b4983982baf153c8a9f1e1e412690cd7fa9fc3d23d7963b20f" + }, + { + "path": "research/community-hyperplane599-audit/pr589/bit589/v9/nine/GEOMETRY.json", + "usage": "input", + "git_blob": "44006542202ca6037533a754f0bcd00549d7e088", + "sha256": "0058c491d839142aa99ef86a5ec697ce99857632228531512ea3fa74fb24d734" + }, + { + "path": "research/e8-bit-p111-tuned/tune/EXPECTED.json", + "usage": "input", + "git_blob": "e293ddc557742637f9f679f083a1a282d87b1b13", + "sha256": "b9f0e5ca038abe837b0007c8fe006f366a6f02009244ac57705a8a200e2301f4" + }, + { + "path": "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz", + "usage": "input", + "git_blob": "85a4499bf9e4911a705d50567a2c2ef6cf23739a", + "sha256": "e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f" + }, + { + "path": "research/pr589-five-helper-hosting/PROOF.md", + "usage": "input", + "git_blob": "bbd3f12b9a32b3ad3cba85a2d5a1b3054214fa02", + "sha256": "59cae781bfbe1a01ed9e66a8efeeb5a2b995e5ecdf908586b23ecc39f2b8d647" + }, + { + "path": "research/pr589-five-helper-hosting/verify.py", + "usage": "input", + "git_blob": "dbc71f56bb4205ebe378ada1f9f4ea88630d1d39", + "sha256": "cf90e19ae9991b0698be03d395a8cc29061ecb307eb7fea19adfb2d23c25a367" + }, + { + "path": "research/recursive-parking-boundary/README.md", + "usage": "input", + "git_blob": "251f335ebaccc11d69393ee7aeb5a2e84526d0bb", + "sha256": "491aa208391ee4c2936510b1a5c5c018dd5509d9a0e88687c72ab8406cd77b18" + }, + { + "path": "research/selected-bit-local-ring-sweeps/PROOF.md", + "usage": "input", + "git_blob": "4330de85dd9862ed15d84ab917887d249753df99", + "sha256": "846c59440cc99e28bae93ad2af99525bc769de29368080071b8427141215b4f7" + }, + { + "path": "research/selected-bit-physical-caller/PROOF.md", + "usage": "input", + "git_blob": "548ecff3ef79a32c14bafc7f2309781181d3c23d", + "sha256": "e5a827e93fe313ba9bf4a2e300bae01b58b28004aa8a8ee119cf6d950edd9f93" + }, + { + "path": "research/selected-bit-physical-caller/README.md", + "usage": "input", + "git_blob": "abd0edba96101a025609d2840c3dbdf4d3e30aa8", + "sha256": "989ad891ce3f866c920a25e0cdd661815f982c4c854370f8c00668eaa15d770c" + }, + { + "path": "research/selected-bit-physical-caller/SNAPSHOTS.json", + "usage": "input", + "git_blob": "034836cfaa3e4f984e900a980eecc986ec405b1d", + "sha256": "c7b3485bdae5ddf43166cd6626bd512816e179617a4234c36584f6c57c34744a" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/EVIDENCE.json", + "usage": "input", + "git_blob": "c2c347abc2b8c19bb642c4da1aad5b3e8383016f", + "sha256": "77b7cbefa2ca30acf2f77e23d14808ccd27848e9c76e4c5e68a045ef7891a07f" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/PREDECESSOR.json", + "usage": "input", + "git_blob": "56d76c357b51f4fc6856923222bfca47f03334e7", + "sha256": "e3127475913d62dbdf1b45d9283d2db2e9b689e0f81a703189150c1e5be2bca0" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/PROOF.md", + "usage": "input", + "git_blob": "1a08e57eac2a37764066d31baa3ecd3769759158", + "sha256": "552fa306d5cc228f4d8d8553f8ac5fc6a738ef2b66a2cb765ba0638cd229794d" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/README.md", + "usage": "input", + "git_blob": "75461632856f94d6b48ae820cf5d0b2b232305c2", + "sha256": "6ce41fd7e6dfbe5faecc25bd36561f0a65b6ebca6fc69d3fb72569424a405045" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/RESULT.json", + "usage": "input", + "git_blob": "75faec7844e18fc7c44543dbab87aba2ecf32b3e", + "sha256": "4919655bae2e5cff051e8f2d240a8e4ebb03392a9da2fb5328daa9248fb7e88b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/SOURCES.json", + "usage": "input", + "git_blob": "ff8c8e36176aa56e319d0f9e584167ac21d67f33", + "sha256": "7c78f539078e1bc3d893b78b5ee24cb22dc090d3763fe554e861b6c3d3e7eaf7" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/TASK.json", + "usage": "input", + "git_blob": "d70ad317275d2a517ab1294ce48ecb1f83dfedbf", + "sha256": "ac7d4b38da31b373e665929027fc04afb66c3e9aedaea3296e3783637912d0e8" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/VALIDATION.md", + "usage": "input", + "git_blob": "d91680665a28c12c27c99336b55c3d5341dd0fe4", + "sha256": "ac0f2fab0ca810ce0202d31480daa8329cba0897ab015520a2bfd4b689c4086b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/VERIFY.json", + "usage": "input", + "git_blob": "b6072f66c13a38b5d8dff3ca3bc5f3f3562f1b6e", + "sha256": "6ad0e07f68458afedece927550655b5bc5cd9861a70044fcd95bb10a2179f0a6" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/bootstrap.py", + "usage": "input", + "git_blob": "448c9b3a86eedb84220646ab27ff089a32ad5b9b", + "sha256": "eef1c418e8edbdf317d159683e30beaecd971c77cf41d6b09708576405e2141e" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/check_layout.py", + "usage": "input", + "git_blob": "be59d614d25961f891e1640bf85cf5e2f474a059", + "sha256": "454b1587d1ed5ccaea19b621a67e2ceba999d7ede61188125faa41c4dd2ab2b1" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/check_nested_model.py", + "usage": "input", + "git_blob": "20fed6bd389cb53fc52d0ad8389e9e7704c90265", + "sha256": "b1941b882b0659722c3c41994c82f020c1f7ab320dc28c43c2758029ef8a48b7" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/check_recursion.py", + "usage": "input", + "git_blob": "8f36c88e196cf5afc0d6e227ba8568a10bb23c6a", + "sha256": "dde82badf043e553bc635a34295e2b5505d84d6dfbaf96e0cfccb8a8c3dbb158" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/check_runtime.py", + "usage": "input", + "git_blob": "fe355a703475325bca4807b8ffedfa9f6edb74f5", + "sha256": "9fcf0c9a3c84a17446fafe8da50b63db296ba9465d48ddb6fdeac8742dfc98b1" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/check_sign.py", + "usage": "input", + "git_blob": "50669949a1325e8c49aa0ff714c40a50077b5eb8", + "sha256": "ee4fd34acd49962a18d268aefeb20aa3c2673a10e7a43eee3e51a9bd3cf9106a" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/check_sources.py", + "usage": "input", + "git_blob": "5c09a13943070a3bb3c0da06fd19fbc6916d1743", + "sha256": "1c49984ae6ee7f8a44cde16b51e486f0b3ba4ee5c973389ac8d58a82d0a0aa3b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/consumer.py", + "usage": "input", + "git_blob": "a66d9276f829ce2c619871866816649d5f3687fd", + "sha256": "2f2a8604c23fb2c81f24320c71ed0142118d98dde3be6086adad28e89954a777" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/control_checks.py", + "usage": "input", + "git_blob": "11daa0b2221c5870d19ba2eaf411a6bff3a0398d", + "sha256": "c09d33327932b4ffbb8acb26c8a6bb621bcca542157d22f1edf72679a9359981" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/driver.py", + "usage": "input", + "git_blob": "5b7846a70aada53d87480b337e1c04217118771b", + "sha256": "ceaf8f75de9810a05ebf8f65780b6f8bd7599a5768401d5e4386182afe615cdf" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/evidence/NOTICE.md", + "usage": "input", + "git_blob": "d0318d43ed420e21dc52166a19de703aa87fbb3e", + "sha256": "fd7c42e89878cda6df86dde8720ece34625a337cf5edd795a421e2d3b42919e9" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/evidence/pr2688-NOTICE.md", + "usage": "input", + "git_blob": "f2b49cdef83a4a685fad32c01fba93e12cfcb5a8", + "sha256": "c899fccf7bd32397f0ddd85e4af35a166cefb3e3ae3407ec40edc3ab2051b617" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/evidence/pr2688-PROOF.md", + "usage": "input", + "git_blob": "1395e1941863e40ff6d62dd91c41de2cb56edae9", + "sha256": "fa9bec0952468e4acb760a88d45d5be216325650e1a4080cf590e07b90c9f533" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/evidence/pr2708-README.md", + "usage": "input", + "git_blob": "79b8742f32b4ffb991f91ddd2d3c6be693084e6d", + "sha256": "5906f6b7b2c8eea90e441476c4cbd60fe2ef981b690c63357bcfe67e3104aeef" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/evidence/pr2731-README.md", + "usage": "input", + "git_blob": "ac5b826f9c34e1faadc5d5a02d5d260823112078", + "sha256": "19683df4394de299cbd7e1cce39bf9434ad260b1a37006587cf9aed84c9c0a03" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/layout.py", + "usage": "input", + "git_blob": "aa554b14fe0f6b308d9fba0a2afc92e5a28e20cb", + "sha256": "3beef6534b02c3b011b741f957a7d9fb05a9ac0bba1fed53b2c71834e4ea6bc1" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/linear_sign.py", + "usage": "input", + "git_blob": "6a6e5c02f299fad8c4f7ab724fc36e14a22ab13c", + "sha256": "73e895fc701a4145cbe89d60f5775128354e7f08d0a45eacf22f423913f54e67" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/node.py", + "usage": "input", + "git_blob": "28c98a3573b458f7a055678d70b602b80e6e959e", + "sha256": "0bd4f640cafb5c8f070c161d86445910f77578a672bf5886936ed89e7f6bd21b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/packet_engine.py", + "usage": "input", + "git_blob": "72543f684f38fefeacc2ee66d81661f1a2439cf7", + "sha256": "c80fc3aa9092f91cc309b2fb2dbc3618bf96bdb9b8498503993ea161f0ae2134" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/peel.py", + "usage": "input", + "git_blob": "38502515afc928082c849cd2cda8578d33a5050a", + "sha256": "8b20888f74b4cd814a97b42ec72528fbfb6d2e936c5022df726f0785d0d01a2e" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/NOTICE.md", + "usage": "input", + "git_blob": "ef9f81510db86eaf2f0a7191d85e92a6db30ddc0", + "sha256": "c446b32b8a621844fb2fbe654810c8122035bdd43fed2132f1137d98cb6f9943" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/PROOF.md", + "usage": "input", + "git_blob": "a4746d1786f41e45a36fdedf37966b80fbab3562", + "sha256": "88754d57bae35a2089d9de221ff32ba802b7a56b810f96271f3ea36985edfb14" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/README.md", + "usage": "input", + "git_blob": "988ff622029aff49d7e99deb2468684d904bc852", + "sha256": "15631eb826b2d8d54fbee18fb6f70ee035e172d524c2a209b6c467c3f0204f64" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/RESULT.json", + "usage": "input", + "git_blob": "7b7dfe0eab22a7b511483f268b97a7c707fd8b90", + "sha256": "0d94c5e9150f3fbd603526c67ea33168d3ba45e158aaf722e848bf5c316a37a8" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/SOURCES.json", + "usage": "input", + "git_blob": "4fef1a4d6c2d5e2620d3506d6032f9226870ed39", + "sha256": "1b02a5c607a5967948988c3beaf37d9975d650ad501a99fcf74c135dc1f05fdd" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/TASK.json", + "usage": "input", + "git_blob": "eb2ce7cc00df816daf566f101d56a0330852c1d9", + "sha256": "a4cd54d4b09ad12a90a5feeb39a127f0f0d5a2a04f9f88554c5fc3ee0cfe77f4" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/VERIFY.json", + "usage": "input", + "git_blob": "69c7ad75abe494be386f73a5d51359b9053cd9be", + "sha256": "e1dd0ee5f267ffa515bb345054ff8637cfedb0079b0d2da29b90b7848264926e" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/cardinal_counts.py", + "usage": "input", + "git_blob": "6a14feac45094ae9156e8c2c982d6727544f180e", + "sha256": "59ddeac102a0cc51fa49b15aae6aeb68cd68ed217fa974ce916372a177d2ec8f" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/catalogue.py", + "usage": "input", + "git_blob": "0efc0575a7623ac41c094d2e8772beda5a9fdc29", + "sha256": "83ea88f82d4a83c5f889774bfe3519b7ebaa24b6a0e2a969dafff012107a89bf" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/check_headers.py", + "usage": "input", + "git_blob": "1c372b19e19b838a89c0e64daeda15ec6b49f079", + "sha256": "a41dab0c487c341eb32b34a03af74454e15e9e61e7386a1ca426d83f3b68b1ca" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/check_layout.py", + "usage": "input", + "git_blob": "174d843716a684145f934cb55a612bca85aad725", + "sha256": "8f776a21dc0e31f9738d822cfda38db92f1e3672afb880d4246ec5e084a50a41" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/check_runtime.py", + "usage": "input", + "git_blob": "5647693b3a5c1555b65e281c6609f98b92d45542", + "sha256": "5357e4ff255f17c4209aaf71a3413a4148475f11180c4f829e8f0ebacd2877cb" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/check_sources.py", + "usage": "input", + "git_blob": "9219cdf863d9f060d6e38a4f2f4760fd227af003", + "sha256": "6463c2724e04a313181b78e90a17cd62ee42465754902cca3e9a65c6140a15a1" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/consumer.py", + "usage": "input", + "git_blob": "24b53521fce94d3349072cf47d70e62195f4d541", + "sha256": "b28ec97b0873ff2be25aff4bdde268247ffcec0d21279d0ada196de19a0bdc66" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/control.py", + "usage": "input", + "git_blob": "4f6ac09bffab43dbccc470bd0bde2ffbe969a8b2", + "sha256": "d3a93e54bb7d333b73917586407d11674d38b5c3fda4fbdc436fb5293ae7786a" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/control_checks.py", + "usage": "input", + "git_blob": "712cfddc4caaad9e788d97b0e1e3f623172c43ed", + "sha256": "5ea6ded8c2508fbb00d93655affdfe7907ffb60916389e0736249c003a7a5148" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/driver.py", + "usage": "input", + "git_blob": "0bdee4c9e348259b470a636a98e7657770f97fae", + "sha256": "ee9e42fe95ab28fdd5e927c2d46fd480305aaad610eb2ca7ae514a5d22d9f0ac" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/fresh_rows.py", + "usage": "input", + "git_blob": "aa3a327604308d3a5c7a27b65f5e631d430ab093", + "sha256": "e4ae08fbd658add630eb7754ebe0cbcb42c6f39cf4128f9cb92e27fcf5213a7d" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/layout.py", + "usage": "input", + "git_blob": "267d5ab98cd013ee82ba75e6d41609f1778af25f", + "sha256": "7534b0166805f2ae8d11495c811d2bd272cea89c89b6bb5251fd411c89245a20" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/model.py", + "usage": "input", + "git_blob": "9fb82fa57d29cdf8402f91534dffed8f586ced6c", + "sha256": "c937ae8e46162f88fc1cd7646d3b22c99273029ad0f0e3131f46ddec230676cb" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/node.py", + "usage": "input", + "git_blob": "13badda6f059da2132cbe325c071307e5191baa3", + "sha256": "b88fc9ac0b22d939311ff4f7aff788e8c87a64fd5e866498e59bd27940ee3f28" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/packet_engine.py", + "usage": "input", + "git_blob": "27a0dbf82e78252beede56ff86f5933c93eb55c1", + "sha256": "ce7f132a6a69c802406f07c4a2119ef921e8978520ff58d5eeaeedb982c257f2" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/peel.py", + "usage": "input", + "git_blob": "2ae1769a9726ab738d3981891d0b76beccac2d99", + "sha256": "3de018e68601566c364c7568b110f60c1bf34941b846cdffb94401bb799f85e3" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/topology.py", + "usage": "input", + "git_blob": "39a2916c207d04be5efc44750d8606f5da0c2990", + "sha256": "384d456ddba76de137a63b50019d5bba2e9f6daa4177c91643e0565d4cf1d44b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/binding.py", + "usage": "input", + "git_blob": "21a5a21220a18ab62a19ac403a9944bc3a8665c8", + "sha256": "20169a8af6ed2b34069fd353a2bc1c42335ab686c58de8479baef33dd3fb493b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/bitstream.py", + "usage": "input", + "git_blob": "4d1fd4abb0f2aabe833e5cbc9efb51039739e7ca", + "sha256": "f78bac9641007dbd8824984edcac057274fe016ce78bd9cb512d0c0913274783" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/cardinality.py", + "usage": "input", + "git_blob": "b8ba857e32c5903408e1e61ff916300848b4a208", + "sha256": "505d5e560c5a507e6184edcc19a87cf1fed243eb34a5cb21fbe1e4fe017e7f22" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/check_support.py", + "usage": "input", + "git_blob": "e1f961df9fa3a441fc5b600d1288a8d038eca51e", + "sha256": "d9977e87ddc5acdb836b8e4a4e3942da17a05b04ce67c04547d17b986b518964" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/children.py", + "usage": "input", + "git_blob": "ce4935f838516e2b08d13bec767cb803786fbc6b", + "sha256": "a78866939631214c1d1659203b2b5fc062e3c6255e9f11f975c310046b010bd6" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/controller.py", + "usage": "input", + "git_blob": "c631a9e77fbcccf0e8f448adc22978728aed7b60", + "sha256": "fa09146991f6c04e6f4b6eb9bf0c8e103e70e90a0e402ff3d69814e6aac8ff8c" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/counts.py", + "usage": "input", + "git_blob": "81b48940ce222290a40d4fb349ce827f4788469d", + "sha256": "00b476dbda0e8cc99886bf794439e1cb9e775f435f599a3557e99321fe084069" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/directory.py", + "usage": "input", + "git_blob": "c74cacf5ce809c0561d374f137a52df0992b4226", + "sha256": "4270e370b2bfe38ef73aadcd97d1b3496b56bd582115d74331eb9e5ceb90bec7" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/episode.py", + "usage": "input", + "git_blob": "30d11ff4f333813855d36da3eb5a1ab0e154bafe", + "sha256": "38f79cb2a370548471063952d5f7c74bd795a2a8496fdcf3ce0996d79e3adaff" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/forms.py", + "usage": "input", + "git_blob": "6667c0b772a63f0059c7caffec63e0d919a92398", + "sha256": "1fdf9d31b7eb107c396e33f94dad61c9d3f2c709cae61178268a44ca80dbc0b4" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/low_codes.py", + "usage": "input", + "git_blob": "737edfc4a10f4b7b3b97a7cef4b40864efd806e6", + "sha256": "f657e17f6088c840e3f7783e662257630f6d2c1e71c217721ffbca4d6ac93e87" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/matrices.py", + "usage": "input", + "git_blob": "5d497353efbb9eeaaf4facd96ab40ffb0f3aa20d", + "sha256": "00b687434039b54529ee092e34f9435cfcd66e0816eb3bd2a6688c73f4e01459" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/numeric.py", + "usage": "input", + "git_blob": "6d4ebca8398008375b8f4762d1a9f1514e8c2611", + "sha256": "7327b05c4ec3e0f6d9c352cc7de85bfd4ebe940482553e77c59a773a8c09c514" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/oracle.py", + "usage": "input", + "git_blob": "244f131466698a3ace10b657242fe1f65c07fd1f", + "sha256": "7bd18089e32ce48085b5e3a75159f6a82cdb2649ec682c53db05e399d97aef67" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/packet.py", + "usage": "input", + "git_blob": "ebc9b616514412b80c56d523776e6ba5d6766453", + "sha256": "970e7fe0719e3dfe122b248941e6f21cd90d7dd62089fa6acbd0e5412ce083a5" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/plan.py", + "usage": "input", + "git_blob": "48255d5454308c07635fae4e7eb4873b0bd2a4f8", + "sha256": "d9c8dc93762db4d3a449814aa51e2211460648694469854d89cb48cb04188cf3" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/records.py", + "usage": "input", + "git_blob": "4f00467a0ff580954ad2fd0c7380240c753ddef3", + "sha256": "0c9c4b23e998597fb877bb1a29da69ac869b68262abe635b162b4dba9c69b372" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/residual.py", + "usage": "input", + "git_blob": "3d070d2539a529f3b14ecb086a92a3db056229fe", + "sha256": "8fd24747cae498dfb2ba333e7f8a68d7315ae4c2d7530d8ca145aab95ede21df" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/routes.py", + "usage": "input", + "git_blob": "35531201dc349a811dfabc6f1f6e64697d665194", + "sha256": "ed7dc3679451696ab1dd841146b215c9515a3eec5e4ff3763f33c315f1696ada" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/selection.py", + "usage": "input", + "git_blob": "2c28f1aaec104a75c4e6c170b3e6a60300ee6700", + "sha256": "bc8e371fb1fa0b41fb05ef0b34d0f4c317b2396f9833d91f44f95c2b54b4052b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/sources.py", + "usage": "input", + "git_blob": "16d5e7e6a28018f1e2d76d61efe2d54f6a6941d4", + "sha256": "f102edc7816d742bd89db8097254c19b843d0ef5cf6758ad42e93bcc0b214c62" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/stream.py", + "usage": "input", + "git_blob": "5e5a4bb0f98971447043e25d4dd6991bfc070389", + "sha256": "c7dc7da5b00f27016982ada4c0416f8328568b00df16d97012f33d4b372d79b5" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/stream_runner.py", + "usage": "input", + "git_blob": "efff281d4c4be5c1378e31404fbcc634fe4ade59", + "sha256": "751c5023ca0e477369e448583961ace6a76db2723bb6c26f81203def539f1249" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/trace.py", + "usage": "input", + "git_blob": "bb845a90f5bcf006e683e581e385936208f6a1f4", + "sha256": "c71ba11d793dde2ac6e4cdcf468482872975c34589bf1167f2a460cb8a74e984" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/words.py", + "usage": "input", + "git_blob": "8d4ba37e2778acb35b34e0719df2caf138fbeb50", + "sha256": "5c37f57708ba3131bdcb03139f9dbc29886bee44569c09cbba51b68f75acd7f9" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/verify.py", + "usage": "input", + "git_blob": "121acc1ff15ec85a8011e96eda2eb587608413b9", + "sha256": "cd83797d1f420f7e5de61c1a693110b4ee0c80bac0adae4699599046b7f76f8a" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/recursive_call.py", + "usage": "input", + "git_blob": "6d33224145aa04f7fbaf7b6cda7c9c164311a402", + "sha256": "157deaa5972557893d43494a81151483bdc46373448ec677cb6a738c9b7e6f1e" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/scheduler.py", + "usage": "input", + "git_blob": "60c2b6d065eba91dd5e0edb7a77fc087971eca3f", + "sha256": "0d96f7fbd6f90416167c5a52c0e3de942d1a0cae3d2968831932a9576701699f" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/stream_runner.py", + "usage": "input", + "git_blob": "6ba5df130bb4a0fcb06b6c630830ae3a6922921b", + "sha256": "b255feaf6cc6e40413ae73fe302bf8f290bf4dd89f4128b23a91cc9860601801" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/trace.py", + "usage": "input", + "git_blob": "4b002201ce54cdecec9acf4e874b7f71cd75fe71", + "sha256": "3a664224c558244f606b603cad816d75e94a17c9b2620a06a1530e893dfceac2" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/verify.py", + "usage": "input", + "git_blob": "96be8f5859a3f3799344d46dec1ee68170d96bfa", + "sha256": "65126e788eeea10e830fc583cf4afe0bfc4d67495cbf8ac21de3507dbe624d56" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/NOTICE.md", + "usage": "input", + "git_blob": "307c2da733f7f3a76e97c77e71072e811f40df02", + "sha256": "8640d1b52fd21e5b20e8109ce9c4957ca1e19a95e26a1c80d019a6e6f4d5f178" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/PROOF.md", + "usage": "input", + "git_blob": "7207ce7dec86694f01a3d9c049dcb87cc909e380", + "sha256": "fc9e7dcc5b385b6e508d6a6e9524b93059fa3e9fd5fcfb5eedbd85b3a54ba55e" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/README.md", + "usage": "input", + "git_blob": "c96e0d6cec56a9a5579ae159456fc15767315bc3", + "sha256": "6550a466bfafff2ca11740e931ed9fce062eb488f23e74edff7e4bbae8282bb1" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/RESULT.json", + "usage": "input", + "git_blob": "b2d1889d77019e06ac0326ac91b1322340cf3866", + "sha256": "4406fec9515bb4206c75b681f046b5441319cf1ed39a13b9b0134696b1c192a7" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/SOURCES.json", + "usage": "input", + "git_blob": "746393061c55f47412601e3d346e914762683e0c", + "sha256": "a6476b786632c2cbffabbe27eece790e378996c8b03eb17a01f1094f20fc4cdf" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/TASK.json", + "usage": "input", + "git_blob": "216dc8f8bcb33fe32d0eaccdadb0fe0383d73848", + "sha256": "964d3a4fbfb53fd58936840328ac4b770b324c9e78f722861b1db04663110626" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/VERIFY.json", + "usage": "input", + "git_blob": "6537be05745836106c753e1388ffc8b1bd23ce4c", + "sha256": "f9e252e8ab255b49c3b18d4db76cc09ebd9fb61d599305e0aca8bf295189028d" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/checks.py", + "usage": "input", + "git_blob": "46630a7648b1c93530e9253872a19cce338929ff", + "sha256": "98ffbd58881aa138b8dbae4d5722855ece2a5fdf7585e53978069ae9b064eb09" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/codec.py", + "usage": "input", + "git_blob": "9cd54d9417eb685dcd3f8293f01299ef9046ad31", + "sha256": "5b9fda8136f7e60bece54e3fcc74f4ea0bec7145fa60e1ae3a4d252741b81fd3" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/vendor/parking_machine.py", + "usage": "input", + "git_blob": "cafd614a3b7bc87b019361fcdf890ed976f26d19", + "sha256": "68134779debfb795468a1aaecbc2b9d321d7d4e451313ce7dc8fa7092561df4c" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/vendor/pr2753_recursive_call.py", + "usage": "input", + "git_blob": "6d33224145aa04f7fbaf7b6cda7c9c164311a402", + "sha256": "157deaa5972557893d43494a81151483bdc46373448ec677cb6a738c9b7e6f1e" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/vendor/words.py", + "usage": "input", + "git_blob": "8d4ba37e2778acb35b34e0719df2caf138fbeb50", + "sha256": "5c37f57708ba3131bdcb03139f9dbc29886bee44569c09cbba51b68f75acd7f9" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/verify.py", + "usage": "input", + "git_blob": "6be4f94eda9c96f4e7265a294f63e39309dcb0c6", + "sha256": "37f9e51e6c038a2493b4550e3cf0bd52621b6c20e115f0886406fc9909a82120" + }, + { + "path": "research/selected-bit-physical-caller/loader.py", + "usage": "input", + "git_blob": "4a0326c9af88626938645f288e559b5b97cb1787", + "sha256": "4d8647f520b2967a0ca7dcadeb39d6ebabbce44df4193f609fef22911d0ae67b" + }, + { + "path": "research/selected-bit-physical-caller/macro_binding.py", + "usage": "input", + "git_blob": "c197eb6458be9374cb4684c654bfc99e619dcaf0", + "sha256": "9ef31765d03d2c54fad9296f2ff0707a190ce169e44de4f0f45214e3c410c01a" + }, + { + "path": "research/selected-bit-physical-caller/macro_code.py", + "usage": "input", + "git_blob": "2f5f8ecfac6457171707b1b5ff02b5071954fcb7", + "sha256": "f626b018124747a5f17c1603bea36cd74c00a69a0647fd7b10e9c4e2964caea8" + }, + { + "path": "research/selected-bit-physical-caller/macro_machine.py", + "usage": "input", + "git_blob": "5a032e8923f7f8b22bb98f3e39b804beb9906c16", + "sha256": "7bc6e42072a09a08ac961e05c3da01cde012d740d4b4c605f298d994f2ad7c5a" + }, + { + "path": "research/selected-bit-physical-caller/residual_blocks.py", + "usage": "input", + "git_blob": "fba75e7649cf77e352a75324495191bbd7853c22", + "sha256": "ab7f3df8906decd2efecfb138eac1456c106bb520b2598761f699f80680d8331" + }, + { + "path": "research/selected-bit-physical-caller/role_parking.py", + "usage": "input", + "git_blob": "fc48c244eefdbaa3e320e86c75a7d187cb5765ef", + "sha256": "1884a3c260d81d5efbc0c33d86a810d6728e55e5764cfcd423f858cc685470f3" + }, + { + "path": "research/selected-bit-recursive-closure/PROOF.md", + "usage": "input", + "git_blob": "6c410cab5713979214a45835091fbeb9ee9b8531", + "sha256": "74cc8de20f21acb5123fe2d20996fe0925ea6e51b3dec633bd5221fb719b3344" + }, + { + "path": "upstream/LICENSE", + "usage": "input", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "path": "upstream/build/sections/02-streams.tex", + "usage": "input", + "git_blob": "088fceea1867abc76271d7efe7532b779fee9039", + "sha256": "606c80db61cad13aa0c3b6060dc4b88dbbe7ac60cdd831aa93f28d908fd09dab" + }, + { + "path": "upstream/manifest.json", + "usage": "input", + "git_blob": "01c309e34d36cf3669c43d89c5dfb25cdc31b8af", + "sha256": "16ab13971694cabab09440c47ebf2fc0496a9d35fc3af33950fda3498f8e2392" + } + ], + "note": "The original 28 archived-package SHA256 pins and 121 live SHA256/Git-blob pins are unchanged. They are the independent census trust anchor; current bytes must pass authentication at each run. No Git history or executable is needed: blob IDs are computed from bytes. The separate 61-entry lifetime_source_sha256 allowlist is retained from the verified lifetime worker RUN.json; three support files (macro_controls.py, numerical_frame.py, scratch_pool.py) are not among the 121 live pins. Import receipts identify which allowlisted sources actually executed. The main scientific receipt is historical and unchanged, not regenerated or extended by these checks.", + "lifetime_source_sha256": { + "research/selected-bit-physical-caller/inputs/pr2753/bootstrap.py": "eef1c418e8edbdf317d159683e30beaecd971c77cf41d6b09708576405e2141e", + "research/selected-bit-physical-caller/inputs/pr2753/consumer.py": "2f2a8604c23fb2c81f24320c71ed0142118d98dde3be6086adad28e89954a777", + "research/selected-bit-physical-caller/inputs/pr2753/driver.py": "ceaf8f75de9810a05ebf8f65780b6f8bd7599a5768401d5e4386182afe615cdf", + "research/selected-bit-physical-caller/inputs/pr2753/layout.py": "3beef6534b02c3b011b741f957a7d9fb05a9ac0bba1fed53b2c71834e4ea6bc1", + "research/selected-bit-physical-caller/inputs/pr2753/linear_sign.py": "73e895fc701a4145cbe89d60f5775128354e7f08d0a45eacf22f423913f54e67", + "research/selected-bit-physical-caller/inputs/pr2753/node.py": "0bd4f640cafb5c8f070c161d86445910f77578a672bf5886936ed89e7f6bd21b", + "research/selected-bit-physical-caller/inputs/pr2753/packet_engine.py": "c80fc3aa9092f91cc309b2fb2dbc3618bf96bdb9b8498503993ea161f0ae2134", + "research/selected-bit-physical-caller/inputs/pr2753/peel.py": "8b20888f74b4cd814a97b42ec72528fbfb6d2e936c5022df726f0785d0d01a2e", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/cardinal_counts.py": "59ddeac102a0cc51fa49b15aae6aeb68cd68ed217fa974ce916372a177d2ec8f", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/catalogue.py": "83ea88f82d4a83c5f889774bfe3519b7ebaa24b6a0e2a969dafff012107a89bf", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/consumer.py": "b28ec97b0873ff2be25aff4bdde268247ffcec0d21279d0ada196de19a0bdc66", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/control.py": "d3a93e54bb7d333b73917586407d11674d38b5c3fda4fbdc436fb5293ae7786a", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/driver.py": "ee9e42fe95ab28fdd5e927c2d46fd480305aaad610eb2ca7ae514a5d22d9f0ac", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/fresh_rows.py": "e4ae08fbd658add630eb7754ebe0cbcb42c6f39cf4128f9cb92e27fcf5213a7d", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/layout.py": "7534b0166805f2ae8d11495c811d2bd272cea89c89b6bb5251fd411c89245a20", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/model.py": "c937ae8e46162f88fc1cd7646d3b22c99273029ad0f0e3131f46ddec230676cb", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/node.py": "b88fc9ac0b22d939311ff4f7aff788e8c87a64fd5e866498e59bd27940ee3f28", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/packet_engine.py": "ce7f132a6a69c802406f07c4a2119ef921e8978520ff58d5eeaeedb982c257f2", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/peel.py": "3de018e68601566c364c7568b110f60c1bf34941b846cdffb94401bb799f85e3", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/topology.py": "384d456ddba76de137a63b50019d5bba2e9f6daa4177c91643e0565d4cf1d44b", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/binding.py": "20169a8af6ed2b34069fd353a2bc1c42335ab686c58de8479baef33dd3fb493b", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/bitstream.py": "f78bac9641007dbd8824984edcac057274fe016ce78bd9cb512d0c0913274783", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/cardinality.py": "505d5e560c5a507e6184edcc19a87cf1fed243eb34a5cb21fbe1e4fe017e7f22", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/children.py": "a78866939631214c1d1659203b2b5fc062e3c6255e9f11f975c310046b010bd6", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/controller.py": "fa09146991f6c04e6f4b6eb9bf0c8e103e70e90a0e402ff3d69814e6aac8ff8c", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/counts.py": "00b476dbda0e8cc99886bf794439e1cb9e775f435f599a3557e99321fe084069", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/directory.py": "4270e370b2bfe38ef73aadcd97d1b3496b56bd582115d74331eb9e5ceb90bec7", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/episode.py": "38f79cb2a370548471063952d5f7c74bd795a2a8496fdcf3ce0996d79e3adaff", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/forms.py": "1fdf9d31b7eb107c396e33f94dad61c9d3f2c709cae61178268a44ca80dbc0b4", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/low_codes.py": "f657e17f6088c840e3f7783e662257630f6d2c1e71c217721ffbca4d6ac93e87", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/matrices.py": "00b687434039b54529ee092e34f9435cfcd66e0816eb3bd2a6688c73f4e01459", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/numeric.py": "7327b05c4ec3e0f6d9c352cc7de85bfd4ebe940482553e77c59a773a8c09c514", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/oracle.py": "7bd18089e32ce48085b5e3a75159f6a82cdb2649ec682c53db05e399d97aef67", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/packet.py": "970e7fe0719e3dfe122b248941e6f21cd90d7dd62089fa6acbd0e5412ce083a5", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/plan.py": "d9c8dc93762db4d3a449814aa51e2211460648694469854d89cb48cb04188cf3", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/records.py": "0c9c4b23e998597fb877bb1a29da69ac869b68262abe635b162b4dba9c69b372", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/residual.py": "8fd24747cae498dfb2ba333e7f8a68d7315ae4c2d7530d8ca145aab95ede21df", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/routes.py": "ed7dc3679451696ab1dd841146b215c9515a3eec5e4ff3763f33c315f1696ada", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/selection.py": "bc8e371fb1fa0b41fb05ef0b34d0f4c317b2396f9833d91f44f95c2b54b4052b", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/sources.py": "f102edc7816d742bd89db8097254c19b843d0ef5cf6758ad42e93bcc0b214c62", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/stream.py": "c7dc7da5b00f27016982ada4c0416f8328568b00df16d97012f33d4b372d79b5", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/stream_runner.py": "751c5023ca0e477369e448583961ace6a76db2723bb6c26f81203def539f1249", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/trace.py": "c71ba11d793dde2ac6e4cdcf468482872975c34589bf1167f2a460cb8a74e984", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/words.py": "5c37f57708ba3131bdcb03139f9dbc29886bee44569c09cbba51b68f75acd7f9", + "research/selected-bit-physical-caller/inputs/pr2753/recursive_call.py": "157deaa5972557893d43494a81151483bdc46373448ec677cb6a738c9b7e6f1e", + "research/selected-bit-physical-caller/inputs/pr2753/scheduler.py": "0d96f7fbd6f90416167c5a52c0e3de942d1a0cae3d2968831932a9576701699f", + "research/selected-bit-physical-caller/inputs/pr2753/stream_runner.py": "b255feaf6cc6e40413ae73fe302bf8f290bf4dd89f4128b23a91cc9860601801", + "research/selected-bit-physical-caller/inputs/pr2753/trace.py": "3a664224c558244f606b603cad816d75e94a17c9b2620a06a1530e893dfceac2", + "research/selected-bit-physical-caller/inputs/pr2769/codec.py": "5b9fda8136f7e60bece54e3fcc74f4ea0bec7145fa60e1ae3a4d252741b81fd3", + "research/selected-bit-physical-caller/inputs/pr2769/vendor/parking_machine.py": "68134779debfb795468a1aaecbc2b9d321d7d4e451313ce7dc8fa7092561df4c", + "research/selected-bit-physical-caller/inputs/pr2769/vendor/pr2753_recursive_call.py": "157deaa5972557893d43494a81151483bdc46373448ec677cb6a738c9b7e6f1e", + "research/selected-bit-physical-caller/inputs/pr2769/vendor/words.py": "5c37f57708ba3131bdcb03139f9dbc29886bee44569c09cbba51b68f75acd7f9", + "research/selected-bit-physical-caller/loader.py": "4d8647f520b2967a0ca7dcadeb39d6ebabbce44df4193f609fef22911d0ae67b", + "research/selected-bit-physical-caller/macro_binding.py": "9ef31765d03d2c54fad9296f2ff0707a190ce169e44de4f0f45214e3c410c01a", + "research/selected-bit-physical-caller/macro_code.py": "f626b018124747a5f17c1603bea36cd74c00a69a0647fd7b10e9c4e2964caea8", + "research/selected-bit-physical-caller/macro_controls.py": "a5343faffadfdd9ea0e52d4c7c4ef24ba5e8d2dee86c8af27c094ad78944b845", + "research/selected-bit-physical-caller/macro_machine.py": "7bc6e42072a09a08ac961e05c3da01cde012d740d4b4c605f298d994f2ad7c5a", + "research/selected-bit-physical-caller/numerical_frame.py": "3fd62eda5d0b48bf31ea244708a77afdc6d16cf4fc9439d140ef422a38c7406c", + "research/selected-bit-physical-caller/residual_blocks.py": "ab7f3df8906decd2efecfb138eac1456c106bb520b2598761f699f80680d8331", + "research/selected-bit-physical-caller/role_parking.py": "1884a3c260d81d5efbc0c33d86a810d6728e55e5764cfcd423f858cc685470f3", + "research/selected-bit-physical-caller/scratch_pool.py": "41f1eb93652b7174c3b02f95f70e1a9ce2e2aed0a729e725167c8f226e65d8db" + }, + "main_scientific_receipt_sha256": "c1bc50f54937cd3b2efae61bb5b655b55859b3ed7ddcf1a2e9bbd8682fc88f3d", + "attribution": [ + "Independent census and lifetime checks adapted from the verified GPT 6 Astra review workers.", + "Capacity arithmetic adapted from the Claude Opus 5.5 CPython representability review.", + "Kewin Talaga: archived PR3391 visitation audit; the successor preserves its source and scope attribution.", + "Jose Manuel (jmbarrancoml): physical caller/emitter, numerical codec and inherited PR2234 request catalogue.", + "David Arias: logical selected caller PR2753; ywz65: parking-controller predecessor PR2635.", + "Nick Petalas: ordering/refinement predecessors PR2989/PR3041 and retained source-chain contributions.", + "Matthieu Pascal: earlier 904896 paid-child invoice (a different counting unit); Ross Richardson: retained-backing/lifetime methodology.", + "Douglas Colkitt and all retained README/NOTICE contributors retain their existing attribution.", + "Substantial OpenAI Codex assistance in this portable adaptation. AI review is not independent human or formal verification. Apache-2.0; original notices preserved." + ] +} diff --git a/research/selected-compiler-source-bridge/CONTRACT.md b/research/selected-compiler-source-bridge/CONTRACT.md new file mode 100644 index 0000000000..9ab1368543 --- /dev/null +++ b/research/selected-compiler-source-bridge/CONTRACT.md @@ -0,0 +1,176 @@ +# Source-to-model correspondence contract + +This contract states exactly what `CompilerAudit.SourceBridge.selected_source_transport` +proves, what it assumes, and how each assumption relates to the pinned Python +source. The machine-readable form is [OBLIGATIONS.json](OBLIGATIONS.json). +Execution results for this package are in [VALIDATION.md](VALIDATION.md). + +## 1. Provenance + +| Item | Value | +|---|---| +| Archived predecessor | `research/selected-compiler-visitation-audit` at `eb89e7a7884ccacb82b5d5120d7f83be269748c0` ([PR3391](https://github.com/CrocSwap/integer-mult-bounds/pull/3391), Kewin Talaga), unchanged | +| Base | canonical main `20ecf2891d80b5acf18d980b2164fb44ea7faa90` | +| Emitter source | `research/selected-bit-physical-caller/macro_code.py`, SHA-256 `f626b018124747a5f17c1603bea36cd74c00a69a0647fd7b10e9c4e2964caea8`; the other cited modules are under that package's `inputs/pr2753/predecessor/` | +| Bridge origin | Drafted by a Claude Opus 5.5 agent during a local six-agent review of PR3391 on 18 October 2026 and compiled serially by the integrating OpenAI Codex session. | +| Repairs before local proof checks | Two tactic-script errors and some deprecation warnings were repaired. The definitions and the main statement were not changed. | +| Previously verified snapshot | SHA-256 `6027af1a083bbca309f406762dc7526e11aac6f4c4cdb90d9aa7427ad04182f9`, Lean `v4.34.1` and the PR3391 mathlib pin `d13f23b723b8a846827a245b89c10fc7d3f11612` | +| Previous checks | 27 declarations. The exact statement type in Section 3 was checked. Axiom reports were limited to `propext`, `Classical.choice` and `Quot.sound`. An explicit `leanchecker --verbose CompilerAudit.SourceBridge` replay also passed. | +| Imported libraries | Trusted cached artifacts, not rebuilt cold | +| Candidate source | Header comments were corrected after the previous check. The formal text is identical. Its hash and rerun status are recorded in [VALIDATION.md](VALIDATION.md). | + +The bridge imports `CompilerAudit.Result` from the PR3391 Lean model. It does +not modify that model or its main theorem. + +## 2. Semantics: idealized, not realizable CPython + +For prime q ≥ 3, `N = |GL64(F_q)| ≥ |GL64(F_3)|`; the latter has 6,492 bits. A +complete selected `compile_node` would need at least `2T = 1,809,792 N` +operation entries. Already at q = 3, this has 6,512 bits and exceeds `2^6500`. That exceeds the list +limit of conventional 32- and 64-bit CPython. On the reviewing interpreter, +`sys.maxsize` has 63 bits. A complete selected `Code` therefore cannot be +constructed there. No claim is made about which resource fails first. + +Accordingly: + +- **D. Denotational trace.** Every statement here is about the trace that the + loop nest denotes under unbounded list and heap semantics. In this semantics, + every guard is assumed to succeed and every `Cursor` loop and plan + compilation to terminate. The phrase "one complete successful compilation" + is meaningful only for D at the selected size. +- **P. Prefixes.** A bounded prefix is a separate possible implementation + target. No prefix correspondence, resource-feasibility or termination theorem + for an actual CPython run is provided. + +This limit does not falsify the conditional formulas or the Lean model. It is +not an argument against lazy or regional representations or multiplication +algorithms generally. + +## 3. Formal statement + +The formal types are hand-written abstractions of the Python loops: + +- `LocalEvent` stores `op` and `request`. +- `Event` has the cases `sweep`, `idle` and `silent`. +- `Seg W` represents one factory call. It stores the number of wrapper-free + operations before the call, the call's wrapper and its block count. +- `SrcOp W` has the cases `begin`, `block`, `finish` and wrapper-free `other`. + +The `sourceTrace` definition transcribes the source loop nest. It is not a copy +of the model's `visitWord`. + +The theorem is stated over an arbitrary LOW type `α`, which uses value equality, +and an arbitrary wrapper type `W`, which represents identity. + +```lean +(hlows : lows = (List.range N).map unrank) +(hinv : ∀ o, o < N → rank (unrank o) = o) +(hsched : List.Forall₂ (Matches SelectedData.replicaCount) (residualEvents sched) Selected.groups) +(hbud : segs.map Seg.blocks = + (sourceTrace lows SelectedData.replicaCount sched).map fun k => blocks (rename rank k)) +(hfresh : (segs.map Seg.wrapper).Nodup) +⊢ (sourceTrace lows SelectedData.replicaCount sched).map (rename rank) = Selected.word N +∧ (sourceTrace lows SelectedData.replicaCount sched).toFinset.card = 28278 * N +∧ (srcRetained (emitSrc segs tail)).card = 904896 * N +∧ (srcRefs (emitSrc segs tail)).length = 1809792 * N + Result.blockTotal N blocks +``` + +`Matches` describes only one event's projected request list for every replica +and its view and nesting flags. It does not mention LOWs, `N`, the trace or any +count. The four conclusions are derived from the hypotheses. In particular: + +1. The renamed trace equality is ordered list equality. Order-changing mutants + with equal counts do not satisfy it. +2. Distinct keys are counted over LOW objects **before** ranking. This count + uses the rank injectivity that follows from `hlows` and `hinv`. +3. Retained identities follow from one segment per trace entry, which follows + from `hbud`, and pairwise-distinct wrappers, given by `hfresh`. +4. Reference counts allow wrapper-free operations before any segment and at the + end. + +`B = Result.blockTotal N blocks` counts block operations. It is not native cost, +heap size or a stock coefficient. + +## 4. Correspondence premises + +The source lines below refer to `macro_code.py`. + +| ID | Lean premise | Python fact | Evidence and boundary | +|---|---|---|---| +| L1 | `sourceTrace` / `eventTrace` definitions | Sweep loops run in the order schedule → replica → `low_classes()` → event position. Idle loops run in the order schedule → replica → identifier → LOW. Bridge and exchange events do not call `residual`. There are three call sites, at lines 66, 71 and 87. | The PR3391 AST check pins the call sites and loop tuples. The semantic transcription is informal. | +| L2 | `LocalEvent.emits` | `accept` returns `event[:2]`. `residual` is called only for op ∈ {0, 2} (MOVE/COPY), with key `(requests[p], True, low)`. Idle calls use `(id, False, low)`. | Source reading. The treatment of malformed events is a Lean totalization; see Section 5. | +| L3 | `Matches` for all `r < 32` | `call(stage, r)` takes events and identifiers from the cached `recipe(stage)`, which does not read `r`. | Structural by source reading. The census checks all 32 replicas at q = 3. | +| L4 | `hsched` | Non-silent schedule events correspond, in order, to the 19 certified interval groups and their flags. | Python census and certificate pins. This is not a formal Python proof. Cross-group disjointness depends on the pinned template, not on the code structure. q independence is argued from the source. | +| L5 | `hlows` | `low_classes()` yields `unrank(o)` for `o in range(size)`. Its size is `∏(q^64 − q^k) = N`. | Source reading | +| L6 | `hinv` | `rank(unrank(o)) = o` for `o < N` on GL64(F_q). | **Not proved by this package.** The tiny codec fixtures do not prove this all-size property. [PR2569's retained proof](https://github.com/CrocSwap/integer-mult-bounds/blob/20ecf2891d80b5acf18d980b2164fb44ea7faa90/research/selected-source-packets/PROOF.md#L44-L65) supplies a written prefix-count/bijection argument for byte-identical codec source. That argument was located and read, not formalized or replayed here. | +| B1 | `Seg` / `emitSrc` shape and `hbud` alignment | Each call appends `residual_begin`, then `b ≥ 0` blocks, then `residual_end`, contiguously (lines 38–47). | Source reading. `Cursor` termination is assumed in D. | +| B2 | `hbud` budget equation | In mode 0, `b` is determined by `Specifications.plan(code)`. The code `encode(i, c, low)` depends only on `(i, c, rank low)`, and plans are cached deterministically. | Source reading. It assumes deterministic plan compilation and no external cache mutation. | +| B3 | `hfresh` | `SelectedBinding.residual` constructs a new `Residual` on every call. Every returned wrapper remains in `Code.operations`. | Python identity semantics. The tiny-fixture lifetime check observes this behaviour. It is not formalized. | +| B4 | `SrcOp.other` carries no wrapper | No non-residual operation tuple directly holds a `Residual`. `compile_owner` returns tuple matrices and `Route` values. | Discharged for direct slots by source inspection. Transitive object graphs are outside the counting unit. | +| B5 | `srcRefs` | A direct reference is slot 2 of `begin`/`end` or slot 1 of `block`. | Definition. It is not `sys.getrefcount`, transitive size or native storage. | + +The Lean theorem uses every hypothesis. Mathematically, the premises are needed +unevenly: + +- Ordered trace equality needs `lows.map rank = range N`. +- The call and direct-reference counts, `T = 904,896 N` and `2T + B`, need only + `N` LOWs per pass, together with segment alignment. +- Identifying `T` with the number of distinct retained wrappers additionally + needs freshness, given by B3. +- The `28,278 N` distinct-key count needs LOW injectivity, which follows from + L5 and L6. +- Freshness of `Specifications` is not needed for any count. It can affect only + cache contents, and therefore possibly `B`. +## 5. Scope of events + +The bridge covers well-formed, guard-successful events only: + +- opcodes in {0, 1, 2, 3}; +- integer request IDs at every MOVE and COPY; +- request IDs and view flags that pass the `need` checks. + +For a missing request or an opcode other than MOVE/COPY, `LocalEvent.emits` +returns no emission as a total Lean definition. This does not model Python +guards or exceptions: no equivalence is asserted for malformed raw events. + +## 6. Python check boundaries + +- **Census.** The census reconstructs requests and groups from metadata at + q = 3 for all 32 replicas. It does not enumerate GL64 LOWs or execute the + selected compiler. +- **Lifetime.** The lifetime check uses tiny seeded fixtures with the original + factory and compiler functions. It is not a cold 64-dimensional + `Specifications` initialization and does not validate numerical endpoints. +- **Windows adapter.** On Windows only, an in-memory adapter changes one + inventory-path expression in the original verifier to its POSIX spelling. + All authentication predicates are unchanged. +- **Loader bypass.** The lifetime importer bypasses `loader.authenticate`. It + hashes the original module bytes, imports them and marks the loader active. It + is therefore not a test of loader authentication. +- **Export.** Portable copies are made with the shared + `scripts/export_research_package.py`, using the committed package and its 152 + declared inputs. The direct verifier checks the extracted + `.research-export.json` inventory and bytes. The manifest provides transport + integrity only and is not authenticated Git provenance. Provenance is checked + before publication and by the registered metadata command in a Git checkout. +- **Lean.** The check freshly compiles seven predecessor modules and the bridge, + uses eight dependency library roots, and checks nine pinned dependency source + revisions. It trusts cached compiled library objects rather than rebuilding them. + +## 7. Not established + +This contract does not establish any of the following: + +- Python parser, operational semantics or compiler correctness; +- that the premises in Section 4 hold formally for the pinned source; +- the GL64 LOW codec inverse (L6); +- complete realizable CPython execution; +- prefix theorems; +- safety of wrapper sharing; +- native space, storage lifetime, stock or precision; +- zero runtime or source-validation work; +- any contradiction of the predecessor construction's q-dependent fixed overhead; +- the full multiplication theorem; +- any change to κ or the selected frontier. + +Separate AI implementations and kernel checks are not independent human review. \ No newline at end of file diff --git a/research/selected-compiler-source-bridge/OBLIGATIONS.json b/research/selected-compiler-source-bridge/OBLIGATIONS.json new file mode 100644 index 0000000000..6d252a0b55 --- /dev/null +++ b/research/selected-compiler-source-bridge/OBLIGATIONS.json @@ -0,0 +1,228 @@ +{ + "schema_version": 1, + "package": "research/selected-compiler-source-bridge", + "predecessor": { + "pr": 3391, + "package": "research/selected-compiler-visitation-audit", + "publication_commit": "eb89e7a7884ccacb82b5d5120d7f83be269748c0", + "author": "Kewin Talaga (PellaML)", + "archive_status": "partially_reviewed", + "modified": false + }, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "semantics": "Idealized unbounded denotational trace (D); guards are assumed to succeed and Cursor loops / plan compilations to terminate. A complete selected Code is impossible on conventional 32/64-bit CPython (q=3: N has 6492 bits; 2T has 6512 bits > 2^6500). No first-failure claim; no prefix theorem.", + "theorem": { + "name": "CompilerAudit.SourceBridge.selected_source_transport", + "imports": "CompilerAudit.Result (PR3391 model, unchanged)", + "hypotheses": [ + "hlows", + "hinv", + "hsched", + "hbud", + "hfresh" + ], + "conclusions": [ + "ordered renamed trace = Selected.word N", + "distinct source keys = 28278 * N", + "retained wrapper identities = 904896 * N", + "direct wrapper references = 1809792 * N + Result.blockTotal N blocks" + ], + "assumes_target_equality": false, + "assumes_totals": false, + "previous_verification": { + "date": "2026-10-18", + "source_sha256": "6027af1a083bbca309f406762dc7526e11aac6f4c4cdb90d9aa7427ad04182f9", + "lean": "v4.34.1", + "declarations": 27, + "exact_type_checked": true, + "axioms": [ + "propext", + "Classical.choice", + "Quot.sound" + ], + "leanchecker_replay": true, + "imported_libraries": "cached, trusted, not cold rebuilt" + }, + "candidate": "Header comments corrected after the previous check; formal text identical. Candidate hash and rerun status: VALIDATION.md." + }, + "premises": [ + { + "id": "L1", + "lean": "sourceTrace/eventTrace definitions", + "fact": "Sweep: schedule -> replica -> low_classes() -> position; idle: schedule -> replica -> identifier -> LOW; bridge/exchange silent; three call sites (macro_code.py l.66/71/87).", + "evidence": "PR3391 AST check of call sites and loop tuples", + "boundary": "Syntactic pin; semantic transcription informal.", + "status": "informal_source_reading", + "needed_for": [ + "trace", + "all counts" + ] + }, + { + "id": "L2", + "lean": "LocalEvent.emits", + "fact": "accept returns event[:2]; residual called iff op in {0,2} with (requests[p], True, low); idle uses (id, False, low).", + "evidence": "control.py accept; macro_code.py l.63-75, 87", + "boundary": "Well-formed, guard-successful events only; malformed-event handling is a Lean totalization.", + "status": "informal_source_reading", + "needed_for": [ + "trace", + "all counts" + ] + }, + { + "id": "L3", + "lean": "Matches: all r < 32", + "fact": "call(stage, r) reads events/identifiers from cached recipe(stage), independent of r.", + "evidence": "topology.py recipe/call; census over all 32 replicas at q=3", + "boundary": "Structural by source reading; census is metadata-only.", + "status": "source_reading_and_python_check", + "needed_for": [ + "trace", + "all counts" + ] + }, + { + "id": "L4", + "lean": "hsched", + "fact": "Non-silent schedule events correspond in order to the 19 certified interval groups and flags.", + "evidence": "Python census (28278 IDs, 19 groups, 904896 projected visits per LOW) and certificate pins", + "boundary": "Not a formal Python proof; cross-group disjointness is a property of the pinned template; q-independence argued from source.", + "status": "python_certificate", + "needed_for": [ + "trace", + "all counts" + ] + }, + { + "id": "L5", + "lean": "hlows", + "fact": "low_classes() yields unrank(o) for o in range(size); size = prod(q^64 - q^k) = N.", + "evidence": "catalogue.py low_classes; low_codes.py", + "boundary": "Source reading.", + "status": "informal_source_reading", + "needed_for": [ + "trace", + "all counts" + ] + }, + { + "id": "L6", + "lean": "hinv", + "fact": "rank(unrank(o)) = o for o < N on GL64(F_q), prime q >= 3.", + "evidence": "PR2569 retained written prefix-count/bijection argument for byte-identical low_codes.py; tiny fixtures here. The written proof was located/read, not formalized or independently replayed.", + "boundary": "The actual GL64 codec inverse remains a hypothesis of this Lean theorem, not a property newly proved here; no absence or novelty claim.", + "status": "open_hypothesis", + "needed_for": [ + "distinct source keys", + "trace equality via rename" + ], + "predecessor_proof": "https://github.com/CrocSwap/integer-mult-bounds/blob/20ecf2891d80b5acf18d980b2164fb44ea7faa90/research/selected-source-packets/PROOF.md#L44-L65" + }, + { + "id": "B1", + "lean": "Seg/emitSrc shape; hbud alignment", + "fact": "Each call appends residual_begin, b >= 0 blocks, residual_end contiguously (macro_code.py l.38-47).", + "evidence": "Source reading", + "boundary": "Cursor termination assumed (D).", + "status": "informal_source_reading", + "needed_for": [ + "retained wrappers", + "direct references" + ] + }, + { + "id": "B2", + "lean": "hbud budget equation", + "fact": "Mode-0 block count is determined by Specifications.plan(encode(i, c, low)), a function of (i, c, rank low); plans cached deterministically.", + "evidence": "residual_blocks.py, catalogue.py, macro_binding.py", + "boundary": "Assumes deterministic plan compilation and no external cache mutation.", + "status": "informal_source_reading", + "needed_for": [ + "direct references (B term)" + ] + }, + { + "id": "B3", + "lean": "hfresh", + "fact": "SelectedBinding.residual constructs a new Residual per call; all retained in Code.operations.", + "evidence": "macro_binding.py; tiny seeded lifetime fixture (16 wrappers, 32 blocks, 64 references, normal and -O)", + "boundary": "Python identity semantics, not formalized; fixture is not cold 64-dimensional initialization or endpoint validation.", + "status": "source_reading_and_fixture_check", + "needed_for": [ + "retained wrappers" + ] + }, + { + "id": "B4", + "lean": "SrcOp.other carries no wrapper", + "fact": "No non-residual operation tuple directly holds a Residual; compile_owner returns tuple matrices and Route values.", + "evidence": "Source dataflow inspection in the local PR3391 review", + "boundary": "Direct slots only; transitive object graphs outside the counting unit; not a formal Python proof.", + "status": "discharged_by_source_inspection", + "needed_for": [ + "retained wrappers", + "direct references" + ] + }, + { + "id": "B5", + "lean": "srcRefs definition", + "fact": "Direct reference = slot 2 of begin/end, slot 1 of block.", + "evidence": "PR3391 PROOF.md section 3", + "boundary": "Not sys.getrefcount, transitive size or native storage.", + "status": "definition", + "needed_for": [ + "direct references" + ] + }, + { + "id": "D", + "lean": "implicit (unbounded semantics)", + "fact": "Every need-check is assumed to succeed and every Cursor loop / plan compilation to terminate for all keys.", + "evidence": "none; not realizable on conventional CPython", + "boundary": "Statements concern the idealized trace only.", + "status": "semantic_assumption", + "needed_for": [ + "all conclusions" + ] + } + ], + "check_boundaries": [ + "Census: q=3 metadata for all 32 replicas; no GL64 LOW enumeration; selected compiler not executed. Archived PR3391 census used q=7 metadata.", + "Lifetime: tiny seeded fixtures with original factory/compiler functions; not cold 64-dimensional initialization or numerical endpoints.", + "Windows only: in-memory adapter changes one inventory-path expression in the original verifier to POSIX spelling; authentication predicates unchanged.", + "Lifetime importer bypasses loader.authenticate: hashes original module bytes, imports them and marks the loader active; not a test of loader authentication or original initialization.", + "Portable copy via shared scripts/export_research_package.py (export, then check; both need it and scripts/research_package.py); 152 declared external inputs; extracted direct verify is Git-free and checks .research-export.json inventory/bytes; transport integrity only, not authenticated Git provenance. Provenance checked before publication and by the registered metadata command in a Git checkout.", + "Lean: seven predecessor modules and the bridge compiled freshly; eight dependency library roots used, nine source revisions checked; cached compiled library objects trusted; no dependency download or install." + ], + "non_claims": [ + "Python parser, operational semantics or compiler verification", + "that the premises hold formally for the pinned source", + "GL64 LOW codec inverse (not proved by this package)", + "realizable complete CPython execution or a first-failure point", + "safety of wrapper sharing", + "native space, stock, storage lifetime, precision", + "zero runtime or source-validation work; contradiction of the q-dependent fixed overhead", + "full multiplication theorem; kappa or selected-frontier change (kappa 0.001672660197076918, priority revision 6)", + "independent human review or maintainer acceptance" + ], + "open_questions": [ + { + "question": "Can the retained written LOW inverse argument be bound to the actual codec implementation in Lean?", + "first_step": "Audit PR2569 prefix-count induction against the byte-identical frozen low_codes.py; recheck live overlap before formalizing rank/unrank invariants.", + "coverage_so_far": "Prior written bijection argument and finite tests located; not formalized or independently replayed in this package." + }, + { + "question": "Can a prefix transport describe feasible CPython runs?", + "first_step": "State the transport for a source trace truncated at a visit index against a prefix of Selected.word N; test it against the tiny lifetime fixture.", + "coverage_so_far": "None." + }, + { + "question": "Can equal-key wrappers share identity under a stated observer contract?", + "first_step": "Audit identity-sensitive consumers such as Machine.geometry.", + "coverage_so_far": "Inherited from PR3391; no sharing refinement proved." + } + ], + "task": "TASK.json" +} diff --git a/research/selected-compiler-source-bridge/README.md b/research/selected-compiler-source-bridge/README.md new file mode 100644 index 0000000000..06fa567a17 --- /dev/null +++ b/research/selected-compiler-source-bridge/README.md @@ -0,0 +1,220 @@ +# Selected compiler: conditional source-to-model bridge + +**Successor verification package to [PR3391](https://github.com/CrocSwap/integer-mult-bounds/pull/3391). +It adds a conditional Lean bridge and bounded Python source checks; it does not +verify Python, the GL64 codec or any multiplication theorem.** The archived +package [`research/selected-compiler-visitation-audit`](../selected-compiler-visitation-audit/README.md) +remains byte-identical to publication `eb89e7a7884ccacb82b5d5120d7f83be269748c0`. +This package was prepared from canonical main +`20ecf2891d80b5acf18d980b2164fb44ea7faa90`. The selected conditional +κ = 0.001672660197076918 (priority revision 6) is unchanged. + +## What this adds + +PR3391 proved its counts for a *defined* model trace, `Selected.word N`, and +connected that model to the Python emitter through hash pins, a metadata +census and prose. This package adds `CompilerAudit.SourceBridge.selected_source_transport`. +It starts from a separately defined, source-shaped trace and primitive premises: + +- per-event request projections that match the 19 certified groups and their view/nesting flags; +- LOW objects enumerated as `unrank(0..N-1)`, with `rank (unrank o) = o` for `o < N`; +- one begin/blocks/end segment per factory call, in trace order, whose block budget depends only on the renamed key; +- pairwise-distinct wrapper identities, with all other operations free of wrapper references. + +From these premises, Lean **derives** the following: + +| Conclusion | Value | +|---|---:| +| Ordered trace after renaming LOWs by `rank` | equal to `Selected.word N` | +| Distinct `(request, view, LOW)` source keys | `28,278 N` | +| Retained wrapper identities | `904,896 N` | +| Direct wrapper references in operations | `1,809,792 N + B` | + +The final trace equality and the totals are not hypotheses. The trace equality is +literal list equality, including order. A count-only match cannot satisfy it. +`B` is the sum of emitted `block` operations. It is an operation count, not +native cost, memory size or a stock coefficient. + +The exact premises, their source locations and their evidence status are in +[CONTRACT.md](CONTRACT.md) and [OBLIGATIONS.json](OBLIGATIONS.json). + +## Interpretation and limits + +**The trace is idealized and unbounded.** A complete selected `Code` cannot be +created on conventional 32- or 64-bit CPython. At the smallest admissible +radix, q = 3, `N = |GL64(F_3)|` has 6,492 bits. The begin/end references alone +need `2T = 1,809,792 N` list entries, a 6,512-bit number above `2^6500`. +Other resource failures may occur sooner; no first-failure point is claimed. +This limit does not contradict the conditional formulas or the Lean model. +It also does not constrain lazy or regional representations, or multiplication +algorithms generally. + +Other qualifications are inherited or newly made explicit: + +- `Specifications` already caches source records and plans. The wrappers are + fresh per call. This package does not show that wrapper sharing is safe. +- The q-dependent fixed overhead allowed by the predecessor construction is not + contradicted. No zero runtime or source-validation work is claimed: runtime + hooks still use specifications. +- The bridge covers only well-formed, guard-successful source events. The Lean + event types are hand-written abstractions of the Python loops, not a Python + operational semantics. +- The inverse property of the actual GL64 LOW codec is **not proved by this + package**. It remains hypothesis `hinv`. This is not a claim that no proof exists + elsewhere: [PR2569's retained proof](https://github.com/CrocSwap/integer-mult-bounds/blob/20ecf2891d80b5acf18d980b2164fb44ea7faa90/research/selected-source-packets/PROOF.md#L44-L65) already gives a + written prefix-count induction and bijection argument for the same codec. + This package does not formalize or independently replay that argument. +- No κ, stock, native-space, precision or full-theorem claim changes. + +## Evidence + +The publication candidate passed a fresh local Lean run on 18 October 2026: +seven unchanged predecessor modules and this bridge compiled with Lean +`v4.34.1`; the exact main statement, baseline main contract and fixed 27-name +axiom inventory checked; and `leanchecker --verbose CompilerAudit.SourceBridge` +replayed the bridge module. Its axiom reports use only `propext`, +`Classical.choice` and `Quot.sound`. One positive and two rejecting bridge probes +passed their expected outcomes. [VALIDATION.md](VALIDATION.md) records the +candidate hash, commands, trust boundary and publication verification. The +prior bridge's formal text is unchanged; only its header comment was clarified. + +Python checks are bounded and use the standard library only: + +- **Census.** It checks all 32 replicas at q = 3: 28,278 request IDs, 19 groups + and 904,896 projected visits per LOW, without enumerating GL64. The archived + PR3391 census used q = 7 metadata. +- **Lifetime.** It runs on tiny seeded fixtures and checks 16 distinct wrappers, + 32 blocks and 64 direct references in normal and optimized mode. It is not a + cold 64-dimensional initialization and does not validate numerical endpoints. +- **Windows path adapter.** On Windows, the census check uses an in-memory + path-spelling adapter. It changes only one inventory-path expression in the + original verifier to its POSIX spelling. Authentication predicates are + unchanged, and no adapter is installed on POSIX. +- **Lifetime importer.** The lifetime check does not call the original + `loader.authenticate`. A source-only importer hashes the original module + bytes, imports them and marks the original loader active. Therefore, this + check does not test loader authentication or original initialization. + +## Reproduce + +Python 3.12, standard library only. From the repository root: + +```sh +python -B scripts/research_package.py --package research/selected-compiler-source-bridge +``` + +The registered command runs the bounded source checks normally and with `-O`, +as listed in `VERIFY.json`; it never runs Lean. For a single direct run with +saved diagnostics: + +```sh +python -I -B research/selected-compiler-source-bridge/verify.py --output /absolute/fresh/external/dir +``` + +Use `-O` as an additional interpreter option for an optimized direct run, with a +different output directory. The optional `--output` must name a new absolute +directory outside the repository; it receives logs and `RESULT.json`. +Provenance is checked before publication and by the registered command in a Git +checkout. Each direct invocation checks only its own interpreter mode. + +To create a portable copy, use the repository's shared exporter +([guide](../../docs/research/package-export.md)). Do not use a package-specific +exporter: + +```sh +python scripts/export_research_package.py export --package research/selected-compiler-source-bridge --ref COMMIT --output /absolute/bridge.tar +python scripts/export_research_package.py check /absolute/bridge.tar +``` + +The archive contains the package and its 152 declared external inputs. Export +and `check` require `scripts/export_research_package.py` and +`scripts/research_package.py`. After the check passes, extract the archive into a +fresh directory and run the direct verifier from there. Git is not required for +that replay: + +```sh +cd /absolute/fresh/extracted +python -I -B research/selected-compiler-source-bridge/verify.py +python -I -B -O research/selected-compiler-source-bridge/verify.py +``` + +In this replay, the verifier also checks the inventory and bytes recorded in +the extracted `.research-export.json`. That manifest provides transport +integrity only. It is not authenticated Git provenance, so obtain the archive or +its source commit through a trusted channel. +Lean is opt-in and uses an existing toolchain and package cache: + +```sh +python research/selected-compiler-source-bridge/lean/check.py \ + --output /absolute/fresh/external/dir --toolchain TOOLCHAIN_ROOT --packages PACKAGES_ROOT +``` + +The checker does not download or install dependencies. It freshly compiles the +seven predecessor modules and this bridge, uses eight pinned dependency library +roots, and checks all nine dependency source revisions (`Cli` is tooling-only). +Cached compiled library objects are not rebuilt cold and remain an explicit +trust assumption. See [VALIDATION.md](VALIDATION.md) for the tested environment. +## Open next questions + +Structured scope, stop rules and overlap status are in [TASK.json](TASK.json). + +1. **Can the written LOW inverse argument be bound to the actual implementation + in a proof assistant?** [PR2569's proof](https://github.com/CrocSwap/integer-mult-bounds/blob/20ecf2891d80b5acf18d980b2164fb44ea7faa90/research/selected-source-packets/PROOF.md#L44-L65) + already gives the prefix-count induction. Its codec bytes match the frozen + codec used here. First audit those invariants against `low_codes.py`, and + recheck live overlap before formalizing them. Tiny codec fixtures are not a + GL64 inverse proof; the prior written result should not be rediscovered or + described as absent. +2. **Can a prefix version of the transport describe what CPython can actually + run?** First, state the transport for a source trace truncated at a visit + index against a prefix of `Selected.word N`. Then check whether the tiny + lifetime fixture fits that statement. +3. **Can equal-key wrappers share identity under a stated observer contract?** + This is inherited from PR3391. First, audit identity-sensitive consumers such + as `Machine.geometry`. Cached plans alone do not establish safety. + +## Status and attribution + +PR3391 was merged for archival intake. It remains `partially_reviewed`, and its +independent scientific review is still open. This package does not change that +status and makes no claim of maintainer acceptance or human review. + +**Submitter of this successor and PR3391:** Kewin Talaga (`PellaML`). PR3391 acknowledges substantial OpenAI +Codex, Claude Opus 5.5 and GPT 6 Astra assistance. + +**Predecessors credited by PR3391:** + +- Jose Manuel (`jmbarrancoml`): public fixed-role physical caller, emitter, + runtime and numerical codec; the ordered 28,278-request catalogue from PR2234 + and its PR2697 metadata. +- David Arias: logical selected caller and stock/endpoint chain from PR2753. +- Jose Manuel's PR2569: the prior written LOW bijection and source packets; + PR2769 supplies the retained numerical codec. +- ywz65: parking-controller predecessor PR2635. +- Nick Petalas: compiler-ordering and residual/CALL audits PR2989 and PR3041. +- Matthieu Pascal: the 904,896 paid-child factor in PR1806, which uses a + different counting unit. +- Ross Richardson: retained-backing/lifetime accounting method. +- Douglas Colkitt and the selected construction's other contributors. + +The fresh overlap pass also read the conditional enclosing NODE/MERGE follow-up +[PR3223](https://github.com/CrocSwap/integer-mult-bounds/pull/3223). Roger Sato's +parallel [PR3634](https://github.com/CrocSwap/integer-mult-bounds/pull/3634) addresses +primed-name axiom reports in the shared checker; [PR3602](https://github.com/CrocSwap/integer-mult-bounds/pull/3602) +addresses raw-string scanning. This package's fixed-name local harness is not a +claim of priority for those tooling issues, and it changes no shared checker. +The portable export uses Tekalign's shared exporter. These contributors keep +their existing credit. Original notices are preserved. + +**AI assistance:** + +- An earlier local cross-review used three GPT 6 Astra agents and three Claude + Opus 5.5 agents. The Astra agents reconstructed the census, checked lifetime + behaviour and audited reproducibility. The Opus agents reviewed the written + proof and Lean trust boundary, and one Opus agent drafted the bridge module and + its contract. +- OpenAI Codex integrated and repaired that work and ran the local checks. +- Current OpenAI Codex packaging-assistant workers prepared this package. + +AI review is not independent human or proof-assistant certification of the +correspondence premises. New work is under Apache-2.0. \ No newline at end of file diff --git a/research/selected-compiler-source-bridge/SOURCES.json b/research/selected-compiler-source-bridge/SOURCES.json new file mode 100644 index 0000000000..58b470d2e2 --- /dev/null +++ b/research/selected-compiler-source-bridge/SOURCES.json @@ -0,0 +1,936 @@ +{ + "schema_version": 1, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "files": [ + { + "path": "LICENSE", + "usage": "input", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "path": "NOTICE", + "usage": "input", + "git_blob": "59d8e0cf3102e15bd11db430838365531e2d7f18", + "sha256": "b49022cb4104d90b182e4c335f670faf45529025b15db77bf0291835083c28bd" + }, + { + "path": "certificates/selected-result.json", + "usage": "input", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "research/community-hyperplane599-audit/pr589/bit589/v9/hosted/GLOBAL-TEMPLATE.json.gz", + "usage": "input", + "git_blob": "9eafb8776cbf78c72124f833534469ddfa5e98ec", + "sha256": "0357b7cfbd7c29b4983982baf153c8a9f1e1e412690cd7fa9fc3d23d7963b20f" + }, + { + "path": "research/community-hyperplane599-audit/pr589/bit589/v9/nine/GEOMETRY.json", + "usage": "input", + "git_blob": "44006542202ca6037533a754f0bcd00549d7e088", + "sha256": "0058c491d839142aa99ef86a5ec697ce99857632228531512ea3fa74fb24d734" + }, + { + "path": "research/e8-bit-p111-tuned/tune/EXPECTED.json", + "usage": "input", + "git_blob": "e293ddc557742637f9f679f083a1a282d87b1b13", + "sha256": "b9f0e5ca038abe837b0007c8fe006f366a6f02009244ac57705a8a200e2301f4" + }, + { + "path": "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz", + "usage": "input", + "git_blob": "85a4499bf9e4911a705d50567a2c2ef6cf23739a", + "sha256": "e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f" + }, + { + "path": "research/pr589-five-helper-hosting/PROOF.md", + "usage": "input", + "git_blob": "bbd3f12b9a32b3ad3cba85a2d5a1b3054214fa02", + "sha256": "59cae781bfbe1a01ed9e66a8efeeb5a2b995e5ecdf908586b23ecc39f2b8d647" + }, + { + "path": "research/pr589-five-helper-hosting/verify.py", + "usage": "input", + "git_blob": "dbc71f56bb4205ebe378ada1f9f4ea88630d1d39", + "sha256": "cf90e19ae9991b0698be03d395a8cc29061ecb307eb7fea19adfb2d23c25a367" + }, + { + "path": "research/recursive-parking-boundary/README.md", + "usage": "input", + "git_blob": "251f335ebaccc11d69393ee7aeb5a2e84526d0bb", + "sha256": "491aa208391ee4c2936510b1a5c5c018dd5509d9a0e88687c72ab8406cd77b18" + }, + { + "path": "research/selected-bit-local-ring-sweeps/PROOF.md", + "usage": "input", + "git_blob": "4330de85dd9862ed15d84ab917887d249753df99", + "sha256": "846c59440cc99e28bae93ad2af99525bc769de29368080071b8427141215b4f7" + }, + { + "path": "research/selected-bit-physical-caller/PROOF.md", + "usage": "input", + "git_blob": "548ecff3ef79a32c14bafc7f2309781181d3c23d", + "sha256": "e5a827e93fe313ba9bf4a2e300bae01b58b28004aa8a8ee119cf6d950edd9f93" + }, + { + "path": "research/selected-bit-physical-caller/README.md", + "usage": "input", + "git_blob": "abd0edba96101a025609d2840c3dbdf4d3e30aa8", + "sha256": "989ad891ce3f866c920a25e0cdd661815f982c4c854370f8c00668eaa15d770c" + }, + { + "path": "research/selected-bit-physical-caller/SNAPSHOTS.json", + "usage": "input", + "git_blob": "034836cfaa3e4f984e900a980eecc986ec405b1d", + "sha256": "c7b3485bdae5ddf43166cd6626bd512816e179617a4234c36584f6c57c34744a" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/EVIDENCE.json", + "usage": "input", + "git_blob": "c2c347abc2b8c19bb642c4da1aad5b3e8383016f", + "sha256": "77b7cbefa2ca30acf2f77e23d14808ccd27848e9c76e4c5e68a045ef7891a07f" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/PREDECESSOR.json", + "usage": "input", + "git_blob": "56d76c357b51f4fc6856923222bfca47f03334e7", + "sha256": "e3127475913d62dbdf1b45d9283d2db2e9b689e0f81a703189150c1e5be2bca0" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/PROOF.md", + "usage": "input", + "git_blob": "1a08e57eac2a37764066d31baa3ecd3769759158", + "sha256": "552fa306d5cc228f4d8d8553f8ac5fc6a738ef2b66a2cb765ba0638cd229794d" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/README.md", + "usage": "input", + "git_blob": "75461632856f94d6b48ae820cf5d0b2b232305c2", + "sha256": "6ce41fd7e6dfbe5faecc25bd36561f0a65b6ebca6fc69d3fb72569424a405045" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/RESULT.json", + "usage": "input", + "git_blob": "75faec7844e18fc7c44543dbab87aba2ecf32b3e", + "sha256": "4919655bae2e5cff051e8f2d240a8e4ebb03392a9da2fb5328daa9248fb7e88b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/SOURCES.json", + "usage": "input", + "git_blob": "ff8c8e36176aa56e319d0f9e584167ac21d67f33", + "sha256": "7c78f539078e1bc3d893b78b5ee24cb22dc090d3763fe554e861b6c3d3e7eaf7" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/TASK.json", + "usage": "input", + "git_blob": "d70ad317275d2a517ab1294ce48ecb1f83dfedbf", + "sha256": "ac7d4b38da31b373e665929027fc04afb66c3e9aedaea3296e3783637912d0e8" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/VALIDATION.md", + "usage": "input", + "git_blob": "d91680665a28c12c27c99336b55c3d5341dd0fe4", + "sha256": "ac0f2fab0ca810ce0202d31480daa8329cba0897ab015520a2bfd4b689c4086b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/VERIFY.json", + "usage": "input", + "git_blob": "b6072f66c13a38b5d8dff3ca3bc5f3f3562f1b6e", + "sha256": "6ad0e07f68458afedece927550655b5bc5cd9861a70044fcd95bb10a2179f0a6" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/bootstrap.py", + "usage": "input", + "git_blob": "448c9b3a86eedb84220646ab27ff089a32ad5b9b", + "sha256": "eef1c418e8edbdf317d159683e30beaecd971c77cf41d6b09708576405e2141e" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/check_layout.py", + "usage": "input", + "git_blob": "be59d614d25961f891e1640bf85cf5e2f474a059", + "sha256": "454b1587d1ed5ccaea19b621a67e2ceba999d7ede61188125faa41c4dd2ab2b1" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/check_nested_model.py", + "usage": "input", + "git_blob": "20fed6bd389cb53fc52d0ad8389e9e7704c90265", + "sha256": "b1941b882b0659722c3c41994c82f020c1f7ab320dc28c43c2758029ef8a48b7" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/check_recursion.py", + "usage": "input", + "git_blob": "8f36c88e196cf5afc0d6e227ba8568a10bb23c6a", + "sha256": "dde82badf043e553bc635a34295e2b5505d84d6dfbaf96e0cfccb8a8c3dbb158" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/check_runtime.py", + "usage": "input", + "git_blob": "fe355a703475325bca4807b8ffedfa9f6edb74f5", + "sha256": "9fcf0c9a3c84a17446fafe8da50b63db296ba9465d48ddb6fdeac8742dfc98b1" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/check_sign.py", + "usage": "input", + "git_blob": "50669949a1325e8c49aa0ff714c40a50077b5eb8", + "sha256": "ee4fd34acd49962a18d268aefeb20aa3c2673a10e7a43eee3e51a9bd3cf9106a" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/check_sources.py", + "usage": "input", + "git_blob": "5c09a13943070a3bb3c0da06fd19fbc6916d1743", + "sha256": "1c49984ae6ee7f8a44cde16b51e486f0b3ba4ee5c973389ac8d58a82d0a0aa3b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/consumer.py", + "usage": "input", + "git_blob": "a66d9276f829ce2c619871866816649d5f3687fd", + "sha256": "2f2a8604c23fb2c81f24320c71ed0142118d98dde3be6086adad28e89954a777" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/control_checks.py", + "usage": "input", + "git_blob": "11daa0b2221c5870d19ba2eaf411a6bff3a0398d", + "sha256": "c09d33327932b4ffbb8acb26c8a6bb621bcca542157d22f1edf72679a9359981" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/driver.py", + "usage": "input", + "git_blob": "5b7846a70aada53d87480b337e1c04217118771b", + "sha256": "ceaf8f75de9810a05ebf8f65780b6f8bd7599a5768401d5e4386182afe615cdf" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/evidence/NOTICE.md", + "usage": "input", + "git_blob": "d0318d43ed420e21dc52166a19de703aa87fbb3e", + "sha256": "fd7c42e89878cda6df86dde8720ece34625a337cf5edd795a421e2d3b42919e9" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/evidence/pr2688-NOTICE.md", + "usage": "input", + "git_blob": "f2b49cdef83a4a685fad32c01fba93e12cfcb5a8", + "sha256": "c899fccf7bd32397f0ddd85e4af35a166cefb3e3ae3407ec40edc3ab2051b617" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/evidence/pr2688-PROOF.md", + "usage": "input", + "git_blob": "1395e1941863e40ff6d62dd91c41de2cb56edae9", + "sha256": "fa9bec0952468e4acb760a88d45d5be216325650e1a4080cf590e07b90c9f533" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/evidence/pr2708-README.md", + "usage": "input", + "git_blob": "79b8742f32b4ffb991f91ddd2d3c6be693084e6d", + "sha256": "5906f6b7b2c8eea90e441476c4cbd60fe2ef981b690c63357bcfe67e3104aeef" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/evidence/pr2731-README.md", + "usage": "input", + "git_blob": "ac5b826f9c34e1faadc5d5a02d5d260823112078", + "sha256": "19683df4394de299cbd7e1cce39bf9434ad260b1a37006587cf9aed84c9c0a03" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/layout.py", + "usage": "input", + "git_blob": "aa554b14fe0f6b308d9fba0a2afc92e5a28e20cb", + "sha256": "3beef6534b02c3b011b741f957a7d9fb05a9ac0bba1fed53b2c71834e4ea6bc1" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/linear_sign.py", + "usage": "input", + "git_blob": "6a6e5c02f299fad8c4f7ab724fc36e14a22ab13c", + "sha256": "73e895fc701a4145cbe89d60f5775128354e7f08d0a45eacf22f423913f54e67" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/node.py", + "usage": "input", + "git_blob": "28c98a3573b458f7a055678d70b602b80e6e959e", + "sha256": "0bd4f640cafb5c8f070c161d86445910f77578a672bf5886936ed89e7f6bd21b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/packet_engine.py", + "usage": "input", + "git_blob": "72543f684f38fefeacc2ee66d81661f1a2439cf7", + "sha256": "c80fc3aa9092f91cc309b2fb2dbc3618bf96bdb9b8498503993ea161f0ae2134" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/peel.py", + "usage": "input", + "git_blob": "38502515afc928082c849cd2cda8578d33a5050a", + "sha256": "8b20888f74b4cd814a97b42ec72528fbfb6d2e936c5022df726f0785d0d01a2e" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/NOTICE.md", + "usage": "input", + "git_blob": "ef9f81510db86eaf2f0a7191d85e92a6db30ddc0", + "sha256": "c446b32b8a621844fb2fbe654810c8122035bdd43fed2132f1137d98cb6f9943" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/PROOF.md", + "usage": "input", + "git_blob": "a4746d1786f41e45a36fdedf37966b80fbab3562", + "sha256": "88754d57bae35a2089d9de221ff32ba802b7a56b810f96271f3ea36985edfb14" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/README.md", + "usage": "input", + "git_blob": "988ff622029aff49d7e99deb2468684d904bc852", + "sha256": "15631eb826b2d8d54fbee18fb6f70ee035e172d524c2a209b6c467c3f0204f64" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/RESULT.json", + "usage": "input", + "git_blob": "7b7dfe0eab22a7b511483f268b97a7c707fd8b90", + "sha256": "0d94c5e9150f3fbd603526c67ea33168d3ba45e158aaf722e848bf5c316a37a8" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/SOURCES.json", + "usage": "input", + "git_blob": "4fef1a4d6c2d5e2620d3506d6032f9226870ed39", + "sha256": "1b02a5c607a5967948988c3beaf37d9975d650ad501a99fcf74c135dc1f05fdd" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/TASK.json", + "usage": "input", + "git_blob": "eb2ce7cc00df816daf566f101d56a0330852c1d9", + "sha256": "a4cd54d4b09ad12a90a5feeb39a127f0f0d5a2a04f9f88554c5fc3ee0cfe77f4" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/VERIFY.json", + "usage": "input", + "git_blob": "69c7ad75abe494be386f73a5d51359b9053cd9be", + "sha256": "e1dd0ee5f267ffa515bb345054ff8637cfedb0079b0d2da29b90b7848264926e" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/cardinal_counts.py", + "usage": "input", + "git_blob": "6a14feac45094ae9156e8c2c982d6727544f180e", + "sha256": "59ddeac102a0cc51fa49b15aae6aeb68cd68ed217fa974ce916372a177d2ec8f" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/catalogue.py", + "usage": "input", + "git_blob": "0efc0575a7623ac41c094d2e8772beda5a9fdc29", + "sha256": "83ea88f82d4a83c5f889774bfe3519b7ebaa24b6a0e2a969dafff012107a89bf" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/check_headers.py", + "usage": "input", + "git_blob": "1c372b19e19b838a89c0e64daeda15ec6b49f079", + "sha256": "a41dab0c487c341eb32b34a03af74454e15e9e61e7386a1ca426d83f3b68b1ca" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/check_layout.py", + "usage": "input", + "git_blob": "174d843716a684145f934cb55a612bca85aad725", + "sha256": "8f776a21dc0e31f9738d822cfda38db92f1e3672afb880d4246ec5e084a50a41" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/check_runtime.py", + "usage": "input", + "git_blob": "5647693b3a5c1555b65e281c6609f98b92d45542", + "sha256": "5357e4ff255f17c4209aaf71a3413a4148475f11180c4f829e8f0ebacd2877cb" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/check_sources.py", + "usage": "input", + "git_blob": "9219cdf863d9f060d6e38a4f2f4760fd227af003", + "sha256": "6463c2724e04a313181b78e90a17cd62ee42465754902cca3e9a65c6140a15a1" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/consumer.py", + "usage": "input", + "git_blob": "24b53521fce94d3349072cf47d70e62195f4d541", + "sha256": "b28ec97b0873ff2be25aff4bdde268247ffcec0d21279d0ada196de19a0bdc66" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/control.py", + "usage": "input", + "git_blob": "4f6ac09bffab43dbccc470bd0bde2ffbe969a8b2", + "sha256": "d3a93e54bb7d333b73917586407d11674d38b5c3fda4fbdc436fb5293ae7786a" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/control_checks.py", + "usage": "input", + "git_blob": "712cfddc4caaad9e788d97b0e1e3f623172c43ed", + "sha256": "5ea6ded8c2508fbb00d93655affdfe7907ffb60916389e0736249c003a7a5148" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/driver.py", + "usage": "input", + "git_blob": "0bdee4c9e348259b470a636a98e7657770f97fae", + "sha256": "ee9e42fe95ab28fdd5e927c2d46fd480305aaad610eb2ca7ae514a5d22d9f0ac" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/fresh_rows.py", + "usage": "input", + "git_blob": "aa3a327604308d3a5c7a27b65f5e631d430ab093", + "sha256": "e4ae08fbd658add630eb7754ebe0cbcb42c6f39cf4128f9cb92e27fcf5213a7d" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/layout.py", + "usage": "input", + "git_blob": "267d5ab98cd013ee82ba75e6d41609f1778af25f", + "sha256": "7534b0166805f2ae8d11495c811d2bd272cea89c89b6bb5251fd411c89245a20" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/model.py", + "usage": "input", + "git_blob": "9fb82fa57d29cdf8402f91534dffed8f586ced6c", + "sha256": "c937ae8e46162f88fc1cd7646d3b22c99273029ad0f0e3131f46ddec230676cb" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/node.py", + "usage": "input", + "git_blob": "13badda6f059da2132cbe325c071307e5191baa3", + "sha256": "b88fc9ac0b22d939311ff4f7aff788e8c87a64fd5e866498e59bd27940ee3f28" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/packet_engine.py", + "usage": "input", + "git_blob": "27a0dbf82e78252beede56ff86f5933c93eb55c1", + "sha256": "ce7f132a6a69c802406f07c4a2119ef921e8978520ff58d5eeaeedb982c257f2" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/peel.py", + "usage": "input", + "git_blob": "2ae1769a9726ab738d3981891d0b76beccac2d99", + "sha256": "3de018e68601566c364c7568b110f60c1bf34941b846cdffb94401bb799f85e3" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/topology.py", + "usage": "input", + "git_blob": "39a2916c207d04be5efc44750d8606f5da0c2990", + "sha256": "384d456ddba76de137a63b50019d5bba2e9f6daa4177c91643e0565d4cf1d44b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/binding.py", + "usage": "input", + "git_blob": "21a5a21220a18ab62a19ac403a9944bc3a8665c8", + "sha256": "20169a8af6ed2b34069fd353a2bc1c42335ab686c58de8479baef33dd3fb493b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/bitstream.py", + "usage": "input", + "git_blob": "4d1fd4abb0f2aabe833e5cbc9efb51039739e7ca", + "sha256": "f78bac9641007dbd8824984edcac057274fe016ce78bd9cb512d0c0913274783" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/cardinality.py", + "usage": "input", + "git_blob": "b8ba857e32c5903408e1e61ff916300848b4a208", + "sha256": "505d5e560c5a507e6184edcc19a87cf1fed243eb34a5cb21fbe1e4fe017e7f22" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/check_support.py", + "usage": "input", + "git_blob": "e1f961df9fa3a441fc5b600d1288a8d038eca51e", + "sha256": "d9977e87ddc5acdb836b8e4a4e3942da17a05b04ce67c04547d17b986b518964" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/children.py", + "usage": "input", + "git_blob": "ce4935f838516e2b08d13bec767cb803786fbc6b", + "sha256": "a78866939631214c1d1659203b2b5fc062e3c6255e9f11f975c310046b010bd6" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/controller.py", + "usage": "input", + "git_blob": "c631a9e77fbcccf0e8f448adc22978728aed7b60", + "sha256": "fa09146991f6c04e6f4b6eb9bf0c8e103e70e90a0e402ff3d69814e6aac8ff8c" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/counts.py", + "usage": "input", + "git_blob": "81b48940ce222290a40d4fb349ce827f4788469d", + "sha256": "00b476dbda0e8cc99886bf794439e1cb9e775f435f599a3557e99321fe084069" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/directory.py", + "usage": "input", + "git_blob": "c74cacf5ce809c0561d374f137a52df0992b4226", + "sha256": "4270e370b2bfe38ef73aadcd97d1b3496b56bd582115d74331eb9e5ceb90bec7" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/episode.py", + "usage": "input", + "git_blob": "30d11ff4f333813855d36da3eb5a1ab0e154bafe", + "sha256": "38f79cb2a370548471063952d5f7c74bd795a2a8496fdcf3ce0996d79e3adaff" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/forms.py", + "usage": "input", + "git_blob": "6667c0b772a63f0059c7caffec63e0d919a92398", + "sha256": "1fdf9d31b7eb107c396e33f94dad61c9d3f2c709cae61178268a44ca80dbc0b4" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/low_codes.py", + "usage": "input", + "git_blob": "737edfc4a10f4b7b3b97a7cef4b40864efd806e6", + "sha256": "f657e17f6088c840e3f7783e662257630f6d2c1e71c217721ffbca4d6ac93e87" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/matrices.py", + "usage": "input", + "git_blob": "5d497353efbb9eeaaf4facd96ab40ffb0f3aa20d", + "sha256": "00b687434039b54529ee092e34f9435cfcd66e0816eb3bd2a6688c73f4e01459" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/numeric.py", + "usage": "input", + "git_blob": "6d4ebca8398008375b8f4762d1a9f1514e8c2611", + "sha256": "7327b05c4ec3e0f6d9c352cc7de85bfd4ebe940482553e77c59a773a8c09c514" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/oracle.py", + "usage": "input", + "git_blob": "244f131466698a3ace10b657242fe1f65c07fd1f", + "sha256": "7bd18089e32ce48085b5e3a75159f6a82cdb2649ec682c53db05e399d97aef67" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/packet.py", + "usage": "input", + "git_blob": "ebc9b616514412b80c56d523776e6ba5d6766453", + "sha256": "970e7fe0719e3dfe122b248941e6f21cd90d7dd62089fa6acbd0e5412ce083a5" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/plan.py", + "usage": "input", + "git_blob": "48255d5454308c07635fae4e7eb4873b0bd2a4f8", + "sha256": "d9c8dc93762db4d3a449814aa51e2211460648694469854d89cb48cb04188cf3" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/records.py", + "usage": "input", + "git_blob": "4f00467a0ff580954ad2fd0c7380240c753ddef3", + "sha256": "0c9c4b23e998597fb877bb1a29da69ac869b68262abe635b162b4dba9c69b372" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/residual.py", + "usage": "input", + "git_blob": "3d070d2539a529f3b14ecb086a92a3db056229fe", + "sha256": "8fd24747cae498dfb2ba333e7f8a68d7315ae4c2d7530d8ca145aab95ede21df" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/routes.py", + "usage": "input", + "git_blob": "35531201dc349a811dfabc6f1f6e64697d665194", + "sha256": "ed7dc3679451696ab1dd841146b215c9515a3eec5e4ff3763f33c315f1696ada" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/selection.py", + "usage": "input", + "git_blob": "2c28f1aaec104a75c4e6c170b3e6a60300ee6700", + "sha256": "bc8e371fb1fa0b41fb05ef0b34d0f4c317b2396f9833d91f44f95c2b54b4052b" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/sources.py", + "usage": "input", + "git_blob": "16d5e7e6a28018f1e2d76d61efe2d54f6a6941d4", + "sha256": "f102edc7816d742bd89db8097254c19b843d0ef5cf6758ad42e93bcc0b214c62" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/stream.py", + "usage": "input", + "git_blob": "5e5a4bb0f98971447043e25d4dd6991bfc070389", + "sha256": "c7dc7da5b00f27016982ada4c0416f8328568b00df16d97012f33d4b372d79b5" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/stream_runner.py", + "usage": "input", + "git_blob": "efff281d4c4be5c1378e31404fbcc634fe4ade59", + "sha256": "751c5023ca0e477369e448583961ace6a76db2723bb6c26f81203def539f1249" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/trace.py", + "usage": "input", + "git_blob": "bb845a90f5bcf006e683e581e385936208f6a1f4", + "sha256": "c71ba11d793dde2ac6e4cdcf468482872975c34589bf1167f2a460cb8a74e984" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/words.py", + "usage": "input", + "git_blob": "8d4ba37e2778acb35b34e0719df2caf138fbeb50", + "sha256": "5c37f57708ba3131bdcb03139f9dbc29886bee44569c09cbba51b68f75acd7f9" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/predecessor/verify.py", + "usage": "input", + "git_blob": "121acc1ff15ec85a8011e96eda2eb587608413b9", + "sha256": "cd83797d1f420f7e5de61c1a693110b4ee0c80bac0adae4699599046b7f76f8a" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/recursive_call.py", + "usage": "input", + "git_blob": "6d33224145aa04f7fbaf7b6cda7c9c164311a402", + "sha256": "157deaa5972557893d43494a81151483bdc46373448ec677cb6a738c9b7e6f1e" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/scheduler.py", + "usage": "input", + "git_blob": "60c2b6d065eba91dd5e0edb7a77fc087971eca3f", + "sha256": "0d96f7fbd6f90416167c5a52c0e3de942d1a0cae3d2968831932a9576701699f" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/stream_runner.py", + "usage": "input", + "git_blob": "6ba5df130bb4a0fcb06b6c630830ae3a6922921b", + "sha256": "b255feaf6cc6e40413ae73fe302bf8f290bf4dd89f4128b23a91cc9860601801" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/trace.py", + "usage": "input", + "git_blob": "4b002201ce54cdecec9acf4e874b7f71cd75fe71", + "sha256": "3a664224c558244f606b603cad816d75e94a17c9b2620a06a1530e893dfceac2" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2753/verify.py", + "usage": "input", + "git_blob": "96be8f5859a3f3799344d46dec1ee68170d96bfa", + "sha256": "65126e788eeea10e830fc583cf4afe0bfc4d67495cbf8ac21de3507dbe624d56" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/NOTICE.md", + "usage": "input", + "git_blob": "307c2da733f7f3a76e97c77e71072e811f40df02", + "sha256": "8640d1b52fd21e5b20e8109ce9c4957ca1e19a95e26a1c80d019a6e6f4d5f178" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/PROOF.md", + "usage": "input", + "git_blob": "7207ce7dec86694f01a3d9c049dcb87cc909e380", + "sha256": "fc9e7dcc5b385b6e508d6a6e9524b93059fa3e9fd5fcfb5eedbd85b3a54ba55e" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/README.md", + "usage": "input", + "git_blob": "c96e0d6cec56a9a5579ae159456fc15767315bc3", + "sha256": "6550a466bfafff2ca11740e931ed9fce062eb488f23e74edff7e4bbae8282bb1" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/RESULT.json", + "usage": "input", + "git_blob": "b2d1889d77019e06ac0326ac91b1322340cf3866", + "sha256": "4406fec9515bb4206c75b681f046b5441319cf1ed39a13b9b0134696b1c192a7" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/SOURCES.json", + "usage": "input", + "git_blob": "746393061c55f47412601e3d346e914762683e0c", + "sha256": "a6476b786632c2cbffabbe27eece790e378996c8b03eb17a01f1094f20fc4cdf" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/TASK.json", + "usage": "input", + "git_blob": "216dc8f8bcb33fe32d0eaccdadb0fe0383d73848", + "sha256": "964d3a4fbfb53fd58936840328ac4b770b324c9e78f722861b1db04663110626" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/VERIFY.json", + "usage": "input", + "git_blob": "6537be05745836106c753e1388ffc8b1bd23ce4c", + "sha256": "f9e252e8ab255b49c3b18d4db76cc09ebd9fb61d599305e0aca8bf295189028d" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/checks.py", + "usage": "input", + "git_blob": "46630a7648b1c93530e9253872a19cce338929ff", + "sha256": "98ffbd58881aa138b8dbae4d5722855ece2a5fdf7585e53978069ae9b064eb09" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/codec.py", + "usage": "input", + "git_blob": "9cd54d9417eb685dcd3f8293f01299ef9046ad31", + "sha256": "5b9fda8136f7e60bece54e3fcc74f4ea0bec7145fa60e1ae3a4d252741b81fd3" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/vendor/parking_machine.py", + "usage": "input", + "git_blob": "cafd614a3b7bc87b019361fcdf890ed976f26d19", + "sha256": "68134779debfb795468a1aaecbc2b9d321d7d4e451313ce7dc8fa7092561df4c" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/vendor/pr2753_recursive_call.py", + "usage": "input", + "git_blob": "6d33224145aa04f7fbaf7b6cda7c9c164311a402", + "sha256": "157deaa5972557893d43494a81151483bdc46373448ec677cb6a738c9b7e6f1e" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/vendor/words.py", + "usage": "input", + "git_blob": "8d4ba37e2778acb35b34e0719df2caf138fbeb50", + "sha256": "5c37f57708ba3131bdcb03139f9dbc29886bee44569c09cbba51b68f75acd7f9" + }, + { + "path": "research/selected-bit-physical-caller/inputs/pr2769/verify.py", + "usage": "input", + "git_blob": "6be4f94eda9c96f4e7265a294f63e39309dcb0c6", + "sha256": "37f9e51e6c038a2493b4550e3cf0bd52621b6c20e115f0886406fc9909a82120" + }, + { + "path": "research/selected-bit-physical-caller/loader.py", + "usage": "input", + "git_blob": "4a0326c9af88626938645f288e559b5b97cb1787", + "sha256": "4d8647f520b2967a0ca7dcadeb39d6ebabbce44df4193f609fef22911d0ae67b" + }, + { + "path": "research/selected-bit-physical-caller/macro_binding.py", + "usage": "input", + "git_blob": "c197eb6458be9374cb4684c654bfc99e619dcaf0", + "sha256": "9ef31765d03d2c54fad9296f2ff0707a190ce169e44de4f0f45214e3c410c01a" + }, + { + "path": "research/selected-bit-physical-caller/macro_code.py", + "usage": "input", + "git_blob": "2f5f8ecfac6457171707b1b5ff02b5071954fcb7", + "sha256": "f626b018124747a5f17c1603bea36cd74c00a69a0647fd7b10e9c4e2964caea8" + }, + { + "path": "research/selected-bit-physical-caller/macro_controls.py", + "usage": "input", + "git_blob": "b7c1d28dd47ff463df02ea97b5907a041c05bdde", + "sha256": "a5343faffadfdd9ea0e52d4c7c4ef24ba5e8d2dee86c8af27c094ad78944b845" + }, + { + "path": "research/selected-bit-physical-caller/macro_machine.py", + "usage": "input", + "git_blob": "5a032e8923f7f8b22bb98f3e39b804beb9906c16", + "sha256": "7bc6e42072a09a08ac961e05c3da01cde012d740d4b4c605f298d994f2ad7c5a" + }, + { + "path": "research/selected-bit-physical-caller/numerical_frame.py", + "usage": "input", + "git_blob": "dc92611dd5f131718806fa96470b8f3494e15e2a", + "sha256": "3fd62eda5d0b48bf31ea244708a77afdc6d16cf4fc9439d140ef422a38c7406c" + }, + { + "path": "research/selected-bit-physical-caller/residual_blocks.py", + "usage": "input", + "git_blob": "fba75e7649cf77e352a75324495191bbd7853c22", + "sha256": "ab7f3df8906decd2efecfb138eac1456c106bb520b2598761f699f80680d8331" + }, + { + "path": "research/selected-bit-physical-caller/role_parking.py", + "usage": "input", + "git_blob": "fc48c244eefdbaa3e320e86c75a7d187cb5765ef", + "sha256": "1884a3c260d81d5efbc0c33d86a810d6728e55e5764cfcd423f858cc685470f3" + }, + { + "path": "research/selected-bit-physical-caller/scratch_pool.py", + "usage": "input", + "git_blob": "0f22807c65d1bca374b905538512bf8c43702070", + "sha256": "41f1eb93652b7174c3b02f95f70e1a9ce2e2aed0a729e725167c8f226e65d8db" + }, + { + "path": "research/selected-bit-recursive-closure/PROOF.md", + "usage": "input", + "git_blob": "6c410cab5713979214a45835091fbeb9ee9b8531", + "sha256": "74cc8de20f21acb5123fe2d20996fe0925ea6e51b3dec633bd5221fb719b3344" + }, + { + "path": "research/selected-compiler-visitation-audit/EXPECTED.json", + "usage": "input", + "git_blob": "539f1398a2d9e838f64d67a0fc247365cba56815", + "sha256": "68d9a80dd341f03b4d9d3c674aa9444ba87a81afd68bd66dd88525002fe401a5" + }, + { + "path": "research/selected-compiler-visitation-audit/PROOF.md", + "usage": "input", + "git_blob": "aded424212254b5f6426bff561ecd8f50244e7e6", + "sha256": "f1cbb9df9f21887d7346b0efb6ae74ebb6fc6e31f3bcadbc26ed5249bd0eed52" + }, + { + "path": "research/selected-compiler-visitation-audit/README.md", + "usage": "input", + "git_blob": "0e38b7d90af06186c8c55aad1286068cd5eab210", + "sha256": "a205a33577bc60628f82606c47d3ee471e6e107db552e45e5c4e9466b4863f31" + }, + { + "path": "research/selected-compiler-visitation-audit/SOURCES.json", + "usage": "input", + "git_blob": "9f38b2365b65beccbc1c1c9ce19a78d5749cafa2", + "sha256": "3ff6ae8c4a46592015a22fd9deea8dae4e98763e25e0487468fdaf4471283031" + }, + { + "path": "research/selected-compiler-visitation-audit/TASK.json", + "usage": "input", + "git_blob": "6a9cd6f3594c2c2c04e5afd6a285041ef9a7aa94", + "sha256": "4affad2ebc2f931ce49a6e4c1c21cda75ca4705abdd3e25d7aef088f7a6927c6" + }, + { + "path": "research/selected-compiler-visitation-audit/VALIDATION.md", + "usage": "input", + "git_blob": "645d2d9fdde7e3128a94afdc7b0d479064be69c7", + "sha256": "502fa36ff882449ebb5b547264e07d94c583a39eca58057f5c8c1b0f9e708af8" + }, + { + "path": "research/selected-compiler-visitation-audit/VERIFY.json", + "usage": "input", + "git_blob": "2e34b6ead60a864de6e5c570f03b673c73c792f4", + "sha256": "f3a16adc4d4adaad7f5e0aecf067742e22e752b70e64d9b8c732bb83cbbafac0" + }, + { + "path": "research/selected-compiler-visitation-audit/accounting.py", + "usage": "input", + "git_blob": "1bf40dd97f73f33484ba304bc8a7e57e39388fb2", + "sha256": "109a452dd0d9339b4ef7349afee5c00de7c1b86c0d63aa50e085513a41a7451c" + }, + { + "path": "research/selected-compiler-visitation-audit/export.py", + "usage": "input", + "git_blob": "2f91ec5212d549b40824839eddb070f359c6fbf2", + "sha256": "a26d5edcaf66d46fce43aca81f0080373b4106ca8b4336872216e54a5b24bbce" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/.gitignore", + "usage": "input", + "git_blob": "22c2102f736754a6647018cec314c5ebb40381c4", + "sha256": "36a4c113772dc3e38226e24bdde29021b56a76a34b8f2a0e367928dea8070a8b" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/CERTIFICATE-CONTRACT.md", + "usage": "input", + "git_blob": "0f1524687a7716c4455663fded02e27469a3001d", + "sha256": "96954bede4623d75b623f2fe370e6f333f54363b770d0c096ae52f3fdda8d930" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/CompilerAudit.lean", + "usage": "input", + "git_blob": "0deedadc78aa5d59009ae8d7e9da8408cd30a13c", + "sha256": "3883991717fcfff245e90355439acb8884b3f58a943fc0fd473a037cee213dde" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/CompilerAudit/Composition.lean", + "usage": "input", + "git_blob": "3556912388ee1b7cdedc7a4be976350bd00d6a64", + "sha256": "022caba159e2034d9f09c92145a47caa849c46edeead5766d58a066abf47621f" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/CompilerAudit/Result.lean", + "usage": "input", + "git_blob": "03f90b6e7d3662a008b5654367eb04b088b8e416", + "sha256": "e9499bac894329f28e9fc491ac00fd640f8e25fdf7f80ad5883954ff2bcc15d5" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/CompilerAudit/Retention.lean", + "usage": "input", + "git_blob": "e1d735d52524773f98fd6c63398d52eb38e5bb13", + "sha256": "081a35b411fe31442f727f38ab3dfdda103bd25e0c5950cf2b1733b5f426bbca" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/CompilerAudit/Selected.lean", + "usage": "input", + "git_blob": "2cff84c598a768aabcd3564d2dd474b083d3cca9", + "sha256": "3b77f822e939d2d2cd3b38d92a7b73836a764eaa939aa840711bbbab7f2037e0" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/CompilerAudit/SelectedData.lean", + "usage": "input", + "git_blob": "15609ee0d206c4b3044a2ec5fde877bc373d58be", + "sha256": "7c767cf2d63aab6d46c6a2075c283eeb816781158fce90cfd13eedd1000eda88" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/CompilerAudit/Visit.lean", + "usage": "input", + "git_blob": "1c6d9cb4da59e0f172655857caa34fca09f4b7ce", + "sha256": "9746c2e876bcee27770fd215129cd72fc52003736cf5c088913c99d2ea1bc4d1" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/README.md", + "usage": "input", + "git_blob": "95190aa2c052caedcca3a47d9987bb31e8922451", + "sha256": "44f8b77c9c28f3c3d4d819eae309915874c9d0834b2f37442eecc9335b7a49e1" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/SelectedCensus.json", + "usage": "input", + "git_blob": "401fd1c6ec24f696593894f50b452cea19f9da08", + "sha256": "07844fafe457b69c1b63c61680d130ea3c9166bafa32f313077e4bd734782887" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/check.py", + "usage": "input", + "git_blob": "879a1a20262113460435333c1d8aba472580a5d3", + "sha256": "7f93b2c00db7c65b39359f2361b77c3903bb297817b6b25b6d8b6234d0b56e45" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/extract_census.py", + "usage": "input", + "git_blob": "f4243ac1722ebe1ae70076c23b67735debc553ee", + "sha256": "c4a357cce70481a76dac88bd137ebe7270415c0c2bfe9cb989da10658821902f" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/lake-manifest.json", + "usage": "input", + "git_blob": "d8cd4df77e50e9069dce693b0e3c4ff5d4868a8b", + "sha256": "f0e42d04edd670ffa604a770562c9dc400e21809bb5809a69c2c1cb342fe1579" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/lakefile.toml", + "usage": "input", + "git_blob": "2e525a2ba4635cd421fbcb4e812d11498ab00e5c", + "sha256": "efacc633cf25b8f18df232bc2094a9a76813ad7676a9bf88e2df836891f9995c" + }, + { + "path": "research/selected-compiler-visitation-audit/lean/lean-toolchain", + "usage": "input", + "git_blob": "ba8ebf2dbaf6a668cd2a0e086186d6d569b69ff5", + "sha256": "d5edba4e4b8faad9c1baeadb265716d20d03be4d1a2647dc5e35b0c0325bea7b" + }, + { + "path": "research/selected-compiler-visitation-audit/source_audit.py", + "usage": "input", + "git_blob": "6e63c2adf48751db66d882ca00e8e432259d5a05", + "sha256": "eae67c8818d18fca26ee6e101e03f5c4fac1ef7c035b3d2c7e9707574cc2b959" + }, + { + "path": "research/selected-compiler-visitation-audit/test_accounting.py", + "usage": "input", + "git_blob": "898f471a9722e21a17e2b54b95e822a6b4cb7e17", + "sha256": "7682d2e30a4f2d5f313e902f26d7c310643677693dec8a7749bb301f8b50674f" + }, + { + "path": "research/selected-compiler-visitation-audit/verify.py", + "usage": "input", + "git_blob": "7ab31269598e5f67faf8125e18d17ef4af42c822", + "sha256": "e26b73a6b11b5479f0838e6775f6684c6f6649d8b8b105427c92d2319aece7bc" + }, + { + "path": "research/selected-source-packets/PROOF.md", + "usage": "provenance", + "git_blob": "8f7d9eecd576f55e4aa194e58155ec29dc8893a6", + "sha256": "b5d3c1329570a7ec2aaf793319f07784f3ccf5a4bda8c43ee43ad65b972cbd53" + }, + { + "path": "research/selected-source-packets/README.md", + "usage": "provenance", + "git_blob": "a623e81257247b4628d863872917bc210b72233d", + "sha256": "9e5df87184bed8e836a95c5b94a68b7a4dde813d0e75c4a6a8f1c41ba2fcd51d" + }, + { + "path": "upstream/LICENSE", + "usage": "input", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "path": "upstream/build/sections/02-streams.tex", + "usage": "input", + "git_blob": "088fceea1867abc76271d7efe7532b779fee9039", + "sha256": "606c80db61cad13aa0c3b6060dc4b88dbbe7ac60cdd831aa93f28d908fd09dab" + }, + { + "path": "upstream/manifest.json", + "usage": "input", + "git_blob": "01c309e34d36cf3669c43d89c5dfb25cdc31b8af", + "sha256": "16ab13971694cabab09440c47ebf2fc0496a9d35fc3af33950fda3498f8e2392" + } + ] +} diff --git a/research/selected-compiler-source-bridge/TASK.json b/research/selected-compiler-source-bridge/TASK.json new file mode 100644 index 0000000000..bdffaf4600 --- /dev/null +++ b/research/selected-compiler-source-bridge/TASK.json @@ -0,0 +1,109 @@ +{ + "schema_version": 1, + "task_id": "selected-stock-envelope", + "priority_revision": 6, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "original_card": { + "id": "selected-stock-envelope", + "question": "What explicit uniform stock envelope does the actual selected stopped producer supply at one bootstrap stage?", + "starting_points": [ + "research/selected-bootstrap-stock-audit/README.md", + "research/bootstrap-cutoff-time-space-split/README.md", + "certificates/selected-result.json", + "docs/research/community-efficient1000-review.md", + "research/stock-margin-chain/README.md" + ], + "methods": [ + "Derive a source-bound reserve recurrence at the actual selected atom widths, separating parent stock from completed inner borrowing.", + "Find an exact missing implication or counterexample to a proposed selected-stage stock envelope." + ], + "acceptance_gate": "Bind every coefficient and depth factor to the selected producer and state the width domain. Compare a proved envelope with the sufficient cutoff guard; a large numerical headroom or a historical m=120 coefficient is not a selected m=73 proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #2972 stock-margin chain and the selected stock audit. The new source archive reports the remaining cutoff comparisons, but leaves every actual stock coefficient unresolved; it is not an independently validated reserve envelope.", + "scope": "Source-bound orientation only. Read the named package and review before relying on its local evidence; this command is not its replay or supplier admission." + }, + "first_experiment": "Choose one actual selected producer/stage and derive its parent reserve and depth coefficient from source. Check whether newer handoffs already cover that exact obligation. Stop with the missing implementation lemma if it cannot be bounded; do not rerun #2972 cutoff/headroom arithmetic as a new contribution.", + "bottleneck_link": "This reduces a concrete inherited implementation obligation without confusing unchanged kappa arithmetic with a completed theorem.", + "allowed_variations": [ + "One stage or one explicit reserve/depth implication.", + "An independently checked same-domain proof repair, retaining all remaining assumptions." + ], + "scope_change_triggers": [ + "Importing the historical 57604 or 252 allowance without a selected-producer binding.", + "Calling a conditional fit lemma a full outer-proof adoption.", + "Replacing an actual selected stock coefficient with cutoff comparisons or a conditional fit inequality." + ], + "overlap_terms": [ + "selected stock", + "stock envelope", + "bootstrap cutoff", + "1956", + "1965", + "1990", + "2972", + "stock-margin-chain", + "actual_stock_coefficient" + ], + "existing_checks": [ + { + "scope": "Retained stock audit identifies missing actual selected-stage coefficients; later cutoff-chain arithmetic does not supply them.", + "evidence": "docs/research/research-family-status.md#revision-6-handoffs-source-archives-awaiting-independent-validation", + "remaining": "Derive one actual reserve/depth coefficient from the selected producer.", + "status": "reviewed", + "source_commit": "836b19bfa309ceafbc8ee32a15e8c4b10dde7e11", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "A successor verification package for PR3391: conditional Lean transport from primitive source-shaped premises, independent bounded census and wrapper-lifetime checks, exact CPython representability bound, and portable source-bound replay.", + "scope_change_reason": "Explicit continuation of PR3391, not a rerolled stock-envelope task. The result closes a model-correspondence lemma and verification gaps; it does not supply the selected producer stock coefficient.", + "bottleneck_link": "Makes the distinction between cached keys, fresh wrappers, and direct references reviewable before any selected implementation or stock invoice. It preserves the existing selected frontier and inherited obligations.", + "budget_minutes": 60, + "stop_rule": "Stop at the existing verified conditional bridge and bounded independent checks. No GL64 enumeration, new compiler, native/stock tariff, historical full suite, or LOW inverse research in this package.", + "outcome": "completed", + "evidence": "CONTRACT.md, OBLIGATIONS.json, VALIDATION.md and the explicit standard-library and opt-in Lean replay commands in README.md.", + "author": "PellaML", + "ai_assistance": "Substantial OpenAI Codex assistance in proof, implementation, integration and writing; GPT 6 Astra and Claude Opus 5.5 agents supplied separated source checks and cross-review. AI cross-review is not independent human certification; executed Lean checks are reported separately.", + "open_questions": [ + { + "question": "Can PR2569's retained written LOW inverse argument be bound to the actual selected codec in Lean?", + "why_it_matters": "The bridge retains rank(unrank(o))=o as a primitive premise. A prior written argument for byte-identical source exists; this package does not discharge implementation-level formal correctness.", + "first_step": "Audit the retained prefix-count induction against low_codes.py, then check live overlap before formalizing validity and inverse invariants.", + "blocked_by": "No implementation-level GL64 codec theorem is formalized or independently replayed by this package." + }, + { + "question": "Can a realizable lazy or regional representation preserve the source trace and the identity-sensitive consumers?", + "why_it_matters": "The literal complete selected Python list/tuple representation cannot fit conventional CPython length bounds, even though the idealized word is finite.", + "first_step": "Specify a prefix/consumer contract, including Machine.geometry and wrapper identity observations, and test one bounded trace without changing the selected compiler.", + "blocked_by": "No lazy representation refinement, prefix theorem or native/stock cost translation is included." + }, + { + "question": "Can equal-key wrappers share identity under a stated observer contract?", + "why_it_matters": "Cached plans do not establish that reusing Residual identities preserves Machine.geometry and other identity-sensitive observations.", + "first_step": "Audit identity-sensitive consumers and define a bounded trace-observer contract before experimenting with sharing.", + "blocked_by": "No sharing refinement is proved or compiler representation changed here." + } + ], + "selected_result_unchanged": true, + "predecessor": { + "pr": "https://github.com/CrocSwap/integer-mult-bounds/pull/3391", + "publication_commit": "eb89e7a7884ccacb82b5d5120d7f83be269748c0", + "scientific_base": "463113d675af7410ac91d53a4fed51ec6494eb9a", + "status": "archived; partially_reviewed; not scientific admission" + }, + "upstream_checkpoint": { + "commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "priority_revision": 6, + "utc": "2026-10-18T12:34:21.024412+00:00", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "coverage": "Fresh complete metadata pagination: 351 open PRs, 2964 closed/merged PRs, 2456 discussion records. Scoped discussions and predecessor heads checked; broad changed-file refresh timed out, closing #1166 reread limited to its latest 100 comments plus exact destinations. No novelty guarantee. See VALIDATION.md." + }, + "formal_verification_scope": "Idealized source-shaped transport under primitive correspondence, LOW inverse, block-budget and identity-freshness premises; not operational Python semantics, actual GL64 codec correctness or the full multiplication theorem." +} diff --git a/research/selected-compiler-source-bridge/VALIDATION.md b/research/selected-compiler-source-bridge/VALIDATION.md new file mode 100644 index 0000000000..dd4e9b37c0 --- /dev/null +++ b/research/selected-compiler-source-bridge/VALIDATION.md @@ -0,0 +1,147 @@ +# Validation and reproducibility boundary + +## Result and exact scope + +Author checks on **18 October 2026**, Windows x86-64, CPython **3.12.6**, passed +for the candidate described here. The PR identifies the published commit and +its committed-byte/export recheck. This is local executed evidence, not a +hosted-CI pass, independent human certification or maintainer admission. + +| Check | Observed result | +|---|---| +| Registered metadata and source pins | Pass; 152 live inputs, plus three historical-provenance rows | +| Bounded Python checks | Pass normally and with `-O`; complete substantive result trees agree after excluding only elapsed time and interpreter-version fields | +| New Python controls | 9 replay/inventory test methods, 30 census/import/lifetime test methods, 7 capacity test methods; all pass in both modes | +| Original PR3391 receipt | Unchanged scientific SHA-256 `c1bc50f54937cd3b2efae61bb5b655b55859b3ed7ddcf1a2e9bbd8682fc88f3d` in both modes | +| Selected interval certificate | Fresh `extract_census.py --check` passes; retained JSON and generated Lean data unchanged | +| Independent census | q = 3, all 32 replicas, 7,843,392 local events, 28,278 request IDs, 19 groups including the empty group; 904,896 projected visits per LOW | +| Tiny original compiler census | 48 visits, 24 keys, multiplicity two; exact order and empty checkpoint checked | +| Tiny original lifetime fixture | Per compilation: T = 16, B = 32, 64 direct references, 16 distinct wrappers; separate warm-cache compilations and weak-reference lifetimes checked | +| Capacity arithmetic | `bit_length(|GL64(F3)|) = 6492`; `bit_length(2T) = 6512`; `2T > 2^6500`, beyond conventional CPython sequence limits | +| Lean runner unit tests | 17 methods pass normally and with `-O`; no Lean execution in these tests | +| Fresh Lean compile | Seven unchanged PR3391 modules and `CompilerAudit.SourceBridge` compile into one fresh external build root | +| Lean contracts | Exact bridge statement and baseline main contract checked; all 27 required bridge theorem axiom reports accepted, with no missing/duplicate/extra names | +| Kernel replay | `leanchecker --verbose CompilerAudit.SourceBridge` succeeds and reports exactly that leaf module | +| Lean controls | Concrete positive contract passes; duplicate-wrapper/freshness counterexample and wrong retained coefficient are rejected at their intended obligations | + +The independent Python implementation does not import PR3391's accounting, +source-audit, verifier or census implementation. The orchestration command also +runs the original verifier separately to check preservation of its receipt. +Those are distinct checks, not two names for one implementation. + +## Lean source and environment binding + +Candidate `lean/CompilerAudit/SourceBridge.lean` SHA-256: + +```text +cb7ce5a50357fe01d4e9bf0a6c65d8767e431d3124d3e14d06e90f0bd46c38fa +``` + +Prior locally checked source: `6027af1a083bbca309f406762dc7526e11aac6f4c4cdb90d9aa7427ad04182f9`. +Only the opening explanatory comment changed. The bytes after that comment +are identical; both comment-stripped formal texts hash to +`d1900d991547da0aa0c2f6b380ec2a60707d66907c36c39dca7eb4e3602f760a`. +The fresh candidate run, not merely the prior run, passed. + +- Lean **4.34.1**, compiler commit `5045d0056413266e57c625dcd7c365b10e377c52`. +- mathlib `d13f23b723b8a846827a245b89c10fc7d3f11612`; all nine source revisions + in the unchanged predecessor `lake-manifest.json` are checked, with clean + tracked dependency checkouts. Eight library roots are used; `Cli` is tooling-only. +- The checker selects real toolchain binaries, records their hashes, rejects + identical elan-shim proxies, and constructs a fresh environment and explicit + `LEAN_PATH`. It rejects reserved or conflicting module roots. Existing + `CompilerAudit` object files are not reused. +- The 27 theorem reports contain only `propext`, `Classical.choice` and + `Quot.sound`. The parser has missing, duplicate, extra-name and foreign-axiom + controls, including names containing apostrophes. +- The explicit leaf-module replay checks the bridge's own declarations. + Predecessor modules are freshly compiled, but their separate historical leaf + replays are **not** all repeated. Imported libraries are trusted cached + artifacts: their binary-to-source correspondence is **not** established by + a cold rebuild or by the path-and-size inventory. The same Lean kernel is used. + +## Commands and publication gate + +From a checkout with the committed source history: + +```sh +python -B scripts/research_package.py --package research/selected-compiler-source-bridge --check-only +python -B scripts/research_package.py --package research/selected-compiler-source-bridge +python -I -B research/selected-compiler-source-bridge/lean/tests/test_check.py +python -I -B -O research/selected-compiler-source-bridge/lean/tests/test_check.py +python -I -B research/selected-compiler-source-bridge/lean/check.py --output FRESH_ABSOLUTE_OUTPUT --toolchain TOOLCHAIN_ROOT --packages PACKAGES_ROOT --timeout 180 +``` + +The generic registered command runs Python only. The Lean command is separate, +serial and explicit; it performs no installation or download. Its output +contains `PREFLIGHT.json`, `RUNS.json`, `RESULT.json` and per-command diagnostics. +A preflight-only run is not a proof check. + +Publication is gated on committed-byte/source-history checks and the shared +exporter's checked bundle, followed by replay from a fresh Git-free extraction: + +```sh +python -B scripts/check_research_commit.py --package research/selected-compiler-source-bridge --ref HEAD --check-source-history +python -B scripts/export_research_package.py export --package research/selected-compiler-source-bridge --ref HEAD --output FRESH_ABSOLUTE_TAR +python -B scripts/export_research_package.py check FRESH_ABSOLUTE_TAR +# After extracting the checked bundle into a fresh directory, run there: +python -I -B research/selected-compiler-source-bridge/verify.py +python -I -B -O research/selected-compiler-source-bridge/verify.py +``` + +The extracted direct verifier requires `.research-export.json` when there is no +Git checkout and checks its exact file inventory, sizes and hashes before and +after execution. The shared archive check additionally checks tar modes. This +unsigned manifest is transport integrity, not authenticated provenance. Obtain +the commit or archive through a trusted channel. The declared inputs include +all 61 lifetime-allowlist files, including `scratch_pool.py`, rather than just +the older census's 121-input closure. No agent scratch directories or compiled +Lean objects are shipped. + +A Windows read-only temporary Git object caused the first runner-unit teardown +to fail. Cleanup was corrected and both unit-test modes were rerun successfully. +This was a harness-cleanup error, not a failed Lean theorem. No formal proof +text or frozen predecessor files were altered to make a check pass. + +## Coordination and prior coverage + +Canonical main was refreshed at `20ecf2891d80b5acf18d980b2164fb44ea7faa90`. +Priority revision 6 and selected conditional κ = 0.001672660197076918 are unchanged. +The 18 October overlap pass covered complete metadata pagination for 351 open +PRs, 2,964 closed/merged PRs and 2,456 discussion records (not 2,456 threads). +The entry reads of #1163, #1166 and #2319 were complete. Closing #1163/#2319 +reads were complete; closing #1166 coverage was its latest 100 comments plus +exact destination rechecks after an older-page request failed. Broad open-PR +changed-path refresh timed out; seven targeted file inventories succeeded. +No duplicate successor was found within that coverage, not as a novelty guarantee. +Relevant heads and the original finding are rechecked before publication. + +The read of Jose Manuel's [PR2569](https://github.com/CrocSwap/integer-mult-bounds/pull/2569) +found an existing written prefix-count/bijection proof for byte-identical LOW +codec source. Its README reports finite GL2/GL3 checks and six GL64 ordinals; +those predecessor tests were **not rerun here**. The remaining task is formal +implementation-level correspondence, not rediscovering an absent written proof. +The source refinements in #2989/#3041/#3223 and parallel shared-checker work +#3602/#3634 are credited in the README; they are not silently imported as proof +premises or superseded by this package. + +PR3391 remains **archived / partially reviewed**. Its linked hosted workflow +ended `failure` with **zero jobs and zero check runs**; that was neither an +executed scientific-test failure nor a hosted pass. The successor does not +change the ledger or selected frontier. The selected-wide orientation helper +was not completed in this scoped sparse checkout because unrelated supplier +packages were absent; no selected-wide or native replay is claimed. + +## Remaining limitations + +The theorem is a manually modelled, idealized/unbounded trace transport, under +primitive correspondence, LOW inverse, budget-alignment and freshness premises. +The original-source fixtures are bounded and seeded, not successful cold GL64 +initialization or selected numerical endpoint tests. The Windows census adapter +changes one authenticated inventory-path spelling expression only; the lifetime +importer separately bypasses loader bootstrap after source-only hash checks. + +Neither the capacity argument nor the Python operational semantics is formalized +by this Lean bridge. There is no actual GL64 inverse proof here, prefix/resource +feasibility theorem, wrapper-sharing refinement, native/stock/precision invoice, +full multiplication theorem, selected κ change, or independent human approval. diff --git a/research/selected-compiler-source-bridge/VERIFY.json b/research/selected-compiler-source-bridge/VERIFY.json new file mode 100644 index 0000000000..79e42571c7 --- /dev/null +++ b/research/selected-compiler-source-bridge/VERIFY.json @@ -0,0 +1,189 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "LICENSE", + "NOTICE", + "certificates/selected-result.json", + "research/community-hyperplane599-audit/pr589/bit589/v9/hosted/GLOBAL-TEMPLATE.json.gz", + "research/community-hyperplane599-audit/pr589/bit589/v9/nine/GEOMETRY.json", + "research/e8-bit-p111-tuned/tune/EXPECTED.json", + "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz", + "research/pr589-five-helper-hosting/PROOF.md", + "research/pr589-five-helper-hosting/verify.py", + "research/recursive-parking-boundary/README.md", + "research/selected-bit-local-ring-sweeps/PROOF.md", + "research/selected-bit-physical-caller/PROOF.md", + "research/selected-bit-physical-caller/README.md", + "research/selected-bit-physical-caller/SNAPSHOTS.json", + "research/selected-bit-physical-caller/inputs/pr2753/EVIDENCE.json", + "research/selected-bit-physical-caller/inputs/pr2753/PREDECESSOR.json", + "research/selected-bit-physical-caller/inputs/pr2753/PROOF.md", + "research/selected-bit-physical-caller/inputs/pr2753/README.md", + "research/selected-bit-physical-caller/inputs/pr2753/RESULT.json", + "research/selected-bit-physical-caller/inputs/pr2753/SOURCES.json", + "research/selected-bit-physical-caller/inputs/pr2753/TASK.json", + "research/selected-bit-physical-caller/inputs/pr2753/VALIDATION.md", + "research/selected-bit-physical-caller/inputs/pr2753/VERIFY.json", + "research/selected-bit-physical-caller/inputs/pr2753/bootstrap.py", + "research/selected-bit-physical-caller/inputs/pr2753/check_layout.py", + "research/selected-bit-physical-caller/inputs/pr2753/check_nested_model.py", + "research/selected-bit-physical-caller/inputs/pr2753/check_recursion.py", + "research/selected-bit-physical-caller/inputs/pr2753/check_runtime.py", + "research/selected-bit-physical-caller/inputs/pr2753/check_sign.py", + "research/selected-bit-physical-caller/inputs/pr2753/check_sources.py", + "research/selected-bit-physical-caller/inputs/pr2753/consumer.py", + "research/selected-bit-physical-caller/inputs/pr2753/control_checks.py", + "research/selected-bit-physical-caller/inputs/pr2753/driver.py", + "research/selected-bit-physical-caller/inputs/pr2753/evidence/NOTICE.md", + "research/selected-bit-physical-caller/inputs/pr2753/evidence/pr2688-NOTICE.md", + "research/selected-bit-physical-caller/inputs/pr2753/evidence/pr2688-PROOF.md", + "research/selected-bit-physical-caller/inputs/pr2753/evidence/pr2708-README.md", + "research/selected-bit-physical-caller/inputs/pr2753/evidence/pr2731-README.md", + "research/selected-bit-physical-caller/inputs/pr2753/layout.py", + "research/selected-bit-physical-caller/inputs/pr2753/linear_sign.py", + "research/selected-bit-physical-caller/inputs/pr2753/node.py", + "research/selected-bit-physical-caller/inputs/pr2753/packet_engine.py", + "research/selected-bit-physical-caller/inputs/pr2753/peel.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/NOTICE.md", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/PROOF.md", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/README.md", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/RESULT.json", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/SOURCES.json", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/TASK.json", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/VERIFY.json", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/cardinal_counts.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/catalogue.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/check_headers.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/check_layout.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/check_runtime.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/check_sources.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/consumer.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/control.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/control_checks.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/driver.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/fresh_rows.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/layout.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/model.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/node.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/packet_engine.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/peel.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/topology.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/binding.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/bitstream.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/cardinality.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/check_support.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/children.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/controller.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/counts.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/directory.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/episode.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/forms.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/low_codes.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/matrices.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/numeric.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/oracle.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/packet.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/plan.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/records.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/residual.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/routes.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/selection.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/sources.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/stream.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/stream_runner.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/trace.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/vendor/words.py", + "research/selected-bit-physical-caller/inputs/pr2753/predecessor/verify.py", + "research/selected-bit-physical-caller/inputs/pr2753/recursive_call.py", + "research/selected-bit-physical-caller/inputs/pr2753/scheduler.py", + "research/selected-bit-physical-caller/inputs/pr2753/stream_runner.py", + "research/selected-bit-physical-caller/inputs/pr2753/trace.py", + "research/selected-bit-physical-caller/inputs/pr2753/verify.py", + "research/selected-bit-physical-caller/inputs/pr2769/NOTICE.md", + "research/selected-bit-physical-caller/inputs/pr2769/PROOF.md", + "research/selected-bit-physical-caller/inputs/pr2769/README.md", + "research/selected-bit-physical-caller/inputs/pr2769/RESULT.json", + "research/selected-bit-physical-caller/inputs/pr2769/SOURCES.json", + "research/selected-bit-physical-caller/inputs/pr2769/TASK.json", + "research/selected-bit-physical-caller/inputs/pr2769/VERIFY.json", + "research/selected-bit-physical-caller/inputs/pr2769/checks.py", + "research/selected-bit-physical-caller/inputs/pr2769/codec.py", + "research/selected-bit-physical-caller/inputs/pr2769/vendor/parking_machine.py", + "research/selected-bit-physical-caller/inputs/pr2769/vendor/pr2753_recursive_call.py", + "research/selected-bit-physical-caller/inputs/pr2769/vendor/words.py", + "research/selected-bit-physical-caller/inputs/pr2769/verify.py", + "research/selected-bit-physical-caller/loader.py", + "research/selected-bit-physical-caller/macro_binding.py", + "research/selected-bit-physical-caller/macro_code.py", + "research/selected-bit-physical-caller/macro_controls.py", + "research/selected-bit-physical-caller/macro_machine.py", + "research/selected-bit-physical-caller/numerical_frame.py", + "research/selected-bit-physical-caller/residual_blocks.py", + "research/selected-bit-physical-caller/role_parking.py", + "research/selected-bit-physical-caller/scratch_pool.py", + "research/selected-bit-recursive-closure/PROOF.md", + "research/selected-compiler-visitation-audit/EXPECTED.json", + "research/selected-compiler-visitation-audit/PROOF.md", + "research/selected-compiler-visitation-audit/README.md", + "research/selected-compiler-visitation-audit/SOURCES.json", + "research/selected-compiler-visitation-audit/TASK.json", + "research/selected-compiler-visitation-audit/VALIDATION.md", + "research/selected-compiler-visitation-audit/VERIFY.json", + "research/selected-compiler-visitation-audit/accounting.py", + "research/selected-compiler-visitation-audit/export.py", + "research/selected-compiler-visitation-audit/lean/.gitignore", + "research/selected-compiler-visitation-audit/lean/CERTIFICATE-CONTRACT.md", + "research/selected-compiler-visitation-audit/lean/CompilerAudit.lean", + "research/selected-compiler-visitation-audit/lean/CompilerAudit/Composition.lean", + "research/selected-compiler-visitation-audit/lean/CompilerAudit/Result.lean", + "research/selected-compiler-visitation-audit/lean/CompilerAudit/Retention.lean", + "research/selected-compiler-visitation-audit/lean/CompilerAudit/Selected.lean", + "research/selected-compiler-visitation-audit/lean/CompilerAudit/SelectedData.lean", + "research/selected-compiler-visitation-audit/lean/CompilerAudit/Visit.lean", + "research/selected-compiler-visitation-audit/lean/README.md", + "research/selected-compiler-visitation-audit/lean/SelectedCensus.json", + "research/selected-compiler-visitation-audit/lean/check.py", + "research/selected-compiler-visitation-audit/lean/extract_census.py", + "research/selected-compiler-visitation-audit/lean/lake-manifest.json", + "research/selected-compiler-visitation-audit/lean/lakefile.toml", + "research/selected-compiler-visitation-audit/lean/lean-toolchain", + "research/selected-compiler-visitation-audit/source_audit.py", + "research/selected-compiler-visitation-audit/test_accounting.py", + "research/selected-compiler-visitation-audit/verify.py", + "upstream/LICENSE", + "upstream/build/sections/02-streams.tex", + "upstream/manifest.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 240, + "checks": "Bounded source census, original wrapper identity/lifetime fixtures, arithmetic capacity bound, input rejection controls and unchanged predecessor scientific receipt; no Lean invocation." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "-O", + "{package}/verify.py" + ], + "timeout_seconds": 240, + "checks": "Same bounded source checks and rejecting controls with Python assertions disabled; no Lean invocation." + } + ], + "optional_lean_replay": { + "command": "python research/selected-compiler-source-bridge/lean/check.py --output FRESH_ABSOLUTE_OUTPUT --toolchain PINNED_TOOLCHAIN_ROOT --packages PINNED_PACKAGES_ROOT", + "automatic": false, + "dependency_lock": "research/selected-compiler-visitation-audit/lean/lake-manifest.json", + "scope": "Fresh compile of seven predecessor modules and the conditional bridge, exact type/axiom checks and explicit single-leaf replay; cached dependencies, not a cold library rebuild." + } +} diff --git a/research/selected-compiler-source-bridge/capacity.py b/research/selected-compiler-source-bridge/capacity.py new file mode 100644 index 0000000000..9a0cad7985 --- /dev/null +++ b/research/selected-compiler-source-bridge/capacity.py @@ -0,0 +1,137 @@ +#!/usr/bin/env python3 +"""Arithmetic-only CPython capacity obstruction; never enumerate GL64. + +Adapted from the verified Claude Opus 5.5 cpython_representability.py review, +with substantial OpenAI Codex assistance. Apache-2.0. Source/compiler credit +remains with Jose Manuel (jmbarrancoml), David Arias and the retained source +contributors. The independent Astra census supplies a separate source-link +check, not a dependency of this arithmetic module. + +This script does NOT import/read the compiler or authenticate its semantics. +The conditional source premises below must be established separately against +pinned bytes. It does not predict a first exception, first allocation failure, +or a feasible partial-run length. There is no GL64, numerical or Lean replay. + +For q >= 3 and 0 <= k < 64, + q**64 - q**k = q**k * (q**(64-k) - 1). +Both factors on the right are positive and nondecreasing in q; the second is +strictly increasing (64-k >= 1). Hence every product factor is strictly +increasing, and so N(q) >= N(3). This proves the comparison for ALL integer +q >= 3, thus for every accepted prime q >= 3, not just two sampled primes. +""" +import argparse +import json +import math +import platform +import struct +import sys + +RHO, R, DIMENSION = 32, 28278, 64 +Q_MIN = 3 +MAX_Q_BITS = 32 # execution guard only; the monotonic proof has no q upper bound +CALLER = "research/selected-bit-physical-caller" +SOURCE_PREMISES = { + "checked_by_this_script": False, + "files": [CALLER + "/macro_code.py", + CALLER + "/inputs/pr2753/predecessor/vendor/low_codes.py"], + "premises": [ + "Accepted LOW field size is a prime q >= 3, with N(q) = product(q**64 - q**k, k=0..63).", + "The independently source-linked abstract visitation count is T = 32 * 28278 * N(q).", + "The unchanged eager compile_node retains one operations list; each residual return appends a begin and an end.", + "A complete successful return builds Code(tuple(operations), staged); both sequence lengths are at least 2*T.", + "On conventional 32/64-bit CPython, list/tuple lengths cannot exceed Py_ssize_t's maximum 2**31-1 / 2**63-1." + ], + "conditional_conclusion": "Those premises exclude a complete successful eager selected compile_node return on conventional 32/64-bit CPython.", + "first_failure_determined": False, + "earlier_failures": "Allocation, size, LOW-unranking or other checks may fail earlier; no failure order is established.", + "unaffected": "Conditional census/lifetime formulas, idealized unbounded semantics and abstract Lean counting claims are not falsified; no claim about lazy/regional compilation." +} + + +class Rejected(ValueError): + pass + + +def need(ok, message): + if not ok: + raise Rejected(message) + + +def gl_order(q, dimension=DIMENSION): + """Exact arithmetic product, not a primality test or matrix enumerator. + + The finite-field interpretation needs q to be a prime power. The proof + uses accepted prime q >= 3; this helper also permits small composite q + solely for arithmetic tests. Guards bound executed integer arithmetic. + """ + need(type(q) is int and 2 <= q and q.bit_length() <= MAX_Q_BITS, "bounded integer q >= 2") + need(type(dimension) is int and 1 <= dimension <= DIMENSION, "dimension in 1..64") + return math.prod(q**dimension - q**k for k in range(dimension)) + + +def factor_monotonicity(): + """A quantified algebraic argument, not a finite sampling certificate.""" + return { + "domain": "integers b >= a >= 3, 0 <= k < 64 (hence accepted primes)", + "factorization": "q**64 - q**k = q**k * (q**(64-k) - 1)", + "positive_factors": "q**k >= 1 and q**(64-k) - 1 >= 2", + "comparison": "b**k >= a**k > 0 and b**(64-k)-1 >= a**(64-k)-1 > 0; multiply these inequalities, then multiply over k", + "strictness": "For b > a, the second factor is strictly larger for every k because 64-k >= 1, including k=0", + "conclusion": "N(q) >= N(3) for every integer q >= 3; no primality enumeration or sampled-q inference", + "formal_verification": False + } + + +def build_report(): + n3 = gl_order(Q_MIN) + lower = (Q_MIN**64 - Q_MIN**63) ** 64 # = (2 * 3**63)**64 + t = RHO * R * n3 + minimum = 2 * t # lower bound only; other retained operations add entries + try: + len(range(n3)) + len_range_ok = True + except OverflowError: + len_range_ok = False + # Two ordinal integers only, not any GL64 matrices or LOW unranking. + iterator = iter(range(n3)) + range_iterates = [next(iterator), next(iterator)] == [0, 1] + conventional = {"32-bit 2**31-1": minimum > 2**31 - 1, + "64-bit 2**63-1": minimum > 2**63 - 1} + arithmetic_ok = (n3 >= lower and minimum > 2**6500 and all(conventional.values())) + return { + "status": "PASS" if arithmetic_ok else "FAIL", + "python": sys.version.split()[0], "implementation": platform.python_implementation(), + "pointer_bytes": struct.calcsize("P"), "sys_maxsize": sys.maxsize, + "sys_maxsize_bit_length": sys.maxsize.bit_length(), + "q": Q_MIN, "dimension": DIMENSION, "replicas": RHO, "requests": R, + "visits_coefficient_of_N": RHO * R, "min_len_coefficient_of_N": 2 * RHO * R, + # Decimal strings preserve exact values even in JSON consumers using floats. + "N_GL64_F3_exact_decimal": str(n3), "T_exact_decimal": str(t), + "min_len_2T_exact_decimal": str(minimum), + "N_GL64_F3_decimal_digits": len(str(n3)), "N_GL64_F3_bit_length": n3.bit_length(), + "N3_ge_closed_form_lower": n3 >= lower, + "closed_form_lower": "(2 * 3**63)**64", + "monotonic_factor_argument": factor_monotonicity(), + "T_bit_length": t.bit_length(), "min_len_2T_bit_length": minimum.bit_length(), + "min_len_gt_2_pow_6500": minimum > 2**6500, + "min_len_gt_sys_maxsize": minimum > sys.maxsize, + "N_alone_gt_sys_maxsize": n3 > sys.maxsize, + "min_len_gt_conventional": conventional, + "illustration_len_range_N_representable": len_range_ok, + "illustration_range_N_iterates": range_iterates, + "range_illustration_scope": "Only two ordinal integers are advanced. len(range(N)) is not an operation asserted to occur in the selected loop, and is not a first-failure claim.", + "source_semantics": SOURCE_PREMISES, + "scope": "Arithmetic tests only. Conditional on the separately authenticated source semantics, a complete successful eager selected compilation cannot fit conventional 32/64-bit CPython lengths. No source execution, numerical verification, or first-failure determination.", + } + + +def main(argv=None): + parser = argparse.ArgumentParser(description=__doc__) + parser.parse_args(argv) # fixed q=3 witness; no user-controlled huge execution + report = build_report() + print(json.dumps(report, indent=2, sort_keys=True)) + return 0 if report["status"] == "PASS" else 1 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/research/selected-compiler-source-bridge/independent_census.py b/research/selected-compiler-source-bridge/independent_census.py new file mode 100644 index 0000000000..e9e7fdc7b9 --- /dev/null +++ b/research/selected-compiler-source-bridge/independent_census.py @@ -0,0 +1,583 @@ +#!/usr/bin/env python3 +"""Independent PR3391 ordered-key review. stdlib only; never expands GL64. + +Adapted from the verified Astra census worker; substantial OpenAI Codex +assistance. Apache-2.0. Source credit: Jose Manuel (jmbarrancoml), David Arias, +ywz65, Nick Petalas and the retained source/NOTICE contributors. The archived +PR3391 visitation audit by Kewin Talaga and its independent reviewers retain +their attribution. + +--source is for the parent's SERIAL bounded run, not the worker's self-test. +No audit accounting/source_audit/verify/extract_census modules are imported. +Source execution is restricted to predecessor authentication, q=3 metadata, +LocalState, and original compile_node on an explicitly synthetic GL2 fixture. +""" +import argparse +from collections import Counter, defaultdict +from dataclasses import dataclass +from hashlib import sha1, sha256 +import gzip +import importlib +import importlib.abc +import importlib.util +import json +import os +from pathlib import Path, PurePosixPath, PureWindowsPath +import subprocess +import sys +import time +import types + +HERE = Path(__file__).resolve().parent +DEFAULT_ROOT = HERE.parents[1] +AUDIT = 'research/selected-compiler-visitation-audit' +CALLER = 'research/selected-bit-physical-caller' +HOST = 'research/community-hyperplane599-audit/pr589/bit589/v9/hosted/GLOBAL-TEMPLATE.json.gz' +CLAIM_SIZES = [2920,2920,222,2920,222,2920,222,2920,222,2920,222,2920,222,2920,2920,222,222,222,0] + +class Rejected(ValueError): + pass + +def require(ok, message): + if not ok: + raise Rejected(message) + +def integer(x): + return type(x) is int + +def digest_ids(ids): + return sha256(json.dumps(list(ids), separators=(',', ':')).encode()).hexdigest() + +@dataclass(frozen=True) +class Group: + schedule_index: int + kind: str + ids: tuple + + @property + def common(self): + return self.kind == 'local_cover_sweep' + + +def partition(groups, request_count): + require(integer(request_count) and request_count >= 0, 'request_count integer') + require(all(g.kind in ('local_cover_sweep','idle') for g in groups), 'closed group kinds') + positions = [g.schedule_index for g in groups] + require(all(integer(p) and p >= 0 for p in positions), 'schedule index integer') + require(positions == sorted(set(positions)), 'strict chronological group positions') + ids = [i for g in groups for i in g.ids] + require(all(integer(i) and 0 <= i < request_count for i in ids), 'request id range/type') + require(len(ids) == len(set(ids)), 'duplicate request within/across groups') + require(set(ids) == set(range(request_count)), 'request coverage gap') + + +def visit_at(groups, replicas, lows, ordinal): + """Mixed-radix decoder, independent of emitter's nested loops. + + Return (group-index, replica-index, request-id, common-view, LOW-token). + LOW tokens are only supplied finite symbols; not GL64 elements. + """ + require(integer(replicas) and replicas > 0, 'positive replica count') + require(len(lows) > 0 and len(set(lows)) == len(lows), 'nonempty unique LOW symbols') + require(integer(ordinal) and ordinal >= 0, 'ordinal range') + for j,g in enumerate(groups): + block = len(g.ids)*len(lows) + extent = replicas*block + if ordinal >= extent: + ordinal -= extent + continue + replica, inner = divmod(ordinal, block) + if g.common: + low_index, id_index = divmod(inner, len(g.ids)) + else: + id_index, low_index = divmod(inner, len(lows)) + return j,replica,g.ids[id_index],g.common,lows[low_index] + raise Rejected('ordinal past end') + + +def projected_word(groups, replicas, lows): + total = replicas*len(lows)*sum(len(g.ids) for g in groups) + return [visit_at(groups, replicas, lows, i) for i in range(total)] + + +def check_word(groups, replicas, lows, observed): + expected = projected_word(groups, replicas, lows) + require(len(observed) == len(expected), 'visit length mismatch') + for index,(a,b) in enumerate(zip(observed, expected)): + # Python bool/int equality must not erase view/type distinctions. + require(type(a[3]) is bool and a == b, + f'ordered visit mismatch at {index}: observed {a!r}, expected {b!r}') + by_key = Counter((r,c,l) for _,_,r,c,l in observed) + require(len(by_key) == sum(len(g.ids) for g in groups)*len(lows), 'distinct key census') + require(set(by_key.values()) == {replicas}, 'per-key replica multiplicity') + return {'visits':len(observed), 'distinct_keys':len(by_key), 'multiplicity':replicas} + + +def interval_data(data, actual=None): + """DATA-only check unless independently derived actual groups are supplied.""" + require(integer(data['request_count']) and integer(data['replica_count']), 'certificate integer types') + require(data['replica_count'] > 0, 'certificate positive replicas') + groups=[] + for j,row in enumerate(data['groups']): + for k in ('index','schedule_index','start','count'): + require(integer(row[k]), 'interval integer '+k) + require(row['index']==j and row['start'] >= 0 and row['count'] >= 0, 'interval index/range') + local = row['kind']=='local_cover_sweep' + require(row['kind'] in ('local_cover_sweep','idle'), 'interval kind') + require(type(row['common']) is bool and row['common'] is local, 'interval view') + require(type(row['low_major']) is bool and row['low_major'] is local, 'interval nesting') + require(row['order']==('low-major' if local else 'id-major'), 'interval order label') + ids=tuple(range(row['start'],row['start']+row['count'])) + require(row['sequence_sha256']==digest_ids(ids), 'interval sequence digest') + if not ids: + require(row['start']==data['request_count'], 'canonical empty start') + groups.append(Group(row['schedule_index'],row['kind'],ids)) + partition(groups,data['request_count']) + require(sum(not g.ids for g in groups)==data['empty_groups'], 'empty group count') + require(data['empty_canonical_start']==data['request_count'], 'empty sentinel') + if actual is not None: + require(groups==actual, 'certificate differs from independent source-data groups') + return groups + + +def raw_groups(template): + """Reconstruct request numbering from hosted data, without Catalogue. + + Local requests follow stage then literal op0/op2 positions. Idle requests + follow schedule idle order then copy number, excluding fully hosted axes. + This does not reconstruct projectors or prove mathematical admissibility. + """ + rho=template['replicas'] + require(integer(rho) and rho>0,'raw replica count') + calls=template['calls']; programs=template['local_programs']; schedule=template['schedule'] + require(len(calls)==template['stages']*rho,'complete raw calls') + requests=[]; local_ids={}; local_events={}; local_maps={} + for stage in range(template['stages']): + first=calls[stage*rho] + require(first['stage']==stage and first['replica']==0,'stage-major raw calls') + events=tuple(map(tuple,programs[first['orientation']])) + ids=[]; mapping=[] + for pos,event in enumerate(events): + op,role=event[:2] + require(op in (0,1,2,3),'closed raw local opcode') + if op not in (0,2): + mapping.append(None); continue + identifier=len(requests); mapping.append(identifier); ids.append(identifier) + requests.append({'kind':('MOVE' if op==0 else 'COPY'),'stage':stage,'position':pos,'role':role}) + local_ids[stage]=tuple(ids); local_maps[stage]=tuple(mapping); local_events[stage]=events + for replica in range(rho): + other=calls[stage*rho+replica] + require((other['stage'],other['replica'],other['orientation'],other['local_hash']) == + (stage,replica,first['orientation'],first['local_hash']), 'raw replica recipe agreement') + idle_events=[e for e in schedule if e['kind']=='idle'] + require(len({e['idx'] for e in idle_events})==len(idle_events),'unique idle schedule ids') + pending={} + for e in idle_events: + a,b=e['source_level'],e['target_level'] + axes=tuple(range(1 if a==-1 else 8+7*a,8+7*b)) + require(len(axes)==e['rank'],'raw idle rank/axis interval') + pending[e['idx']]=axes + used=defaultdict(set) + for child,copy,offset,width,_stage,_helper in template['hosting']['slots']: + require(child in pending and 0<=copy<222 and offset>=0 and width>=0,'hosting slot domain') + axes=pending[child][offset:offset+width] + require(len(axes)==width and not used[child,copy].intersection(axes),'hosting gap/overlap') + used[child,copy].update(axes) + idle_ids={} + for e in idle_events: + ids=[] + for copy in range(222): + remaining=set(pending[e['idx']])-used[e['idx'],copy] + if not remaining: continue + ids.append(len(requests)) + requests.append({'kind':'IDLE','stage':e['idx'],'position':e['idx'],'role':copy, + 'family':e['pair']*222+copy,'axes':tuple(sorted(remaining))}) + idle_ids[e['idx']]=tuple(ids) + groups=[] + for pos,e in enumerate(schedule): + if e['kind']=='local_cover_sweep': groups.append(Group(pos,e['kind'],local_ids[e['stage']])) + elif e['kind']=='idle': groups.append(Group(pos,e['kind'],idle_ids[e['idx']])) + else: require(e['kind'] in ('bridge','exchange'),'closed raw global opcode') + partition(groups,len(requests)) + return groups,requests,local_events,local_maps,idle_ids + + +def check_claims(groups,requests,rho): + kinds=dict(Counter(r['kind'] for r in requests)) + require(len(requests)==28278,'challenge R=28278') + require(rho==32,'challenge rho=32') + require(len(groups)==19 and not groups[-1].ids,'challenge 19 groups, empty final') + require([len(g.ids) for g in groups]==CLAIM_SIZES,'challenge chronological sizes') + require(kinds=={'MOVE':26199,'COPY':81,'IDLE':1998},'challenge request-kind counts') + return {'request_count':len(requests),'replicas':rho,'groups':len(groups), + 'sizes':[len(g.ids) for g in groups],'kinds':kinds, + 'distinct_keys_coefficient_of_N':len(requests), + 'visits_coefficient_of_N':rho*len(requests), + 'per_key_multiplicity':rho} + + +def safe_relative(value): + require(isinstance(value, str) and value and "\\" not in value, + 'repository-relative POSIX path') + path = PurePosixPath(value) + require(not path.is_absolute() and not PureWindowsPath(value).drive + and '..' not in path.parts and path.as_posix() == value + and value != '.', 'safe canonical source path: ' + value) + return value + + +def pin_index(manifest): + """Manifest is the published trust anchor, not a replacement for byte checks.""" + expected = manifest['package_sha256'] + require(len(expected) == 28, '28 archived package pins') + pins = {} + for rel, digest in expected.items(): + safe_relative(rel) + require(rel.startswith(AUDIT + '/'), 'archived package pin scope') + pins[rel] = {'sha256': digest} + live = manifest['live_inputs'] + require(len(live) == 121, '121 live input pins') + for row in live: + rel = safe_relative(row['path']) + require(rel not in pins, 'unique independent pin: ' + rel) + pins[rel] = {'sha256': row['sha256'], 'git_blob': row['git_blob']} + return pins + + +def load_manifest(): + return json.loads((HERE / 'AUTHENTICATION.json').read_bytes()) + + +def read_pinned(root, rel, pins): + """Return exactly the bytes just hashed; never authenticate one read and exec another.""" + root = Path(root).resolve() + rel = safe_relative(rel) + require(rel in pins, 'unlisted source/input: ' + rel) + path = root / rel + require(path.resolve().is_relative_to(root) and path.is_file() and not path.is_symlink(), + 'regular contained input: ' + rel) + raw = path.read_bytes() + row = pins[rel] + require(sha256(raw).hexdigest() == row['sha256'], 'SHA256 mismatch: ' + rel) + if 'git_blob' in row: + # Compute the Git blob object ID directly; no Git executable/history needed. + require(sha1(b'blob ' + str(len(raw)).encode() + b'\0' + raw).hexdigest() + == row['git_blob'], 'Git blob mismatch: ' + rel) + return raw + + +def authenticate(root, manifest=None): + root = Path(root).resolve() + manifest = load_manifest() if manifest is None else manifest + pins = pin_index(manifest) + expected = manifest['package_sha256'] + observed = {p.relative_to(root).as_posix() for p in (root / AUDIT).rglob('*') + if p.is_file() and '__pycache__' not in p.parts} + require(observed == set(expected), 'exact 28-file audit package inventory') + for rel in pins: + read_pinned(root, rel, pins) + return {'package_files': len(expected), 'live_inputs': len(manifest['live_inputs']), + 'all_bytes_checked_before_source_import': True} + + +WINDOWS_VERIFIER = CALLER + '/inputs/pr2753/verify.py' +WINDOWS_OLD = "str(path.relative_to(here/'predecessor'))" +WINDOWS_NEW = "path.relative_to(here/'predecessor').as_posix()" + + +def windows_inventory_adapter(raw): + """Only one verified expression changes, only in an authenticated in-memory copy.""" + old, new = WINDOWS_OLD.encode(), WINDOWS_NEW.encode() + require(raw.count(old) == 1, 'exact inventory adapter anchor') + return raw.replace(old, new) + + +class SourceLoader(importlib.abc.Loader): + def __init__(self, owner, rel): + self.owner, self.rel = owner, rel + + def create_module(self, spec): + return None + + def exec_module(self, module): + self.owner.loaded_names.add(module.__name__) + raw = read_pinned(self.owner.root, self.rel, self.owner.pins) + executable = raw + if self.rel == WINDOWS_VERIFIER and os.name == 'nt': + require(module.__name__ == 'frozen_caller_verifier', 'frozen verifier alias') + executable = windows_inventory_adapter(raw) + self.owner.adapters.append({'path': self.rel, 'old': WINDOWS_OLD, 'new': WINDOWS_NEW}) + self.owner.records[self.rel] = sha256(raw).hexdigest() + path = self.owner.root / self.rel + module.__file__ = str(path) + # Source only: neither adjacent nor prefix .pyc files are consulted. + # Do not inherit future flags from this checking harness. + exec(compile(executable, str(path), 'exec', dont_inherit=True), module.__dict__) + + +class SourceImports(importlib.abc.MetaPathFinder): + """Isolated, hash-checked imports, including original explicit file-location imports. + + The import machinery changes, not compiler/numerical routines. The sole + source expression adapter is the disclosed Windows inventory spelling. + No cache directory is created or needed. Use serially, not across threads. + """ + forbidden = frozenset(('accounting', 'source_audit', 'verify', 'extract_census')) + + def __init__(self, root, pins): + self.root, self.pins = Path(root).resolve(), pins + base = self.root / CALLER + caller = base / 'inputs/pr2753' + self.directories = (base, caller, caller / 'predecessor', + caller / 'predecessor/vendor', base / 'inputs/pr2769', + base / 'inputs/pr2769/vendor') + self.records, self.adapters, self.loaded_names = {}, [], set() + self.names = {p.stem for directory in self.directories for p in directory.glob('*.py')} + self.names.update(Path(rel).stem for rel in pins + if (self.root / rel).parent in self.directories and rel.endswith('.py')) + self.names.update(('bank_codec', 'frozen_caller_verifier', 'retained_selected_node_source')) + + def spec(self, name, path): + path = Path(path).absolute() + require(path.is_relative_to(self.root), 'source import outside root') + rel = path.relative_to(self.root).as_posix() + safe_relative(rel) + require(rel in self.pins and rel.endswith('.py'), 'unpinned source import: ' + rel) + require(not rel.startswith(AUDIT + '/'), 'archived audit source import forbidden') + require(not any(part in self.forbidden for part in name.split('.')), + 'audit/verifier import forbidden: ' + name) + return importlib.util.spec_from_loader(name, SourceLoader(self, rel), origin=str(path)) + + def find_spec(self, fullname, path=None, target=None): + require(not any(part in self.forbidden for part in fullname.split('.')), + 'audit/verifier import forbidden: ' + fullname) + if '.' in fullname: + return None + for directory in self.directories: + candidate = directory / (fullname + '.py') + rel = candidate.relative_to(self.root).as_posix() + if rel in self.pins or candidate.is_file(): + # Missing pinned files must not fall back to an ambient module. + return self.spec(fullname, candidate) + require(not (directory / fullname / '__init__.py').is_file(), + 'unlisted source package: ' + fullname) + return None + + def file_spec(self, name, location=None, *args, **kwargs): + if location is not None and Path(location).absolute().is_relative_to(self.root): + require(not args and not kwargs, 'plain original source-file import') + return self.spec(name, location) + return self.previous_file_spec(name, location, *args, **kwargs) + + def __enter__(self): + require(not self.names.intersection(sys.modules), 'preloaded source module namespace') + self.previous_meta, self.previous_path = list(sys.meta_path), list(sys.path) + self.previous_file_spec = importlib.util.spec_from_file_location + self.previous_bytecode = sys.dont_write_bytecode + sys.dont_write_bytecode = True + sys.meta_path.insert(0, self) + importlib.util.spec_from_file_location = self.file_spec + return self + + def __exit__(self, *exc): + importlib.util.spec_from_file_location = self.previous_file_spec + sys.meta_path[:] = self.previous_meta + sys.path[:] = self.previous_path + sys.dont_write_bytecode = self.previous_bytecode + for name in self.loaded_names: + sys.modules.pop(name, None) + + +def activate_original(root, imports): + """Original loader authentication/controls, not a numerical verifier replay. + + Only frozen_caller_verifier.authenticate is invoked. No archived audit + accounting.py, source_audit.py, verify.py or extract_census.py is imported. + The source-only importer hashes each executed byte string again at import. + """ + loader = importlib.import_module('loader') + loader.activate() + loader.compatibility_controls() + return {'original_loader_authenticate': 'passed', + 'windows_posix_inventory_adapter': imports.adapters, + 'original_selected_record_mutation_controls': 'passed'} + + +def selected_metadata(root,groups,requests,events,mappings,idles): + from catalogue import Catalogue + from topology import SelectedTopology + from control import LocalState + cat=Catalogue(3) # ONLY metadata; no low_classes, bind, plan or compile_node. + topology=SelectedTopology(cat) + require(len(cat.requests)==len(requests),'raw/source request length') + require(topology.replicas==cat.replicas==32,'raw/source replica count') + for i,(actual,raw) in enumerate(zip(cat.requests,requests)): + for key in ('kind','stage','position','role'): + require(getattr(actual,key)==raw[key],f'raw/source request {i} {key}') + if raw['kind']=='IDLE': + require(actual.family==raw['family'] and actual.base.data==raw['axes'],f'idle source support {i}') + visits=Counter(); event_count=0; all_groups=[] + for pos,e in enumerate(topology.schedule): + if e['kind'] not in ('local_cover_sweep','idle'): continue + per_replica=[] + for replica in range(topology.replicas): + ids=[] + if e['kind']=='local_cover_sweep': + call=topology.call(e['stage'],replica) + require(call.stage==e['stage'] and call.replica==replica,'call coordinates') + require(call.events==events[e['stage']] and call.requests==mappings[e['stage']], 'literal call events/requests') + state=LocalState(call) + for position,item in enumerate(call.events): + op,role=state.accept(position); event_count+=1 + require((op,role)==item[:2],'LocalState accepted opcode/role') + if op not in (0,2): + require(call.requests[position] is None,'non-residual event has request'); continue + identifier=call.requests[position] + r=cat.requests[identifier] + require((r.kind,r.stage,r.position,r.role)== + ('MOVE' if op==0 else 'COPY',e['stage'],position,role),'source dispatch binding') + ids.append(identifier); visits[identifier,True]+=1 + state.finish() + else: + require(topology.idles[e['idx']]==idles[e['idx']],'idle request order') + for identifier in topology.idles[e['idx']]: + r=cat.requests[identifier] + require(r.kind=='IDLE' and r.stage==e['idx'],'idle source binding') + require(topology.idle_family(identifier,replica)==r.family+topology.stride*replica,'idle replica family') + ids.append(identifier); visits[identifier,False]+=1 + per_replica.append(tuple(ids)) + require(all(x==per_replica[0] for x in per_replica),'every replica ordered IDs') + all_groups.append(Group(pos,e['kind'],per_replica[0])) + require(all_groups==groups,'source execution versus independent raw-data groups') + require(len(visits)==len(requests) and set(visits.values())=={32},'source-key multiplicity at symbolic one LOW') + require(set(visits)=={(i,r['kind']!='IDLE') for i,r in enumerate(requests)},'source common/native key domain') + return {'q':3,'local_events_executed':event_count,'source_key_pairs':len(visits), + 'metadata_request_visits':sum(visits.values()),'all_replicas':32, + 'GL64_LOW_enumerated':False,'selected_compiler_executed':False} + + +def tiny_emitter(): + """Real predecessor compiler, OWN non-selected fixture; no allocations audit.""" + from low_codes import LowCodes + from macro_code import compile_node + from topology import Call,Owner + codes=LowCodes(3,2,8) + lows=tuple(codes.unrank(i) for i in (0,1,47)) + I=((1,0),(0,1)) + groups=[Group(0,'local_cover_sweep',(0,1,2)),Group(1,'idle',(6,7)), + Group(3,'local_cover_sweep',(3,4,5)),Group(4,'idle',())] + class Cat: + def low_classes(self): return iter(lows) + cat=Cat(); cat.codes=codes + class Top: + replicas=2; pairs=2; ports=1; catalogue=cat + idles={0:(6,7),1:()} + schedule=({'kind':'local_cover_sweep','stage':0},{'kind':'idle','idx':0}, + {'kind':'bridge','dst':0,'src':1,'coefficient':1}, + {'kind':'local_cover_sweep','stage':1},{'kind':'idle','idx':1},{'kind':'exchange'}) + def call(self,stage,replica): + ev=((0,0,0,1,1,0),(2,0,2,1,0,1,0),(1,1,2,1,0,0), + (3,0,2,1,0,0,0),(0,1,0,1,1,0)) + ids=(3*stage,3*stage+1,None,None,3*stage+2) + return Call(stage,replica,(Owner(4*replica,I),Owner(4*replica+1,I)), + (0,0),(1,1),ev,ids,False) + def matrix(self,chart): return chart + def idle_family(self,identifier,replica): return 4*replica+identifier-6 + def family(self,replica,pair,side,port): return 4*replica+2*pair+side + seen=[] + class Binding: + def residual(self,identifier,common,low,mode): + require(mode==0,'fixture mode'); seen.append((identifier,common,low)) + # axis avoids plan allocation/execution; no claim about default factory. + return types.SimpleNamespace(identifier=identifier,common=common,low=low,axis=0) + code=compile_node(Top(),Binding(),0) + expected=projected_word(groups,2,lows) + require(seen==[(r,c,l) for _,_,r,c,l in expected],'actual factory invocation sequence') + observed=[]; current=[]; by_schedule={g.schedule_index:g for g in groups}; pos=0 + for op in code.operations: + if op[0]=='residual_begin': + d=op[2]; current.append((d.identifier,d.common,d.low)); observed.append(current[-1]) + elif op[0]=='checkpoint': + g=by_schedule.get(pos) + want=[] if g is None else [(r,c,l) for j,rep,r,c,l in expected if groups[j].schedule_index==pos] + require(current==want,'emitted source keys at checkpoint '+str(pos)) + current=[]; pos+=1 + require(pos==len(Top.schedule) and not current,'all checkpoints including empty idle') + require(observed==seen,'factory versus emitted key order') + return {'fixture':'own GL2(F3), 2 replicas, 3 LOWs, MOVE/COPY/XOR/ERASE/IDLE/bridge/exchange', + 'emitted_visits':len(observed),'distinct_keys':len(set(observed)), + 'multiplicity_histogram':dict(Counter(Counter(observed).values())), + 'empty_idle_checkpoint_checked':True,'allocation_or_reference_tests':False} + + +def run_source(root=DEFAULT_ROOT): + root = Path(root).resolve() + started=time.monotonic() + manifest = load_manifest() + pins = pin_index(manifest) + result={'authentication':authenticate(root, manifest)} + template=json.loads(gzip.decompress(read_pinned(root, HOST, pins))) + groups,requests,events,mappings,idles=raw_groups(template) + result['independent_raw_data']=check_claims(groups,requests,template['replicas']) + cert=json.loads(read_pinned(root, AUDIT + '/lean/SelectedCensus.json', pins)) + interval_data(cert,groups) + require(cert['kinds']==result['independent_raw_data']['kinds'],'certificate request kinds') + require(cert['replica_count']==template['replicas'],'certificate replicas') + result['interval_data']={'compared_with_raw_data':True,'groups':len(groups), + 'note':'not Lean execution or proof replay'} + result['bytecode_policy'] = 'hash-checked source-only imports; no pyc reads/writes or cache directory' + with SourceImports(root, pins) as imports: + result['loader']=activate_original(root, imports) + result['source_metadata']=selected_metadata(root,groups,requests,events,mappings,idles) + result['source_tiny_emitter']=tiny_emitter() + result['imports_sha256'] = imports.records + # Formula is conditional on the inherited LOW bijection; no GL64 execution. + result['symbolic_key_formula']={'N':'|GL64(F_q)|, inherited bijection premise', + 'distinct_keys':'28278*N','visits':'904896*N','per_key_multiplicity':32, + 'local_nesting':'group/replica/LOW/event','idle_nesting':'group/replica/request/LOW'} + result['elapsed_seconds']=round(time.monotonic()-started,3) + return result + + +def source_command(root, optimize=None): + """Propagate -O/-OO through the optional serial timeout wrapper.""" + optimize = sys.flags.optimize if optimize is None else optimize + require(type(optimize) is int and optimize in (0, 1, 2), 'optimization level') + return [sys.executable, '-I', '-B', *(['-' + 'O' * optimize] if optimize else []), + str(Path(__file__).resolve()), '--source', '--root', str(Path(root).resolve())] + + +def main(argv=None): + p=argparse.ArgumentParser(description=__doc__) + modes=p.add_mutually_exclusive_group(required=True) + modes.add_argument('--source',action='store_true') + modes.add_argument('--intervals',action='store_true') + p.add_argument('--root',type=Path,default=DEFAULT_ROOT, + help='repository/source-export root (default: this package repository)') + p.add_argument('--bounded',type=int,help='parent wrapper timeout seconds; launches one child serially') + args=p.parse_args(argv) + root=args.root.resolve() + if args.bounded is not None: + require(1<=args.bounded<=180 and args.source,'bounded source run 1..180 seconds') + try: + child=subprocess.run(source_command(root),capture_output=True,text=True,timeout=args.bounded) + except subprocess.TimeoutExpired: + print(json.dumps({'status':'TIMEOUT','seconds':args.bounded,'source_checks':'incomplete'})); return 2 + sys.stdout.write(child.stdout); sys.stderr.write(child.stderr) + return child.returncode + if args.source: + result=run_source(root) + else: + manifest=load_manifest() + pins=pin_index(manifest) + result={'authentication':authenticate(root, manifest)} + cert=json.loads(read_pinned(root, AUDIT + '/lean/SelectedCensus.json', pins)) + groups=interval_data(cert) + result['interval_data_only']={'groups':len(groups),'requests':sum(len(g.ids) for g in groups), + 'source_execution':False,'source_link_not_established':True} + print(json.dumps({'status':'PASS','result':result},indent=2,sort_keys=True)) + return 0 + + +if __name__=='__main__': + raise SystemExit(main()) diff --git a/research/selected-compiler-source-bridge/independent_lifetime.py b/research/selected-compiler-source-bridge/independent_lifetime.py new file mode 100644 index 0000000000..212728570a --- /dev/null +++ b/research/selected-compiler-source-bridge/independent_lifetime.py @@ -0,0 +1,541 @@ +"""Independent bounded identity/lifetime audit. No official verifier imports. + +--synthetic: stdlib only; no source imports. --original: parent-run only. +Data fixtures are explicitly not the selected numerical construction. +Adapted from the verified Astra lifetime worker, with substantial OpenAI Codex +assistance. Apache-2.0. Jose Manuel (jmbarrancoml), David Arias, ywz65, +Nick Petalas and retained README/NOTICE contributors retain source credit; +Ross Richardson's retained-backing methodology remains a predecessor. +Never enumerate GL64. +""" +from __future__ import annotations +import argparse +from collections import Counter +from contextlib import contextmanager +from dataclasses import dataclass, replace +import gc +import hashlib +import importlib +import importlib.abc +import importlib.util +import json +from pathlib import Path, PurePosixPath, PureWindowsPath +import sys +import time +from types import SimpleNamespace as NS +import weakref + +MAX_DIMENSION = 2 +MAX_RETURNS = 32 +MAX_OPERATIONS = 512 +MAX_TRACE_EVENTS = 12000 +HERE = Path(__file__).resolve().parent +DEFAULT_ROOT = HERE.parents[1] +CALLER = "research/selected-bit-physical-caller" +I2 = ((1, 0), (0, 1)) +S2 = ((0, 1), (1, 0)) + +class Rejected(ValueError): + pass + +def need(ok, message): + if not ok: + raise Rejected(message) + +def reject(label, function, contains): + try: + function() + except ValueError as error: + need(contains in str(error), f"{label}: unexpected rejection {error}") + return {"control": label, "rejected": True, "reason": str(error)} + raise Rejected(label + ": control was accepted") + +@dataclass(frozen=True) +class SyntheticWrapper: + code: int + plan: object + identifier: int = 0 + common: bool = False + low: tuple = I2 + axis: object = None + +@dataclass(frozen=True) +class Returned: + ref: object + blocks: tuple + + +def direct_refs(operation): + # Exactly direct tuple elements, not recursively traversed plans or lows. + return operation[1:] + + +def inspect_operations(operations, returned): + need(len(operations) <= MAX_OPERATIONS, "operation bound") + need(len(returned) <= MAX_RETURNS, "wrapper bound") + wrappers = [entry.ref() for entry in returned] + need(all(w is not None for w in wrappers), "factory return died before inspection") + need(len({id(w) for w in wrappers}) == len(wrappers), "non-fresh factory identity") + interval = -1 + active = None + seen_blocks = [] + counts = [0] * len(wrappers) + for operation in operations: + for item in direct_refs(operation): + for i, w in enumerate(wrappers): + if item is w: + counts[i] += 1 + kind = operation[0] + if kind == "residual_begin": + need(active is None, "overlapping residual intervals") + interval += 1 + need(interval < len(wrappers), "extra begin") + active = wrappers[interval] + need(operation[2] is active, "begin identity mismatch") + seen_blocks = [] + elif kind == "block": + need(active is not None, "block outside interval") + need(operation[1] is active, "block identity mismatch") + seen_blocks.append(operation[2]) + elif kind == "residual_end": + need(active is not None, "finish outside interval") + need(operation[2] is active, "finish identity mismatch") + need(tuple(seen_blocks) == returned[interval].blocks, "missing/changed block") + active = None + need(active is None, "missing finish") + need(interval + 1 == len(wrappers), "missing begin/finish interval") + expected = [2 + len(entry.blocks) for entry in returned] + need(counts == expected, "direct per-wrapper reference count") + B = sum(len(entry.blocks) for entry in returned) + need(sum(counts) == 2 * len(returned) + B, "2*T+B reference count") + return {"T": len(returned), "B": B, "direct_references": sum(counts), + "distinct_identities": len(wrappers), "zero_block_returns": expected.count(2)} + + +def fixture_operations(wrappers, blocks): + operations = [("node",)] + for w, bs in zip(wrappers, blocks): + operations.append(("residual_begin", "idle", w)) + operations.extend(("block", w, b) for b in bs) + operations.append(("residual_end", "idle", w)) + operations.append(("return",)) + return tuple(operations) + + +def synthetic(): + empty = () + three = (("forward", 0, 0), ("good", 1, 0), ("backward", 2, 0)) + plan = object() + wrappers = [SyntheticWrapper(7, plan) for _ in range(3)] + need(wrappers[0] == wrappers[1] and wrappers[0] is not wrappers[1], "equal-valued distinct control") + blocks = [empty, three, empty] + returned = [Returned(weakref.ref(w), b) for w, b in zip(wrappers, blocks)] + operations = fixture_operations(wrappers, blocks) + positive = inspect_operations(operations, returned) + controls = [] + controls.append(reject("interned-wrapper fixture", lambda: inspect_operations( + fixture_operations([wrappers[0]] * 3, blocks), + [Returned(weakref.ref(wrappers[0]), b) for b in blocks]), "non-fresh")) + missing_end = tuple(op for i, op in enumerate(operations) if i != len(operations)-2) + controls.append(reject("missing-finish output fixture", lambda: inspect_operations(missing_end, returned), "missing finish")) + removed = False + missing_block = [] + for op in operations: + if op[0] == "block" and not removed: + removed = True + else: + missing_block.append(op) + controls.append(reject("missing-block output fixture", lambda: inspect_operations(missing_block, returned), "missing/changed block")) + substitute = replace(wrappers[1]) + changed = list(operations) + position = next(i for i, op in enumerate(changed) if op[0] == "block") + changed[position] = ("block", substitute, changed[position][2]) + controls.append(reject("same-value different-block-identity output fixture", lambda: inspect_operations(changed, returned), "block identity")) + changed_end = list(operations) + position = next(i for i, op in enumerate(changed_end) if op[0] == "residual_end") + changed_end[position] = ("residual_end", "idle", replace(wrappers[0])) + controls.append(reject("same-value different-finish-identity output fixture", lambda: inspect_operations(changed_end, returned), "finish identity")) + # Independent weak-reference test: Code-like operations alone keep wrappers alive. + def owned(): + ws = [SyntheticWrapper(i, None) for i in range(3)] + return fixture_operations(ws, [empty]*3), [weakref.ref(w) for w in ws] + owned_ops, refs = owned() + gc.collect() + need(all(r() is not None for r in refs), "operations must retain wrappers") + del owned_ops + gc.collect() + need(all(r() is None for r in refs), "no hidden synthetic wrapper root") + # An observer is an additional root: Code release alone need not end lifetime. + observed_ops, observed_refs = owned() + observer_holds = [observed_refs[0]()] + del observed_ops + gc.collect() + need(observed_refs[0]() is not None and all(r() is None for r in observed_refs[1:]), + "observer-held wrapper survives release of operations") + observer_holds.clear() + gc.collect() + need(all(r() is None for r in observed_refs), "wrapper dies after observer releases its root") + # An identity observer distinguishes sharing despite identical dataclass values. + identity_observation = len({id(w) for w in wrappers}) + interned_observation = len({id(w) for w in [wrappers[0]] * 3}) + need(identity_observation == 3 and interned_observation == 1, "identity observer discriminates interning") + return {"status": "passed", "positive": positive, "controls": controls, + "observer_control": {"fresh_identities": identity_observation, + "interned_identities": interned_observation, + "lifetime": "observer reference extends lifetime beyond operations"}, + "weak_lifetime": "alive with operations, dead after operations released", + "scope": "synthetic checker controls only; not evidence of original compiler execution"} + + +def source_pins(): + """Independent allowlist from the prior lifetime run, not a census import.""" + manifest = json.loads((HERE / "AUTHENTICATION.json").read_bytes()) + pins = manifest["lifetime_source_sha256"] + need(len(pins) == 61, "61 lifetime source pins") + live = {row["path"]: row["sha256"] for row in manifest["live_inputs"]} + for rel, digest in pins.items(): + safe_source_path(rel) + need(rel.startswith(CALLER + "/") and rel.endswith(".py"), "lifetime source scope") + need(rel not in live or live[rel] == digest, "lifetime/live pin disagreement: " + rel) + return pins + + +def safe_source_path(rel): + need(isinstance(rel, str) and rel and "\\" not in rel, "POSIX source path") + path = PurePosixPath(rel) + need(not path.is_absolute() and not PureWindowsPath(rel).drive + and ".." not in path.parts and path.as_posix() == rel and rel != ".", + "safe repository-relative source path") + return rel + + +class SourceLoader(importlib.abc.Loader): + def __init__(self, path, root, records, pins, loaded_names): + self.path, self.root = Path(path).absolute(), Path(root).resolve() + self.records, self.pins, self.loaded_names = records, pins, loaded_names + + def create_module(self, spec): + return None + + def exec_module(self, module): + self.loaded_names.add(module.__name__) + need(self.path.is_relative_to(self.root), "source path outside root") + key = safe_source_path(self.path.relative_to(self.root).as_posix()) + need(key in self.pins, "unlisted source import: " + key) + need(self.path.resolve().is_relative_to(self.root) and self.path.is_file() + and not self.path.is_symlink(), "regular contained source: " + key) + need(self.path.name not in ("verify.py", "source_audit.py", "accounting.py", "extract_census.py"), + "forbidden verifier/audit source: " + key) + data = self.path.read_bytes() + # Hash and compile the SAME bytes. No second read and no .pyc loader. + digest = hashlib.sha256(data).hexdigest() + need(digest == self.pins[key], "source hash mismatch: " + key) + self.records[key] = digest + module.__file__ = str(self.path) + exec(compile(data, str(self.path), "exec", dont_inherit=True), module.__dict__) + + +class SourceFinder(importlib.abc.MetaPathFinder): + def __init__(self, root, records, pins): + self.root, self.records, self.pins = Path(root).resolve(), records, pins + base = self.root / CALLER + caller = base / "inputs/pr2753" + self.directories = (base, caller, caller / "predecessor", caller / "predecessor/vendor", + base / "inputs/pr2769", base / "inputs/pr2769/vendor") + self.loaded_names = set() + self.names = {p.stem for directory in self.directories for p in directory.glob("*.py")} + self.names.update(Path(rel).stem for rel in pins + if (self.root / rel).parent in self.directories and rel.endswith(".py")) + self.names.add("bank_codec") + + def spec(self, name, path): + return importlib.util.spec_from_loader(name, SourceLoader( + path, self.root, self.records, self.pins, self.loaded_names), origin=str(path)) + + def find_spec(self, fullname, path=None, target=None): + if any(word in fullname for word in ("verif", "source_audit", "accounting", "extract_census")): + raise Rejected("forbidden verifier/audit import: " + fullname) + if "." in fullname: + return None + for directory in self.directories: + candidate = directory / (fullname + ".py") + rel = candidate.relative_to(self.root).as_posix() + if rel in self.pins or candidate.is_file(): + # Missing pinned files must not fall back to an ambient module. + return self.spec(fullname, candidate) + need(not (directory / fullname / "__init__.py").is_file(), + "unlisted source package: " + fullname) + return None + + def file_spec(self, name, location=None, *args, **kwargs): + if location is not None and Path(location).absolute().is_relative_to(self.root): + need(not args and not kwargs, "plain original source-file import") + return self.spec(name, location) + return self.previous_file_spec(name, location, *args, **kwargs) + + def __enter__(self): + need(not self.names.intersection(sys.modules), "preloaded source module namespace") + self.previous_meta, self.previous_path = list(sys.meta_path), list(sys.path) + self.previous_file_spec = importlib.util.spec_from_file_location + self.previous_bytecode = sys.dont_write_bytecode + sys.dont_write_bytecode = True + sys.meta_path.insert(0, self) + importlib.util.spec_from_file_location = self.file_spec + return self + + def __exit__(self, *exc): + importlib.util.spec_from_file_location = self.previous_file_spec + sys.meta_path[:] = self.previous_meta + sys.path[:] = self.previous_path + sys.dont_write_bytecode = self.previous_bytecode + for name in self.loaded_names: + sys.modules.pop(name, None) + + +@contextmanager +def original_modules(root): + root = Path(root).resolve() + base = root / CALLER + records = {} + finder = SourceFinder(root, records, source_pins()) + with finder: + # Deliberately bypass loader.authenticate (it runs an official verifier). + # Load ORIGINAL definitions unchanged; seed the original loader's already-active + # import state with the ORIGINAL codec. No public factory/compiler method patched. + loader = importlib.import_module("loader") + importlib.import_module("sources").ROOT = root + spec = finder.spec("bank_codec", base / "inputs/pr2769/codec.py") + codec = importlib.util.module_from_spec(spec) + sys.modules["bank_codec"] = codec + try: + spec.loader.exec_module(codec) + except BaseException: + sys.modules.pop("bank_codec", None) + raise + loader._active = True + modules = {name: importlib.import_module(name) for name in + ("macro_code", "macro_binding", "macro_machine", "catalogue", "sources", "plan", "low_codes")} + yield modules, records + + +class TinyCatalogue: + """Declared dimension-2 idle fixture; never constructs Catalogue/SelectedTopology.""" + dimension = 2 + q = 3 + lows = (I2, S2) + def __init__(self, modules): + self.modules = modules + self.codes = modules["low_codes"].LowCodes(3, 2, 4) + self.requests = tuple(NS(kind="IDLE") for _ in range(4)) + def low_classes(self): + yield from self.lows + def template_for(self, identifier, common): + need(0 <= identifier < 4 and isinstance(common, bool), "tiny template guard") + from fractions import Fraction as F + eye = tuple(tuple(F(x) for x in row) for row in I2) + base = ((F(1), F(0)), (F(0), F(0))) + return self.modules["sources"].Template(3, 1, ("declared tiny", identifier), base, eye, eye) + +class TinyTopology: + dimension = 2 + replicas = 2 + schedule = ({"kind": "idle", "idx": 0},) + idles = {0: (0, 1, 2, 3)} + def __init__(self, catalogue): + self.catalogue = catalogue + def idle_family(self, identifier, replica): + need(0 <= identifier < 4 and 0 <= replica < 2, "tiny idle guard") + return replica * 4 + identifier + + +def selected_receiver(modules, specs): + # __init__ hard-codes a 64x64 ambient bind; do NOT execute it on tiny data. + receiver = object.__new__(modules["macro_binding"].SelectedBinding) + receiver.specifications = specs + receiver.catalogue = specs.catalogue + receiver.codes = specs.catalogue.codes + receiver.ambient = None # residual never reads ambient + return receiver + + +def seed_records(modules, specs): + for identifier in range(4): + for low in specs.catalogue.lows: + code = specs.catalogue.codes.encode(identifier, False, low) + template = specs.catalogue.template_for(identifier, False) + # Actual source dataclass, deliberately supplied rather than claiming + # selected compile_specification can generate dimension-2 records. + specs[code] = modules["sources"].Specification(code, template, low, True) + + +def populate_plan_fixture(modules, specs): + P, C, R = (getattr(modules["plan"], name) for name in ("Plan", "Command", "Reference")) + plans = (P(2, 1, False, ()), P(2, 1, True, ()), + P(2, 1, False, (C("add", 1, 0, R("head")), C("sign", 1, -1, R("fixed")))), + P(2, 1, False, (C("child", 0, 1, R("unit")),))) + blocks = ((), (("forward", 0, 0), ("good", 1, 0), ("backward", 2, 0)), + (("sweep", 0, 0), ("sweep", 1, 0)), + (("pair", 0, 0), ("pair", 0, 1), ("pair", 0, 2))) + for identifier, plan in enumerate(plans): + for low in specs.catalogue.lows: + specs.plans[specs.catalogue.codes.encode(identifier, False, low)] = plan + return blocks + +class RecordingBinding: + def __init__(self, receiver, blocks, intern=False): + self.receiver, self.blocks, self.intern = receiver, blocks, intern + self.returned, self.cache = [], {} + def residual(self, identifier, common, low, mode): + need(len(self.returned) < MAX_RETURNS, "factory-call size guard") + need(len(low) <= MAX_DIMENSION and all(len(row) <= MAX_DIMENSION for row in low), "LOW dimension guard") + key = (identifier, common, low, mode) + if self.intern and key in self.cache: + definition = self.cache[key] + else: + definition = self.receiver.residual(identifier, common, low, mode) + if self.intern: + self.cache[key] = definition + need(definition.plan.dimension <= MAX_DIMENSION, "plan dimension guard") + self.returned.append(Returned(weakref.ref(definition), self.blocks[identifier])) + return definition + + +def compile_traced(modules, topology, binding): + need(topology.dimension <= 2 and topology.catalogue.codes.dimension <= 2, "topology dimension guard") + need(topology.replicas <= 2 and len(topology.schedule) <= 1 and len(topology.catalogue.lows) <= 2, + "topology event guard") + need(topology.replicas * len(topology.idles[0]) * len(topology.catalogue.lows) <= MAX_RETURNS, "preflight return bound") + visited = {} + events = 0 + start = time.monotonic() + filename = modules["macro_code"].compile_node.__code__.co_filename + def trace(frame, event, arg): + nonlocal events + if frame.f_code.co_filename != filename: + return None + events += 1 + need(events <= MAX_TRACE_EVENTS and time.monotonic()-start < 60, "trace work/time guard") + operations = frame.f_locals.get("operations", ()) + need(len(operations) <= MAX_OPERATIONS, "emission operation guard") + if frame.f_code.co_name == "residual" and event in ("line", "return"): + for i, record in enumerate(binding.returned): + wrapper = record.ref() + need(wrapper is not None, "returned wrapper died during emission") + n = sum(item is wrapper for op in operations for item in direct_refs(op)) + visited.setdefault(i, set()).add(n) + if i < len(binding.returned)-1: + need(n == 2+len(record.blocks), "prior return not retained during later interval") + return trace + need(sys.gettrace() is None, "do not overwrite an existing tracer") + try: + sys.settrace(trace) + code = modules["macro_code"].compile_node(topology, binding, mode=0) + finally: + sys.settrace(None) + summary = inspect_operations(code.operations, binding.returned) + for i, record in enumerate(binding.returned): + required = set(range(3 + len(record.blocks))) + need(required <= visited.get(i, set()), "missing factory/begin/block/finish lifetime trace") + summary["emission_trace_events"] = events + summary["per_return_observed_direct_counts"] = [sorted(visited[i]) for i in range(len(binding.returned))] + return code, summary + + +def original(root=DEFAULT_ROOT): + with original_modules(root) as (modules, imports): + return original_fixture(modules, imports) + + +def original_fixture(modules, imports): + cat = TinyCatalogue(modules) + S = modules["catalogue"].Specifications + # This rejection is an original-source limitation, not a positive fresh test. + cold = S(cat) + cold_result = reject("original cold Specifications dimension-2 rejection", + lambda: cold.bind(0, False, I2), "fixed raw low class") + need(len(cold) == 0 and not cold.plans, "failed cold bind did not populate caches") + specs = S(cat) + seed_records(modules, specs) + receiver = selected_receiver(modules, specs) + first = receiver.residual(0, False, I2, 0) + second = receiver.residual(0, False, I2, 0) + need(first == second and first is not second, "original factory must allocate fresh equal wrappers") + need(first.plan is second.plan is specs.plan(first.code), "source plan cache sharing") + need(specs.bind(0, False, I2) is specs[first.code], "source record cache sharing") + need(len(specs.plans) == 1, "original plan cache initially empty then populated once") + # Factory refs are not roots in the source-record/plan caches. + refs = (weakref.ref(first), weakref.ref(second)) + del first, second + gc.collect() + need(all(r() is None for r in refs), "specification caches unexpectedly retain wrappers") + blocks = populate_plan_fixture(modules, specs) + topology = TinyTopology(cat) + binding = RecordingBinding(receiver, blocks) + code, summary = compile_traced(modules, topology, binding) + need((summary["T"], summary["B"], summary["direct_references"]) == (16, 32, 64), "declared fixture cardinalities") + returned = list(binding.returned) # weak references only + # A second compile using already populated identical Specifications must + # create a disjoint set of wrappers and leave the first code intact. + binding2 = RecordingBinding(receiver, blocks) + code2, summary2 = compile_traced(modules, topology, binding2) + need(not ({id(r.ref()) for r in returned} & {id(r.ref()) for r in binding2.returned}), "cross-compilation wrapper reuse") + # Test only ORIGINAL cached-owner geometry branch; no numeric Machine run. + w = returned[0].ref() + twin = replace(w) + machine = object.__new__(modules["macro_machine"].Machine) + page, layout, fields = object(), object(), object() + machine.geometry_state = (w, page, layout, fields, None) + with machine.geometry(w) as result: + need(result == (page, layout, fields), "same-owner geometry reuse") + def wrong_owner(): + with machine.geometry(twin): + pass + geometry_control = reject("original geometry rejects distinct equal wrapper while active", wrong_owner, "one active residual geometry") + need(w == twin and w is not twin, "geometry control equal-value premise") + del w, twin, machine, wrong_owner + # Original compiler with intentionally DIFFERENT binding fixture. Not a + # mutation of SelectedBinding.residual or compile_node. + interned = RecordingBinding(receiver, blocks, intern=True) + interned_code = modules["macro_code"].compile_node(topology, interned, 0) + interned_control = reject("original compiler + interned binding fixture", lambda: inspect_operations(interned_code.operations, interned.returned), "non-fresh") + del interned_code, interned + gc.collect() + need(all(r.ref() is not None for r in returned), "first Code owns all first-run wrappers") + need(all(r.ref() is not None for r in binding2.returned), "second Code owns all second-run wrappers") + del code + gc.collect() + need(all(r.ref() is None for r in returned), "first wrappers should die despite live specs and second Code") + need(all(r.ref() is not None for r in binding2.returned), "second Code independently owns wrappers") + del code2 + gc.collect() + need(all(r.ref() is None for r in binding2.returned), "no hidden recorder/cache roots after Code release") + return {"status": "passed", "first_compile": summary, "populated_recompile": summary2, + "cold_original_rejection": cold_result, "geometry_control": geometry_control, + "interned_binding_control": interned_control, "weak_lifetime": "two Code lifetimes independent; no wrapper roots in specs", + "imports_sha256": imports, + "bytecode_policy": "independent hash-checked source-only imports; no pyc reads/writes or cache directory", + "loader_authenticate_executed": False, "loader_active_seeded": True, + "limitations": ["original loader.authenticate bypassed; loader._active=True is seeded after codec import, not cold initialization", + "imported source bytes only: no original loader authentication or scientific receipt replay", + "SelectedBinding constructor and real cold selected specification not executed (64-only)", + "tiny seeded records and plan fixtures are not selected numerical endpoint proofs", + "geometry cached-owner branch only; no full numerical Machine execution", + "no source-request census/order validation and no native byte accounting"]} + + +def main(argv=None): + parser = argparse.ArgumentParser(description=__doc__) + modes = parser.add_mutually_exclusive_group(required=True) + modes.add_argument("--synthetic", action="store_true") + modes.add_argument("--original", action="store_true") + parser.add_argument("--root", type=Path, default=DEFAULT_ROOT, + help="repository/source-export root; unused in synthetic mode") + args = parser.parse_args(argv) + start = time.monotonic() + result = synthetic() if args.synthetic else original(args.root) + result.update(mode="synthetic" if args.synthetic else "original", python=sys.version, + elapsed_seconds=round(time.monotonic()-start, 6)) + print(json.dumps(result, sort_keys=True, indent=2)) + +if __name__ == "__main__": + main() diff --git a/research/selected-compiler-source-bridge/lean/CompilerAudit/SourceBridge.lean b/research/selected-compiler-source-bridge/lean/CompilerAudit/SourceBridge.lean new file mode 100644 index 0000000000..64716dda03 --- /dev/null +++ b/research/selected-compiler-source-bridge/lean/CompilerAudit/SourceBridge.lean @@ -0,0 +1,482 @@ +/- +SPDX-License-Identifier: Apache-2.0 + +Source-to-model transport for `CompilerAudit.Result.selected_compiler_model`, +built against the unchanged PR3391 modules (Lean 4.34.1, pinned mathlib). + +Status: the formal text below (definitions, statements and proofs) was checked +in a prior local review run: fresh compilation, exact main-theorem type, full +axiom inventory and a leaf kernel replay. Execution evidence for this +candidate package is recorded in `../VALIDATION.md` (relative to `lean/`); +rerun `check.py` before relying on it in a new environment. + +What this adds over the package: the package *defines* the model word +`visitWord groups replicas N` and the fresh-ID stream `emitFrom 0 budgets`. +Here a separately specified *source-shaped* trace is written as a literal +transcription of the loop nesting of `macro_code.compile_node` (schedule +event -> replica -> LOW -> local position for sweeps; schedule event -> +replica -> request id -> LOW for idles; no residual for bridge/exchange), over +an ABSTRACT LOW type `α` with a separate rank function, and a source-shaped op +stream with arbitrary wrapper identities `W` interleaved with wrapper-free +non-residual ops. From primitive per-event / per-LOW / per-visit hypotheses +(NOT from trace or count equality) we derive: +* the renamed source trace equals `Selected.word N`; +* the number of distinct source keys (in the LOW type, before ranking) is 28278*N; +* the number of distinct retained wrapper identities is 904896*N; +* the number of direct wrapper references is 1809792*N + blockTotal. + +Not claimed: Python semantics, that the hypotheses hold for the pinned +sources, realizability of complete execution on CPython (for GL64(F_q), +q >= 3, a complete list representation of the selected trace exceeds the +capacity of conventional 32-bit and 64-bit CPython builds; the source trace +here is denotational/unbounded), native/stock/space results, or multiplication. +-/ +import CompilerAudit.Result + +namespace CompilerAudit.SourceBridge + +open CompilerAudit + +/-- Source-level residual key: (request id, common view flag, LOW object). -/ +abbrev SKey (α : Type) := Nat × Bool × α + +/-- One local event as seen by `LocalState.accept(position)`: `op = event[0]` +(0 MOVE, 1 XOR, 2 COPY, 3 ERASE) and `request = call.requests[position]`. -/ +structure LocalEvent where + op : Nat + request : Option Nat + +/-- Residual factory requests issued at one local position: only MOVE (0) and +COPY (2) call `residual(..., call.requests[position], True, low)`. -/ +def LocalEvent.emits (e : LocalEvent) : List Nat := + if e.op = 0 ∨ e.op = 2 then e.request.toList else [] + +/-- A schedule event after dispatch on `event["kind"]`. +`sweep calls`: `calls r` is the event list of `topology.call(stage, r)`. +`idle ids`: `topology.idles[event["idx"]]` (replica independent by construction). +`silent`: bridge/exchange, which issue no residual call. -/ +inductive Event where + | sweep (calls : Nat → List LocalEvent) + | idle (ids : List Nat) + | silent + +section Trace + +variable {α : Type} + +/-- Innermost sweep loop: positions of one call at one LOW. -/ +def lowPass (evs : List LocalEvent) (l : α) : List (SKey α) := + evs.flatMap fun e => e.emits.map fun i => (i, true, l) + +/-- One replica of a sweep: `for low in low_classes(): for position ...`. -/ +def replicaPass (lows : List α) (evs : List LocalEvent) : List (SKey α) := + lows.flatMap (lowPass evs) + +/-- One replica of an idle event: `for identifier in idles: for low in ...`. -/ +def idlePass (lows : List α) (ids : List Nat) : List (SKey α) := + ids.flatMap fun i => lows.map fun l => (i, false, l) + +/-- `for replica in range(topology.replicas)` around each event body. -/ +def eventTrace (lows : List α) (replicas : Nat) : Event → List (SKey α) + | .sweep calls => (List.range replicas).flatMap fun r => replicaPass lows (calls r) + | .idle ids => (List.range replicas).flatMap fun _ => idlePass lows ids + | .silent => [] + +/-- `for event in topology.schedule`. -/ +def sourceTrace (lows : List α) (replicas : Nat) (sched : List Event) : List (SKey α) := + sched.flatMap (eventTrace lows replicas) + +/-- Drop the residual-free events. -/ +def residualEvents : List Event → List Event + | [] => [] + | .sweep calls :: es => .sweep calls :: residualEvents es + | .idle ids :: es => .idle ids :: residualEvents es + | .silent :: es => residualEvents es + +/-- Primitive per-event correspondence with one model group. For sweeps this is +the emitted-request projection of every replica's call, which the census +checks; it does NOT mention LOWs, N, the trace, or any count. -/ +def Matches (replicas : Nat) : Event → Group → Prop + | .sweep calls, g => g.common = true ∧ g.lowMajor = true ∧ + ∀ r, r < replicas → (calls r).flatMap LocalEvent.emits = g.ids + | .idle ids, g => g.common = false ∧ g.lowMajor = false ∧ ids = g.ids + | .silent, _ => False + +/-- LOW renaming by a rank function. -/ +def rename (rank : α → Nat) (k : SKey α) : Key := (k.1, k.2.1, rank k.2.2) + +end Trace + +/-! ### Generic list lemmas -/ + +theorem flatMap_range'_const {β : Type} (f : Nat → List β) (xs : List β) : + ∀ (s n : Nat), (∀ r, s ≤ r → r < s + n → f r = xs) → + (List.range' s n).flatMap f = copies n xs + | _, 0, _ => by simp [copies] + | s, n + 1, h => by + show f s ++ (List.range' (s + 1) n).flatMap f = xs ++ copies n xs + rw [h s (Nat.le_refl s) (by omega), + flatMap_range'_const f xs (s + 1) n (fun r h1 h2 => h r (by omega) (by omega))] + +theorem flatMap_range_const {β : Type} (f : Nat → List β) (xs : List β) (n : Nat) + (h : ∀ r, r < n → f r = xs) : (List.range n).flatMap f = copies n xs := by + rw [List.range_eq_range'] + exact flatMap_range'_const f xs 0 n (fun r _ h2 => h r (by omega)) + +theorem product_map_swap (l₁ l₂ : List Nat) (c : Bool) : + ((l₁ ×ˢ l₂).map fun p => ((p.2, c, p.1) : Key)) = + l₁.flatMap fun o => l₂.map fun i => ((i, c, o) : Key) := by + induction l₁ with + | nil => rfl + | cons a l ih => + show ((l₂.map fun b => (a, b)) ++ l ×ˢ l₂).map (fun p => ((p.2, c, p.1) : Key)) = + (l₂.map fun i => ((i, c, a) : Key)) ++ l.flatMap fun o => l₂.map fun i => ((i, c, o) : Key) + rw [List.map_append, ih, List.map_map] + all_goals rfl + +theorem product_map_keep (l₁ l₂ : List Nat) (c : Bool) : + ((l₁ ×ˢ l₂).map fun p => ((p.1, c, p.2) : Key)) = + l₁.flatMap fun i => l₂.map fun o => ((i, c, o) : Key) := by + induction l₁ with + | nil => rfl + | cons a l ih => + show ((l₂.map fun b => (a, b)) ++ l ×ˢ l₂).map (fun p => ((p.1, c, p.2) : Key)) = + (l₂.map fun o => ((a, c, o) : Key)) ++ l.flatMap fun i => l₂.map fun o => ((i, c, o) : Key) + rw [List.map_append, ih, List.map_map] + all_goals rfl + +theorem groupWord_low (N : Nat) (g : Group) (hc : g.common = true) (hl : g.lowMajor = true) : + groupWord N g = (List.range N).flatMap fun o => g.ids.map fun i => ((i, true, o) : Key) := by + rw [groupWord, ite_eq_left hl, hc, product_map_swap] + +theorem groupWord_idle (N : Nat) (g : Group) (hc : g.common = false) (hl : g.lowMajor = false) : + groupWord N g = g.ids.flatMap fun i => (List.range N).map fun o => ((i, false, o) : Key) := by + have hn : ¬ (g.lowMajor = true) := by rw [hl]; decide + rw [groupWord, ite_eq_right hn, hc, product_map_keep] + +theorem map_eq_self_of (f : Nat → Nat) : + ∀ l : List Nat, (∀ x ∈ l, f x = x) → l.map f = l + | [], _ => rfl + | a :: l, h => by + rw [List.map_cons, h a (by simp), map_eq_self_of f l (fun x hx => h x (by simp [hx]))] + +/-! ### LOW enumeration premises -> renaming facts -/ + +section Low + +variable {α : Type} + +/-- `low_classes()` yields `unrank(o)` for `o in range(N)`; with `rank∘unrank = id` +on that range, ranking the enumerated LOWs gives `range N` in order. -/ +theorem lows_rank (lows : List α) (rank : α → Nat) (unrank : Nat → α) (N : Nat) + (hlows : lows = (List.range N).map unrank) (hinv : ∀ o, o < N → rank (unrank o) = o) : + lows.map rank = List.range N := by + rw [hlows, List.map_map] + exact map_eq_self_of _ _ (fun x hx => hinv x (List.mem_range.mp hx)) + +theorem rank_injOn (lows : List α) (rank : α → Nat) (unrank : Nat → α) (N : Nat) + (hlows : lows = (List.range N).map unrank) (hinv : ∀ o, o < N → rank (unrank o) = o) : + ∀ x ∈ lows, ∀ y ∈ lows, rank x = rank y → x = y := by + intro x hx y hy hxy + rw [hlows] at hx hy + obtain ⟨a, ha, rfl⟩ := List.mem_map.mp hx + obtain ⟨b, hb, rfl⟩ := List.mem_map.mp hy + rw [hinv a (List.mem_range.mp ha), hinv b (List.mem_range.mp hb)] at hxy + rw [hxy] + +/-! ### Per-event transport -/ + +theorem lowPass_eq (evs : List LocalEvent) (l : α) : + lowPass evs l = (evs.flatMap LocalEvent.emits).map fun i => ((i, true, l) : SKey α) := by + unfold lowPass + rw [List.map_flatMap] + +theorem replicaPass_map (rank : α → Nat) (evs : List LocalEvent) : + ∀ lows : List α, (replicaPass lows evs).map (rename rank) = + (lows.map rank).flatMap fun o => + (evs.flatMap LocalEvent.emits).map fun i => ((i, true, o) : Key) + | [] => rfl + | l :: ls => by + show (lowPass evs l ++ replicaPass ls evs).map (rename rank) = _ + rw [List.map_append, replicaPass_map rank evs ls, lowPass_eq, List.map_map] + all_goals rfl + +theorem idlePass_map (rank : α → Nat) (lows : List α) (ids : List Nat) : + (idlePass lows ids).map (rename rank) = + ids.flatMap fun i => (lows.map rank).map fun o => ((i, false, o) : Key) := by + induction ids with + | nil => rfl + | cons i is ih => + show ((lows.map fun l => ((i, false, l) : SKey α)) ++ idlePass lows is).map (rename rank) = + (lows.map rank).map (fun o => ((i, false, o) : Key)) ++ + is.flatMap fun i => (lows.map rank).map fun o => ((i, false, o) : Key) + rw [List.map_append, ih, List.map_map, List.map_map] + all_goals rfl + +theorem sweep_transport (lows : List α) (rank : α → Nat) (N replicas : Nat) + (hlow : lows.map rank = List.range N) (calls : Nat → List LocalEvent) (g : Group) + (hm : Matches replicas (.sweep calls) g) : + (eventTrace lows replicas (.sweep calls)).map (rename rank) = + copies replicas (groupWord N g) := by + have hm' : g.common = true ∧ g.lowMajor = true ∧ + ∀ r, r < replicas → (calls r).flatMap LocalEvent.emits = g.ids := hm + obtain ⟨hc, hl, hp⟩ := hm' + show ((List.range replicas).flatMap fun r => replicaPass lows (calls r)).map (rename rank) = _ + rw [List.map_flatMap, groupWord_low N g hc hl] + apply flatMap_range_const + intro r hr + show (replicaPass lows (calls r)).map (rename rank) = _ + rw [replicaPass_map, hlow, hp r hr] + +theorem idle_transport (lows : List α) (rank : α → Nat) (N replicas : Nat) + (hlow : lows.map rank = List.range N) (ids : List Nat) (g : Group) + (hm : Matches replicas (.idle ids) g) : + (eventTrace lows replicas (.idle ids)).map (rename rank) = + copies replicas (groupWord N g) := by + have hm' : g.common = false ∧ g.lowMajor = false ∧ ids = g.ids := hm + obtain ⟨hc, hl, hids⟩ := hm' + show ((List.range replicas).flatMap fun _ => idlePass lows ids).map (rename rank) = _ + rw [List.map_flatMap, groupWord_idle N g hc hl] + apply flatMap_range_const + intro r _ + show (idlePass lows ids).map (rename rank) = _ + rw [idlePass_map, hlow, hids] + +theorem sourceTrace_cons (lows : List α) (replicas : Nat) (e : Event) (es : List Event) : + sourceTrace lows replicas (e :: es) = + eventTrace lows replicas e ++ sourceTrace lows replicas es := by + simp [sourceTrace] + +/-- Main trace transport: literal loop nesting + per-event projections + LOW +enumeration order imply the renamed source trace IS the model word. -/ +theorem trace_transport (lows : List α) (rank : α → Nat) (N replicas : Nat) + (hlow : lows.map rank = List.range N) : + ∀ (sched : List Event) (groups : List Group), + List.Forall₂ (Matches replicas) (residualEvents sched) groups → + (sourceTrace lows replicas sched).map (rename rank) = visitWord groups replicas N + | [], groups, h => by + have h' : List.Forall₂ (Matches replicas) [] groups := h + cases h' + rfl + | .sweep calls :: es, groups, h => by + have h' : List.Forall₂ (Matches replicas) (.sweep calls :: residualEvents es) groups := h + cases h' with + | cons hm hrest => + rw [sourceTrace_cons, List.map_append, + sweep_transport lows rank N replicas hlow calls _ hm, + trace_transport lows rank N replicas hlow es _ hrest] + all_goals rfl + | .idle ids :: es, groups, h => by + have h' : List.Forall₂ (Matches replicas) (.idle ids :: residualEvents es) groups := h + cases h' with + | cons hm hrest => + rw [sourceTrace_cons, List.map_append, + idle_transport lows rank N replicas hlow ids _ hm, + trace_transport lows rank N replicas hlow es _ hrest] + all_goals rfl + | .silent :: es, groups, h => by + rw [sourceTrace_cons] + exact trace_transport lows rank N replicas hlow es groups h + +/-! ### Distinct keys in the source LOW type (before ranking) -/ + +theorem mem_eventTrace_low (lows : List α) (replicas : Nat) (e : Event) (k : SKey α) + (hk : k ∈ eventTrace lows replicas e) : k.2.2 ∈ lows := by + cases e with + | sweep calls => + have hk' : k ∈ (List.range replicas).flatMap fun r => replicaPass lows (calls r) := hk + obtain ⟨r, -, hr⟩ := List.mem_flatMap.mp hk' + have hr' : k ∈ lows.flatMap (lowPass (calls r)) := hr + obtain ⟨l, hl, hl'⟩ := List.mem_flatMap.mp hr' + have hl'' : k ∈ (calls r).flatMap fun e => e.emits.map fun i => ((i, true, l) : SKey α) := hl' + obtain ⟨e, -, he⟩ := List.mem_flatMap.mp hl'' + obtain ⟨i, -, rfl⟩ := List.mem_map.mp he + exact hl + | idle ids => + have hk' : k ∈ (List.range replicas).flatMap fun _ => idlePass lows ids := hk + obtain ⟨r, -, hr⟩ := List.mem_flatMap.mp hk' + have hr' : k ∈ ids.flatMap fun i => lows.map fun l => ((i, false, l) : SKey α) := hr + obtain ⟨i, -, hi⟩ := List.mem_flatMap.mp hr' + obtain ⟨l, hl, rfl⟩ := List.mem_map.mp hi + exact hl + | silent => simp [eventTrace] at hk + +theorem mem_sourceTrace_low (lows : List α) (replicas : Nat) (sched : List Event) (k : SKey α) + (hk : k ∈ sourceTrace lows replicas sched) : k.2.2 ∈ lows := by + obtain ⟨e, -, he⟩ := List.mem_flatMap.mp hk + exact mem_eventTrace_low lows replicas e k he + +end Low + +theorem toFinset_map_card {β γ : Type} [DecidableEq β] [DecidableEq γ] (f : β → γ) (l : List β) + (hinj : ∀ x ∈ l, ∀ y ∈ l, f x = f y → x = y) : + (l.map f).toFinset.card = l.toFinset.card := by + have h : (l.map f).toFinset = l.toFinset.image f := by + ext y + simp + rw [h, Finset.card_image_of_injOn] + intro x hx y hy hxy + exact hinj x (by simpa using hx) y (by simpa using hy) hxy + +/-- Distinct source keys (LOW objects, not ranks) equal distinct model keys. -/ +theorem source_distinct {α : Type} [DecidableEq α] (lows : List α) (rank : α → Nat) + (unrank : Nat → α) (N replicas : Nat) + (hlows : lows = (List.range N).map unrank) (hinv : ∀ o, o < N → rank (unrank o) = o) + (sched : List Event) (groups : List Group) + (h : List.Forall₂ (Matches replicas) (residualEvents sched) groups) : + (sourceTrace lows replicas sched).toFinset.card = + (visitWord groups replicas N).toFinset.card := by + have hinj : ∀ x ∈ sourceTrace lows replicas sched, ∀ y ∈ sourceTrace lows replicas sched, + rename rank x = rename rank y → x = y := by + intro x hx y hy hxy + obtain ⟨i, c, l⟩ := x + obtain ⟨j, d, m⟩ := y + have hl := mem_sourceTrace_low lows replicas sched _ hx + have hm := mem_sourceTrace_low lows replicas sched _ hy + simp only [rename, Prod.mk.injEq] at hxy + obtain ⟨rfl, rfl, hr⟩ := hxy + rw [rank_injOn lows rank unrank N hlows hinv l hl m hm hr] + rw [← trace_transport lows rank N replicas (lows_rank lows rank unrank N hlows hinv) + sched groups h] + exact (toFinset_map_card (rename rank) _ hinj).symm + +/-! ### Source-shaped op stream with arbitrary wrapper identities -/ + +/-- `residual_begin`, `block`, `residual_end` carry a wrapper; every other +compile_node operation is `other` (obligation: it carries no Residual). -/ +inductive SrcOp (W : Type) where + | begin (w : W) + | block (w : W) + | finish (w : W) + | other + +def SrcOp.ref {W : Type} : SrcOp W → Option W + | .begin w => some w + | .block w => some w + | .finish w => some w + | .other => none + +/-- One residual call: `pre` wrapper-free ops before it, its wrapper, its blocks. -/ +structure Seg (W : Type) where + pre : Nat + wrapper : W + blocks : Nat + +def segOps {W : Type} (s : Seg W) : List (SrcOp W) := + List.replicate s.pre .other ++ + (.begin s.wrapper :: (List.replicate s.blocks (.block s.wrapper) ++ [.finish s.wrapper])) + +def emitSrc {W : Type} (segs : List (Seg W)) (tail : Nat) : List (SrcOp W) := + segs.flatMap segOps ++ List.replicate tail .other + +/-- Direct wrapper references in the operation list. -/ +def srcRefs {W : Type} (ops : List (SrcOp W)) : List W := ops.filterMap SrcOp.ref + +def srcRetained {W : Type} [DecidableEq W] (ops : List (SrcOp W)) : Finset W := + (srcRefs ops).toFinset + +theorem fm_other {W : Type} (n : Nat) : + (List.replicate n (SrcOp.other : SrcOp W)).filterMap SrcOp.ref = [] := by + induction n with + | zero => rfl + | succ n ih => exact ih + +theorem fm_block {W : Type} (n : Nat) (w : W) : + (List.replicate n (SrcOp.block w)).filterMap SrcOp.ref = List.replicate n w := by + induction n with + | zero => rfl + | succ n ih => exact congrArg (w :: ·) ih + +theorem fm_seg {W : Type} (s : Seg W) : + (segOps s).filterMap SrcOp.ref = + s.wrapper :: (List.replicate s.blocks s.wrapper ++ [s.wrapper]) := by + unfold segOps + rw [List.filterMap_append, fm_other, List.nil_append] + show s.wrapper :: (List.replicate s.blocks (SrcOp.block s.wrapper) ++ + [SrcOp.finish s.wrapper]).filterMap SrcOp.ref = _ + rw [List.filterMap_append, fm_block] + all_goals rfl + +theorem refs_emit {W : Type} (segs : List (Seg W)) (tail : Nat) : + srcRefs (emitSrc segs tail) = + segs.flatMap fun s => s.wrapper :: (List.replicate s.blocks s.wrapper ++ [s.wrapper]) := by + unfold srcRefs emitSrc + rw [List.filterMap_append, fm_other, List.append_nil] + induction segs with + | nil => rfl + | cons s ss ih => rw [List.flatMap_cons, List.filterMap_append, ih, fm_seg, List.flatMap_cons] + +theorem refs_length {W : Type} (segs : List (Seg W)) (tail : Nat) : + (srcRefs (emitSrc segs tail)).length = 2 * segs.length + (segs.map Seg.blocks).sum := by + rw [refs_emit] + induction segs with + | nil => rfl + | cons s ss ih => + rw [List.flatMap_cons, List.length_append, ih] + simp only [List.length_cons, List.length_append, List.length_replicate, + List.length_nil, List.map_cons, List.sum_cons] + all_goals omega + +/-- Freshness (pairwise distinct wrappers) is a hypothesis, not derived. -/ +theorem retained_emit {W : Type} [DecidableEq W] (segs : List (Seg W)) (tail : Nat) + (hfresh : (segs.map Seg.wrapper).Nodup) : + (srcRetained (emitSrc segs tail)).card = segs.length := by + have h : srcRetained (emitSrc segs tail) = (segs.map Seg.wrapper).toFinset := by + unfold srcRetained + rw [refs_emit] + ext w + simp only [List.mem_toFinset, List.mem_flatMap, List.mem_map, List.mem_cons, + List.mem_append, List.mem_replicate] + constructor + · rintro ⟨s, hs, hw⟩ + refine ⟨s, hs, ?_⟩ + rcases hw with h1 | h1 | h1 | h1 <;> + first | exact h1.symm | exact h1.2.symm | simp at h1 + · rintro ⟨s, hs, rfl⟩ + exact ⟨s, hs, Or.inl rfl⟩ + rw [h, List.toFinset_card_of_nodup hfresh, List.length_map] + +/-! ### Selected corollary -/ + +/-- Conditional transport to the package's selected model. Hypotheses are +primitive: LOW enumeration/inverse, per-event emitted projection matching the +19 certified groups, one segment per residual call with its block budget, and +wrapper freshness. Conclusions are derived, not assumed. -/ +theorem selected_source_transport {α W : Type} [DecidableEq α] [DecidableEq W] + (lows : List α) (rank : α → Nat) (unrank : Nat → α) (N : Nat) + (hlows : lows = (List.range N).map unrank) (hinv : ∀ o, o < N → rank (unrank o) = o) + (sched : List Event) + (hsched : List.Forall₂ (Matches SelectedData.replicaCount) (residualEvents sched) + Selected.groups) + (blocks : Key → Nat) (segs : List (Seg W)) (tail : Nat) + (hbud : segs.map Seg.blocks = + (sourceTrace lows SelectedData.replicaCount sched).map fun k => blocks (rename rank k)) + (hfresh : (segs.map Seg.wrapper).Nodup) : + (sourceTrace lows SelectedData.replicaCount sched).map (rename rank) = Selected.word N ∧ + (sourceTrace lows SelectedData.replicaCount sched).toFinset.card = 28278 * N ∧ + (srcRetained (emitSrc segs tail)).card = 904896 * N ∧ + (srcRefs (emitSrc segs tail)).length = 1809792 * N + Result.blockTotal N blocks := by + have htr : (sourceTrace lows SelectedData.replicaCount sched).map (rename rank) = + Selected.word N := trace_transport lows rank N SelectedData.replicaCount + (lows_rank lows rank unrank N hlows hinv) sched Selected.groups hsched + have hlen : segs.length = 904896 * N := by + have h1 := congrArg List.length hbud + rw [List.length_map, List.length_map] at h1 + have h2 := congrArg List.length htr + rw [List.length_map] at h2 + rw [h1, h2] + exact Selected.word_length N + have hsum : (segs.map Seg.blocks).sum = Result.blockTotal N blocks := by + rw [hbud] + show _ = ((Selected.word N).map blocks).sum + rw [← htr, List.map_map] + all_goals rfl + have hdist : (sourceTrace lows SelectedData.replicaCount sched).toFinset.card = 28278 * N := + (source_distinct lows rank unrank N SelectedData.replicaCount hlows hinv sched + Selected.groups hsched).trans (Selected.word_distinct N) + refine ⟨htr, hdist, ?_, ?_⟩ + · rw [retained_emit segs tail hfresh, hlen] + · rw [refs_length, hlen, hsum] + all_goals omega + +end CompilerAudit.SourceBridge diff --git a/research/selected-compiler-source-bridge/lean/check.py b/research/selected-compiler-source-bridge/lean/check.py new file mode 100644 index 0000000000..56b4a1cea1 --- /dev/null +++ b/research/selected-compiler-source-bridge/lean/check.py @@ -0,0 +1,595 @@ +#!/usr/bin/env python3 +"""Portable, source/environment-bound Lean replay of the selected source bridge. + +The runner never installs or fetches anything. It uses the exact toolchain and +an existing package cache supplied by the caller, and refuses to run when the +inputs do not match their pins: + +* the seven unchanged PR3391 modules (``research/selected-compiler-visitation- + audit/lean``) and that package's toolchain/lakefile/lake-manifest, by SHA-256; +* the candidate ``CompilerAudit/SourceBridge.lean`` by SHA-256, plus the + SHA-256 of its comment-stripped formal text (identical to the previously + checked source 6027af1a..., whose header comment was later corrected); +* all nine lake-manifest dependency revisions (git HEAD, clean tracked files); + eight library roots enter LEAN_PATH, ``Cli`` is tooling-only and excluded; +* real Lean 4.34.1 binaries (commit 5045d005...), not elan shims. + +The child environment is built from scratch (no inherited LEAN_*/LAKE_*/ELAN_*/ +GIT_* or PATH); LEAN_PATH is explicit with the fresh build root first. +All seven baseline modules and the bridge are compiled freshly into one +``CompilerAudit`` build root under ``--output``. Then: exact main-theorem type +and the full 27-name axiom inventory, the baseline main contract, one explicit +leaf ``leanchecker --verbose CompilerAudit.SourceBridge`` replay, and small +contract probes. Imported library .olean files are trusted cached artifacts at +the pinned clean revisions; they are not rebuilt. + +Usage: + python3 -I -B check.py --output /abs/fresh/dir --toolchain TOOLCHAIN_ROOT \\ + --packages PACKAGES_ROOT [--root REPO_ROOT] [--preflight-only] +""" +import argparse +from datetime import datetime, timezone +from hashlib import sha256 +import json +import os +from pathlib import Path +import re +import shutil +import signal +import subprocess +import sys +import time + +HERE = Path(__file__).resolve().parent +DEFAULT_ROOT = HERE.parents[2] +PACKAGE_REL = Path('research/selected-compiler-source-bridge/lean') +BASE_REL = Path('research/selected-compiler-visitation-audit/lean') + +LEAN_VERSION = 'version 4.34.1,' +LEAN_COMMIT = '5045d0056413266e57c625dcd7c365b10e377c52' +TOOLCHAIN_PIN = 'leanprover/lean4:v4.34.1' + +BASE_MODULES = ['CompilerAudit.SelectedData', 'CompilerAudit.Visit', 'CompilerAudit.Retention', + 'CompilerAudit.Composition', 'CompilerAudit.Selected', 'CompilerAudit.Result', + 'CompilerAudit'] +BRIDGE_MODULE = 'CompilerAudit.SourceBridge' +LEAF_MODULE = BRIDGE_MODULE +MAIN_THEOREM = 'CompilerAudit.SourceBridge.selected_source_transport' +BASE_MAIN_THEOREM = 'CompilerAudit.Result.selected_compiler_model' + +BASE_SHA256 = { + 'CompilerAudit/SelectedData.lean': '7c767cf2d63aab6d46c6a2075c283eeb816781158fce90cfd13eedd1000eda88', + 'CompilerAudit/Visit.lean': '9746c2e876bcee27770fd215129cd72fc52003736cf5c088913c99d2ea1bc4d1', + 'CompilerAudit/Retention.lean': '081a35b411fe31442f727f38ab3dfdda103bd25e0c5950cf2b1733b5f426bbca', + 'CompilerAudit/Composition.lean': '022caba159e2034d9f09c92145a47caa849c46edeead5766d58a066abf47621f', + 'CompilerAudit/Selected.lean': '3b77f822e939d2d2cd3b38d92a7b73836a764eaa939aa840711bbbab7f2037e0', + 'CompilerAudit/Result.lean': 'e9499bac894329f28e9fc491ac00fd640f8e25fdf7f80ad5883954ff2bcc15d5', + 'CompilerAudit.lean': '3883991717fcfff245e90355439acb8884b3f58a943fc0fd473a037cee213dde', + 'lean-toolchain': 'd5edba4e4b8faad9c1baeadb265716d20d03be4d1a2647dc5e35b0c0325bea7b', + 'lakefile.toml': 'efacc633cf25b8f18df232bc2094a9a76813ad7676a9bf88e2df836891f9995c', + 'lake-manifest.json': 'f0e42d04edd670ffa604a770562c9dc400e21809bb5809a69c2c1cb342fe1579', +} +BRIDGE_REL = 'CompilerAudit/SourceBridge.lean' +# Candidate published bytes (header comment corrected). +BRIDGE_SHA256 = 'cb7ce5a50357fe01d4e9bf0a6c65d8767e431d3124d3e14d06e90f0bd46c38fa' +# Previously checked bytes; recorded for provenance only, not required on disk. +PRIOR_BRIDGE_SHA256 = '6027af1a083bbca309f406762dc7526e11aac6f4c4cdb90d9aa7427ad04182f9' +# SHA-256 of strip_lean_comments(source) -- equal for prior and candidate bytes. +BRIDGE_FORMAL_SHA256 = 'd1900d991547da0aa0c2f6b380ec2a60707d66907c36c39dca7eb4e3602f760a' + +# name -> (rev, url, library root on LEAN_PATH) +DEPENDENCIES = { + 'mathlib': ('d13f23b723b8a846827a245b89c10fc7d3f11612', 'https://github.com/leanprover-community/mathlib4', True), + 'plausible': ('118aa17ee84656b8bd727fef7c458ee8c833385c', 'https://github.com/leanprover-community/plausible', True), + 'LeanSearchClient': ('ddf04cf3949fa556442341e87d47f9f6e6074707', 'https://github.com/leanprover-community/LeanSearchClient', True), + 'importGraph': ('e928b72544873815af278d38681b31c0293588e3', 'https://github.com/leanprover-community/import-graph', True), + 'proofwidgets': ('106ff4fafc74ef4ac99d81dbf3ab399118f497a5', 'https://github.com/leanprover-community/ProofWidgets4', True), + 'aesop': ('355695d523e41d0554926416cba2a2b3544fbbc9', 'https://github.com/leanprover-community/aesop', True), + 'Qq': ('6a489d9af5d0c47e5b259e2e8bcdfc1811b5a259', 'https://github.com/leanprover-community/quote4', True), + 'batteries': ('f2effa3d803fda822b1f97b806c47cf2adfbcbc2', 'https://github.com/leanprover-community/batteries', True), + 'Cli': ('e92c9f15fdfacc8536f31cfb3b7ad26c3c8cd204', 'https://github.com/leanprover/lean4-cli', False), +} +RESERVED_TOP = {'CompilerAudit', 'Init', 'Lean', 'Std', 'Lake', 'LeanChecker'} + +REQUIRED_THEOREMS = [ + 'flatMap_range\'_const', 'flatMap_range_const', 'product_map_swap', 'product_map_keep', + 'groupWord_low', 'groupWord_idle', 'map_eq_self_of', 'lows_rank', 'rank_injOn', 'lowPass_eq', + 'replicaPass_map', 'idlePass_map', 'sweep_transport', 'idle_transport', 'sourceTrace_cons', + 'trace_transport', 'mem_eventTrace_low', 'mem_sourceTrace_low', 'toFinset_map_card', + 'source_distinct', 'fm_other', 'fm_block', 'fm_seg', 'refs_emit', 'refs_length', + 'retained_emit', 'selected_source_transport'] +REQUIRED_NAMES = ['CompilerAudit.SourceBridge.' + n for n in REQUIRED_THEOREMS] +ALLOWED_AXIOMS = frozenset({'propext', 'Classical.choice', 'Quot.sound'}) +FORBIDDEN_TOKENS = ('sorry', 'admit', 'axiom', 'native_decide', 'unsafe', 'implemented_by', 'extern', + 'opaque', 'partial', 'ofReduceBool', 'trustCompiler', 'set_option', 'skipKernel', + 'debug', 'macro_rules', 'elab', 'initialize') +LEAN_FLAGS = ['-j', '1', '-M', '2048', '-DmaxRecDepth=4096', '-DmaxHeartbeats=800000'] + +# Byte-identical (after CRLF->LF) to integration/bridge-attempt3/ExactTypeAndAllAxioms.lean +# of the prior local review, whose LF-normalized SHA-256 is pinned below. +PRIOR_EXACT_TYPE_SHA256_LF = '1d4dcf9a9e534249c67a5a24d1135b55e09c024a9aecd3d6a7b6aace0c0b5408' +PRIOR_EXACT_TYPE_STDOUT_SHA256 = 'c72212c31417e4aa9cab684fbb5d357c528f5157d3714fa61c1392f29c741a9b' +EXACT_TYPE_HEAD = '''import CompilerAudit.SourceBridge +namespace BridgeReview +open CompilerAudit CompilerAudit.SourceBridge +example {α W : Type} [DecidableEq α] [DecidableEq W] + (lows : List α) (rank : α → Nat) (unrank : Nat → α) (N : Nat) + (hlows : lows = (List.range N).map unrank) (hinv : ∀ o, o < N → rank (unrank o) = o) + (sched : List Event) + (hsched : List.Forall₂ (Matches SelectedData.replicaCount) (residualEvents sched) + Selected.groups) + (blocks : Key → Nat) (segs : List (Seg W)) (tail : Nat) + (hbud : segs.map Seg.blocks = + (sourceTrace lows SelectedData.replicaCount sched).map fun k => blocks (rename rank k)) + (hfresh : (segs.map Seg.wrapper).Nodup) : + (sourceTrace lows SelectedData.replicaCount sched).map (rename rank) = Selected.word N ∧ + (sourceTrace lows SelectedData.replicaCount sched).toFinset.card = 28278 * N ∧ + (srcRetained (emitSrc segs tail)).card = 904896 * N ∧ + (srcRefs (emitSrc segs tail)).length = 1809792 * N + Result.blockTotal N blocks := by + exact CompilerAudit.SourceBridge.selected_source_transport lows rank unrank N hlows hinv + sched hsched blocks segs tail hbud hfresh +end BridgeReview +''' +# Expected type copied from the frozen baseline check.py. +BASE_CONTRACT = '''import CompilerAudit +example (N : Nat) (blocks : CompilerAudit.Key → Nat) : + (CompilerAudit.Selected.word N).toFinset.card = 28278 * N ∧ + (CompilerAudit.Retention.retained (CompilerAudit.Result.program N blocks)).card = 904896 * N ∧ + (CompilerAudit.Retention.refs (CompilerAudit.Result.program N blocks)).length = + 1809792 * N + CompilerAudit.Result.blockTotal N blocks := + CompilerAudit.Result.selected_compiler_model N blocks +#print axioms CompilerAudit.Result.selected_compiler_model +''' +# Contract probes: (file, expectation, expected error line, diagnostic signature). +PROBES = [ + ('A1_ConcreteContract.lean', 'accept', None, None), + ('R1_FreshnessRequired.lean', 'reject', 5, 'is false'), + ('R2_WrongRetainedCoefficient.lean', 'reject', 19, 'ype mismatch'), +] +PROTECTED_MARKERS = ('.git', 'LOCAL-MANIFEST.json', 'EXPORT-MANIFEST.json') +PASS_THROUGH_ENV = ('SYSTEMROOT', 'SystemRoot', 'WINDIR', 'SystemDrive', 'TEMP', 'TMP', 'TMPDIR', + 'HOME', 'USERPROFILE', 'LANG', 'LC_ALL') +AMBIGUOUS_PREFIXES = ('LEAN', 'LAKE', 'ELAN', 'GIT_', 'LD_', 'DYLD_') +EXE = '.exe' if os.name == 'nt' else '' + + +class CheckError(ValueError): + pass + + +def need(ok, message): + if not ok: + raise CheckError(message) + + +def digest(path): + h = sha256() + with open(path, 'rb') as f: + for block in iter(lambda: f.read(1 << 20), b''): + h.update(block) + return h.hexdigest() + + +def is_within(path, parent): + try: + Path(path).resolve().relative_to(Path(parent).resolve()) + return True + except ValueError: + return False + + +def strip_lean_comments(text): + """Remove nested block comments (incl. doc comments) and line comments.""" + out, i, n, depth = [], 0, len(text), 0 + while i < n: + if depth: + if text.startswith('/-', i): + depth, i = depth + 1, i + 2 + elif text.startswith('-/', i): + depth, i = depth - 1, i + 2 + else: + i += 1 + elif text.startswith('/-', i): + depth, i = 1, i + 2 + elif text.startswith('--', i): + j = text.find('\n', i) + i = n if j < 0 else j + elif text[i] == '"': + j = i + 1 + while j < n and text[j] != '"': + j += 2 if text[j] == '\\' else 1 + need(j < n, 'unterminated string literal') + out.append(text[i:j + 1]) + i = j + 1 + else: + out.append(text[i]) + i += 1 + need(depth == 0, 'unterminated block comment') + return ''.join(out) + + +def formal_digest(data): + return sha256(strip_lean_comments(data.decode('utf-8')).encode('utf-8')).hexdigest() + + +def scan_forbidden(code, label): + for token in FORBIDDEN_TOKENS: + need(not re.search(r'(? rfl⟩ + +-- Two residual segments (2 and 0 blocks), one wrapper-free prefix op and a tail of 3. +example : (srcRefs (emitSrc ([⟨1, 7, 2⟩, ⟨0, 8, 0⟩] : List (Seg Nat)) 3)).length = 6 := by decide +example : (srcRetained (emitSrc ([⟨1, 7, 2⟩, ⟨0, 8, 0⟩] : List (Seg Nat)) 3)).card = 2 := by decide +example : (srcRefs (emitSrc ([⟨1, 7, 2⟩, ⟨0, 8, 0⟩] : List (Seg Nat)) 3)).length = 6 := + (refs_length ([⟨1, 7, 2⟩, ⟨0, 8, 0⟩] : List (Seg Nat)) 3).trans (by decide) + +-- Freshness is load-bearing: duplicate wrappers collapse the retained count. +example : (srcRetained (emitSrc ([⟨0, 7, 0⟩, ⟨0, 7, 0⟩] : List (Seg Nat)) 0)).card = 1 := by decide diff --git a/research/selected-compiler-source-bridge/lean/probes/R1_FreshnessRequired.lean b/research/selected-compiler-source-bridge/lean/probes/R1_FreshnessRequired.lean new file mode 100644 index 0000000000..63d501a33f --- /dev/null +++ b/research/selected-compiler-source-bridge/lean/probes/R1_FreshnessRequired.lean @@ -0,0 +1,5 @@ +-- SPDX-License-Identifier: Apache-2.0 +import CompilerAudit.SourceBridge +open CompilerAudit.SourceBridge +-- Negative probe: without wrapper freshness, retained count is not the segment count. +example : (srcRetained (emitSrc ([⟨0, 7, 0⟩, ⟨0, 7, 0⟩] : List (Seg Nat)) 0)).card = 2 := by decide diff --git a/research/selected-compiler-source-bridge/lean/probes/R2_WrongRetainedCoefficient.lean b/research/selected-compiler-source-bridge/lean/probes/R2_WrongRetainedCoefficient.lean new file mode 100644 index 0000000000..917960a6bc --- /dev/null +++ b/research/selected-compiler-source-bridge/lean/probes/R2_WrongRetainedCoefficient.lean @@ -0,0 +1,19 @@ +-- SPDX-License-Identifier: Apache-2.0 +import CompilerAudit.SourceBridge +open CompilerAudit CompilerAudit.SourceBridge +-- Negative probe: the main theorem does not prove a perturbed retained coefficient. +example {α W : Type} [DecidableEq α] [DecidableEq W] + (lows : List α) (rank : α → Nat) (unrank : Nat → α) (N : Nat) + (hlows : lows = (List.range N).map unrank) (hinv : ∀ o, o < N → rank (unrank o) = o) + (sched : List Event) + (hsched : List.Forall₂ (Matches SelectedData.replicaCount) (residualEvents sched) + Selected.groups) + (blocks : Key → Nat) (segs : List (Seg W)) (tail : Nat) + (hbud : segs.map Seg.blocks = + (sourceTrace lows SelectedData.replicaCount sched).map fun k => blocks (rename rank k)) + (hfresh : (segs.map Seg.wrapper).Nodup) : + (sourceTrace lows SelectedData.replicaCount sched).map (rename rank) = Selected.word N ∧ + (sourceTrace lows SelectedData.replicaCount sched).toFinset.card = 28278 * N ∧ + (srcRetained (emitSrc segs tail)).card = 904897 * N ∧ + (srcRefs (emitSrc segs tail)).length = 1809792 * N + Result.blockTotal N blocks := by + exact CompilerAudit.SourceBridge.selected_source_transport lows rank unrank N hlows hinv sched hsched blocks segs tail hbud hfresh diff --git a/research/selected-compiler-source-bridge/lean/tests/fixtures/prior-exact-type-all-axioms.stdout b/research/selected-compiler-source-bridge/lean/tests/fixtures/prior-exact-type-all-axioms.stdout new file mode 100644 index 0000000000..dd36046fc3 --- /dev/null +++ b/research/selected-compiler-source-bridge/lean/tests/fixtures/prior-exact-type-all-axioms.stdout @@ -0,0 +1,136 @@ +CompilerAudit.SourceBridge.flatMap_range'_const {β : Type} (f : ℕ → List β) (xs : List β) (s n : ℕ) : + (∀ (r : ℕ), s ≤ r → r < s + n → f r = xs) → List.flatMap f (List.range' s n) = CompilerAudit.copies n xs +'CompilerAudit.SourceBridge.flatMap_range'_const' depends on axioms: [propext, Quot.sound] +CompilerAudit.SourceBridge.flatMap_range_const {β : Type} (f : ℕ → List β) (xs : List β) (n : ℕ) + (h : ∀ r < n, f r = xs) : List.flatMap f (List.range n) = CompilerAudit.copies n xs +'CompilerAudit.SourceBridge.flatMap_range_const' depends on axioms: [propext, Quot.sound] +CompilerAudit.SourceBridge.product_map_swap (l₁ l₂ : List ℕ) (c : Bool) : + List.map (fun p => (p.2, c, p.1)) (l₁ ×ˢ l₂) = List.flatMap (fun o => List.map (fun i => (i, c, o)) l₂) l₁ +'CompilerAudit.SourceBridge.product_map_swap' depends on axioms: [propext] +CompilerAudit.SourceBridge.product_map_keep (l₁ l₂ : List ℕ) (c : Bool) : + List.map (fun p => (p.1, c, p.2)) (l₁ ×ˢ l₂) = List.flatMap (fun i => List.map (fun o => (i, c, o)) l₂) l₁ +'CompilerAudit.SourceBridge.product_map_keep' depends on axioms: [propext] +CompilerAudit.SourceBridge.groupWord_low (N : ℕ) (g : CompilerAudit.Group) (hc : g.common = true) + (hl : g.lowMajor = true) : + CompilerAudit.groupWord N g = List.flatMap (fun o => List.map (fun i => (i, true, o)) g.ids) (List.range N) +'CompilerAudit.SourceBridge.groupWord_low' depends on axioms: [propext] +CompilerAudit.SourceBridge.groupWord_idle (N : ℕ) (g : CompilerAudit.Group) (hc : g.common = false) + (hl : g.lowMajor = false) : + CompilerAudit.groupWord N g = List.flatMap (fun i => List.map (fun o => (i, false, o)) (List.range N)) g.ids +'CompilerAudit.SourceBridge.groupWord_idle' depends on axioms: [propext] +CompilerAudit.SourceBridge.map_eq_self_of (f : ℕ → ℕ) (l : List ℕ) : (∀ x ∈ l, f x = x) → List.map f l = l +'CompilerAudit.SourceBridge.map_eq_self_of' depends on axioms: [propext] +CompilerAudit.SourceBridge.lows_rank {α : Type} (lows : List α) (rank : α → ℕ) (unrank : ℕ → α) (N : ℕ) + (hlows : lows = List.map unrank (List.range N)) (hinv : ∀ o < N, rank (unrank o) = o) : + List.map rank lows = List.range N +'CompilerAudit.SourceBridge.lows_rank' depends on axioms: [propext, Quot.sound] +CompilerAudit.SourceBridge.rank_injOn {α : Type} (lows : List α) (rank : α → ℕ) (unrank : ℕ → α) (N : ℕ) + (hlows : lows = List.map unrank (List.range N)) (hinv : ∀ o < N, rank (unrank o) = o) (x : α) : + x ∈ lows → ∀ y ∈ lows, rank x = rank y → x = y +'CompilerAudit.SourceBridge.rank_injOn' depends on axioms: [propext, Quot.sound] +CompilerAudit.SourceBridge.lowPass_eq {α : Type} (evs : List CompilerAudit.SourceBridge.LocalEvent) (l : α) : + CompilerAudit.SourceBridge.lowPass evs l = + List.map (fun i => (i, true, l)) (List.flatMap CompilerAudit.SourceBridge.LocalEvent.emits evs) +'CompilerAudit.SourceBridge.lowPass_eq' depends on axioms: [propext] +CompilerAudit.SourceBridge.replicaPass_map {α : Type} (rank : α → ℕ) (evs : List CompilerAudit.SourceBridge.LocalEvent) + (lows : List α) : + List.map (CompilerAudit.SourceBridge.rename rank) (CompilerAudit.SourceBridge.replicaPass lows evs) = + List.flatMap + (fun o => List.map (fun i => (i, true, o)) (List.flatMap CompilerAudit.SourceBridge.LocalEvent.emits evs)) + (List.map rank lows) +'CompilerAudit.SourceBridge.replicaPass_map' depends on axioms: [propext] +CompilerAudit.SourceBridge.idlePass_map {α : Type} (rank : α → ℕ) (lows : List α) (ids : List ℕ) : + List.map (CompilerAudit.SourceBridge.rename rank) (CompilerAudit.SourceBridge.idlePass lows ids) = + List.flatMap (fun i => List.map (fun o => (i, false, o)) (List.map rank lows)) ids +'CompilerAudit.SourceBridge.idlePass_map' depends on axioms: [propext] +CompilerAudit.SourceBridge.sweep_transport {α : Type} (lows : List α) (rank : α → ℕ) (N replicas : ℕ) + (hlow : List.map rank lows = List.range N) (calls : ℕ → List CompilerAudit.SourceBridge.LocalEvent) + (g : CompilerAudit.Group) + (hm : CompilerAudit.SourceBridge.Matches replicas (CompilerAudit.SourceBridge.Event.sweep calls) g) : + List.map (CompilerAudit.SourceBridge.rename rank) + (CompilerAudit.SourceBridge.eventTrace lows replicas (CompilerAudit.SourceBridge.Event.sweep calls)) = + CompilerAudit.copies replicas (CompilerAudit.groupWord N g) +'CompilerAudit.SourceBridge.sweep_transport' depends on axioms: [propext, Quot.sound] +CompilerAudit.SourceBridge.idle_transport {α : Type} (lows : List α) (rank : α → ℕ) (N replicas : ℕ) + (hlow : List.map rank lows = List.range N) (ids : List ℕ) (g : CompilerAudit.Group) + (hm : CompilerAudit.SourceBridge.Matches replicas (CompilerAudit.SourceBridge.Event.idle ids) g) : + List.map (CompilerAudit.SourceBridge.rename rank) + (CompilerAudit.SourceBridge.eventTrace lows replicas (CompilerAudit.SourceBridge.Event.idle ids)) = + CompilerAudit.copies replicas (CompilerAudit.groupWord N g) +'CompilerAudit.SourceBridge.idle_transport' depends on axioms: [propext, Quot.sound] +CompilerAudit.SourceBridge.sourceTrace_cons {α : Type} (lows : List α) (replicas : ℕ) + (e : CompilerAudit.SourceBridge.Event) (es : List CompilerAudit.SourceBridge.Event) : + CompilerAudit.SourceBridge.sourceTrace lows replicas (e :: es) = + CompilerAudit.SourceBridge.eventTrace lows replicas e ++ CompilerAudit.SourceBridge.sourceTrace lows replicas es +'CompilerAudit.SourceBridge.sourceTrace_cons' depends on axioms: [propext] +CompilerAudit.SourceBridge.trace_transport {α : Type} (lows : List α) (rank : α → ℕ) (N replicas : ℕ) + (hlow : List.map rank lows = List.range N) (sched : List CompilerAudit.SourceBridge.Event) + (groups : List CompilerAudit.Group) : + List.Forall₂ (CompilerAudit.SourceBridge.Matches replicas) (CompilerAudit.SourceBridge.residualEvents sched) groups → + List.map (CompilerAudit.SourceBridge.rename rank) (CompilerAudit.SourceBridge.sourceTrace lows replicas sched) = + CompilerAudit.visitWord groups replicas N +'CompilerAudit.SourceBridge.trace_transport' depends on axioms: [propext, Quot.sound] +CompilerAudit.SourceBridge.mem_eventTrace_low {α : Type} (lows : List α) (replicas : ℕ) + (e : CompilerAudit.SourceBridge.Event) (k : CompilerAudit.SourceBridge.SKey α) + (hk : k ∈ CompilerAudit.SourceBridge.eventTrace lows replicas e) : k.2.2 ∈ lows +'CompilerAudit.SourceBridge.mem_eventTrace_low' depends on axioms: [propext, Quot.sound] +CompilerAudit.SourceBridge.mem_sourceTrace_low {α : Type} (lows : List α) (replicas : ℕ) + (sched : List CompilerAudit.SourceBridge.Event) (k : CompilerAudit.SourceBridge.SKey α) + (hk : k ∈ CompilerAudit.SourceBridge.sourceTrace lows replicas sched) : k.2.2 ∈ lows +'CompilerAudit.SourceBridge.mem_sourceTrace_low' depends on axioms: [propext, Quot.sound] +CompilerAudit.SourceBridge.toFinset_map_card {β γ : Type} [DecidableEq β] [DecidableEq γ] (f : β → γ) (l : List β) + (hinj : ∀ x ∈ l, ∀ y ∈ l, f x = f y → x = y) : (List.map f l).toFinset.card = l.toFinset.card +'CompilerAudit.SourceBridge.toFinset_map_card' depends on axioms: [propext, Classical.choice, Quot.sound] +CompilerAudit.SourceBridge.source_distinct {α : Type} [DecidableEq α] (lows : List α) (rank : α → ℕ) (unrank : ℕ → α) + (N replicas : ℕ) (hlows : lows = List.map unrank (List.range N)) (hinv : ∀ o < N, rank (unrank o) = o) + (sched : List CompilerAudit.SourceBridge.Event) (groups : List CompilerAudit.Group) + (h : + List.Forall₂ (CompilerAudit.SourceBridge.Matches replicas) (CompilerAudit.SourceBridge.residualEvents sched) + groups) : + (CompilerAudit.SourceBridge.sourceTrace lows replicas sched).toFinset.card = + (CompilerAudit.visitWord groups replicas N).toFinset.card +'CompilerAudit.SourceBridge.source_distinct' depends on axioms: [propext, Classical.choice, Quot.sound] +CompilerAudit.SourceBridge.fm_other {W : Type} (n : ℕ) : + List.filterMap CompilerAudit.SourceBridge.SrcOp.ref (List.replicate n CompilerAudit.SourceBridge.SrcOp.other) = [] +'CompilerAudit.SourceBridge.fm_other' does not depend on any axioms +CompilerAudit.SourceBridge.fm_block {W : Type} (n : ℕ) (w : W) : + List.filterMap CompilerAudit.SourceBridge.SrcOp.ref (List.replicate n (CompilerAudit.SourceBridge.SrcOp.block w)) = + List.replicate n w +'CompilerAudit.SourceBridge.fm_block' does not depend on any axioms +CompilerAudit.SourceBridge.fm_seg {W : Type} (s : CompilerAudit.SourceBridge.Seg W) : + List.filterMap CompilerAudit.SourceBridge.SrcOp.ref (CompilerAudit.SourceBridge.segOps s) = + s.wrapper :: (List.replicate s.blocks s.wrapper ++ [s.wrapper]) +'CompilerAudit.SourceBridge.fm_seg' depends on axioms: [propext] +CompilerAudit.SourceBridge.refs_emit {W : Type} (segs : List (CompilerAudit.SourceBridge.Seg W)) (tail : ℕ) : + CompilerAudit.SourceBridge.srcRefs (CompilerAudit.SourceBridge.emitSrc segs tail) = + List.flatMap (fun s => s.wrapper :: (List.replicate s.blocks s.wrapper ++ [s.wrapper])) segs +'CompilerAudit.SourceBridge.refs_emit' depends on axioms: [propext] +CompilerAudit.SourceBridge.refs_length {W : Type} (segs : List (CompilerAudit.SourceBridge.Seg W)) (tail : ℕ) : + (CompilerAudit.SourceBridge.srcRefs (CompilerAudit.SourceBridge.emitSrc segs tail)).length = + 2 * segs.length + (List.map CompilerAudit.SourceBridge.Seg.blocks segs).sum +'CompilerAudit.SourceBridge.refs_length' depends on axioms: [propext, Quot.sound] +CompilerAudit.SourceBridge.retained_emit {W : Type} [DecidableEq W] (segs : List (CompilerAudit.SourceBridge.Seg W)) + (tail : ℕ) (hfresh : (List.map CompilerAudit.SourceBridge.Seg.wrapper segs).Nodup) : + (CompilerAudit.SourceBridge.srcRetained (CompilerAudit.SourceBridge.emitSrc segs tail)).card = segs.length +'CompilerAudit.SourceBridge.retained_emit' depends on axioms: [propext, Classical.choice, Quot.sound] +CompilerAudit.SourceBridge.selected_source_transport {α W : Type} [DecidableEq α] [DecidableEq W] (lows : List α) + (rank : α → ℕ) (unrank : ℕ → α) (N : ℕ) (hlows : lows = List.map unrank (List.range N)) + (hinv : ∀ o < N, rank (unrank o) = o) (sched : List CompilerAudit.SourceBridge.Event) + (hsched : + List.Forall₂ (CompilerAudit.SourceBridge.Matches CompilerAudit.SelectedData.replicaCount) + (CompilerAudit.SourceBridge.residualEvents sched) CompilerAudit.Selected.groups) + (blocks : CompilerAudit.Key → ℕ) (segs : List (CompilerAudit.SourceBridge.Seg W)) (tail : ℕ) + (hbud : + List.map CompilerAudit.SourceBridge.Seg.blocks segs = + List.map (fun k => blocks (CompilerAudit.SourceBridge.rename rank k)) + (CompilerAudit.SourceBridge.sourceTrace lows CompilerAudit.SelectedData.replicaCount sched)) + (hfresh : (List.map CompilerAudit.SourceBridge.Seg.wrapper segs).Nodup) : + List.map (CompilerAudit.SourceBridge.rename rank) + (CompilerAudit.SourceBridge.sourceTrace lows CompilerAudit.SelectedData.replicaCount sched) = + CompilerAudit.Selected.word N ∧ + (CompilerAudit.SourceBridge.sourceTrace lows CompilerAudit.SelectedData.replicaCount sched).toFinset.card = + 28278 * N ∧ + (CompilerAudit.SourceBridge.srcRetained (CompilerAudit.SourceBridge.emitSrc segs tail)).card = 904896 * N ∧ + (CompilerAudit.SourceBridge.srcRefs (CompilerAudit.SourceBridge.emitSrc segs tail)).length = + 1809792 * N + CompilerAudit.Result.blockTotal N blocks +'CompilerAudit.SourceBridge.selected_source_transport' depends on axioms: [propext, Classical.choice, Quot.sound] diff --git a/research/selected-compiler-source-bridge/lean/tests/test_check.py b/research/selected-compiler-source-bridge/lean/tests/test_check.py new file mode 100644 index 0000000000..67ea337df6 --- /dev/null +++ b/research/selected-compiler-source-bridge/lean/tests/test_check.py @@ -0,0 +1,247 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Tiny runner unit tests: no Lean execution. Run: python3 -B -m unittest discover -s tests""" +from hashlib import sha256 +import os +from pathlib import Path +import shutil +import stat +import subprocess +import sys +import tempfile +import unittest +import types + +HERE = Path(__file__).resolve().parent +sys.dont_write_bytecode = True +check = types.ModuleType('bridge_runner_under_test') +check.__file__ = str(HERE.parent/'check.py') +exec(compile((HERE.parent/'check.py').read_bytes(), check.__file__, 'exec'), check.__dict__) + +ROOT = check.DEFAULT_ROOT +BRIDGE = HERE.parent / check.BRIDGE_REL +FIXTURE = (HERE / 'fixtures' / 'prior-exact-type-all-axioms.stdout').read_text(encoding='utf-8') +GIT = shutil.which('git') + + +class Tmp(unittest.TestCase): + def setUp(self): + self.tmp = Path(tempfile.mkdtemp(prefix='bridge-check-test-')).resolve() + self.addCleanup(self.clean_temp) + + def clean_temp(self): + # Never recursively remove a computed path before checking its absolute target. + self.assertEqual(self.tmp.parent, Path(tempfile.gettempdir()).resolve()) + self.assertTrue(self.tmp.name.startswith('bridge-check-test-')) + def clear_readonly(function, path, error): + target = Path(path).resolve() + self.assertTrue(target.is_relative_to(self.tmp)) + os.chmod(path, stat.S_IWRITE) + function(path) + shutil.rmtree(self.tmp, onexc=clear_readonly) + + +class Sources(unittest.TestCase): + def test_pinned_sources_and_formal_text(self): + pins = check.source_pins(ROOT) + self.assertEqual(len(pins), len(check.BASE_SHA256) + 2 + len(check.PROBES)) + data = BRIDGE.read_bytes() + self.assertEqual(sha256(data).hexdigest(), check.BRIDGE_SHA256) + self.assertNotEqual(check.BRIDGE_SHA256, check.PRIOR_BRIDGE_SHA256) + # Comment edits keep the formal digest; a proof-token edit changes it. + self.assertEqual(check.formal_digest(data.replace(b'Status:', b'State:', 1)), check.BRIDGE_FORMAL_SHA256) + self.assertNotEqual(check.formal_digest(data.replace(b'all_goals omega', b'all_goals simp', 1)), + check.BRIDGE_FORMAL_SHA256) + + def test_comment_stripper(self): + self.assertEqual(check.strip_lean_comments('a /- x /- y -/ z -/ b -- c\nd "--k"'), 'a b \nd "--k"') + with self.assertRaises(check.CheckError): + check.strip_lean_comments('/- open /- nested -/') + + def test_inventory_and_forbidden_tokens(self): + code = check.strip_lean_comments(BRIDGE.read_text(encoding='utf-8')) + check.scan_forbidden(code, 'bridge') + self.assertEqual(sorted(check.bridge_inventory(code)), sorted(check.REQUIRED_NAMES)) + for bad in ('theorem x : True := sorry', 'theorem x : True := by native_decide', 'axiom x : False', + 'set_option debug.skipKernelTC true', '#eval 1'): + with self.assertRaises(check.CheckError): + check.scan_forbidden(code + '\n' + bad, 'bridge') + with self.assertRaises(check.CheckError): + check.bridge_inventory(code.replace('end CompilerAudit.SourceBridge', 'theorem extra : True := trivial\nend CompilerAudit.SourceBridge')) + with self.assertRaises(check.CheckError): + check.bridge_inventory(code.replace('theorem fm_other', 'def fm_other')) + + def test_exact_type_file_is_prior_review_file(self): + self.assertEqual(sha256(check.exact_type_source().encode()).hexdigest(), check.PRIOR_EXACT_TYPE_SHA256_LF) + + +class AxiomParser(unittest.TestCase): + def test_prior_output_with_apostrophe_names(self): + found = check.parse_axiom_report(FIXTURE, check.REQUIRED_NAMES) + self.assertEqual(len(found), 27) + self.assertEqual(found["CompilerAudit.SourceBridge.flatMap_range'_const"], ['propext', 'Quot.sound']) + self.assertEqual(found['CompilerAudit.SourceBridge.fm_other'], []) + self.assertEqual(sha256(FIXTURE.encode()).hexdigest(), check.PRIOR_EXACT_TYPE_STDOUT_SHA256) + + def assertRejects(self, text, names=check.REQUIRED_NAMES): + with self.assertRaises(check.CheckError): + check.parse_axiom_report(text, names) + + def test_rejections(self): + line = "'CompilerAudit.SourceBridge.fm_block' does not depend on any axioms" + self.assertIn(line, FIXTURE) + self.assertRejects(FIXTURE.replace(line + '\n', '')) # missing + self.assertRejects(FIXTURE + line + '\n') # duplicate + self.assertRejects(FIXTURE + "'Foo.bar' does not depend on any axioms\n") # extra + self.assertRejects(FIXTURE.replace(line, "'CompilerAudit.SourceBridge.fm_block' depends on axioms: [sorryAx]")) + self.assertRejects(FIXTURE.replace(line, "'CompilerAudit.SourceBridge.fm_block' depends on axioms: [Lean.ofReduceBool]")) + self.assertRejects(FIXTURE.replace(line, "'CompilerAudit.SourceBridge.fm_block' depends on axioms: [propext,\n Quot.sound]")) + self.assertRejects(FIXTURE + 'x.lean:1:0: warning: declaration uses sorry\n') + self.assertRejects(FIXTURE.replace("'CompilerAudit.SourceBridge.flatMap_range'_const'", "'CompilerAudit.SourceBridge.flatMap_range'", 1)) + + +class Leanchecker(unittest.TestCase): + def test_only_leaf_module_invocation(self): + self.assertEqual(check.leanchecker_argv('lc'), ['lc', '--verbose', 'CompilerAudit.SourceBridge']) + for target in ('', 'CompilerAudit', 'CompilerAudit.SourceBridge.selected_source_transport', '--help'): + with self.assertRaises(check.CheckError): + check.leanchecker_argv('lc', target) + + def test_leaf_output(self): + check.check_leaf_output(0, 'replaying CompilerAudit.SourceBridge\r\n', '') + for rc, out, err in ((1, 'replaying CompilerAudit.SourceBridge\n', ''), + (0, 'replaying CompilerAudit.SourceBridge\nreplaying CompilerAudit.Result\n', ''), + (0, '', ''), (0, 'replaying CompilerAudit.SourceBridge\n', 'leanchecker found a problem')): + with self.assertRaises(check.CheckError): + check.check_leaf_output(rc, out, err) + + +class Environment(Tmp): + def test_env_is_constructed_not_inherited(self): + base = {'LEAN_PATH': '/evil', 'LEAN_SYSROOT': '/evil', 'LAKE_HOME': '/evil', 'ELAN_TOOLCHAIN': 'x', + 'GIT_DIR': '/evil', 'PATH': '/usr/bin', 'LD_PRELOAD': 'x', 'SYSTEMROOT': 'C:\\Windows', 'HOME': '/h'} + build = self.tmp / 'build' + env, dropped = check.build_env(self.tmp / 'bin', [build, self.tmp / 'lib1'], base) + self.assertEqual(env['LEAN_PATH'].split(os.pathsep), [str(build), str(self.tmp / 'lib1')]) + self.assertEqual(env['PATH'], str(self.tmp / 'bin')) + self.assertEqual(set(env), {'LEAN_PATH', 'PATH', 'PYTHONDONTWRITEBYTECODE', 'SYSTEMROOT', 'HOME'}) + self.assertEqual(set(dropped), {'LEAN_PATH', 'LEAN_SYSROOT', 'LAKE_HOME', 'ELAN_TOOLCHAIN', 'GIT_DIR', 'PATH', 'LD_PRELOAD'}) + + def test_output_validation(self): + ok = check.validate_output(self.tmp / 'fresh', [ROOT]) + self.assertEqual(ok, (self.tmp / 'fresh').resolve()) + (self.tmp / 'exists').mkdir() + (self.tmp / 'guarded' / '.git').mkdir(parents=True) + for bad, roots in ((Path('relative/out'), [ROOT]), (self.tmp / 'exists', [ROOT]), + (ROOT / 'out-inside-repo', [ROOT]), (self.tmp / 'guarded' / 'out', [ROOT]), + (self.tmp / 'in' / 'out', [self.tmp / 'in'])): + with self.assertRaises(check.CheckError): + check.validate_output(bad, roots) + + def make_toolchain(self, same=False, core=True): + root = self.tmp / ('tc%d%d' % (same, core)) + (root / 'bin').mkdir(parents=True) + (root / 'bin' / ('lean' + check.EXE)).write_bytes(b'lean') + (root / 'bin' / ('leanchecker' + check.EXE)).write_bytes(b'lean' if same else b'checker') + if core: + (root / 'lib' / 'lean').mkdir(parents=True) + (root / 'lib' / 'lean' / 'Init.olean').write_bytes(b'') + (root / 'lib' / 'lean' / 'LeanChecker.olean').write_bytes(b'') + return root + + def test_toolchain_validation(self): + lean, checker, hashes = check.validate_toolchain(self.make_toolchain()) + self.assertEqual(set(hashes), {'bin/lean' + check.EXE, 'bin/leanchecker' + check.EXE}) + for kw in (dict(same=True), dict(core=False)): + with self.assertRaises(check.CheckError): + check.validate_toolchain(self.make_toolchain(**kw)) + + +class Manifest(Tmp): + def test_manifest_pins(self): + manifest = ROOT / check.BASE_REL / 'lake-manifest.json' + self.assertEqual(sorted(check.check_manifest(manifest)), sorted(check.DEPENDENCIES)) + self.assertEqual(sum(1 for v in check.DEPENDENCIES.values() if v[2]), 8) + bad = self.tmp / 'lake-manifest.json' + bad.write_bytes(manifest.read_bytes().replace(b'f2effa3d803fda822b1f97b806c47cf2adfbcbc2', b'0' * 40)) + with self.assertRaises(check.CheckError): + check.check_manifest(bad) + + def make_packages(self, extra=None): + pk = self.tmp / 'packages' + for name, (_, _, lib) in check.DEPENDENCIES.items(): + d = pk / name / '.lake' / 'build' / 'lib' / 'lean' + d.mkdir(parents=True) + (d / (name.capitalize() + 'Top.olean')).write_bytes(b'') + if extra: + target, entry = extra + p = pk / target / '.lake' / 'build' / 'lib' / 'lean' / entry + p.mkdir() + return pk + + def test_library_roots(self): + roots = check.check_library_roots(self.make_packages(), list(check.DEPENDENCIES)) + self.assertEqual(len(roots), 8) + self.assertFalse(any(r.parents[3].name == 'Cli' for r in roots)) + + def test_shadowing_rejected(self): + with self.assertRaises(check.CheckError): + check.check_library_roots(self.make_packages(('mathlib', 'CompilerAudit')), list(check.DEPENDENCIES)) + + def test_collision_rejected(self): + with self.assertRaises(check.CheckError): + check.check_library_roots(self.make_packages(('aesop', 'MathlibTop')), list(check.DEPENDENCIES)) + + +@unittest.skipIf(GIT is None, 'git unavailable') +class Dependencies(Tmp): + def git(self, path, *a): + subprocess.run([GIT, '-C', str(path), *a], check=True, capture_output=True, + env={**check.git_env(GIT), 'GIT_AUTHOR_NAME': 't', 'GIT_AUTHOR_EMAIL': 't@t', + 'GIT_COMMITTER_NAME': 't', 'GIT_COMMITTER_EMAIL': 't@t'}) + + def repo(self, name): + p = self.tmp / name + p.mkdir() + self.git(p, 'init', '-q') + (p / 'a.lean').write_text('x\n') + self.git(p, 'add', 'a.lean') + self.git(p, 'commit', '-q', '-m', 'x') + head = subprocess.run([GIT, '-C', str(p), 'rev-parse', 'HEAD'], capture_output=True, text=True).stdout.strip() + return p, head + + def test_dependency_checks(self): + p, head = self.repo('dep') + env = check.git_env(GIT) + saved = dict(check.DEPENDENCIES) + self.addCleanup(lambda: (check.DEPENDENCIES.clear(), check.DEPENDENCIES.update(saved))) + check.DEPENDENCIES['dep'] = (head, 'u', True) + self.assertTrue(check.check_dependency(GIT, p, 'dep', env)['tracked_clean']) + (p / 'new.txt').write_text('u\n') + self.assertEqual(check.check_dependency(GIT, p, 'dep', env)['untracked_nonignored_entries'], 1) + check.DEPENDENCIES['dep'] = ('0' * 40, 'u', True) + with self.assertRaises(check.CheckError): + check.check_dependency(GIT, p, 'dep', env) # wrong pin + check.DEPENDENCIES['dep'] = (head, 'u', True) + (p / 'a.lean').write_text('changed\n') + with self.assertRaises(check.CheckError): + check.check_dependency(GIT, p, 'dep', env) # dirty tracked file + (p / 'sub').mkdir() + check.DEPENDENCIES['sub'] = (head, 'u', True) + with self.assertRaises(check.CheckError): + check.check_dependency(GIT, p / 'sub', 'sub', env) # not its own checkout + + +class Probes(unittest.TestCase): + def test_probe_sources_and_expectations(self): + for f, expect, line, sig in check.PROBES: + text = (HERE.parent / 'probes' / f).read_text(encoding='utf-8') + check.scan_forbidden(check.strip_lean_comments(text), f) + if expect == 'reject': + self.assertRegex(text.splitlines()[line - 1], r'by decide$|^ exact ') + self.assertTrue(check.check_lean_output('f.lean:5:62: error: Tactic `decide` proved that the proposition\n x\nis false', 'reject', 5, 'is false')) + self.assertFalse(check.check_lean_output('f.lean:4:0: error: is false', 'reject', 5, 'is false')) + self.assertFalse(check.check_lean_output('f.lean:3:0: warning: unused', 'accept')) + + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/research/selected-compiler-source-bridge/test_capacity.py b/research/selected-compiler-source-bridge/test_capacity.py new file mode 100644 index 0000000000..9b0f49878c --- /dev/null +++ b/research/selected-compiler-source-bridge/test_capacity.py @@ -0,0 +1,113 @@ +"""Bounded arithmetic/control tests; no original source imports or scientific replay. + +Run python -I -B [-O] /path/to/test_capacity.py. The capacity module is loaded +from source bytes, never a cached .pyc; no sys.path extension is needed. +Substantial OpenAI Codex assistance. Apache-2.0; original Opus review credit +and selected-source contributor attribution are retained in capacity.py. +""" +import itertools +import math +from pathlib import Path +import sys +import types +import unittest + +path = Path(__file__).with_name("capacity.py") +capacity = types.ModuleType("_bridge_capacity_unit") +capacity.__file__ = str(path) +sys.modules[capacity.__name__] = capacity +exec(compile(path.read_bytes(), str(path), "exec", dont_inherit=True), capacity.__dict__) + + +class CapacityTests(unittest.TestCase): + def test_tiny_independent_cardinalities(self): + self.assertEqual(capacity.gl_order(2, 1), 1) + self.assertEqual(capacity.gl_order(3, 1), 2) + self.assertEqual(capacity.gl_order(2, 2), 6) + self.assertEqual(capacity.gl_order(3, 2), 48) + self.assertEqual(capacity.gl_order(2, 3), 168) + # Only 16 + 81 tiny 2x2 matrices. No GL64 enumeration/unranking. + for q in (2, 3): + nonsingular = sum((a*d - b*c) % q != 0 + for a, b, c, d in itertools.product(range(q), repeat=4)) + self.assertEqual(capacity.gl_order(q, 2), nonsingular) + + def test_independent_product_factorization(self): + for q, dimension in ((2, 1), (2, 3), (3, 2), (3, 64), (5, 4)): + alternative = q ** (dimension * (dimension - 1) // 2) + alternative *= math.prod(q**j - 1 for j in range(1, dimension + 1)) + self.assertEqual(capacity.gl_order(q, dimension), alternative) + + def test_q3_exact_arithmetic_bound(self): + report = capacity.build_report() + n3 = int(report["N_GL64_F3_exact_decimal"]) + t = int(report["T_exact_decimal"]) + minimum = int(report["min_len_2T_exact_decimal"]) + self.assertEqual(report["status"], "PASS") + self.assertEqual(n3, math.prod(3**64 - 3**k for k in range(64))) + self.assertEqual(n3.bit_length(), 6492) + self.assertEqual(len(str(n3)), 1955) + self.assertEqual(t, 904896 * n3) + self.assertEqual(minimum, 1809792 * n3) + self.assertEqual(minimum, 2 * t) + self.assertEqual(t.bit_length(), 6511) + self.assertEqual(minimum.bit_length(), 6512) + self.assertGreaterEqual(n3, (2 * 3**63)**64) + self.assertGreaterEqual(minimum, 2**6511) + self.assertLess(minimum, 2**6512) + self.assertGreater(minimum, 2**6500) + self.assertTrue(all(report["min_len_gt_conventional"].values())) + + def test_monotonic_argument_not_only_sampled_primes(self): + argument = capacity.factor_monotonicity() + self.assertIn("b >= a >= 3", argument["domain"]) + self.assertIn("64-k >= 1", argument["strictness"]) + self.assertIn("every integer q >= 3", argument["conclusion"]) + self.assertFalse(argument["formal_verification"]) + # Finite checks catch an implementation/sign error; the quantified + # positive-factor argument in the module proves the general statement. + for a, b in ((3, 3), (3, 4), (4, 5), (6, 7)): + for k in range(64): + left_a, right_a = a**k, a**(64-k) - 1 + left_b, right_b = b**k, b**(64-k) - 1 + self.assertGreater(left_a, 0) + self.assertGreater(right_a, 0) + self.assertGreaterEqual(left_b, left_a) + self.assertGreaterEqual(right_b, right_a) + self.assertEqual(a**64 - a**k, left_a * right_a) + self.assertGreaterEqual(b**64 - b**k, a**64 - a**k) + if b > a: + self.assertGreater(right_b, right_a) + self.assertGreater(b**64 - b**k, a**64 - a**k) + + def test_arithmetic_is_not_source_semantics_or_first_failure(self): + report = capacity.build_report() + self.assertFalse(report["source_semantics"]["checked_by_this_script"]) + self.assertFalse(report["source_semantics"]["first_failure_determined"]) + self.assertIn("Conditional on", report["scope"]) + self.assertIn("not a first-failure", report["range_illustration_scope"]) + self.assertIn("not falsified", report["source_semantics"]["unaffected"]) + for filename in report["source_semantics"]["files"]: + self.assertTrue(filename.startswith("research/")) + self.assertNotIn("\\", filename) + self.assertFalse(Path(filename).is_absolute()) + + def test_range_illustration_uses_only_two_ordinals(self): + report = capacity.build_report() + self.assertFalse(report["illustration_len_range_N_representable"]) + self.assertTrue(report["illustration_range_N_iterates"]) + self.assertIn("not an operation asserted", report["range_illustration_scope"]) + + def test_type_and_execution_bounds_survive_optimization(self): + for q in (True, False, 1, 0, -3, 3.0, "3", 1 << capacity.MAX_Q_BITS): + with self.subTest(q=q), self.assertRaises(capacity.Rejected): + capacity.gl_order(q) + for dimension in (True, False, 0, -1, 65, 2.0, "2"): + with self.subTest(dimension=dimension), self.assertRaises(capacity.Rejected): + capacity.gl_order(3, dimension) + # No primality assertion: q=4 is allowed for arithmetic, not asserted prime. + self.assertEqual(capacity.gl_order(4, 2), (4**2 - 1) * (4**2 - 4)) + + +if __name__ == "__main__": + unittest.main(verbosity=2) diff --git a/research/selected-compiler-source-bridge/test_independent_census.py b/research/selected-compiler-source-bridge/test_independent_census.py new file mode 100644 index 0000000000..e7c0d8e149 --- /dev/null +++ b/research/selected-compiler-source-bridge/test_independent_census.py @@ -0,0 +1,463 @@ +"""Tiny synthetic tests only; never import the actual source tree or replay science. + +Original census algorithm/control coverage retained from the verified Astra +worker. Source-only loader tests use invented temporary files, not originals. +Substantial OpenAI Codex assistance. Apache-2.0; predecessor credit retained. +Run directly with python -I -B [-O] /path/to/test_independent_census.py. +""" +import copy +import hashlib +import importlib +import importlib.util +import itertools +import json +import marshal +from pathlib import Path, PureWindowsPath +import random +import sys +import struct +import tempfile +import types +import unittest +from unittest import mock + +def own_source(name, filename): + # The package manifest is pinned by its parent verifier. Even with -I -B, + # avoid a file-location loader here: it could read stale adjacent bytecode. + path = Path(__file__).with_name(filename) + module = types.ModuleType(name) + module.__file__ = str(path) + sys.modules[name] = module + exec(compile(path.read_bytes(), str(path), "exec", dont_inherit=True), module.__dict__) + return module + + +c = own_source("_bridge_census_unit", "independent_census.py") +lifetime = own_source("_bridge_lifetime_unit", "independent_lifetime.py") + +G=[c.Group(0,'local_cover_sweep',(0,1)),c.Group(2,'idle',(2,3)),c.Group(3,'idle',())] +LOWS=('A','B') + +def cartesian_sorted(groups,replicas,lows): + # Build unordered Cartesian points then sort by grammar, NOT emitter loops + # or mixed-radix division. An independent finite order oracle. + points=[] + for gi,g in enumerate(groups): + for rp,ip,lp in itertools.product(range(replicas),range(len(g.ids)),range(len(lows))): + order=(gi,rp,lp,ip) if g.common else (gi,rp,ip,lp) + points.append((order,(gi,rp,g.ids[ip],g.common,lows[lp]))) + return [v for _,v in sorted(points)] + + +def certificate(groups=G): + rows=[] + for i,g in enumerate(groups): + rows.append({'index':i,'schedule_index':g.schedule_index,'kind':g.kind, + 'common':g.common,'low_major':g.common, + 'order':'low-major' if g.common else 'id-major', + 'start':g.ids[0] if g.ids else 4,'count':len(g.ids), + 'sequence_sha256':c.digest_ids(g.ids)}) + return {'request_count':4,'replica_count':2,'empty_groups':1, + 'empty_canonical_start':4,'groups':rows} + + +class CensusTests(unittest.TestCase): + def test_handwritten_word(self): + # A two-request local group switches request faster than LOW; + # a two-request idle group switches LOW faster than request. + pairs=[(0,True,'A'),(1,True,'A'),(0,True,'B'),(1,True,'B')]*2 + pairs += [(2,False,'A'),(2,False,'B'),(3,False,'A'),(3,False,'B')]*2 + actual=c.projected_word(G,2,LOWS) + self.assertEqual([(r,v,l) for _,_,r,v,l in actual],pairs) + self.assertEqual(c.check_word(G,2,LOWS,actual),{'visits':16,'distinct_keys':8,'multiplicity':2}) + self.assertEqual(actual,cartesian_sorted(G,2,LOWS)) + + def test_counts_preserving_order_mutants(self): + original=c.projected_word(G,2,LOWS) + mutants={} + wrong=original[:];wrong[1],wrong[2]=wrong[2],wrong[1];mutants['local_id_major']=wrong + wrong=original[:];wrong[9],wrong[10]=wrong[10],wrong[9];mutants['idle_low_major']=wrong + wrong=original[4:8]+original[:4]+original[8:];mutants['replica_swap']=wrong + wrong=original[8:]+original[:8];mutants['group_swap']=wrong + wrong=original[:];wrong[0],wrong[1]=wrong[1],wrong[0];mutants['request_swap']=wrong + for name,word in mutants.items(): + with self.subTest(name=name): + self.assertEqual(c.Counter(word),c.Counter(original)) + with self.assertRaises(c.Rejected): c.check_word(G,2,LOWS,word) + + def test_wrong_view_preserves_counts_and_multiplicity(self): + original=c.projected_word(G,2,LOWS) + wrong=[(j,r,i,not view,l) for j,r,i,view,l in original] + counts=c.Counter((i,v,l) for _,_,i,v,l in wrong) + self.assertEqual(len(counts),8);self.assertEqual(set(counts.values()),{2}) + with self.assertRaises(c.Rejected): c.check_word(G,2,LOWS,wrong) + + def test_common_integer_not_boolean(self): + original=c.projected_word(G,2,LOWS) + wrong=[(j,r,i,int(v),l) for j,r,i,v,l in original] + self.assertEqual(wrong,original) # ordinary equality would miss this + with self.assertRaises(c.Rejected): c.check_word(G,2,LOWS,wrong) + + def test_duplicate_gap_same_total(self): + bad=[c.Group(0,'local_cover_sweep',(0,0)),c.Group(2,'idle',(2,3))] + self.assertEqual(sum(len(g.ids) for g in bad),4) + with self.assertRaises(c.Rejected): c.partition(bad,4) + word=c.projected_word(G,2,LOWS);word[1]=word[0] + with self.assertRaises(c.Rejected): c.check_word(G,2,LOWS,word) + + def test_overlap_gap_empty_and_type_boundaries(self): + for groups,R in [([c.Group(0,'idle',(0,)),c.Group(1,'idle',(0,))],2), + ([c.Group(0,'idle',(0,2))],3), + ([c.Group(0,'idle',(False,))],1), + ([c.Group(0,'idle',(-1,))],1), + ([c.Group(0,'idle',(0,)),c.Group(0,'idle',())],1)]: + with self.assertRaises(c.Rejected): c.partition(groups,R) + c.partition(G,4) + for bad in (-1,16,True): + with self.assertRaises(c.Rejected): c.visit_at(G,2,LOWS,bad) + for badlows in ((),('A','A')): + with self.assertRaises(c.Rejected): c.visit_at(G,2,badlows,0) + self.assertEqual(c.projected_word([c.Group(0,'idle',())],2,LOWS),[]) + + def test_missing_extra_replica(self): + for rho in (1,3): + with self.assertRaises(c.Rejected): c.check_word(G,2,LOWS,c.projected_word(G,rho,LOWS)) + + def test_seeded_cartesian_crosscheck(self): + rng=random.Random(3391) + for _ in range(70): + groups=[];identifier=0 + for j in range(rng.randrange(1,7)): + count=rng.randrange(0,5) + ids=tuple(range(identifier,identifier+count));identifier+=count + groups.append(c.Group(j*2,rng.choice(('idle','local_cover_sweep')),ids)) + rho=rng.randrange(1,5);lows=tuple(range(rng.randrange(1,5))) + c.partition(groups,identifier) + self.assertEqual(c.projected_word(groups,rho,lows),cartesian_sorted(groups,rho,lows)) + + def test_interval_controls(self): + data=certificate();self.assertEqual(c.interval_data(data,G),G) + changes=[('common',False),('low_major',False),('order','id-major'), + ('start',1),('count',3),('index',1),('schedule_index',3), + ('sequence_sha256','0'*64),('count',True)] + for key,value in changes: + with self.subTest(key=key): + bad=copy.deepcopy(data);bad['groups'][0][key]=value + with self.assertRaises(c.Rejected):c.interval_data(bad,G) + bad=copy.deepcopy(data);bad['groups'].pop();bad['empty_groups']=0 + # A partition by itself cannot detect a dropped zero-size group. + self.assertEqual(len(c.interval_data(bad)),2) + with self.assertRaises(c.Rejected):c.interval_data(bad,G) + + def test_self_consistent_data_is_not_source_authentication(self): + bad=certificate() + # Interchange equally sized local/idle intervals, recalculate digests. + # Partition and all totals still pass: only source linkage rejects it. + for row,start in zip(bad['groups'][:2],(2,0)): + row['start']=start;row['sequence_sha256']=c.digest_ids(range(start,start+2)) + c.interval_data(bad) + with self.assertRaises(c.Rejected):c.interval_data(bad,G) + + def test_posix_spelling_preserves_windows_components(self): + root=PureWindowsPath('E:/review/predecessor') + path=root/'vendor'/'words.py';rel=path.relative_to(root) + self.assertEqual(str(rel),'vendor\\words.py') + self.assertEqual(rel.as_posix(),'vendor/words.py') + self.assertEqual(root/PureWindowsPath(rel.as_posix()),path) + + def test_raw_request_projection_small_data(self): + # Generic hosting fixture, not selected data or an original module. + events=[[0,0,0,1,1,0],[1,1,0,1,1,0],[2,0,2,1,0,1,0],[3,0,2,1,0,0,0]] + t={'replicas':2,'stages':1, + 'calls':[{'stage':0,'replica':r,'orientation':'forward','local_hash':'fixture'} for r in (0,1)], + 'local_programs':{'forward':events}, + 'schedule':[{'kind':'local_cover_sweep','stage':0}, + {'kind':'idle','idx':0,'source_level':-1,'target_level':0,'rank':7,'pair':0}, + {'kind':'idle','idx':1,'source_level':0,'target_level':0,'rank':0,'pair':1}], + 'hosting':{'slots':[[0,0,0,7,0,0]]}} + groups,requests,ev,mp,idles=c.raw_groups(t) + self.assertEqual(groups[0].ids,(0,1));self.assertEqual(mp[0],(0,None,1,None)) + self.assertEqual(len(requests),223);self.assertEqual(len(idles[0]),221) + self.assertEqual(requests[2]['role'],1);self.assertEqual(idles[1],()) + bad=copy.deepcopy(t);bad['hosting']['slots']*=2 + with self.assertRaises(c.Rejected):c.raw_groups(bad) + + + +def record(raw): + return {"sha256": hashlib.sha256(raw).hexdigest(), + "git_blob": hashlib.sha1(b"blob " + str(len(raw)).encode() + b"\0" + raw).hexdigest()} + + +class AuthenticationTests(unittest.TestCase): + def test_safe_paths(self): + for value in ("../escape.py", "/outside.py", "C:/outside.py", "C:relative.py", + "a\\b.py", "a//b.py", "a/./b.py", "a/../b.py", "", ".", False): + with self.subTest(value=value): + with self.assertRaises(c.Rejected): + c.safe_relative(value) + with self.assertRaises(lifetime.Rejected): + lifetime.safe_source_path(value) + self.assertEqual(c.safe_relative("research/package/module.py"), "research/package/module.py") + + def test_git_free_inventory_and_byte_mutations(self): + # 149 tiny invented inputs, not a copy/replay of the selected source. + with tempfile.TemporaryDirectory(prefix="bridge-auth-") as tmp: + root = Path(tmp).resolve() + manifest = {"package_sha256": {}, "live_inputs": []} + for index in range(28): + rel = c.AUDIT + f"/fixture-{index}.json" + path = root / rel + path.parent.mkdir(parents=True, exist_ok=True) + raw = str(index).encode() + path.write_bytes(raw) + manifest["package_sha256"][rel] = record(raw)["sha256"] + for index in range(121): + rel = f"fixture-inputs/input-{index}.bin" + path = root / rel + path.parent.mkdir(parents=True, exist_ok=True) + raw = str(index).encode() + path.write_bytes(raw) + manifest["live_inputs"].append({"path": rel, **record(raw)}) + self.assertFalse((root / ".git").exists()) + self.assertEqual(c.authenticate(root, manifest), { + "package_files": 28, "live_inputs": 121, + "all_bytes_checked_before_source_import": True}) + for rel in (next(iter(manifest["package_sha256"])), manifest["live_inputs"][0]["path"]): + path = root / rel + raw = path.read_bytes() + path.write_bytes(raw + b"changed") + with self.assertRaisesRegex(c.Rejected, "SHA256 mismatch"): + c.authenticate(root, manifest) + path.write_bytes(raw) + changed = copy.deepcopy(manifest) + changed["live_inputs"][0]["git_blob"] = "0" * 40 + with self.assertRaisesRegex(c.Rejected, "Git blob mismatch"): + c.authenticate(root, changed) + changed = copy.deepcopy(manifest) + changed["live_inputs"][1] = changed["live_inputs"][0] + with self.assertRaisesRegex(c.Rejected, "unique independent pin"): + c.pin_index(changed) + extra = root / c.AUDIT / "extra.py" + extra.write_bytes(b"raise RuntimeError('never import this')") + with self.assertRaisesRegex(c.Rejected, "inventory"): + c.authenticate(root, manifest) + # Fixture cleanup belongs to TemporaryDirectory, never the repository. + + def test_manifest_data_contract(self): + manifest = c.load_manifest() # only this successor's DATA trust anchor + self.assertEqual(len(manifest["package_sha256"]), 28) + self.assertEqual(len(manifest["live_inputs"]), 121) + self.assertEqual(len(c.pin_index(manifest)), 149) + self.assertEqual(len(lifetime.source_pins()), 61) + self.assertEqual(manifest["main_scientific_receipt_sha256"], + "c1bc50f54937cd3b2efae61bb5b655b55859b3ed7ddcf1a2e9bbd8682fc88f3d") + + def test_windows_adapter_exact_one_expression(self): + raw = ("def spelling(path, here):\n return " + c.WINDOWS_OLD + "\n").encode() + expected = raw.replace(c.WINDOWS_OLD.encode(), c.WINDOWS_NEW.encode()) + self.assertEqual(c.windows_inventory_adapter(raw), expected) + for invalid in (b"no anchor", raw + raw): + with self.assertRaisesRegex(c.Rejected, "exact inventory adapter anchor"): + c.windows_inventory_adapter(invalid) + + def test_timeout_wrapper_preserves_optimization(self): + for level in (0, 1, 2): + command = c.source_command(Path(__file__).parent, level) + self.assertEqual(command[:3], [sys.executable, "-I", "-B"]) + self.assertEqual([part for part in command if part in ("-O", "-OO")], + ["-" + "O" * level] if level else []) + self.assertIn("--source", command) + for invalid in (True, -1, 3): + with self.assertRaises(c.Rejected): + c.source_command(Path(__file__).parent, invalid) + + +class SourceImportTests(unittest.TestCase): + def setUp(self): + self.temporary = tempfile.TemporaryDirectory(prefix="bridge-import-") + self.addCleanup(self.temporary.cleanup) + self.root = Path(self.temporary.name).resolve() + self.name = "_bridge_invented_module" + self.rel = c.CALLER + "/" + self.name + ".py" + self.path = self.root / self.rel + self.path.parent.mkdir(parents=True, exist_ok=True) + self.raw = b"value = 7\ndef identity(x: int) -> int: return x\n" + self.path.write_bytes(self.raw) + + def importers(self, pins=None): + pins = {self.rel: record(self.raw)} if pins is None else pins + return (("census", c.SourceImports(self.root, pins), c.Rejected), + ("lifetime", lifetime.SourceFinder(self.root, {}, { + rel: row["sha256"] for rel, row in pins.items()}), lifetime.Rejected)) + + def test_source_only_stale_bytecode_and_cleanup(self): + # A valid timestamp header pointing to a poisonous code object. Both + # adjacent and current-optimization cache paths must be ignored. + stat = self.path.stat() + stale = (importlib.util.MAGIC_NUMBER + struct.pack("