diff --git a/docs/ci-verification.md b/docs/ci-verification.md index 63ba3e9aa8..52b62d0481 100644 --- a/docs/ci-verification.md +++ b/docs/ci-verification.md @@ -1,8 +1,25 @@ # CI verification -## Current selected-family replay: #6030 +## Current selected-family replay: #7000 with #7001 The [selected record](../certificates/selected-result.json) binds conditional +κ = 0.00363005817 to the [application review](research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md), +[validation receipts](research/pr-intake-evidence/pr7000-application/VALIDATION.json), +and [explicit source closure](../certificates/frontier7000-source.json). +`make frontier7000-verify` follows that exact-source selected replay. The review +reuses eleven authenticated preceding executions and records seven fresh serial +application, scalar and complete native-catalogue executions. The earlier +monolithic timeout is retained separately and is not completed coverage. +Consult the receipts for exact commands, source heads and limits. + +The five inherited framework assumptions remain. No complete uniform word, +literal multiplier execution, independent human proof or formal-kernel proof +is asserted. Routine research submissions do not need to rerun this +selected-family replay. The sections below preserve historical checkpoints. + +## Historical selected-family replay: #6030 + +The [historical checkpoint](../certificates/checkpoints/frontier6030.json) binds conditional κ = 0.003125804 to the [proof review](research/pr-intake-evidence/pr6030-audit/PROOF-REVIEW.md), [validation receipts](research/pr-intake-evidence/pr6030-audit/VALIDATION.json), and [explicit source closure](../certificates/frontier6030-source.json). diff --git a/research/cf6a-banked-role1256-relay/.gitattributes b/research/cf6a-banked-role1256-relay/.gitattributes new file mode 100644 index 0000000000..d2f03c8025 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/.gitattributes @@ -0,0 +1 @@ +credits/PR7669-PROVENANCE.md -text !eol whitespace=cr-at-eol diff --git a/research/cf6a-banked-role1256-relay/ASSETS.json b/research/cf6a-banked-role1256-relay/ASSETS.json new file mode 100644 index 0000000000..1bc3bee518 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/ASSETS.json @@ -0,0 +1,502 @@ +{ + "caller_sha256": "62d94fb992acab0a71c3d12f22be4ce63f4f65e5cbe3f420b93aa1393ffa8dcf", + "canonical_main": "e54523517d0f03e58352e647c403a5af3e525a57", + "child_sha256": "8e7b755bd2d2d387bc3d3adfe48100985adf74775ca5acbb143170a3d16b5ccf", + "ci_prerequisite": "0eabc624a9bc9ed2847719efd63390db4d297df4", + "files": [ + { + "bytes": 61, + "path": ".gitattributes", + "sha256": "df132c7b9b59c1039cd707e90c4a4b5228823cd6399be6e890a4b0072448d927", + "source_git_blob": "d2f03c8025090bbaeae584bf1025557c1de56e93", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/.gitattributes" + }, + { + "bytes": 8396, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "CALLER.md", + "sha256": "5d2f734b0a349e15a8066633b0852961a47a076f7f9565ca985fb35ad56e6988" + }, + { + "bytes": 3498, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "CONSTRUCTION.md", + "sha256": "dc8eec5255601d110123a9ab1eaba3cc9c507b49645f295287160946c4a02357" + }, + { + "bytes": 11357, + "path": "LICENSE", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "source_git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "source_head": "7d84799a447867d36137d12ef7ca5646154d763c", + "source_path": "research/cf6a-nine-swap-supplied-word/LICENSE" + }, + { + "bytes": 4809, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "NATIVE.md", + "sha256": "7c45da0ec2aabbc1468e017418c6d0294a4ce328c584bb7111cfc9431a299eab" + }, + { + "bytes": 1259, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "NOTICE", + "sha256": "49657dd50c9431642a9527b0d625197cb34d1838dcf00fe4d92040f9605c8ce0" + }, + { + "bytes": 13385, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "PHYSICAL.md", + "sha256": "89d3d8c41552f86f2582749812436390250fdef5c8a4711d40e8306f53d35bf8" + }, + { + "bytes": 5888, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "PROOF.md", + "sha256": "93cb4eeb6286464a8d22fc0e02bfc34a912d48e0b0b33b19cc11abedde290d9c" + }, + { + "bytes": 4086, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "README.md", + "sha256": "362ef195a82ee99c1b5677c1d60ba05188f2a7bd35f13a5fd6f8ff1de879ff57" + }, + { + "bytes": 4383, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "SOURCES.json", + "sha256": "ae5d4b8bd081bb30aca081024a23984ce542c3a07ab1b98e3010c23b2702d4d7" + }, + { + "bytes": 8344, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "TASK.json", + "sha256": "108d0436ab83fbe44e4dfb7cb8caed7bcc61cdb8396f1499ada0f8792c88222e" + }, + { + "bytes": 1307, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "VERIFY.json", + "sha256": "73630b60b1fa9463b748402b3ef63dd091ededc6319b2ef90170c9dd13c8b9cc" + }, + { + "bytes": 18710, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "caller.py", + "sha256": "857843c16a3bc11558a11118c7fe426b2e0780a58a01c6f6c343894961b7c2d8" + }, + { + "bytes": 13849, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "check_operator.py", + "sha256": "a670e0111adb29a6fc21fa1330848043a5d10d8b5f89e7581e63084852d8afba" + }, + { + "bytes": 11484, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "construct.py", + "sha256": "f45dab80a16b2293488dd6a37048b965a46c572619b191062bc1511c5c0ce4ff" + }, + { + "bytes": 1969, + "path": "credits/7658-NOTICE", + "sha256": "2732575164931c53cc4bc57145c31d87741489e3048afee6899e856c0ea503b5", + "source_git_blob": "2baa2a719ea3a9ec94c2e7aec72702ec8c92b346", + "source_head": "7d84799a447867d36137d12ef7ca5646154d763c", + "source_path": "research/cf6a-nine-swap-supplied-word/upstream7658/NOTICE" + }, + { + "bytes": 2752, + "path": "credits/7700-CITATION.cff", + "sha256": "50399ea15e9ce49baafbd00d6da16e662ac46c566e3c04af3993e23cf0b62ff4", + "source_git_blob": "d80f6b8660d6caaa82cb194fc22d0817d642d043", + "source_head": "7d84799a447867d36137d12ef7ca5646154d763c", + "source_path": "research/cf6a-nine-swap-supplied-word/CITATION.cff" + }, + { + "bytes": 24973, + "path": "credits/7700-NOTICE", + "sha256": "b49022cb4104d90b182e4c335f670faf45529025b15db77bf0291835083c28bd", + "source_git_blob": "59d8e0cf3102e15bd11db430838365531e2d7f18", + "source_head": "7d84799a447867d36137d12ef7ca5646154d763c", + "source_path": "research/cf6a-nine-swap-supplied-word/NOTICE" + }, + { + "bytes": 1238, + "path": "credits/OUTER-GATE-NOTICE", + "sha256": "cadbc642ca84311d2c7a6cf704c7828cb4cf77e3c784b66e4c6e8a5c28002fb8", + "source_git_blob": "1bc9b4da2b8398954cd7a49356eb9d397785d0a6", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/credits/OUTER-GATE-NOTICE" + }, + { + "bytes": 1326, + "path": "credits/PR7663-NOTICE", + "sha256": "5fd4367578d2339fbdcd7dc116b6c12cb4fa72e92d2e3d67be537a36c8bd9d40", + "source_git_blob": "6ce1bc49a3612c9e906df02de81bcba84be8e803", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/credits/PR7663-NOTICE" + }, + { + "bytes": 7588, + "path": "credits/PR7669-PROVENANCE.md", + "sha256": "706c6c852e87e371ddf1828244b2f0c2b00279728818023aa911c8947d69ab83", + "source_git_blob": "bbee2437f012c3268eb5cd920adfa37394c1de72", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/credits/PR7669-PROVENANCE.md" + }, + { + "bytes": 1697, + "path": "credits/PR7674-NOTICE", + "sha256": "382537634a3d9fa0a8089d6121a506a399382f9310088b1f29586dcc93eec92d", + "source_git_blob": "951f081717e0769f3bcc0f442f133965c064d2ce", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/credits/PR7674-NOTICE" + }, + { + "bytes": 1955, + "path": "credits/PR7682-NOTICE", + "sha256": "7590f71de481c424d2315e9ea4884bea1557481676fa5f930f7a0bed637a56a1", + "source_git_blob": "4654631de087fe5034d30abc17e9d57582e5ed9c", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/credits/PR7682-NOTICE" + }, + { + "bytes": 3702, + "path": "data/CALLER-PHASE-BASES.json", + "sha256": "325a1eb4aa7fe5f918b1d8344b88ad132ef4606268bccec20f223ace5feda18b", + "source_git_blob": "3e4aa383a5e3343c4688bff62bd39587b90c31b4", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/data/CALLER-PHASE-BASES.json" + }, + { + "bytes": 11854, + "path": "data/CALLER.json.gz", + "sha256": "d889996a337f648087208ab51c98eaf052705d4fca88b5d01b6e9257a829897a", + "source_git_blob": "26a75a1ae32cb4944a65281cfb08775967cb39a0", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/data/CALLER.json.gz" + }, + { + "bytes": 437058, + "derivation": "The exact folded parent with the exclusive role-1256 relay contracted by construct.py.", + "path": "data/CANDIDATE-GRAPH.json.gz", + "sha256": "0177c25371181e3b1f2c13325eb8434fbf6384a9ab99a612849efd5d0f6ab2cc" + }, + { + "bytes": 27430, + "path": "data/CERTS.json", + "sha256": "39ef28b708cd8bf1166b111d656809407b370dd11cd81a8e43820779f995aca3", + "source_git_blob": "ed66fa483232fcf743aa9a69ce48d79abc0a58c9", + "source_head": "7d84799a447867d36137d12ef7ca5646154d763c", + "source_path": "research/cf6a-nine-swap-supplied-word/candidate/CERTS.json" + }, + { + "bytes": 436816, + "derivation": "Folding data/WORD.json.gz with construct.py, verified by reconstructing the complete source coefficient rows.", + "path": "data/PARENT-GRAPH.json.gz", + "sha256": "c86288cddb4b80af3c8128c9a0d2f7a1e82bae64c5152a0d96a19d166afaab1d" + }, + { + "bytes": 817, + "derivation": "The invoices.candidate projection of the #7697 CALLER.json, with the source head, path and both digests in SOURCES.json.", + "path": "data/PR7697-INVOICE.json", + "sha256": "6e8229022ef7c9a13a33a8df5e591114eb9de49bb5b7b20628bbe56c3fa2c3a7" + }, + { + "bytes": 816, + "path": "data/SOURCE-INVOICE.json", + "sha256": "a6b9a9529db9476e4b39ef4d4fad0a075f5675cbbedde99b7a08b2c007ff006d", + "source_git_blob": "69b5b39e8aac2f77e4056558574d1622577558fa", + "source_head": "7d84799a447867d36137d12ef7ca5646154d763c", + "source_path": "research/cf6a-nine-swap-supplied-word/candidate/INVOICE.json" + }, + { + "bytes": 600183, + "path": "data/WORD.json.gz", + "sha256": "50c1facfc5626c060560e2f354b71bd92d0bb1c1e853b2aad72abcbaaa5328a5", + "source_git_blob": "890579b0b7e12f3a6a70c3612f40cc6ccbc569d5", + "source_head": "7d84799a447867d36137d12ef7ca5646154d763c", + "source_path": "research/cf6a-nine-swap-supplied-word/candidate/WORD.json.gz" + }, + { + "bytes": 25029, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "dense.py", + "sha256": "6264abeb0d5454e9c1881860fdb4ae894c54537569f42f799e402bbe1d628f30" + }, + { + "bytes": 12483, + "path": "dense_support/field_interpreter.py", + "sha256": "e76bc78b132607890b2d9ea234d3a52e608e0e919bdc48308cc0727a2a07c73e", + "source_git_blob": "4872d370db37965f84872e9b66ef60923abce15a", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/dense_support/field_interpreter.py" + }, + { + "bytes": 14024, + "path": "engines/caller/binding16.py", + "sha256": "589058311e44f2d8909495c005bee6d54828ebe561d4673b599193d269006170", + "source_git_blob": "d07341b81719d96e336a47907d48c73772ec1ccb", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/engines/caller/binding16.py" + }, + { + "bytes": 7783, + "path": "engines/caller/caller16.py", + "sha256": "ced48867f07ca0143604aa98cfd74fa7453696b9d3221f7c230d73e9ab9ba81f", + "source_git_blob": "2865530b7878dec54286a67e82b83093911ec43c", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/engines/caller/caller16.py" + }, + { + "bytes": 8469, + "path": "engines/caller/directed_price.py", + "sha256": "446c8ebddf5b1e56d43b8d7f2ad3c1c9ba018a18105b207a0ac9e30386878a10", + "source_git_blob": "8785a1337d1e1c90a55a614a611e4ed57877c545", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/engines/caller/directed_price.py" + }, + { + "bytes": 6886, + "path": "engines/caller/interval_gate.py", + "sha256": "60a743d13f668ef86db4b8215b4d5d04430a671ba6f1fe06d9c1c4c3dfe86da5", + "source_git_blob": "e24dc46079b4c25152f5afc096dda2ce8ee58ff5", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/engines/caller/interval_gate.py" + }, + { + "bytes": 4786, + "path": "engines/caller/native.py", + "sha256": "788465324eb8693a698c75cb3dfdf1b82297324d5583910107ecad4600645e43", + "source_git_blob": "3e09f65fe33e162e1a5e2e0433b7ea4483759b3a", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/engines/caller/native.py" + }, + { + "bytes": 8209, + "path": "engines/caller/network.py", + "sha256": "a9169fd6ad0a13c69cf39bd32649d53256f6d6fa2ed2ceda854f848b64f4c546", + "source_git_blob": "0ebc1925c40cc6c11af59e405221ea51801a6e92", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/engines/caller/network.py" + }, + { + "bytes": 5804, + "path": "engines/caller/reference_caller.py", + "sha256": "9bfb77250ca4826c1098b896769dc504b587c8c0dac634dd07012150fc8dde37", + "source_git_blob": "945c27d8c49b206f4deeb48eaf88df74c4042b3b", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/engines/caller/reference_caller.py" + }, + { + "bytes": 10059, + "path": "engines/caller/selected-bit-ambient.json", + "sha256": "437ad2f9e7956e7f2b477b546f53a6c8cfa0567e207024300e9a7e58d3c0202c", + "source_git_blob": "cd19f356a5549f6b70557095e7745cdddde0485c", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/engines/caller/selected-bit-ambient.json" + }, + { + "bytes": 2891, + "path": "engines/caller/selected-claim.json", + "sha256": "3f8add8252adb223b60418ec69351a69b6b5edfe601ec1c6b4b65cd9e2afd9b2", + "source_git_blob": "c9b816f8445be9dc19b2259e03e9d8709d18c87a", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/engines/caller/selected-claim.json" + }, + { + "bytes": 10887, + "path": "engines/caller/selected-validation.json", + "sha256": "e1374a98b240d7f9f2cca2a1e74b93f240b1bfc94b8cc4b94a385a50281d494e", + "source_git_blob": "7291ce5ab9c59f07ead921fbad9966b4a54e3292", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/engines/caller/selected-validation.json" + }, + { + "bytes": 19068, + "path": "engines/caller/upstream_application.py", + "sha256": "d98987db98553dc55bfc80e3ca47abfcd51c57af6f8cda61101391d8eae94184", + "source_git_blob": "1a6d358cbec88e70615e5314cdfca9e123124f83", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/engines/caller/upstream_application.py" + }, + { + "bytes": 23278, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "evidence/CALLER.json", + "sha256": "f7714c03f0be9fa4213b456e13a12503c6ae681713163ed92f2352cba9981277" + }, + { + "bytes": 8929, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "evidence/DENSE.json", + "sha256": "13528d3faa0d7d17eac2c0d785881287b80f827e36ce846c1a5644a2d3a6ed7c" + }, + { + "bytes": 8274, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "evidence/INDEPENDENT.json", + "sha256": "823ca36613209c6fce9cfe834ba0e0f75f914ddad41089cc263563786bce6e1a" + }, + { + "bytes": 2633, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "evidence/NATIVE.json", + "sha256": "5f5a2b255ce6c3ab9850c1e7e756abca94b1b3f920764a05b721eab028262d79" + }, + { + "bytes": 1956, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "evidence/OPERATOR.json", + "sha256": "9bcbf5f62f7b2561502ffdcd776e6acf6afda1a3ef919ebe69f1e3a331deec57" + }, + { + "bytes": 19560, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "evidence/PHYSICAL.json", + "sha256": "493ba55774b3da20b9d36e290e710ca36286e30a6a4cb85ef9c8d7b89a428e65" + }, + { + "bytes": 44409, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "evidence/PRICE.json", + "sha256": "d6eb916179ba86082a31911494739d034daa615d2c252dc5ef094d9b7e9cfcb5" + }, + { + "bytes": 20112, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "native.py", + "sha256": "bded024ba820ecf4b52b8724e2189820961f61f9c12e4def2e8ce5ad9781da1c" + }, + { + "bytes": 160924, + "path": "native_support/PR7682-BANK-RECIPES.json.gz", + "sha256": "06dbe8d913627dbfef6cfe6599fd8eaa7fd82daddf72253b1f9bc5cb5a4eb0e9", + "source_git_blob": "488a388970d4844c8bab0b8284e749df1b30e046", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/native_support/PR7682-BANK-RECIPES.json.gz" + }, + { + "bytes": 425821, + "path": "native_support/PR7682-GRAPH.json.gz", + "sha256": "8e28c1d403145ca5d72521f4acd7e068603598334c87f18f2fefb738844a1970", + "source_git_blob": "0433088373cc3e9902d3ee7fb06d96954b5e35be", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/data/PARENT-GRAPH.json.gz" + }, + { + "bytes": 47178, + "path": "native_support/PR7682-MAIN-BOUNDARIES.json", + "sha256": "52f7260cf935ce523f5e899c7f384765b56a257bce93bdc4427417df3ba971e0", + "source_git_blob": "84de3180f93c1e9d179c66783b99f846007901dd", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/native_support/PR7682-MAIN-BOUNDARIES.json" + }, + { + "bytes": 2300, + "path": "native_support/PR7682-PHASE-RESULT.json", + "sha256": "50b05bdc2805d709761ce5c4b42e7ec352141366f5cc6031df9f8779e8872735", + "source_git_blob": "a2b53090983c393004497ccec018e72bed7b14d2", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/native_support/PR7682-PHASE-RESULT.json" + }, + { + "bytes": 1984, + "path": "native_support/PR7697-CALLER-LAYOUT.json", + "sha256": "622c6f458eba2dab0fdfd6050303cbc16ad684ab8b834c7df568264e4cf01db6", + "source_git_blob": "2889874f82c59cc7bd4f19eb2e652a36df3b9801", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/data/CALLER-LAYOUT.json" + }, + { + "bytes": 41512, + "path": "native_support/PR7697-CALLER-RESULT.json", + "sha256": "cbef124e8b495b4bec9a1343500766af33b245121a486fff4a619c8eb284f2ad", + "source_git_blob": "00e282d434c1536791bfb20069bbe4cdd41d7b14", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/evidence/CALLER.json" + }, + { + "bytes": 176004, + "derivation": "Fresh native.py catalogue for every ordered pair required by the two #7700-based banked graphs.", + "path": "native_support/RECIPES.json.gz", + "sha256": "cf5dc6a35d3c8f6efbe4fc663853b2134234720c9cc8da16ee49aa1a0d98822f" + }, + { + "bytes": 6824, + "path": "native_support/clifford_exact.py", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "source_git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/native_support/clifford_exact.py" + }, + { + "bytes": 12323, + "path": "native_support/native_verify.py", + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38", + "source_git_blob": "2c209dfa9cfade3bc20ac5fc9d876b433a147f8c", + "source_head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "source_path": "research/p104-banked-chart595-split/native_support/native_verify.py" + }, + { + "bytes": 45970, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "physical.py", + "sha256": "24c9cf906596c9ef1533c1d25f61403db3ff6389478f64359d9d12c5fef87b69" + }, + { + "bytes": 19044, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "price.py", + "sha256": "8d3c2a36d7aa66760bcc6871bfa3821db1fe98429e95c8e7efd9c9a48ee2a5b8" + }, + { + "bytes": 1242, + "derivation": "Independent projection of the published #7697 invoice, with source binding in the separate review.", + "path": "review/COMPARATOR-7697.json", + "sha256": "c5ca88568459eb5aa7769ca7f9f430bcb117f39c2e2c16764517afb5daec4b7e" + }, + { + "bytes": 3029, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "review/JOIN.json", + "sha256": "fbbe48433ed0489019a373fbc2bf9516b4be5103c17823f4cbee8a7b7bee0612" + }, + { + "bytes": 3549, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "review/README.md", + "sha256": "cd279ca3149b2ec8673d2ea9c549da2ecbf082e7bfd0f56558ae31fd838bfef1" + }, + { + "bytes": 22788, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "review/check.py", + "sha256": "6738e90df86240920e2e84bd853da1d55eba337a442b98b93a31543556e7ec41" + }, + { + "bytes": 11268, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "review/check_join.py", + "sha256": "14d526c2e197c8e0cd39e5f83816c64757a90633fa9f6946154c26bcadbdb881" + }, + { + "bytes": 4535, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "review/orientation.py", + "sha256": "9e490c601ddc584c8238f49c6c6be65a62b451acb4e622e0f97f26e68d6726bc" + }, + { + "bytes": 3532, + "derivation": "Role-1256 verification, proof, receipt or package metadata in this contribution.", + "path": "verify.py", + "sha256": "efa28cef25106065a3025dd1e2aee064285ddf158ae3572b7323cb0a70580f7b" + } + ], + "folded_parent_sha256": "72705b094d83d2ba24006661bbb031786a691b776bedb94515b1321e1535105f", + "schema_version": 1, + "source_head": "7d84799a447867d36137d12ef7ca5646154d763c", + "source_word_sha256": "ae62d5d8bef6f7146454b4b3643e487a58380c606a16c5baef7bf0dcf9df1472" +} diff --git a/research/cf6a-banked-role1256-relay/CALLER.md b/research/cf6a-banked-role1256-relay/CALLER.md new file mode 100644 index 0000000000..ec92ce4f90 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/CALLER.md @@ -0,0 +1,151 @@ +# Signed caller, directed price and outer qualification + +The role-1256 relay yields a conditional lower point of **κ ≥ 0.0037300417**. +Its signed raw crossing is in **(0.0037300417703, 0.0037300417704)**. +The reported lower exceeds the #7700 supplied-word upper 0.00372934317807 +by exactly 0.00000069852193 and the #7697 qualified bank upper +0.0037266288770 by exactly 0.0000034128230. The price checker recomputes +both upper signs from the complete pinned bills. The comparison to #7700 +uses the supplied raw signed invoice. Its original source describes a +finite word check, including its own raw-program rational conditions. +The new claim uses the bank, compiler and precision qualification here +with the five assumptions named below. +[Supplied #7700 archive](https://github.com/CrocSwap/integer-mult-bounds/pull/7700) · +[Qualified #7697 archive](https://github.com/CrocSwap/integer-mult-bounds/pull/7697) + +## Actual application + +The supplied word is from head +`7d84799a447867d36137d12ef7ca5646154d763c`. The checked word digest is +`ae62d5d8bef6f7146454b4b3643e487a58380c606a16c5baef7bf0dcf9df1472`. +The folded parent and relay child digests are +`72705b094d83d2ba24006661bbb031786a691b776bedb94515b1321e1535105f` and +`8e7b755bd2d2d387bc3d3adfe48100985adf74775ca5acbb143170a3d16b5ccf`. +The 4,192-event caller has literal digest +`62d94fb992acab0a71c3d12f22be4ce63f4f65e5cbe3f420b93aa1393ffa8dcf`. +Both gzip transport and decoded data are authenticated. + +The actual sixteen joint events use 96 type-A and eight type-B ports. +Each joint event injectively binds all 400 main positions, including the +96 second planes, to root owners. Two exact Gaussian group-ring replays +apply the signed coefficients in event order and recover every declared +diagonal return on all 68 logical root rows. The elementary steps +include the two A shears, the B butterfly, and the signed QUERY, +LAMBDA and IDLE terms. There are 153,295 exact pre-product divisions. +Replicated on the designated ports, those diagonals are 3,536 distinct +same-owner root returns. + +The phase replay matches the actual port geometry of the supplied word +and the retained phase-basis table. All 12,800 absolute forward and +return translations exchange the relevant eight stage directions, +fix their head direction, and preserve the remaining spectators in +the 137-axis view. The 3,536 negative root head translations are +checked separately. A missing contact translation and an aliased joint +owner each fail their respective check. The direct relay's internal +frame phase and full operator are checked in the native and operator +proofs. [Caller checker](caller.py) · [Exact caller receipt](evidence/CALLER.json) + +Both banks replay all 1,501 normalized native output rows on independent +basis inputs. The declared main rows are the signed normalized A and B +interfaces, and each helper returns on its own normalized row. Thus +the physical helper with input `x` at chart `E` returns +`T_G T_E⁻¹ x` at chart `G`, with independent input and same-owner +return in each stage. This includes the retained rank-four roles 325 +and 1087 and the retained rank-nine public role 1256. There are 1,101 +independent helper owners per call and 17,616 across the actual caller. + +## Complete signed invoice + +| Quantity | Folded #7700 | Role-1256 relay | +| --- | ---: | ---: | +| Positive paid native slots per call | 6,144 | 6,143 | +| Fixed QUERY and IDLE paid placements | 3,552 | 3,552 | +| Total paid placements | 101,856 | 101,840 | +| Native productive helper returns | 17,616 | 17,616 | +| Productive root returns | 3,536 | 3,536 | +| Total productive placements | 21,152 | 21,152 | +| Productive minus paid rank mass | 1,328 | 1,328 | + +The exact raw MOVE labels 95828 and 104442 are consecutive transfers +on public role 1256 through charts 476, 878 and 127. The folded row at +104442 reads the former as its sole donor with coefficient one. The +direct chart-476-to-127 MOVE uses its old sender row. In the frozen +child schedule its stable label stays 104442 and its zero-based +execution ordinal moves from 4,114 to 3,310. All 7,643 other rows +preserve their relative order. + +There are 32 fewer rank-three paid placements and 16 more rank-six +paid placements across all sixteen calls. Productive targets are +identical by owner and rank. The exact price improvement over the +supplied invoice at saving `s` is +`16(2·3^(1−s) − 6^(1−s))`. One additional paid rank-one placement +in the whole caller would reverse the directed gain at the #7700 raw +upper, so the full ordinary accounting and direct native phase check +are part of the qualification. +[Supplied invoice](data/SOURCE-INVOICE.json) · +[Extracted #7697 signed invoice](data/PR7697-INVOICE.json) · +[Directed price receipt](evidence/PRICE.json) + +## Directed compiler and finite ordinary lift + +Two directed arithmetic engines enclose each compared signed moment. +Their intervals intersect, and the monotonicity bounds cover the +interval through the retained BIT floor 0.00376669 from the +ambient-corrected selected 134-axis template. The recursive compiler +uses carrier power 1,920, paid cutoff 11, target floor 12, tail power +offset 1/7 and conservative ambient cap 153. At the test point +0.00373004170007 the price ratio is below 1 − 10⁻²⁷ and both tail +ratios are below 31/32. The input-lift bounds pass. The compiler +writes log power 2,289 and H = 14,571,800,000,000,000,000. All +54 strict and four functional outer predicates pass with exact minimum +margin 10⁻¹⁵. [Selected outer root and BIT proof](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md) + +Both banks use native path grid 2,025·2²⁰ and signed caller scale +2,025 with binary height 9. The complete physical budgets use 9,151 +and 9,150 numerical homes per native invocation, inside the inherited +15,290-home bound, with separately charged dummy, guide and four +full-width guarded streams. Each branch charges 55,104 exact odd +conversions. The child charges 280,512 ordinary map positions, +122,001,408 scalar services, 1,477,054 reset services per native call +and 402,978 typed transfer legs per native call. Full addressed +selector, overwrite, copy, exact scalar, guide, stage and complete +return work contributes to ordinary work `G`. The independent +physical receipt gives context bound `c = 1156` and checks that +`bit_length(c·1920·153^1920·(H+1)^2) = 14083 < H` with the +fresh directed compiler's `H`. +[Physical budget and width proof](PHYSICAL.md) · +[Exact physical receipt](evidence/PHYSICAL.json) + +At retained width `W = p+h+2D+3`, aggregate the simultaneous typed +owner tuples, parked contexts, children, and compiler and BIT backing +into stock `O`. For compiled productive width `W_p`, paid rank-one +mass `P`, and `N = 2^H`, the fixed finite-template substitution is +`Z = W_p+O`, `E_0 = 64(Z+N+P+G+1)^3`, `B_0 = P+E_0` and +`C_0 = 32NB_0²`. The positive outer inequalities admit these finite +template constants after increasing the eventual input cutoff. The +conditional interfaces are `native_all_columns`, `owned_erasure`, +`compiler`, `precision_tape` and `analytic_recovery`. + +## Replay and provenance + +The caller replay reads its layout from the exact #7700 WORD. The +compact phase-basis table is retained byte-for-byte from #7697 head +`f55fc1434436ffa1c6d064a29fc56812044b3157`, SHA-256 +`325a1eb4aa7fe5f918b1d8344b88ad132ef4606268bccec20f223ace5feda18b`. +The #7697 comparator invoice comes from `invoices.candidate` in that +head's caller receipt. The pinned engines preserve the #7682 caller +qualification, including the #7113 and #7669 caller lineage, the #7674 +network, independent signed replay and fixed-grid interval arithmetic, +and the upstream phase checker. The selected numerical inputs are from +canonical head `e54523517d0f03e58352e647c403a5af3e525a57`. +[Retained #7697 source](https://github.com/Clear1nsight/integer-mult-bounds/tree/f55fc1434436ffa1c6d064a29fc56812044b3157/research/p104-banked-chart595-split) + +From this package, run the following with Python 3.12 and fresh +output paths. + +```sh +python3 -I -B caller.py --out /tmp/cf6a-CALLER.json +python3 -I -B physical.py --compiler-H 14571800000000000000 --out /tmp/cf6a-PHYSICAL.json +python3 -I -B price.py --caller-proof /tmp/cf6a-CALLER.json \ + --physical /tmp/cf6a-PHYSICAL.json --out /tmp/cf6a-PRICE.json +``` diff --git a/research/cf6a-banked-role1256-relay/CONSTRUCTION.md b/research/cf6a-banked-role1256-relay/CONSTRUCTION.md new file mode 100644 index 0000000000..b0c2f0a626 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/CONSTRUCTION.md @@ -0,0 +1,23 @@ +# Role-1256 paid relay contraction + +Fold the exact supplied #7700 word at head `7d84799a447867d36137d12ef7ca5646154d763c` into a banked graph using the chronological folding rule from Ali Romman's #7674. Store every paid return under its zero-based raw MOVE clock. A negative token `~r` denotes the arbitrary input of public role `r`. The public output for role `r` is form `154768+r`. The constructor checks the word, CLEAR certificates and exact decoded 16-stage caller, then rebuilds both archived graph bodies from the raw word. [Supplied word and evidence](https://github.com/CrocSwap/integer-mult-bounds/pull/7700) · [Banked folding source](https://github.com/aliromman/integer-mult-bounds/blob/28b2af322a1fab01b3734365988930920f9dda48/research/p104-banked-transfer-pivots/network.py) · [Constructor](construct.py) + +| Raw MOVE clock | Public owner | Source → destination chart | Rank | Normalized source form | +|---:|---:|---|---:|---| +| 95828 | 1256 | 476 → 878 | 3 | `−89449 − 89561 − 95823 + 95825` | +| 104442 | 1256 | 878 → 127 | 3 | `+95828` | + +The numbers inside a form are bank tokens. Clock 104442 is the only consumer of 95828 across the paid and terminal forms. Both sides of every original CLEAR certificate also avoid 95828. Keep clock 104442, replace its source by the four-term form at 95828 and route it directly from 476 to 127. Retire clock 95828. The new source uses four existing chart-476 donors. The constructor validates cocharts and computes a topological order for every surviving row. The retained key 104442 advances from zero-based schedule index 4114 to 3310. All 7,643 other surviving rows keep their relative order. + +Charts 476, 878 and 127 have ordered binary bases `[75,164,265]`, `[3,4,48,72,144,265]` and `[1,2,4,8,16,32,64,128,256]`. Their spans are strictly nested with dimensions 3, 6 and 9. The canonical chart composition is $(T_{127}T_{878}^{-1})(T_{878}T_{476}^{-1})=T_{127}T_{476}^{-1}$. The direct pair is implemented at rank six. The native verifier checks its full forward and adjoint columns and absolute phase. Per native invocation two rank-three paid routes become one rank-six route. The 16 invocations charge 32 fewer rank-three jobs and 16 additional rank-six jobs, with the identical public ownership and productive target histogram. + +The operator replay evaluates the raw chronological source over scaled integer rows independently of the folded evaluation. It checks every raw MOVE row and every original CLEAR equality to other live fields. It then checks all 7,644 surviving row observations in forward and adjoint order, including the 1,501 public rows, and the 235 raw CLEAR relations on both graphs. Those relations include 42 zero fields and 193 nonzero fields with other-live witnesses. Whole-field retirement, new map execution and resource accounting appear in the native and physical verification parts. [Operator receipt](evidence/OPERATOR.json) + +The frozen canonical graph hashes are `72705b094d83d2ba24006661bbb031786a691b776bedb94515b1321e1535105f` for the source fold and `8e7b755bd2d2d387bc3d3adfe48100985adf74775ca5acbb143170a3d16b5ccf` for the contracted graph. Run the self-contained checks from the package directory with Python 3.10 or later. + +```sh +python3 -I -B construct.py +python3 -I -B check_operator.py +``` + +The constructor can also emit both independently rebuilt graph bodies with `--out-dir` and an existing destination directory. The operator check accepts `--out` with a fresh receipt path. diff --git a/research/cf6a-banked-role1256-relay/LICENSE b/research/cf6a-banked-role1256-relay/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/cf6a-banked-role1256-relay/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/cf6a-banked-role1256-relay/NATIVE.md b/research/cf6a-banked-role1256-relay/NATIVE.md new file mode 100644 index 0000000000..3ca48361d5 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/NATIVE.md @@ -0,0 +1,21 @@ +# Physical native maps and exact relay phase + +The native checker qualifies the graph `8e7b755bd2d2d387bc3d3adfe48100985adf74775ca5acbb143170a3d16b5ccf` against the banked #7700 source graph `72705b094d83d2ba24006661bbb031786a691b776bedb94515b1321e1535105f`. The literal WORD is `ae62d5d8bef6f7146454b4b3643e487a58380c606a16c5baef7bf0dcf9df1472`, from #7700 at `7d84799a447867d36137d12ef7ca5646154d763c`. Both graphs retain the WORD's complete ordered chart table and ingress and egress arrays. [Donor WORD](https://github.com/CrocSwap/integer-mult-bounds/pull/7700) · [Exact native receipt](evidence/NATIVE.json) + +The literal old MOVEs of public helper 1256 occur at clocks 95828 and 104442. The first takes chart 476 to 878. The second takes chart 878 to 127 and reads the first return with coefficient one. The checker verifies that no intervening scalar operation or original CLEAR witness observes this helper. The candidate drops 95828 and keeps 104442 with the original first source row and ordered pair 476→127. Its productive helper return remains 3→127. The native paid census loses two rank-three occurrences and gains one rank-six occurrence per invocation. [Exact graph and row check](native.py) + +For an ordered chart \(A\), let \(T_A\) denote its exact nine-axis Gaussian frame. Each transition from \(A\) to \(B\) has matrix \(T_B T_A^{-1}\). The checker evaluated the old chronological product \((T_{127}T_{878}^{-1})(T_{878}T_{476}^{-1})\) and the compiled direct rank-six map on every one of the 512 forward and 512 adjoint columns. The exact values and denominators agree, including absolute phase. Changing the final monomial by \(i\) preserves the signed Pauli action and is rejected by the exact Gaussian phase check. Tensor powers and the identity on spectator axes preserve these equalities under the inherited native all-width interface. [Exact column hashes and recipes](native_support/RECIPES.json.gz) · [Chronological product and phase control](evidence/NATIVE.json) + +Each graph has 3,023 active ordered paid or productive pairs, with 3,024 in the union. The checker binds the previous paired bank archive to the exact #7682 graph and chooses reused recipes by both ordered bases. It independently verifies the signed action on all Pauli generators and the exact image of the zero-basis vector for every pair. Equality of the signed Pauli action makes the relative matrix commute with all Pauli generators, whose commutant consists of scalars. Equality of the nonzero zero-basis image fixes that scalar to one. The retained unitary and its adjoint therefore agree on every column. [Exact Gaussian interpreter](native_support/native_verify.py) · [Paired archive receipt](native_support/PR7682-PHASE-RESULT.json) + +Compared with the active #7682 catalogue, #7700 adds 22 ordered pairs. The 21 absent from the whole paired archive and the new direct 476→127 map receive fresh full forward and adjoint column replay. The remaining 730→127 pair occurs in the older archived companion graph with exactly the same ordered bases. Its symbolic all-column check is rerun with the literal #7700 chart operators. The published ordered recipe table includes each source and candidate paid key and each helper owner associated with the pair. Its decoded SHA-256 is `be33fd04af74312d297f01e1d8a374a72034e7e6f902bbd0c671df2597d1c828`. [Ordered recipe table](native_support/RECIPES.json.gz) · [Paired bank construction](https://github.com/CrocSwap/integer-mult-bounds/pull/7674) + +The checker freshly lowers and verifies all 104 rank-zero main boundary pairs and their 96 second-plane correspondences. All charts and q assignments used by the actual caller contacts bind to the exact prior phase context. The literal caller uses 400 distinct main owners and 1,101 helpers on each of its sixteen stages, for 17,616 distinct stage-tagged arbitrary helpers. The 12,800 main phase contacts share digest `29196a9aa29ecf4b3705a6346c40642eef9b14600ccc832210df91c3e4f84f50`. The caller check independently recomputes the phase translations and the full signed application. [Caller replay](caller.py) · [Prior caller phase digest](native_support/PR7697-CALLER-RESULT.json) + +Run the native check from this package with CPython 3.12, using a fresh output directory. + +```sh +python3.12 -I -B native.py --out /path/to/fresh-native-output +``` + +It writes `START.json`, `NATIVE.json`, and the deterministic `RECIPES.json.gz`. The completed guarded run used 43.48 CPU seconds, 45.71 wall seconds and 189,680 KiB peak RSS. An earlier 0.73 CPU-second preflight stopped before checking any chart because the caller pin authenticates its literal decoded bytes. The corrected loader checks both the compressed bytes and the literal decoded input before parsing. [Native execution receipt](evidence/NATIVE.json) diff --git a/research/cf6a-banked-role1256-relay/NOTICE b/research/cf6a-banked-role1256-relay/NOTICE new file mode 100644 index 0000000000..7d2dfec60a --- /dev/null +++ b/research/cf6a-banked-role1256-relay/NOTICE @@ -0,0 +1,5 @@ +Apache License 2.0. Prepared for Clear1nsight with substantial OpenAI Codex and ChatGPT Pro assistance. + +SYLforge supplied the cf6a nine-swap word and its normalized verification in #7700. DreamingOfClouds contributed the #7641 and #7658 swap searches. Ali Romman supplied the changed helper contract in #7663 and the charged bank construction in #7674. Rohan Arun and the #7113 lineage supplied the signed caller. The bank, native, physical and directed price methods reuse work by Ali Romman, SYLforge, Clear1nsight and the contributors credited in #7669, #7682 and #7697. Jerry Chen (CubeJerry) supplied the selected #7000 and #7001 application. Douglas Colkitt and the recorded authors supplied the selected framework, compiler, checker and package infrastructure. + +This contribution identifies and contracts the two paid transfers on helper 1256, reconstructs the banked graph from the supplied source, and checks the resulting physical application and complete signed price. The separate investigation and technical review were performed with Codex agents. Preserve the original notices and citations in credits/ when redistributing the source data or derived engines. See SOURCES.json for pinned upstream inputs and ASSETS.json for file-level custody. diff --git a/research/cf6a-banked-role1256-relay/PHYSICAL.md b/research/cf6a-banked-role1256-relay/PHYSICAL.md new file mode 100644 index 0000000000..7a76ca981d --- /dev/null +++ b/research/cf6a-banked-role1256-relay/PHYSICAL.md @@ -0,0 +1,77 @@ +# Complete banked execution and exact precision + +The banked parent is the exact fold `72705b094d83d2ba24006661bbb031786a691b776bedb94515b1321e1535105f` of the supplied #7700 word at head `7d84799a447867d36137d12ef7ca5646154d763c`. The candidate graph is `8e7b755bd2d2d387bc3d3adfe48100985adf74775ca5acbb143170a3d16b5ccf`. Both use the same literal 16-stage caller with SHA-256 `62d94fb992acab0a71c3d12f22be4ce63f4f65e5cbe3f420b93aa1393ffa8dcf`. The checker derives the 104-port layout from the supplied word and retains all 400 main slots and both protected rank-four helper boundaries. All 1,501 public owners retain their entrance and final charts. [Supplied #7700 word](https://github.com/SYLforge/integer-mult-bounds/blob/7d84799a447867d36137d12ef7ca5646154d763c/research/cf6a-nine-swap-supplied-word/README.md) · [Physical replay](evidence/PHYSICAL.json) + +The successive paid returns on role 1256 have exact charts $476\to878\to127$, with ranks three and three. The first return, key 95828, has one folded reader, the unit source form at key 104442. The direct paid rank-six edge from chart 476 to chart 127 uses the four immutable source terms of the removed return, with donor keys $89449,89561,95823,95825$ and coefficients $(-1,-1,-1,1)$. The surviving raw key remains 104442. It advances from zero-based graph position 4,114 to 3,310, and every other surviving row keeps its relative order. The checker validates the actual chronological chart and availability of every donor. The complete native catalogue supplies the ordered Gaussian chart map and phases for the direct edge and checks its equality to the composition of the old two maps. + +| Checked quantity | Folded #7700 | Role-1256 relay | +| --- | ---: | ---: | +| Literal scalar incidences per native call | 172,415 | 172,414 | +| Independent basis products per native call | 9,044,218 | 9,044,092 | +| Nontrivial basis divisions per native call | 4,662,469 | 4,662,469 | +| Sufficient path grid | $2025\cdot2^{20}$ | $2025\cdot2^{20}$ | +| Minimum product grid | 921,600 | 921,600 | +| Minimum stored-snapshot grid | 23,040 | 23,040 | +| Numerical homes per stage and per raw caller | 9,151 / 146,416 | 9,150 / 146,400 | +| Independent guarded transfer streams per raw caller | 64 | 64 | +| Full-array odd conversions per raw caller | 55,104 | 55,104 | +| Reset services per native call | 1,477,074 | 1,477,054 | +| Selected copy legs per native call | 402,988 | 402,978 | +| Scalar services per raw caller | 122,005,504 | 122,001,408 | +| Ordinary monomial map slots per raw caller | 280,544 | 280,512 | +| Conservative elementary monomial records at ambient 153 | 26,613,526,016 | 26,610,490,368 | +| Recursive paid positions per raw caller | 101,856 | 101,840 | +| Productive targets per raw caller | 21,152 | 21,152 | + +## Grids and the completed caller + +Write $g_u=1$ at each independent entrance. At each row with reduced scalar incidences $q_{vu}$, set +$$ +g_v=\operatorname{lcm}_{u\to v}\bigl(g_u\operatorname{den}(q_{vu})\bigr) +$$ +with the empty lcm equal to one. Every single product is integral on the resulting global lcm $G=2^aS$, so every accumulated prefix and completed row is integral there as well. Both exact schedules give $a=20$ and $S=2025$. Exact basis replay checks each product on each nonzero input column and all public output rows. It computes the minimum grids separately from the sufficient grid and majorizes each row prefix by the sum of the absolute magnitudes of its separate products. The largest such bound divided by $2^{20}$ is $27984388275/16$. In the candidate, removing the $3^4$ factor gives a nonzero remainder of one at row 88440 with donor $-1474$ and coefficient $-2/3$. Removing the $5^2$ factor gives remainder six at row 88808 with donor $-1320$ and coefficient $1/10$. The controls operate before any summation. + +Each physical donor in the row carries the actual ordered chart of that row. Its independent entrance column has the chart factor $T_{\mathrm{current}}T_{\mathrm{input}}^{-1}$ multiplying the normalized coefficient. The all-column native factorization gives these exact operators with spectators at every admitted width. Under the retained chronological composition and common-root induction, the chart and compiler parts join as dyadic Clifford factors at the original root. Odd divisibility of an incoming scalar product follows from the checked coefficient grid. At a complete native endpoint the unscaled normalized coefficients are the appropriate fixed signed main map or the identity on the original helper owner. The exact odd unscale has remainder zero. Each native call and the caller use their own odd conversions at actual entrances and returns. [Selected common-grid induction](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/research/odd-native-common-grid/PROOF.md) + +The fixed signed caller replay covers 4,192 records, all 16 joint occurrences, 68 formal roles and their 3,536 replicated root owners. Its literal products use the odd scale 2025 and dyadic height nine, with 153,295 exact pre-product divisions. The hereditary bound follows the same actual operation order with a sum-of-absolute-path mass and a binary height at each intermediate cut. At a joint event it reads all six old main roles before applying the shears and butterfly. In particular, a LAMBDA contributes two terms with denominators two and Gaussian mass one each. Composing native paths with the corresponding pre-joint bound gives a common exterior binary bound $A=338$ and a common mass-bit bound $B=578$ per unfinished raw context. This upper bound applies without cancellation or commutation. + +For $c=2\max(A,B)=1156$, the compiler value $H=14571800000000000000$ gives +$$ +\operatorname{bitlength}\bigl(c\,1920\,153^{1920}(H+1)^2\bigr)=14083 < H. +$$ +Use $K_*=1920\,153^{1920}(H+1)^2$ and $\ell=\lfloor\log_{2^H}D\rfloor$. The bound $2^H\ell\le (2^H)^\ell\le D$ for $\ell\ge1$ pays the unfinished-context debt at depth $K_*\ell$. At $\ell=0$ no such debt is present. The retained root keeps the complete original $D$-axis factor, all spectators and previous remainders. The exact fractional grid is $2^{-(p+D)}$ at signed width $W=p+h+2D+3$. The inherited SWAP and phase passes, normalization, separate temporary padding and the final truncation keep their complete-view charges. The price checker joins this guard to its independently determined $H$. [Selected root precision and finite template](https://github.com/CrocSwap/integer-mult-bounds/blob/e54523517d0f03e58352e647c403a5af3e525a57/docs/research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md) + +## Same-owner installation and complete dirty overwrite + +For $n=1501$ public owners and $k$ literal paid rows the stage reserves $n$ immutable entrance snapshots, $k$ distinct returned homes, $n$ shaped terminal homes, four scratch homes, and one serial sender. The numerical total $b=2n+k+5$ is within 15,290 for both graphs. Each stage also holds its dummy origin, guide and four separately guarded staging streams. Each stage and suspended compiled occurrence has its own typed backing, including any parked sender, adapter view, guide or scratch track. In the fixture all four addresses in each numerical home start with separate nonzero values. Initialization replaces the whole addressed extent. Each immutable donor is staged before multiplying or selecting the next bank. The selector restores its head on each access. The sender remains occupied through its paid child and completion of both adapters. The fixture records the matching complete return in its distinct destination bank, overwrites the full sender extent, and only then publishes the donor as available and permits sender reuse. It rejects a write on the parked fused sender before that sequence completes. + +All public inputs stay intact until the entire native schedule completes. The terminal installation requires the original owner, full destination chart and exact odd-unscaled value at each of its fixture addresses. Every owner is installed once. A final scan retires all allocated banks and restores the dummy, left and right guards and all staging streams. A negative control deliberately leaves the last payload address dirty after clearing the metadata and every earlier address. The attempted install rejects, then a full overwrite accepts the new owner while preserving its unselected neighbor. The independent coefficient-column replay supplies arbitrary normalized inputs. The addressed fixture and the selector construction supply the required whole-extent storage operations. [Banked predecessor construction](https://github.com/Clear1nsight/integer-mult-bounds/blob/f55fc1434436ffa1c6d064a29fc56812044b3157/research/p104-banked-chart595-split/PHYSICAL.md) + +The supplied #7700 artifact checks a finite normalized operator, 235 chronological normalized CLEAR certificates and its raw invoice. The certificate terms can cite other live charts. Those equalities remain in the source custody and normalized replay. The banked schedule implements private retirement by a charged addressed overwrite, including dirty parked payloads, full returns and their temporary stock. Its own same-owner, all-column phase, rounded caller and outer evidence apply to this exact graph under the retained framework. The supplied raw tape keeps its own constructor and complete supplier application obligations. [#7700 scope](https://github.com/SYLforge/integer-mult-bounds/blob/7d84799a447867d36137d12ef7ca5646154d763c/research/cf6a-nine-swap-supplied-word/README.md) + +## Full addressed and ordinary charges + +At complete address count $N_c$ use $W'=W+26$ and $L'=N_c(2W'+3)$, with all spectator cells and ordinal metadata. The literal signed multiplication carry and exact remainder division fit this padding. The largest numerator or denominator has 13 bits, within the retained 24-bit bound. The finite numerical checker tests 4,038 signed bit-service cases across 673 distinct factors and conversions. Resolve quotient and remainder on the padded stream, install the exact signed quotient, and then retire its full working extent. The conservative allowance is $2^{21}$ steps per padded payload cell per scalar service. + +For $t$ literal scalar incidences in one stage the reset and copy allowances are +$$ +\begin{aligned} +R &= 2b+8(t+k+n)+4n+2k,\\ +X &= 2t+2(k+n)+6k+4n. +\end{aligned} +$$ +The reset terms charge all private homes, four stream resets on both sides of term and row boundaries, public odd conversions, and full sender initialization and retirement on each paid row. The selected transfers cover the full donor staging legs, sender and terminal staging, parked reads and completed returns, both paid adapters, and copies at all public boundaries. The emission of each scalar product, the storage of each row, the snapshot and return for each owner, and each paid staging or clearing site are charged according to the actual graph. Both branches include the $2(3536+16n)$ complete-array odd conversions and all 3,536 root translations. The two removed recursive rank-three jobs and the single rank-six replacement occur at every stage. The signed caller jobs and the productive target census are fixed. + +For ordinal $s$, the complete service bound is +$$ +A_s=(14s+9)L'+63s-7\operatorname{popcount}(s)+27\ell(s)+59 +$$ +Here $\ell(s)$ is binary length. The bound grows with $s$, and its use at the largest allocated slot $b$ pays every guarded select. A complete typed copy costs at most $C=128(L'+2)+64$ besides its selected leg. Charge $R(A_b+2L'+3)+X(A_b+C)$, explicitly allowing a full extra dirty-overwrite scan at each reset. The guide's charged setup uses $q(N_c)+q(W')+22N_cW'+36N_c+7W'+36$ with $q(x)=24x-7\operatorname{popcount}(x)+15\ell(x)+12$. Retiring that guide adds $7L'+10$. Marker layout, fixed descriptors, head and adapter returns, and all complete typed bank tuple moves carry their full charges. [Guarded selector and full guides](https://github.com/aliromman/integer-mult-bounds/blob/677d23ef1610db9921547ab5d58eecc8c8d4c08b/research/current-shared-guide-banks/PROOF.md) + +The 16 stage tuples contain $b+6$ complete payload slots per stage, counter histories and descriptors, and 11 associated layout tracks. For the sum $M$ of the complete tuple spans, pay a further $M+352$ layout shadow cells and $34[256(M+352)+128]$ steps for full setup, retirement and stage switches, plus fixed-degree descriptor work. The compiled map bound charges each monomial using the complete spectator and return volumes. The retained outer constants use compiled positive target width $W_p$, paid mass $P$, compiler rank $N$, finite ordinary cost $G$ and distinct held stock $O$. +$$ +Z=W_p+O,\qquad E_0=64(Z+N+P+G+1)^3,\qquad B_0=P+E_0,\qquad C_0=32NB_0^2. +$$ +The exact signed pricing and outer checks certify the positive gaps under which the resulting fixed costs enter the eventual cutoffs. The argument uses the retained native all-column, owned erasure, compiler, precision and tape, and analytic recovery interfaces. [Predecessor complete bank accounting](https://github.com/Clear1nsight/integer-mult-bounds/blob/f55fc1434436ffa1c6d064a29fc56812044b3157/research/p104-banked-chart595-split/PHYSICAL.md) + +Run `python3.12 -B physical.py --out ` from this package. The default uses the exact compiler $H$ above. With no output path the checker writes its full JSON to stdout. diff --git a/research/cf6a-banked-role1256-relay/PROOF.md b/research/cf6a-banked-role1256-relay/PROOF.md new file mode 100644 index 0000000000..4201033b1b --- /dev/null +++ b/research/cf6a-banked-role1256-relay/PROOF.md @@ -0,0 +1,29 @@ +# Conditional application of the single relay + +Let $T_U$ denote the normalized-to-physical chart transformation for an ordered binary frame $U$. Write $A$, $B$, and $C$ for the ordered frames at charts 476, 878 and 127. Their underlying spans are strictly nested. The literal sender at 95828 is the normalized combination $-h_{89449}-h_{89561}-h_{95823}+h_{95825}$, all available in chart 476. The complete form of 104442 consists of $h_{95828}$ with coefficient one. No other paid or terminal row reads that snapshot. None of the 235 source CLEAR certificates needs it. [Reconstructed graph](data/PARENT-GRAPH.json.gz) · [Full operator and controls](evidence/OPERATOR.json) + +Move the original sender form to stable raw key 104442 and drop 95828. In the new schedule the retained key advances from ordinal 4,114 to 3,310. The other 7,643 surviving rows retain their relative order. The new direct map satisfies $T_C T_A^{-1}=(T_C T_B^{-1})(T_B T_A^{-1})$. This identity includes the ordered Fourier phases, conjugation in the adjoint, and arbitrary input arrays. The native check evaluates the pair that the old paid inventory did not need. The four original donors are still available before the retained sender. Every recipient after 104442 sees its previous array for every assignment of the independent public inputs. Positive or adjoint invocations therefore implement the same external operator. [Construction](CONSTRUCTION.md) · [Native verification](NATIVE.md) + +Folding the supplied program preserves its observed scalar rows and their normalized CLEAR equations. The executable supplier uses distinct private banks, charged whole-view copies and explicit retirement. Its physical implementation uses its own exact product grid, liveness, selection, movement and overwrite costs. It never needs a live off-chart read to clear an old raw register. The 1,501 entrances and terminals, paid snapshots, pending sender and four arithmetic homes fit within 15,290 numerical homes, with four guarded streams. Applicable caller and recursive contexts retain their allocated backing and pay the ordinary operations of the model. [Bank implementation and cost](PHYSICAL.md) · [Physical replay](evidence/PHYSICAL.json) + +At a completed bank row, each available donor occupies its own typed extent. On the common root grid its contents equal the exact linear form for that donor, expressed in its ordered chart, for every public input. The public inputs survive in separate homes. During a recursive transfer the caller retains its sender, backing and spectators until the child and both adapters return. The next row may then read the completed result. After the final installations the only observable homes are the specified public owners. The charged terminal scan overwrites each private extent and restores its guards. This induction uses the selected owned-erasure law on allocated private storage and the selected fixed-tape movement law on the complete view. It does not infer the ability to discard an arbitrary external state from a normalized CLEAR identity. [Selected ownership contract](../../certificates/selected-result.json) · [Charged operations and failure controls](PHYSICAL.md) + +## Signed price and finite compiler + +For a saving $k$, write $H_r(k)=r^{1-k}$. The sixteen calls surrender 32 rank-three payments and add 16 rank-six payments. Both the fixed outer-wrapper charges and productive-target multiset are preserved. The resulting increase in the full target-minus-paid moment is + +$$16(2H_3(k)-H_6(k)).$$ + +The change preserves linear rank mass at $k=0$. For $0 0 for h in (p, t) for r, v in h.items()) + and sum(p.values()) == expected_paid and sum(t.values()) == 21152 + and sum(r * (t[r] - p[r]) for r in p.keys() | t.keys()) == 1328, + "complete actual positive invoice and rank mass surplus") + bills[kind] = dict(reference, paid={str(r): p[r] for r in sorted(p)}, + targets={str(r): t[r] for r in sorted(t)}) + need(bills["parent"] == reference + and {str(r): v for r, v in source_binding["paid"].items()} == reference["paid"] + and {str(r): v for r, v in source_binding["targets"].items()} == reference["targets"], + "independent raw owner-census and folded registered caller match the supplied #7700 invoice") + return bills, { + "stages": stage_rows, "all_stage_owner_digest": source_binding["owner_map_digest"], + "main_slots_per_stage": len(main), "root_owners": len(roots), "fresh_helpers": len(helper_owners), + "native_paid_occurrences": {kind: dict(hist) for kind, hist in paid.items()}, + "native_paid_occurrence_sha256": {kind: h.hexdigest() for kind, h in paid_digest.items()}, + "native_helper_target_occurrences": dict(targets), "native_helper_target_sha256": target_digest.hexdigest(), + "independent_helper_325_and_1087_examples": source_binding["role_325_and_1087_helper_owners"], + } + + +def verify(): + check_sources() + from binding16 import complete_binding + from native import check_endpoints + + word, tape = read_data("WORD.json.gz"), read_data("CALLER.json.gz") + need(word["public"] == PUBLIC and word["owned_fields"] == 68 and len(word["ports"]) == len(set(word["ports"])) == 104, + "fixed supplied ordered port layout and public count") + need(digest((DATA / "CERTS.json").read_bytes()) == SOURCE_CERTS, "supplied source certificate custody") + raw = {kind: read_data(f"{kind.upper()}-GRAPH.json.gz") for kind in ("parent", "candidate")} + graphs = {kind: decode_graph(raw[kind], word, paid) for kind, paid in (("parent", 6144), ("candidate", 6143))} + need(raw["parent"]["metadata"]["kind"] == "parent" and raw["candidate"]["metadata"]["kind"] == "candidate" + and raw["candidate"]["metadata"]["source_banked_graph_sha256"] == PARENT, + "exact parent and child graph roles") + orders = {kind: [key for key in raw[kind]["schedule"] if key in graph.moves] + for kind, graph in graphs.items()} + relay_ordinals = relay_contract(graphs["parent"], graphs["candidate"], + raw["parent"]["schedule"], raw["candidate"]["schedule"], word) + signed = caller_replays(word, tape) + by_q = load(DATA / "CALLER-PHASE-BASES.json", PHASE_BASES)["by_q"] + need({str(q) for q in word["ports"]} <= by_q.keys(), "every actual head has its retained phase basis") + phases = {"recipes": [{"q": q, "idle_children": [{"orthogonal_axes": by_q[str(q)]}]} + for q in word["ports"]]} + source = complete_binding(word, tape, phases, signed) + need(source["phase_digest"] == PHASE_DIGEST and source["contacts"] == source["nonzero_contact_translations"] == 12800 + and source["negative_root_ordinary_corrections"] == 3536 and source["phase_omission_rejected"], + "actual 137-axis phase contacts and root translations") + invoices, owners = stage_invoice(word, tape, graphs, orders, signed, source) + print("PASS_CF6A_RELAY_SIGNED_ROOTS", signed["root_owners"], flush=True) + native = {kind: check_endpoints(graph, word) for kind, graph in graphs.items()} + need(all(r["public"] == PUBLIC and r["mains"] == 400 and r["odd"] == 2025 and r["dyadic_height"] == 20 + for r in native.values()), "both full native endpoint maps and hereditary grids") + ordinary = { + kind: {"root_owners": signed["root_owners"], "fresh_helper_owners": owners["fresh_helpers"], + "root_head_translations": source["negative_root_ordinary_corrections"], + "main_phase_contacts": source["contacts"], + "odd_boundary_conversions": 2 * (signed["root_owners"] + STAGES * n["public"]), + "native_helper_boundary_maps": 2 * owners["fresh_helpers"]} + for kind, n in native.items() + } + return {"status": STATUS, "source_head": SOURCE_HEAD, "source_word_sha256": SOURCE_WORD, + "graphs": {"parent": PARENT, "candidate": CANDIDATE}, "caller_sha256": CALLER, + "published_parent_invoice_sha256": INVOICE, "phase_bases_sha256": PHASE_BASES, + "signed": signed, "owners": owners, "native": native, "invoices": invoices, + "relay_zero_based_schedule_ordinals": relay_ordinals, + "signed_paid_delta": PAID_DELTA, "signed_target_delta": {}, + "ordinary_occurrences": ordinary, + "source_phase": {k: source[k] for k in ("phase_digest", "contacts", "nonzero_contact_translations", + "negative_root_ordinary_corrections", "phase_omission_rejected")}, + "supplied_raw_paid_owner_occurrence_sha256": source["ordered_paid_digest"], + "controls": {"aliased_joint_stage": "rejected", "omitted_phase_translation": "rejected"}} + + +def main(): + parser = ArgumentParser(description=__doc__) + parser.add_argument("--out", "--output", type=Path, required=True) + args = parser.parse_args() + result = verify() + write(args.out, result) + candidate = result["invoices"]["candidate"] + print(result["status"], sum(candidate["paid"].values()), sum(candidate["targets"].values()), flush=True) + + +if __name__ == "__main__": + main() diff --git a/research/cf6a-banked-role1256-relay/check_operator.py b/research/cf6a-banked-role1256-relay/check_operator.py new file mode 100644 index 0000000000..0fb685e143 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/check_operator.py @@ -0,0 +1,300 @@ +#!/usr/bin/env python3 +"""Replay every raw and banked normalized operator and CLEAR relation.""" + +import argparse +from dataclasses import replace +from fractions import Fraction +from functools import cache +import importlib.util +import json +from math import lcm +from pathlib import Path +import sys + + +HERE = Path(__file__).resolve().parent +spec = importlib.util.spec_from_file_location("cf6a_relay_constructor", HERE / "construct.py") +source = importlib.util.module_from_spec(spec) +sys.modules[spec.name] = source +spec.loader.exec_module(source) + + +def same_row(left, left_grid, right, right_grid): + return left.keys() == right.keys() and all( + value * right_grid == right[role] * left_grid for role,value in left.items()) + + +def add_row(result, donor, factor): + numerator, denominator = factor.numerator, factor.denominator + if denominator == 1: + for role,value in donor.items(): + total = result.get(role,0) + numerator*value + if total: + result[role] = total + else: + result.pop(role,None) + else: + for role,value in donor.items(): + term,remainder = divmod(numerator*value,denominator) + if remainder: + raise ValueError("exact integer pre-product division") + total = result.get(role,0) + term + if total: + result[role] = total + else: + result.pop(role,None) + + +def exact_grid(graph, order): + grids = {~r:1 for r in range(len(graph.initial))} + for key in order: + grids[key] = lcm(*(grids[donor]*factor.denominator for donor,factor in graph.forms[key].items())) + return lcm(*grids.values()) + + +def evaluate(graph, required=None): + order = graph.schedule() + if required is not None: + relevant = set(required) + for key in reversed(order): + if key in relevant: + relevant.update(graph.forms[key]) + order = [key for key in order if key in relevant] + grid = exact_grid(graph,order) + values = {~r:{r:grid} for r in range(len(graph.initial))} + products = 0 + for key in order: + result = {} + for donor,factor in sorted(graph.forms[key].items()): + add_row(result,values[donor],factor) + products += len(values[donor]) + values[key] = result + return grid,values,products + + +def weighted(row, values, common): + denominator = lcm(*(value.denominator for value in row.values())) + result = {} + for token,weight in row.items(): + add_row(result,values[token],weight*denominator) + return result,common*denominator + + +def smooth(value): + value = abs(value) + for prime in (2,3,5): + while value % prime == 0: + value //= prime + return value == 1 + + +@cache +def guarded_literal(literal, op): + factor = source.rational(literal) + nb, db = abs(factor.numerator).bit_length(),factor.denominator.bit_length() + source.need(max(nb,db) <= 24 and smooth(factor.denominator) + and (op != "SCALE" or smooth(factor.numerator)), + "source bounded 2/3/5-smooth scalar literal") + return factor,nb,db + + +def chronological_replay(word, certificates, banked_rows, banked_grid, monitors): + """Direct chronological integer evaluation, without executing the folded forms.""" + grid = 225 << 14 + n = word["public"] + fields = [{r:grid} for r in range(n)] + [None]*word["owned_fields"] + charts = word["initial"][:] + [None]*word["owned_fields"] + clear_rows = {entry.clock:entry for entry in monitors} + products = clear_count = zero_count = moves = literals = 0 + max_num = max_den = 0 + for clock,event in enumerate(word["program"]): + op,r,*args = event + if op == "INIT": + source.need(fields[r] is None and charts[r] is None and r >= n, "direct fresh private owner") + charts[r],fields[r] = args[0],{} + continue + stored = fields[r] + source.need(stored is not None, "direct active field") + if op == "MOVE": + a,b,owned = args + source.need(charts[r] == a and owned == (r >= n) + and same_row(stored,grid,banked_rows[clock],banked_grid), f"raw paid observation {clock}") + charts[r] = b + moves += 1 + continue + source.need(charts[r] == args[-1], "direct local operand chart") + if op == "CLEAR": + proof = clear_rows[clock] + weights = {int(label):source.rational(value) for label,value in certificates[str(clock)].items()} + source.need(r == proof.role and charts[r] == proof.chart + and all(label != r and fields[label] is not None for label in weights), + f"other live direct CLEAR witness at {clock}") + rhs,rhs_unit = weighted(weights,fields,grid) + source.need(same_row(stored,grid,rhs,rhs_unit),f"direct CLEAR equality at {clock}") + lhs,lhs_unit = weighted(proof.left,banked_rows,banked_grid) + source.need(same_row(stored,grid,lhs,lhs_unit),f"direct-bank CLEAR binding at {clock}") + clear_count += 1 + zero_count += not stored + charts[r],fields[r] = None,None + continue + if op == "SCALE": + factor,nb,db = guarded_literal(args[0],op) + result = {} + add_row(result,stored,factor) + products += len(stored) + fields[r] = result + else: + donor,literal,_ = args + source.need(op == "ADD" and donor != r and fields[donor] is not None + and charts[donor] == charts[r], "direct other cocharted ADD") + factor,nb,db = guarded_literal(literal,op) + add_row(stored,fields[donor],factor) + products += len(fields[donor]) + literals += 1 + max_num,max_den = max(max_num,nb),max(max_den,db) + source.need(moves == 6144 and clear_count == 235 and zero_count == 42 and literals == 148154, + "direct raw operation and CLEAR denominator") + source.need(charts[:n] == word["final"] and all(row is None for row in fields[n:]), "all public and private exits") + first = len(word["program"]) + source.need(all(same_row(fields[r],grid,banked_rows[first+r],banked_grid) for r in range(n)), + "direct and banked public operator equality") + return {"grid":grid,"paid_move_observations":moves,"public_rows":n,"clear_relations":clear_count, + "zero_clear_rows":zero_count,"nonzero_clear_rows":clear_count-zero_count, + "literal_scalar_events":literals,"literal_bits":[max_num,max_den],"scalar_products":products} + + +def public_formula(word, grid): + """The declared 400 main block ports and one own-input return for each helper.""" + values = [{r:grid} for r in range(word["public"])] + hosted = word["hosted"] + d_ports = set(hosted["Dports"]) + main = set(word["live"]) | {r+112 for r in word["live"]} | set(hosted["X2"]) | set(hosted["Y2"]) + source.need(len(main) == 400 and source.ROLE not in main and grid % 2 == 0,"all protected main slots") + for ordinal,x in enumerate(word["live"]): + y = x+112 + if ordinal in d_ports: + values[y][x] = grid + else: + values[x][y] = -grid + values[y] = {x:grid//2,y:grid//2} + for x,y in zip(hosted["X2"],hosted["Y2"],strict=True): + values[x][y] = -grid + return values + + +def source_transpose(graph, forward, grid, reverse, reverse_grid): + keys = range(graph.first,graph.first+len(graph.final)) + for key in keys: + for coordinate,numerator in forward[key].items(): + source.need(numerator*reverse_grid == + reverse[graph.first+coordinate].get(key-graph.first,0)*grid, + "computed dual equals exact public matrix transpose") + source.need(sum(len(forward[k]) for k in keys) == sum(len(reverse[k]) for k in keys), + "full transpose support") + + +def verify_clears(monitors, old, old_grid, new, new_grid): + zero_count = 0 + observed = [] + for clear in monitors: + old_left,lhs_grid = weighted(clear.left,old,old_grid) + old_right,rhs_grid = weighted(clear.right,old,old_grid) + new_left,cn_lgrid = weighted(clear.left,new,new_grid) + new_right,cn_rgrid = weighted(clear.right,new,new_grid) + source.need(same_row(old_left,lhs_grid,old_right,rhs_grid) + and same_row(new_left,cn_lgrid,new_right,cn_rgrid) + and same_row(old_left,lhs_grid,new_left,cn_lgrid),f"paired CLEAR relation {clear.clock}") + zero_count += not old_left + observed.append([clear.clock,clear.role,clear.chart,clear.born,clear.sources, + sorted((r,str(Fraction(v,lhs_grid))) for r,v in old_left.items())]) + source.need(len(observed) == 235 and zero_count == 42,"235 paired CLEAR relations with 42 exact zeros") + return {"total":len(observed),"zero":zero_count,"nonzero":len(observed)-zero_count, + "all_observation_sha256":source.digest(source.canonical(observed))} + + +def controls(word, certs, child, grid, rows, monitors): + key = source.KEEP + invalid_forms = {**child.forms,key:{token:-value for token,value in child.forms[key].items()}} + bad = source.Graph(child.first,child.initial,child.final,child.moves,invalid_forms) + bad_grid,bad_values,_ = evaluate(bad,required={key}) + source.need(not same_row(rows[key],grid,bad_values[key],bad_grid),"same-price wrong sign control") + invalid_moves = {**child.moves,key:(source.RELAY,source.END)} + try: + source.Graph(child.first,child.initial,child.final,invalid_moves,child.forms).schedule() + except ValueError as exc: + source.need("same ordered chart" in str(exc),"wrong-source rejection reason") + else: + raise ValueError("wrong donor chart accepted") + first = monitors[0] + changed = {**certs,str(first.clock):{str(first.role):"1"}} + try: + source.raw_fold(word,changed) + except ValueError as exc: + source.need(str(exc) == f"other live CLEAR witness source at {first.clock}","self-reference rejection reason") + else: + raise ValueError("self-referencing CLEAR accepted") + dirty = next(entry for entry in monitors if weighted(entry.left,rows,grid)[0]) + missing_relation = [replace(entry,right={}) if entry is dirty else entry for entry in monitors] + try: + verify_clears(missing_relation,rows,grid,rows,grid) + except ValueError as exc: + source.need(str(exc) == f"paired CLEAR relation {dirty.clock}","dirty erase rejection reason") + else: + raise ValueError("dirty CLEAR without its witness accepted") + try: + guarded_literal("1/7","ADD") + except ValueError as exc: + source.need(str(exc) == "source bounded 2/3/5-smooth scalar literal","raw grid control reason") + else: + raise ValueError("non-smooth raw literal accepted") + return {"same_price_wrong_sign":"rejected","wrong_source_chart":"rejected", + "self_clear":"rejected","dirty_clear_erasure":"rejected","denominator_7_raw_literal":"rejected"} + + +def check(): + word,certs,parent,child,monitors,mark,graphs = source.rebuild() + base_grid,base_forward,base_work = evaluate(parent) + base_dual_grid,base_dual,base_dual_work = evaluate(parent.transpose()) + grid,forward,work = evaluate(child) + dual_grid,dual,dual_work = evaluate(child.transpose()) + source.need(len(parent.moves) == 6144 and len(child.moves) == 6143 and len(child.forms) == 7644, + "literal learned paid and public denominators") + for key in child.forms: + source.need(same_row(base_forward[key],base_grid,forward[key],grid),f"forward stable row {key}") + source.need(same_row(base_dual[key],base_dual_grid,dual[key],dual_grid),f"adjoint stable row {key}") + expected = public_formula(word,grid) + source.need(all(forward[child.first+r] == row for r,row in enumerate(expected)),"complete public block") + source_transpose(parent,base_forward,base_grid,base_dual,base_dual_grid) + source_transpose(child,forward,grid,dual,dual_grid) + raw = chronological_replay(word,certs,base_forward,base_grid,monitors) + clear = verify_clears(monitors,base_forward,base_grid,forward,grid) + negative = controls(word,certs,child,grid,forward,monitors) + return { + "status":"PASS_CF6A_ROLE1256_EXACT_OPERATOR_CLEAR", + "source_pr":7700,"source_head":source.SOURCE_HEAD,"source_word_sha256":source.WORD, + "source_certs_sha256":source.CERTS,"caller_sha256":source.CALLER,"relay":mark, + "decoded_graph_sha256":{name:source.digest(data) for name,data in graphs.items()}, + "raw_direct_replay":raw,"clear_replay":clear,"controls":negative, + "exact_normalized_rows":{"paid_matched":len(child.moves),"public_matched":len(child.final), + "both_orientations":True,"protected_main_ports":400}, + "banked_integer_grids":{"parent_forward":base_grid,"parent_adjoint":base_dual_grid, + "candidate_forward":grid,"candidate_adjoint":dual_grid}, + "banked_preproduct_counts":{"parent_forward":base_work,"parent_adjoint":base_dual_work, + "candidate_forward":work,"candidate_adjoint":dual_work}, + "qualification_scope":"Raw normalized operator, banked forward and adjoint operator, and recorded 235 CLEAR relations", + } + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--out",type=Path) + args = parser.parse_args() + result = check() + if args.out: + with args.out.open("xb") as stream: + stream.write(source.canonical(result)+b"\n") + print(result["status"],source.CHILD,flush=True) + + +if __name__=="__main__": + main() diff --git a/research/cf6a-banked-role1256-relay/construct.py b/research/cf6a-banked-role1256-relay/construct.py new file mode 100644 index 0000000000..25115bba74 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/construct.py @@ -0,0 +1,277 @@ +#!/usr/bin/env python3 +"""Rebuild the exact banked #7700 graph and its role-1256 relay contraction.""" + +import argparse +from dataclasses import dataclass +from fractions import Fraction +from functools import cache +from graphlib import TopologicalSorter +import gzip +from hashlib import sha256 +import json +from pathlib import Path + + +HERE = Path(__file__).resolve().parent +DATA = HERE / "data" +SOURCE_HEAD = "7d84799a447867d36137d12ef7ca5646154d763c" +WORD = "ae62d5d8bef6f7146454b4b3643e487a58380c606a16c5baef7bf0dcf9df1472" +CERTS = "39ef28b708cd8bf1166b111d656809407b370dd11cd81a8e43820779f995aca3" +CALLER = "62d94fb992acab0a71c3d12f22be4ce63f4f65e5cbe3f420b93aa1393ffa8dcf" +DONOR_HEAD = "28b2af322a1fab01b3734365988930920f9dda48" +PARENT = "72705b094d83d2ba24006661bbb031786a691b776bedb94515b1321e1535105f" +CHILD = "8e7b755bd2d2d387bc3d3adfe48100985adf74775ca5acbb143170a3d16b5ccf" +PINS = { + "WORD.json.gz": ("50c1facfc5626c060560e2f354b71bd92d0bb1c1e853b2aad72abcbaaa5328a5", WORD), + "CERTS.json": (CERTS, CERTS), + "CALLER.json.gz": ("d889996a337f648087208ab51c98eaf052705d4fca88b5d01b6e9257a829897a", CALLER), + "PARENT-GRAPH.json.gz": ("c86288cddb4b80af3c8128c9a0d2f7a1e82bae64c5152a0d96a19d166afaab1d", PARENT), + "CANDIDATE-GRAPH.json.gz": ("0177c25371181e3b1f2c13325eb8434fbf6384a9ab99a612849efd5d0f6ab2cc", CHILD), +} +REMOVE = 95828 +KEEP = 104442 +ROLE = 1256 +START, RELAY, END = (476, 878, 127) + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")).encode() + + +def digest(raw): + return sha256(raw).hexdigest() + + +def read(name): + path = DATA / name + packed = path.read_bytes() + packed_sha, raw_sha = PINS[name] + need(digest(packed) == packed_sha, f"transport hash of {name}") + raw = gzip.decompress(packed) if path.suffix == ".gz" else packed + need(digest(raw) == raw_sha, f"decoded hash of {name}") + return raw + + +@cache +def rational(literal): + number = Fraction(literal) + need(number and str(number) == literal, "reduced nonzero rational literal") + return number + + +def accumulate(row, source, factor): + for token, value in source.items(): + total = row.get(token, 0) + factor * value + if total: + row[token] = total + else: + row.pop(token, None) + + +@dataclass +class Graph: + """Every paid result is a distinct stable token. Terminals are never donors.""" + + first: int + initial: list + final: list + moves: dict + forms: dict + + def schedule(self): + terminals = set(range(self.first, self.first + len(self.final))) + need(self.forms.keys() == terminals | self.moves.keys(), "complete paid and public forms") + dependencies = {} + for key in sorted(self.forms): + source = self.moves[key][0] if key in self.moves else self.final[key - self.first] + dependencies[key] = [] + for donor in sorted(self.forms[key]): + if donor >= 0: + need(donor in self.moves and self.moves[donor][1] == source, + f"same ordered chart for paid donor at {key}") + dependencies[key].append(donor) + else: + role = ~donor + need(0 <= role < len(self.initial) and self.initial[role] == source, + f"same ordered chart for input donor at {key}") + return list(TopologicalSorter(dependencies).static_order()) + + def transpose(self): + def reverse(node): + if node < 0: + return self.first + ~node + if node >= self.first: + return ~(node - self.first) + return node + + rows = {key: {} for key in self.moves} + rows.update({self.first + r: {} for r in range(len(self.initial))}) + for key, row in self.forms.items(): + for donor, weight in row.items(): + rows[reverse(donor)][reverse(key)] = weight + return Graph(self.first, self.final, self.initial, + {key: (b, a) for key, (a, b) in self.moves.items()}, rows) + + +@dataclass +class Clear: + clock: int + role: int + chart: int + born: int + left: dict + right: dict + sources: list + + +def raw_fold(word, certificates): + """Apply the attributed #7674 folding rule and capture both CLEAR sides.""" + n = word["public"] + start, end, program = word["initial"], word["final"], word["program"] + first = len(program) + capacity = n + word["owned_fields"] + need(n == len(start) == len(end) == 1501 and first == 154768 and capacity == 1569, + "exact raw denominator") + rows = [{~r: Fraction(1)} for r in range(n)] + [None] * word["owned_fields"] + charts = start[:] + [None] * word["owned_fields"] + active, moves, forms, raw_moves = {}, {}, {}, {} + witnesses = [] + peak = 0 + for clock, event in enumerate(program): + op, role, *args = event + need(type(role) is int and 0 <= role < capacity, "literal raw owner label") + if op == "INIT": + need(n <= role and role not in active and rows[role] is None, "new private owner") + need(0 <= args[0] < len(word["frames"]), "valid INIT chart") + charts[role] = args[0] + rows[role] = {} + active[role] = clock + peak = max(peak, len(active)) + continue + row = rows[role] + need(row is not None, "current live field") + if op == "MOVE": + a, b, owned = args + need(type(owned) is bool and owned == (role >= n) and a == charts[role] + and 0 <= b < len(word["frames"]), "literal owner and MOVE charts") + moves[clock], forms[clock] = (a, b), row + raw_moves[clock] = [role, a, b, owned, active.get(role)] + charts[role], rows[role] = b, {clock: Fraction(1)} + continue + need(charts[role] == args[-1], "literal scalar chart") + if op == "CLEAR": + need(role in active and str(clock) in certificates, f"certified private retirement {clock}") + relation = {} + sources = [] + for label, literal in sorted(certificates[str(clock)].items(), key=lambda item: int(item[0])): + field = int(label) + need(0 <= field < capacity and field != role and rows[field] is not None, + f"other live CLEAR witness source at {clock}") + factor = rational(literal) + accumulate(relation, rows[field], factor) + sources.append([field, charts[field], str(factor)]) + witnesses.append(Clear(clock, role, charts[role], active.pop(role), row, relation, sources)) + charts[role], rows[role] = None, None + elif op == "SCALE": + factor = rational(args[0]) + rows[role] = {token: coefficient * factor for token, coefficient in row.items()} + else: + donor, literal, _ = args + need(op == "ADD" and 0 <= donor < capacity and donor != role + and rows[donor] is not None and charts[donor] == charts[role], "other cocharted ADD") + accumulate(row, rows[donor], rational(literal)) + need(charts[:n] == end and all(value is None for value in charts[n:]) and not active, + "same public exit and complete private retirement") + need(peak == 51 and len(moves) == 6144 and len(witnesses) == len(certificates) == 235, + "complete native MOVE and CLEAR custody") + forms.update({first + r: rows[r] for r in range(n)}) + return Graph(first, start, end, moves, forms), witnesses, raw_moves + + +def span(basis): + values = {0} + for axis in basis: + need(type(axis) is int and 0 < axis < 512 and axis not in values, + "independent binary ordered chart") + values |= {axis ^ value for value in values} + return values + + +def contract(source, atlas, witnesses, raw_moves): + a, c, b = START, RELAY, END + need(raw_moves[REMOVE] == [ROLE,a,c,False,None] and raw_moves[KEEP] == [ROLE,c,b,False,None], + "literal route anchors and owner") + need(source.moves[REMOVE] == (a,c) and source.moves[KEEP] == (c,b) + and source.forms[KEEP] == {REMOVE: Fraction(1)}, "pure relay at the anchored paid reader") + readers = [key for key,row in source.forms.items() if REMOVE in row] + need(readers == [KEEP] and all(REMOVE not in clear.left and REMOVE not in clear.right for clear in witnesses), + "sole reader and no original CLEAR incidence") + basis_a,basis_c,basis_b = (atlas[x] for x in (a,c,b)) + need(span(basis_a) < span(basis_c) < span(basis_b) + and tuple(map(len,(basis_a,basis_c,basis_b))) == (3,6,9), "positive 3+3→6 chart nesting") + marks = { + "remove":REMOVE,"keep":KEEP,"charts":[a,c,b],"ranks":[3,3,6],"scale":"1", + "removed_raw_move":raw_moves[REMOVE],"surviving_raw_move_before":raw_moves[KEEP], + "direct_pair_already_paid":(a,b) in source.moves.values(), + "all_readers_of_removed":readers,"raw_clear_use_of_removed":False, + } + forms,moves = dict(source.forms),dict(source.moves) + forms[KEEP] = forms.pop(REMOVE) + del moves[REMOVE] + moves[KEEP] = (a,b) + return Graph(source.first,source.initial,source.final,moves,forms),marks + + +def serialized(graph, frames, kind, **extra): + metadata = { + "schema":"p104-exact-banked-dag/v1","kind":kind,"source_pr":7700,"source_pr_head":SOURCE_HEAD, + "source_word_sha256":WORD,"caller_sha256":CALLER, + "source_clear_certificates_sha256":CERTS,"reference_bank_head":DONOR_HEAD,**extra, + } + return canonical({ + "metadata":metadata,"frames":frames,"initial":graph.initial,"final":graph.final, + "first_output":graph.first,"moves":[[key,*route] for key,route in sorted(graph.moves.items())], + "forms":[[key,[[token,str(value)] for token,value in sorted(row.items())]] + for key,row in sorted(graph.forms.items())], + "schedule":graph.schedule(), + }) + + +def rebuild(): + word = json.loads(read("WORD.json.gz")) + certs = json.loads(read("CERTS.json")) + caller = json.loads(read("CALLER.json.gz")) + need(certs["candidate_canonical_sha256"] == WORD and caller["stages"] == 16 + and caller["ambient_rank"] == 137, "literal source and signed caller binding") + certificates = certs["clear_event_index"] + parent,witnesses,raw_moves = raw_fold(word,certificates) + child,mark = contract(parent,word["frames"],witnesses,raw_moves) + graphs = { + "PARENT-GRAPH.json.gz":serialized(parent,word["frames"],"parent"), + "CANDIDATE-GRAPH.json.gz":serialized(child,word["frames"],"candidate", + source_banked_graph_sha256=PARENT,paid_relay=mark), + } + for name,raw in graphs.items(): + need(raw == read(name), f"deterministic reconstruction of decoded {name}") + return word,certificates,parent,child,witnesses,mark,graphs + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--out-dir", type=Path, help="Optional directory for regenerated gzip artifacts") + args = parser.parse_args() + *_,graphs = rebuild() + if args.out_dir: + for name,raw in graphs.items(): + with (args.out_dir/name).open("xb") as stream: + stream.write(gzip.compress(raw,mtime=0)) + print("PASS_CF6A_REBUILD", PARENT, CHILD) + + +if __name__=="__main__": + main() diff --git a/research/cf6a-banked-role1256-relay/credits/7658-NOTICE b/research/cf6a-banked-role1256-relay/credits/7658-NOTICE new file mode 100644 index 0000000000..2baa2a719e --- /dev/null +++ b/research/cf6a-banked-role1256-relay/credits/7658-NOTICE @@ -0,0 +1,21 @@ +Apache-2.0. DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. + +The base word (data/base-7641-word.json.gz, unmodified bytes, sha256 de43ed04f58133eaef8f8d12a9dae1e6e8aa7f9721044200cc839673d86fd7c1) +is the word of our #7641 (20 swap-then-delete composites on SYLforge's #7637), vendored as data only. #7641's own base is SYLforge's +#7637 candidate word, whose notices read: + + "Apache-2.0. Local H5B + E1/E4 combination experiment, prepared with OpenAI assistance. + All earlier contributors and notices in hydrogen-bounded-verification-20261117/NOTICE remain credited. In particular: Ali Romman + (#7605), SYLforge, Clear1nsight, DreamingOfClouds, and all upstream contributors listed there." + +#7637's recorded technique credits: DreamingOfClouds #7630 (E1 rebirth/canceller, E4 existing-co-presence reroute), Clear1nsight +#7631/#7633 (efficient E4 integration, E1 prefix/tail settlement), and SYLforge's H5B literal-frame-restored archive. Its lineage +also carries Clear1nsight's #7626/#7314/#7274, Rohan Arun's #7277 and signed #7113 caller, and the contributors named in the +retained sources. #7641, #7637 and their code are not run by this package; only their words are read as data. + +This package adds five edits found by a large-neighbourhood search (one SWAP-NULL relabel of two helpers with a stay deletion, one main +stop removal, three helper stay deletions with re-placed contacts) and one hub re-settle. The helper-stay deletion with re-charted +contacts (E3) is of the type introduced by Clear1nsight's #7612 and ToikY's #7643. check.py is our own code: its replay, crossing and +column-test sections come from our #7630-on-#7623, swap-composite and #7641 packages; its column tests follow the description of the +affected-pair tests in #7620's README and native runner. The CLEAR certificate check implements the acceptance rule of #7620's +verify_certificates (read, not run). No other author's code was run; their words are read as data. diff --git a/research/cf6a-banked-role1256-relay/credits/7700-CITATION.cff b/research/cf6a-banked-role1256-relay/credits/7700-CITATION.cff new file mode 100644 index 0000000000..d80f6b8660 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/credits/7700-CITATION.cff @@ -0,0 +1,55 @@ +cff-version: 1.2.0 +message: >- + Please cite the selected composition and its constituent contributions, + this project and the upstream manuscript. The selected checkpoint is PR4470 on the cumulative productive-helper framework; consult certificates/selected-result.json for publication status. + Project-level authorship identifies the maintainer, not sole authorship of + the community result. See CONTRIBUTORS.md and the frozen source notices. +title: "A sharper exponent for integer multiplication" +authors: + - family-names: Colkitt + given-names: Douglas +license: Apache-2.0 +type: software +version: "community-joint4470-2026-10-22" +date-released: 2026-10-22 +repository-code: "https://github.com/CrocSwap/integer-mult-bounds" +url: "https://github.com/CrocSwap/integer-mult-bounds" +abstract: >- + Community research on integer multiplication. The selected maintainer-reviewed + conditional construction has kappa = 60403/20000000 = 0.00302015. + Cinna Davis's PR4470 joint helper frames and query-thinned controller build on + her preceding constructions, zxv's native/productive-helper and compiler work, + Jacob Alan Sussman's mixed-target recursion, and the cumulative community + framework. Exact finite replays and independent audits retain explicit + all-column/native, owned-erasure, compiler, precision/tape, analytic, prime + and recovery assumptions. This is not a complete formal multiplication proof. +preferred-citation: + type: software + title: "A sharper exponent for integer multiplication: community research repository" + authors: + - family-names: Colkitt + given-names: Douglas + year: 2026 + url: "https://github.com/CrocSwap/integer-mult-bounds" + notes: >- + Maintainer citation only, not sole authorship of the mathematical result. + Credit Cinna Davis (PR4470/4447/4441/4440/4416), zxv (PR4359/4433), + Jacob Alan Sussman (PR4268), independent auditors Mihir Srivastava and + Ryanson Jonathan, Mark/Matarener for the commutation question, and the full + geometry, binary, native, precision and outer lineage, including Rohan Arun, + Jeremy Kothe, Chafik Boukhalfa and the contributors listed in CONTRIBUTORS.md + and docs/research/community-joint4470-contributors.md. Cite constituent PRs + where their results are used; preserve their licenses and assistance disclosures. +keywords: + - integer multiplication + - computational complexity + - exact arithmetic + - parameter optimization + - reproducible research +references: + - type: unpublished + title: "Integer multiplication below n log n" + authors: + - name: OpenAI + year: 2026 + url: "https://github.com/openai/math/tree/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/Integer-multiplication-below-n-log-n-September-23-2026" diff --git a/research/cf6a-banked-role1256-relay/credits/7700-NOTICE b/research/cf6a-banked-role1256-relay/credits/7700-NOTICE new file mode 100644 index 0000000000..59d8e0cf31 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/credits/7700-NOTICE @@ -0,0 +1,415 @@ +A sharper exponent for integer multiplication +Copyright 2026 Douglas Colkitt + +This project includes unmodified source files from OpenAI's manuscript +"Integer multiplication below n log n" and its accompanying repository: +https://github.com/openai/math +Commit: adc7f1241b42e322a6451854ab7e4b4c146bf78a + +The original manuscript identifies OpenAI as its author. Its Apache-2.0 +license is retained at upstream/LICENSE. The exact source URLs and hashes +are recorded in upstream/manifest.json. Proposed modifications are supplied +as separate files under patches/; upstream source files remain unchanged. + +The original local research note, scripts, certificates, patches, and +documentation were prepared by Douglas Colkitt with assistance from OpenAI +Codex. The community release incorporates work by the contributors identified +in the notices below; it is not solely Douglas Colkitt's work. +This project is not an official OpenAI release or an OpenAI endorsement. + +Related contributions (not imported in this checkpoint): +Zhihao Chen (jacklightChen), PR #7, supplied an earlier ternary five-subset +motif, finite-alphabet transfer and a different compressed producer: +https://github.com/CrocSwap/integer-mult-bounds/pull/7 +The present checkpoint claims no priority for that motif. Related compressed +complex-network work was submitted by eumemic in PR #3: +https://github.com/CrocSwap/integer-mult-bounds/pull/3 +The pending contributions and their stronger bounds require their own review; +this notice does not represent adoption or verification of their claims. + +Additional community work, including parallel and superseded submissions, is +acknowledged in CONTRIBUTORS.md, with pinned submission metadata in +docs/research/contribution-snapshot.json. These acknowledgements do not imply +joint authorship of the checkpoint, incorporation of pending code, or verification +of submitted mathematical claims. Original source-specific notices remain in force. + +Community release (accepted by conditional maintainer audit): +The following original contributor notices apply to the imported PR #39 chain. +The preceding non-import statements describe the preserved 2^-30 checkpoint. + +Ternary five-subset construction and common-four-point resynthesis +Copyright 2026 Zhihao Chen (jacklightChen) + +This is Zhihao Chen's first submission of this specific construction to this +repository. Research, proof development, code and verification were prepared +with substantial assistance from GPT-6 Astra (OpenAI Codex), as identified by +the contributor. This is not independent review or an OpenAI endorsement. +Future research building on this contribution should explicitly acknowledge +Zhihao Chen (jacklightChen), cite the accompanying note and pull request, and +retain the preceding contributors' attribution. This notice records research +provenance; the repository's Apache-2.0 license remains unchanged. + +Dependencies retained from eumemic's Claude-assisted PRs #3 and #5: +https://github.com/CrocSwap/integer-mult-bounds/pull/3 +https://github.com/CrocSwap/integer-mult-bounds/pull/5 +PR #5 commit: d3d370c34937503bd3fa63c83d505a05e8e50893 +These include complex_circuit.py, complex_network.py, fast_gaussian.py, +their generators, construction notes and certificates. The Gaussian input +scaling proof is corrected in this derivative; see the modification notice below. +Aligned pairing also appears in Bortlesboat's PR #2. Retained totals and bank +sharing appear in dleen's PR #4 and cheaper retained centers in eumemic's PR #6. +Their results and ideas are credited separately from this new construction. + +Bulk recursion and controlled tensor basis, 8 October 2026 +Copyright 2026 icekylinx + +The new projector batching, controlled simultaneous basis, mixed-width tape +recursions, whole-residual complex recursion, and dependency-path precision +guard in the batched-23 proof package are contributed by icekylinx, developed +with substantial OpenAI GPT-6 Astra assistance. Review corrections and +repository integration were prepared with OpenAI Codex assistance. They build on the retained +PR #7 finite producers and the preceding contributions credited above. +The new package retains the repository's Apache-2.0 license and the original +authors' attribution. It is not an official OpenAI release or endorsement. + +Modification notice, 8 October 2026 (icekylinx): the retained fast Gaussian +proof now bounds shifted approximation error by F=2^ceil(1.14 alpha^2). +The P=34p precision budget and asymptotic exponent are unchanged. New batching +checks are integrated into make verify. Existing attribution and licenses +are retained. + +Partial-swap extension, 8 October 2026 +Copyright 2026 icekylinx + +The partial-swap framing, binary retained-total triple construction, +dependency-preserving positive labels and carrier reuse, unequal (25,23,57) +common basis, improved complex batching, and exact assembly are contributed +by icekylinx with substantial OpenAI GPT-6 Astra and Codex assistance. +This extension directly inherits PR #10, commit +62691e395a0458ce089a1c7b5d89e74291e95e29. The portable producer adapters +modify the retained paired-exclusion and shared-point implementations credited +above. The original licenses, attribution, and Gaussian correction are retained. + +Endpoint-gauge extension, 8 October 2026 +Copyright 2026 icekylinx + +The complementary auxiliary endpoint gauges, (32,30,40) controlled basis, +general nondegenerate binary phase residuals, retained-center complex producer, +updated path guard and exact assembly are contributed by icekylinx with +substantial OpenAI GPT-6 Astra and Codex assistance. This extension inherits +f2ab41aebad47861caf6316282c1793e5513845e and its PR #10 ancestry. New portable +adapters retain the paired-exclusion and shared-point contributions credited +above. Original licenses, notices and the Gaussian correction are retained. + +Structured-basis and semantic-bulk extension, 8 October 2026 +Copyright 2026 icekylinx + +The selected (32,30,36) bit construction, A1/A5 block refinements, fixed +middle-axis I+J profiles with bounded-minor CRT certificates, mixed dyadic +complex centers, complete data-front batching and circuit-specific assembly +are contributed by icekylinx with substantial OpenAI GPT-6 Astra and Codex +assistance. The immediate parent is ed90fd940279c336ebc45968631bdebfb087b505. + +The semantic/bulk compatibility argument, literal scalar charge, product row +stock and parameterization adapt Zhihao Chen (jacklightChen)'s PR #23, +commit 661ebabc1076c9f525d7ce4967c876b203fa9827. Translated complex endpoints +are adopted from the same contributor's PR #21, +commit 5ba6cf0bfb68f2be8d15610e7972207c50254d6a, following eumemic's source-frame +work and the earlier nested-basis contributions. + +Completed-child semantic precision, arbitrary-coordinate routing, phase-cell +Gaussian inversion and bulk tape transfer are credited to the RaD project +(hipotures), commit 45d9b60355872041f9275f77c057514def0d45bc, exposed through +PR #20 at 4f8d6c8272b5ff307a0da51df545ec3cd96a8b6e. Their selected proof +sources retain their separate CC0 license and original NOTICE under +references/semantic-bulk/rad20. The PR #23 source retains its recorded OpenAI +Codex assistance; RaD retains its recorded Codex and GPT-6.1-Sol Ultra +assistance. These are source attributions, not claims about this session's +runtime model. Related contributions by Rohan Arun and Aurel Prosz remain +acknowledged in the imported notices. No exclusive priority or additional +license condition is asserted. + +Copied retained-center extension, 8 October 2026 +Copyright 2026 icekylinx + +The copied retained-center schedule in both orientations, its complex-phase +transfer, the Wm-N+L rank budget, and the selected (25,23)/(28,28) composition +are contributed by icekylinx with substantial OpenAI GPT-6 Astra and Codex +assistance. This extension inherits PR #32 at +0ef3aeb61f55cc0b321ce6a0ef00acee25cefe52 and the preceding PR #10/#18/#24 work. + +The two-stage topology and paid copied-stream endpoint correction are due +to Aurel Prosz (Paureel), c82d09eb4781b68435e3fa3eb6beea72fa900fab, +through Zhihao Chen (jacklightChen)'s PR #29 unequal-axis composition, +9d963275075fa98f1da821e27757b238dafd6b3c. That source also credits Swapnil +Jain's two-stage development at ae405eb474d1486b2d8aef90139869f927f4836a. + +The contiguous corner method, incidence factorization and exact partition +certificates are due to Rohan Arun (PR #31), method commit +02f68f95369c39955c5ffcfddbd75cd83e26b305. The selected (25,23) certificate +specializes Dominik Scholz's parameterization (PR #33), +a499a345c040aa15b68e984a0904eadc485c7a7e. Their source notices and proof +snapshots are preserved in references/copied-centers. Historical OpenAI +Codex, GPT-6 Astra and Anthropic Claude Opus 5.5 assistance is credited to +the respective imported sources. Existing PR #21/#23 and RaD attribution, +licenses and the Gaussian correction remain in force. + +Copied centers with reversed (23,25) data corners, 2026-10-08 +Rohan Arun with substantial OpenAI Codex assistance supplies the composition, +exact dimension23 controls and cost/assembly integration. James Chang's PR34 +supplies the reversed boundary family; icekylinx's PR36 supplies copied retained +centers and the selected complex graph. The balanced assembly remains attributed +to RaD/hipotures and its PR34 specialization. Retain Dominik Scholz PR33, Rohan +Arun PR31, Zhihao Chen PR29/21/23, Paureel/Aurel Prosz, Swapnil Jain, icekylinx, +eumemic, Douglas Colkitt, OpenAI and all earlier notices and hypotheses. +This is not a claim of formal verification, new foundational rank identities, +global optimality or measured runtime speedup. + +Fixed middle basis with copied reversed corners (2026-10-08): +Rohan Arun, with substantial OpenAI Codex assistance. Composition and +simultaneous-basis proof retain icekylinx PR32/36, James Chang PR34, +Dominik Scholz PR35/38, Zhihao Chen, Paureel, Swapnil Jain, RaD/hipotures, +eumemic and all preceding attribution and licenses. See research/copied-fixed-reversed. + +Changed-graph composition with copied centers and fixed bases, 8 October 2026 +Prepared with OpenAI Codex assistance. +The new composition uses icekylinx PR36 copied centers and PR32 fixed-I+J +projectors/profiler, Dominik Scholz PR35 two fixed factors and CRT argument, +Zhihao Chen (jacklightChen) PR29/23 interfaces, Aurel Prosz (Paureel) and +Swapnil Jain's two-stage development, Rohan Arun PR25/31 corner methods, +Dominik Scholz PR33/38 dimension/composition work; James Chang (jamesyc) +PR34 reversed geometry and balanced transfer; Rohan Arun PR37/39/40 +reversed integration, modular data tests and both-fixed baseline; +RaD (hipotures) PR41 changed scalar DAGs, alternating point order and +independent role compiler; RaD balanced routing/bulk interfaces, and all +retained predecessors. +Complete attribution and the conditional proof boundary are recorded in +research/copied-fixed/PROOF.md; imported originals and source pins are retained. +Original Apache-2.0 and CC0 notices remain applicable. + +Community follow-up integration (PRs #49, #45 and #26), 8 October 2026: +Rohan Arun contributes weighted carrier matching and climbed summand/leave-one-out +orders (PRs #44/#47/#49), with Anthropic Claude assistance. The final construction +composes Chafik Boukhalfa's changed-graph checks, exact rational data recovery and +reordered exclusion sums (PRs #43/#46/#48, OpenAI Codex assistance) with RaD / +hipotures's alternating pair order and independent physical role compiler (#41). +All predecessor attribution and conditional proof interfaces remain in force. + +Alejandro Zarzuelo Urdiales contributes Gaussian parity and canonical arithmetic +proofs, finite tensor execution, profile precision accounting and mixed-center +reference checks (#45), with substantial OpenAI Codex assistance. See +research/gaussian-parity-synthesis/PROVENANCE.md for his full attribution. +Ryan S / princezuda contributes historical Lean certificate arithmetic, algebraic +frame/movement/guard lemmas and independent paired-circuit checks (#26). Original +source notices and historical snapshots are preserved. Neither formal package +claims a full formal proof of the multiplication algorithm or a new kappa. + +Joint frame compilation of skip-prefix strips + +The local compiler and exact finite witnesses were prepared by eumemic with +substantial OpenAI Codex assistance. Avi Eisenberg / ikeboy with Anthropic +Claude assistance supplied the unmodified PR #53 skip-prefix producer. +The pinned PR #48 pipeline is Chafik Boukhalfa's contribution, incorporating +Rohan Arun, RaD / hipotures, icekylinx, Dominik Scholz, James Chang, +Zhihao Chen, Aurel Prosz / Paureel, Swapnil Jain, eumemic, Douglas Colkitt, +OpenAI, David Harvey, Joris van der Hoeven and the earlier contributors +credited in the retained sources. See references/frame-compiler/pr48/NOTICE +and references/frame-compiler/pr53/NOTICE for their original attribution. +No authorship or review by those predecessors is claimed for this compiler. + +Joint dual-skip/frame-compiler composition (2026-10-08) +--------------------------------------------------- +Rohan Gupta / gupt1156 with Anthropic Claude assistance: PR55 dual-skip +scalar graph; original LICENSE and NOTICE are retained under +references/frame-compiler/pr55. eumemic with substantial OpenAI Codex +assistance: PR57 joint reversible frame compiler, serialized physical-word +replay and profile reconstruction. Chafik Boukhalfa with OpenAI Codex +assistance: this composition, independent integration and exact certificate. +Avi Eisenberg / ikeboy, Rohan Arun, RaD / hipotures, icekylinx, and all +predecessor authors retain the notices above and in pinned source files. +No original copyright or Apache-2.0 notice is removed. + +Ranked reclamation after the PR58 joint-dual composition (2026-10-08) +---------------------------------------------------------------- +Chafik Boukhalfa with OpenAI Codex assistance: prioritize retired physical +slots by descending current frame rank, retaining slot ID as the tie-breaker; +complete replay, exact profiles, comparison and adversarial controls. +The dedicated joint_dual_reclaim_compiler.py is derived from eumemic's PR57 +compiler. Its original shared compiler remains byte-identical. The PR55 +producer and all preceding attribution remain unchanged. The complete PR58 +comparison certificate and its original source/proof provenance are retained +under references/frame-compiler/pr58. + +Skip-prefix strip producer, 8 October 2026 +By Avi Eisenberg (ikeboy), with Anthropic Claude (Claude Opus 5.5) +assistance. The skip-prefix leave-one-out strip layout in +research/skip-strips/skip_graph.py is new. Everything else reuses Chafik +Boukhalfa's PR #43/#46/#48 research/copied-fixed pipeline, its verification +code, exact data recovery and support-order sorting, together with: +- Rohan Arun's PR #44 weighted carrier matching optimizer; +- RaD (hipotures) PR #41 alternating point order; +- every predecessor credited above. +Complete attribution and the conditional proof boundary are recorded in +research/skip-strips/PROOF.md. Original Apache-2.0 and CC0 notices remain +applicable. + +Local split-pair skip-prefix research continuation (2026-10-08) +Prepared with substantial OpenAI Codex assistance at the user's request. +New contribution: singleton/pair recursive partition refinement, finite summand +order and moment search, and verified composition with inherited paid clones. +Avi Eisenberg/ikeboy with Anthropic Claude assistance: PR53 skip-prefix strips. +Chafik Boukhalfa with OpenAI Codex assistance: PR54 original-envelope clone +specialization and PR43/46/48 checking interfaces. RaD/hipotures: PR51 +whole-chain/source-partition cloning and earlier producer/interfaces. +Rohan Arun: PR44 weighted matching and earlier fixed/reversed work, with all +stated historical AI assistance. All predecessor notices remain applicable. + +Original-envelope whole-chain clones on skip-prefix strips (research/skip-clones): +Chafik Boukhalfa, prepared with OpenAI Codex assistance. The complete-chain +source-partition clone operation is adapted from RaD / hipotures, PR #51, +with original envelopes retained here. The scalar base is Avi Eisenberg's +PR #53 skip-prefix layout, prepared with Anthropic Claude assistance. +All credited PR #43/#46/#48, PR #44 and earlier code/proof notices remain +in force. This extension is provided under the repository's Apache-2.0 terms. + +Community review checkpoint #50–#61, 8 October 2026 +Maintainer integration and independent arithmetic: Douglas Colkitt, with OpenAI Codex. +Avi Eisenberg / ikeboy: skip-prefix strip framework (#53), with Anthropic Claude. +Rohan Gupta / gupt1156: parallel order search (#50, stated Antigravity assistance) +and dual-suffix strips (#55, Anthropic Claude assistance). +Eumemic: equal-frame joint compilation and paid signal reclamation (#57), with Codex. +Chafik Boukhalfa: original-envelope paid clones (#54), composition (#58) and ranked +reclamation (#60), with Codex. Rohan Arun: order search (#52) and positive-frame +composition (#56), with Anthropic Claude and stated Codex validation assistance. +RaD / hipotures: enlarged frames, source partitions and paid whole-chain clones +(#51), with Codex. Rohan Garg / rohangar1: singleton/pair recursion and paid-clone +composition (#59), with Codex. Alejandro Zarzuelo Urdiales: exact parameter +refinement, scoped Lean arithmetic, matrix/parity and search tools (#61), with +his disclosed multi-tool and Codex assistance. +Parallel #50/#52 records are reviewed and credited without replacing the earlier +climbed-48 implementation; their exact commit history is retained. The separate +#51 witness is retained as research; its source-graph/negative-basis data proof +has not received the same full replay as #56's consumed compiler machinery. +See docs/research/community-round2-review.md for precise validation boundaries. +All earlier licenses, contributions and notices remain applicable. + +Interval strips and core-aware pair assembly + +The interval leave-one-out strips and the core-aware group-pair assembly in +research/pair-assembly were prepared by Avi Eisenberg / ikeboy with Anthropic +Claude assistance. They build on PR #53's skip-prefix pipeline and its +inherited PR #48 sources. The stacked witness in research/pair-assembly/frame +uses eumemic's PR #57 joint frame compiler unchanged; its driver and verifier +are adaptations of PR #57's skip_frame_compiler.py, skip_frame_compose.py and +verify_skip_frame.py. Original notices are retained. + +Stopped product-ring extension, 9 October 2026 +Copyright 2026 icekylinx + +The opposite-bank generic projector factorization, componentwise atom-ring +adapters, stopped recurrence and outer ordinary-interchange conversion, +aligned pair-star producer with rational centers, exact denominator-21 +grid and selected (23,23)/(24,24) composition are contributed by icekylinx +with substantial OpenAI GPT-6 Astra and Codex assistance. This extension +builds on merged PR #36, 11817ccacb564bb7f98789c20dc11d3fece207e3, and is +integrated on upstream main 56b66d58297deca1d7dd130247d720e960f77a37. + +The retained ordinary leaf uses the preceding projector, corner and +copied-center proofs. The selected two-stage topology retains Aurel Prosz +(Paureel), Swapnil Jain and Zhihao Chen's credits; the semantic assembly +retains PR #21/#23 and RaD's attribution. Paired producers, carrier matching, +original source notices and each imported license remain unchanged. + +Partial-gauge extension, 9 October 2026 +Copyright 2026 icekylinx + +The pair-first cube assembly, compatible backward frame enlargement, +partial source-gauge schedule and stopped whole-projector composition are +contributed by icekylinx with substantial OpenAI GPT-6 Astra and Codex +assistance, extending PR #104 at 948ce1510df750f4c18b96bdaef436a86f8bf834. + +The physical deferred bit word, reflected event accounting, fan-order +clarification and signed two-stage endpoint are adopted from Zhihao Chen +(jacklightChen), PR #97, e15350b66e4bf796153a68c240a6cc1b788abe3e, with +Codex assistance. Its deferred readouts, V leaves, lifted frames and frozen +witness originate in Swapnil Jain's 741e7aa078392553815df7926ee17ac5e25a8c38, +with the original Claude disclosure retained. Cyclic interval and core-aware +pair primitives build on Avi Eisenberg (ikeboy), PR #62, +ad0f25ff7b23cff7f08ad237c2254e6ecf74257e, with Anthropic Claude assistance. +Prior two-stage, copied-center, ordinary-leaf, semantic/bulk, routing and +precision credits remain in force. Imported source notices and licenses +are preserved under references/partial-gauge/; see SOURCES.json. + +Three-stage cover extension, 9 October 2026 +Copyright 2026 icekylinx + +The arbitrary-subspace Clifford frame theorem, three-stage Cayley geometry, +weighted q-adic GL cover, unit-lower weighted compiler, charged local-ring +fallback, uniform batching, internal row borrowing and exact composition +are contributed by icekylinx with substantial OpenAI GPT-6 Astra assistance. This +repository integration uses Codex assistance and extends +PR #115, cf60442983c153a3a0f5272ea4713f99eba13c86. + +The selected local complex DAG and support/label replay are adopted from +Copyright 2026 eumemic, PR #117, cbb05ce504d571546d9b7794c186a613c659c3bf, +with its original Apache-2.0 terms and Claude assistance disclosure. +The unchanged bit physical word retains Zhihao Chen (jacklightChen), +PR #97, and Swapnil Jain's underlying witness and assistance notices. +The prior opposite-bank, stopped ordinary-leaf, copied-center, topology, +semantic/bulk, precision and analytic credits remain applicable. +Original source notices and license bytes are preserved in +references/three-stage-cover/pr117/ and references/partial-gauge/. + +Paired-cube and shared-core extension, 9 October 2026 +Copyright 2026 icekylinx + +The paired-coordinate triple-cube identity, signed overlap channels, +original-source involution, coordinate-star centers, concrete frame/carrier +compiler, chronological source gauges, PR97 gauge-subset selection, +orthogonal cross-stage routing and exact supplier/assembly integration +are contributed by icekylinx with substantial OpenAI GPT-6 Astra assistance. +Repository integration uses Codex assistance and extends PR #130 at +6a9970a530119174507904e23592fd59ede19a5d. + +The substantial completed-core workspace-sharing principle is credited to +an664, PR #128, 530588a019b4a74f09180680c9e3961bf649ec89, with its reported +OpenAI Codex assistance. No source code, partition or serialized witness +from that PR is imported. The new routing and paired-motif integration +are described separately and claim no exclusive priority for broad sharing, +paired-coordinate, Fourier or carrier-matching ideas. + +Selected coarse queries restrict the retained eumemic PR #117 positive DAG; +its original Apache-2.0 and Claude assistance notices remain unchanged. +The bit word and original frames retain Zhihao Chen's PR #97 and Swapnil +Jain's frozen witness, notices and historical assistance disclosures. +Earlier generalized Clifford, three-stage, uniform weighted recursion, +ordinary-leaf, semantic/bulk, precision and analytic credits remain in force. +Source-specific license bytes are preserved under references/. + +October 9 recycled-bit integration: +DaysSky (#150), William Porter/hpst3r (#147), Thomas Marchand/Th0rgal (#146), +Rohan Gupta/gupt1156 (#148), James Chang/jamesyc (#124), SovereignSteak (#122). +The original notices and assistance disclosures are retained under research/, +including research/recycled-bit-integration/NOTICE. Andrew Barnes/Bortlesboat +(#101) repairs shared verifiers using rfu08's #64 counterexample. rfu08's +scoped finite and formal-transfer packages are included separately; they do +not establish the full multiplication theorem. Earlier and parallel credits +remain applicable. Douglas Colkitt integrated these with OpenAI Codex assistance. + +SovereignSteak PR151 independently supplies the matching gauge/recycling +composition and the selected 473/10^6 atom refinement; its original package +and assistance disclosure are retained under research/gauge-recycling/. + +October 9 coordinated-frame and completed-entrance-bank integration: +Dugongue PR186, 166a34d75e853e933855f0f7e940fe77c4bb6b8d, builds on +Chafik Boukhalfa/chafreaky's PR181, 7fb2194801e3a10f54772c7f0d5505035a4fc0ad, +and eumemic's PR168 v4, 4a3c769e5c5430e7114c4d3e099ff34664677f17. +The frozen package and prerequisite archive preserve all author, source-license +and assistance notices, including PR175's compiler optimization. DaysSky's +carrier closure, James Chang's terminal substitution and balanced assembly, +geckods' stopping refinements and all preceding framework credits remain. +Rohan Arun's PR185 bootstrap and chafreaky's PR182 bit refinement are reviewed +parallel contributions; their gains are not added to the selected witness. +Douglas Colkitt integrated the package and supplied the bank scheduling +supplement with OpenAI Codex assistance, under Apache-2.0. The all-size +interfaces remain conditional; finite verification is not full formalization. diff --git a/research/cf6a-banked-role1256-relay/credits/OUTER-GATE-NOTICE b/research/cf6a-banked-role1256-relay/credits/OUTER-GATE-NOTICE new file mode 100644 index 0000000000..1bc9b4da2b --- /dev/null +++ b/research/cf6a-banked-role1256-relay/credits/OUTER-GATE-NOTICE @@ -0,0 +1,13 @@ +# Attribution and source reuse + +New independent operator/invoice verification and fixed-grid interval implementation: OpenAI Codex-assisted research session, 2026-11-10. Apache-2.0. + +DreamingOfClouds supplied the #6936 native predecessor and #6937 shared-wire backup/E-free root. CubeJerry supplied #6912 caller blocks, #6980's QUERY-only caller and #6970/#6985 precision methods. Preserve Ali Romman's #5599 helper-split attribution, icekylinx's #104 odd-grid attribution and unpaidmoon's #6930 width-phase attribution in the parent construction. + +Three unchanged source files are authenticated by exact SHA256 and source commit/path in `INDEPENDENT-SOURCES.json`: + +- #6970 `independent_bounds.py`: fixed integer-grid and positive caller-transfer engine. +- #6985 `envelopes.py`: positive forward envelopes and backward covector witnesses. +- #6985 `source_binding.py`: retained helper functions for the envelope engine. + +The adapter applies only two literal helper-census substitutions in memory and records them. It does not call that adaptation an independent mathematical implementation. The new reverse native operator, formal caller ring and elementary interval engine do not import the source authors' operator or invoice checkers. diff --git a/research/cf6a-banked-role1256-relay/credits/PR7663-NOTICE b/research/cf6a-banked-role1256-relay/credits/PR7663-NOTICE new file mode 100644 index 0000000000..6ce1bc49a3 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/credits/PR7663-NOTICE @@ -0,0 +1,7 @@ +Apache-2.0. Ali Romman with substantial OpenAI Codex assistance. + +The new material is the joint chart assignment, its source-bound operator and caller checks, and the fresh-cost complete-root scalar and private-bank specialization. The parent data are from Clear1nsight's PR #7660 on DreamingOfClouds' PRs #7658 and #7641 and SYLforge's PR #7637. The contributors credited in those sources retain their credit. Original notices are in source/parent-NOTICE, source/physical-NOTICE and source/word-NOTICE. + +Rohan Arun supplied the 17-stage signed caller in PR #7113. The unmodified interval gate and the exact caller data come from its pinned source. See source/caller-NOTICE and source/independent-NOTICE, and the source file inventory for all consumed bytes. The two operator engines and integer power evaluator come from the declared current-main inputs. + +Jerry Chen (CubeJerry) supplied selected PRs #7000 and #7001. The selected application and its phase, common-root, finite-cost and compiler arguments, the odd-native common-grid package, the prior typed six-Gamma reset of PR #7586 and the contributors credited in those records provided the foundations used here. PR #7661 independently derives the fixed caller residuals. PR #7662 supplies a rounded parent-clock alternative. This package uses neither implementation. diff --git a/research/cf6a-banked-role1256-relay/credits/PR7669-PROVENANCE.md b/research/cf6a-banked-role1256-relay/credits/PR7669-PROVENANCE.md new file mode 100644 index 0000000000..bbee2437f0 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/credits/PR7669-PROVENANCE.md @@ -0,0 +1,43 @@ +# Provenance, credit and scope + +This is a cumulative contribution. Thank you to everyone who has made their constructions, exact inputs, failure cases and careful reviews available. Those contributions made this composition possible; the small increment here should not obscure the much larger body of work it rests on. We aim to leave equally inspectable material for the next researcher. + +## Direct lineage and reused methods + +- **SYLforge, #7637:** the H5B frame-restored233-CLEAR construction is the published ancestor of this research. The present K372-2 source retains its descendants rather than starting a new independent construction. [PR7637](https://github.com/CrocSwap/integer-mult-bounds/pull/7637). +- **DreamingOfClouds, #7641 and #7658:** #7641 combines20 edits over #7637. #7658 supplies the large-neighbourhood construction and its exact joint hub reconstruction: helper360/537 SWAP-NULL relabel, main176 bypass, helper236 contact re-chart, helper370 last-stay removal and helper461 first-stay removal. The source explicitly credits its #7630/#7636 relabel lineage and #7634 swap law. Our source descends from this word; those gains are not claimed as new work here. [PR7641](https://github.com/CrocSwap/integer-mult-bounds/pull/7641), [PR7658](https://github.com/CrocSwap/integer-mult-bounds/pull/7658). +- **Clear1nsight:** the contact re-chart type from #7612 and the24-bit coefficient-splitting report are part of the construction's lineage. #7626 contributed source isolation/portable materialization, and #7631/#7633 are credited by the parent lineage. #7660 separately published the role379 shortcut already present in our source; we do not count its rediscovery as another improvement. [PR7612](https://github.com/CrocSwap/integer-mult-bounds/pull/7612), [coefficient report](https://github.com/CrocSwap/integer-mult-bounds/discussions/7111#discussioncomment-19691406), [PR7660](https://github.com/CrocSwap/integer-mult-bounds/pull/7660). +- **ToikY, #7643:** the contact re-chart work is explicitly credited by #7658 alongside Clear1nsight's #7612. Its74-erasure contract and κ are not added to this candidate. No shared CI repair is copied by this PR. [PR7643](https://github.com/CrocSwap/integer-mult-bounds/pull/7643). +- **Rohan Arun, #7113:** the signed caller/accounting lineage underlies the actual16-call composition. Its original source commit is07a76c5e2738882c0cb322278e56f6cae3c9885d. We recount the literal16-call input here; we do not substitute historical17-call constants. [PR7113](https://github.com/CrocSwap/integer-mult-bounds/pull/7113). +- **Ali Romman and upstream contributors:** #7605 supplies an earlier exact protected/application checkpoint cited by the #7637 lineage. The two unmodified directed invoice comparison files are copied from canonical upstream base e54523517d0f03e58352e647c403a5af3e525a57, retaining their attribution and Apache-2.0 headers. Their arithmetic is not a full scientific acceptance gate. [PR7605](https://github.com/CrocSwap/integer-mult-bounds/pull/7605). +- **CubeJerry, Douglas Colkitt and the earlier source contributors:** the retained framework, primitive/service work and repository infrastructure form part of the inherited basis. This package does not claim that their open supplier obligations are resolved by a successful finite replay. + +## What this contribution adds + +The predecessor K372-2 supplies five EARLY edits (1188,1013,940,1141,1195, with940/1141 sharing one ADD). This construction recomputes the1517/770 bypass on that actual source and combined it with a three-field triangle repair. The new contribution is their compatible composition, exact12-block edit, final235 CLEAR witnesses and a small reproducible publication package. Substantial OpenAI Codex assistance was used for research and packaging. New work is Apache-2.0. + +Exact source canonical:3dd1199d95291ee96e6c0aeb6f55f86244a569b1d4975840bf0207e2dcf9c025. Exact candidate canonical:ee251f6005d2a92b887c5b804bd7aac05989d278b2c9ccb3c3091b50d533b08d. Byte hashes are in MANIFEST.json. The12 edit blocks specify every changed event and leave all other fields unchanged. The parent research generators are not silently imported; this publication uses the transparent exact edit as its deterministic reconstruction recipe. + +## Related work, not automatically incorporated + +Ali Romman's #7662 studies one half-ADD rounding-error propagation with CubeJerry's service contract. Nick Petalas's #7654 provides a scoped minimal-rank interpolation result used as background when assessing structural repairs. Neither is a substitute for this candidate's entire rounded caller or physical supply proof. Their actual domains and assumptions must be checked before application. [PR7662](https://github.com/CrocSwap/integer-mult-bounds/pull/7662), [PR7654](https://github.com/CrocSwap/integer-mult-bounds/pull/7654). + +At the publication checkpoint, upstream main remained e54523517d0f03e58352e647c403a5af3e525a57. Ali Romman's #7663 uses a separate17-call full-private-bank model and changed helper endpoints; Clear1nsight's #7664 concerns180erasures/17calls; #7666 charges bank selection and return without claiming a new κ. K372-4 is later, separate research with changed helper-boundary conditions. None is silently folded into ee251f60 or used to assert identical physical assumptions. This is not a claim to the greatest bound across all models. + +## Fresh versus reused evidence + +Publication replay freshly reconstructs the whole word, runs exact rows/CLEAR, recounts native/caller histograms and checks the four directed price points. Normal, optimized Python and a Git-free committed-byte export were tested. The recorded ordinary/precision/native-phase/owner evidence retains its narrower scope and original source identifiers; it is not advertised as freshly rerun. No selected record, frozen predecessor package or common verifier is changed. + +## Editorial normalization of publication labels + +The follow-up editorial commit replaces workstation labels with construction terminology. It changes no candidate, edit, certificate, invoice, numeric result, executable code or contributor attribution. The original recorded bytes remain retrievable at commit `95d476623f1468822057554475dc8badb19bfa44`. Evidence JSON field labels and descriptive scopes are normalized, not recomputed scientific results. In NATIVE-EVIDENCE-REUSE.json, `predecessor-receipt:K372-2/NATIVE-NEW.json` is a historical receipt identifier, not a packaged file path. In PRICE-SUMMARY.json, recorded command invoice arguments now use the equivalent packaged `data/INVOICE.json` path; this is a portability transcription, not the verbatim original command. The fresh replay constructs and runs its own package-relative command. MANIFEST.json authenticates the edited publication bytes. + +Evidence byte-custody mapping (original -> editorially normalized SHA-256): + +- `evidence/BUILD.json`: `4744201691120223ded62a3e0d55ea1029203f3ea996305163e7db8d9e3679a4` -> `a0bafbb3f44920ed6ac1ed3d83385f025f5bbbcf5e9c8013ab1ca55ccf23c32d`. + +- `evidence/NATIVE-EVIDENCE-REUSE.json`: `6615b8a051ac9e4d8c73b5decf8a70d2a33d14da0c4c369574dec946984aa351` -> `84bab14d5c584aa8853b8e1025b562541ac6657e458d120ec803f2bc149c3eb8`. + +- `evidence/ROLE770-BUILD.json`: `c4ee72317678791d4b801479df0af052f3a50662c11ce3f3393b2151368fc92d` -> `1c400f16efbc427c40c811a57dc656fe97c2c84f94c71529e2c5c0598b146369`. + +- `evidence/PRICE-SUMMARY.json`: `c2777382c677634f7017b68c55dbd831a40945b77057f26b738f857c17ee8759` -> `d13741fe3217a01edd0b79b40dad037e644e441fbbc300838df99c0b050a5f42`. diff --git a/research/cf6a-banked-role1256-relay/credits/PR7674-NOTICE b/research/cf6a-banked-role1256-relay/credits/PR7674-NOTICE new file mode 100644 index 0000000000..951f081717 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/credits/PR7674-NOTICE @@ -0,0 +1,7 @@ +Apache License 2.0. Research prepared for Ali Romman with substantial OpenAI Codex assistance. + +New work includes the fifteen certified sender/receiver pivots, the forward and transposed communication construction, the complete native row checker, and the finite stock and precision application for this 16-call program. + +SYLforge supplied the composition, native word reconstruction, published invoice and exact 16-stage caller bytes from PR #7669. Their original PROVENANCE.md is preserved in source/7669-CREDITS.md. It credits the H5B work of SYLforge, DreamingOfClouds' joint native reconstructions, Clear1nsight's coefficient splitting, role-379 and helper work, Rohan Arun's signed caller lineage, and prior contributions from CubeJerry, Douglas Colkitt and others. The source/ directory holds the exact file bytes identified in SOURCE-PINS.json. + +The group-ring caller checker, independent operator checks, bit service, finite-cost method and field guide adapt the corresponding code and arguments of Ali Romman's PR #7663. That package in turn builds on the contributors named in its preserved source/7663-NOTICE. The unchanged directed log/exp gate retains its listed sources in source/gate-NOTICE. Earlier paid-transfer and bank-support constructions include PRs #7434 and #7576. Jerry Chen (CubeJerry) supplied the selected PRs #7000 and #7001 and the typed initializer in PR #7586. The per-call odd-grid induction and the selected application review provide the complete-root realization and finite-cost substitution. Douglas Colkitt and the credited repository authors supplied the pinned operator engines, price evaluator and research workflow. The license accompanies this package. diff --git a/research/cf6a-banked-role1256-relay/credits/PR7682-NOTICE b/research/cf6a-banked-role1256-relay/credits/PR7682-NOTICE new file mode 100644 index 0000000000..4654631de0 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/credits/PR7682-NOTICE @@ -0,0 +1,9 @@ +Apache License 2.0. Research prepared for Clear1nsight with substantial OpenAI Codex assistance. + +Ali Romman supplied the fifteen exact banked pivots and the frozen #7674 baseline, along with the complete signed 16-call graph and application method. The original notices remain at peer/NOTICE, peer/source/7663-NOTICE and peer/source/gate-NOTICE. Read peer/SOURCE-PINS.json for each ancestry binding and ASSETS.json for the exact vendored bytes at scientific commit 26b6c469aa6c4aa04322ce25a22150f90e5fb14e and refreshed head 28b2af322a1fab01b3734365988930920f9dda48. + +SYLforge supplied the #7669 composition, native source pins and literal caller. Its preserved parent provenance is peer/source/7669-CREDITS.md. Retain DreamingOfClouds' #7641/#7658 lineage, Clear1nsight's integer scalar/contact work including #7612, ToikY's #7643 contact-rechart precedent, Rohan Arun's #7113 signed-caller lineage, 5080's helper work, and all other contributors named in the original records. Ali Romman's #7663 exact-grid and extent proof and #7666/#7670 selection and guide work supply relevant implementation precedents. Jerry Chen (CubeJerry) supplied the selected #7000/#7001 applications and #7586 typed initialization. Douglas Colkitt and the authors in the original notices supplied the frozen native compiler, independent checker, price evaluator and package infrastructure. + +The release base reuses ToikY's exact shared CI and historical replay sync 0eabc624a9bc9ed2847719efd63390db4d297df4 above canonical e54523517d0f03e58352e647c403a5af3e525a57. This workflow provenance is separate from the banked construction and its mathematical comparison. + +This package credits the original role-230 splice and its same-contract transfer to the unchanged fifteen-pivot graph, the independent exact wire and price replays, matched complete resource accounting and source-bound native and caller verification. The original works retain their authorships and licenses. diff --git a/research/cf6a-banked-role1256-relay/data/CALLER-PHASE-BASES.json b/research/cf6a-banked-role1256-relay/data/CALLER-PHASE-BASES.json new file mode 100644 index 0000000000..3e4aa383a5 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/data/CALLER-PHASE-BASES.json @@ -0,0 +1 @@ +{"by_q":{"100":[2,97,8,16,69,37,128,256],"11":[13,14,7,16,32,64,128,256],"112":[2,4,8,97,81,49,128,256],"13":[14,11,7,16,32,64,128,256],"131":[133,134,8,16,32,64,7,256],"133":[134,131,8,16,32,64,7,256],"134":[133,131,8,16,32,64,7,256],"138":[137,4,131,16,32,64,11,256],"14":[13,11,7,16,32,64,128,256],"140":[2,137,133,16,32,64,13,256],"145":[146,4,8,131,32,64,19,256],"146":[145,4,8,131,32,64,19,256],"148":[2,145,8,133,32,64,21,256],"152":[2,4,145,137,32,64,25,256],"161":[162,4,8,16,131,64,35,256],"164":[2,161,8,16,133,64,37,256],"168":[2,4,161,16,137,64,41,256],"176":[2,4,8,161,145,64,49,256],"19":[21,22,8,7,32,64,128,256],"191":[253,251,247,239,223,254,127,256],"193":[194,4,8,16,32,131,67,256],"194":[193,4,8,16,32,131,67,256],"196":[2,193,8,16,32,133,69,256],"200":[2,4,193,16,32,137,73,256],"208":[2,4,8,193,32,145,81,256],"21":[22,19,8,7,32,64,128,256],"22":[21,19,8,7,32,64,128,256],"223":[253,251,247,239,254,191,127,256],"224":[2,4,8,16,193,161,97,256],"239":[253,251,247,254,223,191,127,256],"247":[253,251,254,239,223,191,127,256],"251":[253,254,247,239,223,191,127,256],"253":[254,251,247,239,223,191,127,256],"254":[253,251,247,239,223,191,127,256],"259":[261,262,8,16,32,64,128,7],"26":[25,4,19,11,32,64,128,256],"261":[262,259,8,16,32,64,128,7],"262":[261,259,8,16,32,64,128,7],"265":[266,4,259,16,32,64,128,11],"268":[2,265,261,16,32,64,128,13],"273":[274,4,8,259,32,64,128,19],"274":[273,4,8,259,32,64,128,19],"276":[2,273,8,261,32,64,128,21],"28":[2,25,21,13,32,64,128,256],"280":[2,4,273,265,32,64,128,25],"290":[289,4,8,16,259,64,128,35],"292":[2,289,8,16,261,64,128,37],"296":[2,4,289,16,265,64,128,41],"304":[2,4,8,289,273,64,128,49],"319":[381,379,375,367,351,382,128,127],"321":[322,4,8,16,32,259,128,67],"322":[321,4,8,16,32,259,128,67],"324":[2,321,8,16,32,261,128,69],"328":[2,4,321,16,32,265,128,73],"336":[2,4,8,321,32,273,128,81],"35":[37,38,8,16,7,64,128,256],"351":[381,379,375,367,382,319,128,127],"352":[2,4,8,16,321,289,128,97],"367":[381,379,375,382,351,319,128,127],"37":[38,35,8,16,7,64,128,256],"375":[381,379,382,367,351,319,128,127],"379":[381,382,375,367,351,319,128,127],"38":[37,35,8,16,7,64,128,256],"381":[382,379,375,367,351,319,128,127],"382":[381,379,375,367,351,319,128,127],"385":[386,4,8,16,32,64,259,131],"386":[385,4,8,16,32,64,259,131],"388":[2,385,8,16,32,64,261,133],"392":[2,4,385,16,32,64,265,137],"400":[2,4,8,385,32,64,273,145],"41":[42,4,35,16,11,64,128,256],"415":[445,443,439,431,446,64,319,191],"416":[2,4,8,16,385,64,289,161],"431":[445,443,439,446,415,64,319,191],"439":[445,443,446,431,415,64,319,191],"44":[2,41,37,16,13,64,128,256],"443":[445,446,439,431,415,64,319,191],"445":[446,443,439,431,415,64,319,191],"446":[445,443,439,431,415,64,319,191],"463":[477,475,471,478,32,415,351,223],"471":[477,475,478,463,32,415,351,223],"475":[477,478,471,463,32,415,351,223],"477":[478,475,471,463,32,415,351,223],"478":[477,475,471,463,32,415,351,223],"487":[493,491,494,16,463,431,367,239],"49":[50,4,8,35,19,64,128,256],"493":[494,491,487,16,463,431,367,239],"494":[493,491,487,16,463,431,367,239],"499":[501,502,8,487,471,439,375,247],"50":[49,4,8,35,19,64,128,256],"501":[502,499,8,487,471,439,375,247],"502":[501,499,8,487,471,439,375,247],"505":[506,4,499,491,475,443,379,251],"506":[505,4,499,491,475,443,379,251],"508":[2,505,501,493,477,445,381,253],"56":[2,4,49,41,25,64,128,256],"69":[70,67,8,16,32,7,128,256],"70":[69,67,8,16,32,7,128,256],"73":[74,4,67,16,32,11,128,256],"74":[73,4,67,16,32,11,128,256],"81":[82,4,8,67,32,19,128,256],"84":[2,81,8,69,32,21,128,256],"88":[2,4,81,73,32,25,128,256],"98":[97,4,8,16,67,35,128,256]},"full_phase_table_sha256":"c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa"} diff --git a/research/cf6a-banked-role1256-relay/data/CALLER.json.gz b/research/cf6a-banked-role1256-relay/data/CALLER.json.gz new file mode 100644 index 0000000000..26a75a1ae3 Binary files /dev/null and b/research/cf6a-banked-role1256-relay/data/CALLER.json.gz differ diff --git a/research/cf6a-banked-role1256-relay/data/CANDIDATE-GRAPH.json.gz b/research/cf6a-banked-role1256-relay/data/CANDIDATE-GRAPH.json.gz new file mode 100644 index 0000000000..814a8f004d Binary files /dev/null and b/research/cf6a-banked-role1256-relay/data/CANDIDATE-GRAPH.json.gz differ diff --git a/research/cf6a-banked-role1256-relay/data/CERTS.json b/research/cf6a-banked-role1256-relay/data/CERTS.json new file mode 100644 index 0000000000..ed66fa4832 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/data/CERTS.json @@ -0,0 +1,1569 @@ +{ + "candidate_canonical_sha256": "ae62d5d8bef6f7146454b4b3643e487a58380c606a16c5baef7bf0dcf9df1472", + "certificate_rule": "Exact equality to other live public/owned rows; cross-chart sources allowed", + "clear_event_index": { + "100041": { + "550": "1" + }, + "100071": { + "578": "-1/2" + }, + "100124": { + "1334": "1", + "1336": "-2", + "1337": "-1", + "1362": "1", + "1377": "-2", + "1386": "-1/2", + "483": "-1", + "519": "-1", + "543": "-1", + "696": "-1", + "697": "1/4", + "698": "1/2", + "700": "1/2", + "702": "1", + "767": "1/2", + "901": "-1" + }, + "100138": { + "1255": "1/3", + "133": "1", + "1334": "-2/3", + "1336": "4/3", + "1337": "2/3", + "1362": "-1/3", + "1377": "4/3", + "1386": "1", + "483": "1", + "494": "2/3", + "506": "1/2", + "519": "7/6", + "543": "7/6", + "695": "5/3", + "697": "-2/3", + "698": "2/3", + "700": "-1/3", + "701": "-1/3", + "702": "-1/2", + "733": "1/3", + "767": "-5/6", + "883": "2/3", + "892": "2/3", + "901": "2/3", + "929": "2/3", + "962": "2/3", + "981": "2/3" + }, + "100145": { + "1255": "1/2", + "133": "3/2", + "1334": "-1", + "1336": "1/2", + "1337": "1", + "1362": "-1/2", + "1377": "2", + "1386": "3/2", + "1498": "2", + "483": "3/2", + "494": "1", + "506": "3/4", + "519": "7/4", + "543": "7/4", + "695": "5/2", + "697": "-1", + "698": "1", + "700": "-1/2", + "701": "-1/2", + "702": "-3/4", + "733": "1/2", + "767": "-5/4", + "883": "1", + "892": "1", + "901": "1", + "929": "1", + "962": "1", + "981": "1" + }, + "100199": { + "1255": "1/2", + "1262": "-2", + "133": "-1/2", + "1334": "1", + "1337": "-1/2", + "1362": "2", + "1377": "-2", + "1386": "-1/2", + "1498": "-1", + "483": "-1", + "499": "-2", + "519": "-1", + "543": "-1", + "695": "-1", + "696": "-1", + "697": "1/4", + "698": "1/2", + "700": "1/2", + "702": "1", + "733": "1/2", + "767": "1/2", + "883": "1", + "892": "1", + "900": "1", + "901": "-1", + "929": "1", + "962": "1", + "981": "1" + }, + "100202": { + "1158": "-1/2", + "1160": "-1", + "1207": "2", + "1243": "-2", + "1400": "2", + "146": "4", + "1463": "-4/3", + "1479": "-3", + "1495": "-2", + "228": "2", + "428": "-1", + "430": "-1", + "451": "-1", + "508": "2", + "581": "1", + "582": "1", + "637": "-1", + "922": "-1", + "925": "1", + "974": "1", + "983": "-1" + }, + "100262": { + "1449": "1", + "1450": "1", + "268": "-1", + "38": "1", + "546": "1/2", + "578": "-1/2", + "648": "-1", + "652": "-1", + "654": "-1" + }, + "100370": { + "1473": "-1", + "165": "1" + }, + "100653": { + "133": "-3", + "1334": "2", + "1336": "-1", + "1337": "-1", + "1362": "2", + "1377": "-4", + "1386": "-3", + "1498": "-2", + "483": "-3", + "494": "-2", + "506": "-3/2", + "519": "-7/2", + "543": "-7/2", + "695": "-7/2", + "697": "2", + "698": "-2", + "700": "1", + "701": "1", + "702": "-3/2", + "767": "5/2", + "901": "-2", + "986": "2" + }, + "100775": { + "242": "1", + "499": "1" + }, + "100831": { + "430": "1" + }, + "100850": { + "1404": "1", + "359": "-1/2" + }, + "100855": { + "328": "1", + "573": "1" + }, + "100897": { + "498": "1" + }, + "100900": { + "1395": "1", + "551": "1" + }, + "100903": { + "1410": "1", + "392": "1" + }, + "101017": { + "294": "1" + }, + "101025": { + "501": "1" + }, + "101028": { + "295": "1" + }, + "101066": { + "547": "-1/2" + }, + "101116": { + "474": "1" + }, + "101153": { + "577": "-1/2" + }, + "101165": { + "1463": "1/2" + }, + "101326": { + "511": "1" + }, + "101338": { + "1405": "1", + "354": "-1/2" + }, + "101676": { + "498": "-3/2", + "540": "2" + }, + "101714": { + "344": "2", + "512": "-3/2" + }, + "101731": { + "28": "2", + "513": "-3/2" + }, + "101741": { + "1435": "1", + "366": "1" + }, + "101816": { + "274": "1", + "457": "1" + }, + "101851": { + "510": "-3/2", + "528": "2" + }, + "101867": { + "151": "-2", + "501": "-1", + "528": "-4", + "60": "-2", + "623": "-1", + "625": "-1/2", + "626": "1", + "628": "2", + "629": "2", + "630": "2", + "768": "1/2" + }, + "101889": { + "917": "-1" + }, + "101897": { + "1016": "-1", + "1018": "-1", + "1031": "-1", + "1033": "-1", + "1043": "-1/2", + "1047": "-1/2", + "1049": "-1/2", + "1205": "-2", + "1206": "2", + "1232": "-1", + "1238": "1/2", + "129": "-1/2", + "1291": "-1", + "1302": "-1", + "1303": "-1/2", + "1322": "-1", + "1323": "-1", + "1324": "1/2", + "1325": "1/2", + "1394": "1/2", + "1427": "-1", + "150": "-1/2", + "28": "-1", + "296": "-1", + "344": "-1", + "402": "-2", + "407": "-2", + "418": "-2", + "423": "-2", + "484": "-2", + "485": "2", + "540": "-1", + "568": "2", + "569": "2", + "570": "-1/2", + "575": "2", + "576": "3/2", + "651": "-1", + "661": "-1", + "662": "-1", + "707": "-1/2", + "732": "-1/2", + "810": "-1/2", + "882": "-1", + "883": "-1", + "888": "-1", + "889": "1", + "894": "-1", + "895": "-1", + "897": "-1", + "898": "-1", + "907": "1", + "908": "1", + "910": "-1", + "918": "-1", + "919": "-1", + "920": "-1", + "921": "-1", + "928": "-1", + "930": "-1", + "932": "-1", + "933": "-1", + "934": "-1", + "935": "1", + "950": "-1", + "952": "-1", + "953": "1", + "954": "-1", + "957": "1", + "958": "-1", + "959": "-1", + "963": "1", + "968": "-1", + "975": "-1", + "976": "-1", + "977": "-1", + "979": "1", + "980": "-1", + "981": "-1", + "982": "-1", + "995": "-2" + }, + "102006": { + "580": "1" + }, + "102010": { + "428": "-3", + "474": "-1/2" + }, + "102033": { + "294": "-3/2", + "408": "2" + }, + "102075": { + "553": "1" + }, + "102146": { + "295": "-1/2", + "424": "-3" + }, + "102234": { + "546": "1", + "577": "-1" + }, + "102242": { + "547": "1", + "578": "-1" + }, + "102333": { + "558": "1", + "575": "-1" + }, + "102340": { + "558": "-1", + "575": "1" + }, + "102355": { + "559": "1", + "576": "-1" + }, + "102362": { + "559": "-1", + "576": "1" + }, + "102412": { + "546": "-1", + "577": "1" + }, + "102485": { + "516": "2" + }, + "102501": { + "523": "1", + "580": "2" + }, + "102508": { + "523": "1/2", + "580": "-2" + }, + "102527": { + "268": "-1", + "568": "1" + }, + "102679": { + "1410": "-1", + "526": "-3/2" + }, + "102694": { + "1399": "-1", + "527": "-3/2" + }, + "102709": { + "490": "1/2", + "550": "-2" + }, + "102779": { + "1434": "1/2", + "553": "-2" + }, + "102801": { + "430": "-2", + "457": "-1/4" + }, + "102929": { + "547": "-1", + "578": "1" + }, + "102963": {}, + "102975": { + "356": "2", + "500": "-3/2" + }, + "103007": { + "295": "-3/2", + "424": "2" + }, + "103031": { + "428": "2", + "474": "-3/2" + }, + "103051": { + "278": "-3/2", + "562": "2" + }, + "103089": { + "438": "-1", + "585": "-2" + }, + "103110": { + "106": "-5/4", + "1162": "4", + "1163": "-4", + "1365": "1", + "1373": "2", + "1380": "1", + "1385": "7/4", + "1392": "-1/2", + "1397": "-8", + "1448": "-1", + "240": "3/4", + "405": "-2", + "41": "-1", + "42": "1/2", + "728": "1", + "813": "2" + }, + "103119": { + "1342": "-2", + "1437": "2", + "256": "1", + "336": "1" + }, + "103133": { + "1342": "-2", + "1437": "2", + "256": "1", + "336": "1" + }, + "103334": { + "862": "-1" + }, + "103340": { + "1000": "-1/2", + "1206": "-3", + "1207": "1", + "1208": "-1/2", + "1343": "-1/4", + "1344": "-1/4", + "1346": "-1/4", + "1347": "-1/4", + "1354": "1", + "1393": "-1/4", + "1445": "1", + "1458": "-1/2", + "1460": "-2", + "1466": "1", + "1477": "1", + "1490": "2", + "226": "1", + "230": "1", + "449": "-4", + "473": "1", + "485": "1", + "496": "1", + "508": "1", + "521": "1", + "544": "1", + "7": "-1/2", + "779": "-1/2", + "857": "-1/2", + "87": "-1/2", + "882": "-1/2", + "883": "-1/2", + "884": "-1/2", + "888": "-1/2", + "889": "1/2", + "890": "-1/2", + "894": "-1/2", + "898": "-1/2", + "902": "-1/2", + "903": "-1/2", + "904": "-1/2", + "905": "-1/2", + "906": "-1/2", + "907": "-1/2", + "910": "-1/2", + "914": "-1/2", + "918": "-1/2", + "919": "-1/2", + "920": "-1/2", + "921": "-1/2", + "922": "-1/2", + "931": "-1/2", + "932": "-1/2", + "933": "-1/2", + "934": "-1/2", + "940": "-1/2", + "941": "-1/2", + "942": "-1/2", + "946": "-1/2", + "947": "-1/2", + "948": "-1/2", + "949": "-1/2", + "950": "-1/2", + "951": "-1/2", + "958": "-1/2", + "959": "-1/2", + "960": "-1/2", + "965": "-1/2", + "966": "-1/2", + "967": "-1/2", + "971": "-1/2", + "972": "-1/2", + "973": "-1/2", + "976": "-1/2", + "977": "-1/2", + "978": "-1/2", + "980": "-1/2", + "981": "-1/2", + "982": "-1/2", + "983": "-1/2", + "984": "-1/2", + "985": "-1/2", + "990": "1", + "994": "1/2" + }, + "103367": { + "742": "1/4", + "998": "1/2" + }, + "103456": { + "126": "1/4", + "15": "1/4", + "164": "1/4", + "679": "-1/4", + "682": "-1/4" + }, + "103466": { + "126": "-1/4", + "164": "1/4", + "413": "1/2", + "679": "-1/4", + "682": "-1/4" + }, + "103604": { + "126": "1/4", + "15": "1/4", + "164": "1/4", + "679": "-1/4", + "682": "-1/4" + }, + "103608": { + "126": "-1/4", + "164": "1/4", + "413": "1/2", + "679": "-1/4", + "682": "-1/4" + }, + "103657": {}, + "103744": { + "108": "-1", + "1492": "-2", + "22": "-1/2", + "23": "-1/2", + "320": "-1/2", + "333": "-1", + "49": "1" + }, + "103837": {}, + "103839": {}, + "103840": {}, + "103842": {}, + "103843": {}, + "103861": {}, + "103878": {}, + "103918": {}, + "103922": {}, + "103965": { + "1082": "-1", + "794": "-4" + }, + "104013": {}, + "104176": { + "1074": "1/2", + "1221": "1", + "1222": "1", + "1255": "1", + "1311": "1", + "1312": "1", + "1313": "1", + "1314": "1/2", + "1356": "1", + "757": "1/2", + "796": "1/2", + "890": "-1", + "906": "-1", + "942": "-1", + "943": "1", + "956": "1", + "964": "1", + "971": "-1" + }, + "104195": {}, + "104258": {}, + "104340": {}, + "104341": {}, + "104349": {}, + "104355": {}, + "104356": {}, + "104366": {}, + "104369": {}, + "104379": {}, + "104385": {}, + "104388": {}, + "104389": {}, + "104393": {}, + "104406": {}, + "104407": {}, + "104414": {}, + "104428": {}, + "104429": {}, + "104445": { + "1025": "-2", + "1029": "-5/2", + "831": "-1", + "864": "2" + }, + "104476": { + "1499": "1", + "998": "-1" + }, + "104481": {}, + "104482": {}, + "104500": { + "863": "1" + }, + "104503": {}, + "154767": { + "770": "1" + }, + "89018": {}, + "89756": { + "233": "1" + }, + "89953": { + "1072": "1", + "500": "-1" + }, + "90303": { + "1089": "1", + "510": "-1" + }, + "90305": { + "22": "1/4", + "23": "-3/4", + "320": "1/4", + "321": "-1/2", + "323": "-1", + "325": "1/2", + "330": "-1" + }, + "90687": {}, + "91048": { + "110": "-3/8", + "20": "1/8", + "37": "1/8", + "432": "1/2", + "433": "1/8", + "435": "1/2", + "437": "-1/4", + "442": "3/2", + "735": "3/8" + }, + "91146": { + "29": "-1/4", + "30": "-3/4", + "352": "-1/8", + "353": "1/4", + "355": "-1/2", + "357": "1/4", + "362": "-1/2", + "59": "1/4" + }, + "91219": {}, + "91288": {}, + "91372": { + "500": "1" + }, + "91562": { + "628": "-2", + "630": "-2" + }, + "91564": { + "30": "1/4", + "352": "-1/8", + "353": "-1/4", + "355": "1/2", + "357": "-1/4", + "362": "-1/2", + "59": "-1/2" + }, + "91569": { + "106": "-2", + "1165": "-1", + "1365": "1", + "1380": "-1", + "1385": "1", + "240": "1", + "403": "2", + "405": "1/4", + "728": "-4", + "729": "4", + "730": "4", + "813": "2" + }, + "91572": { + "30": "-3/4", + "352": "-1/8", + "353": "1/4", + "355": "1/2", + "357": "1/4", + "362": "-1/2" + }, + "91575": { + "30": "-1/4", + "352": "-1/8", + "353": "-1/4", + "355": "-1/2", + "357": "-1/4", + "362": "-1/2" + }, + "91596": { + "30": "-3/2", + "352": "-1/4", + "353": "1/2", + "355": "-1", + "357": "-1/2", + "362": "1", + "59": "1" + }, + "91868": { + "17": "-5/8", + "273": "-1/2", + "275": "-1", + "277": "1/2", + "282": "-1", + "77": "-1/2" + }, + "91895": {}, + "91931": { + "22": "1/8", + "23": "1/8", + "320": "1/8", + "321": "1/4", + "323": "1/2", + "325": "1/4", + "330": "-1/2" + }, + "91988": { + "1385": "-1/4", + "240": "-1/4" + }, + "91999": { + "385": "-1/4", + "387": "-1/2", + "389": "-1/4", + "394": "-1/2", + "64": "1/8" + }, + "92006": { + "1173": "1", + "573": "-1" + }, + "92008": { + "106": "-3/2", + "1162": "-2", + "1165": "-2", + "1365": "1/4", + "1380": "-1/4", + "1385": "-1/2", + "240": "-1/2", + "401": "1/16", + "403": "2", + "405": "7/16", + "41": "1/2", + "730": "2", + "813": "-1/2", + "814": "-2", + "876": "-1/2" + }, + "92038": { + "18": "1/4", + "288": "-1/4", + "289": "-1/2", + "291": "-1/2", + "298": "1", + "39": "1/4", + "40": "1/4" + }, + "92119": { + "103": "1/2", + "17": "-5/8", + "272": "-1/2", + "273": "-1/2", + "275": "-1", + "277": "1/2", + "282": "1" + }, + "92125": { + "23": "-1/4", + "320": "-1/4", + "321": "-1/2", + "323": "-1", + "325": "1/2", + "330": "1" + }, + "92233": { + "30": "1/4", + "353": "1/2", + "355": "-1", + "357": "-1/2", + "362": "-1" + }, + "92243": { + "385": "1/2", + "387": "-1", + "389": "-1/2", + "394": "-1", + "64": "1/4", + "96": "1" + }, + "92260": {}, + "92280": { + "385": "-1/2", + "387": "-1", + "389": "1/2", + "394": "-1", + "64": "-1/4", + "65": "-1/2", + "96": "1/2" + }, + "92284": { + "29": "-1/2", + "30": "-1/4", + "353": "-1/2", + "355": "-1", + "357": "1/2", + "362": "-1", + "59": "1/2" + }, + "92536": { + "18": "1/4", + "288": "1/4", + "289": "1/2", + "291": "5/2", + "293": "-1", + "298": "-1", + "39": "1/4", + "40": "1/4" + }, + "92717": { + "104": "1/2", + "1179": "-1", + "416": "-1/2", + "417": "1", + "421": "1/2", + "426": "2" + }, + "92742": { + "17": "-1/4", + "273": "1/2", + "275": "-1", + "277": "-1/2", + "282": "-1" + }, + "92856": { + "224": "1/8", + "225": "1/2", + "227": "-1", + "229": "-1/4", + "234": "-1/2", + "57": "-1/8", + "81": "1/8" + }, + "92899": { + "23": "1/4", + "320": "1/4", + "321": "1/2", + "323": "1", + "325": "1/2", + "330": "-1" + }, + "92904": { + "108": "1/2", + "23": "1/4", + "320": "-1/4", + "321": "1/2", + "323": "-1", + "325": "-1/2", + "330": "-1" + }, + "92936": { + "18": "1/4", + "288": "1/4", + "289": "-1/2", + "298": "-1", + "39": "-1/4", + "40": "1/4" + }, + "92968": { + "384": "-1/2", + "385": "-1/2", + "387": "-1", + "389": "1/2", + "394": "1", + "64": "-3/4" + }, + "93003": { + "1120": "1", + "358": "-1" + }, + "93005": { + "30": "-1/4", + "352": "-1/2", + "353": "-1/2", + "355": "-1", + "357": "1/2", + "362": "1", + "59": "1/2" + }, + "93009": { + "26": "1/4", + "368": "-3/4", + "369": "-1/2", + "371": "-1", + "373": "1/2", + "378": "1", + "8": "1/4" + }, + "93063": { + "18": "1/4", + "288": "1/4", + "289": "1/2", + "293": "-1", + "298": "1", + "39": "1/4", + "40": "1/4" + }, + "93073": { + "107": "-1/4", + "304": "-1/4", + "305": "1/2", + "307": "-1", + "309": "-1/2", + "314": "1", + "35": "1/4", + "45": "1/4" + }, + "93111": { + "17": "-1/4", + "273": "1/2", + "275": "-1", + "277": "-1/2", + "282": "1" + }, + "93118": { + "1086": "1", + "513": "-1" + }, + "93120": { + "108": "1/2", + "23": "1/4", + "320": "-1/4", + "321": "1/2", + "323": "-1", + "325": "-1/2", + "330": "1" + }, + "93275": { + "106": "-5/64", + "1154": "1/2", + "1162": "-1/2", + "1163": "-1/4", + "1168": "-1", + "1173": "1/2", + "1349": "1/4", + "1365": "1/16", + "1373": "1/8", + "1380": "1/16", + "1385": "-9/64", + "1392": "-1/32", + "1448": "-1/16", + "240": "-13/64", + "402": "1/4", + "405": "-1/8", + "41": "-1/16", + "42": "1/32", + "570": "-1", + "573": "1/2", + "728": "5/16", + "813": "1/8", + "875": "1/2" + }, + "93278": { + "106": "-5/4", + "1162": "-8", + "1163": "-4", + "1365": "1", + "1373": "2", + "1380": "1", + "1385": "7/4", + "1392": "-1/2", + "1448": "-1", + "240": "3/4", + "405": "-2", + "41": "-1", + "42": "1/2", + "728": "1", + "813": "2" + }, + "93329": { + "1343": "-1", + "1344": "-1", + "1346": "-1", + "1347": "-1" + }, + "93419": { + "26": "-1/8", + "368": "1/8", + "369": "1/4", + "371": "-1/2", + "372": "-1/2", + "373": "-1/4", + "377": "-1", + "378": "1/2", + "8": "1/8" + }, + "94322": { + "26": "-3/8", + "368": "1/8", + "369": "1/4", + "371": "-1/2", + "373": "1/4", + "378": "-1/2", + "8": "-3/8" + }, + "94679": {}, + "94893": { + "104": "-3/8", + "1179": "1/2", + "1185": "4", + "1388": "-4", + "1391": "-3", + "416": "3/8", + "417": "-1/4", + "419": "-1/2", + "421": "-1/8", + "426": "1/2", + "43": "-1/2", + "788": "4", + "815": "-4" + }, + "94930": { + "86": "1" + }, + "95064": { + "385": "1/4", + "387": "-1/2", + "389": "1/4", + "394": "-1/2", + "64": "-1/8", + "65": "-1/4", + "96": "3/8" + }, + "95872": { + "1402": "1", + "290": "1" + }, + "95946": { + "1112": "1/2", + "350": "1/2" + }, + "96007": { + "1470": "-1", + "169": "1" + }, + "96147": { + "1471": "-1", + "203": "1" + }, + "96360": { + "103": "1", + "108": "1", + "18": "1", + "45": "1", + "61": "1", + "63": "1" + }, + "96394": { + "1206": "1/3", + "1455": "-2/3", + "1460": "2/3", + "449": "4/3" + }, + "96427": { + "368": "1/4", + "721": "-1", + "723": "-1", + "724": "-1", + "725": "-1", + "9": "1/4" + }, + "96445": { + "368": "1/4", + "9": "1/4" + }, + "96484": { + "368": "1", + "9": "1" + }, + "96522": { + "1144": "4", + "1390": "-2", + "26": "5/2", + "368": "3/8", + "369": "-1/4", + "371": "1/2", + "373": "-1/4", + "378": "-1/2", + "381": "2", + "723": "2", + "725": "-2", + "8": "1/8", + "865": "8", + "95": "1/4" + }, + "96525": { + "1138": "4", + "1390": "-2", + "26": "5/2", + "368": "3/8", + "369": "-1/4", + "371": "-1/2", + "373": "-1/4", + "378": "-1/2", + "381": "2", + "723": "2", + "724": "-2", + "8": "1/8", + "865": "8", + "95": "1/4" + }, + "96724": {}, + "96957": { + "256": "1/4", + "336": "1/4" + }, + "96992": { + "1020": "2/3", + "1023": "-4/3", + "1025": "-2/3", + "1029": "-1/3", + "831": "1/3" + }, + "97194": { + "1098": "1", + "337": "-1/4", + "341": "1/4", + "346": "-1/2", + "58": "-1/8", + "712": "-7/4", + "714": "1/4", + "93": "-1/4" + }, + "97219": { + "1207": "-2", + "1479": "3", + "451": "2", + "581": "-1", + "582": "-1" + }, + "97234": { + "1105": "1", + "1134": "1", + "1137": "1", + "1138": "-1/2", + "1144": "-1/2", + "1390": "-1/4", + "26": "1/16", + "3": "1/16", + "546": "1", + "550": "-1/2", + "553": "-1/2", + "67": "1/32", + "721": "-1/4", + "724": "-1/4", + "725": "-1/4", + "775": "1/2", + "837": "1", + "942": "1/2", + "956": "-1/2" + }, + "97243": { + "1102": "1", + "1106": "1/2", + "1110": "1/2", + "1113": "-1/2", + "1224": "-1/2", + "1249": "1", + "1280": "1", + "1341": "-1/4", + "1342": "-1/4", + "1355": "1", + "338": "-1/4", + "348": "1/2", + "526": "1/2", + "712": "-1/4", + "714": "-1/4", + "863": "-2" + }, + "97269": { + "640": "-1/2", + "641": "-1/2" + }, + "97291": { + "913": "-1", + "927": "1" + }, + "97325": { + "228": "1" + }, + "97351": { + "92": "1/4" + }, + "97368": { + "1078": "1", + "1080": "1", + "1258": "1", + "1259": "1", + "1340": "1", + "146": "-2", + "1479": "1", + "451": "1", + "496": "2", + "497": "-2", + "581": "-1", + "582": "-1", + "889": "-1", + "895": "1", + "897": "1", + "898": "-1", + "907": "1", + "919": "-1" + }, + "97377": { + "146": "-1/2" + }, + "97423": { + "1469": "-1", + "223": "1" + }, + "97474": { + "1484": "1/2", + "34": "-1/2", + "49": "-1/2" + }, + "97859": { + "125": "1", + "1457": "-1" + }, + "97883": { + "139": "1", + "1474": "-1" + }, + "97920": { + "1472": "-1", + "163": "1" + }, + "97927": { + "1465": "-1", + "201": "1" + }, + "98067": { + "752": "-1", + "891": "1", + "937": "-1" + }, + "98072": { + "611": "1", + "613": "1", + "752": "1", + "891": "-1", + "937": "1" + }, + "98079": { + "1277": "-1", + "1279": "2", + "1368": "-3", + "1374": "2", + "1551": "2", + "476": "-1", + "489": "-1", + "524": "1", + "607": "-1", + "608": "-1/4", + "610": "3/4", + "611": "-1", + "612": "-1", + "613": "-1/2", + "770": "1" + }, + "98307": { + "128": "1", + "1476": "-1" + }, + "98315": { + "119": "1", + "1475": "-1" + }, + "98318": { + "1458": "-1", + "154": "1" + }, + "98359": { + "225": "-1/2", + "229": "1/4" + }, + "98449": { + "707": "4" + }, + "98468": { + "1233": "1", + "1381": "1" + }, + "98554": { + "108": "1", + "22": "1/2", + "23": "1/2", + "320": "-1/2", + "333": "2", + "49": "-1" + }, + "98558": { + "1466": "-1" + }, + "98970": { + "1208": "1", + "1461": "-3", + "454": "12" + }, + "99066": { + "1154": "1/2", + "1168": "-1", + "1173": "1/2", + "13": "1/4", + "1349": "1/4", + "1353": "-1", + "1385": "-3/16", + "1448": "1/4", + "1474": "1/2", + "240": "-3/16", + "402": "1/4", + "52": "-1/2", + "570": "-1", + "573": "1/2", + "737": "-1/2", + "875": "1/2", + "882": "1/2", + "895": "1/2", + "897": "1/2", + "907": "-1/2", + "928": "1/2", + "954": "1/2", + "957": "-1/2", + "968": "1/2", + "975": "1/2" + }, + "99218": { + "1031": "-1", + "1033": "-1", + "1221": "-1", + "1222": "-1", + "1224": "-1", + "1302": "-1", + "1311": "-1", + "1312": "-1", + "1319": "-1", + "1338": "-1/2", + "1360": "-1", + "1361": "-1", + "1366": "-1", + "1426": "2", + "251": "2", + "265": "-2", + "471": "4", + "549": "2", + "650": "-1", + "674": "-1", + "704": "-1/2", + "882": "-1", + "884": "-1", + "889": "1", + "905": "-1", + "907": "-1", + "934": "1", + "938": "1", + "939": "1", + "946": "-1", + "947": "-1", + "948": "-1", + "952": "-1", + "955": "1", + "957": "1", + "963": "-1", + "965": "-1", + "968": "1", + "970": "1" + }, + "99279": { + "68": "1", + "777": "1" + }, + "99282": { + "68": "1", + "777": "1" + }, + "99299": { + "68": "1" + }, + "99320": { + "1322": "-1", + "1325": "1/2", + "1394": "1/2", + "1427": "-1", + "30": "-1/8", + "353": "-1/4", + "355": "-1/2", + "357": "-1/4", + "362": "-1/2", + "538": "-1", + "59": "1/8" + }, + "99464": { + "1495": "-2" + }, + "99564": { + "1208": "1" + }, + "99578": { + "1277": "-1/4", + "1279": "1/2", + "1280": "3/8", + "1368": "-3/4", + "1374": "1/2", + "1551": "1/4", + "173": "1/2", + "476": "-1/4", + "489": "-1/4", + "524": "1/4", + "608": "-1/16", + "610": "3/16", + "611": "-1/4", + "612": "-1/4", + "613": "-1/8", + "770": "1/4", + "891": "3/8", + "905": "3/8" + }, + "99593": { + "151": "1/2" + }, + "99778": { + "382": "1/2", + "816": "-1/2" + }, + "99846": { + "559": "-1/2" + }, + "99858": { + "546": "-1/2" + }, + "99866": { + "568": "-1/2" + }, + "99873": { + "575": "-1/2" + }, + "99881": { + "292": "1" + }, + "99884": { + "558": "-1/2" + }, + "99891": { + "1399": "1", + "563": "1" + }, + "99898": { + "1436": "1", + "364": "1" + }, + "99917": { + "428": "1" + }, + "99939": { + "512": "1" + }, + "99965": { + "527": "1" + }, + "99986": { + "523": "-1/2" + } + } +} \ No newline at end of file diff --git a/research/cf6a-banked-role1256-relay/data/PARENT-GRAPH.json.gz b/research/cf6a-banked-role1256-relay/data/PARENT-GRAPH.json.gz new file mode 100644 index 0000000000..df3ce8383d Binary files /dev/null and b/research/cf6a-banked-role1256-relay/data/PARENT-GRAPH.json.gz differ diff --git a/research/cf6a-banked-role1256-relay/data/PR7697-INVOICE.json b/research/cf6a-banked-role1256-relay/data/PR7697-INVOICE.json new file mode 100644 index 0000000000..cea523b1a3 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/data/PR7697-INVOICE.json @@ -0,0 +1,45 @@ +{ + "contract": { + "ambient_rank": 137, + "boundary": "actual signed caller research candidate with 16 native calls", + "model": "mixed-target-unnormalized-power-v1", + "rank_semantics": "H_r costs r^(1-C); debit surrendered productive fields" + }, + "paid": { + "1": 63408, + "16": 416, + "2": 14112, + "24": 416, + "3": 9680, + "32": 416, + "4": 3920, + "40": 416, + "48": 416, + "5": 5792, + "56": 416, + "6": 1392, + "7": 176, + "8": 752, + "9": 96 + }, + "schema": "integer-mult-recursive-invoice/v1", + "targets": { + "1": 304, + "129": 208, + "17": 416, + "2": 336, + "25": 416, + "3": 752, + "33": 416, + "4": 3632, + "41": 416, + "49": 416, + "5": 1248, + "57": 416, + "6": 704, + "65": 416, + "7": 304, + "8": 528, + "9": 10240 + } +} diff --git a/research/cf6a-banked-role1256-relay/data/SOURCE-INVOICE.json b/research/cf6a-banked-role1256-relay/data/SOURCE-INVOICE.json new file mode 100644 index 0000000000..69b5b39e8a --- /dev/null +++ b/research/cf6a-banked-role1256-relay/data/SOURCE-INVOICE.json @@ -0,0 +1,45 @@ +{ + "contract": { + "ambient_rank": 137, + "boundary": "actual signed caller research candidate with 16 native calls", + "model": "mixed-target-unnormalized-power-v1", + "rank_semantics": "H_r costs r^(1-C); debit surrendered productive fields" + }, + "paid": { + "1": 63728, + "16": 416, + "2": 13904, + "24": 416, + "3": 9552, + "32": 416, + "4": 3840, + "40": 416, + "48": 416, + "5": 5824, + "56": 416, + "6": 1504, + "7": 144, + "8": 768, + "9": 96 + }, + "schema": "integer-mult-recursive-invoice/v1", + "targets": { + "1": 288, + "129": 208, + "17": 416, + "2": 336, + "25": 416, + "3": 752, + "33": 416, + "4": 3664, + "41": 416, + "49": 416, + "5": 1216, + "57": 416, + "6": 736, + "65": 416, + "7": 272, + "8": 512, + "9": 10256 + } +} \ No newline at end of file diff --git a/research/cf6a-banked-role1256-relay/data/WORD.json.gz b/research/cf6a-banked-role1256-relay/data/WORD.json.gz new file mode 100644 index 0000000000..890579b0b7 Binary files /dev/null and b/research/cf6a-banked-role1256-relay/data/WORD.json.gz differ diff --git a/research/cf6a-banked-role1256-relay/dense.py b/research/cf6a-banked-role1256-relay/dense.py new file mode 100644 index 0000000000..c276ff705b --- /dev/null +++ b/research/cf6a-banked-role1256-relay/dense.py @@ -0,0 +1,479 @@ +#!/usr/bin/env python3 +"""Replay both #7700 banked graphs and inherited CLEAR observations in two prime fields.""" + +from argparse import ArgumentParser +from collections import defaultdict +from fractions import Fraction +from functools import cache +import gzip +from hashlib import sha256 +import importlib.util +import json +from pathlib import Path +from random import Random +import sys + + +HERE = Path(__file__).resolve().parent +HEAD = "7d84799a447867d36137d12ef7ca5646154d763c" +WORD = "ae62d5d8bef6f7146454b4b3643e487a58380c606a16c5baef7bf0dcf9df1472" +CALLER = "62d94fb992acab0a71c3d12f22be4ce63f4f65e5cbe3f420b93aa1393ffa8dcf" +PARENT = "72705b094d83d2ba24006661bbb031786a691b776bedb94515b1321e1535105f" +CANDIDATE = "8e7b755bd2d2d387bc3d3adfe48100985adf74775ca5acbb143170a3d16b5ccf" +RECIPES = "native_support/RECIPES.json.gz" +RECIPES_DECODED = "be33fd04af74312d297f01e1d8a374a72034e7e6f902bbd0c671df2597d1c828" +PINS = { + "data/WORD.json.gz": "50c1facfc5626c060560e2f354b71bd92d0bb1c1e853b2aad72abcbaaa5328a5", + "data/CERTS.json": "39ef28b708cd8bf1166b111d656809407b370dd11cd81a8e43820779f995aca3", + "data/CALLER.json.gz": "d889996a337f648087208ab51c98eaf052705d4fca88b5d01b6e9257a829897a", + "data/PARENT-GRAPH.json.gz": "c86288cddb4b80af3c8128c9a0d2f7a1e82bae64c5152a0d96a19d166afaab1d", + "data/CANDIDATE-GRAPH.json.gz": "0177c25371181e3b1f2c13325eb8434fbf6384a9ab99a612849efd5d0f6ab2cc", + "dense_support/field_interpreter.py": "e76bc78b132607890b2d9ea234d3a52e608e0e919bdc48308cc0727a2a07c73e", + "native_support/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "native_support/native_verify.py": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38", + RECIPES: "cf5dc6a35d3c8f6efbe4fc663853b2134234720c9cc8da16ee49aa1a0d98822f", +} +CASES = {1000000009: (17011, 34141), 998244353: (19181, 38303)} +WIDTH = 512 +PUBLIC = 1501 +OWNED = 68 +FIRST = 154768 +ROLE = 1256 +REMOVED, RETAINED = 95828, 104442 +ROUTES = ((476, 878), (878, 127), (476, 127)) + + +def need(condition, label): + if not condition: + raise ValueError(label) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")).encode() + + +def digest(raw): + return sha256(raw).hexdigest() + + +def inputs(): + return {name: pinned(name) for name in PINS} + + +def pinned(name): + raw = (HERE / name).read_bytes() + need(digest(raw) == PINS[name], f"frozen bytes of {name}") + return raw + + +def decoded(packed, pin, require_canonical=True): + raw = gzip.decompress(packed) + need(digest(raw) == pin, "exact decoded input digest") + value = json.loads(raw) + need(not require_canonical or canonical(value) == raw, "canonical decoded input") + return value + + +def module(name, path): + pinned(path) + loader = importlib.util.spec_from_file_location(name, HERE / path) + value = importlib.util.module_from_spec(loader) + sys.modules[name] = value + loader.loader.exec_module(value) + return value + + +def graph(data, word, paid): + metadata = data["metadata"] + need(metadata["schema"] == "p104-exact-banked-dag/v1" and metadata["source_pr"] == 7700 + and metadata["source_pr_head"] == HEAD and metadata["source_word_sha256"] == WORD + and metadata["caller_sha256"] == CALLER and metadata["source_clear_certificates_sha256"] == PINS["data/CERTS.json"], + "source word, caller and CLEAR bindings") + need(data["initial"] == word["initial"] and data["final"] == word["final"] + and data["frames"] == word["frames"] and data["first_output"] == FIRST, + "same typed public arrays and event clock") + moves = {key: (a, b) for key, a, b in data["moves"]} + forms = {key: {donor: Fraction(q) for donor, q in row} for key, row in data["forms"]} + schedule = data["schedule"] + need(len(moves) == len(data["moves"]) == paid and len(forms) == len(data["forms"]) == paid + PUBLIC + and len(schedule) == len(forms) and set(schedule) == forms.keys() == moves.keys() | set(range(FIRST, FIRST+PUBLIC)), + "complete unique paid and terminal schedule") + chart_of = {~role: chart for role, chart in enumerate(data["initial"])} + for key in schedule: + a, b = moves[key] if key in moves else (data["final"][key-FIRST], None) + need(all(chart_of.get(donor) == a and coefficient for donor, coefficient in forms[key].items()), + f"earlier cocharted donors for bank {key}") + if b is not None: + chart_of[key] = b + return moves, forms, schedule + + +def add_sparse(dst, src, scale): + for donor, value in src.items(): + q = dst.get(donor, 0) + scale * value + if q: + dst[donor] = q + else: + dst.pop(donor, None) + + +def literal_clear_monitors(word, certificates, parent): + """Recover cocharted observations with a chronological scalar shadow of the supplied tape.""" + moves, forms, _ = parent + rows = [{~role: Fraction(1)} for role in range(PUBLIC)] + [None]*OWNED + charts = word["initial"] + [None]*OWNED + checked_moves, observations = set(), [] + for clock, (op, role, *args) in enumerate(word["program"]): + if op == "INIT": + need(role >= PUBLIC and rows[role] is None, f"fresh owned field {clock}") + rows[role], charts[role] = {}, args[0] + continue + row = rows[role] + need(row is not None, f"live field at {clock}") + if op == "MOVE": + a, b, owned = args + need(charts[role] == a and owned == (role >= PUBLIC) and moves[clock] == (a, b) + and forms[clock] == row, f"literal source bank at {clock}") + checked_moves.add(clock) + rows[role], charts[role] = {clock: Fraction(1)}, b + continue + need(charts[role] == args[-1], f"literal operation chart at {clock}") + if op == "CLEAR": + need(role >= PUBLIC and clock in certificates, f"certified owned CLEAR at {clock}") + right = defaultdict(dict) + for donor, q in certificates[clock].items(): + need(donor != role and rows[donor] is not None and q, f"other live witness donor at {clock}") + add_sparse(right[charts[donor]], rows[donor], q) + need(REMOVED not in row and all(REMOVED not in value for value in right.values()), + f"the removed MOVE never supplies a certified CLEAR side at {clock}") + observations.append((clock, role, charts[role], row, dict(right))) + rows[role], charts[role] = None, None + elif op == "SCALE": + q = Fraction(args[0]) + rows[role] = {donor: value*q for donor, value in row.items()} + else: + donor, q, _ = args + need(op == "ADD" and donor != role and charts[donor] == charts[role], f"cocharted literal ADD at {clock}") + add_sparse(row, rows[donor], Fraction(q)) + need(checked_moves == moves.keys() and {row[0] for row in observations} == certificates.keys() + and len(observations) == 235 and all(row is None for row in rows[PUBLIC:]) + and charts[:PUBLIC] == word["final"] and all(rows[r] == forms[FIRST+r] for r in range(PUBLIC)), + "complete literal bank fold, public endpoints and private closure") + return observations + + +def physical_bodies(word, parent, child, catalogue, compiler, checker): + frames = word["frames"] + need(catalogue["parent_graph_sha256"] == PARENT and catalogue["candidate_graph_sha256"] == CANDIDATE, + "recipe catalogue covers the two frozen graphs") + + def occurrences(program): + result = defaultdict(list) + for slot, pair in sorted(program[0].items()): + result[pair].append(slot) + return result + + old_keys, new_keys = occurrences(parent), occurrences(child) + wanted = old_keys.keys() | new_keys.keys() + bodies = {} + for entry in catalogue["pairs"]: + pair = tuple(entry["pair"]) + if pair not in wanted: + continue + a, b = pair + recipe = entry["recipe"] + need(pair not in bodies and entry["ordered_bases"] == [frames[a], frames[b]] + and entry["parent_moves"] == old_keys.get(pair, []) and entry["candidate_moves"] == new_keys.get(pair, []) + and recipe["rank"] == abs(len(frames[a])-len(frames[b])) > 0, + f"exact stored paid recipe and occurrence binding for {a}->{b}") + bodies[pair] = checker.recipe(recipe) + need(bodies.keys() == wanted and len(bodies) == 2979, "all actual paid ordered bodies") + + pair = ROUTES[-1] + a, b = (compiler.canonical_frame(9, tuple(frames[i])) for i in pair) + recipe, _ = compiler.lower_child(a.adjoint().then(b)) + need(recipe["rank"] == 6, "fresh direct role-1256 body rank") + direct = checker.recipe(recipe) + checker.equal(direct, bodies[pair], "fresh paid body and bound catalogue") + checker.equal(direct, bodies[ROUTES[0]] + bodies[ROUTES[1]], "retained direct body and predecessor relay") + bodies[pair] = direct + return bodies + + +def replay_field(word, parent, child, certificates, monitors, bodies, field_engine, checker, prime, seeds): + field = field_engine.GateInterpreter(prime, need) + digest_rows = field_engine.digest + scalar = cache(field.coefficient) + zero = [0]*WIDTH + + @cache + def chart(a): + return checker.frame(word["frames"][a], 9) + + @cache + def oracle_gates(a, b): + return () if a == b else checker.adjoint(chart(a)) + chart(b) + + @cache + def prepared(circuit): + return tuple(field.gate(gate) for gate in circuit) + + def oracle(a, b, value): + return field.apply(prepared(oracle_gates(a, b)), value) + + def paid(a, b, value): + return field.apply(prepared(bodies[a,b]), value) + + def add(left, q, right): + if q == 1: + return [(x+y) % prime for x, y in zip(left, right, strict=True)] + return [(x + q*y) % prime for x, y in zip(left, right, strict=True)] + + def scale(q, value): + return [q*x % prime for x in value] + + def linear(terms, values): + result = zero.copy() + for donor, q in terms.items(): + result = add(result, scalar(q), values[donor]) + return result + + def direct_public(entries): + layout = word["hosted"] + dports = set(layout["Dports"]) + rows = [None]*PUBLIC + + def entry(target, donor): + return oracle(word["initial"][donor], word["final"][target], entries[donor]) + + def block(x, y, alpha, beta): + need(rows[x] is None and rows[y] is None, "disjoint typed main blocks") + rows[x] = add(entry(x, x), scalar(alpha), entry(x, y)) + rows[y] = add(scale(scalar(beta), entry(y, x)), scalar(1 + alpha*beta), entry(y, y)) + + al, be, al2, be2 = (Fraction(layout[key]) for key in ("alpha", "beta", "alpha2", "beta2")) + need(len(word["live"]) == 104 and len(layout["X2"]) == len(layout["Y2"]) == len(dports) == 96, + "actual 104/96 typed main blocks") + for position, x in enumerate(word["live"]): + a, b = (0, 1) if position in dports else (al, be) + block(x, x+112, a, b) + for x, y in zip(layout["X2"], layout["Y2"], strict=True): + block(x, y, al2, be2) + mains = {role for role, row in enumerate(rows) if row is not None} + need(len(mains) == 400 and ROLE not in mains, "400 main and 1,101 helper boundary oracles") + for role in set(range(PUBLIC)) - mains: + rows[role] = entry(role, role) + return rows, mains + + links = [] + for a, b in ROUTES: + cooked, ideal = bodies[a,b], oracle_gates(a,b) + for direction in ("forward", "adjoint"): + for column in (0, 17, 511): + value = [0]*WIDTH + value[column] = 1 + need(field.apply(prepared(cooked), value) == field.column_residue(checker.state(ideal, column)), + f"modular ordered physical map for {a}->{b} {direction} column {column}") + links.append([a,b,direction,column]) + cooked, ideal = checker.adjoint(cooked), checker.adjoint(ideal) + + def literal(entries, seed): + # Give every owned home unrelated dirty digits before its first INIT. + poison = Random(27183 + seed) + homes = [[poison.randrange(1, prime) for _ in range(WIDTH)] for _ in range(OWNED)] + values = entries.copy() + homes + charts = word["initial"] + [None]*OWNED + initial_digest = digest_rows(entries) + used_homes = {event[1] for event in word["program"] if event[0] == "INIT"} + unused_homes = sorted(set(range(PUBLIC, PUBLIC+OWNED)) - used_homes) + unused_digest = digest_rows(values[role] for role in unused_homes) + need(len(used_homes) == 53 and len(unused_homes) == 15, "literal active and reserved owned-home inventory") + physical_relays = {} + observed = [] + initialized = cleared = nonzero = dirty_first_init = paid_count = 0 + for clock, (op, role, *args) in enumerate(word["program"]): + row = values[role] + if op == "INIT": + need(role >= PUBLIC and charts[role] is None, f"literal owned INIT {clock}") + dirty_first_init += any(row) + row[:] = zero + need(not any(row), f"complete initialized array at {clock}") + charts[role] = args[0] + initialized += 1 + continue + need(charts[role] is not None, f"live literal array at {clock}") + if op == "MOVE": + a, b, owned = args + need(charts[role] == a and owned == (role >= PUBLIC), f"literal MOVE owner/chart at {clock}") + updated = paid(a,b,row) + charts[role] = b + paid_count += 1 + if clock in (REMOVED, RETAINED): + physical_relays[clock] = (row, updated) + elif op == "CLEAR": + need(role >= PUBLIC and charts[role] == args[0], f"literal CLEAR owner/chart at {clock}") + expected = zero.copy() + for donor, q in certificates[clock].items(): + need(charts[donor] is not None and donor != role, f"other active CLEAR witness at {clock}") + expected = add(expected, scalar(q), oracle(charts[donor], charts[role], values[donor])) + need(row == expected, f"literal live cross-chart CLEAR witness at {clock}") + observed.append(row.copy()) + nonzero += any(row) + row[:] = zero + need(not any(row), f"complete restored array at {clock}") + charts[role] = None + cleared += 1 + continue + elif op == "SCALE": + updated = scale(scalar(args[0]), row) + else: + updated = add(row, scalar(args[1]), values[args[0]]) + if role >= PUBLIC: + row[:] = updated + else: + values[role] = updated + need(charts[:PUBLIC] == word["final"] and all(a is None for a in charts[PUBLIC:]) + and all(not any(values[r]) for r in used_homes) + and digest_rows(values[role] for role in unused_homes) == unused_digest + and all(values[PUBLIC+r] is home for r, home in enumerate(homes)), + "literal terminal charts, restored active homes and intact reserved homes") + need(initialized == cleared == 235 and nonzero == 193 and paid_count == 6144 + and dirty_first_init == len(used_homes) and digest_rows(entries) == initial_digest, + "complete raw owned reset, CLEAR and borrowed-input scopes") + return values[:PUBLIC], physical_relays, {"moves": paid_count, "initialized": initialized, "cleared": cleared, + "nonzero_clear": nonzero, "dirty_homes_initialized": dirty_first_init, + "restored_owned_homes": len(used_homes), "reserved_owned_homes": len(unused_homes), + "clear_sha256": digest_rows(observed)} + + def banked(program, entries, fault=False): + moves, forms, schedule = program + inputs_sha = digest_rows(entries) + bars = {~role: row for role, row in enumerate(entries)} + sources, returns, terminal = {}, {}, {} + mutations = 0 + for slot in schedule: + value = sources[slot] = linear(forms[slot], bars) + if slot in moves: + result = paid(*moves[slot], value) + if fault and slot == RETAINED: + result = scale(field.i, result) + mutations += 1 + returns[slot] = bars[slot] = result + else: + terminal[slot-FIRST] = value + need(mutations == int(fault), "one actual phase mutation at the retained event") + held = [*entries, *sources.values(), *returns.values()] + need(len({id(row) for row in held}) == len(held) == 2*(PUBLIC+len(moves)) + and digest_rows(entries) == inputs_sha, "distinct held banks and intact external input arrays") + need(terminal.keys() == set(range(PUBLIC)) and returns.keys() == moves.keys(), "all public owners and paid returns") + cleared, anomalies = [], [] + for clock, _, chart_at_clear, left, right in monitors: + actual = linear(left, bars) + expected = zero.copy() + for chart_of_donors, terms in right.items(): + expected = add(expected, 1, oracle(chart_of_donors, chart_at_clear, linear(terms, bars))) + if actual != expected: + anomalies.append(clock) + cleared.append(actual) + need(fault or (not anomalies and sum(any(row) for row in cleared) == 193), "complete inherited CLEAR observations") + outputs = [terminal[r] for r in range(PUBLIC)] + snapshots = {slot: (sources[slot], returns[slot]) for slot in (REMOVED, RETAINED) if slot in moves} + return outputs, snapshots, {"paid_moves": len(returns), "held_arrays": len(held), "terminal_arrays": len(outputs), + "terminal_sha256": digest_rows(outputs), + "paid_returns_sha256": digest_rows(returns[k] for k in sorted(returns)), + "clear_observations": len(cleared), "clear_sha256": digest_rows(cleared), + "clear_relation_failures": anomalies} + + results = [] + for seed in seeds: + random = Random(seed) + entries = [[random.randrange(prime) for _ in range(WIDTH)] for _ in range(PUBLIC)] + need(any(entries[ROLE]), "nonzero arbitrary helper-1256 input") + expected, mains = direct_public(entries) + report = {"seed": seed, "inputs_sha256": digest_rows(entries), "oracle_sha256": digest_rows(expected)} + old, old_relays, report["parent"] = banked(parent, entries) + new, new_relays, report["candidate"] = banked(child, entries) + need(old == expected == new, "every entry of all 1,501 typed public outputs") + pre, mid = old_relays[REMOVED] + post = old_relays[RETAINED][1] + need(old_relays[RETAINED][0] == mid and new_relays[RETAINED] == (pre, post) + and post == oracle(*ROUTES[-1], pre) and any(post), "same actual relay input and independently typed returned array") + need(report["parent"]["clear_sha256"] == report["candidate"]["clear_sha256"], "all individual CLEAR arrays retained") + report["role1256_relay"] = {"input_sha256": digest_rows([pre]), "old_midpoint_sha256": digest_rows([mid]), + "returned_sha256": digest_rows([post]), "public_terminal_sha256": digest_rows([new[ROLE]])} + if seed == seeds[0]: + original, raw_relays, report["literal"] = literal(entries, seed) + need(original == expected and raw_relays == old_relays + and report["literal"]["clear_sha256"] == report["parent"]["clear_sha256"], + "literal chronological output, relay and all CLEAR arrays agree with folded parent") + if prime == 1000000009 and seed == seeds[0]: + altered, altered_relay, faulty = banked(child, entries, fault=True) + mismatches = [role for role in range(PUBLIC) if altered[role] != expected[role]] + need(mismatches and altered_relay[RETAINED] == (pre, scale(field.i, post)), + "one retained physical MOVE quarter-phase mutation reaches a real public output") + report["actual_phase_fault"] = {"slot": RETAINED, "pair": ROUTES[-1], "imaginary_root": field.i, + "mismatched_roles": mismatches, "changed_main_roles": sorted(mains.intersection(mismatches)), + "role1256_changed": ROLE in mismatches, "faulted_terminal_sha256": faulty["terminal_sha256"], + "clear_relation_failures": faulty["clear_relation_failures"]} + results.append(report) + print(f"PASS_CF6A_DENSE_FIELD_CASE {prime} {seed}", flush=True) + return {"prime": prime, "imaginary_root": field.i, "exact_column_links": links, "cases": results} + + +def main(): + parser = ArgumentParser(description=__doc__) + parser.add_argument("--out", required=True, type=Path) + args = parser.parse_args() + files = inputs() + word = decoded(files["data/WORD.json.gz"], WORD) + caller = decoded(files["data/CALLER.json.gz"], CALLER, require_canonical=False) + need(word["public"] == PUBLIC and word["owned_fields"] == OWNED and len(word["program"]) == FIRST + and caller["stages"] == 16 and caller["ambient_rank"] == 137, "complete source and signed caller geometry") + cert = json.loads(files["data/CERTS.json"]) + need(cert["candidate_canonical_sha256"] == WORD and len(cert["clear_event_index"]) == 235, + "exact literal CLEAR certificate denominator") + certificates = {int(clock): {int(role): Fraction(q) for role, q in item.items()} + for clock, item in cert["clear_event_index"].items()} + before, after = (decoded(files[f"data/{name}-GRAPH.json.gz"], pin) + for name, pin in (("PARENT", PARENT), ("CANDIDATE", CANDIDATE))) + need(before["metadata"]["kind"] == "parent" and after["metadata"]["kind"] == "candidate" + and after["metadata"]["source_banked_graph_sha256"] == PARENT, "exact graph lineage") + parent, child = graph(before, word, 6144), graph(after, word, 6143) + p_moves, p_forms, _ = parent + c_moves, c_forms, _ = child + expected_moves, expected_forms = p_moves.copy(), p_forms.copy() + expected_forms[RETAINED] = expected_forms.pop(REMOVED) + del expected_moves[REMOVED] + expected_moves[RETAINED] = ROUTES[-1] + need(p_moves[REMOVED] == ROUTES[0] and p_moves[RETAINED] == ROUTES[1] + and p_forms[RETAINED] == {REMOVED: Fraction(1)} + and [key for key, row in p_forms.items() if REMOVED in row] == [RETAINED] + and c_moves == expected_moves and c_forms == expected_forms + and word["program"][REMOVED] == ["MOVE",ROLE,*ROUTES[0],False] + and word["program"][RETAINED] == ["MOVE",ROLE,*ROUTES[1],False], "only the literal role-1256 relay changed") + monitors = literal_clear_monitors(word, certificates, parent) + compiler = module("_dense_cf6a_compiler", "native_support/clifford_exact.py") + checker = module("_dense_cf6a_checker", "native_support/native_verify.py") + field_engine = module("_dense_cf6a_field", "dense_support/field_interpreter.py") + catalogue = decoded(files[RECIPES], RECIPES_DECODED) + bodies = physical_bodies(word, parent, child, catalogue, compiler, checker) + print(f"CF6A_BOUND_ACTUAL_PAID_BODIES {len(bodies)}", flush=True) + fields = [replay_field(word, parent, child, certificates, monitors, bodies, field_engine, checker, prime, seeds) + for prime, seeds in CASES.items()] + inputs() + result = {"status": "PASS_CF6A_ROLE1256_DENSE_HELD_ARRAYS", "source_head": HEAD, + "source_word_sha256": WORD, "caller_sha256": CALLER, "graphs": {"parent": PARENT, "candidate": CANDIDATE}, + "inputs_sha256": PINS, "field_width": WIDTH, "public_outputs": PUBLIC, "main_outputs": 400, + "helper_outputs": 1101, "paired_physical_paid_bodies": len(bodies), "clear_monitors": len(monitors), + "recipe_catalogue_decoded_sha256": RECIPES_DECODED, "fresh_direct_lowering": list(ROUTES[-1]), + "relay": {"role": ROLE, "removed": REMOVED, "retained": RETAINED, "routes": ROUTES, "ranks": [3,3,6]}, + "scope": "All materialized public arrays and exact certified live CLEAR observations in the tested finite fields.", + "fields": fields} + raw = canonical(result) + b"\n" + with args.out.open("xb") as out: + out.write(raw) + print(result["status"], digest(raw), flush=True) + + +if __name__ == "__main__": + main() diff --git a/research/cf6a-banked-role1256-relay/dense_support/field_interpreter.py b/research/cf6a-banked-role1256-relay/dense_support/field_interpreter.py new file mode 100644 index 0000000000..4872d370db --- /dev/null +++ b/research/cf6a-banked-role1256-relay/dense_support/field_interpreter.py @@ -0,0 +1,306 @@ +"""Dense all-event finite replay adapted from the exact #7660 interpreter.""" + +from fractions import Fraction +from functools import cache +import hashlib +from math import isqrt +from random import Random +from struct import Struct +from time import monotonic_ns + + +DIM = 512 +ADDRESS = range(DIM) +PACK_ROW = Struct("<512I") + + +class GateInterpreter: + def __init__(self, prime, require): + require(type(prime) is int and 5 <= prime < 2**31 and prime % 4 == 1, + "modulus range and fourth root") + require(all(prime % f for f in range(3, isqrt(prime) + 1, 2)), "modulus is not prime") + self.p = prime + for x in range(2, prime): + root = pow(x, (prime - 1) // 4, prime) + if root * root % prime == prime - 1: + self.i = root + break + self.powers = (1, self.i, prime - 1, prime - self.i) + self.zero = [0] * DIM + self.gates = {} + self.require = require + + def coefficient(self, script): + q = Fraction(script) + self.require(q.denominator % self.p != 0, "literal denominator vanishes in F_p") + return q.numerator * pow(q.denominator, -1, self.p) % self.p + + def gate(self, spec): + if spec in self.gates: + return self.gates[spec] + op, *params = spec + if op == "P": + rows, = params + perm = [None] * DIM + for prev in ADDRESS: + after = sum(((prev & row).bit_count() % 2) << j for j, row in enumerate(rows)) + self.require(perm[after] is None, "non-permutation gate") + perm[after] = prev + gate = ("gather", perm) + elif op == "X": + offset, = params + gate = ("gather", [x ^ offset for x in ADDRESS]) + elif op == "D": + rows, linear = params + weights = [] + for mask in ADDRESS: + phase = 0 + for j, (row, weight) in enumerate(zip(rows, linear)): + if mask >> j & 1: + phase += weight + 2 * ((row & mask) >> (j + 1)).bit_count() + weights.append(self.powers[phase % 4]) + gate = ("weights", weights) + elif op == "phase": + exponent, = params + gate = ("phase", self.powers[exponent % 4]) + elif op == "C": + line, sign = params + half = (self.p + 1) // 2 + gate = ("mix", (1 + sign * self.i) * half % self.p, + (1 - sign * self.i) * half % self.p, [x ^ line for x in ADDRESS]) + else: + raise ValueError(f"unknown physical gate {op}") + self.gates[spec] = gate + return gate + + def apply(self, gates, value): + p = self.p + for op, *spec in gates: + if op == "gather": + indices, = spec + value = [value[j] for j in indices] + elif op == "weights": + weights, = spec + value = [a * b % p for a, b in zip(value, weights)] + elif op == "phase": + weight, = spec + if weight != 1: + value = [a * weight % p for a in value] + else: + c, d, indices = spec + value = [(c * a + d * value[j]) % p for a, j in zip(value, indices)] + return value + + def column_residue(self, exact): + sparse, denominator = exact + inverse = pow(2, -denominator, self.p) + target = [0] * DIM + for x, (re, im) in sparse.items(): + target[x] = (re + self.i * im) * inverse % self.p + return target + + +def raw_ports(phase, w, require): + """The 104 hosted parent-port equations, plus opposite-sign controls.""" + frames = w["frames"] + require(len(w["live"]) == len(w["ports"]) == 104 and len(set(w["live"])) == 104, + "raw port count") + + @cache + def frame(i): + return phase.frame_op(frames[i]) + + def same(x, y): + return x.tab == y.tab and all(phase.column(x.circ, j) == phase.column(y.circ, j) for j in (0, 1)) + + full = phase.op_four(range(9)) + for r, q in zip(w["live"], w["ports"]): + y = r + 112 + low_x, low_y = w["initial"][r], w["initial"][y] + high_x, high_y = w["final"][r], w["final"][y] + require(frames[low_x] == [q] and frames[low_y] == [] + and len(frames[high_x]) == 9 and len(frames[high_y]) == 8, f"port chart dimensions {r}") + p, v, z = frame(high_y), frame(high_x), frame(low_y) + qp, qm = phase.op_c(q, 1), phase.op_c(q, -1) + d = qm.then(full) + low_adapter = phase.lower(qp.dag().then(frame(low_x))) + high_adapter = phase.lower(p.dag().then(d)) + require(low_adapter["rank"] == high_adapter["rank"] == 0, f"port adapter rank {r}") + circ = phase.recipe_circuit(high_adapter) + mp = phase.Op(phase.tableau(circ), circ) + xx = qp.dag().then(v) + yy = z.dag().then(p).then(mp) + yx = qp.dag().then(p).then(mp) + xy = z.dag().then(v) + require(same(xx, d) and same(yy, d) and same(yx, qm.then(d)) and same(xy, qp.then(d)), + f"raw port operator identity {r}") + require(not same(xy, qm.then(d)) and not same(yx, qp.then(d)), + f"raw port operator sign control {r}") + return {"ports": 104, "directions": 4, "opposite_sign_rejections": 208, + "comparisons": "signed Pauli action and Gaussian absolute phase"} + + +def digest(rows): + value = hashlib.sha256() + for row in rows: + value.update(PACK_ROW.pack(*row)) + return value.hexdigest() + + +def evaluate(phase, source, candidate, prime, seed, altered_clock, test_wrong_phase, require): + """Evaluate dense finite fields. Compiled MOVEs and oracle frame maps differ.""" + t0 = monotonic_ns() + field = GateInterpreter(prime, require) + frames, n = source["frames"], source["public"] + size = n + source["owned_fields"] + rand = Random(seed) + initial = [[rand.randrange(prime) for _ in ADDRESS] for _ in range(n)] + + @cache + def direct_frame(frame): + return phase.frame_circuit(frames[frame]) + + @cache + def chart_operator(frame): + return phase.frame_op(frames[frame]) + + @cache + def literal(a, b): + return phase.dagger(direct_frame(a)) + direct_frame(b) + + @cache + def compiled(a, b): + lo, hi = (a, b) if len(frames[a]) < len(frames[b]) else (b, a) + rec = phase.lower(chart_operator(lo).dag().then(chart_operator(hi))) + require(rec["rank"] == len(frames[hi]) - len(frames[lo]), f"compiled MOVE rank {lo},{hi}") + circ = phase.recipe_circuit(rec) + if lo != a: + circ = phase.dagger(circ) + return tuple(field.gate(g) for g in circ) + + @cache + def oracle(a, b): + return tuple(field.gate(g) for g in literal(a, b)) + + @cache + def residue(value): + return field.coefficient(value) + + def cvec(a, b, v): + return field.apply(compiled(a, b), v) + + def pred_move(a, b, v): + return field.apply(oracle(a, b), v) + + # Independently reduce the exact column convention before using a dense + # finite vector. Use the actual candidate transition at the control clock. + endpoints = tuple(candidate["program"][altered_clock][2:4]) + r0 = source["live"][0] + boundary = (source["initial"][r0], source["final"][r0]) + witnesses = ((endpoints, cvec), (endpoints[::-1], cvec), (boundary, pred_move)) + for (a, b), move in witnesses: + for j in (0, 5): + v = [0] * DIM + v[j] = 1 + require(move(a, b, v) == field.column_residue(phase.column(literal(a, b), j)), + f"finite versus exact interpreter column {a},{b},{j}") + + def scale(vector, a): + return [a * x % prime for x in vector] + + def plus(x, a, y): + return [(u + a * v) % prime for u, v in zip(x, y)] + + def replay(word, inject=False): + values = initial + [field.zero] * (size - n) + erased = hashlib.sha256() + clears, copy_checks = 0, 0 + for i, e in enumerate(word["program"]): + op, r = e[:2] + if op == "MOVE": + row = cvec(e[2], e[3], values[r]) + values[r] = scale(row, field.i) if inject and i == altered_clock else row + elif op == "INIT": + require(not any(values[r]), f"nonzero dead owned state at INIT {i}") + values[r] = field.zero + elif op == "CLEAR": + erased.update(PACK_ROW.pack(*values[r])) + values[r] = field.zero + clears += 1 + elif op == "SCALE": + values[r] = scale(values[r], residue(e[2])) + else: + if op == "COPY": + if any(values[r]) and inject: + return None, {"detected_at_COPY": i} + require(not any(values[r]), f"nonzero owned COPY target at {i}") + copy_checks += 1 + values[r] = plus(values[r], residue(e[3]), values[e[2]]) + require(not any(any(v) for v in values[n:]), "nonzero final owned payload") + return values, {"events": len(word["program"]), "ordered_clear_values": erased.hexdigest(), + "clears": clears, "copy_zero_checks": copy_checks} + + H = source["hosted"] + require(H["mode"] == "mix-t0", "hosted native model") + live, dp = source["live"], H["Dports"] + x2, y2 = H["X2"], H["Y2"] + require(len(dp) == len(set(dp)) == len(x2) == len(y2) and set(dp) <= set(range(104)), + "hosted second-port count") + mains = set(live) | {r + 112 for r in live} | set(x2) | set(y2) + require(len(mains) == 2 * (104 + len(x2)), "overlapping hosted role") + alpha1, beta1 = map(Fraction, (H["alpha"], H["beta"])) + alpha2, beta2 = map(Fraction, (H["alpha2"], H["beta2"])) + require(alpha2, "nonzero second-port sign witness") + lo, hi = source["initial"], source["final"] + + def row_from(r, s): + return pred_move(lo[s], hi[r], initial[s]) + + def expected(rows, r, s, a, b): + rows[r] = plus(row_from(r, r), residue(a), row_from(r, s)) + rows[s] = plus(scale(row_from(s, r), residue(b)), residue(1 + a * b), row_from(s, s)) + + ref = [None] * n + for k, x in enumerate(live): + a, b = (0, 1) if k in dp else (alpha1, beta1) + expected(ref, x, x + 112, a, b) + for x, y in zip(x2, y2): + expected(ref, x, y, alpha2, beta2) + for r in range(n): + if r not in mains: + ref[r] = row_from(r, r) + require(all(row is not None for row in ref), "incomplete physical endpoint predictor") + + old, old_counts = replay(source) + new, new_counts = replay(candidate) + for label, data in (("source", old), ("candidate", new)): + bad = [r for r in range(n) if data[r] != ref[r]] + require(not bad, f"{label} physical endpoint mismatch {bad[:12]}") + require(old == new, "paired physical endpoints differ") + require(old_counts.keys() == new_counts.keys() + and all(old_counts[k] == new_counts[k] for k in old_counts if k != "events"), + "ordered CLEAR values or COPY zero observations differ") + wrong_ref = [None] * n + for x, y in zip(x2, y2): + expected(wrong_ref, x, y, -alpha2, beta2) + wrong_sign = [r for r in (*x2, *y2) if new[r] != wrong_ref[r]] + require(bool(wrong_sign), "wrong second-port alpha sign accepted") + failed = None + if test_wrong_phase: + mutated, counts = replay(candidate, inject=True) + failed = counts if mutated is None else {"endpoint_rows": [ + r for r in range(n) if mutated[r] != ref[r]]} + require(failed.get("detected_at_COPY") is not None or bool(failed.get("endpoint_rows")), + "wrong edited transition phase accepted") + return { + "status": "PASS_PAIRED_DENSE_PHYSICAL_WORDS", + "prime": prime, "seed": seed, "i_squared_minus_one": field.i, + "endpoint_rows": n, "owned_zero_rows": size - n, "vector_width": DIM, + "elapsed_ns": monotonic_ns() - t0, + "digests": {"initial": digest(initial), "source": digest(old), "candidate": digest(new), + "reference_public": digest(ref)}, + "source": old_counts, "candidate": new_counts, + "wrong_second_alpha_rows": wrong_sign, "wrong_edited_transition_phase": failed, + "six_finite_exact_column_crosschecks": 6, + "scope": "One deterministic dense input at this modulus through every literal event", + } diff --git a/research/cf6a-banked-role1256-relay/engines/caller/binding16.py b/research/cf6a-banked-role1256-relay/engines/caller/binding16.py new file mode 100644 index 0000000000..d07341b817 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/engines/caller/binding16.py @@ -0,0 +1,280 @@ +"""Complete occurrence and source-bound phase specialization of #7000/#7113. + +The degree-two phase polynomial and translation checks are reused unchanged +from Douglas Colkitt's retained upstream_application.py. See SOURCE-PINS.json. +""" + +from collections import Counter + +from caller16 import literal_layout, require +from upstream_application import boundary, digest, dot, polynomial, sub, terms, translation + + +def route(q, basis, stage, ambient): + native = [q, *basis] + require(len(native) == 9 and all(0 < v < 512 for v in native), + "nine central directions") + require(all(dot(a, b) == (i == j) for i, a in enumerate(native) + for j, b in enumerate(native)), "orthonormal central directions") + fresh = [1 << (9 + 8 * (stage - 1) + j) for j in range(8)] + mask = 511 | sum(fresh) + + def transform(value): + central = value & 511 + out = value & ~mask + if dot(central, q): + out ^= q + for basis_vector, axis in zip(basis, fresh, strict=True): + if dot(central, basis_vector): + out ^= axis + if value & axis: + out ^= basis_vector + return out + + axes = [1 << j for j in range(ambient)] + require(all(transform(transform(a)) == a for a in axes), "full route involution") + require(transform(q) == q, "preserved head direction") + require(all(transform(a) == a for a in axes if not mask & a), "complete spectators") + return transform + + +def contact_phase(q, basis, stage, ambient): + move = route(q, basis, stage, ambient) + before_axes = [1 << j for j in range(9 + 8 * (stage - 1))] + after_axes = [1 << j for j in range(9 + 8 * stage)] + spectator = [1 << j for j in range(9, 9 + 8 * stage)] + x0 = terms((a, 1) for a in before_axes) + y0 = terms([*x0.items(), (q, -1)]) + x1 = terms((a, 1) for a in after_axes) + y1 = terms([*x1.items(), (q, -1)]) + nx0 = terms([(a, 1) for a in spectator] + [(q, 1)]) + ny0 = terms((a, 1) for a in spectator) + nx1 = terms((a, 1) for a in [*spectator, *[1 << j for j in range(9)]]) + ny1 = terms([*nx1.items(), (q, -1)]) + pairs = ((x0, nx0), (y0, ny0), (nx1, x1), (ny1, y1)) + shifts = [boundary(a, b, move) for a, b in pairs] + body = terms((1 << j, 1) for j in range(9 + 8 * (stage - 1), 9 + 8 * stage)) + require(not polynomial(sub(sub(x1, x0), body)) + and not polynomial(sub(sub(y1, y0), body)) + and not polynomial(sub(sub(y1, x0), terms([*body.items(), (q, -1)]))) + and not polynomial(sub(sub(x1, y0), terms([*body.items(), (q, 1)]))), + "all four signed contact operators") + require(polynomial(sub(terms([(q, 1)]), terms([(q, -1)]))), + "query orientation discrimination") + # The two signed head corrections and the Q^2 term of LAMBDA. + require(translation(sub(terms([(q, 1)]), terms([(q, -1)]))) == q + and translation(terms([(q, 2)])) == q, "ordinary head translations") + first_shift = next((i for i, shift in enumerate(shifts) if shift), None) + return shifts, (move, pairs[first_shift]) if first_shift is not None else None + + +def native_inventory(word, helpers): + dimensions = [len(frame) for frame in word["frames"]] + public = word["public"] + owned = {} + lifetimes = [] + moves = [] + paid = Counter() + opcodes = Counter() + live_peak = 0 + for clock, event in enumerate(word["program"]): + op, role, *args = event + opcodes[op] += 1 + if op == "INIT": + require(public <= role < public + word["owned_fields"] and role not in owned, + "fresh owned lifetime") + owned[role] = len(lifetimes) + lifetimes.append([role, clock, args[0], None, None]) + live_peak = max(live_peak, len(owned)) + elif op == "CLEAR": + require(role in owned, "ordered owned retirement") + lifetime = lifetimes[owned.pop(role)] + lifetime[3:] = [clock, args[0]] + elif op == "MOVE": + first, last, is_owned = args + rank = abs(dimensions[last] - dimensions[first]) + require(rank > 0 and is_owned == (role >= public), "positive paid native rank") + require(not is_owned or role in owned, "current private MOVE owner") + moves.append((clock, role, first, last, rank, owned.get(role))) + paid[rank] += 1 + require(not owned and len(lifetimes) == 235 and live_peak == 51, "full 235-lifetime closure") + targets = Counter() + for role in helpers: + rank = dimensions[word["final"][role]] - dimensions[word["initial"][role]] + require(rank > 0, "positive independently owned helper target") + targets[rank] += 1 + return lifetimes, moves, paid, targets, opcodes + + +def complete_binding(word, caller, phases, signed): + stages, types, role_sets = literal_layout(caller, word) + ambient = caller["ambient_rank"] + public = word["public"] + require(public == 1501 and word["owned_fields"] == 68, "exact native public/private header") + ports = word["ports"] + live = word["live"] + h = word["hosted"] + second = dict(zip(h["Dports"], zip(h["X2"], h["Y2"], strict=True), strict=True)) + main = set(live) | {r + 112 for r in live} | set(h["X2"]) | set(h["Y2"]) + helpers = sorted(set(range(public)) - main) + require(len(live) == len(ports) == 104 and len(set(ports)) == 104 + and len(main) == 400 and len(helpers) == 1101, "actual native partition") + special_helpers = (325, 1087) + for role in special_helpers: + pair = [word["initial"][role], word["final"][role]] + require(role in helpers and pair == [3, 237] + and not word["frames"][pair[0]] + and word["frames"][pair[1]] == [30, 75, 138, 266], + "explicit arbitrary-input rank-four helper boundary") + by_q = {row["q"]: row["idle_children"][0]["orthogonal_axes"][:8] + for row in phases["recipes"]} + require(set(ports) <= set(by_q), "every actual port has a pinned phase basis") + for port, (first, q) in enumerate(zip(live, ports, strict=True)): + companion = first + 112 + fin = word["frames"][word["final"][companion]] + require(word["frames"][word["initial"][first]] == [q] + and not word["frames"][word["initial"][companion]] + and word["frames"][word["final"][first]] == [1 << j for j in range(9)] + and len(fin) == 8 and all(dot(q, axis) == 0 for axis in fin), + "actual main source and target charts") + if port in second: + x2, y2 = second[port] + require(all(word[key][a] == word[key][b] + for key in ("initial", "final") + for a, b in ((first, x2), (companion, y2))), + "separate second plane with identical charts") + + lifetime_plan, moves, native_paid, helper_targets, opcodes = native_inventory(word, helpers) + roots = {("main", port, role) for kind, spec in types.items() + for port in spec["ports"] for role in role_sets[kind]} + require(len(roots) == signed["root_owners"] == 3536, "distinct root owner count") + fresh_helpers = set() + paid = Counter() + targets = Counter() + phase_rows = [] + occurrences = [] + owner_maps = [] + phase_fault_rejected = False + signed_idles = 0 + special_owners = [] + for clock, event in enumerate(caller["events"]): + if event[0] == "J": + _, stage, a, b = event + owners = {} + for port, first in enumerate(live): + pair = a[:2] if port in second else b[:2] + first_pair = ((first, pair[0]), (first + 112, pair[1])) + if port in second: + first_pair += tuple(zip(second[port], a[2:], strict=True)) + for slot, role in first_pair: + tag = ("main", port, role) + require(tag in roots and slot not in owners, "injective main assignment") + owners[slot] = tag + shifts, fault = contact_phase(ports[port], by_q[ports[port]], stage, ambient) + phase_rows.append([clock, port, shifts, 2 if port in second else 1]) + if fault and not phase_fault_rejected: + transform, (before, after) = fault + try: + boundary(before, after, transform, omit_translation=True) + except ValueError as exc: + require(str(exc) == "forward contact includes its phase", + "phase control rejection reason") + phase_fault_rejected = True + else: + raise ValueError("omitted contact translation escaped") + require(set(owners) == main and len(set(owners.values())) == 400, + "all source main slots have different physical owners") + for role in helpers: + tag = ("helper", stage, role) + require(tag not in fresh_helpers and tag not in roots, "fresh arbitrary helper") + fresh_helpers.add(tag) + owners[role] = tag + if role in special_helpers: + special_owners.append({ + "tag": tag, "stage": stage, "caller_clock": clock, + "initial_chart": 3, "final_chart": 237, "target_rank": 4, + "exit_ordered_basis": word["frames"][237], + }) + require(set(owners) == set(range(public)) and len(set(owners.values())) == public, + "full public-field injection") + owner_maps.append([stage, sorted(owners.items())]) + for native_clock, role, first, last, rank, owned in moves: + tag = owners[role] if owned is None else ("owned", stage, owned) + require(tag not in roots or owned is None, "private owner separation") + paid[rank] += 1 + occurrences.append([clock, native_clock, tag, rank, first, last]) + targets.update(helper_targets) + continue + + kind, op, role, *args = event + if op not in {"QUERY", "IDLE_ONE", "IDLE_ODD"}: + continue + if op == "QUERY": + rank = 1 + else: + rank = 8 * len(args[0]) + int(op == "IDLE_ODD") + for port in types[kind]["ports"]: + tag = ("query_scratch", clock, port) if op == "QUERY" else ("main", port, role) + require((tag not in roots) if op == "QUERY" else tag in roots, "caller paid owner") + occurrences.append([clock, op, tag, rank]) + paid[rank] += 1 + signed_idles += int(op == "IDLE_ODD") + require(len(owner_maps) == stages and len(fresh_helpers) == 17616 and phase_fault_rejected, + "complete 16-call owners and phase control") + require(len(special_owners) == len({row["tag"] for row in special_owners}) == 32, + "distinct stage-tagged arbitrary helper 325 and 1087 ingress/egress") + root_targets = Counter() + root_negative = 0 + for kind, spec in types.items(): + for phase, coeff_phase, *selection in spec["diagonal"]: + require(coeff_phase == 0 and any(selection), "whole positive target endpoint") + for port in spec["ports"]: + q = ports[port] + axes = [1 << (9 + 8 * j + offset) for j, yes in enumerate(selection) + if yes for offset in range(8)] + require(len(axes) == len(set(axes)) and all(a < 1 << ambient for a in axes), + "positive target complete distinct axes") + actual = terms([(q, phase)] + [(axis, 1) for axis in axes]) + positive = terms((a, 1) for a in ([q] if phase else []) + axes) + require(translation(sub(positive, actual)) == (q if phase == -1 else 0), + "exact negative root translation") + root_targets[len(axes) + int(bool(phase))] += 1 + root_negative += int(phase < 0) + targets.update(root_targets) + references = Counter({rank: stages * count for rank, count in native_paid.items()}) + references.update(signed["fixed_caller_paid"]) + require(paid == references and root_targets == Counter(signed["fixed_root_targets"]), + "independent decomposition and occurrence invoices agree") + require(len(occurrences) == sum(paid.values()) and sum(targets.values()) == 21152, + "complete paid and productive owner count") + contacts = sum(4 * row[3] for row in phase_rows) + nonzero = sum(row[3] * sum(bool(v) for v in row[2]) for row in phase_rows) + require(contacts == nonzero == 12800, "all 12,800 absolute phase translations charged") + return { + "ambient": ambient, + "calls": stages, + "native_public": public, + "main_per_native": len(main), + "fresh_helpers": len(fresh_helpers), + "role_325_and_1087_helper_owners": special_owners, + "root_owners": len(roots), + "productive_fields": sum(targets.values()), + "paid_positions": len(occurrences), + "native_paid": dict(native_paid), + "native_targets": dict(helper_targets), + "paid": dict(paid), + "targets": dict(targets), + "phase_digest": digest(phase_rows), + "owner_map_digest": digest(owner_maps), + "ordered_paid_digest": digest(occurrences), + "contacts": contacts, + "nonzero_contact_translations": nonzero, + "phase_omission_rejected": phase_fault_rejected, + "signed_idle_ordinary_corrections": signed_idles, + "negative_root_ordinary_corrections": root_negative, + "owned_lifetimes_per_native": len(lifetime_plan), + "owned_lifetime_plan_digest": digest(lifetime_plan), + "owned_fresh_homes_per_raw_caller": stages * len(lifetime_plan), + "owned_resets_per_raw_caller": 2 * stages * len(lifetime_plan), + "native_opcodes": dict(opcodes), + } diff --git a/research/cf6a-banked-role1256-relay/engines/caller/caller16.py b/research/cf6a-banked-role1256-relay/engines/caller/caller16.py new file mode 100644 index 0000000000..2865530b78 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/engines/caller/caller16.py @@ -0,0 +1,182 @@ +"""Exact signed caller replay, adapted from Ali Romman's #7663 caller.py. + +See SOURCE-PINS.json for Rohan Arun's literal #7113-derived caller and +the attributed reference engines. Apache-2.0. +""" + +from collections import Counter +from fractions import Fraction +from functools import cache + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def exact_div(numerator, denominator): + quotient, remainder = divmod(numerator, denominator) + require(remainder == 0, "inexact caller pre-product") + return quotient + + +def literal_layout(caller, word): + stages = caller["stages"] + require(stages == 16 and caller["ambient_rank"] == 9 + 8 * stages == 137, + "literal 16-call, 137-axis layout") + require(len(caller["events"]) == 4192, "literal caller event count") + types = caller["types"] + require(set(types) == {"A", "B"}, "literal type partition") + require(all(spec["roles"] == 34 for spec in types.values()), "literal 34+34 roles") + require(types["A"]["ports"] == word["hosted"]["Dports"], "hosted port assignment") + require((len(types["A"]["ports"]), len(types["B"]["ports"])) == (96, 8), + "literal 96+8 ports") + require(sorted(types["A"]["ports"] + types["B"]["ports"]) == list(range(104)), + "disjoint complete 104-port assignment") + role_sets = { + kind: set(range(spec["offset"], spec["offset"] + spec["roles"])) + for kind, spec in types.items() + } + require(role_sets["A"].isdisjoint(role_sets["B"]) + and role_sets["A"] | role_sets["B"] == set(range(caller["roles"])), + "disjoint complete root role ranges") + h = word["hosted"] + coefficients = tuple(Fraction(h[k]) for k in ("alpha", "beta", "alpha2", "beta2")) + require(coefficients == (-1, Fraction(1, 2), -1, 0), "joint normalized source coefficients") + require(Fraction(types["A"]["alpha2"]) == coefficients[2], "A second-plane coefficient") + return stages, types, role_sets + + +def signed_caller(caller, word, odd_scale, dyadic_height): + stages, types, role_sets = literal_layout(caller, word) + unit = odd_scale << dyadic_height + zero = (0,) * stages + rows = [{(r, 0, zero): (unit, 0)} for r in range(caller["roles"])] + paid = Counter() + targets = Counter() + uses = Counter() + calls = [] + checks = 0 + peak = unit + peak_at = (-1, "entrance") + clock = -1 + + def observe(row, site): + nonlocal peak, peak_at + mass = sum(abs(real) + abs(imag) for real, imag in row.values()) + if mass > peak: + peak, peak_at = mass, (clock, site) + + @cache + def shifted(exponents, shift): + result = list(exponents) + for stage in shift: + result[stage - 1] += 1 + return tuple(result) + + def term(row, ar=1, ai=0, denominator=1, phase=0, shift=()): + nonlocal checks + out = {} + for (role, q, powers), (x, y) in row.items(): + real, imag = ar * x - ai * y, ar * y + ai * x + if denominator != 1: + real, imag = exact_div(real, denominator), exact_div(imag, denominator) + checks += 1 + if real or imag: + key = (role, (q + phase) % 4, shifted(powers, shift) if shift else powers) + out[key] = (real, imag) + observe(out, "scaled separate term") + return out + + def add(a, b): + out = a.copy() + for key, (u, v) in b.items(): + x, y = out.get(key, (0, 0)) + if x + u or y + v: + out[key] = (x + u, y + v) + else: + out.pop(key, None) + observe(out, "stored sum") + return out + + for clock, event in enumerate(caller["events"]): + kind = event[0] + if kind == "J": + _, stage, (x, y, u, v), (a, b, alpha, beta) = event + require(stage == len(calls) + 1, "chronological joint occurrences") + require(Fraction(alpha) == -1 and Fraction(beta) == Fraction(1, 2), + "literal joint coefficients") + require(len({x, y, u, v}) == 4 and {x, y, u, v} <= role_sets["A"] + and a != b and {a, b} <= role_sets["B"], "joint owner alias") + calls.append(stage) + rows[y] = add(rows[y], term(rows[x], phase=-1)) + rows[u] = add(rows[u], term(rows[v], -1, phase=1)) + first, second = rows[a], rows[b] + rows[a] = add(first, term(second, -1, phase=1)) + rows[b] = add(term(second, denominator=2), + term(first, denominator=2, phase=-1)) + for role in (x, y, u, v, a, b): + rows[role] = term(rows[role], shift=(stage,)) + continue + + _, op, role, *args = event + require(kind in role_sets and role in role_sets[kind], "caller target owner") + replicas = len(types[kind]["ports"]) + uses[op] += replicas + if op in {"ADD", "SWAP", "QUERY"}: + require(args[0] in role_sets[kind] and args[0] != role, "caller donor owner") + if op == "SWAP": + other, = args + rows[role], rows[other] = rows[other], rows[role] + elif op == "QUERY": + donor, sign = args + require(sign in (-1, 1), "caller query orientation") + rows[role] = add(rows[role], term(rows[donor], phase=sign)) + paid[1] += replicas + elif op in {"ADD", "SCALE"}: + factor = Fraction(args[-1]) + donor = args[0] if op == "ADD" else role + contribution = term(rows[donor], factor.numerator, denominator=factor.denominator) + rows[role] = add(rows[role], contribution) if op == "ADD" else contribution + elif op == "LAMBDA": + sign, = args + require(sign in (-1, 1), "caller LAMBDA sign") + old = rows[role] + rows[role] = add(term(old, 1, sign, 2), term(old, 1, -sign, 2, phase=2)) + else: + require(op in {"IDLE_ONE", "IDLE_ODD"}, "known caller operation") + block = tuple(args[0]) + require(block and len(block) == len(set(block)) + and all(1 <= k <= stages for k in block), "whole idle stage subset") + if op == "IDLE_ODD": + require(len(args) == 2 and len(block) == 1 and args[1] == -1, + "literal signed rank-nine child") + else: + require(len(args) == 1, "literal unit idle") + phase = args[1] if op == "IDLE_ODD" else 0 + rows[role] = term(rows[role], phase=phase, shift=block) + paid[8 * len(block) + phase % 2] += replicas + + require(calls == list(range(1, stages + 1)), "all 16 native invocations") + for spec in types.values(): + require(len(spec["diagonal"]) == spec["roles"], "complete diagonal") + for off, (phase, coefficient_phase, *powers) in enumerate(spec["diagonal"]): + role = spec["offset"] + off + require(phase in (-1, 0, 1) and coefficient_phase == 0 and len(powers) == stages + and set(powers) <= {0, 1} and any(powers), "positive whole root target") + require(rows[role] == {(role, phase % 4, tuple(powers)): (unit, 0)}, + "exact signed root endpoint") + targets[8 * sum(powers) + phase % 2] += len(spec["ports"]) + return { + "fixed_caller_paid": dict(paid), + "fixed_root_targets": dict(targets), + "uses": dict(uses), + "calls": stages, + "roles": len(rows), + "root_owners": sum(targets.values()), + "dyadic_height": dyadic_height, + "odd_scale": odd_scale, + "peak_scaled_mass": str(Fraction(peak, 1 << dyadic_height)), + "peak_witness": peak_at, + "exact_preproduct_divisions": checks, + } diff --git a/research/cf6a-banked-role1256-relay/engines/caller/directed_price.py b/research/cf6a-banked-role1256-relay/engines/caller/directed_price.py new file mode 100644 index 0000000000..8785a1337d --- /dev/null +++ b/research/cf6a-banked-role1256-relay/engines/caller/directed_price.py @@ -0,0 +1,184 @@ +#!/usr/bin/env python3 +"""Independent rational bounds on the two frozen banked invoices.""" + +from argparse import ArgumentParser +from fractions import Fraction +from functools import lru_cache +from hashlib import sha256 +import json +from pathlib import Path + + +INVOICE = "a9aecf52d99d5370506b9dc6d03799241bebd2c03bbdcfa2dd5f45ec03c9d70d" +OUTER = "8e29f3ebb19c849884cfb87ef39431616774acfe95fa28a3cfe2e124abc6d202" +PEER = "00340c699fd7e2895d31a41d1eb60aebf91d7ba2c1c193dc002f69315298cd38" +RESULT = "b1af8b101a40f25eea55a8b58443794a7db708389ad66c20adefbace12828e09" +PLAN = "509c44b078561a8868b68dab9f50b0b7d87d0976361d927bc8cc6bfdf1239393" +F = Fraction +Q = 1 << 160 +BIT = F("0.00376669") +PEER_CLAIM = F("0.0037260455556") +CHILD_CLAIM = F("0.0037261023899") +PEER_BRACKET = tuple(map(F, ("0.00372604555571", "0.00372604555572"))) +CHILD_BRACKET = tuple(map(F, ("0.0037261023900", "0.0037261023901"))) + + +def require(predicate, reason): + if not predicate: + raise ValueError(reason) + + +def load_exact(path, expected): + raw = path.read_bytes() + require(sha256(raw).hexdigest() == expected, f"frozen bytes changed: {path.name}") + return json.loads(raw) + + +def outward(lower, upper): + return F(lower * Q // 1, Q), F(-((-upper * Q) // 1), Q) + + +def log_unit(value): + """Lower partial sum and upper geometric tail on log(value), 1 <= value <= 2.""" + u = (value - 1) / (value + 1) + require(0 <= u <= F(1, 3), "range reduction for the logarithm") + square, term, total = u * u, u, F() + for index in range(28): + total += 2 * term / (2 * index + 1) + term *= square + return total, total + 2 * term / (57 * (1 - square)) + + +@lru_cache(maxsize=None) +def log_rank(rank): + power = rank.bit_length() - 1 + low2, high2 = log_unit(F(2)) + low, high = log_unit(F(rank, 1 << power)) + return outward(power * low2 + low, power * high2 + high) + + +def positive_exp(value): + """Bound exp(value) from its first 27 positive terms and the remaining tail.""" + require(0 <= value <= 1, "range reduction for the exponential") + term, total = F(1), F(1) + for index in range(1, 27): + term *= value / index + total += term + first_omitted = term * value / 27 + return total, total + first_omitted / (1 - value / 28) + + +@lru_cache(maxsize=None) +def power_rank(rank, k_low, k_high): + require(0 <= k_low <= k_high < 1, "positive exponent interval") + log_low, log_high = log_rank(rank) + x_low, x_high = outward((1-k_high) * log_low / 8, (1-k_low) * log_high / 8) + low = positive_exp(x_low)[0] + high = positive_exp(x_high)[1] + low, high = outward(low, high) + for _ in range(3): + low, high = outward(low * low, high * high) + return low, high + + +def moment(coefficients, k_low, k_high, derivative=False): + low, high = F(), F() + for rank, coeff in sorted(coefficients.items()): + term_low, term_high = power_rank(rank, k_low, k_high) + if derivative: + log_low, log_high = log_rank(rank) + term_low, term_high = -term_high * log_high, -term_low * log_low + lower, upper = sorted((term_low * coeff, term_high * coeff)) + low, high = low + lower, high + upper + return low, high + + +def read_history(invoice): + p = {int(k): v for k, v in invoice["paid"].items()} + t = {int(k): v for k, v in invoice["targets"].items()} + require(all(1 <= k <= 137 and type(v) is int and v > 0 + for series in (p, t) for k, v in series.items()), "literal positive rank bill") + require(sum(p.values()) == 101824 and sum(t.values()) == 21152, "full bill denominators") + coeff = {k: t.get(k, 0) - p.get(k, 0) for k in p.keys() | t.keys()} + require(sum(k * v for k, v in coeff.items()) == 1328, "retained signed rank surplus") + return p, t, coeff + + +def per_side(invoice, received, claim, bracket, comparator, comparator_sign): + _, _, coeff = read_history(invoice) + require(F(received["decimal_claim"]) == claim and tuple(map(F, received["bracket"])) == bracket, + "same directed endpoints shown in the application receipt") + query = {claim: 1, claim + F(7, 10**14): 1, bracket[0]: 1, bracket[1]: -1} + require(comparator not in query or query[comparator] == comparator_sign, "consistent comparator sign") + query[comparator] = comparator_sign + points = {} + for point, sign in query.items(): + bounds = moment(coeff, point, point) + require(bounds[0] > 0 if sign > 0 else bounds[1] < 0, f"strict moment sign at {point}") + points[str(point)] = list(map(str, bounds)) + derivative = moment(coeff, PEER_CLAIM, BIT, derivative=True) + require(derivative[1] < 0, "strictly decreasing moment on the shared comparison interval") + return { + "claim": str(claim), "bracket": list(map(str, bracket)), "target_minus_paid": points, + "derivative_range": list(map(str, derivative)), + "derivative_interval_kappa": [str(PEER_CLAIM), str(BIT)], + } + + +def main(): + parser = ArgumentParser(description=__doc__) + for name in ("invoices", "outer", "application", "peer-result", "out"): + parser.add_argument("--" + name, required=True, type=Path) + parser.add_argument("--plan-sha256", required=True) + args = parser.parse_args() + require(args.plan_sha256 == PLAN, "registered independent rational price check") + invoices = load_exact(args.invoices, INVOICE) + outer = load_exact(args.outer, OUTER) + published = load_exact(args.peer_result, PEER)["application"] + applied = load_exact(args.application, RESULT) + require(applied["status"] == "PASS_BANK24_ACTUAL16_APPLICATION_COMPONENT" + and invoices["peer"] == published["invoice"], "same complete #7674 comparator") + require(applied["graphs"]["peer"][0] == "d81ec9f47740852a4bf7bd83100feff5cb66b70e1973466e1609bbac8af75098" + and applied["graphs"]["candidate"][0] == "1f082936ada08b5138b7d13e33368bd21c6f46632c5319a348e2f2a8e0021150", + "actual frozen peer and child graph identities") + peer_p, peer_t, _ = read_history(invoices["peer"]) + child_p, child_t, child_coeff = read_history(invoices["candidate"]) + delta = {k: child_p.get(k, 0) - peer_p.get(k, 0) for k in peer_p.keys() | child_p.keys()} + require({k: change for k, change in delta.items() if change} == {2: 16, 3: -32, 4: 16} + and peer_t == child_t, "the only signed fee change is the paid rank redistribution") + compared = PEER_BRACKET[1] + improvement = moment({2: -16, 3: 32, 4: -16}, compared, compared) + require(0 < improvement[0] <= improvement[1] < 1, "strict improvement with no rank-one fee") + child_plus_fee = dict(child_coeff) + child_plus_fee[1] -= 1 + control = moment(child_plus_fee, compared, compared) + require(control[1] < 0, "a single added rank-one charge rejects the claimed comparison") + gap = CHILD_CLAIM - compared + require(gap == F(applied["strict_gap"]) == F(2841709, 50000000000000), "exact strict gap") + result = { + "status": "PASS_BANK24_REVIEW_INDEPENDENT_DIRECTED_PRICE", + "scope": "Independent signed-rank moment brackets, derivative and added-price control", + "inputs": {"invoices": INVOICE, "outer_receipt": OUTER, "application": RESULT, + "published_peer": PEER, "plan_receipt": PLAN, + "source": sha256(Path(__file__).read_bytes()).hexdigest()}, + "graphs": applied["graphs"], "caller_sha256": applied["caller_sha256"], + "paid_count_each": 101824, "target_count_each": 21152, + "rank_mass_surplus_each": 1328, "paid_delta": {2: 16, 3: -32, 4: 16}, + "target_delta": {}, "strict_gap": str(gap), + "peer": per_side(invoices["peer"], outer["peer"], PEER_CLAIM, PEER_BRACKET, compared, -1), + "candidate": per_side(invoices["candidate"], outer["candidate"], CHILD_CLAIM, + CHILD_BRACKET, compared, 1), + "target_minus_paid_improvement_at_peer_upper": list(map(str, improvement)), + "actual_child_added_one_rank_one_fee_control": list(map(str, control)), + } + for path, digest in ((args.invoices, INVOICE), (args.outer, OUTER), + (args.application, RESULT), (args.peer_result, PEER)): + require(sha256(path.read_bytes()).hexdigest() == digest, f"input changed: {path.name}") + with args.out.open("x") as handle: + json.dump(result, handle, indent=2, sort_keys=True) + handle.write("\n") + print(result["status"]) + + +if __name__ == "__main__": + main() diff --git a/research/cf6a-banked-role1256-relay/engines/caller/interval_gate.py b/research/cf6a-banked-role1256-relay/engines/caller/interval_gate.py new file mode 100644 index 0000000000..e24dc46079 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/engines/caller/interval_gate.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 +"""Independent certified fixed-grid intervals (80 decimal places). +ln via 2 atanh after binary range reduction; exp(-x) via alternating +Taylor brackets. Uses only integer floor/ceiling, not Decimal transcendents. +""" +from fractions import Fraction as F +from functools import lru_cache +from pathlib import Path +import json,argparse +if not __debug__: raise RuntimeError('Run without -O; assertions are proof checks.') +B=10**80 + +def ceildiv(a,b):return -((-a)//b) +def exact(q): + q=F(q);return q.numerator*B//q.denominator,ceildiv(q.numerator*B,q.denominator) +def add(a,b):return a[0]+b[0],a[1]+b[1] +def sub(a,b):return a[0]-b[1],a[1]-b[0] +def mul(a,b): + p=[a[i]*b[j] for i in (0,1) for j in (0,1)];return min(p)//B,ceildiv(max(p),B) +def div(a,b): + assert b[0]>0 + p=[F(a[i]*B,b[j]) for i in (0,1) for j in (0,1)] + return min(p).__floor__(),max(p).__ceil__() +def smul(a,q):return mul(a,exact(q)) +def atanh_log(y): + yi=exact(y);yy=mul(yi,yi);p=yi;s=(0,0) + for j in range(100):s=add(s,smul(p,F(2,2*j+1)));p=mul(p,yy) + # 0 <= tail <= 2 y^201/[201(1-y^2)] < 3*(1/3)^201. + return s[0],s[1]+ceildiv(3*B,3**201) +@lru_cache(None) +def log(r): + assert r>=1 + k=r.bit_length()-1;y=F(r-2**k,r+2**k) + a=atanh_log(y);b=atanh_log(F(1,3));return add(a,smul(b,k)) +def expminus(x): + assert 0<=x[0]<=x[1]0 and margins[str(hi)][1]<0 and margins[str(tested)][0]>0 + target=moment(T,tested);paid=moment(P,tested) + alpha=div(paid,target) + # Tail exponent = 1-tested+1/7; argument exp may not be negative. + # r^(1-tested+1/7)=r^(1-tested)* exp(log(r)/7). + def exppos(x): + assert 0<=x[0]<=x[1]0 and gap.numerator==1;step=gap.denominator + wins=lambda j:(step*j+1)**written<2**j + l,h=1,2 + while not wins(h):l,h=h,2*h + while h-l>1: + m=(l+h)//2 + if wins(m):h=m + else:l=m + assert wins(h) and not wins(h-1) + # Monotonicity: upper derivative bound on [0, cap]. + derivative=(0,0) + for rr in T.keys()|P.keys(): + c=T.get(rr,0)-P.get(rr,0);r=int(rr) + term=mul(power(r,cap if c>=0 else 0),log(r));derivative=add(derivative,smul(term,-c)) + assert derivative[1]<0 + result=dict(claim=str(claim),tested=str(tested),raw_bracket=[str(lo),str(hi)],moment_margins={k:show(v) for k,v in margins.items()},moment_margin_float={k:value(v) for k,v in margins.items()},derivative_upper=float(F(derivative[1],B)),alpha=value(alpha),gamma=value(gamma),delta=value(delta),minimum_log_power=lp,written_log_power=written,compiler_gap=str(gap),H=str(step*h),BIT_pin=str(cap),BIT_margin=str(cap-tested)) + # Outer formulas evaluated independently after algebraically substituting + # b=k+5g,a=k+4g,q=k+3g,epsilon=1-g,beta=1-3g. + k=claim;g=gap;b=k+5*g;a=k+4*g;q=k+3*g;ep=1-g;be=1-3*g;r0=g/10;stop=layout=g + sig=1-b;tau=1-a;internal=tau+(1-stop)*max(sig-tau,0);leaf=sig+stop*(1-sig);lam=1-(q+a)/2;xi=ep*(1+q)-F(3,32)+layout;key=be+1-ep + M=[ep*q,a,1-ep+q*be,1-ep+a*be,1-ep+be,F(3,32)+xi-ep,xi+F(1,2)-ep,ep,1-(ep+be+48-128+2)] + checks=[cap-a,b-a,q,b-q,a-q,stop,1-stop,(1-stop)*b-a,1-internal-q,1-leaf-q,lam-tau,lam-sig,lam-internal,1-q-lam,1-q-leaf,ep,1-ep,xi-F(1,2),ep-xi,be,ep-be,1-be,1-(2*xi-2)-r0-be,1-(2*xi-2)-be,1-ep-r0,1-ep,r0,1-key,1-be-2*(1-ep),128-48-be,layout,ep-a,F(1,32)-b,F(2**45-7**16),F(2),2-xi,F(5),1-be,1-be,1-ep,M[2]-M[0],g,k-F('.001730970419199163702738'),1-ep,F(11,2)]+[x-k for x in M] + functional=[1-be,be*(1-F(3,1000)),128-48-ep-be-1,be*(1-F(1,250))] + assert len(checks)==54 and len(functional)==4 and min(checks+functional)>0 + result['outer']=dict(strict_count=54,functional_count=4,minimum_margin=str(min(checks+functional)),BIT_just_below_effective_rejected=(a-F(1,10**12))-a<0) + # Input-lift is only needed on [1-tested_complex,1]. A stronger BIT + # pin is irrelevant to this interval; the source's crude BIT-wide bound + # is not imported beyond its valid range. + pos={7:1,3:1,5:1};neg={9:1,4:1,1:2};d1=(0,0);curvature=(0,0) + for hist,sign in ((pos,1),(neg,-1)): + for r,c in hist.items(): + d1=add(d1,smul(log(r),sign*c*r)) + curvature=add(curvature,smul(mul(log(r),log(r)),c*r)) + lift_cap=cap if cap<=F('.00376669') else tested + assert tested<=lift_cap and F(d1[1],B)+lift_cap*F(curvature[1],B)<0 + lifts={} + for price in (claim,tested): + lift=sub(moment(pos,price),moment(neg,price));assert lift[0]>0 + assert price*(-F(d1[1],B))-price*price*F(curvature[1],B)/2>0 + lifts[str(price)]=show(lift) + result['input_lift']=dict(margins=lifts,interval_kappa_cap=str(lift_cap),derivative_upper_on_required_interval=str(F(d1[1],B)+lift_cap*F(curvature[1],B)),source_BIT_wide_crude_bound_would_be=str(F(d1[1],B)+cap*F(curvature[1],B))) + return result +if __name__=='__main__': + p=argparse.ArgumentParser();p.add_argument('audit');p.add_argument('--claim',default='.00362852408');p.add_argument('--tested',default='.00362852408007');p.add_argument('--lower',default='.00362852408398727978896072723289');p.add_argument('--upper',default='.00362852408398727978896072723290');p.add_argument('--out',required=True);p.add_argument('--bit-pin',default='.00376669');a=p.parse_args() + r=gate(json.loads(Path(a.audit).read_text())['invoice'],a.claim,a.tested,a.lower,a.upper,a.bit_pin);Path(a.out).write_text(json.dumps(r,indent=2)+'\n');print(json.dumps(r,indent=2)) diff --git a/research/cf6a-banked-role1256-relay/engines/caller/native.py b/research/cf6a-banked-role1256-relay/engines/caller/native.py new file mode 100644 index 0000000000..3e09f65fe3 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/engines/caller/native.py @@ -0,0 +1,132 @@ +"""Check exact rational signals, all endpoints, and the common integer grid.""" +from fractions import Fraction +from math import lcm +from pathlib import Path +import sys + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from network import add_scaled, coefficients, fold, main_roles, need, pivot, read, source_word + + +def grid(net, order): + denominators = {~r: 1 for r in range(len(net.initial))} + common = 1 + for node in order: + bound = 1 + for donor, factor in net.forms[node].items(): + bound = lcm(bound, denominators[donor] * factor.denominator) + denominators[node] = bound + common = lcm(common, bound) + return common + + +def evaluate(net, requested=None): + order = net.schedule() + if requested is not None: + active = set(requested) + for k in reversed(order): + if k in active: + active.update(net.forms[k]) + order = [k for k in order if k in active] + unit = grid(net, order) + values = {~r: {r: unit} for r in range(len(net.initial))} + mass = {~r: unit for r in range(len(net.initial))} + peak = unit + work = 0 + for k in order: + row = {} + bound = 0 + for donor, factor in sorted(net.forms[k].items()): + a, b = factor.numerator, factor.denominator + bound += abs(a) * mass[donor] // b + for i, value in values[donor].items(): + quotient, remainder = divmod(a * value, b) + need(remainder == 0, "native term left the grid") + new = row.get(i, 0) + quotient + if new: + row[i] = new + else: + row.pop(i, None) + work += len(values[donor]) + peak = max(peak, bound) + values[k] = row + mass[k] = sum(map(abs, row.values())) + return unit, values, peak, work + + +def expected(word, unit): + n = word["public"] + out = [{r: unit} for r in range(n)] + hosted = word["hosted"] + a_ports = set(hosted["Dports"]) + for j, x in enumerate(word["live"]): + y = x + 112 + if j in a_ports: + out[y][x] = unit + else: + need(unit % 2 == 0, "butterfly half") + out[x][y] = -unit + out[y] = {x: unit // 2, y: unit // 2} + for x, y in zip(hosted["X2"], hosted["Y2"], strict=True): + out[x][y] = -unit + return out + + +def check_endpoints(net, word): + unit, rows, peak, terms = evaluate(net) + targets = expected(word, unit) + need([rows[net.first_output + r] for r in range(len(targets))] == targets, "native output matrix") + power = (unit & -unit).bit_length() - 1 + numerator_bits = max(abs(c.numerator).bit_length() for row in net.forms.values() for c in row.values()) + denominator_bits = max(c.denominator.bit_length() for row in net.forms.values() for c in row.values()) + return dict(grid=str(unit), odd=unit >> power, dyadic_height=power, peak_scaled_mass=str(Fraction(peak, 1 << power)), + checked_products=terms, terms=sum(map(len, net.forms.values())), slots=len(net.moves), + coefficient_bits=max(numerator_bits, denominator_bits), public=len(targets), mains=len(main_roles(word))) + + +def verify_pivot(net, edit): + combo = coefficients(edit["combination"]) + source = coefficients(edit["sender"]) + side = coefficients(edit["receiver"]) + _, values, _, _ = evaluate(net, combo.keys() | source.keys() | side.keys()) + target = {} + for m, a in combo.items(): + add_scaled(target, values[m], a) + for m, a in side.items(): + add_scaled(target, values[m], a) + got = {} + for m, a in source.items(): + add_scaled(got, values[m], a) + need(target == got, "saved signal identity") + + +def check_pivots(): + word = source_word() + net = fold(word) + edits = read(HERE / "PIVOTS.json") + checked = 0 + for i, edit in enumerate(edits): + if edit["direction"] == "transpose": + net = net.transpose() + verify_pivot(net, edit) + if i == 0: + donor, weight = edit["sender"][0] + corrupted = dict(edit, sender=[[donor, str(-Fraction(weight))], *edit["sender"][1:]]) + try: + verify_pivot(net, corrupted) + except ValueError as exc: + need(str(exc) == "saved signal identity", "sender sign control reason") + else: + raise ValueError("incorrect sender sign accepted") + checked += 1 + net = pivot(net, edit) + if edit["direction"] == "transpose": + net = net.transpose() + return checked + + +if __name__ == "__main__": + checked = check_pivots() + need(checked == read(HERE / "RESULT.json")["pivot_checks"], "pivot coverage") + print("PASS_EXACT_PIVOTS", checked) diff --git a/research/cf6a-banked-role1256-relay/engines/caller/network.py b/research/cf6a-banked-role1256-relay/engines/caller/network.py new file mode 100644 index 0000000000..0ebc1925c4 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/engines/caller/network.py @@ -0,0 +1,217 @@ +"""Construct the communication circuit and apply the rational pivots.""" +from dataclasses import dataclass +from fractions import Fraction +from functools import cache +from graphlib import TopologicalSorter +from hashlib import sha1, sha256 +from pathlib import Path +import gzip +import json + +HERE = Path(__file__).resolve().parent +PARENT = "ee251f6005d2a92b887c5b804bd7aac05989d278b2c9ccb3c3091b50d533b08d" + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def encoded(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")).encode() + + +def read(path): + raw = path.read_bytes() + return json.loads(gzip.decompress(raw) if path.suffix == ".gz" else raw) + + +def source_word(): + for pin in read(HERE / "SOURCE-PINS.json"): + raw = (HERE / pin["file"]).read_bytes() + need(sha256(raw).hexdigest() == pin["sha256"], "source SHA-256") + need(sha1(f"blob {len(raw)}\0".encode() + raw).hexdigest() == pin["git_blob"], "source Git blob") + base = read(HERE / "source/K372-2-WORD.json.gz") + patch = read(HERE / "source/source-edits.json") + need(sha256(encoded(base)).hexdigest() == patch["source"], "source edit origin") + result = [] + cursor = 0 + for edit in patch["edits"]: + start, stop = edit["start"], edit["stop"] + need(cursor <= start <= stop <= len(base["program"]), "source edit range") + need(base["program"][start:stop] == edit["before"], "source edit preimage") + result.extend(base["program"][cursor:start]) + result.extend(edit["after"]) + cursor = stop + result.extend(base["program"][cursor:]) + word = dict(base, program=result) + need(sha256(encoded(word)).hexdigest() == patch["candidate"] == PARENT, "parent word") + return word + + +def main_roles(word): + h = word["hosted"] + return set(word["live"]) | {i + 112 for i in word["live"]} | set(h["X2"]) | set(h["Y2"]) + + +@cache +def rational(literal): + return Fraction(literal) + + +def add_scaled(row, donor, factor): + for index, value in donor.items(): + new = row.get(index, 0) + factor * value + if new: + row[index] = new + else: + row.pop(index, None) + + +@dataclass +class Network: + first_output: int + initial: list + final: list + moves: dict + forms: dict + + def schedule(self): + for node, form in self.forms.items(): + chart = self.moves[node][0] if node < self.first_output else self.final[node - self.first_output] + for donor in form: + if donor < 0: + need(0 <= ~donor < len(self.initial), "input owner") + donor_chart = self.initial[~donor] + else: + need(donor in self.moves, "missing donor") + donor_chart = self.moves[donor][1] + need(donor_chart == chart, "nonlocal scalar") + need(set(self.forms) == self.moves.keys() | set(range(self.first_output, self.first_output + len(self.final))), + "output inventory") + dependencies = {node: sorted(i for i in self.forms[node] if i >= 0) for node in sorted(self.forms)} + return list(TopologicalSorter(dependencies).static_order()) + + def transpose(self): + def reverse(node): + if node < 0: + return self.first_output + ~node + if node >= self.first_output: + return ~(node - self.first_output) + return node + + edges = {k: {} for k in self.moves} + edges.update({self.first_output + r: {} for r in range(len(self.initial))}) + for node, form in self.forms.items(): + for donor, coefficient in form.items(): + edges[reverse(donor)][reverse(node)] = coefficient + moves = {k: (b, a) for k, (a, b) in self.moves.items()} + return Network(self.first_output, self.final, self.initial, moves, edges) + + +def fold(word): + n = word["public"] + rows = [{~r: 1} for r in range(n)] + [None] * word["owned_fields"] + charts = word["initial"][:] + [None] * word["owned_fields"] + forms, moves = {}, {} + for clock, event in enumerate(word["program"]): + op, r = event[:2] + if op == "INIT": + need(r >= n and rows[r] is None, "private birth") + rows[r], charts[r] = {}, event[2] + continue + need(rows[r] is not None, "inactive register") + if op == "MOVE": + _, _, a, b, owned = event + need(charts[r] == a and owned == (r >= n), "original transfer") + moves[clock], forms[clock] = (a, b), rows[r] + rows[r], charts[r] = {clock: 1}, b + else: + need(charts[r] == event[-1], "original scalar chart") + if op == "CLEAR": + need(r >= n, "public retirement") + rows[r], charts[r] = None, None + elif op == "SCALE": + rows[r] = {k: v * rational(event[2]) for k, v in rows[r].items()} + else: + need(op == "ADD" and event[2] != r and charts[event[2]] == charts[r], "original donor") + add_scaled(rows[r], rows[event[2]], rational(event[3])) + need(charts[:n] == word["final"] and all(f is None for f in charts[n:]), "original exit") + first = len(word["program"]) + forms.update({first + r: rows[r] for r in range(n)}) + return Network(first, word["initial"], word["final"], moves, forms) + + +def coefficients(entries): + result = {k: rational(v) for k, v in entries} + need(len(entries) == len(result) and all(result.values()), "sparse coefficient list") + return result + + +def pivot(net, edit): + drop, lead = edit["remove"], edit["pivot"] + combination = coefficients(edit["combination"]) + sender = coefficients(edit["sender"]) + side = coefficients(edit["receiver"]) + need(lead in combination and drop in net.moves and lead in net.moves, "pivot slots") + _, middle = net.moves[drop] + old, destination = net.moves[lead] + uses = {m: row[drop] for m, row in net.forms.items() if drop in row} + need(old == middle and combination.keys() <= uses.keys(), "pivot combination") + need(all(net.moves.get(m) == (middle, destination) for m in uses), "shared destination") + aggregate = {} + for m, weight in combination.items(): + add_scaled(aggregate, net.forms[m], weight) + response = aggregate.get(drop, 0) + need(response, "zero pivot response") + + forms = net.forms.copy() + del forms[drop] + forms[lead] = sender + for m, weight in uses.items(): + if m != lead: + residual = net.forms[m].copy() + add_scaled(residual, aggregate, -Fraction(weight, response)) + need(drop not in residual, "uncancelled transfer") + forms[m] = residual + + combined = {lead: 1} + add_scaled(combined, side, -1) + recovered = {} + for m, weight in uses.items(): + if m == lead: + row = {k: -v / combination[lead] for k, v in combination.items() if k != lead} + else: + row = {m: 1} + add_scaled(row, combined, Fraction(weight, response)) + recovered[m] = row + for k, row in list(forms.items()): + affected = row.keys() & recovered.keys() + if affected: + new = {i: v for i, v in row.items() if i not in affected} + for i in affected: + add_scaled(new, recovered[i], row[i]) + forms[k] = new + moves = net.moves.copy() + del moves[drop] + moves[lead] = (edit["source_chart"], destination) + return Network(net.first_output, net.initial, net.final, moves, forms) + + +def networks(word): + parent = fold(word) + net = parent + receipts = [] + for edit in read(HERE / "PIVOTS.json"): + direction = edit["direction"] + need(direction in ("forward", "transpose"), "pivot direction") + if direction == "transpose": + net = net.transpose() + before = len(net.moves) + net = pivot(net, edit) + if direction == "transpose": + net = net.transpose() + net.schedule() + need(len(net.moves) == before - 1, "paid slot count") + receipts.append([direction, edit["remove"], edit["pivot"], len(net.moves)]) + return parent, net, receipts diff --git a/research/cf6a-banked-role1256-relay/engines/caller/reference_caller.py b/research/cf6a-banked-role1256-relay/engines/caller/reference_caller.py new file mode 100644 index 0000000000..945c27d8c4 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/engines/caller/reference_caller.py @@ -0,0 +1,129 @@ +"""Replay the signed caller over the Gaussian group ring and price its actual entries.""" +from collections import Counter +from fractions import Fraction +from functools import cache +from pathlib import Path +import sys + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from network import main_roles, need, rational + + +def divided(value, denominator): + quotient, remainder = divmod(value, denominator) + need(remainder == 0, "caller grid remainder") + return quotient + + +def caller_replay(caller, word): + stages = caller["stages"] + cs = 2025 + height = 9 + unit = cs << height + zero = (0,) * stages + rows = [{(r, 0, zero): (unit, 0)} for r in range(caller["roles"])] + peak = unit + checks = 0 + paid = Counter() + targets = Counter() + uses = Counter() + stages_seen = [] + types = caller["types"] + need(types["A"]["ports"] == word["hosted"]["Dports"] and sorted(types["A"]["ports"] + types["B"]["ports"]) == list(range(len(word["ports"]))), "port allocation") + need(9 + 8 * stages == caller["ambient_rank"] <= 153, "caller geometry") + role_sets = {name: set(range(ty["offset"], ty["offset"] + ty["roles"])) for name, ty in types.items()} + need(role_sets["A"].isdisjoint(role_sets["B"]) and role_sets["A"] | role_sets["B"] == set(range(len(rows))), "type owners") + + @cache + def shifted(exponents, shift): + exponents = list(exponents) + for k in shift: + exponents[k - 1] += 1 + return tuple(exponents) + + def term(row, ar=1, ai=0, denominator=1, phase=0, shift=()): + nonlocal peak, checks + out = {} + for (r, q, powers), (x, y) in row.items(): + u, v = ar * x - ai * y, ar * y + ai * x + if denominator != 1: + u, v = divided(u, denominator), divided(v, denominator) + checks += 1 + out[r, (q + phase) % 4, shifted(powers, shift) if shift else powers] = (u, v) + peak = max(peak, sum(abs(x) + abs(y) for x, y in out.values())) + return out + + def plus(a, b): + nonlocal peak + out = a.copy() + for k, (u, v) in b.items(): + x, y = out.get(k, (0, 0)) + if x + u or y + v: + out[k] = (x + u, y + v) + else: + out.pop(k, None) + peak = max(peak, sum(abs(x) + abs(y) for x, y in out.values())) + return out + + for event in caller["events"]: + ty = event[0] + if ty == "J": + _, stage, (x, y, u, v), (a, b, alpha, beta) = event + need(stage == len(stages_seen) + 1 and alpha == "-1" and beta == "1/2" and types["A"]["alpha2"] == "-1", "joint coefficients") + need(len({x, y, u, v}) == 4 and {x, y, u, v} <= role_sets["A"] and a != b and {a, b} <= role_sets["B"], "joint owner alias") + stages_seen.append(stage) + rows[y] = plus(rows[y], term(rows[x], phase=-1)) + rows[u] = plus(rows[u], term(rows[v], -1, phase=1)) + r, s = rows[a], rows[b] + rows[a] = plus(r, term(s, -1, phase=1)) + rows[b] = plus(term(s, denominator=2), term(r, denominator=2, phase=-1)) + for role in (x, y, u, v, a, b): + rows[role] = term(rows[role], shift=(stage,)) + continue + _, op, r, *args = event + need(r in role_sets[ty], "local caller owner") + count = len(types[ty]["ports"]) + uses[op] += count + if op in ("ADD", "SWAP", "QUERY"): + need(args[0] in role_sets[ty] and args[0] != r, "caller donor") + if op == "SWAP": + s = args[0] + rows[r], rows[s] = rows[s], rows[r] + elif op == "QUERY": + s, q = args + need(q in (-1, 1), "query sign") + rows[r] = plus(rows[r], term(rows[s], phase=q)) + paid[1] += count + elif op in ("SCALE", "ADD"): + amount = rational(args[-1]) + if op == "SCALE": + rows[r] = term(rows[r], amount.numerator, denominator=amount.denominator) + else: + rows[r] = plus(rows[r], term(rows[args[0]], amount.numerator, denominator=amount.denominator)) + elif op == "LAMBDA": + sign = args[0] + need(sign in (-1, 1), "lambda sign") + original = rows[r] + rows[r] = plus(term(original, 1, sign, 2), term(original, 1, -sign, 2, phase=2)) + else: + need(op in ("IDLE_ONE", "IDLE_ODD"), "caller operation") + block = tuple(args[0]) + need(len(set(block)) == len(block) and all(1 <= k <= stages for k in block), "idle stages") + phase = args[1] if op == "IDLE_ODD" else 0 + need(op != "IDLE_ODD" or phase in (-1, 1), "idle sign") + rows[r] = term(rows[r], phase=phase, shift=block) + paid[8 * len(block) + phase % 2] += count + need(stages_seen == list(range(1, stages + 1)), "all native calls") + for ty in types.values(): + for offset, (phase, coefficient_phase, *powers) in enumerate(ty["diagonal"]): + r = ty["offset"] + offset + need(coefficient_phase == 0 and len(powers) == stages and set(powers) <= {0, 1}, "positive root boundary") + need(rows[r] == {(r, phase % 4, tuple(powers)): (unit, 0)}, "complete signed caller endpoint") + rank = 8 * sum(powers) + phase % 2 + need(rank > 0 and any(powers), "empty root credit") + targets[rank] += len(ty["ports"]) + return dict(paid=dict(paid), targets=dict(targets), uses=dict(uses), calls=stages, + dyadic_height=height, odd_scale=cs, peak_scaled_mass=str(Fraction(peak, 2**height)), + exact_preproduct_divisions=checks, root_owners=sum(targets.values()), + fresh_helpers=stages * (word["public"] - len(main_roles(word)))) diff --git a/research/cf6a-banked-role1256-relay/engines/caller/selected-bit-ambient.json b/research/cf6a-banked-role1256-relay/engines/caller/selected-bit-ambient.json new file mode 100644 index 0000000000..cd19f356a5 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/engines/caller/selected-bit-ambient.json @@ -0,0 +1,98 @@ +{ + "name": "bit-ambient", + "command": [ + "/usr/local/bin/python3.12", + "-I", + "-B", + "docs/research/pr-intake-evidence/pr7000-admission/check_bit_ambient.py" + ], + "base": "17469fff78c22941280f04d39dc5a1faee09c840", + "started_at": "2026-11-10T13:34:04.485882+00:00", + "exit_code": 0, + "wall_seconds": 0.26789799984544516, + "peak_sampled_descendant_kib": 1600, + "stop": null, + "limits": { + "seconds": 30, + "descendant_kib": 1048576, + "sampling_seconds": 0.2, + "serial": true + }, + "python": "3.12.8 (v3.12.8:2dc476bcb91, Dec 3 2024, 14:43:19) [Clang 13.0.0 (clang-1300.0.29.30)]", + "platform": "macOS-26.6.2-arm64-arm-64bit", + "source_sha256": { + "research/shared-wire-split-composition/native-accounting.json": "ec4f2657a6c172a16c68e958e865ef7bf5217a47814fb506e6e144d19daeaebc", + "research/shared-wire-split-composition/INDEPENDENT-NOTICE.md": "cadbc642ca84311d2c7a6cf704c7828cb4cf77e3c784b66e4c6e8a5c28002fb8", + "research/shared-wire-split-composition/INDEPENDENT-SOURCES.json": "dced1457df5230466ba6202fd6d4595bc2b7fb2a65302806bf2720b1837ff350", + "research/shared-wire-split-composition/SOURCES.json": "c66f8049a4e4bf9890d5f7d9f386de2c4897490f8f5e48edcc69a54b9333d103", + "research/shared-wire-split-composition/NATIVE-INPUTS.json": "9bb6c1567783661334d6c1d23f715ce5635cbbb513678819ab9e020a34c7e4c0", + "research/shared-wire-split-composition/VERIFY.json": "f27f759db9707cf5e8e4a331ca509401186c994ed661a9f4b480961642d5544f", + "research/shared-wire-split-composition/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "research/shared-wire-split-composition/INDEPENDENT-REVIEW.md": "c24c7ee899c258420e281afe4e6dfcd890adf552b469822a38c13898bcd2a936", + "research/shared-wire-split-composition/compose.py": "f057d659243575529cfd89a5534c8f333d0716897ee495bfe3de67eeb0970c20", + "research/shared-wire-split-composition/interval_gate.py": "60a743d13f668ef86db4b8215b4d5d04430a671ba6f1fe06d9c1c4c3dfe86da5", + "research/shared-wire-split-composition/reproduce.py": "9b9fca18bf28c627ff29ba06048503af0cb5f27a4ffabeadffed50e0678c96c9", + "research/shared-wire-split-composition/FULL-RESULT.json": "d9ba709fa5dcefffe3f3abdcf34600ce188224703cfd743e6db8b58ba4816cb7", + "research/shared-wire-split-composition/TASK.json": "60e22522e87684c068f32c8ec687305f2be934f2800e2f10a55483bff02506a1", + "research/shared-wire-split-composition/VALIDATION.md": "582d71db76db5ac7bcfb2f9a962479d1a76d321c7536f08347f16fe01ec9d52e", + "research/shared-wire-split-composition/chart_delta.json": "881bc1bb93e1738aa9269f41af6db0ef80b377920aed6f91e79b9b6ed70e5deb", + "research/shared-wire-split-composition/independent.py": "21f46a8340331abb1486b50bd4e04453f1968b0a5950d86ff7780dd368590874", + "research/shared-wire-split-composition/NOTICE": "da12736e2e824167ff56f2ecb623a5f88f75a270410360890f61dffc33bab249", + "research/shared-wire-split-composition/chart_delta.py": "865f1e526663cb6e53092db66b5fdabae5ed37a0afe7520bdbe1bb21d0266d38", + "research/shared-wire-split-composition/README.md": "f8d540c9f505d5856416897c231bcb9186f873f6148b68b9f23fedac70313831", + "research/shared-wire-split-composition/split_build.py": "54f80d3c557175acfc2cf13059f00f004be3f18fb6c76946e05efe8ca8b5f33a", + "research/shared-wire-split-composition/independent_construction.py": "1e8d66885afce4181ff6195c31aa3445886410b13faf1c8c7321f3ae7fc9554e", + "research/shared-wire-split-composition/precision_replay.py": "850d9098c5946ab27ef5228acc54d59df2196e72259d3e21588ec0c319c8f5ee", + "research/shared-wire-split-composition/VERIFY-INDEPENDENT.json": "820992b885fffaee53854be2c0200b7d4bf96ec678c305b1eff3e6be1364b3e3", + "research/shared-wire-split-composition/CONSTRUCTION-REVIEW.md": "038392a7c5f1705b1978bcc35f9dc889d4ccd457a1f32c384a500c81259e978b", + "research/shared-wire-split-composition/build_wire.py": "b0e1f38dd70f7c1a6f4d9ec8289c76747f558dc8e1ba44b22dd58ff82870e6bd", + "research/shared-wire-split-composition/full_verify.py": "08134736288c3a1067d61185f195c645aa2624051b45c808b2447360d2d20ae0", + "research/shared-wire-split-composition/verify.py": "d2a291f8f4ea6dce51648ba44614d655b47e8e38d235458ac64924af7552b57b", + "research/shared-wire-split-composition/CONSTRUCTION.md": "40249ccc0854393aa3a6ff14845879407ebeb0bc365f14c49ab155489addb436", + "research/shared-wire-split-composition/frozen/verify_host3_odd.py": "e75ad2096ba2587d1dc9c8982b2c2eb7c6fd2636a80adcd943314ef2cf6fd258", + "research/shared-wire-split-composition/frozen/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "research/shared-wire-split-composition/frozen/physical.py": "4e995d1158033d83bf69b671f23dc7924d66edbbe07623ba063ba7421234ea20", + "research/shared-wire-split-composition/frozen/native_verify.py": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38", + "research/shared-wire-split-composition/data/caller.json": "3828d53e80ea97e8b866320f081af20b6b93bfebd58b95b56b85a7afe151af5e", + "research/shared-wire-split-composition/data/split759.proof.json": "35f8b64110957b6f51fd8dd0e53326c466e2ffeecf9254012f0e55a5275bea81", + "research/shared-wire-split-composition/data/bit-admission.json": "a46b6c6040f75184cab5467656811ad988c216e3bc8e44d595a5015b6e49620b", + "research/shared-wire-split-composition/data/split759_450.proof.json": "78b25749911131b50bb4565b17a06d08ccf4b511ec05e598e7f146c96aed4174", + "research/shared-wire-split-composition/data/wh_6937.json.gz": "25326dac562fa07edd28a6daf302de0c27f5f2e82f610eaf3671d39575f8dbea", + "research/shared-wire-split-composition/data/final.json.gz": "2b94953dc14a122e3ef089633f05b58ec689ec5156feb7c784ed3e137dc01883", + "research/shared-wire-split-composition/data/extra_wire_spec.json": "b065bd6c3b0762bc90f5cd0a0c1fb6b9664edefc5a1becbff6734a72ab7698d8", + "research/shared-wire-split-composition/data/main_6936.json.gz": "273e81f176f001684b1fa3eb857992bf58b54748004fcfe806b83adb48d2cc00", + "research/shared-wire-split-composition/retained/query-only-precision-envelope/envelopes.py": "783da6b5b450fc07434946cb9ec86070dfee01df6b5fa1c385cb024def2c9a9f", + "research/shared-wire-split-composition/retained/query-only-precision-envelope/source_binding.py": "624c459311c58f3847b7713b818bfd340153abf42919f02ac9aa8892ed52a2bd", + "research/shared-wire-split-composition/retained/odd-native-common-grid/independent_bounds.py": "198521def614fe78fa728f1dde2b7fb820c0c0e0ac3ad0c9224dccbf51eac0d5", + "research/paired-query-only-bit/SOURCES.json": "1037b0a2d0d60d998630d0d6faf80bc8f2d4351ba1a50dcdfa9f7e86e44019fd", + "research/paired-query-only-bit/PROOF.md": "3c32eb61bec108aceee3d2d676c2c115391f5d0f9845ac209214bb58ef4ebee4", + "research/paired-query-only-bit/INDEPENDENT-REVIEW.json": "e44a7204dcac835817e89be12fc0fb33d981c99ed6ebc3e33b48e49d2fdaeeb3", + "research/paired-query-only-bit/VERIFY.json": "774280bdef625e08e3f854a0f886f65b4283db17fcb397efe7556f97082cbaad", + "research/paired-query-only-bit/check.py": "460ed9a77d66264b00c31d0a7f8dab1db9aab21ec4cc0eaf0452bd4be4ef585e", + "research/paired-query-only-bit/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "research/paired-query-only-bit/EFREE-CALLER.json.gz": "757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b", + "research/paired-query-only-bit/EFREE-RESULT.json": "a46b6c6040f75184cab5467656811ad988c216e3bc8e44d595a5015b6e49620b", + "research/paired-query-only-bit/TASK.json": "4c76a0988a076598a22473b2849f062116e09613939a4a4fb672e5792c5c7906", + "research/paired-query-only-bit/VALIDATION.md": "1cc6f940cf4ce1cc6c54c9d07fd2574c1bdbb543097eede31ad78836b1918903", + "research/paired-query-only-bit/NOTICE": "8c73eaf46327f01b4cfc18640b5e5f552648fc5e4427cbccd42af5e7ecd3b732", + "research/paired-query-only-bit/README.md": "cfdb5e13f1b7571a76f6d645eb3bcc703e545e55a34a6fdc08a8e6f96ba1a9a8", + "research/paired-query-only-bit/INPUT-PINS.json": "84007e990d41cf4aac3cd9c1a08984b895fff20acdefc99d464262ec2ad694d4", + "research/paired-query-only-bit/independent/bit_review.py": "6db4b1657bac033ed526fb714b4830b51ae2260d2ce11c3ef0b9e907cadd47db", + "research/paired-query-only-bit/independent/interval_gate.py": "8dc2bc4c64cba3f83c664373984a075f1a14b4d53958084091345c8cab189dec", + "research/paired-query-only-bit/data/selected_review.md": "8bd158b8ef68202000f167b9b78db0b31531b5b067b5cbd91b5bf35f3ddd1ab6", + "research/paired-query-only-bit/data/selected_record.json": "9b8d0eea95b3bf0dfcb7938a732a6439b87a2685dec2a5ab9e525b3b34debbfa", + "research/paired-query-only-bit/data/selected_claim.json": "9cee8a1304fa893be3d3b641eda42fdd9b2fd6a5ac2124fb891de7a1a5e8d92e", + "research/paired-query-only-bit/data/query_only_6980.json": "3828d53e80ea97e8b866320f081af20b6b93bfebd58b95b56b85a7afe151af5e", + "research/paired-query-only-bit/data/6980_PROOF.md": "0cede285a98dd61b78020651202729c6d9cd16fb078ee5fe9a01aa2400df5432", + "research/paired-query-only-bit/data/6834_result.json": "5c3dd8b954de767e41ec7b3d51895ed8c28968d39cb6af57a84c01683f5780ae", + "research/paired-query-only-bit/retained/audit_binary_mixed.py": "bb6616dbf536acf10163b8fff65ebfa69d01dfdeda3c0ead388c03377361b298", + "research/paired-query-only-bit/retained/NOTICE": "620e4ec6f537fa1c071f019ac92fa0e4eec8ab487c811e84153292b981de0424", + "research/paired-query-only-bit/retained/inputs/independent_interval.py": "9293f567aa4afd9b4e618f1cddd3cf66eea51c5e194e3c578e7a8f4db6e04a57", + "research/paired-query-only-bit/retained/inputs/BIT-NATIVE-WORD.json.gz": "51203e7fc75ba10bd3ac3f8e675759f47e13d262bea66b6600d1e515095cad78", + "research/paired-query-only-bit/retained/inputs/credited_trim.py": "fcff17fdd3108be68761fbde0fcbfe218be166cf518c99f7163e60d53ab785d9", + "research/paired-query-only-bit/retained/inputs/inputs/exact_arithmetic.py": "0ce7e7137422d5ffeda22085c81fa88471bbe963100fdad62e659f1e3bf89326" + }, + "source_unchanged": true, + "log": "bit-ambient.log", + "log_sha256": "90e8b8bba405ec40d89c6f522cceb48fe873e51527f39a88d0c61b4f1990f98e" +} diff --git a/research/cf6a-banked-role1256-relay/engines/caller/selected-claim.json b/research/cf6a-banked-role1256-relay/engines/caller/selected-claim.json new file mode 100644 index 0000000000..c9b816f844 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/engines/caller/selected-claim.json @@ -0,0 +1,65 @@ +{ + "schema": "proposed-conditional-integer-multiplication-claim/1", + "kappa": "363005817/100000000000", + "source_result": "research/shared-wire-split-composition/FULL-RESULT.json", + "uniform_templates": [ + { + "family": "complex", + "rank_encoding": "2^14174600000000000000", + "saving": "181502908503/50000000000000", + "ambient": 153 + }, + { + "family": "BIT before cover", + "rank_encoding": "2^296630000000000", + "saving": "38525299/10000000000", + "ambient": 134 + } + ], + "covered_BIT_saving": "19262649/5000000000", + "ordinary_BIT_saving": "4815653101/1250000000000", + "admitted_BIT_saving": "12039/3125000", + "complex_BIT_premise": "376669/100000000", + "BIT_bootstrap": [ + "17/5000", + "38507/10000000", + "12039/3125000" + ], + "nine_outer_savings": { + "main_transform": "36300581700299636994182997/10000000000000000000000000000", + "global_coordinate_router": "90751454251/25000000000000", + "fused_gaussian": "36300581700398910982548991/10000000000000000000000000000", + "group_bit_router": "9075145425124727745637247/2500000000000000000000000000", + "group_scans": "49999999999999/50000000000000", + "boundary_algebraic_matrix": "36300581700399636994182997/10000000000000000000000000000", + "sparse_union_movement": "4098800581700399636994182997/10000000000000000000000000000", + "polynomial_products": "99999999999999/100000000000000", + "microbox_face_corrections": "1925000000000001/25000000000000" + }, + "outer_formula_source": "research/shared-wire-split-composition/interval_gate.py", + "limiting_outer_saving": "36300581700299636994182997/10000000000000000000000000000", + "strict_limiting_slack": "299636994182997/10000000000000000000000000000", + "assumptions": [ + { + "id": "native_all_columns", + "statement": "Retained native operators, phase conventions, spectators and whole-job adapters work at every positive column multiplicity." + }, + { + "id": "owned_erasure", + "statement": "Owned streams and suspended centers obey the retained allocation, erasure and ownership contracts." + }, + { + "id": "compiler", + "statement": "The finite mixed-target compiler and chronological product, completion and splitting satisfy the retained uniform closure contract." + }, + { + "id": "precision_tape", + "statement": "Retained fixed-tape movement and precision/storage prescriptions apply to the new fixed finite template." + }, + { + "id": "analytic_recovery", + "statement": "Analytic decomposition, fine-prime avoidance and exact integer recovery follow the retained upstream/outer framework." + } + ], + "scope": "Conditional shared-native mixed caller with exact common-grid scalar service; five inherited assumptions. No materialized uniform word, complete multiplier, independent human proof or formal-kernel acceptance." +} diff --git a/research/cf6a-banked-role1256-relay/engines/caller/selected-validation.json b/research/cf6a-banked-role1256-relay/engines/caller/selected-validation.json new file mode 100644 index 0000000000..7291ce5ab9 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/engines/caller/selected-validation.json @@ -0,0 +1,223 @@ +{ + "schema_version": 1, + "status": "admitted_conditional", + "base": "f16923d466a6aba912299882e0545564d2ba7bb2", + "source_heads": { + "7000": "93effe2a135bf57b9e484cb630d8dd057159aec9", + "7001": "d777f3a0aa2878bea0478918923dabcf86b9878b" + }, + "selected_frontier_changed": true, + "selected_kappa": "0.00363005817", + "previous_kappa": "0.003125804", + "registered_replays_complete": true, + "all_jobs_finished": true, + "receipts": [ + { + "name": "bit-primary", + "receipt": "docs/research/pr-intake-evidence/pr7000-admission/bit-primary.json", + "sha256": "2bd4ae504350b8189e5a25c8e55212666ad15e16e3d85a824691513f0f498b11", + "wall_seconds": 13.74172916682437, + "peak_sampled_descendant_kib": 32544, + "exit_code": 0 + }, + { + "name": "bit-independent", + "receipt": "docs/research/pr-intake-evidence/pr7000-admission/bit-independent.json", + "sha256": "16088896d2b49bb81d17b778f162e41aee988188d79e76bdffe967ac0e9d40ff", + "wall_seconds": 0.4980977922677994, + "peak_sampled_descendant_kib": 34128, + "exit_code": 0 + }, + { + "name": "complex-primary", + "receipt": "docs/research/pr-intake-evidence/pr7000-admission/complex-primary.json", + "sha256": "fab9a2ead4a6212f3bc262a8da1019a623c420af02a38edb63807516b5cee8bf", + "wall_seconds": 99.33472337480634, + "peak_sampled_descendant_kib": 241472, + "exit_code": 0 + }, + { + "name": "complex-independent", + "receipt": "docs/research/pr-intake-evidence/pr7000-admission/complex-independent.json", + "sha256": "cbecd914e3a231b915ab4826a0046c0118fe1c800f2cca5a5c1e9586aa87d7e7", + "wall_seconds": 84.73606283264235, + "peak_sampled_descendant_kib": 110064, + "exit_code": 0 + }, + { + "name": "complex-physical", + "receipt": "docs/research/pr-intake-evidence/pr7000-admission/complex-physical.json", + "sha256": "fab7f7e00d40a09508a5bee285dc8fb33f06c92f48ed86e1f99affc35207627c", + "wall_seconds": 80.88798883417621, + "peak_sampled_descendant_kib": 699600, + "exit_code": 0 + }, + { + "name": "owned-factorizations", + "receipt": "docs/research/pr-intake-evidence/pr7000-admission/owned-factorizations.json", + "sha256": "938d1791dc320d7fa0bdb44ef318641960798823cd66c4074a037bb9c7682bd9", + "wall_seconds": 22.427095042075962, + "peak_sampled_descendant_kib": 102480, + "exit_code": 0 + }, + { + "name": "lambda-algebra", + "receipt": "docs/research/pr-intake-evidence/pr7000-admission/lambda-algebra.json", + "sha256": "bc871b73eaf56318c8be84b117c6f8e7eed8db4e0f9d0ab729eeb5d425a4a1d7", + "wall_seconds": 0.5506485840305686, + "peak_sampled_descendant_kib": 17728, + "exit_code": 0 + }, + { + "name": "bit-ambient", + "receipt": "docs/research/pr-intake-evidence/pr7000-admission/bit-ambient.json", + "sha256": "437ad2f9e7956e7f2b477b546f53a6c8cfa0567e207024300e9a7e58d3c0202c", + "wall_seconds": 0.26789799984544516, + "peak_sampled_descendant_kib": 1600, + "exit_code": 0 + }, + { + "name": "bit-ambient-optimized", + "receipt": "docs/research/pr-intake-evidence/pr7000-admission/bit-ambient-optimized.json", + "sha256": "977abde2a364af1a0153033f759cc2d90ea79b6f266bcdbb0830c52d22976ded", + "wall_seconds": 0.26918487483635545, + "peak_sampled_descendant_kib": 2272, + "exit_code": 0 + }, + { + "name": "interface-bindings", + "receipt": "docs/research/pr-intake-evidence/pr7000-admission/interface-bindings.json", + "sha256": "e3313b43b32169fba878600b43a722c51cce770f685f151433a7addeff25c3d3", + "wall_seconds": 0.28022624971345067, + "peak_sampled_descendant_kib": 1920, + "exit_code": 0 + }, + { + "name": "interface-bindings-optimized", + "receipt": "docs/research/pr-intake-evidence/pr7000-admission/interface-bindings-optimized.json", + "sha256": "030311e1fcdf372c059545a8c355cf09b4931fda34b7759333406f14d837b2bd", + "wall_seconds": 0.28489804081618786, + "peak_sampled_descendant_kib": 4832, + "exit_code": 0 + }, + { + "name": "application", + "receipt": "docs/research/pr-intake-evidence/pr7000-application/application.json", + "sha256": "b6ca671c7101674a40a2c30fdea0ec95f08f9b61bbc9a0926d38da9a6942e14b", + "wall_seconds": 49.84868695773184, + "peak_sampled_descendant_kib": 105232, + "exit_code": 0 + }, + { + "name": "application-optimized", + "receipt": "docs/research/pr-intake-evidence/pr7000-application/application-optimized.json", + "sha256": "f8989171cd7561dccd1ce0db3a7cb119640b965d7f6212d21e9f2d7f16590365", + "wall_seconds": 38.167422249913216, + "peak_sampled_descendant_kib": 106320, + "exit_code": 0 + }, + { + "name": "scalar", + "receipt": "docs/research/pr-intake-evidence/pr7000-application/scalar.json", + "sha256": "d3eb6cf49dd74cc78ea85703236ec1e31a84b6c52e5a42311a65b7a19faeb669", + "wall_seconds": 10.96639662515372, + "peak_sampled_descendant_kib": 47040, + "exit_code": 0 + }, + { + "name": "scalar-optimized", + "receipt": "docs/research/pr-intake-evidence/pr7000-application/scalar-optimized.json", + "sha256": "13e86b7a72e98e8189c964969b43fb055291f5b2efa92fc7ca63e5bf6b8324bb", + "wall_seconds": 15.716162957716733, + "peak_sampled_descendant_kib": 45600, + "exit_code": 0 + }, + { + "name": "native-catalogue-0", + "receipt": "docs/research/pr-intake-evidence/pr7000-application/native-catalogue-0.json", + "sha256": "60911939b399975817334f2ab0e33e1b3d15ac937baab1bc82573f18c761766e", + "wall_seconds": 222.34261462511495, + "peak_sampled_descendant_kib": 58640, + "exit_code": 0 + }, + { + "name": "native-catalogue-1", + "receipt": "docs/research/pr-intake-evidence/pr7000-application/native-catalogue-1.json", + "sha256": "d7cb2b5ac7ebdfdde129877916bded5c5dfc386316b6395dbe58ebbefdd7c69d", + "wall_seconds": 249.59168437542394, + "peak_sampled_descendant_kib": 58624, + "exit_code": 0 + }, + { + "name": "native-catalogue-2", + "receipt": "docs/research/pr-intake-evidence/pr7000-application/native-catalogue-2.json", + "sha256": "2e1f8fd8e4504b2495d07488bf9831e913c706a3e94d1c4de3c1866c585cacaa", + "wall_seconds": 338.04289187537506, + "peak_sampled_descendant_kib": 59712, + "exit_code": 0 + } + ], + "historical_input_aliases": { + "cc723faaf0d182693f69d51ad8a5b3d483103e4a8d0e2ecbbcb5e1508e77404e": "docs/research/pr-intake-evidence/pr7000-application/orchestration-initial.txt", + "8b8067cfd88d785a74c68e8b8e519b3b90c2122298aa3c1b29cb51efea164b63": "docs/research/pr-intake-evidence/pr7000-application/orchestration-monolithic.txt" + }, + "nonexecuted_inventory_changes": { + "scalar": { + "docs/research/pr-intake-evidence/pr7000-application/check_application.py": "c44411369b8bfa66ed2865b0be15ccb45b7410d0a34d2fa24b6fe0fc6a08b17d" + }, + "scalar-optimized": { + "docs/research/pr-intake-evidence/pr7000-application/check_application.py": "c44411369b8bfa66ed2865b0be15ccb45b7410d0a34d2fa24b6fe0fc6a08b17d" + } + }, + "nonexecuted_inventory_changes_reason": "The scalar harness inventoried check_application.py but did not execute or import it. Later changes added application controls; both application modes then passed at its current hash. Both exact scalar executions used the unchanged current scalar checker. Orchestration snapshots retain the earlier harness bytes.", + "prior_review_checker_sha256": { + "check_bit_ambient.py": "e8dabd0285c2ea84472a588a0f6f56e0a7865535ba5f0109db56b08cb7e79886", + "check_interface_bindings.py": "24f5a3c1660b2490981c3af2bd00791c95a0eae373b20db08854d61362c5e08f" + }, + "failed_attempt": { + "receipt": "docs/research/pr-intake-evidence/pr7000-application/native-catalogue.json", + "sha256": "aed71658d6b85b37c44bfb961c9f56c7d72e625b9d5fcc8b492b75d17ce4aa6c", + "original_checker": "docs/research/pr-intake-evidence/pr7000-application/native-catalogue-monolithic.txt", + "scope": "600-second monolithic timeout; no successful coverage reused. Disjoint bounded parts replace it." + }, + "coverage": [ + "All five registered candidate/BIT checks reused at unchanged scientific input hashes.", + "Current complete native catalogue: 3057 maps, 104 main boundary pairs, exact signed Pauli action and absolute Gaussian phase.", + "All 14400 complex native contacts and current paid-owner lists; all 636 BIT frames and 111 main charts.", + "Exact fixed-rational scalar reference normal/optimized; common-grid and fixed-tape scan application supplied in the review.", + "Current root/complete-spectator layouts, owned lifetimes, full cost units and fresh thresholds applied under the same five assumptions." + ], + "remaining": [], + "retained_assumptions": [ + { + "id": "native_all_columns", + "statement": "Retained native operators, phase conventions, spectators and whole-job adapters work at every positive column multiplicity." + }, + { + "id": "owned_erasure", + "statement": "Owned streams and suspended centers obey the retained allocation, erasure and ownership contracts." + }, + { + "id": "compiler", + "statement": "The finite mixed-target compiler and chronological product, completion and splitting satisfy the retained uniform closure contract." + }, + { + "id": "precision_tape", + "statement": "Retained fixed-tape movement and precision/storage prescriptions apply to the new fixed finite template." + }, + { + "id": "analytic_recovery", + "statement": "Analytic decomposition, fine-prime avoidance and exact integer recovery follow the retained upstream/outer framework." + } + ], + "reuse_invalidation": "Any changed executed checker, source data, imported engine, occurrence recipe or application premise invalidates its affected coverage. Orchestration-only historical aliases and the scalar job's nonexecuted application checker are explicit. The previous selected record is preserved byte-for-byte as frontier6030.json.", + "scope": "Maintainer conditional application admission; finite checks and a written specialization, not a complete multiplier, independent human proof or formal-kernel acceptance.", + "review_files_sha256": { + "PROOF-REVIEW.md": "4501502c2ceb9759b20372435fe4beb51082c5a5e2910c1fd5dbe6edca415055", + "SOURCES.json": "8fa7eb44bcc8c7d442848b9f51e9b5e26413a433ebc382f302c350981871265c", + "check_application.py": "d98987db98553dc55bfc80e3ca47abfcd51c57af6f8cda61101391d8eae94184", + "check_exact_scalar.py": "f83e506617a92027b3ff82f28bc043e34e890951eb7f3bd930e08c6c02a04a9d", + "check_native_catalogue.py": "6120e1ea1e07eeba757694d209437a38f121b0a377cc466889a30fa52c561472", + "replay_bounded.py": "ed8324a1f126d3282e312ecc252e4f4847ec50aed9e8b70d00b98d4b9ab96a16" + } +} diff --git a/research/cf6a-banked-role1256-relay/engines/caller/upstream_application.py b/research/cf6a-banked-role1256-relay/engines/caller/upstream_application.py new file mode 100644 index 0000000000..1a6d358cbe --- /dev/null +++ b/research/cf6a-banked-role1256-relay/engines/caller/upstream_application.py @@ -0,0 +1,369 @@ +#!/usr/bin/env python3 +"""Exact-source caller geometry, occurrence allocation and rational BIT frames. + +No contributor scientific module is imported. Complex phase-polynomial +method credited to the retained fragment physical audit; here coefficients +of the full degree-two polynomial are constructed instead of probing it. +OpenAI Codex assistance for Douglas Colkitt. Apache-2.0. +""" +from collections import Counter +from copy import deepcopy +from fractions import Fraction as Q +from hashlib import sha256 +from pathlib import Path +import gzip +import json + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[3] + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def read(path): + raw = (ROOT / path).read_bytes() + pin = next(p for p in json.loads((HERE / 'SOURCES.json').read_text())['files'] + if p['path'] == path) + need(sha256(raw).hexdigest() == pin['sha256'], 'source bytes: ' + path) + return json.loads(gzip.decompress(raw) if path.endswith('.gz') else raw) + + +def digest(value): + return sha256(json.dumps(value, sort_keys=True, separators=(',', ':')).encode()).hexdigest() + + +def bits(n): + result = [] + while n: + a = n & -n + result.append(a) + n ^= a + return result + + +def dot(a, b): + return (a & b).bit_count() % 2 + + +def terms(items): + c = Counter() + for v, a in items: + c[v] += a + return {v: a % 4 for v, a in c.items() if v and a % 4} + + +def sub(a, b): + return terms(list(a.items()) + [(v, -c) for v, c in b.items()]) + + +def polynomial(t): + # parity(sum x_i) = sum x_i - 2 sum_{i 0, 'positive complete helper job') + T[rank] += 1 + need(len(mapping) == len(set(mapping.values())) == word['public'], 'injective native inputs') + for r in range(word['public'], word['public']+word['owned_fields']): + mapping[r] = ('owned', ci, r-word['public']) + need(len(set(mapping.values())) == word['public']+51, 'owned/public separation') + for ni, move in native_moves: + _, r, start, end, owned = move + rank = abs(len(word['frames'][end])-len(word['frames'][start])) + need(owned == (r >= word['public']) and rank > 0, 'actual paid owner class') + P[rank] += 1 + occurrences.append([ci, ni, list(mapping[r]), rank, start, end]) + for pi, q in enumerate(word['ports']): + transform = route(q, by_q[q], stage) + before_axes = [1 << j for j in range(9+8*(stage-1))] + after_axes = [1 << j for j in range(9+8*stage)] + spectator = [1 << j for j in range(9, 9+8*stage)] + x0 = terms((a, 1) for a in before_axes) + y0 = terms(list(x0.items())+[(q, -1)]) + x1 = terms((a, 1) for a in after_axes) + y1 = terms(list(x1.items())+[(q, -1)]) + nx0 = terms([(a, 1) for a in spectator]+[(q, 1)]) + ny0 = terms((a, 1) for a in spectator) + nx1 = terms((a, 1) for a in spectator+[1 << j for j in range(9)]) + ny1 = terms(list(nx1.items())+[(q, -1)]) + shifts = [boundary(a, b, transform) for a, b in + ((x0, nx0), (y0, ny0), (nx1, x1), (ny1, y1))] + body = terms((1 << j, 1) for j in range(9+8*(stage-1), 9+8*stage)) + for actual, expected in ((sub(x1,x0),body), (sub(y1,y0),body), + (sub(y1,x0),terms(list(body.items())+[(q,-1)])), + (sub(x1,y0),terms(list(body.items())+[(q,1)]))): + need(not polynomial(sub(actual,expected)), 'all four contact operators') + need(polynomial(sub(terms([(q,1)]),terms([(q,-1)]))), 'wrong query orientation rejected') + phase_records.append([ci,pi,shifts,2 if pi in second else 1]) + else: + ty, op, r, *a = e + kind = caller['types'][ty] + used = [r] + ([a[0]] if op in ('ADD','SWAP','QUERY') else []) + need(all(kind['offset'] <= x < kind['offset']+kind['roles'] for x in used), 'caller owners stay in type') + need(len(used) == len(set(used)), 'distinct scalar/query owners') + if op in ('QUERY','IDLE_ONE'): + if op == 'QUERY': + need(a[1] in (-1,1), 'signed completed query') + rank = 1; query_uses += len(kind['ports']) + else: + selected = a[0] + need(selected and len(selected)==len(set(selected)) + and all(1 <= s <= 18 for s in selected), 'whole idle stage axes') + rank = 8*len(selected); idle_uses += len(kind['ports']) + for pi in kind['ports']: + owner = ['query_scratch',ci,pi] if op == 'QUERY' else ['main',pi,r] + occurrences.append([ci,op,owner,rank]); P[rank] += 1 + elif op == 'LAMBDA': + need(a[0] in (-1,1), 'global normalizer sign') + lambda_uses += len(kind['ports']) + need(stage_order == list(range(1,19)), 'fresh chronological native stages') + for kind in caller['types'].values(): + for diagonal in kind['diagonal']: + qp, zero, *selection = diagonal + need(qp in (-1,0,1) and zero == 0 and len(selection)==18 + and set(selection)<={0,1} and any(selection), 'positive nonempty root endpoint') + rank = abs(qp)+8*sum(selection) + for pi in kind['ports']: + q = word['ports'][pi] + axes = [1 << (9+8*j+k) for j,yes in enumerate(selection) if yes for k in range(8)] + actual = terms([(q,qp)]+[(a,1) for a in axes]) + target = terms((a,1) for a in ([q] if qp else [])+axes) + need(translation(sub(target,actual)) == (q if qp == -1 else 0), 'whole output correction') + T[rank] += 1 + for name, actual in [('P',P),('T',T)]: + need(actual == Counter({int(k):v for k,v in receipt['invoice'][name].items()}), 'independent '+name+' invoice') + need(sum(T.values()) == len(owners), 'every productive target is one actual owner') + need(len(occurrences) == sum(P.values()), 'every paid position retained in order') + return dict(ambient=153, native_calls=18, native_public=1480, fresh_helpers=19440, + productive_fields=len(owners), paid_positions=len(occurrences), + complete_paid_position_digest=digest(occurrences), + native_contact_boundaries=sum(4*r[3] for r in phase_records), + phase_record_digest=digest(phase_records), nonzero_boundary_translations=sum(sum(bool(x) for x in r[2])*r[3] for r in phase_records), + reserved_native_banks=18*51, reserved_serial_query_lambda_bank=1, + query_uses=query_uses, idle_uses=idle_uses, lambda_uses=lambda_uses, + paid=dict(sorted(P.items())), targets=dict(sorted(T.items())), + rank_surplus=sum(r*T[r] for r in T)-sum(r*P[r] for r in P)) + + +def inverse(matrix): + n = len(matrix) + a = [[Q(x) for x in row]+[Q(i==j) for j in range(n)] for i,row in enumerate(matrix)] + det = Q(1) + for j in range(n): + pivot = next((i for i in range(j,n) if a[i][j]),None) + need(pivot is not None, 'rational basis invertible') + if pivot != j: + a[j],a[pivot] = a[pivot],a[j]; det = -det + v = a[j][j]; det *= v; a[j] = [x/v for x in a[j]] + for i in range(n): + if i != j: + v = a[i][j] + a[i] = [x-v*y for x,y in zip(a[i],a[j])] + return [row[n:] for row in a], det + + +def bit_application(word, caller, receipt): + ff = word['frames']; determinants=[]; denominator_witnesses=set() + for label, frame in ff.items(): + B,A = frame['B'],frame['A']; d = frame['dim'] + need(len(B)==d and len(A)==8-d and all(len(v)==8 for v in B+A), 'rational frame dimensions') + need(all(sum(Q(x)*Q(y) for x,y in zip(b,a))==0 for b in B for a in A), 'complement annihilation') + inv, det = inverse(list(zip(*(B+A)))) + determinants.append([label,str(det)]) + denominator_witnesses.add(abs(det.numerator)); denominator_witnesses.add(det.denominator) + for row in inv: + denominator_witnesses.update(x.denominator for x in row) + for row in B+A: + denominator_witnesses.update(Q(x).denominator for x in row) + charts=[] + for port in range(111): + head=ff[str(word['start'][port])]; body=ff[str(word['final'][port+111])] + need(head['dim']==1 and body['dim']==7, 'actual main head/body ranks') + u=head['B'][0] + need(all(sum(Q(x)*Q(y) for x,y in zip(u,v))==0 for v in body['B']), 'main complement') + inv,det=inverse(list(zip(*([u]+body['B'])))) + charts.append([port,str(det)]) + denominator_witnesses.update([abs(det.numerator),det.denominator]) + for row in inv:denominator_witnesses.update(x.denominator for x in row) + P,T=Counter(),Counter(); positions=[]; names={('main',pi,r) for pi in range(111) for r in range(38)} + calls=[] + for ci,e in enumerate(caller['events']): + op=e[0] + if op=='LOCAL': + _,stage,src,dst=e; calls.append(stage) + mapping={i:('main',i,src) for i in range(111)} + mapping.update({i+111:('main',i,dst) for i in range(111)}) + for r in range(222,word['public']): + owner=('helper',ci,r); need(owner not in names,'fresh BIT helper');names.add(owner);mapping[r]=owner + T[abs(ff[str(word['start'][r])]['dim']-ff[str(word['final'][r])]['dim'])]+=1 + need(len(mapping)==len(set(mapping.values()))==659,'injective BIT occurrence') + for r in range(659,659+word['owned_fields']):mapping[r]=('owned',ci,r-659) + for ni,move in enumerate(word['program']): + if move[0]=='MOVE': + _,r,a,b=move;rank=abs(ff[str(a)]['dim']-ff[str(b)]['dim']) + P[rank]+=1;positions.append([ci,ni,list(mapping[r]),rank,a,b]) + elif op=='QUERY': + need(e[1]!=e[2] and 0<=min(e[1:])<=max(e[1:])<38,'BIT query owners') + for pi in range(111):P[1]+=1;positions.append([ci,op,['query_scratch',ci,pi],1]) + elif op=='IDLE_ONE': + _,owner,ss=e;need(ss and len(ss)==len(set(ss)) and all(1<=s<=18 for s in ss),'BIT idle axes') + for pi in range(111):P[7*len(ss)]+=1;positions.append([ci,op,['main',pi,owner],7*len(ss)]) + need(calls==[s for s in range(1,19) for _ in range(2)],'paired native chronology') + for d in caller['diagonal']: + need(d['q']==1 and d['stages'] and len(d['stages'])==len(set(d['stages'])),'BIT positive endpoint') + T[1+7*len(d['stages'])]+=111 + need(P==Counter({int(k):v for k,v in receipt['paid'].items()}) and + T==Counter({int(k):v for k,v in receipt['targets'].items()}),'complete BIT invoice') + need(sum(T.values())==len(names)==19950,'BIT owner count') + return dict(ambient=134, rational_frames=len(ff), rational_main_charts=len(charts), + rational_determinants_digest=digest(determinants), + finite_prime_exclusion_witness_count=len(denominator_witnesses), + finite_prime_exclusion_witness_digest=digest(sorted(denominator_witnesses)), + native_calls=len(calls), fresh_helpers=36*437, productive_fields=len(names), + paid_positions=len(positions), complete_paid_position_digest=digest(positions), + reserved_native_banks=36*word['owned_fields'], reserved_serial_query_bank=1, + rank_surplus=sum(r*T[r] for r in T)-sum(r*P[r] for r in P)) + + +def main(): + p='research/shared-wire-split-composition/' + w,c,r=read(p+'data/final.json.gz'),read(p+'data/caller.json'),read(p+'FULL-RESULT.json') + phases=read('research/p104-two-chain-shared-native/retained/runtime/DATA-PHASES.json') + complex_result=complex_application(w,c,r,phases) + p='research/paired-query-only-bit/' + bw,bc,br=read(p+'retained/inputs/BIT-NATIVE-WORD.json.gz'),read(p+'EFREE-CALLER.json.gz'),read(p+'EFREE-RESULT.json') + bit_result=bit_application(bw,bc,br) + controls={} + def reject(name, action): + try:action() + except ValueError as error:controls[name]=str(error) + else:raise ValueError('negative control accepted: '+name) + alias=deepcopy(c);joint=next(e for e in alias['events'] if e[0]=='J');joint[2][2]=joint[2][0] + reject('same_frame_main_alias',lambda:complex_application(w,alias,r,phases)) + reordered=deepcopy(c);joint=next(e for e in reordered['events'] if e[0]=='J');joint[1]=2 + reject('wrong_stage',lambda:complex_application(w,reordered,r,phases)) + bad_bit=deepcopy(bw);bad_bit['frames']['0']['A'][1]=bad_bit['frames']['0']['A'][0][:] + reject('singular_BIT_spectator_basis',lambda:bit_application(bad_bit,bc,br)) + q=w['ports'][0];basis=next(x for x in phases['recipes'] if x['q']==q)['idle_children'][0]['orthogonal_axes'][:8] + reject('singular_complex_route',lambda:route(q,basis[:-1]+basis[:1],1)) + transform=route(q,basis,1) + before=terms((1<>i)&1)<>j&1);a[j],a[k]=a[k],a[j] + for i in range(n): + if i!=j and a[i]>>j&1:a[i]^=a[j] + assert [r&((1<>n for r in a) +def basis_extend(cols,n): + out=[] + for x in list(cols)+[1<len(out):out.append(x) + assert len(out)==n + return tuple(out) +def nullspace(rows,n): + a=list(rows);p=[];k=0 + for j in range(n): + t=next((i for i in range(k,len(a)) if a[i]>>j&1),None) + if t is None:continue + a[t],a[k]=a[k],a[t] + for i in range(len(a)): + if i!=k and a[i]>>j&1:a[i]^=a[k] + p.append(j);k+=1 + return tuple((1<>j)&1)<>i&1:out=pmul(out,T[i]) + for i in range(n): + if z>>i&1:out=pmul(out,T[n+i]) + return out +def compose(A,B):return tuple(apply(A,p) for p in B) +def inverse(T): + n=len(T)//2;cols=[x|(z<>n;u,v,p=apply(T,(x,z,0));assert (u,v)==identity(n)[j][:2];out.append((x,z,(-p)%4)) + return tuple(out) +def qvalue(Q,alpha,x,n): + return (sum(alpha[i] for i in range(n) if x>>i&1)+2*sum(parity((Q[i]>>(i+1))&(x>>(i+1))) for i in range(n) if x>>i&1))%4 +def mul_i(a,p): + x,y=a;p%=4 + return [(x,y),(-y,x),(-x,-y),(y,-x)][p] +@dataclass +class Op: + n:int + tab:tuple + circuit:list + def then(self,b): + assert self.n==b.n + return Op(self.n,compose(b.tab,self.tab),self.circuit+b.circuit) + def adjoint(self): + circ=[] + for e in reversed(self.circuit): + if e[0]=='P':circ.append(('P',inv(e[1],self.n))) + elif e[0]=='D':circ.append(('D',e[1],tuple((-x)%4 for x in e[2]))) + elif e[0]=='C':circ.append(('C',e[1],-e[2])) + elif e[0]=='phase':circ.append(('phase',(-e[1])%4)) + else:circ.append(e) + return Op(self.n,inverse(self.tab),circ) + def zero_state(self,basis=0): + N=1<>i)&1 for i in range(n)) + assert all(alpha[i]%2==(Q[i]>>i)&1 for i in range(n)) + return Op(n,tuple([(1<>i&1 else 0,1<>i&1 else 0) for i in range(n)]),[('C',q,sgn)]) +def xgate(n,b):return Op(n,tuple([(1<>i)&1)) for i in range(n)]),[('X',b)]) +def fourier(n,axes=None): + out=ident(n) + for i in range(n) if axes is None else axes:out=out.then(cgate(n,1<len(selected):picks.append(j);selected.append(x) + assert len(picks)==r and all(x>>r==0 for x in Bcols) + Br=transpose(selected,r);Bi=inv(Br,r);Dr=transpose([Dcols[j]&((1<> j) & 1) << i for i, row in enumerate(matrix)) for j in range(len(matrix))) + + +def inverse(matrix): + n = len(matrix) + rows = [row | (1 << (n+i)) for i, row in enumerate(matrix)] + for j in range(n): + pivot = next((i for i in range(j, n) if rows[i] >> j & 1), None) + require(pivot is not None, 'singular binary chart') + rows[j], rows[pivot] = rows[pivot], rows[j] + for i in range(n): + if i != j and rows[i] >> j & 1: + rows[i] ^= rows[j] + require([row & ((1 << n)-1) for row in rows] == [1 << i for i in range(n)], 'binary inverse') + return tuple(row >> n for row in rows) + + +def extend(vectors, n): + columns, pivots = [], {} + for value in tuple(vectors) + tuple(1 << i for i in range(n)): + reduced = value + while reduced: + j = reduced.bit_length()-1 + if j not in pivots: + pivots[j] = reduced + columns.append(value) + break + reduced ^= pivots[j] + require(len(columns) == n, 'frame basis extension') + return tuple(columns) + + +def adjoint(circuit): + out = [] + for gate in reversed(circuit): + if gate[0] == 'P': + out.append(('P', inverse(gate[1]))) + elif gate[0] == 'D': + out.append(('D', gate[1], tuple(-a % 4 for a in gate[2]))) + elif gate[0] == 'C': + out.append(('C', gate[1], -gate[2])) + elif gate[0] == 'phase': + out.append(('phase', -gate[1] % 4)) + else: + require(gate[0] == 'X', 'adjoint gate type') + out.append(gate) + return tuple(out) + + +def fourier(rank): + return tuple(('C', 1 << i, 1) for i in range(rank)) + + +def frame(vectors, n): + rank = len(vectors) + if rank == 0: + return () + if rank == n: + return fourier(n) + matrix = transpose(extend(vectors, n)) + columns = transpose(inverse(matrix)) + quadratic = tuple((1 << i) ^ sum(parity(a & b) << j for j, b in enumerate(columns)) for i, a in enumerate(columns)) + diagonal = tuple((row >> i) & 1 for i, row in enumerate(quadratic)) + chart = (('P', matrix), ('D', quadratic, diagonal)) + return adjoint(chart) + fourier(rank) + chart + + +def monomial(record): + matrix = tuple(record['matrix_rows']) + quadratic = tuple(record['quadratic_rows']) + linear = tuple(record['linear_Z4']) + require(transpose(quadratic) == quadratic, 'quadratic symmetry') + require(len(matrix) == len(quadratic) == len(linear) == 9, 'monomial dimension') + require(all(a % 2 == (quadratic[i] >> i) & 1 for i, a in enumerate(linear)), 'diagonal parity') + inverse(matrix) + return (('D', quadratic, linear), ('P', matrix), ('X', record['offset']), ('phase', record['phase'])) + + +def recipe(record): + rank = record['rank'] + require(isinstance(rank, int) and 0 <= rank <= 9, 'child rank') + if rank == 0: + require(record['right'] is None, 'rank zero right factor') + return monomial(record['left']) + return monomial(record['right']) + fourier(rank) + monomial(record['left']) + + +def tableau(circuit, n=9): + rows = [(1 << i, 0, 0) for i in range(n)] + [(0, 1 << i, 0) for i in range(n)] + for gate in circuit: + tag = gate[0] + out = [] + inverse_transpose = transpose(inverse(gate[1])) if tag == 'P' else None + for x, z, phase in rows: + if tag == 'P': + x, z = mul(gate[1], x), mul(inverse_transpose, z) + elif tag == 'X': + phase += 2 * parity(z & gate[1]) + elif tag == 'C': + if parity(z & gate[1]): + x ^= gate[1] + phase += 3 * gate[2] + elif tag == 'D': + quadratic, linear = gate[1:] + phase += sum(linear[i] for i in range(n) if x >> i & 1) + phase += 2 * sum(parity((quadratic[i] >> (i+1)) & (x >> (i+1))) for i in range(n) if x >> i & 1) + z ^= mul(quadratic, x) + else: + require(tag == 'phase', 'tableau gate type') + out.append((x, z, phase % 4)) + rows = out + return tuple(rows) + + +@lru_cache(maxsize=512) +def action(gate): + if gate[0] == 'P': + return tuple(mul(gate[1], x) for x in range(512)) + require(gate[0] == 'D', 'state action type') + quadratic, linear = gate[1:] + return tuple((sum(linear[i] for i in range(9) if x >> i & 1) + + 2 * sum(parity((quadratic[i] >> (i+1)) & (x >> (i+1))) for i in range(9) if x >> i & 1)) % 4 for x in range(512)) + + +def rotate(pair, power): + a, b = pair + return ((a, b), (-b, a), (-a, -b), (b, -a))[power % 4] + + +def state(circuit, basis=0): + value, denominator = {basis: (1, 0)}, 0 + for gate in circuit: + tag = gate[0] + result = {} + if tag == "C": + direction, sign = gate[1:] + for address, (a, b) in value.items(): + for target, pair in ((address, (a - sign*b, b + sign*a)), + (address ^ direction, (a + sign*b, b - sign*a))): + old = result.get(target, (0, 0)) + result[target] = (old[0] + pair[0], old[1] + pair[1]) + denominator += 1 + else: + for address, pair in value.items(): + if tag == "P": + target = mul(gate[1], address) + elif tag == "X": + target = address ^ gate[1] + else: + target = address + if tag == "D": + pair = rotate(pair, action(gate)[address]) + else: + require(tag == "phase", "Unknown Gaussian state gate") + pair = rotate(pair, gate[1]) + require(target not in result, "A monomial address map is not injective") + result[target] = pair + value = {address: pair for address, pair in result.items() if pair != (0, 0)} + while denominator and all((a | b) % 2 == 0 for a, b in value.values()): + denominator -= 1 + value = {address: (a//2, b//2) for address, (a, b) in value.items()} + return value, denominator + + +def equal(actual, expected, label): + require(tableau(actual) == tableau(expected), label + ": signed Pauli action") + require(state(actual) == state(expected), label + ": exact global phase") + + +def verify(data, certificate): + word = data["word"] + original, clean = data["programs"], data["clean_programs"] + source_recipes = data["recipes"] + residuals = data["residuals"]["recipes"] + native_tags = {"climb", "adapter", "residual_adapter"} + for orientation in ("forward", "backward"): + native = [event for event in clean[orientation] if event[0] in native_tags] + require(native == [event for event in original[orientation] if event[0] in native_tags], + "A retained native event changed") + require(len(native) == 5056, "The retained native event count changed") + frames = [frame(tuple(vectors), 9) for vectors in word["frames"]] + used = {(event[3], event[4]) for program in clean.values() + for event in program if event[0] == "climb"} + children = {(record["old"], record["new"]): record for record in source_recipes["children"]} + require(len(children) == len(source_recipes["children"]) and used <= set(children), + "The retained child recipe coverage is incomplete") + for old, new in sorted(used): + record = children[old, new] + require(record["rank"] == len(word["frames"][new]) - len(word["frames"][old]), + "A retained child has the wrong rank") + equal(recipe(record), adjoint(frames[old]) + frames[new], "Retained child") + endpoints = {(record["role"], record["port"]): record + for record in source_recipes["endpoint_adapters"]} + require(len(endpoints) == len(source_recipes["endpoint_adapters"]) + and set(endpoints) == {(role, p) for role in ("source", "target") for p in range(112)}, + "The endpoint adapter coverage is incomplete") + for (role, port), record in endpoints.items(): + direction = word["ports"][port] + conventional = (("C", direction, 1),) if role == "source" else ( + ("C", direction, -1),) + fourier(9) + index = word["start"][port] if role == "source" else word["final"][112 + port] + require(record["frame"] == index and record["rank"] == 0, "An endpoint frame changed") + equal(recipe(record), adjoint(conventional) + frames[index], "Endpoint adapter") + used_residuals = set() + for program in clean.values(): + for event in program: + if event[0] != "residual_adapter": + continue + _, position, register, entry, *tail = event + terminal = tail[0] if tail else 1 + key = str(entry) if terminal == 1 else str(entry) + ":" + str(terminal) + require(key in residuals and position in ("pre", "post"), "A residual binding changed") + require(entry == word["start"][register] and terminal == word["final"][register], + "A residual endpoint changed") + used_residuals.add(key) + for key in sorted(used_residuals): + record = residuals[key] + equal(recipe(record), adjoint(frames[record["frame"]]) + frames[record.get("terminal", 1)], + "Residual adapter") + records = certificate["input_recipes"] + ports = certificate["compensation_ports"] + require([record["port"] for record in records] == ports and len(records) == 8, + "The eight input recipes changed") + columns = 0 + for item in records: + port, label = item["port"], item["label"] + require(label == word["ports"][port] and item["canonical_start_frame_id"] == word["start"][port], + "An input recipe has the wrong supplier label") + record = item["recipe"] + require(record["rank"] == 1, "An input copy has the wrong child rank") + for side in ("left", "right"): + factor = record[side] + require(factor["quadratic_rows"] == [0] * 9 and factor["linear_Z4"] == [0] * 9 + and factor["offset"] == factor["phase"] == 0, + "An input factor is not an address permutation") + actual, expected = recipe(record), (("C", label, 1),) + equal(actual, expected, "Positive inherited input line") + for basis in range(512): + require(state(actual, basis) == state(expected, basis), "A complete input Gaussian column differs") + columns += 1 + negative = monomial(record["right"]) + (("C", 1, -1),) + monomial(record["left"]) + require(tableau(negative) != tableau(expected) or state(negative) != state(expected), + "An inverse input child was not detected") + phased = actual + (("phase", 1),) + require(tableau(phased) == tableau(actual) and state(phased) != state(expected), + "An input phase-only error was not detected") + return {"status": "PASS_EXACT_INPUT_NATIVE_FRAMES", "retained_native_events_per_orientation": 5056, + "retained_child_recipes": len(used), "endpoint_adapter_recipes": len(endpoints), + "residual_adapter_recipes": len(used_residuals), "new_input_recipes": len(records), + "new_exact_gaussian_columns": columns, "inverse_input_child_controls": len(records), + "phase_only_controls": len(records), "address_permutation_factors": 2 * len(records), + "method": "Independent signed Pauli and exact Gaussian interpretation; no compiler import", + "scope": "Positive inherited input frames before every retained adapter. No recursive hosting claim."} diff --git a/research/cf6a-banked-role1256-relay/physical.py b/research/cf6a-banked-role1256-relay/physical.py new file mode 100644 index 0000000000..e7c4e5798b --- /dev/null +++ b/research/cf6a-banked-role1256-relay/physical.py @@ -0,0 +1,868 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Exact grids and occupied bank schedules for the cf6a banked relay. + +Adapt the guarded bank and exact-root accounting of #7697, based on #7682. +The graph folds the supplied #7700 tape and contracts its role-1256 relay. +""" + +from argparse import ArgumentParser +from collections import Counter +from fractions import Fraction +import gzip +from hashlib import sha256 +import importlib.util +import json +from math import gcd, lcm +from pathlib import Path + + +HERE = Path(__file__).resolve().parent +PEER = "72705b094d83d2ba24006661bbb031786a691b776bedb94515b1321e1535105f" +CANDIDATE = "8e7b755bd2d2d387bc3d3adfe48100985adf74775ca5acbb143170a3d16b5ccf" +SOURCE_WORD = "ae62d5d8bef6f7146454b4b3643e487a58380c606a16c5baef7bf0dcf9df1472" +SOURCE_HEAD = "7d84799a447867d36137d12ef7ca5646154d763c" +SOURCE_CERTS = "39ef28b708cd8bf1166b111d656809407b370dd11cd81a8e43820779f995aca3" +CALLER = "62d94fb992acab0a71c3d12f22be4ce63f4f65e5cbe3f420b93aa1393ffa8dcf" +CALLER_REPLAY = "ced48867f07ca0143604aa98cfd74fa7453696b9d3221f7c230d73e9ab9ba81f" +STAGES = 16 +CALLER_ODD = 2025 +COMPILER_H = 14571800000000000000 +AMBIENT_CAP = 153 +PROTECTED_HELPERS = (325, 1087) +OLD_NATIVE_STOCK = 15290 +REMOVED, SURVIVOR = 95828, 104442 +RELAY_ROLE = 1256 +RELAY_CHARTS = (476, 878, 127) +PAYLOAD_AXES = 4 + + +def require(condition, reason): + if not condition: + raise ValueError(reason) + + +def encoded(data): + return json.dumps(data, sort_keys=True, separators=(",", ":")).encode() + + +def load_gzip(path, pin, *, canonical=True): + packed = path.read_bytes() + raw = gzip.decompress(packed) + require(sha256(raw).hexdigest() == pin, f"wrong decoded hash for {path.name}") + data = json.loads(raw) + require(not canonical or encoded(data) == raw, f"noncanonical data for {path.name}") + return data, sha256(packed).hexdigest() + + +def chart_span(basis): + span = {0} + for axis in basis: + require(type(axis) is int and 0 < axis < 512 and axis not in span, + "invalid independent ordered chart basis") + span |= {axis ^ vector for vector in span} + return span + + +def exact_coefficient(text): + value = Fraction(text) + require(value and str(value) == text, "noncanonical or zero scalar incidence") + return value + + +def exact_div(value, denominator): + result, remainder = divmod(value, denominator) + require(remainder == 0, "nonintegral scalar pre-product") + return result + + +def grid_parts(grid): + height = (grid & -grid).bit_length() - 1 + return grid >> height, height + + +def ceiling_bits(value): + return (-(-value.numerator // value.denominator)).bit_length() + + +def public_interface(graph, layout): + n = len(graph["initial"]) + require(layout["public"] == n == len(graph["final"]) == 1501 + and len(layout["live"]) == len(layout["ports"]) == 104, + "complete public and port denominators") + hosted = layout["hosted"] + hosted_ports = set(hosted["Dports"]) + second_planes = list(zip(hosted["X2"], hosted["Y2"], strict=True)) + require(len(hosted_ports) == len(second_planes) == 96, "actual 96 hosted ports") + live = layout["live"] + mains = set(live) | {role + 112 for role in live} | set(hosted["X2"]) | set(hosted["Y2"]) + require(len(mains) == 400 and mains <= set(range(n)), "400 distinct real main slots") + for port, (x, q) in enumerate(zip(live, layout["ports"], strict=True)): + y = x + 112 + initial, final = graph["initial"], graph["final"] + frames = graph["frames"] + require(frames[initial[x]] == [q] and frames[initial[y]] == [] + and frames[final[x]] == [1 << j for j in range(9)] + and len(frames[final[y]]) == 8 + and all((v & q).bit_count() % 2 == 0 for v in frames[final[y]]), + f"main binding at port {port}") + for position, pair in zip(hosted["Dports"], second_planes, strict=True): + original = (live[position], live[position] + 112) + require(all(graph[boundary][a] == graph[boundary][b] + for boundary in ("initial", "final") for a, b in zip(original, pair)), + "separate hosted main partners in the same charts") + require(all(r not in mains and (graph["initial"][r], graph["final"][r]) == (3, 237) + for r in PROTECTED_HELPERS), "fixed rank-four same-owner helper boundaries") + return mains, hosted_ports, second_planes + + +def expected_rows(n, layout, interface, unit): + mains, hosted, second = interface + rows = [{r: unit} for r in range(n)] + for port, x in enumerate(layout["live"]): + y = x + 112 + if port in hosted: + rows[y][x] = unit + else: + rows[x][y] = -unit + rows[y] = {x: exact_div(unit, 2), y: exact_div(unit, 2)} + for x, y in second: + rows[x][y] = -unit + require(all(r in mains or row == {r: unit} for r, row in enumerate(rows)), + "independent arbitrary helper definition") + return rows + + +def graph_inputs(graph): + n = len(graph["initial"]) + first = graph["first_output"] + require(n == 1501 and first == 154768, "stable paid and public namespace") + moves = {key: (a, b) for key, a, b in graph["moves"]} + rows = {key: [(donor, exact_coefficient(coef)) for donor, coef in terms] + for key, terms in graph["forms"]} + terminal_keys = set(range(first, first + n)) + order = graph["schedule"] + require(len(moves) == len(graph["moves"]) and all(0 <= key < first for key in moves), + "exact positive paid slots") + require(len(rows) == len(graph["forms"]) == len(moves) + n + and set(rows) == moves.keys() | terminal_keys and moves.keys().isdisjoint(terminal_keys) + and len(order) == len(rows) and set(order) == rows.keys(), + "exact held-bank schedule denominator") + require(all([donor for donor, _ in row] == sorted({donor for donor, _ in row}) + for row in rows.values()), "unique donor keys in literal scalar order") + return moves, rows + + +def graph_bounds(graph, moves, rows, mains): + frames = graph["frames"] + spans = list(map(chart_span, frames)) + starts, ends = graph["initial"], graph["final"] + first = graph["first_output"] + n = len(starts) + require(all(type(chart) is int and 0 <= chart < len(spans) for chart in (*starts, *ends)), + "valid public charts") + + def rank(a, b, helper=False): + require(0 <= a < len(spans) and 0 <= b < len(spans), "valid paid chart IDs") + require(spans[a] < spans[b] or (not helper and spans[b] < spans[a]), + "strictly nested positive paid or helper charts") + return abs(len(frames[b]) - len(frames[a])) + + paid = Counter(rank(a, b) for a, b in moves.values()) + productive = Counter(rank(starts[r], ends[r], helper=True) for r in range(n) if r not in mains) + available = {~r: (chart, 1, Fraction(1)) for r, chart in enumerate(starts)} + grid, peak_mass, peak_node = 1, Fraction(1), None + for key in graph["schedule"]: + a = moves[key][0] if key in moves else ends[key - first] + row_grid, mass = 1, Fraction() + for donor, q in rows[key]: + require(donor in available and available[donor][0] == a, + f"donor unavailable or in wrong chart at row {key}") + _, divisor, weight = available[donor] + row_grid = lcm(row_grid, divisor * q.denominator) + mass += abs(q) * weight + grid = lcm(grid, row_grid) + if mass > peak_mass: + peak_mass, peak_node = mass, key + if key in moves: + available[key] = (moves[key][1], row_grid, mass) + odd, height = grid_parts(grid) + return { + "public": n, "slots": len(moves), "terms": sum(map(len, rows.values())), + "path_grid": grid, "path_grid_odd": odd, "path_grid_height": height, + "positive_path_mass_bound_unscaled": str(peak_mass), + "positive_path_mass_peak_node": peak_node, + "paid_native_ranks": dict(paid), "positive_helper_ranks": dict(productive), + } + + +def exact_basis_grid(graph, moves, rows, grid, expected): + """Check every separate rational product, prefix and installed basis row.""" + values = {~r: {r: grid} for r in range(len(graph["initial"]))} + product_gcd = snapshot_gcd = grid + odd_factors = {} + for prime in (3, 5): + reduced = grid + while reduced % prime == 0: + reduced //= prime + require(reduced < grid, f"missing expected odd prime {prime}") + odd_factors[prime] = grid // reduced + off_grid_controls = {} + n_checks = nontrivial = 0 + divisors = Counter() + peak_absolute = grid + for key in graph["schedule"]: + row, row_bound = {}, 0 + for donor, q in rows[key]: + a, b = q.numerator, q.denominator + n_checks += len(values[donor]) + nontrivial += len(values[donor]) if b != 1 else 0 + if b != 1: + divisors[b] += len(values[donor]) + for column, value in values[donor].items(): + product = exact_div(a * value, b) + product_gcd = gcd(product_gcd, product) + if len(off_grid_controls) < len(odd_factors): + for prime, factor in odd_factors.items(): + if prime not in off_grid_controls and product % factor: + require(value % factor == 0, "first under-scaled donor already off grid") + reduced_numerator = a * (value // factor) + require(reduced_numerator % b, "removed odd factor must cause a literal DIV fault") + off_grid_controls[prime] = { + "row": key, "donor": donor, "entrance_column": column, + "coefficient": str(q), "removed_factor": factor, + "numerator_without_factor": reduced_numerator, "denominator": b, + "positive_remainder": reduced_numerator % b, + } + row_bound += abs(product) + result = row.get(column, 0) + product + if result: + row[column] = result + else: + row.pop(column, None) + peak_absolute = max(peak_absolute, row_bound) + for value in row.values(): + snapshot_gcd = gcd(snapshot_gcd, value) + if key in moves: + values[key] = row + else: + require(row == expected[key - graph["first_output"]], f"wrong normalized endpoint {key}") + return { + "coefficient_products": n_checks, "checked_nontrivial_divisions": nontrivial, + "checked_nontrivial_divisions_by_denominator": dict(divisors), + "exact_all_public_rows": len(expected), + "minimum_product_grid": grid // product_gcd, "minimum_snapshot_grid": grid // snapshot_gcd, + "maximum_exact_row_prefix_mass_scaled": str(Fraction(peak_absolute, 1 << grid_parts(grid)[1])), + "missing_odd_factor_controls": off_grid_controls, + } + + +class HeldBank: + """Finite extent fixture with typed payloads and separately guarded streams.""" + + def __init__(self, homes): + self.homes = homes + self.blank = (None, None, (0,) * PAYLOAD_AXES) + self.left_guard = object() + self.right_guard = object() + self.dummy = object() + self.left = self.left_guard + self.right = self.right_guard + self.slots = [self.dummy] + [ + (("dirty", slot), -1, tuple((-1)**axis * (slot + axis) for axis in range(PAYLOAD_AXES))) + for slot in range(1, homes + 1) + ] + self.head = 0 + self.operations = Counter() + self.overwritten_cells = Counter() + self.trace = sha256() + # GET restores the selector head. Its complete donor and the running + # accumulator have independent backing throughout the term. + self.streams = {name: None for name in ("accumulator", "donor", "product", "quotient")} + self.stream_resets = 0 + + def access(self, slot, operation, replacement=None, *, require_blank=False, clear=False): + require(self.head == 0 and 1 <= slot <= self.homes, "bad guarded bank selection") + self.head = slot + try: + old = self.slots[slot] + require(not require_blank or old == self.blank, + "send or install before previous full owner extent cleared") + if clear: + require(replacement is None and len(old[2]) == PAYLOAD_AXES, "wrong reset extent") + # Scan every addressed payload cell without inspecting its + # value or treating a normalized zero as a reset. + cleared = tuple(0 for _ in old[2]) + self.slots[slot] = (None, None, cleared) + self.overwritten_cells[operation] += len(cleared) + if replacement is not None: + require(len(replacement[2]) == PAYLOAD_AXES, "wrong staged copy extent") + tag, chart, payload = replacement + self.slots[slot] = (tag, chart, tuple(cell for cell in payload)) + self.operations[operation] += 1 + self.trace.update(encoded([operation, slot, old[0], replacement[0] if replacement else None])) + return old + finally: + self.head = 0 + + def reset_stream(self, name): + live = self.streams[name] + if live is not None: + require(len(live) == PAYLOAD_AXES, "wrong stream reset extent") + self.streams[name] = None + self.stream_resets += 1 + + def close(self): + require(self.head == 0 and self.slots[0] is self.dummy + and self.left is self.left_guard and self.right is self.right_guard + and all(slot == self.blank for slot in self.slots[1:]) + and all(stream is None for stream in self.streams.values()), + "packed bank and four stream retirement") + + +def rejected_write(bank, slot, record, control_operation): + try: + bank.access(slot, control_operation, record, require_blank=True) + except ValueError as failure: + require(str(failure) == "send or install before previous full owner extent cleared" + and bank.head == 0, "wrong dirty or outstanding-sender control failure") + else: + raise ValueError("dirty or held payload accepted as blank") + + +def partial_clear_control(): + bank = HeldBank(2) + old_unselected = bank.slots[2] + # A missing final address remains dirty even though the tag, chart, and + # all earlier positions have been cleared. + bank.slots[1] = (None, None, (0,) * (PAYLOAD_AXES - 1) + (17,)) + record = (("fresh", 0), 3, (1,) * PAYLOAD_AXES) + rejected_write(bank, 1, record, "partial_clear_fault") + residue = bank.access(1, "clear_every_address", clear=True) + require(residue[2][-1] == 17 and bank.slots[1] == bank.blank and bank.slots[2] == old_unselected, + "complete overwrite must remove the residual and preserve neighbors") + bank.access(1, "accepted_after_full_clear", record, require_blank=True) + return {"dirty_unaddressed_last_cell_rejected": True, "neighbor_unchanged": True} + + +def held_schedule(graph, moves, rows, grid, expected, control=False): + n, k, first = len(graph["initial"]), len(moves), graph["first_output"] + entrance = {~r: r + 1 for r in range(n)} + returned = {key: n + i + 1 for i, key in enumerate(sorted(moves))} + terminal = {first + r: n + k + r + 1 for r in range(n)} + sender = 2*n + k + 1 + scratch = range(sender + 1, sender + 5) + allocated = set(entrance.values()) | set(returned.values()) | set(terminal.values()) | {sender} | set(scratch) + require(allocated == set(range(1, 2*n + k + 6)), "injective bank home plan") + bank = HeldBank(len(allocated)) + odd = grid_parts(grid)[0] + binary_grid = grid // odd + public = [ + (("public", r), chart, tuple( + binary_grid * ((r * (719 - 41*axis) + 29 + 37*axis) % 127 - 63) + for axis in range(PAYLOAD_AXES) + )) + for r, chart in enumerate(graph["initial"]) + ] + original_public = public.copy() + for slot in sorted(allocated): + old = bank.access(slot, "initialize_complete_dirty_home", clear=True) + require(all(old[2]), "every initial fixture address must be dirty") + for r, (_, chart, value) in enumerate(public): + scaled = tuple(x * odd for x in value) + bank.access(entrance[~r], "write_entrance", (("entry", r), chart, scaled), require_blank=True) + known = dict(entrance) + installed = set() + outstanding = None + attempted_early_reuse = False + + for key in graph["schedule"]: + paid = key in moves + source, destination = moves[key] if paid else (graph["final"][key - first], None) + require(bank.streams["accumulator"] is None, "running accumulator already occupied") + bank.streams["accumulator"] = (0,) * PAYLOAD_AXES + for donor, q in rows[key]: + require(donor in known, "read before donor RETURN") + tag, chart, value = bank.access(known[donor], "read_immutable_donor") + require(tag == (("entry", ~donor) if donor < 0 else ("returned", donor)) + and chart == source, "wrong owner or chart at guarded GET") + require(all(bank.streams[name] is None for name in ("donor", "product", "quotient")), + "term workspace was live before GET") + bank.streams["donor"] = tuple(cell for cell in value) + bank.streams["product"] = tuple(q.numerator * x for x in bank.streams["donor"]) + bank.streams["quotient"] = tuple(exact_div(x, q.denominator) for x in bank.streams["product"]) + bank.streams["accumulator"] = tuple(a + b for a, b in zip( + bank.streams["accumulator"], bank.streams["quotient"], strict=True)) + for name in ("donor", "product", "quotient"): + bank.reset_stream(name) + value = bank.streams["accumulator"] + if paid: + require(outstanding is None and key not in known, "invalid new native sender") + bank.access(sender, "initialize_empty_sender_before_departure", require_blank=True, clear=True) + record = (("sender", key), source, value) + bank.access(sender, "stage_full_sender", record, require_blank=True) + outstanding = key + if control and key == SURVIVOR: + rejected_write(bank, sender, (("sender", key + 1), source, value), "early_sender_fault") + require(bank.slots[sender] == record and key not in known and bank.slots[returned[key]] == bank.blank, + "fault disturbed the parked sender or exposed an incomplete return") + attempted_early_reuse = True + held_tag, held_chart, held_value = bank.access(sender, "read_parked_sender") + require(outstanding == key and held_tag == ("sender", key) and held_chart == source, + "parked sender must survive until shape and complete return") + # Native checks supply both complete adapters and the paid + # Gaussian child. Their normalized composite preserves this value. + returned_record = (("returned", key), destination, held_value) + bank.access(returned[key], "write_complete_return", returned_record, require_blank=True) + bank.access(sender, "clear_full_sender_after_return", clear=True) + require(bank.head == 0, "sender head not restored after full retirement") + outstanding = None + known[key] = returned[key] + else: + role = key - first + bank.access(terminal[key], "write_terminal", (("terminal", role), source, value), require_blank=True) + bank.reset_stream("accumulator") + + require(outstanding is None and len(known) == n+k and public == original_public, + "all full public entrances must remain intact throughout the native schedule") + for role in range(n): + tag, chart, values = bank.access(terminal[first + role], "read_terminal_for_same_owner_install") + predicted = tuple(exact_div( + sum(q * original_public[i][2][axis] for i, q in expected[role].items()), grid) + for axis in range(PAYLOAD_AXES)) + unscaled = tuple(exact_div(value, odd) for value in values) + require(tag == ("terminal", role) and chart == graph["final"][role] and unscaled == predicted, + "wrong extent, chart, value or same-owner terminal install") + public[role] = (("public", role), chart, unscaled) + installed.add(role) + bank.trace.update(encoded(["public_install_and_unscale", role, chart])) + require(installed == set(range(n)) and all( + record[:2] == (("public", role), graph["final"][role]) for role, record in enumerate(public)), + "every public owner fully installed exactly once") + for slot in sorted(allocated): + bank.access(slot, "retire_complete_home", clear=True) + bank.close() + terms = sum(map(len, rows.values())) + wanted = { + "initialize_complete_dirty_home": len(allocated), "write_entrance": n, + "read_immutable_donor": terms, "initialize_empty_sender_before_departure": k, + "stage_full_sender": k, "read_parked_sender": k, "write_complete_return": k, + "clear_full_sender_after_return": k, "write_terminal": n, + "read_terminal_for_same_owner_install": n, "retire_complete_home": len(allocated), + } + resets = { + op: count * PAYLOAD_AXES for op, count in wanted.items() + if op in {"initialize_complete_dirty_home", "initialize_empty_sender_before_departure", + "clear_full_sender_after_return", "retire_complete_home"} + } + require(bank.operations == wanted and bank.overwritten_cells == resets + and bank.stream_resets == 3*terms+k+n, "complete independent selected replay counts") + return { + "numerical_homes": len(allocated), "guarded_dummy_slots": 1, "separate_guide_tracks": 1, + "max_outstanding_native_senders": 1, "declared_senders": 1, + "immutable_entry_banks": n, "immutable_paid_return_banks": k, + "deferred_terminal_banks": n, "native_scalar_scratch_homes": 4, + "additional_independent_guarded_streams": len(bank.streams), + "trace_sha256": bank.trace.hexdigest(), "selected_logical_operations": dict(bank.operations), + "fixture_addressed_cells_per_home": PAYLOAD_AXES, + "fixture_addressed_cells_overwritten": dict(bank.overwritten_cells), + "tracked_stream_reset_visits": bank.stream_resets, + "same_owner_complete_fixture_outputs": len(installed), "exact_odd_unscale_outputs": len(installed), + "retired_and_guards_restored": True, "live_sender_alias_control_rejected": attempted_early_reuse, + "all_public_inputs_preserved_until_final_installs": True, + } + + +def scalar_service(value, coefficient, signed_width): + """Finite signed carry, quotient, exact remainder and padded installation.""" + a, b = abs(coefficient.numerator), coefficient.denominator + magnitude = abs(value) + require(magnitude.bit_length() < signed_width, "input width") + padding = signed_width + 26 + carry, bits = 0, [] + for j in range(padding): + carry += a * ((magnitude >> j) & 1) + bits.append(carry & 1) + carry >>= 1 + require(carry == 0, "padded product overflow") + quotient = remainder = 0 + for bit in reversed(bits): + trial = 2 * remainder + bit + next_bit = int(trial >= b) + remainder = trial - next_bit * b + quotient = (quotient << 1) | next_bit + require(remainder == 0, "physical remainder") + require(quotient.bit_length() < signed_width, "installed scalar overflow") + return -quotient if (value < 0) != (coefficient.numerator < 0) else quotient + + +def scalar_cases(graph_rows, caller, scales): + factors = {factor for rows in graph_rows for row in rows.values() for _, factor in row} + factors.update(Fraction(event[-1]) for event in caller["events"] + if event[0] != "J" and event[1] in ("ADD", "SCALE")) + factors.update((Fraction(-1), Fraction(1), Fraction(-1, 2), Fraction(1, 2))) + for scale in scales: + factors.update((Fraction(scale), Fraction(1, scale), Fraction(-1, scale))) + bits = max(max(abs(q.numerator).bit_length(), q.denominator.bit_length()) for q in factors) + require(bits <= 24, "all literal scalar and division conversions fit W+26") + cases = 0 + for coefficient in sorted(factors): + for k in (0, -127, -1, 1, 19, (1 << 68) + 1): + value = k * coefficient.denominator + signed_width = max(3, abs(value).bit_length()+2, abs(k * coefficient.numerator).bit_length()+2) + require(scalar_service(value, coefficient, signed_width) == k * coefficient.numerator, + "fixed scalar sign/carry/remainder or installation") + cases += 1 + rejected_denominators = (2, 3, 5, 7) + for denominator in rejected_denominators: + try: + scalar_service(1, Fraction(-1, denominator), 3) + except ValueError as failure: + require(str(failure) == "physical remainder", "wrong inexact scalar rejection") + else: + raise ValueError("nonintegral scalar installed") + return {"distinct_scalar_and_conversion_factors": len(factors), "signed_bit_transducer_cases": cases, + "coefficient_bits": bits, "rejected_one_tick_denominators": rejected_denominators, + "retained_max_bits": 24, "component_padding": 26} + + +def caller_envelope(caller): + """Majorize raw caller products with no cancellation or operator commutation.""" + roles = [(0, Fraction(1)) for _ in range(caller["roles"])] + max_height, max_mass = 0, Fraction(1) + pre_height, pre_mass = 0, Fraction(1) + visits = Counter() + + def observe(*values): + nonlocal max_height, max_mass + for height, mass in values: + max_height = max(max_height, height) + max_mass = max(max_mass, mass) + + def scale(value, factor): + height, mass = value + return height + grid_parts(factor.denominator)[1], abs(factor) * mass + + def add(first, second): + return max(first[0], second[0]), first[1] + second[1] + + stages = [] + for event in caller["events"]: + if event[0] == "J": + _, stage, (x, y, u, v), (a, b, alpha, beta) = event + require((Fraction(alpha), Fraction(beta)) == (-1, Fraction(1, 2)), + "exact signed joint envelope coefficients") + stages.append(stage) + pre_height = max(pre_height, *(roles[j][0] for j in (x, y, u, v, a, b))) + pre_mass = max(pre_mass, *(roles[j][1] for j in (x, y, u, v, a, b))) + roles[y], roles[u] = add(roles[y], roles[x]), add(roles[u], roles[v]) + old_a, old_b = roles[a], roles[b] + roles[a] = add(old_a, old_b) + roles[b] = add(scale(old_a, Fraction(1, 2)), scale(old_b, Fraction(1, 2))) + observe(roles[y], roles[u], roles[a], roles[b]) + continue + kind, op, role, *args = event + visits[op] += len(caller["types"][kind]["ports"]) + if op == "ADD": + term = scale(roles[args[0]], Fraction(args[-1])) + roles[role] = add(roles[role], term) + observe(term) + elif op == "SCALE": + roles[role] = scale(roles[role], Fraction(args[-1])) + elif op == "SWAP": + donor = args[0] + roles[role], roles[donor] = roles[donor], roles[role] + elif op == "QUERY": + roles[role] = add(roles[role], roles[args[0]]) + elif op == "LAMBDA": + height, mass = roles[role] + # (1 ± i)/2 and (1 ∓ i)/2 each have Gaussian l1 norm one. + roles[role] = height + 1, 2 * mass + else: + require(op in {"IDLE_ONE", "IDLE_ODD"}, "unknown signed caller operation") + observe(roles[role]) + require(stages == list(range(1, STAGES+1)), "complete exact 16-stage raw schedule") + return { + "records": len(caller["events"]), "stages": len(stages), "uses": dict(visits), + "binary_height_at_all_completed_cuts_and_products": max_height, + "binary_height_at_native_entrances": pre_height, + "scaled_mass_at_all_cuts_and_products": str(CALLER_ODD * max_mass), + "scaled_mass_at_native_entrances": str(CALLER_ODD * pre_mass), + "normalized_bound_uses_no_cancellation_or_commutation": True, + } + + +def replay_caller(caller, layout): + path = HERE / "engines/caller/caller16.py" + require(sha256(path.read_bytes()).hexdigest() == CALLER_REPLAY, "wrong signed caller engine") + spec = importlib.util.spec_from_file_location("physical_signed_caller16", path) + require(spec is not None and spec.loader is not None, "signed caller engine must be loadable") + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + result = module.signed_caller(caller, layout, CALLER_ODD, 9) + require(result["calls"] == STAGES and result["roles"] == 68 and result["root_owners"] == 3536 + and result["exact_preproduct_divisions"] == 153295 + and Fraction(result["peak_scaled_mass"]) == Fraction(495734175, 2), + "exact inherited caller odd scale and literal divide replay") + roots_q = sum(len(specification["ports"]) * sum(row[0] < 0 for row in specification["diagonal"]) + for specification in caller["types"].values()) + require(roots_q == 3536, "charge all root negative-q ordinary translations") + envelope = caller_envelope(caller) + require(envelope["uses"] == result["uses"], "independent weighted caller operation count") + return result, envelope, roots_q + + +def ordinary_budget(native, signed, roots_q, scalar_bits): + n, k, terms, homes = (native[key] for key in ("public", "slots", "terms", "numerical_homes")) + conversions = 2 * (signed["root_owners"] + STAGES * n) + reset_counts = { + "dirty_home_initializations_and_retirements": 2 * homes, + "term_and_row_stream_initializations_and_retirements": 8 * (terms + k + n), + "owner_scale_unscale_stream_initializations_and_retirements": 4 * n, + "sender_reinitializations_and_retirements": 2 * k, + } + transfer_counts = { + "complete_scalar_donor_staging_legs": 2 * terms, + "complete_sender_and_terminal_staging_legs": 2 * (k + n), + "paid_parked_sender_return_and_adapter_legs": 6 * k, + "immutable_entrance_and_public_terminal_install_legs": 4 * n, + } + resets, transfers = sum(reset_counts.values()), sum(transfer_counts.values()) + selector_l = 14*homes + 9 + selector_constant = 63*homes - 7*homes.bit_count() + 27*homes.bit_length() + 59 + # Allow the separate full overwrite scan for every reset, in addition + # to the selector/reset bound, including the stream resets. + selections = [resets*(selector_l+2) + transfers*(selector_l+128), + resets*(selector_constant+3) + transfers*(selector_constant+320)] + selected = native["selected_logical_operations"] + checked_home_resets = sum(selected[op] for op in native["fixture_addressed_cells_overwritten"]) + checked_copy_visits = sum(selected.values()) - checked_home_resets + require(checked_home_resets == 2*(homes+k) + and resets >= checked_home_resets + native["tracked_stream_reset_visits"], + "full occupied resets, sender reuse and independent stream resets charged") + require(checked_copy_visits == terms+3*(k+n) and transfers == 2*checked_copy_visits + 2*k, + "all staged copy visits plus complete paid adapter legs charged") + p = STAGES * k + sum(signed["fixed_caller_paid"].values()) + t = STAGES * sum(native["positive_helper_ranks"].values()) + sum(signed["fixed_root_targets"].values()) + uses = signed["uses"] + maps = 2*(p+t+STAGES*400) + 2*(uses["IDLE_ONE"]+uses["IDLE_ODD"]) + maps += 3*uses["QUERY"] + uses["LAMBDA"] + uses["IDLE_ODD"] + roots_q + scalar_counts = { + "literal_native_products_and_accumulations": STAGES * terms, + "width_padded_native_row_lifecycles": STAGES * 4 * (k + n), + "public_boundary_installations_and_scale_preparations": STAGES * 2 * n, + "private_home_flags_and_cleanup": STAGES * homes, + "serial_sender_initialization_and_retirement": STAGES * 2 * k, + "weighted_signed_caller_operation_slots": sum(uses.values()), + "complete_array_odd_conversions": conversions, + } + scalar_count = 32 * sum(scalar_counts.values()) + require(homes <= OLD_NATIVE_STOCK and native["additional_independent_guarded_streams"] == 4, + "retained numerical home ceiling and extra independent streams") + return { + "native_numeric_homes": homes, "native_numeric_homes_plus_dummy": homes+1, + "raw_numeric_homes": STAGES*homes, "raw_numeric_homes_plus_dummy": STAGES*(homes+1), + "separate_guarded_guide_tracks_per_native": 1, "separate_guarded_guide_tracks_raw": STAGES, + "separate_guarded_streams_per_native": 4, "separate_guarded_streams_raw": STAGES*4, + "odd_conversions": conversions, "reset_services_per_native": resets, + "typed_selected_transfers_per_native": transfers, + "reset_services_by_kind_per_native": reset_counts, + "typed_transfer_legs_by_kind_per_native": transfer_counts, + "reset_services_all_native_stages": STAGES * resets, + "typed_selected_transfer_legs_all_native_stages": STAGES * transfers, + "selector_steps_per_selected_service_L_and_constant": [selector_l, selector_constant], + "additional_full_overwrite_steps_per_reset_L_and_constant": [2, 3], + "selected_total_steps_per_native_L_and_constant": selections, + "selected_total_steps_raw_L_and_constant": [STAGES * part for part in selections], + "scalar_services": scalar_count, "scalar_step_rate": 2**max(20, scalar_bits+8), + "raw_scalar_incidence_allowance_before_factor_32": scalar_counts, + "ordinary_map_slots": maps, "ordinary_elementary_record_upper": maps*4*(AMBIENT_CAP+1)**2, + "raw_paid_positions": p, "raw_productive_targets": t, "root_negative_q_translations": roots_q, + "native_paid_wrappers": STAGES * k, + "native_productive_wrappers": STAGES * sum(native["positive_helper_ranks"].values()), + "ordinary_main_pair_slots": STAGES * 400, + "compiled_ordinary_work": "Full-view resets, selects, copies, guide and layout setup and return, exact scalar and odd conversions, matchers, fixed descriptors, root normalization, and all native, caller and child adapters.", + "compiled_stock": "Disjoint occurrence-tagged bank tuples, dummy origins, guides and four guarded streams per stage; complete public owners, matching child views, compiler and BIT workspace, and every parked ancestor.", + "layout": { + "padded_payload": "L'=N_c(2(W+26)+3)", + "per_stage_selector_and_stream_tracks": 11, + "guide_setup_and_retirement": "q(N_c)+q(W')+22N_cW'+36N_c+7W'+36+7L'+10; q(x)=24x-7popcount(x)+15ell(x)+12; W'=W+26", + "aggregate_owned_tuple_M": "sum_stage[(homes+6)(L'+2)+ell(N_c)+ell(W+26)+max(ell(N_c),ell(W+26),ell(homes))+max(N_c,homes)+max(W+26,ell(homes))+10]", + "shadow_cells_upper": "M+352", + "complete_view_step_bound": "34*(256(M+352)+128) plus fixed-degree descriptor work", + }, + } + + +def root_envelope(native, caller): + max_binary = max(caller["binary_height_at_all_completed_cuts_and_products"], + *(caller["binary_height_at_native_entrances"] + side["path_grid_height"] + for side in native.values())) + max_mass = max(Fraction(caller["scaled_mass_at_all_cuts_and_products"]), + *(Fraction(caller["scaled_mass_at_native_entrances"]) * side["path_grid_odd"] + * Fraction(side["positive_path_mass_bound_unscaled"]) + for side in native.values())) + mass_bits = ceiling_bits(max_mass) + c = 2 * max(max_binary, mass_bits) + return { + "caller_odd": CALLER_ODD, + "native_odd": {side: audit["path_grid_odd"] for side, audit in native.items()}, + "native_binary": {side: audit["path_grid_height"] for side, audit in native.items()}, + "context_mass_bound": str(max_mass), "context_mass_bits": mass_bits, + "context_binary_bits": max_binary, "context_c": c, + "H_guard": "bit_length(context_c*1920*153**1920*(H+1)**2) < H for each actual compiler bound H", + "exact_grid": "2^(-p-D)", + "signed_width": "W=p+h+2D+3", + "temporary_width": "W+26", + } + + +def relay_edit(parent, candidate, word): + require(all(parent[field] == candidate[field] == word[field] + for field in ("frames", "initial", "final")), + "same complete raw chart atlas and public owner shapes") + require(parent["first_output"] == candidate["first_output"] == len(word["program"]), + "stable raw clocks and complete public output namespace") + enter, middle, leave = RELAY_CHARTS + require(word["program"][REMOVED] == ["MOVE", RELAY_ROLE, enter, middle, False] + and word["program"][SURVIVOR] == ["MOVE", RELAY_ROLE, middle, leave, False], + "literal nonproductive source relay on owner 1256") + parent_moves, parent_rows = graph_inputs(parent) + child_moves, child_rows = graph_inputs(candidate) + raw_moves = {clock: (event[2], event[3]) for clock, event in enumerate(word["program"]) + if event[0] == "MOVE"} + require(parent_moves == raw_moves and len(raw_moves) == 6144 and len(child_moves) == 6143, + "exact source and contracted paid denominators") + require(child_moves == {key: (enter, leave) if key == SURVIVOR else edge + for key, edge in parent_moves.items() if key != REMOVED}, + "only one direct paid edge replaces the two source children") + require(parent_rows[SURVIVOR] == [(REMOVED, Fraction(1))] + and [key for key, terms in parent_rows.items() if any(donor == REMOVED for donor, _ in terms)] + == [SURVIVOR], + "pure single-consumer relay") + require(child_rows == {key: parent_rows[REMOVED] if key == SURVIVOR else terms + for key, terms in parent_rows.items() if key != REMOVED}, + "retained paid sender uses exactly four substituted source terms") + edited = {REMOVED, SURVIVOR} + require([key for key in candidate["schedule"] if key not in edited] + == [key for key in parent["schedule"] if key not in edited], + "relative schedule order of all rows outside the relay") + positions = (parent["schedule"].index(REMOVED), parent["schedule"].index(SURVIVOR), + candidate["schedule"].index(SURVIVOR)) + require(positions == (3308, 4114, 3310), "exact old and new zero-based relay schedule positions") + a, b, c = (chart_span(word["frames"][chart]) for chart in RELAY_CHARTS) + require(a < b < c and (len(a), len(b), len(c)) == (8, 64, 512), + "strict consecutive ranks 3+3, direct rank 6") + return {"role": RELAY_ROLE, "removed_paid_key": REMOVED, "surviving_paid_key": SURVIVOR, + "ordered_charts": list(RELAY_CHARTS), "old_ranks": [3, 3], "new_rank": 6, + "new_sender_donors": [[donor, str(coef)] for donor, coef in child_rows[SURVIVOR]], + "schedule_positions_zero_based": {"parent_removed": positions[0], "parent_survivor": positions[1], + "candidate_survivor": positions[2]}, + "relative_order_unchanged_rows": len(candidate["schedule"]) - 1, + "row_later_relay_consumers": 1, "new_recursive_charges_outside_replacement": 0} + + +def check_raw_clear_inventory(word, certs): + indices = {str(clock) for clock, event in enumerate(word["program"]) if event[0] == "CLEAR"} + certificates = certs["clear_event_index"] + count = sum(len(terms) for terms in certificates.values()) + require(certs["candidate_canonical_sha256"] == SOURCE_WORD and set(certificates) == indices + and len(indices) == 235 and count == 1135, "source raw CLEAR certificate inventory") + return {"raw_clear_clocks": len(indices), "normalized_source_terms": count, + "bank_execution_source": "complete addressed retirement in the new banked schedule", + "raw_clear_role": "source-word chronological normalized proof; graph replay checks its own ownership"} + + +def check_depth_guard(root, h): + require(h > 0, "positive compiler H") + k_star = 1920 * 153**1920 * (h + 1)**2 + bits = (root["context_c"] * k_star).bit_length() + require(bits < h, "common exact-root depth guard") + return {"compiler_H": h, "argument_bit_length": bits, "strict_guard_passed": True} + + +def qualify(parent, candidate, word, certs, caller, h): + relay = relay_edit(parent, candidate, word) + clear_inventory = check_raw_clear_inventory(word, certs) + signed, caller_bound, roots_q = replay_caller(caller, word) + native, all_rows = {}, [] + for side, graph in (("parent", parent), ("candidate", candidate)): + interface = public_interface(graph, word) + moves, rows = graph_inputs(graph) + all_rows.append(rows) + audit = graph_bounds(graph, moves, rows, interface[0]) + grid = audit["path_grid"] + expected = expected_rows(audit["public"], word, interface, grid) + native[side] = { + **audit, + **exact_basis_grid(graph, moves, rows, grid, expected), + **held_schedule(graph, moves, rows, grid, expected, control=side == "candidate"), + } + parent_audit, child = native["parent"], native["candidate"] + require(parent_audit["path_grid"] == 2025 << 20 and parent_audit["terms"] == 172415 + and parent_audit["coefficient_products"] == 9044218, "independent G3 folded native anchor") + require(set(child["missing_odd_factor_controls"]) == {3, 5} and child["live_sender_alias_control_rejected"], + "actual under-scaled literal divisions and outstanding sender controls must reject") + old_paid = Counter(parent_audit["paid_native_ranks"]) + new_paid = Counter(child["paid_native_ranks"]) + require(new_paid - old_paid == {6: 1} and old_paid - new_paid == {3: 2} + and child["positive_helper_ranks"] == parent_audit["positive_helper_ranks"], + "exact paid replacement, unchanged productive ranks") + require(sum(rank * count for rank, count in new_paid.items()) + == sum(rank * count for rank, count in old_paid.items()), "paid rank mass conservation") + require((parent_audit["numerical_homes"], child["numerical_homes"]) == (9151, 9150), + "complete serial sender realization on both exact graphs") + root = root_envelope(native, caller_bound) + scalars = scalar_cases(all_rows, caller, (CALLER_ODD, *root["native_odd"].values())) + ordinary = {side: ordinary_budget(audit, signed, roots_q, scalars["coefficient_bits"]) + for side, audit in native.items()} + return { + "status": "PASS_CF6A_RELAY_BANK_PHYSICAL", + "scope": "Complete folded normalized products, all public endpoints, charged guarded bank schedules, finite scalar services and common exact root under the retained physical and recursive interfaces.", + "relay": relay, "raw_clear_source_inventory": clear_inventory, + "native": native, "ordinary": ordinary, "scalar_services": scalars, + "physical_controls": partial_clear_control(), + "caller_exact": signed, "caller_hereditary_envelope": caller_bound, "common_exact_root": root, + "bit_guard": check_depth_guard(root, h), + "both_graphs_respect_historical_numeric_homes_and_streams": True, + "inherited_private_home_cap_per_stage": OLD_NATIVE_STOCK, + "raw_stage_count": STAGES, + } + + +def main(): + parser = ArgumentParser(description=__doc__) + parser.add_argument("--parent", type=Path, default=HERE / "data/PARENT-GRAPH.json.gz") + parser.add_argument("--candidate", type=Path, default=HERE / "data/CANDIDATE-GRAPH.json.gz") + parser.add_argument("--word", type=Path, default=HERE / "data/WORD.json.gz") + parser.add_argument("--certs", type=Path, default=HERE / "data/CERTS.json") + parser.add_argument("--caller", type=Path, default=HERE / "data/CALLER.json.gz") + parser.add_argument("--candidate-sha256", default=CANDIDATE) + parser.add_argument("--compiler-H", type=int, default=COMPILER_H) + parser.add_argument("--out", type=Path) + args = parser.parse_args() + require(args.candidate_sha256 == CANDIDATE, "wrong frozen candidate pin") + parent, parent_gzip = load_gzip(args.parent, PEER) + child, child_gzip = load_gzip(args.candidate, CANDIDATE) + word, word_gzip = load_gzip(args.word, SOURCE_WORD) + caller, caller_gzip = load_gzip(args.caller, CALLER, canonical=False) + certs_raw = args.certs.read_bytes() + require(sha256(certs_raw).hexdigest() == SOURCE_CERTS, "wrong literal raw CLEAR certificate binding") + result = qualify(parent, child, word, json.loads(certs_raw), caller, args.compiler_H) + result.update({ + "graphs": {"parent": PEER, "candidate": CANDIDATE}, "caller_sha256": CALLER, + "source_head": SOURCE_HEAD, "source_word_sha256": SOURCE_WORD, "source_certs_sha256": SOURCE_CERTS, + "transport_sha256": {"parent": parent_gzip, "candidate": child_gzip, "word": word_gzip, + "caller": caller_gzip}, + }) + if args.out is None: + print(json.dumps(result, sort_keys=True, indent=2)) + else: + with args.out.open("x", encoding="utf-8") as handle: + json.dump(result, handle, sort_keys=True, indent=2) + handle.write("\n") + print(result["status"]) + + +if __name__ == "__main__": + main() diff --git a/research/cf6a-banked-role1256-relay/price.py b/research/cf6a-banked-role1256-relay/price.py new file mode 100644 index 0000000000..67a5815f21 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/price.py @@ -0,0 +1,314 @@ +#!/usr/bin/env python3 +"""Join the exact supplied-word relay, physical costs and directed outer bound.""" + +from argparse import ArgumentParser +from collections import Counter +from fractions import Fraction +from pathlib import Path +import sys + +if not __debug__: + raise RuntimeError("Directed compiler checks require Python assertions") + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from caller import ( + CALLER, CANDIDATE, DATA, ENGINE, INVOICE, PARENT, PAID_DELTA, PHASE_DIGEST, PUBLIC, + SOURCE_HEAD, SOURCE_WORD, STATUS as CALLER_STATUS, check_sources, digest, load, need, + signed_delta, write, +) + + +CLAIM = "0.0037300417" +TARGET = "0.00372935" +BIT_FLOOR = "0.00376669" +GAP = Fraction(1, 10**14) +CARRIER_POWER = 1920 +AMBIENT_CAP = 153 +PHYSICAL_STATUS = "PASS_CF6A_RELAY_BANK_PHYSICAL" +STATUS = "PASS_CF6A_RELAY_DIRECTED_PRICE_OUTER" +COMPARATOR_7697 = { + "head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "graph": "d5dab11bb773bf5beb8ae2998be1282b243e2d1606c5257896a037c9b52c5c3b", + "caller_receipt": "cbef124e8b495b4bec9a1343500766af33b245121a486fff4a619c8eb284f2ad", + "signed_invoice_sha256": "6e8229022ef7c9a13a33a8df5e591114eb9de49bb5b7b20628bbe56c3fa2c3a7", + "lower": "0.0037266288769", "upper": "0.0037266288770", +} +PARENT_LOWER, PARENT_UPPER = "0.00372934317806", "0.00372934317807" +ASSUMPTIONS = ("native_all_columns", "owned_erasure", "compiler", "precision_tape", "analytic_recovery") +PINS = { + "directed_price.py": "446c8ebddf5b1e56d43b8d7f2ad3c1c9ba018a18105b207a0ac9e30386878a10", + "interval_gate.py": "60a743d13f668ef86db4b8215b4d5d04430a671ba6f1fe06d9c1c4c3dfe86da5", + "selected-claim.json": "3f8add8252adb223b60418ec69351a69b6b5edfe601ec1c6b4b65cd9e2afd9b2", + "selected-bit-ambient.json": "437ad2f9e7956e7f2b477b546f53a6c8cfa0567e207024300e9a7e58d3c0202c", + "selected-validation.json": "e1374a98b240d7f9f2cca2a1e74b93f240b1bfc94b8cc4b94a385a50281d494e", +} + + +def selected_bit(): + check_sources() + for name, pin in PINS.items(): + need(digest((ENGINE / name).read_bytes()) == pin, f"fixed directed price or selected input {name}") + claim = load(ENGINE / "selected-claim.json", PINS["selected-claim.json"]) + repair = load(ENGINE / "selected-bit-ambient.json", PINS["selected-bit-ambient.json"]) + validation = load(ENGINE / "selected-validation.json", PINS["selected-validation.json"]) + bit = next(row for row in claim["uniform_templates"] if row["family"] == "BIT before cover") + need(bit["ambient"] == 134 and bit["rank_encoding"] == "2^296630000000000" + and repair["exit_code"] == 0 and repair["source_unchanged"] + and validation["status"] == "admitted_conditional" and validation["registered_replays_complete"], + "selected ambient-corrected BIT anchor") + need(tuple(row["id"] for row in claim["assumptions"]) == ASSUMPTIONS + and Fraction(bit["saving"]) > Fraction("0.00385248") > Fraction(BIT_FLOOR), + "retained five named assumptions and conservative independently justified BIT saving") + return {"ambient": bit["ambient"], "rank_encoding": bit["rank_encoding"], + "source_template_saving": bit["saving"], "retained_completed_saving": "0.00385248", + "outer_floor": BIT_FLOOR, "assumptions": claim["assumptions"], + "selected_source_pins": {k: v for k, v in PINS.items() if k.startswith("selected-")}} + + +def checked_histograms(invoice, totals): + p = Counter({int(k): n for k, n in invoice["paid"].items()}) + t = Counter({int(k): n for k, n in invoice["targets"].items()}) + need(invoice["schema"] == "integer-mult-recursive-invoice/v1" + and invoice["contract"]["ambient_rank"] == 137 + and all(1 <= rank <= 137 and type(n) is int and n > 0 for h in (p, t) for rank, n in h.items()) + and (sum(p.values()), sum(t.values())) == totals, + "each positive paid placement and productive target in the fixed complete invoice") + coeff = {r: t[r] - p[r] for r in t.keys() | p.keys()} + need(sum(r * n for r, n in coeff.items()) == 1328, "complete conserved signed rank mass") + return p, t, coeff + + +def checked_bills(application): + need(application["status"] == CALLER_STATUS and application["source_head"] == SOURCE_HEAD + and application["source_word_sha256"] == SOURCE_WORD + and application["graphs"] == {"parent": PARENT, "candidate": CANDIDATE} + and application["caller_sha256"] == CALLER + and application["published_parent_invoice_sha256"] == INVOICE + and application["source_phase"]["phase_digest"] == PHASE_DIGEST + and application["source_phase"]["contacts"] == 12800 + and application["signed"]["calls"] == 16 and application["signed"]["root_owners"] == 3536 + and application["owners"]["fresh_helpers"] == 17616, "actual supplied 16-call receipt and frozen fingerprints") + invoices = application["invoices"] + old = load(DATA / "PR7697-INVOICE.json", COMPARATOR_7697["signed_invoice_sha256"]) + source = load(DATA / "SOURCE-INVOICE.json", INVOICE) + need(invoices["parent"] == source + and all(invoice["contract"] == source["contract"] for invoice in (invoices["candidate"], old)), + "supplied original and prior banked comparator use the same signed invoice model") + base = checked_histograms(source, (101856, 21152)) + alternate = checked_histograms(old, (101824, 21168)) + child = checked_histograms(invoices["candidate"], (101840, 21152)) + need(signed_delta(base[0], child[0]) == PAID_DELTA and base[1] == child[1] + and {int(k): n for k, n in application["signed_paid_delta"].items()} == PAID_DELTA + and application["signed_target_delta"] == {}, "only −32 rank-three and +16 rank-six whole-caller charges") + return {"pr7697": alternate, "parent": base, "candidate": child} + + +def directed_sign(coeff, point, sign): + from directed_price import moment + from interval_gate import B, moment as fixed_moment + + point = Fraction(point) + first = moment(coeff, point, point) + second = tuple(Fraction(bound, B) for bound in fixed_moment(coeff, point)) + for bounds in (first, second): + need(bounds[0] > 0 if sign > 0 else bounds[1] < 0, f"two strict directed prices at {point}") + common = (max(first[0], second[0]), min(first[1], second[1])) + need(common[0] <= common[1], "the independent directed intervals intersect") + return {"sign": sign, "binary_rational_log_exp": list(map(str, first)), + "decimal_fixed_grid": list(map(str, second)), "intersection": list(map(str, common)), + "display": list(map(float, common))} + + +def decimal_tick(tick, digits): + integral, fractional = divmod(tick, 10**digits) + return f"{integral}.{fractional:0{digits}d}" + + +def bisect_crossing(coeff): + from directed_price import moment + + steps = 10**13 + lo, hi = int(Fraction(TARGET) * steps), int(Fraction(BIT_FLOOR) * steps) + directed_sign(coeff, Fraction(lo, steps), 1) + directed_sign(coeff, Fraction(hi, steps), -1) + while hi - lo > 1: + tick = (lo + hi) // 2 + point = Fraction(tick, steps) + L, U = moment(coeff, point, point) + if L > 0: + lo = tick + elif U < 0: + hi = tick + else: + raise ValueError("directed root bracket cannot resolve a tick") + return decimal_tick(lo, 13), decimal_tick(hi, 13) + + +def price_calculations(bills): + from directed_price import moment + from interval_gate import gate + + old, parent, candidate = (bills[kind][2] for kind in ("pr7697", "parent", "candidate")) + high_old, low_old = COMPARATOR_7697["upper"], COMPARATOR_7697["lower"] + lo, hi = bisect_crossing(candidate) + probe = Fraction(CLAIM) + 7 * GAP + need(Fraction(low_old) < Fraction(high_old) < Fraction(PARENT_LOWER) < Fraction(PARENT_UPPER) + < Fraction(TARGET) < Fraction(CLAIM) < probe < Fraction(lo) < Fraction(hi) < Fraction(BIT_FLOOR), + "strict chain from the two comparator upper bounds to the new reporting and BIT points") + checks = { + "pr7697": {p: directed_sign(old, p, sign) for p, sign in + ((low_old, 1), (high_old, -1), (PARENT_UPPER, -1), (CLAIM, -1), (BIT_FLOOR, -1))}, + "parent": {p: directed_sign(parent, p, sign) for p, sign in + ((high_old, 1), (PARENT_LOWER, 1), (PARENT_UPPER, -1), (TARGET, -1), + (CLAIM, -1), (BIT_FLOOR, -1))}, + "candidate": {}, + } + for point, sign in ((high_old, 1), (PARENT_UPPER, 1), (TARGET, 1), (CLAIM, 1), + ("0.00373004170007", 1), (lo, 1), (hi, -1), (BIT_FLOOR, -1)): + checks["candidate"][point] = directed_sign(candidate, point, sign) + derivatives = {} + for kind, (p, t, coeff) in bills.items(): + result = moment(coeff, Fraction(), Fraction(BIT_FLOOR), derivative=True) + need(result[1] < 0, f"strictly decreasing {kind} moment on the whole admitted bracket") + derivatives[kind] = list(map(str, result)) + p, t, _ = bills["candidate"] + compiler = gate({"P": p, "T": t}, CLAIM, probe, lo, hi, BIT_FLOOR) + outer = compiler["outer"] + need(outer["strict_count"] == 54 and outer["functional_count"] == 4 + and Fraction(outer["minimum_margin"]) > 0 and outer["BIT_just_below_effective_rejected"], + "54 strict and four functional selected outer predicates") + root_fee_mutant = dict(candidate) + root_fee_mutant[1] -= 1 + extra_fee = directed_sign(root_fee_mutant, PARENT_UPPER, -1) + credit = directed_sign({r: -n for r, n in PAID_DELTA.items()}, CLAIM, 1) + k = Fraction(CLAIM) + need(probe == Fraction("0.00373004170007"), "literal compiled right-probe position") + return {"candidate_directed_conditional_lower": CLAIM, "candidate_raw_bracket": [lo, hi], + "signed_paid_delta": PAID_DELTA, "signed_target_delta": {}, + "published_comparator_7697": COMPARATOR_7697, + "supplied_comparator_7700_raw_bracket": [PARENT_LOWER, PARENT_UPPER], + "strict_gap_over_7697_upper": str(k - Fraction(high_old)), + "strict_gap_over_7700_raw_upper": str(k - Fraction(PARENT_UPPER)), + "directed_checks": checks, "directed_derivatives": derivatives, + "additional_raw_rank_one_rejected_at_7700_upper": extra_fee, "relay_credit_at_claim": credit, + "compiler": compiler, "recurrence_anchors": { + "carrier_power": CARRIER_POWER, "conservative_ambient_cap": AMBIENT_CAP, + "paid_cutoff": 11, "target_floor": 12, "tail_power_offset": "1/7", + "tail_ratio_upper": "31/32", "alpha_reserve": str(Fraction(1, 10**27)), + "claim_and_probe_increment": str(GAP), "test_increment_count": 7, + "b": str(k + 5*GAP), "a": str(k + 4*GAP), "q": str(k + 3*GAP), + "epsilon": str(1 - GAP), "beta": str(1 - 3*GAP)}} + + +def verify_ordinary(kind, physical, application, bills): + stats = physical["native"][kind] + replay = application["native"][kind] + work = physical["ordinary"][kind] + actual = application["ordinary_occurrences"][kind] + n, k, terms, homes = (stats[field] for field in ("public", "slots", "terms", "numerical_homes")) + paid, target = (sum(hist.values()) for hist in bills[kind][:2]) + need(all(stats[field] == replay[field] for field in ("public", "slots", "terms")) + and n == PUBLIC and k == (6144 if kind == "parent" else 6143) + and stats["coefficient_products"] == replay["checked_products"] + and stats["path_grid"] == int(replay["grid"]) + and stats["path_grid_odd"] == replay["odd"] and stats["path_grid_height"] == replay["dyadic_height"] + and stats["exact_all_public_rows"] == stats["same_owner_complete_fixture_outputs"] + == stats["exact_odd_unscale_outputs"] == n, + "all normalized endpoint rows, exact products, and complete same-owner physical installs") + need(homes == 2*n+k+5 <= 15290 and work["native_numeric_homes"] == homes + and work["raw_numeric_homes"] == 16*homes and work["raw_numeric_homes_plus_dummy"] == 16*(homes+1) + and stats["max_outstanding_native_senders"] == stats["guarded_dummy_slots"] == stats["separate_guide_tracks"] == 1 + and stats["additional_independent_guarded_streams"] == work["separate_guarded_streams_per_native"] == 4 + and work["separate_guarded_streams_raw"] == 64 and work["separate_guarded_guide_tracks_raw"] == 16 + and stats["retired_and_guards_restored"] and stats["all_public_inputs_preserved_until_final_installs"], + "complete owned bank, serialized sender, full CLEAR, dummy, guides and separately charged streams") + resets = 2*homes + 8*(terms+k+n) + 4*n + 2*k + transfers = 2*terms + 2*(k+n) + 6*k + 4*n + selector_l = 14*homes + 9 + selector_const = 63*homes - 7*homes.bit_count() + 27*homes.bit_length() + 59 + selected = [resets*(selector_l+2) + transfers*(selector_l+128), + resets*(selector_const+3) + transfers*(selector_const+320)] + need(work["reset_services_per_native"] == resets and work["typed_selected_transfers_per_native"] == transfers + and sum(work["reset_services_by_kind_per_native"].values()) == resets + and sum(work["typed_transfer_legs_by_kind_per_native"].values()) == transfers + and work["selected_total_steps_per_native_L_and_constant"] == selected + and work["selected_total_steps_raw_L_and_constant"] == [16*n for n in selected] + and all(work["layout"][field] for field in ("aggregate_owned_tuple_M", "guide_setup_and_retirement", + "complete_view_step_bound", "shadow_cells_upper")), + "actual full-width reset, overwrite, selected copy, guide and return formulas") + uses = application["signed"]["uses"] + conversions = 2*(3536 + 16*n) + scalar = 32*(16*(terms + 4*(k+n) + 2*n + homes + 2*k) + sum(uses.values()) + conversions) + maps = (2*(paid + target + 16*400) + 2*(uses["IDLE_ONE"] + uses["IDLE_ODD"]) + + 3*uses["QUERY"] + uses["LAMBDA"] + uses["IDLE_ODD"] + actual["root_head_translations"]) + scalar_bits = physical["scalar_services"]["coefficient_bits"] + need(work["raw_paid_positions"] == paid and work["raw_productive_targets"] == target + and work["native_paid_wrappers"] == 16*k and work["native_productive_wrappers"] == actual["fresh_helper_owners"] + and work["ordinary_main_pair_slots"]*2 == actual["main_phase_contacts"] + and work["root_negative_q_translations"] == actual["root_head_translations"] == 3536 + and work["odd_conversions"] == actual["odd_boundary_conversions"] == conversions + and work["ordinary_map_slots"] == maps and work["ordinary_elementary_record_upper"] == maps*4*(AMBIENT_CAP+1)**2 + and work["scalar_services"] == scalar and 0 < scalar_bits <= 24 + and work["scalar_step_rate"] == 2**max(20, scalar_bits+8), + "all physical scalar, conversion, chart-contact, wrapper and charged ordinary occurrences") + return {"native": {"public": n, "slots": k, "terms": terms, "grid": stats["path_grid"], + "checked_basis_products": stats["coefficient_products"], "stock_trace": stats["trace_sha256"]}, + "ordinary": work} + + +def physical_join(path, application, bills, compiler): + physical = load(path) + need(physical["status"] == PHYSICAL_STATUS and physical["graphs"] == application["graphs"] + and physical["caller_sha256"] == CALLER and physical["source_word_sha256"] == SOURCE_WORD + and physical["source_head"] == SOURCE_HEAD and physical["inherited_private_home_cap_per_stage"] == 15290 + and physical["raw_stage_count"] == 16 and physical["both_graphs_respect_historical_numeric_homes_and_streams"] + and physical["relay"]["new_recursive_charges_outside_replacement"] == 0, + "physical qualification of the exact graphs, source and actual 16 signed occurrences") + common = physical["common_exact_root"] + c = common["context_c"] + h = int(compiler["H"]) + depth_bits = (c*CARRIER_POWER * AMBIENT_CAP**CARRIER_POWER * (h+1)**2).bit_length() + guard = physical["bit_guard"] + need(c == 2*max(common["context_mass_bits"], common["context_binary_bits"]) + and common["caller_odd"] == application["signed"]["odd_scale"] == 2025 + and Fraction(common["context_mass_bound"]) > 0 and common["signed_width"] == "W=p+h+2D+3" + and guard["compiler_H"] == h and guard["argument_bit_length"] == depth_bits < h + and guard["strict_guard_passed"], + "common exact rooted precision and depth bound use the freshly computed actual H") + pair = {kind: verify_ordinary(kind, physical, application, bills) for kind in ("parent", "candidate")} + delta = {key: pair["candidate"]["ordinary"][key] - pair["parent"]["ordinary"][key] + for key in ("native_numeric_homes", "odd_conversions", "ordinary_map_slots", "scalar_services", + "reset_services_per_native", "typed_selected_transfers_per_native")} + need(delta["native_numeric_homes"] == -1 and delta["odd_conversions"] == 0 + and delta["ordinary_map_slots"] == -32, "the two wrapper maps on the removed call disappear at each stage") + return {"sha256": digest(path.read_bytes()), "compiler_H": h, "c": c, "depth_guard_bits": depth_bits, + "paired": pair, "candidate_minus_parent_ordinary": delta, + "inherited_private_home_cap_per_native": 15290, + "ordinary_substitution": { + "W": "p+h+2D+3", "Z": "W_p+O", "E_0": "64(Z+N+P+G+1)^3", + "B_0": "P+E_0", "C_0": "32*N*B_0^2", "N": "2^H", + "G": "Complete addressed selector, reset, copy, overwrite, exact scalar, phase, guide, view and return work with stored signed budgets.", + "O": "Complete simultaneous typed payload, guide, selector, independent stream, child, compiler and BIT spaces and all parked parent contexts."}} + + +def main(): + parser = ArgumentParser(description=__doc__) + parser.add_argument("--caller-proof", "--caller", type=Path, required=True) + parser.add_argument("--physical", type=Path, required=True) + parser.add_argument("--out", "--output", type=Path, required=True) + args = parser.parse_args() + bit = selected_bit() + application = load(args.caller_proof) + bills = checked_bills(application) + numerics = price_calculations(bills) + joined = physical_join(args.physical, application, bills, numerics["compiler"]) + result = {"status": STATUS, "graphs": application["graphs"], "caller_sha256": CALLER, + "source_head": SOURCE_HEAD, "source_word_sha256": SOURCE_WORD, + "caller_proof_sha256": digest(args.caller_proof.read_bytes()), + "invoices": application["invoices"], "selected_BIT": bit, "physical_join": joined, **numerics} + write(args.out, result) + print(STATUS, CLAIM, *numerics["candidate_raw_bracket"], numerics["strict_gap_over_7700_raw_upper"], flush=True) + + +if __name__ == "__main__": + main() diff --git a/research/cf6a-banked-role1256-relay/review/COMPARATOR-7697.json b/research/cf6a-banked-role1256-relay/review/COMPARATOR-7697.json new file mode 100644 index 0000000000..2cdf04270f --- /dev/null +++ b/research/cf6a-banked-role1256-relay/review/COMPARATOR-7697.json @@ -0,0 +1,52 @@ +{ + "caller": "62d94fb992acab0a71c3d12f22be4ce63f4f65e5cbe3f420b93aa1393ffa8dcf", + "full_receipt_sha256": "cbef124e8b495b4bec9a1343500766af33b245121a486fff4a619c8eb284f2ad", + "graph": "d5dab11bb773bf5beb8ae2998be1282b243e2d1606c5257896a037c9b52c5c3b", + "head": "f55fc1434436ffa1c6d064a29fc56812044b3157", + "invoice": { + "contract": { + "ambient_rank": 137, + "boundary": "actual signed caller research candidate with 16 native calls", + "model": "mixed-target-unnormalized-power-v1", + "rank_semantics": "H_r costs r^(1-C); debit surrendered productive fields" + }, + "paid": { + "1": 63408, + "16": 416, + "2": 14112, + "24": 416, + "3": 9680, + "32": 416, + "4": 3920, + "40": 416, + "48": 416, + "5": 5792, + "56": 416, + "6": 1392, + "7": 176, + "8": 752, + "9": 96 + }, + "schema": "integer-mult-recursive-invoice/v1", + "targets": { + "1": 304, + "129": 208, + "17": 416, + "2": 336, + "25": 416, + "3": 752, + "33": 416, + "4": 3632, + "41": 416, + "49": 416, + "5": 1248, + "57": 416, + "6": 704, + "65": 416, + "7": 304, + "8": 528, + "9": 10240 + } + }, + "pr": 7697 +} diff --git a/research/cf6a-banked-role1256-relay/review/JOIN.json b/research/cf6a-banked-role1256-relay/review/JOIN.json new file mode 100644 index 0000000000..f77fcc5195 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/review/JOIN.json @@ -0,0 +1,88 @@ +{ + "accepted_conditional_bound": "37300417/10000000000", + "assumption_ids": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "candidate": "8e7b755bd2d2d387bc3d3adfe48100985adf74775ca5acbb143170a3d16b5ccf", + "controls": [ + "fresh compiler and context depth guard mismatch", + "ordinary charge mismatch" + ], + "evidence_sha256": { + "CALLER": "f7714c03f0be9fa4213b456e13a12503c6ae681713163ed92f2352cba9981277", + "INDEPENDENT": "823ca36613209c6fce9cfe834ba0e0f75f914ddad41089cc263563786bce6e1a", + "PHYSICAL": "493ba55774b3da20b9d36e290e710ca36286e30a6a4cb85ef9c8d7b89a428e65", + "PRICE": "d6eb916179ba86082a31911494739d034daa615d2c252dc5ef094d9b7e9cfcb5" + }, + "independent_moment_at_outer_probe": { + "approx": [ + 2.482090814436341e-05, + 2.482090814436341e-05 + ], + "point": "373004170007/100000000000000", + "rational": [ + "2214098992494327670001423352704336846283/89202980794122492566142873090593446023921664", + "1107049496247163886042375283209519358171/44601490397061246283071436545296723011960832" + ] + }, + "one_rank_one_fee_at_7700_upper": { + "approx": [ + -0.7531753740634762, + -0.7531753740634762 + ], + "point": "372934317807/100000000000000", + "rational": [ + "-33592744213595146613561547922055664754866723/44601490397061246283071436545296723011960832", + "-33592744213595146613510515694072982638996389/44601490397061246283071436545296723011960832" + ] + }, + "ordinary": { + "candidate": { + "native_numeric_homes": 9150, + "odd_conversions": 55104, + "ordinary_elementary_record_upper": 26610490368, + "ordinary_map_slots": 280512, + "raw_numeric_homes": 146400, + "raw_paid_positions": 101840, + "raw_productive_targets": 21152, + "reset_services_per_native": 1477054, + "scalar_services": 122001408, + "selected_total_steps_raw_L_and_constant": [ + 3854456876480, + 17353295399840 + ], + "separate_guarded_streams_raw": 64, + "typed_selected_transfers_per_native": 402978 + }, + "parent": { + "native_numeric_homes": 9151, + "odd_conversions": 55104, + "ordinary_elementary_record_upper": 26613526016, + "ordinary_map_slots": 280544, + "raw_numeric_homes": 146416, + "raw_paid_positions": 101856, + "raw_productive_targets": 21152, + "reset_services_per_native": 1477074, + "scalar_services": 122005504, + "selected_total_steps_raw_L_and_constant": [ + 3854939523808, + 17355256863072 + ], + "separate_guarded_streams_raw": 64, + "typed_selected_transfers_per_native": 402988 + } + }, + "precision_and_depth": { + "H": 14571800000000000000, + "binary_height": 338, + "c": 1156, + "guard_bits": 14083, + "mass_bits": 578 + }, + "scope": "Independent finite invoice, stock and receipt join review. Production outer predicates are joined by evidence.", + "status": "PASS_INDEPENDENT_ACTUAL_PHYSICAL_CALLER_AND_OUTER_JOIN" +} diff --git a/research/cf6a-banked-role1256-relay/review/README.md b/research/cf6a-banked-role1256-relay/review/README.md new file mode 100644 index 0000000000..41b9240cd1 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/review/README.md @@ -0,0 +1,17 @@ +# Independent replay of the role-1256 relay + +The independent replay checked the exact #7700 word at commit `7d84799a447867d36137d12ef7ca5646154d763c`, the folded parent `72705b094d83d2ba24006661bbb031786a691b776bedb94515b1321e1535105f` and the relay child `8e7b755bd2d2d387bc3d3adfe48100985adf74775ca5acbb143170a3d16b5ccf`. It uses its own scalar basis replay, banked row checks, chart convolution and directed price arithmetic. [Independent result](../evidence/INDEPENDENT.json) · [Supplied #7700 word](https://github.com/CrocSwap/integer-mult-bounds/pull/7700) + +- The four sender terms of paid MOVE 95828 are available by child ordinal 2468. Its sole paid reader in the parent is the identity row at 104442. The direct transfer keeps key 104442, moves from parent ordinal 4114 to child ordinal 3310, and is available before its first reader at 6862. The other 7,643 rows keep their relative order. The exact replay checks 5,708,090 source coefficient products, all 235 raw CLEAR relations and every normalized public return. It rejects an added cocharted reader, an early placement before a donor, a changed identity sign, a self-CLEAR, a public erasure and the omission of a live CLEAR operand. +- The forward and adjoint checks compute all 512 columns of the direct 476→127 map and the ordered old 476→878→127 product. They reject a quarter-phase shift and reversed orientation. Banked rows keep the same ordered charts and all 1,501 independent public owners, including the retained role 1256 return. +- The actual signed 16-call invoice has 32 fewer rank-three payments and 16 more rank-six payments. All 21,152 productive targets remain. An independent rational enclosure places the raw root between `0.00373004177032` and `0.00373004177033`. At the outer probe `0.00373004170007` the signed moment is about `0.00002482090814436`. Adding one rank-one payment makes it negative at the #7700 raw upper. Restoring one of the two deleted rank-three families also defeats the round price control. +- The exact joined evidence recomputes 9,151 parent numerical homes and 9,150 child numerical homes per native stage against the inherited cap of 15,290. The guide, dummy and four guarded staging streams are accounted for separately. It checks the physical and caller receipt hashes joined into the directed price. The complete ordinary charges include addressed overwrite, selector, copy and scalar work, and the common precision guard gives `14083 < H` at `H = 14571800000000000000`. The join rejects an altered compiler bound and an omitted full copy charge. [Independent join result](JOIN.json) · [Physical contract](../PHYSICAL.md) · [Outer qualification](../CALLER.md) + +The conditional lower point `0.0037300417` exceeds the exact invoice upper of #7700 by `0.00000069852193` and that of #7697 by `0.0000034128230`. The independent replay checks the finite construction and invoice, recalculates the stock and precision arithmetic, and reads the frozen outer predicate receipt for the same input bytes. The five standing assumptions cover native realization on all columns, owned erasure, the compiler, fixed-tape precision and movement, and analytic recovery. Independent human maintainer review remains open. [Earlier #7697 comparator](https://github.com/CrocSwap/integer-mult-bounds/pull/7697) + +From the package directory, run both checks with CPython 3.12 and fresh output paths. + +```sh +python3.12 -I -B review/check.py --out /tmp/cf6a-independent.json +python3.12 -I -B review/check_join.py --out /tmp/cf6a-independent-join.json +``` diff --git a/research/cf6a-banked-role1256-relay/review/check.py b/research/cf6a-banked-role1256-relay/review/check.py new file mode 100644 index 0000000000..7a4f876d87 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/review/check.py @@ -0,0 +1,514 @@ +#!/usr/bin/env python3 +"""Independent exact raw, banked and signed checks for the single 1256 relay.""" + +import argparse +from collections import Counter +from fractions import Fraction as Q +from functools import cache +import gzip +from hashlib import sha256 +import json +from math import lcm +from pathlib import Path +import sys + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from orientation import compare_columns, support + +HERE = Path(__file__).resolve().parent.parent +SOURCE_HEAD = "7d84799a447867d36137d12ef7ca5646154d763c" +SOURCE = "ae62d5d8bef6f7146454b4b3643e487a58380c606a16c5baef7bf0dcf9df1472" +PARENT = "72705b094d83d2ba24006661bbb031786a691b776bedb94515b1321e1535105f" +CHILD = "8e7b755bd2d2d387bc3d3adfe48100985adf74775ca5acbb143170a3d16b5ccf" +CALLER = "62d94fb992acab0a71c3d12f22be4ce63f4f65e5cbe3f420b93aa1393ffa8dcf" +CERTS = "39ef28b708cd8bf1166b111d656809407b370dd11cd81a8e43820779f995aca3" +SOURCE_INVOICE = "a6b9a9529db9476e4b39ef4d4fad0a075f5675cbbedde99b7a08b2c007ff006d" +COMPARE_7697 = "c5ca88568459eb5aa7769ca7f9f430bcb117f39c2e2c16764517afb5daec4b7e" +REMOVE, KEEP, ROLE = 95828, 104442, 1256 +GRID = 225 * 2**18 + + +def require(ok, detail): + if not ok: + raise ValueError(detail) + + +def hash_bytes(raw): + return sha256(raw).hexdigest() + + +def current(path, digest): + raw = path.read_bytes() + if path.suffix == ".gz": + raw = gzip.decompress(raw) + require(hash_bytes(raw) == digest, f"byte pin {path.name}") + return json.loads(raw) + + +def blocked(fn, reason): + try: + fn() + except ValueError as exc: + require(str(exc) == reason, f"unexpected fault control {exc}") + else: + raise ValueError(f"fault control accepted {reason}") + return reason + + +def integer_smooth(n): + for p in (2, 3, 5): + while n % p == 0: + n //= p + return n == 1 + + +def ordered_ranks(frames): + spans = tuple(set(support(vectors)) for vectors in frames) + + @cache + def rank(a, b): + require(spans[a] < spans[b] or spans[b] < spans[a], "positive nested MOVE") + return abs(len(frames[a]) - len(frames[b])) + + return rank + + +@cache +def coeff(amount, is_scale): + q = Q(amount) + require(q != 0 and abs(q.numerator).bit_length() <= 24 and q.denominator.bit_length() <= 24 + and integer_smooth(q.denominator) + and (not is_scale or integer_smooth(abs(q.numerator))), "raw nonzero/smooth 24-bit coefficient") + return q + + +def row_add(dst, src, factor): + for i, x in src.items(): + y = dst.get(i, 0) + factor*x + if y: + dst[i] = y + else: + dst.pop(i, None) + + +def row_grid_add(dst, src, q): + a, b = q.numerator, q.denominator + for i, x in src.items(): + y, r = divmod(a*x, b) + require(r == 0, "raw scalar term grid") + total = dst.get(i, 0) + y + if total: + dst[i] = total + else: + dst.pop(i, None) + + +def prove_clear(owner, n, rows, terms): + require(owner >= n and owner in rows, "CLEAR must retire the actual owned lifetime") + require(owner not in terms, "CLEAR uses the erased role as its proof donor") + require(terms.keys() <= rows.keys(), "CLEAR donor not live") + common = lcm(*(q.denominator for q in terms.values())) + total = {} + for role, q in terms.items(): + row_add(total, rows[role], q.numerator * (common // q.denominator)) + require(total == {col: x*common for col, x in rows[owner].items()}, "exact CLEAR equation") + + +def moves_and_forms(g): + moves = {k: (a, b) for k, a, b in g["moves"]} + forms = {k: {j: Q(c) for j, c in row} for k, row in g["forms"]} + require(len(moves) == len(g["moves"]) and len(forms) == len(g["forms"]) + and all(len(forms[k]) == len(row) and all(forms[k].values()) for k, row in g["forms"]), + "unique literal normalized rows and donors") + return moves, forms + + +def raw_replay(word, certs, parent, raw_moves, raw_forms, rank): + n = word["public"] + require(certs["candidate_canonical_sha256"] == SOURCE and n == 1501 + and len(word["program"]) == parent["first_output"] == 154768 + and word["initial"] == parent["initial"] and word["final"] == parent["final"] + and word["frames"] == parent["frames"], "raw to folded source boundary") + certificates = {int(i): {int(r): Q(q) for r, q in row.items()} + for i, row in certs["clear_event_index"].items()} + state = {i: {i: GRID} for i in range(n)} + forms = {i: {~i: Q(1)} for i in range(n)} + charts = dict(enumerate(word["initial"])) + half = 0 + owned_max = 0 + nonzero = 0 + clear_controls = None + moves = set() + clears = set() + ops = Counter() + + for k, (op, r, *args) in enumerate(word["program"]): + ops[op] += 1 + touched = {r} + if op == "ADD": + s, amount, chart = args + q = coeff(amount, False) + require(r != s and charts.get(r) == charts.get(s) == chart, "active cocharted ADD") + row_grid_add(state[r], state[s], q) + row_add(forms[r], forms[s], q) + touched.add(s) + half += len(state[s]) + elif op == "SCALE": + amount, chart = args + q = coeff(amount, True) + require(charts.get(r) == chart, "active cocharted SCALE") + out = {} + row_grid_add(out, state[r], q) + half += len(state[r]) + state[r] = out + forms[r] = {i: q*v for i, v in forms[r].items()} + elif op == "MOVE": + a, b, owned = args + require(charts.get(r) == a and owned is (r >= n), "physical MOVE ownership and chart") + rank(a, b) + charts[r] = b + require(raw_moves[k] == (a, b) and raw_forms[k] == forms[r], "raw paid form equals frozen parent") + forms[r] = {k: Q(1)} + moves.add(k) + elif op == "INIT": + chart, = args + require(n <= r < n + word["owned_fields"] and r not in charts, "strict fresh private INIT") + charts[r] = chart + state[r], forms[r] = {}, {} + owned_max = max(owned_max, len(charts) - n) + elif op == "CLEAR": + chart, = args + require(charts.get(r) == chart and k in certificates, "ordered CLEAR chart and certificate") + proof = certificates[k] + prove_clear(r, n, state, proof) + touched.update(proof) + clears.add(k) + nonzero += bool(state[r]) + if state[r] and clear_controls is None: + clear_controls = { + "first_nonzero_clock": k, + "erased_owner": r, + "self_certificate": blocked(lambda: prove_clear(r, n, state, {r: Q(1)}), + "CLEAR uses the erased role as its proof donor"), + "public_erase": blocked(lambda: prove_clear(0, n, state, {}), + "CLEAR must retire the actual owned lifetime"), + "omit_nonzero_operand": blocked(lambda: prove_clear(r, n, state, {}), + "exact CLEAR equation"), + } + for registry in (charts, state, forms): + del registry[r] + else: + raise ValueError(f"unexpected raw literal {op}") + if REMOVE < k < KEEP: + require(ROLE not in touched, "role 1256 accessed inside the intermediate stays") + + require(set(charts) == set(state) == set(range(n)) and list(charts.values()) == word["final"] + and moves == raw_moves.keys() and clears == certificates.keys() + and len(clears) == 235 and nonzero == 193 and owned_max == 51, + "all raw MOVE, lifetime, CLEAR and boundary inventories") + end = parent["first_output"] + require(all(forms[i] == raw_forms[end+i] for i in range(n)), "all literal folded terminal forms") + expected = {i: {i: GRID} for i in range(n)} + for port, x in enumerate(word["live"]): + y = x + 112 + if port in word["hosted"]["Dports"]: + expected[y][x] = GRID + else: + expected[x][y] = -GRID + expected[y] = {x: GRID//2, y: GRID//2} + for x, y in zip(word["hosted"]["X2"], word["hosted"]["Y2"], strict=True): + expected[x][y] = -GRID + require(state == expected, "all 1501 independent external normalized rows") + return {"raw_input_grid": GRID, "exact_literal_products": half, + "raw_events": dict(ops), "ordered_clear_relations": len(clears), "nonzero_clear_operands": nonzero, + "peak_live_private": owned_max, "public_rows": len(expected), + "all_paid_and_terminal_folded_forms_matched": True, "controls": clear_controls} + + +def coframe_execution(graph, moves, rows): + order = graph["schedule"] + first = graph["first_output"] + public = range(len(graph["final"])) + require(len(order) == len(set(order)) == len(rows) + and set(order) == set(rows) == moves.keys() | {first + r for r in public}, + "each bank and terminal exactly once") + ready = {~r: chart for r, chart in enumerate(graph["initial"])} + for key in order: + if key in moves: + source, target = moves[key] + else: + source, target = graph["final"][key-first], None + require(all(ready.get(donor) == source for donor in rows[key]), "causal cochart donor") + if target is not None: + ready[key] = target + + +def exclusive(rows): + require([key for key, row in rows.items() if REMOVE in row] == [KEEP], + "removed bank has an additional reader") + require(rows[KEEP] == {REMOVE: Q(1)}, "surviving read is exactly identity") + + +def relay_check(word, parent, child, om, of, nm, nf, rank): + k = word["program"] + require(k[REMOVE] == ["MOVE", ROLE, 476, 878, False] + and k[KEEP] == ["MOVE", ROLE, 878, 127, False], "two exact public relay clocks") + require((om[REMOVE], om[KEEP], nm[KEEP]) == ((476, 878), (878, 127), (476, 127)), + "two old ordered pairs and the new one") + require(nm.keys() == om.keys() - {REMOVE} and nf.keys() == of.keys() - {REMOVE} + and all(nm[i] == om[i] for i in nm if i != KEEP) + and all(nf[i] == of[i] for i in nf if i != KEEP) + and REMOVE not in {donor for row in nf.values() for donor in row} + and nf[KEEP] == of[REMOVE], "only the exact silent relay contraction") + require(all(parent[field] == child[field] for field in ("initial", "final", "frames", "first_output")), + "unchanged public and geometry declarations") + require(all(g["metadata"]["source_pr_head"] == SOURCE_HEAD + and g["metadata"]["source_word_sha256"] == SOURCE + and g["metadata"]["caller_sha256"] == CALLER + for g in (parent, child)), "exact graph source metadata") + exclusive(of) + coframe_execution(parent, om, of) + coframe_execution(child, nm, nf) + parent_order = parent["schedule"] + child_order = child["schedule"] + require([i for i in parent_order if i not in (REMOVE, KEEP)] == + [i for i in child_order if i != KEEP], "all remaining row orders are preserved") + old_position = parent_order.index(KEEP) + new_position = child_order.index(KEEP) + require(new_position < old_position, "the surviving stable key actually moves earlier") + candidate_positions = {k: i for i, k in enumerate(child_order)} + donor_position = max(candidate_positions[i] for i in nf[KEEP] if i >= 0) + next_read = min(candidate_positions[k] for k, row in nf.items() if KEEP in row) + require(donor_position < new_position < next_read, "actual source-ready window for the moved row") + bad_order = [k for k in child_order if k != KEEP] + bad_order.insert(donor_position, KEEP) + premature = blocked(lambda: coframe_execution({**child, "schedule": bad_order}, nm, nf), + "causal cochart donor") + require(tuple(rank(*pair) for pair in (om[REMOVE], om[KEEP], nm[KEEP])) == (3, 3, 6), + "the complete grouped positive-rank change") + other = next(k for k, (src, _) in om.items() if src == 878 and k != KEEP + and parent["schedule"].index(k) > parent["schedule"].index(REMOVE)) + fault = {**of, other: {**of[other], REMOVE: Q(1)}} + coframe_execution(parent, om, fault) + additional_reader = blocked(lambda: exclusive(fault), "removed bank has an additional reader") + nonunit = {**of, KEEP: {REMOVE: Q(-1)}} + wrong_coefficient = blocked(lambda: exclusive(nonunit), "surviving read is exactly identity") + return {"role": ROLE, "old_slots": [REMOVE, KEEP], "paid_ranks": [3, 3, 6], + "sender_row": {k: str(v) for k, v in nf[KEEP].items()}, + "parent_removed_position": parent_order.index(REMOVE), "survivor_positions": [old_position, new_position], + "last_donor_and_first_reader_positions": [donor_position, next_read], + "control_premature_survivor": premature, + "global_equivalence": "all downstream rows use the same normalized return at the same chart", + "between_clock_public_and_clear_touches": 0, + "control_additional_cocharted_read_at": other, + "control_additional_cocharted_read": additional_reader, + "control_wrong_identity_weight": wrong_coefficient} + + +def owner_ranks(word, graph, caller, rank): + boundaries = word["hosted"] + mains = set(word["live"]) | {r+112 for r in word["live"]} | set(boundaries["X2"]) | set(boundaries["Y2"]) + require(len(mains) == 400 and len(graph["initial"]) == 1501, "actual native owner inventory") + types = caller["types"] + sides = {k: set(v["ports"]) for k, v in types.items()} + require(len(sides["A"]) == 96 and len(sides["B"]) == 8 + and sides["A"].isdisjoint(sides["B"]) and sides["A"] | sides["B"] == set(range(104)), + "exact disjoint A/B port inventory") + require(sides["A"] == set(boundaries["Dports"]), "literal slots use the raw main type split") + require(caller["stages"] == 16 and caller["ambient_rank"] == 137, "actual caller dimensions") + paid = Counter() + target = Counter() + roots = set() + stage_tags = set() + stage_order = [] + targets_once = Counter(rank(a, b) for i, (a, b) in enumerate(zip(graph["initial"], graph["final"], strict=True)) + if i not in mains) + native_paid_once = Counter(rank(a, b) for _, a, b in graph["moves"]) + for event in caller["events"]: + if event[0] == "J": + _, stage, a, b = event + require(len(a) == 4 and len(b) == 4 and b[2:] == ["-1","1/2"] + and len(set(a + b[:2])) == 6 + and all(0 <= role < types["A"]["roles"] for role in a) + and all(types["B"]["offset"] <= role < caller["roles"] for role in b[:2]), + "actual J signs and owners") + stage_order.append(stage) + paid.update(native_paid_once) + target.update(targets_once) + stage_tags.update((stage, r) for r in range(1501) if r not in mains) + else: + role_type, op, r, *tail = event + count = len(sides[role_type]) + if op == "QUERY": + paid[1] += count + elif op in ("IDLE_ONE", "IDLE_ODD"): + stage_bits = tail[0] + require(len(stage_bits) == len(set(stage_bits)) and all(1 <= i <= 16 for i in stage_bits), + "actual idle has distinct blocks") + paid[8 * len(stage_bits) + (op == "IDLE_ODD")] += count + require(stage_order == list(range(1, 17)), "sixteen actual calls in literal order") + for name, spec in types.items(): + for i, (phase, alpha, *selection) in enumerate(spec["diagonal"]): + require(alpha == 0 and len(selection) == 16 and set(selection) <= {0, 1} + and sum(selection) > 0, "actual productive signed call root") + target[8 * sum(selection) + (phase % 2)] += len(sides[name]) + roots.update((port, spec["offset"]+i) for port in sides[name]) + require(len(roots) == 3536 and len(stage_tags) == 17616 + and len(roots) + len(stage_tags) == sum(target.values()) == 21152, + "whole external target census") + return paid, target + + +def invoice_counts(obj): + return tuple(Counter({int(r): n for r, n in obj[side].items()}) for side in ("paid", "targets")) + + +def positive_log(z): + n = 24 + partial = 2 * sum((z**(2*j+1) / (2*j+1) for j in range(n)), Q()) + return partial, partial + 2 * z**(2*n+1) / ((2*n+1)*(1-z*z)) + + +@cache +def log_rank(r): + bits = r.bit_length() - 1 + m = Q(r, 1 << bits) + a, b = positive_log((m-1)/(m+1)) + c, d = positive_log(Q(1, 3)) + return a+bits*c, b+bits*d + + +def negative_exp(x): + require(0 <= x < 1, "alternating exponential range") + y = part = Q(1) + for i in range(1, 18): + y *= -x/i + part += y + return part, part-y + + +@cache +def root_weight(rank, k): + a, b = log_rank(rank) + low = rank * negative_exp(k*b)[0] + high = rank * negative_exp(k*a)[1] + d = 1 << 150 + return Q((low.numerator*d)//low.denominator, d), Q(-((-high.numerator*d)//high.denominator), d) + + +def signed_interval(invoice, l, r=None, derivative=False): + paid, target = invoice + r = l if r is None else r + low = high = Q() + for rank in set(paid) | set(target): + subtraction = target[rank]-paid[rank] + a, b = root_weight(rank, r)[0], root_weight(rank, l)[1] + if derivative: + la, lb = log_rank(rank) + a, b = -b*lb, -a*la + lq, rq = sorted((subtraction*a, subtraction*b)) + low += lq + high += rq + return low, high + + +def directed_result(invoice, point, required_sign): + val = signed_interval(invoice, point) + require(val[0] > 0 if required_sign > 0 else val[1] < 0, f"directed price sign at {point}") + return {"point": str(point), "rational": list(map(str, val)), "approx": list(map(float, val))} + + +def price_proof(word, parent, child, caller, rank): + start = owner_ranks(word, parent, caller, rank) + end = owner_ranks(word, child, caller, rank) + expected_start = invoice_counts(current(HERE/"data/SOURCE-INVOICE.json", SOURCE_INVOICE)) + prior = current(HERE/"review/COMPARATOR-7697.json", COMPARE_7697) + require(prior["caller"] == CALLER + and prior["head"] == "f55fc1434436ffa1c6d064a29fc56812044b3157", + "exact previous compatible caller") + accepted_invoice = invoice_counts(prior["invoice"]) + require(start == expected_start, "literal replay matches #7700's full supplied invoice") + delta = end[0].copy() + delta.subtract(start[0]) + require({r: n for r, n in delta.items() if n} == {3: -32, 6: 16} and start[1] == end[1], + "all signed paid and target changes") + require((sum(start[0].values()), sum(end[0].values()), sum(end[1].values())) == (101856, 101840, 21152), + "full signed denominators") + + p7697_lo, p7697_hi = Q("0.0037266288769"), Q("0.0037266288770") + p7700_lo, p7700_hi = Q("0.00372934317806"), Q("0.00372934317807") + threshold = Q("0.00372935") + cap = Q("0.00376669") + checks = { + "prior_7697_bracket": [directed_result(accepted_invoice, p7697_lo, 1), + directed_result(accepted_invoice, p7697_hi, -1)], + "raw_7700_bracket": [directed_result(start, p7700_lo, 1), + directed_result(start, p7700_hi, -1)], + "candidate_at_round_probe": directed_result(end, threshold, 1), + } + for invoice in (start, end, accepted_invoice): + require(signed_interval(invoice, p7697_lo, cap, derivative=True)[1] < 0, + "complete moment strictly decreases through the compatible interval") + one_fee = end[0].copy() + one_fee[1] += 1 + missing_group = end[0].copy() + missing_group[3] += 16 + checks["one_new_rank_one_fee"] = directed_result((one_fee, end[1]), threshold, -1) + checks["restore_one_simultaneously_replaced_rank_three_family"] = directed_result( + (missing_group, end[1]), threshold, -1) + + precision = 10**14 + lo, hi = int(threshold*precision), int(cap*precision) + while lo+1 < hi: + mid = (lo+hi)//2 + bounds = signed_interval(end, Q(mid, precision)) + require(bounds[0] > 0 or bounds[1] < 0, "directed bisection rejects uncertain sign") + if bounds[0] > 0: + lo = mid + else: + hi = mid + checks["candidate_crossing"] = [directed_result(end, Q(lo, precision), 1), + directed_result(end, Q(hi, precision), -1)] + ordinary_guarded_lower = Q(lo-10, precision) + require(ordinary_guarded_lower > max(p7697_hi, p7700_hi), "strictly beats both directed upper points") + checks["guarded_candidate_lower_point"] = directed_result(end, ordinary_guarded_lower, 1) + return {"input_paid_counts": start[0], "output_paid_counts": end[0], "whole_targets": end[1], + "checks": checks, "comparison_scope": "actual literal 16-call signed invoice", + "exponent_convention": "each positive rank r costs r^(1-kappa)"} + + +def main(): + cli = argparse.ArgumentParser(description=__doc__) + cli.add_argument("--out", type=Path, required=True) + args = cli.parse_args() + require(not args.out.exists(), "exclusive review output") + word = current(HERE/"data/WORD.json.gz", SOURCE) + certs = current(HERE/"data/CERTS.json", CERTS) + parent = current(HERE/"data/PARENT-GRAPH.json.gz", PARENT) + child = current(HERE/"data/CANDIDATE-GRAPH.json.gz", CHILD) + caller = current(HERE/"data/CALLER.json.gz", CALLER) + om, of = moves_and_forms(parent) + nm, nf = moves_and_forms(child) + rank = ordered_ranks(word["frames"]) + relay = relay_check(word, parent, child, om, of, nm, nf, rank) + replay = raw_replay(word, certs, parent, om, of, rank) + gaussian = compare_columns(word["frames"]) + price = price_proof(word, parent, child, caller, rank) + result = { + "status": "PASS_INDEPENDENT_ROLE1256_RAW_CLEAR_READY_PHASE_AND_DIRECTED_PRICE", + "source": SOURCE, "source_head": SOURCE_HEAD, "parent_graph": PARENT, "changed_graph": CHILD, + "signed_caller": CALLER, "raw_clear_certificates": CERTS, + "literal_source_and_owned_guard": replay, + "banked_relay": relay, + "native_direct_columns": gaussian, + "price": price, + "scope": "Independent implementation checks under the retained five P104 assumptions, not independent human theorem approval", + } + with args.out.open("x") as out: + json.dump(result, out, indent=2, sort_keys=True) + out.write("\n") + print(result["status"]) + + +if __name__ == "__main__": + main() diff --git a/research/cf6a-banked-role1256-relay/review/check_join.py b/research/cf6a-banked-role1256-relay/review/check_join.py new file mode 100644 index 0000000000..672b2aab77 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/review/check_join.py @@ -0,0 +1,171 @@ +#!/usr/bin/env python3 +"""Audit the published physical, caller and outer joins against the independent replay.""" + +import argparse +from fractions import Fraction as Q +import json +from pathlib import Path +import sys + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from check import CALLER, CHILD, HERE, PARENT, SOURCE, SOURCE_HEAD, blocked, current, directed_result +from check import hash_bytes, invoice_counts, require + + +def evidence(name): + raw = (HERE / "evidence" / f"{name}.json").read_bytes() + return hash_bytes(raw), json.loads(raw) + + +def counts(physical, caller, graph, invoice, side): + n = len(graph["initial"]) + k = len(graph["moves"]) + terms = sum(len(row) for _, row in graph["forms"]) + homes = n + k + n + 4 + 1 + stages = sum(event[0] == "J" for event in caller["events"]) + roots = sum(len(spec["ports"]) * len(spec["diagonal"]) for spec in caller["types"].values()) + negative_roots = sum(len(spec["ports"]) * sum(row[0] < 0 for row in spec["diagonal"]) + for spec in caller["types"].values()) + contacts = 2 * stages * 400 + native = physical["native"][side] + logical = native["selected_logical_operations"] + require((n, stages, roots, contacts) == (1501, 16, 3536, 12800) + and native["slots"] == native["max_outstanding_native_senders"] * k + and native["numerical_homes"] == homes <= physical["inherited_private_home_cap_per_stage"] == 15290 + and native["immutable_entry_banks"] == native["deferred_terminal_banks"] == n + and native["immutable_paid_return_banks"] == k + and native["max_outstanding_native_senders"] == native["separate_guide_tracks"] + == native["guarded_dummy_slots"] == 1 + and native["additional_independent_guarded_streams"] == native["native_scalar_scratch_homes"] == 4 + and native["retired_and_guards_restored"] and native["all_public_inputs_preserved_until_final_installs"], + "physical ownership or home count") + require(logical["write_entrance"] == logical["write_terminal"] + == logical["read_terminal_for_same_owner_install"] == n + and logical["read_immutable_donor"] == terms + and logical["initialize_complete_dirty_home"] == logical["retire_complete_home"] == homes + and all(logical[key] == k for key in ("initialize_empty_sender_before_departure", "stage_full_sender", + "read_parked_sender", "write_complete_return", + "clear_full_sender_after_return")), + "incomplete physical lifecycle") + require(all(cells == logical[work] * native["fixture_addressed_cells_per_home"] + for work, cells in native["fixture_addressed_cells_overwritten"].items()), "complete overwrite fixture") + conversions = 2 * (roots + stages * n) + resets = 2 * homes + 8 * terms + 10 * k + 12 * n + copies = 2 * terms + 8 * k + 6 * n + selector_span = 14 * homes + 9 + selector_constant = 63 * homes - 7 * homes.bit_count() + 27 * homes.bit_length() + 59 + select = [resets*(selector_span+2) + copies*(selector_span+128), + resets*(selector_constant+3) + copies*(selector_constant+320)] + uses = physical["caller_exact"]["uses"] + paid, targets = map(lambda counts: sum(counts.values()), invoice_counts(invoice)) + maps = (2 * (paid + targets) + contacts + 2 * uses["IDLE_ONE"] + 3 * uses["IDLE_ODD"] + + 3 * uses["QUERY"] + uses["LAMBDA"] + negative_roots) + scalar = 32 * (stages * (terms + homes + 6*(k+n)) + sum(uses.values()) + conversions) + output = {"native_numeric_homes": homes, "raw_numeric_homes": stages * homes, + "separate_guarded_streams_raw": 4 * stages, "odd_conversions": conversions, + "reset_services_per_native": resets, "typed_selected_transfers_per_native": copies, + "selected_total_steps_raw_L_and_constant": [stages * x for x in select], + "ordinary_map_slots": maps, "ordinary_elementary_record_upper": 4 * 154**2 * maps, + "scalar_services": scalar, "raw_paid_positions": paid, "raw_productive_targets": targets} + require(all(physical["ordinary"][side][field] == value for field, value in output.items()), "ordinary charge mismatch") + return output + + +def depth_guard(physical, price): + envelope = physical["caller_hereditary_envelope"] + native = physical["native"].values() + a = max(envelope["binary_height_at_all_completed_cuts_and_products"], + *(envelope["binary_height_at_native_entrances"] + row["path_grid_height"] for row in native)) + before_joint = Q(envelope["scaled_mass_at_native_entrances"]) + mass = max(Q(envelope["scaled_mass_at_all_cuts_and_products"]), + *(before_joint * row["path_grid_odd"] * Q(row["positive_path_mass_bound_unscaled"]) for row in native)) + b = mass.numerator.bit_length() - mass.denominator.bit_length() + if mass > 2**b: + b += 1 + context = physical["common_exact_root"] + c = 2 * max(a, b) + h = int(price["compiler"]["H"]) + carrier, ambient = (price["recurrence_anchors"][field] for field in ("carrier_power", "conservative_ambient_cap")) + bits = (c * carrier * ambient**carrier * (h+1)**2).bit_length() + guard = physical["bit_guard"] + require((carrier, ambient) == (1920, 153) and (a, b, c) == (338, 578, 1156) + and (context["context_binary_bits"], context["context_mass_bits"], context["context_c"]) == (a, b, c) + and Q(context["context_mass_bound"]) == mass and context["signed_width"] == "W=p+h+2D+3" + and context["temporary_width"] == "W+26" and context["exact_grid"] == "2^(-p-D)" + and guard["strict_guard_passed"] and guard["argument_bit_length"] == bits < h + and guard["compiler_H"] == h, "fresh compiler and context depth guard mismatch") + return {"H": h, "binary_height": a, "mass_bits": b, "c": c, "guard_bits": bits} + + +def main(): + cli = argparse.ArgumentParser(description=__doc__) + cli.add_argument("--out", type=Path, required=True) + args = cli.parse_args() + require(not args.out.exists(), "exclusive review output") + records = {key: evidence(key) for key in ("INDEPENDENT", "CALLER", "PHYSICAL", "PRICE")} + audit, caller_receipt, physical, price = (records[key][1] for key in records) + caller = current(HERE/"data/CALLER.json.gz", CALLER) + graphs = {"parent": current(HERE/"data/PARENT-GRAPH.json.gz", PARENT), + "candidate": current(HERE/"data/CANDIDATE-GRAPH.json.gz", CHILD)} + require((audit["source_head"], audit["source"], audit["parent_graph"], audit["changed_graph"], audit["signed_caller"]) + == (SOURCE_HEAD, SOURCE, PARENT, CHILD, CALLER), "independent evidence belongs to these exact inputs") + for receipt in (caller_receipt, physical, price): + require(receipt["graphs"] == {"parent": PARENT, "candidate": CHILD} + and (receipt["source_head"], receipt["source_word_sha256"], receipt["caller_sha256"]) + == (SOURCE_HEAD, SOURCE, CALLER), "joined source, graph and caller pins") + require(price["caller_proof_sha256"] == records["CALLER"][0] + and price["physical_join"]["sha256"] == records["PHYSICAL"][0] + and price["invoices"] == caller_receipt["invoices"], "exact author evidence bytes joined to price") + independent = audit["price"] + for side, pay_key in (("parent", "input_paid_counts"), ("candidate", "output_paid_counts")): + require(price["invoices"][side]["paid"] == independent[pay_key] + and price["invoices"][side]["targets"] == independent["whole_targets"], "entire independently grouped bill") + ordinary = {side: counts(physical, caller, graphs[side], price["invoices"][side], side) for side in graphs} + compiler = depth_guard(physical, price) + require(compiler["H"] == price["physical_join"]["compiler_H"] + and compiler["c"] == price["physical_join"]["c"] + and compiler["guard_bits"] == price["physical_join"]["depth_guard_bits"] + and all(price["physical_join"]["paired"][side]["ordinary"] == physical["ordinary"][side] + for side in graphs), "outer uses entire replayed ordinary budgets") + assumption_ids = [a["id"] for a in price["selected_BIT"]["assumptions"]] + require(assumption_ids == ["native_all_columns", "owned_erasure", "compiler", "precision_tape", "analytic_recovery"], + "selected assumptions changed") + require(price["compiler"]["outer"] == {"BIT_just_below_effective_rejected": True, "functional_count": 4, + "minimum_margin": "1/1000000000000000", "strict_count": 54}, + "selected production outer predicates") + lower = Q(price["candidate_directed_conditional_lower"]) + tested = Q(price["compiler"]["tested"]) + high_7700 = Q(price["supplied_comparator_7700_raw_bracket"][1]) + high_7697 = Q(price["published_comparator_7697"]["upper"]) + p0, p1 = map(lambda result: Q(result["point"]), independent["checks"]["candidate_crossing"]) + b0, b1 = map(Q, price["candidate_raw_bracket"]) + require((lower, high_7700, high_7697) == (Q(".0037300417"), Q(".00372934317807"), Q(".0037266288770")) + and lower - high_7700 == Q(price["strict_gap_over_7700_raw_upper"]) + and lower - high_7697 == Q(price["strict_gap_over_7697_upper"]) + and max(high_7697, high_7700) < lower < tested < b0 < p0 < p1 < b1, + "conditional quote, upper comparators and compatible raw intervals") + candidate = invoice_counts(price["invoices"]["candidate"]) + own_moment = directed_result(candidate, tested, 1) + paid, productive = candidate + paid[1] += 1 + fee_control = directed_result((paid, productive), high_7700, -1) + wrong_compiler = {**price, "compiler": {**price["compiler"], "H": compiler["H"]+1}} + wrong_bank = {**physical, "ordinary": {**physical["ordinary"], "candidate": {**physical["ordinary"]["candidate"], + "typed_selected_transfers_per_native": 0}}} + controls = [blocked(lambda: depth_guard(physical, wrong_compiler), "fresh compiler and context depth guard mismatch"), + blocked(lambda: counts(wrong_bank, caller, graphs["candidate"], price["invoices"]["candidate"], + "candidate"), "ordinary charge mismatch")] + result = {"status": "PASS_INDEPENDENT_ACTUAL_PHYSICAL_CALLER_AND_OUTER_JOIN", "candidate": CHILD, + "evidence_sha256": {key: value[0] for key, value in records.items()}, "ordinary": ordinary, + "precision_and_depth": compiler, "assumption_ids": assumption_ids, + "accepted_conditional_bound": str(lower), "independent_moment_at_outer_probe": own_moment, + "one_rank_one_fee_at_7700_upper": fee_control, "controls": controls, + "scope": "Independent finite invoice, stock and receipt join review. Production outer predicates are joined by evidence."} + with args.out.open("x") as stream: + json.dump(result, stream, indent=2, sort_keys=True) + stream.write("\n") + print(result["status"]) + + +if __name__ == "__main__": + main() diff --git a/research/cf6a-banked-role1256-relay/review/orientation.py b/research/cf6a-banked-role1256-relay/review/orientation.py new file mode 100644 index 0000000000..ced649b976 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/review/orientation.py @@ -0,0 +1,116 @@ +"""Direct Gaussian columns for the ordered 476 → 878 → 127 relay. + +The canonical frame rule is the chart-dephased XOR convolution. Expand +it directly in integers here, independently of the native lowering engine. +""" + +from hashlib import sha256 +import json + + +def ensure(value, reason): + if not value: + raise ValueError(reason) + + +def support(vectors): + result = [0] + for v in vectors: + ensure(v not in result, "independent frame basis") + result.extend([x ^ v for x in result]) + return result + + +def phase_polynomial(basis): + """Find the coordinate inverse by enumerating the 512-point basis bijection.""" + if len(basis) in (0, 9): + return [0] * 512 + image = support(basis) + for e in (1 << j for j in range(9)): + if e not in image: + image.extend([x ^ e for x in image]) + ensure(len(image) == len(set(image)) == 512, "square ordered chart extension") + inverse = {value: i for i, value in enumerate(image)} + dual = [inverse[1 << j] for j in range(9)] + unary = [1 ^ (value.bit_count() % 2) for value in dual] + pairs = [(1 << j) | (1 << i) for j in range(9) for i in range(j) + if (dual[j] & dual[i]).bit_count() % 2] + return [ + (sum(a for j, a in enumerate(unary) if x & (1 << j)) + + 2 * sum(x & mask == mask for mask in pairs)) % 4 + for x in range(512) + ] + + +def rotate(a, b, kind): + return ((a, b), (-b, a), (-a, -b), (b, -a))[kind % 4] + + +def direct_frame(basis, sign): + bits = len(basis) + powers = support(basis) + phases = phase_polynomial(basis) + a, b = 1, 0 + for _ in range(bits): + a, b = a - sign*b, b + sign*a + offsets = [(effect, sign * mask.bit_count()) for mask, effect in enumerate(powers)] + + def apply(source): + ans = {} + for x, (u, v) in source.items(): + re, im = u*a-v*b, u*b+v*a + previous = phases[x] + for offset, flips in offsets: + y = x ^ offset + wr, wi = rotate(re, im, phases[y] - previous - flips) + old_r, old_i = ans.get(y, (0, 0)) + ans[y] = old_r + wr, old_i + wi + return {k: value for k, value in ans.items() if value != (0, 0)} + + return apply + + +def compare_columns(frames): + a, b, c = 476, 878, 127 + ensure(set(support(frames[a])) < set(support(frames[b])) < set(support(frames[c])), + "exact binary nested charts") + canonical = {(chart, sign): direct_frame(frames[chart], sign) + for chart in (a, b, c) for sign in (-1, 1)} + + def run(k, path): + vect = {k: (1, 0)} + denominator_bits = 0 + for chart, sign in path: + vect = canonical[chart, sign](vect) + denominator_bits += len(frames[chart]) + return vect, denominator_bits + + def literal(vect): + return json.dumps(sorted(vect.items()), separators=(",", ":")).encode() + + summaries = {} + first = {} + for source, center, target, direction in ((a, b, c, "forward"), (c, b, a, "adjoint")): + joined_path = ((source, -1), (target, 1)) + original_path = ((source, -1), (center, 1), (center, -1), (target, 1)) + direct_hash = sha256() + for col in range(512): + changed, new_bits = run(col, joined_path) + original, old_bits = run(col, original_path) + stretch = 1 << (old_bits - new_bits) + ensure(len(changed) == 64 and old_bits == new_bits + 12, "all columns have rank-six support") + ensure(original == {i: (stretch*x, stretch*y) for i, (x, y) in changed.items()}, + f"same exact {direction} Gaussian column {col}") + direct_hash.update(literal(changed)) + if col == 0: + first[direction] = changed + summaries[direction] = {"columns": 512, "entries_each": 64, + "unreduced_denominator_power_of_two": new_bits, + "sha256": direct_hash.hexdigest()} + rotated = {i: rotate(x, y, 1) for i, (x, y) in first["forward"].items()} + ensure(rotated != first["forward"], "same-rank global quarter-phase fault") + ensure(summaries["forward"]["sha256"] != summaries["adjoint"]["sha256"], + "reversing the orientation is detected") + return {"method": "direct integer chart-dephased XOR convolution; no production native engine", + "charts": [a, b, c], "source_and_destination_ranks": [3, 3, 6], + **summaries, "quarter_phase_rejected": True, "wrong_orientation_rejected": True} diff --git a/research/cf6a-banked-role1256-relay/verify.py b/research/cf6a-banked-role1256-relay/verify.py new file mode 100644 index 0000000000..6dade279a2 --- /dev/null +++ b/research/cf6a-banked-role1256-relay/verify.py @@ -0,0 +1,88 @@ +"""Rebuild the role-1256 banked application and compare its scientific receipts.""" + +import argparse +from datetime import datetime +from hashlib import sha256 +import json +from pathlib import Path +import subprocess +import sys +from tempfile import TemporaryDirectory + + +PACKAGE = Path(__file__).resolve().parent + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def read(path): + with path.open(encoding="utf-8") as stream: + return json.load(stream) + + +def digest(path): + return sha256(path.read_bytes()).hexdigest() + + +def check_assets(): + manifest = read(PACKAGE / "ASSETS.json") + for record in manifest["files"]: + path = PACKAGE / record["path"] + require(path.is_file() and not path.is_symlink(), f"Missing package input {path}") + require(path.stat().st_size == record["bytes"] and digest(path) == record["sha256"], + f"Incorrect package bytes for {record['path']}") + + +def invoke(tmp, name, script, *arguments, directory=False, expected_path=None): + target = tmp / name if directory else tmp / f"{name}.json" + if directory: + target.mkdir() + command = [sys.executable, "-I", "-B", "-X", f"pycache_prefix={tmp / 'bytecode'}", + str(PACKAGE / script), *map(str, arguments), "--out", str(target)] + print(f"Replaying {name}", flush=True) + subprocess.run(command, cwd=PACKAGE, check=True) + result = target / f"{name}.json" if directory else target + actual = read(result) + expected = read(expected_path or PACKAGE / "evidence" / f"{name}.json") + if name == "NATIVE": + start = target / "START.json" + require(actual["start_sha256"] == digest(start) and + read(start)["runner_sha256"] == digest(PACKAGE / script) and + read(start)["started_at"] == actual["started_at"] and + datetime.fromisoformat(actual["started_at"]) <= datetime.fromisoformat(actual["completed_at"]) and + actual["cpu_seconds"] > 0 and actual["peak_rss_kib"] > 0, + "Invalid native run metadata") + for key in ("started_at", "completed_at", "start_sha256", "cpu_seconds", "peak_rss_kib"): + del actual[key], expected[key] + require(actual == expected, f"Scientific receipt differs for {name}") + return result + + +def replay(group): + check_assets() + with TemporaryDirectory(prefix="cf6a-relay-") as temp: + tmp = Path(temp) + if group == "core": + invoke(tmp, "OPERATOR", "check_operator.py") + physical = invoke(tmp, "PHYSICAL", "physical.py") + caller = invoke(tmp, "CALLER", "caller.py") + invoke(tmp, "PRICE", "price.py", "--caller-proof", caller, "--physical", physical) + invoke(tmp, "INDEPENDENT", "review/check.py") + invoke(tmp, "JOIN", "review/check_join.py", expected_path=PACKAGE / "review/JOIN.json") + elif group == "native": + native = invoke(tmp, "NATIVE", "native.py", directory=True) + require(digest(native.parent / "RECIPES.json.gz") == + digest(PACKAGE / "native_support/RECIPES.json.gz"), + "Ordered native recipes differ from the committed catalogue") + else: + invoke(tmp, "DENSE", "dense.py") + print(f"PASS_CF6A_ROLE1256_{group.upper()}", flush=True) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("group", choices=("core", "native", "dense")) + replay(parser.parse_args().group) diff --git a/research/historical-selected-replay-gap/README.md b/research/historical-selected-replay-gap/README.md index 55d8cc3b49..36d9a873ca 100644 --- a/research/historical-selected-replay-gap/README.md +++ b/research/historical-selected-replay-gap/README.md @@ -69,7 +69,11 @@ python3 -B scripts/research_package.py --package research/historical-selected-re The direct command prints `PASS_HISTORICAL_SELECTED_REPLAY_GAP`. A registered replay prints `PASS_REGISTERED_RESEARCH_PACKAGE`. Both require Git history -containing the two inspected commits. +containing the two inspected commits and the source and manifest objects at +`2485805a6d47f36ea83ddde6327d453ac82d44dc`. The verifier uses a temporary +sparse checkout of that commit, checks the declared source digests there, and +uses its planner and manifest inventory. The recorded rejections and selection +therefore remain reproducible after later changes to the live Makefile or CI guide. ## Open next questions diff --git a/research/historical-selected-replay-gap/SOURCES.json b/research/historical-selected-replay-gap/SOURCES.json index c1010eec95..62bb8b3950 100644 --- a/research/historical-selected-replay-gap/SOURCES.json +++ b/research/historical-selected-replay-gap/SOURCES.json @@ -4,13 +4,13 @@ "files": [ { "path": "Makefile", - "usage": "input", + "usage": "provenance", "git_blob": "0d683a06b9e7ee162496108ce9a7c5d2ee94fccf", "sha256": "4f2d4f2dcd15139ec82658a975f85ed300897385f85799218539f4c8d60567da" }, { "path": "certificates/partial-swap-network.json", - "usage": "input", + "usage": "provenance", "git_blob": "eccafa830c16170c36faf93045ddf1f638f7bcd4", "sha256": "4c0b9d37e1034b2076e30a70f8e514416298c462d9ee98bc87fe6556b14df786" }, @@ -22,7 +22,7 @@ }, { "path": "docs/ci-verification.md", - "usage": "input", + "usage": "provenance", "git_blob": "63ba3e9aa8bdc5e942b56e34244b92b16f854085", "sha256": "c7d3027e9ad8bcbff68f07aa9576b30fb2f3c76c44d876d40c7fdbf4a3e2228a" }, @@ -34,163 +34,163 @@ }, { "path": "research/clifford-state-performance/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "6f98a0061a5104dfab82c9e806f819b41811f684", "sha256": "396d0f08df24952248140d5c65c51b8c902ef1c580892ff7ea182890530f67ee" }, { "path": "research/community-batch1047-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "5e0f92af463ec12c5e1dcc3effd44081a88af647", "sha256": "07a9daeaf2bda308a92e9a4684f13d5fc766c7772d74801fceb7f4599fdab226" }, { "path": "research/community-batch1099-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "9e13266bf85e627f1b7dc225e9530ea69fd2c7f0", "sha256": "421e1211fb1897c45621dc6801c276e53f2e6f335583c9c9049e535f87c0a3b1" }, { "path": "research/community-batch932-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "cc4d03eb59b9ab3f952735f7e88ff18c2d15d7af", "sha256": "184629cac91a5cfaca50330a88596008b824221433867dcf8117539c913c284a" }, { "path": "research/community-batch970-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "8b9f4111badf7de5d97684799560b55110e9da79", "sha256": "23188ed920e38a54006cb883e181585620821c63bf7e8b5e05d32719417cc37e" }, { "path": "research/community-frontier741-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "a5300d4e7a5381a3f443fc54c768ca6f0f236d68", "sha256": "3c820fb30e1b4d9bcfc6a7ab524375e5b2abd66b940af2c509146104f0bcd79c" }, { "path": "research/community-frontier890-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "d7ff6d777b01d69b6ce84caf25d3b7e4a4d2f211", "sha256": "6b185a9902652f893f3ebd8ada92d2f11b6de6533a9a4d11718a8a4496101128" }, { "path": "research/community-hyperplane599-audit/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "546f37d326d10a99910ae8f908e71ef768524d98", "sha256": "65099d764bfcc39bda5e4d9966783611b094c3522dbdd1435cd498d657a8ef8e" }, { "path": "research/community-k492-audit/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "e538481e4cb16ed936d3195f2dfb5b5a9ca0a76b", "sha256": "2c0f4fa5bc150d05658af2e7c54c4d2c337dd52b7efd3d69530ae73bcbdf452a" }, { "path": "research/community-reconciliation92-audit/MANIFEST.json", - "usage": "input", + "usage": "provenance", "git_blob": "2a2e93685173d5f13cbb5abe740f5d90352e0228", "sha256": "5f501f3c118131e7d069f30ad77186eb2ad6961f9680a0ef105f4514ed41808a" }, { "path": "research/partial-swap-digest/baseline.py", - "usage": "input", + "usage": "provenance", "git_blob": "a2f0190704db83bd8ef48e46e723c49b925804fe", "sha256": "81e9af92cdf38243a540cdcff2062778e449467848d444da37a9553c12ca4c34" }, { "path": "research/r420-two-sided-basis/SOURCES.json", - "usage": "input", + "usage": "provenance", "git_blob": "5d718e11e62f4bcadecf1e02d6b61f87dbe190b0", "sha256": "d9810b0d139c5a1211fd2c1f0d142187cc1fca30026e1e7bc4f9ecfacf1596d1" }, { "path": "research/skip-clones/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "8d1bb3b9c8189e35e5d8bfdfa632d7473e8be0d5", "sha256": "0b68e63e35a97ce6b0cdb6e291b88ebaa8f2dd4afb70b2498f10ee89428258dc" }, { "path": "research/split-skip/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "2ab610b6ea2edd2865fda793ef2168b0c76afb4f", "sha256": "7c2b4646a3ecfef6f881da5c43e4bd0fa9a4d1b00548b8ab458d897e16735134" }, { "path": "scripts/historical-ci-inputs/Makefile", - "usage": "input", + "usage": "provenance", "git_blob": "aff68409021c9d401a6f8013b9dfd7dbcc30f2a8", "sha256": "ea8830dd79da493e2d75baf753d733ff7efbcf2b4794afe41fae0ac8f3055646" }, { "path": "scripts/historical-ci-inputs/ledger-batch932-run_isolated_tests.py", - "usage": "input", + "usage": "provenance", "git_blob": "65db599ab0b1dea0312c4ca048e0bd0f44c3736f", "sha256": "96ea543e6c707424afe247e77bd86c82152f90fc76a0773c4232145da5cdf8d1" }, { "path": "scripts/historical-ci-inputs/ledger-batch932-test_isolated_test_runner.py", - "usage": "input", + "usage": "provenance", "git_blob": "34820a8f24678f918f4d0e7a35380d8013fc3495", "sha256": "628391b6abfbc8674ceec1751867a4392f2cc0b5b66886243e139af86cf355ac" }, { "path": "scripts/historical-ci-inputs/ledger-batch970-verify_selected_result.py", - "usage": "input", + "usage": "provenance", "git_blob": "c755b76e0d44ba4917aa94440ebe54daefce5b2a", "sha256": "d7fd929726b326aeeaf0a3996475adec88eee9aac09ae0bebeeaa0bc1fc8f199" }, { "path": "scripts/historical-ci-inputs/ledger-frontier741-ci-verification.md", - "usage": "input", + "usage": "provenance", "git_blob": "7f3c012504187917a728b9fe87043f0fc8cd006a", "sha256": "a854022e0e1d5d4db4d60e586be3ea56005013ef14a1fc06d02bc06e8529c4b0" }, { "path": "scripts/historical-ci-inputs/partial-swap-context.json", - "usage": "input", + "usage": "provenance", "git_blob": "ad65114886bf34a4fd27e79f3be502389e689faa", "sha256": "833a9642f33aeab2ffea17ec9c6b82e0a953f90192b2c82e10bef21538dccba9" }, { "path": "scripts/historical-ci-inputs/partial-swap-network.json", - "usage": "input", + "usage": "provenance", "git_blob": "52075f2463f60af5e16571347f24274fce73a1ea", "sha256": "f3c4be597b2f2136da4ae2cc80c7454f63c90aa01f84e5b8131cee4dd55de815" }, { "path": "scripts/partial_swap/shared.py", - "usage": "input", + "usage": "provenance", "git_blob": "44a0e454c70f9c4b98e258b8443612e6a119904b", "sha256": "5a0646a50b9f3e8ea55168620a78e8853b0ab810517cefc8cfb8696aedee278a" }, { "path": "scripts/replay_historical_check.py", - "usage": "input", + "usage": "provenance", "git_blob": "1e92fff2782970ef71378f594f2350d245a4db26", "sha256": "5467619c78183d3adc82b0cb55af28e5c1a01fca2b0588677816244b53e2bafd" }, { "path": "scripts/research_package.py", - "usage": "input", + "usage": "provenance", "git_blob": "091b4c8f58bac9a9580d76025b887dc5c873d05f", "sha256": "e1256016e7f51827d04fa2179255989f639ae1d97afaa9c16265f85a0c6abd70" }, { "path": "scripts/run_isolated_tests.py", - "usage": "input", + "usage": "provenance", "git_blob": "a96ab35b315ce492e7fbbfd6c5ae211aa066b541", "sha256": "49eb56dd0fc0d8d8ffdb209970a7adf2176223580646f575d5c22e59543b381c" }, { "path": "scripts/verify_selected_result.py", - "usage": "input", + "usage": "provenance", "git_blob": "6882a4700e410dec569b51ae2eaf1a19cc019195", "sha256": "d6b305eac5b9bdb8172c469ad30a1655a60fa0aceac8b1bf610e1b73f51babd8" }, { "path": "tests/test_isolated_test_runner.py", - "usage": "input", + "usage": "provenance", "git_blob": "343b24abf6719b81805eba5a84c74e57634c8288", "sha256": "3a5470d0b139828b90e19bf9583ddeafcd69f8e34f2824664eb3a2958a52e34d" } diff --git a/research/historical-selected-replay-gap/VERIFY.json b/research/historical-selected-replay-gap/VERIFY.json index 98553e72ed..ab7efa3471 100644 --- a/research/historical-selected-replay-gap/VERIFY.json +++ b/research/historical-selected-replay-gap/VERIFY.json @@ -4,36 +4,7 @@ "python": "3.12", "requirements": [], "inputs": [ - "Makefile", - "certificates/partial-swap-network.json", - "docs/ci-verification.md", - "research/clifford-state-performance/SOURCE.json", - "research/community-batch1047-audit/CONTENT-COVERAGE.json", - "research/community-batch1099-audit/CONTENT-COVERAGE.json", - "research/community-batch932-audit/CONTENT-COVERAGE.json", - "research/community-batch970-audit/CONTENT-COVERAGE.json", - "research/community-frontier741-audit/CONTENT-COVERAGE.json", - "research/community-frontier890-audit/CONTENT-COVERAGE.json", - "research/community-hyperplane599-audit/SOURCE.json", - "research/community-k492-audit/SOURCE.json", - "research/community-reconciliation92-audit/MANIFEST.json", - "research/partial-swap-digest/baseline.py", - "research/r420-two-sided-basis/SOURCES.json", - "research/skip-clones/SOURCE.json", - "research/split-skip/SOURCE.json", - "scripts/historical-ci-inputs/Makefile", - "scripts/historical-ci-inputs/ledger-batch932-run_isolated_tests.py", - "scripts/historical-ci-inputs/ledger-batch932-test_isolated_test_runner.py", - "scripts/historical-ci-inputs/ledger-batch970-verify_selected_result.py", - "scripts/historical-ci-inputs/ledger-frontier741-ci-verification.md", - "scripts/historical-ci-inputs/partial-swap-context.json", - "scripts/historical-ci-inputs/partial-swap-network.json", - "scripts/partial_swap/shared.py", - "scripts/replay_historical_check.py", - "scripts/research_package.py", - "scripts/run_isolated_tests.py", - "scripts/verify_selected_result.py", - "tests/test_isolated_test_runner.py" + "scripts/research_package.py" ], "commands": [ { diff --git a/research/historical-selected-replay-gap/verify.py b/research/historical-selected-replay-gap/verify.py index 83b995941a..9d266c5a4e 100644 --- a/research/historical-selected-replay-gap/verify.py +++ b/research/historical-selected-replay-gap/verify.py @@ -6,8 +6,10 @@ """ import hashlib import importlib.util +import json import subprocess import sys +import tempfile from pathlib import Path ROOT = Path(__file__).resolve().parents[2] @@ -61,31 +63,47 @@ def require(ok, message): raise SystemExit(message) -def load_checker(): - path = ROOT / "scripts/replay_historical_check.py" - spec = importlib.util.spec_from_file_location("historical_selected_replay_gap_checker", path) +def load_module(path): + spec = importlib.util.spec_from_file_location(path.stem, path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) return module +def checkout_snapshot(snapshot, sources, runner, env): + paths = [runner.canonical_relative_path(row["path"]) for row in sources["files"]] + git = ["git", "-c", "maintenance.auto=false", "-c", "gc.auto=0", + "-c", "core.autocrlf=false"] + subprocess.run([*git, "clone", "--quiet", "--shared", "--no-tags", "--no-checkout", + "--", str(ROOT), str(snapshot)], cwd=ROOT, env=env, check=True) + subprocess.run([*git, "update-ref", "--no-deref", "HEAD", INSPECTED], + cwd=snapshot, env=env, check=True) + # The pinned planner reads omitted manifests from the sparse HEAD/index. + patterns = "".join(f"/{path.as_posix()}\n" for path in paths) + subprocess.run([*git, "sparse-checkout", "set", "--no-cone", "--stdin"], + cwd=snapshot, env=env, input=patterns.encode("utf-8"), check=True) + subprocess.run([*git, "read-tree", "-mu", "HEAD"], cwd=snapshot, env=env, check=True) + for path, row in zip(paths, sources["files"], strict=True): + require(hashlib.sha256((snapshot / path).read_bytes()).hexdigest() == row["sha256"], + "historical checkout source digest changed: " + path.as_posix()) + + def entries(checker): for name, config in checker.CONFIG.items(): for entry in [config, *config.get("additional_inputs", [])]: yield name, entry -def reject(checker, entry): +def reject(root, checker, entry): try: - checker.authenticated_input(ROOT, entry) + checker.authenticated_input(root, entry) except ValueError as exc: return str(exc) raise SystemExit("historical input was admitted: " + entry["path"]) -def main(): - require(not sys.flags.optimize, "assertions must stay enabled") - checker = load_checker() +def check_snapshot(root, env): + checker = load_module(root / "scripts/replay_historical_check.py") selected = [entry for name, entry in entries(checker) if name == "tooling-ledger" and entry["path"] == SELECTED_PATH] require(len(selected) == 1, "selected-result checker overlay is not unique") @@ -94,7 +112,7 @@ def main(): require(entry["accepted_live_sha256"] == [SELECTED_ACCEPTED], "accepted selected-checker successors changed") frozen = (checker.INPUTS / entry["input"]).read_bytes() - live = (ROOT / SELECTED_PATH).read_bytes() + live = (root / SELECTED_PATH).read_bytes() require(hashlib.sha256(frozen).hexdigest() == SELECTED_PIN, "frozen selected checker bytes changed") require(hashlib.sha256(live).hexdigest() == SELECTED_LIVE, "live selected checker digest changed") require(SELECTED_LIVE not in (SELECTED_PIN, SELECTED_ACCEPTED), "live checker was already admitted") @@ -102,7 +120,7 @@ def main(): # live successor, not a broken comparison. require(SELECTED_PIN in (SELECTED_PIN, *entry["accepted_live_sha256"]), "pin membership control failed") - require(reject(checker, entry) == REJECTIONS[SELECTED_PATH][1], + require(reject(root, checker, entry) == REJECTIONS[SELECTED_PATH][1], "selected checker rejection text changed") counts = {path: 0 for path in REJECTIONS} @@ -110,7 +128,7 @@ def main(): for _name, item in entries(checker): if item["path"] not in REJECTIONS: continue - message = reject(checker, item) + message = reject(root, checker, item) counts[item["path"]] += 1 messages.setdefault(item["path"], message) for path, (count, message) in REJECTIONS.items(): @@ -118,20 +136,31 @@ def main(): require(messages[path] == message, "rejection text changed for " + path) require(sum(counts.values()) == 19, "rejection total changed") ci = [item for _name, item in entries(checker) if item["path"] == CI_PATH] - require(len(ci) == 1 and hashlib.sha256((ROOT / CI_PATH).read_bytes()).hexdigest() == CI_LIVE, + require(len(ci) == 1 and hashlib.sha256((root / CI_PATH).read_bytes()).hexdigest() == CI_LIVE, "selected CI note digest changed") diff = subprocess.check_output( - ["git", "diff", "--name-only", PARENT, INSPECTED], cwd=ROOT, text=True) + ["git", "diff", "--name-only", PARENT, INSPECTED], cwd=root, env=env, text=True) changed = sorted(name for name in diff.splitlines() if name) require(changed == CHANGED, "inspected commit diff changed") - sys.path.insert(0, str(ROOT / "scripts")) - from research_package import plan_details - details = plan_details(ROOT, set(changed)) + planner = load_module(root / "scripts/research_package.py") + details = planner.plan_details(root, set(changed)) require([row["package"] for row in details] == PLAN_PACKAGES, "helper plan selection changed") matched = {name for row in details for names in row["causes"].values() for name in names} require(sorted(set(changed) - matched) == UNMATCHED, "unmatched plan paths changed") - require(plan_details(ROOT, set()) == [], "empty change set selected a package") + require(planner.plan_details(root, set()) == [], "empty change set selected a package") + + +def main(): + require(not sys.flags.optimize, "assertions must stay enabled") + sources = json.loads(Path(__file__).with_name("SOURCES.json").read_bytes()) + require(sources["base_commit"] == INSPECTED, "historical checkout base changed") + runner = load_module(ROOT / "scripts/research_package.py") + env = runner.git_source_env() + with tempfile.TemporaryDirectory(prefix="historical-selected-replay-") as temporary: + snapshot = Path(temporary) / "snapshot" + checkout_snapshot(snapshot, sources, runner, env) + check_snapshot(snapshot, env) print("PASS_HISTORICAL_SELECTED_REPLAY_GAP") print("selected_checker_live=" + SELECTED_LIVE) print("rejections=19 distinct_paths=7 plan_packages=9")