diff --git a/research/independent-v45-ledger-audit/PINS.json b/research/independent-v45-ledger-audit/PINS.json new file mode 100644 index 0000000000..69b012a452 --- /dev/null +++ b/research/independent-v45-ledger-audit/PINS.json @@ -0,0 +1,10 @@ +{ + "schema_version": 1, + "priority_revision": 6, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "source_pr": 2979, + "source_head": "be191346391661f4d35fc0d1508d0a6029572576", + "source_package": "research/rank7-joint-endframes", + "source_manifest_sha256": "124bd80e6253256b716716abcde518fec172e6cd855377295875a0fc8dd96db2", + "scope": "Independent finite audit of the V45 frame lowering, subset controls, child-rank report and serialized owner/physical ledger." +} diff --git a/research/independent-v45-ledger-audit/README.md b/research/independent-v45-ledger-audit/README.md new file mode 100644 index 0000000000..30f0edd630 --- /dev/null +++ b/research/independent-v45-ledger-audit/README.md @@ -0,0 +1,144 @@ +# Independent V45 frame and ledger audit + +Status: scoped independent audit of PR #2979, source head +`be191346391661f4d35fc0d1508d0a6029572576`. The worktree base is +`20ecf2891d80b5acf18d980b2164fb44ea7faa90`, priority revision 6. This package +does not change the selected frontier or claim a new κ. + +The live overlap check found PR #3823, which records the V45 triple +intersection, and PR #3841, which records the printed V45 margin ladder and +the five stage-one group prices. This audit keeps those finite facts as +cross-checks. Its separate coverage is an independent implementation of frame +application and both provider child-rank reports, all 15 endpoint subsets, +the owner schedule/fill checks, and the complete physical invoice. It does not +claim that the archived search-time pricing witness is independently derived. + +## Question and method + +For PR #2979's V45 group, do the four shared rank-seven end frames fit the +recorded gates, does a one-helper control lose under the stated local pricing +model, and do the resulting child-rank and physical totals reconcile through +both provider words? + +`verify.py` is a Python standard-library-only implementation. It hashes every +file in the pinned #2979 source package, rebuilds the F2 frame walk from the +compressed parent/final words, applies the declared frame edits, and checks the +rank histogram and width inventory. It independently reconstructs source +windows and checks each serialized owner role for chronology, same-call family +collisions, bin capacity and overlapping offsets. It imports no code from the +source package and does not run that package's registered verifier or owner +engine. + +Run: + +```sh +python3 -B research/independent-v45-ledger-audit/verify.py +``` + +Expected status: `PASS_INDEPENDENT_V45_FRAME_COST_AND_PHYSICAL_LEDGER`. + +## Findings + +The shared space is +`W = <256,128,64,35,16,11,5> = E_7 ∩ E_42 ∩ E_45`. It has rank 7 because +`7 xor 42 = 45`, so the three normals impose two independent conditions. Each +of helpers 249, 251, 265 and 267 has an eight-dimensional parent end frame +containing W. The four endpoints become W, and 29 of the 139 recorded gate +frame edits touch this group. Recomputed parent and complete stage-one reports +agree with both provider word records. The gate/operator/scalar entries and +cleanup arrays stay fixed during stage one. Five semantic controls reject a +wrong W, a missing partner refit, a changed gate signature, a duplicate helper +role and an over-capacity role. + +The independently recounted stage-one profile is `{1:2430, 2:722, 3:236, +4:102, 5:18, 8:8}`. Its exact weighted delta is `-46,150,994` units; with 22 +freed width units at break-even `2,091,300`, the complete stage-one margin is +`+142,394`. The five source group prices sum exactly to this independently +recounted total. + +The pinned V45 group price is `-8,388,172`, with margin `+22,972`. Holding +the complete stage-one gate edits fixed, independently toggling its four +endpoint frames changes the child-profile cost by `-8,466,684`, exactly four +times the rank-one tariff `2,116,671`. The difference implies a shared +partner-refit charge of `+78,512` in the source price decomposition. The audit +rebuilds all 15 nonempty endpoint-subset profiles in the complete stage-one +word; the single-helper control is a direct profile variant, but its group +margin uses that source-derived shared refit charge. The subset formula is +then + +```text +margin(k) = k * (2,116,671 - 2,091,300) - 78,512 + = k * 25,371 - 78,512 +``` + +It gives margins `-53,141`, `-27,770`, `-2,399` and `+22,972` for one through +four lowered endpoints. The audit checks the profile variants and all 15 +rows against the pinned source table. An attempted V45-only gate refit on the +parent is not a valid independent decomposition: its frame walk becomes +nonmonotone at register 169. The archive does not include the frame-search +optimizer, so this audit does not independently derive the V45 group price or +establish that the chosen refit is globally optimal. + +The final child-rank ledger independently agrees for both providers +(`gauge44` and `extra`): + +| Rank | Per-provider local children | Full 666-call profile, including idle children | +|---:|---:|---:| +| 1 | 2,445 | 1,645,680 | +| 2 | 706 | 470,196 | +| 3 | 232 | 159,468 | +| 4 | 108 | 71,928 | +| 5 | 18 | 13,716 | +| 8 | 8 | 5,328 | +| 48 | 0 | 28,190 | + +The final width inventory for each provider is `{4:26, 5:2, 6:16, 7:52, +8:99, 9:213}`. Relative to the PR2942 parent, the complete local-profile cost +delta is `-56,726,747`, rank mass falls by 27, and the recorded total margin +reconciles to `+261,647`. + +The serialized owner ledger has 666 calls and 271,728 helper roles, with 416 +calls dispatched to `extra` and 250 to `gauge44`. The independent schedule and +family check finds 54,200 distinct assigned family IDs within the 66,304 +reserved live-family stock (`74 * 896`). The full physical invoice is: + +```text +66,304 live-family stock ++ 408 helpers ++ 8 centres ++ 91 private cleanup buffers ++ 2 guards (residual in the pinned owner invoice) += 66,813 physical families +``` + +The two provider records have the same independently rebuilt profile and +width inventory. The source-selected bit/complex bounds, the numerical cap +root and the outer release are not recalculated here. + +## Open next questions + +Can the V45 group price and single-helper control be rederived without the +search-time group price row while preserving a valid monotone frame walk? +First find a valid decomposition of the V45 edits from the complete 139-edit +stage-one word, then compare its child-profile costs with the source table. +The straightforward isolated V45 gate-edit subset fails monotonicity at +register 169, and the archive does not include the optimizer witness. + +## Scope limits + +The archived group-price table is search-time evidence from a frame solver +that is not present in the package. The audit does not independently derive +the V45 group price or the `78,512` shared refit charge. It confirms the +complete stage-one profile, constructs valid endpoint-subset profiles under +the complete gate refit, and checks their listed margins against the pinned +price table. An isolated gate-edit decomposition is nonmonotone, and optimizer +completeness remains open. + +This is not a fresh two-sided algebra replay, native-provider replay, outer +proof, supplier admission or multiplication theorem. Do not treat the finite +frame and ledger result as a new κ. + +Credit and predecessor attribution remain with Marius-Paul Dumitrean/PR #2979, +Mason Hale/PR #2917, Jeremy Kothe/PR #2957, PR #2942 and their cited source +lineage. This scoped audit was prepared with model assistance; no independent +human or formal-kernel review is claimed. diff --git a/research/independent-v45-ledger-audit/SOURCES.json b/research/independent-v45-ledger-audit/SOURCES.json new file mode 100644 index 0000000000..496d968c58 --- /dev/null +++ b/research/independent-v45-ledger-audit/SOURCES.json @@ -0,0 +1,690 @@ +{ + "schema_version": 1, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "research/rank7-joint-endframes/.gitattributes", + "usage": "input", + "git_blob": "e1d75a2b2de7631c953139dcaec6cecb7a1cb469", + "sha256": "056f4f66161e333f3a8d4c20de323ca05599a7deac1aa02d47ba6f6b96335573" + }, + { + "path": "research/rank7-joint-endframes/ALLOCATION-PINS.json", + "usage": "input", + "git_blob": "5cb50cd03cae839b4407b58d2f4e8efcb1ebbafb", + "sha256": "d0a4e7fb9f629534e7e258a5bfd9e5f9e47564277f677a54ca77d5148ffaabf9" + }, + { + "path": "research/rank7-joint-endframes/CLAIM.json", + "usage": "input", + "git_blob": "8ec2ce4e440c0b584ee982c551e526a011c9324c", + "sha256": "436e0d297cbdf195445d3697d496ac675e95210b79e70ce602a6a6667a4c6ce9" + }, + { + "path": "research/rank7-joint-endframes/CREDITS.md", + "usage": "input", + "git_blob": "5f4197842052437f5fb6dc41cfd8d4dc9349cc22", + "sha256": "bf85777bd2d9b8e537dae2e70614759ba1a265101dd903a72fbd2cfc2869c406" + }, + { + "path": "research/rank7-joint-endframes/MANIFEST.json", + "usage": "input", + "git_blob": "185cb43638456b3245e97b6d9e3aa10401d13434", + "sha256": "124bd80e6253256b716716abcde518fec172e6cd855377295875a0fc8dd96db2" + }, + { + "path": "research/rank7-joint-endframes/NOTICE", + "usage": "input", + "git_blob": "9df951052ae186bce02a6258219dae58f7cf2e80", + "sha256": "b767e40e8c7e16058d1ebb8c08eef9b9bffae31cfa30512b843ae1fcbfc6f5cd" + }, + { + "path": "research/rank7-joint-endframes/PINS.json", + "usage": "input", + "git_blob": "d71aaccbae9232322721638cb0857a25bab4b91c", + "sha256": "978b20708cabb86cc379e42ca04f45b9251d60a5241c3d70092288f42051cc68" + }, + { + "path": "research/rank7-joint-endframes/README.md", + "usage": "input", + "git_blob": "ad4fde698389d02543df632d46b54dcd93e53a97", + "sha256": "d00d123fc6cb7da627a8db1b8ae95b732ef7c55f802a784059de982159548634" + }, + { + "path": "research/rank7-joint-endframes/SOURCES.json", + "usage": "input", + "git_blob": "8a319a65c1196d827a5f477213a4c0940762e4af", + "sha256": "d5f3f498d4d34125bcaed14dafaceaff342223d511d1099993d5b217a147019c" + }, + { + "path": "research/rank7-joint-endframes/TASK.json", + "usage": "input", + "git_blob": "cbc9bcc5b1d4a7ef69ae983ab0cba218cf6ef7d2", + "sha256": "b1f2b3c1eb570009689fd6fd408c011e5a851c3ab1e407ba4ed0cdd60a4474b1" + }, + { + "path": "research/rank7-joint-endframes/VERIFY.json", + "usage": "input", + "git_blob": "dcad065eb2e8397640d853829d8df145116056ef", + "sha256": "620001c99145f78fbb639218e97620a956e87fe0a11b541e22b3ccb68fa29ffb" + }, + { + "path": "research/rank7-joint-endframes/allocation/DISPATCH.json", + "usage": "input", + "git_blob": "9544fee4e6ee1f202cee22bfaeaf229ee3b2515e", + "sha256": "65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c" + }, + { + "path": "research/rank7-joint-endframes/allocation/FILL.json.gz", + "usage": "input", + "git_blob": "8d4fd644d60ba2c98106dc770803b647afdf0963", + "sha256": "c2136be9434cda511a1a8a44d98f9f72ea5376830a8426674253b4ee351c4c39" + }, + { + "path": "research/rank7-joint-endframes/allocation/ORDER.json", + "usage": "input", + "git_blob": "7409c4df1092241729739596c7648bda504e6aad", + "sha256": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1" + }, + { + "path": "research/rank7-joint-endframes/allocation/PROFILE.json", + "usage": "input", + "git_blob": "46a83eeda67ab67cccbffe8b7ad8e44368b40ea7", + "sha256": "94a819747f3ced41f1544ada0036c983fc0c92847b9644380f877a06cd7931cf" + }, + { + "path": "research/rank7-joint-endframes/allocation/PROVIDERS.json", + "usage": "input", + "git_blob": "e1d99e12cfa3ac8375984d85c0b040dc36ea1312", + "sha256": "f2edb7922f3029a5d607437e737775ff3371bca49ebab62e5e2495d16d3bf573" + }, + { + "path": "research/rank7-joint-endframes/allocation/SEARCH.json", + "usage": "input", + "git_blob": "cf0a2e7ca4bb431ab32b2515050ff81c7b5faae2", + "sha256": "2ceb1f825cb68e44d17d4251f74c3975ae5122c845391c1ca8de2e564ac4246a" + }, + { + "path": "research/rank7-joint-endframes/allocation/baseline/CLAIM.json", + "usage": "input", + "git_blob": "beee83c9261522029d99fb486befecaf5a42fd1c", + "sha256": "656a4c93411b078753783513e2e71b1722a56e7b70120264a38118811982fa77" + }, + { + "path": "research/rank7-joint-endframes/allocation/baseline/ORDER.json", + "usage": "input", + "git_blob": "b1629ba9819396197b529717ef21be9056edfe41", + "sha256": "d559a1dcb83707724afc0310f6ef8e3a36ad6cda0a895ca6abae9d6f39a0fc76" + }, + { + "path": "research/rank7-joint-endframes/allocation/baseline/PROFILE.json", + "usage": "input", + "git_blob": "52d24cfc6ab68ddfa52a2721f512bc84da7c8ef5", + "sha256": "6de8ac1fd628cdd2afa5a43872da69c7dab9d7219bdc318f9db55fd8ccdb5eb2" + }, + { + "path": "research/rank7-joint-endframes/allocation/vendor/PLAN.json.gz", + "usage": "input", + "git_blob": "7a1db55a4d53ee99280be4f3ab7d29f7b2033adf", + "sha256": "d566cfb87b71639d4138e1f89b543e2dd6a7772070226a2a14c799a6835bf21e" + }, + { + "path": "research/rank7-joint-endframes/allocation/vendor/TEMPLATE.json.gz", + "usage": "input", + "git_blob": "114808c32b1799da53524bdc25cea67efb60009e", + "sha256": "21297b20f1f2dc76eb9dd8124416068c3cb096bab9df17fa4da19bc68dfe082e" + }, + { + "path": "research/rank7-joint-endframes/allocation/vendor/independent_owners.py", + "usage": "input", + "git_blob": "16013201b19054f7e45398ecf10af74c9c6a9114", + "sha256": "77a848729159e271ba64f403dfd59dddb13044b17b2950fa56700f442e2fe461" + }, + { + "path": "research/rank7-joint-endframes/certificates/RELAX-CAP.json", + "usage": "input", + "git_blob": "14de38f85eedf4a96500173576184a439348328c", + "sha256": "b272680de5842f7fd5f442cd0aeadfd317fe6af266ddee1a1e0738a919ba856e" + }, + { + "path": "research/rank7-joint-endframes/certificates/RELAX-STAGES.json", + "usage": "input", + "git_blob": "04f87e783b2e2b6d3ac44dd3270c0e62a1cc1173", + "sha256": "0e5ec700a191b668ba3d4b6d675f5c047d264b9a5109fc55fa92961b3fcb7d68" + }, + { + "path": "research/rank7-joint-endframes/check_allocation.py", + "usage": "input", + "git_blob": "6f254b3aa9b4e187e900a7a87e2c128a1183ac69", + "sha256": "c66ec511ea6140bceee47027632dfe746bff4b78ec18831785b2732b8fbf7d43" + }, + { + "path": "research/rank7-joint-endframes/check_cap.py", + "usage": "input", + "git_blob": "266d2b2cce2b8b132a93698b75969f9521e22156", + "sha256": "fe23b6af93d66300952bc2f42c6acb0de84570bf7681bfbd53d2d157b75f378f" + }, + { + "path": "research/rank7-joint-endframes/comparators/PR2942-CLAIM.json", + "usage": "input", + "git_blob": "53d9edee7e8355f7e5dd5b0094462330da907846", + "sha256": "011aaac80ad79f7f29dc429a672441bb6b3c21a68bbcb34c7a0d5f943c3c3c2e" + }, + { + "path": "research/rank7-joint-endframes/comparators/PR2957-CLAIM.json", + "usage": "input", + "git_blob": "cff1a70ed800d732e39f9b9b968f81662930d8e6", + "sha256": "a93e6c9e94bc9bf5664b5e23506dda9647fad1930e1eede66d5ba9f3718b598a" + }, + { + "path": "research/rank7-joint-endframes/comparators/PR2966-CLAIM.json", + "usage": "input", + "git_blob": "8f1ad730dde7535d93f6185c79e288bb9976b00d", + "sha256": "4d4c4800bf3bcb36d09021313b2712aebd4aa0830c74dda30991daf6851c220a" + }, + { + "path": "research/rank7-joint-endframes/construction/STAGE-PRICES.json", + "usage": "input", + "git_blob": "b06b369ace05b86377f9f73e13586b62b0b77b98", + "sha256": "dfb7d06724bf95367f3fdb398f4828fc70f803d23030bc0eee0b00541457f546" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/T37-FACE-MIX.json", + "usage": "input", + "git_blob": "6e6c97d6bdcc4f81051968ae0be99a2299f72157", + "sha256": "10598b7ea2e26fbd49db2b4d2f08122415fd6673b87fb7b458019d503ae60744" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/T37-FLOW.json.gz", + "usage": "input", + "git_blob": "592ca15f4390d83d694c15a5b7a5d1d6302ae674", + "sha256": "765c6b774ca207f715dd5f579995700f4787c1f4eb92a7855bfc1424f683eca4" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/T37-MODEL.json", + "usage": "input", + "git_blob": "56d7f7b6a6c734a379027492c74bdd23d0c64028", + "sha256": "74849384ad2160f0402f6577e9d3ea849c21704abcf839af50f3353e141a4355" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/T37-PATTERNS.json", + "usage": "input", + "git_blob": "7fbf9e238f3509c4603534c14e4ab931e2f4ccac", + "sha256": "df09e4581d7ed73fa22253909197ceb26ced59333f50c008c822894a4082f0e4" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/T37-SOLVER.json", + "usage": "input", + "git_blob": "9caa9b34c2342960487ca7dcbe3bd7df690782b3", + "sha256": "f56caa18e9638c568c57e699a8576fa6dcbdfe6ba54ae2da3fc8bc626168d863" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/T74-CONTROLS.json", + "usage": "input", + "git_blob": "7e49e69d78372efda308db5de67266f98cc87c92", + "sha256": "0de2d067d957bbca2580566576030d4f10508b7827a0d83a0bd8c05f19b23bbf" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/T74-OWNER-CHECK.json", + "usage": "input", + "git_blob": "a0d10423622b1e217f63d8afd1d52efc95482064", + "sha256": "996234db3632983effc279a93cb5599a945688a3ea476fc9f88e3a714fb330be" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/assemble.py", + "usage": "input", + "git_blob": "f5ba21b6ad3d65b1ce9b7b01088375c1328fa21c", + "sha256": "57fcc8dd6f08b5557add7f34c0deb993574f71b3e565d6668085f1f65df5eccd" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/controls.py", + "usage": "input", + "git_blob": "b739058bf29f899c34532ec09072693cd138aa7b", + "sha256": "9e10e5c21fab8ea2fdaf07ce92a141c4e6d63a7ef02d9de25bc9022ad1ae7998" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/diag_lp.py", + "usage": "input", + "git_blob": "47fb31be1b3668a0b901c5bc83d18424f69eefc5", + "sha256": "59bfeb9586820f7b653370e20619760e23a4b170e4b7e14dc4e2abad9f5d9c61" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/double.py", + "usage": "input", + "git_blob": "f002703372d0b022eadec928a6153997e51e8ad1", + "sha256": "8a89fafcd69cacb0a5a8d19a90d76f8740cf8f12585dc83796fcd8bc428dd94f" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/fill17.py", + "usage": "input", + "git_blob": "d2a51867833f7ee69997977693d278624f6deb0f", + "sha256": "933be460381d65ea04a6e7f288f977ba22a7e4068b69494d65c38ccd7e5f4dbf" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/providers_from_words.py", + "usage": "input", + "git_blob": "bab1d7139a4801b2f723fadb5c742818ef82aa51", + "sha256": "8cf55c2859a626d86f21b447460321c19db92fec8e1f893b3cd37267f3b145fd" + }, + { + "path": "research/rank7-joint-endframes/construction/allocation/round_mix.py", + "usage": "input", + "git_blob": "5737651571feb461c45f84a3028e52ef4860813b", + "sha256": "0d0a423817b30fda9cceaa61b9bcc90e07710f9829e65098c9a31ed1734341bd" + }, + { + "path": "research/rank7-joint-endframes/construction/records/derive_stage2.py", + "usage": "input", + "git_blob": "26a06133119f24f69d2102827eb9348306dee401", + "sha256": "f2518333cea351376ee094e8212b71ad753710d4038c55937a9e3bb212249f9e" + }, + { + "path": "research/rank7-joint-endframes/construction/records/make_data.py", + "usage": "input", + "git_blob": "ff113b8a1203ebfb7d378e47ad8f4b5b39dd0822", + "sha256": "b9528bcb26bc3c1a8e582032fa3899c79dc4cb463814dc6fea617fd83a5b4858" + }, + { + "path": "research/rank7-joint-endframes/construction/records/make_prices.py", + "usage": "input", + "git_blob": "8700174f1ce9e6ab26d72c772257da8949a24d22", + "sha256": "5fcf593b5672b4f66cabd9d2bd5b4e843453248186d95794386331d801280b78" + }, + { + "path": "research/rank7-joint-endframes/construction/search/codim2.py", + "usage": "input", + "git_blob": "7b60aafc88486d1ccfbbd09a8821812e48a45aaf", + "sha256": "1dd77f4ceb0c4cf82ee5f3f4c04123724db09ebb0e7b9f856c4bd000d4e57531" + }, + { + "path": "research/rank7-joint-endframes/construction/search/combine.py", + "usage": "input", + "git_blob": "65b84f5f4ea78de561f287b64922b1febc2651ef", + "sha256": "d06e041082f120b903937a8c7fdf2189eb42411330af625492ff5a24109b49d0" + }, + { + "path": "research/rank7-joint-endframes/construction/search/deliver_l22.py", + "usage": "input", + "git_blob": "21182d4310c6d103325f61315298c9d266d73944", + "sha256": "b5f0a6ee2eaf1cbef95f0447efb08b75937e7e03c6d27d0b73d5c884c24a91b5" + }, + { + "path": "research/rank7-joint-endframes/construction/search/final_l27.py", + "usage": "input", + "git_blob": "ce3a20c8ff946237fbe19d0d98de66f5c1fd87df", + "sha256": "e964d48e7b7705cc64a57bd42d81eb990d69606689349240e5a18155d08f7350" + }, + { + "path": "research/rank7-joint-endframes/construction/search/lowerA.py", + "usage": "input", + "git_blob": "c08666a6da9b6c7bdf423c6586f3c12278acc161", + "sha256": "1aba1edb5397701151b2c95afaf23cd8e675ddc48b5ccca1738bc0c5370e9a6c" + }, + { + "path": "research/rank7-joint-endframes/construction/search/lowerA_joint.py", + "usage": "input", + "git_blob": "abbf31081dffb60cefc32a9e8bd33af6fff55994", + "sha256": "eb0efbe0c40d063a606dc370362a8d3fe3f4f57877e2e79f63be940fe06ce41b" + }, + { + "path": "research/rank7-joint-endframes/construction/search/realize.py", + "usage": "input", + "git_blob": "570d53d42cbe18dcc5a558b58849e0c247f8e8dd", + "sha256": "6d524f4a1ce0a4bf77f8e5a859e46922334956688c9268dbea3004e3aea6898e" + }, + { + "path": "research/rank7-joint-endframes/construction/search/vlower.py", + "usage": "input", + "git_blob": "c1eaf2b1542afe8525483b5eaa63940ab82ba3f7", + "sha256": "3052c96b4f00239fe679f460bbbad2b7271089b5aa73665cb92c052755143ec4" + }, + { + "path": "research/rank7-joint-endframes/data/PARENT-base.json.gz", + "usage": "input", + "git_blob": "1ca8287d6ae5eb45d87db65b369be8d09ba692b2", + "sha256": "54ca34c749e3228d7e2df3d8dbf7aa1568c2872490166997c5962f12fd03da35" + }, + { + "path": "research/rank7-joint-endframes/data/PARENT-extra.json.gz", + "usage": "input", + "git_blob": "c39913ce24cbce4c841eabcc9b1e5a18e4ccc754", + "sha256": "eded756dfe8f411c3d1f80a3ac16516f0ea5dd6f9866728b2179b157630fa7b6" + }, + { + "path": "research/rank7-joint-endframes/data/REWRITES-2957.json", + "usage": "input", + "git_blob": "7bf1633c93951828159b0d9f17d65eda6877101a", + "sha256": "a37ade675876e4f5b00b33066c84f495fccd264863b7eb5d813837b1d01c3e7d" + }, + { + "path": "research/rank7-joint-endframes/data/STAGE1-FRAME-EDITS.json", + "usage": "input", + "git_blob": "66525d293bd0e615e469b4c2191281e8cafb8788", + "sha256": "5fbfce004330ebc1fbac8de264614fe295f1a074811b478db4892c3bc3852cd3" + }, + { + "path": "research/rank7-joint-endframes/data/TRANSFORM-226.json", + "usage": "input", + "git_blob": "bab8518d199e902d72e3b8ec649b62afb74c4e77", + "sha256": "1732a39728c068f9d663111c7876b4e0b96088f3dd3b8e6ff824551b5a711338" + }, + { + "path": "research/rank7-joint-endframes/data/TRANSFORM-228.json", + "usage": "input", + "git_blob": "0097d9dbb972126bde3551ac11d7421494e9c4ec", + "sha256": "82346e6a5173c4822e16b2dad06ca232111b6795a340079f9aceabe0098797c0" + }, + { + "path": "research/rank7-joint-endframes/data/TRANSFORM-230.json", + "usage": "input", + "git_blob": "11edd2e513f8dfd224c53dd8f5ab6bd000098d3a", + "sha256": "8ad70d545695b5d2246fb9e09d46abcc1e42926c1161884f69b77f978a28f46d" + }, + { + "path": "research/rank7-joint-endframes/data/TRANSFORM-363.json", + "usage": "input", + "git_blob": "9260bdf0b87319f212c0a7527693c511cd45c736", + "sha256": "84d2a609739eb30d4d9356fb6f04b2ff32c8823a978d7a51db1ace1d6d2352cc" + }, + { + "path": "research/rank7-joint-endframes/data/TRANSFORM-395.json", + "usage": "input", + "git_blob": "fb2f6a9d2d72324d7dc7505ed46d566cdf8603c8", + "sha256": "065aa5d7713683942bc2156b543681857e33c6e2f30f32cba47e2cbb9d1bef69" + }, + { + "path": "research/rank7-joint-endframes/data/WORD-base.json.gz", + "usage": "input", + "git_blob": "d9aa96a93fea5f7395e7783aef0bc117c0a0ae89", + "sha256": "abaf67bfcb257528658c906b612f57025617592bd7889828f92b97a5f4f4300d" + }, + { + "path": "research/rank7-joint-endframes/data/WORD-extra.json.gz", + "usage": "input", + "git_blob": "74f6cb64595c21f7726ae77e69437868620bdcee", + "sha256": "e0eaf64c4d5d324693d43889bce1b9e53e8da00402105c8c978fd102f208bed7" + }, + { + "path": "research/rank7-joint-endframes/evidence/ADAPTER-DERIVATION.json", + "usage": "input", + "git_blob": "f7b180f4ec3d60e688055fb3356611f091af0107", + "sha256": "abfe60c965953c567392b587cbcc4703f2f80fc60e267539251a1eac0f9db2f3" + }, + { + "path": "research/rank7-joint-endframes/evidence/ADMISSION-RESULT.json", + "usage": "input", + "git_blob": "41bca45d53e950d8eac8e2cec0fba610177813cb", + "sha256": "be9652312a88fd670eb09a4303679b4e875516d02a008ce90ccbca8a92e6b2ac" + }, + { + "path": "research/rank7-joint-endframes/evidence/ADMISSION-STAGES.json", + "usage": "input", + "git_blob": "3d92f8e91360dcac2662b36cbad4b6b4a98029b9", + "sha256": "bf2fcb3012c65d861ccc4ba5950e5b97cbff31f603268afdb7e9ae2a0ac9696f" + }, + { + "path": "research/rank7-joint-endframes/evidence/ENVIRONMENT.json", + "usage": "input", + "git_blob": "e9e5c00ae39c34cccf4ae01800ce8d4122b51291", + "sha256": "c6faaaa9b538ddbf0ea3c624bbe2f1c7e4074f8cb504d4bee0f3353f1e7f32a1" + }, + { + "path": "research/rank7-joint-endframes/evidence/FULL-NATIVE-RECEIPT.json", + "usage": "input", + "git_blob": "87ac21d0878479877bb75961b3c054843711d4d4", + "sha256": "6d27c89d5e3a2c7f28387e4b20c462b0dff6c9fa92aacdde715d4b29cc286d41" + }, + { + "path": "research/rank7-joint-endframes/evidence/FULL-NATIVE-RESULT.json", + "usage": "input", + "git_blob": "88ea12162481ff309e4feb78ae2916942161bd64", + "sha256": "ee10e7b8f2196b3bd28f5389b9be3372c216f3cfe67e00c7a2bcd130746ac364" + }, + { + "path": "research/rank7-joint-endframes/evidence/FULL-REPLAY-RESULT.json", + "usage": "input", + "git_blob": "ff3ff037bc725d45d5bf40d08e80c2da73efb8a7", + "sha256": "0293261edd3696408e1067df358644a7f43fd05f6c7b78e255aeac3f4a2530a2" + }, + { + "path": "research/rank7-joint-endframes/evidence/FULL-REPLAY-STAGES.json", + "usage": "input", + "git_blob": "d802392e99832bc31bbb6fc1380fd84314356cf1", + "sha256": "d8764bbbc029b13e20dc881783c44b74c689064d9ddf8286fc18371f2ec0d503" + }, + { + "path": "research/rank7-joint-endframes/evidence/OVERLAY-DERIVATION.json", + "usage": "input", + "git_blob": "e4b3c8e18b21e484c0d0e788270e479af6b62725", + "sha256": "145a9491cca7b22f0d04cccb66795a7b6914a1ee415ecfc65e1db7b586573826" + }, + { + "path": "research/rank7-joint-endframes/evidence/RELEASE-RECEIPT.json", + "usage": "input", + "git_blob": "22ef9eab8041c982eb86c69fb1d55d5525caaca2", + "sha256": "473a5f8e048e45d7e83747077a18985ef87d58da370ca3f2fe5748a057ffdb2d" + }, + { + "path": "research/rank7-joint-endframes/evidence/RETAINED-BOOTSTRAP-RECEIPT.json", + "usage": "input", + "git_blob": "3c6bebb28b072e2f1c057f39912ec617ad197853", + "sha256": "ba9ef5709319ceb54928aed10cb250f3d018b3f654a2902c53df27d9e2e1157f" + }, + { + "path": "research/rank7-joint-endframes/evidence/RUNTIME-PATCHES.json", + "usage": "input", + "git_blob": "383b994459ec973ba34dac2339e92f5bf6c18a1e", + "sha256": "6e4fe608caae2cdc28abc0ab772514d03ede2a4a50b06e9ede2853ab6889f218" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/admission-discovery.log.txt", + "usage": "input", + "git_blob": "386a5797d99a422ceba38ac1b5b6ca08e6df1272", + "sha256": "68845b7e19574ee2040677640848f0f7aaf71854250dfe0470dfae3ff09210b3" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/admission-outer-check_ledger.py.log.txt", + "usage": "input", + "git_blob": "d45983a93ea66fa0533019e96d7f12f976d57d76", + "sha256": "c56f8e0232d749e0ff33b76a8f9de18d28a7bb3abcd736ba69a4b167f2b5a824" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/admission-outer-independent_check.py.log.txt", + "usage": "input", + "git_blob": "6021b160e5ed07f14d135be0601f4904ed739e6b", + "sha256": "7eab2e50c0b03f058ae320c4791a0ea5a0ae3eae3393d29971663428ca79547a" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/admission-owners.log.txt", + "usage": "input", + "git_blob": "7d4c19c77d1057dffcd277759f57df4f9bbf9605", + "sha256": "dc4840d279e447e42af2ece9437cb92ab13c7f631440911ca5e8a676e3fa418c" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/admission-parent-lift.log.txt", + "usage": "input", + "git_blob": "19dae85e2e4e8355f28c35e4dab926566af41f37", + "sha256": "7b6249a123ca39fae7b7a6339dd9e8ae8777b081f4336418f2cc101704b70644" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/admission-rebind.log.txt", + "usage": "input", + "git_blob": "4e064c2a105d47c877d38a4aacb2a8bc4e66d137", + "sha256": "6126af0a7935a1605ddad6074978494d462ed67cbd54be809ce13fcb32469d67" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/admission-release.log.txt", + "usage": "input", + "git_blob": "81084f5d7eacfa7ae2965a50e1f74b2bdf91cfa2", + "sha256": "d1e575ccd284596605baf38e5ed5b751cd5f506572ef9cfc578bd88d917b46a0" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/complete-admission.log.txt", + "usage": "input", + "git_blob": "94807e3e1ee47aa22d6ca073f37eefe29d059d95", + "sha256": "37584a0aed98b08f491b676ba0e4914518027f556495b1ae4e8a9a123d360b4f" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/derive-closed-adapters.log.txt", + "usage": "input", + "git_blob": "ce6bde045fe7750c0fa2dca63f0c40ff07ac9171", + "sha256": "d11d75855720cfa75a26f667a61467b5122a7b7ae5521030509bf1cbdd00a496" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/export-pr2833.log.txt", + "usage": "input", + "git_blob": "af1f216bb50af29432c6aa2d30313ce958788d14", + "sha256": "0fa7e0c6a0f0e31c60aadd0fe2afa6841d046d3272a02d3dc873f999b8508654" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/export-pr2894.log.txt", + "usage": "input", + "git_blob": "2bed900376db47d928ffe64835940c728d3e4094", + "sha256": "6bd8df30779863897e48441608240db6a7e3fcbd0754511e44f854f3a5c462a6" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/four-kernel-stage.log.txt", + "usage": "input", + "git_blob": "257be58c74eb0f54ee80f34af65e64e9f201935a", + "sha256": "f2bbb6462b3f5bb8a6415bb33c0c35355353b13343ddb90961660f7473caa5a2" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/fresh-current-native.log.txt", + "usage": "input", + "git_blob": "820460ef57351ee8e921a122c460254594e0c05c", + "sha256": "d7581123b0f3330f2598e7758ccbca466018d2599124fc6ceb1b678a9ee27dec" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/fresh-retained-bootstrap.log.txt", + "usage": "input", + "git_blob": "9308a84963a6bf0ebcf3e0343c2bc92655d8e3c0", + "sha256": "4a1625fdd9a947187583e67492c492f309e28669082f2e6f2aa97b5da345ea29" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/paired-extension-stage.log.txt", + "usage": "input", + "git_blob": "9ca3a425215401648870f3f65397a683c028abfb", + "sha256": "61cc77beeae833d7473b5c5338b176b150f95f6652a888c0307f080674cfde35" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/parent-paired-stage.log.txt", + "usage": "input", + "git_blob": "de80347a9094a0741e644d36c1f75487fa664424", + "sha256": "d80d8494c48816e3acf662db00cc0077a888b82392d736826f73beb1c4248299" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/preload-stage.log.txt", + "usage": "input", + "git_blob": "4fa79b5e482d644cbe1d2c882dbc3296d367db9b", + "sha256": "2eb7601c48840a39c58eb838886aed00a531349b259f0bbc3ea6421376b8ea3c" + }, + { + "path": "research/rank7-joint-endframes/evidence/logs/rank7-overlay-stage.log.txt", + "usage": "input", + "git_blob": "d058b55c96bf06d7e9f888559ef27df5417f354d", + "sha256": "06150c3f42489b14e981b90ac0e594e7e32bfc6ec4a98f3551cf53b6d18acd36" + }, + { + "path": "research/rank7-joint-endframes/producer.py", + "usage": "input", + "git_blob": "872ffd1df10798eaface8d73196040fa0020820d", + "sha256": "d4577cee26314b36b59723cc68df9b8895b22449cc15807c95f325f555c4da3a" + }, + { + "path": "research/rank7-joint-endframes/reproduce.py", + "usage": "input", + "git_blob": "c0c819e6095b7ee9e636f87b83d5ddeec87a4104", + "sha256": "b58f63128aaf3d37a9556ca450e5206d62bab16535946988f4674a15cc0d39c1" + }, + { + "path": "research/rank7-joint-endframes/run_registered.py", + "usage": "input", + "git_blob": "eeb2d14151dc8451d2a83a5950c6f43673d33ee7", + "sha256": "28355883bbe1b77e931ebf2ed2efa84707b92b21c8969527a897ba1c7a4c9d9e" + }, + { + "path": "research/rank7-joint-endframes/structure.py", + "usage": "input", + "git_blob": "8d5bd544ee7cad4309edad3d2a256bf48b810f90", + "sha256": "83f63b6d9a1a543ecfa2c98d479dbe4e7a1c3caf6fd1c3566123308efbc32e96" + }, + { + "path": "research/rank7-joint-endframes/tools/audit_allocation_moment.py", + "usage": "input", + "git_blob": "623ae14fbeaacf2f1b2302ae23b40c52586b7342", + "sha256": "c632527ecf092f013862660dbd7f52b599a50b321a8aa88ddc45af0547e79cb5" + }, + { + "path": "research/rank7-joint-endframes/tools/build_overlay.py", + "usage": "input", + "git_blob": "74c39e8d33c260d6662b6b1f682ee48526fde974", + "sha256": "9d98ace9bffb37aeebd05b93ed386f73e6eee169d960e4956cf14a66e6852140" + }, + { + "path": "research/rank7-joint-endframes/tools/derive_adapters.py", + "usage": "input", + "git_blob": "cff5a3cec53bb8e88ddbf074599cf7047a4303b0", + "sha256": "5c06828151cd230add3e328b42dda72c4a2ed1075bd2902f38ee28727870bc84" + }, + { + "path": "research/rank7-joint-endframes/tools/relax.py", + "usage": "input", + "git_blob": "97dfe35c434283ca6e83818e61aed65740522f50", + "sha256": "0fed1c56b50a2e6d44deeeb6db0f1c7e1f71b86d1747130e1a9202216249a728" + }, + { + "path": "research/rank7-joint-endframes/tools/relax_exact.py", + "usage": "input", + "git_blob": "0be97756bb9d8b072c962c147d4b4d3b3122f884", + "sha256": "baf1855d6095c951a90d19a0d8094bd33290519940b732e2b758c5647830f044" + }, + { + "path": "research/rank7-joint-endframes/tools/root.py", + "usage": "input", + "git_blob": "bd6dc2eb4e5013625d17cc08461b67622bcfed69", + "sha256": "55f5aca39b5ee2fe4687ac8863e6c24569010f27a332883c069b8e14b8fe09e3" + }, + { + "path": "research/rank7-joint-endframes/tools/wordedit.py", + "usage": "input", + "git_blob": "e5893496cd6345cd91ecf3c1dd23a645ec5e0b0a", + "sha256": "cae8ae0f5d7fb3387ec6922fe966068aae05e3a6d3586830d4361b650cfb3617" + }, + { + "path": "research/rank7-joint-endframes/vendor/audit_local.py", + "usage": "input", + "git_blob": "8224873d0497cf0b4c202f31b145fa273553d978", + "sha256": "a38940094f7d19cd6376aafdd4734fa68eabc9aff4c98c3c4a3e9540328b1c90" + }, + { + "path": "research/rank7-joint-endframes/vendor/declared_rewrites.py", + "usage": "input", + "git_blob": "964fb2a9c773d60b2ac079f2a4b669d13cf56034", + "sha256": "2509f1335e47543f8814b42d6bf83032b30c5899b4f7cc62a6adc03f5138ae13" + }, + { + "path": "research/rank7-joint-endframes/vendor/preload_move.py", + "usage": "input", + "git_blob": "55b435035bbc439a9d55e8abd125993208cef8d9", + "sha256": "c8fda4674644fcd5cbf39b6645ce148a21daa90a998b678cbe51f970b78b0044" + }, + { + "path": "research/rank7-joint-endframes/verify.py", + "usage": "input", + "git_blob": "d58d988de13ad9d6a5e1d092ccfda7497f90fead", + "sha256": "5c6bdd35c81d9a2b3a12e020874a5d32e8b0783a3c35bff7a28d070586003401" + } + ] +} diff --git a/research/independent-v45-ledger-audit/TASK.json b/research/independent-v45-ledger-audit/TASK.json new file mode 100644 index 0000000000..f1f26d799c --- /dev/null +++ b/research/independent-v45-ledger-audit/TASK.json @@ -0,0 +1,66 @@ +{ + "schema_version": 1, + "task_id": "independent-moment", + "priority_revision": 6, + "base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "original_card": { + "id": "independent-moment", + "question": "Does one changed supplier or assembly claim lack a source-bound independent check of a specific new implication?", + "starting_points": [ + "certificates/selected-result.json", + "research/rank7-joint-endframes/README.md", + "docs/research/research-family-status.md" + ], + "methods": [ + "Independently reconstruct a coordinated frame/circuit change and its single-change control, then derive the complete rank and physical ledger.", + "Implement certified moment inequalities through a different exact enclosure method." + ], + "acceptance_gate": "Demonstrate independence, source binding, positive cases and semantic failure controls. Name the existing checks and the missing coverage. More digits or another equivalent evaluation of an unchanged root is not by itself new verification coverage.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #2979 joint rank-7 end-frame proposal and the revision-6 evidence status. Its claimed kappa is not selected. Compare coordinated changes with the losing single-change controls and locate the complete physical ledger; an aggregate moment alone does not validate the mechanism.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Prioritize a bounded independent audit of #2979: reconstruct one joint group and its single-lowering control, check the declared frames/chronology, then trace changed children, idle widths and cleanup buffers into the complete invoice and both supplier caps. Choose one still-missing implication after checking existing audits. Stop with exact unresolved dependencies if full admission exceeds the session; do not launch a new lowering census on an unvalidated premise or substitute extra root digits for mechanism checking.", + "bottleneck_link": "Independent pricing prevents unsupported frontier claims and can reveal genuine accounting slack.", + "allowed_variations": [ + "Reconstruct either a source ledger or a numeric enclosure with a different method." + ], + "scope_change_triggers": [ + "Importing the primary function and calling its output independent verification.", + "Promoting #2979 from merged source archive to validated supplier solely from author PASS receipts or aggregate pricing." + ], + "overlap_terms": [ + "independent moment", + "rank histogram", + "exact enclosure", + "2979", + "rank7 joint endframes", + "paired extraction", + "joint lowering" + ] + }, + "scope_status": "refined", + "actual_scope": "Independently reconstruct PR #2979's V45 coordinated end-frame change and a valid one-helper profile control under the pinned group-price model, then derive both supplier child-rank ledgers, idle-width totals, and the complete physical-family invoice.", + "scope_change_reason": "Narrowed the assigned card to V45 after live overlap review: PR #3823 records the triple intersection and PR #3841 records the printed margin ladder. This package adds an independent frame, provider-ledger, owner-fill, and full-invoice reconstruction, and states that the source search-time price attribution remains unproved.", + "bottleneck_link": "Independent pricing prevents unsupported frontier claims and can reveal genuine accounting slack.", + "budget_minutes": 60, + "stop_rule": "Stop after a source-bound positive V45 frame reconstruction, all proper subset controls losing under the pinned pricing table, exact reconciliation of both provider profiles and the global idle-inclusive rank histogram, and the full owner physical invoice; stop earlier if a source hash, frame-fit, or ledger identity fails.", + "outcome": "partial", + "evidence": "The stdlib verifier binds 112 source-package files, independently rebuilds the F2 frame walk and both provider reports, checks all 15 nonempty V45 endpoint-subset profiles under the complete stage-one gate refit, validates the serialized owner schedule/fill and semantic failure controls, and reconciles the 66,813 family invoice. The singleton margin uses the pinned V45 group-price row; the isolated frame-search price is not independently derived, and full admission is unrun.", + "author": "OpenAI Codex (macbook-12)", + "ai_assistance": "OpenAI Codex generated and executed this scoped audit. No separate human or formal-kernel review is claimed.", + "open_questions": [ + { + "question": "Can the V45 group price and singleton control be rederived without the search-time group-price row while preserving a monotone frame walk?", + "why_it_matters": "The endpoint-subset profiles are independently rebuilt, but their group margins use the pinned V45 shared refit charge. Without an independent attribution, the losing single-helper control inherits that price-table claim.", + "first_step": "Find a valid decomposition of the V45 gate changes from the complete 139-edit stage-one word, then recompute the group and subset child-profile costs.", + "blocked_by": "Applying the 29 V45 gate edits alone to the parent makes the frame walk nonmonotone at register 169; the pinned archive does not include the optimizer witness." + } + ] +} diff --git a/research/independent-v45-ledger-audit/VERIFY.json b/research/independent-v45-ledger-audit/VERIFY.json new file mode 100644 index 0000000000..fd51187d64 --- /dev/null +++ b/research/independent-v45-ledger-audit/VERIFY.json @@ -0,0 +1,131 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/rank7-joint-endframes/.gitattributes", + "research/rank7-joint-endframes/ALLOCATION-PINS.json", + "research/rank7-joint-endframes/CLAIM.json", + "research/rank7-joint-endframes/CREDITS.md", + "research/rank7-joint-endframes/MANIFEST.json", + "research/rank7-joint-endframes/NOTICE", + "research/rank7-joint-endframes/PINS.json", + "research/rank7-joint-endframes/README.md", + "research/rank7-joint-endframes/SOURCES.json", + "research/rank7-joint-endframes/TASK.json", + "research/rank7-joint-endframes/VERIFY.json", + "research/rank7-joint-endframes/allocation/DISPATCH.json", + "research/rank7-joint-endframes/allocation/FILL.json.gz", + "research/rank7-joint-endframes/allocation/ORDER.json", + "research/rank7-joint-endframes/allocation/PROFILE.json", + "research/rank7-joint-endframes/allocation/PROVIDERS.json", + "research/rank7-joint-endframes/allocation/SEARCH.json", + "research/rank7-joint-endframes/allocation/baseline/CLAIM.json", + "research/rank7-joint-endframes/allocation/baseline/ORDER.json", + "research/rank7-joint-endframes/allocation/baseline/PROFILE.json", + "research/rank7-joint-endframes/allocation/vendor/PLAN.json.gz", + "research/rank7-joint-endframes/allocation/vendor/TEMPLATE.json.gz", + "research/rank7-joint-endframes/allocation/vendor/independent_owners.py", + "research/rank7-joint-endframes/certificates/RELAX-CAP.json", + "research/rank7-joint-endframes/certificates/RELAX-STAGES.json", + "research/rank7-joint-endframes/check_allocation.py", + "research/rank7-joint-endframes/check_cap.py", + "research/rank7-joint-endframes/comparators/PR2942-CLAIM.json", + "research/rank7-joint-endframes/comparators/PR2957-CLAIM.json", + "research/rank7-joint-endframes/comparators/PR2966-CLAIM.json", + "research/rank7-joint-endframes/construction/STAGE-PRICES.json", + "research/rank7-joint-endframes/construction/allocation/T37-FACE-MIX.json", + "research/rank7-joint-endframes/construction/allocation/T37-FLOW.json.gz", + "research/rank7-joint-endframes/construction/allocation/T37-MODEL.json", + "research/rank7-joint-endframes/construction/allocation/T37-PATTERNS.json", + "research/rank7-joint-endframes/construction/allocation/T37-SOLVER.json", + "research/rank7-joint-endframes/construction/allocation/T74-CONTROLS.json", + "research/rank7-joint-endframes/construction/allocation/T74-OWNER-CHECK.json", + "research/rank7-joint-endframes/construction/allocation/assemble.py", + "research/rank7-joint-endframes/construction/allocation/controls.py", + "research/rank7-joint-endframes/construction/allocation/diag_lp.py", + "research/rank7-joint-endframes/construction/allocation/double.py", + "research/rank7-joint-endframes/construction/allocation/fill17.py", + "research/rank7-joint-endframes/construction/allocation/providers_from_words.py", + "research/rank7-joint-endframes/construction/allocation/round_mix.py", + "research/rank7-joint-endframes/construction/records/derive_stage2.py", + "research/rank7-joint-endframes/construction/records/make_data.py", + "research/rank7-joint-endframes/construction/records/make_prices.py", + "research/rank7-joint-endframes/construction/search/codim2.py", + "research/rank7-joint-endframes/construction/search/combine.py", + "research/rank7-joint-endframes/construction/search/deliver_l22.py", + "research/rank7-joint-endframes/construction/search/final_l27.py", + "research/rank7-joint-endframes/construction/search/lowerA.py", + "research/rank7-joint-endframes/construction/search/lowerA_joint.py", + "research/rank7-joint-endframes/construction/search/realize.py", + "research/rank7-joint-endframes/construction/search/vlower.py", + "research/rank7-joint-endframes/data/PARENT-base.json.gz", + "research/rank7-joint-endframes/data/PARENT-extra.json.gz", + "research/rank7-joint-endframes/data/REWRITES-2957.json", + "research/rank7-joint-endframes/data/STAGE1-FRAME-EDITS.json", + "research/rank7-joint-endframes/data/TRANSFORM-226.json", + "research/rank7-joint-endframes/data/TRANSFORM-228.json", + "research/rank7-joint-endframes/data/TRANSFORM-230.json", + "research/rank7-joint-endframes/data/TRANSFORM-363.json", + "research/rank7-joint-endframes/data/TRANSFORM-395.json", + "research/rank7-joint-endframes/data/WORD-base.json.gz", + "research/rank7-joint-endframes/data/WORD-extra.json.gz", + "research/rank7-joint-endframes/evidence/ADAPTER-DERIVATION.json", + "research/rank7-joint-endframes/evidence/ADMISSION-RESULT.json", + "research/rank7-joint-endframes/evidence/ADMISSION-STAGES.json", + "research/rank7-joint-endframes/evidence/ENVIRONMENT.json", + "research/rank7-joint-endframes/evidence/FULL-NATIVE-RECEIPT.json", + "research/rank7-joint-endframes/evidence/FULL-NATIVE-RESULT.json", + "research/rank7-joint-endframes/evidence/FULL-REPLAY-RESULT.json", + "research/rank7-joint-endframes/evidence/FULL-REPLAY-STAGES.json", + "research/rank7-joint-endframes/evidence/OVERLAY-DERIVATION.json", + "research/rank7-joint-endframes/evidence/RELEASE-RECEIPT.json", + "research/rank7-joint-endframes/evidence/RETAINED-BOOTSTRAP-RECEIPT.json", + "research/rank7-joint-endframes/evidence/RUNTIME-PATCHES.json", + "research/rank7-joint-endframes/evidence/logs/admission-discovery.log.txt", + "research/rank7-joint-endframes/evidence/logs/admission-outer-check_ledger.py.log.txt", + "research/rank7-joint-endframes/evidence/logs/admission-outer-independent_check.py.log.txt", + "research/rank7-joint-endframes/evidence/logs/admission-owners.log.txt", + "research/rank7-joint-endframes/evidence/logs/admission-parent-lift.log.txt", + "research/rank7-joint-endframes/evidence/logs/admission-rebind.log.txt", + "research/rank7-joint-endframes/evidence/logs/admission-release.log.txt", + "research/rank7-joint-endframes/evidence/logs/complete-admission.log.txt", + "research/rank7-joint-endframes/evidence/logs/derive-closed-adapters.log.txt", + "research/rank7-joint-endframes/evidence/logs/export-pr2833.log.txt", + "research/rank7-joint-endframes/evidence/logs/export-pr2894.log.txt", + "research/rank7-joint-endframes/evidence/logs/four-kernel-stage.log.txt", + "research/rank7-joint-endframes/evidence/logs/fresh-current-native.log.txt", + "research/rank7-joint-endframes/evidence/logs/fresh-retained-bootstrap.log.txt", + "research/rank7-joint-endframes/evidence/logs/paired-extension-stage.log.txt", + "research/rank7-joint-endframes/evidence/logs/parent-paired-stage.log.txt", + "research/rank7-joint-endframes/evidence/logs/preload-stage.log.txt", + "research/rank7-joint-endframes/evidence/logs/rank7-overlay-stage.log.txt", + "research/rank7-joint-endframes/producer.py", + "research/rank7-joint-endframes/reproduce.py", + "research/rank7-joint-endframes/run_registered.py", + "research/rank7-joint-endframes/structure.py", + "research/rank7-joint-endframes/tools/audit_allocation_moment.py", + "research/rank7-joint-endframes/tools/build_overlay.py", + "research/rank7-joint-endframes/tools/derive_adapters.py", + "research/rank7-joint-endframes/tools/relax.py", + "research/rank7-joint-endframes/tools/relax_exact.py", + "research/rank7-joint-endframes/tools/root.py", + "research/rank7-joint-endframes/tools/wordedit.py", + "research/rank7-joint-endframes/vendor/audit_local.py", + "research/rank7-joint-endframes/vendor/declared_rewrites.py", + "research/rank7-joint-endframes/vendor/preload_move.py", + "research/rank7-joint-endframes/verify.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Bind the full pinned source archive; reconstruct the V45 F2 space and gate frames; verify one-through-four endpoint margins across all 15 subsets; rebuild stage-one and both provider child-rank and width ledgers; reconcile local children plus idle to the global rank profile; validate owner chronology, family uniqueness, capacities, dispatch and the complete physical invoice; reject five semantic failure controls." + } + ] +} diff --git a/research/independent-v45-ledger-audit/verify.py b/research/independent-v45-ledger-audit/verify.py new file mode 100644 index 0000000000..455d1fb639 --- /dev/null +++ b/research/independent-v45-ledger-audit/verify.py @@ -0,0 +1,691 @@ +#!/usr/bin/env python3 +"""Independent stdlib audit of PR #2979's V45 lowering and final ledgers. + +This script reads the frozen source archive as data. It imports no module from +that archive, does not run its registered verifier or owner engine, and does +not calculate a new kappa root. +""" +from collections import Counter, defaultdict +from copy import deepcopy +import gzip +import hashlib +import json +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[2] +HERE = Path(__file__).resolve().parent +SOURCE = ROOT / "research/rank7-joint-endframes" +NORMS = (7, 42, 45) +LOCAL_REGISTERS = 704 +HELPER_START = 224 +HELPER_STOP = 704 +PORT_COUNT = 112 +GUARD_COUNT = 2 + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def read_json(path): + return json.loads(path.read_text()) + + +def read_gzip_json(path): + with gzip.open(path, "rt", encoding="utf-8") as stream: + return json.load(stream) + + +def sha256(path): + return hashlib.sha256(path.read_bytes()).hexdigest() + + +def bind_source_archive(pins): + manifest_path = SOURCE / "MANIFEST.json" + need(sha256(manifest_path) == pins["source_manifest_sha256"], + "source package manifest hash differs from local pin") + expected = read_json(manifest_path) + actual = {} + for path in SOURCE.rglob("*"): + need(not path.is_symlink(), "source archive contains an unexpected symlink") + if path.is_file() and path != manifest_path: + actual[path.relative_to(SOURCE).as_posix()] = sha256(path) + need(actual == expected, "source package file set or SHA-256 differs from manifest") + allocation_pins = read_json(SOURCE / "ALLOCATION-PINS.json") + for relative, digest in allocation_pins.items(): + need(sha256(SOURCE / relative) == digest, + "source allocation pin differs: " + relative) + return len(actual), len(allocation_pins) + + +def basis(vectors): + """Return an echelon basis over F2 using highest-bit pivots.""" + pivots = {} + for vector in vectors: + value = int(vector) + need(value >= 0, "negative F2 vector") + while value: + pivot = value.bit_length() - 1 + if pivot in pivots: + value ^= pivots[pivot] + else: + pivots[pivot] = value + break + return tuple(pivots[p] for p in sorted(pivots, reverse=True)) + + +def rank(vectors): + return len(basis(vectors)) + + +def contained(small, large): + rows = basis(large) + for raw in small: + value = int(raw) + for row in rows: + pivot = row.bit_length() - 1 + if (value >> pivot) & 1: + value ^= row + if value: + return False + return True + + +def same_space(left, right): + return contained(left, right) and contained(right, left) + + +def hyperplane(normal): + need(0 < normal < 512, "normal outside F2^9") + return basis(value for value in range(1, 512) + if (value & normal).bit_count() % 2 == 0) + + +def valid_v45_space(space): + return (rank(space) == 7 and + all((int(vector) & normal).bit_count() % 2 == 0 + for vector in space for normal in NORMS)) + + +def frame_report(word): + """Rebuild the local child-rank and width report from word events. + + The walk tracks each register's current subspace. An event that needs a + larger frame pays one child at the dimension difference; terminal helper + widths are counted from their start and end frames. + """ + full = basis(1 << bit for bit in range(9)) + ports = word["ports"] + endings = ([full] * PORT_COUNT + + [hyperplane(port) for port in ports] + + [full] * 480) + for register, frame in word["helper_final"].items(): + endings[int(register)] = basis(frame) + + beginnings = [(port,) for port in ports] + [()] * (PORT_COUNT + 480) + for register, frame in word["start_extra"].items(): + beginnings[int(register)] = basis(frame) + + current = [basis(frame) for frame in beginnings] + paid = Counter() + + def climb(register, target): + target_basis = basis(target) + need(contained(current[register], target_basis), + "nonmonotone frame at register " + str(register)) + delta = rank(target_basis) - rank(current[register]) + if delta: + paid[delta] += 1 + current[register] = target_basis + + def event(gate): + if gate[0] == "warp": + need(same_space(current[gate[1]], gate[3]), "warp source frame mismatch") + current[gate[1]] = basis(gate[4]) + return + need(gate[0] in ("add", "scale"), "unknown word operation " + str(gate[0])) + registers = gate[1:3] if gate[0] == "add" else gate[1:2] + for register in registers: + climb(register, gate[-1]) + + for gate in word["A"]: + event(gate) + + for register, centre_frame in zip(word["centers"], word["center_frames"]): + need(same_space(current[register], centre_frame), "centre frame mismatch") + targets = { + basis(word["target_levels"].get(str(gate[1] - PORT_COUNT), [])) + for gate in word["cut"] if gate[2] == register + } + current_level = basis(centre_frame) + for target in sorted(targets, key=lambda value: -len(value)): + if not same_space(current_level, target): + paid[len(current_level) - len(target)] += 1 + current_level = target + + warps_by_position = defaultdict(list) + for warp in word["warps"]: + warps_by_position[warp[0]].append(warp) + for position in range(len(word["B"]) + 1): + for warp in warps_by_position.get(position, []): + need(same_space(current[warp[1]], warp[3]), "B warp source frame mismatch") + current[warp[1]] = basis(warp[4]) + if position < len(word["B"]): + event(word["B"][position]) + + for gate in word["restore"]: + event(gate) + + live = set(range(LOCAL_REGISTERS)) - set(word["removed"]) + for register in live: + climb(register, endings[register]) + + widths = Counter(rank(endings[register]) - rank(beginnings[register]) + for register in live if register >= HELPER_START) + profile = {str(key): paid[key] for key in sorted(paid) if paid[key]} + inventory = {str(key): widths[key] for key in sorted(widths) if widths[key]} + return profile, inventory + + +def gate_registers(signature): + if signature[0] == "add": + return signature[1:3] + if signature[0] == "scale": + return signature[1:2] + return () + + +def apply_stage_one(parent, record, lowered, *, omit=None, edited_record=None): + """Apply the shared recorded gate refit and selected terminal lowerings.""" + row = record if edited_record is None else edited_record + result = deepcopy(parent) + seen = set() + for edit in row["frame_edits"]: + key = (edit["section"], edit["index"]) + need(key not in seen, "duplicate frame-edit address") + seen.add(key) + section, index = key + gate = result[section][index] + need(gate[:-1] == edit["gate"] and gate[-1] == edit["old_frame"], + "gate signature/frame preimage mismatch at " + repr(key)) + need(contained(edit["new_frame"], edit["old_frame"]), + "edited gate frame is not a subspace of its preimage") + need(rank(edit["new_frame"]) == rank(edit["old_frame"]) - 1, + "edited gate frame did not drop exactly one dimension") + if omit != key: + gate[-1] = list(edit["new_frame"]) + + changes = record["helper_final_changes"] + for helper in lowered: + change = changes[str(helper)] + need(parent["helper_final"].get(str(helper)) == change["old"], + "helper endpoint preimage mismatch at " + str(helper)) + need(rank(change["new"]) == rank(change["old"]) - 1, + "helper endpoint did not drop exactly one dimension") + result["helper_final"][str(helper)] = list(change["new"]) + return result + + +def word_gate_fit(word, helpers, space): + for section in ("A", "B", "restore"): + for index, gate in enumerate(word[section]): + if gate[0] in ("add", "scale") and set(gate_registers(gate)) & set(helpers): + if not contained(gate[-1], space): + return False, (section, index) + return True, None + + +def profile_cost(profile, weights): + return sum(int(count) * weights[int(rank)] for rank, count in profile.items()) + + +def rank_mass(profile): + return sum(int(rank) * int(count) for rank, count in profile.items()) + + +def widths_histogram(widths): + return {str(width): count for width, count in sorted(Counter(widths).items())} + + +def derive_windows(template, order, replicas): + rank_by_child = {int(row["child"]): int(row["rank"]) + for row in template["idle_children"]} + pair_by_stage = {int(row["stage"]): int(row["pair"]) + for row in template["recipe"] if row["kind"] == "local"} + blocks = {} + stage = None + ignored = {"bank_padding_cover_sweep", "translate_every_live_family"} + for item in template["execution_schedule"]: + if item["kind"] in ignored: + continue + if item["kind"] == "local_cover_sweep": + stage = int(item["stage"]) + blocks[stage] = [] + need(stage is not None, "source event precedes first local stage") + blocks[stage].append(item) + need(set(blocks) == set(range(9)), "expected nine source stages") + + progress = [0] * replicas + last_source = {} + windows = {} + for time, (raw_stage, raw_replica) in enumerate(order): + current_stage, replica = int(raw_stage), int(raw_replica) + need(0 <= replica < replicas and current_stage == progress[replica], + "call order violates stage chronology") + progress[replica] += 1 + for position, item in enumerate(blocks[current_stage]): + kind = item["kind"] + if kind == "local_cover_sweep": + need(position == 0, "local sweep is not first in its stage") + last_source[replica, pair_by_stage[current_stage]] = time + elif kind == "bridge": + last_source[replica, item["src"]] = time + last_source[replica, item["dst"]] = time + elif kind == "idle_cover_sweep": + start = last_source.get((replica, item["pair"]), -1) + for child in item["child_indices"]: + child = int(child) + if child in rank_by_child: + windows[replica, child] = (rank_by_child[child], start, time) + elif kind in ("terminal_Y_translations", "terminal"): + pass + else: + raise ValueError("unknown source-window event " + str(kind)) + need(progress == [9] * replicas, "replica chronology is incomplete") + return windows, pair_by_stage + + +def check_fill(fill, order, dispatch_rows, plan, template, providers): + dispatch = {} + for stage, replica, provider in dispatch_rows: + key = (int(stage), int(replica)) + need(key not in dispatch, "duplicate provider dispatch") + need(provider in providers, "unknown provider dispatch") + dispatch[key] = provider + need(set(dispatch) == {tuple(map(int, row)) for row in order}, + "provider dispatch does not bind the complete order") + + replicas = len(order) // 9 + need(replicas * 9 == len(order), "call count is not nine stages per replica") + windows, _ = derive_windows(template, order, replicas) + need(fill["columns"] == ["time", "helper", "owner_replica", "child", "port", "offset"], + "role column schema mismatch") + rows = fill["rows"] + need(len(rows) == len(order) * 408, "role count is not 408 per call") + pair = plan["pairs"] + side = plan["sides"] + need(set(pair) == set(side), "bin pair/side keys differ") + helper_masks = [0] * len(order) + family_masks = [set() for _ in order] + used_families = set() + occupancy = {} + provider_role_counts = Counter() + for row in rows: + need(len(row) == 6 and all(type(value) is int for value in row), + "non-integer role row") + time, helper, owner, child, port, offset = row + need(0 <= time < len(order) and 0 <= helper < 408 and + 0 <= port < PORT_COUNT and offset >= 0, "role row outside declared domain") + need((owner, child) in windows, "role has no source window") + cap, lo, hi = windows[owner, child] + need(lo < time <= hi, "role is outside its source window") + helper_bit = 1 << helper + need(not helper_masks[time] & helper_bit, "duplicate helper at a call") + helper_masks[time] |= helper_bit + + stage, replica = map(int, order[time]) + provider = dispatch[stage, replica] + provider_role_counts[provider] += 1 + width = int(providers[provider]["widths"][helper]) + need(offset + width <= cap, "role exceeds bin capacity") + child_key = str(child) + need(child_key in pair and child_key in side, "bin has no physical family map") + family = (owner * 896 + + (2 * int(pair[child_key]) + int(side[child_key])) * PORT_COUNT + port) + family_bitset = family_masks[time] + need(family not in family_bitset, "two helpers use one family in a call") + family_bitset.add(family) + used_families.add(family) + + key = (owner, child, port) + mask = ((1 << width) - 1) << offset + need(not occupancy.get(key, 0) & mask, "two roles overlap within a family") + occupancy[key] = occupancy.get(key, 0) | mask + + complete_helper_mask = (1 << 408) - 1 + need(all(mask == complete_helper_mask for mask in helper_masks), + "one or more calls lack a helper role") + expected_live = replicas * 896 + need(all(0 <= family < expected_live for family in used_families), + "physical family ID exceeds the reserved live-family domain") + need(len(used_families) <= expected_live, "more distinct assignments than live stock") + return { + "replicas": replicas, + "calls": len(order), + "roles": len(rows), + "live_families": expected_live, + "distinct_assigned_families": len(used_families), + "roles_by_provider": dict(sorted(provider_role_counts.items())), + } + + +def rejected(label, action): + try: + action() + except (ValueError, KeyError, IndexError): + return label + raise ValueError("semantic failure control accepted: " + label) + + +def main(): + pins = read_json(HERE / "PINS.json") + need(pins["base_commit"] == "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "unexpected research base") + need(pins["source_pr"] == 2979 and + pins["source_head"] == "be191346391661f4d35fc0d1508d0a6029572576", + "unexpected PR #2979 source head") + source_file_count, allocation_pin_count = bind_source_archive(pins) + + record = read_json(SOURCE / "data/STAGE1-FRAME-EDITS.json") + price_data = read_json(SOURCE / "construction/STAGE-PRICES.json") + groups = record["groups"] + space, v45_helpers = groups["V45"] + need(valid_v45_space(space), "V45 is not the claimed rank-seven intersection") + need(rank(NORMS) == 2, "V45 normals do not impose exactly two independent conditions") + need((7 ^ 42) == 45, "V45 circuit relation differs") + + parents = {kind: read_gzip_json(SOURCE / f"data/PARENT-{kind}.json.gz") + for kind in ("base", "extra")} + final_words = {kind: read_gzip_json(SOURCE / f"data/WORD-{kind}.json.gz") + for kind in ("base", "extra")} + for kind, word in parents.items(): + profile, inventory = frame_report(word) + need(profile == word["report"]["local_profile"], + "independent parent child-rank report differs for " + kind) + need(inventory == word["report"]["width_inventory"], + "independent parent width report differs for " + kind) + + edits = record["frame_edits"] + need(len(record["helper_final_changes"]) == 22 and len(edits) == 139, + "stage-one declared edit counts changed") + v45_edit_positions = { + (edit["section"], edit["index"]) + for edit in edits if set(gate_registers(edit["gate"])) & set(v45_helpers) + } + need(len(v45_edit_positions) == 29, "V45 gate-edit count changed") + + old_end = parents["base"]["helper_final"] + for helper in v45_helpers: + change = record["helper_final_changes"][str(helper)] + need(old_end[str(helper)] == change["old"], "V45 endpoint preimage mismatch") + need(same_space(space, change["new"]), "V45 endpoint is not the shared space") + need(rank(change["old"]) == 8 and rank(change["new"]) == 7 and + contained(change["new"], change["old"]), "V45 endpoint is not a hyperplane lowering") + + for edit in edits: + need(edit["section"] in ("A", "B", "restore"), "unexpected frame-edit section") + need(rank(edit["old_frame"]) == rank(edit["new_frame"]) + 1 and + contained(edit["new_frame"], edit["old_frame"]), "gate edit is not a one-rank subspace") + + all_stage1_profiles = {} + stage1_words = {} + for kind, word in parents.items(): + stage1 = apply_stage_one(word, record, + {int(helper) for helper in record["helper_final_changes"]}) + fit, failed_gate = word_gate_fit(stage1, v45_helpers, space) + need(fit, "V45 partner gate falls outside W: " + repr(failed_gate)) + need(stage1["cleanup"] == word["cleanup"], "stage one changed cleanup data") + for section in ("A", "B", "restore"): + need(all(before[:-1] == after[:-1] + for before, after in zip(word[section], stage1[section])), + "stage one changed a gate/operator/scalar") + profile, inventory = frame_report(stage1) + need(profile == record["declared_local_profile"], "stage-one local profile mismatch") + need(inventory == record["declared_width_inventory"], "stage-one width inventory mismatch") + all_stage1_profiles[kind] = (profile, inventory) + stage1_words[kind] = stage1 + + weights = {int(rank): int(value) for rank, value in price_data["weights"]["c"].items()} + break_even = int(price_data["weights"]["break_even"]) + base_profile = parents["base"]["report"]["local_profile"] + all_profile = all_stage1_profiles["base"][0] + all_delta = profile_cost(all_profile, weights) - profile_cost(base_profile, weights) + need(all_delta == price_data["stage1"]["literal_price_units"], + "complete stage-one price does not follow from independently rebuilt profiles") + + all_lowered = {int(helper) for helper in record["helper_final_changes"]} + source_group_prices = {} + for group_name, (_, helpers) in groups.items(): + source_group = next(row for row in price_data["stage1"]["groups"] + if row["group"] == group_name) + need(source_group["joint_margin"] == + -source_group["joint_delta"] - len(helpers) * break_even, + "joint margin arithmetic differs for group " + group_name) + source_group_prices[group_name] = { + "joint_delta_units": source_group["joint_delta"], + "joint_margin_units": source_group["joint_margin"], + "helpers": len(helpers), + } + need(sum(row["joint_delta_units"] for row in source_group_prices.values()) == all_delta, + "five source group prices do not sum to the independently rebuilt stage-one profile cost") + + v45_joint = v45_source_group = next(row for row in price_data["stage1"]["groups"] + if row["group"] == "V45") + v45_joint_margin = int(v45_joint["joint_margin"]) + need(v45_joint["helpers"] == v45_helpers, "V45 helper inventory mismatch") + no_v45_endpoints = deepcopy(stage1_words["base"]) + for helper in v45_helpers: + no_v45_endpoints["helper_final"][str(helper)] = \ + parents["base"]["helper_final"][str(helper)] + no_v45_profile, _ = frame_report(no_v45_endpoints) + fixed_gate_delta = profile_cost(all_profile, weights) - profile_cost(no_v45_profile, weights) + need(fixed_gate_delta == -len(v45_helpers) * weights[1], + "fixed-gate V45 endpoint delta is not four rank-one child savings") + partner_refit_overhead = int(v45_joint["joint_delta"]) - fixed_gate_delta + + subset_prices = [] + source_subsets = {tuple(row["helpers"]): row for row in v45_source_group["subsets"]} + for mask in range(1, 1 << len(v45_helpers)): + selected = {v45_helpers[index] for index in range(len(v45_helpers)) + if (mask >> index) & 1} + reverted = set(v45_helpers) - selected + candidate = deepcopy(stage1_words["base"]) + for helper in reverted: + candidate["helper_final"][str(helper)] = parents["base"]["helper_final"][str(helper)] + fits, failed_gate = word_gate_fit(candidate, selected, space) + need(fits, "V45 subset control has an unfitted partner gate: " + repr(failed_gate)) + profile, _ = frame_report(candidate) + need(candidate["cleanup"] == stage1_words["base"]["cleanup"], + "V45 endpoint-only control changed cleanup data") + reverted_endpoint_cost = profile_cost(profile, weights) - profile_cost(all_profile, weights) + expected_reversion_cost = len(reverted) * weights[1] + need(reverted_endpoint_cost == expected_reversion_cost, + "V45 terminal reversion cost differs from rank-one child tariff") + endpoint_delta = profile_cost(profile, weights) - profile_cost(no_v45_profile, weights) + need(endpoint_delta == -len(selected) * weights[1], + "V45 endpoint-only delta differs from rank-one tariff") + delta = endpoint_delta + partner_refit_overhead + margin = -delta - len(selected) * break_even + source = source_subsets[tuple(helper for helper in v45_helpers if helper in selected)] + need(delta == source["delta"] and margin == source["margin"], + "V45 subset price mismatch for " + repr(sorted(selected))) + subset_prices.append((len(selected), delta, margin)) + need(all(margin < 0 for size, _, margin in subset_prices if size < len(v45_helpers)), + "a proper V45 subset unexpectedly meets the joint margin") + need(next(margin for size, _, margin in subset_prices if size == len(v45_helpers)) > 0, + "joint V45 group no longer clears its reported margin") + + final_profiles = {} + provider_registry = read_json(SOURCE / "allocation/PROVIDERS.json") + for kind, word in final_words.items(): + profile, inventory = frame_report(word) + provider = "gauge44" if kind == "base" else "extra" + need(profile == {str(k): int(v) for k, v in + provider_registry[provider]["actual_paid_profile"].items()}, + "final provider paid profile mismatch for " + provider) + need(inventory == widths_histogram(provider_registry[provider]["widths"]), + "final provider width inventory mismatch for " + provider) + need(len(word["helper_final"]) == 91 and len(word["centers"]) == 8, + "final private buffer or centre count mismatch for " + provider) + buffer_registers = set() + for gate in word["cleanup"]: + for register in gate_registers(gate): + if register >= LOCAL_REGISTERS: + buffer_registers.add(register) + need(len(buffer_registers) == 91, "cleanup does not expose 91 private buffers") + final_profiles[kind] = profile + need(final_profiles["base"] == final_profiles["extra"], + "the two provider words have different local profiles") + + final_profile = final_profiles["base"] + final_delta = profile_cost(final_profile, weights) - profile_cost(base_profile, weights) + final_width_loss = rank_mass(base_profile) - rank_mass(final_profile) + total = price_data["total"] + need(final_delta == total["literal_price_units"], "full final child cost differs from the source ledger") + need(final_width_loss == total["freed_width_units"], "full final rank-mass reduction differs") + need(-final_delta - final_width_loss * break_even == total["margin"], + "full final margin arithmetic differs") + + claim = read_json(SOURCE / "CLAIM.json") + order = read_json(SOURCE / "allocation/ORDER.json") + dispatch = read_json(SOURCE / "allocation/DISPATCH.json") + fill = read_gzip_json(SOURCE / "allocation/FILL.json.gz") + plan = read_gzip_json(SOURCE / "allocation/vendor/PLAN.json.gz") + template = read_gzip_json(SOURCE / "allocation/vendor/TEMPLATE.json.gz") + owner = read_json(SOURCE / "construction/allocation/T74-OWNER-CHECK.json") + owner_summary = check_fill(fill, order, dispatch, plan, template, provider_registry) + + global_profile = {int(rank): int(count) for rank, count in + read_json(SOURCE / "allocation/PROFILE.json").items()} + idle = {int(rank): int(count) for rank, count in + read_json(SOURCE / "allocation/SEARCH.json")["idle_histogram"].items()} + local = {int(rank): int(count) for rank, count in final_profile.items()} + reconciled = {rank: local.get(rank, 0) * len(order) + idle.get(rank, 0) + for rank in set(local) | set(idle)} + reconciled = {rank: count for rank, count in reconciled.items() if count} + need(reconciled == global_profile, "local children plus idle widths do not equal full profile") + total_rank_mass = sum(rank * count for rank, count in global_profile.items()) + need(total_rank_mass == owner["rank_mass"], "full child-rank mass mismatch") + need(owner_summary["live_families"] == claim["live_families"] == 66304, + "live physical family count mismatch") + helpers = len(provider_registry["extra"]["widths"]) + centres = len(final_words["base"]["centers"]) + private = len(final_words["base"]["helper_final"]) + guards = int(owner["physical"]) - owner_summary["live_families"] - helpers - centres - private + physical = owner_summary["live_families"] + helpers + centres + private + guards + need(guards == GUARD_COUNT and physical == 66813 == owner["physical"] == claim["physical_families"], + "complete physical family invoice mismatch") + + # Semantic failure controls: wrong shared space, omitted partner refit, + # stale gate signature, duplicate helper row, and over-capacity offset. + wrong_space = None + for index in range(len(space)): + for bit in range(9): + candidate = list(space) + candidate[index] ^= 1 << bit + if rank(candidate) == 7 and not valid_v45_space(candidate): + wrong_space = candidate + break + if wrong_space is not None: + break + need(wrong_space is not None, "failed to construct wrong-space control") + controls = [rejected("wrong_v45_subspace", lambda: need( + valid_v45_space(wrong_space), "wrong rank-seven space"))] + + omitted_edit = None + for edit in edits: + if ((edit["section"], edit["index"]) in v45_edit_positions and + not contained(edit["old_frame"], space)): + omitted_edit = edit + break + need(omitted_edit is not None, "no V45 gate refit available for omission control") + omitted_word = apply_stage_one( + parents["base"], record, all_lowered, + omit=(omitted_edit["section"], omitted_edit["index"])) + fits, _ = word_gate_fit(omitted_word, v45_helpers, space) + controls.append(rejected("omitted_partner_gate_refit", lambda: need( + fits, "a lowered helper has an unfitted partner gate"))) + + mutated_record = deepcopy(record) + mutated_record["frame_edits"][0]["gate"][3] *= -1 + controls.append(rejected("changed_gate_scalar_preimage", lambda: apply_stage_one( + parents["base"], record, all_lowered, edited_record=mutated_record))) + + bad_rows = list(fill["rows"]) + bad_rows[1] = list(bad_rows[0]) + duplicate_fill = {**fill, "rows": bad_rows} + controls.append(rejected("duplicate_helper_role", lambda: check_fill( + duplicate_fill, order, dispatch, plan, template, provider_registry))) + + bad_rows = list(fill["rows"]) + bad_rows[0] = list(bad_rows[0]) + bad_rows[0][5] = 49 + overflow_fill = {**fill, "rows": bad_rows} + controls.append(rejected("bin_capacity_overflow", lambda: check_fill( + overflow_fill, order, dispatch, plan, template, provider_registry))) + + metrics = { + "status": "PASS_INDEPENDENT_V45_FRAME_COST_AND_PHYSICAL_LEDGER", + "base_commit": pins["base_commit"], + "priority_revision": pins["priority_revision"], + "source_pr": pins["source_pr"], + "source_head": pins["source_head"], + "source_files_hash_bound": source_file_count, + "allocation_inputs_hash_bound": allocation_pin_count, + "v45": { + "normals": list(NORMS), + "relation": "7 xor 42 = 45", + "space_rank": rank(space), + "helpers": list(v45_helpers), + "edited_partner_gates": len(v45_edit_positions), + "subset_count": len(subset_prices), + "fixed_gate_endpoint_delta_units": fixed_gate_delta, + "source_joint_delta_units": v45_joint["joint_delta"], + "implied_shared_partner_refit_overhead_units": partner_refit_overhead, + "subset_margins_by_cardinality": { + str(size): sorted({margin for n, _, margin in subset_prices if n == size}) + for size in range(1, len(v45_helpers) + 1) + }, + "single_lowering_margin": subset_prices[0][2], + "joint_margin": next(margin for size, _, margin in subset_prices if size == 4), + }, + "stage_one": { + "lowered_endpoints": 22, + "gate_frame_edits": 139, + "local_profile": all_profile, + "source_joint_group_delta_and_margin": source_group_prices, + "literal_price_units": all_delta, + "freed_width_units": 22, + "margin": -all_delta - 22 * break_even, + }, + "final": { + "provider_profiles_equal": True, + "provider_local_profile": final_profile, + "provider_width_inventory": widths_histogram(provider_registry["extra"]["widths"]), + "literal_price_units_from_parent": final_delta, + "freed_width_units_from_parent": final_width_loss, + "margin_from_parent": total["margin"], + }, + "physical": { + **owner_summary, + "helpers": helpers, + "centres": centres, + "private_buffers": private, + "guards_from_pinned_invoice_residual": guards, + "physical_families": physical, + "provider_calls": dict(sorted(Counter( + provider for _, _, provider in dispatch).items())), + "global_child_rank_mass": total_rank_mass, + "global_rank_profile": {str(k): v for k, v in sorted(global_profile.items())}, + "idle_rank_profile": {str(k): v for k, v in sorted(idle.items())}, + }, + "controls_rejected": controls, + "scope": "Exact finite source-bound ledger audit; no new kappa root, full native replay, independent algebra replay, outer theorem, or supplier admission.", + } + print(json.dumps(metrics, indent=2, sort_keys=True)) + + +if __name__ == "__main__": + main()