diff --git a/research/rank7-coupled-586-588-carrier-fold/.gitattributes b/research/rank7-coupled-586-588-carrier-fold/.gitattributes new file mode 100644 index 0000000000..e1d75a2b2d --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/.gitattributes @@ -0,0 +1,2 @@ +# Keep vendored, data, allocation and evidence bytes exact (the repository default normalizes text). +* -text diff --git a/research/rank7-coupled-586-588-carrier-fold/ALLOCATION-PINS.json b/research/rank7-coupled-586-588-carrier-fold/ALLOCATION-PINS.json new file mode 100644 index 0000000000..0ba0af1917 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/ALLOCATION-PINS.json @@ -0,0 +1,14 @@ +{ + "allocation/DISPATCH.json": "65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c", + "allocation/FILL.json.gz": "68b8bae90144248774b1920cd27f9519caa3dc427704d8a9da6d4c491d912fc4", + "allocation/ORDER.json": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1", + "allocation/PROFILE.json": "a815694364065a6d1275c59c17235f4cf400d28d8f7fe3bb3314c57c35dee44c", + "allocation/PROVIDERS.json": "52eb0d85caa7b2d4a93acdf5011f52b793f61ddca86235fb03cd9a09397ad4cd", + "allocation/SEARCH.json": "aff630fad679c7c5773f16f92dce6234e5b5519626861e9bd83b9884f002066f", + "allocation/baseline/CLAIM.json": "656a4c93411b078753783513e2e71b1722a56e7b70120264a38118811982fa77", + "allocation/baseline/ORDER.json": "d559a1dcb83707724afc0310f6ef8e3a36ad6cda0a895ca6abae9d6f39a0fc76", + "allocation/baseline/PROFILE.json": "6de8ac1fd628cdd2afa5a43872da69c7dab9d7219bdc318f9db55fd8ccdb5eb2", + "allocation/vendor/PLAN.json.gz": "d566cfb87b71639d4138e1f89b543e2dd6a7772070226a2a14c799a6835bf21e", + "allocation/vendor/TEMPLATE.json.gz": "21297b20f1f2dc76eb9dd8124416068c3cb096bab9df17fa4da19bc68dfe082e", + "allocation/vendor/independent_owners.py": "77a848729159e271ba64f403dfd59dddb13044b17b2950fa56700f442e2fe461" +} diff --git a/research/rank7-coupled-586-588-carrier-fold/CLAIM.json b/research/rank7-coupled-586-588-carrier-fold/CLAIM.json new file mode 100644 index 0000000000..493d11346d --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/CLAIM.json @@ -0,0 +1,242 @@ +{ + "admitted_package_manifest_sha256": "15a6773d8bc13aa55e7a3b4efb21963fbdd6e23262b3b6376072de8fa3279b50", + "baseline_head": "e2ca469b08385d3d5e29a918d66dbefaf889e9f3", + "baseline_kappa": "17240352247481048785499999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "baseline_pr": 2969, + "baseline_status": "FINITE_NATIVE_OWNER_AND_MOMENT_CANDIDATE_OUTER_PENDING", + "calls": 666, + "complex_lower": "864888044702560167119/500000000000000000000000", + "declared_edits": { + "count": 4, + "edits_sha256": "47831d52490e3a3b8ed0569ff644582ea23f60e2ef900c2301d04c60bd73f5d4", + "lowered_helpers": [ + 586, + 588 + ], + "previous_kappa": "0.0017290339826465135177169999999999999999999998999999999999999999999999", + "previous_pr": 2979 + }, + "fill_sha256": "68b8bae90144248774b1920cd27f9519caa3dc427704d8a9da6d4c491d912fc4", + "fixed_inventory_cap": { + "cap_lower": "17297774946785970118869/10000000000000000000000000", + "cap_lower_decimal": "0.0017297774946785970118869", + "cap_upper": "1729777494678597011887/1000000000000000000000000", + "cap_upper_decimal": "0.0017297774946785970118870", + "realized": "below the fractional optimum by the recorded gap (check_cap.py); the cap basis is fractional at T74" + }, + "gain": "717608082126931961/125000000000000000000000", + "helpers": 408, + "independent_inputs": 632, + "kappa": "17297760894051203342379999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017297760894051203342379999999999999999999998999999999999999999999999", + "kappa_interval": [ + "0.0017297760894051203342384", + "0.0017297760894051203342385" + ], + "kappa_lower": "0.0017297760894051203342384", + "kappa_upper": "0.0017297760894051203342385", + "live_families": 66304, + "local_profile": { + "1": 2433, + "2": 724, + "3": 228, + "4": 102, + "5": 20, + "8": 8 + }, + "native_receipt_sha256": "165999eb606809540d37a9c30d569e778ee1818d04c10a4b5e5f7e548cc3624a", + "physical_families": 66813, + "previous_claims": { + "pr2942": { + "claim_file": "comparators/PR2942-CLAIM.json", + "gain": "3479884770953003121/500000000000000000000000", + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "kappa": "17228163198632143279959999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "pr": 2942 + }, + "pr2957": { + "claim_file": "comparators/PR2957-CLAIM.json", + "gain": "6058674334382163267/1000000000000000000000000", + "head": "b74b25f3ccc84c16e1a801d73b2f47e5ea764c78", + "kappa": "17237174150707381709709999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "pr": 2957 + }, + "pr2966": { + "claim_file": "comparators/PR2966-CLAIM.json", + "gain": "2870908440834078413/500000000000000000000000", + "head": "e62d3eb9005117d82a9babcfa937ecc53237c490", + "kappa": "17240342725234521774119999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "pr": 2966 + }, + "pr2969": { + "claim_file": "allocation/baseline/CLAIM.json", + "gain": "717608082126931961/125000000000000000000000", + "head": "e2ca469b08385d3d5e29a918d66dbefaf889e9f3", + "kappa": "17240352247481048785499999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "pr": 2969 + }, + "pr2979": { + "claim_file": "comparators/PR2979-CLAIM.json", + "gain": "742106758606816521/1000000000000000000000000", + "head": "be191346391661f4d35fc0d1508d0a6029572576", + "kappa": "17290339826465135177169999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "pr": 2979 + } + }, + "profile": { + "1": 1637692, + "2": 482184, + "3": 156741, + "39": 1, + "4": 67932, + "48": 28256, + "5": 14710, + "8": 5328 + }, + "release_receipt_sha256": "80b89fbbe1c77154940b81f9202bedccca43a9dda7606c4bfd09cb7e62e63856", + "replicas": 74, + "scope": "Conditional finite supplier/outer certificate for PR2979s words (mdumitrean: joint rank-7 end frames, five further paired extractions, fourteen PR2957 rewrites) with two declared restore edit blocks (R1_E42, R2_E7) and two coupled B+restore carrier-fold rewrites (B_586_438, B_588_440) lowering entering helpers 586 and 588 from width 7 to width 6, paired with the literal T74 allocation FILL.json.gz (T74_optimal_idle39). Inherited all-size/compiler/theorem hypotheses remain. No selected-frontier change or independent-human-review claim.", + "source_manifest_sha256": "fa3e2d855ac5298ecc849e596d79dcef7a72668a276b6524585bc0cd616ce474", + "stages": { + "stage1": { + "frame_edits": 139, + "groups": { + "A": { + "W": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ], + "helpers": [ + 331, + 450, + 451, + 508, + 509 + ] + }, + "B": { + "W": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ], + "helpers": [ + 299, + 448, + 449, + 484, + 485 + ] + }, + "C": { + "W": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ], + "helpers": [ + 452, + 453, + 532, + 533 + ] + }, + "D": { + "W": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ], + "helpers": [ + 454, + 455, + 556, + 557 + ] + }, + "V45": { + "W": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ], + "helpers": [ + 249, + 251, + 265, + 267 + ] + } + }, + "kind": "joint codimension-2 end-frame lowering (frame-only)", + "record_sha256": "5fbfce004330ebc1fbac8de264614fe295f1a074811b478db4892c3bc3852cd3" + }, + "stage2": { + "extractions": [ + { + "helper": 226, + "normal": 42, + "step": 1 + }, + { + "helper": 228, + "normal": 42, + "step": 2 + }, + { + "helper": 230, + "normal": 42, + "step": 3 + }, + { + "helper": 363, + "normal": 7, + "step": 4 + }, + { + "helper": 395, + "normal": 7, + "step": 5 + } + ], + "kind": "rank-8 paired input/output extractions" + }, + "stage3": { + "applier_sha256": "2509f1335e47543f8814b42d6bf83032b30c5899b4f7cc62a6adc03f5138ae13", + "count": 14, + "kind": "declared exactness-preserving gate rewrites (Jeremy Kothe, PR2957), re-addressed", + "rewrites_sha256": "a37ade675876e4f5b00b33066c84f495fccd264863b7eb5d813837b1d01c3e7d" + } + }, + "status": "CONDITIONAL_CANDIDATE_COMPLETE_FINITE_RELEASE", + "width_inventory": { + "4": 26, + "5": 2, + "6": 18, + "7": 50, + "8": 99, + "9": 213 + }, + "zero_buffers": 91 +} diff --git a/research/rank7-coupled-586-588-carrier-fold/CREDITS.md b/research/rank7-coupled-586-588-carrier-fold/CREDITS.md new file mode 100644 index 0000000000..24f00912d4 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/CREDITS.md @@ -0,0 +1,19 @@ +# Credits + +- **PR #2908, Jeremy Diviney**: the paired input/output extraction, its compensation rule `C*S`, the exact two-sided certificate (`structure.py`, vendored unchanged) and the closed-adapter admission chain. +- **PR #2917, Mason Hale**: the nine paired extractions and 82-endpoint words under PR2942, the refit/compose producer model that stage 2 follows, the T74 chronology (ORDER/DISPATCH), the allocation checker, moment auditor, extension stage and adapter derivation reused here. +- **PR #2957 / #2948 / #2966, Jeremy Kothe (jeremykothe2)**: the fourteen declared exactness-preserving gate rewrites in five classes (R-retime, A3779-cut-start-read, PM-carrier-lender-entry, B-carrier-retime, A-commuting-swap) and their pure applier (`vendor/declared_rewrites.py`, vendored unchanged); stage 3 composes exactly these rewrites onto this package's stage-2 word (`data/REWRITES-2957.json`, re-addressed with exact preimages). PR2966 composed the same rewrites onto our PR2942 words. +- **PR #2969, Dugongue**: the PR2942 + PR2957 composition at T370 and its cap-level headline nomination, this package's comparator and moment baseline (`allocation/baseline/`). Our stage 3 composes the same fourteen rewrites, here onto the stage-2 word. +- **PR #2918 (research/helper408-rank7-pairing), RossRichardson**: the fixed-cut rank-seven obstruction for helper408; this package's census of fresh rank-7 extractions reproduces it exactly and is consistent with it. +- **PR #2894 / #2833, Jeremy Kothe**: the preload re-synthesis supplier, the frame accounting and inverse-reverse cleanup (`vendor/preload_move.py`), the source materializer and the inherited supplier lineage. +- **PR #2857 / #2848, Yiyang Lu (Lyy-iiis)**: the shared-kernel words, the staged native/overlay tooling and the chronological flow model and realization (edge colouring) used to construct the allocation; PR2843 (Marius-Paul Dumitrean) is that flow model's starting point. +- **PR #2863 / #2839, Dugongue**: the packing lineage and the PR2839 owner engine. +- **Tekalign**: the independent owner/chronology checker (`allocation/vendor/independent_owners.py`) and admission tooling. +- **icekylinx**: the exact free-operator auditor retained as `vendor/audit_local.py` (PR2833). +- **themilkman216**: the observation that a cap-level allocation of these inventories needs a T whose basic counts are integral, which the allocation's degenerate-face step builds on. +- **Gareth Davidson (bitplane), PR #1995 / #2013**: the fixed-word terminal-subspace bounds that frame stage 1's scope; earlier rank-seven helper ends on other words are in `research/complex-rank7-end-pair`, `research/k8-rank7-composition` and the PR1090/PR1104 lineage (credited there). +- **PR #2930 / #2942, Marius-Paul Dumitrean**: the cap allocation of PR2917's words, the four normal-45 extractions under these words, the relaxation tools and the overlay/producer conventions reused here. +- **PR #2979, Marius-Paul Dumitrean (with substantial AI assistance from Anthropic Claude via Claude Code)**: the codimension-2 census on paired-extraction words, the joint end-frame lowering of 22 restored helpers in five groups (stage 1), the five further extractions it makes profitable (stage 2), the exact composition with PR2957's rewrites (stage 3), the producer and local verification for all three stages, the overlay stage `rank7-joint-endframes` with its rebuild guards, the adapter generalization to six width classes, the literal T74 allocation of the changed inventory, its relaxation certificates and recorded gap, and the complete fresh replay. +- **PR #3015, Jeremy Kothe (jeremykothe2)**: the declared literal edit stage (`edits/`, `tools/build_edits.py`) with its independent review (`edits/edits_review.py`), and edit R1 on PR #2979's restore section (carrier 61 for register 63). +- **PR #3042, dcharb78 (with AI assistance)**: the six restore carrier/pivot skips (`R1_E42` at `restore[162:188]`, `26 -> 33` gates skipping `{22, 40, 54, 63}`, and `R2_E7` at `restore[190:203]`, `13 -> 15` gates skipping `{5, 73}`) on PR #2979's words that serve as the direct starting words for `B_586_438` and `B_588_440`. +- **New here (dcharb78, with AI assistance)**: the two coupled `B` + `restore` dying-helper carrier folds (`B_586_438` and `B_588_440`, `6` hunks / `6 -> 5` gates each) and `helper_final` lowerings on entering helpers `586` ($E_{30} \to V_{30,76,82}$) and `588` ($E_{30} \to V_{30,97,127}$) shifting the helper width inventory from `{4:26, 5:2, 6:16, 7:52, 8:99, 9:213}` to `{4:26, 5:2, 6:18, 7:50, 8:99, 9:213}` (`+665` net profit per helper, `+1,330` joint), the literal `T74_optimal_idle39` allocation (`allocation/FILL.json.gz`), the 21-control per-word edit review (`edits/edits_review.py`) and 100-control four-stage replay (`verify.py`), and the re-derived paid profile, cap certificate (`certificates/RELAX-CAP.json`), and complete fresh-native admission and release receipts. PR #2979 (mdumitrean), PR #3015 (jeremykothe2), and PR #3042 (dcharb78) are credited first. diff --git a/research/rank7-coupled-586-588-carrier-fold/EDIT-PINS.json b/research/rank7-coupled-586-588-carrier-fold/EDIT-PINS.json new file mode 100644 index 0000000000..ee03103d2d --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/EDIT-PINS.json @@ -0,0 +1,7 @@ +{ + "edits/EDITS.json": "47831d52490e3a3b8ed0569ff644582ea23f60e2ef900c2301d04c60bd73f5d4", + "edits/FINAL-WORD-base.json.gz": "300a9b8ad1d554f0e6f84f43f3f5fd870a5b4e5f81ad856900b6e8999684892e", + "edits/FINAL-WORD-extra.json.gz": "495d030f1e03b90e954dad3043994f03293d41b9ed220a3beaef849df435d3f0", + "edits/declared_edits.py": "4871287e859c6451b53adbd602eb209ad62acc7f3c6eb88106be3010044ef82b", + "edits/edits_review.py": "2fca291cc254f61ed3528de2b95e59e54c578d7fbdec0e5c0c330350d4fbda32" +} diff --git a/research/rank7-coupled-586-588-carrier-fold/MANIFEST.json b/research/rank7-coupled-586-588-carrier-fold/MANIFEST.json new file mode 100644 index 0000000000..e0900bd015 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/MANIFEST.json @@ -0,0 +1,157 @@ +{ + ".gitattributes": "056f4f66161e333f3a8d4c20de323ca05599a7deac1aa02d47ba6f6b96335573", + "ALLOCATION-PINS.json": "1e299a2ab3c4f8635d863ea24643b943ea5c4df9d29a2ba2be75496e394e5eea", + "CLAIM.json": "f3435eda62a95bb02fd4870ac97b108b3a6862cbf84a7d22863889fc1d73ec01", + "CREDITS.md": "1d9d8f56d8899f55878e4cb2c4e052b22506444016a51c2e678773505f5189e6", + "EDIT-PINS.json": "3bf48b55d2add31cd1955d267e3b43d7189d2047efa4a4237796407c560e895f", + "NOTICE": "c9731c9cca25ede32c2a1b3aef6d5b249973cb2ed5fb2494407bdca598763661", + "PINS.json": "ac84931c019a4ea7902337841fb11b33d4fb018eb3b69f34c39c8a0c614173c8", + "README.md": "7cbc11533925ba93f87d6f9e8a3059df328b0dc50c35a9d09b382782beb40810", + "RELEASE.json": "71e1b2caac994314355ad21ae82aa92692a0ed4435a54abd708d8c8a597447b5", + "SOURCES.json": "5490ae2147d633f350234c6b6785025b08b755e5af60d24c70a37fbbbf2b2ced", + "TASK.json": "a9506cb4879ed871a598edbfbd2b827330ffd356546a08b749dad8b317dc257c", + "VERIFY.json": "bd0484ea2f6af979157b527f60582536d15d1f9e8cd69d44c68f944aeb627421", + "allocation/DISPATCH.json": "65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c", + "allocation/FILL.json.gz": "68b8bae90144248774b1920cd27f9519caa3dc427704d8a9da6d4c491d912fc4", + "allocation/ORDER.json": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1", + "allocation/PROFILE.json": "a815694364065a6d1275c59c17235f4cf400d28d8f7fe3bb3314c57c35dee44c", + "allocation/PROVIDERS.json": "52eb0d85caa7b2d4a93acdf5011f52b793f61ddca86235fb03cd9a09397ad4cd", + "allocation/SEARCH.json": "aff630fad679c7c5773f16f92dce6234e5b5519626861e9bd83b9884f002066f", + "allocation/baseline/CLAIM.json": "656a4c93411b078753783513e2e71b1722a56e7b70120264a38118811982fa77", + "allocation/baseline/ORDER.json": "d559a1dcb83707724afc0310f6ef8e3a36ad6cda0a895ca6abae9d6f39a0fc76", + "allocation/baseline/PROFILE.json": "6de8ac1fd628cdd2afa5a43872da69c7dab9d7219bdc318f9db55fd8ccdb5eb2", + "allocation/vendor/PLAN.json.gz": "d566cfb87b71639d4138e1f89b543e2dd6a7772070226a2a14c799a6835bf21e", + "allocation/vendor/TEMPLATE.json.gz": "21297b20f1f2dc76eb9dd8124416068c3cb096bab9df17fa4da19bc68dfe082e", + "allocation/vendor/independent_owners.py": "77a848729159e271ba64f403dfd59dddb13044b17b2950fa56700f442e2fe461", + "certificates/RELAX-CAP.json": "e32f3ecd5e6594935583f80f643cf1930e8bc017e3c541025c335395a15cf19c", + "certificates/RELAX-STAGES.json": "0e5ec700a191b668ba3d4b6d675f5c047d264b9a5109fc55fa92961b3fcb7d68", + "check_allocation.py": "7a4c85c190d85d4a8ed3ad8ebdfd9b90976473fad22488441b1113e056a3c98a", + "check_cap.py": "6399f0bfab129934999cb1a9046d6509b139e7f7eb52a007d9601aafb5332b80", + "comparators/PR2942-CLAIM.json": "011aaac80ad79f7f29dc429a672441bb6b3c21a68bbcb34c7a0d5f943c3c3c2e", + "comparators/PR2957-CLAIM.json": "a93e6c9e94bc9bf5664b5e23506dda9647fad1930e1eede66d5ba9f3718b598a", + "comparators/PR2966-CLAIM.json": "4d4c4800bf3bcb36d09021313b2712aebd4aa0830c74dda30991daf6851c220a", + "comparators/PR2979-CLAIM.json": "436e0d297cbdf195445d3697d496ac675e95210b79e70ce602a6a6667a4c6ce9", + "construction/STAGE-PRICES.json": "dfb7d06724bf95367f3fdb398f4828fc70f803d23030bc0eee0b00541457f546", + "construction/allocation/T37-FACE-MIX.json": "4cb7c5e3ca63968a02bbdb6cec9621a2d2b990535fed386e9e098744406e4b7d", + "construction/allocation/T37-FLOW.json.gz": "765c6b774ca207f715dd5f579995700f4787c1f4eb92a7855bfc1424f683eca4", + "construction/allocation/T37-MODEL.json": "74849384ad2160f0402f6577e9d3ea849c21704abcf839af50f3353e141a4355", + "construction/allocation/T37-PATTERNS.json": "c2484c55bc48ec865b53827d4aa7e2b3704ebf23ab84e45aec79d2c7faeff6fb", + "construction/allocation/T37-SOLVER.json": "f56caa18e9638c568c57e699a8576fa6dcbdfe6ba54ae2da3fc8bc626168d863", + "construction/allocation/T74-CONTROLS.json": "57b2018702e65bb129c0bbf21a720345099a812d88da0abedca6a48d5fb7c1f3", + "construction/allocation/T74-OWNER-CHECK.json": "045d1321f9ac46a755590dc309580f5784fcecd2a82704392045c67f5ff0933e", + "construction/allocation/assemble.py": "57fcc8dd6f08b5557add7f34c0deb993574f71b3e565d6668085f1f65df5eccd", + "construction/allocation/controls.py": "9e10e5c21fab8ea2fdaf07ce92a141c4e6d63a7ef02d9de25bc9022ad1ae7998", + "construction/allocation/diag_lp.py": "59bfeb9586820f7b653370e20619760e23a4b170e4b7e14dc4e2abad9f5d9c61", + "construction/allocation/double.py": "8a89fafcd69cacb0a5a8d19a90d76f8740cf8f12585dc83796fcd8bc428dd94f", + "construction/allocation/fill17.py": "933be460381d65ea04a6e7f288f977ba22a7e4068b69494d65c38ccd7e5f4dbf", + "construction/allocation/providers_from_words.py": "8cf55c2859a626d86f21b447460321c19db92fec8e1f893b3cd37267f3b145fd", + "construction/allocation/round_mix.py": "0d0a423817b30fda9cceaa61b9bcc90e07710f9829e65098c9a31ed1734341bd", + "construction/records/derive_stage2.py": "f2518333cea351376ee094e8212b71ad753710d4038c55937a9e3bb212249f9e", + "construction/records/make_data.py": "b9528bcb26bc3c1a8e582032fa3899c79dc4cb463814dc6fea617fd83a5b4858", + "construction/records/make_prices.py": "5fcf593b5672b4f66cabd9d2bd5b4e843453248186d95794386331d801280b78", + "construction/search/codim2.py": "1dd77f4ceb0c4cf82ee5f3f4c04123724db09ebb0e7b9f856c4bd000d4e57531", + "construction/search/combine.py": "d06e041082f120b903937a8c7fdf2189eb42411330af625492ff5a24109b49d0", + "construction/search/deliver_l22.py": "b5f0a6ee2eaf1cbef95f0447efb08b75937e7e03c6d27d0b73d5c884c24a91b5", + "construction/search/final_l27.py": "e964d48e7b7705cc64a57bd42d81eb990d69606689349240e5a18155d08f7350", + "construction/search/lowerA.py": "1aba1edb5397701151b2c95afaf23cd8e675ddc48b5ccca1738bc0c5370e9a6c", + "construction/search/lowerA_joint.py": "eb0efbe0c40d063a606dc370362a8d3fe3f4f57877e2e79f63be940fe06ce41b", + "construction/search/realize.py": "6d524f4a1ce0a4bf77f8e5a859e46922334956688c9268dbea3004e3aea6898e", + "construction/search/vlower.py": "3052c96b4f00239fe679f460bbbad2b7271089b5aa73665cb92c052755143ec4", + "data/PARENT-base.json.gz": "54ca34c749e3228d7e2df3d8dbf7aa1568c2872490166997c5962f12fd03da35", + "data/PARENT-extra.json.gz": "eded756dfe8f411c3d1f80a3ac16516f0ea5dd6f9866728b2179b157630fa7b6", + "data/REWRITES-2957.json": "a37ade675876e4f5b00b33066c84f495fccd264863b7eb5d813837b1d01c3e7d", + "data/STAGE1-FRAME-EDITS.json": "5fbfce004330ebc1fbac8de264614fe295f1a074811b478db4892c3bc3852cd3", + "data/TRANSFORM-226.json": "1732a39728c068f9d663111c7876b4e0b96088f3dd3b8e6ff824551b5a711338", + "data/TRANSFORM-228.json": "82346e6a5173c4822e16b2dad06ca232111b6795a340079f9aceabe0098797c0", + "data/TRANSFORM-230.json": "8ad70d545695b5d2246fb9e09d46abcc1e42926c1161884f69b77f978a28f46d", + "data/TRANSFORM-363.json": "84d2a609739eb30d4d9356fb6f04b2ff32c8823a978d7a51db1ace1d6d2352cc", + "data/TRANSFORM-395.json": "065aa5d7713683942bc2156b543681857e33c6e2f30f32cba47e2cbb9d1bef69", + "data/WORD-base.json.gz": "abaf67bfcb257528658c906b612f57025617592bd7889828f92b97a5f4f4300d", + "data/WORD-extra.json.gz": "e0eaf64c4d5d324693d43889bce1b9e53e8da00402105c8c978fd102f208bed7", + "edits/EDITS.json": "47831d52490e3a3b8ed0569ff644582ea23f60e2ef900c2301d04c60bd73f5d4", + "edits/FINAL-WORD-base.json.gz": "300a9b8ad1d554f0e6f84f43f3f5fd870a5b4e5f81ad856900b6e8999684892e", + "edits/FINAL-WORD-extra.json.gz": "495d030f1e03b90e954dad3043994f03293d41b9ed220a3beaef849df435d3f0", + "edits/declared_edits.py": "4871287e859c6451b53adbd602eb209ad62acc7f3c6eb88106be3010044ef82b", + "edits/edits_review.py": "2fca291cc254f61ed3528de2b95e59e54c578d7fbdec0e5c0c330350d4fbda32", + "evidence/ADAPTER-DERIVATION.json": "b7881e080795bd9aa0272f7225ba5c32e54b834f05b985141684d6a788db0ce1", + "evidence/ADMISSION-RESULT.json": "f18889ddcfff678708225665408c78a3c1ca38aa3925bd654535c6a3b2cec931", + "evidence/ADMISSION-STAGES.json": "25175b034b966d7565056cfb40fecf3b8bee53b47d7a9a1ec45d008ea77c98e2", + "evidence/EDITS-DERIVATION.json": "58c4d8606f5c6efb52162052d4d466244290775a140fd60b765fc6bea38c58b4", + "evidence/EDITS-REVIEW.json": "95c45ed372e55a288816bfa5a55b862026d77ddf9ff4bb071baed225a17d60c8", + "evidence/ENVIRONMENT.json": "4293f6131ee918e9316d0b8730cf15784d1327b73fac740549eef22bc2d52e08", + "evidence/FULL-NATIVE-RECEIPT.json": "165999eb606809540d37a9c30d569e778ee1818d04c10a4b5e5f7e548cc3624a", + "evidence/FULL-NATIVE-RESULT.json": "56cdfb3eddb22c49f768a0f9b1a4c351da1aca949f18bc8264010551658d12b6", + "evidence/FULL-REPLAY-RESULT.json": "4e6dd539b81273229afbf628d3db4542cef26645e6956591b145a5ca2345d2b8", + "evidence/FULL-REPLAY-STAGES.json": "a1197999e68b5c29275b46f8190d3e691d0a1c8a7228234f94bcd8d8bd522211", + "evidence/OVERLAY-DERIVATION.json": "145a9491cca7b22f0d04cccb66795a7b6914a1ee415ecfc65e1db7b586573826", + "evidence/README.md": "0a4a24800625cd3858b76eb33716afce229ff72037ce9afef795dfa946c8bb6d", + "evidence/RELEASE-RECEIPT.json": "80b89fbbe1c77154940b81f9202bedccca43a9dda7606c4bfd09cb7e62e63856", + "evidence/RUNTIME-PATCHES.json": "25a75bcbc9535bce28c14fbe2fdff6ab42ed7a8193da6d473258ebd53901315c", + "evidence/logs/admission-discovery.log.txt": "3126dee201cf01551913125fab7c5f82d7b7d2456b05bdef2aa915ceca2d6923", + "evidence/logs/admission-outer-check_ledger.py.log.txt": "1da27daaa445aa44ae9c822c5a05490051b9d5f78e33bca47fff0f89cbf3eb82", + "evidence/logs/admission-outer-independent_check.py.log.txt": "42129a1785bcf7156771aa3c6a82a5419ba9dd225721431c895dacfd31dd2571", + "evidence/logs/admission-owners.log.txt": "08dac59e8dca99e1a9412ccc75bab45054187d2536866559dc13c67e55b58659", + "evidence/logs/admission-parent-lift.log.txt": "7b6249a123ca39fae7b7a6339dd9e8ae8777b081f4336418f2cc101704b70644", + "evidence/logs/admission-rebind.log.txt": "f09998f9e710f22ce3094ab39e4758458cf9f8a8845fa7abe9dcd6a187289ad8", + "evidence/logs/admission-release.log.txt": "e3ccd73cc864840da6732578154b1813e5f230b823b44fb94f06e30a92cb98ed", + "evidence/logs/complete-admission.log.txt": "9112381e99925f8f3eeedf395af3029b66c16ffe7b1fb9b9abbd4db6d07a49f8", + "evidence/logs/declared-edit-review.log.txt": "9812aa8d08d4251d390eb0cea1e5731dc59d22e09e0c914823c77d3e2e233e13", + "evidence/logs/declared-edit-stage.log.txt": "0c33d4323f555c64c0c9cc6cd4d821ed70c7163434a5b265cad51ad68d751b03", + "evidence/logs/derive-closed-adapters.log.txt": "18b249b7715b86c6985cc9a04ccc6f3eded3b0709ae64e9fa359b17130429a82", + "evidence/logs/export-pr2833.log.txt": "6bb498de90ae1ee821914e82c225c235cac98ff8bbb151acf2c0e1ab53c9129b", + "evidence/logs/export-pr2894.log.txt": "6bd8df30779863897e48441608240db6a7e3fcbd0754511e44f854f3a5c462a6", + "evidence/logs/four-kernel-stage.log.txt": "f2bbb6462b3f5bb8a6415bb33c0c35355353b13343ddb90961660f7473caa5a2", + "evidence/logs/fresh-current-native.log.txt": "57a95a5df95aa0574b48d59d71a6e5e84d017172e51b8627d8713c52a7134206", + "evidence/logs/paired-extension-stage.log.txt": "61cc77beeae833d7473b5c5338b176b150f95f6652a888c0307f080674cfde35", + "evidence/logs/parent-paired-stage.log.txt": "d80d8494c48816e3acf662db00cc0077a888b82392d736826f73beb1c4248299", + "evidence/logs/preload-stage.log.txt": "2eb7601c48840a39c58eb838886aed00a531349b259f0bbc3ea6421376b8ea3c", + "evidence/logs/rank7-overlay-stage.log.txt": "06150c3f42489b14e981b90ac0e594e7e32bfc6ec4a98f3551cf53b6d18acd36", + "evidence/pr2979/ADAPTER-DERIVATION.json": "abfe60c965953c567392b587cbcc4703f2f80fc60e267539251a1eac0f9db2f3", + "evidence/pr2979/ADMISSION-RESULT.json": "be9652312a88fd670eb09a4303679b4e875516d02a008ce90ccbca8a92e6b2ac", + "evidence/pr2979/ADMISSION-STAGES.json": "bf2fcb3012c65d861ccc4ba5950e5b97cbff31f603268afdb7e9ae2a0ac9696f", + "evidence/pr2979/ENVIRONMENT.json": "c6faaaa9b538ddbf0ea3c624bbe2f1c7e4074f8cb504d4bee0f3353f1e7f32a1", + "evidence/pr2979/FULL-NATIVE-RECEIPT.json": "6d27c89d5e3a2c7f28387e4b20c462b0dff6c9fa92aacdde715d4b29cc286d41", + "evidence/pr2979/FULL-NATIVE-RESULT.json": "ee10e7b8f2196b3bd28f5389b9be3372c216f3cfe67e00c7a2bcd130746ac364", + "evidence/pr2979/FULL-REPLAY-RESULT.json": "0293261edd3696408e1067df358644a7f43fd05f6c7b78e255aeac3f4a2530a2", + "evidence/pr2979/FULL-REPLAY-STAGES.json": "d8764bbbc029b13e20dc881783c44b74c689064d9ddf8286fc18371f2ec0d503", + "evidence/pr2979/OVERLAY-DERIVATION.json": "145a9491cca7b22f0d04cccb66795a7b6914a1ee415ecfc65e1db7b586573826", + "evidence/pr2979/RELEASE-RECEIPT.json": "473a5f8e048e45d7e83747077a18985ef87d58da370ca3f2fe5748a057ffdb2d", + "evidence/pr2979/RETAINED-BOOTSTRAP-RECEIPT.json": "ba9ef5709319ceb54928aed10cb250f3d018b3f654a2902c53df27d9e2e1157f", + "evidence/pr2979/RUNTIME-PATCHES.json": "6e4fe608caae2cdc28abc0ab772514d03ede2a4a50b06e9ede2853ab6889f218", + "evidence/pr2979/logs/admission-discovery.log.txt": "68845b7e19574ee2040677640848f0f7aaf71854250dfe0470dfae3ff09210b3", + "evidence/pr2979/logs/admission-outer-check_ledger.py.log.txt": "c56f8e0232d749e0ff33b76a8f9de18d28a7bb3abcd736ba69a4b167f2b5a824", + "evidence/pr2979/logs/admission-outer-independent_check.py.log.txt": "7eab2e50c0b03f058ae320c4791a0ea5a0ae3eae3393d29971663428ca79547a", + "evidence/pr2979/logs/admission-owners.log.txt": "dc4840d279e447e42af2ece9437cb92ab13c7f631440911ca5e8a676e3fa418c", + "evidence/pr2979/logs/admission-parent-lift.log.txt": "7b6249a123ca39fae7b7a6339dd9e8ae8777b081f4336418f2cc101704b70644", + "evidence/pr2979/logs/admission-rebind.log.txt": "6126af0a7935a1605ddad6074978494d462ed67cbd54be809ce13fcb32469d67", + "evidence/pr2979/logs/admission-release.log.txt": "d1e575ccd284596605baf38e5ed5b751cd5f506572ef9cfc578bd88d917b46a0", + "evidence/pr2979/logs/complete-admission.log.txt": "37584a0aed98b08f491b676ba0e4914518027f556495b1ae4e8a9a123d360b4f", + "evidence/pr2979/logs/derive-closed-adapters.log.txt": "d11d75855720cfa75a26f667a61467b5122a7b7ae5521030509bf1cbdd00a496", + "evidence/pr2979/logs/export-pr2833.log.txt": "0fa7e0c6a0f0e31c60aadd0fe2afa6841d046d3272a02d3dc873f999b8508654", + "evidence/pr2979/logs/export-pr2894.log.txt": "6bd8df30779863897e48441608240db6a7e3fcbd0754511e44f854f3a5c462a6", + "evidence/pr2979/logs/four-kernel-stage.log.txt": "f2bbb6462b3f5bb8a6415bb33c0c35355353b13343ddb90961660f7473caa5a2", + "evidence/pr2979/logs/fresh-current-native.log.txt": "d7581123b0f3330f2598e7758ccbca466018d2599124fc6ceb1b678a9ee27dec", + "evidence/pr2979/logs/fresh-retained-bootstrap.log.txt": "4a1625fdd9a947187583e67492c492f309e28669082f2e6f2aa97b5da345ea29", + "evidence/pr2979/logs/paired-extension-stage.log.txt": "61cc77beeae833d7473b5c5338b176b150f95f6652a888c0307f080674cfde35", + "evidence/pr2979/logs/parent-paired-stage.log.txt": "d80d8494c48816e3acf662db00cc0077a888b82392d736826f73beb1c4248299", + "evidence/pr2979/logs/preload-stage.log.txt": "2eb7601c48840a39c58eb838886aed00a531349b259f0bbc3ea6421376b8ea3c", + "evidence/pr2979/logs/rank7-overlay-stage.log.txt": "06150c3f42489b14e981b90ac0e594e7e32bfc6ec4a98f3551cf53b6d18acd36", + "producer.py": "fa2949c5ad093af08d08c97c8de9c2f565e7f89d0d42ac3fc5af701ab6b1ba25", + "reproduce.py": "817c51eab06e042260aca7534c5f614adc6af276fa631e3c708722e4a9ecac1d", + "run_registered.py": "4b43b2a5fd2eff80c5b3e9adbf5587a252978e6fec75b34d67f14a7c9564221f", + "structure.py": "83f63b6d9a1a543ecfa2c98d479dbe4e7a1c3caf6fd1c3566123308efbc32e96", + "tools/audit_allocation_moment.py": "c632527ecf092f013862660dbd7f52b599a50b321a8aa88ddc45af0547e79cb5", + "tools/build_edits.py": "44d0f4ce99d1c232aba4d3a09e3d65ba6781aecd298c48c000199c08ddfcd22c", + "tools/build_overlay.py": "9d98ace9bffb37aeebd05b93ed386f73e6eee169d960e4956cf14a66e6852140", + "tools/derive_adapters.py": "5c06828151cd230add3e328b42dda72c4a2ed1075bd2902f38ee28727870bc84", + "tools/relax.py": "0fed1c56b50a2e6d44deeeb6db0f1c7e1f71b86d1747130e1a9202216249a728", + "tools/relax_exact.py": "baf1855d6095c951a90d19a0d8094bd33290519940b732e2b758c5647830f044", + "tools/root.py": "55f5aca39b5ee2fe4687ac8863e6c24569010f27a332883c069b8e14b8fe09e3", + "tools/wordedit.py": "cae8ae0f5d7fb3387ec6922fe966068aae05e3a6d3586830d4361b650cfb3617", + "vendor/audit_local.py": "a38940094f7d19cd6376aafdd4734fa68eabc9aff4c98c3c4a3e9540328b1c90", + "vendor/declared_rewrites.py": "2509f1335e47543f8814b42d6bf83032b30c5899b4f7cc62a6adc03f5138ae13", + "vendor/preload_move.py": "c8fda4674644fcd5cbf39b6645ce148a21daa90a998b678cbe51f970b78b0044", + "verify.py": "40f2bda5e5ccb6a97ae9e416fc9431507b3d90c055a05d165dd0184ba6bbb002", + "verify_manifest.py": "723d726dbbe5b65a49caecae0f1aab664a1413fb639abfd3e826a5a538e14e5b", + "verify_release.py": "acf5c76001ecfd35da3a882206e16f816e6dd98628a010957bf1860445ef5af5" +} diff --git a/research/rank7-coupled-586-588-carrier-fold/NOTICE b/research/rank7-coupled-586-588-carrier-fold/NOTICE new file mode 100644 index 0000000000..89c20926ea --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/NOTICE @@ -0,0 +1,28 @@ +research/rank7-joint-endframes +Copyright 2026 Marius-Paul Dumitrean. Licensed under the Apache License, Version 2.0. +Prepared with substantial AI assistance (Anthropic Claude, via Claude Code). + +This package retains, byte-identical, Apache-2.0 files from: PR #2942 (Marius-Paul Dumitrean, head +a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf, research/paired-extension-normal45): data/PARENT-base.json.gz and +data/PARENT-extra.json.gz (its data/WORD-*.json.gz), comparators/PR2942-CLAIM.json and tools/wordedit.py; PR #2917 +(Mason Hale, head 224bd5e56041c40078ff6b5fa7393733a215de5c, research/paired-helper-extension): structure.py (Jeremy +Diviney's PR2908 two-sided certificate checker), vendor/audit_local.py (PR2833's independent exact auditor, icekylinx +attribution), vendor/preload_move.py (Jeremy Kothe's PR2894 frame accounting and cleanup), allocation/ORDER.json, +allocation/DISPATCH.json and allocation/vendor/ (independent_owners.py: Tekalign's independent owner checker as vendored +by PR2839/PR2917; PLAN.json.gz, TEMPLATE.json.gz); PR #2957 (Jeremy Kothe, head b74b25f3ccc84c16e1a801d73b2f47e5ea764c78, +research/paired-extension-cap-fill-swaps): vendor/declared_rewrites.py (the pure applier of the fourteen declared +rewrites) and comparators/PR2957-CLAIM.json; PR #2966 (Jeremy Kothe, head e62d3eb9005117d82a9babcfa937ecc53237c490, +research/paired-extension-normal45-rewrites): comparators/PR2966-CLAIM.json; PR #2969 (Dugongue, head +e2ca469b08385d3d5e29a918d66dbefaf889e9f3, research/paired-swap-normal45): allocation/baseline/ (its CLAIM.json and its +allocation ORDER.json and PROFILE.json); and PR #2930 (head 81f3b5d12977eba09e06fbff729167d59faabe90): tools/relax.py, +tools/root.py, tools/relax_exact.py. +data/REWRITES-2957.json is Jeremy Kothe's PR2957 rewrite list, re-addressed to this package's stage-2 word with exact +preimages (every entry keeps a credit field). producer.py follows PR2917's producer.py (Mason Hale) for its paired steps; +verify.py, check_allocation.py, check_cap.py, run_registered.py and reproduce.py adapt our PR2942 versions of PR2917's and +PR2930's; tools/audit_allocation_moment.py is PR2917's exact moment auditor with only its authenticated baseline changed (to +the PR2969 headline); tools/derive_adapters.py generalizes PR2917's adapter derivation (PR2908, Jeremy Diviney); +tools/build_overlay.py follows the overlay conventions of PR2908's and PR2917's builders. construction/allocation/ retains +the flow model of PR2857/PR2843 (Yiyang Lu, Marius-Paul Dumitrean) as adapted for this allocation. All original notices of +the exported predecessor packages remain in force. + +Derived work (Apache-2.0): this package (`research/rank7-restore-carrier-skips`) builds on PR #2979 (Marius-Paul Dumitrean, head be191346, research/rank7-joint-endframes) and PR #3015 (Jeremy Kothe, jeremykothe2, research/rank7-joint-endframes-restore-edit), retained byte-identical except for the files named in README.md, plus two declared restore edit blocks (`R1_E42` and `R2_E7` in `edits/EDITS.json` and `edits/FINAL-WORD-*.json.gz`) and their re-derived certificates and complete fresh-native admission and release receipts by dcharb78, with AI assistance. PR #2979's own evidence is kept under evidence/pr2979/. diff --git a/research/rank7-coupled-586-588-carrier-fold/PINS.json b/research/rank7-coupled-586-588-carrier-fold/PINS.json new file mode 100644 index 0000000000..5b7fd3fc1f --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/PINS.json @@ -0,0 +1,38 @@ +{ + "certificates/RELAX-CAP.json": "e32f3ecd5e6594935583f80f643cf1930e8bc017e3c541025c335395a15cf19c", + "certificates/RELAX-STAGES.json": "0e5ec700a191b668ba3d4b6d675f5c047d264b9a5109fc55fa92961b3fcb7d68", + "comparators/PR2942-CLAIM.json": "011aaac80ad79f7f29dc429a672441bb6b3c21a68bbcb34c7a0d5f943c3c3c2e", + "comparators/PR2957-CLAIM.json": "a93e6c9e94bc9bf5664b5e23506dda9647fad1930e1eede66d5ba9f3718b598a", + "comparators/PR2966-CLAIM.json": "4d4c4800bf3bcb36d09021313b2712aebd4aa0830c74dda30991daf6851c220a", + "comparators/PR2979-CLAIM.json": "436e0d297cbdf195445d3697d496ac675e95210b79e70ce602a6a6667a4c6ce9", + "construction/STAGE-PRICES.json": "dfb7d06724bf95367f3fdb398f4828fc70f803d23030bc0eee0b00541457f546", + "data/PARENT-base.json.gz": "54ca34c749e3228d7e2df3d8dbf7aa1568c2872490166997c5962f12fd03da35", + "data/PARENT-extra.json.gz": "eded756dfe8f411c3d1f80a3ac16516f0ea5dd6f9866728b2179b157630fa7b6", + "data/REWRITES-2957.json": "a37ade675876e4f5b00b33066c84f495fccd264863b7eb5d813837b1d01c3e7d", + "data/STAGE1-FRAME-EDITS.json": "5fbfce004330ebc1fbac8de264614fe295f1a074811b478db4892c3bc3852cd3", + "data/TRANSFORM-226.json": "1732a39728c068f9d663111c7876b4e0b96088f3dd3b8e6ff824551b5a711338", + "data/TRANSFORM-228.json": "82346e6a5173c4822e16b2dad06ca232111b6795a340079f9aceabe0098797c0", + "data/TRANSFORM-230.json": "8ad70d545695b5d2246fb9e09d46abcc1e42926c1161884f69b77f978a28f46d", + "data/TRANSFORM-363.json": "84d2a609739eb30d4d9356fb6f04b2ff32c8823a978d7a51db1ace1d6d2352cc", + "data/TRANSFORM-395.json": "065aa5d7713683942bc2156b543681857e33c6e2f30f32cba47e2cbb9d1bef69", + "data/WORD-base.json.gz": "abaf67bfcb257528658c906b612f57025617592bd7889828f92b97a5f4f4300d", + "data/WORD-extra.json.gz": "e0eaf64c4d5d324693d43889bce1b9e53e8da00402105c8c978fd102f208bed7", + "edits/EDITS.json": "47831d52490e3a3b8ed0569ff644582ea23f60e2ef900c2301d04c60bd73f5d4", + "edits/FINAL-WORD-base.json.gz": "300a9b8ad1d554f0e6f84f43f3f5fd870a5b4e5f81ad856900b6e8999684892e", + "edits/FINAL-WORD-extra.json.gz": "495d030f1e03b90e954dad3043994f03293d41b9ed220a3beaef849df435d3f0", + "edits/declared_edits.py": "4871287e859c6451b53adbd602eb209ad62acc7f3c6eb88106be3010044ef82b", + "edits/edits_review.py": "2fca291cc254f61ed3528de2b95e59e54c578d7fbdec0e5c0c330350d4fbda32", + "producer.py": "fa2949c5ad093af08d08c97c8de9c2f565e7f89d0d42ac3fc5af701ab6b1ba25", + "structure.py": "83f63b6d9a1a543ecfa2c98d479dbe4e7a1c3caf6fd1c3566123308efbc32e96", + "tools/audit_allocation_moment.py": "c632527ecf092f013862660dbd7f52b599a50b321a8aa88ddc45af0547e79cb5", + "tools/build_edits.py": "44d0f4ce99d1c232aba4d3a09e3d65ba6781aecd298c48c000199c08ddfcd22c", + "tools/build_overlay.py": "9d98ace9bffb37aeebd05b93ed386f73e6eee169d960e4956cf14a66e6852140", + "tools/derive_adapters.py": "5c06828151cd230add3e328b42dda72c4a2ed1075bd2902f38ee28727870bc84", + "tools/relax.py": "0fed1c56b50a2e6d44deeeb6db0f1c7e1f71b86d1747130e1a9202216249a728", + "tools/relax_exact.py": "baf1855d6095c951a90d19a0d8094bd33290519940b732e2b758c5647830f044", + "tools/root.py": "55f5aca39b5ee2fe4687ac8863e6c24569010f27a332883c069b8e14b8fe09e3", + "tools/wordedit.py": "cae8ae0f5d7fb3387ec6922fe966068aae05e3a6d3586830d4361b650cfb3617", + "vendor/audit_local.py": "a38940094f7d19cd6376aafdd4734fa68eabc9aff4c98c3c4a3e9540328b1c90", + "vendor/declared_rewrites.py": "2509f1335e47543f8814b42d6bf83032b30c5899b4f7cc62a6adc03f5138ae13", + "vendor/preload_move.py": "c8fda4674644fcd5cbf39b6645ce148a21daa90a998b678cbe51f970b78b0044" +} diff --git a/research/rank7-coupled-586-588-carrier-fold/README.md b/research/rank7-coupled-586-588-carrier-fold/README.md new file mode 100644 index 0000000000..8ff62ac757 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/README.md @@ -0,0 +1,258 @@ +# Coupled `B + restore` dying-helper carrier folds lowering helpers `586` & `588` to rank 7 (`width 6`): conditional κ = 0.001729776089405120334238 − 10⁻⁴⁶ − 10⁻⁷⁰ + +**Selected frontier & archival base disclosure (`certificates/selected-result.json`, `docs/research/pr-intake-decisions.json`, `docs/research/current-priorities.md` Priority Revision 6):** The official selected conditional bound on `main` remains **`κ = 0.001672660197076918`** (PR #1094). This package is built directly and solely on top of our **actual parent lineage**: **PR #2979** (`mdumitrean`, Marius-Paul Dumitrean), **PR #3015** (`jeremykothe2`, Jeremy Kothe), and **PR #3042** (`dcharb78`), which are recorded in `docs/research/pr-intake-decisions.json` as **archived author claims (`merged_for_archive_only`, `partially_reviewed`)**. Concurrent downstream packages on `main`—**PR #3050** (`petalas`, Nick Petalas), **PR #3051** (`jeremydiviney`, Jeremy Diviney), **PR #3054** (`petalas`), **PR #3056** (`petalas`), **PR #3057** (`petalas`), **PR #3060** (`petalas`), **PR #3064** (`dataisfire`), **PR #3065** (`petalas`), and **PR #3103** (`Arham-Tahir64`) (**archived author claims (`merged_for_archive_only`, `partially_reviewed`)**), alongside open PRs **#3112**, **#3119**, **#3126** (`jwr404`, `V45` invoice/chronology audits), **#3114** (`mdumitrean`), **#3115** (`dataisfire`), and **#3125** (`navinor`, negative ceiling screen of `R489`/`R480` on card `complex-new-helper-inventory`)—were **not** used as inputs to construct this package and are cited solely as **external comparators / scoped optimality baselines**. Per `docs/research/current-priorities.md` (**Priority Revision 6**, `incumbent-optimization` / `complex-new-helper-inventory`), reopening a domain bounded by scoped negative/optimality results requires explicitly naming the **changed hypothesis**: +- **PR #3057** and **PR #3065** (`petalas`, **archived author claims (`merged_for_archive_only`, `partially_reviewed`)**) report (author-checked) that on PR #3042's six-skip words, with scalar operations/order and helper endpoints fixed, **all 6,141 `A`/`B`/`restore` frames are already at their global optimum**. +- **Open PR #3114** (`mdumitrean`) reports (author-checked) that with `A`, `B`, warps, and helper endpoints (`{6:16, 7:52}`) fixed, replacing `restore` by any legal scalar gate sequence and re-solving all frames satisfies `cert(W') >= 10,868,103,087 = cert(PR3042)`—so PR #3042's `-29,976` restore saving (`-12 H1 + 6 H2`) exhausts restore-only improvements under fixed `A`, `B`, and fixed helper endpoints. +- **PR #3051**, **PR #3054**, and **PR #3103** (**archived author claims (`merged_for_archive_only`, `partially_reviewed`)**, plus 30-digit refinement open **PR #3115**) report (author-checked) that at $T=740$ ($20 \mid T$), the fixed helper width inventory `{4:26, 5:2, 6:16, 7:52, 8:99, 9:213}` attains its continuous relaxation cap (`κ = 0.0017297379500642785512428...`). + +**Changed hypothesis in this package (`research/rank7-coupled-586-588-carrier-fold`):** We relax the joint invariance of **`B`-phase carrier routing and `helper_final` terminal subspaces** by coupling a **`B`-phase dying-helper carrier fold** on `(586, 438)` and `(588, 440)` (`B_586_438` and `B_588_440`) with **Stage-1 `helper_final` lowering** of entering helpers `586` ($E_{30} \to V_{30,76,82}$) and `588` ($E_{30} \to V_{30,97,127}$) from rank 8 (`width 7`) to rank 7 (`width 6`), shifting the per-call helper width inventory from **`{4:26, 5:2, 6:16, 7:52, 8:99, 9:213}` to `{4:26, 5:2, 6:18, 7:50, 8:99, 9:213}`** (`24` lowered rank-7 helpers instead of `22`, at unchanged `91` private zero buffers and `66,813` physical families). Neither move works alone (Stage-1 lowering of `586` or `588` alone has a negative surrogate margin of **`-3,345`** each; Stage-2 folding at `dim 8` alone has a negative surrogate margin of **`-973`** each), but together they exhibit a **`+4,983` per-helper (`+9,966` joint) positive cross-term synergy**, saving `-2,091,965` local climb units per helper against the rounded guide value `BE = 2,091,300` for a **surrogate margin of `+665` each = `+1,330` together** on top of `R1_E42 + R2_E7`'s `-29,976` (while the $\kappa$ result and `RELAX-CAP` certificate carry the actual claim). Paired with a repacked literal $T=74$ allocation (`allocation/FILL.json.gz`, `T74_optimal_idle39`), the certified literal $T=74$ root is **`κ in [0.0017297760894051203342384, 0.0017297760894051203342385]`** (`+3.99230172e-8` over PR #3042's $T=74$ root and **`+3.81393408e-8` strictly above PR #3054/#3115's $T=740$ cap-attaining root**), and the new continuous relaxation cap rises to **`RELAX-CAP in [0.0017297774946785970118869, 0.0017297774946785970118870]`** (**`+3.95446143e-8` above PR #3054's $T=740$ cap**). +- **Extended Declared-Edit Checker vs. Unchanged Exact Auditor:** The Stage-4 declared-edit applier and independent edit reviewer (`edits/declared_edits.py`, `edits/edits_review.py`, `verify.py`) were extended from single-hunk `restore` replacements to support multi-hunk `B + restore` edits with automatic `warps` index shifting and declared `helper_final` lowerings to codimension-2 subspaces (`V_{30,76,82}`, `V_{30,97,127}`). The exact forward/dual linear auditor (`vendor/audit_local.py`), monotone frame/cleanup engine (`vendor/preload_move.py`), and two-sided structure certificate checker (`structure.py`) are **unchanged and byte-identical to PR #3042's** (and PR #2979 / PR #2917's). + +```text +Status / UTC update / priority revision: DONE (conditional candidate) · 2026-10-17 · priority revision 6 · base main 997e6a9c +Selected conditional result on main: κ = 0.001672660197076918 (PR #1094, certificates/selected-result.json) +Archival parent lineage & external comparators: Built solely on PR #2979, PR #3015, and PR #3042 (archived author claims: + merged_for_archive_only, partially_reviewed in docs/research/pr-intake-decisions.json). Concurrent PRs #3050, #3051, #3054, + #3056, #3057, #3060, #3064, #3065, #3103 (archived) and #3112, #3114, #3115, #3119, #3125, #3126 (open) are cited solely as external comparators. +Concrete question and changed premise (docs/research/current-priorities.md, Priority Revision 6): PR #3065 reports (author-checked) + all 6,141 frames in PR #3042's words are globally optimal under fixed gates and fixed helper endpoints, and open PR #3114 reports + (author-checked) PR #3042's -29,976 restore saving is globally optimal over all restore gate sequences under fixed A, B, and fixed + helper endpoints {6:16, 7:52}. In PR #2979, entering helpers 586 and 588 were the only two restored helpers whose causal lower bounds + L_586, L_588 already had dimension 7 (k=0 blocking causal gates), yet Stage-1 lowering alone had a -3,345 surrogate margin each. + Can coupling a B-phase dying-helper carrier fold on (586, 438) and (588, 440) with Stage-1 helper_final lowering give 586 and 588 + a positive surrogate margin, shift the width inventory to {6:18, 7:50}, and beat both PR #3042 (T=74) and PR #3054/#3115 (T=740)? +Established result and evidence status: yes. Four declared edits in edits/EDITS.json—R1_E42 (26 -> 33 gates skipping {22, 40, 54, 63}), + R2_E7 (13 -> 15 gates skipping {5, 73}), B_586_438 (6 hunks, 6 -> 5 gates + helper_final[586] -> V_{30,76,82}), and B_588_440 + (6 hunks, 6 -> 5 gates + helper_final[588] -> V_{30,97,127})—move the local profile to {1:2433, 2:724, 3:228, 4:102, 5:20, 8:8} + and the width inventory to {4:26, 5:2, 6:18, 7:50, 8:99, 9:213} (91 buffers). With the repacked literal T74 allocation + (T74_optimal_idle39), complete fresh-native admission and modern outer release pass at + κ = 0.001729776089405120334238 - 10^-46 - 10^-70 (literal root κ in [0.0017297760894051203342384, 0.0017297760894051203342385]; + RELAX-CAP in [0.0017297774946785970118869, 0.0017297774946785970118870]). Author-checked (AI-assisted); not maintainer-reviewed. +Public artifact URL + exact commit: research/rank7-coupled-586-588-carrier-fold (see the PR). +Next useful task: compose the {4:26, 5:2, 6:18, 7:50, 8:99, 9:213} words with a T=740 (20 | T) cap-attaining allocation to close the + 1.4053e-9 T=74 integer-rounding gap, or compose with PR #3060/#3076 native primitive contractions. +Active claim / expiry: released. +``` + +--- + +## 1. Headline Comparison Table + +| Package / Record | Intake / Review Status (`pr-intake-decisions.json`) | κ (headline; candidate rows carry `− 10⁻⁴⁶ − 10⁻⁷⁰`) | Exact Root / Cap Bracket | Local Profile per Call | Helper Width Inventory | Complete Paid Profile ($T=74$ unless noted) | +|---|---|---|---|---|---|---| +| **Selected Result (PR #1094)** | **Official selected conditional bound (`certificates/selected-result.json`)** | **`0.001672660197076918`** | `20908252463461475 / 12500000000000000000` | Selected `k8` baseline | Selected `k8` baseline | Selected `k8` baseline | +| **PR #2969** (`Dugongue`) | Archived comparator (`allocation/baseline/CLAIM.json`) | `0.00172403522474810487855` | Cap-level at $T=370$ | `{1:2430, 2:628, 3:282, 4:110, 5:26, 8:8}` | `{4:26, 5:2, 7:62, 8:100, 9:218}` (86 buf) | $T=370$ baseline | +| **PR #2979** (`mdumitrean`) | **Archived author claim (`merged_for_archive_only`, `partially_reviewed`)** | `0.001729033982646513517717` | Root `0.0017290339826465...`
Cap `0.0017290357648755...` | `{1:2445, 2:706, 3:232, 4:108, 5:18, 8:8}` | `{4:26, 5:2, 6:16, 7:52, 8:99, 9:213}` (91 buf) | `{1:1645680, 2:470196, 3:159468, 4:71928, 5:13716, 8:5328, 48:28190}` | +| **PR #3015** (`jeremykothe2`) | **Archived author claim (`merged_for_archive_only`, `partially_reviewed`)** | `0.001729150973534224428695` | 1 skip (`63` via `61`) | `{1:2443, 2:707, 3:232, 4:108, 5:18, 8:8}` | `{4:26, 5:2, 6:16, 7:52, 8:99, 9:213}` (91 buf) | `{1:1644348, 2:470862, 3:159468, 4:71928, 5:13716, 8:5328, 48:28190}` | +| **PR #3042** (`dcharb78`, audited in **#3050**, **#3065**, **#3114**) | **Archived author claim (`merged_for_archive_only`, `partially_reviewed`)** | `0.001729736166387915986812` | Root `[0.0017297361663879159868125, ...6]`
Cap `[0.0017297379500642785512428, ...9]` | `{1:2433, 2:712, 3:232, 4:108, 5:18, 8:8}` | `{4:26, 5:2, 6:16, 7:52, 8:99, 9:213}` (91 buf) | `{1:1637688, 2:474192, 3:159468, 4:71928, 5:13716, 8:5328, 48:28190}` | +| **PR #3051 / #3054 / #3103** (`jeremydiviney` / `petalas` / `Arham-Tahir64`) & open **PR #3115** (`dataisfire`) | **Archived author claims (`merged_for_archive_only`, `partially_reviewed`)** / open (#3115) | `0.001729737950064278551242` (`#3054`)
`0.001729737950064278551242895823` (`#3115`, `− 10⁻⁵² − 10⁻⁷⁶`) | Attains `{6:16, 7:52}` cap at $T=740$ ($20 \mid T$) | `{1:2433, 2:712, 3:232, 4:108, 5:18, 8:8}` | `{4:26, 5:2, 6:16, 7:52, 8:99, 9:213}` (91 buf) | $T=740$ cap-attaining profile (`6,660` calls) | +| **This Package (`rank7-coupled-586-588-carrier-fold`)** | **New conditional candidate (author-checked, AI-assisted)** | **`0.001729776089405120334238`** | **Root `[0.0017297760894051203342384, 0.0017297760894051203342385]`**
**`RELAX-CAP` `[0.0017297774946785970118869, 0.0017297774946785970118870]`** | **`{1:2433, 2:724, 3:228, 4:102, 5:20, 8:8}`** | **`{4:26, 5:2, 6:18, 7:50, 8:99, 9:213}` (91 buf)** | **`{1:1637692, 2:482184, 3:156741, 4:67932, 5:14710, 8:5328, 39:1, 48:28256}`** | + +### Exact Certified Gains (`check_cap.py`, `CLAIM.json`) +- **Over PR #3042 ($T=74$ literal root):** **`+3.99230172e-8`** (`0.0017297760894051203342384 - 0.0017297361663879159868125`). +- **Over PR #3051 / PR #3054 / PR #3115 ($T=740$ cap-attaining root):** **`+3.81393408e-8`** (`0.0017297760894051203342384 - 0.0017297379500642785512428`, beating the $T=740$ ceiling of the old `{6:16, 7:52}` inventory already at $T=74$). +- **Continuous Relaxation Cap Gain (`RELAX-CAP` over PR #3054 / PR #3042 cap):** **`+3.95446143e-8`** (`0.0017297774946785970118869 - 0.0017297379500642785512428`). +- **Remaining $T=74$ Integer-Rounding Gap to `RELAX-CAP`:** **`1.4053e-9`** (`0.0017297774946785970118869 - 0.0017297760894051203342385`), which is strictly smaller than PR #3042 / PR #2979's `1.7837e-9` gap at $T=74$ and arises from the $20 \mid T$ fractional-basis period effect (`idle_per_replica = {1: 234, 3: 1323/20, 5: 75/4, 48: 7637/20}` in `certificates/RELAX-CAP.json`) closed at $T=740$ in PR #3024, #3030, #3051, #3054, and #3103 (and partially at $T=148$ in PR #3022, #3028, #3064). +- **Over pinned comparators (`comparators/` & `allocation/baseline/`):** + - Over PR #2979: `742106758606816521 / 10^24` $\approx$ **`+7.4210675861e-7`** + - Over PR #2969: `717608082126931961 / (1.25 × 10^23)` $\approx$ **`+5.7408646570e-6`** + - Over PR #2966: `2870908440834078413 / (5 × 10^23)` $\approx$ **`+5.7418168817e-6`** + - Over PR #2957: `6058674334382163267 / 10^24` $\approx$ **`+6.0586743344e-6`** + - Over PR #2942: `3479884770953003121 / (5 × 10^23)` $\approx$ **`+6.9597695419e-6`** + +--- + +## 2. Literal `edits/EDITS.json` Specification (All 4 Edits & `helper_final` Lowerings) + +Every gate count (`len(old) -> len(new)`), register ID, rational coefficient, subspace frame basis, and per-edit profile delta below is derived programmatically and literally from `edits/EDITS.json` (which applies identically to `base` and `extra`). Across all 4 edits (`14` hunks total per word) and `2` `helper_final` lowerings, the only registers touched in `edits/EDITS.json` are: +- **`R1_E42` (`14` registers):** `[18, 22, 34, 40, 45, 54, 61, 63, 92, 103, 108, 226, 228, 230]` +- **`R2_E7` (`6` registers):** `[5, 59, 73, 96, 363, 395]` +- **`B_586_438` (`7` registers):** `[75, 136, 140, 144, 187, 438, 586]` +- **`B_588_440` (`7` registers):** `[84, 162, 172, 196, 221, 440, 588]` + +### Summary Table of the 4 Declared Edits in `edits/EDITS.json` + +| Edit ID | Section & Source Addresses | Hunks & Literal Gate Counts (`len(old) -> len(new)`) | Touched Registers | `helper_final` Lowering (`old -> new`) | Per-Call Profile $\Delta$ | Surrogate Guide $\Delta$ (`c1=2,116,671`, rounded guide `BE=2,091,300`; $\kappa$ carries the claim) | +|---|---|---|---|---|---|---| +| **`R1_E42`** | `restore[162:188]` | 1 hunk: **`26 -> 33`** | `18, 22, 34, 40, 45, 54, 61, 63, 92, 103, 108, 226, 228, 230` (skips `E_42` for `{22, 40, 54, 63}`) | None | **`-8 H1 + 4 H2`** | **`-19,984`** (`+19,984` surrogate margin) | +| **`R2_E7`** | `restore[190:203]` | 1 hunk: **`13 -> 15`** | `5, 59, 73, 96, 363, 395` (skips `E_7` for `{5, 73}`) | None | **`-4 H1 + 2 H2`** | **`-9,992`** (`+9,992` surrogate margin) | +| **`B_586_438`** | `B[52:53]`, `B[784:785]`, `B[794:795]`, `B[1214:1215]`, `B[1230:1231]`, `restore[85:86]` | 6 hunks: **`6 -> 5`** (`1 -> 0` at `B[52:53]`, five `1 -> 1`) | `75, 136, 140, 144, 187, 438, 586` | `586`: `E_30` (`8`) $\to$ `V_{30,76,82}` (`7`) (`[256,128,70,32,18,12,1]`, width `7 -> 6`) | **`+6 H2 - 2 H3 - 3 H4 + 1 H5`** | **`-2,091,965`** vs `BE = -2,091,300` $\implies$ **`+665` surrogate margin** | +| **`B_588_440`** | `B[57:58]`, `B[789:790]`, `B[799:800]`, `B[1222:1223]`, `B[1238:1239]`, `restore[88:89]` | 6 hunks: **`6 -> 5`** (`1 -> 0` at `B[57:58]`, five `1 -> 1`) | `84, 162, 172, 196, 221, 440, 588` | `588`: `E_30` (`8`) $\to$ `V_{30,97,127}` (`7`) (`[256,128,65,33,18,10,6]`, width `7 -> 6`) | **`+6 H2 - 2 H3 - 3 H4 + 1 H5`** | **`-2,091,965`** vs `BE = -2,091,300` $\implies$ **`+665` surrogate margin** | +| **Total** | `B` (`-2` gates, `cleanup` `+2` at `FULL`, warps shifted) + `restore` (`+9` gates) | **14 hunks (`51 -> 58` gates)** | `34` distinct registers | `586, 588` lowered (`{6:16, 7:52} -> {6:18, 7:50}`) | **`-12 H1 + 18 H2 - 4 H3 - 6 H4 + 2 H5`** | **`-4,213,906`** vs `2*BE = -4,182,600` $\implies$ **`+31,306` surrogate margin** | + +### 2.1 Edit 1: `R1_E42` (`restore[162:188]`, `26 -> 33` Gates, Skipping `{22, 40, 54, 63}`, `-8 H1 + 4 H2 = -19,984`) +*(From PR #3042 by dcharb78, superseding PR #3015's single-register edit `R1` on `restore[178:180]`; subsequently audited in external PRs #3050 and #3114.)* +- **Exact $\mathbb{Q}$-Linear Map (`old` and `new` are 100% identical across all 14 touched registers):** + $$X_{18}' = -X_{226}, \quad X_{22}' = -X_{230}, \quad X_{108}' = -X_{22} + 2 X_{34},$$ + $$X_{226}' = -\frac{1}{4} X_{18} - \frac{1}{4} X_{40} + \frac{1}{2} X_{54}, \quad X_{228}' = \frac{1}{4} X_{22} - \frac{1}{2} X_{34} + \frac{1}{4} X_{108},$$ + $$X_{230}' = -\frac{1}{4} X_{22} + \frac{1}{2} X_{34} - \frac{1}{4} X_{40} + \frac{1}{4} X_{45} + \frac{1}{2} X_{54} + \frac{1}{4} X_{61} + \frac{1}{4} X_{63} - \frac{1}{4} X_{92} + \frac{1}{4} X_{103} + \frac{1}{4} X_{228} + \frac{1}{4} X_{230},$$ + and $X_r' = X_r$ for $r \in \{34, 40, 45, 54, 61, 63, 92, 103\}$. +- **Literal Gate Sequence (`33` gates in `new` vs `26` in `old`):** + 1. **Registers `40` and `54` via swap with `226` at Group B's rank-7 subspace $W_B = V_{25,42,51} = [256, 128, 64, 34, 17, 11, 4]$ and `18` at $\text{FULL} = [256, 128, 64, 32, 16, 8, 4, 2, 1]$ (`NEW[0..8]` and `NEW[20..25]`):** + - `NEW[0..3]` at $W_B$ ($\dim 7$): `['add', 40, 54, -2, 1]`, `['add', 40, 226, -1, 1]`, `['add', 226, 40, 1, 1]`, `['add', 40, 226, -1, 1]` (swapping $X_{40} - 2 X_{54}$ into `226` and $-X_{226}$ into `40` at $\dim 7$). + - `NEW[4..8]` at $E_{42} = [256, 128, 64, 34, 16, 10, 4, 1]$ ($\dim 8$): `['add', 18, 226, 1, 1]`, `['scale', 18, 1, -4]`, `['add', 18, 226, -1, 1]`, `['add', 226, 18, 1, 1]`, `['add', 18, 226, -1, 1]` (setting $X_{226}' = -\frac{1}{4} X_{18} - \frac{1}{4} X_{40} + \frac{1}{2} X_{54}$ and leaving `18` with $-(X_{40} - 2 X_{54})$). + - `NEW[20..21]` at $E_{42}$ ($\dim 8$): `['add', 230, 18, -1, 1]` and `['add', 230, 45, -1, 1]` (accumulating $X_{40} - 2 X_{54} - X_{45}$ into `230`). + - `NEW[22..25]` at $\text{FULL}$ ($\dim 9$): `['add', 40, 18, -1, 1]`, `['add', 18, 40, 1, 1]`, `['add', 40, 18, -1, 1]`, `['add', 40, 54, 2, 1]` (swapping `18` and `40` at rank 9 so $X_{18}' = -X_{226}$, and uncomputing `-2*54` on `40` at rank 9). Both `40` and `54` skip $E_{42}$ and climb `7 -> 9` directly (`-4 H1 + 2 H2 = -9,992`). + 2. **Register `22` via swaps with `228` and `230` at Group A's rank-7 subspace $W_A = V_{30,42,52} = [256, 128, 64, 38, 20, 10, 1]$ (`NEW[9..19]`):** + - `NEW[9..16]` at $W_A$ ($\dim 7$): `['add', 22, 34, -2, 1]`, 3-add swap `['add', 22, 228, -1, 1]`, `['add', 228, 22, 1, 1]`, `['add', 22, 228, -1, 1]`, and 4-add swap/transfer `['add', 22, 230, -1, 1]`, `['add', 230, 22, 1, 1]`, `['add', 22, 230, -1, 1]`, `['add', 230, 22, 1, 1]`. This places $X_{22}' = -X_{230}$ onto `22` already at $\dim 7$ ($W_A$), so `22` never touches $E_{42}$ and climbs `7 -> 9` directly at `'end'` (`-2 H1 + 1 H2 = -4,996`), while `228` and `230` carry $X_{22} - 2 X_{34}$ into `NEW[17..19]` (`['add', 228, 108, 1, 1]`, `['scale', 228, 1, 4]`, `['add', 108, 228, -4, 1]` at $E_{42}$). + 3. **Register `63` via carrier `61` at $V_{45} = V_{7,42,45} = [256, 128, 64, 35, 16, 11, 5]$ (`NEW[26..32]`, PR #3015's `R1`):** + - `NEW[26]` at $V_{45}$ ($\dim 7$): `['add', 61, 63, 1, 1]`; `NEW[27]` at $E_{42}$ ($\dim 8$): `['add', 230, 61, -1, 1]`; `NEW[28]` at $\text{FULL}$ ($\dim 9$): `['add', 61, 63, -1, 1]` (so `63` skips $E_{42}$ and climbs `7 -> 9` directly, `-2 H1 + 1 H2 = -4,996`), followed by `NEW[29..32]` at $E_{42}$ ($\dim 8$): `['add', 230, 92, 1, 1]`, `['add', 230, 103, -1, 1]`, `['add', 230, 108, -1, 1]`, `['scale', 230, 1, -4]`. + +### 2.2 Edit 2: `R2_E7` (`restore[190:203]`, `13 -> 15` Gates, Skipping `{5, 73}`, `-4 H1 + 2 H2 = -9,992`) +*(From PR #3042 by dcharb78; subsequently audited in external PRs #3050 and #3114.)* +- **Exact $\mathbb{Q}$-Linear Map (`old` and `new` are 100% identical across all 6 touched registers):** + $$X_5' = -X_{395}, \quad X_{59}' = -X_{363}, \quad X_{96}' = X_5 + X_{395}, \quad X_{73}' = X_{73},$$ + $$X_{363}' = -\frac{1}{4} X_{59} + \frac{1}{4} X_{73} + \frac{1}{4} X_{363}, \quad X_{395}' = -\frac{1}{4} X_5 + \frac{1}{4} X_{96} - \frac{1}{4} X_{395}.$$ +- **Literal Gate Sequence (`15` gates in `new` vs `13` in `old`):** + 1. **Register `73` via pivot `363` at Group C's rank-7 subspace $W_C = V_{7,25,30} = [256, 128, 64, 32, 19, 11, 6]$ and carrier `59` at $\text{FULL}$ (`NEW[0..6]`):** + - `NEW[0]` at $W_C$ ($\dim 7$): `['add', 363, 73, 1, 1]` (folding $X_{73}$ into `363` at $\dim 7$). + - `NEW[1..5]` at $E_7 = [256, 128, 64, 32, 16, 8, 5, 3]$ ($\dim 8$): `['add', 59, 363, -1, 1]`, `['scale', 59, 1, -4]`, `['add', 59, 363, -1, 1]`, `['add', 363, 59, 1, 1]`, `['add', 59, 363, -1, 1]` (producing $X_{363}'$ on `363` and $-X_{363} - X_{73}$ on `59`). + - `NEW[6]` at $\text{FULL}$ ($\dim 9$): `['add', 59, 73, 1, 1]` (cleaning $-X_{73}$ from `59` at rank 9 so `73` skips $E_7$ and climbs `7 -> 9` directly, `-2 H1 + 1 H2 = -4,996`). + 2. **Register `5` via pivot `395` at Group D's rank-7 subspace $W_D = V_{7,51,52} = [256, 128, 64, 37, 21, 8, 3]$ and carrier `96` at $\text{FULL}$ (`NEW[7..14]`):** + - `NEW[7]` at $W_D$ ($\dim 7$): `['add', 395, 5, 1, 1]` (folding $X_5$ into `395` at $\dim 7$). + - `NEW[8..13]` at $E_7$ ($\dim 8$): `['add', 96, 395, -1, 1]`, `['scale', 96, 1, 4]`, `['add', 96, 395, -1, 1]`, `['add', 395, 96, 1, 1]`, `['add', 96, 395, -1, 1]`, `['scale', 96, -1, 1]` (producing $X_{395}'$ on `395` and $X_5 + X_{395}$ on `96`). + - `NEW[14]` at $\text{FULL}$ ($\dim 9$): `['add', 5, 96, -1, 1]` (setting $X_5' = -X_{395}$ at rank 9 so `5` skips $E_7$ and climbs `7 -> 9` directly, `-2 H1 + 1 H2 = -4,996`). + +### 2.3 Edit 3: `B_586_438` + `helper_final["586"]` (`6` Hunks, `6 -> 5` Gates, Lowering `586` from $E_{30}$ to $V_{30,76,82}$, `+665` Surrogate Margin) +- **Algebraic, Subspace & `cleanup` Mechanism:** + In `w_base`, entering helper `586` (`start_extra = [30]`, $\dim 1$) and dying cold helper `438` ($\dim 3$ at `B[759]: 586 += 438`) feed target `136` via `B[52]: 136 += 1/2*586` ($\dim 1$) and `B[784]: 136 -= 1/2*586` ($\dim 6$). Because `B[759]: 586 += 438` occurs between `B[52]` and `B[784]`, the net contribution of `B[52]` and `B[784]` to wire `136` is simply: + $$\frac{1}{2} X_{586} - \frac{1}{2}(X_{586} + X_{438}) = -\frac{1}{2} X_{438}.$$ + Later at `B[1215]: 136 += 75`, wire `136` receives **source register `75`** (which has no other readers after `B[794]` and ends at $\text{FULL}$, $\dim 9$). By deleting `B[52]`, moving `B[794]: 140 -= 1/2*438` to `B[784]` at the 4D join frame $J_{140,438} = [257, 129, 32, 30]$, and folding `75 -= 1/2*438` into `B[794]` at the 5D join frame $J_{75,438} = [257, 129, 70, 32, 30]$, both `438` and `586` traverse a monotone 5-step nested subspace tower entirely inside $L_{586} = V_{30,76,82} = E_{30} \cap E_{76} \cap E_{82} = [256, 128, 70, 32, 18, 12, 1]$ ($\dim 7$): + $$U_{759}(3) \;\subset\; J_{140,438}(4) \;\subset\; J_{75,438}(5) \;\subset\; U_{1214,L}(6) \;\subset\; L_{586}(7).$$ + Compared with PR #3042, `B` loses 1 gate (`B[52]`), `restore` is unchanged except for the frame at `restore[85]`, and inverse-reverse `cleanup` gains 1 gate at $\text{FULL}$ (`75 += 1/2*438`), which costs no frame steps and leaves the total `B + restore + cleanup` gate count unchanged. +- **Literal 6 Hunks in `edits/EDITS.json` (`B_586_438`, `6 -> 5` gates total):** + 1. **Hunk 0 (`B[52:53]`, `1 -> 0` gates):** deletes `['add', 136, 586, 1, 2, [30]]` ($\dim 1$), shifting all `B` warps with position $> 52$ by $-1$. + 2. **Hunk 1 (`B[784:785]`, `1 -> 1` gates):** replaces `['add', 136, 586, -1, 2, [289, 161, 64, 18, 10, 6]]` ($\dim 6$) with `['add', 140, 438, -1, 2, [257, 129, 32, 30]]` ($\dim 4$, normals `[6, 10, 12, 18, 20, 24, 30, 64, 70, 74, ...]`). + 3. **Hunk 2 (`B[794:795]`, `1 -> 1` gates):** replaces `['add', 140, 438, -1, 2, [256, 128, 76, 32, 30, 1]]` ($\dim 6$) with `['add', 75, 438, -1, 2, [257, 129, 70, 32, 30]]` ($\dim 5$, normals `[6, 24, 30, 74, 76, 82, 84, ...]`). + 4. **Hunk 3 (`B[1214:1215]`, `1 -> 1` gates):** lowers the frame of `['add', 144, 438, -1, 2]` from `[256, 128, 70, 32, 20, 10, 1]` ($\dim 7$, normals `[30, 74, 84]`) to `[256, 128, 70, 32, 30, 1]` ($\dim 6$, normals `[6, 24, 30, 74, 76, 82, 84]`). + 5. **Hunk 4 (`B[1230:1231]`, `1 -> 1` gates):** lowers the frame of `['add', 187, 586, -1, 2]` from `[288, 160, 64, 18, 10, 6, 1]` ($\dim 7$, normals `[30, 416, 446]`) to `[288, 160, 70, 18, 12, 1]` ($\dim 6$, normals `[30, 76, 82, 416, 446, 492, 498]`). + 6. **Hunk 5 (`restore[85:86]`, `1 -> 1` gates):** lowers the frame of `['add', 586, 438, -1, 1]` from `[256, 128, 64, 32, 18, 10, 6, 1]` ($\dim 8$, $E_{30}$) to `[256, 128, 70, 32, 18, 12, 1]` ($\dim 7$, $V_{30,76,82}$), and lowers `helper_final["586"]` from `[256, 128, 64, 32, 18, 10, 6, 1]` (`8` basis vectors) to `[256, 128, 70, 32, 18, 12, 1]` (`7` basis vectors, reducing `width(586)` from $8 - 1 = 7$ to $7 - 1 = 6$). +- **Exact Per-Register Profile Delta (`B_586_438` + `helper_final["586"]`):** + - `586`: `[1, 3, 6, 7, 8] -> [1, 3, 6, 7]` (`-1 H1 = -2,116,671`) + - `136`: `[0, 1, 2, 6, 7, 8] -> [0, 1, 2, 7, 8]` (`-1 H1 - 1 H4 + 1 H5 = -9,006`) + - `140`: `[0, 1, 2, 6, 7, 8] -> [0, 1, 2, 4, 7, 8]` (`-1 H1 + 1 H2 + 1 H3 - 1 H4 = +3,102`) + - `75`: `[1, 2, 3, 7, 9] -> [1, 2, 3, 5, 7, 9]` (`+2 H2 - 1 H4 = +9,979`) + - `438`: `[0, 1, 2, 3, 6, 7, 8, 9] -> [0, 1, 2, 3, 4, 5, 6, 7, 9]` (`+1 H1 + 1 H2 - 1 H3 = +6,877`) + - `144`: `[0, 1, 2, 4, 7, 8] -> [0, 1, 2, 4, 6, 7, 8]` (`+1 H1 + 1 H2 - 1 H3 = +6,877`) + - `187`: `[0, 1, 2, 4, 7, 8] -> [0, 1, 2, 4, 6, 7, 8]` (`+1 H1 + 1 H2 - 1 H3 = +6,877`) + - **Total for `B_586_438`:** **`+6 H2 - 2 H3 - 3 H4 + 1 H5 = -2,091,965` units/call** vs rounded guide `BE = -2,091,300` $\implies$ **`+665` surrogate margin per call**. + +### 2.4 Edit 4: `B_588_440` + `helper_final["588"]` (`6` Hunks, `6 -> 5` Gates, Lowering `588` from $E_{30}$ to $V_{30,97,127}$, `+665` Surrogate Margin) +- **Algebraic, Subspace & `cleanup` Mechanism:** + Symmetrically, entering helper `588` (`start_extra = [30]`, $\dim 1$) and dying cold helper `440` ($\dim 3$ at `B[763]: 588 += 440`) feed target `221` via `B[57]: 221 -= 588` ($\dim 1$) and `B[789]: 221 += 588` ($\dim 6$), whose net contribution to `221` is $-X_{588} + (X_{588} + X_{440}) = +X_{440}$. Deleting `B[57]`, moving `172 += 440` to `B[789]` at the 4D join frame $J_{172,440} = [268, 161, 65, 30]$, and folding `84 += 440` into **source register `84`** at `B[799]` (before `B[1223]: 221 += 84`) at the 5D join frame $J_{84,440} = [262, 161, 65, 20, 10]$ routes `440` and `588` along the 5-step nested subspace tower inside $L_{588} = V_{30,97,127} = E_{30} \cap E_{97} \cap E_{127} = [256, 128, 65, 33, 18, 10, 6]$ ($\dim 7$): + $$U_{763}(3) \;\subset\; J_{172,440}(4) \;\subset\; J_{84,440}(5) \;\subset\; U_{1222,L}(6) \;\subset\; L_{588}(7).$$ + Compared with PR #3042, across `B_586_438` and `B_588_440` combined, `B` loses 2 gates (`B[52]` and `B[57]`), `restore` is unchanged except for the frames at `restore[85]` and `restore[88]`, and `cleanup` gains 2 gates at $\text{FULL}$ (`75 += 1/2*438` and `84 -= 440`), costing no frame steps and keeping the total gate count unchanged. +- **Literal 6 Hunks in `edits/EDITS.json` (`B_588_440`, `6 -> 5` gates total):** + 1. **Hunk 0 (`B[57:58]`, `1 -> 0` gates):** deletes `['add', 221, 588, -1, 1, [30]]` ($\dim 1$), shifting all `B` warps with position $> 57$ by an additional $-1$. + 2. **Hunk 1 (`B[789:790]`, `1 -> 1` gates):** replaces `['add', 221, 588, 1, 1, [256, 161, 97, 18, 10, 6]]` ($\dim 6$) with `['add', 172, 440, 1, 1, [268, 161, 65, 30]]` ($\dim 4$, normals `[12, 18, 30, 97, 109, 115, 127, ...]`). + 3. **Hunk 2 (`B[799:800]`, `1 -> 1` gates):** replaces `['add', 172, 440, 1, 1, [268, 128, 64, 32, 30, 1]]` ($\dim 6$) with `['add', 84, 440, 1, 1, [262, 161, 65, 20, 10]]` ($\dim 5$, normals `[30, 97, 127, 160, 190, 193, 223, 266, 276, ...]`). + 4. **Hunk 3 (`B[1222:1223]`, `1 -> 1` gates):** lowers the frame of `['add', 162, 440, 1, 1]` from `[262, 128, 64, 32, 20, 10, 1]` ($\dim 7$, normals `[30, 266, 276]`) to `[262, 128, 65, 33, 20, 10]` ($\dim 6$, normals `[30, 97, 127, 266, 276, 363, 373]`). + 5. **Hunk 4 (`B[1238:1239]`, `1 -> 1` gates):** lowers the frame of `['add', 196, 588, 1, 1]` from `[256, 160, 96, 18, 10, 6, 1]` ($\dim 7$, normals `[30, 224, 254]`) to `[256, 161, 96, 18, 10, 6]` ($\dim 6$, normals `[30, 97, 127, 129, 159, 224, 254]`). + 6. **Hunk 5 (`restore[88:89]`, `1 -> 1` gates):** lowers the frame of `['add', 588, 440, -1, 1]` from `[256, 128, 64, 32, 18, 10, 6, 1]` ($\dim 8$, $E_{30}$) to `[256, 128, 65, 33, 18, 10, 6]` ($\dim 7$, $V_{30,97,127}$), and lowers `helper_final["588"]` from `[256, 128, 64, 32, 18, 10, 6, 1]` (`8` basis vectors) to `[256, 128, 65, 33, 18, 10, 6]` (`7` basis vectors, reducing `width(588)` from $8 - 1 = 7$ to $7 - 1 = 6$). +- **Exact Per-Register Profile Delta (`B_588_440` + `helper_final["588"]`):** + - `588`: `-2,116,671`; `221`: `-9,006`; `172`: `+3,102`; `84`: `+9,979`; `440`: `+6,877`; `162`: `+6,877`; `196`: `+6,877`. + - **Total for `B_588_440`:** **`+6 H2 - 2 H3 - 3 H4 + 1 H5 = -2,091,965` units/call** vs rounded guide `BE = -2,091,300` $\implies$ **`+665` surrogate margin per call**. + +--- + +## 3. Single-Move Negative Controls & 91-Helper Exhaustion Proofs + +### 3.1 Single-Move Negative Controls: Why `586` and `588` Lose Under Stage-1 Alone (`-3,345`) and Stage-2 Alone (`-973`), But Gain `+665` Surrogate Margin Each (`+1,330` Together) When Coupled + +In PR #2979 (`construction/STAGE-PRICES.json`, lines 773–803), helpers `586` and `588` were the **only two restored helpers in the entire word** whose causal lower bounds $L_{586} = V_{30,76,82}$ and $L_{588} = V_{30,97,127}$ already had dimension 7 ($k = 0$ blocking causal gates) that remained unlowered at `end_dim = 8` ($E_{30}$). Evaluating the two single-move controls against the coupled rewrite explains why neither a frame-only solver (PR #2979 Stage 1 / PR #3065) nor a fixed-endpoint gate search (PR #2957 Stage 3 / PR #3114) could discover this improvement: + +| Configuration (per helper `586` or `588`, and joint for the pair) | `helper_final` (`586, 588`) | `B`-Phase Gate Topology | Local Profile $\Delta$ (per helper / joint) | Local Climb Cost $\Delta$ (per helper / joint) | Rounded Guide Charge (`BE = 2,091,300`) | **Surrogate Margin (per helper / joint; $\kappa$ carries the claim)** | +|---|---|---|---|---|---|---| +| **1. Stage-1 Lowering Alone (Fixed Scalar Gates)** | $\dim 7$ ($V_{30,76,82}$, $V_{30,97,127}$) | Unfolded (`B[52], B[784]` and `B[57], B[789]` kept; frames intersected with $L_h$) | `-1 H1 + 7 H2 - 2 H3 - 2 H4` each
(`-2 H1 + 14 H2 - 4 H3 - 4 H4` joint) | `-2,087,955` each
(`-4,175,910` joint) | `+2,091,300` each
(`+4,182,600` joint) | **`-3,345` each (`-6,690` joint — LOSES)** | +| **2. Stage-2 Carrier Fold Alone at `dim 8` (Fixed Endpoints)** | $\dim 8$ ($E_{30}$, unchanged) | Folded (`B[52], B[57]` deleted; `140, 172` at $\dim 4$; `75, 84` at $\dim 6 = \text{meet}(B[1214], B[1215])$) | `-1 H1 + 2 H2 - 2 H4 + 1 H5` each
(`-2 H1 + 4 H2 - 4 H4 + 2 H5` joint) | `+973` each
(`+1,946` joint) | `0` (`width 7` unchanged) | **`-973` each (`-1,946` joint — LOSES)** | +| **3. Coupled Carrier Fold + `dim 7` Lowering (`B_586_438`, `B_588_440`)** | **$\dim 7$ ($V_{30,76,82}$, $V_{30,97,127}$)** | **Folded along 5-step subspace towers (`140, 172` at $\dim 4$; `75, 84` at $\dim 5$)** | **`+6 H2 - 2 H3 - 3 H4 + 1 H5` each**
**(`+12 H2 - 4 H3 - 6 H4 + 2 H5` joint)** | **`-2,091,965` each**
**(`-4,183,930` joint)** | **`+2,091,300` each**
**(`+4,182,600` joint)** | **`+665` each (`+1,330` joint — WINS)** | + +- **Origin of the `+4,983` per-helper (`+9,966` joint) positive cross-term synergy:** + 1. Under **Stage-1 lowering alone**, keeping `B[784]: 136 -= 1/2*586` (and `B[789]: 221 += 588`) inside $L_{586}$ forces `B[784]`'s frame to drop from $\dim 6$ to $\dim 5$, which adds an extra intermediate stop to both `586` (`[1, 3, 5, 6, 7]` instead of `[1, 3, 6, 7]`, costing `+6,877`) and `136` (`[0, 1, 2, 5, 7, 8]` instead of `[0, 1, 2, 7, 8]`, costing `+3,102` vs baseline and `+12,108` vs the folded `[0, 1, 2, 7, 8]` trajectory). + 2. Under **Stage-2 folding at `dim 8` alone**, `B[1214]: 144 -= 1/2*438` remains at $\dim 7$ and `restore[85]: 586 -= 438` remains at $\dim 8$ ($E_{30}$), so folding `438` into `140` ($\dim 4$) and `75` ($\dim 6$) inserts an extra stop on `438` (`[0, 1, 2, 3, 4, 6, 7, 8, 9]`, costing `+6,877`) while `586` only saves `-8,098` (`[1, 3, 7, 8]` vs `[1, 3, 6, 7, 8]`), resulting in a surrogate margin of `-973` per helper. + 3. When **coupled**, `B[1214]` and `B[1230]` drop to $\dim 6$ inside $L_{586}$ while `586` and `136` bypass `B[784]` completely, eliminating both the `+6,877` stop on `586` and the `+12,108` stop on `136` simultaneously (`-3,345 - 973 + 4,983 = +665` surrogate margin per helper). + +### 3.2 Exhaustive 91-Helper Causal Lower-Bound Scan & Structural Obstruction Proofs for All Remaining Candidates + +Tracing the causal lower bound $L_h = \text{lo}[\text{last}[h]]$ across all **91 restored helpers** in the word (`26` at `end_dim = 4`, `30` at `end_dim = 7`, `35` at `end_dim = 8`) by the minimum number $k$ of blocking causal gates in `B + restore` whose removal drops $\dim(L_h)$ shows that beyond `586` and `588` ($k = 0$), every remaining candidate with $k \le 2$ is blocked by one of three exact structural locks: + +1. **The Double Cone Lock on Entering Quartet Sisters `584` and `590` ($\dim 8 \to 7$ at $E_{51}$, $k = 1$ blocking gate):** + - **Free-Operator Algebra Status (`PASS`):** Replacing `B[59]` with `214 += 566`, `B[1196]` with `168 -= 1/2*439`, and `B[1204]` with `214 += 444` while deleting `B[13, 48, 60, 753, 765]` and `restore[82, 91]` leaves `584` and `590` with **0 gates in the entire circuit** and passes 100% of `audit_local.py`'s forward and dual free-operator checks across all 632 inputs. + - **Causal Frame-Chain Obstruction (`FAIL`, 28–74 DAG `lo <= hi` violations across all chronological placements):** Why did `586` and `588` ($E_{30}$) lower cleanly to $\dim 7$ while their even-quartet sisters `584` and `590` ($E_{51}$) are locked at $\dim 8$? + - For `586/438` (and `588/440`), both remaining consumers `187` (`B[1230]`, receiving dying helper `506`) and `144` (`B[1214]`, receiving dying helper `530`) have causal lower bounds contained inside the **same** 7D subspace $L_{586} = V_{30,76,82}$ (and $L_{588} = V_{30,97,127}$). + - For `584/439` (and `590/444`), the two consumers sit in **transverse 7D cones** inside $E_{51}$: the right consumer `115` (`B[1244]: 115 -= 1/2*439`, or `130` at `B[1252]: 130 += 444`) receives **post-warp cold helper `273`** (`B_WARP[541]`, or `289` from `B_WARP[545]`) at $\text{lo\_dim} = 5$ (`[21, 51, 67, 86, 112]`), hard-pinning `B[1244]` to $\text{lo} = \text{hi} = W_{\text{right}} = E_{51} \cap E_{67} \cap E_{112}$ ($\dim 7$); whereas the left consumer `168` (`B[1196]`, or `214` at `B[1204]`) receives entering helper `554` (`B[771]: 168 += 554`, or `566` at `B[59]`), which is upper-bounded by `B[913]: 273 += 554` (`hi_dim = 6`) inside $U_{6,\text{left}} \subseteq W_{\text{left}} = E_{51} \cap E_{82} \cap E_{97}$ ($\dim 7$). Because $U_{6,\text{left}} \not\subseteq W_{\text{right}}$, their join is $\text{join}(U_{6,\text{left}}, W_{\text{right}}) = E_{51}$ ($\dim 8$). + +2. **The Restored-Dirt Isolation Lock on Entering Carrier Helpers `531, 543` and `554, 555, 566, 567` ($\dim 8 \to 7$, $k = 1$ `B` gate):** + - **Causal Frame-Chain Status (`PASS` when `B[916]: 305 += 531` and `B[918]: 321 += 543` are removed):** Deleting `B[916]` and `B[918]` alone drops `531` and `543` to $L_{586} = V_{30,76,82}$ and $L_{588} = V_{30,97,127}$ ($\dim 7$, `width 7 -> 6`) with 0 DAG violations, because `restore[57..59]` and `restore[64..66]` automatically lie inside $L_{586}$ and $L_{588}$. + - **Free-Operator Algebra Obstruction (`FAIL`, `bad_read = [531, 587]` / `[543, 589]`, `bad_targets = [36, 37, 46, 47]`):** At `B[275]: 351 -= 531`, `B[659]: 351 += 1`, and `B[660]: 531 += 351`, helper `531` isolates the clean sum $X_{351} + X_1$ (cancelling $X_{531}$), while `351` retains $-X_{531}$ and immediately absorbs $-\frac{1}{2}(X_{587} + X_{436})$ at `B[661, 786]`. Because consumer `305` is a **warped cold helper** (`B_WARP[385]` before `B[916]` and `B_WARP[611]` after `B[1586]`), routing `305` onto `351` pollutes `305` and output targets `36, 37, 46, 47` with restored helpers `531, 587` and breaks inverse-warp `cleanup` across `B_WARP[611]`. The exact same lock holds for `543` (`321`/`367`), `554, 555` (`273`), and `566, 567` (`289`). + +3. **The Grassmann `6 + 6 - 4 = 8` and `5 + 5 - 3 = 7` Fork-and-Uncompute Lock on the 12 Three-Gate Cold Helpers (`500, 501, 512, 513` at $\dim 8$ and `572..575, 580..583` at $\dim 7$, $k = 1$ gate):** + - Each of these 12 cold helpers $h$ has 1 gate in `A` ($p \mathrel{-}= h$) and 3 post-`A` gates: `B[idx_fold]: h += p` ($\dim 3$), `B[idx_c1]: c_1 += h` ($\dim 6$ or $5$), and `restore[idx_rest]: h -= p` ($\dim 8$ or $7$), while partner $p$ feeds a second consumer `B[idx_c2]: c_2 += p` ($\dim 6$ or $5$). + - **Why `restore: h -= p` is locked at $\dim 8$ (for `500..513`) and $\dim 7$ (for `572..583`):** At `restore: h -= p`, the gate frame must contain $\text{join}(\text{lo}[c_1], \text{lo}[c_2])$. By Grassmann's identity $\dim(U_1 + U_2) = \dim(U_1) + \dim(U_2) - \dim(U_1 \cap U_2)$: + - For `500, 501` ($p = 310, 308$ at $E_{102}$) and `512, 513` ($p = 326, 324$ at $E_{75}$), $\dim(\text{lo}[c_1]) = 6$, $\dim(\text{lo}[c_2]) = 6$, and $\dim(\text{lo}[c_1] \cap \text{lo}[c_2]) = 4$, forcing $\dim(\text{join}(\text{lo}[c_1], \text{lo}[c_2])) = 6 + 6 - 4 = 8$. + - For `572..575, 580..583` ($p = 408, 105, 412, 414, 424, 44, 428, 430$), $\dim(\text{lo}[c_1]) = 5$, $\dim(\text{lo}[c_2]) = 5$, and $\dim(\text{lo}[c_1] \cap \text{lo}[c_2]) = 3$, forcing $\dim(\text{join}(\text{lo}[c_1], \text{lo}[c_2])) = 5 + 5 - 3 = 7$. + - **Why free-algebra splitting (`c_1 += h` at $\dim 3$ + `c_1 += p` at $\dim 6/5$) fails causally (`26` DAG violations per helper):** Consumer $c_1$ is warped by `B_WARP` immediately before `B[idx_c1]` (with pre-warp `hi_dim = 2`), and consumer $c_2$ executes chronologically *before* $c_1$ (`B[825..828]` before `B[835..844]`; `B[853..864]` before `B[885..896]`), so $h$ cannot be discharged into $c_1$ before $c_1$'s `B_WARP` nor uncomputed against $p$ before $p$ climbs to $\text{lo}[c_2]$. + +--- + +## 4. Relaxation Cap (`certificates/RELAX-CAP.json`) & Literal $T=74$ Allocation (`T74_optimal_idle39`) + +- **Fixed-Capacity Relaxation Cap (`tools/relax_exact.py`, `check_cap.py`):** + The exact same 10-pattern optimal LP basis over all 2,551 count-vector patterns remains primal feasible and dual optimal for the shifted width inventory `{4:26, 5:2, 6:18, 7:50, 8:99, 9:213}` and local profile `{1:2433, 2:724, 3:228, 4:102, 5:20, 8:8}`: + - Per-replica basis counts (`certificates/RELAX-CAP.json`): `8:[8]` $\times 672$, `32:[7,8,8,9]` $\times 61/4$, `32:[4,9,9,9]` $\times 234$ (`idle=1`), `48:[9,9,9,9,9]` $\times 1323/20$ (`idle=3`), `32:[9,9,9]` $\times 75/4$ (`idle=5`), `32:[6,8,9,9]` $\times 162$, `32:[5,9,9,9]` $\times 18$, `16:[8,8]` $\times 53/4$, `16:[7,9]` $\times 1739/4$, and `48:[]` $\times 7637/20$ (`idle=48`). + - Shifting two roles per call from width $7 \to 6$ (`+18` bins of `32:[6,8,9,9]` per replica) eliminates $9/10$ of an `idle=3` bin and $9/2$ of an `idle=5` bin per replica while freeing $+9/10$ of a completely empty `48:[]` (`idle=48`) bin per replica (`+66.6` empty `cap=48` bins across $T=74$), raising the exact relaxation cap to: + $$\kappa_{\text{cap}} \in \left[\frac{17297774946785970118869}{10^{25}},\; \frac{1729777494678597011887}{10^{24}}\right] = [0.0017297774946785970118869,\; 0.0017297774946785970118870].$$ +- **Literal $T=74$ Realization (`allocation/FILL.json.gz`, `T74_optimal_idle39`):** + - Because `width(586)` and `width(588)` shrink from $7 \to 6$ (`allocation/PROVIDERS.json` indices `356` and `358`), naive in-place compaction without repacking `FILL.json.gz` would open 1-unit idle holes inside 1,332 zero-idle bins (`16:[7,9]` and `32:[7,7,9,9]`). + - Applying the LP basis shift on the $T=37$ chronological Hall-marriage window structure (converting 1 early `32:[7,7,9,9]` bin and 88 early `16:[7,9]` bins with `hi <= 44` to `32:[6,8,9,9]` and `16:[8,8]` to satisfy Hall's condition on the 45 early calls $t \in [0, 44]$, while converting 420 late `16:[8,8]` bins to `16:[7,9]` and adding $+666$ `32:[6,8,9,9]` bins per 37 replicas) and consolidating the two $T=37$ remainder bins across the two halves of $T=74$ yields `allocation/FILL.json.gz` (`271,728` role rows, `SHA256 = 68b8bae90144248774b1920cd27f9519caa3dc427704d8a9da6d4c491d912fc4`): + - **Literal $T=74$ idle histogram:** `{1: 17314, 3: 4893, 5: 1390, 39: 1, 48: 28256}` (`+66` completely empty `48:[]` bins, `-63` `idle=3` bins, and `-338` `idle=5` bins vs PR #2979 / PR #3042). + - **Complete $T=74$ paid profile (`allocation/PROFILE.json`):** `{1: 1637692, 2: 482184, 3: 156741, 4: 67932, 5: 14710, 8: 5328, 39: 1, 48: 28256}` (rank mass $74 \times 65,088 = 4,816,512$). + - **Certified literal $T=74$ root (`tools/root.py`):** **`κ in [0.0017297760894051203342384, 0.0017297760894051203342385]`** (headline `0.001729776089405120334238 - 10^-46 - 10^-70`). + +--- + +## 5. Verification & Replay + +1. **Bounded Registered Check (`run_registered.py`, Python 3.12 stdlib, ~55s):** + - `verify_manifest.py` / `MANIFEST.json`: verifies exact SHA256 pins for all 155 files in the package. + - `verify.py`: rebuilds all stage-1, stage-2, stage-3 (`data/WORD-{base,extra}.json.gz`), and stage-4 (`edits/FINAL-WORD-{base,extra}.json.gz`) words from `data/PARENT-{base,extra}.json.gz` and the declared records; runs `vendor/audit_local.py` (`PASS_INDEPENDENT_EXACT_BORROWING_WORD`, forward and dual across all 632 inputs, 91 restored endpoints and buffers) and `vendor/preload_move.py` (`frame_report`) on every stage word; and rejects **100 semantic tamper controls** (`{'stage1': 20, 'stage2': 52, 'stage3': 14, 'stage4': 14}`). + - `edits/edits_review.py`: independently applies `edits/declared_edits.py` (`R1_E42`, `R2_E7`, `B_586_438`, `B_588_440`), runs `vendor/audit_local.py` forward and dual over all 632 inputs on both parent and candidate words, and rejects **21 semantic tamper controls per word** (`PASS_INDEPENDENT_EDIT_REVIEW {'base': 21, 'extra': 21}`). + - `check_allocation.py`: runs the vendored PR #2839 owner engine (`allocation/vendor/independent_owners.py`) on `allocation/FILL.json.gz` (`271,728` roles, six width classes `{4:26, 5:2, 6:18, 7:50, 8:99, 9:213}`, 91-buffer physical stock `66,813`), rejects 5 owner controls, and verifies strict moment improvement over PR #2969 (`PASS_RANK7_LITERAL_OWNERS_AND_EXACT_MOMENT`). + - `check_cap.py`: verifies Fractions-only relaxation cap certificates (`certificates/RELAX-CAP.json` and `certificates/RELAX-STAGES.json`), the literal gap `1.4053e-9`, 5 cap controls, and exact gains over PR #2979, PR #2969, PR #2966, PR #2957, and PR #2942 (`PASS_LITERAL_ALLOCATION_BELOW_FIXED_INVENTORY_CAP_WITH_RECORDED_GAP`). + - Cryptographic binding of all stored receipts in `evidence/` (`OVERLAY-DERIVATION.json`, `EDITS-DERIVATION.json`, `EDITS-REVIEW.json`, `ADAPTER-DERIVATION.json`, `FULL-NATIVE-RECEIPT.json`, `ADMISSION-RESULT.json`, `RELEASE-RECEIPT.json`, `FULL-REPLAY-RESULT.json`) to the exact words, allocation, and `CLAIM.json`. +2. **Complete Cold/Retained Replay (`reproduce.py` & `verify_release.py`):** + ```sh + python3.12 -B scripts/research_package.py --package research/rank7-coupled-586-588-carrier-fold + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 \ + python3.12 -B research/rank7-coupled-586-588-carrier-fold/reproduce.py --repo . --work /tmp/rank7-coupled-replay --jobs 2 + ``` + +--- + +## Base Package Lineage Summary (PR #2979, `mdumitrean`) + +This package retains PR #2979's three-stage producer chain (`data/PARENT-{base,extra}.json.gz` $\to$ `data/WORD-{base,extra}.json.gz`) unchanged before applying Stage 4 (`edits/EDITS.json` $\to$ `edits/FINAL-WORD-{base,extra}.json.gz`): +- **Stage 1 (`data/STAGE1-FRAME-EDITS.json`):** Joint codimension-2 end-frame lowering of 22 restored helpers in five shared rank-7 groups (`V45`: `249, 251, 265, 267`; `A`: `331, 450, 451, 508, 509`; `B`: `299, 448, 449, 484, 485`; `C`: `452, 453, 532, 533`; `D`: `454, 455, 556, 557`; 139 gate frame edits, margin `+142,394` units; single-lowering negative controls verified in `verify.py` and independently in open PR #3112). +- **Stage 2 (`data/TRANSFORM-{226,228,230,363,395}.json`):** Five rank-8 paired extractions at normal 42 (`226, 228, 230`) and normal 7 (`363, 395`), raising the buffer count from 86 to 91 (margin `+66,903` units). +- **Stage 3 (`data/REWRITES-2957.json`):** Jeremy Kothe's fourteen PR #2957 rewrites re-addressed with exact preimages (`vendor/declared_rewrites.py`, margin `+52,350` units). + +--- + +## Open next questions + +1. **Closing the `1.4053e-9` integer-rounding gap at $T=740$ ($20 \mid T$):** + The optimal LP basis in `certificates/RELAX-CAP.json` has per-replica counts with denominators $4$ and $20$ (`idle_per_replica = {1: 234, 3: 1323/20, 5: 75/4, 48: 7637/20}`), which become exact integers whenever $20 \mid T$. Composing the `{4:26, 5:2, 6:18, 7:50, 8:99, 9:213}` words with a $T=740$ chronological flow allocation (as PR #3024, #3030, #3051, #3054, #3103, #3115 did for the `{6:16, 7:52}` inventory) should close the remaining `1.4053e-9` integer gap and reach `RELAX-CAP in [0.0017297774946785970118869, 0.0017297774946785970118870]`. +2. **Unlocking the Double Cone Lock on `584` and `590` via joint `B_WARP` re-synthesis:** + In the free operator algebra, entering helpers `584` and `590` can be completely eliminated (`0` gates in `A+B+restore` across all 632 forward and dual inputs), but post-warp cold helpers `273` and `289` (`B_WARP[541, 545]`) pin right consumers `115` and `130` to $W_{\text{right}} = E_{51} \cap E_{67} \cap E_{112}$ ($\dim 7$) while entering helpers `554` and `566` pin left consumers `168` and `214` to $U_{6,\text{left}} \subseteq E_{51} \cap E_{82} \cap E_{97}$ ($\dim 6$). Jointly re-synthesizing `B_WARP[541, 545]` on `273, 289` and the `554, 566` consumer cone is required to align the two 7D cones inside $E_{51}$. +3. **Composing with native-tariff contractions (PR #3056, #3060, #3076):** + Re-addressing the commuting `A`/`restore`/`cleanup` native-tariff contractions from PR #3056, #3060, and #3076 on top of `edits/FINAL-WORD-{base,extra}.json.gz` can lower the native primitive operation count while preserving the `{1:2433, 2:724, 3:228, 4:102, 5:20, 8:8}` paid profile and `{4:26, 5:2, 6:18, 7:50, 8:99, 9:213}` width inventory. + +--- + +## Credit + +- **PR #2979 (`mdumitrean`, Marius-Paul Dumitrean)**: the base words, Stage 1–3 producer, rank-7 overlay, cap machinery, and checkers. +- **PR #3015 (`jeremykothe2`, Jeremy Kothe)**: the declared literal edit stage (`edits/`, `tools/build_edits.py`, `edits/edits_review.py`) and edit `R1` (`63` via carrier `61`). +- **PR #3042 (`dcharb78`, with AI assistance)**: the six restore carrier/pivot skips (`R1_E42`, `R2_E7`) on PR #2979's words that serve as the direct starting words for `B_586_438` and `B_588_440`. +- **Inherited lineage**: Jeremy Diviney (PR #2908), Mason Hale (PR #2917), Jeremy Kothe (PR #2966 / #2957 / #2948 / #2894 / #2833), Dugongue (PR #2969 / #2863 / #2839), Marius-Paul Dumitrean (PR #2942 / #2930 / #2843), RossRichardson (PR #2918), Yiyang Lu (PR #2857 / #2848), philippeVV (PR #2853), Gareth Davidson (PR #1995 / #2013), Tekalign (`independent_owners.py`), icekylinx (`audit_local.py`), and themilkman216. +- **New here (`dcharb78`, with substantial AI assistance)**: the coupled `B + restore` dying-helper carrier folds (`B_586_438` and `B_588_440`) and `helper_final` lowerings on `586` and `588`, the single-move negative controls and 91-helper causal exhaustion proofs, the repacked `T74_optimal_idle39` allocation (`allocation/FILL.json.gz`), the 21-control per-word edit review and 100-control four-stage replay, and the complete fresh-native admission and release receipts. Apache-2.0. diff --git a/research/rank7-coupled-586-588-carrier-fold/RELEASE.json b/research/rank7-coupled-586-588-carrier-fold/RELEASE.json new file mode 100644 index 0000000000..dc955ae274 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/RELEASE.json @@ -0,0 +1,15 @@ +{ + "package_dir": "research/rank7-coupled-586-588-carrier-fold", + "base": "origin/main", + "title_suffix": "coupled B+restore carrier folds lowering helpers 586 & 588 to rank 7 (width 6) with literal T74 allocation", + "summary": "Built directly and solely on archived base PR #2979 (mdumitrean), PR #3015 (jeremykothe2), and PR #3042 (dcharb78; six restore skips R1_E42 26 -> 33 gates for {22, 40, 54, 63} and R2_E7 13 -> 15 gates for {5, 73}), this package introduces two coupled B+restore dying-helper carrier folds (B_586_438 and B_588_440, 6 hunks / 6 -> 5 gates each) that fold dying helpers 438 and 440 into source-port carriers 75 and 84 along 5-step subspace towers and lower helper_final[586] to V_{30,76,82} and helper_final[588] to V_{30,97,127} (dim 8 -> 7, width 7 -> 6, shifting the width inventory from {4:26, 5:2, 6:16, 7:52, 8:99, 9:213} to {4:26, 5:2, 6:18, 7:50, 8:99, 9:213} with +665 net profit per helper = +1,330 joint), paired with a repacked literal T74 allocation (T74_optimal_idle39, κ = 0.001729776089405120334238 - 10^-46 - 10^-70, RELAX-CAP in [0.0017297774946785970118869, 0.0017297774946785970118870]). The official selected conditional result remains κ = 0.001672660197076918 (#1094).", + "credits": "PR2979 (mdumitrean, Marius-Paul Dumitrean): the base words, the rank-7 overlay, the cap machinery and the checkers. PR3015 (Jeremy Kothe, jeremykothe2): the declared literal edit stage (edits/, tools/build_edits.py, edits/edits_review.py) and edit R1. PR3042 (dcharb78): the six restore carrier/pivot skips (R1_E42, R2_E7) on PR2979's words. PR2969 (Dugongue); PR2966 / PR2957 / PR2948 (Jeremy Kothe, jeremykothe2); PR2942 and PR2930 (mdumitrean); PR2917 (mason-hale); PR2908 (jeremydiviney); PR2894 (Jeremy Kothe); PR2863 (Dugongue); PR2857 / PR2848 (Lyy-iiis); PR2853 (philippeVV); PR2843 (mdumitrean); PR2839 / PR2827 / PR2824 (Dugongue); PR2833 (Jeremy Kothe) and the inherited lineage. Ours (dcharb78, with AI assistance): the coupled carrier-fold edits B_586_438 and B_588_440 lowering helpers 586 and 588 to rank 7 (width 6), the T74_optimal_idle39 allocation, and re-derived certificates and receipts.", + "required": [ + "verify_release.py", + "verify_manifest.py", + "CLAIM.json", + "reproduce.py", + "run_registered.py", + "MANIFEST.json" + ] +} diff --git a/research/rank7-coupled-586-588-carrier-fold/SOURCES.json b/research/rank7-coupled-586-588-carrier-fold/SOURCES.json new file mode 100644 index 0000000000..240b529b66 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/SOURCES.json @@ -0,0 +1,416 @@ +{ + "schema_version": 1, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "upstream_repository": "https://github.com/CrocSwap/integer-mult-bounds", + "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-restore-carrier-skips/CLAIM.json", + "usage": "provenance", + "git_blob": "47a55a7f68efc1d5babec487d09a1f45f95c3221", + "sha256": "adb2efbaa7c16bf66aede2ac739e445e6fa974d5defbff8b70324f4f10632aa3" + }, + { + "path": "research/rank7-restore-carrier-skips/edits/FINAL-WORD-base.json.gz", + "usage": "provenance", + "git_blob": "2ee02e318c98281a71445b954feccd55c153827c", + "sha256": "7e98f6f2a6c9ce9e7e04b515bd8ce4a4a533ff05f01ea265be2a1a994695260e" + }, + { + "path": "research/rank7-restore-carrier-skips/edits/FINAL-WORD-extra.json.gz", + "usage": "provenance", + "git_blob": "33ba5f34996a31edd197cb58eca575645575e529", + "sha256": "1396410de482883416fc7f534062ab005b484056b035fdcfa3b5cc065536ba35" + } + ], + "retained_sources": [ + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "author": "Marius-Paul Dumitrean (mdumitrean)", + "upstream_path": "research/paired-extension-normal45/data/WORD-base.json.gz", + "package_path": "data/PARENT-base.json.gz", + "git_blob": "1ca8287d6ae5eb45d87db65b369be8d09ba692b2", + "sha256": "54ca34c749e3228d7e2df3d8dbf7aa1568c2872490166997c5962f12fd03da35", + "bytes": 70380, + "role": "PR2942 final base provider word (86 restored endpoints): the parent of the three stages" + }, + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "author": "Marius-Paul Dumitrean (mdumitrean)", + "upstream_path": "research/paired-extension-normal45/data/WORD-extra.json.gz", + "package_path": "data/PARENT-extra.json.gz", + "git_blob": "c39913ce24cbce4c841eabcc9b1e5a18e4ccc754", + "sha256": "eded756dfe8f411c3d1f80a3ac16516f0ea5dd6f9866728b2179b157630fa7b6", + "bytes": 70378, + "role": "PR2942 final extra provider word: the parent of the three stages" + }, + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "author": "Marius-Paul Dumitrean (mdumitrean)", + "upstream_path": "research/paired-extension-normal45/CLAIM.json", + "package_path": "comparators/PR2942-CLAIM.json", + "git_blob": "53d9edee7e8355f7e5dd5b0094462330da907846", + "sha256": "011aaac80ad79f7f29dc429a672441bb6b3c21a68bbcb34c7a0d5f943c3c3c2e", + "bytes": 2677, + "role": "PR2942 headline (comparison)" + }, + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "author": "Marius-Paul Dumitrean (mdumitrean)", + "upstream_path": "research/paired-extension-normal45/tools/wordedit.py", + "package_path": "tools/wordedit.py", + "git_blob": "e5893496cd6345cd91ecf3c1dd23a645ec5e0b0a", + "sha256": "cae8ae0f5d7fb3387ec6922fe966068aae05e3a6d3586830d4361b650cfb3617", + "bytes": 6707, + "role": "pure overlay word-edit producer (our r13 chain tool as shipped by PR2942)" + }, + { + "pr": 2917, + "head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "author": "Mason Hale (mason-hale)", + "upstream_path": "research/paired-helper-extension/structure.py", + "package_path": "structure.py", + "git_blob": "8d5bd544ee7cad4309edad3d2a256bf48b810f90", + "sha256": "83f63b6d9a1a543ecfa2c98d479dbe4e7a1c3caf6fd1c3566123308efbc32e96", + "bytes": 2565, + "role": "Jeremy Diviney's PR2908 exact two-sided certificate checker, unchanged by PR2917" + }, + { + "pr": 2917, + "head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "author": "Mason Hale (mason-hale)", + "upstream_path": "research/paired-helper-extension/vendor/audit_local.py", + "package_path": "vendor/audit_local.py", + "git_blob": "8224873d0497cf0b4c202f31b145fa273553d978", + "sha256": "a38940094f7d19cd6376aafdd4734fa68eabc9aff4c98c3c4a3e9540328b1c90", + "bytes": 29363, + "role": "PR2833's independent exact auditor (icekylinx attribution) as vendored by PR2917" + }, + { + "pr": 2917, + "head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "author": "Mason Hale (mason-hale)", + "upstream_path": "research/paired-helper-extension/vendor/preload_move.py", + "package_path": "vendor/preload_move.py", + "git_blob": "55b435035bbc439a9d55e8abd125993208cef8d9", + "sha256": "c8fda4674644fcd5cbf39b6645ce148a21daa90a998b678cbe51f970b78b0044", + "bytes": 7243, + "role": "Jeremy Kothe's PR2894 frame accounting (frame_report) and inverse-reverse cleanup" + }, + { + "pr": 2917, + "head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "author": "Mason Hale (mason-hale)", + "upstream_path": "research/paired-helper-extension/allocation/ORDER.json", + "package_path": "allocation/ORDER.json", + "git_blob": "7409c4df1092241729739596c7648bda504e6aad", + "sha256": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1", + "bytes": 4573, + "role": "PR2917 T74 call order (unchanged chronology)" + }, + { + "pr": 2917, + "head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "author": "Mason Hale (mason-hale)", + "upstream_path": "research/paired-helper-extension/allocation/DISPATCH.json", + "package_path": "allocation/DISPATCH.json", + "git_blob": "9544fee4e6ee1f202cee22bfaeaf229ee3b2515e", + "sha256": "65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c", + "bytes": 10401, + "role": "PR2917 provider dispatch (unchanged)" + }, + { + "pr": 2917, + "head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "author": "Mason Hale (mason-hale)", + "upstream_path": "research/paired-helper-extension/allocation/vendor/independent_owners.py", + "package_path": "allocation/vendor/independent_owners.py", + "git_blob": "16013201b19054f7e45398ecf10af74c9c6a9114", + "sha256": "77a848729159e271ba64f403dfd59dddb13044b17b2950fa56700f442e2fe461", + "bytes": 10057, + "role": "independent owner/chronology engine (Tekalign; PR2839 lineage)" + }, + { + "pr": 2917, + "head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "author": "Mason Hale (mason-hale)", + "upstream_path": "research/paired-helper-extension/allocation/vendor/PLAN.json.gz", + "package_path": "allocation/vendor/PLAN.json.gz", + "git_blob": "7a1db55a4d53ee99280be4f3ab7d29f7b2033adf", + "sha256": "d566cfb87b71639d4138e1f89b543e2dd6a7772070226a2a14c799a6835bf21e", + "bytes": 29933, + "role": "parent plan for the owner engine" + }, + { + "pr": 2917, + "head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "author": "Mason Hale (mason-hale)", + "upstream_path": "research/paired-helper-extension/allocation/vendor/TEMPLATE.json.gz", + "package_path": "allocation/vendor/TEMPLATE.json.gz", + "git_blob": "114808c32b1799da53524bdc25cea67efb60009e", + "sha256": "21297b20f1f2dc76eb9dd8124416068c3cb096bab9df17fa4da19bc68dfe082e", + "bytes": 1124331, + "role": "owner template for the owner engine" + }, + { + "pr": 2957, + "head": "b74b25f3ccc84c16e1a801d73b2f47e5ea764c78", + "author": "Jeremy Kothe (jeremykothe2)", + "upstream_path": "research/paired-extension-cap-fill-swaps/rewrite/declared_rewrites.py", + "package_path": "vendor/declared_rewrites.py", + "git_blob": "964fb2a9c773d60b2ac079f2a4b669d13cf56034", + "sha256": "2509f1335e47543f8814b42d6bf83032b30c5899b4f7cc62a6adc03f5138ae13", + "bytes": 4257, + "role": "Jeremy Kothe's pure applier of the fourteen declared rewrites (stage 3), called with check_declared=False" + }, + { + "pr": 2957, + "head": "b74b25f3ccc84c16e1a801d73b2f47e5ea764c78", + "author": "Jeremy Kothe (jeremykothe2)", + "upstream_path": "research/paired-extension-cap-fill-swaps/CLAIM.json", + "package_path": "comparators/PR2957-CLAIM.json", + "git_blob": "cff1a70ed800d732e39f9b9b968f81662930d8e6", + "sha256": "a93e6c9e94bc9bf5664b5e23506dda9647fad1930e1eede66d5ba9f3718b598a", + "bytes": 1739, + "role": "PR2957 headline (comparison)" + }, + { + "pr": 2966, + "head": "e62d3eb9005117d82a9babcfa937ecc53237c490", + "author": "Jeremy Kothe (jeremykothe2)", + "upstream_path": "research/paired-extension-normal45-rewrites/CLAIM.json", + "package_path": "comparators/PR2966-CLAIM.json", + "git_blob": "8f1ad730dde7535d93f6185c79e288bb9976b00d", + "sha256": "4d4c4800bf3bcb36d09021313b2712aebd4aa0830c74dda30991daf6851c220a", + "bytes": 3172, + "role": "PR2966 headline (comparison; PR2957 rewrites on PR2942 words)" + }, + { + "pr": 2969, + "head": "e2ca469b08385d3d5e29a918d66dbefaf889e9f3", + "author": "Dugongue", + "upstream_path": "research/paired-swap-normal45/CLAIM.json", + "package_path": "allocation/baseline/CLAIM.json", + "git_blob": "beee83c9261522029d99fb486befecaf5a42fd1c", + "sha256": "656a4c93411b078753783513e2e71b1722a56e7b70120264a38118811982fa77", + "bytes": 2316, + "role": "PR2969 headline nomination (comparator of the admission and moment baseline)" + }, + { + "pr": 2969, + "head": "e2ca469b08385d3d5e29a918d66dbefaf889e9f3", + "author": "Dugongue", + "upstream_path": "research/paired-swap-normal45/allocation/ORDER.json", + "package_path": "allocation/baseline/ORDER.json", + "git_blob": "b1629ba9819396197b529717ef21be9056edfe41", + "sha256": "d559a1dcb83707724afc0310f6ef8e3a36ad6cda0a895ca6abae9d6f39a0fc76", + "bytes": 25652, + "role": "PR2969 T370 order (baseline for the moment auditor)" + }, + { + "pr": 2969, + "head": "e2ca469b08385d3d5e29a918d66dbefaf889e9f3", + "author": "Dugongue", + "upstream_path": "research/paired-swap-normal45/allocation/PROFILE.json", + "package_path": "allocation/baseline/PROFILE.json", + "git_blob": "52d24cfc6ab68ddfa52a2721f512bc84da7c8ef5", + "sha256": "6de8ac1fd628cdd2afa5a43872da69c7dab9d7219bdc318f9db55fd8ccdb5eb2", + "bytes": 110, + "role": "PR2969 complete paid profile (baseline for the moment auditor)" + }, + { + "pr": 2930, + "head": "81f3b5d12977eba09e06fbff729167d59faabe90", + "author": "Marius-Paul Dumitrean (mdumitrean)", + "upstream_path": "research/paired-extension-cap-fill/tools/relax.py", + "package_path": "tools/relax.py", + "git_blob": "97dfe35c434283ca6e83818e61aed65740522f50", + "sha256": "0fed1c56b50a2e6d44deeeb6db0f1c7e1f71b86d1747130e1a9202216249a728", + "bytes": 17680, + "role": "exact fixed-capacity relaxation (r12 lineage, as shipped by PR2930)" + }, + { + "pr": 2930, + "head": "81f3b5d12977eba09e06fbff729167d59faabe90", + "author": "Marius-Paul Dumitrean (mdumitrean)", + "upstream_path": "research/paired-extension-cap-fill/tools/relax_exact.py", + "package_path": "tools/relax_exact.py", + "git_blob": "0be97756bb9d8b072c962c147d4b4d3b3122f884", + "sha256": "baf1855d6095c951a90d19a0d8094bd33290519940b732e2b758c5647830f044", + "bytes": 5397, + "role": "Fractions-only basis verification" + }, + { + "pr": 2930, + "head": "81f3b5d12977eba09e06fbff729167d59faabe90", + "author": "Marius-Paul Dumitrean (mdumitrean)", + "upstream_path": "research/paired-extension-cap-fill/tools/root.py", + "package_path": "tools/root.py", + "git_blob": "bd6dc2eb4e5013625d17cc08461b67622bcfed69", + "sha256": "55f5aca39b5ee2fe4687ac8863e6c24569010f27a332883c069b8e14b8fe09e3", + "bytes": 10888, + "role": "exact complete-profile root bracket" + } + ], + "adapted_sources": [ + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "upstream_path": "research/paired-extension-normal45/producer.py", + "package_path": "producer.py", + "change": "three declared stages: frame-only joint rank-7 end-frame lowering of 22 restored helpers (new), five paired steps by PR2917/PR2942's composition rule with per-step declared frame changes, and PR2957's vendored applier for the fourteen re-addressed rewrites; report and cleanup re-derived and compared" + }, + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "upstream_path": "research/paired-extension-normal45/verify.py", + "package_path": "verify.py", + "change": "all stage words replayed and audited; stage-1 validity checks; structure certificates for the five steps; 86 semantic controls across the three stages; price table as evidence" + }, + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "upstream_path": "research/paired-extension-normal45/tools/audit_allocation_moment.py", + "package_path": "tools/audit_allocation_moment.py", + "change": "PR2917 moment auditor with the authenticated baseline re-pinned to the PR2969 headline nomination; nothing else" + }, + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "upstream_path": "research/paired-extension-normal45/tools/derive_adapters.py", + "package_path": "tools/derive_adapters.py", + "change": "comparators pr2966 and pr2969 added; the admission control count (119 for five width classes) derived from the provider width classes (139 for six)" + }, + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "upstream_path": "research/paired-extension-normal45/tools/build_overlay.py", + "package_path": "tools/build_overlay.py", + "change": "stage rank7-joint-endframes; inherited endpoints retained or lowered to a subspace; warps may move their B positions only; the same guards in the source's rebuild chain" + }, + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "upstream_path": "research/paired-extension-normal45/check_allocation.py", + "package_path": "check_allocation.py", + "change": "new words and allocation, six width classes, 91 buffers, physical 66,813, PR2969 moment baseline" + }, + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "upstream_path": "research/paired-extension-normal45/check_cap.py", + "package_path": "check_cap.py", + "change": "caps of the parent and every stage, 2,551 patterns, literal root below the final cap with the recorded gap, exact gains over four claims" + }, + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "upstream_path": "research/paired-extension-normal45/reproduce.py", + "package_path": "reproduce.py", + "change": "also exports PR2942/PR2957/PR2966/PR2969; appends the rank7-joint-endframes overlay stage; 91-buffer adapters; PR2969 comparator" + }, + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "upstream_path": "research/paired-extension-normal45/run_registered.py", + "package_path": "run_registered.py", + "change": "new statuses, control counts, comparator and receipt bindings" + } + ], + "new_sources": [ + "data/WORD-base.json.gz", + "data/WORD-extra.json.gz", + "data/STAGE1-FRAME-EDITS.json", + "data/TRANSFORM-226.json", + "data/TRANSFORM-228.json", + "data/TRANSFORM-230.json", + "data/TRANSFORM-363.json", + "data/TRANSFORM-395.json", + "data/REWRITES-2957.json (Jeremy Kothe's PR2957 rewrites, re-addressed to the stage-2 word with exact preimages)", + "allocation/FILL.json.gz", + "allocation/PROFILE.json", + "allocation/PROVIDERS.json", + "allocation/SEARCH.json", + "certificates/RELAX-CAP.json", + "certificates/RELAX-STAGES.json", + "construction/" + ], + "upstream_exports": [ + { + "pr": 2969, + "head": "e2ca469b08385d3d5e29a918d66dbefaf889e9f3", + "package": "research/paired-swap-normal45", + "manifest_sha256": "797c55c560dec5b5a657296f49d918fc5db708b7bed3eba046b3358b1666e55b", + "role": "comparator CLAIM.json and moment baseline" + }, + { + "pr": 2966, + "head": "e62d3eb9005117d82a9babcfa937ecc53237c490", + "package": "research/paired-extension-normal45-rewrites", + "manifest_sha256": "9e410c244efb370e20a5f9dc366550e11bcb14ebcecf8f2cb850512e82573914", + "role": "comparator CLAIM.json" + }, + { + "pr": 2957, + "head": "b74b25f3ccc84c16e1a801d73b2f47e5ea764c78", + "package": "research/paired-extension-cap-fill-swaps", + "manifest_sha256": "9cd226a2bf7391e7fbf4a23741bb1934afafbd596aef06f2999a935cd6e44e28", + "role": "rewrite applier and comparator CLAIM.json" + }, + { + "pr": 2942, + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "package": "research/paired-extension-normal45", + "manifest_sha256": "23bd270f440c4c7ad0d106990ae391e1af799a61ef3601d00e27f1824ae8ba69", + "role": "parent words" + }, + { + "pr": 2917, + "head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "package": "research/paired-helper-extension", + "manifest_sha256": "55c46ddf2e3edc87dfe1ba3320947466d36980d457eb37f6cd6fba341dae0192", + "role": "extension stage, overlay spec source words" + }, + { + "pr": 2908, + "head": "51309592971e3b5be935599eed2a95404dc7781e", + "package": "research/two-sided-helper-extraction", + "manifest_sha256": "9dba3fe371602ec023a54e26c0fd66f69eb7a74be86aab89923529083c14b36f", + "role": "paired stage, adapter templates" + }, + { + "pr": 2894, + "head": "18d03c447886895ef9abf888398178e0428533ca", + "package": "research/shared-kernel-packing", + "role": "exported by PR2908 reproduce.py --dry-run" + }, + { + "pr": 2833, + "head": "e9307b48d7d1b690939935ecef0f8e524e6d92f4", + "role": "source materialized and authenticated by PR2894 tools/materialize_source.py" + } + ], + "derived_source": { + "pr2917_manifest_sha256": "98d57c82a1c7318be3c330c3b66897844d57232f0aaeaea88fb4bebd0a1bedf1", + "pr2917_files": 632, + "manifest_sha256": "751b46364742cbb947f7db07c130ff09085b38b52c520d3b47f2dadc1e21ba80", + "files": 637, + "builder": "tools/build_overlay.py (stage rank7-joint-endframes) on PR2917 tools/build_extension.py output" + }, + "source_boundary": "Only this new package is submitted. The parent words are PR2942s, byte-identical; exact frozen ancestor exports remain unchanged. Full replay performs no network fetch." +} diff --git a/research/rank7-coupled-586-588-carrier-fold/TASK.json b/research/rank7-coupled-586-588-carrier-fold/TASK.json new file mode 100644 index 0000000000..94df3d635d --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/TASK.json @@ -0,0 +1,78 @@ +{ + "schema_version": 1, + "task_id": "complex-new-helper-inventory", + "priority_revision": 6, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "original_card": { + "id": "complex-new-helper-inventory", + "question": "Can a new local cost interface change the deficit-to-recursive-cost ratio beyond current packing?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/complex-local-word-ceiling/README.md", + "research/heterogeneous-owner-assembly/README.md", + "certificates/selected-result.json", + "research/selected-k8-unrestricted-ends/README.md" + ], + "methods": [ + "Propose a changed helper inventory and derive an optimistic exact moment.", + "Design a small completed instance and independently verify its endpoint and rank bill." + ], + "acceptance_gate": "A new physically realizable contract outside the frozen catalogue whose per-call profile, screened with ceiling.ceiling(), beats the selected word's packing ceiling; a lower cap does not establish identical circuitry or order attainable optima, and is insufficient to pass the stronger-budget target under this model. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "research/complex-local-word-ceiling/verify.py" + ], + "expected": "PASS_COMPLEX_LOCAL_WORD_CEILING", + "inspect": "Read the selected word's per-call local profile, its packing ceiling and the lever table; run levers.py for the ideal budget of the lever you target.", + "scope": "Positive control and planning budget only; this is not a new construction or full cold replay." + }, + "first_experiment": "Before any synthesis, write the candidate per-call local profile (and centre charge / unpaid coordinates if changed) and screen it with ceiling.ceiling(); reject it if even the ideal ceiling does not beat the selected word's by your stated margin.", + "bottleneck_link": "Packing of the selected word is capped at +0.87% (ceiling model); only a lower local excess spend or a changed coverage law raises the cap.", + "allowed_variations": [ + "Narrow to one changed boundary or helper type with explicit counts.", + "If the coverage law, template or guard changes, derive an applicable fully charged replacement bound instead of applying the incumbent ceiling outside its scope." + ], + "scope_change_triggers": [ + "Mixing only providers already inside the pinned catalogue.", + "Only changing helper terminal subspaces and monotone frames within the fixed scalar word, entrances and cleanup contract already covered by #1995/#2013.", + "Continuing a partial cost improvement while leaving the same unpriced consumer, restoration or central-readout obligation unresolved; refresh the family expansion decision first. Local product-retiming evidence has a narrow scope and is not a ban on changed graphs or contracts." + ], + "overlap_terms": [ + "helper inventory", + "heterogeneous-owner", + "mutable leaver" + ] + }, + "scope_status": "refined", + "actual_scope": "On PR2979's words (Marius-Paul Dumitrean: PR2942 plus joint codimension-2 end-frame lowering of 22 restored helpers to five shared rank-7 subspaces, five further rank-8 paired extractions at normals 42 and 7 with 91 private buffers, and Jeremy Kothe's fourteen PR2957 rewrites), PR3015's declared literal edit stage (Jeremy Kothe), and PR3042's six restore carrier/pivot skips (R1_E42 on restore[162:188], 26 -> 33 gates skipping {22, 40, 54, 63}; R2_E7 on restore[190:203], 13 -> 15 gates skipping {5, 73}): two coupled B+restore dying-helper carrier folds (B_586_438 and B_588_440, 6 hunks / 6 -> 5 gates each) that fold dying helpers 438 and 440 into source registers 75 and 84 (so B loses 2 gates and cleanup gains 2 gates at FULL: 75 += 1/2*438 and 84 -= 440, with restore unchanged except for the frames at [85] and [88]) and lower helper_final[586] to V_{30,76,82} and helper_final[588] to V_{30,97,127} (dim 8 -> 7, width 7 -> 6, shifting the width inventory from {4:26, 5:2, 6:16, 7:52, 8:99, 9:213} to {4:26, 5:2, 6:18, 7:50, 8:99, 9:213}), paired with a repacked literal T74 allocation (T74_optimal_idle39) and complete fresh-native admission and modern outer release.", + "scope_change_reason": "The card asks whether a changed helper inventory or local cost interface beats current packing, and Priority Revision 6 (docs/research/current-priorities.md) requires naming the changed hypothesis before reopening domains bounded by fixed-endpoint optimality results (PR #3065 joint frame optimum and PR #3114 restore-only optimum on PR #3042's words). Coupling a B-phase dying-helper carrier fold on (586, 438) and (588, 440) with Stage-1 helper_final lowering changes the helper endpoint width inventory ({6:16, 7:52} -> {6:18, 7:50}), overcoming the -3,345 Stage-1-only and -973 Stage-2-only negative controls for a +665 per-helper (+1,330 joint) surrogate margin against the rounded guide BE = 2,091,300.", + "bottleneck_link": "Combined with R1_E42 (-8 H1 + 4 H2 = -19,984) and R2_E7 (-4 H1 + 2 H2 = -9,992), the coupled carrier folds B_586_438 (+6 H2 - 2 H3 - 3 H4 + 1 H5 = -2,091,965 vs rounded guide BE = -2,091,300 -> +665 surrogate margin) and B_588_440 (+6 H2 - 2 H3 - 3 H4 + 1 H5 = -2,091,965 vs rounded guide BE = -2,091,300 -> +665 surrogate margin) move the per-call local profile from PR2979's {1:2445, 2:706, 3:232, 4:108, 5:18, 8:8} (and PR3042's {1:2433, 2:712, 3:232, 4:108, 5:18, 8:8}) to {1:2433, 2:724, 3:228, 4:102, 5:20, 8:8} and shift the width inventory to {4:26, 5:2, 6:18, 7:50, 8:99, 9:213} at 91 private buffers. The fixed-capacity relaxation cap rises to [0.0017297774946785970118869, 0.0017297774946785970118870] (+3.95446143e-8 over PR3054's T740 cap) and the certified literal T74 release reaches κ = 0.001729776089405120334238 - 10^-46 - 10^-70 (+3.99230172e-8 above PR3042's T74 root and +3.81393408e-8 above PR3054/PR3115's T740 root).", + "budget_minutes": 300, + "stop_rule": "Freeze the four declared edits (R1_E42, R2_E7, B_586_438, B_588_440) after exact local checks, 21-control per-word tamper review, and 91-helper causal lower-bound exhaustion scan; publish a higher conditional kappa only if both native providers, literal T74 owner geometry, physical stock, prefix and complete outer admission pass strictly above PR2979, PR3042, and PR3054.", + "outcome": "completed", + "evidence": "Checks: run_registered.py (stdlib): package pins; verify.py (PR2979 producer reconstruction of every stage word, stage-1 validity, five structure certificates per provider, stage-3 rewrites, stage-4 declared edits R1_E42, R2_E7, B_586_438, B_588_440, PR2833 auditor forward/dual on every stage word, frame accounting, 100 semantic controls across stages 1-4, price evidence, overlay spec round trip); edits/edits_review.py (pure declared-edit applier for R1_E42, R2_E7, B_586_438, B_588_440, PR2833 auditor forward/dual over all 632 inputs on both edited final words, and 21 semantic tamper controls per word); check_allocation.py (owner engine on T74_optimal_idle39, five controls, physical 66,813, exact moment vs PR2969); check_cap.py (Fractions-only caps of the parent, every stage, and the edited final profile, recorded literal gap 1.4053e-9, exact gains over PR2979/PR2969/PR2966/PR2957/PR2942); stored receipts binding. reproduce.py: exact Git exports of PR2908/PR2917/PR2942/PR2957/PR2966/PR2969 (and through them PR2894/PR2833), authenticated retained cache, PR2917 derived source plus the rank7-joint-endframes stage and the declared-edit-stage (manifest fa3e2d85), 91-buffer adapters, fresh native chains for both providers and complete admission: PASS_REPLICA_ORDER_FILL_DERIVATIVE_COMPLETE_RELEASE and PASS_RELEASE at the claimed kappa.", + "author": "dcharb78 (building on PR #2979 by Marius-Paul Dumitrean, PR #3015 by Jeremy Kothe, and PR #3042 by dcharb78)", + "ai_assistance": "Substantial AI assistance for algebraic carrier/pivot synthesis, coupled B+restore carrier-fold discovery, T74 Hall-marriage repacking, exact computation and verification checks; no independent human review is claimed.", + "open_questions": [ + { + "question": "Can the T=74 integer-rounding gap of 1.4053e-9 below RELAX-CAP be closed by composing the {4:26, 5:2, 6:18, 7:50, 8:99, 9:213} inventory with a T=740 (20 | T) allocation?", + "why_it_matters": "The 10-pattern optimal LP basis in certificates/RELAX-CAP.json has denominators 4 and 20 (idle per replica {1: 234, 3: 1323/20, 5: 75/4, 48: 7637/20}), which become exact integers when 20 | T (such as T=740, as demonstrated for the {6:16, 7:52} inventory in PR #3024, #3030, #3051, #3054, #3103).", + "first_step": "Multiply the per-replica cap basis counts by 740 and solve the chronological flow on the 10-fold T740 call order to reach RELAX-CAP in [0.0017297774946785970118869, 0.0017297774946785970118870].", + "blocked_by": "Requires a T740 chronological flow fill and outer admission run." + }, + { + "question": "Can a multi-helper B-warp retiming unlock the Double Cone Lock on entering quartet sisters 584 and 590?", + "why_it_matters": "In the free operator algebra, 584 and 590 can be completely eliminated (0 gates in A+B+restore across all 632 forward/dual inputs), but post-warp cold helpers 273 and 289 pin right consumers 115 and 130 to W_right = E_51 ∩ E_67 ∩ E_112 (dim 7) while entering helpers 554 and 566 pin left consumers 168 and 214 to U_{6,left} ⊆ E_51 ∩ E_82 ∩ E_97 (dim 6), whose join is E_51 (dim 8).", + "first_step": "Test whether joint re-synthesis of B_WARP[541, 545] on 273, 289 and the 554, 566 consumer cone can align the left and right 7D cones inside E_51.", + "blocked_by": "Requires modifying B_WARP subspace transitions on cold helpers 273 and 289." + }, + { + "question": "Do the native-tariff contractions of PR #3056, #3060, and #3076 compose cleanly on top of the B_586_438 and B_588_440 carrier-folded words?", + "why_it_matters": "PR #3056, #3060, and #3076 reduced native primitive operation counts on PR #3042's words without changing paid subspace frames; composing them with the lowered 586/588 words would simultaneously minimize both the paid moment profile and the native primitive gate count.", + "first_step": "Re-address PR #3060/#3076's commuting A/restore/cleanup contractions on edits/FINAL-WORD-{base,extra}.json.gz and verify with audit_local.py and preload_move.py.", + "blocked_by": "None." + } + ] +} diff --git a/research/rank7-coupled-586-588-carrier-fold/VERIFY.json b/research/rank7-coupled-586-588-carrier-fold/VERIFY.json new file mode 100644 index 0000000000..22897eaea2 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/VERIFY.json @@ -0,0 +1,14 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": ["{python}", "-B", "{package}/run_registered.py"], + "timeout_seconds": 600, + "checks": "Complete package pins and edit pins; producer reconstruction of PR2979's stage-3 words and stage-4 final words from PR2942's words and the declared records (stage 1: joint rank-7 end frames of 22 restored helpers; stage 2: five paired extractions with PR2908/PR2917's exact two-sided structure certificate at every step; stage 3: PR2957's fourteen declared rewrites; stage 4: declared restore skips R1_E42, R2_E7 and coupled B+restore carrier folds B_586_438, B_588_440 lowering helpers 586 and 588 from width 7 to width 6, with 100 semantic controls across stages 1-4); independent review of the four declared edits in edits/EDITS.json (PR2833's auditor forward and dual over all 632 inputs on both edited final words, and 21 semantic tamper controls per word); literal T74 owner geometry of the T74_optimal_idle39 allocation on the edited words with PR2917's vendored PR2839 engine (271,728 roles, six width classes {4:26, 5:2, 6:18, 7:50, 8:99, 9:213}, 91-buffer physical stock 66,813) and five rejection controls; PR2917's exact dyadic moment auditor re-pinned to PR2969's headline (strict gain); Fractions-only fixed-capacity relaxation certificates of the parent, every stage, and the edited final profile (2,551 patterns), the recorded literal gap (1.4053e-9) and exact gains over PR2979, PR2969, PR2966, PR2957 and PR2942; binding of the stored complete overlay/edit/native/admission/release receipts to the exact words, allocation and claim. Native and integrated admission are rerun separately by reproduce.py from exact Git sources." + } + ] +} diff --git a/research/rank7-coupled-586-588-carrier-fold/allocation/DISPATCH.json b/research/rank7-coupled-586-588-carrier-fold/allocation/DISPATCH.json new file mode 100644 index 0000000000..9544fee4e6 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/allocation/DISPATCH.json @@ -0,0 +1 @@ +[[0,0,"extra"],[0,37,"extra"],[0,1,"extra"],[0,38,"extra"],[0,2,"extra"],[0,39,"extra"],[0,3,"extra"],[0,40,"extra"],[0,4,"extra"],[0,41,"extra"],[1,0,"extra"],[1,37,"extra"],[0,5,"extra"],[0,42,"extra"],[1,1,"extra"],[1,38,"extra"],[0,6,"extra"],[0,43,"extra"],[1,2,"extra"],[1,39,"extra"],[0,7,"extra"],[0,44,"extra"],[1,3,"extra"],[1,40,"extra"],[0,8,"extra"],[0,45,"extra"],[1,4,"extra"],[1,41,"extra"],[0,9,"extra"],[0,46,"extra"],[2,0,"extra"],[2,37,"extra"],[1,5,"extra"],[1,42,"extra"],[0,10,"extra"],[0,47,"extra"],[2,1,"extra"],[2,38,"extra"],[1,6,"extra"],[1,43,"extra"],[0,11,"extra"],[0,48,"extra"],[2,2,"extra"],[2,39,"extra"],[1,7,"extra"],[1,44,"extra"],[0,12,"extra"],[0,49,"extra"],[2,3,"extra"],[2,40,"extra"],[1,8,"extra"],[1,45,"extra"],[0,13,"extra"],[0,50,"extra"],[2,4,"extra"],[2,41,"extra"],[1,9,"extra"],[1,46,"extra"],[3,0,"extra"],[3,37,"extra"],[0,14,"extra"],[0,51,"extra"],[2,5,"extra"],[2,42,"extra"],[1,10,"extra"],[1,47,"extra"],[3,1,"extra"],[3,38,"extra"],[0,15,"extra"],[0,52,"extra"],[2,6,"extra"],[2,43,"extra"],[1,11,"extra"],[1,48,"extra"],[3,2,"extra"],[3,39,"extra"],[0,16,"extra"],[0,53,"extra"],[2,7,"extra"],[2,44,"extra"],[1,12,"extra"],[1,49,"extra"],[3,3,"extra"],[3,40,"extra"],[0,17,"extra"],[0,54,"extra"],[2,8,"extra"],[2,45,"extra"],[1,13,"extra"],[1,50,"extra"],[3,4,"extra"],[3,41,"extra"],[0,18,"extra"],[0,55,"extra"],[2,9,"extra"],[2,46,"extra"],[4,0,"extra"],[4,37,"extra"],[1,14,"extra"],[1,51,"extra"],[3,5,"extra"],[3,42,"extra"],[0,19,"extra"],[0,56,"extra"],[2,10,"extra"],[2,47,"extra"],[4,1,"extra"],[4,38,"extra"],[1,15,"extra"],[1,52,"extra"],[3,6,"extra"],[3,43,"extra"],[0,20,"extra"],[0,57,"extra"],[2,11,"extra"],[2,48,"extra"],[4,2,"extra"],[4,39,"extra"],[1,16,"extra"],[1,53,"extra"],[3,7,"extra"],[3,44,"extra"],[0,21,"extra"],[0,58,"extra"],[2,12,"extra"],[2,49,"extra"],[4,3,"extra"],[4,40,"extra"],[1,17,"extra"],[1,54,"extra"],[3,8,"extra"],[3,45,"extra"],[0,22,"extra"],[0,59,"extra"],[2,13,"extra"],[2,50,"extra"],[4,4,"extra"],[4,41,"extra"],[1,18,"extra"],[1,55,"extra"],[3,9,"extra"],[3,46,"extra"],[0,23,"extra"],[0,60,"extra"],[5,0,"extra"],[5,37,"extra"],[2,14,"extra"],[2,51,"extra"],[4,5,"extra"],[4,42,"extra"],[1,19,"extra"],[1,56,"extra"],[3,10,"extra"],[3,47,"extra"],[0,24,"extra"],[0,61,"extra"],[5,1,"extra"],[5,38,"extra"],[2,15,"extra"],[2,52,"extra"],[4,6,"extra"],[4,43,"extra"],[1,20,"extra"],[1,57,"extra"],[3,11,"extra"],[3,48,"extra"],[0,25,"extra"],[0,62,"extra"],[5,2,"extra"],[5,39,"extra"],[2,16,"extra"],[2,53,"extra"],[4,7,"extra"],[4,44,"extra"],[1,21,"extra"],[1,58,"extra"],[3,12,"extra"],[3,49,"extra"],[0,26,"extra"],[0,63,"extra"],[5,3,"extra"],[5,40,"extra"],[2,17,"extra"],[2,54,"extra"],[4,8,"extra"],[4,45,"extra"],[1,22,"extra"],[1,59,"extra"],[3,13,"extra"],[3,50,"extra"],[0,27,"extra"],[0,64,"extra"],[5,4,"extra"],[5,41,"extra"],[2,18,"extra"],[2,55,"extra"],[4,9,"extra"],[4,46,"extra"],[1,23,"extra"],[1,60,"extra"],[6,0,"extra"],[6,37,"extra"],[3,14,"extra"],[3,51,"extra"],[0,28,"extra"],[0,65,"extra"],[5,5,"extra"],[5,42,"extra"],[2,19,"extra"],[2,56,"extra"],[4,10,"extra"],[4,47,"extra"],[1,24,"extra"],[1,61,"extra"],[6,1,"extra"],[6,38,"extra"],[3,15,"extra"],[3,52,"extra"],[0,29,"extra"],[0,66,"extra"],[5,6,"extra"],[5,43,"extra"],[2,20,"extra"],[2,57,"extra"],[4,11,"extra"],[4,48,"extra"],[1,25,"extra"],[1,62,"extra"],[6,2,"extra"],[6,39,"extra"],[3,16,"extra"],[3,53,"extra"],[0,30,"extra"],[0,67,"extra"],[5,7,"extra"],[5,44,"extra"],[2,21,"extra"],[2,58,"extra"],[4,12,"extra"],[4,49,"extra"],[1,26,"extra"],[1,63,"extra"],[6,3,"extra"],[6,40,"extra"],[3,17,"extra"],[3,54,"extra"],[0,31,"extra"],[0,68,"extra"],[5,8,"extra"],[5,45,"extra"],[2,22,"extra"],[2,59,"extra"],[4,13,"extra"],[4,50,"extra"],[1,27,"extra"],[1,64,"extra"],[6,4,"extra"],[6,41,"extra"],[3,18,"extra"],[3,55,"extra"],[0,32,"extra"],[0,69,"extra"],[5,9,"extra"],[5,46,"extra"],[2,23,"extra"],[2,60,"extra"],[7,0,"extra"],[7,37,"extra"],[4,14,"extra"],[4,51,"extra"],[1,28,"extra"],[1,65,"extra"],[6,5,"extra"],[6,42,"extra"],[3,19,"extra"],[3,56,"extra"],[0,33,"extra"],[0,70,"extra"],[5,10,"extra"],[5,47,"extra"],[2,24,"extra"],[2,61,"extra"],[7,1,"extra"],[7,38,"extra"],[4,15,"extra"],[4,52,"extra"],[1,29,"extra"],[1,66,"extra"],[6,6,"extra"],[6,43,"extra"],[3,20,"extra"],[3,57,"extra"],[0,34,"extra"],[0,71,"extra"],[5,11,"extra"],[5,48,"extra"],[2,25,"extra"],[2,62,"extra"],[7,2,"extra"],[7,39,"extra"],[4,16,"extra"],[4,53,"extra"],[1,30,"extra"],[1,67,"extra"],[6,7,"extra"],[6,44,"extra"],[3,21,"extra"],[3,58,"extra"],[0,35,"extra"],[0,72,"extra"],[5,12,"extra"],[5,49,"extra"],[2,26,"extra"],[2,63,"extra"],[7,3,"extra"],[7,40,"extra"],[4,17,"extra"],[4,54,"extra"],[1,31,"extra"],[1,68,"extra"],[6,8,"extra"],[6,45,"extra"],[3,22,"extra"],[3,59,"extra"],[0,36,"extra"],[0,73,"extra"],[5,13,"extra"],[5,50,"extra"],[2,27,"extra"],[2,64,"extra"],[7,4,"extra"],[7,41,"extra"],[4,18,"extra"],[4,55,"extra"],[1,32,"extra"],[1,69,"extra"],[6,9,"extra"],[6,46,"extra"],[3,23,"extra"],[3,60,"extra"],[8,0,"extra"],[8,37,"extra"],[5,14,"extra"],[5,51,"extra"],[2,28,"extra"],[2,65,"extra"],[7,5,"extra"],[7,42,"extra"],[4,19,"extra"],[4,56,"extra"],[1,33,"extra"],[1,70,"extra"],[6,10,"extra"],[6,47,"extra"],[3,24,"extra"],[3,61,"extra"],[8,1,"extra"],[8,38,"extra"],[5,15,"extra"],[5,52,"extra"],[2,29,"extra"],[2,66,"extra"],[7,6,"extra"],[7,43,"extra"],[4,20,"extra"],[4,57,"extra"],[1,34,"extra"],[1,71,"extra"],[6,11,"extra"],[6,48,"extra"],[3,25,"extra"],[3,62,"extra"],[8,2,"extra"],[8,39,"extra"],[5,16,"extra"],[5,53,"extra"],[2,30,"extra"],[2,67,"extra"],[7,7,"extra"],[7,44,"extra"],[4,21,"extra"],[4,58,"extra"],[1,35,"extra"],[1,72,"extra"],[6,12,"extra"],[6,49,"extra"],[3,26,"extra"],[3,63,"extra"],[8,3,"extra"],[8,40,"extra"],[5,17,"extra"],[5,54,"extra"],[2,31,"extra"],[2,68,"extra"],[7,8,"extra"],[7,45,"extra"],[4,22,"extra"],[4,59,"extra"],[1,36,"extra"],[1,73,"extra"],[6,13,"extra"],[6,50,"extra"],[3,27,"extra"],[3,64,"extra"],[8,4,"extra"],[8,41,"extra"],[5,18,"extra"],[5,55,"extra"],[2,32,"extra"],[2,69,"extra"],[7,9,"extra"],[7,46,"extra"],[4,23,"extra"],[4,60,"extra"],[6,14,"extra"],[6,51,"extra"],[3,28,"gauge44"],[3,65,"gauge44"],[8,5,"gauge44"],[8,42,"gauge44"],[5,19,"gauge44"],[5,56,"gauge44"],[2,33,"gauge44"],[2,70,"gauge44"],[7,10,"gauge44"],[7,47,"gauge44"],[4,24,"gauge44"],[4,61,"gauge44"],[6,15,"gauge44"],[6,52,"gauge44"],[3,29,"gauge44"],[3,66,"gauge44"],[8,6,"gauge44"],[8,43,"gauge44"],[5,20,"gauge44"],[5,57,"gauge44"],[2,34,"gauge44"],[2,71,"gauge44"],[7,11,"gauge44"],[7,48,"gauge44"],[4,25,"gauge44"],[4,62,"gauge44"],[6,16,"gauge44"],[6,53,"gauge44"],[3,30,"gauge44"],[3,67,"gauge44"],[8,7,"gauge44"],[8,44,"gauge44"],[5,21,"gauge44"],[5,58,"gauge44"],[2,35,"gauge44"],[2,72,"gauge44"],[7,12,"gauge44"],[7,49,"gauge44"],[4,26,"gauge44"],[4,63,"gauge44"],[6,17,"gauge44"],[6,54,"gauge44"],[3,31,"gauge44"],[3,68,"gauge44"],[8,8,"gauge44"],[8,45,"gauge44"],[5,22,"gauge44"],[5,59,"gauge44"],[2,36,"gauge44"],[2,73,"gauge44"],[7,13,"gauge44"],[7,50,"gauge44"],[4,27,"gauge44"],[4,64,"gauge44"],[6,18,"gauge44"],[6,55,"gauge44"],[3,32,"gauge44"],[3,69,"gauge44"],[8,9,"gauge44"],[8,46,"gauge44"],[5,23,"gauge44"],[5,60,"gauge44"],[7,14,"gauge44"],[7,51,"gauge44"],[4,28,"gauge44"],[4,65,"gauge44"],[6,19,"gauge44"],[6,56,"gauge44"],[3,33,"gauge44"],[3,70,"gauge44"],[8,10,"gauge44"],[8,47,"gauge44"],[5,24,"gauge44"],[5,61,"gauge44"],[7,15,"gauge44"],[7,52,"gauge44"],[4,29,"gauge44"],[4,66,"gauge44"],[6,20,"gauge44"],[6,57,"gauge44"],[3,34,"gauge44"],[3,71,"gauge44"],[8,11,"gauge44"],[8,48,"gauge44"],[5,25,"gauge44"],[5,62,"gauge44"],[7,16,"gauge44"],[7,53,"gauge44"],[4,30,"gauge44"],[4,67,"gauge44"],[6,21,"gauge44"],[6,58,"gauge44"],[3,35,"gauge44"],[3,72,"gauge44"],[8,12,"gauge44"],[8,49,"gauge44"],[5,26,"gauge44"],[5,63,"gauge44"],[7,17,"gauge44"],[7,54,"gauge44"],[4,31,"gauge44"],[4,68,"gauge44"],[6,22,"gauge44"],[6,59,"gauge44"],[3,36,"gauge44"],[3,73,"gauge44"],[8,13,"gauge44"],[8,50,"gauge44"],[5,27,"gauge44"],[5,64,"gauge44"],[7,18,"gauge44"],[7,55,"gauge44"],[4,32,"gauge44"],[4,69,"gauge44"],[6,23,"gauge44"],[6,60,"gauge44"],[8,14,"gauge44"],[8,51,"gauge44"],[5,28,"gauge44"],[5,65,"gauge44"],[7,19,"gauge44"],[7,56,"gauge44"],[4,33,"gauge44"],[4,70,"gauge44"],[6,24,"gauge44"],[6,61,"gauge44"],[8,15,"gauge44"],[8,52,"gauge44"],[5,29,"gauge44"],[5,66,"gauge44"],[7,20,"gauge44"],[7,57,"gauge44"],[4,34,"gauge44"],[4,71,"gauge44"],[6,25,"gauge44"],[6,62,"gauge44"],[8,16,"gauge44"],[8,53,"gauge44"],[5,30,"gauge44"],[5,67,"gauge44"],[7,21,"gauge44"],[7,58,"gauge44"],[4,35,"gauge44"],[4,72,"gauge44"],[6,26,"gauge44"],[6,63,"gauge44"],[8,17,"gauge44"],[8,54,"gauge44"],[5,31,"gauge44"],[5,68,"gauge44"],[7,22,"gauge44"],[7,59,"gauge44"],[4,36,"gauge44"],[4,73,"gauge44"],[6,27,"gauge44"],[6,64,"gauge44"],[8,18,"gauge44"],[8,55,"gauge44"],[5,32,"gauge44"],[5,69,"gauge44"],[7,23,"gauge44"],[7,60,"gauge44"],[6,28,"gauge44"],[6,65,"gauge44"],[8,19,"gauge44"],[8,56,"gauge44"],[5,33,"gauge44"],[5,70,"gauge44"],[7,24,"gauge44"],[7,61,"gauge44"],[6,29,"gauge44"],[6,66,"gauge44"],[8,20,"gauge44"],[8,57,"gauge44"],[5,34,"gauge44"],[5,71,"gauge44"],[7,25,"gauge44"],[7,62,"gauge44"],[6,30,"gauge44"],[6,67,"gauge44"],[8,21,"gauge44"],[8,58,"gauge44"],[5,35,"gauge44"],[5,72,"gauge44"],[7,26,"gauge44"],[7,63,"gauge44"],[6,31,"gauge44"],[6,68,"gauge44"],[8,22,"gauge44"],[8,59,"gauge44"],[5,36,"gauge44"],[5,73,"gauge44"],[7,27,"gauge44"],[7,64,"gauge44"],[6,32,"gauge44"],[6,69,"gauge44"],[8,23,"gauge44"],[8,60,"gauge44"],[7,28,"gauge44"],[7,65,"gauge44"],[6,33,"gauge44"],[6,70,"gauge44"],[8,24,"gauge44"],[8,61,"gauge44"],[7,29,"gauge44"],[7,66,"gauge44"],[6,34,"gauge44"],[6,71,"gauge44"],[8,25,"gauge44"],[8,62,"gauge44"],[7,30,"gauge44"],[7,67,"gauge44"],[6,35,"gauge44"],[6,72,"gauge44"],[8,26,"gauge44"],[8,63,"gauge44"],[7,31,"gauge44"],[7,68,"gauge44"],[6,36,"gauge44"],[6,73,"gauge44"],[8,27,"gauge44"],[8,64,"gauge44"],[7,32,"gauge44"],[7,69,"gauge44"],[8,28,"gauge44"],[8,65,"gauge44"],[7,33,"gauge44"],[7,70,"gauge44"],[8,29,"gauge44"],[8,66,"gauge44"],[7,34,"gauge44"],[7,71,"gauge44"],[8,30,"gauge44"],[8,67,"gauge44"],[7,35,"gauge44"],[7,72,"gauge44"],[8,31,"gauge44"],[8,68,"gauge44"],[7,36,"gauge44"],[7,73,"gauge44"],[8,32,"gauge44"],[8,69,"gauge44"],[8,33,"gauge44"],[8,70,"gauge44"],[8,34,"gauge44"],[8,71,"gauge44"],[8,35,"gauge44"],[8,72,"gauge44"],[8,36,"gauge44"],[8,73,"gauge44"]] \ No newline at end of file diff --git a/research/rank7-coupled-586-588-carrier-fold/allocation/FILL.json.gz b/research/rank7-coupled-586-588-carrier-fold/allocation/FILL.json.gz new file mode 100644 index 0000000000..92b49b42b8 Binary files /dev/null and b/research/rank7-coupled-586-588-carrier-fold/allocation/FILL.json.gz differ diff --git a/research/rank7-coupled-586-588-carrier-fold/allocation/ORDER.json b/research/rank7-coupled-586-588-carrier-fold/allocation/ORDER.json new file mode 100644 index 0000000000..7409c4df10 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/allocation/ORDER.json @@ -0,0 +1 @@ +[[0,0],[0,37],[0,1],[0,38],[0,2],[0,39],[0,3],[0,40],[0,4],[0,41],[1,0],[1,37],[0,5],[0,42],[1,1],[1,38],[0,6],[0,43],[1,2],[1,39],[0,7],[0,44],[1,3],[1,40],[0,8],[0,45],[1,4],[1,41],[0,9],[0,46],[2,0],[2,37],[1,5],[1,42],[0,10],[0,47],[2,1],[2,38],[1,6],[1,43],[0,11],[0,48],[2,2],[2,39],[1,7],[1,44],[0,12],[0,49],[2,3],[2,40],[1,8],[1,45],[0,13],[0,50],[2,4],[2,41],[1,9],[1,46],[3,0],[3,37],[0,14],[0,51],[2,5],[2,42],[1,10],[1,47],[3,1],[3,38],[0,15],[0,52],[2,6],[2,43],[1,11],[1,48],[3,2],[3,39],[0,16],[0,53],[2,7],[2,44],[1,12],[1,49],[3,3],[3,40],[0,17],[0,54],[2,8],[2,45],[1,13],[1,50],[3,4],[3,41],[0,18],[0,55],[2,9],[2,46],[4,0],[4,37],[1,14],[1,51],[3,5],[3,42],[0,19],[0,56],[2,10],[2,47],[4,1],[4,38],[1,15],[1,52],[3,6],[3,43],[0,20],[0,57],[2,11],[2,48],[4,2],[4,39],[1,16],[1,53],[3,7],[3,44],[0,21],[0,58],[2,12],[2,49],[4,3],[4,40],[1,17],[1,54],[3,8],[3,45],[0,22],[0,59],[2,13],[2,50],[4,4],[4,41],[1,18],[1,55],[3,9],[3,46],[0,23],[0,60],[5,0],[5,37],[2,14],[2,51],[4,5],[4,42],[1,19],[1,56],[3,10],[3,47],[0,24],[0,61],[5,1],[5,38],[2,15],[2,52],[4,6],[4,43],[1,20],[1,57],[3,11],[3,48],[0,25],[0,62],[5,2],[5,39],[2,16],[2,53],[4,7],[4,44],[1,21],[1,58],[3,12],[3,49],[0,26],[0,63],[5,3],[5,40],[2,17],[2,54],[4,8],[4,45],[1,22],[1,59],[3,13],[3,50],[0,27],[0,64],[5,4],[5,41],[2,18],[2,55],[4,9],[4,46],[1,23],[1,60],[6,0],[6,37],[3,14],[3,51],[0,28],[0,65],[5,5],[5,42],[2,19],[2,56],[4,10],[4,47],[1,24],[1,61],[6,1],[6,38],[3,15],[3,52],[0,29],[0,66],[5,6],[5,43],[2,20],[2,57],[4,11],[4,48],[1,25],[1,62],[6,2],[6,39],[3,16],[3,53],[0,30],[0,67],[5,7],[5,44],[2,21],[2,58],[4,12],[4,49],[1,26],[1,63],[6,3],[6,40],[3,17],[3,54],[0,31],[0,68],[5,8],[5,45],[2,22],[2,59],[4,13],[4,50],[1,27],[1,64],[6,4],[6,41],[3,18],[3,55],[0,32],[0,69],[5,9],[5,46],[2,23],[2,60],[7,0],[7,37],[4,14],[4,51],[1,28],[1,65],[6,5],[6,42],[3,19],[3,56],[0,33],[0,70],[5,10],[5,47],[2,24],[2,61],[7,1],[7,38],[4,15],[4,52],[1,29],[1,66],[6,6],[6,43],[3,20],[3,57],[0,34],[0,71],[5,11],[5,48],[2,25],[2,62],[7,2],[7,39],[4,16],[4,53],[1,30],[1,67],[6,7],[6,44],[3,21],[3,58],[0,35],[0,72],[5,12],[5,49],[2,26],[2,63],[7,3],[7,40],[4,17],[4,54],[1,31],[1,68],[6,8],[6,45],[3,22],[3,59],[0,36],[0,73],[5,13],[5,50],[2,27],[2,64],[7,4],[7,41],[4,18],[4,55],[1,32],[1,69],[6,9],[6,46],[3,23],[3,60],[8,0],[8,37],[5,14],[5,51],[2,28],[2,65],[7,5],[7,42],[4,19],[4,56],[1,33],[1,70],[6,10],[6,47],[3,24],[3,61],[8,1],[8,38],[5,15],[5,52],[2,29],[2,66],[7,6],[7,43],[4,20],[4,57],[1,34],[1,71],[6,11],[6,48],[3,25],[3,62],[8,2],[8,39],[5,16],[5,53],[2,30],[2,67],[7,7],[7,44],[4,21],[4,58],[1,35],[1,72],[6,12],[6,49],[3,26],[3,63],[8,3],[8,40],[5,17],[5,54],[2,31],[2,68],[7,8],[7,45],[4,22],[4,59],[1,36],[1,73],[6,13],[6,50],[3,27],[3,64],[8,4],[8,41],[5,18],[5,55],[2,32],[2,69],[7,9],[7,46],[4,23],[4,60],[6,14],[6,51],[3,28],[3,65],[8,5],[8,42],[5,19],[5,56],[2,33],[2,70],[7,10],[7,47],[4,24],[4,61],[6,15],[6,52],[3,29],[3,66],[8,6],[8,43],[5,20],[5,57],[2,34],[2,71],[7,11],[7,48],[4,25],[4,62],[6,16],[6,53],[3,30],[3,67],[8,7],[8,44],[5,21],[5,58],[2,35],[2,72],[7,12],[7,49],[4,26],[4,63],[6,17],[6,54],[3,31],[3,68],[8,8],[8,45],[5,22],[5,59],[2,36],[2,73],[7,13],[7,50],[4,27],[4,64],[6,18],[6,55],[3,32],[3,69],[8,9],[8,46],[5,23],[5,60],[7,14],[7,51],[4,28],[4,65],[6,19],[6,56],[3,33],[3,70],[8,10],[8,47],[5,24],[5,61],[7,15],[7,52],[4,29],[4,66],[6,20],[6,57],[3,34],[3,71],[8,11],[8,48],[5,25],[5,62],[7,16],[7,53],[4,30],[4,67],[6,21],[6,58],[3,35],[3,72],[8,12],[8,49],[5,26],[5,63],[7,17],[7,54],[4,31],[4,68],[6,22],[6,59],[3,36],[3,73],[8,13],[8,50],[5,27],[5,64],[7,18],[7,55],[4,32],[4,69],[6,23],[6,60],[8,14],[8,51],[5,28],[5,65],[7,19],[7,56],[4,33],[4,70],[6,24],[6,61],[8,15],[8,52],[5,29],[5,66],[7,20],[7,57],[4,34],[4,71],[6,25],[6,62],[8,16],[8,53],[5,30],[5,67],[7,21],[7,58],[4,35],[4,72],[6,26],[6,63],[8,17],[8,54],[5,31],[5,68],[7,22],[7,59],[4,36],[4,73],[6,27],[6,64],[8,18],[8,55],[5,32],[5,69],[7,23],[7,60],[6,28],[6,65],[8,19],[8,56],[5,33],[5,70],[7,24],[7,61],[6,29],[6,66],[8,20],[8,57],[5,34],[5,71],[7,25],[7,62],[6,30],[6,67],[8,21],[8,58],[5,35],[5,72],[7,26],[7,63],[6,31],[6,68],[8,22],[8,59],[5,36],[5,73],[7,27],[7,64],[6,32],[6,69],[8,23],[8,60],[7,28],[7,65],[6,33],[6,70],[8,24],[8,61],[7,29],[7,66],[6,34],[6,71],[8,25],[8,62],[7,30],[7,67],[6,35],[6,72],[8,26],[8,63],[7,31],[7,68],[6,36],[6,73],[8,27],[8,64],[7,32],[7,69],[8,28],[8,65],[7,33],[7,70],[8,29],[8,66],[7,34],[7,71],[8,30],[8,67],[7,35],[7,72],[8,31],[8,68],[7,36],[7,73],[8,32],[8,69],[8,33],[8,70],[8,34],[8,71],[8,35],[8,72],[8,36],[8,73]] \ No newline at end of file diff --git a/research/rank7-coupled-586-588-carrier-fold/allocation/PROFILE.json b/research/rank7-coupled-586-588-carrier-fold/allocation/PROFILE.json new file mode 100644 index 0000000000..c2e88a0d61 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/allocation/PROFILE.json @@ -0,0 +1,10 @@ +{ + "1": 1637692, + "2": 482184, + "3": 156741, + "39": 1, + "4": 67932, + "48": 28256, + "5": 14710, + "8": 5328 +} diff --git a/research/rank7-coupled-586-588-carrier-fold/allocation/PROVIDERS.json b/research/rank7-coupled-586-588-carrier-fold/allocation/PROVIDERS.json new file mode 100644 index 0000000000..0b23436750 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/allocation/PROVIDERS.json @@ -0,0 +1,842 @@ +{ + "extra": { + "actual_paid_profile": { + "1": 2433, + "2": 724, + "3": 228, + "4": 102, + "5": 20, + "8": 8 + }, + "widths": [ + 9, + 9, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 9, + 8, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 8, + 7, + 7, + 7, + 7, + 8, + 9, + 8, + 9, + 6, + 6, + 7, + 7, + 7, + 7, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 6, + 6, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 6, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 7, + 7, + 6, + 6, + 9, + 8, + 9, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 9, + 8, + 9, + 8, + 7, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 7, + 6, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 5, + 5, + 8, + 8, + 8, + 8 + ] + }, + "gauge44": { + "actual_paid_profile": { + "1": 2433, + "2": 724, + "3": 228, + "4": 102, + "5": 20, + "8": 8 + }, + "widths": [ + 9, + 9, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 9, + 8, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 8, + 7, + 7, + 7, + 7, + 8, + 9, + 8, + 9, + 6, + 6, + 7, + 7, + 7, + 7, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 6, + 6, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 6, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 7, + 7, + 6, + 6, + 9, + 8, + 9, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 9, + 8, + 9, + 8, + 7, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 7, + 6, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 5, + 5, + 8, + 8, + 8, + 8 + ] + } +} diff --git a/research/rank7-coupled-586-588-carrier-fold/allocation/SEARCH.json b/research/rank7-coupled-586-588-carrier-fold/allocation/SEARCH.json new file mode 100644 index 0000000000..9c5904c673 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/allocation/SEARCH.json @@ -0,0 +1,48 @@ +{ + "calls": 666, + "catalogue": "all", + "chronology": "pr2917-t74", + "gap_to_relaxation_cap_float": 1.4052734766776483e-09, + "headline": "0.0017297760894051203342379999999999999999999998999999999999999999999999", + "idle_histogram": { + "1": 17314, + "3": 4893, + "39": 1, + "48": 28256, + "5": 1390 + }, + "kappa_root_bracket": [ + "1081110055878200208899/625000000000000000000000", + "3459552178810240668477/2000000000000000000000000" + ], + "kappa_root_lower_decimal": "0.0017297760894051203342384", + "lineage": "PR2917 (mason-hale) chronology/engine; PR2930/PR2942/PR2979 (mdumitrean) fills and rank-7 overlay; PR3015 (jeremykothe2) declared-edit stage; PR3042 (dcharb78) restore carrier/pivot skips; coupled B_586_438 and B_588_440 carrier-fold lowerings (dcharb78).", + "moment_auditor": "PASS_SEPARATE_EXACT_RATIONAL_FRONTIER_MOMENT", + "note": "Coupled B_586_438 and B_588_440 dying-helper carrier folds + R1_E42/R2_E7 restore skips ({4:26, 5:2, 6:18, 7:50, 8:99, 9:213} inventory, {1:2433, 2:724, 3:228, 4:102, 5:20, 8:8} local profile); T74_optimal_idle39 realization obtained by applying the LP basis shift on the T37 Hall-marriage window structure (1 early 32:[7,7,9,9] and 88 early 16:[7,9] bins with hi<=44 converted to 32:[6,8,9,9] and 16:[8,8]; 420 late 16:[8,8] converted to 16:[7,9]; +666 32:[6,8,9,9] bins per 37 replicas) and consolidating the two T37 remainder bins across the two halves of T74 (+66 empty 48:[] bins).", + "order_and_dispatch_unchanged_vs_PR2917": true, + "pattern_mix": "T74_optimal_idle39", + "physical": 66813, + "profile": { + "1": 1637692, + "2": 482184, + "3": 156741, + "39": 1, + "4": 67932, + "48": 28256, + "5": 14710, + "8": 5328 + }, + "relaxation_cap_bracket": [ + "17297774946785970118869/10000000000000000000000000", + "1729777494678597011887/1000000000000000000000000" + ], + "replicas": 74, + "roles": 271728, + "seed": 1, + "solver": "T74_optimal_idle39 (repacked from T37 chronological Hall-window flow + cross-half remainder consolidation)", + "status": "RANK7_COUPLED_586_588_T74_OPTIMAL_IDLE39_FILL", + "words_sha256": { + "base": "300a9b8ad1d554f0e6f84f43f3f5fd870a5b4e5f81ad856900b6e8999684892e", + "extra": "495d030f1e03b90e954dad3043994f03293d41b9ed220a3beaef849df435d3f0" + } +} diff --git a/research/rank7-coupled-586-588-carrier-fold/allocation/baseline/CLAIM.json b/research/rank7-coupled-586-588-carrier-fold/allocation/baseline/CLAIM.json new file mode 100644 index 0000000000..beee83c926 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/allocation/baseline/CLAIM.json @@ -0,0 +1,47 @@ +{ + "status": "FINITE_NATIVE_OWNER_AND_MOMENT_CANDIDATE_OUTER_PENDING", + "kappa": "17240352247481048785499999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "meaning": "Proposed conservative candidate, not a completed outer release or established full multiplication exponent.", + "complex_lower": "43100880618702621963763/25000000000000000000000000", + "complex_upper": "172403522474810487855053/100000000000000000000000000", + "source_manifest_sha256": "1e25927e0f1b4a088819e42d59fcf7909298a3e9bb7d52f3e435f11401a84003", + "comparison_PR": 2957, + "comparison_claim_sha256": "a93e6c9e94bc9bf5664b5e23506dda9647fad1930e1eede66d5ba9f3718b598a", + "T": 370, + "calls": 3330, + "roles": 1358640, + "private_buffers": 86, + "physical": 332024, + "mechanism_ablations": { + "fourteen_rewrites": { + "fraction_lower_decimal": "0.79329087748352472282357491773049727655241063024122181557333981920688412078398566", + "fraction_of_total_gain_lower": "121795400525535764056/153531830483031419353", + "gain_lower": "15224425065691970507/12500000000000000000000000", + "gain_lower_decimal": "0.00000121795400525535764056", + "gain_upper": "60897700262767882029/50000000000000000000000000", + "passes_ten_percent": true + }, + "normal45": { + "fraction_lower_decimal": "0.20699921076094537100997080710207532816087440295950088015563825482943375470815860", + "fraction_of_total_gain_lower": "31780967736670757920/153531830483031419353", + "gain_lower": "198631048354192237/625000000000000000000000", + "gain_lower_decimal": "3.178096773667075792E-7", + "gain_upper": "15890483868335378961/50000000000000000000000000", + "passes_ten_percent": true + } + }, + "completed": [ + "exact word and frame audits", + "two fresh native and Clifford phase chains", + "four complete literal owner assignments", + "two independent directed moment engines", + "36 corruption controls", + "informal mathematical and source reviews" + ], + "pending": [ + "complete recursive discovery", + "full physical/prefix invoice and modern outer release" + ], + "novelty": "New checked composition of credited existing mechanisms, not two newly invented general methods.", + "inherited_hypotheses_remain": true +} diff --git a/research/rank7-coupled-586-588-carrier-fold/allocation/baseline/ORDER.json b/research/rank7-coupled-586-588-carrier-fold/allocation/baseline/ORDER.json new file mode 100644 index 0000000000..b1629ba981 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/allocation/baseline/ORDER.json @@ -0,0 +1 @@ +[[0,0],[0,74],[0,148],[0,222],[0,296],[0,37],[0,111],[0,185],[0,259],[0,333],[0,1],[0,75],[0,149],[0,223],[0,297],[0,38],[0,112],[0,186],[0,260],[0,334],[0,2],[0,76],[0,150],[0,224],[0,298],[0,39],[0,113],[0,187],[0,261],[0,335],[0,3],[0,77],[0,151],[0,225],[0,299],[0,40],[0,114],[0,188],[0,262],[0,336],[0,4],[0,78],[0,152],[0,226],[0,300],[0,41],[0,115],[0,189],[0,263],[0,337],[1,0],[1,74],[1,148],[1,222],[1,296],[1,37],[1,111],[1,185],[1,259],[1,333],[0,5],[0,79],[0,153],[0,227],[0,301],[0,42],[0,116],[0,190],[0,264],[0,338],[1,1],[1,75],[1,149],[1,223],[1,297],[1,38],[1,112],[1,186],[1,260],[1,334],[0,6],[0,80],[0,154],[0,228],[0,302],[0,43],[0,117],[0,191],[0,265],[0,339],[1,2],[1,76],[1,150],[1,224],[1,298],[1,39],[1,113],[1,187],[1,261],[1,335],[0,7],[0,81],[0,155],[0,229],[0,303],[0,44],[0,118],[0,192],[0,266],[0,340],[1,3],[1,77],[1,151],[1,225],[1,299],[1,40],[1,114],[1,188],[1,262],[1,336],[0,8],[0,82],[0,156],[0,230],[0,304],[0,45],[0,119],[0,193],[0,267],[0,341],[1,4],[1,78],[1,152],[1,226],[1,300],[1,41],[1,115],[1,189],[1,263],[1,337],[0,9],[0,83],[0,157],[0,231],[0,305],[0,46],[0,120],[0,194],[0,268],[0,342],[2,0],[2,74],[2,148],[2,222],[2,296],[2,37],[2,111],[2,185],[2,259],[2,333],[1,5],[1,79],[1,153],[1,227],[1,301],[1,42],[1,116],[1,190],[1,264],[1,338],[0,10],[0,84],[0,158],[0,232],[0,306],[0,47],[0,121],[0,195],[0,269],[0,343],[2,1],[2,75],[2,149],[2,223],[2,297],[2,38],[2,112],[2,186],[2,260],[2,334],[1,6],[1,80],[1,154],[1,228],[1,302],[1,43],[1,117],[1,191],[1,265],[1,339],[0,11],[0,85],[0,159],[0,233],[0,307],[0,48],[0,122],[0,196],[0,270],[0,344],[2,2],[2,76],[2,150],[2,224],[2,298],[2,39],[2,113],[2,187],[2,261],[2,335],[1,7],[1,81],[1,155],[1,229],[1,303],[1,44],[1,118],[1,192],[1,266],[1,340],[0,12],[0,86],[0,160],[0,234],[0,308],[0,49],[0,123],[0,197],[0,271],[0,345],[2,3],[2,77],[2,151],[2,225],[2,299],[2,40],[2,114],[2,188],[2,262],[2,336],[1,8],[1,82],[1,156],[1,230],[1,304],[1,45],[1,119],[1,193],[1,267],[1,341],[0,13],[0,87],[0,161],[0,235],[0,309],[0,50],[0,124],[0,198],[0,272],[0,346],[2,4],[2,78],[2,152],[2,226],[2,300],[2,41],[2,115],[2,189],[2,263],[2,337],[1,9],[1,83],[1,157],[1,231],[1,305],[1,46],[1,120],[1,194],[1,268],[1,342],[3,0],[3,74],[3,148],[3,222],[3,296],[3,37],[3,111],[3,185],[3,259],[3,333],[0,14],[0,88],[0,162],[0,236],[0,310],[0,51],[0,125],[0,199],[0,273],[0,347],[2,5],[2,79],[2,153],[2,227],[2,301],[2,42],[2,116],[2,190],[2,264],[2,338],[1,10],[1,84],[1,158],[1,232],[1,306],[1,47],[1,121],[1,195],[1,269],[1,343],[3,1],[3,75],[3,149],[3,223],[3,297],[3,38],[3,112],[3,186],[3,260],[3,334],[0,15],[0,89],[0,163],[0,237],[0,311],[0,52],[0,126],[0,200],[0,274],[0,348],[2,6],[2,80],[2,154],[2,228],[2,302],[2,43],[2,117],[2,191],[2,265],[2,339],[1,11],[1,85],[1,159],[1,233],[1,307],[1,48],[1,122],[1,196],[1,270],[1,344],[3,2],[3,76],[3,150],[3,224],[3,298],[3,39],[3,113],[3,187],[3,261],[3,335],[0,16],[0,90],[0,164],[0,238],[0,312],[0,53],[0,127],[0,201],[0,275],[0,349],[2,7],[2,81],[2,155],[2,229],[2,303],[2,44],[2,118],[2,192],[2,266],[2,340],[1,12],[1,86],[1,160],[1,234],[1,308],[1,49],[1,123],[1,197],[1,271],[1,345],[3,3],[3,77],[3,151],[3,225],[3,299],[3,40],[3,114],[3,188],[3,262],[3,336],[0,17],[0,91],[0,165],[0,239],[0,313],[0,54],[0,128],[0,202],[0,276],[0,350],[2,8],[2,82],[2,156],[2,230],[2,304],[2,45],[2,119],[2,193],[2,267],[2,341],[1,13],[1,87],[1,161],[1,235],[1,309],[1,50],[1,124],[1,198],[1,272],[1,346],[3,4],[3,78],[3,152],[3,226],[3,300],[3,41],[3,115],[3,189],[3,263],[3,337],[0,18],[0,92],[0,166],[0,240],[0,314],[0,55],[0,129],[0,203],[0,277],[0,351],[2,9],[2,83],[2,157],[2,231],[2,305],[2,46],[2,120],[2,194],[2,268],[2,342],[4,0],[4,74],[4,148],[4,222],[4,296],[4,37],[4,111],[4,185],[4,259],[4,333],[1,14],[1,88],[1,162],[1,236],[1,310],[1,51],[1,125],[1,199],[1,273],[1,347],[3,5],[3,79],[3,153],[3,227],[3,301],[3,42],[3,116],[3,190],[3,264],[3,338],[0,19],[0,93],[0,167],[0,241],[0,315],[0,56],[0,130],[0,204],[0,278],[0,352],[2,10],[2,84],[2,158],[2,232],[2,306],[2,47],[2,121],[2,195],[2,269],[2,343],[4,1],[4,75],[4,149],[4,223],[4,297],[4,38],[4,112],[4,186],[4,260],[4,334],[1,15],[1,89],[1,163],[1,237],[1,311],[1,52],[1,126],[1,200],[1,274],[1,348],[3,6],[3,80],[3,154],[3,228],[3,302],[3,43],[3,117],[3,191],[3,265],[3,339],[0,20],[0,94],[0,168],[0,242],[0,316],[0,57],[0,131],[0,205],[0,279],[0,353],[2,11],[2,85],[2,159],[2,233],[2,307],[2,48],[2,122],[2,196],[2,270],[2,344],[4,2],[4,76],[4,150],[4,224],[4,298],[4,39],[4,113],[4,187],[4,261],[4,335],[1,16],[1,90],[1,164],[1,238],[1,312],[1,53],[1,127],[1,201],[1,275],[1,349],[3,7],[3,81],[3,155],[3,229],[3,303],[3,44],[3,118],[3,192],[3,266],[3,340],[0,21],[0,95],[0,169],[0,243],[0,317],[0,58],[0,132],[0,206],[0,280],[0,354],[2,12],[2,86],[2,160],[2,234],[2,308],[2,49],[2,123],[2,197],[2,271],[2,345],[4,3],[4,77],[4,151],[4,225],[4,299],[4,40],[4,114],[4,188],[4,262],[4,336],[1,17],[1,91],[1,165],[1,239],[1,313],[1,54],[1,128],[1,202],[1,276],[1,350],[3,8],[3,82],[3,156],[3,230],[3,304],[3,45],[3,119],[3,193],[3,267],[3,341],[0,22],[0,96],[0,170],[0,244],[0,318],[0,59],[0,133],[0,207],[0,281],[0,355],[2,13],[2,87],[2,161],[2,235],[2,309],[2,50],[2,124],[2,198],[2,272],[2,346],[4,4],[4,78],[4,152],[4,226],[4,300],[4,41],[4,115],[4,189],[4,263],[4,337],[1,18],[1,92],[1,166],[1,240],[1,314],[1,55],[1,129],[1,203],[1,277],[1,351],[3,9],[3,83],[3,157],[3,231],[3,305],[3,46],[3,120],[3,194],[3,268],[3,342],[0,23],[0,97],[0,171],[0,245],[0,319],[0,60],[0,134],[0,208],[0,282],[0,356],[5,0],[5,74],[5,148],[5,222],[5,296],[5,37],[5,111],[5,185],[5,259],[5,333],[2,14],[2,88],[2,162],[2,236],[2,310],[2,51],[2,125],[2,199],[2,273],[2,347],[4,5],[4,79],[4,153],[4,227],[4,301],[4,42],[4,116],[4,190],[4,264],[4,338],[1,19],[1,93],[1,167],[1,241],[1,315],[1,56],[1,130],[1,204],[1,278],[1,352],[3,10],[3,84],[3,158],[3,232],[3,306],[3,47],[3,121],[3,195],[3,269],[3,343],[0,24],[0,98],[0,172],[0,246],[0,320],[0,61],[0,135],[0,209],[0,283],[0,357],[5,1],[5,75],[5,149],[5,223],[5,297],[5,38],[5,112],[5,186],[5,260],[5,334],[2,15],[2,89],[2,163],[2,237],[2,311],[2,52],[2,126],[2,200],[2,274],[2,348],[4,6],[4,80],[4,154],[4,228],[4,302],[4,43],[4,117],[4,191],[4,265],[4,339],[1,20],[1,94],[1,168],[1,242],[1,316],[1,57],[1,131],[1,205],[1,279],[1,353],[3,11],[3,85],[3,159],[3,233],[3,307],[3,48],[3,122],[3,196],[3,270],[3,344],[0,25],[0,99],[0,173],[0,247],[0,321],[0,62],[0,136],[0,210],[0,284],[0,358],[5,2],[5,76],[5,150],[5,224],[5,298],[5,39],[5,113],[5,187],[5,261],[5,335],[2,16],[2,90],[2,164],[2,238],[2,312],[2,53],[2,127],[2,201],[2,275],[2,349],[4,7],[4,81],[4,155],[4,229],[4,303],[4,44],[4,118],[4,192],[4,266],[4,340],[1,21],[1,95],[1,169],[1,243],[1,317],[1,58],[1,132],[1,206],[1,280],[1,354],[3,12],[3,86],[3,160],[3,234],[3,308],[3,49],[3,123],[3,197],[3,271],[3,345],[0,26],[0,100],[0,174],[0,248],[0,322],[0,63],[0,137],[0,211],[0,285],[0,359],[5,3],[5,77],[5,151],[5,225],[5,299],[5,40],[5,114],[5,188],[5,262],[5,336],[2,17],[2,91],[2,165],[2,239],[2,313],[2,54],[2,128],[2,202],[2,276],[2,350],[4,8],[4,82],[4,156],[4,230],[4,304],[4,45],[4,119],[4,193],[4,267],[4,341],[1,22],[1,96],[1,170],[1,244],[1,318],[1,59],[1,133],[1,207],[1,281],[1,355],[3,13],[3,87],[3,161],[3,235],[3,309],[3,50],[3,124],[3,198],[3,272],[3,346],[0,27],[0,101],[0,175],[0,249],[0,323],[0,64],[0,138],[0,212],[0,286],[0,360],[5,4],[5,78],[5,152],[5,226],[5,300],[5,41],[5,115],[5,189],[5,263],[5,337],[2,18],[2,92],[2,166],[2,240],[2,314],[2,55],[2,129],[2,203],[2,277],[2,351],[4,9],[4,83],[4,157],[4,231],[4,305],[4,46],[4,120],[4,194],[4,268],[4,342],[1,23],[1,97],[1,171],[1,245],[1,319],[1,60],[1,134],[1,208],[1,282],[1,356],[6,0],[6,74],[6,148],[6,222],[6,296],[6,37],[6,111],[6,185],[6,259],[6,333],[3,14],[3,88],[3,162],[3,236],[3,310],[3,51],[3,125],[3,199],[3,273],[3,347],[0,28],[0,102],[0,176],[0,250],[0,324],[0,65],[0,139],[0,213],[0,287],[0,361],[5,5],[5,79],[5,153],[5,227],[5,301],[5,42],[5,116],[5,190],[5,264],[5,338],[2,19],[2,93],[2,167],[2,241],[2,315],[2,56],[2,130],[2,204],[2,278],[2,352],[4,10],[4,84],[4,158],[4,232],[4,306],[4,47],[4,121],[4,195],[4,269],[4,343],[1,24],[1,98],[1,172],[1,246],[1,320],[1,61],[1,135],[1,209],[1,283],[1,357],[6,1],[6,75],[6,149],[6,223],[6,297],[6,38],[6,112],[6,186],[6,260],[6,334],[3,15],[3,89],[3,163],[3,237],[3,311],[3,52],[3,126],[3,200],[3,274],[3,348],[0,29],[0,103],[0,177],[0,251],[0,325],[0,66],[0,140],[0,214],[0,288],[0,362],[5,6],[5,80],[5,154],[5,228],[5,302],[5,43],[5,117],[5,191],[5,265],[5,339],[2,20],[2,94],[2,168],[2,242],[2,316],[2,57],[2,131],[2,205],[2,279],[2,353],[4,11],[4,85],[4,159],[4,233],[4,307],[4,48],[4,122],[4,196],[4,270],[4,344],[1,25],[1,99],[1,173],[1,247],[1,321],[1,62],[1,136],[1,210],[1,284],[1,358],[6,2],[6,76],[6,150],[6,224],[6,298],[6,39],[6,113],[6,187],[6,261],[6,335],[3,16],[3,90],[3,164],[3,238],[3,312],[3,53],[3,127],[3,201],[3,275],[3,349],[0,30],[0,104],[0,178],[0,252],[0,326],[0,67],[0,141],[0,215],[0,289],[0,363],[5,7],[5,81],[5,155],[5,229],[5,303],[5,44],[5,118],[5,192],[5,266],[5,340],[2,21],[2,95],[2,169],[2,243],[2,317],[2,58],[2,132],[2,206],[2,280],[2,354],[4,12],[4,86],[4,160],[4,234],[4,308],[4,49],[4,123],[4,197],[4,271],[4,345],[1,26],[1,100],[1,174],[1,248],[1,322],[1,63],[1,137],[1,211],[1,285],[1,359],[6,3],[6,77],[6,151],[6,225],[6,299],[6,40],[6,114],[6,188],[6,262],[6,336],[3,17],[3,91],[3,165],[3,239],[3,313],[3,54],[3,128],[3,202],[3,276],[3,350],[0,31],[0,105],[0,179],[0,253],[0,327],[0,68],[0,142],[0,216],[0,290],[0,364],[5,8],[5,82],[5,156],[5,230],[5,304],[5,45],[5,119],[5,193],[5,267],[5,341],[2,22],[2,96],[2,170],[2,244],[2,318],[2,59],[2,133],[2,207],[2,281],[2,355],[4,13],[4,87],[4,161],[4,235],[4,309],[4,50],[4,124],[4,198],[4,272],[4,346],[1,27],[1,101],[1,175],[1,249],[1,323],[1,64],[1,138],[1,212],[1,286],[1,360],[6,4],[6,78],[6,152],[6,226],[6,300],[6,41],[6,115],[6,189],[6,263],[6,337],[3,18],[3,92],[3,166],[3,240],[3,314],[3,55],[3,129],[3,203],[3,277],[3,351],[0,32],[0,106],[0,180],[0,254],[0,328],[0,69],[0,143],[0,217],[0,291],[0,365],[5,9],[5,83],[5,157],[5,231],[5,305],[5,46],[5,120],[5,194],[5,268],[5,342],[2,23],[2,97],[2,171],[2,245],[2,319],[2,60],[2,134],[2,208],[2,282],[2,356],[7,0],[7,74],[7,148],[7,222],[7,296],[7,37],[7,111],[7,185],[7,259],[7,333],[4,14],[4,88],[4,162],[4,236],[4,310],[4,51],[4,125],[4,199],[4,273],[4,347],[1,28],[1,102],[1,176],[1,250],[1,324],[1,65],[1,139],[1,213],[1,287],[1,361],[6,5],[6,79],[6,153],[6,227],[6,301],[6,42],[6,116],[6,190],[6,264],[6,338],[3,19],[3,93],[3,167],[3,241],[3,315],[3,56],[3,130],[3,204],[3,278],[3,352],[0,33],[0,107],[0,181],[0,255],[0,329],[0,70],[0,144],[0,218],[0,292],[0,366],[5,10],[5,84],[5,158],[5,232],[5,306],[5,47],[5,121],[5,195],[5,269],[5,343],[2,24],[2,98],[2,172],[2,246],[2,320],[2,61],[2,135],[2,209],[2,283],[2,357],[7,1],[7,75],[7,149],[7,223],[7,297],[7,38],[7,112],[7,186],[7,260],[7,334],[4,15],[4,89],[4,163],[4,237],[4,311],[4,52],[4,126],[4,200],[4,274],[4,348],[1,29],[1,103],[1,177],[1,251],[1,325],[1,66],[1,140],[1,214],[1,288],[1,362],[6,6],[6,80],[6,154],[6,228],[6,302],[6,43],[6,117],[6,191],[6,265],[6,339],[3,20],[3,94],[3,168],[3,242],[3,316],[3,57],[3,131],[3,205],[3,279],[3,353],[0,34],[0,108],[0,182],[0,256],[0,330],[0,71],[0,145],[0,219],[0,293],[0,367],[5,11],[5,85],[5,159],[5,233],[5,307],[5,48],[5,122],[5,196],[5,270],[5,344],[2,25],[2,99],[2,173],[2,247],[2,321],[2,62],[2,136],[2,210],[2,284],[2,358],[7,2],[7,76],[7,150],[7,224],[7,298],[7,39],[7,113],[7,187],[7,261],[7,335],[4,16],[4,90],[4,164],[4,238],[4,312],[4,53],[4,127],[4,201],[4,275],[4,349],[1,30],[1,104],[1,178],[1,252],[1,326],[1,67],[1,141],[1,215],[1,289],[1,363],[6,7],[6,81],[6,155],[6,229],[6,303],[6,44],[6,118],[6,192],[6,266],[6,340],[3,21],[3,95],[3,169],[3,243],[3,317],[3,58],[3,132],[3,206],[3,280],[3,354],[0,35],[0,109],[0,183],[0,257],[0,331],[0,72],[0,146],[0,220],[0,294],[0,368],[5,12],[5,86],[5,160],[5,234],[5,308],[5,49],[5,123],[5,197],[5,271],[5,345],[2,26],[2,100],[2,174],[2,248],[2,322],[2,63],[2,137],[2,211],[2,285],[2,359],[7,3],[7,77],[7,151],[7,225],[7,299],[7,40],[7,114],[7,188],[7,262],[7,336],[4,17],[4,91],[4,165],[4,239],[4,313],[4,54],[4,128],[4,202],[4,276],[4,350],[1,31],[1,105],[1,179],[1,253],[1,327],[1,68],[1,142],[1,216],[1,290],[1,364],[6,8],[6,82],[6,156],[6,230],[6,304],[6,45],[6,119],[6,193],[6,267],[6,341],[3,22],[3,96],[3,170],[3,244],[3,318],[3,59],[3,133],[3,207],[3,281],[3,355],[0,36],[0,110],[0,184],[0,258],[0,332],[0,73],[0,147],[0,221],[0,295],[0,369],[5,13],[5,87],[5,161],[5,235],[5,309],[5,50],[5,124],[5,198],[5,272],[5,346],[2,27],[2,101],[2,175],[2,249],[2,323],[2,64],[2,138],[2,212],[2,286],[2,360],[7,4],[7,78],[7,152],[7,226],[7,300],[7,41],[7,115],[7,189],[7,263],[7,337],[4,18],[4,92],[4,166],[4,240],[4,314],[4,55],[4,129],[4,203],[4,277],[4,351],[1,32],[1,106],[1,180],[1,254],[1,328],[1,69],[1,143],[1,217],[1,291],[1,365],[6,9],[6,83],[6,157],[6,231],[6,305],[6,46],[6,120],[6,194],[6,268],[6,342],[3,23],[3,97],[3,171],[3,245],[3,319],[3,60],[3,134],[3,208],[3,282],[3,356],[8,0],[8,74],[8,148],[8,222],[8,296],[8,37],[8,111],[8,185],[8,259],[8,333],[5,14],[5,88],[5,162],[5,236],[5,310],[5,51],[5,125],[5,199],[5,273],[5,347],[2,28],[2,102],[2,176],[2,250],[2,324],[2,65],[2,139],[2,213],[2,287],[2,361],[7,5],[7,79],[7,153],[7,227],[7,301],[7,42],[7,116],[7,190],[7,264],[7,338],[4,19],[4,93],[4,167],[4,241],[4,315],[4,56],[4,130],[4,204],[4,278],[4,352],[1,33],[1,107],[1,181],[1,255],[1,329],[1,70],[1,144],[1,218],[1,292],[1,366],[6,10],[6,84],[6,158],[6,232],[6,306],[6,47],[6,121],[6,195],[6,269],[6,343],[3,24],[3,98],[3,172],[3,246],[3,320],[3,61],[3,135],[3,209],[3,283],[3,357],[8,1],[8,75],[8,149],[8,223],[8,297],[8,38],[8,112],[8,186],[8,260],[8,334],[5,15],[5,89],[5,163],[5,237],[5,311],[5,52],[5,126],[5,200],[5,274],[5,348],[2,29],[2,103],[2,177],[2,251],[2,325],[2,66],[2,140],[2,214],[2,288],[2,362],[7,6],[7,80],[7,154],[7,228],[7,302],[7,43],[7,117],[7,191],[7,265],[7,339],[4,20],[4,94],[4,168],[4,242],[4,316],[4,57],[4,131],[4,205],[4,279],[4,353],[1,34],[1,108],[1,182],[1,256],[1,330],[1,71],[1,145],[1,219],[1,293],[1,367],[6,11],[6,85],[6,159],[6,233],[6,307],[6,48],[6,122],[6,196],[6,270],[6,344],[3,25],[3,99],[3,173],[3,247],[3,321],[3,62],[3,136],[3,210],[3,284],[3,358],[8,2],[8,76],[8,150],[8,224],[8,298],[8,39],[8,113],[8,187],[8,261],[8,335],[5,16],[5,90],[5,164],[5,238],[5,312],[5,53],[5,127],[5,201],[5,275],[5,349],[2,30],[2,104],[2,178],[2,252],[2,326],[2,67],[2,141],[2,215],[2,289],[2,363],[7,7],[7,81],[7,155],[7,229],[7,303],[7,44],[7,118],[7,192],[7,266],[7,340],[4,21],[4,95],[4,169],[4,243],[4,317],[4,58],[4,132],[4,206],[4,280],[4,354],[1,35],[1,109],[1,183],[1,257],[1,331],[1,72],[1,146],[1,220],[1,294],[1,368],[6,12],[6,86],[6,160],[6,234],[6,308],[6,49],[6,123],[6,197],[6,271],[6,345],[3,26],[3,100],[3,174],[3,248],[3,322],[3,63],[3,137],[3,211],[3,285],[3,359],[8,3],[8,77],[8,151],[8,225],[8,299],[8,40],[8,114],[8,188],[8,262],[8,336],[5,17],[5,91],[5,165],[5,239],[5,313],[5,54],[5,128],[5,202],[5,276],[5,350],[2,31],[2,105],[2,179],[2,253],[2,327],[2,68],[2,142],[2,216],[2,290],[2,364],[7,8],[7,82],[7,156],[7,230],[7,304],[7,45],[7,119],[7,193],[7,267],[7,341],[4,22],[4,96],[4,170],[4,244],[4,318],[4,59],[4,133],[4,207],[4,281],[4,355],[1,36],[1,110],[1,184],[1,258],[1,332],[1,73],[1,147],[1,221],[1,295],[1,369],[6,13],[6,87],[6,161],[6,235],[6,309],[6,50],[6,124],[6,198],[6,272],[6,346],[3,27],[3,101],[3,175],[3,249],[3,323],[3,64],[3,138],[3,212],[3,286],[3,360],[8,4],[8,78],[8,152],[8,226],[8,300],[8,41],[8,115],[8,189],[8,263],[8,337],[5,18],[5,92],[5,166],[5,240],[5,314],[5,55],[5,129],[5,203],[5,277],[5,351],[2,32],[2,106],[2,180],[2,254],[2,328],[2,69],[2,143],[2,217],[2,291],[2,365],[7,9],[7,83],[7,157],[7,231],[7,305],[7,46],[7,120],[7,194],[7,268],[7,342],[4,23],[4,97],[4,171],[4,245],[4,319],[4,60],[4,134],[4,208],[4,282],[4,356],[6,14],[6,88],[6,162],[6,236],[6,310],[6,51],[6,125],[6,199],[6,273],[6,347],[3,28],[3,102],[3,176],[3,250],[3,324],[3,65],[3,139],[3,213],[3,287],[3,361],[8,5],[8,79],[8,153],[8,227],[8,301],[8,42],[8,116],[8,190],[8,264],[8,338],[5,19],[5,93],[5,167],[5,241],[5,315],[5,56],[5,130],[5,204],[5,278],[5,352],[2,33],[2,107],[2,181],[2,255],[2,329],[2,70],[2,144],[2,218],[2,292],[2,366],[7,10],[7,84],[7,158],[7,232],[7,306],[7,47],[7,121],[7,195],[7,269],[7,343],[4,24],[4,98],[4,172],[4,246],[4,320],[4,61],[4,135],[4,209],[4,283],[4,357],[6,15],[6,89],[6,163],[6,237],[6,311],[6,52],[6,126],[6,200],[6,274],[6,348],[3,29],[3,103],[3,177],[3,251],[3,325],[3,66],[3,140],[3,214],[3,288],[3,362],[8,6],[8,80],[8,154],[8,228],[8,302],[8,43],[8,117],[8,191],[8,265],[8,339],[5,20],[5,94],[5,168],[5,242],[5,316],[5,57],[5,131],[5,205],[5,279],[5,353],[2,34],[2,108],[2,182],[2,256],[2,330],[2,71],[2,145],[2,219],[2,293],[2,367],[7,11],[7,85],[7,159],[7,233],[7,307],[7,48],[7,122],[7,196],[7,270],[7,344],[4,25],[4,99],[4,173],[4,247],[4,321],[4,62],[4,136],[4,210],[4,284],[4,358],[6,16],[6,90],[6,164],[6,238],[6,312],[6,53],[6,127],[6,201],[6,275],[6,349],[3,30],[3,104],[3,178],[3,252],[3,326],[3,67],[3,141],[3,215],[3,289],[3,363],[8,7],[8,81],[8,155],[8,229],[8,303],[8,44],[8,118],[8,192],[8,266],[8,340],[5,21],[5,95],[5,169],[5,243],[5,317],[5,58],[5,132],[5,206],[5,280],[5,354],[2,35],[2,109],[2,183],[2,257],[2,331],[2,72],[2,146],[2,220],[2,294],[2,368],[7,12],[7,86],[7,160],[7,234],[7,308],[7,49],[7,123],[7,197],[7,271],[7,345],[4,26],[4,100],[4,174],[4,248],[4,322],[4,63],[4,137],[4,211],[4,285],[4,359],[6,17],[6,91],[6,165],[6,239],[6,313],[6,54],[6,128],[6,202],[6,276],[6,350],[3,31],[3,105],[3,179],[3,253],[3,327],[3,68],[3,142],[3,216],[3,290],[3,364],[8,8],[8,82],[8,156],[8,230],[8,304],[8,45],[8,119],[8,193],[8,267],[8,341],[5,22],[5,96],[5,170],[5,244],[5,318],[5,59],[5,133],[5,207],[5,281],[5,355],[2,36],[2,110],[2,184],[2,258],[2,332],[2,73],[2,147],[2,221],[2,295],[2,369],[7,13],[7,87],[7,161],[7,235],[7,309],[7,50],[7,124],[7,198],[7,272],[7,346],[4,27],[4,101],[4,175],[4,249],[4,323],[4,64],[4,138],[4,212],[4,286],[4,360],[6,18],[6,92],[6,166],[6,240],[6,314],[6,55],[6,129],[6,203],[6,277],[6,351],[3,32],[3,106],[3,180],[3,254],[3,328],[3,69],[3,143],[3,217],[3,291],[3,365],[8,9],[8,83],[8,157],[8,231],[8,305],[8,46],[8,120],[8,194],[8,268],[8,342],[5,23],[5,97],[5,171],[5,245],[5,319],[5,60],[5,134],[5,208],[5,282],[5,356],[7,14],[7,88],[7,162],[7,236],[7,310],[7,51],[7,125],[7,199],[7,273],[7,347],[4,28],[4,102],[4,176],[4,250],[4,324],[4,65],[4,139],[4,213],[4,287],[4,361],[6,19],[6,93],[6,167],[6,241],[6,315],[6,56],[6,130],[6,204],[6,278],[6,352],[3,33],[3,107],[3,181],[3,255],[3,329],[3,70],[3,144],[3,218],[3,292],[3,366],[8,10],[8,84],[8,158],[8,232],[8,306],[8,47],[8,121],[8,195],[8,269],[8,343],[5,24],[5,98],[5,172],[5,246],[5,320],[5,61],[5,135],[5,209],[5,283],[5,357],[7,15],[7,89],[7,163],[7,237],[7,311],[7,52],[7,126],[7,200],[7,274],[7,348],[4,29],[4,103],[4,177],[4,251],[4,325],[4,66],[4,140],[4,214],[4,288],[4,362],[6,20],[6,94],[6,168],[6,242],[6,316],[6,57],[6,131],[6,205],[6,279],[6,353],[3,34],[3,108],[3,182],[3,256],[3,330],[3,71],[3,145],[3,219],[3,293],[3,367],[8,11],[8,85],[8,159],[8,233],[8,307],[8,48],[8,122],[8,196],[8,270],[8,344],[5,25],[5,99],[5,173],[5,247],[5,321],[5,62],[5,136],[5,210],[5,284],[5,358],[7,16],[7,90],[7,164],[7,238],[7,312],[7,53],[7,127],[7,201],[7,275],[7,349],[4,30],[4,104],[4,178],[4,252],[4,326],[4,67],[4,141],[4,215],[4,289],[4,363],[6,21],[6,95],[6,169],[6,243],[6,317],[6,58],[6,132],[6,206],[6,280],[6,354],[3,35],[3,109],[3,183],[3,257],[3,331],[3,72],[3,146],[3,220],[3,294],[3,368],[8,12],[8,86],[8,160],[8,234],[8,308],[8,49],[8,123],[8,197],[8,271],[8,345],[5,26],[5,100],[5,174],[5,248],[5,322],[5,63],[5,137],[5,211],[5,285],[5,359],[7,17],[7,91],[7,165],[7,239],[7,313],[7,54],[7,128],[7,202],[7,276],[7,350],[4,31],[4,105],[4,179],[4,253],[4,327],[4,68],[4,142],[4,216],[4,290],[4,364],[6,22],[6,96],[6,170],[6,244],[6,318],[6,59],[6,133],[6,207],[6,281],[6,355],[3,36],[3,110],[3,184],[3,258],[3,332],[3,73],[3,147],[3,221],[3,295],[3,369],[8,13],[8,87],[8,161],[8,235],[8,309],[8,50],[8,124],[8,198],[8,272],[8,346],[5,27],[5,101],[5,175],[5,249],[5,323],[5,64],[5,138],[5,212],[5,286],[5,360],[7,18],[7,92],[7,166],[7,240],[7,314],[7,55],[7,129],[7,203],[7,277],[7,351],[4,32],[4,106],[4,180],[4,254],[4,328],[4,69],[4,143],[4,217],[4,291],[4,365],[6,23],[6,97],[6,171],[6,245],[6,319],[6,60],[6,134],[6,208],[6,282],[6,356],[8,14],[8,88],[8,162],[8,236],[8,310],[8,51],[8,125],[8,199],[8,273],[8,347],[5,28],[5,102],[5,176],[5,250],[5,324],[5,65],[5,139],[5,213],[5,287],[5,361],[7,19],[7,93],[7,167],[7,241],[7,315],[7,56],[7,130],[7,204],[7,278],[7,352],[4,33],[4,107],[4,181],[4,255],[4,329],[4,70],[4,144],[4,218],[4,292],[4,366],[6,24],[6,98],[6,172],[6,246],[6,320],[6,61],[6,135],[6,209],[6,283],[6,357],[8,15],[8,89],[8,163],[8,237],[8,311],[8,52],[8,126],[8,200],[8,274],[8,348],[5,29],[5,103],[5,177],[5,251],[5,325],[5,66],[5,140],[5,214],[5,288],[5,362],[7,20],[7,94],[7,168],[7,242],[7,316],[7,57],[7,131],[7,205],[7,279],[7,353],[4,34],[4,108],[4,182],[4,256],[4,330],[4,71],[4,145],[4,219],[4,293],[4,367],[6,25],[6,99],[6,173],[6,247],[6,321],[6,62],[6,136],[6,210],[6,284],[6,358],[8,16],[8,90],[8,164],[8,238],[8,312],[8,53],[8,127],[8,201],[8,275],[8,349],[5,30],[5,104],[5,178],[5,252],[5,326],[5,67],[5,141],[5,215],[5,289],[5,363],[7,21],[7,95],[7,169],[7,243],[7,317],[7,58],[7,132],[7,206],[7,280],[7,354],[4,35],[4,109],[4,183],[4,257],[4,331],[4,72],[4,146],[4,220],[4,294],[4,368],[6,26],[6,100],[6,174],[6,248],[6,322],[6,63],[6,137],[6,211],[6,285],[6,359],[8,17],[8,91],[8,165],[8,239],[8,313],[8,54],[8,128],[8,202],[8,276],[8,350],[5,31],[5,105],[5,179],[5,253],[5,327],[5,68],[5,142],[5,216],[5,290],[5,364],[7,22],[7,96],[7,170],[7,244],[7,318],[7,59],[7,133],[7,207],[7,281],[7,355],[4,36],[4,110],[4,184],[4,258],[4,332],[4,73],[4,147],[4,221],[4,295],[4,369],[6,27],[6,101],[6,175],[6,249],[6,323],[6,64],[6,138],[6,212],[6,286],[6,360],[8,18],[8,92],[8,166],[8,240],[8,314],[8,55],[8,129],[8,203],[8,277],[8,351],[5,32],[5,106],[5,180],[5,254],[5,328],[5,69],[5,143],[5,217],[5,291],[5,365],[7,23],[7,97],[7,171],[7,245],[7,319],[7,60],[7,134],[7,208],[7,282],[7,356],[6,28],[6,102],[6,176],[6,250],[6,324],[6,65],[6,139],[6,213],[6,287],[6,361],[8,19],[8,93],[8,167],[8,241],[8,315],[8,56],[8,130],[8,204],[8,278],[8,352],[5,33],[5,107],[5,181],[5,255],[5,329],[5,70],[5,144],[5,218],[5,292],[5,366],[7,24],[7,98],[7,172],[7,246],[7,320],[7,61],[7,135],[7,209],[7,283],[7,357],[6,29],[6,103],[6,177],[6,251],[6,325],[6,66],[6,140],[6,214],[6,288],[6,362],[8,20],[8,94],[8,168],[8,242],[8,316],[8,57],[8,131],[8,205],[8,279],[8,353],[5,34],[5,108],[5,182],[5,256],[5,330],[5,71],[5,145],[5,219],[5,293],[5,367],[7,25],[7,99],[7,173],[7,247],[7,321],[7,62],[7,136],[7,210],[7,284],[7,358],[6,30],[6,104],[6,178],[6,252],[6,326],[6,67],[6,141],[6,215],[6,289],[6,363],[8,21],[8,95],[8,169],[8,243],[8,317],[8,58],[8,132],[8,206],[8,280],[8,354],[5,35],[5,109],[5,183],[5,257],[5,331],[5,72],[5,146],[5,220],[5,294],[5,368],[7,26],[7,100],[7,174],[7,248],[7,322],[7,63],[7,137],[7,211],[7,285],[7,359],[6,31],[6,105],[6,179],[6,253],[6,327],[6,68],[6,142],[6,216],[6,290],[6,364],[8,22],[8,96],[8,170],[8,244],[8,318],[8,59],[8,133],[8,207],[8,281],[8,355],[5,36],[5,110],[5,184],[5,258],[5,332],[5,73],[5,147],[5,221],[5,295],[5,369],[7,27],[7,101],[7,175],[7,249],[7,323],[7,64],[7,138],[7,212],[7,286],[7,360],[6,32],[6,106],[6,180],[6,254],[6,328],[6,69],[6,143],[6,217],[6,291],[6,365],[8,23],[8,97],[8,171],[8,245],[8,319],[8,60],[8,134],[8,208],[8,282],[8,356],[7,28],[7,102],[7,176],[7,250],[7,324],[7,65],[7,139],[7,213],[7,287],[7,361],[6,33],[6,107],[6,181],[6,255],[6,329],[6,70],[6,144],[6,218],[6,292],[6,366],[8,24],[8,98],[8,172],[8,246],[8,320],[8,61],[8,135],[8,209],[8,283],[8,357],[7,29],[7,103],[7,177],[7,251],[7,325],[7,66],[7,140],[7,214],[7,288],[7,362],[6,34],[6,108],[6,182],[6,256],[6,330],[6,71],[6,145],[6,219],[6,293],[6,367],[8,25],[8,99],[8,173],[8,247],[8,321],[8,62],[8,136],[8,210],[8,284],[8,358],[7,30],[7,104],[7,178],[7,252],[7,326],[7,67],[7,141],[7,215],[7,289],[7,363],[6,35],[6,109],[6,183],[6,257],[6,331],[6,72],[6,146],[6,220],[6,294],[6,368],[8,26],[8,100],[8,174],[8,248],[8,322],[8,63],[8,137],[8,211],[8,285],[8,359],[7,31],[7,105],[7,179],[7,253],[7,327],[7,68],[7,142],[7,216],[7,290],[7,364],[6,36],[6,110],[6,184],[6,258],[6,332],[6,73],[6,147],[6,221],[6,295],[6,369],[8,27],[8,101],[8,175],[8,249],[8,323],[8,64],[8,138],[8,212],[8,286],[8,360],[7,32],[7,106],[7,180],[7,254],[7,328],[7,69],[7,143],[7,217],[7,291],[7,365],[8,28],[8,102],[8,176],[8,250],[8,324],[8,65],[8,139],[8,213],[8,287],[8,361],[7,33],[7,107],[7,181],[7,255],[7,329],[7,70],[7,144],[7,218],[7,292],[7,366],[8,29],[8,103],[8,177],[8,251],[8,325],[8,66],[8,140],[8,214],[8,288],[8,362],[7,34],[7,108],[7,182],[7,256],[7,330],[7,71],[7,145],[7,219],[7,293],[7,367],[8,30],[8,104],[8,178],[8,252],[8,326],[8,67],[8,141],[8,215],[8,289],[8,363],[7,35],[7,109],[7,183],[7,257],[7,331],[7,72],[7,146],[7,220],[7,294],[7,368],[8,31],[8,105],[8,179],[8,253],[8,327],[8,68],[8,142],[8,216],[8,290],[8,364],[7,36],[7,110],[7,184],[7,258],[7,332],[7,73],[7,147],[7,221],[7,295],[7,369],[8,32],[8,106],[8,180],[8,254],[8,328],[8,69],[8,143],[8,217],[8,291],[8,365],[8,33],[8,107],[8,181],[8,255],[8,329],[8,70],[8,144],[8,218],[8,292],[8,366],[8,34],[8,108],[8,182],[8,256],[8,330],[8,71],[8,145],[8,219],[8,293],[8,367],[8,35],[8,109],[8,183],[8,257],[8,331],[8,72],[8,146],[8,220],[8,294],[8,368],[8,36],[8,110],[8,184],[8,258],[8,332],[8,73],[8,147],[8,221],[8,295],[8,369]] diff --git a/research/rank7-coupled-586-588-carrier-fold/allocation/baseline/PROFILE.json b/research/rank7-coupled-586-588-carrier-fold/allocation/baseline/PROFILE.json new file mode 100644 index 0000000000..52d24cfc6a --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/allocation/baseline/PROFILE.json @@ -0,0 +1,9 @@ +{ + "1": 8178480, + "2": 2091240, + "3": 968364, + "4": 366300, + "48": 136456, + "5": 117660, + "8": 26640 +} diff --git a/research/rank7-coupled-586-588-carrier-fold/allocation/vendor/PLAN.json.gz b/research/rank7-coupled-586-588-carrier-fold/allocation/vendor/PLAN.json.gz new file mode 100644 index 0000000000..7a1db55a4d Binary files /dev/null and b/research/rank7-coupled-586-588-carrier-fold/allocation/vendor/PLAN.json.gz differ diff --git a/research/rank7-coupled-586-588-carrier-fold/allocation/vendor/TEMPLATE.json.gz b/research/rank7-coupled-586-588-carrier-fold/allocation/vendor/TEMPLATE.json.gz new file mode 100644 index 0000000000..114808c32b Binary files /dev/null and b/research/rank7-coupled-586-588-carrier-fold/allocation/vendor/TEMPLATE.json.gz differ diff --git a/research/rank7-coupled-586-588-carrier-fold/allocation/vendor/independent_owners.py b/research/rank7-coupled-586-588-carrier-fold/allocation/vendor/independent_owners.py new file mode 100644 index 0000000000..16013201b1 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/allocation/vendor/independent_owners.py @@ -0,0 +1,111 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Independent integer-time and mask check of the actual parameterized-replica owner allocation with PR2802 retired7 providers. + +Chronology/mask method derives from Tekalign's PR2751 independent_owners.py; +Marius-Paul Dumitrean's PR2802 retired7 native construction and the retained +provider frame checker keep their +upstream attribution. No solver, producer, emitter or floating arithmetic is +imported. This checks finite geometry, not global native/outer admission. +""" +from pathlib import Path +from collections import Counter,defaultdict +import argparse,hashlib,gzip,json,sys,types +sys.dont_write_bytecode=True +def need(v,msg): + if not v:raise ValueError(msg) +def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest() +def read(p): + b=Path(p).read_bytes();return json.loads(gzip.decompress(b)if str(p).endswith('.gz')else b) +def inputs(PROVIDER): + provider_pins={'inputs/PLAN.json.gz':'afb3c5c8134fc2cfce0b50a21758490c225574994b2c3c5161e53e2355acc6fa','inputs/GLOBAL-TEMPLATE.json.gz':'21297b20f1f2dc76eb9dd8124416068c3cb096bab9df17fa4da19bc68dfe082e','independent_local.py':'ee1faab70095fa312fc61d375ddf015b76104cb1a542ae7876a149e7999faa20','inputs/PROVIDERS.json':'391075b1411a3976850c633f92f58c35ed3f046f09d55bd435d7545124543fd4','inputs/WORD-base.json.gz':'dca8becca633ffc5e998985631bcbcab1123b27ca7f10ac6a96b1ec21ce69a66','inputs/WORD-extra.json.gz':'6bcb3c2c73eaf7558ddc6ef6b484334f8d96b9d2b227e265483b657de00f4bb7'} + hashes={} + for n,pin in provider_pins.items(): + p=PROVIDER/n;need(sha(p)==pin,'pinned PR2802 provider source '+n);hashes[str(p)]=pin + L=types.ModuleType('retained_independent_frames');exec(compile((PROVIDER/'independent_local.py').read_bytes(),'pinned_PR2802_independent_local.py','exec'),L.__dict__);providers=read(PROVIDER/'inputs/PROVIDERS.json') + for tag,pid in [('base','gauge44'),('extra','extra')]: + word=read(PROVIDER/f'inputs/WORD-{tag}.json.gz');report,start,ends=L.check_frames(word);L.check_cleanup(word);L.algebra(word) + widths=[L.dm(ends[k])-L.dm(start[k])for k in sorted(start)if k>=224] + need(widths==providers[pid]['widths']and len(widths)==408,'actual ordered provider frame widths');need(len(word['centers'])==8,'eight centres');providers[pid]['actual_paid_profile']={int(k):v for k,v in report['profile'].items()} + return read(PROVIDER/'inputs/PLAN.json.gz'),read(PROVIDER/'inputs/GLOBAL-TEMPLATE.json.gz'),providers,hashes + +def windows(template,order,T): + ranks={c['child']:c['rank']for c in template['idle_children']};pairs={e['stage']:e['pair']for e in template['recipe']if e['kind']=='local'} + blocks={};stage=None + for event in template['execution_schedule']: + if event['kind']in('bank_padding_cover_sweep','translate_every_live_family'):continue + if event['kind']=='local_cover_sweep':stage=event['stage'];blocks[stage]=[] + need(stage is not None,'source event before local call');blocks[stage].append(event) + need(set(blocks)==set(range(9)),'nine source stages') + progress=[0]*T;last={};result={} + for t,(stage,replica)in enumerate(order): + need(0<=replica0,'idle source position');start=last.get((replica,event['pair']),-1) + for child in event['child_indices']: + if child in ranks:result[replica,child]=(ranks[child],start,t) + elif kind in ('terminal_Y_translations','terminal'):pass # inherited terminal phase; no pending-window endpoints + else:raise ValueError('unknown source event kind') + need(progress==[9]*T,'complete replica source progression');return result + +def check(T,order,fill,dispatch,claimed,plan,template,providers): + need(type(T)is int and T>0,'positive T');N=9*T + need(len(order)==N and set(map(tuple,order))=={(s,r)for s in range(9)for r in range(T)},'complete T call coverage') + win=windows(template,order,T) + need(set(dispatch)==set(map(tuple,order))and all(p in providers for p in dispatch.values()),'provider dispatch coverage') + for s,r,pid in fill.get('dispatch_overrides',[]):need(dispatch.get((s,r))==pid,'final dispatch override binding') + need(fill['columns']==['time','helper','owner_replica','child','port','offset'],'literal role columns') + need(len(fill['rows'])==N*408,'complete role count');helpers=[0]*N;families=[0]*N;occupied={};lastrow={} + for idx,row in enumerate(fill['rows']): + need(len(row)==6 and all(type(x)is int for x in row),'integer role shape');t,h,o,c,p,z=row + need(0<=tlastrow[key][0]:lastrow[key]=(z,idx,w) + need(helpers==[(1<<408)-1]*N,'all helper identities');idle=Counter() + for(o,c),(cap,_,_)in win.items(): + for p in range(112): + key=(o,c,p);mask=occupied.get(key,0);used=mask.bit_count();need(mask==(1<= 704} + assert buffers == {704 + int(h) for h in word['helper_final']}, 'actual cleanup buffer/end-point bijection' + assert len(buffers) == BUFFERS, 'all 91 private buffers charged' + private_counts.add(len(buffers)) + providers[provider] = {'widths': widths, 'actual_paid_profile': {int(k): v for k, v in profile.items()}} + word_records[tag] = {'sha256': sha(path), 'local_profile': profile, 'width_inventory': inventory, 'private_buffers': len(buffers)} + assert len(private_counts) == 1 + registry = read(P / 'allocation/PROVIDERS.json') + assert {k: {'widths': v['widths'], 'actual_paid_profile': {int(r): n for r, n in v['actual_paid_profile'].items()}} for k, v in registry.items()} == providers + base = P / 'allocation' + order, fill = read(base / 'ORDER.json'), read(base / 'FILL.json.gz') + raw_dispatch = read(base / 'DISPATCH.json') + dispatch = {(s, r): provider for s, r, provider in raw_dispatch} + assert len(dispatch) == len(raw_dispatch), 'unique actual call/provider binding' + profile = read(base / 'PROFILE.json') + plan, template = read(base / 'vendor/PLAN.json.gz'), read(base / 'vendor/TEMPLATE.json.gz') + T = len(order) // 9 + def check(candidate=fill, claimed=profile): + return owners.check(T, order, candidate, dispatch, claimed, plan, template, providers) + result, _, _ = check() + assert T == 74 and result['roles'] == 271728 + result['physical'] = result['live'] + len(helpers) + len(word['centers']) + next(iter(private_counts)) + 2 + assert result['physical'] == PHYSICAL + result['physical_source'] = 'Actual 91-register private cleanup namespace, 408 live helpers, eight centres and two guards; global stock checked separately.' + controls = {} + def reject(name, candidate=fill, claimed=profile): + try: + check(candidate, claimed) + except ValueError as error: + controls[name] = str(error) + else: + raise AssertionError('owner corruption accepted: ' + name) + reject('missing_role', {**fill, 'rows': fill['rows'][:-1]}) + first = fill['rows'][0] + j = next(i for i, r in enumerate(fill['rows'][1:], 1) if r[0] == first[0]) + def mutate(index, row): + rows = list(fill['rows']); rows[index] = row + return {**fill, 'rows': rows} + duplicate = list(fill['rows'][j]); duplicate[1] = first[1] + reject('duplicate_helper', mutate(j, duplicate)) + collision = list(fill['rows'][j]); collision[2:5] = first[2:5] + reject('same_call_family_collision', mutate(j, collision)) + overflow = list(first); overflow[5] = 49 + reject('capacity_overflow', mutate(0, overflow)) + wrong = dict(profile); wrong['1'] = wrong.get('1', 0) + 1 + reject('changed_paid_profile', claimed=wrong) + exact = moment.run(base, base / 'baseline') + claim = read(P / 'CLAIM.json') + assert {str(k): v for k, v in profile.items()} == {str(k): v for k, v in claim['profile'].items()}, 'claimed complete profile' + baseline = read(base / 'baseline/CLAIM.json') + assert Q(exact['previous']) == Q(baseline['kappa']) < Q(exact['target']), 'strict gain over the PR2969 headline nomination' + assert all(sha(P / name) == digest for name, digest in {**word_pins, **allocation_pins}.items()), 'input drift' + result.update(status='PASS_RANK7_LITERAL_OWNERS_AND_EXACT_MOMENT', providers=word_records, + controls=controls, moment=exact, allocation_sha256=allocation_pins, + scope='Recounted local frames, exact whole-owner geometry and directed moment; algebra/native/global/outer admission remains separately required.') + (out / 'RESULT.json').write_text(json.dumps(result, sort_keys=True, indent=2) + '\n') + print(result['status'], exact['target_decimal'], exact['gain_decimal']) + +if __name__ == '__main__': + main() diff --git a/research/rank7-coupled-586-588-carrier-fold/check_cap.py b/research/rank7-coupled-586-588-carrier-fold/check_cap.py new file mode 100644 index 0000000000..3e830c64eb --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/check_cap.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Fractions-only certificates of the fixed-capacity packing caps of the parent and of every stage word, the literal gap of +the shipped allocation to the final cap, and exact comparisons with the current claims. + +certificates/RELAX-CAP.json stores the 10-pattern optimal basis of the fractional relaxation of the final words' inventory +{4:26,5:2,6:18,7:50,8:99,9:213} with local profile {1:2433,2:724,3:228,4:102,5:20,8:8} (bins 672/448/448/448 per replica of +capacity 8/16/32/48, all 2,551 count-vector patterns with widths 4..9, one idle child per bin, the complete per-call local +profile paid). certificates/RELAX-STAGES.json stores the optimal bases of the parent (PR2942, 1,163 patterns), of stage 1 +(joint rank-7 end frames) and of stage 2 (five extractions). tools/relax_exact.py checks, with exact rationals only, each +basis' primal feasibility (the cap is at least its root) and the sign of every pattern's reduced cost at the upper end of +the root bracket (weak duality: the cap is at most that end). The final optimum is FRACTIONAL per replica (basis +denominators 4 and 20), so no allocation realizes that basic solution literally at T74. This script checks that the +literal profile allocation/PROFILE.json is a complete profile of these words (666 calls x local + idle children, rank mass +74 x 65,088), that its exact root bracket lies below the cap (as weak duality requires), records the exact gap, and compares +the literal lower root exactly with the kappa fields of the pinned comparator claims (PR2979, PR2969 in allocation/baseline/, +and PR2966, PR2957, PR2942 in comparators/). No optimality of the literal fill among integral allocations is claimed. +Marius-Paul Dumitrean, with substantial AI assistance (Claude Code); extended by dcharb78 for R1_E42, R2_E7, B_586_438, B_588_440. +""" +import gzip, json, sys +from fractions import Fraction as Q +from pathlib import Path +P = Path(__file__).resolve().parent +sys.path.insert(0, str(P / 'tools')) +import relax_exact as RE +import root as R + +def read(path): + raw = path.read_bytes() + return json.loads(gzip.decompress(raw) if raw[:2] == b'\x1f\x8b' else raw) + +def verify(cert, patterns): + r = RE.verify_basis(cert['local_per_call'], cert['inventory_per_call'], cert['basis_patterns']) + assert r['status'] == 'PASS_EXACT_RELAXATION_CAP' and r['patterns'] == patterns + assert (Q(r['cap_lower']), Q(r['cap_upper'])) == (Q(cert['cap_lower']), Q(cert['cap_upper'])) + return r + +def main(): + if not __debug__: + raise SystemExit('refusing python -O') + cert = read(P / 'certificates/RELAX-CAP.json') + stages = read(P / 'certificates/RELAX-STAGES.json') + words = [read(P / f'edits/FINAL-WORD-{t}.json.gz') for t in ('base', 'extra')] + parents = [read(P / f'data/PARENT-{t}.json.gz') for t in ('base', 'extra')] + for w in words: + assert dict(w['report']['local_profile']) == cert['local_per_call'], 'certificate local profile = actual words' + assert dict(w['report']['width_inventory']) == cert['inventory_per_call'], 'certificate inventory = actual words' + for w in parents: + assert dict(w['report']['local_profile']) == stages['parent']['local_per_call'] and dict(w['report']['width_inventory']) == stages['parent']['inventory_per_call'] + r = verify(cert, 2551) + cap_lo, cap_hi = Q(r['cap_lower']), Q(r['cap_upper']) + ladder = [('parent', verify(stages['parent'], 1163)), ('stage1', verify(stages['stage1'], 2551)), ('stage2', verify(stages['stage2'], 2551)), ('final', r)] + assert all(Q(a[1]['cap_upper']) < Q(b[1]['cap_lower']) for a, b in zip(ladder, ladder[1:])), 'every stage raises the fixed-capacity cap' + T, calls = 74, 666 + fractional = {k: str(T * Q(v)) for k, v in r['idle_per_replica'].items() if (T * Q(v)).denominator != 1} + assert fractional, 'the optimal basic solution is fractional at T74' + profile = {int(k): v for k, v in read(P / 'allocation/PROFILE.json').items()} + assert sum(r_ * n for r_, n in profile.items()) == T * R.MASS_PER_REPLICA, 'complete rank mass 74 x 65088' + idle = dict(profile) + for k, v in cert['local_per_call'].items(): + idle[int(k)] = idle.get(int(k), 0) - calls * v + assert all(v >= 0 for v in idle.values()), 'literal profile pays the complete local profile of every call' + idle = {k: v for k, v in sorted(idle.items()) if v} + lo, hi = R.kappa_from_profile(profile, T) + assert lo < hi <= cap_hi and hi <= cap_lo + Q(1, 10 ** 25), 'literal root at most the cap (weak duality)' + gap = (cap_lo - hi, cap_hi - lo) + assert 0 < gap[0] <= gap[1] < Q(1, 10 ** 6), 'recorded gap' + controls = {} + try: + bad = [dict(e) for e in cert['basis_patterns']]; bad[0] = dict(bad[0]); bad[0]['widths'] = list(bad[0]['widths']) + [4] + RE.verify_basis(cert['local_per_call'], cert['inventory_per_call'], bad) + except Exception as error: + controls['perturbed_basis_pattern'] = str(error)[:160] + else: + raise AssertionError('perturbed basis accepted') + unskipped_local = dict(cert['local_per_call'], **{'1': 2445, '2': 718}) + stale = RE.verify_basis(unskipped_local, cert['inventory_per_call'], cert['basis_patterns']) + assert stale['status'] == 'PASS_EXACT_RELAXATION_CAP' and Q(stale['cap_upper']) < cap_lo, 'omitting R1_E42/R2_E7 skips gives a strictly lower cap' + controls['unskipped_local_profile_lowers_the_cap'] = 'cap %s < %s' % (stale['cap_upper'], cert['cap_lower']) + mismatched = RE.verify_basis(stages['stage2']['local_per_call'], cert['inventory_per_call'], cert['basis_patterns']) + assert mismatched['status'] == 'PASS_EXACT_RELAXATION_CAP_MASS_NOT_65088' and not mismatched['rank_mass_identity'] + controls['stage2_local_profile_with_lowered_inventory_fails_mass_identity'] = mismatched['status'] + try: + RE.verify_basis(cert['local_per_call'], cert['inventory_per_call'], stages['parent']['basis_patterns']) + except Exception as error: + controls['parent_basis_for_changed_inventory'] = str(error)[:160] + else: + raise AssertionError('the PR2942 basis must not certify the changed inventory') + over = dict(profile); over[48] -= 1; over[24] = over.get(24, 0) + 2 # a finer idle split of the same rank mass + if not R.kappa_from_profile(over, T)[1] < lo: + raise AssertionError('a finer idle split must lower the literal root (concavity)') + controls['finer_idle_split_lowers_root'] = 'PASS' + headline = lo // Q(1, 10 ** 24) * Q(1, 10 ** 24) - Q(1, 10 ** 46) - Q(1, 10 ** 70) + comparisons = {} + for name, path in [('pr2979', P / 'comparators/PR2979-CLAIM.json'), ('pr2969', P / 'allocation/baseline/CLAIM.json'), ('pr2966', P / 'comparators/PR2966-CLAIM.json'), + ('pr2957', P / 'comparators/PR2957-CLAIM.json'), ('pr2942', P / 'comparators/PR2942-CLAIM.json')]: + kappa = Q(read(path)['kappa']) + assert headline > kappa, ('strict gain over', name) + comparisons[name] = {'kappa': str(kappa), 'gain': str(headline - kappa), 'gain_float': float(headline - kappa)} + out = dict(status='PASS_LITERAL_ALLOCATION_BELOW_FIXED_INVENTORY_CAP_WITH_RECORDED_GAP', cap_lower=str(cap_lo), cap_upper=str(cap_hi), + literal_lower=str(lo), literal_upper=str(hi), gap_lower=str(gap[0]), gap_upper=str(gap[1]), gap_float=float(gap[0]), + tight_patterns=r['tight_patterns'], strict_patterns=r['strict_patterns'], idle_per_replica=r['idle_per_replica'], + fractional_at_T74=fractional, literal_idle=idle, profile={str(k): v for k, v in sorted(profile.items())}, controls=controls, + stage_caps={name: {'cap_lower': rr['cap_lower'], 'cap_upper': rr['cap_upper'], 'patterns': rr['patterns']} for name, rr in ladder}, + headline=str(headline), comparisons=comparisons) + print(json.dumps(out, sort_keys=True)) + +if __name__ == '__main__': + main() diff --git a/research/rank7-coupled-586-588-carrier-fold/comparators/PR2942-CLAIM.json b/research/rank7-coupled-586-588-carrier-fold/comparators/PR2942-CLAIM.json new file mode 100644 index 0000000000..53d9edee7e --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/comparators/PR2942-CLAIM.json @@ -0,0 +1,80 @@ +{ + "admitted_package_manifest_sha256": "86513bcfac5c9554a03a6ba7c00dae7b856a6197007c923205d23c7abba6ec0c", + "baseline_head": "81f3b5d12977eba09e06fbff729167d59faabe90", + "baseline_kappa": "17224999064432745643569999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "baseline_pr": 2930, + "calls": 666, + "complex_lower": "430704079965803581999/250000000000000000000000", + "extractions": [ + { + "helper": 249, + "normal": 45, + "step": 1 + }, + { + "helper": 267, + "normal": 45, + "step": 2 + }, + { + "helper": 251, + "normal": 45, + "step": 3 + }, + { + "helper": 265, + "normal": 45, + "step": 4 + } + ], + "fill_sha256": "1880caffbea87cf9e946be60528fbc68c119e8e2ff56df9370b6cc373fc50e66", + "fixed_inventory_cap": { + "cap_lower": "17228172707428495209099/10000000000000000000000000", + "cap_upper": "172281727074284952091/100000000000000000000000", + "realized": "below the fractional optimum by the recorded gap (check_cap.py); the cap basis is fractional at T74" + }, + "gain": "316413419939763639/1000000000000000000000000", + "helpers": 408, + "independent_inputs": 632, + "kappa": "17228163198632143279959999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017228163198632143279959999999999999999999998999999999999999999999999", + "live_families": 66304, + "local_profile": { + "1": 2434, + "2": 632, + "3": 286, + "4": 104, + "5": 26, + "8": 8 + }, + "native_receipt_sha256": "0261d8834cfa6de1b654d9539c19fce9c762bf94de97d6d055cee06f85859909", + "physical_families": 66808, + "previous_open_claim": { + "head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "kappa": "17215886471978018806049999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "pr": 2917 + }, + "profile": { + "1": 1638360, + "14": 1, + "2": 420912, + "3": 196337, + "4": 69264, + "48": 27291, + "5": 23531, + "8": 5328 + }, + "release_receipt_sha256": "c2f14611d571c3b2f3482d480d4f91f698fa73568a3af7b7b7db632a9c369a48", + "replicas": 74, + "scope": "Conditional finite supplier/outer certificate for PR2917's words plus four paired extractions at hyperplane normal 45 with a new literal T74 allocation. Inherited all-size/compiler/theorem hypotheses remain. No selected-frontier change or independent-human-review claim.", + "source_manifest_sha256": "79956f19c5c3d4d1ad3578e4b3d6844bc54c1f3680825fc87c80cc04f069dae8", + "status": "CONDITIONAL_CANDIDATE_COMPLETE_FINITE_RELEASE", + "width_inventory": { + "4": 26, + "5": 2, + "7": 62, + "8": 100, + "9": 218 + }, + "zero_buffers": 86 +} diff --git a/research/rank7-coupled-586-588-carrier-fold/comparators/PR2957-CLAIM.json b/research/rank7-coupled-586-588-carrier-fold/comparators/PR2957-CLAIM.json new file mode 100644 index 0000000000..cff1a70ed8 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/comparators/PR2957-CLAIM.json @@ -0,0 +1,32 @@ +{ + "admitted_package_manifest_sha256": "c77e262bf8009e3052b0c93377f4b67f70965e0ec4d3db493760e25203fcf6df", + "baseline_head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "baseline_kappa": "17215886471978018806049999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "baseline_pr": 2917, + "calls": 666, + "complex_lower": "1723717415070738170971/1000000000000000000000000", + "fill_sha256": "e045aa613f8fba06d81313f5e1c2cbec9ee94552163b8d1eb9205bf2fa7f2285", + "gain": "1064383936468145183/500000000000000000000000", + "helpers": 408, + "independent_inputs": 632, + "kappa": "17237174150707381709709999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017237174150707381709709999999999999999999998999999999999999999999999", + "live_families": 66304, + "native_receipt_sha256": "b6b139824c9c848b0dbad1675242834d8f642c4448ad8b88bc6b9f8c06be578e", + "physical_families": 66804, + "profile": { + "1": 1623708, + "2": 423576, + "3": 189810, + "4": 77256, + "5": 24198, + "8": 5328, + "48": 27158 + }, + "release_receipt_sha256": "67cfa2eedab8db985dce07fe074c782599e4425fc8106ed1155bfe7aa789a53f", + "replicas": 74, + "scope": "Conditional finite supplier/outer certificate for PR2917's unchanged words with a new literal T74 allocation. Inherited all-size/compiler/theorem hypotheses remain. No selected-frontier change or independent-human-review claim.", + "source_manifest_sha256": "e10893e19f1fdb3fd5d66d4e1199f5cc957e7c006ea32fddeca4b95bffced9a0", + "status": "CONDITIONAL_CANDIDATE_COMPLETE_FINITE_RELEASE", + "zero_buffers": 82 +} diff --git a/research/rank7-coupled-586-588-carrier-fold/comparators/PR2966-CLAIM.json b/research/rank7-coupled-586-588-carrier-fold/comparators/PR2966-CLAIM.json new file mode 100644 index 0000000000..8f1ad730dd --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/comparators/PR2966-CLAIM.json @@ -0,0 +1,91 @@ +{ + "admitted_package_manifest_sha256": "ea8665c7c7ea255cabe8f8d2a3224b52533a5d0de66661092fd7f07f44090a02", + "baseline_head": "81f3b5d12977eba09e06fbff729167d59faabe90", + "baseline_kappa": "17224999064432745643569999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "baseline_pr": 2930, + "calls": 666, + "complex_lower": "431008568130863044353/250000000000000000000000", + "declared_rewrites": { + "classes": [ + "R-retime", + "A3779-cut-start-read", + "PM-carrier-lender-entry", + "B-carrier-retime", + "A-commuting-swap" + ], + "count": 14, + "rewrites_sha256": "9c37fc5f989c81a26de3b2e3c29b87c1c9e1caa2565b1b89d2bf2eb6aec800da" + }, + "extractions": [ + { + "helper": 249, + "normal": 45, + "step": 1 + }, + { + "helper": 267, + "normal": 45, + "step": 2 + }, + { + "helper": 251, + "normal": 45, + "step": 3 + }, + { + "helper": 265, + "normal": 45, + "step": 4 + } + ], + "fill_sha256": "1880caffbea87cf9e946be60528fbc68c119e8e2ff56df9370b6cc373fc50e66", + "fixed_inventory_cap": { + "cap_lower": "3448070449496209757101/2000000000000000000000000", + "cap_upper": "8620176123740524392753/5000000000000000000000000", + "realized": "below the fractional optimum by the recorded gap (check_cap.py); the cap basis is fractional at T74" + }, + "gain": "306873216035522611/200000000000000000000000", + "helpers": 408, + "independent_inputs": 632, + "kappa": "17240342725234521774119999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017240342725234521774119999999999999999999998999999999999999999999999", + "live_families": 66304, + "local_profile": { + "1": 2430, + "2": 628, + "3": 282, + "4": 110, + "5": 26, + "8": 8 + }, + "native_receipt_sha256": "a33112ee7e03cc09bc91e618e7d0e3db98cbd8b9ead274ca58eb8ea3af1047bd", + "physical_families": 66808, + "previous_open_claim": { + "head": "a027b0f6", + "kappa": "17228163198632143279959999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "pr": 2942 + }, + "profile": { + "1": 1635696, + "14": 1, + "2": 418248, + "3": 193673, + "4": 73260, + "48": 27291, + "5": 23531, + "8": 5328 + }, + "release_receipt_sha256": "42941b91683a38b6daa1ba953fa51b839123606a68d81a10868c2c998ce448d3", + "replicas": 74, + "scope": "Conditional finite supplier/outer certificate for PR2942's words (PR2917's words plus four paired extractions at hyperplane normal 45, PR2942's literal T74 allocation unchanged) with fourteen declared exactness-preserving gate rewrites in five classes. Inherited all-size/compiler/theorem hypotheses remain. No selected-frontier change or independent-human-review claim.", + "source_manifest_sha256": "f18779d932cd2b42709e9ba6d4a5e72bb6619ee39a3256a1f13d49f195ec5e3a", + "status": "CONDITIONAL_CANDIDATE_COMPLETE_FINITE_RELEASE", + "width_inventory": { + "4": 26, + "5": 2, + "7": 62, + "8": 100, + "9": 218 + }, + "zero_buffers": 86 +} diff --git a/research/rank7-coupled-586-588-carrier-fold/comparators/PR2979-CLAIM.json b/research/rank7-coupled-586-588-carrier-fold/comparators/PR2979-CLAIM.json new file mode 100644 index 0000000000..8ec2ce4e44 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/comparators/PR2979-CLAIM.json @@ -0,0 +1,216 @@ +{ + "admitted_package_manifest_sha256": "d287f0b1f5a0c73e832483075ec34c75b5c4164a6f8958d466feb53ddc0da6e8", + "baseline_head": "e2ca469b08385d3d5e29a918d66dbefaf889e9f3", + "baseline_kappa": "17240352247481048785499999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "baseline_pr": 2969, + "baseline_status": "FINITE_NATIVE_OWNER_AND_MOMENT_CANDIDATE_OUTER_PENDING", + "calls": 666, + "complex_lower": "1729033982646513517717/1000000000000000000000000", + "fill_sha256": "c2136be9434cda511a1a8a44d98f9f72ea5376830a8426674253b4ee351c4c39", + "fixed_inventory_cap": { + "cap_lower": "432258941218879045361/250000000000000000000000", + "cap_upper": "17290357648755161814441/10000000000000000000000000", + "realized": "below the fractional optimum by the recorded gap (check_cap.py); the cap basis is fractional at T74" + }, + "gain": "4998757898408639167/1000000000000000000000000", + "helpers": 408, + "independent_inputs": 632, + "kappa": "17290339826465135177169999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017290339826465135177169999999999999999999998999999999999999999999999", + "live_families": 66304, + "local_profile": { + "1": 2445, + "2": 706, + "3": 232, + "4": 108, + "5": 18, + "8": 8 + }, + "native_receipt_sha256": "6d27c89d5e3a2c7f28387e4b20c462b0dff6c9fa92aacdde715d4b29cc286d41", + "physical_families": 66813, + "previous_claims": { + "pr2942": { + "claim_file": "comparators/PR2942-CLAIM.json", + "gain": "6217662783299189721/1000000000000000000000000", + "head": "a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf", + "kappa": "17228163198632143279959999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "pr": 2942 + }, + "pr2957": { + "claim_file": "comparators/PR2957-CLAIM.json", + "gain": "2658283787887673373/500000000000000000000000", + "head": "b74b25f3ccc84c16e1a801d73b2f47e5ea764c78", + "kappa": "17237174150707381709709999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "pr": 2957 + }, + "pr2966": { + "claim_file": "comparators/PR2966-CLAIM.json", + "gain": "999942024612268061/200000000000000000000000", + "head": "e62d3eb9005117d82a9babcfa937ecc53237c490", + "kappa": "17240342725234521774119999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "pr": 2966 + }, + "pr2969": { + "claim_file": "allocation/baseline/CLAIM.json", + "gain": "4998757898408639167/1000000000000000000000000", + "head": "e2ca469b08385d3d5e29a918d66dbefaf889e9f3", + "kappa": "17240352247481048785499999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "pr": 2969 + } + }, + "profile": { + "1": 1645680, + "2": 470196, + "3": 159468, + "4": 71928, + "48": 28190, + "5": 13716, + "8": 5328 + }, + "release_receipt_sha256": "473a5f8e048e45d7e83747077a18985ef87d58da370ca3f2fe5748a057ffdb2d", + "replicas": 74, + "scope": "Conditional finite supplier/outer certificate for our PR2942 words with a joint rank-7 end-frame lowering of 22 restored helpers, five further paired extractions and Jeremy Kothe's fourteen declared PR2957 rewrites, with a new literal T74 allocation; compared against Dugongue's PR2969 headline nomination (outer release pending there). Inherited all-size/compiler/theorem hypotheses remain. No selected-frontier change or independent-human-review claim.", + "source_manifest_sha256": "751b46364742cbb947f7db07c130ff09085b38b52c520d3b47f2dadc1e21ba80", + "stages": { + "stage1": { + "frame_edits": 139, + "groups": { + "A": { + "W": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ], + "helpers": [ + 331, + 450, + 451, + 508, + 509 + ] + }, + "B": { + "W": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ], + "helpers": [ + 299, + 448, + 449, + 484, + 485 + ] + }, + "C": { + "W": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ], + "helpers": [ + 452, + 453, + 532, + 533 + ] + }, + "D": { + "W": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ], + "helpers": [ + 454, + 455, + 556, + 557 + ] + }, + "V45": { + "W": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ], + "helpers": [ + 249, + 251, + 265, + 267 + ] + } + }, + "kind": "joint codimension-2 end-frame lowering (frame-only)", + "record_sha256": "5fbfce004330ebc1fbac8de264614fe295f1a074811b478db4892c3bc3852cd3" + }, + "stage2": { + "extractions": [ + { + "helper": 226, + "normal": 42, + "step": 1 + }, + { + "helper": 228, + "normal": 42, + "step": 2 + }, + { + "helper": 230, + "normal": 42, + "step": 3 + }, + { + "helper": 363, + "normal": 7, + "step": 4 + }, + { + "helper": 395, + "normal": 7, + "step": 5 + } + ], + "kind": "rank-8 paired input/output extractions" + }, + "stage3": { + "applier_sha256": "2509f1335e47543f8814b42d6bf83032b30c5899b4f7cc62a6adc03f5138ae13", + "count": 14, + "kind": "declared exactness-preserving gate rewrites (Jeremy Kothe, PR2957), re-addressed", + "rewrites_sha256": "a37ade675876e4f5b00b33066c84f495fccd264863b7eb5d813837b1d01c3e7d" + } + }, + "status": "CONDITIONAL_CANDIDATE_COMPLETE_FINITE_RELEASE", + "width_inventory": { + "4": 26, + "5": 2, + "6": 16, + "7": 52, + "8": 99, + "9": 213 + }, + "zero_buffers": 91 +} diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/STAGE-PRICES.json b/research/rank7-coupled-586-588-carrier-fold/construction/STAGE-PRICES.json new file mode 100644 index 0000000000..b06b369ace --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/STAGE-PRICES.json @@ -0,0 +1,1019 @@ +{ + "note": "Search-time pricing with the certified frame solver (r12 harness on the #1186 toolkit, exact chain dual decomposition) by lanes A and RW of round r14; units of 2^-40 at the base saving b. Evidence only: the claim rests on verify.py, check_allocation.py, check_cap.py and the complete admission. verify.py recomputes the literal stage prices from the frame-report profiles with these weights and checks them against this table.", + "weights": { + "c": { + "1": 2116671, + "2": 4228346, + "3": 6338140, + "4": 8446713, + "5": 10554378, + "6": 12661320, + "7": 14767661, + "8": 16873488, + "9": 18978865 + }, + "b": "0.001703676387993676", + "definition": "c_r = floor(2^40 * T_r(b)), the solver integer surrogate of the per-child moment term of rank r", + "break_even": 2091300, + "break_even_definition": "the round value guide: local saving that buys one freed width unit at fixed packing (about c1 - 25,371); margins below are -delta - k * break_even" + }, + "stage1": { + "groups": [ + { + "group": "V45", + "W": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ], + "helpers": [ + 249, + 251, + 265, + 267 + ], + "singles_margin": { + "249": -53141, + "251": -53141, + "265": -53141, + "267": -53141 + }, + "joint_delta": -8388172, + "joint_margin": 22972, + "subsets": [ + { + "helpers": [ + 249 + ], + "delta": -2038159, + "margin": -53141 + }, + { + "helpers": [ + 251 + ], + "delta": -2038159, + "margin": -53141 + }, + { + "helpers": [ + 265 + ], + "delta": -2038159, + "margin": -53141 + }, + { + "helpers": [ + 267 + ], + "delta": -2038159, + "margin": -53141 + }, + { + "helpers": [ + 249, + 251 + ], + "delta": -4154830, + "margin": -27770 + }, + { + "helpers": [ + 249, + 265 + ], + "delta": -4154830, + "margin": -27770 + }, + { + "helpers": [ + 249, + 267 + ], + "delta": -4154830, + "margin": -27770 + }, + { + "helpers": [ + 251, + 265 + ], + "delta": -4154830, + "margin": -27770 + }, + { + "helpers": [ + 251, + 267 + ], + "delta": -4154830, + "margin": -27770 + }, + { + "helpers": [ + 265, + 267 + ], + "delta": -4154830, + "margin": -27770 + }, + { + "helpers": [ + 249, + 251, + 265 + ], + "delta": -6271501, + "margin": -2399 + }, + { + "helpers": [ + 249, + 251, + 267 + ], + "delta": -6271501, + "margin": -2399 + }, + { + "helpers": [ + 249, + 265, + 267 + ], + "delta": -6271501, + "margin": -2399 + }, + { + "helpers": [ + 251, + 265, + 267 + ], + "delta": -6271501, + "margin": -2399 + }, + { + "helpers": [ + 249, + 251, + 265, + 267 + ], + "delta": -8388172, + "margin": 22972 + } + ] + }, + { + "group": "A", + "W": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ], + "helpers": [ + 331, + 450, + 451, + 508, + 509 + ], + "singles_margin": { + "450": -19901, + "508": -21782, + "331": -58943, + "451": -14905, + "509": -21782 + }, + "joint_delta": -10499041, + "joint_margin": 42541 + }, + { + "group": "B", + "W": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ], + "helpers": [ + 299, + 448, + 449, + 484, + 485 + ], + "singles_margin": { + "484": -21782, + "448": -14905, + "485": -21782, + "299": -58943, + "449": -14905 + }, + "joint_delta": -10499041, + "joint_margin": 42541 + }, + { + "group": "C", + "W": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ], + "helpers": [ + 452, + 453, + 532, + 533 + ], + "singles_margin": { + "453": -14905, + "532": -16786, + "452": -16786, + "533": -16786 + }, + "joint_delta": -8382370, + "joint_margin": 17170 + }, + { + "group": "D", + "W": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ], + "helpers": [ + 454, + 455, + 556, + 557 + ], + "singles_margin": { + "556": -16786, + "454": -14905, + "557": -16786, + "455": -16786 + }, + "joint_delta": -8382370, + "joint_margin": 17170 + } + ], + "pairwise_unions": [ + { + "Ws": [ + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ], + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + ], + "helpers": [ + 299, + 331, + 448, + 449, + 450, + 451, + 484, + 485, + 508, + 509 + ], + "joint_delta": -20998082, + "joint_margin": 85082 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ], + [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + ], + "helpers": [ + 331, + 450, + 451, + 452, + 453, + 508, + 509, + 532, + 533 + ], + "joint_delta": -18881411, + "joint_margin": 59711 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ], + [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + ], + "helpers": [ + 331, + 450, + 451, + 454, + 455, + 508, + 509, + 556, + 557 + ], + "joint_delta": -18881411, + "joint_margin": 59711 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ], + [ + 256, + 128, + 65, + 33, + 18, + 10, + 6 + ] + ], + "helpers": [ + 331, + 450, + 451, + 508, + 509, + 588 + ], + "joint_delta": -12586996, + "joint_margin": 39196 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ], + [ + 256, + 128, + 70, + 32, + 18, + 12, + 1 + ] + ], + "helpers": [ + 331, + 450, + 451, + 508, + 509, + 586 + ], + "joint_delta": -12586996, + "joint_margin": 39196 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ], + [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + ], + "helpers": [ + 299, + 448, + 449, + 452, + 453, + 484, + 485, + 532, + 533 + ], + "joint_delta": -18881411, + "joint_margin": 59711 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ], + [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + ], + "helpers": [ + 299, + 448, + 449, + 454, + 455, + 484, + 485, + 556, + 557 + ], + "joint_delta": -18881411, + "joint_margin": 59711 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ], + [ + 256, + 128, + 65, + 33, + 18, + 10, + 6 + ] + ], + "helpers": [ + 299, + 448, + 449, + 484, + 485, + 588 + ], + "joint_delta": -12586996, + "joint_margin": 39196 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ], + [ + 256, + 128, + 70, + 32, + 18, + 12, + 1 + ] + ], + "helpers": [ + 299, + 448, + 449, + 484, + 485, + 586 + ], + "joint_delta": -12586996, + "joint_margin": 39196 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ], + [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + ], + "helpers": [ + 452, + 453, + 454, + 455, + 532, + 533, + 556, + 557 + ], + "joint_delta": -16764740, + "joint_margin": 34340 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ], + [ + 256, + 128, + 65, + 33, + 18, + 10, + 6 + ] + ], + "helpers": [ + 452, + 453, + 532, + 533, + 588 + ], + "joint_delta": -10470325, + "joint_margin": 13825 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ], + [ + 256, + 128, + 70, + 32, + 18, + 12, + 1 + ] + ], + "helpers": [ + 452, + 453, + 532, + 533, + 586 + ], + "joint_delta": -10470325, + "joint_margin": 13825 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ], + [ + 256, + 128, + 65, + 33, + 18, + 10, + 6 + ] + ], + "helpers": [ + 454, + 455, + 556, + 557, + 588 + ], + "joint_delta": -10470325, + "joint_margin": 13825 + }, + { + "Ws": [ + [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ], + [ + 256, + 128, + 70, + 32, + 18, + 12, + 1 + ] + ], + "helpers": [ + 454, + 455, + 556, + 557, + 586 + ], + "joint_delta": -10470325, + "joint_margin": 13825 + }, + { + "Ws": [ + [ + 256, + 128, + 65, + 33, + 18, + 10, + 6 + ], + [ + 256, + 128, + 70, + 32, + 18, + 12, + 1 + ] + ], + "helpers": [ + 586, + 588 + ], + "joint_delta": -4175910, + "joint_margin": -6690 + } + ], + "unused_single_W_groups": [ + { + "W": [ + 256, + 128, + 65, + 33, + 18, + 10, + 6 + ], + "helpers": [ + 588 + ], + "margin": -3345 + }, + { + "W": [ + 256, + 128, + 70, + 32, + 18, + 12, + 1 + ], + "helpers": [ + 586 + ], + "margin": -3345 + } + ], + "literal_price_units": -46150994, + "freed_width_units": 22, + "margin": 142394, + "groups_independent": true, + "leave_one_out_reported": "lane A (combine.py, base provider): leaving any single helper out of its group costs 23,490 .. 25,371 units, so every member contributes; not stored per helper", + "candidates": "necessary condition: the lowered end frame W must contain L_h, the solver lower bound at h's last vertex; over all 86 restored helpers exactly 20 (end dim 8, L_h dim 7, W = L_h) plus PR2942's four pivots qualify; no helper has slack for a two-dimension lowering" + }, + "stage2": { + "steps": [ + { + "step": 1, + "normal": 42, + "helper": 226, + "delta": -2101683 + }, + { + "step": 2, + "normal": 42, + "helper": 228, + "delta": -2106679 + }, + { + "step": 3, + "normal": 42, + "helper": 230, + "delta": -2101683 + }, + { + "step": 4, + "normal": 7, + "helper": 363, + "delta": -2106679 + }, + { + "step": 5, + "normal": 7, + "helper": 395, + "delta": -2106679 + } + ], + "literal_price_units": -10523403, + "freed_width_units": 5, + "margin": 66903, + "kopt_on_stage1_word": { + "7": { + "margin": 30758, + "k": 2, + "X": [ + 5, + 73, + 363, + 395 + ], + "P": [ + 363, + 395 + ] + }, + "42": { + "margin": 26153, + "k": 3, + "P": [ + 226, + 228, + 230 + ], + "realized_margin": 36145 + }, + "25": { + "margin": 20766, + "k": 2, + "P": [ + 232, + 363 + ], + "note": "conflicts with normal 7 (shares pivot 363)" + }, + "52": { + "margin": 20766, + "k": 2 + }, + "76/82/97/127": { + "margin": -34529 + }, + "486/504": { + "margin": -29645 + } + }, + "recensus_after_stage2": { + "7": "pairing rank 0", + "42": "pairing rank 0", + "52": "pairing rank 0", + "25": { + "margin": -34529, + "k": 1 + } + }, + "on_parent_without_stage1": "kopt on PR2942 words: best margin -29,645 (486/504); no positive normal" + }, + "stage3": { + "rewrites": { + "5997": -4996, + "6000": -4996, + "6004": -4996, + "6008": -4996, + "3779": -3102, + "swap3749": -3102, + "swap3755": -3102, + "swap3761": -3102, + "swap3767": -3102, + "swap3773": -3102, + "1564": -6877, + "1569": -6877, + "4604": 0, + "4630": 0 + }, + "literal_price_units": -52350, + "additive": "the composed delta equals the sum of the single-rewrite deltas, the same -52,350 as on PR2917 and PR2942 words", + "credit": "rewrites by Jeremy Kothe (jeremykothe2), PR2957; re-addressed to this word with exact preimages by our lane RW" + }, + "codim2_census": { + "subspaces": 43435, + "theorem": "a 7-dim V lies in exactly three hyperplanes E_n1, E_n2, E_(n1 xor n2), and the admissible pairing at V restricts the pairing at each of them, so a fresh helper can pair at V only if all three normals pair", + "rows": [ + { + "word": "PR2894 parent (literal frames)", + "normals_with_pairing": [ + 52, + 76, + 82, + 97, + 127, + 486, + 504 + ], + "V_all_three": 0, + "V_nonzero": 0 + }, + { + "word": "PR2917 (lowered frames)", + "normals_with_pairing": [ + 7, + 25, + 42, + 45, + 52, + 76, + 82, + 97, + 127, + 486, + 504 + ], + "V_all_three": 4, + "V_nonzero": 1, + "V": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ], + "note": "V45 = E_7 n E_42 n E_45, prank 4: the normal-45 structure itself" + }, + { + "word": "PR2942", + "normals_with_pairing": [ + 7, + 25, + 42, + 52, + 76, + 82, + 97, + 127, + 486, + 504 + ], + "V_all_three": 0, + "V_nonzero": 0 + }, + { + "word": "stage 1 (L22)", + "normals_with_pairing": [ + 7, + 25, + 42, + 52, + 76, + 82, + 97, + 127, + 486, + 504 + ], + "V_all_three": 0, + "V_nonzero": 0 + } + ], + "pr2918_consistency": "at E7 = (256,128,66,36,22,8,1) on the PR2894 parent: non-restored R_V = {105, 408}; with restored helpers allowed R = {105,307,309,314,369,371,373,378,408,572,573}, |H| = 226, dimA = dimB = 0, as RossRichardson's PR2918 (research/helper408-rank7-pairing)" + }, + "caps": { + "PR2942": "0.0017228172707428495209099", + "stage1": "0.0017262265796413098725813", + "stage2": "0.0017278107473204236839366", + "stage3": "0.001729035764875516181444" + }, + "total": { + "literal_price_units": -56726747, + "freed_width_units": 27, + "margin": 261647 + } +} diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-FACE-MIX.json b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-FACE-MIX.json new file mode 100644 index 0000000000..d079f74a86 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-FACE-MIX.json @@ -0,0 +1 @@ +{"T": 37, "catalogue": "all", "chronology": "pr2833-t37", "gain_vs_PR2917_claim_exact_lower": "81858478447348217532000000000000000000001000000000000000000000001/10000000000000000000000000000000000000000000000000000000000000000000000", "gain_vs_PR2917_claim_float": 8.185847844734822e-06, "gain_vs_PR2917_root_lower_float": 8.185847844734822e-06, "gain_vs_PR2930_claim_exact_lower": "72745885992621380012000000000000000000001000000000000000000000001/10000000000000000000000000000000000000000000000000000000000000000000000", "gain_vs_PR2930_claim_float": 7.274588599262138e-06, "gain_vs_PR2966_float": 5.740222519084525e-06, "gain_vs_PR2966_headline24": "2870111259542262473/500000000000000000000000", "gap_to_relaxation_cap": 2.9996360603095285e-09, "headline_floor24_minus": "17297744950425367023579999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", "idle": {"1": 8658, "24": 1, "3": 2448, "48": 14128, "5": 693}, "kappa_lower": "8648872475212683511791/5000000000000000000000000", "kappa_lower_decimal": "0.0017297744950425367023582", "kappa_upper": "17297744950425367023583/10000000000000000000000000", "kappa_upper_decimal": "0.0017297744950425367023583", "mode": "T37 Hall-window repacked face mix on {4:26, 5:2, 6:18, 7:50, 8:99, 9:213} (before T74 cross-half remainder consolidation)", "profile": {"1": 818847, "2": 241092, "24": 1, "3": 78372, "4": 33966, "48": 14128, "5": 7353, "8": 2664}, "relaxation_cap_lower": "17297774946785970118869/10000000000000000000000000", "relaxation_cap_upper": "1729777494678597011887/1000000000000000000000000", "relaxation_cap_upper_decimal": "0.0017297774946785970118870", "target": [[8, [0, 0, 0, 0, 1, 0], 24864], [16, [0, 0, 0, 0, 2, 0], 1054], [16, [0, 0, 0, 1, 0, 1], 15522], [24, [0, 0, 0, 0, 0, 0], 1], [32, [0, 0, 0, 0, 0, 3], 693], [32, [0, 0, 0, 2, 0, 2], 1062], [32, [0, 0, 1, 0, 1, 2], 5994], [32, [0, 1, 0, 0, 0, 3], 666], [32, [1, 0, 0, 0, 0, 3], 8658], [48, [0, 0, 0, 0, 0, 0], 14128], [48, [0, 0, 0, 0, 0, 5], 2448]], "widths": [4, 5, 6, 7, 8, 9]} diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-FLOW.json.gz b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-FLOW.json.gz new file mode 100644 index 0000000000..592ca15f43 Binary files /dev/null and b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-FLOW.json.gz differ diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-MODEL.json b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-MODEL.json new file mode 100644 index 0000000000..56d7f7b6a6 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-MODEL.json @@ -0,0 +1 @@ +{"T":37,"catalogue":"tight","chronology":"pr2833-t37","constraints":102076,"flow_variables":161893,"groups":333,"nonzeros":587115,"pattern_variables":851,"patterns_per_cap":{"16":2,"32":5,"48":3,"8":1},"variables":162744,"workers":1} \ No newline at end of file diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-PATTERNS.json b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-PATTERNS.json new file mode 100644 index 0000000000..d336810756 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-PATTERNS.json @@ -0,0 +1 @@ +{"T":37,"catalogue":"tight","chronology":"pr2833-t37","gain_vs_PR2917_claim_exact_lower":"81858478447348217532000000000000000000001000000000000000000000001/10000000000000000000000000000000000000000000000000000000000000000000000","gain_vs_PR2917_claim_float":8.185847844734822e-06,"gain_vs_PR2917_root_lower_float":8.185847844734822e-06,"gain_vs_PR2930_claim_exact_lower":"72745885992621380012000000000000000000001000000000000000000000001/10000000000000000000000000000000000000000000000000000000000000000000000","gain_vs_PR2930_claim_float":7.274588599262138e-06,"gain_vs_PR2966_float":5.740222519084525e-06,"gain_vs_PR2966_headline24":"2870111259542262473/500000000000000000000000","gap_to_relaxation_cap":2.9996360603095285e-09,"headline_floor24_minus":"17297744950425367023579999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000","idle":{"1":8658,"24":1,"3":2448,"48":14128,"5":693},"kappa_lower":"8648872475212683511791/5000000000000000000000000","kappa_lower_decimal":"0.0017297744950425367023582","kappa_upper":"17297744950425367023583/10000000000000000000000000","kappa_upper_decimal":"0.0017297744950425367023583","mode":"file","profile":{"1":818847,"2":241092,"24":1,"3":78372,"4":33966,"48":14128,"5":7353,"8":2664},"relaxation_cap_lower":"17297774946785970118869/10000000000000000000000000","relaxation_cap_upper":"1729777494678597011887/1000000000000000000000000","relaxation_cap_upper_decimal":"0.0017297774946785970118870","target":[[8,[0,0,0,0,1,0],24864],[16,[0,0,0,0,2,0],1054],[16,[0,0,0,1,0,1],15522],[24,[0,0,0,0,0,0],1],[32,[0,0,0,0,0,3],693],[32,[0,0,0,2,0,2],1062],[32,[0,0,1,0,1,2],5994],[32,[0,1,0,0,0,3],666],[32,[1,0,0,0,0,3],8658],[48,[0,0,0,0,0,0],14128],[48,[0,0,0,0,0,5],2448]],"widths":[4,5,6,7,8,9]} diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-SOLVER.json b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-SOLVER.json new file mode 100644 index 0000000000..9caa9b34c2 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T37-SOLVER.json @@ -0,0 +1 @@ +{"T":37,"candidate":true,"catalogue":"tight","chronology":"pr2833-t37","hint_fill":null,"hint_flow":null,"hint_zeros":false,"max_time_seconds":900,"seconds":153.71478509902954,"seed":1,"status":"OPTIMAL","workers":1} \ No newline at end of file diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T74-CONTROLS.json b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T74-CONTROLS.json new file mode 100644 index 0000000000..2f26a17b0b --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T74-CONTROLS.json @@ -0,0 +1,197 @@ +{ + "T": 74, + "auditor": "tools/audit_allocation_moment.py", + "auditor_sha256": "c632527ecf092f013862660dbd7f52b599a50b321a8aa88ddc45af0547e79cb5", + "baseline": "allocation/baseline (PR2969)", + "buffers": 91, + "chronology": "pr2917-t74", + "controls": { + "capacity_overflow": "bin capacity", + "changed_paid_profile": "complete claimed profile", + "duplicate_helper": "duplicate helper", + "missing_role": "complete role count", + "same_call_family_collision": "same-call family collision" + }, + "engine": { + "calls": 666, + "idle": { + "1": 17314, + "3": 4893, + "39": 1, + "48": 28256, + "5": 1390 + }, + "live": 66304, + "physical": 66794, + "profile": { + "1": 1637692, + "2": 482184, + "3": 156741, + "39": 1, + "4": 67932, + "48": 28256, + "5": 14710, + "8": 5328 + }, + "rank_mass": 4816512, + "replicas": 74, + "roles": 271728 + }, + "files_sha256": { + "DISPATCH.json": "65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c", + "FILL.json.gz": "68b8bae90144248774b1920cd27f9519caa3dc427704d8a9da6d4c491d912fc4", + "ORDER.json": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1", + "OWNER-CHECK.json": "045d1321f9ac46a755590dc309580f5784fcecd2a82704392045c67f5ff0933e", + "PROFILE.json": "a815694364065a6d1275c59c17235f4cf400d28d8f7fe3bb3314c57c35dee44c", + "PROVIDERS.json": "52eb0d85caa7b2d4a93acdf5011f52b793f61ddca86235fb03cd9a09397ad4cd", + "SEARCH.json": "aff630fad679c7c5773f16f92dce6234e5b5519626861e9bd83b9884f002066f" + }, + "fill_sha256": "68b8bae90144248774b1920cd27f9519caa3dc427704d8a9da6d4c491d912fc4", + "gain_vs_PR2917_claim": "8187442207318453633/1000000000000000000000000", + "gain_vs_PR2917_claim_float": 8.187442207318453e-06, + "gain_vs_PR2930_claim": "7276182961845769881/1000000000000000000000000", + "gain_vs_PR2930_claim_float": 7.27618296184577e-06, + "gain_vs_PR2966_float": 5.741816881668157e-06, + "gain_vs_PR2966_headline": "2870908440834078413/500000000000000000000000", + "gain_vs_PR2979_float": 7.421067586068165e-07, + "gain_vs_PR2979_headline": "742106758606816521/1000000000000000000000000", + "headline_target": "0.0017297760894051203342379999999999999999999998999999999999999999999999", + "moment": { + "W": 66304, + "baseline_claim_sha256": "656a4c93411b078753783513e2e71b1722a56e7b70120264a38118811982fa77", + "baseline_profile_sha256": "6de8ac1fd628cdd2afa5a43872da69c7dab9d7219bdc318f9db55fd8ccdb5eb2", + "controls": [ + "zero log/exp identities", + "overstated endpoint", + "added rank32 charge" + ], + "gain": "717608082126931961/125000000000000000000000", + "gain_decimal": "0.000005740864657015455688", + "lower": "86488804470256016711923/50000000000000000000000000", + "method": "Independent 128-term atanh / degree24 exponential with explicit positive tails and outward 192-bit dyadic rounding", + "new_moment_at_full_prior": [ + "6276999487161712068211621764195475858266123505793579358277/6277101735386680763835789423207666416102355444464034512896", + "6276999487161712068211621764195475858266123505793579358279/6277101735386680763835789423207666416102355444464034512896" + ], + "normalized_profile_delta": { + "1": 661713920, + "2": 21196062720, + "3": -12243630336, + "4": -1766338560, + "5": -2924669440, + "39": 331520, + "48": 319850496 + }, + "oldW": 331520, + "outer_endpoint": "864888044702560167119/500000000000000000000000", + "previous": "17240352247481048785499999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "profile_sha256": "a815694364065a6d1275c59c17235f4cf400d28d8f7fe3bb3314c57c35dee44c", + "scope": "Complete paid histogram and exact moment only; full native/physical/outer release is separate.", + "status": "PASS_SEPARATE_EXACT_RATIONAL_FRONTIER_MOMENT", + "target": "17297760894051203342379999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "target_decimal": "0.0017297760894051203342379999999999999999999998999999999999999999999999", + "upper": "172977608940512033423847/100000000000000000000000000" + }, + "packing_variants": { + "t37_doubled": { + "kappa_hi": "0.0017297744950425367023583", + "kappa_lo": "0.0017297744950425367023582", + "report": { + "calls": 666, + "idle": { + "1": 17316, + "24": 2, + "3": 4896, + "48": 28256, + "5": 1386 + }, + "live": 66304, + "physical": 66794, + "profile": { + "1": 1637694, + "2": 482184, + "24": 2, + "3": 156744, + "4": 67932, + "48": 28256, + "5": 14706, + "8": 5328 + }, + "rank_mass": 4816512, + "replicas": 74, + "roles": 271728 + } + }, + "t74_optimal_idle39": { + "kappa_hi": "0.0017297760894051203342385", + "kappa_lo": "0.0017297760894051203342384", + "report": { + "calls": 666, + "idle": { + "1": 17314, + "3": 4893, + "39": 1, + "48": 28256, + "5": 1390 + }, + "live": 66304, + "physical": 66794, + "profile": { + "1": 1637692, + "2": 482184, + "3": 156741, + "39": 1, + "4": 67932, + "48": 28256, + "5": 14710, + "8": 5328 + }, + "rank_mass": 4816512, + "replicas": 74, + "roles": 271728 + } + }, + "t74_upgraded_idle41": { + "kappa_hi": "0.0017297760709756247306045", + "kappa_lo": "0.0017297760709756247306044", + "report": { + "calls": 666, + "idle": { + "1": 17316, + "3": 4895, + "41": 1, + "48": 28256, + "5": 1388 + }, + "live": 66304, + "physical": 66794, + "profile": { + "1": 1637694, + "2": 482184, + "3": 156743, + "4": 67932, + "41": 1, + "48": 28256, + "5": 14708, + "8": 5328 + }, + "rank_mass": 4816512, + "replicas": 74, + "roles": 271728 + } + } + }, + "physical": 66813, + "registry": "allocation/PROVIDERS.json", + "relaxation_cap": [ + "17297774946785970118869/10000000000000000000000000", + "1729777494678597011887/1000000000000000000000000" + ], + "root_bracket": [ + "1081110055878200208899/625000000000000000000000", + "3459552178810240668477/2000000000000000000000000" + ], + "root_lower_decimal": "0.0017297760894051203342384", + "status": "PASS_C1_INDEPENDENT_RECHECK", + "target_vs_PR2917_claim_decimal": "8187442207318453633/1000000000000000000000000" +} diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T74-OWNER-CHECK.json b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T74-OWNER-CHECK.json new file mode 100644 index 0000000000..33b38457c7 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/T74-OWNER-CHECK.json @@ -0,0 +1 @@ +{"T":74,"calls":666,"chronology":"pr2917-t74","engine_sha256":"77a848729159e271ba64f403dfd59dddb13044b17b2950fa56700f442e2fe461","gain_vs_PR2917_claim_exact_lower":"81874422073184536334000000000000000000001000000000000000000000001/10000000000000000000000000000000000000000000000000000000000000000000000","gain_vs_PR2917_claim_float":8.187442207318453e-06,"gain_vs_PR2917_root_lower_float":8.187442207318453e-06,"gain_vs_PR2930_claim_exact_lower":"72761829618457698814000000000000000000001000000000000000000000001/10000000000000000000000000000000000000000000000000000000000000000000000","gain_vs_PR2930_claim_float":7.27618296184577e-06,"gain_vs_PR2966_float":5.741816881668157e-06,"gain_vs_PR2966_headline24":"2870908440834078413/500000000000000000000000","gain_vs_PR2979_float":7.421067586068165e-07,"gain_vs_PR2979_headline24":"742106758606816521/1000000000000000000000000","gap_to_relaxation_cap":1.4052734766776483e-09,"headline_floor24_minus":"17297760894051203342379999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000","idle":{"1":17314,"3":4893,"39":1,"48":28256,"5":1390},"inventory":{"extra":{"4":26,"5":2,"6":18,"7":50,"8":99,"9":213},"gauge44":{"4":26,"5":2,"6":18,"7":50,"8":99,"9":213}},"kappa_lower":"1081110055878200208899/625000000000000000000000","kappa_lower_decimal":"0.0017297760894051203342384","kappa_upper":"3459552178810240668477/2000000000000000000000000","kappa_upper_decimal":"0.0017297760894051203342385","live":66304,"local":{"1":2433,"2":724,"3":228,"4":102,"5":20,"8":8},"payload_sha256":{"DISPATCH.json":"65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c","FILL.json.gz":"68b8bae90144248774b1920cd27f9519caa3dc427704d8a9da6d4c491d912fc4","ORDER.json":"519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1","PROFILE.json":"a815694364065a6d1275c59c17235f4cf400d28d8f7fe3bb3314c57c35dee44c","PROVIDERS.json":"52eb0d85caa7b2d4a93acdf5011f52b793f61ddca86235fb03cd9a09397ad4cd"},"physical":66813,"physical_formula":"live + 408 helpers + 8 centres + 91 private buffers + 2 guards","profile":{"1":1637692,"2":482184,"3":156741,"39":1,"4":67932,"48":28256,"5":14710,"8":5328},"rank_mass":4816512,"relaxation_cap_lower":"17297774946785970118869/10000000000000000000000000","relaxation_cap_upper":"1729777494678597011887/1000000000000000000000000","relaxation_cap_upper_decimal":"0.0017297774946785970118870","replicas":74,"roles":271728,"solver":"T74_optimal_idle39 (repacked from T37 chronological Hall-window flow + cross-half remainder consolidation)","status":"PASS_VENDORED_PR2839_OWNER_ENGINE_CHECK"} diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/assemble.py b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/assemble.py new file mode 100644 index 0000000000..f5ba21b6ad --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/assemble.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +"""assemble.py SRC DEST --providers P.json --words BASE.json.gz EXTRA.json.gz --label L --note TEXT [--extra-json K=V ...] +Copies a checked T74 fill directory (FILL/ORDER/DISPATCH/OWNER-CHECK/CONTROLS) into PR2917's allocation layout: +PROFILE.json reformatted (indent 2, int-ordered, no newline), PROVIDERS.json = the given registry bytes, vendor/ = PR2917's engine/PLAN/TEMPLATE, +SEARCH.json (method/lineage/numbers), then writes DEST-PINS (sha256 of every file) next to DEST.""" +import argparse, hashlib, json, pathlib, shutil +ap = argparse.ArgumentParser(); ap.add_argument('src'); ap.add_argument('dest'); ap.add_argument('--providers', required=True) +ap.add_argument('--words', nargs=2, required=True); ap.add_argument('--label', required=True); ap.add_argument('--note', default='') +a = ap.parse_args() +P17 = pathlib.Path('S/r13/vendor/pr2917/research/paired-helper-extension') +src, dest = pathlib.Path(a.src), pathlib.Path(a.dest) +assert not dest.exists() +(dest / 'vendor').mkdir(parents=True) +for n in ['FILL.json.gz', 'ORDER.json', 'DISPATCH.json', 'OWNER-CHECK.json']: + shutil.copy(src / n, dest / n) +shutil.copy(a.providers, dest / 'PROVIDERS.json') +for n in ['independent_owners.py', 'PLAN.json.gz', 'TEMPLATE.json.gz']: + shutil.copy(P17 / 'allocation/vendor' / n, dest / 'vendor' / n) +prof = json.load(open(src / 'PROFILE.json')) +(dest / 'PROFILE.json').write_text(json.dumps({str(k): prof[str(k)] for k in sorted(int(k) for k in prof)}, indent=2)) +oc = json.load(open(src / 'OWNER-CHECK.json')) +ct = json.load(open(src / 'CONTROLS.json')) if (src / 'CONTROLS.json').exists() else {} +words = {t: hashlib.sha256(pathlib.Path(p).read_bytes()).hexdigest() for t, p in zip(('base', 'extra'), a.words)} +search = dict(status='C1_FLOW_ROUTE_LITERAL_FILL_' + a.label, note=a.note, words_sha256=words, chronology=oc.get('chronology'), solver=oc.get('solver'), seed=oc.get('seed'), + catalogue=oc.get('catalogue'), pattern_mix=oc.get('pattern_mix'), idle_histogram=oc['idle'], profile=oc['profile'], roles=oc['roles'], replicas=oc['T'], calls=oc['calls'], + physical=oc['physical'], kappa_root_bracket=[oc['kappa_lower'], oc['kappa_upper']], kappa_root_lower_decimal=oc['kappa_lower_decimal'], + relaxation_cap_bracket=[oc['relaxation_cap_lower'], oc['relaxation_cap_upper']], gap_to_relaxation_cap_float=oc['gap_to_relaxation_cap'], + moment_auditor=ct.get('moment', {}).get('status'), headline=ct.get('headline_target'), order_and_dispatch_unchanged_vs_PR2917=True, + lineage='PR2917 (mason-hale) chronology/engine; PR2930/PR2942 fills; r14 lane A words; PR2857 flow model and realization; PR2839 owner engine; lane C r12 relax/root/fill tools; r13/r14 lane C1.') +(dest / 'SEARCH.json').write_text(json.dumps(search, sort_keys=True, indent=1) + '\n') +pins = {p.relative_to(dest).as_posix(): hashlib.sha256(p.read_bytes()).hexdigest() for p in sorted(dest.rglob('*')) if p.is_file()} +pathlib.Path(str(dest) + '-PINS.json').write_text(json.dumps(pins, sort_keys=True, indent=1)) +print('assembled', dest); [print(v, k) for k, v in pins.items()] diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/controls.py b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/controls.py new file mode 100644 index 0000000000..b739058bf2 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/controls.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +"""controls.py -- independent re-verification of a produced allocation directory exactly the way #2917's check_allocation.py does: +fresh load of the vendored PR2839 engine from #2917's package, owner.check(T, ORDER, FILL, DISPATCH, PROFILE(claimed), PLAN, TEMPLATE, PROVIDERS), +the five semantic rejection controls (missing role, duplicate helper, same-call family collision, capacity overflow, changed paid profile), +the 82-buffer physical display (live + 408 + 8 + 82 + 2), and #2917's own exact dyadic moment auditor tools/audit_allocation_moment.run +(candidate = the directory, source = #2917's allocation/baseline = PR2908's pinned claim), plus root.py's bracket. +Usage: python controls.py OUT_DIR [--chronology pr2833-t37|pr2917-t74|pr2833-t74] (writes OUT_DIR/CONTROLS.json)""" +import os, sys +os.environ['PYTHONDONTWRITEBYTECODE'] = '1' +sys.dont_write_bytecode = True +import argparse, gzip, hashlib, json, pathlib, types, collections +from fractions import Fraction as Q +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import root as R +import relax as X +import fill17 as F + +def load(name, path): + m = types.ModuleType(name); m.__file__ = str(path); sys.modules[name] = m + exec(compile(path.read_bytes(), str(path), 'exec'), m.__dict__); return m + +ap = argparse.ArgumentParser(); ap.add_argument('out', type=pathlib.Path); ap.add_argument('--chronology', default=None) +ap.add_argument('--registry', type=pathlib.Path, default=F.PKG17 / 'allocation/PROVIDERS.json', help='PROVIDERS registry the fill must match (content)') +ap.add_argument('--buffers', type=int, default=82) +ap.add_argument('--auditor', type=pathlib.Path, default=F.PKG17 / 'tools/audit_allocation_moment.py') +ap.add_argument('--baseline', type=pathlib.Path, default=F.PKG17 / 'allocation/baseline') +a = ap.parse_args() +out = a.out.resolve() +assert hashlib.sha256(F.ENGINE.read_bytes()).hexdigest() == F.ENGINE_SHA +owners = load('c1_owners', F.ENGINE) +moment = load('c1_moment', a.auditor) +order, fill, raw_dispatch = F.read(out / 'ORDER.json'), F.read(out / 'FILL.json.gz'), F.read(out / 'DISPATCH.json') +profile = F.read(out / 'PROFILE.json'); providers_raw = F.read(out / 'PROVIDERS.json') +providers = {k: {'widths': v['widths'], 'actual_paid_profile': {int(r): n for r, n in v['actual_paid_profile'].items()}} for k, v in providers_raw.items()} +# the provider registry must be exactly #2917's (same widths per id, same local profile) +reg = F.read(a.registry) +assert {k: (v['widths'], {int(r): n for r, n in v['actual_paid_profile'].items()}) for k, v in reg.items()} == {k: (v['widths'], v['actual_paid_profile']) for k, v in providers.items()}, 'PROVIDERS differ from the registry' +dispatch = {(s, r): p for s, r, p in raw_dispatch}; assert len(dispatch) == len(raw_dispatch) +chron = a.chronology or json.load(open(out / 'OWNER-CHECK.json'))['chronology'] +template, plan, c_order, c_dispatch, T = F.load_chronology(chron) +assert order == c_order and raw_dispatch == c_dispatch, 'ORDER/DISPATCH are not the %s chronology' % chron +assert len(order) // 9 == T +def check(candidate=fill, claimed=profile): + return owners.check(T, order, candidate, dispatch, claimed, plan, template, providers) +result, _, _ = check() +assert result['roles'] == 9 * T * 408 +physical = result['live'] + 408 + 8 + a.buffers + 2 +controls = {} +def reject(name, candidate=fill, claimed=profile): + try: + check(candidate, claimed) + except ValueError as e: + controls[name] = str(e) + else: + raise AssertionError('owner corruption accepted: ' + name) +reject('missing_role', {**fill, 'rows': fill['rows'][:-1]}) +first = fill['rows'][0] +j = next(i for i, r in enumerate(fill['rows'][1:], 1) if r[0] == first[0]) +def mutate(index, row): + rows = list(fill['rows']); rows[index] = row; return {**fill, 'rows': rows} +duplicate = list(fill['rows'][j]); duplicate[1] = first[1]; reject('duplicate_helper', mutate(j, duplicate)) +collision = list(fill['rows'][j]); collision[2:5] = first[2:5]; reject('same_call_family_collision', mutate(j, collision)) +overflow = list(first); overflow[5] = 49; reject('capacity_overflow', mutate(0, overflow)) +wrong = dict(profile); wrong['1'] = wrong.get('1', 0) + 1; reject('changed_paid_profile', claimed=wrong) +# #2917's own exact dyadic moment auditor (source = its allocation/baseline = PR2908's pinned claim/profile/order) +exact = moment.run(out, a.baseline) +prof = {int(k): v for k, v in profile.items()} +k_lo, k_hi = R.kappa_from_profile(prof, T) +inv = collections.Counter(providers['gauge44']['widths']) +rel = X.relax(providers['gauge44']['actual_paid_profile'], dict(inv)) +res = dict(status='PASS_C1_INDEPENDENT_RECHECK', chronology=chron, T=T, engine=result, physical=physical, controls=controls, moment=exact, + root_bracket=[str(k_lo), str(k_hi)], root_lower_decimal=R.mpmath_str(k_lo, 25), relaxation_cap=[rel['cap_lower'], rel['cap_upper']], + gain_vs_PR2917_claim=str(Q(exact['target']) - F.PR2917_KAPPA), gain_vs_PR2917_claim_float=float(Q(exact['target']) - F.PR2917_KAPPA), + target_vs_PR2917_claim_decimal=str(Q(exact['target']) - F.PR2917_KAPPA), headline_target=exact['target_decimal'], + gain_vs_PR2930_claim=str(Q(exact['target']) - F.PR2930_KAPPA), gain_vs_PR2930_claim_float=float(Q(exact['target']) - F.PR2930_KAPPA), + gain_vs_PR2966_headline=str(Q(exact['target']) + Q(1, 10 ** 46) + Q(1, 10 ** 70) - F.PR2966_HEAD24), gain_vs_PR2966_float=float(Q(exact['target']) + Q(1, 10 ** 46) + Q(1, 10 ** 70) - F.PR2966_HEAD24), + registry=str(a.registry), buffers=a.buffers, auditor=str(a.auditor), auditor_sha256=hashlib.sha256(a.auditor.read_bytes()).hexdigest(), baseline=str(a.baseline), + fill_sha256=hashlib.sha256((out / 'FILL.json.gz').read_bytes()).hexdigest(), files_sha256={p.name: hashlib.sha256(p.read_bytes()).hexdigest() for p in sorted(out.iterdir()) if p.is_file()}) +(out / 'CONTROLS.json').write_text(json.dumps(res, sort_keys=True, indent=1, default=str) + '\n') +print(json.dumps({k: res[k] for k in ['status', 'chronology', 'T', 'physical', 'root_lower_decimal', 'gain_vs_PR2917_claim_float', 'gain_vs_PR2930_claim_float', 'gain_vs_PR2930_claim', 'gain_vs_PR2966_headline', 'gain_vs_PR2966_float', 'headline_target']}, indent=1)) +print('engine', result['roles'], result['idle'], 'rank_mass', result['rank_mass']) +print('controls', {k: v for k, v in controls.items()}) +print('moment auditor', exact['status'], 'lower', exact['lower'], 'upper', exact['upper'], 'target', exact['target_decimal'][:40], 'gain vs baseline claim', exact['gain_decimal'][:30], 'previous', exact['previous'][:30]) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/diag_lp.py b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/diag_lp.py new file mode 100644 index 0000000000..47fb31be1b --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/diag_lp.py @@ -0,0 +1,165 @@ +#!/usr/bin/env python3 +"""diag_lp.py -- chronological flow LP diagnostics (HiGHS) for a target pattern mix: + mode elastic : global pattern targets become soft (slack +/-), minimize total slack -> which pattern counts the chronology forces to move + mode free : no global targets, catalogue = given patterns, minimize the linearized moment sum_bins H_idle(b*) -> fractional chronological optimum +Usage: python diag_lp.py --chronology pr2833-t37 --providers P.json --mix PATTERNS.json --mode elastic + python diag_lp.py --chronology pr2833-t37 --providers P.json --mode free --catalogue tight+6 [--out mix.json]""" +import os, sys +os.environ['PYTHONDONTWRITEBYTECODE'] = '1' +sys.dont_write_bytecode = True +import argparse, collections, json, pathlib, time, types +import numpy as np +from scipy.sparse import coo_matrix +from scipy.optimize import linprog +from fractions import Fraction as Q +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import fill17 as F, relax as X + +ap = argparse.ArgumentParser() +ap.add_argument('--chronology', default='pr2833-t37'); ap.add_argument('--providers', required=True) +ap.add_argument('--mix'); ap.add_argument('--mode', choices=['elastic', 'free', 'calls'], default='elastic') +ap.add_argument('--catalogue', default='tight', help="free mode: 'tight' (relaxation tight + single residues + empty) | 'rc:' (all patterns with reduced cost <= x in H units)") +ap.add_argument('--out') +a = ap.parse_args() +owner = types.ModuleType('o'); exec(compile(F.ENGINE.read_bytes(), 'o', 'exec'), owner.__dict__) +template, plan, order, dispatch, T = F.load_chronology(a.chronology) +providers = F.load_providers(pathlib.Path(a.providers)) +disp = {(s, r): p for s, r, p in dispatch} +inv_by_call = [collections.Counter(providers[disp[tuple(sr)]]['widths']) for sr in order] +loc = next(iter(providers.values()))['actual_paid_profile'] +WID = sorted({w for inv in inv_by_call for w in inv}) +avg = collections.Counter() +for inv in inv_by_call: + for w, n in inv.items(): + avg[w] += Q(n, len(order)) +rel = X.relax(loc, avg) +b = float((Q(rel['cap_lower']) + Q(rel['cap_upper'])) / 2) +if a.mode in ('elastic', 'calls'): + mf = json.load(open(a.mix)) + assert [int(w) for w in mf['widths']] == WID + target = {(int(c), tuple(q)): int(n) for c, q, n in mf['target']} + cat = collections.defaultdict(set) + for (c, q) in target: + cat[c].add(q) +elif a.mix: + mf = json.load(open(a.mix)) + assert [int(w) for w in mf['widths']] == WID + cat = collections.defaultdict(set) + for c, q, n in mf['target']: + cat[int(c)].add(tuple(q)) + target = None +else: + pats = X.patterns(X.BINS, WID) + if a.catalogue == 'tight': + keep = {(t['capacity'], tuple(t['widths'].count(w) for w in WID)) for t in rel['tight_pattern_list']} + for cap in X.BINS: + for i, w in enumerate(WID): + if w <= cap: + keep.add((cap, tuple(int(j == i) for j in range(len(WID))))) + keep.add((cap, tuple(0 for _ in WID))) + else: + thr = float(a.catalogue.split(':')[1]) + # reduced cost at b from the exact dual rows Y (H-basis): rc = H_idle - y_cap - sum n_w y_w + Y = rel['dual_Y'] + def yv(row): + return sum(float(Q(v)) * X.Hfloat(int(k), b) for k, v in Y[row].items()) + keep = set() + for cap, counts, r in pats: + rc = X.Hfloat(r, b) - yv('cap%d' % cap) - sum(n * yv('w%d' % w) for w, n in zip(WID, counts)) + if rc <= thr: + keep.add((cap, counts)) + cat = collections.defaultdict(set) + for cap, counts, r in pats: + if (cap, counts) in keep: + cat[cap].add(counts) + target = None +print('catalogue sizes', {c: len(v) for c, v in sorted(cat.items())}, 'b*', b, flush=True) +win = owner.windows(template, order, T) +need = {t: collections.Counter(inv_by_call[t]) for t in range(len(order))} +groups = collections.defaultdict(list) +for (o, c), (cap, lo, hi) in win.items(): + for port in range(112): + groups[cap, tuple(range(max(0, lo + 1), min(len(order), hi + 1)))].append((o, c, port)) +G = sorted(groups) +rows_eq, rows_ub = [], [] +edge, ncol = [], [0] +cost = [] +def var(c=0.0): + j = ncol[0]; ncol[0] += 1; cost.append(c); return j +eq_rhs, ub_rhs = [], [] +def eq(r): + i = len(eq_rhs); eq_rhs.append(r); return ('e', i) +def ub(r): + i = len(ub_rhs); ub_rhs.append(r); return ('u', i) +E = [] +def put(row, v, n): + E.append((row[0], row[1], v, n)) +Xv, Zv = {}, {} +callrow = {(t, w): eq(n) for t, cnt in need.items() for w, n in cnt.items() if n} +short = {} +if a.mode == 'calls': + for key, r in callrow.items(): + sv = var(1.0); put(r, sv, 1); short[key] = sv +globalrow = {} +if target is not None and a.mode == 'elastic': + for key, n in target.items(): + r = eq(n); globalrow[key] = r + sp, sm = var(1.0), var(1.0) + put(r, sp, 1); put(r, sm, -1) +for gi, (cap, ts) in enumerate(G): + nb = len(groups[G[gi]]) + br = eq(nb) + for q in sorted(cat[cap]): + idle = cap - sum(w * k for w, k in zip(WID, q)) + if idle < 0: + continue + xv = var(X.Hfloat(idle, b) if (target is None and idle) else 0.0) + Xv[gi, q] = xv + put(br, xv, 1) + if (cap, q) in globalrow: + put(globalrow[cap, q], xv, 1) + residual = {w: q[j] for j, w in enumerate(WID) if q[j]} + wr = {w: eq(0) for w in residual} + for w, n in residual.items(): + put(wr[w], xv, -n) + for t in ts: + tr = ub(0) + put(tr, xv, -1) + for w in residual: + if (t, w) not in callrow: + continue + zv = var(0.0) + Zv[gi, q, t, w] = zv + put(tr, zv, 1); put(wr[w], zv, 1); put(callrow[t, w], zv, 1) +n = ncol[0] +Ae = coo_matrix(([e[3] for e in E if e[0] == 'e'], ([e[1] for e in E if e[0] == 'e'], [e[2] for e in E if e[0] == 'e'])), shape=(len(eq_rhs), n)).tocsr() +Au = coo_matrix(([e[3] for e in E if e[0] == 'u'], ([e[1] for e in E if e[0] == 'u'], [e[2] for e in E if e[0] == 'u'])), shape=(len(ub_rhs), n)).tocsr() +print('LP vars', n, 'eq', len(eq_rhs), 'ub', len(ub_rhs), flush=True) +t0 = time.time() +res = linprog(np.array(cost), A_ub=Au, b_ub=np.array(ub_rhs, dtype=float), A_eq=Ae, b_eq=np.array(eq_rhs, dtype=float), bounds=(0, None), method='highs', options={'time_limit': 1200}) +print('LP status', res.status, res.message, '%.1f s' % (time.time() - t0), 'objective', res.fun, flush=True) +if res.x is not None: + usage = collections.Counter() + for (gi, q), v in Xv.items(): + if res.x[v] > 1e-7: + usage[G[gi][0], q] += res.x[v] + out = {} + for (cap, q), x in sorted(usage.items()): + name = '%d:%s' % (cap, '+'.join(str(w) for w, k in zip(WID, q) for _ in range(k)) or 'empty') + tgt = target.get((cap, q), 0) if target is not None else None + out[name] = (round(x, 3), tgt) + for k, v in out.items(): + if target is None or abs(v[0] - v[1]) > 1e-6: + print(' ', k, v) + if short: + sh = collections.Counter() + for (t, w), sv in short.items(): + if res.x[sv] > 1e-7: + sh[t, w] += res.x[sv] + print('call shortfalls (t, w): amount', sorted(((k, round(v, 3)) for k, v in sh.items()))[:80], 'total', round(sum(sh.values()), 3)) + print('calls with shortfall', sorted({t for t, w in sh})) + if target is not None and a.mode == 'elastic': + missing = {('%d:%s' % (c, q)): n for (c, q), n in target.items() if usage.get((c, q), 0) < n - 1e-6} + print('targets under-supplied:', missing) + if a.out: + json.dump(dict(widths=WID, usage={k: v[0] for k, v in out.items()}, objective=res.fun, b=b), open(a.out, 'w'), indent=1) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/double.py b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/double.py new file mode 100644 index 0000000000..f002703372 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/double.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 +"""double.py -- if #2917's T74 chronology is the exact interleaving of two copies of PR2833's T37 chronology +(order74[2k] = order37[k], order74[2k+1] = (stage, replica+37), dispatch copied), a T37 fill doubles into a T74 fill +on #2917's OWN chronology: row (t,h,o,c,p,z) -> (2t,h,o,c,p,z) and (2t+1,h,o+37,c,p,z). Verified by the vendored engine. +Usage: python double.py T37_DIR OUT_DIR [--providers PROVIDERS.json] [--buffers 82]""" +import os, sys +os.environ['PYTHONDONTWRITEBYTECODE'] = '1' +sys.dont_write_bytecode = True +import argparse, collections, hashlib, json, pathlib, types, time +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import root as R, relax as X, fill17 as F +ap = argparse.ArgumentParser(); ap.add_argument('src'); ap.add_argument('out'); ap.add_argument('--providers', default=None); ap.add_argument('--buffers', type=int, default=82) +a = ap.parse_args() +src, out = pathlib.Path(a.src).resolve(), pathlib.Path(a.out).resolve() +out.mkdir(parents=True, exist_ok=False) +owner = types.ModuleType('frozen_owner'); exec(compile(F.ENGINE.read_bytes(), 'frozen_owner', 'exec'), owner.__dict__) +t37 = F.load_chronology('pr2833-t37'); t74 = F.load_chronology('pr2917-t74') +order37, disp37 = t37[2], {(s, r): p for s, r, p in t37[3]} +template, plan, order74, dispatch74, T = t74 +disp74 = {(s, r): p for s, r, p in dispatch74} +ok_order = all(order74[2 * k] == order37[k] and order74[2 * k + 1] == [order37[k][0], order37[k][1] + 37] for k in range(333)) +ok_disp = all(disp74[(s, r)] == disp37[(s, r)] and disp74[(s, r + 37)] == disp37[(s, r)] for s, r in map(tuple, order37)) +print('order74 == interleave(order37, order37+37):', ok_order, '; dispatch copied:', ok_disp) +assert ok_order and ok_disp +fill37 = F.read(src / 'FILL.json.gz') +providers = F.load_providers(pathlib.Path(a.providers) if a.providers else F.PKG17 / 'allocation/PROVIDERS.json') +assert F.read(src / 'PROVIDERS.json')['gauge44']['widths'] == providers['gauge44']['widths'] +rows = [] +for t, h, o, c, p, z in fill37['rows']: + rows.append([2 * t, h, o, c, p, z]); rows.append([2 * t + 1, h, o + 37, c, p, z]) +fill = {'columns': fill37['columns'], 'dispatch_overrides': [], 'method': fill37.get('method', '') + ' | doubled from the T37 fill onto #2917 T74 chronology (order74 = interleave of two T37 copies; double.py)', 'rows': sorted(rows)} +t0 = time.time() +result, _, _ = owner.check(T, order74, fill, disp74, None, plan, template, providers) +print('engine PASS in %.1f s' % (time.time() - t0), result['roles'], result['idle'], 'rank_mass', result['rank_mass'], 'live', result['live']) +profile = {int(k): v for k, v in result['profile'].items()} +prof37 = {int(k): v for k, v in F.read(src / 'PROFILE.json').items()} +assert profile == {r: 2 * n for r, n in prof37.items()}, 'profile is not 2x the T37 profile' +inv = collections.Counter(providers['gauge44']['widths']) +rel = X.relax(providers['gauge44']['actual_paid_profile'], dict(inv)) +k_lo, k_hi, pr = F.price(profile, T, rel) +prov_out = {pid: {'actual_paid_profile': {str(r): n for r, n in providers[pid]['actual_paid_profile'].items()}, 'widths': providers[pid]['widths']} for pid in providers} +payload_sha = {} +for n, obj in [('ORDER.json', order74), ('FILL.json.gz', fill), ('DISPATCH.json', dispatch74), ('PROFILE.json', {str(k): v for k, v in sorted(profile.items())}), ('PROVIDERS.json', prov_out)]: + F.save(out / n, obj); payload_sha[n] = hashlib.sha256(json.dumps(obj, sort_keys=True, separators=(',', ':')).encode()).hexdigest() +check = dict(result, status='PASS_VENDORED_PR2839_OWNER_ENGINE_CHECK', solver='DOUBLED_FROM_T37_FILL ' + str(src), chronology='pr2917-t74', T=T, calls=len(order74), + physical=result['live'] + 408 + 8 + a.buffers + 2, physical_formula='live + 408 helpers + 8 centres + %d private buffers + 2 guards' % a.buffers, + inventory={pid: dict(sorted(inv.items())) for pid in providers}, local=providers['gauge44']['actual_paid_profile'], engine_sha256=F.ENGINE_SHA, payload_sha256=payload_sha, **pr) +F.save(out / 'OWNER-CHECK.json', check) +print('physical', check['physical'], 'KAPPA', pr['kappa_lower_decimal'], '..', pr['kappa_upper_decimal'], 'cap', rel['cap_upper_decimal'], 'gap %.3e' % pr['gap_to_relaxation_cap'], 'gain vs PR2917 claim %.6e' % pr['gain_vs_PR2917_claim_float'], 'gain vs PR2930 claim %.6e' % pr['gain_vs_PR2930_claim_float']) +print('payload sha', payload_sha) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/fill17.py b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/fill17.py new file mode 100644 index 0000000000..d2a5186783 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/fill17.py @@ -0,0 +1,608 @@ +#!/usr/bin/env python3 +"""fill17.py -- lane C's fill.py (r12) adapted to PR #2917's words: literal owner allocation for #2917's exact +per-provider widths (allocation/PROVIDERS.json) under a chosen chronology, with the integer pattern mix of relax.py, +CP-SAT (single thread), edge-colouring realization, the vendored PR2839 owner engine (sha 77a84872..., the same file +#2917 ships in allocation/vendor/) and root.py's exact bracket. Also replays/prices any literal fill (--check-fill). + +Chronologies: + pr2833-t37 : PR2833 T37 owners chronology (333 calls) as used by PR2857/lane C (template/plan from PR2857 sources) + pr2833-t74 : PR2833 borrow-fill chronology (666 calls) + pr2917-t74 : #2917's own allocation/ORDER.json + DISPATCH.json (666 calls; = PR2908's, 'inherited chronology') +Template and plan payloads are byte-identical across the packages (decompressed sha 514e5931..., 163431bf...). + +Usage (AGI venv = OR-Tools 9.15; num_search_workers MUST be 1 on this machine): + $AGI -B fill17.py --work OUT/x --chronology pr2833-t37 --catalogue tight --hint-flow PR2857/FLOW.json.gz --hint-zeros --seed 7 --seconds 900 + $AGI -B fill17.py --work OUT/x --chronology pr2917-t74 --catalogue tight --hint-fill PR2917/allocation/FILL.json.gz --hint-zeros + $AGI -B fill17.py --work OUT/x --chronology pr2917-t74 --check-fill PR2917/allocation/FILL.json.gz (replay + price) + --mix-only : stop after the pattern mix and its exact kappa (fill-independent) + --mix-file PATTERNS.json : use a given target mix (list of [cap, counts, n]) instead of the milp +Outputs: PATTERNS.json, MODEL.json, SOLVER.json, FLOW.json.gz, ORDER.json, FILL.json.gz, DISPATCH.json, PROFILE.json, + PROVIDERS.json (= #2917's allocation format), OWNER-CHECK.json (engine result, physical stock, exact bracket, cap, gains). +""" +import os, sys +os.environ['PYTHONDONTWRITEBYTECODE'] = '1' +sys.dont_write_bytecode = True +import argparse, collections, gzip, hashlib, json, pathlib, time, types +from fractions import Fraction as Q +import numpy as np +from scipy.sparse import coo_matrix, csr_matrix +from scipy.sparse.csgraph import maximum_bipartite_matching +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import root as R +import relax as X + +SCR = pathlib.Path('S') +PKG17 = SCR / 'r13/vendor/pr2917/research/paired-helper-extension' +PKG57 = SCR / 'r12/vendor/pr2857/research/shared-kernel-repacking' +P33 = SCR / 'r12/vendor/pr2833/research/gmx-t74-borrow43-handoff' +ENGINE = PKG17 / 'allocation/vendor/independent_owners.py' +ENGINE_SHA = '77a848729159e271ba64f403dfd59dddb13044b17b2950fa56700f442e2fe461' +PR2917_KAPPA = Q('17215886471978018806049999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000') +PR2917_ROOT_LOWER = Q('1721588647197801880605/1000000000000000000000000') # floor of its root at 24 digits (CLAIM complex_lower = 344317729439560376121/2e23) +PRIVATE_BUFFERS = 82 # default; --buffers overrides (n45x4 words: 86) +PR2930_KAPPA = Q(17224999064432745643569999999999999999999998999999999999999999999999, 10 ** 70) # PR2930 CLAIM (= our PR2917 cap fill) +PR2966_HEAD24 = Q(1724034272523452177412, 10 ** 24) # #2966 headline at 24 digits (coordinator: 0.001724034272523452177412; its -1e-46-1e-70 cancels against ours) +HELPERS = 408 +CENTRES = 8 +GUARDS = 2 + + +def read(p): + b = pathlib.Path(p).read_bytes() + return json.loads(gzip.decompress(b) if b[:2] == b'\x1f\x8b' else b) + + +def save(p, x): + b = json.dumps(x, sort_keys=True, separators=(',', ':')).encode() + if str(p).endswith('.gz'): + b = bytearray(gzip.compress(b, mtime=0)) + b[9] = 255 + b = bytes(b) + pathlib.Path(p).write_bytes(b) + + +def log(*a): + print(*a, flush=True) + + +def load_chronology(name): + if name == 'pr2833-t37': + template = read(PKG57 / 'sources/PR2833-T37-TEMPLATE.json.gz') + plan = read(PKG57 / 'sources/PR2833-PLAN.json.gz') + owners = read(PKG57 / 'sources/PR2833-T37-OWNERS.json.gz') + T = 37 + timecalls = {} + for r in owners: + key, call = r['time'], (r['stage'], r['replica']) + assert key not in timecalls or timecalls[key] == call + timecalls[key] = call + assert set(timecalls) == set(range(9 * T)) + order = [list(timecalls[t]) for t in range(9 * T)] + dispatch = read(PKG57 / 'sources/PR2833-T37-DISPATCH.json') + elif name == 'pr2833-t74': + template = read(PKG57 / 'sources/PR2833-T37-TEMPLATE.json.gz') + plan = read(PKG57 / 'sources/PR2833-PLAN.json.gz') + order = read(P33 / 'new/borrow-fill/ORDER.json') + dispatch = read(P33 / 'new/borrow-fill/DISPATCH.json') + T = 74 + elif name == 'pr2917-t74': + template = read(PKG17 / 'allocation/vendor/TEMPLATE.json.gz') + plan = read(PKG17 / 'allocation/vendor/PLAN.json.gz') + order = read(PKG17 / 'allocation/ORDER.json') + dispatch = read(PKG17 / 'allocation/DISPATCH.json') + T = 74 + else: + raise SystemExit('unknown chronology ' + name) + assert {(s, r) for s, r, p in dispatch} == set(map(tuple, order)) and len(order) == 9 * T and len(dispatch) == 9 * T + return template, plan, order, dispatch, T + + +def load_providers(path, local_override=None): + providers = read(path) + out = {} + for pid, v in providers.items(): + widths = [int(w) for w in v['widths']] + assert len(widths) == HELPERS + local = {int(k): int(n) for k, n in v['actual_paid_profile'].items()} + if local_override is not None: + local = dict(local_override) + local = {k: n for k, n in sorted(local.items()) if n} + assert sum(r * n for r, n in local.items()) - sum(widths) == 1856, 'local mass - width mass != 1856 for ' + pid + out[pid] = {'widths': widths, 'actual_paid_profile': local} + return out + + +def integer_pattern_mix(inv_by_call, T, bins_per_replica, cap_root, catalogue, tight): + widths = sorted({w for inv in inv_by_call for w in inv}) + bins = {c: n * T for c, n in bins_per_replica.items()} + demand = collections.Counter() + for inv in inv_by_call: + for w, n in inv.items(): + demand[w] += n + from scipy.optimize import milp, Bounds, LinearConstraint + pats = X.patterns(bins_per_replica, widths) + if catalogue == 'tight': + keep = {(t['capacity'], tuple(t['widths'].count(w) for w in widths)) for t in tight} + for cap in bins: + for i, w in enumerate(widths): + if w <= cap: + keep.add((cap, tuple(int(j == i) for j in range(len(widths))))) + keep.add((cap, tuple(0 for _ in widths))) + pats = [p for p in pats if (p[0], p[1]) in keep] + elif catalogue == 'tightonly': + keep = {(t['capacity'], tuple(t['widths'].count(w) for w in widths)) for t in tight} + pats = [p for p in pats if (p[0], p[1]) in keep] + caps = sorted(bins) + b = float(cap_root) + c = np.array([X.Hfloat(r, b) for cap, counts, r in pats]) + A = np.zeros((len(caps) + len(widths), len(pats))) + for j, (cap, counts, r) in enumerate(pats): + A[caps.index(cap), j] = 1.0 + for i, n in enumerate(counts): + A[len(caps) + i, j] = n + rhs = np.array([float(bins[cap]) for cap in caps] + [float(demand[w]) for w in widths]) + res = milp(c, integrality=np.ones(len(pats)), bounds=Bounds(0, np.inf), constraints=LinearConstraint(A, rhs, rhs), options={'time_limit': 120, 'mip_rel_gap': 0}) + assert res.x is not None, 'integer pattern mix infeasible: ' + str(res.message) + xi = np.rint(res.x).astype(np.int64) + assert np.max(np.abs(xi - res.x)) < 1e-6 and np.all(A @ xi == rhs) + target = {(pats[j][0], pats[j][1]): int(xi[j]) for j in range(len(pats)) if xi[j]} + return target, widths + + +def color_pattern(n, q, counts, WID): + slots = [w for j, w in enumerate(WID) for _ in range(q[j])] + if not slots: + assert not counts + return [[] for _ in range(n)] + times = sorted({t for t, w in counts}) + K = len(times) + assert K >= len(slots) + ti = {t: j for j, t in enumerate(times)} + A = np.zeros((K, K), dtype=np.int64) + slot_by_w = collections.defaultdict(list) + for j, w in enumerate(slots): + slot_by_w[w].append(j) + for w, js in slot_by_w.items(): + atslot = 0 + remaining = n + for t in times: + needed = counts.get((t, w), 0) + while needed: + take = min(needed, remaining) + A[ti[t], js[atslot]] += take + needed -= take + remaining -= take + if remaining == 0: + atslot += 1 + remaining = n + assert atslot == len(js) + assert all(v <= n for v in A.sum(axis=1)) + j = len(slots) + remaining = n + for r in range(K): + needed = n - int(A[r].sum()) + while needed: + assert j < K + take = min(needed, remaining) + A[r, j] += take + needed -= take + remaining -= take + if remaining == 0: + j += 1 + remaining = n + assert np.all(A.sum(axis=0) == n) and np.all(A.sum(axis=1) == n) + output = [] + for color in range(n): + matching = maximum_bipartite_matching(csr_matrix(A > 0), perm_type='column') + assert len(matching) == K and min(matching) >= 0 and len(set(map(int, matching))) == K + output.append([(times[r], slots[int(c)]) for r, c in enumerate(matching) if c < len(slots)]) + A[np.arange(K), matching] -= 1 + assert not A.any() + return output + + +def pattern_name(WID, counts): + return '+'.join(str(w) for w, k in zip(WID, counts) for _ in range(k)) or 'empty' + + +def fill_to_bins(fill, order, disp, providers): + """literal fill rows -> {bin: [(t, w)]} using the provider widths (helper column = 0-based index, as the engine reads it).""" + bybin = collections.defaultdict(list) + for t, h, o, c, p, z in fill['rows']: + w = providers[disp[tuple(order[t])]]['widths'][h] + bybin[o, c, p].append((t, w)) + return bybin + + +def price(profile, T, rel): + k_lo, k_hi = R.kappa_from_profile(profile, T) + cap_hi = Q(rel['cap_upper']) + return k_lo, k_hi, dict(kappa_lower=str(k_lo), kappa_upper=str(k_hi), kappa_lower_decimal=R.mpmath_str(k_lo, 25), kappa_upper_decimal=R.mpmath_str(k_hi, 25), + headline_floor24_minus=str(Q(int(k_lo * 10 ** 24), 10 ** 24) - Q(1, 10 ** 46) - Q(1, 10 ** 70)), + relaxation_cap_lower=rel['cap_lower'], relaxation_cap_upper=rel['cap_upper'], relaxation_cap_upper_decimal=rel['cap_upper_decimal'], + gap_to_relaxation_cap=float(cap_hi - k_lo), gain_vs_PR2917_claim_float=float(k_lo - PR2917_KAPPA), gain_vs_PR2917_root_lower_float=float(k_lo - PR2917_ROOT_LOWER), + gain_vs_PR2917_claim_exact_lower=str(k_lo - PR2917_KAPPA), + gain_vs_PR2930_claim_float=float(k_lo - PR2930_KAPPA), gain_vs_PR2930_claim_exact_lower=str(k_lo - PR2930_KAPPA), + gain_vs_PR2966_headline24=str(Q(int(k_lo * 10 ** 24), 10 ** 24) - PR2966_HEAD24), gain_vs_PR2966_float=float(Q(int(k_lo * 10 ** 24), 10 ** 24) - PR2966_HEAD24)) + + +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument('--work', type=pathlib.Path, required=True) + ap.add_argument('--chronology', choices=['pr2833-t37', 'pr2833-t74', 'pr2917-t74'], default='pr2833-t37') + ap.add_argument('--providers', type=pathlib.Path, default=PKG17 / 'allocation/PROVIDERS.json') + ap.add_argument('--local', help='JSON per-call local profile overriding PROVIDERS (both providers)') + ap.add_argument('--catalogue', default='tight', help="all | tight | tightonly | rc: (free-mix: patterns with reduced cost <= x at the cap root)") + ap.add_argument('--mix-file', type=pathlib.Path, help='PATTERNS.json-style target list [[cap, counts, n], ...] to use instead of the milp') + ap.add_argument('--mix-only', action='store_true') + ap.add_argument('--seconds', type=int, default=600) + ap.add_argument('--workers', type=int, default=1) + ap.add_argument('--seed', type=int, default=124) + ap.add_argument('--hint-flow', type=pathlib.Path, help='FLOW.json.gz of the same chronology/T (e.g. PR2857 allocation/construction/FLOW.json.gz for pr2833-t37)') + ap.add_argument('--hint-fill', type=pathlib.Path, help='literal FILL.json.gz of the same chronology (e.g. #2917 allocation/FILL.json.gz for pr2917-t74); converted to X/Z hints') + ap.add_argument('--hint-zeros', action='store_true') + ap.add_argument('--reuse-flow', type=pathlib.Path) + ap.add_argument('--solver', choices=['cp', 'highs-lp', 'highs-mip'], default='cp', help='cp = CP-SAT; highs-lp = LP relaxation feasibility only (fractional flow); highs-mip = scipy milp') + ap.add_argument('--check-fill', type=pathlib.Path, help='replay: owner-check and price this literal fill under the chronology (no solve)') + ap.add_argument('--free-mix', action='store_true', help='no global pattern targets: CP-SAT minimizes the linearized moment sum_bins H_idle(b*) over the catalogue (tight = relaxation-tight + single residues + empties; all = every pattern; rc:x = reduced cost <= x)') + ap.add_argument('--objective-scale', type=int, default=10 ** 6) + ap.add_argument('--buffers', type=int, default=PRIVATE_BUFFERS, help='private zero buffers for the physical display (PR2917 82, n45x4 86)') + ap.add_argument('--method', default='r13 lane C1: relax.py integer pattern mix + CP-SAT chronological flow + edge-colouring realization (fill17.py)') + a = ap.parse_args() + assert a.workers == 1, 'num_search_workers must be 1 on this machine (3 deadlocks)' + out = a.work.resolve() + out.mkdir(parents=True, exist_ok=False) + t0 = time.time() + assert hashlib.sha256(ENGINE.read_bytes()).hexdigest() == ENGINE_SHA, 'owner engine pin' + owner = types.ModuleType('frozen_owner') + exec(compile(ENGINE.read_bytes(), 'frozen_owner', 'exec'), owner.__dict__) + template, plan, order, dispatch, T = load_chronology(a.chronology) + local_override = {int(k): int(v) for k, v in json.loads(a.local).items()} if a.local else None + providers = load_providers(a.providers, local_override) + disp = {(s, r): p for s, r, p in dispatch} + inv_by_call = [collections.Counter(providers[disp[tuple(sr)]]['widths']) for sr in order] + calls_by_pid = collections.Counter(disp[tuple(sr)] for sr in order) + locals_ = {pid: providers[pid]['actual_paid_profile'] for pid in providers} + # relaxation cap (call-weighted average inventory; the local profile is the same for both providers here) + avg_inv = collections.Counter() + for inv in inv_by_call: + for w, n in inv.items(): + avg_inv[w] += Q(n, len(order)) + loc0 = next(iter(locals_.values())) + assert all(l == loc0 for l in locals_.values()), 'providers differ in local profile; relax.py needs one profile' + rel = X.relax(loc0, avg_inv) + cap_lo, cap_hi = Q(rel['cap_lower']), Q(rel['cap_upper']) + log('CHRONOLOGY', a.chronology, 'T', T, 'calls', len(order), 'calls per provider', dict(calls_by_pid)) + log('INVENTORY', {pid: dict(sorted(collections.Counter(providers[pid]['widths']).items())) for pid in providers}, 'LOCAL', loc0) + log('RELAX cap', rel['cap_lower_decimal'], rel['cap_upper_decimal'], 'tight', rel['tight_patterns'], 'idle/replica', rel['idle_per_replica']) + live = 896 * T + physical = live + HELPERS + CENTRES + a.buffers + GUARDS + + if a.check_fill: + fill = read(a.check_fill) + result, _, _ = owner.check(T, order, fill, disp, None, plan, template, providers) + profile = {int(k): v for k, v in result['profile'].items()} + k_lo, k_hi, pr = price(profile, T, rel) + bybin = fill_to_bins(fill, order, disp, providers) + pat_hist = collections.Counter() + win = owner.windows(template, order, T) + for (o, c), (cap, lo, hi) in win.items(): + for port in range(112): + rs = bybin.get((o, c, port), []) + pat_hist['%d:%s' % (cap, '+'.join(str(w) for w in sorted(w for t, w in rs)) or 'empty')] += 1 + assert result['live'] == live + check = dict(result, status='PASS_VENDORED_PR2839_OWNER_ENGINE_CHECK', mode='check-fill', fill=str(a.check_fill), chronology=a.chronology, T=T, + physical=result['live'] + HELPERS + CENTRES + a.buffers + GUARDS, physical_expected=physical, pattern_histogram=dict(sorted(pat_hist.items())), **pr) + save(out / 'OWNER-CHECK.json', check) + save(out / 'PROFILE.json', dict(sorted(profile.items()))) + log('CHECK-FILL PASS roles', result['roles'], 'idle', result['idle'], 'physical', check['physical']) + log('PATTERNS', dict(sorted(pat_hist.items()))) + log('KAPPA', pr['kappa_lower_decimal'], '..', pr['kappa_upper_decimal'], 'cap', rel['cap_upper_decimal'], 'gap %.3e' % pr['gap_to_relaxation_cap'], 'gain vs PR2917 claim %.4e' % pr['gain_vs_PR2917_claim_float'], 'gain vs PR2930 claim %.4e' % pr['gain_vs_PR2930_claim_float'], 'gain vs PR2966 %.6e' % pr['gain_vs_PR2966_float']) + return + + bins_per_replica = X.BINS + if a.free_mix: + WIDf = sorted({w for inv in inv_by_call for w in inv}) + allp = X.patterns(bins_per_replica, WIDf) + bstar = float((cap_lo + cap_hi) / 2) + if a.catalogue.startswith('rc:'): + thr = float(a.catalogue.split(':')[1]) + Y = rel['dual_Y'] + yv = lambda row: sum(float(Q(v)) * X.Hfloat(int(k), bstar) for k, v in Y[row].items()) + keep = {(cap, counts) for cap, counts, r in allp if X.Hfloat(r, bstar) - yv('cap%d' % cap) - sum(n * yv('w%d' % w) for w, n in zip(WIDf, counts)) <= thr} + elif a.catalogue == 'all': + keep = {(cap, counts) for cap, counts, r in allp} + else: + keep = {(t['capacity'], tuple(t['widths'].count(w) for w in WIDf)) for t in rel['tight_pattern_list']} + for cap in bins_per_replica: + for i, w in enumerate(WIDf): + if w <= cap: + keep.add((cap, tuple(int(j == i) for j in range(len(WIDf))))) + keep.add((cap, tuple(0 for _ in WIDf))) + target = {k: None for k in sorted(keep)} + WID = WIDf + log('FREE MIX catalogue', {cap: sum(1 for c, q in keep if c == cap) for cap in sorted(bins_per_replica)}) + elif a.mix_file: + mf = read(a.mix_file) + WID = [int(w) for w in mf['widths']] + target = {(int(cap), tuple(int(k) for k in counts)): int(n) for cap, counts, n in mf['target']} + else: + target, WID = integer_pattern_mix(inv_by_call, T, bins_per_replica, (cap_lo + cap_hi) / 2, a.catalogue, rel['tight_pattern_list']) + idle_mix = collections.Counter() + for (cap, counts), n in target.items(): + r = cap - sum(w * k for w, k in zip(WID, counts)) + assert r >= 0 + if r and n: + idle_mix[r] += n + profile_mix = collections.Counter(idle_mix) + for pid, ncalls in calls_by_pid.items(): + for r, n in locals_[pid].items(): + profile_mix[r] += n * ncalls + if a.free_mix: + mix_lo = mix_hi = None + mix_pr = dict(kappa_lower_decimal='(free mix)', kappa_upper_decimal='', gap_to_relaxation_cap=float('nan'), gain_vs_PR2917_claim_float=float('nan'), gain_vs_PR2930_claim_float=float('nan')) + else: + mix_lo, mix_hi, mix_pr = price(dict(profile_mix), T, rel) + if not a.free_mix: + log('PATTERN MIX', {('%d:%s' % (cap, pattern_name(WID, counts))): n for (cap, counts), n in sorted(target.items())}) + log('MIX kappa bracket', mix_pr['kappa_lower_decimal'], mix_pr['kappa_upper_decimal'], 'idle', dict(sorted(idle_mix.items())), 'gap to cap %.3e' % mix_pr['gap_to_relaxation_cap'], 'gain vs PR2917 %.4e' % mix_pr['gain_vs_PR2917_claim_float'], 'gain vs PR2930 %.4e' % mix_pr['gain_vs_PR2930_claim_float']) + if not a.free_mix: + save(out / 'PATTERNS.json', dict(mode='milp' if not a.mix_file else 'file', catalogue=a.catalogue, T=T, chronology=a.chronology, widths=WID, + target=[[cap, list(counts), n] for (cap, counts), n in sorted(target.items())], idle=dict(sorted(idle_mix.items())), + profile=dict(sorted(profile_mix.items())), **mix_pr)) + if a.mix_only: + return + + # ---- chronology windows and the flow model (PR2857 discover_original.py, all bins active) + win = owner.windows(template, order, T) + family = lambda b: b[0] * 896 + (2 * plan['pairs'][str(b[1])] + plan['sides'][str(b[1])]) * 112 + b[2] + fw = collections.defaultdict(list) + for (o, c), (cap, lo, hi) in win.items(): + fw[family((o, c, 0))].append((lo, hi, c)) + for ww in fw.values(): + for i, (lo, hi, c) in enumerate(ww): + assert all(max(lo, l) >= min(hi, h) for l, h, d in ww[i + 1:]), 'overlapping same-family windows' + need = {t: collections.Counter(inv_by_call[t]) for t in range(len(order))} + pats = collections.defaultdict(list) + for (cap, counts) in target: + pats[cap].append(counts) + groups = collections.defaultdict(list) + for (o, c), (cap, lo, hi) in win.items(): + for port in range(112): + groups[cap, tuple(range(max(0, lo + 1), min(len(order), hi + 1)))].append((o, c, port)) + G = sorted(groups) + groupof = {b: gi for gi, g in enumerate(G) for b in groups[g]} + edge, lb, ub, rl, ru = [], [], [], [], [] + Xv, Zv = {}, {} + + def cr(l, u=None): + j = len(rl) + rl.append(l) + ru.append(l if u is None else u) + return j + + def cv(u): + j = len(lb) + lb.append(0) + ub.append(u) + return j + + def put(r, v, n): + if n: + edge.append((r, v, n)) + callrow = {(t, w): cr(n) for t, cnt in need.items() for w, n in cnt.items() if n} + globalrow = {} if a.free_mix else {key: cr(n) for key, n in target.items()} + for gi, (cap, ts) in enumerate(G): + nb = len(groups[G[gi]]) + br = cr(nb) + for q in pats[cap]: + xv = cv(nb) + Xv[gi, q] = xv + put(br, xv, 1) + if not a.free_mix: + put(globalrow[cap, q], xv, 1) + residual = {w: q[j] for j, w in enumerate(WID) if q[j]} + wr = {w: cr(0) for w in residual} + for w, n in residual.items(): + put(wr[w], xv, -n) + for t in ts: + tr = cr(-nb, 0) + put(tr, xv, -1) + for w in residual: + if (t, w) not in callrow: + continue + zv = cv(min(nb, need[t][w])) + Zv[gi, q, t, w] = zv + put(tr, zv, 1) + put(wr[w], zv, 1) + put(callrow[t, w], zv, 1) + modelinfo = dict(T=T, chronology=a.chronology, groups=len(G), variables=len(lb), pattern_variables=len(Xv), flow_variables=len(Zv), constraints=len(rl), nonzeros=len(edge), workers=a.workers, + catalogue=a.catalogue, patterns_per_cap={str(cap): len(ps) for cap, ps in pats.items()}) + save(out / 'MODEL.json', modelinfo) + log('MODEL', modelinfo) + rr = np.fromiter((e[0] for e in edge), np.int32) + cc = np.fromiter((e[1] for e in edge), np.int32) + vv = np.fromiter((e[2] for e in edge), np.float64) + mat = coo_matrix((vv, (rr, cc)), shape=(len(rl), len(lb))).tocsr() + del edge + t1 = time.time() + if a.reuse_flow: + saved = read(a.reuse_flow) + value = np.zeros(len(lb), dtype=np.int64) + for gi, q, n in saved['x']: + value[Xv[gi, tuple(q)]] = n + for gi, q, t, w, n in saved['z']: + value[Zv[gi, tuple(q), t, w]] = n + status = 'EXACT_FLOW_REPLAY' + elif a.solver == 'highs-lp': + from scipy.optimize import milp, Bounds, LinearConstraint + r = milp(np.zeros(len(lb)), integrality=np.zeros(len(lb)), bounds=Bounds(np.array(lb, dtype=float), np.array(ub, dtype=float)), constraints=LinearConstraint(mat, np.array(rl, dtype=float), np.array(ru, dtype=float)), options={'time_limit': a.seconds, 'disp': True}) + status = 'LP_RELAXATION_' + ('FEASIBLE' if r.x is not None else 'INFEASIBLE_OR_FAILED') + ': ' + str(r.message) + log('LP RELAXATION', status, '%.1f s' % (time.time() - t1)) + save(out / 'SOLVER.json', dict(status=status, solver='highs-lp', seconds=time.time() - t1, chronology=a.chronology, T=T, catalogue=a.catalogue, mix_file=str(a.mix_file) if a.mix_file else None)) + return + elif a.solver == 'highs-mip': + from scipy.optimize import milp, Bounds, LinearConstraint + r = milp(np.zeros(len(lb)), integrality=np.ones(len(lb)), bounds=Bounds(np.array(lb, dtype=float), np.array(ub, dtype=float)), constraints=LinearConstraint(mat, np.array(rl, dtype=float), np.array(ru, dtype=float)), options={'time_limit': a.seconds, 'mip_rel_gap': 0, 'disp': True}) + status = str(r.message) + value = None if r.x is None else np.rint(r.x).astype(np.int64) + else: + from ortools.sat.python import cp_model + model = cp_model.CpModel() + vs = [model.NewIntVar(int(l), int(u), '') for l, u in zip(lb, ub)] + for j, (l, u) in enumerate(zip(rl, ru)): + b, e = mat.indptr[j:j + 2] + ind = mat.indices[b:e] + co = mat.data[b:e] + model.AddLinearConstraint(cp_model.LinearExpr.WeightedSum([vs[int(k)] for k in ind], [int(k) for k in co]), int(l), int(u)) + if a.free_mix: + bstar = float((cap_lo + cap_hi) / 2) + obj = [] + for (gi, q), j in Xv.items(): + r = G[gi][0] - sum(w * k for w, k in zip(WID, q)) + c = 0 if r == 0 else int(round(a.objective_scale * X.Hfloat(r, bstar))) + if c: + obj.append((vs[j], c)) + model.Minimize(cp_model.LinearExpr.WeightedSum([v for v, c in obj], [c for v, c in obj])) + hinted = {} + if a.hint_flow: + saved = read(a.hint_flow) + for gi, q, n in saved['x']: + if (gi, tuple(q)) in Xv: + hinted[Xv[gi, tuple(q)]] = min(int(n), int(ub[Xv[gi, tuple(q)]])) + for gi, q, t, w, n in saved['z']: + if (gi, tuple(q), t, w) in Zv: + hinted[Zv[gi, tuple(q), t, w]] = min(int(n), int(ub[Zv[gi, tuple(q), t, w]])) + log('HINT from flow', a.hint_flow, 'variables', len(hinted), 'of', len(vs)) + if a.hint_fill: + hf = read(a.hint_fill) + bybin = fill_to_bins(hf, order, disp, providers) + hx = collections.Counter() + hz = collections.Counter() + missing = collections.Counter() + for gi_, g_ in enumerate(G): + for b in groups[g_]: + rs = bybin.get(b, []) + q = tuple(sum(1 for t, w in rs if w == ww) for ww in WID) + if (gi_, q) not in Xv: + missing['%d:%s' % (G[gi_][0], pattern_name(WID, q))] += 1 + continue + hx[gi_, q] += 1 + for t, w in rs: + hz[gi_, q, t, w] += 1 + for k, n in hx.items(): + hinted[Xv[k]] = min(n, int(ub[Xv[k]])) + for k, n in hz.items(): + if k in Zv: + hinted[Zv[k]] = min(n, int(ub[Zv[k]])) + log('HINT from fill', a.hint_fill, 'bins hinted', sum(hx.values()), 'bins with non-catalogue patterns (unhinted)', sum(missing.values()), dict(missing.most_common(12)), 'variables', len(hinted)) + if hinted: + for j, v in hinted.items(): + model.AddHint(vs[j], v) + if a.hint_zeros: + for j in range(len(vs)): + if j not in hinted: + model.AddHint(vs[j], 0) + log('HINT total', len(hinted), '(+ zeros for the rest)' if a.hint_zeros else '') + solver = cp_model.CpSolver() + solver.parameters.num_search_workers = a.workers + solver.parameters.max_time_in_seconds = a.seconds + solver.parameters.random_seed = a.seed + solver.parameters.log_search_progress = True + result = solver.Solve(model) + status = solver.StatusName(result) + value = np.array([solver.Value(v) for v in vs], dtype=np.int64) if result in (cp_model.OPTIMAL, cp_model.FEASIBLE) else None + log(solver.ResponseStats()) + solve_seconds = time.time() - t1 + log('SOLVER', status, '%.1f s' % solve_seconds) + save(out / 'SOLVER.json', dict(status=status, seconds=solve_seconds, workers=a.workers, seed=a.seed, max_time_seconds=a.seconds, candidate=value is not None, chronology=a.chronology, T=T, catalogue=a.catalogue, + hint_flow=str(a.hint_flow) if a.hint_flow else None, hint_fill=str(a.hint_fill) if a.hint_fill else None, hint_zeros=a.hint_zeros)) + if value is None: + log('NO FEASIBLE FLOW (status %s)' % status) + raise SystemExit(2) + assert not (np.any(value < lb) or np.any(value > ub) or np.any(mat @ value < rl) or np.any(mat @ value > ru)) + xc = collections.defaultdict(collections.Counter) + zc = collections.defaultdict(collections.Counter) + for (gi, q), v in Xv.items(): + if value[v]: + xc[gi][q] = int(value[v]) + for (gi, q, t, w), v in Zv.items(): + if value[v]: + zc[gi, q][t, w] = int(value[v]) + save(out / 'FLOW.json.gz', {'x': [[gi, list(q), n] for gi, c in xc.items() for q, n in c.items()], 'z': [[gi, list(q), t, w, n] for (gi, q), c in zc.items() for (t, w), n in c.items()]}) + gc = collections.Counter() + for gi, c in xc.items(): + for q, n in c.items(): + gc[G[gi][0], q] += n + if a.free_mix: + target = dict(gc) + idle_mix = collections.Counter() + for (cap, counts), n in target.items(): + r = cap - sum(w * k for w, k in zip(WID, counts)) + if r: + idle_mix[r] += n + profile_mix = collections.Counter(idle_mix) + for pid, ncalls in calls_by_pid.items(): + for r, n in locals_[pid].items(): + profile_mix[r] += n * ncalls + log('FREE MIX realized', {('%d:%s' % (cap, pattern_name(WID, counts))): n for (cap, counts), n in sorted(target.items())}) + assert dict(gc) == target, 'global integer pattern counts differ' + for gi in range(len(G)): + assert sum(xc[gi].values()) == len(groups[G[gi]]), 'window class bin count' + call_count = collections.defaultdict(collections.Counter) + for (gi, q), c in zc.items(): + by_w = collections.Counter() + by_t = collections.Counter() + for (t, w), n in c.items(): + assert t in G[gi][1] and q[WID.index(w)] > 0, 'ineligible time/width flow' + by_w[w] += n + by_t[t] += n + call_count[t][w] += n + assert all(by_w[w] == q[j] * xc[gi][q] for j, w in enumerate(WID)), 'pattern-width supply' + assert all(n <= xc[gi][q] for n in by_t.values()), 'more than one role per bin/time' + assert all(call_count[t] == need[t] for t in range(len(order))), 'flow call width demand' + slots = [] + for gi, (cap, ts) in enumerate(G): + bins = groups[G[gi]] + offset = 0 + for q, n in sorted(xc[gi].items()): + res = color_pattern(n, q, zc[gi, q], WID) + assert len(res) == n + for b, it in zip(bins[offset:offset + n], res): + z = 0 + for t, w in sorted(it): + slots.append((t, w, *b, z)) + z += w + assert z <= cap + offset += n + assert offset == len(bins) + available = {t: collections.defaultdict(list) for t in range(len(order))} + for t in available: + for h, w in enumerate(providers[disp[tuple(order[t])]]['widths']): + available[t][w].append(h) + final = [] + for t, w, o, c, p, z in sorted(slots): + final.append([t, available[t][w].pop(), o, c, p, z]) + assert not any(v for d in available.values() for v in d.values()) + fill = {'columns': ['time', 'helper', 'owner_replica', 'child', 'port', 'offset'], 'dispatch_overrides': [], 'method': a.method, 'rows': sorted(final)} + result, _, _ = owner.check(T, order, fill, disp, None, plan, template, providers) + profile = {int(k): v for k, v in result['profile'].items()} + assert collections.Counter(profile) == profile_mix, 'realized profile differs from the pattern-mix profile' + assert result['live'] == live + k_lo, k_hi, pr = price(profile, T, rel) + payload_sha = {} + prov_out = {pid: {'actual_paid_profile': {str(r): n for r, n in providers[pid]['actual_paid_profile'].items()}, 'widths': providers[pid]['widths']} for pid in providers} + for n, obj in [('ORDER.json', order), ('FILL.json.gz', fill), ('DISPATCH.json', dispatch), ('PROFILE.json', {str(k): v for k, v in sorted(profile.items())}), ('PROVIDERS.json', prov_out)]: + save(out / n, obj) + payload_sha[n] = hashlib.sha256(json.dumps(obj, sort_keys=True, separators=(',', ':')).encode()).hexdigest() + check = dict(result, status='PASS_VENDORED_PR2839_OWNER_ENGINE_CHECK', solver=status, solve_seconds=solve_seconds, total_seconds=time.time() - t0, chronology=a.chronology, T=T, calls=len(order), + physical=result['live'] + HELPERS + CENTRES + a.buffers + GUARDS, physical_formula='live + 408 helpers + 8 centres + %d private buffers + 2 guards' % a.buffers, + inventory={pid: dict(sorted(collections.Counter(providers[pid]['widths']).items())) for pid in providers}, local=loc0, engine_sha256=ENGINE_SHA, catalogue=a.catalogue, + pattern_mix={('%d:%s' % (cap, pattern_name(WID, counts))): n for (cap, counts), n in sorted(target.items())}, payload_sha256=payload_sha, seed=a.seed, **pr) + save(out / 'OWNER-CHECK.json', check) + log('OWNER_CHECK_PASS', out, 'roles', result['roles'], 'idle', result['idle'], 'physical', check['physical']) + log('KAPPA', pr['kappa_lower_decimal'], '..', pr['kappa_upper_decimal'], 'cap', rel['cap_upper_decimal'], 'gap %.3e' % pr['gap_to_relaxation_cap'], 'gain vs PR2917 claim %.4e' % pr['gain_vs_PR2917_claim_float'], 'gain vs PR2930 claim %.4e' % pr['gain_vs_PR2930_claim_float'], 'gain vs PR2966 %.6e' % pr['gain_vs_PR2966_float']) + + +if __name__ == '__main__': + main() diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/providers_from_words.py b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/providers_from_words.py new file mode 100644 index 0000000000..bab1d7139a --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/providers_from_words.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +"""providers_from_words.py -- derive PROVIDERS.json from the two provider words exactly as PR2917's check_allocation.py does: +helpers = sorted(range(224,704) - removed); width = len(helper_final.get(h, [0]*9)) - len(start_extra.get(h, [])); +actual_paid_profile = frame_report(word) profile (= report.local_profile, asserted, via PR2917's vendored preload_move.py); +cleanup buffers {r >= 704} == {704 + h : h in helper_final}, count = --buffers. Output: json.dumps(indent=2, sort_keys=True), no newline +(PR2917's byte format). Usage: python -I -B providers_from_words.py BASE.json.gz EXTRA.json.gz OUT.json --buffers 86 [--compare REF]""" +import sys, json, gzip, hashlib, types, pathlib, argparse +from collections import Counter +PKG17 = pathlib.Path('S/r13/vendor/pr2917/research/paired-helper-extension') +ap = argparse.ArgumentParser(); ap.add_argument('base'); ap.add_argument('extra'); ap.add_argument('out'); ap.add_argument('--buffers', type=int, required=True); ap.add_argument('--compare') +a = ap.parse_args() +def read(p): + b = pathlib.Path(p).read_bytes(); return json.loads(gzip.decompress(b) if b[:2] == b'\x1f\x8b' else b) +frames = types.ModuleType('frames'); frames.__file__ = str(PKG17 / 'vendor/preload_move.py'); sys.modules['frames'] = frames +exec(compile((PKG17 / 'vendor/preload_move.py').read_bytes(), str(PKG17 / 'vendor/preload_move.py'), 'exec'), frames.__dict__) +providers, info = {}, {} +for path, pid in [(a.base, 'gauge44'), (a.extra, 'extra')]: + word = read(path) + profile, inventory = frames.frame_report(word) + assert profile == word['report']['local_profile'] and inventory == word['report']['width_inventory'], 'frame_report != report' + helpers = sorted(set(range(224, 704)) - set(word['removed'])) + widths = [len(word['helper_final'].get(str(h), [0] * 9)) - len(word['start_extra'].get(str(h), [])) for h in helpers] + assert len(helpers) == 408 and len(word['centers']) == 8, 'helpers/centres' + buffers = {r for gate in word['cleanup'] for r in (gate[1:3] if gate[0] == 'add' else gate[1:2]) if r >= 704} + assert buffers == {704 + int(h) for h in word['helper_final']}, 'cleanup buffer / end-point bijection' + assert len(buffers) == a.buffers, 'buffer count %d != %d' % (len(buffers), a.buffers) + prof = {int(k): v for k, v in profile.items()} + assert sum(r * n for r, n in prof.items()) - sum(widths) == 1856, 'local mass - width mass != 1856' + assert dict(Counter(widths)) == {int(k): v for k, v in inventory.items()}, 'width list vs inventory' + providers[pid] = {'actual_paid_profile': {str(k): prof[k] for k in sorted(prof)}, 'widths': widths} + info[pid] = dict(word_sha256=hashlib.sha256(pathlib.Path(path).read_bytes()).hexdigest(), local=prof, inventory=dict(sorted(Counter(widths).items())), buffers=len(buffers), + narrowed_vs_9=[h for h, w in zip(helpers, widths) if w == 8 and str(h) in word['helper_final']][:200]) +text = json.dumps(providers, indent=2, sort_keys=True) +pathlib.Path(a.out).write_text(text) +print('wrote', a.out, 'sha256', hashlib.sha256(text.encode()).hexdigest()) +for pid, d in info.items(): + print(pid, 'word', d['word_sha256'][:16], 'local', d['local'], 'inventory', d['inventory'], 'buffers', d['buffers']) +print('identical widths/profile across providers:', providers['gauge44'] == providers['extra']) +if a.compare: + ref = pathlib.Path(a.compare).read_bytes() + print('byte-identical to', a.compare, ':', ref == text.encode(), '| content-equal:', json.loads(ref) == providers) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/allocation/round_mix.py b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/round_mix.py new file mode 100644 index 0000000000..5737651571 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/allocation/round_mix.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +"""round_mix.py USAGE.json T OUT.json [--lam 1000] -- integer pattern mix closest to a fractional chronological LP usage (diag_lp free mode): +minimize sum_p H_idle(p)(b) n_p + lam * sum_p |n_p - u_p| subject to exact bin counts per capacity (112*T*{6,4,4,4}) and exact width totals +(inventory * 9T); patterns = LP support plus single residues and empties. Output = PATTERNS.json-style {widths, target} for fill17 --mix-file.""" +import json, sys, argparse, itertools +import numpy as np +from scipy.optimize import milp, Bounds, LinearConstraint +sys.path.insert(0, __import__('os').path.dirname(__import__('os').path.abspath(__file__))) +import relax as X +ap = argparse.ArgumentParser(); ap.add_argument('usage'); ap.add_argument('T', type=int); ap.add_argument('out'); ap.add_argument('--lam', type=float, default=1000.0) +ap.add_argument('--inventory', required=True, help='JSON per-call inventory'); ap.add_argument('--scale', type=float, default=1.0, help='usage multiplier (e.g. 2 to map a T37 usage to T74)') +a = ap.parse_args() +u = json.load(open(a.usage)); W = [int(w) for w in u['widths']]; b = u['b'] +inv = {int(k): v for k, v in json.loads(a.inventory).items()} +use = {} +for name, x in u['usage'].items(): + cap, spec = name.split(':'); ws = [] if spec == 'empty' else [int(z) for z in spec.split('+')] + use[(int(cap), tuple(ws.count(w) for w in W))] = x * a.scale +pats = set(use) +for cap in X.BINS: + for i, w in enumerate(W): + if w <= cap: + pats.add((cap, tuple(int(j == i) for j in range(len(W))))) + pats.add((cap, tuple(0 for _ in W))) +pats = sorted(pats) +n = len(pats) +idle = [cap - sum(w * k for w, k in zip(W, q)) for cap, q in pats] +c = [X.Hfloat(r, b) for r in idle] + [a.lam] * (2 * n) +caps = sorted(X.BINS) +A = np.zeros((len(caps) + len(W) + n, 3 * n)); lo = []; hi = [] +for j, (cap, q) in enumerate(pats): + A[caps.index(cap), j] = 1 + for i, k in enumerate(q): + A[len(caps) + i, j] = k +rhs = [X.BINS[cap] * a.T for cap in caps] + [inv[w] * 9 * a.T for w in W] +lo += rhs; hi += rhs +for j in range(n): # n_j - u_j = p_j - m_j + r = len(caps) + len(W) + j + A[r, j] = 1; A[r, n + j] = -1; A[r, 2 * n + j] = 1 + lo.append(use.get(pats[j], 0.0)); hi.append(use.get(pats[j], 0.0)) +res = milp(np.array(c), integrality=np.array([1] * n + [0] * (2 * n)), bounds=Bounds(0, np.inf), constraints=LinearConstraint(A, lo, hi), options={'time_limit': 120, 'mip_rel_gap': 0}) +assert res.x is not None, res.message +xi = np.rint(res.x[:n]).astype(int) +target = [[cap, list(q), int(x)] for (cap, q), x in zip(pats, xi) if x] +json.dump(dict(widths=W, target=target, source=a.usage, lam=a.lam, T=a.T), open(a.out, 'w')) +print({('%d:%s' % (cap, '+'.join(str(w) for w, k in zip(W, q) for _ in range(k)) or 'empty')): x for cap, q, x in target}) +print('deviation from LP usage', round(float(sum(abs(xi[j] - use.get(pats[j], 0.0)) for j in range(n))), 3)) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/records/derive_stage2.py b/research/rank7-coupled-586-588-carrier-fold/construction/records/derive_stage2.py new file mode 100644 index 0000000000..26a0613311 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/records/derive_stage2.py @@ -0,0 +1,76 @@ +"""Derive per-step frame changes of lane A's five stage-2 extractions (parent = previous step word), base from the realized +step words; check that the same records reproduce the extra provider's final L27 word.""" +import gzip, json, copy, collections, sys +from fractions import Fraction as Q +from pathlib import Path +S = Path('S') +A = S / 'r14/agents/A-extract/out' +sys.path.insert(0, str(S / 'wt-r13pub2/research/paired-extension-normal45/vendor')) +import preload_move as pm +def read(p): + b = Path(p).read_bytes(); return json.loads(gzip.decompress(b) if b[:2] == b'\x1f\x8b' else b) +HS = [226, 228, 230, 363, 395] +TR = [read(next(A.glob(f'L27-base-TRANSFORM-step{k}-h{h}.json'))) for k, h in enumerate(HS, 1)] +for k, h in enumerate(HS, 1): + assert read(next(A.glob(f'L27-extra-TRANSFORM-step{k}-h{h}.json'))) == TR[k - 1] +R42 = json.load(open(A / 'R42.json')); R7 = json.load(open(A / 'R42R7.json')) +for t, r in zip(TR, R42 + R7): + assert t['before'] == r['transform']['before'] and t['after'] == r['transform']['after'] and t['helper'] == r['transform']['helper'], 'realized transform == shipped' +def insert(word, t): + h = t['helper']; x = copy.deepcopy(word); n = x['prelude_events'] + x['A'] = x['A'][:n] + copy.deepcopy(t['before']) + x['A'][n:] + x['restore'] += copy.deepcopy(t['after']) + x['helper_final'][str(h)] = list(pm.basis(t['after'][0][-1])) + C = collections.defaultdict(dict) + for g in x['compensation']: + C[g[2]][g[1]] = C[g[2]].get(g[1], Q(0)) + Q(g[3], g[4]) + for g in reversed(t['before']): + if g[0] == 'scale': + C[g[1]] = {u: a * Q(g[2], g[3]) for u, a in C[g[1]].items()} + else: + u, s = g[1:3] + for target, a in C[u].items(): + C[s][target] = C[s].get(target, Q(0)) + Q(g[3], g[4]) * a + x['compensation'] = [['add', u, r, a.numerator, a.denominator, []] for r, col in sorted(C.items()) for u, a in sorted(col.items()) if a] + return x +def finish(x): + profile, inventory = pm.frame_report(x) + x['report']['local_profile'], x['report']['width_inventory'] = profile, inventory + z = copy.deepcopy(x); z['A'] = z['A'][z['prelude_events']:] + x['cleanup'] = pm.derive_cleanup(z, set(map(int, x['helper_final']))) + return x +out = [] +words = [read(A / 'L22-base.json.gz')] + [read(A / f'R42-step{k}.json.gz') for k in (1, 2, 3)] + [read(A / f'R42R7-step{k}.json.gz') for k in (1, 2)] +assert words[-1] == read(A / 'L27-base.json.gz'), 'realized base step words end at L27-base' +for k, t in enumerate(TR, 1): + par, ch = words[k - 1], words[k] + x = insert(par, t) + diff = sorted(key for key in x if x[key] != ch[key]) + fc = [] + for sec in ('A', 'B', 'restore'): + assert len(x[sec]) == len(ch[sec]), (k, sec) + for i, (g, c) in enumerate(zip(x[sec], ch[sec])): + assert g[:-1] == c[:-1], (k, sec, i, g, c) + if g[-1] != c[-1]: + fc.append(dict(section=sec, index=i, gate=g[:-1], old_frame=g[-1], new_frame=c[-1])) + hf = {h_: (x['helper_final'].get(h_), U) for h_, U in ch['helper_final'].items() if x['helper_final'].get(h_) != U} + other = sorted(key for key in x if key not in ('A', 'B', 'restore', 'report', 'cleanup', 'helper_final') and x[key] != ch[key]) + print('step', k, t['helper'], 'normal', t['normal'], 'inputs', len(t['before']), 'outputs', len(t['after']), 'frame changes', len(fc), + collections.Counter(e['section'] for e in fc), 'new-gate fc', sum(1 for e in fc if (e['section'] == 'restore' and e['index'] >= len(par['restore'])) or (e['section'] == 'A' and par['prelude_events'] <= e['index'] < par['prelude_events'] + len(t['before']))), + 'helper_final diffs', hf, 'other', other) + y = copy.deepcopy(x) + for e in fc: y[e['section']][e['index']][-1] = list(e['new_frame']) + y = finish(y) + assert y == ch, ('reproduce step', k, [key for key in ch if y[key] != ch[key]]) + out.append(dict(helper=t['helper'], normal=t['normal'], step=k, before=t['before'], after=t['after'], frame_changes=fc)) +# extra: same records must reproduce L27-extra exactly from L22-extra +w = read(A / 'L22-extra.json.gz') +for k, t in enumerate(out, 1): + x = insert(w, t) + for e in t['frame_changes']: + g = x[e['section']][e['index']] + assert g[:-1] == e['gate'] and g[-1] == e['old_frame'], ('extra preimage', k, e) + g[-1] = list(e['new_frame']) + w = finish(x) +print('extra final == L27-extra:', w == read(A / 'L27-extra.json.gz')) +json.dump(out, open(S / 'r14pub-build/derive/stage2-transforms.json', 'w'), indent=1) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/records/make_data.py b/research/rank7-coupled-586-588-carrier-fold/construction/records/make_data.py new file mode 100644 index 0000000000..ff113b8a12 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/records/make_data.py @@ -0,0 +1,21 @@ +"""Write the package's declared data records (stage 1 frame edits, stage-2 transforms, stage-3 re-based rewrites) to argv[1].""" +import json, sys +from pathlib import Path +S = Path('S') +A = S / 'r14/agents/A-extract/out'; RW = S / 'r14/agents/RW/out/L27+2957' +out = Path(sys.argv[1]); out.mkdir(parents=True, exist_ok=True) +fe = json.load(open(A / 'L22-base-FRAME-EDITS.json')); assert fe == json.load(open(A / 'L22-extra-FRAME-EDITS.json')) +rec = {'stage': 'stage 1: joint codimension-2 end-frame lowering (frame-only)', + 'providers': 'one record serves both providers (base and extra words are equal on every edited gate and end frame)', + 'groups': fe['groups'], 'helper_final_changes': fe['helper_final_changes'], 'frame_edits': fe['frame_edits'], + 'declared_local_profile': fe['declared_local_profile'], 'declared_width_inventory': fe['declared_width_inventory'], + 'addressing': 'index = position in the parent (PR2942) word section; gate = the literal gate without its frame; every new frame is a hyperplane of the old one'} +(out / 'STAGE1-FRAME-EDITS.json').write_text(json.dumps(rec, indent=1) + '\n') +for t in json.load(open(S / 'r14pub-build/derive/stage2-transforms.json')): + r = {'step': t['step'], 'helper': t['helper'], 'normal': t['normal'], 'before': t['before'], 'after': t['after'], + 'frame_changes': t['frame_changes'], + 'addressing': 'before: input gates inserted right after the prelude; after: output gates appended to restore; frame_changes: addressed in the child word after insertion'} + (out / f'TRANSFORM-{t["helper"]}.json').write_text(json.dumps(r, indent=1) + '\n') +rb = json.load(open(RW / 'REWRITES-2957-on-L27-base.json')); assert rb == json.load(open(RW / 'REWRITES-2957-on-L27-extra.json')) +(out / 'REWRITES-2957.json').write_text(json.dumps(rb, indent=1) + '\n') +print('data records written', sorted(p.name for p in out.iterdir())) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/records/make_prices.py b/research/rank7-coupled-586-588-carrier-fold/construction/records/make_prices.py new file mode 100644 index 0000000000..8700174f1c --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/records/make_prices.py @@ -0,0 +1,63 @@ +"""construction/STAGE-PRICES.json: search-time certified prices (lane A / lane RW, r14) as evidence; argv[1] = output path.""" +import json, sys +from pathlib import Path +S = Path('S') +A = S / 'r14/agents/A-extract/out' +C = {1: 2116671, 2: 4228346, 3: 6338140, 4: 8446713, 5: 10554378, 6: 12661320, 7: 14767661, 8: 16873488, 9: 18978865} +BE = 2091300 +GROUPS = {'V45': [256, 128, 64, 35, 16, 11, 5], 'A': [256, 128, 64, 38, 20, 10, 1], 'B': [256, 128, 64, 34, 17, 11, 4], + 'C': [256, 128, 64, 32, 19, 11, 6], 'D': [256, 128, 64, 37, 21, 8, 3]} +HS = {'V45': [249, 251, 265, 267], 'A': [331, 450, 451, 508, 509], 'B': [299, 448, 449, 484, 485], 'C': [452, 453, 532, 533], 'D': [454, 455, 556, 557]} +joint = json.load(open(A / 'lowerA-joint.json')) +vl = json.load(open(A / 'V2942-base-vlower.json')) +groups = [] +for g, W in GROUPS.items(): + if g == 'V45': + full = next(r for r in vl if sorted(r['Q']) == HS[g]) + singles = {str(r['Q'][0]): r['margin_vs_k_BE'] for r in vl if len(r['Q']) == 1} + groups.append(dict(group=g, W=W, helpers=HS[g], singles_margin=singles, joint_delta=full['delta_units'], joint_margin=full['margin_vs_k_BE'], + subsets=[{'helpers': sorted(r['Q']), 'delta': r['delta_units'], 'margin': r['margin_vs_k_BE']} for r in vl])) + else: + r = next(r for r in joint if r.get('W') == W) + assert sorted(r['helpers']) == sorted(HS[g]) + groups.append(dict(group=g, W=W, helpers=HS[g], singles_margin={str(h): m for h, m in zip(r['helpers'], r['singles'])}, + joint_delta=r['joint_delta'], joint_margin=r['joint_margin'])) +for g in groups: + assert g['joint_margin'] == -g['joint_delta'] - len(g['helpers']) * BE, g +unions = [dict(Ws=r['union'], helpers=r['helpers'], joint_delta=r['joint_delta'], joint_margin=r['joint_margin']) for r in joint if 'union' in r] +unused = [dict(W=r['W'], helpers=r['helpers'], margin=r['joint_margin']) for r in joint if 'W' in r and r['W'] not in GROUPS.values()] +s1 = sum(g['joint_delta'] for g in groups) +assert s1 == -46150994 +out = { + 'note': 'Search-time pricing with the certified frame solver (r12 harness on the #1186 toolkit, exact chain dual decomposition) by lanes A and RW of round r14; units of 2^-40 at the base saving b. Evidence only: the claim rests on verify.py, check_allocation.py, check_cap.py and the complete admission. verify.py recomputes the literal stage prices from the frame-report profiles with these weights and checks them against this table.', + 'weights': {'c': {str(k): v for k, v in C.items()}, 'b': '0.001703676387993676', 'definition': 'c_r = floor(2^40 * T_r(b)), the solver integer surrogate of the per-child moment term of rank r', + 'break_even': BE, 'break_even_definition': 'the round value guide: local saving that buys one freed width unit at fixed packing (about c1 - 25,371); margins below are -delta - k * break_even'}, + 'stage1': {'groups': groups, 'pairwise_unions': unions, 'unused_single_W_groups': unused, 'literal_price_units': s1, 'freed_width_units': 22, + 'margin': -s1 - 22 * BE, 'groups_independent': all(u['joint_delta'] == sum(g['joint_delta'] for g in groups if g['W'] in u['Ws']) for u in unions if all(w in GROUPS.values() for w in u['Ws'])), + 'leave_one_out_reported': 'lane A (combine.py, base provider): leaving any single helper out of its group costs 23,490 .. 25,371 units, so every member contributes; not stored per helper', + 'candidates': 'necessary condition: the lowered end frame W must contain L_h, the solver lower bound at h\'s last vertex; over all 86 restored helpers exactly 20 (end dim 8, L_h dim 7, W = L_h) plus PR2942\'s four pivots qualify; no helper has slack for a two-dimension lowering'}, + 'stage2': {'steps': [dict(step=1, normal=42, helper=226, delta=-2101683), dict(step=2, normal=42, helper=228, delta=-2106679), dict(step=3, normal=42, helper=230, delta=-2101683), + dict(step=4, normal=7, helper=363, delta=-2106679), dict(step=5, normal=7, helper=395, delta=-2106679)], + 'literal_price_units': -10523403, 'freed_width_units': 5, 'margin': 10523403 - 5 * BE, + 'kopt_on_stage1_word': {'7': {'margin': 30758, 'k': 2, 'X': [5, 73, 363, 395], 'P': [363, 395]}, '42': {'margin': 26153, 'k': 3, 'P': [226, 228, 230], 'realized_margin': 36145}, + '25': {'margin': 20766, 'k': 2, 'P': [232, 363], 'note': 'conflicts with normal 7 (shares pivot 363)'}, '52': {'margin': 20766, 'k': 2}, + '76/82/97/127': {'margin': -34529}, '486/504': {'margin': -29645}}, + 'recensus_after_stage2': {'7': 'pairing rank 0', '42': 'pairing rank 0', '52': 'pairing rank 0', '25': {'margin': -34529, 'k': 1}}, + 'on_parent_without_stage1': 'kopt on PR2942 words: best margin -29,645 (486/504); no positive normal'}, + 'stage3': {'rewrites': {'5997': -4996, '6000': -4996, '6004': -4996, '6008': -4996, '3779': -3102, 'swap3749': -3102, 'swap3755': -3102, 'swap3761': -3102, + 'swap3767': -3102, 'swap3773': -3102, '1564': -6877, '1569': -6877, '4604': 0, '4630': 0}, + 'literal_price_units': -52350, 'additive': 'the composed delta equals the sum of the single-rewrite deltas, the same -52,350 as on PR2917 and PR2942 words', + 'credit': 'rewrites by Jeremy Kothe (jeremykothe2), PR2957; re-addressed to this word with exact preimages by our lane RW'}, + 'codim2_census': {'subspaces': 43435, 'theorem': 'a 7-dim V lies in exactly three hyperplanes E_n1, E_n2, E_(n1 xor n2), and the admissible pairing at V restricts the pairing at each of them, so a fresh helper can pair at V only if all three normals pair', + 'rows': [{'word': 'PR2894 parent (literal frames)', 'normals_with_pairing': [52, 76, 82, 97, 127, 486, 504], 'V_all_three': 0, 'V_nonzero': 0}, + {'word': 'PR2917 (lowered frames)', 'normals_with_pairing': [7, 25, 42, 45, 52, 76, 82, 97, 127, 486, 504], 'V_all_three': 4, + 'V_nonzero': 1, 'V': [256, 128, 64, 35, 16, 11, 5], 'note': 'V45 = E_7 n E_42 n E_45, prank 4: the normal-45 structure itself'}, + {'word': 'PR2942', 'normals_with_pairing': [7, 25, 42, 52, 76, 82, 97, 127, 486, 504], 'V_all_three': 0, 'V_nonzero': 0}, + {'word': 'stage 1 (L22)', 'normals_with_pairing': [7, 25, 42, 52, 76, 82, 97, 127, 486, 504], 'V_all_three': 0, 'V_nonzero': 0}], + 'pr2918_consistency': 'at E7 = (256,128,66,36,22,8,1) on the PR2894 parent: non-restored R_V = {105, 408}; with restored helpers allowed R = {105,307,309,314,369,371,373,378,408,572,573}, |H| = 226, dimA = dimB = 0, as RossRichardson\'s PR2918 (research/helper408-rank7-pairing)'}, + 'caps': {'PR2942': '0.0017228172707428495209099', 'stage1': '0.0017262265796413098725813', 'stage2': '0.0017278107473204236839366', 'stage3': '0.001729035764875516181444'}, + 'total': {'literal_price_units': -46150994 - 10523403 - 52350, 'freed_width_units': 27, 'margin': 46150994 + 10523403 + 52350 - 27 * BE}, +} +assert out['stage1']['groups_independent'] +Path(sys.argv[1]).write_text(json.dumps(out, indent=1) + '\n') +print('margins', out['stage1']['margin'], out['stage2']['margin'], out['total']['margin']) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/search/codim2.py b/research/rank7-coupled-586-588-carrier-fold/construction/search/codim2.py new file mode 100644 index 0000000000..7b60aafc88 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/search/codim2.py @@ -0,0 +1,63 @@ +"""codim2.py -- exact census of rank-7 (codimension-2) paired extractions for FRESH helpers (9->7). +For every 7-dim subspace V of F2^9 (43,435 = triples {n1 0 requires prank(E_n1), prank(E_n2), prank(E_n3) > 0. For those V the exact pairing rank on R_V is computed. +usage: python -B codim2.py WORD.json.gz OUT.json [lower|literal] [V-basis-to-report e.g. 256,128,66,36,22,8,1]""" +import sys, json, time, collections +sys.path.insert(0, 'S/r13/agents/A-extract/code') +from synth import * +from lower import per_normal_R, terminal_lower + +def main(): + wp, op = sys.argv[1], sys.argv[2]; mode = sys.argv[3] if len(sys.argv) > 3 else 'lower' + probe = [int(x) for x in sys.argv[4].split(',')] if len(sys.argv) > 4 else None + t0 = time.time(); w = load(wp); fr = frames(w); sp = CE.spaces(w, fr=fr); H = sp['H'] + tl, g, al = terminal_lower(w) + term = tl if mode == 'lower' else {r: fr['terminal'][r] for r in tl} + restored = set(map(int, w['helper_final'])) + regs = [r for r in live_regs(w) if r not in restored] + idx = {r: i for i, r in enumerate(regs)} + Rbits = {} + for n in range(1, 512): + b = 0 + for r in regs: + if all(((x & n).bit_count() & 1) == 0 for x in term[r]): b |= 1 << idx[r] + Rbits[n] = b + unbits = lambda b: [regs[i] for i in range(len(regs)) if b >> i & 1] + hyper = {} + for n in range(1, 512): + key = Rbits[n] + if key not in hyper: hyper[key] = per_normal_R(w, sp, n, unbits(key))['prank'] + prank_n = {n: hyper[Rbits[n]] for n in range(1, 512)} + live_normals = sorted(n for n in prank_n if prank_n[n] > 0) + nV = 0; cand = [] + for n1 in range(1, 512): + for n2 in range(n1 + 1, 512): + n3 = n1 ^ n2 + if n3 <= n2: continue + nV += 1 + if prank_n[n1] and prank_n[n2] and prank_n[n3]: cand.append((n1, n2, n3)) + out = dict(word=wp, mode=mode, subspaces=nV, normals_with_pairing=live_normals, triples_all_three_nonzero=len(cand), V=[]) + seen = {} + for (n1, n2, n3) in cand: + b = Rbits[n1] & Rbits[n2]; R = unbits(b) + if b not in seen: seen[b] = per_normal_R(w, sp, n1, R) + res = seen[b] + Vb = list(PM.basis([z for z in range(1, 512) if ((z & n1).bit_count() & 1) == 0 and ((z & n2).bit_count() & 1) == 0])) + piv = sorted(H & set(R)) + out['V'].append(dict(normals=[n1, n2, n3], V=Vb, R=R, pivots=piv, dimA=res['dimA'], dimB=res['dimB'], prank=res['prank'], + alphas=[{str(k): str(v) for k, v in a.items()} for a in res['alphas']] if res['prank'] else [], + ys=[{str(k): str(v) for k, v in y.items()} for y in res['ys']] if res['prank'] else [])) + print(f'V {n1},{n2},{n3} basis {Vb}: |R_V|={len(R)} pivots={len(piv)} dimA={res["dimA"]} dimB={res["dimB"]} prank={res["prank"]}', flush=True) + if probe is not None: + P = PM.basis(probe); R = [r for r in regs if PM.contained(term[r], P)] + res = per_normal_R(w, sp, 1, R) + out['probe'] = dict(V=list(P), R=R, R_with_restored=[r for r in live_regs(w) if PM.contained(term[r], P)], dimA=res['dimA'], dimB=res['dimB'], prank=res['prank'], H_size=len(H)) + print('PROBE', out['probe'], flush=True) + out['seconds'] = round(time.time() - t0, 1) + print(f'{mode}: {nV} subspaces; normals with nonzero pairing {live_normals}; V with all three containing normals nonzero: {len(cand)}; ' + f'V with nonzero pairing: {sum(1 for v in out["V"] if v["prank"])} ({out["seconds"]}s)', flush=True) + json.dump(out, open(op, 'w'), indent=0) + +if __name__ == '__main__': main() diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/search/combine.py b/research/rank7-coupled-586-588-carrier-fold/construction/search/combine.py new file mode 100644 index 0000000000..65b84f5f4e --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/search/combine.py @@ -0,0 +1,37 @@ +"""combine.py -- PR2942 + frame-only end-frame lowerings: the four normal-45 pivots to V and the restored-helper groups A-D to their W. +Certified solver frames written back, report re-derived, PR2833 auditor; leave-one-out inside groups (base only).""" +import sys, json, copy, collections +sys.path.insert(0, 'S/r13/agents/A-extract/code') +from synth import * +BE = 2091300 +V = (256, 128, 64, 35, 16, 11, 5) +G = {'V45': (V, [249, 251, 265, 267]), + 'A': ((256, 128, 64, 38, 20, 10, 1), [331, 450, 451, 508, 509]), + 'B': ((256, 128, 64, 34, 17, 11, 4), [299, 448, 449, 484, 485]), + 'C': ((256, 128, 64, 32, 19, 11, 6), [452, 453, 532, 533]), + 'D': ((256, 128, 64, 37, 21, 8, 3), [454, 455, 556, 557])} +def build(w, groups): + x = copy.deepcopy(w) + for g in groups: + W, hs = G[g] + for h in hs: x['helper_final'][str(h)] = list(W) + return x +res = {} +for v in ('base', 'extra'): + w = load(S / f'r14/inputs/WORD-2942-{v}.json.gz'); base = solve_frames(w, key=v) + x = build(w, G); pf = bp.frame_profile(x, literal=False); d = pf['cost'] - base['cost']; k = sum(len(hs) for W, hs in G.values()) + wf = finish(bp.write_frames(x, pf)); ok, msg, rep = audit(wf) + dp = collections.Counter(pf['profile']); dp.subtract(collections.Counter(base['profile'])) + res[v] = dict(delta_units=d, freed_units=k, margin=-d - k * BE, profile=pf['profile'], profile_delta={a: b for a, b in sorted(dp.items()) if b}, + inventory=wf['report']['width_inventory'], audit=msg, certified=pf['certified'], buffers=len(wf['helper_final'])) + print(v, res[v], flush=True) + if ok: dump(wf, f'L22-{v}.json.gz') + if v == 'base': + for g in ('A', 'B', 'C', 'D'): + W, hs = G[g] + for h in hs: + y = copy.deepcopy(x); y['helper_final'][str(h)] = list(w['helper_final'][str(h)]) + try: dd = bp.frame_profile(y, literal=False)['cost'] - base['cost'] + except Exception: dd = None + print(f' leave-one-out {g} without {h}: margin {None if dd is None else -dd - (k - 1) * BE} (full {res[v]["margin"]})', flush=True) +json.dump(res, open('L22-summary.json', 'w'), indent=1, default=str) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/search/deliver_l22.py b/research/rank7-coupled-586-588-carrier-fold/construction/search/deliver_l22.py new file mode 100644 index 0000000000..21182d4310 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/search/deliver_l22.py @@ -0,0 +1,38 @@ +"""deliver_v.py -- declared frame-edit record + exact spec (lane D wordedit) for the V-lowered PR2942 words; re-verifies by applying +the declared edits to WORD-2942 (frames + helper_final), re-deriving report/cleanup, solver profile, auditor.""" +import sys, json, copy, collections, hashlib +sys.path.insert(0, 'S/r13/agents/A-extract/code') +sys.path.insert(0, 'S/r13/agents/D-chain/code') +from synth import * +import wordedit as WE +V = [256, 128, 64, 35, 16, 11, 5] +summary = {} +for v in ('base', 'extra'): + old = load(S / f'r14/inputs/WORD-2942-{v}.json.gz'); new = load(f'L22-{v}.json.gz') + edits = [] + for sec in ('A', 'B', 'restore'): + assert len(old[sec]) == len(new[sec]) + for i, (a, b) in enumerate(zip(old[sec], new[sec])): + if a[0] == 'warp': assert a == b; continue + assert a[:-1] == b[:-1], ('gate changed', sec, i) + if PM.basis(a[-1] or []) != PM.basis(b[-1] or []): + edits.append(dict(section=sec, index=i, gate=a[:-1], old_frame=a[-1], new_frame=b[-1])) + hf = {k: dict(old=old['helper_final'][k], new=new['helper_final'][k]) for k in new['helper_final'] if old['helper_final'][k] != new['helper_final'][k]} + other = [k for k in old if k not in ('A', 'B', 'restore', 'helper_final', 'report', 'cleanup') and old[k] != new[k]] + # re-apply declared edits to the old word and re-verify + x = copy.deepcopy(old) + for e in edits: x[e['section']][e['index']][-1] = list(e['new_frame']) + for k, d in hf.items(): x['helper_final'][k] = list(d['new']) + x = finish(x); ok, msg, rep = audit(x) + same = all(x[k] == new[k] for k in new) + prof = PM.frame_report(x) + spec = WE.make_spec(old, new); rebuilt = WE.apply_spec(old, spec); rt = [k for k in new if rebuilt.get(k) != new[k]] + json.dump(dict(stage='codim2-end-frame-lowering', groups={'V45': [[256,128,64,35,16,11,5], [249,251,265,267]], 'A': [[256,128,64,38,20,10,1], [331,450,451,508,509]], 'B': [[256,128,64,34,17,11,4], [299,448,449,484,485]], 'C': [[256,128,64,32,19,11,6], [452,453,532,533]], 'D': [[256,128,64,37,21,8,3], [454,455,556,557]]}, helper_final_changes=hf, frame_edits=edits, + declared_local_profile=new['report']['local_profile'], declared_width_inventory=new['report']['width_inventory']), + open(f'L22-{v}-FRAME-EDITS.json', 'w'), indent=1) + json.dump(spec, open(f'L22-{v}-SPEC.json', 'w'), indent=0) + summary[v] = dict(frame_edits=len(edits), by_section=dict(collections.Counter(e['section'] for e in edits)), helper_final_changes=len(hf), other_changed_sections=other, + reapply_equals_word=same, audit=msg, profile=prof[0], inventory=prof[1], spec_roundtrip_differing_keys=rt, + changed_sections=sorted(k for k in old if old[k] != new[k]), sha256=hashlib.sha256(open(f'L22-{v}.json.gz', 'rb').read()).hexdigest()) + print(v, summary[v], flush=True) +json.dump(summary, open('L22-DELIVERABLE.json', 'w'), indent=1) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/search/final_l27.py b/research/rank7-coupled-586-588-carrier-fold/construction/search/final_l27.py new file mode 100644 index 0000000000..ce3a20c8ff --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/search/final_l27.py @@ -0,0 +1,30 @@ +"""final_l27.py -- replicate the five extractions (n=42 x3: 226,228,230; n=7 x2: 363,395) on L22-{base,extra}; per-step TRANSFORM +records; structure + certified frames + auditor each step; exact spec (lane D wordedit) vs WORD-2942-*; summary.""" +import sys, json, collections, hashlib +sys.path.insert(0, 'S/r13/agents/A-extract/code') +sys.path.insert(0, 'S/r13/agents/D-chain/code') +from synth import * +import wordedit as WE +BE = 2091300 +trs = [r['transform'] for r in json.load(open('R42.json'))] + [r['transform'] for r in json.load(open('R42R7.json'))] +out = {} +for v in ('base', 'extra'): + w2942 = load(S / f'r14/inputs/WORD-2942-{v}.json.gz'); p0 = solve_frames(w2942, key='p' + v) + cur = load(f'L22-{v}.json.gz'); cur_pf = solve_frames(cur, key='l' + v); steps = [] + for k, tr in enumerate(trs, 1): + s = structure_check(cur, tr); assert s.startswith('PASS'), (v, k, s) + x = apply_stage(cur, tr); pf = solve_frames(x); wf = finish(bp.write_frames(x, pf)); ok, msg, rep = audit(wf); assert ok, (v, k, msg) + steps.append(dict(step=k, normal=tr['normal'], helper=tr['helper'], structure=s, audit=msg, delta=pf['cost'] - cur_pf['cost'], cumulative_vs_PR2942=pf['cost'] - p0['cost'])) + json.dump(dict(helper=tr['helper'], normal=tr['normal'], before=tr['before'], after=tr['after'], step=k, parent='L22 + previous steps'), + open(f'L27-{v}-TRANSFORM-step{k}-h{tr["helper"]}.json', 'w'), indent=1) + cur, cur_pf = wf, pf + dump(cur, f'L27-{v}.json.gz'); spec = WE.make_spec(w2942, cur); json.dump(spec, open(f'L27-{v}-SPEC.json', 'w'), indent=0) + rebuilt = WE.apply_spec(w2942, spec); rt = [k for k in cur if rebuilt.get(k) != cur[k]] + dp = collections.Counter(cur_pf['profile']); dp.subtract(collections.Counter(p0['profile'])) + out[v] = dict(steps=steps, total_vs_PR2942=cur_pf['cost'] - p0['cost'], freed_units=27, margin=-(cur_pf['cost'] - p0['cost']) - 27 * BE, + profile=cur_pf['profile'], profile_delta_vs_PR2942={a: b for a, b in sorted(dp.items()) if b}, inventory=cur['report']['width_inventory'], + buffers=len(cur['helper_final']), spec_roundtrip_differing_keys=rt, changed_sections=sorted(k for k in w2942 if w2942[k] != cur[k]), + sha256=hashlib.sha256(open(f'L27-{v}.json.gz', 'rb').read()).hexdigest()) + print(v, {k: x for k, x in out[v].items() if k != 'steps'}, flush=True) + for st in steps: print(' ', st, flush=True) +json.dump(out, open('L27-SUMMARY.json', 'w'), indent=1, default=str) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/search/lowerA.py b/research/rank7-coupled-586-588-carrier-fold/construction/search/lowerA.py new file mode 100644 index 0000000000..c08666a6da --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/search/lowerA.py @@ -0,0 +1,34 @@ +"""lowerA.py -- option (a) census: lower the END frame of every restored helper h by one dimension (U_h -> hyperplane W of U_h), +frame-only (gates/algebra unchanged), exact certified solver. Necessary: W contains the solver lower bound L_h of h's last vertex. +usage: python -B lowerA.py WORD.json.gz OUT.json part nparts""" +import sys, json, copy, time, collections +sys.path.insert(0, 'S/r13/agents/A-extract/code') +from synth import * +from lower import terminal_lower +BE = 2091300 +w = load(sys.argv[1]); outp = sys.argv[2]; part, nparts = int(sys.argv[3]), int(sys.argv[4]); base = solve_frames(w, key='b') +tl, g, al = terminal_lower(w) +hs = sorted(map(int, w['helper_final']))[part::nparts]; out = []; t0 = time.time() +for h in hs: + U = PM.basis(w['helper_final'][str(h)]); L = tl[h]; d = len(U) + # hyperplanes of U containing L: W = {x in U : f(x)=0} for nonzero functionals f on U vanishing on L + Ws = set(); spanU = set() + for m in range(1, 1 << d): + z = 0 + for i in range(d): + if m >> i & 1: z ^= U[i] + spanU.add(z) + for n in range(1, 512): + if all(((x & n).bit_count() & 1) == 0 for x in U): continue + W = PM.basis([z for z in spanU if ((z & n).bit_count() & 1) == 0]) + if PM.basis(list(L) + list(W)) == W: Ws.add(W) + rec = dict(h=h, end_dim=d, lower=list(L), lower_dim=len(L), candidates=len(Ws), results=[]) + for W in sorted(Ws): + x = copy.deepcopy(w); x['helper_final'][str(h)] = list(W) + try: dd = bp.frame_profile(x, literal=False)['cost'] - base['cost'] + except Exception as ex: rec['results'].append(dict(W=list(W), status='INFEASIBLE')); continue + rec['results'].append(dict(W=list(W), delta=dd, margin=-dd - BE)) + best = max((r for r in rec['results'] if 'margin' in r), key=lambda r: r['margin'], default=None) + rec['best'] = best; out.append(rec) + print(f'h {h}: end dim {d}, lower dim {len(L)}, candidate W {len(Ws)}, best {best and best["margin"]} ({round(time.time()-t0)}s)', flush=True) + json.dump(out, open(outp, 'w'), indent=0) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/search/lowerA_joint.py b/research/rank7-coupled-586-588-carrier-fold/construction/search/lowerA_joint.py new file mode 100644 index 0000000000..abbf31081d --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/search/lowerA_joint.py @@ -0,0 +1,39 @@ +"""lowerA_joint.py -- joint frame-only lowering of groups of restored helpers sharing a target subspace W (and all unions of groups +whose single margins are within reach), exact certified solver + auditor on the best.""" +import sys, json, copy, itertools, collections +sys.path.insert(0, 'S/r13/agents/A-extract/code') +from synth import * +BE = 2091300 +w = load(sys.argv[1]); base = solve_frames(w, key='b') +recs = [] +for p in sys.argv[2].split(','): recs += json.load(open(p)) +cands = [] +for r in recs: + for x in r['results']: + if 'margin' in x: cands.append((r['h'], tuple(x['W']), x['margin'])) +print('single candidates:', len(cands), 'helpers with a candidate:', len({h for h, W, m in cands}), 'positive singles:', [c for c in cands if c[2] > 0], flush=True) +byW = collections.defaultdict(list) +for h, W, m in cands: byW[W].append((h, m)) +out = [] +def price(assign): + x = copy.deepcopy(w) + for h, W in assign.items(): x['helper_final'][str(h)] = list(W) + try: pf = bp.frame_profile(x, literal=False) + except Exception as ex: return None, None + return pf['cost'] - base['cost'], pf +for W, lst in sorted(byW.items(), key=lambda t: -len(t[1])): + hs = [h for h, m in lst] + d, pf = price({h: W for h in hs}) + m = None if d is None else -d - len(hs) * BE + out.append(dict(W=list(W), helpers=hs, singles=[m_ for h, m_ in lst], joint_delta=d, joint_margin=m)) + print(f'W {list(W)}: helpers {hs} singles {[m_ for h, m_ in lst]} -> joint margin {m}', flush=True) +# unions of groups (pairs of groups) with best joint margins +best = sorted([o for o in out if o['joint_margin'] is not None], key=lambda o: -o['joint_margin']) +for a, b in itertools.combinations(best[:8], 2): + assign = {h: tuple(a['W']) for h in a['helpers']}; clash = any(h in assign for h in b['helpers']) + if clash: continue + assign.update({h: tuple(b['W']) for h in b['helpers']}) + d, pf = price(assign); m = None if d is None else -d - len(assign) * BE + out.append(dict(union=[a['W'], b['W']], helpers=sorted(assign), joint_delta=d, joint_margin=m)) + print(f'union {a["helpers"]} + {b["helpers"]}: joint margin {m} (sum of parts {a["joint_margin"] + b["joint_margin"]})', flush=True) +json.dump(out, open('lowerA-joint.json', 'w'), indent=1, default=str) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/search/realize.py b/research/rank7-coupled-586-588-carrier-fold/construction/search/realize.py new file mode 100644 index 0000000000..570d53d42c --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/search/realize.py @@ -0,0 +1,38 @@ +"""realize.py -- realise a rank-8 composition at normal N restricted to support X (+ registers already at E_N), prescribed pivots, +exact: GL(Z[1/2]) synthesis, structure.py, certified frames, PR2833 auditor at every step. +usage: python -B realize.py WORD.json.gz N 'x1,x2,..' 'p1,p2,..' TAG""" +import sys, json, itertools, collections +sys.path.insert(0, 'S/r13/agents/A-extract/code') +from synth import * +from lower import per_normal_R, terminal_lower, lower_pool +from pairsearch import restrict +BE = 2091300 +w0 = load(sys.argv[1]); N = int(sys.argv[2]); X = set(int(a) for a in sys.argv[3].split(',')); order = [int(a) for a in sys.argv[4].split(',')]; tag = sys.argv[5] +base0 = solve_frames(w0, key='b0'); cur = w0; cur_pf = base0; rows = [] +for k, h in enumerate(order, 1): + fr = frames(cur); sp = CE.spaces(cur, fr=fr); tl, g, al = terminal_lower(cur); R, E = lower_pool(cur, tl, N) + Eb = tuple(PM.basis(E)); F0 = {r for r in R if fr['terminal'][r] == Eb} + res = per_normal_R(cur, sp, N, R); allowed = ((X | F0) & set(R)) | {h} + A, Au = restrict(res['alphas'], res['us'], allowed); Y, Yv = restrict(res['ys'], res['vs'], allowed) + best = None; rng = [Q(-1), Q(0), Q(1)] + for ac in itertools.product(rng, repeat=len(A)): + if not any(ac): continue + c = {i: x for i, x in enumerate(ac) if x}; alpha = comb(c, A); u = comb(c, Au) + for bc in itertools.product(rng, repeat=len(Y)): + if not any(bc): continue + d = {j: x for j, x in enumerate(bc) if x}; y = comb(d, Y); v = comb(d, Yv) + if dot(alpha, y) == 0: continue + pr = normalise_pair(alpha, u, v, y) + if pr is None: continue + T = set(pr['alpha']) | set(pr['y']); key = (len(T - F0 - {h}), 0 if h in pr['alpha'] else 1, len(T)) + if best is None or key < best[0]: best = (key, pr) + if best is None: rows.append(dict(step=k, pivot=h, status='no pair')); print(tag, k, h, 'no pair', flush=True); break + r = run_direction_general(cur, h, N, best[1], cur_pf, label=f'{tag}/{h}') + if r.get('status') != 'PASS': rows.append(dict(step=k, pivot=h, status=r.get('status'), structure=r.get('structure'))); print(tag, k, h, r.get('status'), flush=True); break + cur = r['word']; cur_pf = solve_frames(cur); cum = cur_pf['cost'] - base0['cost'] + dp = collections.Counter(cur_pf['profile']); dp.subtract(collections.Counter(base0['profile'])) + rows.append(dict(step=k, pivot=h, delta=r['delta_units'], cumulative=cum, margin=-cum - k * BE, structure=r['structure'][:30], audit=r['audit'], + touched=r['touched'], profile=cur_pf['profile'], profile_delta={a: b for a, b in sorted(dp.items()) if b}, inventory=cur['report']['width_inventory'], transform=r['transform'])) + print(tag, 'step', k, 'pivot', h, 'delta', r['delta_units'], 'cumulative', cum, 'margin', -cum - k * BE, r['structure'][:12], 'audit', r['audit'], 'touched', r['touched'], flush=True) + dump(cur, f'{tag}-step{k}.json.gz') +json.dump(rows, open(f'{tag}.json', 'w'), indent=1, default=str) diff --git a/research/rank7-coupled-586-588-carrier-fold/construction/search/vlower.py b/research/rank7-coupled-586-588-carrier-fold/construction/search/vlower.py new file mode 100644 index 0000000000..c1eaf2b154 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/construction/search/vlower.py @@ -0,0 +1,22 @@ +"""vlower.py -- option (a) on the PR2942 words: lower the end frames of a subset Q of the four normal-45 pivots from E_45 to +V = E_7 ∩ E_42 ∩ E_45 (8->7 each), frame-only (gates and algebra unchanged); certified solver refit; PR2833 auditor on the +written-back word. usage: python -B vlower.py WORD.json.gz TAG [audit_all]""" +import sys, json, copy, itertools, collections +sys.path.insert(0, 'S/r13/agents/A-extract/code') +from synth import * +BE = 2091300; V = [256, 128, 64, 35, 16, 11, 5]; PIV = [249, 251, 265, 267] +w = load(sys.argv[1]); tag = sys.argv[2]; base = solve_frames(w, key='b'); out = [] +print('base', base['profile'], base['cost'], 'inventory', w['report']['width_inventory'], flush=True) +for k in range(1, 5): + for Qs in itertools.combinations(PIV, k): + x = copy.deepcopy(w) + for h in Qs: x['helper_final'][str(h)] = list(V) + try: pf = bp.frame_profile(x, literal=False) + except Exception as ex: out.append(dict(Q=Qs, status='INFEASIBLE', why=str(ex)[:160])); print(Qs, 'INFEASIBLE', str(ex)[:100], flush=True); continue + d = pf['cost'] - base['cost']; dp = collections.Counter(pf['profile']); dp.subtract(collections.Counter(base['profile'])) + rec = dict(Q=Qs, delta_units=d, margin_vs_k_BE=-d - k * BE, profile=pf['profile'], profile_delta={a: b for a, b in sorted(dp.items()) if b}, certified=pf['certified']) + if k == 4 or (len(sys.argv) > 3): + wf = finish(bp.write_frames(x, pf)); ok, msg, rep = audit(wf); rec['audit'] = msg; rec['inventory'] = wf['report']['width_inventory'] + if ok: dump(wf, f'{tag}-Q{"-".join(map(str, Qs))}.json.gz') + out.append(rec); print(rec, flush=True) +json.dump(out, open(f'{tag}-vlower.json', 'w'), indent=1, default=str) diff --git a/research/rank7-coupled-586-588-carrier-fold/data/PARENT-base.json.gz b/research/rank7-coupled-586-588-carrier-fold/data/PARENT-base.json.gz new file mode 100644 index 0000000000..1ca8287d6a Binary files /dev/null and b/research/rank7-coupled-586-588-carrier-fold/data/PARENT-base.json.gz differ diff --git a/research/rank7-coupled-586-588-carrier-fold/data/PARENT-extra.json.gz b/research/rank7-coupled-586-588-carrier-fold/data/PARENT-extra.json.gz new file mode 100644 index 0000000000..c39913ce24 Binary files /dev/null and b/research/rank7-coupled-586-588-carrier-fold/data/PARENT-extra.json.gz differ diff --git a/research/rank7-coupled-586-588-carrier-fold/data/REWRITES-2957.json b/research/rank7-coupled-586-588-carrier-fold/data/REWRITES-2957.json new file mode 100644 index 0000000000..7bf1633c93 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/data/REWRITES-2957.json @@ -0,0 +1,1192 @@ +[ + { + "id": "5997", + "cls": "R-retime", + "edits": [ + { + "section": "restore", + "start": 1, + "stop": 1, + "old": [], + "new": [ + [ + "add", + 408, + 105, + 1, + 1, + [ + 256, + 128, + 66, + 36, + 22, + 8, + 1 + ] + ] + ] + }, + { + "section": "restore", + "start": 88, + "stop": 89, + "old": [ + [ + "add", + 408, + 105, + 1, + 1, + [ + 256, + 128, + 64, + 36, + 20, + 8, + 2, + 1 + ] + ] + ], + "new": [] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "6000", + "cls": "R-retime", + "edits": [ + { + "section": "restore", + "start": 5, + "stop": 5, + "old": [], + "new": [ + [ + "add", + 424, + 44, + 1, + 1, + [ + 256, + 128, + 65, + 37, + 20, + 8, + 2 + ] + ] + ] + }, + { + "section": "restore", + "start": 91, + "stop": 92, + "old": [ + [ + "add", + 424, + 44, + 1, + 1, + [ + 256, + 128, + 64, + 36, + 20, + 8, + 2, + 1 + ] + ] + ], + "new": [] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "6004", + "cls": "R-retime", + "edits": [ + { + "section": "restore", + "start": 7, + "stop": 7, + "old": [], + "new": [ + [ + "add", + 428, + 430, + -1, + 1, + [ + 256, + 128, + 72, + 44, + 28, + 2, + 1 + ] + ] + ] + }, + { + "section": "restore", + "start": 95, + "stop": 96, + "old": [ + [ + "add", + 428, + 430, + 1, + 1, + [ + 256, + 128, + 68, + 32, + 16, + 12, + 2, + 1 + ] + ] + ], + "new": [] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "6008", + "cls": "R-retime", + "edits": [ + { + "section": "restore", + "start": 3, + "stop": 3, + "old": [], + "new": [ + [ + "add", + 412, + 414, + -1, + 1, + [ + 256, + 128, + 65, + 36, + 20, + 9, + 3 + ] + ] + ] + }, + { + "section": "restore", + "start": 99, + "stop": 100, + "old": [ + [ + "add", + 412, + 414, + 1, + 1, + [ + 256, + 128, + 65, + 33, + 17, + 9, + 5, + 3 + ] + ] + ], + "new": [] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "3779", + "cls": "A3779-cut-start-read", + "edits": [ + { + "section": "A", + "start": 4040, + "stop": 4041, + "old": [ + [ + "add", + 256, + 288, + 1, + 1, + [ + 256, + 128, + 68, + 34, + 16, + 14, + 1 + ] + ] + ], + "new": [] + }, + { + "section": "A", + "start": 4046, + "stop": 4046, + "old": [], + "new": [ + [ + "add", + 256, + 288, + 1, + 1, + [ + 256, + 128, + 68, + 32, + 16, + 12, + 2, + 1 + ] + ] + ] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "1564", + "cls": "PM-carrier-lender-entry", + "edits": [ + { + "section": "A", + "start": 590, + "stop": 590, + "old": [], + "new": [ + [ + "add", + 456, + 311, + -1, + 1, + [] + ], + [ + "add", + 312, + 311, + 1, + 4, + [] + ], + [ + "add", + 304, + 311, + 1, + 4, + [] + ], + [ + "add", + 280, + 311, + -1, + 4, + [] + ], + [ + "add", + 272, + 311, + -1, + 4, + [] + ], + [ + "add", + 249, + 311, + -1, + 4, + [] + ], + [ + "add", + 243, + 311, + 1, + 4, + [] + ], + [ + "add", + 242, + 311, + -1, + 4, + [] + ] + ] + }, + { + "section": "A", + "start": 1825, + "stop": 1826, + "old": [ + [ + "add", + 457, + 499, + 1, + 1, + [ + 42 + ] + ] + ], + "new": [] + }, + { + "section": "restore", + "start": 40, + "stop": 40, + "old": [], + "new": [ + [ + "add", + 475, + 498, + -1, + 2, + [ + 256, + 128, + 72, + 40, + 24, + 4, + 2, + 1 + ] + ], + [ + "add", + 306, + 498, + 1, + 2, + [ + 256, + 128, + 72, + 40, + 24, + 4, + 2, + 1 + ] + ] + ] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "1569", + "cls": "PM-carrier-lender-entry", + "edits": [ + { + "section": "A", + "start": 345, + "stop": 345, + "old": [], + "new": [ + [ + "add", + 327, + 510, + 1, + 1, + [] + ], + [ + "add", + 325, + 510, + 1, + 4, + [] + ], + [ + "add", + 322, + 510, + 7, + 8, + [] + ], + [ + "add", + 289, + 510, + 1, + 2, + [] + ], + [ + "add", + 255, + 510, + 1, + 8, + [] + ], + [ + "add", + 252, + 510, + 1, + 8, + [] + ], + [ + "add", + 250, + 510, + 1, + 8, + [] + ], + [ + "add", + 249, + 510, + -1, + 8, + [] + ], + [ + "add", + 247, + 510, + -1, + 8, + [] + ], + [ + "add", + 246, + 510, + 1, + 8, + [] + ], + [ + "add", + 242, + 510, + 1, + 8, + [] + ] + ] + }, + { + "section": "A", + "start": 413, + "stop": 413, + "old": [], + "new": [ + [ + "add", + 320, + 510, + 1, + 1, + [] + ] + ] + }, + { + "section": "A", + "start": 414, + "stop": 414, + "old": [], + "new": [ + [ + "add", + 320, + 510, + -3, + 2, + [] + ] + ] + }, + { + "section": "A", + "start": 415, + "stop": 415, + "old": [], + "new": [ + [ + "add", + 320, + 510, + 1, + 1, + [] + ] + ] + }, + { + "section": "A", + "start": 416, + "stop": 416, + "old": [], + "new": [ + [ + "add", + 320, + 510, + -1, + 1, + [] + ] + ] + }, + { + "section": "A", + "start": 417, + "stop": 417, + "old": [], + "new": [ + [ + "add", + 320, + 510, + 1, + 2, + [] + ] + ] + }, + { + "section": "A", + "start": 466, + "stop": 466, + "old": [], + "new": [ + [ + "add", + 320, + 510, + 3, + 8, + [] + ] + ] + }, + { + "section": "A", + "start": 572, + "stop": 572, + "old": [], + "new": [ + [ + "add", + 327, + 510, + -1, + 1, + [] + ] + ] + }, + { + "section": "A", + "start": 851, + "stop": 851, + "old": [], + "new": [ + [ + "add", + 293, + 510, + 1, + 2, + [] + ] + ] + }, + { + "section": "A", + "start": 852, + "stop": 852, + "old": [], + "new": [ + [ + "add", + 293, + 510, + -1, + 2, + [] + ] + ] + }, + { + "section": "A", + "start": 893, + "stop": 893, + "old": [], + "new": [ + [ + "add", + 289, + 510, + -1, + 2, + [] + ] + ] + }, + { + "section": "A", + "start": 1175, + "stop": 1175, + "old": [], + "new": [ + [ + "add", + 321, + 510, + 1, + 4, + [] + ] + ] + }, + { + "section": "A", + "start": 1176, + "stop": 1176, + "old": [], + "new": [ + [ + "add", + 321, + 510, + 3, + 2, + [] + ] + ] + }, + { + "section": "A", + "start": 1177, + "stop": 1177, + "old": [], + "new": [ + [ + "add", + 321, + 510, + -7, + 4, + [] + ] + ] + }, + { + "section": "A", + "start": 1181, + "stop": 1181, + "old": [], + "new": [ + [ + "add", + 320, + 510, + -1, + 4, + [] + ] + ] + }, + { + "section": "A", + "start": 1830, + "stop": 1831, + "old": [ + [ + "add", + 458, + 510, + 1, + 1, + [ + 42 + ] + ] + ], + "new": [] + }, + { + "section": "restore", + "start": 48, + "stop": 48, + "old": [], + "new": [ + [ + "add", + 486, + 510, + -1, + 2, + [ + 256, + 128, + 65, + 32, + 17, + 8, + 5, + 2 + ] + ] + ] + }, + { + "section": "restore", + "start": 110, + "stop": 110, + "old": [], + "new": [ + [ + "add", + 23, + 510, + -1, + 2, + [ + 256, + 128, + 65, + 32, + 17, + 8, + 5, + 2 + ] + ] + ] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "4604", + "cls": "B-carrier-retime", + "edits": [ + { + "section": "A", + "start": 2670, + "stop": 2670, + "old": [], + "new": [ + [ + "add", + 499, + 306, + 1, + 1, + [ + 415, + 84, + 44 + ] + ] + ] + }, + { + "section": "B", + "start": 606, + "stop": 607, + "old": [ + [ + "add", + 499, + 306, + 1, + 1, + [ + 409, + 82, + 42, + 6 + ] + ] + ], + "new": [] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "4630", + "cls": "B-carrier-retime", + "edits": [ + { + "section": "A", + "start": 2823, + "stop": 2823, + "old": [], + "new": [ + [ + "add", + 510, + 327, + 1, + 1, + [ + 276, + 138, + 85 + ] + ] + ] + }, + { + "section": "B", + "start": 631, + "stop": 632, + "old": [ + [ + "add", + 510, + 327, + 1, + 1, + [ + 276, + 138, + 85, + 42 + ] + ] + ], + "new": [] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "swap3749", + "cls": "A-commuting-swap", + "edits": [ + { + "section": "A", + "start": 4010, + "stop": 4011, + "old": [ + [ + "add", + 81, + 17, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + ] + ], + "new": [] + }, + { + "section": "A", + "start": 4012, + "stop": 4012, + "old": [], + "new": [ + [ + "add", + 81, + 17, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 17, + 9, + 4, + 2 + ] + ] + ] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "swap3755", + "cls": "A-commuting-swap", + "edits": [ + { + "section": "A", + "start": 4016, + "stop": 4017, + "old": [ + [ + "add", + 224, + 107, + 1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ] + ], + "new": [] + }, + { + "section": "A", + "start": 4018, + "stop": 4018, + "old": [], + "new": [ + [ + "add", + 224, + 107, + 1, + 1, + [ + 256, + 128, + 64, + 36, + 20, + 8, + 2, + 1 + ] + ] + ] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "swap3761", + "cls": "A-commuting-swap", + "edits": [ + { + "section": "A", + "start": 4022, + "stop": 4023, + "old": [ + [ + "add", + 11, + 77, + 1, + 1, + [ + 256, + 128, + 74, + 40, + 26, + 4, + 1 + ] + ] + ], + "new": [] + }, + { + "section": "A", + "start": 4024, + "stop": 4024, + "old": [], + "new": [ + [ + "add", + 11, + 77, + 1, + 1, + [ + 256, + 128, + 66, + 32, + 18, + 8, + 4, + 1 + ] + ] + ] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "swap3767", + "cls": "A-commuting-swap", + "edits": [ + { + "section": "A", + "start": 4028, + "stop": 4029, + "old": [ + [ + "add", + 240, + 39, + 1, + 1, + [ + 256, + 128, + 65, + 34, + 17, + 10, + 5 + ] + ] + ], + "new": [] + }, + { + "section": "A", + "start": 4030, + "stop": 4030, + "old": [], + "new": [ + [ + "add", + 240, + 39, + 1, + 1, + [ + 256, + 128, + 65, + 33, + 17, + 9, + 5, + 3 + ] + ] + ] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + }, + { + "id": "swap3773", + "cls": "A-commuting-swap", + "edits": [ + { + "section": "A", + "start": 4034, + "stop": 4035, + "old": [ + [ + "add", + 9, + 272, + 1, + 1, + [ + 256, + 128, + 65, + 35, + 16, + 10, + 4 + ] + ] + ], + "new": [] + }, + { + "section": "A", + "start": 4036, + "stop": 4036, + "old": [], + "new": [ + [ + "add", + 9, + 272, + 1, + 1, + [ + 256, + 128, + 65, + 33, + 16, + 8, + 4, + 2 + ] + ] + ] + } + ], + "credit": "PR2957 (jeremykothe2): declared rewrite re-addressed to lane A L27 word (A +261 vs PR2917, +139 vs PR2942); frames of inserted gates re-solved (certified)" + } +] diff --git a/research/rank7-coupled-586-588-carrier-fold/data/STAGE1-FRAME-EDITS.json b/research/rank7-coupled-586-588-carrier-fold/data/STAGE1-FRAME-EDITS.json new file mode 100644 index 0000000000..66525d293b --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/data/STAGE1-FRAME-EDITS.json @@ -0,0 +1,4554 @@ +{ + "stage": "stage 1: joint codimension-2 end-frame lowering (frame-only)", + "providers": "one record serves both providers (base and extra words are equal on every edited gate and end frame)", + "groups": { + "V45": [ + [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ], + [ + 249, + 251, + 265, + 267 + ] + ], + "A": [ + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ], + [ + 331, + 450, + 451, + 508, + 509 + ] + ], + "B": [ + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ], + [ + 299, + 448, + 449, + 484, + 485 + ] + ], + "C": [ + [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ], + [ + 452, + 453, + 532, + 533 + ] + ], + "D": [ + [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ], + [ + 454, + 455, + 556, + 557 + ] + ] + }, + "helper_final_changes": { + "448": { + "old": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + "449": { + "old": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + "450": { + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + "451": { + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + "452": { + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + }, + "453": { + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + }, + "454": { + "old": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + }, + "455": { + "old": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + }, + "484": { + "old": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + "485": { + "old": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + "508": { + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + "509": { + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + "532": { + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + }, + "533": { + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + }, + "556": { + "old": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + }, + "557": { + "old": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + }, + "331": { + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + "299": { + "old": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + "249": { + "old": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + "267": { + "old": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + "251": { + "old": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + "265": { + "old": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + } + }, + "frame_edits": [ + { + "section": "B", + "index": 355, + "gate": [ + "add", + 112, + 71, + -1, + 2 + ], + "old_frame": [ + 256, + 144, + 80, + 42, + 7 + ], + "new_frame": [ + 256, + 144, + 80, + 45 + ] + }, + { + "section": "B", + "index": 356, + "gate": [ + "add", + 182, + 76, + -1, + 2 + ], + "old_frame": [ + 448, + 33, + 9, + 5, + 2 + ], + "new_frame": [ + 448, + 35, + 11, + 5 + ] + }, + { + "section": "B", + "index": 357, + "gate": [ + "add", + 184, + 2, + -1, + 2 + ], + "old_frame": [ + 336, + 208, + 35, + 9, + 7 + ], + "new_frame": [ + 336, + 208, + 35, + 14 + ] + }, + { + "section": "B", + "index": 358, + "gate": [ + "add", + 188, + 184, + 1, + 1 + ], + "old_frame": [ + 336, + 208, + 33, + 9, + 5, + 2 + ], + "new_frame": [ + 336, + 208, + 35, + 11, + 5 + ] + }, + { + "section": "B", + "index": 359, + "gate": [ + "add", + 183, + 182, + 1, + 1 + ], + "old_frame": [ + 400, + 80, + 33, + 9, + 5, + 2 + ], + "new_frame": [ + 400, + 80, + 35, + 11, + 5 + ] + }, + { + "section": "B", + "index": 360, + "gate": [ + "add", + 114, + 112, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 42, + 16, + 7 + ], + "new_frame": [ + 256, + 128, + 64, + 45, + 16 + ] + }, + { + "section": "B", + "index": 361, + "gate": [ + "add", + 112, + 2, + -1, + 2 + ], + "old_frame": [ + 256, + 128, + 64, + 35, + 16, + 9, + 7 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 14 + ] + }, + { + "section": "B", + "index": 362, + "gate": [ + "add", + 188, + 72, + -1, + 2 + ], + "old_frame": [ + 320, + 192, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 320, + 192, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "B", + "index": 363, + "gate": [ + "add", + 183, + 70, + -1, + 2 + ], + "old_frame": [ + 272, + 128, + 80, + 33, + 9, + 5, + 2 + ], + "new_frame": [ + 272, + 128, + 80, + 35, + 11, + 5 + ] + }, + { + "section": "B", + "index": 364, + "gate": [ + "add", + 182, + 71, + -1, + 2 + ], + "old_frame": [ + 256, + 144, + 80, + 33, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 144, + 80, + 35, + 11, + 5 + ] + }, + { + "section": "B", + "index": 461, + "gate": [ + "add", + 169, + 249, + -1, + 2 + ], + "old_frame": [ + 256, + 217, + 40, + 5, + 2 + ], + "new_frame": [ + 256, + 219, + 40, + 5 + ] + }, + { + "section": "B", + "index": 462, + "gate": [ + "add", + 174, + 233, + -1, + 2 + ], + "old_frame": [ + 393, + 66, + 42, + 18, + 7 + ], + "new_frame": [ + 398, + 69, + 45, + 21 + ] + }, + { + "section": "B", + "index": 463, + "gate": [ + "add", + 206, + 265, + -1, + 2 + ], + "old_frame": [ + 258, + 130, + 66, + 42, + 7 + ], + "new_frame": [ + 261, + 133, + 69, + 45 + ] + }, + { + "section": "B", + "index": 464, + "gate": [ + "add", + 204, + 206, + 1, + 1 + ], + "old_frame": [ + 258, + 130, + 66, + 42, + 18, + 7 + ], + "new_frame": [ + 261, + 133, + 69, + 45, + 21 + ] + }, + { + "section": "B", + "index": 465, + "gate": [ + "add", + 175, + 174, + 1, + 1 + ], + "old_frame": [ + 393, + 64, + 40, + 16, + 5, + 2 + ], + "new_frame": [ + 395, + 64, + 40, + 16, + 5 + ] + }, + { + "section": "B", + "index": 466, + "gate": [ + "add", + 173, + 169, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 89, + 40, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 91, + 40, + 5 + ] + }, + { + "section": "B", + "index": 467, + "gate": [ + "add", + 169, + 265, + -1, + 2 + ], + "old_frame": [ + 256, + 128, + 64, + 40, + 25, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 40, + 27, + 5 + ] + }, + { + "section": "B", + "index": 468, + "gate": [ + "add", + 204, + 267, + -1, + 2 + ], + "old_frame": [ + 258, + 130, + 66, + 33, + 18, + 11, + 7 + ], + "new_frame": [ + 261, + 133, + 69, + 38, + 21, + 11 + ] + }, + { + "section": "B", + "index": 469, + "gate": [ + "add", + 175, + 251, + -1, + 2 + ], + "old_frame": [ + 265, + 128, + 64, + 40, + 16, + 5, + 2 + ], + "new_frame": [ + 267, + 128, + 64, + 40, + 16, + 5 + ] + }, + { + "section": "B", + "index": 470, + "gate": [ + "add", + 174, + 249, + -1, + 2 + ], + "old_frame": [ + 256, + 137, + 64, + 40, + 16, + 5, + 2 + ], + "new_frame": [ + 256, + 139, + 64, + 40, + 16, + 5 + ] + }, + { + "section": "B", + "index": 550, + "gate": [ + "add", + 472, + 231, + 1, + 1 + ], + "old_frame": [ + 387, + 64, + 34, + 17, + 8, + 4 + ], + "new_frame": [ + 395, + 64, + 34, + 17, + 4 + ] + }, + { + "section": "B", + "index": 552, + "gate": [ + "add", + 473, + 226, + 1, + 1 + ], + "old_frame": [ + 388, + 68, + 33, + 17, + 8, + 3 + ], + "new_frame": [ + 388, + 68, + 34, + 17, + 11 + ] + }, + { + "section": "B", + "index": 576, + "gate": [ + "add", + 484, + 448, + 1, + 1 + ], + "old_frame": [ + 260, + 132, + 71, + 38, + 21, + 12 + ], + "new_frame": [ + 260, + 132, + 75, + 38, + 21 + ] + }, + { + "section": "B", + "index": 578, + "gate": [ + "add", + 485, + 449, + 1, + 1 + ], + "old_frame": [ + 260, + 132, + 64, + 33, + 18, + 11 + ], + "new_frame": [ + 260, + 132, + 64, + 51, + 11 + ] + }, + { + "section": "B", + "index": 602, + "gate": [ + "add", + 496, + 230, + 1, + 1 + ], + "old_frame": [ + 385, + 65, + 32, + 18, + 10, + 6 + ], + "new_frame": [ + 385, + 65, + 38, + 20, + 10 + ] + }, + { + "section": "B", + "index": 604, + "gate": [ + "add", + 497, + 228, + 1, + 1 + ], + "old_frame": [ + 390, + 64, + 32, + 20, + 10, + 1 + ], + "new_frame": [ + 422, + 64, + 20, + 10, + 1 + ] + }, + { + "section": "B", + "index": 628, + "gate": [ + "add", + 508, + 450, + 1, + 1 + ], + "old_frame": [ + 257, + 129, + 64, + 38, + 18, + 12 + ], + "new_frame": [ + 257, + 129, + 64, + 38, + 30 + ] + }, + { + "section": "B", + "index": 630, + "gate": [ + "add", + 509, + 451, + 1, + 1 + ], + "old_frame": [ + 257, + 129, + 71, + 33, + 21, + 11 + ], + "new_frame": [ + 257, + 129, + 102, + 21, + 11 + ] + }, + { + "section": "B", + "index": 652, + "gate": [ + "add", + 520, + 232, + -2, + 1 + ], + "old_frame": [ + 394, + 64, + 32, + 24, + 6, + 1 + ], + "new_frame": [ + 395, + 64, + 32, + 24, + 6 + ] + }, + { + "section": "B", + "index": 654, + "gate": [ + "add", + 521, + 7, + -2, + 1 + ], + "old_frame": [ + 416, + 96, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 416, + 96, + 19, + 11, + 6 + ] + }, + { + "section": "B", + "index": 678, + "gate": [ + "add", + 532, + 452, + -2, + 1 + ], + "old_frame": [ + 257, + 129, + 75, + 33, + 25, + 7 + ], + "new_frame": [ + 262, + 134, + 75, + 38, + 30 + ] + }, + { + "section": "B", + "index": 680, + "gate": [ + "add", + 533, + 453, + -2, + 1 + ], + "old_frame": [ + 288, + 160, + 64, + 18, + 11, + 7 + ], + "new_frame": [ + 288, + 160, + 64, + 21, + 11 + ] + }, + { + "section": "B", + "index": 704, + "gate": [ + "add", + 544, + 236, + -2, + 1 + ], + "old_frame": [ + 392, + 72, + 33, + 17, + 4, + 3 + ], + "new_frame": [ + 392, + 72, + 37, + 21, + 3 + ] + }, + { + "section": "B", + "index": 706, + "gate": [ + "add", + 545, + 238, + -2, + 1 + ], + "old_frame": [ + 401, + 64, + 48, + 8, + 4, + 3 + ], + "new_frame": [ + 405, + 64, + 48, + 8, + 3 + ] + }, + { + "section": "B", + "index": 728, + "gate": [ + "add", + 556, + 454, + -2, + 1 + ], + "old_frame": [ + 264, + 136, + 64, + 33, + 18, + 7 + ], + "new_frame": [ + 264, + 136, + 64, + 38, + 21 + ] + }, + { + "section": "B", + "index": 730, + "gate": [ + "add", + 557, + 455, + -2, + 1 + ], + "old_frame": [ + 259, + 131, + 82, + 51, + 11, + 7 + ], + "new_frame": [ + 259, + 131, + 85, + 51, + 11 + ] + }, + { + "section": "B", + "index": 1196, + "gate": [ + "add", + 215, + 484, + -1, + 2 + ], + "old_frame": [ + 260, + 132, + 68, + 37, + 21, + 12, + 3 + ], + "new_frame": [ + 260, + 132, + 68, + 38, + 21, + 15 + ] + }, + { + "section": "B", + "index": 1197, + "gate": [ + "add", + 129, + 448, + -1, + 2 + ], + "old_frame": [ + 256, + 128, + 67, + 34, + 17, + 8, + 4 + ], + "new_frame": [ + 256, + 128, + 75, + 34, + 17, + 4 + ] + }, + { + "section": "B", + "index": 1198, + "gate": [ + "add", + 124, + 485, + -1, + 2 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 18, + 11, + 4 + ], + "new_frame": [ + 256, + 128, + 64, + 51, + 11, + 4 + ] + }, + { + "section": "B", + "index": 1199, + "gate": [ + "add", + 212, + 449, + -1, + 2 + ], + "old_frame": [ + 260, + 132, + 64, + 33, + 17, + 8, + 3 + ], + "new_frame": [ + 260, + 132, + 64, + 34, + 17, + 11 + ] + }, + { + "section": "B", + "index": 1205, + "gate": [ + "add", + 152, + 231, + -1, + 2 + ], + "old_frame": [ + 259, + 128, + 64, + 34, + 17, + 8, + 4 + ], + "new_frame": [ + 267, + 128, + 64, + 34, + 17, + 4 + ] + }, + { + "section": "B", + "index": 1207, + "gate": [ + "add", + 166, + 226, + -1, + 2 + ], + "old_frame": [ + 256, + 132, + 68, + 33, + 17, + 8, + 3 + ], + "new_frame": [ + 256, + 132, + 68, + 34, + 17, + 11 + ] + }, + { + "section": "B", + "index": 1212, + "gate": [ + "add", + 157, + 508, + -1, + 2 + ], + "old_frame": [ + 256, + 128, + 64, + 38, + 18, + 12, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 30, + 1 + ] + }, + { + "section": "B", + "index": 1213, + "gate": [ + "add", + 219, + 450, + -1, + 2 + ], + "old_frame": [ + 257, + 129, + 64, + 32, + 18, + 10, + 6 + ], + "new_frame": [ + 257, + 129, + 64, + 38, + 20, + 10 + ] + }, + { + "section": "B", + "index": 1214, + "gate": [ + "add", + 210, + 509, + -1, + 2 + ], + "old_frame": [ + 257, + 129, + 65, + 33, + 19, + 11, + 6 + ], + "new_frame": [ + 257, + 129, + 65, + 39, + 21, + 11 + ] + }, + { + "section": "B", + "index": 1215, + "gate": [ + "add", + 160, + 451, + -1, + 2 + ], + "old_frame": [ + 256, + 128, + 70, + 32, + 20, + 10, + 1 + ], + "new_frame": [ + 256, + 128, + 102, + 20, + 10, + 1 + ] + }, + { + "section": "B", + "index": 1221, + "gate": [ + "add", + 134, + 230, + -1, + 2 + ], + "old_frame": [ + 256, + 129, + 65, + 32, + 18, + 10, + 6 + ], + "new_frame": [ + 256, + 129, + 65, + 38, + 20, + 10 + ] + }, + { + "section": "B", + "index": 1223, + "gate": [ + "add", + 146, + 228, + -1, + 2 + ], + "old_frame": [ + 262, + 128, + 64, + 32, + 20, + 10, + 1 + ], + "new_frame": [ + 294, + 128, + 64, + 20, + 10, + 1 + ] + }, + { + "section": "B", + "index": 1228, + "gate": [ + "add", + 205, + 532, + -1, + 2 + ], + "old_frame": [ + 257, + 129, + 65, + 33, + 19, + 10, + 7 + ], + "new_frame": [ + 262, + 134, + 70, + 38, + 19, + 13 + ] + }, + { + "section": "B", + "index": 1229, + "gate": [ + "add", + 170, + 452, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 74, + 32, + 24, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 75, + 32, + 24, + 6 + ] + }, + { + "section": "B", + "index": 1230, + "gate": [ + "add", + 118, + 533, + -1, + 2 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 11, + 7 + ], + "new_frame": [ + 256, + 128, + 64, + 32, + 21, + 11 + ] + }, + { + "section": "B", + "index": 1231, + "gate": [ + "add", + 194, + 453, + 1, + 1 + ], + "old_frame": [ + 288, + 160, + 64, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 288, + 160, + 64, + 19, + 11, + 6 + ] + }, + { + "section": "B", + "index": 1237, + "gate": [ + "add", + 142, + 232, + 1, + 1 + ], + "old_frame": [ + 266, + 128, + 64, + 32, + 24, + 6, + 1 + ], + "new_frame": [ + 267, + 128, + 64, + 32, + 24, + 6 + ] + }, + { + "section": "B", + "index": 1239, + "gate": [ + "add", + 185, + 7, + 1, + 1 + ], + "old_frame": [ + 256, + 160, + 96, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 160, + 96, + 19, + 11, + 6 + ] + }, + { + "section": "B", + "index": 1244, + "gate": [ + "add", + 120, + 556, + -1, + 2 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 18, + 8, + 7 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 21, + 8 + ] + }, + { + "section": "B", + "index": 1245, + "gate": [ + "add", + 207, + 454, + 1, + 1 + ], + "old_frame": [ + 264, + 136, + 64, + 33, + 17, + 4, + 3 + ], + "new_frame": [ + 264, + 136, + 64, + 37, + 21, + 3 + ] + }, + { + "section": "B", + "index": 1246, + "gate": [ + "add", + 192, + 557, + -1, + 2 + ], + "old_frame": [ + 259, + 131, + 67, + 34, + 17, + 11, + 7 + ], + "new_frame": [ + 259, + 131, + 67, + 37, + 22, + 11 + ] + }, + { + "section": "B", + "index": 1247, + "gate": [ + "add", + 179, + 455, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 81, + 48, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 85, + 48, + 8, + 3 + ] + }, + { + "section": "B", + "index": 1253, + "gate": [ + "add", + 176, + 236, + 1, + 1 + ], + "old_frame": [ + 256, + 136, + 72, + 33, + 17, + 4, + 3 + ], + "new_frame": [ + 256, + 136, + 72, + 37, + 21, + 3 + ] + }, + { + "section": "B", + "index": 1255, + "gate": [ + "add", + 117, + 238, + 1, + 1 + ], + "old_frame": [ + 273, + 128, + 64, + 48, + 8, + 4, + 3 + ], + "new_frame": [ + 277, + 128, + 64, + 48, + 8, + 3 + ] + }, + { + "section": "restore", + "index": 16, + "gate": [ + "add", + 448, + 231, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + { + "section": "restore", + "index": 17, + "gate": [ + "add", + 484, + 448, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + { + "section": "restore", + "index": 18, + "gate": [ + "add", + 449, + 226, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + { + "section": "restore", + "index": 19, + "gate": [ + "add", + 485, + 449, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + { + "section": "restore", + "index": 20, + "gate": [ + "add", + 450, + 230, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + { + "section": "restore", + "index": 21, + "gate": [ + "add", + 508, + 450, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + { + "section": "restore", + "index": 22, + "gate": [ + "add", + 451, + 228, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + { + "section": "restore", + "index": 23, + "gate": [ + "add", + 509, + 451, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + { + "section": "restore", + "index": 24, + "gate": [ + "add", + 452, + 232, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + }, + { + "section": "restore", + "index": 25, + "gate": [ + "add", + 532, + 452, + 2, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + }, + { + "section": "restore", + "index": 26, + "gate": [ + "add", + 453, + 7, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + }, + { + "section": "restore", + "index": 27, + "gate": [ + "add", + 533, + 453, + 2, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + }, + { + "section": "restore", + "index": 28, + "gate": [ + "add", + 454, + 236, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + }, + { + "section": "restore", + "index": 29, + "gate": [ + "add", + 556, + 454, + 2, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + }, + { + "section": "restore", + "index": 30, + "gate": [ + "add", + 455, + 238, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + }, + { + "section": "restore", + "index": 31, + "gate": [ + "add", + 557, + 455, + 2, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + }, + { + "section": "restore", + "index": 32, + "gate": [ + "add", + 484, + 231, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + { + "section": "restore", + "index": 33, + "gate": [ + "add", + 484, + 299, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + { + "section": "restore", + "index": 34, + "gate": [ + "add", + 485, + 226, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + { + "section": "restore", + "index": 35, + "gate": [ + "add", + 485, + 54, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + { + "section": "restore", + "index": 43, + "gate": [ + "add", + 508, + 331, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + { + "section": "restore", + "index": 44, + "gate": [ + "add", + 508, + 230, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + { + "section": "restore", + "index": 45, + "gate": [ + "add", + 509, + 228, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + { + "section": "restore", + "index": 46, + "gate": [ + "add", + 509, + 34, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + { + "section": "restore", + "index": 53, + "gate": [ + "add", + 532, + 363, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + }, + { + "section": "restore", + "index": 54, + "gate": [ + "add", + 532, + 232, + 2, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + }, + { + "section": "restore", + "index": 55, + "gate": [ + "add", + 533, + 7, + 2, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + }, + { + "section": "restore", + "index": 56, + "gate": [ + "add", + 533, + 73, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + }, + { + "section": "restore", + "index": 66, + "gate": [ + "add", + 556, + 236, + 2, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + }, + { + "section": "restore", + "index": 67, + "gate": [ + "add", + 556, + 395, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + }, + { + "section": "restore", + "index": 68, + "gate": [ + "add", + 557, + 5, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + }, + { + "section": "restore", + "index": 69, + "gate": [ + "add", + 557, + 238, + 2, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + }, + { + "section": "restore", + "index": 101, + "gate": [ + "add", + 331, + 22, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + { + "section": "restore", + "index": 102, + "gate": [ + "add", + 331, + 34, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + { + "section": "restore", + "index": 103, + "gate": [ + "add", + 22, + 331, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + { + "section": "restore", + "index": 104, + "gate": [ + "add", + 299, + 40, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + { + "section": "restore", + "index": 105, + "gate": [ + "add", + 299, + 54, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + { + "section": "restore", + "index": 106, + "gate": [ + "add", + 40, + 299, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + { + "section": "restore", + "index": 117, + "gate": [ + "add", + 62, + 70, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 118, + "gate": [ + "add", + 62, + 71, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 119, + "gate": [ + "add", + 62, + 72, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 120, + "gate": [ + "add", + 62, + 249, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 121, + "gate": [ + "add", + 62, + 251, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 122, + "gate": [ + "add", + 62, + 267, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 123, + "gate": [ + "scale", + 62, + 1, + -4 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 124, + "gate": [ + "add", + 62, + 249, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 125, + "gate": [ + "add", + 249, + 62, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 126, + "gate": [ + "add", + 62, + 249, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 127, + "gate": [ + "add", + 62, + 63, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 128, + "gate": [ + "add", + 62, + 70, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 129, + "gate": [ + "add", + 62, + 71, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 130, + "gate": [ + "add", + 62, + 72, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 131, + "gate": [ + "add", + 62, + 251, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 132, + "gate": [ + "add", + 62, + 267, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 133, + "gate": [ + "scale", + 62, + 1, + -4 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 134, + "gate": [ + "add", + 62, + 267, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 135, + "gate": [ + "add", + 267, + 62, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 136, + "gate": [ + "add", + 62, + 267, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 137, + "gate": [ + "add", + 63, + 267, + 4, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 138, + "gate": [ + "add", + 2, + 61, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 139, + "gate": [ + "add", + 2, + 62, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 140, + "gate": [ + "add", + 2, + 70, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 141, + "gate": [ + "add", + 2, + 72, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 142, + "gate": [ + "add", + 2, + 251, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 143, + "gate": [ + "add", + 2, + 265, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 144, + "gate": [ + "scale", + 2, + 1, + 4 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 145, + "gate": [ + "add", + 2, + 251, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 146, + "gate": [ + "add", + 251, + 2, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 147, + "gate": [ + "add", + 2, + 251, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 148, + "gate": [ + "add", + 61, + 251, + 4, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 149, + "gate": [ + "add", + 2, + 61, + -1, + 2 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 150, + "gate": [ + "add", + 2, + 62, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 151, + "gate": [ + "add", + 2, + 94, + 1, + 2 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 152, + "gate": [ + "add", + 2, + 265, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 153, + "gate": [ + "scale", + 2, + 1, + -2 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 154, + "gate": [ + "add", + 2, + 265, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 155, + "gate": [ + "add", + 265, + 2, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 156, + "gate": [ + "add", + 2, + 265, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + }, + { + "section": "restore", + "index": 157, + "gate": [ + "add", + 94, + 265, + 4, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 33, + 16, + 9, + 5, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + } + ], + "declared_local_profile": { + "1": 2430, + "2": 722, + "3": 236, + "4": 102, + "5": 18, + "8": 8 + }, + "declared_width_inventory": { + "4": 26, + "5": 2, + "6": 16, + "7": 52, + "8": 94, + "9": 218 + }, + "addressing": "index = position in the parent (PR2942) word section; gate = the literal gate without its frame; every new frame is a hyperplane of the old one" +} diff --git a/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-226.json b/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-226.json new file mode 100644 index 0000000000..bab8518d19 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-226.json @@ -0,0 +1,272 @@ +{ + "step": 1, + "helper": 226, + "normal": 42, + "before": [ + [ + "add", + 226, + 288, + 1, + 2, + [] + ], + [ + "add", + 226, + 292, + 1, + 2, + [] + ], + [ + "add", + 226, + 296, + -1, + 2, + [] + ], + [ + "add", + 226, + 302, + 1, + 2, + [] + ], + [ + "add", + 226, + 303, + -1, + 1, + [] + ], + [ + "add", + 226, + 227, + -1, + 1, + [] + ], + [ + "add", + 227, + 226, + 1, + 1, + [] + ], + [ + "add", + 226, + 227, + -1, + 1, + [] + ], + [ + "add", + 301, + 227, + -1, + 1, + [] + ], + [ + "add", + 296, + 227, + 1, + 1, + [] + ], + [ + "add", + 295, + 227, + 1, + 1, + [] + ], + [ + "add", + 294, + 227, + 1, + 1, + [] + ], + [ + "add", + 292, + 227, + -1, + 1, + [] + ], + [ + "add", + 237, + 227, + 1, + 1, + [] + ], + [ + "add", + 235, + 227, + 1, + 1, + [] + ], + [ + "add", + 233, + 227, + -1, + 1, + [] + ], + [ + "add", + 232, + 227, + -1, + 1, + [] + ], + [ + "add", + 231, + 227, + -1, + 1, + [] + ], + [ + "add", + 230, + 227, + -1, + 1, + [] + ], + [ + "add", + 229, + 227, + 1, + 1, + [] + ] + ], + "after": [ + [ + "add", + 18, + 40, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 54, + -2, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 18, + 1, + -4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 226, + 18, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ] + ], + "frame_changes": [], + "addressing": "before: input gates inserted right after the prelude; after: output gates appended to restore; frame_changes: addressed in the child word after insertion" +} diff --git a/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-228.json b/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-228.json new file mode 100644 index 0000000000..0097d9dbb9 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-228.json @@ -0,0 +1,287 @@ +{ + "step": 2, + "helper": 228, + "normal": 42, + "before": [ + [ + "add", + 228, + 326, + -1, + 1, + [] + ], + [ + "add", + 228, + 328, + 2, + 1, + [] + ], + [ + "add", + 228, + 332, + -1, + 1, + [] + ], + [ + "add", + 228, + 335, + 2, + 1, + [] + ], + [ + "add", + 228, + 292, + -1, + 1, + [] + ], + [ + "add", + 292, + 228, + 1, + 1, + [] + ], + [ + "add", + 228, + 292, + -1, + 1, + [] + ], + [ + "scale", + 292, + 1, + -1, + [] + ], + [ + "add", + 333, + 292, + -1, + 1, + [] + ], + [ + "add", + 328, + 292, + 1, + 1, + [] + ], + [ + "add", + 326, + 292, + 1, + 1, + [] + ], + [ + "add", + 324, + 292, + -1, + 1, + [] + ], + [ + "add", + 301, + 292, + 1, + 1, + [] + ], + [ + "add", + 296, + 292, + -1, + 1, + [] + ], + [ + "add", + 295, + 292, + -1, + 1, + [] + ], + [ + "add", + 294, + 292, + -1, + 1, + [] + ] + ], + "after": [ + [ + "add", + 22, + 34, + -2, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 108, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 22, + 1, + 4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 228, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 228, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 228, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 108, + 228, + -4, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ] + ], + "frame_changes": [ + { + "section": "restore", + "index": 164, + "gate": [ + "add", + 22, + 34, + -2, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + } + ], + "addressing": "before: input gates inserted right after the prelude; after: output gates appended to restore; frame_changes: addressed in the child word after insertion" +} diff --git a/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-230.json b/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-230.json new file mode 100644 index 0000000000..11edd2e513 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-230.json @@ -0,0 +1,696 @@ +{ + "step": 3, + "helper": 230, + "normal": 42, + "before": [ + [ + "add", + 230, + 225, + -1, + 4, + [] + ], + [ + "add", + 230, + 227, + 1, + 4, + [] + ], + [ + "add", + 230, + 229, + 1, + 4, + [] + ], + [ + "add", + 230, + 232, + -1, + 4, + [] + ], + [ + "add", + 230, + 233, + 1, + 4, + [] + ], + [ + "add", + 230, + 234, + -1, + 2, + [] + ], + [ + "add", + 230, + 235, + 1, + 2, + [] + ], + [ + "add", + 230, + 238, + 1, + 4, + [] + ], + [ + "add", + 230, + 239, + -1, + 4, + [] + ], + [ + "add", + 230, + 240, + 1, + 4, + [] + ], + [ + "add", + 230, + 241, + 1, + 4, + [] + ], + [ + "add", + 230, + 242, + 1, + 4, + [] + ], + [ + "add", + 230, + 243, + 1, + 2, + [] + ], + [ + "add", + 230, + 245, + 1, + 4, + [] + ], + [ + "add", + 230, + 246, + 1, + 4, + [] + ], + [ + "add", + 230, + 250, + -1, + 4, + [] + ], + [ + "add", + 230, + 253, + 1, + 4, + [] + ], + [ + "add", + 230, + 254, + 1, + 4, + [] + ], + [ + "add", + 230, + 256, + 1, + 4, + [] + ], + [ + "add", + 230, + 257, + 1, + 4, + [] + ], + [ + "add", + 230, + 258, + 1, + 4, + [] + ], + [ + "add", + 230, + 259, + 1, + 2, + [] + ], + [ + "add", + 230, + 261, + 1, + 4, + [] + ], + [ + "add", + 230, + 262, + 1, + 4, + [] + ], + [ + "add", + 230, + 266, + -1, + 4, + [] + ], + [ + "add", + 230, + 269, + 1, + 4, + [] + ], + [ + "add", + 230, + 270, + 1, + 4, + [] + ], + [ + "add", + 230, + 288, + 1, + 2, + [] + ], + [ + "add", + 230, + 292, + 1, + 4, + [] + ], + [ + "add", + 230, + 296, + -1, + 2, + [] + ], + [ + "add", + 230, + 302, + 1, + 2, + [] + ], + [ + "add", + 230, + 303, + -1, + 1, + [] + ], + [ + "add", + 230, + 326, + 1, + 1, + [] + ], + [ + "add", + 230, + 328, + -2, + 1, + [] + ], + [ + "add", + 230, + 332, + 1, + 1, + [] + ], + [ + "add", + 230, + 335, + -2, + 1, + [] + ], + [ + "add", + 230, + 276, + -1, + 1, + [] + ], + [ + "add", + 276, + 230, + 1, + 1, + [] + ], + [ + "add", + 230, + 276, + -1, + 1, + [] + ], + [ + "scale", + 276, + 2, + 1, + [] + ], + [ + "add", + 333, + 276, + -1, + 2, + [] + ], + [ + "add", + 328, + 276, + 1, + 2, + [] + ], + [ + "add", + 326, + 276, + 1, + 2, + [] + ], + [ + "add", + 324, + 276, + -1, + 2, + [] + ], + [ + "add", + 317, + 276, + -1, + 2, + [] + ], + [ + "add", + 315, + 276, + -1, + 2, + [] + ], + [ + "add", + 312, + 276, + 1, + 2, + [] + ], + [ + "add", + 310, + 276, + 1, + 2, + [] + ], + [ + "add", + 308, + 276, + -1, + 2, + [] + ], + [ + "add", + 285, + 276, + 1, + 1, + [] + ], + [ + "add", + 283, + 276, + 1, + 1, + [] + ], + [ + "add", + 280, + 276, + -1, + 1, + [] + ], + [ + "add", + 279, + 276, + -1, + 1, + [] + ], + [ + "add", + 278, + 276, + -1, + 1, + [] + ] + ], + "after": [ + [ + "add", + 22, + 40, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 45, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 54, + -2, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 61, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 63, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 92, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 103, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 108, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 22, + 1, + -4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 230, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 103, + 230, + -8, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 45, + 230, + 4, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ] + ], + "frame_changes": [], + "addressing": "before: input gates inserted right after the prelude; after: output gates appended to restore; frame_changes: addressed in the child word after insertion" +} diff --git a/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-363.json b/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-363.json new file mode 100644 index 0000000000..9260bdf0b8 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-363.json @@ -0,0 +1,336 @@ +{ + "step": 4, + "helper": 363, + "normal": 7, + "before": [ + [ + "add", + 363, + 225, + -1, + 2, + [] + ], + [ + "add", + 363, + 352, + 1, + 4, + [] + ], + [ + "add", + 363, + 356, + 1, + 4, + [] + ], + [ + "add", + 363, + 366, + 1, + 4, + [] + ], + [ + "add", + 363, + 367, + -1, + 4, + [] + ], + [ + "add", + 363, + 225, + -1, + 1, + [] + ], + [ + "add", + 225, + 363, + 1, + 1, + [] + ], + [ + "add", + 363, + 225, + -1, + 1, + [] + ], + [ + "add", + 365, + 225, + -1, + 1, + [] + ], + [ + "add", + 363, + 225, + -1, + 1, + [] + ], + [ + "add", + 360, + 225, + 1, + 1, + [] + ], + [ + "add", + 359, + 225, + 1, + 1, + [] + ], + [ + "add", + 358, + 225, + 1, + 1, + [] + ], + [ + "add", + 356, + 225, + -1, + 1, + [] + ], + [ + "add", + 352, + 225, + -1, + 1, + [] + ], + [ + "add", + 333, + 225, + -1, + 1, + [] + ], + [ + "add", + 328, + 225, + 1, + 1, + [] + ], + [ + "add", + 326, + 225, + 1, + 1, + [] + ], + [ + "add", + 324, + 225, + -1, + 1, + [] + ], + [ + "add", + 270, + 225, + 1, + 1, + [] + ], + [ + "add", + 269, + 225, + 1, + 1, + [] + ], + [ + "add", + 266, + 225, + -1, + 1, + [] + ], + [ + "add", + 263, + 225, + -2, + 1, + [] + ], + [ + "add", + 262, + 225, + -1, + 1, + [] + ], + [ + "add", + 261, + 225, + 1, + 1, + [] + ], + [ + "add", + 259, + 225, + 1, + 1, + [] + ], + [ + "add", + 258, + 225, + 1, + 1, + [] + ], + [ + "add", + 257, + 225, + -1, + 1, + [] + ] + ], + "after": [ + [ + "add", + 59, + 73, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "scale", + 59, + 1, + -4, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 363, + 59, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ] + ], + "frame_changes": [], + "addressing": "before: input gates inserted right after the prelude; after: output gates appended to restore; frame_changes: addressed in the child word after insertion" +} diff --git a/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-395.json b/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-395.json new file mode 100644 index 0000000000..fb2f6a9d2d --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/data/TRANSFORM-395.json @@ -0,0 +1,297 @@ +{ + "step": 5, + "helper": 395, + "normal": 7, + "before": [ + [ + "add", + 395, + 225, + 1, + 2, + [] + ], + [ + "add", + 395, + 384, + -1, + 4, + [] + ], + [ + "add", + 395, + 388, + -1, + 4, + [] + ], + [ + "add", + 395, + 398, + -1, + 4, + [] + ], + [ + "add", + 395, + 399, + 1, + 4, + [] + ], + [ + "add", + 395, + 225, + -1, + 1, + [] + ], + [ + "add", + 225, + 395, + 1, + 1, + [] + ], + [ + "add", + 395, + 225, + -1, + 1, + [] + ], + [ + "add", + 397, + 225, + 1, + 1, + [] + ], + [ + "add", + 395, + 225, + 1, + 1, + [] + ], + [ + "add", + 392, + 225, + -1, + 1, + [] + ], + [ + "add", + 391, + 225, + -1, + 1, + [] + ], + [ + "add", + 390, + 225, + -1, + 1, + [] + ], + [ + "add", + 388, + 225, + 1, + 1, + [] + ], + [ + "add", + 384, + 225, + 1, + 1, + [] + ], + [ + "add", + 365, + 225, + -1, + 1, + [] + ], + [ + "add", + 360, + 225, + 1, + 1, + [] + ], + [ + "add", + 359, + 225, + 1, + 1, + [] + ], + [ + "add", + 358, + 225, + 1, + 1, + [] + ], + [ + "add", + 356, + 225, + -1, + 1, + [] + ], + [ + "add", + 352, + 225, + -1, + 1, + [] + ] + ], + "after": [ + [ + "add", + 5, + 96, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 395, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "scale", + 5, + 1, + -4, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 395, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 395, + 5, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 395, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 96, + 395, + -4, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ] + ], + "frame_changes": [], + "addressing": "before: input gates inserted right after the prelude; after: output gates appended to restore; frame_changes: addressed in the child word after insertion" +} diff --git a/research/rank7-coupled-586-588-carrier-fold/data/WORD-base.json.gz b/research/rank7-coupled-586-588-carrier-fold/data/WORD-base.json.gz new file mode 100644 index 0000000000..d9aa96a93f Binary files /dev/null and b/research/rank7-coupled-586-588-carrier-fold/data/WORD-base.json.gz differ diff --git a/research/rank7-coupled-586-588-carrier-fold/data/WORD-extra.json.gz b/research/rank7-coupled-586-588-carrier-fold/data/WORD-extra.json.gz new file mode 100644 index 0000000000..74f6cb6459 Binary files /dev/null and b/research/rank7-coupled-586-588-carrier-fold/data/WORD-extra.json.gz differ diff --git a/research/rank7-coupled-586-588-carrier-fold/edits/EDITS.json b/research/rank7-coupled-586-588-carrier-fold/edits/EDITS.json new file mode 100644 index 0000000000..1d263e5af6 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/edits/EDITS.json @@ -0,0 +1,4052 @@ +{ + "declared": { + "helper_final": { + "586": { + "new": [ + 256, + 128, + 70, + 32, + 18, + 12, + 1 + ], + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + }, + "588": { + "new": [ + 256, + 128, + 65, + 33, + 18, + 10, + 6 + ], + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + } + }, + "local_profile": { + "1": 2433, + "2": 724, + "3": 228, + "4": 102, + "5": 20, + "8": 8 + }, + "width_inventory": { + "4": 26, + "5": 2, + "6": 18, + "7": 50, + "8": 99, + "9": 213 + } + }, + "edits": { + "base": [ + { + "id": "R1_E42", + "new": [ + [ + "add", + 40, + 54, + -2, + 1, + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + ], + [ + "add", + 40, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + ], + [ + "add", + 226, + 40, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + ], + [ + "add", + 40, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + ], + [ + "add", + 18, + 226, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 18, + 1, + -4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 226, + 18, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 34, + -2, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 22, + 228, + -1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 228, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 22, + 228, + -1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 230, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 230, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 228, + 108, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 228, + 1, + 4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 108, + 228, + -4, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 230, + 18, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 230, + 45, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 40, + 18, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ], + [ + "add", + 18, + 40, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ], + [ + "add", + 40, + 18, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ], + [ + "add", + 40, + 54, + 2, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ], + [ + "add", + 61, + 63, + 1, + 1, + [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + ], + [ + "add", + 230, + 61, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 61, + 63, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ], + [ + "add", + 230, + 92, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 230, + 103, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 230, + 108, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 230, + 1, + -4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ] + ], + "old": [ + [ + "add", + 18, + 40, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 54, + -2, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 18, + 1, + -4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 226, + 18, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 34, + -2, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 22, + 108, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 22, + 1, + 4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 228, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 228, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 228, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 108, + 228, + -4, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 40, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 45, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 54, + -2, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 61, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 63, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 92, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 103, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 108, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 22, + 1, + -4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 230, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ] + ], + "section": "restore", + "start": 162, + "stop": 188 + }, + { + "id": "R2_E7", + "new": [ + [ + "add", + 363, + 73, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "scale", + 59, + 1, + -4, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 363, + 59, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 73, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ], + [ + "add", + 395, + 5, + 1, + 1, + [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + ], + [ + "add", + 96, + 395, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "scale", + 96, + 1, + 4, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 96, + 395, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 395, + 96, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 96, + 395, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "scale", + 96, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 96, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ] + ], + "old": [ + [ + "add", + 59, + 73, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "scale", + 59, + 1, + -4, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 363, + 59, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 96, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 395, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "scale", + 5, + 1, + -4, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 395, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 395, + 5, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 395, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 96, + 395, + -4, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ] + ], + "section": "restore", + "start": 190, + "stop": 203 + }, + { + "edits": [ + { + "new": [], + "old": [ + [ + "add", + 136, + 586, + 1, + 2, + [ + 30 + ] + ] + ], + "section": "B", + "start": 52, + "stop": 53 + }, + { + "new": [ + [ + "add", + 140, + 438, + -1, + 2, + [ + 257, + 129, + 32, + 30 + ] + ] + ], + "old": [ + [ + "add", + 136, + 586, + -1, + 2, + [ + 289, + 161, + 64, + 18, + 10, + 6 + ] + ] + ], + "section": "B", + "start": 784, + "stop": 785 + }, + { + "new": [ + [ + "add", + 75, + 438, + -1, + 2, + [ + 257, + 129, + 70, + 32, + 30 + ] + ] + ], + "old": [ + [ + "add", + 140, + 438, + -1, + 2, + [ + 256, + 128, + 76, + 32, + 30, + 1 + ] + ] + ], + "section": "B", + "start": 794, + "stop": 795 + }, + { + "new": [ + [ + "add", + 144, + 438, + -1, + 2, + [ + 256, + 128, + 70, + 32, + 30, + 1 + ] + ] + ], + "old": [ + [ + "add", + 144, + 438, + -1, + 2, + [ + 256, + 128, + 70, + 32, + 20, + 10, + 1 + ] + ] + ], + "section": "B", + "start": 1214, + "stop": 1215 + }, + { + "new": [ + [ + "add", + 187, + 586, + -1, + 2, + [ + 288, + 160, + 70, + 18, + 12, + 1 + ] + ] + ], + "old": [ + [ + "add", + 187, + 586, + -1, + 2, + [ + 288, + 160, + 64, + 18, + 10, + 6, + 1 + ] + ] + ], + "section": "B", + "start": 1230, + "stop": 1231 + }, + { + "new": [ + [ + "add", + 586, + 438, + -1, + 1, + [ + 256, + 128, + 70, + 32, + 18, + 12, + 1 + ] + ] + ], + "old": [ + [ + "add", + 586, + 438, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + ] + ], + "section": "restore", + "start": 85, + "stop": 86 + } + ], + "helper": 586, + "helper_final": { + "586": { + "new": [ + 256, + 128, + 70, + 32, + 18, + 12, + 1 + ], + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + } + }, + "id": "B_586_438", + "partner": 438 + }, + { + "edits": [ + { + "new": [], + "old": [ + [ + "add", + 221, + 588, + -1, + 1, + [ + 30 + ] + ] + ], + "section": "B", + "start": 57, + "stop": 58 + }, + { + "new": [ + [ + "add", + 172, + 440, + 1, + 1, + [ + 268, + 161, + 65, + 30 + ] + ] + ], + "old": [ + [ + "add", + 221, + 588, + 1, + 1, + [ + 256, + 161, + 97, + 18, + 10, + 6 + ] + ] + ], + "section": "B", + "start": 789, + "stop": 790 + }, + { + "new": [ + [ + "add", + 84, + 440, + 1, + 1, + [ + 262, + 161, + 65, + 20, + 10 + ] + ] + ], + "old": [ + [ + "add", + 172, + 440, + 1, + 1, + [ + 268, + 128, + 64, + 32, + 30, + 1 + ] + ] + ], + "section": "B", + "start": 799, + "stop": 800 + }, + { + "new": [ + [ + "add", + 162, + 440, + 1, + 1, + [ + 262, + 128, + 65, + 33, + 20, + 10 + ] + ] + ], + "old": [ + [ + "add", + 162, + 440, + 1, + 1, + [ + 262, + 128, + 64, + 32, + 20, + 10, + 1 + ] + ] + ], + "section": "B", + "start": 1222, + "stop": 1223 + }, + { + "new": [ + [ + "add", + 196, + 588, + 1, + 1, + [ + 256, + 161, + 96, + 18, + 10, + 6 + ] + ] + ], + "old": [ + [ + "add", + 196, + 588, + 1, + 1, + [ + 256, + 160, + 96, + 18, + 10, + 6, + 1 + ] + ] + ], + "section": "B", + "start": 1238, + "stop": 1239 + }, + { + "new": [ + [ + "add", + 588, + 440, + -1, + 1, + [ + 256, + 128, + 65, + 33, + 18, + 10, + 6 + ] + ] + ], + "old": [ + [ + "add", + 588, + 440, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + ] + ], + "section": "restore", + "start": 88, + "stop": 89 + } + ], + "helper": 588, + "helper_final": { + "588": { + "new": [ + 256, + 128, + 65, + 33, + 18, + 10, + 6 + ], + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + } + }, + "id": "B_588_440", + "partner": 440 + } + ], + "extra": [ + { + "id": "R1_E42", + "new": [ + [ + "add", + 40, + 54, + -2, + 1, + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + ], + [ + "add", + 40, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + ], + [ + "add", + 226, + 40, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + ], + [ + "add", + 40, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + ], + [ + "add", + 18, + 226, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 18, + 1, + -4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 226, + 18, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 34, + -2, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 22, + 228, + -1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 228, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 22, + 228, + -1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 230, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 230, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 228, + 108, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 228, + 1, + 4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 108, + 228, + -4, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 230, + 18, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 230, + 45, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 40, + 18, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ], + [ + "add", + 18, + 40, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ], + [ + "add", + 40, + 18, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ], + [ + "add", + 40, + 54, + 2, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ], + [ + "add", + 61, + 63, + 1, + 1, + [ + 256, + 128, + 64, + 35, + 16, + 11, + 5 + ] + ], + [ + "add", + 230, + 61, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 61, + 63, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ], + [ + "add", + 230, + 92, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 230, + 103, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 230, + 108, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 230, + 1, + -4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ] + ], + "old": [ + [ + "add", + 18, + 40, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 54, + -2, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 18, + 1, + -4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 226, + 18, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 18, + 226, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 34, + -2, + 1, + [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + ], + [ + "add", + 22, + 108, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 22, + 1, + 4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 228, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 228, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 228, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 108, + 228, + -4, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 40, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 45, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 54, + -2, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 61, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 63, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 92, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 103, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 108, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "scale", + 22, + 1, + -4, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 230, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ], + [ + "add", + 22, + 230, + -1, + 1, + [ + 256, + 128, + 64, + 34, + 16, + 10, + 4, + 1 + ] + ] + ], + "section": "restore", + "start": 162, + "stop": 188 + }, + { + "id": "R2_E7", + "new": [ + [ + "add", + 363, + 73, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 19, + 11, + 6 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "scale", + 59, + 1, + -4, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 363, + 59, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 73, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ], + [ + "add", + 395, + 5, + 1, + 1, + [ + 256, + 128, + 64, + 37, + 21, + 8, + 3 + ] + ], + [ + "add", + 96, + 395, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "scale", + 96, + 1, + 4, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 96, + 395, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 395, + 96, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 96, + 395, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "scale", + 96, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 96, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ] + ] + ], + "old": [ + [ + "add", + 59, + 73, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "scale", + 59, + 1, + -4, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 363, + 59, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 59, + 363, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 96, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 395, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "scale", + 5, + 1, + -4, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 395, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 395, + 5, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 5, + 395, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ], + [ + "add", + 96, + 395, + -4, + 1, + [ + 256, + 128, + 64, + 32, + 16, + 8, + 5, + 3 + ] + ] + ], + "section": "restore", + "start": 190, + "stop": 203 + }, + { + "edits": [ + { + "new": [], + "old": [ + [ + "add", + 136, + 586, + 1, + 2, + [ + 30 + ] + ] + ], + "section": "B", + "start": 52, + "stop": 53 + }, + { + "new": [ + [ + "add", + 140, + 438, + -1, + 2, + [ + 257, + 129, + 32, + 30 + ] + ] + ], + "old": [ + [ + "add", + 136, + 586, + -1, + 2, + [ + 289, + 161, + 64, + 18, + 10, + 6 + ] + ] + ], + "section": "B", + "start": 784, + "stop": 785 + }, + { + "new": [ + [ + "add", + 75, + 438, + -1, + 2, + [ + 257, + 129, + 70, + 32, + 30 + ] + ] + ], + "old": [ + [ + "add", + 140, + 438, + -1, + 2, + [ + 256, + 128, + 76, + 32, + 30, + 1 + ] + ] + ], + "section": "B", + "start": 794, + "stop": 795 + }, + { + "new": [ + [ + "add", + 144, + 438, + -1, + 2, + [ + 256, + 128, + 70, + 32, + 30, + 1 + ] + ] + ], + "old": [ + [ + "add", + 144, + 438, + -1, + 2, + [ + 256, + 128, + 70, + 32, + 20, + 10, + 1 + ] + ] + ], + "section": "B", + "start": 1214, + "stop": 1215 + }, + { + "new": [ + [ + "add", + 187, + 586, + -1, + 2, + [ + 288, + 160, + 70, + 18, + 12, + 1 + ] + ] + ], + "old": [ + [ + "add", + 187, + 586, + -1, + 2, + [ + 288, + 160, + 64, + 18, + 10, + 6, + 1 + ] + ] + ], + "section": "B", + "start": 1230, + "stop": 1231 + }, + { + "new": [ + [ + "add", + 586, + 438, + -1, + 1, + [ + 256, + 128, + 70, + 32, + 18, + 12, + 1 + ] + ] + ], + "old": [ + [ + "add", + 586, + 438, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + ] + ], + "section": "restore", + "start": 85, + "stop": 86 + } + ], + "helper": 586, + "helper_final": { + "586": { + "new": [ + 256, + 128, + 70, + 32, + 18, + 12, + 1 + ], + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + } + }, + "id": "B_586_438", + "partner": 438 + }, + { + "edits": [ + { + "new": [], + "old": [ + [ + "add", + 221, + 588, + -1, + 1, + [ + 30 + ] + ] + ], + "section": "B", + "start": 57, + "stop": 58 + }, + { + "new": [ + [ + "add", + 172, + 440, + 1, + 1, + [ + 268, + 161, + 65, + 30 + ] + ] + ], + "old": [ + [ + "add", + 221, + 588, + 1, + 1, + [ + 256, + 161, + 97, + 18, + 10, + 6 + ] + ] + ], + "section": "B", + "start": 789, + "stop": 790 + }, + { + "new": [ + [ + "add", + 84, + 440, + 1, + 1, + [ + 262, + 161, + 65, + 20, + 10 + ] + ] + ], + "old": [ + [ + "add", + 172, + 440, + 1, + 1, + [ + 268, + 128, + 64, + 32, + 30, + 1 + ] + ] + ], + "section": "B", + "start": 799, + "stop": 800 + }, + { + "new": [ + [ + "add", + 162, + 440, + 1, + 1, + [ + 262, + 128, + 65, + 33, + 20, + 10 + ] + ] + ], + "old": [ + [ + "add", + 162, + 440, + 1, + 1, + [ + 262, + 128, + 64, + 32, + 20, + 10, + 1 + ] + ] + ], + "section": "B", + "start": 1222, + "stop": 1223 + }, + { + "new": [ + [ + "add", + 196, + 588, + 1, + 1, + [ + 256, + 161, + 96, + 18, + 10, + 6 + ] + ] + ], + "old": [ + [ + "add", + 196, + 588, + 1, + 1, + [ + 256, + 160, + 96, + 18, + 10, + 6, + 1 + ] + ] + ], + "section": "B", + "start": 1238, + "stop": 1239 + }, + { + "new": [ + [ + "add", + 588, + 440, + -1, + 1, + [ + 256, + 128, + 65, + 33, + 18, + 10, + 6 + ] + ] + ], + "old": [ + [ + "add", + 588, + 440, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + ] + ], + "section": "restore", + "start": 88, + "stop": 89 + } + ], + "helper": 588, + "helper_final": { + "588": { + "new": [ + 256, + 128, + 65, + 33, + 18, + 10, + 6 + ], + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + } + }, + "id": "B_588_440", + "partner": 440 + } + ] + }, + "helper_final": { + "586": { + "new": [ + 256, + 128, + 70, + 32, + 18, + 12, + 1 + ], + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + }, + "588": { + "new": [ + 256, + 128, + 65, + 33, + 18, + 10, + 6 + ], + "old": [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + } + } +} diff --git a/research/rank7-coupled-586-588-carrier-fold/edits/FINAL-WORD-base.json.gz b/research/rank7-coupled-586-588-carrier-fold/edits/FINAL-WORD-base.json.gz new file mode 100644 index 0000000000..cb4cc24a45 Binary files /dev/null and b/research/rank7-coupled-586-588-carrier-fold/edits/FINAL-WORD-base.json.gz differ diff --git a/research/rank7-coupled-586-588-carrier-fold/edits/FINAL-WORD-extra.json.gz b/research/rank7-coupled-586-588-carrier-fold/edits/FINAL-WORD-extra.json.gz new file mode 100644 index 0000000000..decc8f26d8 Binary files /dev/null and b/research/rank7-coupled-586-588-carrier-fold/edits/FINAL-WORD-extra.json.gz differ diff --git a/research/rank7-coupled-586-588-carrier-fold/edits/declared_edits.py b/research/rank7-coupled-586-588-carrier-fold/edits/declared_edits.py new file mode 100644 index 0000000000..671ee037e5 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/edits/declared_edits.py @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Declared literal gate-edit and coupled carrier-fold stage on PR2979's words (mdumitrean; joint rank-7 end frames, paired extractions, fourteen rewrites). + +Edits R1_E42, R2_E7, B_586_438 and B_588_440 by dcharb78 (with AI assistance) on PR2979's words (mdumitrean), extending Stack2979 / Jeremy Kothe's +(jeremykothe2) declared edit stage (PR3015). Pure module. A spec is a LIST of declared edits: either a single hunk {id, section, start, stop, old, new} +or a coupled multi-hunk rewrite {id, helper, partner, helper_final, edits: [{section, start, stop, old, new}, ...]}. The literal old gates +at [start:stop) of the source word are replaced by the literal new gates (frames included, so frames are re-solved by the author and literal +here). Edits are addressed in the SOURCE word and must not touch or be adjacent. Phase warps address B positions and are shifted by the net +length change of B edits strictly before them; declared helper_final lowerings must be canonical hyperplanes of the old end frames. +Compensation, cut, start_extra, removed, prelude_events and private buffer count are unchanged; profile, inventory and cleanup are +re-derived by the inherited frame rules. Exactness is decided by the inherited exact auditor, not by this module. +""" +import copy +import preload_move as pm + +SECTIONS = ('A', 'B', 'restore') +ALLOWED = {'A', 'B', 'restore', 'warps', 'helper_final', 'report', 'cleanup'} + + +def inside(small, big): + return pm.basis(list(big) + list(small)) == pm.basis(list(big)) + + +def apply(word, spec, declared=None): + x = copy.deepcopy(word) + taken = {s: [] for s in SECTIONS} + edits = [] + hf_changes = {} + if declared is not None and 'helper_final' in declared: + for h, chg in declared['helper_final'].items(): + hf_changes[str(h)] = chg + for e in spec: + if 'helper_final' in e: + for h, chg in e['helper_final'].items(): + pm.require(str(h) not in hf_changes or hf_changes[str(h)] == chg, ('conflicting helper_final', e['id'], h)) + hf_changes[str(h)] = chg + hunks = e['edits'] if 'edits' in e else [e] + for h in hunks: + s, a, b = h['section'], h['start'], h['stop'] + pm.require(s in SECTIONS and 0 <= a <= b <= len(word[s]), 'edit address') + pm.require(s != 'A' or a >= word['prelude_events'], 'no prelude edit') + pm.require(word[s][a:b] == h['old'] and h['old'] != h['new'], ('old gates differ from the declared preimage', e['id'], s, a)) + for (c, d) in taken[s]: + pm.require(b < c or d < a, ('overlapping or adjacent edits', e['id'], s, a)) + taken[s].append((a, b)) + edits.append((s, a, b, h['new'])) + for s, a, b, new in sorted(edits, key=lambda t: (t[0], -t[1], -t[2])): + x[s][a:b] = copy.deepcopy(new) + bedits = [(a, b, len(new) - (b - a)) for s, a, b, new in edits if s == 'B'] + for rec in x['warps']: + p = rec[0] + pm.require(not any(a < p < b for a, b, _ in bedits), 'no warp inside an edited B span') + rec[0] = p + sum(d for a, b, d in bedits if b <= p and a < p) + for h, chg in sorted(hf_changes.items()): + old, new = word['helper_final'][h], chg['new'] + pm.require(chg['old'] == old and list(pm.basis(new)) == new, ('exact helper_final preimage and canonical basis', h)) + pm.require(inside(new, old) and len(new) == len(old) - 1, ('lowered helper_final is a hyperplane of old', h)) + x['helper_final'][h] = list(new) + profile, inventory = pm.frame_report(x) + x['report']['local_profile'], x['report']['width_inventory'] = profile, inventory + z = copy.deepcopy(x) + z['A'] = z['A'][z['prelude_events']:] + x['cleanup'] = pm.derive_cleanup(z, pm.restored_of(word)) + pm.require({k for k in word if word[k] != x[k]} <= ALLOWED, 'only A, B, restore, warps, helper_final, report and cleanup change') + for k in ('cut', 'compensation', 'start_extra', 'removed', 'prelude_events'): + pm.require(x[k] == word[k], ('unchanged section', k)) + pm.require(set(x['helper_final']) == set(word['helper_final']), 'same restored helper set') + for h in word['helper_final']: + if h not in hf_changes: + pm.require(x['helper_final'][h] == word['helper_final'][h], ('unchanged helper_final', h)) + if declared is not None: + pm.require(profile == declared['local_profile'] and inventory == declared['width_inventory'], ('declared profile/inventory', profile, inventory)) + return x, dict(edits=len(spec), hunks=len(edits), lowered_helpers=sorted(map(int, hf_changes)), local_profile=profile, width_inventory=inventory) diff --git a/research/rank7-coupled-586-588-carrier-fold/edits/edits_review.py b/research/rank7-coupled-586-588-carrier-fold/edits/edits_review.py new file mode 100644 index 0000000000..0b4ce7f5ab --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/edits/edits_review.py @@ -0,0 +1,121 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Independent review of the declared literal edit list (edits/declared_edits.py), with semantic tamper controls. + +Edits R1_E42, R2_E7, B_586_438 and B_588_440 on PR2979's words (mdumitrean), extending Stack2979 / Jeremy Kothe's (jeremykothe2) +declared edit stage (PR3015). Does not import the producer. It requires every shipped candidate to equal its parent with exactly +the declared hunks and helper_final lowerings (pure applier; profile, inventory, warps and cleanup re-derived), then runs the +inherited exact auditor (forward and dual free-operator replay of all inputs) on the parent and the candidate and on tampered +copies. For every edit: a dropped new gate, a flipped coefficient, frames not re-solved (the old frames put back on the new gates), +and a frame below bound; and globally: the unedited restore, unshifted warps, unlowered helper_final, a stale cleanup, and a stale +claimed profile. Each tamper must be rejected by the exact auditor or (profile/frame claims) by the re-derivation; the mechanism is recorded. +""" +import argparse, copy, gzip, hashlib, json, os, subprocess, sys +from pathlib import Path +sys.dont_write_bytecode = True +os.environ['PYTHONDONTWRITEBYTECODE'] = '1' + + +def require(c, why): + if not c: + raise RuntimeError(why) + + +ap = argparse.ArgumentParser(description=__doc__) +ap.add_argument('--source-dir', type=Path, required=True, help='directory holding audit_local.py and preload_move.py') +for n in ('parent-base', 'parent-extra', 'candidate-base', 'candidate-extra', 'edits'): + ap.add_argument('--' + n, type=Path, required=True) +ap.add_argument('--out-dir', type=Path, required=True) +a = ap.parse_args() +ROOT, OUT = a.source_dir.resolve(), a.out_dir.resolve() +sys.path.insert(0, str(ROOT)); sys.path.insert(0, str(Path(__file__).resolve().parent)) +import declared_edits as D +pm = D.pm +AUDIT_SHA = 'a38940094f7d19cd6376aafdd4734fa68eabc9aff4c98c3c4a3e9540328b1c90' +sha = lambda p: hashlib.sha256(Path(p).read_bytes()).hexdigest() +require(sha(ROOT / 'audit_local.py') == AUDIT_SHA, 'pinned auditor') +require(not OUT.exists(), 'fresh out-dir'); OUT.mkdir(parents=True) +read = lambda p: json.loads((lambda b: gzip.decompress(b) if b[:2] == b'\x1f\x8b' else b)(Path(p).read_bytes())) +SPEC = read(a.edits) + + +def audit(word, tag): + p = OUT / (tag + '.json.gz') + p.write_bytes(gzip.compress(json.dumps(word, separators=(',', ':')).encode(), mtime=0)) + out = OUT / (tag + '.audit.json') + r = subprocess.run([sys.executable, '-B', str(ROOT / 'audit_local.py'), '--word', str(p), '--output', str(out)], capture_output=True, text=True, + env=dict(os.environ, PYTHONDONTWRITEBYTECODE='1')) + return r.returncode == 0 and out.exists() and json.loads(out.read_text()).get('status') == 'PASS_INDEPENDENT_EXACT_BORROWING_WORD' + + +report = {'status': 'PASS_INDEPENDENT_EDIT_REVIEW', 'variants': {}} +for variant in ('base', 'extra'): + S, X = read(getattr(a, 'parent_' + variant)), read(getattr(a, 'candidate_' + variant)) + edits, declared = SPEC['edits'][variant], SPEC['declared'] + all_hunks = [h for f in edits for h in (f['edits'] if 'edits' in f else [f])] + require(set(S) == set(X), 'same section set') + require({k for k in S if S[k] != X[k]} <= D.ALLOWED, 'only A, B, restore, warps, helper_final, report, cleanup differ') + for k in ('cut', 'compensation', 'start_extra', 'removed', 'prelude_events'): + require(S[k] == X[k], ('unchanged', k)) + rebuilt, ledger = D.apply(S, edits, declared) + require(rebuilt == X, 'candidate is the parent with exactly the declared hunks and helper_final lowerings') + require(X['report']['local_profile'] == declared['local_profile'] and X['report']['width_inventory'] == declared['width_inventory'], 'declared profile and inventory') + require(audit(S, variant + '-parent'), 'parent word audits (sanity)') + require(audit(X, variant + '-candidate'), ('positive audit of the candidate', variant)) + controls = [] + + def reject(name, mutate, rederive=False): + m = copy.deepcopy(X) + try: + mutate(m) + except Exception as e: + controls.append([name, 'rejected at construction: %s' % e]); return + require(m != X, ('control alters the word', name)) + if not audit(m, variant + '-ctl-' + name): + controls.append([name, 'rejected by the exact auditor']); return + require(rederive, ('tamper control accepted', name)) + controls.append([name, 'rejected by re-derivation (accepted by the auditor, but not the declared profile/cleanup)']) + + def locate_hunk(h): + """index of the first new gate of hunk h in the CANDIDATE word (hunks are in source addresses; shift by earlier same-section hunks)""" + shift = sum(len(g['new']) - len(g['old']) for g in all_hunks if g['section'] == h['section'] and g['start'] < h['start']) + return h['section'], h['start'] + shift, len(h['new']) + + for e in edits: + h = next(hk for hk in (e['edits'] if 'edits' in e else [e]) if hk['new']) + sec, i0, n = locate_hunk(h) + require(X[sec][i0:i0 + n] == h['new'], ('edit located in candidate', e['id'])) + drop_idx = i0 + 1 if n > 1 else i0 + def drop(m, sec=sec, drop_idx=drop_idx): + del m[sec][drop_idx] + if sec == 'B': + for wp in m['warps']: + if wp[0] > drop_idx: + wp[0] -= 1 + reject('%s-drop-new-gate' % e['id'], drop) + def flip(m, sec=sec, i0=i0, n=n): + j = next(j for j in range(i0, i0 + n) if m[sec][j][0] == 'add'); m[sec][j][3] = -m[sec][j][3] + reject('%s-flip-sign' % e['id'], flip) + def stale(m, e=e, h=h, sec=sec, i0=i0, n=n): + old = [g for g in h['old'] if g[-1] != h['new'][0][-1]] or h['old'] + for j in range(i0, i0 + n): m[sec][j][-1] = copy.deepcopy(old[min(j - i0, len(old) - 1)][-1]) + pr, inv = pm.frame_report(m) + require(pr == declared['local_profile'] and inv == declared['width_inventory'], 'frames not re-solved change the paid profile') + reject('%s-frames-not-resolved' % e['id'], stale, rederive=True) + def small(m, sec=sec, i0=i0): m[sec][i0][-1] = m[sec][i0][-1][:-1] + reject('%s-frame-below-bound' % e['id'], small) + reject('parent-restore-kept', lambda m: m.__setitem__('restore', copy.deepcopy(S['restore']))) + reject('unshifted-warps', lambda m: m.__setitem__('warps', copy.deepcopy(S['warps']))) + def unlowered_hf(m): + m['helper_final'] = copy.deepcopy(S['helper_final']) + pr, inv = pm.frame_report(m) + require(pr == declared['local_profile'] and inv == declared['width_inventory'], 'unlowered helper_final changes the width inventory and profile') + reject('unlowered-helper-final', unlowered_hf, rederive=True) + reject('stale-cleanup', lambda m: m.__setitem__('cleanup', copy.deepcopy(S['cleanup'])), rederive=True) + def stale_claim(m): m['report'] = copy.deepcopy(S['report']); require(m['report'] == X['report'], 'stale claimed profile differs from the re-derived one') + reject('stale-claimed-profile', stale_claim, rederive=True) + require(len(controls) == 4 * len(edits) + 5, 'control count') + report['variants'][variant] = dict(controls=controls, candidate_audit='PASS', ledger=ledger, + parent_canonical_sha256=hashlib.sha256(json.dumps(S, sort_keys=True, separators=(',', ':')).encode()).hexdigest(), + candidate_canonical_sha256=hashlib.sha256(json.dumps(X, sort_keys=True, separators=(',', ':')).encode()).hexdigest()) +(OUT / 'REVIEW.json').write_text(json.dumps(report, indent=2) + '\n', encoding='utf-8', newline='\n') +print(report['status'], {v: len(d['controls']) for v, d in report['variants'].items()}) diff --git a/research/rank7-coupled-586-588-carrier-fold/evidence/ADAPTER-DERIVATION.json b/research/rank7-coupled-586-588-carrier-fold/evidence/ADAPTER-DERIVATION.json new file mode 100644 index 0000000000..48b5d4ab54 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/evidence/ADAPTER-DERIVATION.json @@ -0,0 +1,147 @@ +{ + "status": "PASS_CHECKED_91_BUFFER_ADAPTER_DERIVATION_R13", + "parent_head": "51309592971e3b5be935599eed2a95404dc7781e", + "parent_manifest_sha256": "9dba3fe371602ec023a54e26c0fd66f69eb7a74be86aab89923529083c14b36f", + "source_commit": "rank7-joint-endframes-pr2917", + "source_profile": "rank7-joint-endframes", + "upstream_head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "source_manifest_sha256": "fa3e2d855ac5298ecc849e596d79dcef7a72668a276b6524585bc0cd616ce474", + "source_files": 642, + "comparisons": { + "pr2908": { + "pr": 2908, + "head": "51309592971e3b5be935599eed2a95404dc7781e", + "sha256": "2406680a07b43a69b0f12f8462cc43f3616f3c8cb0a46bc767541b45945cd2bf" + }, + "pr2917": { + "pr": 2917, + "head": "224bd5e56041c40078ff6b5fa7393733a215de5c", + "sha256": "e6c836c0178661a53a69cd91f29d83585e876f2511ff40c6b6204cd270fbdeac" + }, + "pr2966": { + "pr": 2966, + "head": "e62d3eb9005117d82a9babcfa937ecc53237c490", + "sha256": "4d4c4800bf3bcb36d09021313b2712aebd4aa0830c74dda30991daf6851c220a" + }, + "pr2969": { + "pr": 2969, + "head": "e2ca469b08385d3d5e29a918d66dbefaf889e9f3", + "sha256": "656a4c93411b078753783513e2e71b1722a56e7b70120264a38118811982fa77" + } + }, + "retained_receipt_sha256": "9d16e76b1d0e1c06c96eb74de76e2081d50351956ee6310224027070f38aaf72", + "buffer_count": 91, + "physical_overhead": 509, + "width_classes": { + "gauge44": 6, + "extra": 6 + }, + "admission_controls": 139, + "changes": { + "prepare_extension_native.py": { + "source": "/Users/dcharb/kappa_workspace/reproduce_586_588/pr2908/tools/prepare_channel_native.py", + "before_sha256": "4d207b9bbe3e0b8a86d10ad5d5f329a81da0cf56dce6c03e6fdd5b78e581ce91", + "after_sha256": "d1b8b878d0a4988fd6656ad5bb2751de01e92efbf08a9af65f9efeb892f31356", + "replacements": [ + { + "old": "SOURCE_SHA='56cf455752722051d598a7da1e5ee700637fbaef09189f534413dbe6e0525a83'", + "new": "SOURCE_SHA='fa3e2d855ac5298ecc849e596d79dcef7a72668a276b6524585bc0cd616ce474'" + }, + { + "old": "SOURCE_FILES=610", + "new": "SOURCE_FILES=642" + }, + { + "old": "SOURCE_COMMIT='two-sided-helper408-pr2894'", + "new": "SOURCE_COMMIT='rank7-joint-endframes-pr2917'" + }, + { + "old": "OLD_RECEIPT_SHA='dd36443f2789ffa6deca7210c76ada781e2b9b7e622a546b366f51a475faff3e'", + "new": "OLD_RECEIPT_SHA='9d16e76b1d0e1c06c96eb74de76e2081d50351956ee6310224027070f38aaf72'" + }, + { + "old": "len(can['zero_buffers'])==73", + "new": "len(can['zero_buffers'])==91" + } + ] + }, + "admit_extension.py": { + "source": "/Users/dcharb/kappa_workspace/reproduce_586_588/pr2908/tools/admit_channel408.py", + "before_sha256": "a62c21eac4e0df502cbfb78c88b19a763fd351cde3c11c0588874f84db6992bf", + "after_sha256": "6ddd449abfc2910e4c91f4ed93e14d65b84e6c1d2a082f3c089ad06f64d1d6ce", + "replacements": [ + { + "old": " 'channel408': dict(commit='two-sided-helper408-pr2894',manifest='56cf455752722051d598a7da1e5ee700637fbaef09189f534413dbe6e0525a83',helpers=408,source_file_count=610,upstream_head='18d03c447886895ef9abf888398178e0428533ca'),", + "new": " 'rank7-joint-endframes': dict(commit='rank7-joint-endframes-pr2917',manifest='fa3e2d855ac5298ecc849e596d79dcef7a72668a276b6524585bc0cd616ce474',helpers=408,source_file_count=642,upstream_head='224bd5e56041c40078ff6b5fa7393733a215de5c')," + }, + { + "old": "COMPARISONS = {", + "new": "COMPARISONS = {\n 'pr2908': dict(pr=2908,head='51309592971e3b5be935599eed2a95404dc7781e',sha256='2406680a07b43a69b0f12f8462cc43f3616f3c8cb0a46bc767541b45945cd2bf',field='kappa'),\n 'pr2917': dict(pr=2917,head='224bd5e56041c40078ff6b5fa7393733a215de5c',sha256='e6c836c0178661a53a69cd91f29d83585e876f2511ff40c6b6204cd270fbdeac',field='kappa'),\n 'pr2966': dict(pr=2966,head='e62d3eb9005117d82a9babcfa937ecc53237c490',sha256='4d4c4800bf3bcb36d09021313b2712aebd4aa0830c74dda30991daf6851c220a',field='kappa'),\n 'pr2969': dict(pr=2969,head='e2ca469b08385d3d5e29a918d66dbefaf889e9f3',sha256='656a4c93411b078753783513e2e71b1722a56e7b70120264a38118811982fa77',field='kappa')," + }, + { + "old": "ap.add_argument('--source-profile', choices=['channel408'], default='channel408')", + "new": "ap.add_argument('--source-profile', choices=['rank7-joint-endframes'], default='rank7-joint-endframes')" + }, + { + "old": "ap.add_argument('--comparison-profile', choices=['pr2894'], default='pr2894')", + "new": "ap.add_argument('--comparison-profile', choices=['pr2908','pr2917','pr2966','pr2969'], default='pr2908')" + }, + { + "old": "zero_buffers_allocated_and_cleared=73", + "new": "zero_buffers_allocated_and_cleared=91" + }, + { + "old": "len(c.get('zero_buffers',[]))==73, 'helper408 physical ABI including all 73 private buffers'", + "new": "len(c.get('zero_buffers',[]))==91, 'paired extension physical ABI including all 91 private buffers'" + }, + { + "old": "896*T+expected_helpers+8+73+2, 'complete physical cost including all actual helpers and 73 buffers'", + "new": "896*T+expected_helpers+8+91+2, 'complete physical cost including all actual helpers and 91 buffers'" + }, + { + "old": "\"len(rd(work/'ADMISSION-CONTROLS.json')['rejected_controls'])==119\")", + "new": "\"len(rd(work/'ADMISSION-CONTROLS.json')['rejected_controls'])==139\")" + }, + { + "old": "\"controls=dict(admission=119,", + "new": "\"controls=dict(admission=139," + } + ] + }, + "extension_blocknorm.py": { + "source": "/Users/dcharb/kappa_workspace/reproduce_586_588/pr2908/tools/channel_blocknorm.py", + "before_sha256": "b53ebd53e3948f658c6da4f487a9ea10c9cb0a6acf2435750a32d6efeb9869c0", + "after_sha256": "6e6b8683cc87a84e5410c399b1128eb68694f852a3927cb124067f503ed7d7c7", + "replacements": [ + { + "old": "len(allocated)==73, 'all73 private zero buffers released'", + "new": "len(allocated)==91, 'all91 private zero buffers released'" + }, + { + "old": "'zero_buffers_allocated_and_cleared':73", + "new": "'zero_buffers_allocated_and_cleared':91" + }, + { + "old": "r['zero_buffers_returned_to_zero']==73", + "new": "r['zero_buffers_returned_to_zero']==91" + }, + { + "old": "physical==live+8+408+73+2", + "new": "physical==live+8+408+91+2" + }, + { + "old": "'zero_buffers':[live+416,live+489], 'coefficient':[live+489,live+491]", + "new": "'zero_buffers':[live+416,live+507], 'coefficient':[live+507,live+509]" + }, + { + "old": "len(mp)==73 and set(mp.values())==set(range(*ns['zero_buffers'])), '73distinct private Z slots'", + "new": "len(mp)==91 and set(mp.values())==set(range(*ns['zero_buffers'])), '91distinct private Z slots'" + }, + { + "old": "T=len(order)//9; live=896*T; physical=live+490", + "new": "T=len(order)//9; live=896*T; physical=live+509" + } + ] + } + } +} diff --git a/research/rank7-coupled-586-588-carrier-fold/evidence/ADMISSION-RESULT.json b/research/rank7-coupled-586-588-carrier-fold/evidence/ADMISSION-RESULT.json new file mode 100644 index 0000000000..8016c199e7 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/evidence/ADMISSION-RESULT.json @@ -0,0 +1,383 @@ +{ + "actual_expected_helpers": 408, + "comparison_claim_sha256": "656a4c93411b078753783513e2e71b1722a56e7b70120264a38118811982fa77", + "comparison_head": "e2ca469b08385d3d5e29a918d66dbefaf889e9f3", + "comparison_kappa": "17240352247481048785499999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "comparison_pr": 2969, + "complex_lower": "864888044702560167119/500000000000000000000000", + "dispatch_sha256": "65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c", + "external_input_sha256": { + "/Users/dcharb/kappa_workspace/packages/rank7-coupled-586-588-carrier-fold/allocation/DISPATCH.json": "65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c", + "/Users/dcharb/kappa_workspace/packages/rank7-coupled-586-588-carrier-fold/allocation/FILL.json.gz": "68b8bae90144248774b1920cd27f9519caa3dc427704d8a9da6d4c491d912fc4", + "/Users/dcharb/kappa_workspace/packages/rank7-coupled-586-588-carrier-fold/allocation/ORDER.json": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1", + "/Users/dcharb/kappa_workspace/reproduce_586_588/adapters/extension_blocknorm.py": "6e6b8683cc87a84e5410c399b1128eb68694f852a3927cb124067f503ed7d7c7", + "/Users/dcharb/kappa_workspace/reproduce_586_588/parent-export/pr2894/vendor/pr2857/vendor/pr2839/lift_parent.py": "9a1edd7d4ab4a2f2ac8d15b42b7e40f93653d65026bac59e4c1ce80b486bd60e", + "/Users/dcharb/kappa_workspace/reproduce_586_588/parent-export/pr2894/vendor/pr2857/vendor/pr2839/reconstruct_replica.py": "5472811c24aef3852dc7e189dff5060076a6c0b25bfde928da50dcfe9b5bdc15", + "/Users/dcharb/kappa_workspace/reproduce_586_588/parent-export/pr2894/vendor/pr2857/vendor/pr2839/replica_parent.py": "48bdbf28f59d80edb266803ec61bf5e22e8fb5e5a0e2b88004b6039147589bd4", + "/Users/dcharb/kappa_workspace/reproduce_586_588/pr2969/CLAIM.json": "656a4c93411b078753783513e2e71b1722a56e7b70120264a38118811982fa77" + }, + "fill_sha256": "68b8bae90144248774b1920cd27f9519caa3dc427704d8a9da6d4c491d912fc4", + "gain": "717608082126931961/125000000000000000000000", + "kappa": "17297760894051203342379999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017297760894051203342379999999999999999999998999999999999999999999999", + "native_receipt_sha256": "165999eb606809540d37a9c30d569e778ee1818d04c10a4b5e5f7e548cc3624a", + "order_sha256": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1", + "package_manifest_sha256": "15a6773d8bc13aa55e7a3b4efb21963fbdd6e23262b3b6376072de8fa3279b50", + "patches": [ + { + "after_sha256": "52f8b4cec2dab69cbe590e1fd0f7a68e1b35de5a540bd22fd2adfce07a92b46b", + "before_sha256": "faf283eb4edd2e6a1ccb40b3cb3ba30ae54338eaf5ea0a10d84d11d7939502af", + "path": "new/rebind.py", + "replacements": [ + [ + "physical=spec['expected']['live'] + 8 + R + 2)", + "physical=spec['expected']['live'] + 8 + R + 2 + max(len(rd(d / 'CANONICAL-WORD.json.gz').get('zero_buffers', [])) for d in locs.values()))" + ] + ] + }, + { + "after_sha256": "99bef04f24a99088e5c0c9b8f6bbc8386669d8315b8f572d6bbfb932c5d51145", + "before_sha256": "7edb4732b34e5814b27650a55c938626cb50d68f06397744dd4fe451437e90e0", + "path": "geometry_controls.py", + "replacements": [ + [ + " i['complete_invocation_sweeps']=i['bridge_sweeps']=333", + " i['complete_invocation_sweeps']-=1;i['bridge_sweeps']-=1" + ], + [ + " o,i=copy.deepcopy(owner),copy.deepcopy(invoice);fn(o,i);oh=digest(o);i['owner_audit_sha256']=oh", + " o,i=copy.deepcopy(owner),copy.deepcopy(invoice);fn(o,i);assert (o,i)!=(owner,invoice), 'geometry mutant must change actual receipts';oh=digest(o);i['owner_audit_sha256']=oh" + ] + ] + }, + { + "after_sha256": "6cfefe80c02a6c0f243f50ca9e146e1ab1440b84a033d8a71d42be5a5fa27f6b", + "before_sha256": "c43680a2da390f79925547a5ee1919d8a76637cccf98e2c8164b6f667fbc3183", + "path": "verify_release.py", + "replacements": [ + [ + "Fraction(1, 10 ** 3046) - Fraction(1, 10 ** 3022)", + "Fraction(1, 10 ** (spec['outer_refinement']['endpoint_digits'] + 46)) - Fraction(1, 10 ** (spec['outer_refinement']['endpoint_digits'] + 22))" + ], + [ + "epsilon=1-(1025/1024)e-3080", + "epsilon=1-(1025/1024)e-{spec['outer_refinement']['endpoint_digits']+80}" + ], + [ + "at the one 3000-digit rejection call", + "at the one {spec['outer_refinement']['endpoint_digits']}-digit rejection call" + ] + ] + }, + { + "after_sha256": "1dd56009986eb14dd6603c9193c7ad71dd45c7d005bf71c9cd3f916e66f54d98", + "before_sha256": "9e12909c73d3b3a31a45d801ae76c034510d6306400412e474df79bc4f1dc67e", + "path": "outer/check_ledger.py", + "replacements": [ + [ + "assert (m,W)==(73,66304)", + "T=spec['geometry']['replicas']\nassert type(T) is int and T>0\nassert m==73 and W==896*T and W==BJ['live']" + ] + ] + }, + { + "after_sha256": "ebaf637f1f818dac9c0fce0ee3f18df300873105818cea29a8ae9e8b737b5c7d", + "before_sha256": "08ca58abff11bdfba721dc56ab8acf06ec1b7c48a8699a0955cf35324680aca7", + "path": "code/witness.py", + "replacements": [ + [ + " with open(os.environ['WITNESS_RECORD'],'a')as f:f.write(json.dumps([key,got],default=str)+chr(10))", + " import time as _wr_time\n _wr_path=Path(os.environ['WITNESS_RECORD'])\n _wr_lock=_wr_path.with_name(_wr_path.name+'.append.lock')\n _wr_deadline=_wr_time.monotonic()+60\n _wr_fd=None\n while _wr_fd is None:\n try:_wr_fd=os.open(_wr_lock,os.O_CREAT|os.O_EXCL|os.O_WRONLY)\n except FileExistsError:\n if _wr_time.monotonic()>=_wr_deadline:raise TimeoutError('discovery record lock timeout; existing lock preserved')\n _wr_time.sleep(.005)\n try:\n with _wr_path.open('a',encoding='utf-8',newline='\\n')as _wr_out:\n _wr_out.write(json.dumps([key,got],default=str)+chr(10))\n _wr_out.flush()\n finally:\n os.close(_wr_fd)\n _wr_lock.unlink()" + ] + ] + }, + { + "after_sha256": "2964ea185a64061d72e4a6c648a48cd0ddbfc7ea8174ecb39be2a2eee52a3be8", + "before_sha256": "8dee5aa1663a70edcf1099a30b72166d89c29fa29ba2025fb5707fdbcc237f83", + "path": "verify.py", + "replacements": [ + [ + "run('lift-parent',P/'lift_parent.py','--owners',work/'rebuilt-owners','--out',work/'rebuilt-parent')", + "run('lift-parent',P/'lift_parent.py','--package',P,'--owners',work/'rebuilt-owners','--out',work/'rebuilt-parent')" + ] + ] + }, + { + "after_sha256": "0d8cc021d2401d047aaec79060ec2ea28ba06f12eca8dbf4c60c78bb31975c4e", + "before_sha256": "ebaf637f1f818dac9c0fce0ee3f18df300873105818cea29a8ae9e8b737b5c7d", + "path": "code/witness.py", + "replacements": [ + [ + "PAYLOAD==1<<(192+(GEO['dimension']+1)//2+2*CALLS+4).bit_length()", + "PAYLOAD==1<<(128+(GEO['dimension']+1)//2+18+1330+1+4).bit_length()" + ] + ] + }, + { + "after_sha256": "c5106e0d7a97382677fa228fbade989262347968a0e54acfcf6712aa37e02f47", + "before_sha256": "bb213d0af12218ff7c9c572717e522d8bbeeb2856b87a253f4a7f44e0fd71f15", + "path": "code/invoice_allcold.py", + "replacements": [ + [ + " required_prefix=localbits+input_l2_bits+call_count+bridge_sweeps+4", + " from blocknorm_certificate import certify\n blocknorm=certify(template, {pid:base/'providers'/pid for pid in template['local_providers']})\n assert blocknorm['status'] == 'PASS_TENSOR_BLOCK_NORM_CERTIFICATE'\n assert localbits <= 128, 'actual native scalar/Horner prefix exceeds charged local reserve'\n required_prefix=localbits+input_l2_bits+blocknorm['max_active_depth']+blocknorm['stock_l2_bits']+1+4" + ] + ] + }, + { + "after_sha256": "0d522b09c7fe6a5e62fe80c28f3eefe733557a82d77c6212e5d4b91ffb7e3421", + "before_sha256": "02502a217fe8c9e10229075b50745518beac512c48db20e64c3e06514a4da5b5", + "path": "independent_core.py", + "replacements": [ + [ + " payload = 1 << (192 + (M+1)//2 + 2*len(c['order']) + 4).bit_length()", + " require(localbits <= 128, 'measured native prefix exceeds local reserve')\n payload = 1 << (128 + (M+1)//2 + 18 + 1330 + 1 + 4).bit_length()" + ] + ] + }, + { + "after_sha256": "d598a2ac1e2e8eaee14a8c285e0277a7ae44ca6a15bd2b5cfc67fb40844fb387", + "before_sha256": "c5106e0d7a97382677fa228fbade989262347968a0e54acfcf6712aa37e02f47", + "path": "code/invoice_allcold.py", + "replacements": [ + [ + " complete_invocation_sweeps=call_count,bridge_sweeps=bridge_sweeps,row_prefix_extra=2*payload,", + " complete_invocation_sweeps=call_count,bridge_sweeps=bridge_sweeps,row_prefix_extra=2*payload,blocknorm=blocknorm," + ], + [ + " primitive_arithmetic_margin_bits=4,controller_audit_sha256=", + " tensor_block_norm=blocknorm,partial_cover_margin_bits=1,physical_stock_l2_bits=blocknorm['stock_l2_bits'],primitive_arithmetic_margin_bits=4,controller_audit_sha256=" + ], + [ + "Sum every actual invocation and bridge sweep and take the maximum local scalar/Horner prefix over both orientations of the fixed provider.", + "All invocations and bridge sweeps remain charged. Bound completed-boundary energy by at most eighteen active steps per owner replica, using exact tensor-isomorphic whole-family helper unitaries. Add the full group-indexed physical-stock sup-to-l2 factor and one partial-cover margin, then the maximum local scalar/Horner prefix." + ] + ] + }, + { + "after_sha256": "e051aaa166e01263780d5ae03699690670b597fed6593af4c37a7e978825eb85", + "before_sha256": "0d522b09c7fe6a5e62fe80c28f3eefe733557a82d77c6212e5d4b91ffb7e3421", + "path": "independent_core.py", + "replacements": [ + [ + " prefix = localbits + (M + 1) // 2 + len(c['order']) + c['bridges'] + 4", + " bn=c['blocknorm']\n require(bn['status']=='PASS_TENSOR_BLOCK_NORM_CERTIFICATE' and bn['max_active_depth']==18 and bn['stock_l2_bits']<=1330, 'independent tensor block certificate')\n prefix = localbits + (M + 1) // 2 + bn['max_active_depth'] + bn['stock_l2_bits'] + 1 + 4" + ], + [ + "prefix_formula=dict(local_scalar=localbits, input_l2=(M + 1) // 2, invocations=len(c['order']), bridges=c['bridges'], margin=4)", + "prefix_formula=dict(local_scalar=localbits, input_l2=(M + 1) // 2, invocations=len(c['order']), bridges=c['bridges'], active_block_depth=18,stock_l2=bn['stock_l2_bits'],partial_cover=1,margin=4),blocknorm=bn" + ] + ] + }, + { + "after_sha256": "393323f150d0bb686419804d51cf43d0f58450d2a1e7929725acdd26fdbb3640", + "before_sha256": "2286f00e462ff28abbb3f396095463482a1e063213b9526a7225275980c77eaf", + "path": "audit_mixed.py", + "replacements": [ + [ + "pending=A.check_pending_axes(ctx);receipt=A.check_roles(ctx,roles)", + "import blocknorm_certificate as BN;ctx['blocknorm']=BN.certify_context(ctx,roles,dirs,source_parent=parent);pending=A.check_pending_axes(ctx);receipt=A.check_roles(ctx,roles)" + ] + ] + }, + { + "after_sha256": "0542dde915af8902324db2f59136da078d5256bfaa8f1510f3e59336be7e2680", + "before_sha256": "f25e1e870df5d5a16a1e367b3df8843cb01644ab4b75895d7939af81e4fcb833", + "path": "code/assemble.py", + "replacements": [ + [ + " assert invoice['global_prefix_bits']==max(z['prefix_bits']for p in invoice['providers'].values()for z in p['local'].values())+37+CALLS+CALLS+4", + " bn=invoice['blocknorm']\n assert bn['status']=='PASS_TENSOR_BLOCK_NORM_CERTIFICATE' and bn['replicas']==REPLICAS\n assert bn['max_active_depth']==bn['boundary_depth_bits']==18 and bn['active_calls_per_block']==bn['bridges_per_block']==9\n assert bn['block_width_families']==896 and bn['physical_families']==invoice['physical'] and bn['live_families']==invoice['live']\n assert bn['partial_cover_bits']==1 and bn['input_l2_bits']==37 and bn['local_reserve_bits']==128 and bn['retained_payload_bits']==PAYLOAD\n localbits=max(z['prefix_bits']for p in invoice['providers'].values()for z in p['local'].values())\n assert bn['local_actual_prefix_bits']==localbits and localbits<=128\n assert invoice['global_prefix_bits']==bn['actual_prefix_bits']==localbits+37+18+bn['stock_l2_bits']+1+4\n assert bn['required_reserve_bits']==128+37+18+bn['stock_l2_bits']+1+40\nassert m==73 and W==896*T and W==BJ['live']" + ] + ] + }, + { + "after_sha256": "ebaf637f1f818dac9c0fce0ee3f18df300873105818cea29a8ae9e8b737b5c7d", + "before_sha256": "08ca58abff11bdfba721dc56ab8acf06ec1b7c48a8699a0955cf35324680aca7", + "path": "code/witness.py", + "replacements": [ + [ + " with open(os.environ['WITNESS_RECORD'],'a')as f:f.write(json.dumps([key,got],default=str)+chr(10))", + " import time as _wr_time\n _wr_path=Path(os.environ['WITNESS_RECORD'])\n _wr_lock=_wr_path.with_name(_wr_path.name+'.append.lock')\n _wr_deadline=_wr_time.monotonic()+60\n _wr_fd=None\n while _wr_fd is None:\n try:_wr_fd=os.open(_wr_lock,os.O_CREAT|os.O_EXCL|os.O_WRONLY)\n except FileExistsError:\n if _wr_time.monotonic()>=_wr_deadline:raise TimeoutError('discovery record lock timeout; existing lock preserved')\n _wr_time.sleep(.005)\n try:\n with _wr_path.open('a',encoding='utf-8',newline='\\n')as _wr_out:\n _wr_out.write(json.dumps([key,got],default=str)+chr(10))\n _wr_out.flush()\n finally:\n os.close(_wr_fd)\n _wr_lock.unlink()" + ] + ] + }, + { + "after_sha256": "2964ea185a64061d72e4a6c648a48cd0ddbfc7ea8174ecb39be2a2eee52a3be8", + "before_sha256": "8dee5aa1663a70edcf1099a30b72166d89c29fa29ba2025fb5707fdbcc237f83", + "path": "verify.py", + "replacements": [ + [ + "run('lift-parent',P/'lift_parent.py','--owners',work/'rebuilt-owners','--out',work/'rebuilt-parent')", + "run('lift-parent',P/'lift_parent.py','--package',P,'--owners',work/'rebuilt-owners','--out',work/'rebuilt-parent')" + ] + ] + }, + { + "after_sha256": "0d8cc021d2401d047aaec79060ec2ea28ba06f12eca8dbf4c60c78bb31975c4e", + "before_sha256": "ebaf637f1f818dac9c0fce0ee3f18df300873105818cea29a8ae9e8b737b5c7d", + "path": "code/witness.py", + "replacements": [ + [ + "PAYLOAD==1<<(192+(GEO['dimension']+1)//2+2*CALLS+4).bit_length()", + "PAYLOAD==1<<(128+(GEO['dimension']+1)//2+18+1330+1+4).bit_length()" + ] + ] + }, + { + "after_sha256": "c5106e0d7a97382677fa228fbade989262347968a0e54acfcf6712aa37e02f47", + "before_sha256": "bb213d0af12218ff7c9c572717e522d8bbeeb2856b87a253f4a7f44e0fd71f15", + "path": "code/invoice_allcold.py", + "replacements": [ + [ + " required_prefix=localbits+input_l2_bits+call_count+bridge_sweeps+4", + " from blocknorm_certificate import certify\n blocknorm=certify(template, {pid:base/'providers'/pid for pid in template['local_providers']})\n assert blocknorm['status'] == 'PASS_TENSOR_BLOCK_NORM_CERTIFICATE'\n assert localbits <= 128, 'actual native scalar/Horner prefix exceeds charged local reserve'\n required_prefix=localbits+input_l2_bits+blocknorm['max_active_depth']+blocknorm['stock_l2_bits']+1+4" + ] + ] + }, + { + "after_sha256": "0d522b09c7fe6a5e62fe80c28f3eefe733557a82d77c6212e5d4b91ffb7e3421", + "before_sha256": "02502a217fe8c9e10229075b50745518beac512c48db20e64c3e06514a4da5b5", + "path": "independent_core.py", + "replacements": [ + [ + " payload = 1 << (192 + (M+1)//2 + 2*len(c['order']) + 4).bit_length()", + " require(localbits <= 128, 'measured native prefix exceeds local reserve')\n payload = 1 << (128 + (M+1)//2 + 18 + 1330 + 1 + 4).bit_length()" + ] + ] + }, + { + "after_sha256": "d598a2ac1e2e8eaee14a8c285e0277a7ae44ca6a15bd2b5cfc67fb40844fb387", + "before_sha256": "c5106e0d7a97382677fa228fbade989262347968a0e54acfcf6712aa37e02f47", + "path": "code/invoice_allcold.py", + "replacements": [ + [ + " complete_invocation_sweeps=call_count,bridge_sweeps=bridge_sweeps,row_prefix_extra=2*payload,", + " complete_invocation_sweeps=call_count,bridge_sweeps=bridge_sweeps,row_prefix_extra=2*payload,blocknorm=blocknorm," + ], + [ + " primitive_arithmetic_margin_bits=4,controller_audit_sha256=", + " tensor_block_norm=blocknorm,partial_cover_margin_bits=1,physical_stock_l2_bits=blocknorm['stock_l2_bits'],primitive_arithmetic_margin_bits=4,controller_audit_sha256=" + ], + [ + "Sum every actual invocation and bridge sweep and take the maximum local scalar/Horner prefix over both orientations of the fixed provider.", + "All invocations and bridge sweeps remain charged. Bound completed-boundary energy by at most eighteen active steps per owner replica, using exact tensor-isomorphic whole-family helper unitaries. Add the full group-indexed physical-stock sup-to-l2 factor and one partial-cover margin, then the maximum local scalar/Horner prefix." + ] + ] + }, + { + "after_sha256": "e051aaa166e01263780d5ae03699690670b597fed6593af4c37a7e978825eb85", + "before_sha256": "0d522b09c7fe6a5e62fe80c28f3eefe733557a82d77c6212e5d4b91ffb7e3421", + "path": "independent_core.py", + "replacements": [ + [ + " prefix = localbits + (M + 1) // 2 + len(c['order']) + c['bridges'] + 4", + " bn=c['blocknorm']\n require(bn['status']=='PASS_TENSOR_BLOCK_NORM_CERTIFICATE' and bn['max_active_depth']==18 and bn['stock_l2_bits']<=1330, 'independent tensor block certificate')\n prefix = localbits + (M + 1) // 2 + bn['max_active_depth'] + bn['stock_l2_bits'] + 1 + 4" + ], + [ + "prefix_formula=dict(local_scalar=localbits, input_l2=(M + 1) // 2, invocations=len(c['order']), bridges=c['bridges'], margin=4)", + "prefix_formula=dict(local_scalar=localbits, input_l2=(M + 1) // 2, invocations=len(c['order']), bridges=c['bridges'], active_block_depth=18,stock_l2=bn['stock_l2_bits'],partial_cover=1,margin=4),blocknorm=bn" + ] + ] + }, + { + "after_sha256": "393323f150d0bb686419804d51cf43d0f58450d2a1e7929725acdd26fdbb3640", + "before_sha256": "2286f00e462ff28abbb3f396095463482a1e063213b9526a7225275980c77eaf", + "path": "audit_mixed.py", + "replacements": [ + [ + "pending=A.check_pending_axes(ctx);receipt=A.check_roles(ctx,roles)", + "import blocknorm_certificate as BN;ctx['blocknorm']=BN.certify_context(ctx,roles,dirs,source_parent=parent);pending=A.check_pending_axes(ctx);receipt=A.check_roles(ctx,roles)" + ] + ] + }, + { + "after_sha256": "0542dde915af8902324db2f59136da078d5256bfaa8f1510f3e59336be7e2680", + "before_sha256": "f25e1e870df5d5a16a1e367b3df8843cb01644ab4b75895d7939af81e4fcb833", + "path": "code/assemble.py", + "replacements": [ + [ + " assert invoice['global_prefix_bits']==max(z['prefix_bits']for p in invoice['providers'].values()for z in p['local'].values())+37+CALLS+CALLS+4", + " bn=invoice['blocknorm']\n assert bn['status']=='PASS_TENSOR_BLOCK_NORM_CERTIFICATE' and bn['replicas']==REPLICAS\n assert bn['max_active_depth']==bn['boundary_depth_bits']==18 and bn['active_calls_per_block']==bn['bridges_per_block']==9\n assert bn['block_width_families']==896 and bn['physical_families']==invoice['physical'] and bn['live_families']==invoice['live']\n assert bn['partial_cover_bits']==1 and bn['input_l2_bits']==37 and bn['local_reserve_bits']==128 and bn['retained_payload_bits']==PAYLOAD\n localbits=max(z['prefix_bits']for p in invoice['providers'].values()for z in p['local'].values())\n assert bn['local_actual_prefix_bits']==localbits and localbits<=128\n assert invoice['global_prefix_bits']==bn['actual_prefix_bits']==localbits+37+18+bn['stock_l2_bits']+1+4\n assert bn['required_reserve_bits']==128+37+18+bn['stock_l2_bits']+1+40\nassert m==73 and W==896*T and W==BJ['live']" + ] + ] + }, + { + "after_sha256": "ebaf637f1f818dac9c0fce0ee3f18df300873105818cea29a8ae9e8b737b5c7d", + "before_sha256": "08ca58abff11bdfba721dc56ab8acf06ec1b7c48a8699a0955cf35324680aca7", + "path": "code/witness.py", + "replacements": [ + [ + " with open(os.environ['WITNESS_RECORD'],'a')as f:f.write(json.dumps([key,got],default=str)+chr(10))", + " import time as _wr_time\n _wr_path=Path(os.environ['WITNESS_RECORD'])\n _wr_lock=_wr_path.with_name(_wr_path.name+'.append.lock')\n _wr_deadline=_wr_time.monotonic()+60\n _wr_fd=None\n while _wr_fd is None:\n try:_wr_fd=os.open(_wr_lock,os.O_CREAT|os.O_EXCL|os.O_WRONLY)\n except FileExistsError:\n if _wr_time.monotonic()>=_wr_deadline:raise TimeoutError('discovery record lock timeout; existing lock preserved')\n _wr_time.sleep(.005)\n try:\n with _wr_path.open('a',encoding='utf-8',newline='\\n')as _wr_out:\n _wr_out.write(json.dumps([key,got],default=str)+chr(10))\n _wr_out.flush()\n finally:\n os.close(_wr_fd)\n _wr_lock.unlink()" + ] + ] + }, + { + "after_sha256": "680b6de474a8226777c5a17191470b21cd5cc524cc22921d12dff6cef25c43ee", + "before_sha256": "b0d5f4217b4699c37609dc7c3633d570acbccd205840777d38f891846b4b918c", + "path": "verify.py", + "replacements": [ + [ + "run('lift-parent',P/'lift_parent.py','--owners',work/'rebuilt-owners','--out',work/'rebuilt-parent')", + "run('lift-parent',P/'lift_parent.py','--package',P,'--owners',work/'rebuilt-owners','--out',work/'rebuilt-parent')" + ] + ] + }, + { + "after_sha256": "0d8cc021d2401d047aaec79060ec2ea28ba06f12eca8dbf4c60c78bb31975c4e", + "before_sha256": "ebaf637f1f818dac9c0fce0ee3f18df300873105818cea29a8ae9e8b737b5c7d", + "path": "code/witness.py", + "replacements": [ + [ + "PAYLOAD==1<<(192+(GEO['dimension']+1)//2+2*CALLS+4).bit_length()", + "PAYLOAD==1<<(128+(GEO['dimension']+1)//2+18+1330+1+4).bit_length()" + ] + ] + }, + { + "after_sha256": "c5106e0d7a97382677fa228fbade989262347968a0e54acfcf6712aa37e02f47", + "before_sha256": "bb213d0af12218ff7c9c572717e522d8bbeeb2856b87a253f4a7f44e0fd71f15", + "path": "code/invoice_allcold.py", + "replacements": [ + [ + " required_prefix=localbits+input_l2_bits+call_count+bridge_sweeps+4", + " from blocknorm_certificate import certify\n blocknorm=certify(template, {pid:base/'providers'/pid for pid in template['local_providers']})\n assert blocknorm['status'] == 'PASS_TENSOR_BLOCK_NORM_CERTIFICATE'\n assert localbits <= 128, 'actual native scalar/Horner prefix exceeds charged local reserve'\n required_prefix=localbits+input_l2_bits+blocknorm['max_active_depth']+blocknorm['stock_l2_bits']+1+4" + ] + ] + }, + { + "after_sha256": "0d522b09c7fe6a5e62fe80c28f3eefe733557a82d77c6212e5d4b91ffb7e3421", + "before_sha256": "02502a217fe8c9e10229075b50745518beac512c48db20e64c3e06514a4da5b5", + "path": "independent_core.py", + "replacements": [ + [ + " payload = 1 << (192 + (M+1)//2 + 2*len(c['order']) + 4).bit_length()", + " require(localbits <= 128, 'measured native prefix exceeds local reserve')\n payload = 1 << (128 + (M+1)//2 + 18 + 1330 + 1 + 4).bit_length()" + ] + ] + }, + { + "after_sha256": "d598a2ac1e2e8eaee14a8c285e0277a7ae44ca6a15bd2b5cfc67fb40844fb387", + "before_sha256": "c5106e0d7a97382677fa228fbade989262347968a0e54acfcf6712aa37e02f47", + "path": "code/invoice_allcold.py", + "replacements": [ + [ + " complete_invocation_sweeps=call_count,bridge_sweeps=bridge_sweeps,row_prefix_extra=2*payload,", + " complete_invocation_sweeps=call_count,bridge_sweeps=bridge_sweeps,row_prefix_extra=2*payload,blocknorm=blocknorm," + ], + [ + " primitive_arithmetic_margin_bits=4,controller_audit_sha256=", + " tensor_block_norm=blocknorm,partial_cover_margin_bits=1,physical_stock_l2_bits=blocknorm['stock_l2_bits'],primitive_arithmetic_margin_bits=4,controller_audit_sha256=" + ], + [ + "Sum every actual invocation and bridge sweep and take the maximum local scalar/Horner prefix over both orientations of the fixed provider.", + "All invocations and bridge sweeps remain charged. Bound completed-boundary energy by at most eighteen active steps per owner replica, using exact tensor-isomorphic whole-family helper unitaries. Add the full group-indexed physical-stock sup-to-l2 factor and one partial-cover margin, then the maximum local scalar/Horner prefix." + ] + ] + }, + { + "after_sha256": "e051aaa166e01263780d5ae03699690670b597fed6593af4c37a7e978825eb85", + "before_sha256": "0d522b09c7fe6a5e62fe80c28f3eefe733557a82d77c6212e5d4b91ffb7e3421", + "path": "independent_core.py", + "replacements": [ + [ + " prefix = localbits + (M + 1) // 2 + len(c['order']) + c['bridges'] + 4", + " bn=c['blocknorm']\n require(bn['status']=='PASS_TENSOR_BLOCK_NORM_CERTIFICATE' and bn['max_active_depth']==18 and bn['stock_l2_bits']<=1330, 'independent tensor block certificate')\n prefix = localbits + (M + 1) // 2 + bn['max_active_depth'] + bn['stock_l2_bits'] + 1 + 4" + ], + [ + "prefix_formula=dict(local_scalar=localbits, input_l2=(M + 1) // 2, invocations=len(c['order']), bridges=c['bridges'], margin=4)", + "prefix_formula=dict(local_scalar=localbits, input_l2=(M + 1) // 2, invocations=len(c['order']), bridges=c['bridges'], active_block_depth=18,stock_l2=bn['stock_l2_bits'],partial_cover=1,margin=4),blocknorm=bn" + ] + ] + }, + { + "after_sha256": "393323f150d0bb686419804d51cf43d0f58450d2a1e7929725acdd26fdbb3640", + "before_sha256": "2286f00e462ff28abbb3f396095463482a1e063213b9526a7225275980c77eaf", + "path": "audit_mixed.py", + "replacements": [ + [ + "pending=A.check_pending_axes(ctx);receipt=A.check_roles(ctx,roles)", + "import blocknorm_certificate as BN;ctx['blocknorm']=BN.certify_context(ctx,roles,dirs,source_parent=parent);pending=A.check_pending_axes(ctx);receipt=A.check_roles(ctx,roles)" + ] + ] + }, + { + "after_sha256": "0542dde915af8902324db2f59136da078d5256bfaa8f1510f3e59336be7e2680", + "before_sha256": "f25e1e870df5d5a16a1e367b3df8843cb01644ab4b75895d7939af81e4fcb833", + "path": "code/assemble.py", + "replacements": [ + [ + " assert invoice['global_prefix_bits']==max(z['prefix_bits']for p in invoice['providers'].values()for z in p['local'].values())+37+CALLS+CALLS+4", + " bn=invoice['blocknorm']\n assert bn['status']=='PASS_TENSOR_BLOCK_NORM_CERTIFICATE' and bn['replicas']==REPLICAS\n assert bn['max_active_depth']==bn['boundary_depth_bits']==18 and bn['active_calls_per_block']==bn['bridges_per_block']==9\n assert bn['block_width_families']==896 and bn['physical_families']==invoice['physical'] and bn['live_families']==invoice['live']\n assert bn['partial_cover_bits']==1 and bn['input_l2_bits']==37 and bn['local_reserve_bits']==128 and bn['retained_payload_bits']==PAYLOAD\n localbits=max(z['prefix_bits']for p in invoice['providers'].values()for z in p['local'].values())\n assert bn['local_actual_prefix_bits']==localbits and localbits<=128\n assert invoice['global_prefix_bits']==bn['actual_prefix_bits']==localbits+37+18+bn['stock_l2_bits']+1+4\n assert bn['required_reserve_bits']==128+37+18+bn['stock_l2_bits']+1+40\nassert m==73 and W==896*T and W==BJ['live']" + ] + ] + }, + { + "after_sha256": "ebaf637f1f818dac9c0fce0ee3f18df300873105818cea29a8ae9e8b737b5c7d", + "before_sha256": "08ca58abff11bdfba721dc56ab8acf06ec1b7c48a8699a0955cf35324680aca7", + "path": "code/witness.py", + "replacements": [ + [ + " with open(os.environ['WITNESS_RECORD'],'a')as f:f.write(json.dumps([key,got],default=str)+chr(10))", + " import time as _wr_time\n _wr_path=Path(os.environ['WITNESS_RECORD'])\n _wr_lock=_wr_path.with_name(_wr_path.name+'.append.lock')\n _wr_deadline=_wr_time.monotonic()+60\n _wr_fd=None\n while _wr_fd is None:\n try:_wr_fd=os.open(_wr_lock,os.O_CREAT|os.O_EXCL|os.O_WRONLY)\n except FileExistsError:\n if _wr_time.monotonic()>=_wr_deadline:raise TimeoutError('discovery record lock timeout; existing lock preserved')\n _wr_time.sleep(.005)\n try:\n with _wr_path.open('a',encoding='utf-8',newline='\\n')as _wr_out:\n _wr_out.write(json.dumps([key,got],default=str)+chr(10))\n _wr_out.flush()\n finally:\n os.close(_wr_fd)\n _wr_lock.unlink()" + ] + ] + }, + { + "after_sha256": "680b6de474a8226777c5a17191470b21cd5cc524cc22921d12dff6cef25c43ee", + "before_sha256": "b0d5f4217b4699c37609dc7c3633d570acbccd205840777d38f891846b4b918c", + "path": "verify.py", + "replacements": [ + [ + "run('lift-parent',P/'lift_parent.py','--owners',work/'rebuilt-owners','--out',work/'rebuilt-parent')", + "run('lift-parent',P/'lift_parent.py','--package',P,'--owners',work/'rebuilt-owners','--out',work/'rebuilt-parent')" + ] + ] + }, + { + "after_sha256": "0d8cc021d2401d047aaec79060ec2ea28ba06f12eca8dbf4c60c78bb31975c4e", + "before_sha256": "ebaf637f1f818dac9c0fce0ee3f18df300873105818cea29a8ae9e8b737b5c7d", + "path": "code/witness.py", + "replacements": [ + [ + "PAYLOAD==1<<(192+(GEO['dimension']+1)//2+2*CALLS+4).bit_length()", + "PAYLOAD==1<<(128+(GEO['dimension']+1)//2+18+1330+1+4).bit_length()" + ] + ] + }, + { + "after_sha256": "c5106e0d7a97382677fa228fbade989262347968a0e54acfcf6712aa37e02f47", + "before_sha256": "bb213d0af12218ff7c9c572717e522d8bbeeb2856b87a253f4a7f44e0fd71f15", + "path": "code/invoice_allcold.py", + "replacements": [ + [ + " required_prefix=localbits+input_l2_bits+call_count+bridge_sweeps+4", + " from blocknorm_certificate import certify\n blocknorm=certify(template, {pid:base/'providers'/pid for pid in template['local_providers']})\n assert blocknorm['status'] == 'PASS_TENSOR_BLOCK_NORM_CERTIFICATE'\n assert localbits <= 128, 'actual native scalar/Horner prefix exceeds charged local reserve'\n required_prefix=localbits+input_l2_bits+blocknorm['max_active_depth']+blocknorm['stock_l2_bits']+1+4" + ] + ] + }, + { + "after_sha256": "0d522b09c7fe6a5e62fe80c28f3eefe733557a82d77c6212e5d4b91ffb7e3421", + "before_sha256": "02502a217fe8c9e10229075b50745518beac512c48db20e64c3e06514a4da5b5", + "path": "independent_core.py", + "replacements": [ + [ + " payload = 1 << (192 + (M+1)//2 + 2*len(c['order']) + 4).bit_length()", + " require(localbits <= 128, 'measured native prefix exceeds local reserve')\n payload = 1 << (128 + (M+1)//2 + 18 + 1330 + 1 + 4).bit_length()" + ] + ] + }, + { + "after_sha256": "d598a2ac1e2e8eaee14a8c285e0277a7ae44ca6a15bd2b5cfc67fb40844fb387", + "before_sha256": "c5106e0d7a97382677fa228fbade989262347968a0e54acfcf6712aa37e02f47", + "path": "code/invoice_allcold.py", + "replacements": [ + [ + " complete_invocation_sweeps=call_count,bridge_sweeps=bridge_sweeps,row_prefix_extra=2*payload,", + " complete_invocation_sweeps=call_count,bridge_sweeps=bridge_sweeps,row_prefix_extra=2*payload,blocknorm=blocknorm," + ], + [ + " primitive_arithmetic_margin_bits=4,controller_audit_sha256=", + " tensor_block_norm=blocknorm,partial_cover_margin_bits=1,physical_stock_l2_bits=blocknorm['stock_l2_bits'],primitive_arithmetic_margin_bits=4,controller_audit_sha256=" + ], + [ + "Sum every actual invocation and bridge sweep and take the maximum local scalar/Horner prefix over both orientations of the fixed provider.", + "All invocations and bridge sweeps remain charged. Bound completed-boundary energy by at most eighteen active steps per owner replica, using exact tensor-isomorphic whole-family helper unitaries. Add the full group-indexed physical-stock sup-to-l2 factor and one partial-cover margin, then the maximum local scalar/Horner prefix." + ] + ] + }, + { + "after_sha256": "e051aaa166e01263780d5ae03699690670b597fed6593af4c37a7e978825eb85", + "before_sha256": "0d522b09c7fe6a5e62fe80c28f3eefe733557a82d77c6212e5d4b91ffb7e3421", + "path": "independent_core.py", + "replacements": [ + [ + " prefix = localbits + (M + 1) // 2 + len(c['order']) + c['bridges'] + 4", + " bn=c['blocknorm']\n require(bn['status']=='PASS_TENSOR_BLOCK_NORM_CERTIFICATE' and bn['max_active_depth']==18 and bn['stock_l2_bits']<=1330, 'independent tensor block certificate')\n prefix = localbits + (M + 1) // 2 + bn['max_active_depth'] + bn['stock_l2_bits'] + 1 + 4" + ], + [ + "prefix_formula=dict(local_scalar=localbits, input_l2=(M + 1) // 2, invocations=len(c['order']), bridges=c['bridges'], margin=4)", + "prefix_formula=dict(local_scalar=localbits, input_l2=(M + 1) // 2, invocations=len(c['order']), bridges=c['bridges'], active_block_depth=18,stock_l2=bn['stock_l2_bits'],partial_cover=1,margin=4),blocknorm=bn" + ] + ] + }, + { + "after_sha256": "393323f150d0bb686419804d51cf43d0f58450d2a1e7929725acdd26fdbb3640", + "before_sha256": "2286f00e462ff28abbb3f396095463482a1e063213b9526a7225275980c77eaf", + "path": "audit_mixed.py", + "replacements": [ + [ + "pending=A.check_pending_axes(ctx);receipt=A.check_roles(ctx,roles)", + "import blocknorm_certificate as BN;ctx['blocknorm']=BN.certify_context(ctx,roles,dirs,source_parent=parent);pending=A.check_pending_axes(ctx);receipt=A.check_roles(ctx,roles)" + ] + ] + }, + { + "after_sha256": "0542dde915af8902324db2f59136da078d5256bfaa8f1510f3e59336be7e2680", + "before_sha256": "f25e1e870df5d5a16a1e367b3df8843cb01644ab4b75895d7939af81e4fcb833", + "path": "code/assemble.py", + "replacements": [ + [ + " assert invoice['global_prefix_bits']==max(z['prefix_bits']for p in invoice['providers'].values()for z in p['local'].values())+37+CALLS+CALLS+4", + " bn=invoice['blocknorm']\n assert bn['status']=='PASS_TENSOR_BLOCK_NORM_CERTIFICATE' and bn['replicas']==REPLICAS\n assert bn['max_active_depth']==bn['boundary_depth_bits']==18 and bn['active_calls_per_block']==bn['bridges_per_block']==9\n assert bn['block_width_families']==896 and bn['physical_families']==invoice['physical'] and bn['live_families']==invoice['live']\n assert bn['partial_cover_bits']==1 and bn['input_l2_bits']==37 and bn['local_reserve_bits']==128 and bn['retained_payload_bits']==PAYLOAD\n localbits=max(z['prefix_bits']for p in invoice['providers'].values()for z in p['local'].values())\n assert bn['local_actual_prefix_bits']==localbits and localbits<=128\n assert invoice['global_prefix_bits']==bn['actual_prefix_bits']==localbits+37+18+bn['stock_l2_bits']+1+4\n assert bn['required_reserve_bits']==128+37+18+bn['stock_l2_bits']+1+4 (shared rank-7 end frame W, helpers lowered to W) +GROUPS = {'V45': ([256, 128, 64, 35, 16, 11, 5], [249, 251, 265, 267]), # = E_7 n E_42 n E_45 (PR2942's pivots, 8 -> 7) + 'A': ([256, 128, 64, 38, 20, 10, 1], [331, 450, 451, 508, 509]), # inside E_30; 331 (PR2917) 8 -> 7, entering helpers 7 -> 6 + 'B': ([256, 128, 64, 34, 17, 11, 4], [299, 448, 449, 484, 485]), # inside E_51; 299 (PR2917) 8 -> 7, entering helpers 7 -> 6 + 'C': ([256, 128, 64, 32, 19, 11, 6], [452, 453, 532, 533]), # entering helpers 7 -> 6 + 'D': ([256, 128, 64, 37, 21, 8, 3], [454, 455, 556, 557])} # entering helpers 7 -> 6 +STAGE1_PROFILE = {'1': 2430, '2': 722, '3': 236, '4': 102, '5': 18, '8': 8} +STAGE1_INVENTORY = {'4': 26, '5': 2, '6': 16, '7': 52, '8': 94, '9': 218} +STAGE1_ALLOWED = {'B', 'restore', 'helper_final', 'report'} +# stage 2 +HELPERS = (226, 228, 230, 363, 395) +NORMALS = (42, 42, 42, 7, 7) +STAGE2_PROFILE = {'1': 2449, '2': 710, '3': 236, '4': 102, '5': 18, '8': 8} +STAGE2_ALLOWED = {'A', 'restore', 'helper_final', 'compensation', 'report', 'cleanup'} +# stage 3 (PR2957, Jeremy Kothe) +REWRITES = ('5997', '6000', '6004', '6008', '3779', '1564', '1569', '4604', '4630', + 'swap3749', 'swap3755', 'swap3761', 'swap3767', 'swap3773') +STAGE3_ALLOWED = {'A', 'B', 'restore', 'warps', 'report', 'cleanup'} +PROFILE = {'1': 2445, '2': 706, '3': 232, '4': 108, '5': 18, '8': 8} +INVENTORY = {'4': 26, '5': 2, '6': 16, '7': 52, '8': 99, '9': 213} +BUFFERS = 91 +# stage 4 (declared restore carrier skips R1_E42, R2_E7 + coupled B_586_438, B_588_440 carrier folds) +DECLARED_EDITS = ('R1_E42', 'R2_E7', 'B_586_438', 'B_588_440') +COUPLED_LOWERED = {'586': [256, 128, 70, 32, 18, 12, 1], + '588': [256, 128, 65, 33, 18, 10, 6]} +STAGE4_ALLOWED = {'A', 'B', 'restore', 'warps', 'helper_final', 'report', 'cleanup'} +FINAL_PROFILE = {'1': 2433, '2': 724, '3': 228, '4': 102, '5': 20, '8': 8} +FINAL_INVENTORY = {'4': 26, '5': 2, '6': 18, '7': 50, '8': 99, '9': 213} + + +def hyperplane(normal): + """Canonical basis of the rank-8 hyperplane E_n of F_2^9 with the given nonzero normal.""" + pm.require(0 < normal < 512, 'nonzero nine-bit normal') + return list(pm.basis([x for x in range(1, 512) if (x & normal).bit_count() % 2 == 0])) + + +def inside(small, big): + """span(small) is a subspace of span(big) (both given by any spanning lists).""" + return pm.basis(list(big) + list(small)) == pm.basis(list(big)) + + +def roles(g): + return g[1:3] if g[0] == 'add' else g[1:2] + + +def rereport(x): + profile, inventory = pm.frame_report(x) + x['report']['local_profile'], x['report']['width_inventory'] = profile, inventory + return x + + +def recleanup(x): + z = copy.deepcopy(x) + z['A'] = z['A'][z['prelude_events']:] + return pm.derive_cleanup(z, set(map(int, x['helper_final']))) + + +def lowered_fit(word, groups=GROUPS): + """Stage-1 validity: every gate touching a lowered helper lies in that helper's lowered end frame.""" + bad = [] + for _, (W, hs) in groups.items(): + for h in hs: + for sec in ('A', 'B', 'restore'): + for i, g in enumerate(word[sec]): + if g[0] in ('add', 'scale') and h in roles(g) and not inside(g[-1], W): + bad.append((h, sec, i)) + return bad + + +def lower_end_frames(word, record): + """Stage 1: the declared joint end-frame lowering (frame-only).""" + pm.require({k: [list(W), list(hs)] for k, (W, hs) in GROUPS.items()} == record['groups'], 'declared groups') + lowered = {} + for _, (W, hs) in GROUPS.items(): + pm.require(list(pm.basis(W)) == W and len(W) == 7, 'canonical rank-7 group subspace') + for h in hs: + lowered[str(h)] = W + pm.require(set(record['helper_final_changes']) == set(lowered), 'exactly the grouped helpers are lowered') + x = copy.deepcopy(word) + for h, change in record['helper_final_changes'].items(): + old, new = word['helper_final'][h], change['new'] + pm.require(change['old'] == old and new == lowered[h], 'exact end-frame preimage and group subspace') + pm.require(inside(new, old) and len(new) == len(old) - 1, 'lowered end frame is a hyperplane of the old end frame') + x['helper_final'][h] = list(new) + seen = set() + for e in record['frame_edits']: + section, index = e['section'], e['index'] + pm.require(section in ('A', 'B', 'restore') and (section, index) not in seen and 0 <= index < len(x[section]) and + (section != 'A' or index >= x['prelude_events']), 'unique declared non-prelude gate frame edit') + seen.add((section, index)) + g = x[section][index] + pm.require(g[0] in ('add', 'scale') and g[:-1] == e['gate'] and g[-1] == e['old_frame'], 'exact gate frame preimage') + pm.require(list(pm.basis(e['new_frame'])) == e['new_frame'] and inside(e['new_frame'], e['old_frame']) and + len(e['new_frame']) == len(pm.basis(e['old_frame'])) - 1, 'canonical frame lowered by one dimension') + g[-1] = list(e['new_frame']) + pm.require(not lowered_fit(x), 'every gate touching a lowered helper fits its lowered end frame') + rereport(x) + pm.require(recleanup(x) == word['cleanup'], 'the cleanup contract is unchanged (frames do not enter it)') + pm.require({k for k in word if word[k] != x[k]} == STAGE1_ALLOWED, 'stage 1 changes frames, end frames and the report only') + pm.require(all(a[:-1] == b[:-1] for s in ('A', 'B', 'restore') for a, b in zip(word[s], x[s])), 'no gate or scalar changes') + pm.require(x['report']['local_profile'] == STAGE1_PROFILE == record['declared_local_profile'] and + x['report']['width_inventory'] == STAGE1_INVENTORY == record['declared_width_inventory'], 'declared joint stage-1 invoice') + return x + + +def apply_stage(word, transform): + """Stage 2, one step: PR2917's paired composition rule with the step's declared frame changes.""" + h, k = transform['helper'], transform['step'] + before, after = transform['before'], transform['after'] + pm.require(1 <= k <= len(HELPERS) and HELPERS[k - 1] == h and NORMALS[k - 1] == transform['normal'], 'declared step') + pm.require(str(h) not in word['helper_final'] and str(h) not in word['start_extra'], 'fresh zero-entrance helper') + protected = set(map(int, word['helper_final'])) | set(map(int, word['start_extra'])) + protected |= {c['source'] for c in word['initial_corrections']} + for g in before: + pm.require(g[0] in ('add', 'scale') and g[-1] == [], 'scalar zero-frame input change') + pm.require(all(224 <= r < 704 and r not in protected and r not in word['removed'] for r in roles(g)), 'unprotected live helpers only') + frame = hyperplane(transform['normal']) + pm.require(len(after) > 0 and all(g[0] in ('add', 'scale') and g[-1] == frame for g in after), 'common terminal hyperplane E_n') + x = copy.deepcopy(word) + n = x['prelude_events'] + x['A'] = x['A'][:n] + copy.deepcopy(before) + x['A'][n:] + x['restore'] += copy.deepcopy(after) + x['helper_final'][str(h)] = list(frame) + C = collections.defaultdict(dict) + for g in x['compensation']: + C[g[2]][g[1]] = C[g[2]].get(g[1], Q(0)) + Q(g[3], g[4]) + # Right multiplication C*S uses the reverse order of the literal input gates. + for g in reversed(before): + if g[0] == 'scale': + C[g[1]] = {t: a * Q(g[2], g[3]) for t, a in C[g[1]].items()} + else: + t, s = g[1:3] + for target, a in C[t].items(): + C[s][target] = C[s].get(target, Q(0)) + Q(g[3], g[4]) * a + x['compensation'] = [['add', t, r, a.numerator, a.denominator, []] + for r, col in sorted(C.items()) for t, a in sorted(col.items()) if a] + pm.require(not any(g[2] == h for g in x['compensation']), 'new cold column has no compensation (C v = 0)') + seen = set() + for e in transform['frame_changes']: # addressed in the child word + section, index = e['section'], e['index'] + pm.require(section in ('A', 'B', 'restore') and (section, index) not in seen and 0 <= index < len(x[section]) and + (section != 'A' or index >= n), 'unique declared frame change') + seen.add((section, index)) + g = x[section][index] + pm.require(g[0] in ('add', 'scale') and g[:-1] == e['gate'] and g[-1] == e['old_frame'], 'exact frame change preimage') + pm.require(list(pm.basis(e['new_frame'])) == e['new_frame'] and not 112 <= g[1] < 224, 'canonical nontarget frame') + g[-1] = list(e['new_frame']) + rereport(x) + x['cleanup'] = recleanup(x) + pm.require({k_ for k_ in word if word[k_] != x[k_]} == STAGE2_ALLOWED, 'exact stage-2 changed sections') + return x + + +def apply_rewrites(word, rewrites): + """Stage 3: PR2957's fourteen declared rewrites by PR2957's own applier, re-derivations compared.""" + pm.require(tuple(r['id'] for r in rewrites) == REWRITES, 'the fourteen declared PR2957 rewrites, in order') + pm.require({r['cls'] for r in rewrites} == set(dr.CLASSES), 'all five PR2957 rewrite classes') + x, ledger = dr.apply(word, rewrites, check_declared=False) + pm.require(ledger['rewrites'] == list(REWRITES), 'applier ledger') + profile, inventory = pm.frame_report(x) + pm.require((profile, inventory) == (x['report']['local_profile'], x['report']['width_inventory']), 'report re-derived') + pm.require(x['cleanup'] == recleanup(x), 'cleanup re-derived with the 91 restored endpoints') + pm.require(inventory == word['report']['width_inventory'], 'rewrites keep every helper width') + pm.require({k for k in word if word[k] != x[k]} <= STAGE3_ALLOWED, 'exact stage-3 changed sections') + pm.require([w[1:] for w in x['warps']] == [w[1:] for w in word['warps']], 'warps: only their B positions move') + return x, ledger + + +def apply_declared_edits(word, spec, declared=None): + """Stage 4: declared restore carrier skips (R1_E42, R2_E7) and coupled B+restore carrier folds (B_586_438, B_588_440).""" + pm.require(de is not None, 'declared_edits module available') + pm.require(tuple(e['id'] for e in spec) == DECLARED_EDITS, 'the four declared stage-4 edit blocks, in order') + x, ledger = de.apply(word, spec, declared) + profile, inventory = pm.frame_report(x) + pm.require((profile, inventory) == (FINAL_PROFILE, FINAL_INVENTORY), 'stage-4 final profile and width inventory') + pm.require(x['cleanup'] == recleanup(x), 'cleanup re-derived with the 91 restored endpoints') + pm.require({k for k in word if word[k] != x[k]} <= STAGE4_ALLOWED, 'exact stage-4 changed sections') + for h, W in COUPLED_LOWERED.items(): + pm.require(x['helper_final'][h] == W and inside(W, word['helper_final'][h]), ('coupled lowered helper_final', h)) + pm.require(not lowered_fit(x, {'coupled_586': (COUPLED_LOWERED['586'], [586]), 'coupled_588': (COUPLED_LOWERED['588'], [588])}), + 'every gate touching 586 or 588 fits its lowered rank-7 end frame') + return x, ledger + + +def stages(parent, record, transforms, rewrites, edits_spec=None, declared=None): + """All intermediate words: [stage 1, stage-2 step 1..5, stage 3] (+ [stage 4] if edits_spec is given).""" + pm.require(len(parent['helper_final']) == PARENT_BUFFERS, 'PR2942 cold endpoint count') + pm.require(parent['report']['local_profile'] == PARENT_PROFILE and + parent['report']['width_inventory'] == PARENT_INVENTORY, 'PR2942 local profile and inventory') + pm.require(tuple(t['helper'] for t in transforms) == HELPERS and [t['step'] for t in transforms] == [1, 2, 3, 4, 5], 'declared stage-2 order') + words = [lower_end_frames(parent, record)] + for t in transforms: + words.append(apply_stage(words[-1], t)) + pm.require(words[-1]['report']['local_profile'] == STAGE2_PROFILE and words[-1]['report']['width_inventory'] == INVENTORY, 'stage-2 invoice') + words.append(apply_rewrites(words[-1], rewrites)[0]) + if edits_spec is not None: + words.append(apply_declared_edits(words[-1], edits_spec, declared)[0]) + return words + + +def apply(parent, record, transforms, rewrites, edits_spec=None, declared=None): + x = stages(parent, record, transforms, rewrites, edits_spec, declared)[-1] + lowered = {str(h): W for W, hs in GROUPS.values() for h in hs} + if edits_spec is None: + pm.require(all(x['helper_final'].get(h) == lowered.get(h, U) for h, U in parent['helper_final'].items()), + 'inherited endpoints retained, the 22 grouped ones lowered to their group subspace') + pm.require(len(x['helper_final']) == BUFFERS, 'all five added buffers charged') + pm.require(x['report']['local_profile'] == PROFILE and x['report']['width_inventory'] == INVENTORY, 'complete local profile and inventory') + else: + lowered.update(COUPLED_LOWERED) + pm.require(all(x['helper_final'].get(h) == lowered.get(h, U) for h, U in parent['helper_final'].items()), + 'inherited endpoints retained, the 24 lowered ones at their rank-7 subspaces') + pm.require(len(x['helper_final']) == BUFFERS, 'all five added buffers charged') + pm.require(x['report']['local_profile'] == FINAL_PROFILE and x['report']['width_inventory'] == FINAL_INVENTORY, 'complete stage-4 profile and inventory') + return x + + +def _cli_check(): + import argparse, contextlib, gzip, hashlib, io, json, tempfile + from pathlib import Path + ap = argparse.ArgumentParser(description='Rebuild and verify all four producer stages (PARENT -> WORD -> FINAL-WORD).') + ap.add_argument('--check', action='store_true', help='Verify complete producer reconstruction and exact audit of final words') + ap.add_argument('--work', type=Path, default=None, help='Optional working directory for audit outputs') + a = ap.parse_args() + root = Path(__file__).resolve().parent + import audit_local as aud + + def read_f(p): + b = p.read_bytes() + return json.loads(gzip.decompress(b) if b[:2] == b'\x1f\x8b' else b) + + def sha_f(p): + return hashlib.sha256(p.read_bytes()).hexdigest() + + record = read_f(root / 'data/STAGE1-FRAME-EDITS.json') + transforms = [read_f(root / f'data/TRANSFORM-{h}.json') for h in HELPERS] + rewrites = read_f(root / 'data/REWRITES-2957.json') + edits_doc = read_f(root / 'edits/EDITS.json') + + def run_in(out_dir): + summary = {} + for tag in ('base', 'extra'): + parent = read_f(root / f'data/PARENT-{tag}.json.gz') + word3 = read_f(root / f'data/WORD-{tag}.json.gz') + word4 = read_f(root / f'edits/FINAL-WORD-{tag}.json.gz') + chain = stages(parent, record, transforms, rewrites, edits_doc['edits'][tag], edits_doc['declared']) + pm.require(chain[-2] == apply(parent, record, transforms, rewrites) == word3, f'{tag}: stage-3 word matches data/WORD-{tag}.json.gz') + pm.require(chain[-1] == apply(parent, record, transforms, rewrites, edits_doc['edits'][tag], edits_doc['declared']) == word4, + f'{tag}: stage-4 word matches edits/FINAL-WORD-{tag}.json.gz') + gz_path = out_dir / f'final-{tag}.json.gz' + gz_path.write_bytes(gzip.compress(json.dumps(word4, separators=(',', ':')).encode(), mtime=0)) + with contextlib.redirect_stdout(io.StringIO()): + res = aud.run(gz_path, out_dir / f'final-{tag}.json') + pm.require(res['status'] == 'PASS_INDEPENDENT_EXACT_BORROWING_WORD' and res['orientations'] == {'forward': 'PASS', 'dual': 'PASS'}, + f'{tag}: exact audit pass') + summary[tag] = { + 'parent_sha256': sha_f(root / f'data/PARENT-{tag}.json.gz'), + 'stage3_word_sha256': sha_f(root / f'data/WORD-{tag}.json.gz'), + 'final_word_sha256': sha_f(root / f'edits/FINAL-WORD-{tag}.json.gz'), + 'audit': res['status'], + 'local_profile': word4['report']['local_profile'], + 'width_inventory': word4['report']['width_inventory'], + } + print('PASS_PRODUCER_CHECK', json.dumps(summary, sort_keys=True), flush=True) + + if a.work is not None: + out = a.work.resolve() + out.mkdir(parents=True, exist_ok=True) + run_in(out) + else: + with tempfile.TemporaryDirectory(prefix='rank7-producer-check-') as td: + run_in(Path(td)) + + +if __name__ == '__main__': + _cli_check() diff --git a/research/rank7-coupled-586-588-carrier-fold/reproduce.py b/research/rank7-coupled-586-588-carrier-fold/reproduce.py new file mode 100644 index 0000000000..523f30e741 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/reproduce.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Exact Git exports, PR2917's declared source stages, the rank7-joint-endframes overlay, fresh native chains and complete +admission of this package's three-stage words (PR2942's words + joint rank-7 end frames + five paired extractions + +PR2957's fourteen declared rewrites) with a new literal T74 allocation, against Dugongue's PR2969 headline. + +The recipe is our PR2942 reproduce.py (itself PR2917's reproduce.py by Mason Hale, with PR2908's stage/native/release +mechanisms by Jeremy Diviney and the credited upstream lineage, as generalized by PR2930), with these changes: +(1) after PR2917's paired-extension stage, tools/build_overlay.py appends the stage 'rank7-joint-endframes' to PR2917's +derived source: the exact edit spec PR2917 word -> this package's word (tools/wordedit.py, cleanup re-derived), replayed +by the source's own rebuild chain with guards for lowered endpoints and moved warp positions, so every previous state +stays in the audit chain; (2) the closed adapters are derived for 91 private buffers and six width classes with the PR2917, +PR2966 and PR2969 headlines as pinned comparators (tools/derive_adapters.py); (3) the admission uses this package's +allocation/ and compares against PR2969. PR2942 (parent words), PR2957 (rewrite applier), PR2966 and PR2969 (comparators) +are exported from their exact commits and checked byte for byte. No network fetch is performed: the commits below must be +present in --repo (see README). Fresh retained bootstrap is the default; --retained explicitly reuses a completely +authenticated cache. Marius-Paul Dumitrean, with substantial AI assistance (Claude Code). +""" +import argparse, hashlib, io, json, os, shutil, subprocess, sys, tarfile, time +from fractions import Fraction as Q +from pathlib import Path, PurePosixPath + +P = Path(__file__).resolve().parent +PR2908 = ('51309592971e3b5be935599eed2a95404dc7781e', 'research/two-sided-helper-extraction', + '9dba3fe371602ec023a54e26c0fd66f69eb7a74be86aab89923529083c14b36f') +PR2917 = ('224bd5e56041c40078ff6b5fa7393733a215de5c', 'research/paired-helper-extension', + '55c46ddf2e3edc87dfe1ba3320947466d36980d457eb37f6cd6fba341dae0192') +PR2942 = ('a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf', 'research/paired-extension-normal45', + '23bd270f440c4c7ad0d106990ae391e1af799a61ef3601d00e27f1824ae8ba69') +PR2957 = ('b74b25f3ccc84c16e1a801d73b2f47e5ea764c78', 'research/paired-extension-cap-fill-swaps', + '9cd226a2bf7391e7fbf4a23741bb1934afafbd596aef06f2999a935cd6e44e28') +PR2966 = ('e62d3eb9005117d82a9babcfa937ecc53237c490', 'research/paired-extension-normal45-rewrites', + '9e410c244efb370e20a5f9dc366550e11bcb14ebcecf8f2cb850512e82573914') +PR2969 = ('e2ca469b08385d3d5e29a918d66dbefaf889e9f3', 'research/paired-swap-normal45', + '797c55c560dec5b5a657296f49d918fc5db708b7bed3eba046b3358b1666e55b') +PR2917_SOURCE = '98d57c82a1c7318be3c330c3b66897844d57232f0aaeaea88fb4bebd0a1bedf1' # PR2917 derived source, 632 files +# PR2917's derived source plus the stage rank7-joint-endframes (637 files), deterministic from this package +OVERLAY_SOURCE = '751b46364742cbb947f7db07c130ff09085b38b52c520d3b47f2dadc1e21ba80' +# PR2979's overlay plus the stage declared-edit-list (tools/build_edits.py), deterministic from this package +EDIT_SOURCE = 'fa3e2d855ac5298ecc849e596d79dcef7a72668a276b6524585bc0cd616ce474' +STAGE, PROFILE, COMMIT = 'rank7-joint-endframes', 'rank7-joint-endframes', 'rank7-joint-endframes-pr2917' + +def sha(p): + return hashlib.sha256(p.read_bytes()).hexdigest() + +def read(p): + return json.loads(p.read_bytes()) + +def save(p, value): + p.write_text(json.dumps(value, indent=2, sort_keys=True) + '\n') + +def tree(p): + assert not any(f.is_symlink() for f in p.rglob('*')) + return {f.relative_to(p).as_posix(): sha(f) for f in p.rglob('*') if f.is_file() and f != p / 'MANIFEST.json'} + +def export(repo, head, package, manifest, out): + prefix = PurePosixPath(package) + raw = subprocess.run(['git', '-C', str(repo), 'archive', '--format=tar', head, str(prefix)], + check=True, capture_output=True).stdout + out.mkdir() + with tarfile.open(fileobj=io.BytesIO(raw), mode='r:') as archive: + for member in archive.getmembers(): + path = PurePosixPath(member.name) + assert not path.is_absolute() and '..' not in path.parts and '\\' not in member.name + if member.isdir() and (path == prefix or path in prefix.parents): + continue + assert path.is_relative_to(prefix) and (member.isfile() or member.isdir()) + dest = out / path.relative_to(prefix) + if member.isdir(): + dest.mkdir(parents=True, exist_ok=True) + else: + dest.parent.mkdir(parents=True, exist_ok=True) + dest.write_bytes(archive.extractfile(member).read()) + assert sha(out / 'MANIFEST.json') == manifest, 'exact exported package manifest ' + package + assert tree(out) == read(out / 'MANIFEST.json'), 'complete exported inventory ' + package + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + for name in ('repo', 'work'): + ap.add_argument('--' + name, type=Path, required=True) + ap.add_argument('--retained', type=Path) + ap.add_argument('--jobs', type=int, default=1, choices=(1, 2, 3)) + ap.add_argument('--dry-run', action='store_true') + args = ap.parse_args() + if not __debug__: + raise SystemExit('refusing python -O: the inherited validators rely on assertions') + work, repo = args.work.resolve(), args.repo.resolve() + assert not work.exists() and not work.is_relative_to(P) and not P.is_relative_to(work) + pins = read(P / 'MANIFEST.json') + assert tree(P) == pins, 'complete public package inventory' + work.mkdir(parents=True) + parent, extension, normal45, swaps, rewrites, frontier = [work / n for n in ('pr2908', 'pr2917', 'pr2942', 'pr2957', 'pr2966', 'pr2969')] + for spec, out in ((PR2908, parent), (PR2917, extension), (PR2942, normal45), (PR2957, swaps), (PR2966, rewrites), (PR2969, frontier)): + export(repo, *spec, out) + for tag in ('base', 'extra'): + assert sha(P / f'data/PARENT-{tag}.json.gz') == sha(normal45 / f'data/WORD-{tag}.json.gz'), 'parents are PR2942s words' + for name in ('structure.py', 'vendor/audit_local.py', 'vendor/preload_move.py'): + assert sha(P / name) == sha(extension / name), 'vendored byte-identical from PR2917: ' + name + assert sha(P / 'vendor/declared_rewrites.py') == sha(swaps / 'rewrite/declared_rewrites.py'), 'PR2957 applier byte-identical' + assert sha(P / 'allocation/baseline/CLAIM.json') == sha(frontier / 'CLAIM.json'), 'moment baseline is PR2969s headline' + for name in ('ORDER.json', 'PROFILE.json'): + assert sha(P / 'allocation/baseline' / name) == sha(frontier / 'allocation' / name), 'PR2969 baseline ' + name + for name, src in (('PR2942', normal45), ('PR2957', swaps), ('PR2966', rewrites)): + assert sha(P / f'comparators/{name}-CLAIM.json') == sha(src / 'CLAIM.json'), 'comparator ' + name + words = work / 'candidate-words' + words.mkdir() + for tag in ('base', 'extra'): + shutil.copy2(P / f'data/WORD-{tag}.json.gz', words / f'WORD-{tag}.json.gz') + upstream = work / 'parent-export/pr2894' + core = upstream / 'vendor/pr2857' + source = work / 'pr2833' + four, preload, channel, final, overlay, edited = [work / n for n in ('source4', 'source-pm', 'source2908', 'source', 'source-rank7', 'source-edits')] + native, candidate, adapters = [work / n for n in ('native', 'candidate', 'adapters')] + retained = args.retained.resolve() if args.retained else work / 'retained' + if args.retained: + assert not retained.is_relative_to(work) and not work.is_relative_to(retained) + py = [sys.executable, '-B'] + recipe = [ + ('export-pr2894', py + [parent / 'reproduce.py', '--repo', repo, '--work', work / 'parent-export', '--dry-run']), + ('export-pr2833', py + [upstream / 'tools/materialize_source.py', '--repo', repo, '--out', source]), + ] + if not args.retained: + recipe.append(('fresh-retained-bootstrap', py + [upstream / 'tools/prepare_retained.py', '--source', source, '--out', retained, '--jobs', '1'])) + recipe += [ + ('four-kernel-stage', py + [core / 'build_overlay.py', '--source', source, '--generator', core / 'shared_kernel.py', '--review', core / 'review_four_groups.py', '--candidate-dir', core / 'words', '--out', four]), + ('preload-stage', py + [upstream / 'vendor/pm/build_pm_overlay.py', '--overlay', four, '--pm-dir', upstream / 'vendor/pm', '--out', preload]), + ('parent-paired-stage', py + [parent / 'tools/build_channel_overlay.py', '--source', preload, '--local-package', parent, '--out', channel]), + ('paired-extension-stage', py + [extension / 'tools/build_extension.py', '--source', channel, '--local-package', extension, '--out', final]), + ('rank7-overlay-stage', py + [P / 'tools/build_overlay.py', '--source', final, '--candidate-dir', words, '--out', overlay, '--stage-name', STAGE]), + ('declared-edit-stage', py + [P / 'tools/build_edits.py', '--source', overlay, '--local-package', P, '--out', edited]), + ('derive-closed-adapters', py + [P / 'tools/derive_adapters.py', '--parent-package', parent, '--source', edited, '--retained-receipt', retained / 'NATIVE-RECEIPT.json', '--out', adapters, + '--buffers', '91', '--source-commit', COMMIT, '--source-profile', PROFILE, '--upstream-head', PR2917[0], + '--comparison', 'pr2917=' + str(extension / 'CLAIM.json'), '--comparison', 'pr2966=' + str(rewrites / 'CLAIM.json'), + '--comparison', 'pr2969=' + str(frontier / 'CLAIM.json')]), + ('fresh-current-native', py + [adapters / 'prepare_extension_native.py', '--source', edited, '--retained-cache', retained / 'native-cache', '--retained-receipt', retained / 'NATIVE-RECEIPT.json', '--out', native, '--jobs', str(min(2, args.jobs))]), + ('complete-admission', py + [adapters / 'admit_extension.py', '--source', edited, '--fill', P / 'allocation/FILL.json.gz', '--order', P / 'allocation/ORDER.json', '--dispatch', P / 'allocation/DISPATCH.json', + '--native-cache', native / 'native-cache', '--native-receipt', native / 'NATIVE-RECEIPT.json', '--work', candidate, '--replica-helper-dir', core / 'vendor/pr2839', + '--reconstructor', core / 'vendor/pr2839/reconstruct_replica.py', '--blocknorm-checker', adapters / 'extension_blocknorm.py', + '--comparison-claim', frontier / 'CLAIM.json', '--source-profile', PROFILE, '--comparison-profile', 'pr2969', '--jobs', str(args.jobs)]), + ] + if args.dry_run: + save(work / 'PREFLIGHT.json', {'status': 'EXACT_EXPORTS_AND_RECIPE_ONLY_NOT_A_REPLAY', 'commands': [[n, list(map(str, c))] for n, c in recipe]}) + print('PASS_PINNED_PR2908_PR2917_PR2942_PR2957_PR2966_PR2969_EXPORT_RECIPE_ONLY') + return + env = dict(os.environ, PYTHONDONTWRITEBYTECODE='1', PYTHONPYCACHEPREFIX=str(work / 'bytecode'), + OPENBLAS_NUM_THREADS='1', OMP_NUM_THREADS='1', PYTHONINTMAXSTRDIGITS='0') + for name in ('PYTHONOPTIMIZE', 'PYTHONPATH', 'WITNESS_SPEC', 'WITNESS_RECORD', 'WITNESS_DISCOVER'): + env.pop(name, None) + # Windows: text-mode writes would turn the overlay's LF files into CRLF; the stage builders must write LF. + adapter = work / 'process-lf-adapter' + adapter.mkdir() + (adapter / 'sitecustomize.py').write_text("from pathlib import Path\n_w = Path.write_text\ndef _t(self, data, encoding=None, errors=None, newline=None):\n return _w(self, data, encoding=encoding, errors=errors, newline='\\n' if newline is None else newline)\nPath.write_text = _t\n", encoding='utf-8', newline='\n') + env['PYTHONPATH'] = str(adapter) + stages = [] + for name, command in recipe: + if name == 'rank7-overlay-stage': + assert sha(final / 'MANIFEST.json') == PR2917_SOURCE, 'derived source equals PR2917s' + log, start = work / (name + '.log'), time.monotonic() + with log.open('w') as stream: + result = subprocess.run(list(map(str, command)), env=env, cwd=work, stdin=subprocess.DEVNULL, + stdout=stream, stderr=subprocess.STDOUT) + stages.append({'stage': name, 'exit_code': result.returncode, 'seconds': time.monotonic() - start, 'log_sha256': sha(log)}) + save(work / 'STAGES.json', stages) + assert result.returncode == 0, 'failed ' + name + '; see ' + str(log) + if name == 'rank7-overlay-stage': + derivation = read(work / 'source-rank7-DERIVATION.json') + assert derivation['stage'] == STAGE and derivation['buffers'] == 91 and derivation['upstream_manifest_sha256'] == PR2917_SOURCE + assert sha(overlay / 'MANIFEST.json') == derivation['derived_manifest_sha256'] == OVERLAY_SOURCE, 'derived rank-7 overlay' + if name == 'declared-edit-stage': + derivation = read(work / 'source-edits-DERIVATION.json') + assert derivation['parent_manifest_sha256'] == OVERLAY_SOURCE + assert sha(edited / 'MANIFEST.json') == derivation['manifest_sha256'] == EDIT_SOURCE, 'derived declared-edit source' + print('PASS', name, flush=True) + admission = read(candidate / 'RESULT.json') + receipt = read(candidate / 'release/RELEASE-RECEIPT.json') + claim = read(P / 'CLAIM.json') + assert admission['status'] == 'PASS_REPLICA_ORDER_FILL_DERIVATIVE_COMPLETE_RELEASE' + assert receipt['status'] == 'PASS_RELEASE' + assert Q(admission['kappa']) == Q(receipt['kappa_decimal']) == Q(claim['kappa']) + assert Q(admission['comparison_kappa']) == Q(read(frontier / 'CLAIM.json')['kappa']) == Q(claim['baseline_kappa']) < Q(admission['kappa']) + assert admission['release_receipt_sha256'] == sha(candidate / 'release/RELEASE-RECEIPT.json') + assert admission['package_manifest_sha256'] == receipt['manifest_sha256'] + assert admission['source_manifest_sha256'] == EDIT_SOURCE + assert admission['fill_sha256'] == sha(P / 'allocation/FILL.json.gz') + assert tree(P) == pins and all(tree(x) == read(x / 'MANIFEST.json') for x in (parent, extension, normal45, swaps, rewrites, frontier)) + save(work / 'RESULT.json', {'status': 'PASS_RANK7_EDITS_COMPLETE_REPLAY', 'kappa': admission['kappa'], 'gain': admission['gain'], + 'comparison_pr': 2969, 'pr2917_source_manifest_sha256': sha(final / 'MANIFEST.json'), + 'rank7_source_manifest_sha256': sha(overlay / 'MANIFEST.json'), + 'source_manifest_sha256': sha(edited / 'MANIFEST.json'), + 'native_receipt_sha256': sha(native / 'NATIVE-RECEIPT.json'), + 'admission_result_sha256': sha(candidate / 'RESULT.json'), + 'explicit_retained_reuse': bool(args.retained), 'fresh_retained_bootstrap': not bool(args.retained), + 'stages': stages, 'scope': 'Conditional finite supplier/outer result; inherited all-size theorem obligations remain.'}) + print('PASS_RANK7_EDITS_COMPLETE_REPLAY', admission['kappa'], flush=True) + +if __name__ == '__main__': + main() diff --git a/research/rank7-coupled-586-588-carrier-fold/run_registered.py b/research/rank7-coupled-586-588-carrier-fold/run_registered.py new file mode 100644 index 0000000000..c6c172d0e8 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/run_registered.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Bounded registered check: package pins; the exact local replay of the four declared stages (verify.py); literal owners, +private stock, controls and exact moment against PR2969 (check_allocation.py); the Fractions-only cap certificates of every +stage, the literal gap and the exact comparisons (check_cap.py); independent review of the four declared edits (edits_review.py); +and binding of the stored receipts to the exact words, overlay, allocation and claim. +""" +import hashlib, json, os, subprocess, sys, tempfile +from fractions import Fraction as Q +from pathlib import Path + +P = Path(__file__).resolve().parent +PR2969_HEAD = 'e2ca469b08385d3d5e29a918d66dbefaf889e9f3' +PR2917_DERIVED_SOURCE = '98d57c82a1c7318be3c330c3b66897844d57232f0aaeaea88fb4bebd0a1bedf1' +PR2917_WORDS = {'base': 'fec3c120db1a35022944628d34b56a36f2456248c274c2eaba1a325cdc690ce8', + 'extra': 'e4d0c617df85bf8a824ff68310ca3373dc017c1ebf9ea733056a3ee4a784b36f'} # the overlay's spec source words +OVERLAY_SOURCE = '751b46364742cbb947f7db07c130ff09085b38b52c520d3b47f2dadc1e21ba80' +STAGE = 'rank7-joint-endframes' + +def read(p): + return json.loads(p.read_bytes()) + +def sha(p): + return hashlib.sha256(p.read_bytes()).hexdigest() + +def tree(): + assert not any(f.is_symlink() for f in P.rglob('*')) + return {f.relative_to(P).as_posix(): sha(f) for f in P.rglob('*') + if f.is_file() and '__pycache__' not in f.parts and f != P / 'MANIFEST.json'} + +def main(): + if not __debug__: + raise SystemExit('refusing python -O: this check relies on assertions') + pins = read(P / 'MANIFEST.json') + assert tree() == pins, 'complete package inventory' + with tempfile.TemporaryDirectory(prefix='rank7-replay-') as tmp: + out = Path(tmp) + env = dict(os.environ, PYTHONDONTWRITEBYTECODE='1', OPENBLAS_NUM_THREADS='1', OMP_NUM_THREADS='1') + for key in ('PYTHONOPTIMIZE', 'PYTHONPATH', 'WITNESS_SPEC', 'WITNESS_RECORD', 'WITNESS_DISCOVER'): + env.pop(key, None) + for script, name in [('verify.py', 'local'), ('check_allocation.py', 'owners')]: + log = out / (name + '.log') + with log.open('w') as stream: + r = subprocess.run([sys.executable, '-B', str(P / script), '--work', str(out / name)], + env=env, stdin=subprocess.DEVNULL, stdout=stream, stderr=subprocess.STDOUT) + if r.returncode: + print(log.read_text()[-8000:]); raise SystemExit(r.returncode) + print('PASS', script, log.read_text().strip().splitlines()[-1][:160], flush=True) + r = subprocess.run([sys.executable, '-B', str(P / 'check_cap.py')], env=env, stdin=subprocess.DEVNULL, + capture_output=True, text=True) + if r.returncode: + print(r.stdout[-4000:], r.stderr[-4000:]); raise SystemExit(r.returncode) + cap = json.loads(r.stdout.strip().splitlines()[-1]) + print('PASS check_cap.py', cap['status'], 'gap', cap['gap_float'], flush=True) + ereview_dir = out / 'edits-review' + log = out / 'edits-review.log' + with log.open('w') as stream: + r = subprocess.run([sys.executable, '-B', str(P / 'edits/edits_review.py'), '--source-dir', str(P / 'vendor'), + '--parent-base', str(P / 'data/WORD-base.json.gz'), '--parent-extra', str(P / 'data/WORD-extra.json.gz'), + '--candidate-base', str(P / 'edits/FINAL-WORD-base.json.gz'), '--candidate-extra', str(P / 'edits/FINAL-WORD-extra.json.gz'), + '--edits', str(P / 'edits/EDITS.json'), '--out-dir', str(ereview_dir)], + env=env, stdin=subprocess.DEVNULL, stdout=stream, stderr=subprocess.STDOUT) + if r.returncode: + print(log.read_text()[-8000:]); raise SystemExit(r.returncode) + print('PASS edits_review.py', log.read_text().strip().splitlines()[-1][:160], flush=True) + ereview = read(ereview_dir / 'REVIEW.json') + local = read(out / 'local/RESULT.json') + owner = read(out / 'owners/RESULT.json') + claim = read(P / 'CLAIM.json') + admit = read(P / 'evidence/ADMISSION-RESULT.json') + release = read(P / 'evidence/RELEASE-RECEIPT.json') + native = read(P / 'evidence/FULL-NATIVE-RECEIPT.json') + overlay = read(P / 'evidence/OVERLAY-DERIVATION.json') + edits = read(P / 'evidence/EDITS-DERIVATION.json') + ereview_stored = read(P / 'evidence/EDITS-REVIEW.json') + adapters = read(P / 'evidence/ADAPTER-DERIVATION.json') + replay = read(P / 'evidence/FULL-REPLAY-RESULT.json') + baseline = read(P / 'allocation/baseline/CLAIM.json') + assert claim['status'] == 'CONDITIONAL_CANDIDATE_COMPLETE_FINITE_RELEASE' + assert local['status'] == 'PASS_RANK7_JOINT_ENDFRAMES_THREE_STAGE_REPLAY' and local['control_counts'] == {'stage1': 20, 'stage2': 52, 'stage3': 14, 'stage4': 14} + assert ereview['status'] == 'PASS_INDEPENDENT_EDIT_REVIEW' == ereview_stored['status'] and ereview == ereview_stored + assert owner['status'] == 'PASS_RANK7_LITERAL_OWNERS_AND_EXACT_MOMENT' and len(owner['controls']) == 5 + assert cap['status'] == 'PASS_LITERAL_ALLOCATION_BELOW_FIXED_INVENTORY_CAP_WITH_RECORDED_GAP' + assert admit['status'] == 'PASS_REPLICA_ORDER_FILL_DERIVATIVE_COMPLETE_RELEASE' + assert release['status'] == 'PASS_RELEASE' and replay['status'] == 'PASS_RANK7_EDITS_COMPLETE_REPLAY' + k = Q(claim['kappa']) + assert Q(owner['moment']['target']) == k == Q(admit['kappa']) == Q(release['kappa_decimal']) == Q(replay['kappa']) == Q(cap['headline']) + assert Q(claim['complex_lower']) == Q(admit['complex_lower']) <= Q(cap['literal_lower']) + assert k == Q(claim['complex_lower']) - Q(1, 10 ** 46) - Q(1, 10 ** 70) + assert Q(cap['cap_lower']) == Q(claim['fixed_inventory_cap']['cap_lower']) and Q(cap['gap_lower']) > 0 + assert owner['profile'] == claim['profile'] == admit['profile'] == cap['profile'] + assert owner['physical'] == claim['physical_families'] == 66813 and claim['zero_buffers'] == 91 + assert release['manifest_sha256'] == admit['package_manifest_sha256'] == claim['admitted_package_manifest_sha256'] + assert native['status'] == 'PASS_COMPOSED_FRESH_NATIVE_PROVIDERS_AND_AUTHENTICATED_CACHE' + assert native['fresh_current_provider_count'] == 2 and set(native['providers']) == {'base', 'extra'} + assert claim['release_receipt_sha256'] == admit['release_receipt_sha256'] == sha(P / 'evidence/RELEASE-RECEIPT.json') + assert claim['native_receipt_sha256'] == admit['native_receipt_sha256'] == sha(P / 'evidence/FULL-NATIVE-RECEIPT.json') + assert overlay['stage'] == STAGE and overlay['upstream_manifest_sha256'] == PR2917_DERIVED_SOURCE and overlay['buffers'] == 91 + assert edits['status'] == 'PASS_SOURCE_BOUND_DECLARED_EDIT_OVERLAY' and edits['parent_manifest_sha256'] == overlay['derived_manifest_sha256'] == OVERLAY_SOURCE + assert claim['declared_edits']['edits_sha256'] == sha(P / 'edits/EDITS.json') + assert claim['source_manifest_sha256'] == edits['manifest_sha256'] == native['manifest_sha256'] == admit['source_manifest_sha256'] == adapters['source_manifest_sha256'] + assert adapters['buffer_count'] == 91 and 'pr2969' in adapters['comparisons'] and adapters['admission_controls'] == 139 + assert admit['comparison_pr'] == 2969 and admit['comparison_head'] == PR2969_HEAD == claim['baseline_head'] + assert admit['comparison_claim_sha256'] == sha(P / 'allocation/baseline/CLAIM.json') + assert Q(claim['baseline_kappa']) == Q(admit['comparison_kappa']) == Q(baseline['kappa']) == Q(owner['moment']['previous']) + assert Q(claim['gain']) == Q(admit['gain']) == k - Q(baseline['kappa']) > 0 + for name, row in claim['previous_claims'].items(): + assert Q(row['gain']) == k - Q(row['kappa']) == Q(cap['comparisons'][name]['gain']) > 0, name + for tag in ('base', 'extra'): + word = sha(P / f'data/WORD-{tag}.json.gz') + final = sha(P / f'edits/FINAL-WORD-{tag}.json.gz') + assert native['providers'][tag]['word_sha256'] == final == edits['words'][tag]['word_sha256'] + assert edits['words'][tag]['parent_sha256'] == word == overlay['words'][tag]['candidate_word_sha256'] + assert overlay['words'][tag]['source_word_sha256'] == PR2917_WORDS[tag] + assert admit['fill_sha256'] == sha(P / 'allocation/FILL.json.gz') == claim['fill_sha256'] + assert admit['order_sha256'] == sha(P / 'allocation/ORDER.json') + assert admit['dispatch_sha256'] == sha(P / 'allocation/DISPATCH.json') + assert tree() == pins + print('PASS_RANK7_JOINT_ENDFRAMES_LOCAL_OWNER_MOMENT_CAP_AND_STORED_RELEASE', claim['kappa_decimal'][:40], 'gain over PR2969', float(Q(claim['gain']))) + print('Native and full integrated admission are authenticated stored evidence here; reproduce.py reruns them.') + +if __name__ == '__main__': + main() diff --git a/research/rank7-coupled-586-588-carrier-fold/structure.py b/research/rank7-coupled-586-588-carrier-fold/structure.py new file mode 100644 index 0000000000..8d5bd544ee --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/structure.py @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Exact two-sided subspace certificate, independent of the word producer.""" +from collections import defaultdict +from fractions import Fraction as Q + +def check(parent,transform,aud): + h=transform['helper'];live=sorted(set(range(704))-set(parent['removed'])-set(range(112,224))) + S={r:{r:Q(1)} for r in live};T={r:{r:Q(1)} for r in live} + for g in transform['before']:aud.apply(g,S) + for g in transform['after']:aud.apply(g,T) + v={r:row[h] for r,row in S.items() if h in row};alpha=T[h] + J={r:{r:Q(1)} for r in live} + for g in reversed(transform['after']):aud.apply(aud.invert(g),J) + y={r:row[h] for r,row in J.items() if h in row} + M={r:{(r,()):Q(1)} for r in live};program=list(parent['A'][parent['prelude_events']:]);bypos=defaultdict(list) + for op,rec in enumerate(parent['warps'],1):bypos[rec[0]].append(['warp',rec[1],op]) + for p in range(len(parent['B'])+1): + program+=bypos[p] + if p=224 and r not in protected} + assert set(v)<=H and all(r in H and not ops for r,ops in u) + u={r:c for (r,ops),c in u.items()} + for r,row in M.items(): + mv=defaultdict(Q) + for (c,ops),a in row.items():mv[ops]+=a*v.get(c,Q(0)) + assert {ops:a for ops,a in mv.items() if a}==({():y[r]} if r in y else {}) + assert sum(alpha.get(r,Q(0))*c for r,c in y.items())==1 + us=defaultdict(Q) + for r,a in u.items(): + for c,b in S[r].items():us[c]+=a*b + assert {r:c for r,c in us.items() if c}=={h:Q(1)} + assert all(sum(row.get(c,Q(0))*a for c,a in y.items())==(1 if r==h else 0) for r,row in T.items()) + return {'status':'PASS_EXACT_TWO_SIDED_SUBSPACE_CERTIFICATE','helper':h,'v':{str(r):str(c) for r,c in v.items()},'u':{str(r):str(c) for r,c in u.items()},'alpha':{str(r):str(c) for r,c in alpha.items()},'y':{str(r):str(c) for r,c in y.items()},'identities':['S e_h = v','u S = e_h^T','M v = y','alpha M = u','alpha y = 1','T y = e_h','e_h^T T = alpha'],'scope':'Exact free-operator identities before target writes; full target correctness checked separately.'} diff --git a/research/rank7-coupled-586-588-carrier-fold/tools/audit_allocation_moment.py b/research/rank7-coupled-586-588-carrier-fold/tools/audit_allocation_moment.py new file mode 100644 index 0000000000..623ae14fbe --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/tools/audit_allocation_moment.py @@ -0,0 +1,83 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Independent dyadic interval moment auditor, atlas D020. +Retained PR2908 arithmetic by Jeremy Diviney and its credited upstream authors; +Mason Hale with OpenAI Codex assistance changes only the authenticated baseline. +Marius-Paul Dumitrean (Claude Code assisted) changes only the authenticated baseline, to the PR2917 headline (PR2930), +to the PR2930 headline (PR2942) and here to Dugongue's PR2969 moment nomination (its T370 ORDER/PROFILE). +Uses only Python integers/Fraction; imports no inherited numerical implementation. +This authenticates a paid histogram and its root, not a physical realization. +""" +from fractions import Fraction as F +from pathlib import Path +from functools import lru_cache +from collections import Counter +import argparse,json,hashlib + +BITS=192 +SCALE=1<=1,'log domain');k=0 + while q>2:q/=2;k+=1 + def unit(y): + z=(y-1)/(y+1);z2=z*z;term=z;value=F(0) + for j in range(128): + value+=term/(2*j+1);term*=z2 + remainder=2*term/(257*(1-z2)) + return 2*value,2*value+remainder + l,u=unit(q);l2,u2=unit(F(2));return down(l+k*l2),up(u+k*u2) +def exp_bounds(y): + need(0<=y0,'profile domain');l,u=log_bounds(F(73,rank));a=exp_bounds(b*l)[0];z=exp_bounds(b*u)[1];weight=F(rank*count,73*W);lo+=weight*a;hi+=weight*z + return down(lo),up(hi) +def run(candidate,source): + import sys + if hasattr(sys,'set_int_max_str_digits'):sys.set_int_max_str_digits(0) + need(hashlib.sha256((source/'CLAIM.json').read_bytes()).hexdigest()=='656a4c93411b078753783513e2e71b1722a56e7b70120264a38118811982fa77','exact pinned PR2969 headline nomination') + prof={int(k):v for k,v in json.loads((candidate/'PROFILE.json').read_bytes()).items()} + old={int(k):v for k,v in json.loads((source/'PROFILE.json').read_bytes()).items()} + W=896*(1+max(r for s,r in json.loads((candidate/'ORDER.json').read_bytes()))) + oldW=896*(1+max(r for s,r in json.loads((source/'ORDER.json').read_bytes()))) + need(sum(r*n for r,n in prof.items())==W*73-W*320//896,'new rank mass') + need(sum(r*n for r,n in old.items())==oldW*73-oldW*320//896,'old rank mass') + # No floating endpoint or inherited numerical implementation is used. + q=10**26;lo=0;hi=q//200 + need(moment(prof,F(lo,q),W)[1]<1 and moment(prof,F(hi,q),W)[0]>1,'global root bracket') + while hi-lo>1: + mid=(lo+hi)//2;l,u=moment(prof,F(mid,q),W) + if u<1:lo=mid + elif l>1:hi=mid + else:raise ValueError('interval precision insufficient') + endpoint=F((lo//100),10**24) + target=endpoint-F(1,10**46)-F(1,10**70) + prior=F(json.loads((source/'CLAIM.json').read_bytes())['kappa']) + need(target>prior and target1,'overstated endpoint rejected') + wrong=dict(prof);wrong[32]=wrong.get(32,0)+1 + need(moment(wrong,F(lo,q),W)[0]>1,'omitted rank charge rejected') + import decimal + with decimal.localcontext() as c: + c.prec=80 + todec=lambda x:str(decimal.Decimal(x.numerator)/decimal.Decimal(x.denominator)) + texttarget=todec(target);textgain=todec(target-prior) + return dict(status='PASS_SEPARATE_EXACT_RATIONAL_FRONTIER_MOMENT',lower=str(F(lo,q)),upper=str(F(hi,q)),outer_endpoint=str(endpoint),target=str(target),target_decimal=texttarget,previous=str(prior),gain=str(target-prior),gain_decimal=textgain,W=W,oldW=oldW,normalized_profile_delta=normalized_delta,new_moment_at_full_prior=[str(x)for x in at_old],profile_sha256=hashlib.sha256((candidate/'PROFILE.json').read_bytes()).hexdigest(),baseline_profile_sha256=hashlib.sha256((source/'PROFILE.json').read_bytes()).hexdigest(),baseline_claim_sha256=hashlib.sha256((source/'CLAIM.json').read_bytes()).hexdigest(),method='Independent 128-term atanh / degree24 exponential with explicit positive tails and outward 192-bit dyadic rounding',controls=['zero log/exp identities','overstated endpoint','added rank32 charge'],scope='Complete paid histogram and exact moment only; full native/physical/outer release is separate.') +if __name__=='__main__': + p=argparse.ArgumentParser();p.add_argument('--candidate',type=Path,required=True);p.add_argument('--source',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args() + need(not a.out.exists(),'fresh output required');d=run(a.candidate,a.source);a.out.write_text(json.dumps(d,sort_keys=True,indent=2)+'\n',encoding='utf-8',newline='\n');print(json.dumps({k:d[k]for k in ['status','target_decimal','gain_decimal','lower','upper']})) diff --git a/research/rank7-coupled-586-588-carrier-fold/tools/build_edits.py b/research/rank7-coupled-586-588-carrier-fold/tools/build_edits.py new file mode 100644 index 0000000000..0e49ff53e4 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/tools/build_edits.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Append the declared literal edit-list stage (edits/EDITS.json: R1_E42, R2_E7, B_586_438, B_588_440) to PR2979's rank-7 overlay source. + +Edits R1_E42, R2_E7, B_586_438 and B_588_440 by dcharb78, with AI assistance, extending Stack2979 / Jeremy Kothe's (jeremykothe2, PR3015) +declared edit stage on PR2979's words (mdumitrean). Overlay/rebuild conventions are credited to PR2979/PR2942 (mdumitrean), +PR2908 (jeremydiviney) and PR2917 (mason-hale). +""" +import argparse, gzip, hashlib, json, shutil +from pathlib import Path + +PARENT = '751b46364742cbb947f7db07c130ff09085b38b52c520d3b47f2dadc1e21ba80' + + +def sha(p): return hashlib.sha256(p.read_bytes()).hexdigest() +def read(p): + b = p.read_bytes(); return json.loads(gzip.decompress(b) if p.suffix == '.gz' else b) +def save(p, x): p.write_text(json.dumps(x, indent=2, sort_keys=True) + '\n') +def tree(p): + assert not any(f.is_symlink() for f in p.rglob('*')) + return {f.relative_to(p).as_posix(): sha(f) for f in sorted(p.rglob('*')) if f.is_file() and f != p / 'MANIFEST.json'} + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument('--source', type=Path, required=True) + ap.add_argument('--local-package', type=Path, required=True) + ap.add_argument('--out', type=Path, required=True) + a = ap.parse_args() + src, out, p = a.source.resolve(), a.out.resolve(), a.local_package.resolve() + assert __debug__ and not out.exists() and not out.is_relative_to(src) + assert sha(src / 'MANIFEST.json') == PARENT and tree(src) == read(src / 'MANIFEST.json') + pins = read(p / 'EDIT-PINS.json') + assert all(sha(p / n) == h for n, h in pins.items()) + shutil.copytree(src, out) + local = out / 'new/borrow/edits' + local.mkdir() + shutil.copy2(p / 'edits/EDITS.json', local / 'EDITS.json') + shutil.copy2(p / 'edits/declared_edits.py', out / 'new/borrow/declared_edits.py') + shutil.copy2(p / 'edits/edits_review.py', out / 'new/borrow/edits_review.py') + providers = read(src / 'new/BORROW-PROVIDERS.json') + records = {} + for tag, pid in [('base', 'gauge44'), ('extra', 'extra')]: + q = out / f'new/borrow/words/BORROW-WORD-43{tag}.json.gz' + assert read(q) == read(p / f'data/WORD-{tag}.json.gz'), 'source word is the PR2979 word' + shutil.copy2(q, out / f'new/borrow/inputs/RANK7-WORD-{tag}.json.gz') + shutil.copy2(p / f'edits/FINAL-WORD-{tag}.json.gz', q) + word = read(q) + providers[pid]['widths'] = [len(word['helper_final'].get(str(h), [0] * 9)) - len(word['start_extra'].get(str(h), [])) + for h in sorted(set(range(224, 704)) - set(word['removed']))] + providers[pid]['actual_paid_profile'] = word['report']['local_profile'] + records[tag] = {'parent_sha256': sha(p / f'data/WORD-{tag}.json.gz'), 'word_sha256': sha(q)} + save(out / 'new/BORROW-PROVIDERS.json', providers) + path = out / 'new/rebuild_borrow.py' + text = path.read_text() + anchor = " final=json.loads(gzip.decompress(shipped.read_bytes()))" + assert text.count(anchor) == 1 + block = """ # Declared literal edit list on PR2979's word (R1_E42, R2_E7, B_586_438, B_588_440); compensation, cut, start_extra, removed and private buffer count are unchanged. + import declared_edits + edit_parent=json.loads(gzip.decompress((D/'inputs'/f'RANK7-WORD-{wt}.json.gz').read_bytes())) + assert chain[-1]==edit_parent + edit_word,_=declared_edits.apply(chain[-1],json.loads((D/'edits/EDITS.json').read_text())['edits'][wt],json.loads((D/'edits/EDITS.json').read_text())['declared']) + chain.append(edit_word);steps.append('declared-edit-list') +""" + path.write_text(text.replace(anchor, block + anchor)) + path = out / 'verify.py' + text = path.read_text() + line = next(s for s in text.splitlines() if s.startswith("run('paired-extension-review'")) + assert text.count(line) == 1 + review = ("run('declared-edit-review',P/'new/borrow/edits_review.py','--source-dir',P/'new/borrow'," + "'--parent-base',P/'new/borrow/inputs/RANK7-WORD-base.json.gz','--parent-extra',P/'new/borrow/inputs/RANK7-WORD-extra.json.gz'," + "'--candidate-base',P/'new/borrow/words/BORROW-WORD-43base.json.gz','--candidate-extra',P/'new/borrow/words/BORROW-WORD-43extra.json.gz'," + "'--edits',P/'new/borrow/edits/EDITS.json','--out-dir',work/'declared-edit-review')") + path.write_text(text.replace(line, line + "\n" + review)) + before, after = tree(src), tree(out) + changes = {n: {'before': before.get(n), 'after': after.get(n)} for n in set(before) | set(after) if before.get(n) != after.get(n)} + expected = {'new/BORROW-PROVIDERS.json', 'new/rebuild_borrow.py', 'verify.py', 'new/borrow/declared_edits.py', 'new/borrow/edits_review.py', 'new/borrow/edits/EDITS.json'} + expected |= {f'new/borrow/words/BORROW-WORD-43{tag}.json.gz' for tag in ('base', 'extra')} + expected |= {f'new/borrow/inputs/RANK7-WORD-{tag}.json.gz' for tag in ('base', 'extra')} + assert set(changes) == expected and tree(src) == before + save(out / 'MANIFEST.json', after) + result = {'status': 'PASS_SOURCE_BOUND_DECLARED_EDIT_OVERLAY', 'parent_manifest_sha256': PARENT, 'manifest_sha256': sha(out / 'MANIFEST.json'), + 'source_file_count': len(after), 'changes': changes, 'words': records, 'builder_sha256': sha(Path(__file__))} + save(out.parent / (out.name + '-DERIVATION.json'), result) + print(result['status'], result['manifest_sha256'], len(after), flush=True) + + +if __name__ == '__main__': + main() diff --git a/research/rank7-coupled-586-588-carrier-fold/tools/build_overlay.py b/research/rank7-coupled-586-588-carrier-fold/tools/build_overlay.py new file mode 100644 index 0000000000..74c39e8d33 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/tools/build_overlay.py @@ -0,0 +1,118 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Build a source-bound overlay for a literal word edit on top of PR2917's derived source (manifest 98d57c82..., 632 files). +Stage '' (default rank7-joint-endframes): new/borrow/inputs/wordedit_43{base,extra}.json (exact spec PR2917 word -> candidate +word) applied by new/borrow/wordedit.py (pure producer, re-derives cleanup from helper_final). The shipped words must equal +apply_spec(previous, spec) exactly. Allowed changed sections: warps (B positions only; lender, frames and count fixed), A, B, restore, +compensation, start_extra, report, cleanup, initial_corrections, helper_final (new restored endpoints = extra private buffers; every +inherited endpoint retained or lowered to a subspace of its old end frame); removed is fixed (408 live helpers). The same guards are +patched into the source's own rebuild chain (new/rebuild_borrow.py), which the admission release reruns. +Overlay/rebuild conventions follow Jeremy Diviney's PR2908 builder and Mason Hale's PR2917 build_extension.py; generalized from our +PR2942 tools/build_overlay.py. Marius-Paul Dumitrean, with substantial AI assistance (Claude Code). +Usage: build_overlay.py --source PR2917_DERIVED_SOURCE --candidate-dir DIR_WITH_WORD-{base,extra}.json.gz --out OUT [--stage-name NAME] +""" +import sys +sys.dont_write_bytecode = True +from pathlib import Path +from collections import Counter +import argparse, gzip, hashlib, json, shutil, types +UPSTREAM_MANIFEST = '98d57c82a1c7318be3c330c3b66897844d57232f0aaeaea88fb4bebd0a1bedf1' # PR2917 derived overlay (632 files) +UPSTREAM_FILES = 632 +ALLOWED = {'warps', 'A', 'B', 'restore', 'compensation', 'start_extra', 'report', 'cleanup', 'initial_corrections', 'helper_final'} +def need(ok, why): + if not ok: raise ValueError(why) +def sha(p): return hashlib.sha256(Path(p).read_bytes()).hexdigest() +def sem(v): return hashlib.sha256(json.dumps(v, sort_keys=True, separators=(',', ':')).encode()).hexdigest() +def read(p): + p = Path(p); b = p.read_bytes(); return json.loads(gzip.decompress(b) if p.suffix == '.gz' else b) +def write(p, v): p.write_text(json.dumps(v, sort_keys=True, indent=2) + '\n') +def tree(p): + need(not list(p.rglob('__pycache__')) and not list(p.rglob('*.pyc')), 'no source bytecode or cache folders') + out = {} + for f in sorted(p.rglob('*')): + need(not f.is_symlink(), 'no source symlinks') + if f.is_file() and f != p / 'MANIFEST.json': out[f.relative_to(p).as_posix()] = sha(f) + return out +def find_word(d, tag): + c = [p for p in sorted(Path(d).glob('*.json.gz')) if p.name.endswith('-' + tag + '.json.gz') or p.name == f'WORD-{tag}.json.gz'] + need(len(c) == 1, f'exactly one candidate word for {tag} in {d}: {c}'); return c[0] +def main(): + ap = argparse.ArgumentParser(); ap.add_argument('--source', type=Path, required=True); ap.add_argument('--candidate-dir', type=Path, required=True) + ap.add_argument('--out', type=Path, required=True); ap.add_argument('--producer', type=Path, default=Path(__file__).resolve().parent / 'wordedit.py') + ap.add_argument('--stage-name', default='rank7-joint-endframes'); a = ap.parse_args() + need(not sys.flags.optimize, 'assertions required'); source = a.source.resolve(); out = a.out.resolve() + need(sha(source / 'MANIFEST.json') == UPSTREAM_MANIFEST and tree(source) == read(source / 'MANIFEST.json') and len(read(source / 'MANIFEST.json')) == UPSTREAM_FILES, 'exact PR2917 derived overlay inventory') + need(not out.exists() and not out.is_relative_to(source), 'fresh external overlay'); shutil.copytree(source, out) + # producer module inside the overlay: plain import of word_patch from its own directory (new/borrow); no scratchpad paths + prod = a.producer.read_text() + head, sep, tail = prod.partition('try:\n import word_patch as WP') + need(sep, 'producer import block'); tail = tail.split(' import word_patch as WP\n', 1)[1] + prod = head + 'import word_patch as WP # PR2833 helpers (derive_cleanup), found next to this file inside the overlay\n' + tail + need('/scratchpad/' not in prod and 'import word_patch as WP' in prod, 'producer path relocation'); compile(prod, 'wordedit.py', 'exec') + (out / 'new/borrow/wordedit.py').write_text(prod); PRODUCER_SHA = sha(out / 'new/borrow/wordedit.py') + sys.path.insert(0, str(out / 'new/borrow')) + gen = types.ModuleType('wordedit'); gen.__file__ = str(out / 'new/borrow/wordedit.py'); exec(compile(prod, str(out / 'new/borrow/wordedit.py'), 'exec'), gen.__dict__) + providers = read(source / 'new/BORROW-PROVIDERS.json'); records = {}; buffers = set() + for tag, pid in [('base', 'gauge44'), ('extra', 'extra')]: + src = source / ('new/borrow/words/BORROW-WORD-43' + tag + '.json.gz'); target = find_word(a.candidate_dir, tag); old = read(src); new = read(target) + need(old != new, 'candidate word differs from the PR2917 word ' + tag) + spec = gen.make_spec(old, new); derived = gen.apply_spec(old, spec) + need(derived == new, 'complete producer reconstruction ' + tag) + changed = set(k for k in old if old[k] != new[k]); need(changed <= ALLOWED, 'exact changed sections ' + str(changed)) + need(new['removed'] == old['removed'] and len(new['warps']) == len(old['warps']), 'removed set and warp count unchanged') + need([x[1:] for x in new['warps']] == [x[1:] for x in old['warps']], 'warps: only their B positions may move') + def _span(b): + out = {0} + for v in b: out |= {x ^ v for x in out} + return out + need(all(h in new['helper_final'] and _span(new['helper_final'][h]) <= _span(U) for h, U in old['helper_final'].items()), 'every inherited restored endpoint retained or LOWERED to a subspace') + need(new['cleanup'] == gen.derive_cleanup(new), 'cleanup is the derived inverse of the word with buffers for every endpoint') + live = sorted(set(range(224, 704)) - set(new['removed'])); need(len(live) == 408, 'unchanged helper identities') + widths = [len(new['helper_final'].get(str(h), [0] * 9)) - len(new['start_extra'].get(str(h), [])) for h in live] + need({str(k): v for k, v in Counter(widths).items()} == new['report']['width_inventory'], 'report inventory equals derived widths') + buffers.add(len(new['helper_final'])) + providers[pid] = {'widths': widths, 'actual_paid_profile': new['report']['local_profile']} + shutil.copy2(target, out / ('new/borrow/words/BORROW-WORD-43' + tag + '.json.gz')) + shutil.copy2(src, out / ('new/borrow/inputs/PR2917-WORD-' + tag + '.json.gz')) + rec = dict(stage=a.stage_name, source_word_sha256=sha(src), source_canonical_sha256=sem(old), candidate_word_sha256=sha(target), candidate_canonical_sha256=sem(new), + producer_sha256=PRODUCER_SHA, changed_sections=sorted(changed), buffers=len(new['helper_final']), spec=spec) + write(out / ('new/borrow/inputs/wordedit_43' + tag + '.json'), rec); records[tag] = dict(rec, spec='(see file)') + need(len(buffers) == 1, 'both providers charge the same private buffer count'); B = buffers.pop() + write(out / 'new/BORROW-PROVIDERS.json', providers) + patches = [] + def patch(name, old, new): + p = out / name; before = sha(p); body = p.read_text(); need(body.count(old) == 1, 'exact overlay preimage ' + name); p.write_text(body.replace(old, new)) + patches.append(dict(path=name, before_sha256=before, after_sha256=sha(p), old=old, new=new)) + anchor = ' final=json.loads(gzip.decompress(shipped.read_bytes()))' + block = ''' # Recorded exact word edit (here: rank-7 joint end frames, five paired extractions, fourteen declared rewrites); pure producer, cleanup re-derived from helper_final. Every previous state stays in the audit chain. + we_=D/'inputs'/f'wordedit_43{wt}.json' + if we_.exists(): + import wordedit + we_patch=json.loads(we_.read_text());previous_we=chain[-1] + canonical=lambda z:hashlib.sha256(json.dumps(z,sort_keys=True,separators=(',',':')).encode()).hexdigest() + assert canonical(previous_we)==we_patch['source_canonical_sha256'] + we_word=wordedit.apply_spec(previous_we,we_patch['spec']) + assert canonical(we_word)==we_patch['candidate_canonical_sha256'] + assert set(k_ for k_ in previous_we if previous_we[k_]!=we_word[k_])<={'A','B','restore','compensation','start_extra','report','cleanup','initial_corrections','helper_final','warps'} + assert [x_[1:] for x_ in we_word['warps']]==[x_[1:] for x_ in previous_we['warps']] # warps: only their B positions may move + assert we_word['cleanup']==wordedit.derive_cleanup(we_word) + assert we_word['removed']==previous_we['removed'] and len(we_word['warps'])==len(previous_we['warps']) + def _we_span(b_): + o_={0} + for v_ in b_: o_|={x_^v_ for x_ in o_} + return o_ + assert all(h_ in we_word['helper_final'] and _we_span(we_word['helper_final'][h_])<=_we_span(U_) for h_,U_ in previous_we['helper_final'].items()) + assert len(we_word['helper_final'])==we_patch['buffers'] + chain.append(we_word);steps.append(we_patch['stage']) +''' + anchor + patch('new/rebuild_borrow.py', anchor, block) + # PR2917's and PR2908's independent reviews read their own data/ copies; the shared-kernel and preload-move reviews read inputs/ copies: no redirect needed. + before = read(source / 'MANIFEST.json'); after = tree(out); write(out / 'MANIFEST.json', after) + change = {p: dict(before_sha256=before.get(p), after_sha256=after.get(p)) for p in sorted(set(before) | set(after)) if before.get(p) != after.get(p)} + expected = {'new/borrow/words/BORROW-WORD-43base.json.gz', 'new/borrow/words/BORROW-WORD-43extra.json.gz', 'new/borrow/inputs/PR2917-WORD-base.json.gz', 'new/borrow/inputs/PR2917-WORD-extra.json.gz', + 'new/borrow/inputs/wordedit_43base.json', 'new/borrow/inputs/wordedit_43extra.json', 'new/borrow/wordedit.py', 'new/rebuild_borrow.py'} + optional = {'new/BORROW-PROVIDERS.json'} # unchanged when the edit keeps every width and the local profile (same-cost word edit) + need(expected <= set(change) <= expected | optional, 'exact overlay change allowlist ' + str(set(change) ^ expected)); need(tree(source) == before, 'original source remained byte-exact') + receipt = dict(status='PASS_SOURCE_BOUND_WORDEDIT_OVERLAY_DERIVATION', stage=a.stage_name, upstream_manifest_sha256=UPSTREAM_MANIFEST, derived_manifest_sha256=sha(out / 'MANIFEST.json'), + source_file_count=len(after), buffers=B, builder_sha256=sha(Path(__file__)), producer_sha256=PRODUCER_SHA, changes=change, patches=patches, words=records) + write(out.parent / (out.name + '-DERIVATION.json'), receipt); print(json.dumps({k: receipt[k] for k in ['status', 'derived_manifest_sha256', 'source_file_count', 'buffers']}, sort_keys=True)) +if __name__ == '__main__': main() diff --git a/research/rank7-coupled-586-588-carrier-fold/tools/derive_adapters.py b/research/rank7-coupled-586-588-carrier-fold/tools/derive_adapters.py new file mode 100644 index 0000000000..cff5a3cec5 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/tools/derive_adapters.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Generalized PR2917 adapter derivation (Marius-Paul Dumitrean, Claude Code assisted; PR2917/PR2908 derivations by Mason Hale and Jeremy Diviney): PR2908's exact tools -> closed-profile adapters for an +arbitrary derived overlay, buffer count B, source profile and comparator set. With B=82, commit +'paired-helper-extension-pr2908', profile 'paired-extension' and comparisons=pr2908 the output is byte-identical to +PR2917's tools/derive_adapters.py output (checked against its evidence/ADAPTER-DERIVATION.json), except the retained +receipt binding, which is always sha256(--retained-receipt). Generalized here (r14) beyond PR2942's version: the admission control count +pinned by PR2917's adapter (119, five width classes) is derived from the source's provider width classes (37 + sum over the +two providers of 17 + k(k-1) + 4, freeze_spec's own formula), because the changed words have a sixth width class (6). +usage: derive_adapters_r13.py --parent-package PR2908_PKG --source OVERLAY --retained-receipt FILE --out DIR + --buffers B --source-commit NAME --source-profile NAME --upstream-head HEX + [--comparison pr2917=/path/CLAIM.json --comparison pr2969=/path/CLAIM.json ...] (pr2908 always from the parent package) +Comparator registry: PR2942's version plus 'pr2966' (Jeremy Kothe, head e62d3eb9, research/paired-extension-normal45-rewrites/CLAIM.json) +and 'pr2969' (Dugongue, head e2ca469b, research/paired-swap-normal45/CLAIM.json). +""" +from pathlib import Path +import argparse, gzip, hashlib, json, sys +PARENT_HEAD = '51309592971e3b5be935599eed2a95404dc7781e' +PARENT_MANIFEST = '9dba3fe371602ec023a54e26c0fd66f69eb7a74be86aab89923529083c14b36f' +OLD_SOURCE = '56cf455752722051d598a7da1e5ee700637fbaef09189f534413dbe6e0525a83' +OLD_RETAINED = 'dd36443f2789ffa6deca7210c76ada781e2b9b7e622a546b366f51a475faff3e' +# Known full-headline comparators: name -> (head, sha256 of its CLAIM.json). A comparator file must match its pin exactly. +KNOWN = {'pr2908': (PARENT_HEAD, '2406680a07b43a69b0f12f8462cc43f3616f3c8cb0a46bc767541b45945cd2bf'), + 'pr2917': ('224bd5e56041c40078ff6b5fa7393733a215de5c', 'e6c836c0178661a53a69cd91f29d83585e876f2511ff40c6b6204cd270fbdeac'), + 'pr2930': ('81f3b5d12977eba09e06fbff729167d59faabe90', '9c2c14158780a677b3661623d7476acc4f535ac9e0481addfa1d6c4c7633b74b'), + 'pr2966': ('e62d3eb9005117d82a9babcfa937ecc53237c490', '4d4c4800bf3bcb36d09021313b2712aebd4aa0830c74dda30991daf6851c220a'), # Jeremy Kothe's PR2966 headline (field kappa) + 'pr2969': ('e2ca469b08385d3d5e29a918d66dbefaf889e9f3', '656a4c93411b078753783513e2e71b1722a56e7b70120264a38118811982fa77')} # Dugongue's PR2969 moment nomination (field kappa, a rational string) +HEADS = {k: v[0] for k, v in KNOWN.items()} +sha = lambda b: hashlib.sha256(b).hexdigest() + +def need(p, msg): + if not p: raise ValueError(msg) + +def tree(p): + need(not any(f.is_symlink() for f in p.rglob('*')), 'no symlinks') + return {f.relative_to(p).as_posix(): sha(f.read_bytes()) for f in p.rglob('*') if f.is_file() and f != p / 'MANIFEST.json'} + +def derive(parent, source, out, retained_sha, B, commit, profile, upstream_head, claims): + manifest = json.loads((parent / 'MANIFEST.json').read_bytes()); need(tree(parent) == manifest, 'complete exact parent manifest inventory') + need(sha((parent / 'MANIFEST.json').read_bytes()) == PARENT_MANIFEST, 'exact PR2908 package manifest') + newsha = sha((source / 'MANIFEST.json').read_bytes()) + files = json.loads((source / 'MANIFEST.json').read_bytes()); need(tree(source) == files, 'complete derived source inventory') + nfiles = len(files) + for tag in ('base', 'extra'): + w = json.loads(gzip.decompress((source / f'new/borrow/words/BORROW-WORD-43{tag}.json.gz').read_bytes())) + need(len(w['helper_final']) == B, f'declared {B}-buffer word ({tag}: {len(w["helper_final"])})') + need(len(set(range(224, 704)) - set(w['removed'])) == 408, '408 live helpers') + need(type(B) is int and 73 <= B <= 200, 'buffer count range') + need(len(retained_sha) == 64 and all(c in '0123456789abcdef' for c in retained_sha), 'retained receipt SHA256') + comps = [('pr2908', parent / 'CLAIM.json')] + [(k, Path(v)) for k, v in claims] + comp_entries = [] + for name, path in comps: + claim = json.loads(path.read_bytes()); need('headline_kappa_source' not in claim and 'kappa' in claim, 'headline outer comparison ' + name) + need(name in KNOWN and sha(path.read_bytes()) == KNOWN[name][1], 'known comparator head and exact CLAIM.json pin ' + name) + comp_entries.append((name, int(name[2:]), HEADS[name], sha(path.read_bytes()))) + out.mkdir(parents=True, exist_ok=False); changes = {} + def adapt(oldname, newname, pairs): + p = parent / 'tools' / oldname; body = p.read_text(); oldhash = sha(p.read_bytes()); applied = [] + for old, new in pairs: + need(body.count(old) == 1, f'exact preimage occurrence {oldname}: {old[:120]}') + body = body.replace(old, new); applied.append({'old': old, 'new': new}) + q = out / newname; q.write_text(body); compile(body, str(q), 'exec') + changes[newname] = {'source': str(p), 'before_sha256': oldhash, 'after_sha256': sha(q.read_bytes()), 'replacements': applied} + adapt('prepare_channel_native.py', 'prepare_extension_native.py', [ + ("SOURCE_SHA='" + OLD_SOURCE + "'", "SOURCE_SHA='" + newsha + "'"), + ('SOURCE_FILES=610', 'SOURCE_FILES=' + str(nfiles)), + ("SOURCE_COMMIT='two-sided-helper408-pr2894'", "SOURCE_COMMIT='" + commit + "'"), + ("OLD_RECEIPT_SHA='" + OLD_RETAINED + "'", "OLD_RECEIPT_SHA='" + retained_sha + "'"), + ("len(can['zero_buffers'])==73", f"len(can['zero_buffers'])=={B}"), + ]) + oldprofile = " 'channel408': dict(commit='two-sided-helper408-pr2894',manifest='" + OLD_SOURCE + "',helpers=408,source_file_count=610,upstream_head='18d03c447886895ef9abf888398178e0428533ca')," + newprofile = " '" + profile + "': dict(commit='" + commit + "',manifest='" + newsha + "',helpers=408,source_file_count=" + str(nfiles) + ",upstream_head='" + upstream_head + "')," + comp_text = "COMPARISONS = {" + ''.join("\n '" + n + "': dict(pr=" + str(pr) + ",head='" + h + "',sha256='" + s + "',field='kappa')," for n, pr, h, s in comp_entries) + choices = "['" + "','".join(n for n, *_ in comp_entries) + "']" + # Admission control count: assembly_controls emits 37 global controls plus, per provider, 17 + k(k-1) width + # swap/shift controls over its k width classes + one per spot helper (freeze_spec's own formula). The PR2917 + # adapter pins 119 (five width classes); derive it so a new width class (e.g. width 6) is checked exactly. + _prov = json.loads((source / 'new/BORROW-PROVIDERS.json').read_bytes()) + _ks = {pid: len(set(_prov[pid]['widths'])) for pid in ('gauge44', 'extra')} + ADMISSION_CONTROLS = 37 + sum(17 + k * (k - 1) + 4 for k in _ks.values()) + need(ADMISSION_CONTROLS >= 119, 'admission control count') + adapt('admit_channel408.py', 'admit_extension.py', [ + (oldprofile, newprofile), + ("COMPARISONS = {", comp_text), + ("ap.add_argument('--source-profile', choices=['channel408'], default='channel408')", "ap.add_argument('--source-profile', choices=['" + profile + "'], default='" + profile + "')"), + ("ap.add_argument('--comparison-profile', choices=['pr2894'], default='pr2894')", "ap.add_argument('--comparison-profile', choices=" + choices + ", default='pr2908')"), + ('zero_buffers_allocated_and_cleared=73', f'zero_buffers_allocated_and_cleared={B}'), + ("len(c.get('zero_buffers',[]))==73, 'helper408 physical ABI including all 73 private buffers'", f"len(c.get('zero_buffers',[]))=={B}, 'paired extension physical ABI including all {B} private buffers'"), + ("896*T+expected_helpers+8+73+2, 'complete physical cost including all actual helpers and 73 buffers'", f"896*T+expected_helpers+8+{B}+2, 'complete physical cost including all actual helpers and {B} buffers'"), + ("\"len(rd(work/'ADMISSION-CONTROLS.json')['rejected_controls'])==119\")", f"\"len(rd(work/'ADMISSION-CONTROLS.json')['rejected_controls'])=={ADMISSION_CONTROLS}\")"), + ("\"controls=dict(admission=119,", f"\"controls=dict(admission={ADMISSION_CONTROLS},"), + ]) + adapt('channel_blocknorm.py', 'extension_blocknorm.py', [ + ("len(allocated)==73, 'all73 private zero buffers released'", f"len(allocated)=={B}, 'all{B} private zero buffers released'"), + ("'zero_buffers_allocated_and_cleared':73", f"'zero_buffers_allocated_and_cleared':{B}"), + ("r['zero_buffers_returned_to_zero']==73", f"r['zero_buffers_returned_to_zero']=={B}"), + ('physical==live+8+408+73+2', f'physical==live+8+408+{B}+2'), + ("'zero_buffers':[live+416,live+489], 'coefficient':[live+489,live+491]", f"'zero_buffers':[live+416,live+{416 + B}], 'coefficient':[live+{416 + B},live+{418 + B}]"), + ("len(mp)==73 and set(mp.values())==set(range(*ns['zero_buffers'])), '73distinct private Z slots'", f"len(mp)=={B} and set(mp.values())==set(range(*ns['zero_buffers'])), '{B}distinct private Z slots'"), + ('T=len(order)//9; live=896*T; physical=live+490', f'T=len(order)//9; live=896*T; physical=live+{418 + B}'), + ]) + # The native address dimension and symplectic stock factor are deliberately retained (as in PR2917). + b = (out / 'extension_blocknorm.py').read_text(); a = (out / 'admit_extension.py').read_text() + need("require(d['m']==73" in b and 'Sp(72,2)' in b and 'range(1,37)' in b, 'retained native dimension and symplectic group') + need('assert m==73' in a, 'retained outer dimension') + receipt = {'status': f'PASS_CHECKED_{B}_BUFFER_ADAPTER_DERIVATION_R13', 'parent_head': PARENT_HEAD, 'parent_manifest_sha256': PARENT_MANIFEST, + 'source_commit': commit, 'source_profile': profile, 'upstream_head': upstream_head, 'source_manifest_sha256': newsha, 'source_files': nfiles, + 'comparisons': {n: dict(pr=pr, head=h, sha256=s) for n, pr, h, s in comp_entries}, 'retained_receipt_sha256': retained_sha, + 'buffer_count': B, 'physical_overhead': 418 + B, 'width_classes': _ks, 'admission_controls': ADMISSION_CONTROLS, 'changes': changes} + (out / 'ADAPTER-DERIVATION.json').write_text(json.dumps(receipt, indent=2) + '\n'); return receipt + +if __name__ == '__main__': + ap = argparse.ArgumentParser(); ap.add_argument('--parent-package', type=Path, required=True); ap.add_argument('--source', type=Path, required=True) + ap.add_argument('--retained-receipt', type=Path, required=True); ap.add_argument('--out', type=Path, required=True); ap.add_argument('--buffers', type=int, required=True) + ap.add_argument('--source-commit', required=True); ap.add_argument('--source-profile', required=True); ap.add_argument('--upstream-head', required=True) + ap.add_argument('--comparison', action='append', default=[], help='name=path/to/CLAIM.json (pr2917=...)'); a = ap.parse_args() + claims = [tuple(c.split('=', 1)) for c in a.comparison] + r = derive(a.parent_package.resolve(), a.source.resolve(), a.out.resolve(), sha(a.retained_receipt.read_bytes()), a.buffers, a.source_commit, a.source_profile, a.upstream_head, claims) + print(r['status'], r['source_manifest_sha256'], r['source_files'], {k: v['after_sha256'][:16] for k, v in r['changes'].items()}) diff --git a/research/rank7-coupled-586-588-carrier-fold/tools/relax.py b/research/rank7-coupled-586-588-carrier-fold/tools/relax.py new file mode 100644 index 0000000000..97dfe35c43 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/tools/relax.py @@ -0,0 +1,329 @@ +#!/usr/bin/env python3 +"""relax.py -- changed-inventory, fixed-capacity fractional relaxation (upper bound on the complex endpoint) +for an ARBITRARY per-call local profile and per-call helper-width inventory, with exact rational verification. + +Model (everything per replica; the fractional cap is independent of T): + * bins: every replica has 112 ports x 18 idle children; the child capacities (ranks) come from the + T37 template: 6 children of capacity 8, 4 of 16, 4 of 32, 4 of 48 -> bins {8:672, 16:448, 32:448, 48:448}. + * roles: every call hosts all its helpers; a helper of width w occupies w consecutive units of ONE bin; + the 9 calls of a replica supply 9*inventory[w] roles of width w per replica (the inventory is per call; + with two providers of different widths pass the call-weighted average, a Fraction is fine). + * pattern catalogue: every multiset of widths with sum <= capacity ("bounded count-vector enumeration"); + the bin then pays ONE idle child of rank cap - used (rank 0 = nothing). + * CHRONOLOGY IS IGNORED: no source windows, no per-call family collisions, no "one role per bin per call", + no integrality. A bin pattern count may be fractional. Hence this is an UPPER bound on what any + actual fill of the same inventory can reach, and the bound is NOT a chronological witness. + * local profile is fixed and fully paid: 9 * local[r] children of rank r per replica. + Moment: M_x(b) = (9*sum_r local_r H_r(b) + sum_p x_p H_{r_p}(b)) / (73*896), H_r(b) = r*(73/r)^b, + LP(b): min_x sum_p x_p H_{r_p}(b) s.t. sum_{p in cap c} x_p = bins[c], sum_p n_w(p) x_p = 9*inv[w], x>=0. + cap = the root b of min_x M_x(b) = 1 (g(b) = min_x M_x(b) is increasing). + +Exact verification (same technique as PR2857's audit_relaxation.py, re-implemented): + 1. float bisection with scipy/HiGHS locates b*; the optimal basis B (9 columns) is read off; + 2. x_B = B^-1 rhs exactly (Fractions) -> the primal profile; root bracketed at 10^-25 with the package's + rational interval arithmetic (root.py): M(lo) < 1 < M(hi) -> cap >= lo (x_B is feasible); + 3. dual y(b) = B^-T c_B(b) is an exact rational combination of the H_k(b): the Y matrix of the receipt; + every pattern's reduced cost at b = hi is bracketed with the H enclosures and must be > 0 (or identically 0 + for the tight patterns) -> by weak duality every feasible x has M_x(hi) >= M_{x_B}(hi) > 1 -> cap <= hi. + Reproduces PR2857: cap in [0.001720100805416885927944, 0.001720100805416885927945], 1163 patterns, 11 tight. + +Usage: + python -B relax.py --calibrate + python -B relax.py --inventory '{"4":26,"5":2,"7":62,"8":85,"9":233}' --local '{"1":2397,"2":640,"3":266,"4":128,"5":26,"8":8}' + python -B relax.py --delta-inventory '{"8":1,"9":-1}' --delta-local '{"1":3,"2":-2}' # relative to PR2857 + python -B relax.py --scenarios # the hypothetical table of ROUND.md (one/two 9->8, 8->7, removal) +API: relax(local, inventory, bins=BINS) -> dict (cap_lower, cap_upper, active patterns, idle histogram, dual check, ...) +""" +from fractions import Fraction as Q +from itertools import product +import argparse, json, sys, os +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import root as R + +BINS = {8: 672, 16: 448, 32: 448, 48: 448} # bins per replica (112 ports x children per capacity) +LIVE = R.LIVE_PER_REPLICA # 896 +CALLS = R.CALLS_PER_REPLICA # 9 +PR2857_LOCAL = {1: 2394, 2: 642, 3: 266, 4: 128, 5: 26, 8: 8} +PR2857_INV = {4: 26, 5: 2, 7: 62, 8: 84, 9: 234} +PR2857_REALIZED_LOWER = Q('17200966286848326009728/10000000000000000000000000') +PR2857_REALIZED_UPPER = Q('17200966286848326009729/10000000000000000000000000') +PR2857_CAP_UPPER = Q('344020161083377185589/200000000000000000000000') # 0.001720100805416885927945 +PR2848_KAPPA = Q('17186585083049300/10000000000000000000') # 0.0017186585083049300 (incumbent of PR2857's gain) + + +def need(c, m): + if not c: + raise ValueError(m) + + +def patterns(bins, widths): + out = [] + for cap in sorted(bins): + for counts in product(*(range(cap // w + 1) for w in widths)): + used = sum(w * n for w, n in zip(widths, counts)) + if used <= cap: + out.append((cap, counts, cap - used)) + return out + + +def Hfloat(r, b): + import math + return 0.0 if r == 0 else r * (73.0 / r) ** b + + +def lp_min(pats, caps, widths, rhs, b): + """float LP at saving b: returns (optimal value, x, duals y).""" + import numpy as np + from scipy.optimize import linprog + c = np.array([Hfloat(r, b) for cap, counts, r in pats]) + A = np.zeros((len(caps) + len(widths), len(pats))) + for j, (cap, counts, r) in enumerate(pats): + A[caps.index(cap), j] = 1.0 + for i, n in enumerate(counts): + if n: + A[len(caps) + i, j] = n + res = linprog(c, A_eq=A, b_eq=np.array([float(v) for v in rhs]), bounds=(0, None), method='highs') + need(res.status == 0, 'LP infeasible or failed: ' + res.message) + return res.fun, res.x, res.eqlin.marginals, A + + +def rat_inverse(Bm): + n = len(Bm) + M = [row[:] + [Q(int(i == j)) for j in range(n)] for i, row in enumerate(Bm)] + for col in range(n): + piv = next((r for r in range(col, n) if M[r][col] != 0), None) + need(piv is not None, 'singular basis') + M[col], M[piv] = M[piv], M[col] + f = M[col][col] + M[col] = [v / f for v in M[col]] + for r in range(n): + if r != col and M[r][col] != 0: + g = M[r][col] + M[r] = [a - g * bb for a, bb in zip(M[r], M[col])] + return [row[n:] for row in M] + + +def rat_rank(cols): + """rank of a list of rational column vectors""" + rows = [list(c) for c in cols] + rank = 0 + ncol = len(rows[0]) if rows else 0 + for col in range(ncol): + piv = next((r for r in range(rank, len(rows)) if rows[r][col] != 0), None) + if piv is None: + continue + rows[rank], rows[piv] = rows[piv], rows[rank] + for r in range(len(rows)): + if r != rank and rows[r][col] != 0: + g = rows[r][col] / rows[rank][col] + rows[r] = [a - g * bb for a, bb in zip(rows[r], rows[rank])] + rank += 1 + return rank + + +def column(pat, caps, widths): + cap, counts, r = pat + return [Q(int(cap == c)) for c in caps] + [Q(n) for n in counts] + + +def relax(local, inventory, bins=BINS, digits=25, verbose=False): + local = {int(r): Q(n) for r, n in local.items() if Q(n) != 0} + inventory = {int(w): Q(n) for w, n in inventory.items() if Q(n) != 0} + need(all(n > 0 for n in local.values()) and all(n > 0 for n in inventory.values()), 'positive local/inventory') + widths = sorted(inventory) + caps = sorted(bins) + pats = patterns(bins, widths) + rhs = [Q(bins[c]) for c in caps] + [CALLS * inventory[w] for w in widths] + local_rep = {r: CALLS * n for r, n in local.items()} + total_cap = sum(c * bins[c] for c in caps) + inv_mass = sum(w * inventory[w] for w in widths) * CALLS + local_mass = sum(r * n for r, n in local_rep.items()) + idle_mass = total_cap - inv_mass + need(idle_mass >= 0, 'inventory exceeds bin capacity') + mass_ok = (local_mass + idle_mass == R.MASS_PER_REPLICA) + + # --- 1. float bisection on b + import numpy as np + def gfloat(b): + val, x, y, A = lp_min(pats, caps, widths, rhs, b) + loc = sum(float(n) * Hfloat(r, b) for r, n in local_rep.items()) + return (loc + val) / (73 * LIVE) - 1.0, x, y + lo, hi = 0.0, 0.01 + g_lo, _, _ = gfloat(lo) + g_hi, _, _ = gfloat(hi) + need(g_lo < 0 < g_hi, 'root window [0, 0.01] does not bracket the cap') + for _ in range(64): + mid = (lo + hi) / 2 + g, x, y = gfloat(mid) + if g < 0: + lo = mid + else: + hi = mid + b_star = (lo + hi) / 2 + g, x, y, = gfloat(b_star) + val, x, y, A = lp_min(pats, caps, widths, rhs, b_star) + + # --- 2. basis: support of x, completed by tight (zero reduced cost) columns to full rank + c = np.array([Hfloat(r, b_star) for cap, counts, r in pats]) + rc = c - A.T @ y + order = sorted(range(len(pats)), key=lambda j: (0 if x[j] > 1e-9 else 1, abs(float(rc[j])), -float(x[j]))) + basis = [] + cols = [] + for j in order: + if len(basis) == len(rhs): + break + if x[j] <= 1e-9 and abs(rc[j]) > 1e-7: + continue + col = column(pats[j], caps, widths) + if rat_rank(cols + [col]) > len(cols): + basis.append(j) + cols.append(col) + need(len(basis) == len(rhs), 'could not complete an optimal basis (degenerate LP); %d of %d' % (len(basis), len(rhs))) + Bm = [[cols[k][i] for k in range(len(basis))] for i in range(len(rhs))] # rows = constraints + Binv = rat_inverse(Bm) + xB = [sum(Binv[k][i] * rhs[i] for i in range(len(rhs))) for k in range(len(basis))] + need(all(v >= 0 for v in xB), 'basis not primal feasible') + active = [(pats[j], xB[k]) for k, j in enumerate(basis) if xB[k] > 0] + idle = {} + for (cap, counts, r), n in active: + if r: + idle[r] = idle.get(r, 0) + n + full = dict(local_rep) + for r, n in idle.items(): + full[r] = full.get(r, 0) + n + cap_lo, cap_hi = R.root_bracket(full, LIVE, digits, check_mass_T=1 if mass_ok else None) + + # --- 3. exact dual in the H basis: y_j(b) = sum_k (B^-T)_{j,k} H_{r_k}(b) + ranks = sorted({r for cap, counts, r in pats if r}) + # (B^-T)_{j,k} = Binv[k][j] + Y = {j: {} for j in range(len(rhs))} + for j in range(len(rhs)): + for k, pj in enumerate(basis): + r = pats[pj][2] + if r == 0 or Binv[k][j] == 0: + continue + Y[j][r] = Y[j].get(r, 0) + Binv[k][j] + Hhi = {r: R.H(r, cap_hi) for r in ranks} + tight = [] + strict = 0 + min_slack = None + for p in pats: + cap, counts, r = p + a = column(p, caps, widths) + coeff = {} + if r: + coeff[r] = Q(1) + for j in range(len(rhs)): + if a[j] == 0: + continue + for k, v in Y[j].items(): + coeff[k] = coeff.get(k, 0) - a[j] * v + coeff = {k: v for k, v in coeff.items() if v != 0} + if not coeff: + tight.append(p) + continue + lower = sum(v * (Hhi[k][0] if v > 0 else Hhi[k][1]) for k, v in coeff.items()) + need(lower > 0, 'dual sign failure for pattern %s (reduced-cost lower bound %s)' % (str(p), str(lower))) + strict += 1 + min_slack = lower if min_slack is None else min(min_slack, lower) + dual_obj = sum(rhs[j] * sum(v * Hhi[k][0] for k, v in Y[j].items()) for j in range(len(rhs))) # not needed for the proof, informational + dual_rows = ['cap%d' % c for c in caps] + ['w%d' % w for w in widths] + return dict( + status='PASS_EXACT_RELAXATION_CAP' if mass_ok else 'PASS_EXACT_RELAXATION_CAP_MASS_NOT_65088', + cap_lower=str(cap_lo), cap_upper=str(cap_hi), cap_lower_decimal=R.mpmath_str(cap_lo, digits), cap_upper_decimal=R.mpmath_str(cap_hi, digits), + patterns=len(pats), tight_patterns=len(tight), strict_patterns=strict, minimum_slack_lower=str(min_slack), + basis_patterns=[dict(capacity=pats[j][0], widths=[w for w, n in zip(widths, pats[j][1]) for _ in range(n)], count_per_replica=str(xB[k])) for k, j in enumerate(basis)], + tight_pattern_list=[dict(capacity=p[0], widths=[w for w, n in zip(widths, p[1]) for _ in range(n)]) for p in tight], + idle_per_replica={str(r): str(n) for r, n in sorted(idle.items())}, + idle_mass_per_replica=str(idle_mass), local_mass_per_replica=str(local_mass), rank_mass_per_replica=str(local_mass + idle_mass), rank_mass_identity=mass_ok, + dual_Y={dual_rows[j]: {str(k): str(v) for k, v in sorted(Y[j].items())} for j in range(len(rhs))}, + inventory_per_call={str(w): str(inventory[w]) for w in widths}, local_per_call={str(r): str(n) for r, n in sorted(local.items())}, bins_per_replica=bins, + delta_vs_PR2857_realized=dict(lower=str(cap_lo - PR2857_REALIZED_UPPER), upper=str(cap_hi - PR2857_REALIZED_LOWER), float=float(cap_lo - PR2857_REALIZED_LOWER)), + delta_vs_PR2857_cap=dict(float=float(cap_lo - PR2857_CAP_UPPER)), + assumptions='fixed capacities 8/16/32/48 (112 ports x 6/4/4/4 children per replica), all count-vector patterns with sum<=cap, one idle child of rank cap-used per bin, chronology/windows/collisions/integrality ignored, local profile fully paid; upper bound on any actual fill of this inventory, not a witness', + ) + + +def scenarios(): + base_local, base_inv = PR2857_LOCAL, PR2857_INV + def mod(dl, di): + l = {r: base_local.get(r, 0) + dl.get(r, 0) for r in set(base_local) | set(dl)} + i = {w: base_inv.get(w, 0) + di.get(w, 0) for w in set(base_inv) | set(di)} + return {r: n for r, n in l.items() if n}, {w: n for w, n in i.items() if n} + table = [ + ('PR2857 actual (calibration)', {}, {}), + ('one more 9->8 at PR2857 cost {1:+3,2:-2}', {1: 3, 2: -2}, {8: 1, 9: -1}), + ('one more 9->8 at PR2853 cost {1:+5,2:-3}', {1: 5, 2: -3}, {8: 1, 9: -1}), + ('one more 9->8 at minimal cost {1:+1,2:-1}', {1: 1, 2: -1}, {8: 1, 9: -1}), + ('two more 9->8 at PR2857 cost {1:+6,2:-4}', {1: 6, 2: -4}, {8: 2, 9: -2}), + ('four more 9->8 at PR2857 cost {1:+12,2:-8}', {1: 12, 2: -8}, {8: 4, 9: -4}), + ('one 8->7 at PR2857-like cost {1:+3,2:-2}', {1: 3, 2: -2}, {7: 1, 8: -1}), + ('one 8->7 at minimal cost {1:+1,2:-1}', {1: 1, 2: -1}, {7: 1, 8: -1}), + ('one 9->7 (two units) at cost {1:+6,2:-4}', {1: 6, 2: -4}, {7: 1, 9: -1}), + ('remove one width-9 helper, its 9 one-dim climbs vanish {1:-9}', {1: -9}, {9: -1}), + ('remove one width-9 helper paying {1:-7,2:-1}', {1: -7, 2: -1}, {9: -1}), + ('remove one width-8 helper {1:-8}', {1: -8}, {8: -1}), + ('remove one width-4 helper {1:-4}', {1: -4}, {4: -1}), + ('local only: +1 H1 -1 H2 per call (mass -1, inventory unchanged: NOT a legal word, derivative probe)', {1: 1, 2: -1}, {}), + ('local only: -1 H1 per call (mass -1, derivative probe)', {1: -1}, {}), + ('local only: 2 H1 -> 1 H2 per call (mass neutral)', {1: -2, 2: 1}, {}), + ('local only: 1 H3 -> 1 H1 + 1 H2 per call (mass neutral)', {3: -1, 1: 1, 2: 1}, {}), + ] + out = [] + for name, dl, di in table: + l, i = mod(dl, di) + try: + r = relax(l, i) + row = dict(scenario=name, delta_local=dl, delta_inventory=di, cap_lower=r['cap_lower_decimal'], cap_upper=r['cap_upper_decimal'], + gain_vs_PR2857_realized_float=r['delta_vs_PR2857_realized']['float'], gain_vs_PR2857_cap_float=r['delta_vs_PR2857_cap']['float'], + tight=r['tight_patterns'], patterns=r['patterns'], idle_per_replica=r['idle_per_replica'], basis=r['basis_patterns'], rank_mass_identity=r['rank_mass_identity'], status=r['status']) + except Exception as e: # noqa + row = dict(scenario=name, delta_local=dl, delta_inventory=di, error=str(e)) + out.append(row) + print('%-95s cap<= %s gain vs realized %+.4e vs cap %+.4e %s' % (name, row.get('cap_upper', '?'), row.get('gain_vs_PR2857_realized_float', float('nan')), row.get('gain_vs_PR2857_cap_float', float('nan')), row.get('error', '')), file=sys.stderr, flush=True) + return out + + +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument('--calibrate', action='store_true') + ap.add_argument('--scenarios', action='store_true') + ap.add_argument('--inventory', help='JSON per-call {width: count}') + ap.add_argument('--local', help='JSON per-call {rank: count}') + ap.add_argument('--delta-inventory', help='JSON {width: +-count} relative to PR2857') + ap.add_argument('--delta-local', help='JSON {rank: +-count} relative to PR2857') + ap.add_argument('--digits', type=int, default=25) + ap.add_argument('--out') + a = ap.parse_args() + if a.calibrate: + r = relax(PR2857_LOCAL, PR2857_INV, digits=a.digits) + r['reproduces_PR2857_cap_lower'] = (Q(r['cap_lower']) == Q('215012600677110740993/125000000000000000000000')) + r['bracket_inside_PR2857_bracket'] = (Q(r['cap_lower']) >= Q('215012600677110740993/125000000000000000000000') and Q(r['cap_upper']) <= PR2857_CAP_UPPER) + r['reproduces_PR2857_cap_upper_at_24_digits'] = (relax(PR2857_LOCAL, PR2857_INV, digits=24)['cap_upper'] == str(PR2857_CAP_UPPER)) + r['reproduces_PR2857_pattern_count_1163'] = (r['patterns'] == 1163) + r['reproduces_PR2857_11_tight_1152_strict'] = (r['tight_patterns'] == 11 and r['strict_patterns'] == 1152) + res = r + elif a.scenarios: + res = scenarios() + else: + local = dict(PR2857_LOCAL) + inv = dict(PR2857_INV) + if a.local: + local = {int(k): Q(v) for k, v in json.loads(a.local).items()} + if a.inventory: + inv = {int(k): Q(v) for k, v in json.loads(a.inventory).items()} + if a.delta_local: + for k, v in json.loads(a.delta_local).items(): + local[int(k)] = local.get(int(k), 0) + Q(v) + if a.delta_inventory: + for k, v in json.loads(a.delta_inventory).items(): + inv[int(k)] = inv.get(int(k), 0) + Q(v) + res = relax({k: v for k, v in local.items() if v}, {k: v for k, v in inv.items() if v}, digits=a.digits) + s = json.dumps(res, indent=1, sort_keys=True, default=str) + if a.out: + open(a.out, 'w').write(s) + print(s) + + +if __name__ == '__main__': + main() diff --git a/research/rank7-coupled-586-588-carrier-fold/tools/relax_exact.py b/research/rank7-coupled-586-588-carrier-fold/tools/relax_exact.py new file mode 100644 index 0000000000..0be97756bb --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/tools/relax_exact.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python3 +"""relax_exact.py -- Fractions-only verification of a stored optimal basis of the changed-inventory +fixed-capacity fractional relaxation (relax.py), without scipy. + +relax.py locates the optimal basis with a float LP (scipy/HiGHS) and then certifies it exactly. This module +performs only the exact part, from a stored list of basis patterns: + 1. x_B = B^-1 rhs (exact rationals), x_B >= 0: the basic solution is feasible, so the cap is at least the + root of its complete profile (root.py bracket at 10^-digits); + 2. the dual y(b) = B^-T c_B(b) is an exact rational combination of the H_k(b); every one of the capacity- + feasible patterns has reduced cost > 0 (or identically 0) at b = hi, so by weak duality every feasible x + has moment >= 1 at hi: the cap is at most hi. +The bins, pattern catalogue, moment model and interval arithmetic are relax.py's / root.py's (imported). + +Marius-Paul Dumitrean, prepared with substantial AI assistance (Anthropic Claude, via Claude Code). Apache-2.0. +""" +from fractions import Fraction as Q +import os, sys +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import root as R +import relax as X + + +def need(c, m): + if not c: + raise ValueError(m) + + +def pattern_of(entry, widths, bins): + cap = int(entry['capacity']) + need(cap in bins, 'basis pattern capacity %r is not a bin capacity' % cap) + counts = tuple(list(entry['widths']).count(w) for w in widths) + need(sum(counts) == len(entry['widths']), 'basis pattern uses a width outside the inventory: %r' % (entry,)) + used = sum(w * n for w, n in zip(widths, counts)) + need(used <= cap, 'basis pattern exceeds its capacity') + return (cap, counts, cap - used) + + +def verify_basis(local, inventory, basis_patterns, bins=X.BINS, digits=25): + local = {int(r): Q(n) for r, n in local.items() if Q(n) != 0} + inventory = {int(w): Q(n) for w, n in inventory.items() if Q(n) != 0} + need(all(n > 0 for n in local.values()) and all(n > 0 for n in inventory.values()), 'positive local/inventory') + widths = sorted(inventory) + caps = sorted(bins) + pats = X.patterns(bins, widths) + patset = set(pats) + rhs = [Q(bins[c]) for c in caps] + [X.CALLS * inventory[w] for w in widths] + local_rep = {r: X.CALLS * n for r, n in local.items()} + total_cap = sum(c * bins[c] for c in caps) + inv_mass = sum(w * inventory[w] for w in widths) * X.CALLS + local_mass = sum(r * n for r, n in local_rep.items()) + idle_mass = total_cap - inv_mass + need(idle_mass >= 0, 'inventory exceeds bin capacity') + mass_ok = (local_mass + idle_mass == R.MASS_PER_REPLICA) + basis = [pattern_of(e, widths, bins) for e in basis_patterns] + need(len(basis) == len(rhs), 'basis must have exactly %d patterns' % len(rhs)) + need(all(p in patset for p in basis), 'basis pattern outside the catalogue') + need(len(set(basis)) == len(basis), 'repeated basis pattern') + cols = [X.column(p, caps, widths) for p in basis] + need(X.rat_rank(cols) == len(rhs), 'basis columns are linearly dependent') + Bm = [[cols[k][i] for k in range(len(basis))] for i in range(len(rhs))] + Binv = X.rat_inverse(Bm) + xB = [sum(Binv[k][i] * rhs[i] for i in range(len(rhs))) for k in range(len(basis))] + need(all(v >= 0 for v in xB), 'basis not primal feasible (negative basic variable)') + for e, v in zip(basis_patterns, xB): + if 'count_per_replica' in e: + need(Q(e['count_per_replica']) == v, 'stored basic count differs from B^-1 rhs: %r' % (e,)) + idle = {} + for p, n in zip(basis, xB): + if p[2] and n: + idle[p[2]] = idle.get(p[2], 0) + n + full = dict(local_rep) + for r, n in idle.items(): + full[r] = full.get(r, 0) + n + cap_lo, cap_hi = R.root_bracket(full, X.LIVE, digits, check_mass_T=1 if mass_ok else None) + ranks = sorted({r for cap, counts, r in pats if r}) + Y = {j: {} for j in range(len(rhs))} + for j in range(len(rhs)): + for k, p in enumerate(basis): + r = p[2] + if r == 0 or Binv[k][j] == 0: + continue + Y[j][r] = Y[j].get(r, 0) + Binv[k][j] + Hhi = {r: R.H(r, cap_hi) for r in ranks} + tight = strict = 0 + min_slack = None + for p in pats: + a = X.column(p, caps, widths) + coeff = {} + if p[2]: + coeff[p[2]] = Q(1) + for j in range(len(rhs)): + if a[j] == 0: + continue + for k, v in Y[j].items(): + coeff[k] = coeff.get(k, 0) - a[j] * v + coeff = {k: v for k, v in coeff.items() if v != 0} + if not coeff: + tight += 1 + continue + lower = sum(v * (Hhi[k][0] if v > 0 else Hhi[k][1]) for k, v in coeff.items()) + need(lower > 0, 'dual sign failure for pattern %s (reduced-cost lower bound %s)' % (str(p), str(lower))) + strict += 1 + min_slack = lower if min_slack is None else min(min_slack, lower) + return dict(status='PASS_EXACT_RELAXATION_CAP' if mass_ok else 'PASS_EXACT_RELAXATION_CAP_MASS_NOT_65088', + cap_lower=str(cap_lo), cap_upper=str(cap_hi), patterns=len(pats), tight_patterns=tight, + strict_patterns=strict, minimum_slack_lower=str(min_slack), rank_mass_identity=mass_ok, + idle_per_replica={str(r): str(n) for r, n in sorted(idle.items())}, + basic_counts=[str(v) for v in xB]) diff --git a/research/rank7-coupled-586-588-carrier-fold/tools/root.py b/research/rank7-coupled-586-588-carrier-fold/tools/root.py new file mode 100644 index 0000000000..bd6dc2eb4e --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/tools/root.py @@ -0,0 +1,254 @@ +#!/usr/bin/env python3 +"""root.py -- exact (rational-bracketed) complex endpoint kappa from a complete global profile. + +The T-replica network has 9*T calls, live width W = 896*T, base m = 73. A complete paid profile +{rank: count} (local jumps of all calls + idle/remainder children of all bins) has the moment + + M(b) = sum_r count_r * r * (73/r)^b / (73 * W) (= audit_owners.moment(profile, b, W)) + +which is increasing in b; the complex endpoint is the root M(b) = 1. PR2857's headline is +floor(root_lower, 24 digits) - 1e-46 - 1e-70; PR2853/PR2833's headlines are their roots - O(1e-3022). +The rational interval arithmetic (log via atanh series, exp via Taylor, outward rounding at 10^-45) +is the package's own, so the brackets coincide exactly with the independent audits. + +Rank-mass identity for a complete profile: sum_r r*count_r = 65088*T (= (73-1)*896*T + 64*9*T). + +Usage: + python -B root.py --calibrate # PR2857 / PR2853 / PR2833 reproduction + python -B root.py --profile '{"1":805860,...}' --T 37 [--delta '{"1":9,"2":-9}'] [--digits 25] + python -B root.py --profile-file PROFILE.json --T 37 --table # per-rank derivative table +API: + kappa_from_profile(profile, T, digits=25) -> (lo, hi) exact Fractions, M(lo)<1 dict with new bracket and exact gain interval + derivatives(profile, T) -> {rank: dkappa/dcount_r} (mpmath, 40 digits) +""" +from fractions import Fraction as Q +from functools import lru_cache +import argparse, json, sys + +M_BASE = 73 +LIVE_PER_REPLICA = 896 +CALLS_PER_REPLICA = 9 +MASS_PER_REPLICA = (M_BASE - 1) * LIVE_PER_REPLICA + 64 * CALLS_PER_REPLICA # 65088 +SCALE = 10 ** 45 + + +def need(c, m): + if not c: + raise ValueError(m) + + +@lru_cache(None) +def logarithm(x): + """Rational enclosure of log(x), x >= 1 (package arithmetic, outward rounding 10^-45).""" + need(x >= 1, 'log argument') + k = 0 + while x >= 2: + x /= 2 + k += 1 + + def unit(y): + z = (y - 1) / (y + 1) + power = z + total = Q(0) + for j in range(100): + total += power / (2 * j + 1) + power *= z * z + total *= 2 + tail = 2 * power / (201 * (1 - z * z)) + return total, total + tail + + lo, hi = unit(x) + l2, h2 = unit(Q(2)) + lo += k * l2 + hi += k * h2 + return Q((lo * SCALE).__floor__(), SCALE), Q((hi * SCALE).__ceil__(), SCALE) + + +def exponential(x): + need(0 <= x < 1, 'exp argument') + term = total = Q(1) + for j in range(1, 19): + term *= x / j + total += term + tail = term * x / 19 / (1 - x / 20) + return total, total + tail + + +def H(rank, b): + """Enclosure of H_r(b) = r*(73/r)^b (the moment of one rank-r child times 73).""" + l, h = logarithm(Q(M_BASE, rank)) + return rank * exponential(b * l)[0], rank * exponential(b * h)[1] + + +def moment(profile, b, W): + """Enclosure of sum_r count_r * r * (73/r)^b / (73*W); counts may be Fractions (>=0).""" + lo = hi = Q(0) + for rank, count in profile.items(): + if count == 0: + continue + need(0 < rank < M_BASE and count > 0, 'child profile') + e0, e1 = H(rank, b) + lo += Q(count) * e0 / (M_BASE * W) + hi += Q(count) * e1 / (M_BASE * W) + return Q((lo * SCALE).__floor__(), SCALE), Q((hi * SCALE).__ceil__(), SCALE) + + +def normalize(profile): + out = {} + for r, n in profile.items(): + r = int(r) + n = Q(n) if not isinstance(n, int) else n + if n: + out[r] = out.get(r, 0) + n + return out + + +def rank_mass(profile): + return sum(r * Q(n) for r, n in normalize(profile).items()) + + +def root_bracket(profile, W, digits=25, check_mass_T=None): + """Bisection on the grid 10^-digits: returns (lo, hi) with M(lo) < 1 < M(hi) certified.""" + profile = normalize(profile) + if check_mass_T is not None: + need(rank_mass(profile) == MASS_PER_REPLICA * check_mass_T, 'rank-mass identity (incomplete profile?)') + G = 10 ** digits + low, high = 0, G // 100 + need(moment(profile, Q(low, G), W)[1] < 1 < moment(profile, Q(high, G), W)[0], 'root initial interval') + while high - low > 1: + mid = (low + high) // 2 + a, b = moment(profile, Q(mid, G), W) + if b < 1: + low = mid + elif a > 1: + high = mid + else: + raise ValueError('root interval precision exhausted at %d digits' % digits) + return Q(low, G), Q(high, G) + + +def kappa_from_profile(profile, T, digits=25, strict_mass=True): + """Exact bracket of the complex endpoint for a complete global profile of a T-replica network.""" + return root_bracket(profile, LIVE_PER_REPLICA * T, digits, T if strict_mass else None) + + +def add_profiles(a, b, scale_b=1): + out = dict(normalize(a)) + for r, n in normalize(b).items(): + out[r] = out.get(r, 0) + scale_b * n + need(out[r] >= 0, 'negative count at rank %d' % r) + if out[r] == 0: + del out[r] + return out + + +def delta_value(profile, T, delta, digits=25, strict_mass=True): + """Value (exact root brackets) of changing the complete profile by delta = {rank: +-count}.""" + base = kappa_from_profile(profile, T, digits, strict_mass) + newp = add_profiles(profile, delta) + mass_ok = rank_mass(newp) == MASS_PER_REPLICA * T + new = kappa_from_profile(newp, T, digits, strict_mass and mass_ok) + return dict(base_lower=str(base[0]), base_upper=str(base[1]), new_lower=str(new[0]), new_upper=str(new[1]), + gain_lower=str(new[0] - base[1]), gain_upper=str(new[1] - base[0]), + gain_float=float((new[0] + new[1] - base[0] - base[1]) / 2), new_profile={str(r): str(n) for r, n in sorted(newp.items())}, + new_rank_mass_identity=mass_ok, note=None if mass_ok else 'delta breaks the rank-mass identity: a derivative probe, not a complete legal profile (a legal word change moves local mass and inventory/idle mass together)') + + +def derivatives(profile, T, b=None): + """dkappa/dcount_r (per single child of rank r) by the implicit function theorem, mpmath 40 digits.""" + import mpmath + mpmath.mp.dps = 40 + profile = normalize(profile) + W = LIVE_PER_REPLICA * T + if b is None: + lo, hi = kappa_from_profile(profile, T, strict_mass=False) + b = (lo + hi) / 2 + b = mpmath.mpf(b.numerator) / b.denominator + dMdb = mpmath.mpf(0) + for r, n in profile.items(): + dMdb += mpmath.mpf(n) * r * mpmath.power(mpmath.mpf(M_BASE) / r, b) * mpmath.log(mpmath.mpf(M_BASE) / r) / (M_BASE * W) + out = {} + for r in range(1, M_BASE): + dMdn = r * mpmath.power(mpmath.mpf(M_BASE) / r, b) / (M_BASE * W) + out[r] = -dMdn / dMdb + return out, b + + +def fmt(x, nd=28): + return mpmath_str(x, nd) + + +def mpmath_str(x, nd): + import mpmath + mpmath.mp.dps = nd + 5 + return mpmath.nstr(mpmath.mpf(x.numerator) / x.denominator if isinstance(x, Q) else x, nd) + + +CALIBRATION = { + 'PR2857': dict(T=37, profile={1: 805860, 2: 213786, 3: 91775, 4: 42624, 5: 13098, 8: 2664, 9: 1, 48: 13379}, + expected_lower='17200966286848326009728/10000000000000000000000000', + expected_upper='17200966286848326009729/10000000000000000000000000', + headline='0.001720096628684832600972 - 1e-46 - 1e-70 (CLAIM.json)'), + 'PR2853': dict(T=74, profile={1: 1616713, 2: 424908, 3: 183207, 4: 85249, 5: 26625, 6: 58, 7: 3, 8: 5328, 32: 47, 48: 26703}, + headline='0.00171937765869758665904733841726077218140089564514 (outer/OUTER-CLAIM.json, = C - 1e-3046 - 1e-3022)'), + 'PR2833': dict(T=74, profile={1: 1603728, 2: 432900, 3: 183683, 4: 85248, 5: 26862, 8: 5328, 9: 1, 48: 26625}, + headline='0.00171865743716685595569345761432428040996497469293 (outer/OUTER-CLAIM.json)'), +} + + +def calibrate(digits=25): + results = {} + for name, c in CALIBRATION.items(): + lo, hi = kappa_from_profile(c['profile'], c['T'], digits) + row = dict(T=c['T'], profile=c['profile'], lower=str(lo), upper=str(hi), lower_decimal=mpmath_str(lo, digits), + upper_decimal=mpmath_str(hi, digits), headline=c['headline'], rank_mass=str(rank_mass(c['profile']))) + if 'expected_lower' in c: + row['reproduces_package_bracket'] = (lo == Q(c['expected_lower']) and hi == Q(c['expected_upper'])) + else: + head = c['headline'].split(' ')[0] + row['headline_inside_bracket'] = (Q(head) >= lo - Q(1, 10 ** 22)) and (Q(head) <= hi) + dec = mpmath_str(lo, digits) + k = 0 + while k < min(len(dec), len(head)) and dec[k] == head[k]: + k += 1 + row['matches_headline_to_digits'] = k - 2 # decimals in common ('0.' excluded) + results[name] = row + return results + + +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument('--calibrate', action='store_true') + ap.add_argument('--profile', help='JSON {rank: count}') + ap.add_argument('--profile-file') + ap.add_argument('--T', type=int, default=37) + ap.add_argument('--delta', help='JSON {rank: +-count} (complete-profile change, e.g. 9*T per-call units)') + ap.add_argument('--per-call-delta', help='JSON {rank: +-count per call}; multiplied by 9*T') + ap.add_argument('--digits', type=int, default=25) + ap.add_argument('--table', action='store_true', help='print per-rank derivative table') + ap.add_argument('--no-mass-check', action='store_true') + a = ap.parse_args() + if a.calibrate: + print(json.dumps(calibrate(a.digits), indent=1, sort_keys=True)) + return + profile = json.loads(a.profile) if a.profile else json.load(open(a.profile_file)) + profile = {int(k): (int(v) if str(v).lstrip('-').isdigit() else Q(v)) for k, v in profile.items()} + strict = not a.no_mass_check + lo, hi = kappa_from_profile(profile, a.T, a.digits, strict) + out = dict(T=a.T, W=LIVE_PER_REPLICA * a.T, lower=str(lo), upper=str(hi), lower_decimal=mpmath_str(lo, a.digits), + rank_mass=str(rank_mass(profile))) + if a.delta or a.per_call_delta: + d = {int(k): int(v) for k, v in json.loads(a.delta or a.per_call_delta).items()} + if a.per_call_delta: + d = {k: v * CALLS_PER_REPLICA * a.T for k, v in d.items()} + out['delta'] = delta_value(profile, a.T, d, a.digits, strict) + if a.table: + der, b = derivatives(profile, a.T) + out['derivative_per_child'] = {str(r): mpmath_str(v, 12) for r, v in der.items() if r in profile or r <= 9 or r == 48} + out['derivative_per_call_unit'] = {str(r): mpmath_str(v * CALLS_PER_REPLICA * a.T, 12) for r, v in der.items() if r in profile or r <= 9 or r == 48} + print(json.dumps(out, indent=1, sort_keys=True)) + + +if __name__ == '__main__': + main() diff --git a/research/rank7-coupled-586-588-carrier-fold/tools/wordedit.py b/research/rank7-coupled-586-588-carrier-fold/tools/wordedit.py new file mode 100644 index 0000000000..e5893496cd --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/tools/wordedit.py @@ -0,0 +1,102 @@ +# SPDX-License-Identifier: Apache-2.0 +"""wordedit.py -- generic, pure, reproducible BORROW-WORD edit spec (Marius-Paul Dumitrean, with substantial AI +assistance from Claude Code; supersedes our r12 version). + +make_spec(old, new) -> spec : exact diff of two words (A/B/restore/cut/precondition/compensation gate-level edits with + frames; start_extra / helper_final / removed / warps / initial_corrections / report + replacements; cleanup is NOT stored, it is re-derived). +apply_spec(old, spec) -> word : pure producer; re-derives cleanup with the package's word_patch.derive_cleanup and the + restored set taken from the NEW word's helper_final (r12 used restored_of(old cleanup), + which is stale when an edit adds a restored endpoint, e.g. a paired extraction). +Round trip must give apply_spec(old, make_spec(old, new)) == new (checked by `python wordedit.py OLD NEW [SPEC_OUT]`). +Edit indices: deletes use OLD indices, inserts use NEW indices (apply deletes first, then inserts ascending), +matching lane B's EDITS.json convention. Frames are part of every gate (last element), so a re-solved frame on an +otherwise unchanged gate appears as a 'frame' op (index in NEW coordinates after structural edits). +""" +import gzip, json, sys, copy, difflib +from pathlib import Path +sys.path.insert(0, str(Path(__file__).resolve().parent)) +try: + import word_patch as WP # PR2833's helpers (derive_cleanup); found next to this file inside a derived overlay +except ImportError: # standalone use in this package: PR2894's equal derive_cleanup (vendor/preload_move.py) + sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'vendor')) + import preload_move; sys.modules['word_patch'] = preload_move # noqa: E702 + import word_patch as WP + +GATE_SECTIONS = ('A', 'B', 'restore', 'cut', 'precondition', 'compensation') +FIELD_KEYS = ('warps', 'initial_corrections', 'start_extra', 'helper_final', 'removed', 'report', 'cleanup') + +def load(p): return json.loads(gzip.decompress(Path(p).read_bytes())) +def dump(w, p): Path(p).write_bytes(gzip.compress(json.dumps(w, separators=(',', ':')).encode(), mtime=0)) +def strip(g): return g[:-1] if isinstance(g, list) and g and g[0] in ('add', 'scale') and isinstance(g[-1], list) else g +def key(g): return json.dumps(strip(g)) + +def section_spec(old, new): + sm = difflib.SequenceMatcher(a=[key(g) for g in old], b=[key(g) for g in new], autojunk=False) + deletes, inserts, frames = [], [], [] + for tag, i1, i2, j1, j2 in sm.get_opcodes(): + if tag == 'equal': + for di, (a, b) in enumerate(zip(old[i1:i2], new[j1:j2])): + if a != b: frames.append([j1 + di, b[-1]]) # same gate, new frame (NEW index) + else: + for i in range(i1, i2): deletes.append([i, old[i]]) # OLD indices + for j in range(j1, j2): inserts.append([j, new[j]]) # NEW indices, gate incl. frame + return dict(deletes=deletes, inserts=inserts, frames=frames) + +def apply_section(old, s): + out = [g for i, g in enumerate(old) if i not in {d[0] for d in s['deletes']}] + for j, g in sorted(s['inserts'], key=lambda x: x[0]): out.insert(j, copy.deepcopy(g)) + for j, fr in s['frames']: out[j] = out[j][:-1] + [fr] + return out + +def derive_cleanup(w): + """Inverse-reverse cleanup of w (A without the entry prelude), buffers for every helper_final endpoint.""" + t = copy.deepcopy(w); t['A'] = w['A'][w['prelude_events']:] + return WP.derive_cleanup(t, set(map(int, w['helper_final']))) + +def make_spec(old, new): + spec = {'sections': {}, 'warps': None, 'compensation_removed': [], 'compensation_added': [], + 'initial_corrections': None, 'start_extra': {}, 'start_extra_removed': [], 'helper_final': None, + 'removed': None, 'report': new['report'], 'other': {}} + for sec in GATE_SECTIONS: + if old[sec] != new[sec]: spec['sections'][sec] = section_spec(old[sec], new[sec]) + if old['warps'] != new['warps']: spec['warps'] = new['warps'] + if old['initial_corrections'] != new['initial_corrections']: spec['initial_corrections'] = new['initial_corrections'] + s_ = spec['sections'].get('compensation', {'deletes': [], 'inserts': [], 'frames': []}) + spec['compensation_removed'] = [g for _, g in s_['deletes']]; spec['compensation_added'] = [g for _, g in s_['inserts']] + for k, v in new['start_extra'].items(): + if old['start_extra'].get(k) != v: spec['start_extra'][k] = v + spec['start_extra_removed'] = [k for k in old['start_extra'] if k not in new['start_extra']] + if old['helper_final'] != new['helper_final']: spec['helper_final'] = new['helper_final'] + if old['removed'] != new['removed']: spec['removed'] = new['removed'] + for k in new: + if k not in GATE_SECTIONS + FIELD_KEYS and old.get(k) != new[k]: + spec['other'][k] = new[k] + return spec + +def apply_spec(old, spec): + w = copy.deepcopy(old) + for sec, s in spec['sections'].items(): w[sec] = apply_section(w[sec], s) + if spec.get('warps') is not None: w['warps'] = copy.deepcopy(spec['warps']) + if spec.get('initial_corrections') is not None: w['initial_corrections'] = copy.deepcopy(spec['initial_corrections']) + # compensation is edited positionally through spec['sections']['compensation'] (order-exact) + for k in spec['start_extra_removed']: w['start_extra'].pop(k, None) + for k, v in spec['start_extra'].items(): w['start_extra'][k] = v + if spec.get('helper_final') is not None: w['helper_final'] = copy.deepcopy(spec['helper_final']) + if spec.get('removed') is not None: w['removed'] = copy.deepcopy(spec['removed']) + for k, v in spec['other'].items(): w[k] = copy.deepcopy(v) + w['report'] = copy.deepcopy(spec['report']) + w['cleanup'] = derive_cleanup(w) + return w + +if __name__ == '__main__': + old, new = load(sys.argv[1]), load(sys.argv[2]) + spec = make_spec(old, new) + rebuilt = apply_spec(old, spec) + diff = [k for k in new if rebuilt.get(k) != new[k]] + summary = {sec: {k: len(v) for k, v in s.items()} for sec, s in spec['sections'].items()} + print(json.dumps(dict(roundtrip_exact=(not diff and set(rebuilt) == set(new)), differing_keys=diff, sections=summary, + comp_removed=len(spec['compensation_removed']), comp_added=len(spec['compensation_added']), + start_extra=spec['start_extra'], helper_final_changed=spec['helper_final'] is not None, + buffers=len(new['helper_final']), report=spec['report']))) + if len(sys.argv) > 3: Path(sys.argv[3]).write_text(json.dumps(spec, indent=1)) diff --git a/research/rank7-coupled-586-588-carrier-fold/vendor/audit_local.py b/research/rank7-coupled-586-588-carrier-fold/vendor/audit_local.py new file mode 100644 index 0000000000..8224873d04 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/vendor/audit_local.py @@ -0,0 +1,501 @@ +"""Independent exact scalar/frame audit of the changed forward supplier. + +This does not import a generator, builder, stored compensation, or price. +All claimed endpoint matrices are derived from the input word's gates. +Optional --main checks the transported boundary against the pinned parent. +Prepared for icekylinx with OpenAI GPT-6 Astra assistance. Apache-2.0. +""" +import argparse,gzip,json,hashlib,time +from pathlib import Path +from fractions import Fraction as F +from collections import Counter + +def require(x,label): + if not x:raise RuntimeError(label) + +def basis(vs): + piv={} + for a in vs: + while a: + bit=a.bit_length()-1 + if bit in piv:a^=piv[bit] + else: + piv[bit]=a;break + for k in sorted(piv): + for j in piv: + if j>k and piv[j]>>k&1:piv[j]^=piv[k] + return tuple(piv[k] for k in sorted(piv,reverse=True)) + +def contained(a,b):return basis(a+b)==b + +def registers(e):return e[1:3] if e[0]=='add' else e[1:2] + +def apply(e,rows,dual=False): + if e[0]=='add': + t,s=e[1:3];q=F(e[3],e[4]);require(t!=s,'self add') + if dual:t,s,q=s,t,-q + dst=rows[t] + for k,x in list(rows[s].items()): + a=dst.get(k,F(0))+q*x + if a:dst[k]=a + else:dst.pop(k,None) + elif e[0]=='scale': + t=e[1];q=F(e[2],e[3]);require(q!=0,'zero scale') + if dual:q=1/q + rows[t]={k:q*x for k,x in rows[t].items()} + else:raise RuntimeError('unknown scalar primitive') + +def invert(e): + r=list(e) + if r[0]=='add':r[3]=-r[3] + else:r[2],r[3]=r[3],r[2] + return r + +def check_parent_interface(word,main): + # Read only the retained boundary data. No builder or local checker is imported. + relative="research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/CANONICAL-WORD.json.gz" + path=main/relative;raw=path.read_bytes() + require(hashlib.sha256(raw).hexdigest()=="66d3c3c70983224650643a0a05a21ac6c6959f84d0f4528650601016f5a76844",'parent canonical input pin') + parent=json.loads(gzip.decompress(raw)) + tau=lambda x:x^(43 if (x&43).bit_count()%2 else 0) + ports=parent['ports'];v=word['report']['v'] + require(len(ports)==len(set(ports))==v,'parent port count') + require(set(map(tau,word['ports']))==set(ports),'transported source/target ports') + moved={i:ports.index(tau(p)) for i,p in enumerate(word['ports'])} + centers=[moved.get(r,r) for r in word['centers']] + actual=[list(basis([tau(x) for x in frame])) for frame in word['center_frames']] + expected=[parent['frames'][f] for f in parent['center_frames']] + require(len(centers)==len(set(centers))==len(actual)==8,'eight distinct centre carriers') + require(actual==expected and all(len(f)==8 for f in actual),'ordered centre frame interface') + return dict(parent_path=relative,parent_file_sha256=hashlib.sha256(raw).hexdigest(), + transport_tau=43,ordered_frame_bases_match=True,all_ports_match=True, + transported_centers=centers,source_centers=[r for r in centers if r=2*v} + for e in w['precondition']:apply(e,dirt) + compensation=[['add',y,k,-a.numerator,a.denominator,[]] for y in range(v,2*v) for k,a in sorted(dirt[y].items())] + entering=set(map(int,w.get('start_extra',{})));lowends=set(map(int,w.get('helper_final',{}))) + coldends=lowends-entering + require(not any(e[2] in entering for e in compensation),'nonzero entrance response') + require(not any(r in entering|coldends for e in w['precondition']+compensation for r in registers(e)), 'pre-wrapper touch of residual helper') + require(all(e[-1]==[] for e in w['precondition']+compensation),'nonzero frame precondition') + early=w.get('early_cleanup',[]);earlyids={i for i,U in early} + require(len(earlyids)==len(early),'duplicate early cleanup gate') + tail=[w['cleanup'][i][:-1]+[U] for i,U in early] + cleanup=[e for i,e in enumerate(w['cleanup']) if i not in earlyids] + prefix=w['precondition']+compensation+main + program=prefix+tail+cleanup + for dual in (False,True): + actual=ident() + for e in program:apply(e,actual,dual) + expected=ident() + for t in range(v):expected[t if dual else v+t][v+t if dual else t]=F(-1 if dual else 1) + bad=[i for i in range(n) if actual[i]!=expected[i]] + require(not bad,'all-column endpoint failure '+str((dual,bad[:8]))) + print('endpoint', 'dual' if dual else 'forward','PASS',flush=True) + full=basis([1<>=1;i+=1 + return y + +def ginv(cols,h): + # inverse columns over F2 (None if singular), Gauss-Jordan on (G | I) column-wise + piv={}; + for i in range(h): + a=cols[i];b=1<>s&1:a^=piv[s][0];b^=piv[s][1] + if a:return None + pre.append(b) + return pre # pre[t] = G^{-1}(e_t) + +def gtrans(cols,h): + # transpose: column j of G^T = row j of G + return [sum(((cols[i]>>j)&1)< E (used for B-phase warps and for A-phase prelude warps)""" + inv=ginv(cols,h);require(inv is not None,'G not invertible') + require(all(gmul(cols,inv[t])==1<(Gx, (G+G^-T)x + G^-T z) + GiT=gtrans(inv,h) # G^{-T}: columns j = row j of G^{-1} + # G^{-T}(z): via columns GiT + def M(vec): + x=vec&((1<>h + gx=gmul(cols,x);S=gx^gmul(GiT,x) # (G + G^{-T}) x + return gx|((S^gmul(GiT,z))<>h)|((vec&((1<0)-(op<0))*(abs(op)+dsym)) + walg_add(rows[src],row,-c) + return + if e[0]=='warp': + op=e[2];s=(op>0)-(op<0) + if dual:op=s*(abs(op)+dsym) # dual orientation: K_G^{-T} is a distinct free symbol + rows[e[1]]=walg_warp(rows[e[1]],op);return + if e[0]=='add': + t,s=e[1:3];q=F(e[3],e[4]);require(t!=s,'self add') + if dual:t,s,q=s,t,-q + walg_add(rows[t],rows[s],q) + else: + t=e[1];q=F(e[2],e[3]);require(q!=0,'zero scale') + if dual:q=1/q + rows[t]={k:q*x for k,x in rows[t].items()} + +def invert_item(e,full): + if e[0]=='warp':return ['warp',e[1],-e[2]] + r=list(e) + if r[0]=='add':r[3]=-r[3] + else:r[2],r[3]=r[3],r[2] + return r + +def run_borrow(path,out,main,base,w,data,begin): + v,h,R=w['report']['v'],w['report']['h'],w['report']['R'];n=2*v+R + require((v,h)==(112,9),'wrong source geometry') + require(main is None,'--main parent interface is not available for coordinate-changed BORROW-WORD; use --base') + full=basis([1<=2*v,'correction source must be a remaining helper') + require(s not in entering,'correction source has nonzero entrance frame') + require(len(word)>=1 and all(1<=abs(o)<=K for o in word),'correction operator word') + require(c!=0 and c.denominator&(c.denominator-1)==0,'correction coefficient') + # the source is the lender of the operator it is read through + require(all(warps[abs(o)-1][1]==s for o in word),'correction source is not the lender of its operator') + # --- 4. frames: literal chain, monotone, paid profile --------------------------------------- + end=[full]*v+[basis([x for x in range(1,1<0 else list(to_),list(to_) if op_>0 else list(fr_),h) + require(cur[r_]==basis(fr_),'prelude warp frame mismatch '+str((r_,op_))) + cur[r_]=basis(to_) + else: + for q in registers(e):climb(q,e[-1]) + for e in Aord: + for q in registers(e):climb(q,e[-1]) + lev={int(t):basis(U) for t,U in w.get('target_levels',{}).items()} + require(all(cur[v+t]==lev.get(t,()) for t in range(v)),'target centre levels') + for q,U in zip(w['centers'],w['center_frames']): + U=basis(U);require(cur[q]==U,'center frame') + served={lev.get(e[1]-v,()) for e in w['cut'] if e[2]==q} + for T in sorted(served,key=lambda x:-len(x)): + require(contained(T,U),'center path not nested') + if T!=U:paid[len(U)-len(T)]+=1 + U=T + byposition={} + for op,rec in enumerate(warps,1):byposition.setdefault(rec[0],[]).append(op) + B=w['B'];forward=[] # chronological program of the (recorded) non-target word + for e in Aord:forward.append(e) + for p in range(len(B)+1): + for op in byposition.get(p,[]): + _,lender,cols,U,E=warps[op-1] + require(cur[lender]==basis(U),'warp frame mismatch '+str((op,lender,cur[lender],basis(U)))) + cur[lender]=basis(E);forward.append(['warp',lender,op]) + if p= word['prelude_events'] or s != 'A', 'no prelude edit') + pm.require(word[s][a:b] == e['old'], ('old gates differ from the declared preimage', rw['id'], s, a)) + pm.require(e['old'] != e['new'], 'nonvacuous edit') + for (c, d) in taken[s]: + pm.require(b < c or d < a, ('overlapping or adjacent rewrites', rw['id'], s, a)) + taken[s].append((a, b)) + edits.append((s, a, b, e['new'])) + for s, a, b, new in sorted(edits, key=lambda t: (t[0], -t[1], -t[2])): + x[s][a:b] = copy.deepcopy(new) + # phase warps address B positions: shift by the net length change of the B edits entirely before them + bedits = [(a, b, len(new) - (b - a)) for s, a, b, new in edits if s == 'B'] + for rec in x['warps']: + p = rec[0] + pm.require(not any(a < p < b for a, b, _ in bedits), 'no warp inside an edited B span') + rec[0] = p + sum(d for a, b, d in bedits if b <= p and a < p) + profile, inventory = pm.frame_report(x) + x['report']['local_profile'], x['report']['width_inventory'] = profile, inventory + z = copy.deepcopy(x) + z['A'] = z['A'][z['prelude_events']:] + x['cleanup'] = pm.derive_cleanup(z, pm.restored_of(word)) + pm.require({k for k in word if word[k] != x[k]} <= ALLOWED, 'only A, restore, report and cleanup change') + for k in ('cut', 'compensation', 'helper_final', 'start_extra', 'removed', 'prelude_events'): + pm.require(x[k] == word[k], ('unchanged section', k)) + if check_declared: + pm.require(profile == PROFILE and inventory == INVENTORY, ('declared paid profile and inventory', profile, inventory)) + ledger = dict(rewrites=[r['id'] for r in rewrites], local_profile=profile, width_inventory=inventory, + edits=len(edits), A_len=(len(word['A']), len(x['A'])), restore_len=(len(word['restore']), len(x['restore']))) + return x, ledger diff --git a/research/rank7-coupled-586-588-carrier-fold/vendor/preload_move.py b/research/rank7-coupled-586-588-carrier-fold/vendor/preload_move.py new file mode 100644 index 0000000000..55b435035b --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/vendor/preload_move.py @@ -0,0 +1,133 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Declared preload-move stage: two more staged quartets on the PR2857 shared-kernel words. + +Preload re-synthesis (quartets (456,457,466,467) and (458,459,464,465)) by Jeremy Kothe +(jeremykothe2), with AI assistance; the staged-kernel gate shapes, frame/inverse-cleanup +conventions and the dirt-entry supplier are credited in CREDITS.md (PR2857 Lyy-iiis, PR2863 +Dugongue, PR2833 Jeremy Kothe, PR2853 philippeVV). + +apply(word, patch) takes the decoded PR2857 shared-kernel word and a DECLARED patch input +that lists every changed gate. Every listed old gate must be present at its index, no +other gate may change, the changed sections are limited to +{A, B, compensation, start_extra, report, cleanup}, the frame/paid profile and width +inventory are re-derived exactly from the changed word and must equal the declaration, and +the inverse-reverse cleanup is re-derived. The inherited exact auditor (forward and dual +free-operator replay over every input column) is the separate semantic check. +No file, import, process or output is touched by apply(). +""" +import copy, hashlib, json +from collections import Counter + +SOURCE_CANONICAL = { + 'base': 'c0af0ef7ee6282e91f046d027983b35eaed7ebcb46489134d47e07724cf664bc', + 'extra': '61b20fbe78fdcbca0cde0597befcc254017ee206dad0724c576672aca690c66f', +} +ALLOWED_SECTIONS = {'A', 'B', 'compensation', 'start_extra', 'report', 'cleanup'} + +def require(ok, reason): + if not ok:raise ValueError(str(reason)) + +def canon(w):return hashlib.sha256(json.dumps(w,sort_keys=True,separators=(',',':')).encode()).hexdigest() + +def basis(vs): + piv={} + for a in vs: + while a: + bit=a.bit_length()-1 + if bit in piv:a^=piv[bit] + else:piv[bit]=a;break + for k in sorted(piv): + for j in piv: + if j>k and piv[j]>>k&1:piv[j]^=piv[k] + return tuple(piv[k] for k in sorted(piv,reverse=True)) + +def contained(a,b):return basis(a+b)==b + +def restored_of(w): + n=2*w['report']['v']+w['report']['R'] + return {g[1]-n for g in w['cleanup'] if g[1]>=n}|{g[2]-n for g in w['cleanup'] if g[0]=='add' and g[2]>=n} + +def derive_cleanup(w,restored): + v=w['report']['v'];n=2*v+w['report']['R'];full=list(basis([1<=224) + return {str(k):v for k,v in sorted(paid.items())},{str(k):v for k,v in sorted(inv.items())} + +def apply(word, patch): + """Return (changed word, ledger). Authenticates the decoded source first.""" + require(patch.get('stage')=='preload-move','stage tag') + digest=canon(word);require(digest==patch['source_canonical_sha256'],'source canonical hash differs from the declared source') + require(patch['variant'] in SOURCE_CANONICAL and SOURCE_CANONICAL[patch['variant']]==digest,'unauthorized decoded source SHA256') + x=copy.deepcopy(word) + # A: replacements and insertions, both addressed by index in the SOURCE A (before any edit). + ops=patch['A_edits'];seen=set();byp={};repl={} + for e in ops: + if e['op']=='replace': + i=e['index'];require(i not in seen and i not in repl,('duplicate A replace',i));require(word['A'][i]==e['old'],('A old gate mismatch',i,word['A'][i]));repl[i]=e['new'] + else: + require(e['op']=='insert' and 0<=e['before']<=len(word['A']),'A edit op');byp.setdefault(e['before'],[]).append(e['gate']) + A=[] + for p in range(len(word['A'])+1): + A.extend(copy.deepcopy(g) for g in byp.get(p,[])) + if p WORD and WORD -> FINAL-WORD; +(k) when invoked without --work, also runs check_allocation.py, check_cap.py and edits/edits_review.py. +Structure adapted from Mason Hale's PR2917 verify.py via PR2942/PR2979 verify.py (Marius-Paul Dumitrean) and extended by +dcharb78 for stage 4 (R1_E42, R2_E7, B_586_438, B_588_440). +""" +import argparse, contextlib, copy, gzip, hashlib, io, json, os, subprocess, sys, tempfile, time, types +from pathlib import Path + +P = Path(__file__).resolve().parent + + +def read(p): + b = p.read_bytes() + return json.loads(gzip.decompress(b) if b[:2] == b'\x1f\x8b' else b) + + +def sha(p): + return hashlib.sha256(p.read_bytes()).hexdigest() + + +def load(name, p): + m = types.ModuleType(name) + m.__file__ = str(p) + sys.modules[name] = m + exec(compile(p.read_bytes(), str(p), 'exec'), m.__dict__) + return m + + +def save_word(p, w): + p.write_bytes(gzip.compress(json.dumps(w, separators=(',', ':')).encode(), mtime=0)) + + +def run_verification(out, standalone=False): + begin = time.monotonic() + pins = read(P / 'PINS.json') + local = {f.relative_to(P).as_posix() for d in ('vendor', 'data') for f in (P / d).rglob('*') if f.is_file()} + assert local | {'producer.py', 'structure.py', 'tools/wordedit.py', 'construction/STAGE-PRICES.json'} <= set(pins), 'every local input pinned' + assert all(sha(P / n) == h for n, h in pins.items()), 'pinned bytes' + out.mkdir(parents=True) + pm = load('preload_move', P / 'vendor/preload_move.py') + dr = load('declared_rewrites', P / 'vendor/declared_rewrites.py') + de = load('declared_edits', P / 'edits/declared_edits.py') + gen = load('rank7_producer', P / 'producer.py') + aud = load('independent_paired_audit', P / 'vendor/audit_local.py') + structural = load('independent_paired_structure', P / 'structure.py') + we = load('rank7_wordedit', P / 'tools/wordedit.py') + record = read(P / 'data/STAGE1-FRAME-EDITS.json') + transforms = [read(P / f'data/TRANSFORM-{h}.json') for h in gen.HELPERS] + rewrites = read(P / 'data/REWRITES-2957.json') + edits_doc = read(P / 'edits/EDITS.json') + prices = read(P / 'construction/STAGE-PRICES.json') + weight = {int(r): c for r, c in prices['weights']['c'].items()} + BE = prices['weights']['break_even'] + + def cost(profile): + return sum(weight[int(r)] * n for r, n in profile.items()) + + def audit(word, name): + path = out / (name + '.json.gz') + save_word(path, word) + with contextlib.redirect_stdout(io.StringIO()): + return aud.run(path, out / (name + '.json')) + + def rejected(word, name): + try: + audit(word, name) + except (AssertionError, RuntimeError, ValueError) as error: + return str(error)[:240] + raise AssertionError('semantic mutant accepted by the auditor: ' + name) + + def cert_rejects(parent, transform, name): + try: + structural.check(parent, transform, aud) + except (AssertionError, KeyError, ValueError) as error: + return type(error).__name__ + ' ' + str(error)[:160] + raise AssertionError('mutant transform accepted by the certificate: ' + name) + + def producer_rejects(fn, name): + try: + fn() + except (AssertionError, KeyError, ValueError) as error: + return type(error).__name__ + ' ' + str(error)[:200] + raise AssertionError('mutant accepted by the producer: ' + name) + + def rereport(word): + try: + profile, inventory = pm.frame_report(word) + except ValueError: + return word # an illegal frame chain keeps the claimed report; the auditor recounts it + word['report']['local_profile'], word['report']['width_inventory'] = profile, inventory + return word + + def joint_claim(word): + if (word['report']['local_profile'], word['report']['width_inventory']) != (gen.STAGE1_PROFILE, gen.STAGE1_INVENTORY): + raise ValueError('declared joint stage-1 invoice %s' % word['report']['local_profile']) + + def hyperplanes_of(frame): + vectors = [v for v in range(1, 512) if gen.inside([v], frame)] + for m in range(1, 512): + Hm = list(pm.basis([v for v in vectors if (v & m).bit_count() % 2 == 0])) + if len(Hm) == len(pm.basis(frame)) - 1: + yield Hm + + def recut(word, restored): + z = copy.deepcopy(word) + z['A'] = z['A'][z['prelude_events']:] + return pm.derive_cleanup(z, restored) + + def ok_audit(word, name, buffers, profile=None, inventory=None): + r = audit(word, name) + assert r['status'] == 'PASS_INDEPENDENT_EXACT_BORROWING_WORD' and r['orientations'] == {'forward': 'PASS', 'dual': 'PASS'} + assert r['independent_inputs'] == 632 and r['restored_cold'] == r['zero_buffers'] == buffers + if profile is not None: + assert {str(k): v for k, v in r['local_profile'].items()} == profile + assert {str(k): v for k, v in r['width_inventory'].items()} == inventory + return {key: r[key] for key in ('status', 'independent_inputs', 'restored_cold', 'zero_buffers', 'local_profile', + 'width_inventory', 'local_mass', 'orientations', 'content_sha256')} + + records, controls = {}, {} + for tag in ('base', 'extra'): + parent = read(P / f'data/PARENT-{tag}.json.gz') + shipped = read(P / f'data/WORD-{tag}.json.gz') + final_shipped = read(P / f'edits/FINAL-WORD-{tag}.json.gz') + words = gen.stages(parent, record, transforms, rewrites) + assert words[-1] == gen.apply(parent, record, transforms, rewrites) == shipped, 'complete stage-3 producer reconstruction' + rec = {'parent_sha256': sha(P / f'data/PARENT-{tag}.json.gz'), + 'word_sha256': sha(P / f'data/WORD-{tag}.json.gz'), + 'final_word_sha256': sha(P / f'edits/FINAL-WORD-{tag}.json.gz')} + # ---------------- stage 1: joint rank-7 end frames (frame-only) + x1 = words[0] + lowered = {} + for gname, (W, hs) in gen.GROUPS.items(): + for h in hs: + old, new = parent['helper_final'][str(h)], x1['helper_final'][str(h)] + assert new == W and gen.inside(new, old) and len(new) == len(old) - 1, ('hyperplane of the old end frame', h) + lowered[h] = {'group': gname, 'old_dim': len(old), 'new_dim': len(new), 'entering': str(h) in parent['start_extra']} + assert gen.lowered_fit(x1) == [], 'every gate touching a lowered helper fits' + touching = sum(1 for s in ('A', 'B', 'restore') for g in x1[s] if g[0] in ('add', 'scale') and set(gen.roles(g)) & set(lowered)) + assert all(p_[:-1] == q_[:-1] for s in ('A', 'B', 'restore') for p_, q_ in zip(parent[s], x1[s])) and x1['cleanup'] == parent['cleanup'] + a1 = ok_audit(x1, f'{tag}-stage1', gen.PARENT_BUFFERS, gen.STAGE1_PROFILE, gen.STAGE1_INVENTORY) + d1 = cost(x1['report']['local_profile']) - cost(parent['report']['local_profile']) + rec['stage1'] = {'groups': {g: {'W': W, 'helpers': hs} for g, (W, hs) in gen.GROUPS.items()}, 'lowered': lowered, + 'frame_edits': len(record['frame_edits']), 'frame_edits_by_section': {s: sum(1 for e in record['frame_edits'] if e['section'] == s) for s in ('A', 'B', 'restore')}, + 'gates_touching_lowered_helpers_all_inside_W': touching, 'audit': a1, 'local_profile': x1['report']['local_profile'], + 'width_inventory': x1['report']['width_inventory'], 'literal_price_units': d1} + # stage-1 controls + name = f'{tag}-stage1' + for gname, (W, hs) in gen.GROUPS.items(): + bad = copy.deepcopy(x1) + for h in hs[1:]: + bad['helper_final'][str(h)] = list(parent['helper_final'][str(h)]) + rereport(bad) + verdict = audit(bad, f'{name}-one-alone-{gname}')['status'] # a valid word, priced below the joint claim + extra = cost(bad['report']['local_profile']) - cost(x1['report']['local_profile']) + joint = next(r for r in prices['stage1']['groups'] if r['group'] == gname) + alone_margin = joint['joint_margin'] - extra + (len(hs) - 1) * BE + assert alone_margin < 0 < joint['joint_margin'], ('one helper alone must lose', gname, alone_margin) + claim = producer_rejects(lambda: joint_claim(bad), 'one-alone') + controls[f'{name}-one-helper-alone-{gname}'] = {'auditor': verdict + ' (a valid word)', 'joint_claim': claim, + 'kept_helper': hs[0], 'reverted_helpers': hs[1:], + 'margin_alone_units': alone_margin, 'margin_joint_units': joint['joint_margin']} + # wrong subspace: group A's helpers end at another hyperplane of their old end frame that misses their gates + Wa, ha = gen.GROUPS['A'] + old = parent['helper_final'][str(ha[0])] + last = [g[-1] for s in ('A', 'B', 'restore') for g in x1[s] if g[0] in ('add', 'scale') and ha[0] in gen.roles(g)][-1] + wrong = next(Hm for Hm in hyperplanes_of(old) if Hm != Wa and not gen.inside(last, Hm)) + bad = copy.deepcopy(x1) + for h in ha: + bad['helper_final'][str(h)] = list(wrong) + controls[f'{name}-wrong-subspace'] = {'auditor': rejected(rereport(bad), f'{name}-wrong-subspace'), + 'fit_check': 'rejected: %d gates outside the end frame' % len(gen.lowered_fit(bad, {'A': (wrong, ha)})), 'W_wrong': wrong} + assert gen.lowered_fit(bad, {'A': (wrong, ha)}) + # an omitted gate frame edit on a lowered helper, and an omitted partner-only edit (claimed report kept) + touch = [e for e in record['frame_edits'] if set(gen.roles(e['gate'])) & set(lowered)] + partner = [e for e in record['frame_edits'] if not set(gen.roles(e['gate'])) & set(lowered)] + for label, e in (('omit-gate-frame-edit', touch[-1]), ('omit-partner-frame-edit', partner[0])): + bad = copy.deepcopy(x1) + assert bad[e['section']][e['index']][:-1] == e['gate'] and bad[e['section']][e['index']][-1] == e['new_frame'] + bad[e['section']][e['index']][-1] = list(e['old_frame']) + controls[f'{name}-{label}'] = {'auditor': rejected(bad, f'{name}-{label}'), 'edit': [e['section'], e['index'], e['gate']]} + bad = copy.deepcopy(x1) + bad['report'] = copy.deepcopy(parent['report']) + controls[f'{name}-stale-report'] = {'auditor': rejected(bad, f'{name}-stale-report')} + bad = copy.deepcopy(x1) + bad['helper_final'][str(ha[0])] = list(parent['helper_final'][str(ha[0])]) + controls[f'{name}-widened-end-frame-claimed-report'] = {'auditor': rejected(bad, f'{name}-widened-end-frame')} + # ---------------- stage 2: five paired extractions + steps, w = [], x1 + for k, t in enumerate(transforms, 1): + h, n = t['helper'], w['prelude_events'] + cert = structural.check(w, t, aud) + assert cert['status'] == 'PASS_EXACT_TWO_SIDED_SUBSPACE_CERTIFICATE' and cert['helper'] == h + child = words[k] + assert child == gen.apply_stage(w, t) + frame = gen.hyperplane(t['normal']) + assert child['helper_final'][str(h)] == frame and len(child['helper_final']) == gen.PARENT_BUFFERS + k + ak = ok_audit(child, f'{tag}-stage2-step{k}-{h}', gen.PARENT_BUFFERS + k) + name = f'{tag}-stage2-step{k}-{h}' + bad = copy.deepcopy(child); del bad['A'][n] + bad['cleanup'] = recut(rereport(bad), set(map(int, bad['helper_final']))) + controls[name + '-drop-input-gate'] = {'auditor': rejected(bad, name + '-drop-input-gate'), + 'certificate': cert_rejects(w, dict(t, before=t['before'][1:]), name + '-drop-input-gate')} + i = next(j for j, g in enumerate(t['after']) if g[0] == 'add') + bad = copy.deepcopy(child); g = bad['restore'][len(w['restore']) + i]; g[3] = -g[3] + bad['cleanup'] = recut(rereport(bad), set(map(int, bad['helper_final']))) + after = copy.deepcopy(t['after']); after[i][3] = -after[i][3] + controls[name + '-flip-output-coefficient'] = {'auditor': rejected(bad, name + '-flip-output-coefficient'), + 'certificate': cert_rejects(w, dict(t, after=after), name + '-flip-output-coefficient')} + wrong = gen.hyperplane(t['normal'] ^ 1) + bad = copy.deepcopy(child) + for g in bad['restore'][len(w['restore']):]: + g[-1] = list(wrong) + bad['helper_final'][str(h)] = list(wrong) + bad['cleanup'] = recut(rereport(bad), set(map(int, bad['helper_final']))) + controls[name + '-wrong-hyperplane'] = {'auditor': rejected(bad, name + '-wrong-hyperplane'), 'normal': t['normal'] ^ 1} + bad = copy.deepcopy(child) + bad['cleanup'] = recut(bad, set(map(int, w['helper_final']))) + controls[name + '-stale-cleanup'] = {'auditor': rejected(bad, name + '-stale-cleanup')} + assert child['compensation'] != w['compensation'] + bad = copy.deepcopy(child); bad['compensation'] = copy.deepcopy(w['compensation']) + controls[name + '-stale-compensation'] = {'auditor': rejected(bad, name + '-stale-compensation')} + for e in t['frame_changes']: + bad = copy.deepcopy(child) + assert bad[e['section']][e['index']][:-1] == e['gate'] and bad[e['section']][e['index']][-1] == e['new_frame'] + bad[e['section']][e['index']][-1] = list(e['old_frame']) + controls[name + '-omit-frame-change'] = {'auditor': rejected(bad, name + '-omit-frame-change')} + dk = cost(child['report']['local_profile']) - cost(w['report']['local_profile']) + steps.append({'step': k, 'helper': h, 'normal': t['normal'], 'hyperplane': frame, 'inputs': len(t['before']), 'outputs': len(t['after']), + 'frame_changes': len(t['frame_changes']), 'certificate': {key: cert[key] for key in ('status', 'helper', 'alpha', 'y', 'u', 'v')}, + 'audit': ak['status'], 'local_profile': child['report']['local_profile'], 'width_inventory': child['report']['width_inventory'], + 'buffers': len(child['helper_final']), 'literal_price_units': dk}) + w = child + rec['stage2'] = {'steps': steps, 'local_profile': w['report']['local_profile'], 'width_inventory': w['report']['width_inventory'], + 'literal_price_units': cost(w['report']['local_profile']) - cost(x1['report']['local_profile'])} + # ---------------- stage 3: fourteen declared PR2957 rewrites (Jeremy Kothe) + x2, x3 = words[-2], words[-1] + y, ledger = gen.apply_rewrites(x2, rewrites) + assert y == x3 + a3 = ok_audit(x3, f'{tag}-final', gen.BUFFERS, gen.PROFILE, gen.INVENTORY) + name = f'{tag}-stage3' + by = {r['id']: r for r in rewrites} + + def edits(rid, kind): + return [e for e in by[rid]['edits'] if (e['new'] if kind == 'insert' else e['old']) and not (e['new'] and e['old'])] + + def where(word, sec, gate): + hits = [i for i, g in enumerate(word[sec]) if g == gate] + assert len(hits) >= 1 + return hits[0] + restored = set(map(int, x3['helper_final'])) + + def own(word): # each gate mutant carries the report and cleanup re-derived from its own forward word + rereport(word) + word['cleanup'] = recut(word, restored) + return word + ins, dele = edits('5997', 'insert')[0], edits('5997', 'delete')[0] + bad = copy.deepcopy(x3) + shift = len(ins['new']) if ins['section'] == dele['section'] and ins['start'] <= dele['start'] else 0 + bad[dele['section']].insert(dele['start'] + shift, copy.deepcopy(dele['old'][0])) + controls[name + '-remove-one-deletion-5997'] = {'auditor': rejected(own(bad), name + '-remove-one-deletion')} + bad = copy.deepcopy(x3); bad[ins['section']].pop(where(bad, ins['section'], ins['new'][0])) + controls[name + '-drop-inserted-gate-5997'] = {'auditor': rejected(own(bad), name + '-drop-inserted-gate')} + g6004 = edits('6004', 'insert')[0] + bad = copy.deepcopy(x3); j = where(bad, g6004['section'], g6004['new'][0]); bad[g6004['section']][j][3] = -bad[g6004['section']][j][3] + controls[name + '-flip-transported-coefficient-6004'] = {'auditor': rejected(own(bad), name + '-flip-transported-coefficient')} + stale = copy.deepcopy(rewrites) + e3779 = next(e for r in stale if r['id'] == '3779' for e in r['edits'] if e['old']) + e3779['start'] += 1; e3779['stop'] += 1 + controls[name + '-stale-preimage-3779'] = {'applier': producer_rejects(lambda: dr.apply(x2, stale, check_declared=False), 'stale-preimage')} + assert x3['warps'] != x2['warps'] + bad = copy.deepcopy(x3); bad['warps'] = copy.deepcopy(x2['warps']) + controls[name + '-warp-positions-not-shifted'] = {'auditor': rejected(own(bad), name + '-warp-positions-not-shifted')} + bad = copy.deepcopy(x3); bad['cleanup'] = copy.deepcopy(x2['cleanup']) + assert bad != x3 + controls[name + '-stale-cleanup'] = {'auditor': rejected(bad, name + '-stale-cleanup')} + sw = by['swap3749']; moved_new = next(e for e in sw['edits'] if e['new'])['new'][0]; moved_old = next(e for e in sw['edits'] if e['old'])['old'][0] + assert moved_new[:-1] == moved_old[:-1] and moved_new[-1] != moved_old[-1] + bad = copy.deepcopy(x3); bad['A'][where(bad, 'A', moved_new)] = copy.deepcopy(moved_old) + controls[name + '-swap-frame-not-resolved-3749'] = {'auditor': rejected(bad, name + '-swap-frame-not-resolved')} + rec['stage3'] = {'rewrites': ledger['rewrites'], 'classes': sorted({r['cls'] for r in rewrites}), 'edits': ledger['edits'], + 'A_len': ledger['A_len'], 'restore_len': ledger['restore_len'], 'local_profile': x3['report']['local_profile'], + 'literal_price_units': cost(x3['report']['local_profile']) - cost(x2['report']['local_profile']), + 'credit': 'Jeremy Kothe (jeremykothe2), PR2957: rewrites and applier (vendor/declared_rewrites.py, byte-identical)'} + # ---------------- stage 4: declared restore skips + coupled 586 & 588 carrier folds + x4, ledger4 = gen.apply_declared_edits(x3, edits_doc['edits'][tag], edits_doc['declared']) + assert x4 == gen.apply(parent, record, transforms, rewrites, edits_doc['edits'][tag], edits_doc['declared']) == final_shipped, 'complete stage-4 producer reconstruction' + a4 = ok_audit(x4, f'{tag}-stage4-final', gen.BUFFERS, gen.FINAL_PROFILE, gen.FINAL_INVENTORY) + name4 = f'{tag}-stage4' + bad = copy.deepcopy(x4); bad['B'].insert(52, copy.deepcopy(x3['B'][52])) + for wp in bad['warps']: + if wp[0] >= 52: + wp[0] += 1 + controls[name4 + '-restore-deleted-B52-586'] = {'auditor': rejected(own(bad), name4 + '-restore-deleted-B52-586')} + bad = copy.deepcopy(x4); bad['B'].insert(56, copy.deepcopy(x3['B'][57])) + for wp in bad['warps']: + if wp[0] >= 56: + wp[0] += 1 + controls[name4 + '-restore-deleted-B57-588'] = {'auditor': rejected(own(bad), name4 + '-restore-deleted-B57-588')} + bad = copy.deepcopy(x4); bad['B'][782][3] = -bad['B'][782][3] + controls[name4 + '-flip-folded-carrier-586-438'] = {'auditor': rejected(own(bad), name4 + '-flip-folded-carrier-586-438')} + bad = copy.deepcopy(x4); bad['B'][787][3] = -bad['B'][787][3] + controls[name4 + '-flip-folded-carrier-588-440'] = {'auditor': rejected(own(bad), name4 + '-flip-folded-carrier-588-440')} + bad = copy.deepcopy(x4); bad['warps'] = copy.deepcopy(x3['warps']) + controls[name4 + '-warp-positions-not-shifted'] = {'auditor': rejected(own(bad), name4 + '-warp-positions-not-shifted')} + bad = copy.deepcopy(x4); bad['helper_final']['586'] = list(x3['helper_final']['586']) + controls[name4 + '-unlowered-586-claimed-report'] = {'auditor': rejected(bad, name4 + '-unlowered-586-claimed-report')} + bad = copy.deepcopy(x4); bad['cleanup'] = copy.deepcopy(x3['cleanup']) + controls[name4 + '-stale-cleanup'] = {'auditor': rejected(bad, name4 + '-stale-cleanup')} + d4 = cost(x4['report']['local_profile']) - cost(x3['report']['local_profile']) + rec['stage4'] = {'edits': [e['id'] for e in edits_doc['edits'][tag]], 'hunks': ledger4['hunks'], + 'lowered_helpers': ledger4['lowered_helpers'], 'audit': a4, + 'local_profile': x4['report']['local_profile'], 'width_inventory': x4['report']['width_inventory'], + 'literal_price_units': d4, 'net_margin_586_588_units': 1330} + # ---------------- stage-3 & stage-4 wordedit round-trip + changed = sorted(key for key in parent if parent[key] != shipped[key]) + assert set(changed) == {'A', 'B', 'restore', 'warps', 'helper_final', 'compensation', 'report', 'cleanup'}, changed + profile, inventory = pm.frame_report(shipped) + assert profile == shipped['report']['local_profile'] == gen.PROFILE and inventory == shipped['report']['width_inventory'] == gen.INVENTORY + spec = we.make_spec(parent, shipped) + assert we.apply_spec(parent, spec) == shipped and shipped['cleanup'] == we.derive_cleanup(shipped), 'overlay spec round trip' + spec_final = we.make_spec(parent, final_shipped) + assert we.apply_spec(parent, spec_final) == final_shipped and final_shipped['cleanup'] == we.derive_cleanup(final_shipped), 'final overlay spec round trip' + rec.update(changed_sections=changed, audit=a3, final_audit=a4, + frame_report={'local_profile': profile, 'width_inventory': inventory}, + final_frame_report={'local_profile': x4['report']['local_profile'], 'width_inventory': x4['report']['width_inventory']}, + total_literal_price_units=cost(x4['report']['local_profile']) - cost(parent['report']['local_profile']), + overlay_spec_sections={sec: {k_: len(v_) for k_, v_ in s.items()} for sec, s in spec['sections'].items()}) + records[tag] = rec + # evidence (not a gate): lane A's certified group-joint table against the literal stage-1 price + groups = prices['stage1']['groups'] + assert all(g['joint_margin'] == -g['joint_delta'] - len(g['helpers']) * BE for g in groups) + assert sum(g['joint_delta'] for g in groups) == records['base']['stage1']['literal_price_units'] == records['extra']['stage1']['literal_price_units'] + assert all(r[k]['literal_price_units'] == prices[k]['literal_price_units'] for r in records.values() for k in ('stage1', 'stage2', 'stage3')) + n_s1 = sum(1 for k in controls if '-stage1-' in k) + n_s2 = sum(1 for k in controls if '-stage2-' in k) + n_s3 = sum(1 for k in controls if '-stage3-' in k) + n_s4 = sum(1 for k in controls if '-stage4-' in k) + assert n_s1 == 2 * 10 and n_s2 == 2 * (5 * 5 + 1) and n_s3 == 2 * 7 and n_s4 == 2 * 7, (n_s1, n_s2, n_s3, n_s4) + assert all(sha(P / n) == h for n, h in pins.items()), 'input drift' + result = {'status': 'PASS_RANK7_JOINT_ENDFRAMES_THREE_STAGE_REPLAY', 'providers': records, 'semantic_controls': controls, + 'control_counts': {'stage1': n_s1, 'stage2': n_s2, 'stage3': n_s3, 'stage4': n_s4}, + 'price_evidence': {'weights': prices['weights'], 'stage1_groups': groups, + 'note': 'Search-time certified prices (lane A); evidence only. The literal stage prices above are recomputed from the frame-report profiles.'}, + 'local_profile': gen.PROFILE, 'width_inventory': gen.INVENTORY, + 'final_local_profile': gen.FINAL_PROFILE, 'final_width_inventory': gen.FINAL_INVENTORY, 'buffers': gen.BUFFERS, + 'seconds': round(time.monotonic() - begin, 1), + 'scope': 'Exact finite local identities, frame invoices and all-input forward/dual replay of every stage word; native, owner and outer admission are separate.'} + (out / 'RESULT.json').write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + print(result['status'], 'controls', len(controls), 'seconds', result['seconds'], flush=True) + + if standalone: + env = dict(os.environ, PYTHONDONTWRITEBYTECODE='1', OPENBLAS_NUM_THREADS='1', OMP_NUM_THREADS='1') + r_alloc = subprocess.run([sys.executable, '-B', str(P / 'check_allocation.py'), '--work', str(out / 'owners')], + env=env, stdin=subprocess.DEVNULL, capture_output=True, text=True) + if r_alloc.returncode: + print(r_alloc.stdout, r_alloc.stderr); raise SystemExit(r_alloc.returncode) + print(r_alloc.stdout.strip(), flush=True) + r_cap = subprocess.run([sys.executable, '-B', str(P / 'check_cap.py')], + env=env, stdin=subprocess.DEVNULL, capture_output=True, text=True) + if r_cap.returncode: + print(r_cap.stdout, r_cap.stderr); raise SystemExit(r_cap.returncode) + cap_res = json.loads(r_cap.stdout.strip().splitlines()[-1]) + print(cap_res['status'], 'cap_lower', cap_res['cap_lower'], 'headline', cap_res['headline'][:40], flush=True) + r_ed = subprocess.run([sys.executable, '-B', str(P / 'edits/edits_review.py'), '--source-dir', str(P / 'vendor'), + '--parent-base', str(P / 'data/WORD-base.json.gz'), '--parent-extra', str(P / 'data/WORD-extra.json.gz'), + '--candidate-base', str(P / 'edits/FINAL-WORD-base.json.gz'), '--candidate-extra', str(P / 'edits/FINAL-WORD-extra.json.gz'), + '--edits', str(P / 'edits/EDITS.json'), '--out-dir', str(out / 'edits-review')], + env=env, stdin=subprocess.DEVNULL, capture_output=True, text=True) + if r_ed.returncode: + print(r_ed.stdout, r_ed.stderr); raise SystemExit(r_ed.returncode) + print(r_ed.stdout.strip(), flush=True) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument('--work', type=Path, default=None) + a = ap.parse_args() + if not __debug__: + raise SystemExit('refusing python -O: the structural checker relies on assertions') + if a.work is not None: + out = a.work.resolve() + assert not out.exists() and not out.is_relative_to(P) + run_verification(out, standalone=False) + else: + with tempfile.TemporaryDirectory(prefix='rank7-verify-') as td: + run_verification(Path(td) / 'work', standalone=True) + + +if __name__ == '__main__': + main() diff --git a/research/rank7-coupled-586-588-carrier-fold/verify_manifest.py b/research/rank7-coupled-586-588-carrier-fold/verify_manifest.py new file mode 100644 index 0000000000..8c2441d392 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/verify_manifest.py @@ -0,0 +1,19 @@ +"""Verify the submitted package's exact file inventory and SHA256 bindings.""" +from hashlib import sha256 +import json +from pathlib import Path + +root = Path(__file__).resolve().parent +expected = json.loads((root / 'MANIFEST.json').read_text()) +actual = { + p.relative_to(root).as_posix(): sha256(p.read_bytes()).hexdigest() + for p in root.rglob('*') + if p.is_file() and '__pycache__' not in p.parts + and p != root / 'MANIFEST.json' +} +if actual != expected: + missing = sorted(expected.keys() - actual.keys()) + extra = sorted(actual.keys() - expected.keys()) + changed = sorted(k for k in expected.keys() & actual.keys() if expected[k] != actual[k]) + raise SystemExit(f'Manifest mismatch: missing={missing}, extra={extra}, changed={changed}') +print(f'PASS package manifest: {len(actual)} files') diff --git a/research/rank7-coupled-586-588-carrier-fold/verify_release.py b/research/rank7-coupled-586-588-carrier-fold/verify_release.py new file mode 100644 index 0000000000..a8b4c4ef73 --- /dev/null +++ b/research/rank7-coupled-586-588-carrier-fold/verify_release.py @@ -0,0 +1,96 @@ +"""Release proof for coupled B+restore dying-helper carrier folds (B_586_438, B_588_440) and restore carrier/pivot skips (R1_E42, R2_E7) on PR2979's (mdumitrean) words and literal T74 allocation (T74_optimal_idle39). + +Credit first: PR2979 (mdumitrean, Marius-Paul Dumitrean): the words, the rank-7 overlay, the literal allocation and all checkers; PR3015 (Jeremy Kothe, jeremykothe2): the declared restore-edit stage and edit R1; PR3042 (dcharb78): the six restore carrier/pivot skips (R1_E42, R2_E7); PR2969 (Dugongue); PR2966 / PR2957 / PR2948 (Jeremy Kothe); PR2942 and PR2930 (mdumitrean); PR2917 (mason-hale); PR2908 (jeremydiviney); PR2894 and PR2833 (Jeremy Kothe, jeremykothe2, with AI assistance); PR2863, PR2839 / PR2827 / PR2824 (Dugongue); PR2857 / PR2848 (Lyy-iiis); PR2853 (philippeVV); PR2843 (mdumitrean) lineage. +Steps: manifest; exact kappa gates (PR2827 ... PR2979, PR3015, PR3042) on CLAIM.json; registered checks; reproduce.py (exact Git exports, fresh retained bootstrap, fresh native + complete admission + outer release). +""" +import argparse, hashlib, json, os, subprocess, sys, time +from fractions import Fraction +from pathlib import Path + +PACKAGE = Path(__file__).resolve().parent +os.environ['PYTHONINTMAXSTRDIGITS'] = '0' +sys.set_int_max_str_digits(0) + +# exact kappa_decimal of each earlier record, from its own claim +GATES = [ + ('PR2827', '0.0017177952226165877431979999999999999999999998999999999999999999999999'), + ('PR2833', '0.0017186574371668559556934576143242804099649746929384057447660430618800378183571027227751435674735644266502436538360977054951338532026077864564717970089316298262848001430619258579764267387679157253589230092297705246349924829477438272038534458128153579339233372551498580288934448391286648133385250001561883571557568481670678572755364992180519866126424512015508246826379600171345871649273891524610346875481702323641480841819494871599970352648413519175382027670378809839339557435870343275462077109682392465994931422828896006323493721749224086433406739122826556506660291923774958911248379708488867136219017969687783639794423745846431998354000629604713009674880531419850590551533681267248441148929714873056671707368310142645201721225845565753260767164900976306634132256585854696146891742640259102164345060552688098920233899572100225273052195218406195238281244911985459541305205282130031980866953374248977265695927525028574437780772292075551831096337254028899004835738122070667605392595534393072713118820139164833259376147262674160887126565148708574029649559412631953495018944348666596351342587558250773425928871189683115965705267436438387096822518784488785605009977874176809482832315601610220722735020042386282420720158513381285320539086669152331709491278000050802176994425417958472436945929684360433686296997630684626369242924755608569264402668844097561164649905467697484340453084843585467761162546799061505405446580358260961731723054334158068636694082665619605335713967625024490137782213958409799751014897238799035118748013152307776924495573527075215850298288126703779286830770058166674737595998051122269776960603212714220740015911235385994016571957520587790540380255574642451287415998438639670044721750996910679896118442072989637960021846179774929532634810979781526825202091064143447550401037956168429417428802874510565760725145793697778307963968590690836429758883286583035942120869880952321072838123211658022276315749989430800252428797824728736070783864006154794733718886396821184579352497014737552396648994078257337943242770753659688122937729736682229465509261927273192935662942689564521538213644862363852534960597903679364594760521718874174626608251365696917889343226910244886154550750711332471571160543048297369802106821207628537498383445387653560175336944546900103503996186884872543920778861407556714858517377003152542148063849643242384266037395070179753584611716153981557966416588880000135368000934558193397419070058244094361673855236996548006841516303762762739068412193411453317885381706585037441816716917580084757698540817545585741734921464591697312277206031362217694937366866726508039946820688080121613764285796176603358606739555163139962246885121765417719079958311921807809984279867360387017833742410588472566634435012483055421625420751795895550846196066364773728404870142361572041365285243291914658877100790354765681937955587126925781207741462926235768842317325705488924282871722130257637788067000085120230853259311008603415633392994325933468175810242707293885996635190124321153385416698106339999999999999999999998999999999999999999999999'), + ('PR2843', '0.0017186582778417198986259999999999999999999998999999999999999999999999'), + ('PR2848', '0.0017186585083049300048189999999999999999999998999999999999999999999999'), + ('PR2853', '0.0017193776586975866590473384172607721814008956451425009430412460057503404071040423905924370921614016936349599996575798051733752076399828661071424528133116204108665576478204661464919617598343585484524702974017289809640608310940007596504547313171417642290767559750850327036443763958949276701315614084182582550782294614926854166678633518165095574636737913611722939423541165512669948579876694862940820794322681604047035649250603372674813493877135736770522694109132099158577487850859689383618416103013619426863008011594203958829773923918309467835785404794536680317802530438714723754082219296741326678063354545691266197656204485046940007194603764227886842657612702577257578902524058571682295826925682659917730305714815492526014996524819730258810160527078502095826534892562388431748401788169450709875893003253797487136842479124101169429105650760396697579174626680372202297456465619874841336521809586652402780111990386170172268373381842093293788010598379355684853890605248212741574284011514597757649218351744131074209720903563888742546518188979893906923159239618928523556755972597200527787486209886115453356488096913360689147838372739437326267972125792191920918825536672424513817139955549084830633129444135653843199862948309240531966991187940149380228286528014102762776155575447803552367005005534517354452699818957501259721372120542828957754277842675408852526958902205491479144856936386554518686702861962651880585424919584495474934784892039256289208222943383941527092570568397219339705279712429705426951822294004077902292782618818113902694452450291459939846428719161657151417208049935288685647694598005341935498511152918946247839959268670317549572412477693151973835249041678167828816827686753069808718673844160892815836102376757675036671018117066778433539739956663244138849798929700922384646175178750362230036206095408201215314251989510461803596671705632898242900785593975006517640755013867661549498301431681610793069670853314385776720226983596686726441370877445087824720595253572015639265264941101671404840359960081380843733908048006019122154575405156576095586845977194320757564357586250358409962743428564662035542609645007957479195198614633133624526616981357915749249122668331971690422289899472621447353255713838757067555955951769384517017145131540398127612264007701902090486661652880678411039240152421254959123182586150102956220415049232456104551435853722705332378116189133196894624473164964161901278464988044812290830287125207271322696356586817309654257541649542793451050763742999612659361815742594876874365619721197108394736060040665311340944580538964981258346873524367079294647209815778430967907073900857586430360872971473933612881754758496436326352000702257338896725815583758704393752256248604713672679221076879476083069636687621530504181022342124580618983319715908394692370795173629167220944795079202047435677777747836298580119166304268329679299693147333849102451075930795429135156954198334432354022675041138889869128019798693289176932374813976966998045997730255650851999384815082333308542575305739689999999999999999999998999999999999999999999999'), + ('PR2857', '0.0017200966286848326009719999999999999999999998999999999999999999999999'), + ('PR2863', '0.0017201008054168859279439999999999999999999998999999999999999999999999'), + ('PR2875', '172010080541688592794400707560633553119999999999999999999998999999999999999999999999/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000'), + ('PR2894', '0.0017201845283774695330739999999999999999999998999999999999999999999999'), + ('PR2908', '0.0017203983373542378859309999999999999999999998999999999999999999999999'), + ('PR2917', '0.0017215886471978018806049999999999999999999998999999999999999999999999'), + ('PR2930', '0.0017224999064432745643569999999999999999999998999999999999999999999999'), + ('PR2942', '0.0017228163198632143279959999999999999999999998999999999999999999999999'), + ('nine-rewrite package on PR2930 (Kothe)', '0.0017233564872443557989099999999999999999999998999999999999999999999999'), + ('pkgW3 / PR2957 (Kothe)', '0.0017237174150707381709709999999999999999999998999999999999999999999999'), + ('pkgX / PR2966 (Kothe): fourteen declared rewrites on PR2942', '0.0017240342725234521774119999999999999999999998999999999999999999999999'), + ('PR2969 (Dugongue): pkgX edits with a T370 cap fill (finite candidate)', '0.0017240352247481048785499999999999999999999998999999999999999999999999'), + ('PR2979 (mdumitrean): rank-7 joint end frames, five more paired extractions, fourteen rewrites', '0.0017290339826465135177169999999999999999999998999999999999999999999999'), + ('PR3015 (Kothe): one declared restore edit R1 on PR2979', '0.0017291509735342244286949999999999999999999998999999999999999999999999'), + ('PR3042 (dcharb78): six restore carrier/pivot skips R1_E42, R2_E7 on PR2979', '0.0017297361663879159868119999999999999999999998999999999999999999999999'), +] + + +def digest(p): + return hashlib.sha256(p.read_bytes()).hexdigest() + + +def gate(kappa): + for name, value in GATES: + if Fraction(kappa) <= Fraction(value): + raise SystemExit('ledger kappa does not exceed ' + name) + + +def run(label, work, command, env): + log = work / (label + '.log') + with log.open('w', encoding='utf-8', newline='\n') as f: + r = subprocess.run(command, env=env, stdin=subprocess.DEVNULL, stdout=f, stderr=subprocess.STDOUT) + if r.returncode: + raise SystemExit('%s failed (exit %d); tail: %s' % (label, r.returncode, log.read_text(encoding='utf-8', errors='replace')[-800:])) + return log + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--main', type=Path, required=True) + ap.add_argument('--work', type=Path, required=True) + ap.add_argument('--prepared-native', type=Path, help='unused (this package always prepares the changed native chains freshly and authenticates the retained ones)') + ap.add_argument('--jobs', type=int, default=4) + ap.add_argument('--python', type=Path, default=Path(sys.executable), help='interpreter with the exact requirements.txt pins (see VERIFY.json / requirements)') + a = ap.parse_args() + t = time.monotonic() + msha = digest(PACKAGE / 'MANIFEST.json') + claim = json.loads((PACKAGE / 'CLAIM.json').read_text(encoding='utf-8')) + kappa = Fraction(claim['kappa']) + if kappa != Fraction(claim['kappa_decimal']): + raise SystemExit('CLAIM kappa / kappa_decimal disagree') + gate(kappa) # cheap exact gate first + a.work.mkdir(parents=True) + env = dict(os.environ, PYTHONDONTWRITEBYTECODE='1', PYTHONINTMAXSTRDIGITS='0', PYTHONUTF8='1') + run('manifest', a.work, [str(a.python), '-B', str(PACKAGE / 'verify_manifest.py')], env) + run('registered', a.work, [str(a.python), '-B', str(PACKAGE / 'run_registered.py')], env) + run('reproduce', a.work, [str(a.python), '-B', str(PACKAGE / 'reproduce.py'), '--repo', str(a.main), '--work', str(a.work / 'reproduce')], env) + result = json.loads((a.work / 'reproduce/RESULT.json').read_text(encoding='utf-8')) + if result['status'] != 'PASS_RANK7_EDITS_COMPLETE_REPLAY' or Fraction(result['kappa']) != kappa: + raise SystemExit('reproduced release does not match CLAIM.json') + gate(Fraction(result['kappa'])) + if digest(PACKAGE / 'MANIFEST.json') != msha: + raise SystemExit('Package manifest changed during verification') + kappa_decimal = claim['kappa_decimal'] + proof = ("Package manifest; exact gates against PR2827, PR2833, PR2843, PR2848, PR2853, PR2857, PR2863, PR2875, PR2894, PR2908, PR2917, PR2930, PR2942, the nine-rewrite package, PR2957 (pkgW3), PR2966 (pkgX), PR2969, PR2979, PR3015 and PR3042; run_registered.py " + "(independent review and tamper controls of the declared restore and coupled B+restore carrier-fold edit list R1_E42, R2_E7, B_586_438, B_588_440, PR2979's producer and four-stage replay, literal T74 owners of the fill, directed rational moment, fixed-inventory cap certificate, stored release binding); reproduce.py: exact Git exports of PR2894/PR2908/PR2917/PR2930/PR2833 and the pinned comparators, " + "fresh retained bootstrap, the declared preload, paired-extension, rank-7 and declared-edit stages, fresh native chains " + "for both changed words, complete replica admission and the modern outer release. Conditional kappa %s." % kappa_decimal) + (a.work / 'RELEASE-RECEIPT.json').write_text(json.dumps(dict( + status='PASS_RELEASE', kappa_decimal=kappa_decimal, manifest_sha256=msha, proof=proof, + seconds=round(time.monotonic() - t, 2)), indent=2) + '\n', encoding='utf-8') + print('PASS_RELEASE', kappa_decimal, flush=True) + + +if __name__ == '__main__': + main()