diff --git a/research/paired-helper-extension/.gitattributes b/research/paired-helper-extension/.gitattributes new file mode 100644 index 0000000000..f7f56c2d0a --- /dev/null +++ b/research/paired-helper-extension/.gitattributes @@ -0,0 +1,5 @@ +# Preserve the exact pinned predecessor bytes, including CRLF source files. +vendor/** -text -whitespace +data/** -text +allocation/** -text +evidence/** -text diff --git a/research/paired-helper-extension/ALLOCATION-PINS.json b/research/paired-helper-extension/ALLOCATION-PINS.json new file mode 100644 index 0000000000..325f196087 --- /dev/null +++ b/research/paired-helper-extension/ALLOCATION-PINS.json @@ -0,0 +1,14 @@ +{ + "allocation/DISPATCH.json": "65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c", + "allocation/FILL.json.gz": "19b551af07274931b443ac42588e15df20ec0140fa69b54f3b62a4df9a54ff8e", + "allocation/ORDER.json": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1", + "allocation/PROFILE.json": "07ee0cfe8d88073de9b75cd3262a98f4ac428b1bdd3922b5a077dbf3436be00c", + "allocation/PROVIDERS.json": "1fbbe45a0b70b909bf764fab7d89ec05b10c6c3dec5340a59a69b871d309c6ab", + "allocation/SEARCH.json": "6e461e5746313dfefada9a7a07cddd363883adf39c84662cbb72edb3697f92ef", + "allocation/baseline/CLAIM.json": "2406680a07b43a69b0f12f8462cc43f3616f3c8cb0a46bc767541b45945cd2bf", + "allocation/baseline/ORDER.json": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1", + "allocation/baseline/PROFILE.json": "ab0840eda08fa501d444be22c7298bf38b70061b91964ad1b9dd9db388720199", + "allocation/vendor/PLAN.json.gz": "d566cfb87b71639d4138e1f89b543e2dd6a7772070226a2a14c799a6835bf21e", + "allocation/vendor/TEMPLATE.json.gz": "21297b20f1f2dc76eb9dd8124416068c3cb096bab9df17fa4da19bc68dfe082e", + "allocation/vendor/independent_owners.py": "77a848729159e271ba64f403dfd59dddb13044b17b2950fa56700f442e2fe461" +} diff --git a/research/paired-helper-extension/CLAIM.json b/research/paired-helper-extension/CLAIM.json new file mode 100644 index 0000000000..50cc0eeeba --- /dev/null +++ b/research/paired-helper-extension/CLAIM.json @@ -0,0 +1,35 @@ +{ + "baseline_head": "51309592971e3b5be935599eed2a95404dc7781e", + "baseline_kappa": "17203983373542378859309999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "baseline_pr": 2908, + "calls": 666, + "complete_package_manifest_sha256": "bf852fb4ecfa28dddfb8cc6fe7bf53019b3932114e01cba3e026b63ef2b1babd", + "complex_lower": "344317729439560376121/200000000000000000000000", + "gain": "595154921781997337/500000000000000000000000", + "helpers": 408, + "independent_inputs": 632, + "kappa": "17215886471978018806049999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017215886471978018806049999999999999999999998999999999999999999999999", + "live_families": 66304, + "native_receipt_sha256": "5c1ea6f03e48673d9b56563494fff2258ee18bc8dacdeb72ba5c07e2044008ca", + "physical_families": 66804, + "profile": { + "1": 1625724, + "2": 426240, + "24": 1, + "3": 191980, + "32": 207, + "4": 73260, + "48": 26958, + "5": 24951, + "6": 167, + "7": 45, + "8": 5328 + }, + "release_receipt_sha256": "f7639e51fd620070767b8e2a855a0a613ae9bfd19f86a1ba023d88316193ae06", + "replicas": 74, + "scope": "Conditional finite supplier/outer certificate. Inherited all-size/compiler/theorem hypotheses remain. No selected frontier change, optimality or independent-human-review claim. Both changed native chains are fresh; unchanged retained parent/native evidence is explicitly authenticated and reused.", + "source_manifest_sha256": "98d57c82a1c7318be3c330c3b66897844d57232f0aaeaea88fb4bebd0a1bedf1", + "status": "CONDITIONAL_CANDIDATE_COMPLETE_FINITE_RELEASE", + "zero_buffers": 82 +} diff --git a/research/paired-helper-extension/CONSTRUCTION.md b/research/paired-helper-extension/CONSTRUCTION.md new file mode 100644 index 0000000000..2704ab1525 --- /dev/null +++ b/research/paired-helper-extension/CONSTRUCTION.md @@ -0,0 +1,228 @@ +# Nine further paired helper extractions + +This construction starts from Jeremy Diviney's PR2908 at +`51309592971e3b5be935599eed2a95404dc7781e`, including its restored helper408. +It restores nine further arbitrary dirty helper inputs at rank8 instead of +rank9. Three directions fit the predecessor's terminal frames. Six more become +available after explicit changes to thirteen inherited gate frames. Every new +restored endpoint gets its own charged private zero buffer. + +The paired input/output method, its structural checker and its compensation +rule are inherited from PR2908. The new contribution is the ordered nine-step +composition, the six directions enabled by the declared frame changes, and +their complete allocation and admission. Jeremy Kothe's PR2894 supplies the +frame-accounting and inverse-cleanup routines. Further attribution is recorded +in `CREDITS.md` and retained source notices. + +## Exact two-sided certificate + +Fix the current word immediately before one extraction. Let `M` be its +complete non-target forward operator: the A gates after the entry prelude, +the B gates with their formal invertible warps, and the restore gates. Omit +target writes from this definition. Coefficients belong to the exact rational +free algebra of the warp operators and their inverses. Distinct operator words +are not identified by numerical evaluation. + +Let `H` contain the live, zero-entry helpers except for previously restored +helpers and the sources of the initial operator corrections. Let + +``` +E_n = {x in F_2^9 : x dot n = 0}. +``` + +For a nonzero nine-bit normal `n`, this is a rank8 hyperplane. The admissible +output registers `R` have terminal frames contained in `E_n`, after any +declared frame changes for this step. + +Choose a scalar row `alpha` and scalar column `y` supported on `R`, and scalar +vectors `u,v` supported on `H`, with + +``` +alpha M = u, M v = y, alpha y = 1. +``` + +These identities imply `u v = 1`. We also require `C v = 0`, where `C` is the +current scalar target-compensation map. The input and output changes `S,T` +are literal invertible dyadic gate sequences satisfying + +``` +S e_h = v, u S = e_h^T, +T y = e_h, e_h^T T = alpha. +``` + +Consequently, + +``` +(T M S) e_h = T M v = T y = e_h, +e_h^T (T M S) = alpha M S = u S = e_h^T. +``` + +Both the entire column and the entire row of helper `h` are therefore the +corresponding identity column and row. Its original arbitrary dirty input is +restored, and no other non-target output depends on that input. Restoring the +row alone, or preserving only the target map, would not establish this +isolation property. + +The unchanged PR2908 `structure.py` derives `S,T,M,alpha,y,u,v` from the +literal gates. It checks all seven displayed identities defining the paired +certificate over exact rational free-operator coefficients. It does not +accept search vectors or a numerical nullspace as evidence. `producer.py` +separately requires that the new compensation has no column for `h`; +because `S e_h = v`, this is the condition `C v = 0`. The full local auditor +checks the target map and its dual orientation separately. + +## Legal insertion and composition + +The input gates are inserted immediately after the unchanged entry prelude. +They use only unprotected live zero-entry helpers and have frame zero. Their +coefficients are dyadic. Thus they neither modify a prior restored endpoint +nor alter an initial operator-correction source. All output gates for a step +use its single rank8 frame `E_n` and are appended to the current restore +sequence. + +The target compensation is replaced by `C S`. The producer computes this +right multiplication by visiting the literal input gates in reverse order. +The initial operator corrections are unchanged. The cut, warp interfaces, +ports, target levels, removed helpers and entry prelude are also unchanged. +Exactly these six word sections change: `A`, `restore`, `helper_final`, +`compensation`, `report` and `cleanup`. + +Inverse-reverse cleanup is regenerated from the full new word at every step. +The new isolated cold coordinate is included in its protected cold set and +receives one additional private zero buffer. The local auditor checks the +resulting restore/isolation and zero-buffer identities; native admission +checks the realized operator program and its complete physical contract. + +Composition is sequential. Each certificate is derived against the result +of the preceding step, and its protected set includes every endpoint already +extracted. The producer enforces this exact helper order: + +| Step | Helper | Hyperplane normal | Inherited frame edits | Per-call profile change | Private buffers | +| --- | ---: | ---: | ---: | --- | ---: | +| Parent PR2908 | 408 already present | 52 | — | — | 73 | +| 1 | 424 | 52 | 0 | `3H1 - 2H2` | 74 | +| 2 | 428 | 76 | 0 | `3H1 - 2H2` | 75 | +| 3 | 412 | 127 | 0 | `3H1 - 2H2` | 76 | +| 4 | 331 | 30 | 2 | `H2 + 3H3 - 3H4` | 77 | +| 5 | 299 | 51 | 2 | `H2 + 3H3 - 3H4` | 78 | +| 6 | 320 | 75 | 2 | `H2 + 3H3 - 3H4` | 79 | +| 7 | 511 | 85 | 2 | `H2 + 3H3 - 3H4` | 80 | +| 8 | 304 | 102 | 2 | `H2 + 3H3 - 3H4` | 81 | +| 9 | 499 | 120 | 3 | `H2 + 3H3 - 3H4` | 82 | + +Here `Hr` denotes one rank-r term in the paid profile. The changes in the +table include the complete local frame bill for each step, not just its +new output gates. + +## Why the six frame changes expose new directions + +An extraction search restricted to the current literal terminal frames can +miss a direction whose supporting registers were lifted unnecessarily early. +For each of the last six steps, two inherited A additions can instead use a +particular rank7 frame. Their scalar coefficients and order stay unchanged. +The complete frame replay checks the resulting inclusions at every use and +the unchanged later cut and warp requirements. These substitutions allow the +small output support of the paired certificate to meet in its rank8 +hyperplane without the previous terminal-frame obstruction. + +The sparse output rows and columns for the six steps are: + +| Helper | `alpha` | `y` | +| ---: | --- | --- | +| 331 | `e331^T + e22^T - e34^T` | `e22` | +| 299 | `e299^T + e40^T - e54^T` | `e40` | +| 320 | `e320^T - e324^T + e326^T` | `e320` | +| 511 | `e511^T + e23^T - e322^T` | `e23` | +| 304 | `e304^T - e308^T + e310^T` | `e304` | +| 499 | `e499^T + e35^T - e306^T` | `e35` | + +The full input vectors generally have larger support; the literal dyadic +input gates in `data/TRANSFORM-.json` define them exactly. They are +checked against the current composed word, not reused from an earlier +nullspace computation. + +There are twelve rank8-to-rank7 edits in A. The thirteenth edit lowers the +existing `scale 499 by -1` restore gate from the full rank9 frame to the +normal120 rank8 frame. That scale is retained, and its coefficient is +unchanged. Omitting this edit would retain an unnecessary full-frame touch +and would not implement the stated endpoint and bill. + +Each transform records the section, index in that step's immediate parent, +complete scalar gate, old frame and new frame. `producer.refit` checks the +exact old gate and frame before applying the substitution. It applies the +edits before inserting that step's input and output gates. Verification uses +these fixed records and does not run a frame optimizer. Frame-only edits +leave the formal scalar/warp operator `M` unchanged; their geometric legality +and paid cost are separate obligations checked from the complete word. + +## Complete local accounting + +The predecessor and final local profiles are respectively + +``` +PR2908: 2407 H1 + 640 H2 + 262 H3 + 128 H4 + 26 H5 + 8 H8 +final: 2416 H1 + 640 H2 + 280 H3 + 110 H4 + 26 H5 + 8 H8. +``` + +Thus the exact local difference is + +``` +3(3H1 - 2H2) + 6(H2 + 3H3 - 3H4) + = 9H1 + 18H3 - 18H4. +``` + +The helper-width inventory changes from + +``` +{4:26, 5:2, 7:62, 8:87, 9:231} +``` + +to + +``` +{4:26, 5:2, 7:62, 8:96, 9:222}. +``` + +There remain 408 live helper roles per call and 632 independent inputs. +Exactly nine width9 roles become width8; no role disappears. The local +rank-mass decrease is nine, consistent with those nine endpoint changes. +The buffer count increases from 73 to 82. + +In the unchanged T74 architecture there are 666 calls and 271,728 helper +roles. Its complete physical stock is + +``` +66304 live families + 408 helper slots + 8 centres + + 82 private zero buffers + 2 scratch = 66804. +``` + +The saved local rank mass must reappear in the owner residual accounting. +Accordingly, the local difference alone is not a claim of a higher kappa. +The literal allocation must fit all whole-width roles in legal owner windows, +respect same-call family exclusions, and charge every unused remainder. Its +actual profile, physical stock and complete outer inequalities determine the +conditional exponent. + +## Evidence and scope + +`verify.py` authenticates every shipped vendor/data byte, derives each +transformation in order, checks its exact paired identities, reproduces both +published words, and runs the inherited full local auditor on both provider +variants. The auditor covers all 632 independent columns and the dual +orientation. The verifier also regenerates cleanup for 36 semantic mutants +and requires rejection: in each provider and at each step, it either removes +the final output gate or reverses that gate's sign. These checks establish +finite symbolic identities and local invoices, rather than tests of a sample +of integer inputs. + +`tools/build_extension.py` binds the local parent words to the exact PR2908 +export and appends this stage to its complete rebuild chain. The remaining +native, literal-owner, block-norm, physical-stock, prefix and outer-admission +checks are separate from the local certificate. Their final receipts, not +the local proof alone, authorize a published conditional kappa. No allocation +optimality or impossibility of further paired extractions is claimed. + +Even after complete finite admission, the multiplication bound remains +conditional on the repository's inherited all-size, compiler and outer-theorem +assumptions. This construction does not close those assumptions or establish +a measured practical multiplication speedup. diff --git a/research/paired-helper-extension/CREDITS.md b/research/paired-helper-extension/CREDITS.md new file mode 100644 index 0000000000..153868a3eb --- /dev/null +++ b/research/paired-helper-extension/CREDITS.md @@ -0,0 +1,40 @@ +# Credit and scope + +Mason Hale, with substantial OpenAI Codex assistance, contributed the ordered +nine-step paired extraction, the explicit frame refits enabling six of those +steps, the actual allocation repair, and the source-bound 82-buffer integration. +Parallel Codex agents searched, implemented and cross-checked the construction; +this is not independent human review. + +The immediate predecessor is Jeremy Diviney's PR2908 at +`51309592971e3b5be935599eed2a95404dc7781e`. His paired input/output extraction +of helper408, structural certificate, compensation rule, owner repair and +73-buffer integration are the foundation of this contribution. +`structure.py` is unchanged from that package. This work uses ordinary exact +linear algebra and does not claim to invent basis changes or nullspaces. + +Jeremy Kothe / `jeremykothe2`'s PR2894 at +`18d03c447886895ef9abf888398178e0428533ca` supplies the preload-resynthesized +quartets, T74 chronology, packing and inverse cleanup conventions. +`vendor/preload_move.py` is unchanged from the pinned parent package. + +The inherited chain includes Yiyang Lu / `Lyy-iiis`'s PR2857 staged shared +kernels and native/overlay/release tools; Dugongue's PR2863 packing; +Marius-Paul Dumitrean's PR2843/2802 pattern-flow and retired-helper lineage; +Jeremy Kothe's PR2833 dirt-entry supplier; Philippe Van Velzen's PR2853 cost +and block-energy work; and Tekalign's PR2751/2839 owner and admission tools. +The exact free-operator auditor retains icekylinx's attribution. The full +native replay retains the PR2768 sparse engine and PR2226 Clifford/operator +notices, without modifying their frozen sources. + +The public replay exports exact predecessor Git objects and checks their +complete manifests before executing their code. Admission adapters are derived +with explicit, counted source substitutions, preserving all inherited checks. +Changes include the declared source identity, the nine additional buffers and +the comparison against PR2908. The dimension73 and Sp(72,2) stock factor remain +the inherited quantities; neither is a buffer count. + +All new material is Apache-2.0. Source-specific notices remain in the pinned +predecessor exports and copied files. The selected result is unchanged. A +passing finite certificate remains conditional on the inherited all-size, +compiler and outer-theorem hypotheses. diff --git a/research/paired-helper-extension/MANIFEST.json b/research/paired-helper-extension/MANIFEST.json new file mode 100644 index 0000000000..80da18ce56 --- /dev/null +++ b/research/paired-helper-extension/MANIFEST.json @@ -0,0 +1,64 @@ +{ + ".gitattributes": "31d8f1090e5584ce239fe348aacfc6db5f02dedc01bc9c61b35c00a5671ea480", + "ALLOCATION-PINS.json": "7ab6a3add8b3eb285789cf36d8463335b391ec77f5d91b9a692453767b2d7f03", + "CLAIM.json": "e6c836c0178661a53a69cd91f29d83585e876f2511ff40c6b6204cd270fbdeac", + "CONSTRUCTION.md": "2efe3e56f914993aa34bcac29f6127828b9f50de1142b36a60fb991f2a2b778d", + "CREDITS.md": "a4e845cbd7cd430d7b53899b3148fb908c3af1924137412e44f19a9031fdc86a", + "PINS.json": "3d49ca62f3242444db52a21b9de10f18293757842f64a2b3189ad8f4e61fad36", + "README.md": "22469e9c1dae5103a5dcd804881235fe094c52197eff550065ba0b0e78b2535e", + "SOURCES.json": "23aa763c74ef9ec2378e59c7bb68d1692df77308c70157ed82aadcc2fb0b9209", + "TASK.json": "2b59f3a868876d184833b9329298a2a12de1c72cb6d4da43475f8bfde3191b55", + "VERIFY.json": "14da2d0b8056949eac7684ba86a07be3dfa450e7e68bbd35909b072e88000005", + "allocation/DISPATCH.json": "65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c", + "allocation/FILL.json.gz": "19b551af07274931b443ac42588e15df20ec0140fa69b54f3b62a4df9a54ff8e", + "allocation/ORDER.json": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1", + "allocation/PROFILE.json": "07ee0cfe8d88073de9b75cd3262a98f4ac428b1bdd3922b5a077dbf3436be00c", + "allocation/PROVIDERS.json": "1fbbe45a0b70b909bf764fab7d89ec05b10c6c3dec5340a59a69b871d309c6ab", + "allocation/SEARCH.json": "6e461e5746313dfefada9a7a07cddd363883adf39c84662cbb72edb3697f92ef", + "allocation/baseline/CLAIM.json": "2406680a07b43a69b0f12f8462cc43f3616f3c8cb0a46bc767541b45945cd2bf", + "allocation/baseline/ORDER.json": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1", + "allocation/baseline/PROFILE.json": "ab0840eda08fa501d444be22c7298bf38b70061b91964ad1b9dd9db388720199", + "allocation/vendor/PLAN.json.gz": "d566cfb87b71639d4138e1f89b543e2dd6a7772070226a2a14c799a6835bf21e", + "allocation/vendor/TEMPLATE.json.gz": "21297b20f1f2dc76eb9dd8124416068c3cb096bab9df17fa4da19bc68dfe082e", + "allocation/vendor/independent_owners.py": "77a848729159e271ba64f403dfd59dddb13044b17b2950fa56700f442e2fe461", + "check_allocation.py": "7c94239afa5d6cac3ce11926077f7bb02e2239c45f6ad37f8bedd5662bd4cc7d", + "data/PARENT-base.json.gz": "3657ad53ebe5f156f307a903479e919f2fe812811ce5d5f15e72c3aaf68dfde3", + "data/PARENT-extra.json.gz": "b975492ff4cbec0d619cdf2da34f55ce3b20c8a541132e4339cc6c8ae3b2e487", + "data/TRANSFORM-299.json": "781585f68449c30f63e40ee4bf58d1fa194e4faf8cf4394505437fc15137ba34", + "data/TRANSFORM-304.json": "024515c6e47d952dfaf307fcefda9f2106049ccc28875ae620d95241fdec72ed", + "data/TRANSFORM-320.json": "0e4c0216221ab21c4bf48a11eab34ff6cc245014d664dc1523cfae9d437dc00d", + "data/TRANSFORM-331.json": "355bcfd60ffcb672f66882e66bae1b046d1bfb979f725b411b034f811dfb68bb", + "data/TRANSFORM-412.json": "54328a8436d7abed6433da5e4384a36ad95b266070479b496e0e96416a5f5a79", + "data/TRANSFORM-424.json": "42747fa1332af1ca0827edebfff7490ee761f84f662527f593e975a502400dbc", + "data/TRANSFORM-428.json": "89e8fbd5a5d1d64d386cdc38f257cae18d8e7428e868f618ed1f0be5a22aba3e", + "data/TRANSFORM-499.json": "f86eef40cd96b45c67755903eae6a86432e2aeb6d53812621222db7c062d88f6", + "data/TRANSFORM-511.json": "48e0749f1c82594841c88923a38b0308ed777639631a4c3f2414500617f2e34b", + "data/WORD-base.json.gz": "fec3c120db1a35022944628d34b56a36f2456248c274c2eaba1a325cdc690ce8", + "data/WORD-extra.json.gz": "e4d0c617df85bf8a824ff68310ca3373dc017c1ebf9ea733056a3ee4a784b36f", + "evidence/ADAPTER-DERIVATION.json": "2e8d4ba717294738780e179d4ffc734c64d6d05a4ad3c50f60b6c64c737a1d5d", + "evidence/ADMISSION-RESULT.json": "1d580dc9edcc70d01a51a18c831aa3b0fc5885b49e9c815fc7d423d3da7701ad", + "evidence/COMPLETE-VERIFY-STAGES.json": "8ee4ed4639c3b8361d19d089044a929d93632496a4a1bca53c1c971b86c75930", + "evidence/ENVIRONMENT.json": "c6d3ce212bd2cd82d580158a39f6d7048c109daa1a695aa0d1eee280eb620213", + "evidence/EXACT-OWNER-MOMENT.json": "5be25d5479f63b7dab276f50973abc9334ec1a0dd1aec26369f4e7ea467768dd", + "evidence/FRESHNESS.json": "8ee0019c01005eec3eac244bacc0cf1377ff3a4242c7de438f3e6210a180d3c4", + "evidence/FULL-NATIVE-RECEIPT.json": "5c1ea6f03e48673d9b56563494fff2258ee18bc8dacdeb72ba5c07e2044008ca", + "evidence/FULL-NATIVE-RESULT.json": "94d76ba883bdb38d44dc960d615e42da9b06074a802305e596064600392ac5ec", + "evidence/FULL-REPLAY-RESULT.json": "737f4e56a3b736f0fe3d1dc5868042f716591b0f0fc6fb3b0c54bc838f23e604", + "evidence/FULL-REPLAY-STAGES.json": "a6e085252f39cb1a7b23ae49d73af36055327b19fd35e9c0ae67e33515ad311f", + "evidence/LOCAL-RESULT.json": "987cfcf4b8b76b2b8dfbc29bd40c9a93a4abac664c1bcbe6d692155845cc806c", + "evidence/PHYSICAL-INVOICE.json": "f9d865732c9e6cb918be3b8924350f852610bc0d7fa6b6c2a7c3d2cdb437c1ba", + "evidence/RELEASE-RECEIPT.json": "f7639e51fd620070767b8e2a855a0a613ae9bfd19f86a1ba023d88316193ae06", + "evidence/RETAINED-ORIGIN.json": "bc24de8d3d49a30cb37895b8780acbbe5255f76ccba446605ce29b721399bdf8", + "evidence/SEARCH.json": "5cf7d543c99dbefb8ac93e5c7f4c4f1254fa110ed8279fec22f92bf545623906", + "evidence/SOURCE-DERIVATION.json": "3e95bdf16abfe58d56642b7a2888bda3f770bc50aa05d1e576fb6b2920902278", + "producer.py": "c60546ca68a905d237401b2a255ccb60e17285b004211d523b5d8fd57b758f5a", + "reproduce.py": "64cd79b8460b0795097099b0c4615f17bde37ee3351157f74260ab89fbee8ece", + "run_registered.py": "a9b0e0bb04e8047509b1f5b8ba2b1d329a4d7f01e13f1384742752079e9182d6", + "structure.py": "83f63b6d9a1a543ecfa2c98d479dbe4e7a1c3caf6fd1c3566123308efbc32e96", + "tools/audit_allocation_moment.py": "d0b925495b0d28c107f72ec76a85e6e975db6f46396d70ae70a5719908fed28d", + "tools/build_extension.py": "24de3c08bf6fa8844ed17a426b24ae108d8d55d76ea5d1509bdef042731ea8b5", + "tools/derive_adapters.py": "5e4c47f8e91b5a29927e3a69a51512f92003fa8483707184431f84eea06c308b", + "vendor/audit_local.py": "a38940094f7d19cd6376aafdd4734fa68eabc9aff4c98c3c4a3e9540328b1c90", + "vendor/preload_move.py": "c8fda4674644fcd5cbf39b6645ce148a21daa90a998b678cbe51f970b78b0044", + "verify.py": "5fb7984329ce7213294c8f76a3151f06759005456940968b4cc84712933321ee" +} diff --git a/research/paired-helper-extension/PINS.json b/research/paired-helper-extension/PINS.json new file mode 100644 index 0000000000..f5ce309523 --- /dev/null +++ b/research/paired-helper-extension/PINS.json @@ -0,0 +1,17 @@ +{ + "data/PARENT-base.json.gz": "3657ad53ebe5f156f307a903479e919f2fe812811ce5d5f15e72c3aaf68dfde3", + "data/PARENT-extra.json.gz": "b975492ff4cbec0d619cdf2da34f55ce3b20c8a541132e4339cc6c8ae3b2e487", + "data/TRANSFORM-299.json": "781585f68449c30f63e40ee4bf58d1fa194e4faf8cf4394505437fc15137ba34", + "data/TRANSFORM-304.json": "024515c6e47d952dfaf307fcefda9f2106049ccc28875ae620d95241fdec72ed", + "data/TRANSFORM-320.json": "0e4c0216221ab21c4bf48a11eab34ff6cc245014d664dc1523cfae9d437dc00d", + "data/TRANSFORM-331.json": "355bcfd60ffcb672f66882e66bae1b046d1bfb979f725b411b034f811dfb68bb", + "data/TRANSFORM-412.json": "54328a8436d7abed6433da5e4384a36ad95b266070479b496e0e96416a5f5a79", + "data/TRANSFORM-424.json": "42747fa1332af1ca0827edebfff7490ee761f84f662527f593e975a502400dbc", + "data/TRANSFORM-428.json": "89e8fbd5a5d1d64d386cdc38f257cae18d8e7428e868f618ed1f0be5a22aba3e", + "data/TRANSFORM-499.json": "f86eef40cd96b45c67755903eae6a86432e2aeb6d53812621222db7c062d88f6", + "data/TRANSFORM-511.json": "48e0749f1c82594841c88923a38b0308ed777639631a4c3f2414500617f2e34b", + "data/WORD-base.json.gz": "fec3c120db1a35022944628d34b56a36f2456248c274c2eaba1a325cdc690ce8", + "data/WORD-extra.json.gz": "e4d0c617df85bf8a824ff68310ca3373dc017c1ebf9ea733056a3ee4a784b36f", + "vendor/audit_local.py": "a38940094f7d19cd6376aafdd4734fa68eabc9aff4c98c3c4a3e9540328b1c90", + "vendor/preload_move.py": "c8fda4674644fcd5cbf39b6645ce148a21daa90a998b678cbe51f970b78b0044" +} diff --git a/research/paired-helper-extension/README.md b/research/paired-helper-extension/README.md new file mode 100644 index 0000000000..54637f9551 --- /dev/null +++ b/research/paired-helper-extension/README.md @@ -0,0 +1,104 @@ +# Nine additional paired helper extractions + +Starting from [Jeremy Diviney's PR2908](https://github.com/CrocSwap/integer-mult-bounds/pull/2908) +at `51309592971e3b5be935599eed2a95404dc7781e`, this package restores nine more +helpers while preserving all previously restored endpoints. Three extractions +use the existing frames; six more become possible after explicit frame refits. +The complete local profile changes by **9H1 + 18H3 − 18H4**. A literal owner +allocation realizes the resulting improvement after charging all nine extra +private buffers. The resulting bound is + +**κ = 0.001721588647197801880605 − 10⁻⁴⁶ − 10⁻⁷⁰**, + +an increase of **0.000001190309843563994674** (about **0.06919%**) over +pinned PR2908. The exact claim and release bindings are in [CLAIM.json](CLAIM.json). + +This is a finite conditional supplier/outer certificate, with the inherited +all-size, compiler and theorem hypotheses still outstanding. It does not change +the maintainer-selected result or claim an unconditional multiplication theorem, +practical timing improvement, packing optimum, or independent human review. + +| Quantity | Pinned PR2908 | This construction | +|---|---:|---:| +| Independent input columns | 632 | 632 | +| Live helpers | 408 | 408 | +| Private zero buffers | 73 | 82 | +| Width8 helpers | 87 | 96 | +| Width9 helpers | 231 | 222 | +| Local H1 / H2 / H3 / H4 / H5 / H8 counts | 2407 / 640 / 262 / 128 / 26 / 8 | 2416 / 640 / 280 / 110 / 26 / 8 | +| Live / physical families | 66304 / 66795 | 66304 / 66804 | + +The 74 replicas, 666 calls, 271728 helper roles and inherited chronology are +retained. The paid global histogram includes every actual unused owner +remainder. [CONSTRUCTION.md](CONSTRUCTION.md) proves the paired identities and +explains the frame changes; `data/TRANSFORM-*.json` supplies every literal gate +and frame edit. The source-bound builder preserves the predecessor chain. + +## Reproduce + +The bounded registered replay uses Python 3.12 and the standard library: + +```sh +python3.12 -B scripts/research_package.py --package research/paired-helper-extension --check-only +python3.12 -B scripts/research_package.py --package research/paired-helper-extension +``` + +It reruns the exact nine-stage construction, both all-input forward/dual +audits, 36 semantic rejection controls, the actual owner allocation and +directed rational moment. It authenticates the recorded native and complete +outer-release receipts. It does **not** rerun native or integrated outer +admission; the complete command below does that. + +For separate local and allocation checks, use fresh output directories: + +```sh +python3.12 -B research/paired-helper-extension/verify.py --work /tmp/paired-local +python3.12 -B research/paired-helper-extension/check_allocation.py --work /tmp/paired-owners +``` + +For complete source/native/physical/outer admission, obtain the exact ancestor +Git objects, then run the public driver. It exports and authenticates the +predecessors without changing the checkout and does not fetch from the network. + +```sh +git fetch https://github.com/CrocSwap/integer-mult-bounds.git \ + 51309592971e3b5be935599eed2a95404dc7781e \ + 18d03c447886895ef9abf888398178e0428533ca \ + e9307b48d7d1b690939935ecef0f8e524e6d92f4 +env OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 \ + python3.12 -B research/paired-helper-extension/reproduce.py \ + --repo . --work /tmp/paired-complete +``` + +Use the numerical dependencies recorded in `evidence/ENVIRONMENT.json` for +the complete inherited replay. The default rebuilds the retained parent/native +evidence. `--retained /path/to/prior-run` explicitly reuses its `native-cache` +and `NATIVE-RECEIPT.json`, after complete source/claim/cache and all 16 retained +parent stages are authenticated. Both changed native providers are always +fresh in the public driver. The recorded public run used explicit retained-cache reuse; both changed +native chains and the full current admission were fresh. The reused parent +cache came from an earlier fresh PR2894 replay in the same session. See +`evidence/RETAINED-ORIGIN.json` and `evidence/FULL-REPLAY-RESULT.json`. +`--dry-run` only authenticates the PR2908 export and writes a recipe. + +Exact hashes bind immutable source archives. Regenerated words are compared +by complete decoded content, so gzip container differences do not change the +mathematical comparison. The source identity is closed: all 632 files in the +derived source are accounted for, including the declared producer and checks. + +## Open next questions + +1. Can another profitable paired direction be extracted while preserving all 82 + restored endpoints? Recompute exact paired nullspaces on the final word and + price the input/output gates, frame changes and new buffer before synthesis. + A nominated direction alone does not establish another improvement. +2. Can a better literal allocation close more of the packing relaxation gap? + Start from the shipped fill and explore bounded relay moves or changes to + chronology, with exact owner-window and family checks. A fractional optimum + is not an admitted bound. + +Credit: Jeremy Diviney's paired extraction and structural checker; Jeremy +Kothe's PR2894/2833 supplier, frame accounting and cleanup; Yiyang Lu's staged +native/overlay tooling; and the retained owner, packing and exact-audit authors. +See [CREDITS.md](CREDITS.md) for the complete immediate lineage. Mason Hale, +with substantial OpenAI Codex assistance, including parallel cross-checks. diff --git a/research/paired-helper-extension/SOURCES.json b/research/paired-helper-extension/SOURCES.json new file mode 100644 index 0000000000..1096d9b016 --- /dev/null +++ b/research/paired-helper-extension/SOURCES.json @@ -0,0 +1,46 @@ +{ + "base_commit": "0706e744cbda1e4d0da5a6c569ad9b47876c6960", + "refreshed_main_commit": "5a0dc2c0f4685b02bef7776bc196c7c1231cbac1", + "upstream_repository": "https://github.com/CrocSwap/integer-mult-bounds", + "immediate_parent": { + "pr": 2908, + "head": "51309592971e3b5be935599eed2a95404dc7781e", + "package": "research/two-sided-helper-extraction", + "manifest_sha256": "9dba3fe371602ec023a54e26c0fd66f69eb7a74be86aab89923529083c14b36f", + "derived_source_manifest_sha256": "56cf455752722051d598a7da1e5ee700637fbaef09189f534413dbe6e0525a83" + }, + "upstream_exports": [ + { + "pr": 2894, + "head": "18d03c447886895ef9abf888398178e0428533ca", + "package": "research/shared-kernel-packing", + "manifest_sha256": "3cb842b93dd3b0707ceea825bef2afeaa68f8df0d554867761b4752b69077293" + }, + { + "pr": 2833, + "head": "e9307b48d7d1b690939935ecef0f8e524e6d92f4", + "role": "Source materialized and authenticated by exact PR2894 tool; nested retained manifests stay unchanged." + } + ], + "derived_source": { + "manifest_sha256": "98d57c82a1c7318be3c330c3b66897844d57232f0aaeaea88fb4bebd0a1bedf1", + "files": 632, + "builder": "tools/build_extension.py" + }, + "source_boundary": "Only the scoped new package is submitted. Exact frozen ancestor exports remain unchanged. Full replay performs no network fetch.", + "schema_version": 1, + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "889b95d936746df124872133ae1e7cc339adcb92", + "sha256": "7d185cd8c2af35988d638d969748ad7b670f902606444dbfc748e4402c340df6" + } + ] +} diff --git a/research/paired-helper-extension/TASK.json b/research/paired-helper-extension/TASK.json new file mode 100644 index 0000000000..61624d0f6d --- /dev/null +++ b/research/paired-helper-extension/TASK.json @@ -0,0 +1,72 @@ +{ + "schema_version": 1, + "task_id": "complex-new-helper-inventory", + "priority_revision": 5, + "base_commit": "0706e744cbda1e4d0da5a6c569ad9b47876c6960", + "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": "Compose nine additional paired input/output extractions on exact PR2908, including six enabled by declared frame refits; realize their budget with a literal T74 owner allocation and complete 82-buffer admission.", + "scope_change_reason": "Explicit donor request to beat the latest conditional bound. The paired basis change alters the scalar word and endpoint contract; this is outside the fixed-word entry/refit screens. Finite exact identities and a fully charged literal allocation are required.", + "bottleneck_link": "Nine helpers change width9 to8; the paired changes plus refits change the local profile by9H1+18H3\u221218H4. All nine additional private buffers and the actual owner residuals are charged.", + "budget_minutes": 240, + "stop_rule": "Freeze the nine-step composition after exact local checks; publish a higher conditional kappa only if both native providers, literal owner geometry, physical stock, prefix and complete outer admission pass. Do not expand the search after the frozen candidate.", + "outcome": "completed", + "evidence": "CLAIM.json and evidence/; reproduce.py reruns complete source/native/owner/outer admission.", + "author": "Mason Hale", + "ai_assistance": "Substantial OpenAI Codex assistance, including parallel search, implementation and cross-checks. No independent human review claimed.", + "open_questions": [ + { + "question": "Can remaining paired directions be extracted profitably after this nine-step composition?", + "why_it_matters": "Changed terminal frames can reveal directions missed by a search on the old literal frames.", + "first_step": "Recompute paired exact nullspaces on the final word, preserving all82 restored endpoints, and price all input/output and frame changes before synthesis.", + "blocked_by": "No further directions are claimed; each candidate needs complete local/native/owner/outer admission." + }, + { + "question": "Can a better literal owner allocation close more of the fractional packing gap?", + "why_it_matters": "The exhibited allocation is feasible, not an optimum.", + "first_step": "Start from the shipped fill and explore bounded relay moves or changed chronology, with exact window/family checks.", + "blocked_by": "A relaxation or numerical root alone is not a new admitted bound." + } + ] +} diff --git a/research/paired-helper-extension/VERIFY.json b/research/paired-helper-extension/VERIFY.json new file mode 100644 index 0000000000..e05c18c758 --- /dev/null +++ b/research/paired-helper-extension/VERIFY.json @@ -0,0 +1,12 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [{ + "argv": ["{python}", "-B", "{package}/run_registered.py"], + "timeout_seconds": 300, + "checks": "Complete package pins; exact nine-stage construction and free-operator structural identities; both 632-input forward/dual audits and36 semantic rejection controls; literal T74 owner geometry, allocation controls and directed rational moment; binding of stored complete native and outer-release receipts to the exact words/source/fill. Native and full integrated admission are rerun separately by reproduce.py from exact Git sources." + }] +} diff --git a/research/paired-helper-extension/allocation/DISPATCH.json b/research/paired-helper-extension/allocation/DISPATCH.json new file mode 100644 index 0000000000..9544fee4e6 --- /dev/null +++ b/research/paired-helper-extension/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/paired-helper-extension/allocation/FILL.json.gz b/research/paired-helper-extension/allocation/FILL.json.gz new file mode 100644 index 0000000000..3e84340d0c Binary files /dev/null and b/research/paired-helper-extension/allocation/FILL.json.gz differ diff --git a/research/paired-helper-extension/allocation/ORDER.json b/research/paired-helper-extension/allocation/ORDER.json new file mode 100644 index 0000000000..7409c4df10 --- /dev/null +++ b/research/paired-helper-extension/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/paired-helper-extension/allocation/PROFILE.json b/research/paired-helper-extension/allocation/PROFILE.json new file mode 100644 index 0000000000..a3c711f5c3 --- /dev/null +++ b/research/paired-helper-extension/allocation/PROFILE.json @@ -0,0 +1,13 @@ +{ + "1": 1625724, + "2": 426240, + "3": 191980, + "4": 73260, + "5": 24951, + "6": 167, + "7": 45, + "8": 5328, + "24": 1, + "32": 207, + "48": 26958 +} \ No newline at end of file diff --git a/research/paired-helper-extension/allocation/PROVIDERS.json b/research/paired-helper-extension/allocation/PROVIDERS.json new file mode 100644 index 0000000000..1bd962152f --- /dev/null +++ b/research/paired-helper-extension/allocation/PROVIDERS.json @@ -0,0 +1,842 @@ +{ + "extra": { + "actual_paid_profile": { + "1": 2416, + "2": 640, + "3": 280, + "4": 110, + "5": 26, + "8": 8 + }, + "widths": [ + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 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, + 8, + 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, + 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, + 9, + 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, + 9, + 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, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 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, + 7, + 7, + 7, + 7, + 7, + 7, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 7, + 7, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 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, + 7, + 7, + 7, + 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": 2416, + "2": 640, + "3": 280, + "4": 110, + "5": 26, + "8": 8 + }, + "widths": [ + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 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, + 8, + 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, + 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, + 9, + 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, + 9, + 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, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 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, + 7, + 7, + 7, + 7, + 7, + 7, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 7, + 7, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 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, + 7, + 7, + 7, + 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 + ] + } +} \ No newline at end of file diff --git a/research/paired-helper-extension/allocation/SEARCH.json b/research/paired-helper-extension/allocation/SEARCH.json new file mode 100644 index 0000000000..e03a04b425 --- /dev/null +++ b/research/paired-helper-extension/allocation/SEARCH.json @@ -0,0 +1,39 @@ +{ + "changed_offsets": 103323, + "changed_owner_rows": 103059, + "methods": [ + "Exhaustive unequal-width exchanges within an actual call preserve its physical family set.", + "Whole-role relocations preserve source windows and per-call physical-family distinctness.", + "Equal-width two-role relays preserve the intermediate bin total.", + "Subset dynamic programming moves all3..6 roles of a48-bin into eligible spare bins, retaining only strictly improved complete residual moments.", + "Cost-neutral equal-width cross-call swaps change only temporal incidence and are followed by the preceding improving passes." + ], + "neutral_rewiring_rounds": [ + { + "accepted": 12000, + "seed": 1 + }, + { + "accepted": 12000, + "seed": 2 + }, + { + "accepted": 50000, + "seed": 3 + } + ], + "numeric_root_for_discovery": "0.0017215886471978018806051293282625451738999963743107355795274760820981327521127712", + "order_and_dispatch_unchanged": true, + "parent_fill_sha256": "d6585a3b05fb86efd08b1925c5ae0a03265c30f895f5e2c4e1cdfe91978cd3ef", + "parent_head": "51309592971e3b5be935599eed2a95404dc7781e", + "parent_pr": 2908, + "roles": 271728, + "scope": "Discovery history only. Final independently checked literal owners and directed moment provide the certificate; neither global optimality nor fractional-LP attainment is claimed.", + "source_words_unchanged_by_allocation": true, + "status": "BOUNDED_ALLOCATION_DISCOVERY_NOT_OPTIMALITY", + "stopping_rule": "Two initial fills and three deterministic neutral-rewiring rounds; final fill frozen after the third round, with no remaining improving move in the implemented fixed-point pass.", + "word_sha256": { + "base": "fec3c120db1a35022944628d34b56a36f2456248c274c2eaba1a325cdc690ce8", + "extra": "e4d0c617df85bf8a824ff68310ca3373dc017c1ebf9ea733056a3ee4a784b36f" + } +} diff --git a/research/paired-helper-extension/allocation/baseline/CLAIM.json b/research/paired-helper-extension/allocation/baseline/CLAIM.json new file mode 100644 index 0000000000..4edc2cb723 --- /dev/null +++ b/research/paired-helper-extension/allocation/baseline/CLAIM.json @@ -0,0 +1,35 @@ +{ + "baseline_head": "18d03c447886895ef9abf888398178e0428533ca", + "baseline_kappa": "17201845283774695330739999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "baseline_pr": 2894, + "calls": 666, + "complete_package_manifest_sha256": "a6d0e45723ea87f43ed8026758306adbf44b5cfc8473464c77acb57f32530783", + "complex_lower": "1720398337354237885931/1000000000000000000000000", + "gain": "213808976768352857/1000000000000000000000000", + "helpers": 408, + "independent_inputs": 632, + "kappa": "17203983373542378859309999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017203983373542378859309999999999999999999998999999999999999999999999", + "live_families": 66304, + "native_receipt_sha256": "3280682ab975f412ab25e8ec433b2e52d8d3b6226db712ccabbbd2babcc2b84d", + "physical_families": 66795, + "profile": { + "1": 1620344, + "2": 426241, + "23": 1, + "3": 180732, + "32": 14, + "4": 85248, + "48": 26837, + "5": 25700, + "6": 120, + "7": 1, + "8": 5328 + }, + "release_receipt_sha256": "c3fd39e0645b10681a26b74afd08b429e04a139222e156f533654486c4f70214", + "replicas": 74, + "scope": "Conditional finite supplier/outer certificate. Inherited all-size/compiler/theorem hypotheses remain; no selected frontier change, no optimality or independent-human-review claim. Both changed native chains are fresh; retained parent/native evidence explicitly reused by complete receipts.", + "source_manifest_sha256": "56cf455752722051d598a7da1e5ee700637fbaef09189f534413dbe6e0525a83", + "status": "CONDITIONAL_CANDIDATE_COMPLETE_FINITE_RELEASE", + "zero_buffers": 73 +} diff --git a/research/paired-helper-extension/allocation/baseline/ORDER.json b/research/paired-helper-extension/allocation/baseline/ORDER.json new file mode 100644 index 0000000000..7409c4df10 --- /dev/null +++ b/research/paired-helper-extension/allocation/baseline/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/paired-helper-extension/allocation/baseline/PROFILE.json b/research/paired-helper-extension/allocation/baseline/PROFILE.json new file mode 100644 index 0000000000..916437d9e1 --- /dev/null +++ b/research/paired-helper-extension/allocation/baseline/PROFILE.json @@ -0,0 +1 @@ +{"1":1620344,"2":426241,"3":180732,"4":85248,"5":25700,"6":120,"7":1,"8":5328,"23":1,"32":14,"48":26837} \ No newline at end of file diff --git a/research/paired-helper-extension/allocation/vendor/PLAN.json.gz b/research/paired-helper-extension/allocation/vendor/PLAN.json.gz new file mode 100644 index 0000000000..7a1db55a4d Binary files /dev/null and b/research/paired-helper-extension/allocation/vendor/PLAN.json.gz differ diff --git a/research/paired-helper-extension/allocation/vendor/TEMPLATE.json.gz b/research/paired-helper-extension/allocation/vendor/TEMPLATE.json.gz new file mode 100644 index 0000000000..114808c32b Binary files /dev/null and b/research/paired-helper-extension/allocation/vendor/TEMPLATE.json.gz differ diff --git a/research/paired-helper-extension/allocation/vendor/independent_owners.py b/research/paired-helper-extension/allocation/vendor/independent_owners.py new file mode 100644 index 0000000000..16013201b1 --- /dev/null +++ b/research/paired-helper-extension/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) == 82, 'all nine extra 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'] == 66804 + result['physical_source'] = 'Actual 82-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') + assert all(sha(P / name) == digest for name, digest in {**word_pins, **allocation_pins}.items()), 'input drift' + result.update(status='PASS_PAIRED_EXTENSION_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/paired-helper-extension/data/PARENT-base.json.gz b/research/paired-helper-extension/data/PARENT-base.json.gz new file mode 100644 index 0000000000..6303cfd847 Binary files /dev/null and b/research/paired-helper-extension/data/PARENT-base.json.gz differ diff --git a/research/paired-helper-extension/data/PARENT-extra.json.gz b/research/paired-helper-extension/data/PARENT-extra.json.gz new file mode 100644 index 0000000000..38af2b6ea7 Binary files /dev/null and b/research/paired-helper-extension/data/PARENT-extra.json.gz differ diff --git a/research/paired-helper-extension/data/TRANSFORM-299.json b/research/paired-helper-extension/data/TRANSFORM-299.json new file mode 100644 index 0000000000..897a891719 --- /dev/null +++ b/research/paired-helper-extension/data/TRANSFORM-299.json @@ -0,0 +1,274 @@ +{ + "helper": 299, + "normal": 51, + "before": [ + [ + "add", + 302, + 299, + 1, + 4, + [] + ], + [ + "add", + 297, + 299, + -1, + 4, + [] + ], + [ + "add", + 295, + 299, + 1, + 4, + [] + ], + [ + "add", + 294, + 299, + -1, + 4, + [] + ], + [ + "add", + 288, + 299, + 1, + 4, + [] + ], + [ + "add", + 239, + 299, + 1, + 4, + [] + ], + [ + "add", + 238, + 299, + 1, + 4, + [] + ], + [ + "add", + 237, + 299, + -1, + 4, + [] + ], + [ + "add", + 236, + 299, + -1, + 4, + [] + ], + [ + "add", + 231, + 299, + -1, + 4, + [] + ], + [ + "add", + 229, + 299, + 1, + 4, + [] + ], + [ + "add", + 227, + 299, + -1, + 4, + [] + ], + [ + "add", + 225, + 299, + 1, + 4, + [] + ], + [ + "add", + 299, + 303, + 2, + 1, + [] + ], + [ + "add", + 299, + 302, + -1, + 1, + [] + ], + [ + "add", + 299, + 296, + 1, + 1, + [] + ], + [ + "add", + 299, + 292, + -1, + 1, + [] + ], + [ + "add", + 299, + 288, + -1, + 1, + [] + ], + [ + "scale", + 299, + 1, + -2, + [] + ] + ], + "after": [ + [ + "add", + 299, + 40, + 1, + 1, + [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ] + ], + [ + "add", + 299, + 54, + -1, + 1, + [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ] + ], + [ + "add", + 40, + 299, + -1, + 1, + [ + 256, + 128, + 64, + 33, + 17, + 8, + 4, + 3 + ] + ] + ], + "frame_changes": [ + { + "section": "A", + "parent_index": 3645, + "candidate_index": 3664, + "gate": [ + "add", + 81, + 17, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 17, + 9, + 4, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + }, + { + "section": "A", + "parent_index": 3646, + "candidate_index": 3665, + "gate": [ + "add", + 81, + 40, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 17, + 9, + 4, + 2 + ], + "new_frame": [ + 256, + 128, + 64, + 34, + 17, + 11, + 4 + ] + } + ] +} diff --git a/research/paired-helper-extension/data/TRANSFORM-304.json b/research/paired-helper-extension/data/TRANSFORM-304.json new file mode 100644 index 0000000000..e04d294250 --- /dev/null +++ b/research/paired-helper-extension/data/TRANSFORM-304.json @@ -0,0 +1,296 @@ +{ + "helper": 304, + "normal": 102, + "before": [ + [ + "add", + 319, + 304, + -1, + 4, + [] + ], + [ + "add", + 316, + 304, + -1, + 4, + [] + ], + [ + "add", + 313, + 304, + 1, + 4, + [] + ], + [ + "add", + 312, + 304, + 1, + 4, + [] + ], + [ + "add", + 310, + 304, + 1, + 4, + [] + ], + [ + "add", + 306, + 304, + -1, + 4, + [] + ], + [ + "add", + 271, + 304, + 1, + 4, + [] + ], + [ + "add", + 268, + 304, + 1, + 4, + [] + ], + [ + "add", + 266, + 304, + -1, + 4, + [] + ], + [ + "add", + 265, + 304, + -1, + 4, + [] + ], + [ + "add", + 263, + 304, + -1, + 4, + [] + ], + [ + "add", + 262, + 304, + -1, + 4, + [] + ], + [ + "add", + 258, + 304, + 1, + 4, + [] + ], + [ + "add", + 304, + 499, + 1, + 1, + [] + ], + [ + "add", + 304, + 319, + 2, + 1, + [] + ], + [ + "add", + 304, + 318, + -1, + 1, + [] + ], + [ + "add", + 304, + 315, + 2, + 1, + [] + ], + [ + "add", + 304, + 313, + -2, + 1, + [] + ], + [ + "add", + 304, + 308, + -1, + 1, + [] + ], + [ + "scale", + 304, + 1, + -1, + [] + ], + [ + "scale", + 306, + 1, + -1, + [] + ], + [ + "add", + 304, + 306, + -1, + 1, + [] + ], + [ + "add", + 306, + 304, + 1, + 1, + [] + ], + [ + "add", + 304, + 306, + -1, + 1, + [] + ] + ], + "after": [ + [ + "add", + 304, + 308, + -1, + 1, + [ + 256, + 128, + 66, + 34, + 16, + 8, + 6, + 1 + ] + ], + [ + "add", + 304, + 310, + 1, + 1, + [ + 256, + 128, + 66, + 34, + 16, + 8, + 6, + 1 + ] + ] + ], + "frame_changes": [ + { + "section": "A", + "parent_index": 3734, + "candidate_index": 3758, + "gate": [ + "add", + 256, + 288, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 68, + 32, + 16, + 12, + 2, + 1 + ], + "new_frame": [ + 256, + 128, + 68, + 34, + 16, + 14, + 1 + ] + }, + { + "section": "A", + "parent_index": 3735, + "candidate_index": 3759, + "gate": [ + "add", + 256, + 304, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 68, + 32, + 16, + 12, + 2, + 1 + ], + "new_frame": [ + 256, + 128, + 68, + 34, + 16, + 14, + 1 + ] + } + ] +} diff --git a/research/paired-helper-extension/data/TRANSFORM-320.json b/research/paired-helper-extension/data/TRANSFORM-320.json new file mode 100644 index 0000000000..9c8490c864 --- /dev/null +++ b/research/paired-helper-extension/data/TRANSFORM-320.json @@ -0,0 +1,249 @@ +{ + "helper": 320, + "normal": 75, + "before": [ + [ + "add", + 335, + 320, + -1, + 4, + [] + ], + [ + "add", + 332, + 320, + -1, + 4, + [] + ], + [ + "add", + 329, + 320, + 1, + 4, + [] + ], + [ + "add", + 328, + 320, + 1, + 4, + [] + ], + [ + "add", + 326, + 320, + 1, + 4, + [] + ], + [ + "add", + 271, + 320, + 1, + 4, + [] + ], + [ + "add", + 270, + 320, + 1, + 4, + [] + ], + [ + "add", + 269, + 320, + -1, + 4, + [] + ], + [ + "add", + 268, + 320, + -1, + 4, + [] + ], + [ + "add", + 263, + 320, + -1, + 4, + [] + ], + [ + "add", + 261, + 320, + 1, + 4, + [] + ], + [ + "add", + 259, + 320, + -1, + 4, + [] + ], + [ + "add", + 257, + 320, + 1, + 4, + [] + ], + [ + "add", + 320, + 511, + 1, + 1, + [] + ], + [ + "add", + 320, + 335, + 1, + 1, + [] + ], + [ + "add", + 320, + 329, + -2, + 1, + [] + ], + [ + "add", + 320, + 322, + 1, + 1, + [] + ], + [ + "scale", + 320, + 1, + -1, + [] + ] + ], + "after": [ + [ + "add", + 320, + 324, + -1, + 1, + [ + 256, + 128, + 65, + 32, + 16, + 9, + 4, + 3 + ] + ], + [ + "add", + 320, + 326, + 1, + 1, + [ + 256, + 128, + 65, + 32, + 16, + 9, + 4, + 3 + ] + ] + ], + "frame_changes": [ + { + "section": "A", + "parent_index": 3688, + "candidate_index": 3706, + "gate": [ + "add", + 9, + 272, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 65, + 33, + 16, + 8, + 4, + 2 + ], + "new_frame": [ + 256, + 128, + 65, + 35, + 16, + 10, + 4 + ] + }, + { + "section": "A", + "parent_index": 3689, + "candidate_index": 3707, + "gate": [ + "add", + 9, + 320, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 65, + 33, + 16, + 8, + 4, + 2 + ], + "new_frame": [ + 256, + 128, + 65, + 35, + 16, + 10, + 4 + ] + } + ] +} diff --git a/research/paired-helper-extension/data/TRANSFORM-331.json b/research/paired-helper-extension/data/TRANSFORM-331.json new file mode 100644 index 0000000000..7d35aab299 --- /dev/null +++ b/research/paired-helper-extension/data/TRANSFORM-331.json @@ -0,0 +1,266 @@ +{ + "helper": 331, + "normal": 30, + "before": [ + [ + "add", + 511, + 331, + 1, + 4, + [] + ], + [ + "add", + 334, + 331, + 1, + 4, + [] + ], + [ + "add", + 329, + 331, + -1, + 4, + [] + ], + [ + "add", + 326, + 331, + -1, + 4, + [] + ], + [ + "add", + 320, + 331, + 1, + 4, + [] + ], + [ + "add", + 239, + 331, + 1, + 4, + [] + ], + [ + "add", + 236, + 331, + 1, + 4, + [] + ], + [ + "add", + 234, + 331, + -1, + 4, + [] + ], + [ + "add", + 233, + 331, + -1, + 4, + [] + ], + [ + "add", + 231, + 331, + -1, + 4, + [] + ], + [ + "add", + 230, + 331, + -1, + 4, + [] + ], + [ + "add", + 227, + 331, + 1, + 4, + [] + ], + [ + "add", + 226, + 331, + 1, + 4, + [] + ], + [ + "add", + 331, + 335, + 1, + 1, + [] + ], + [ + "add", + 331, + 334, + -1, + 1, + [] + ], + [ + "add", + 331, + 324, + -1, + 1, + [] + ], + [ + "add", + 331, + 320, + -1, + 1, + [] + ], + [ + "scale", + 331, + 1, + -2, + [] + ] + ], + "after": [ + [ + "add", + 331, + 22, + 1, + 1, + [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + ], + [ + "add", + 331, + 34, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + ], + [ + "add", + 22, + 331, + -1, + 1, + [ + 256, + 128, + 64, + 32, + 18, + 10, + 6, + 1 + ] + ] + ], + "frame_changes": [ + { + "section": "A", + "parent_index": 3633, + "candidate_index": 3651, + "gate": [ + "add", + 224, + 107, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 36, + 20, + 8, + 2, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + }, + { + "section": "A", + "parent_index": 3634, + "candidate_index": 3652, + "gate": [ + "add", + 224, + 22, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 36, + 20, + 8, + 2, + 1 + ], + "new_frame": [ + 256, + 128, + 64, + 38, + 20, + 10, + 1 + ] + } + ] +} diff --git a/research/paired-helper-extension/data/TRANSFORM-412.json b/research/paired-helper-extension/data/TRANSFORM-412.json new file mode 100644 index 0000000000..e62dd449d7 --- /dev/null +++ b/research/paired-helper-extension/data/TRANSFORM-412.json @@ -0,0 +1,258 @@ +{ + "helper": 412, + "normal": 127, + "before": [ + [ + "add", + 415, + 412, + -1, + 2, + [] + ], + [ + "add", + 410, + 412, + 1, + 2, + [] + ], + [ + "add", + 409, + 412, + 1, + 2, + [] + ], + [ + "add", + 407, + 412, + 1, + 2, + [] + ], + [ + "add", + 406, + 412, + 1, + 2, + [] + ], + [ + "add", + 403, + 412, + -1, + 2, + [] + ], + [ + "add", + 402, + 412, + -1, + 2, + [] + ], + [ + "add", + 255, + 412, + 1, + 2, + [] + ], + [ + "add", + 252, + 412, + 1, + 2, + [] + ], + [ + "add", + 250, + 412, + -1, + 2, + [] + ], + [ + "add", + 249, + 412, + -1, + 2, + [] + ], + [ + "add", + 247, + 412, + -1, + 2, + [] + ], + [ + "add", + 246, + 412, + -1, + 2, + [] + ], + [ + "add", + 242, + 412, + 1, + 2, + [] + ], + [ + "add", + 412, + 415, + 1, + 1, + [] + ], + [ + "add", + 412, + 414, + -1, + 1, + [] + ], + [ + "add", + 412, + 413, + -1, + 2, + [] + ], + [ + "add", + 412, + 411, + 1, + 2, + [] + ], + [ + "add", + 412, + 410, + -1, + 2, + [] + ], + [ + "add", + 412, + 407, + -1, + 2, + [] + ], + [ + "add", + 412, + 406, + 1, + 2, + [] + ], + [ + "add", + 412, + 401, + -1, + 2, + [] + ], + [ + "scale", + 412, + 2, + -1, + [] + ] + ], + "after": [ + [ + "scale", + 412, + -1, + 1, + [ + 256, + 128, + 65, + 33, + 17, + 9, + 5, + 3 + ] + ], + [ + "add", + 412, + 400, + 1, + 2, + [ + 256, + 128, + 65, + 33, + 17, + 9, + 5, + 3 + ] + ], + [ + "add", + 412, + 414, + 1, + 1, + [ + 256, + 128, + 65, + 33, + 17, + 9, + 5, + 3 + ] + ], + [ + "add", + 400, + 412, + -2, + 1, + [ + 256, + 128, + 65, + 33, + 17, + 9, + 5, + 3 + ] + ] + ] +} diff --git a/research/paired-helper-extension/data/TRANSFORM-424.json b/research/paired-helper-extension/data/TRANSFORM-424.json new file mode 100644 index 0000000000..4fae6d1bb3 --- /dev/null +++ b/research/paired-helper-extension/data/TRANSFORM-424.json @@ -0,0 +1,250 @@ +{ + "helper": 424, + "normal": 52, + "before": [ + [ + "add", + 430, + 424, + 1, + 2, + [] + ], + [ + "add", + 427, + 424, + -1, + 2, + [] + ], + [ + "add", + 426, + 424, + -1, + 2, + [] + ], + [ + "add", + 423, + 424, + -1, + 2, + [] + ], + [ + "add", + 419, + 424, + 1, + 2, + [] + ], + [ + "add", + 418, + 424, + 1, + 2, + [] + ], + [ + "add", + 417, + 424, + -1, + 2, + [] + ], + [ + "add", + 239, + 424, + 1, + 2, + [] + ], + [ + "add", + 236, + 424, + 1, + 2, + [] + ], + [ + "add", + 234, + 424, + -1, + 2, + [] + ], + [ + "add", + 233, + 424, + -1, + 2, + [] + ], + [ + "add", + 231, + 424, + -1, + 2, + [] + ], + [ + "add", + 230, + 424, + -1, + 2, + [] + ], + [ + "add", + 227, + 424, + 1, + 2, + [] + ], + [ + "add", + 226, + 424, + 1, + 2, + [] + ], + [ + "add", + 424, + 431, + 1, + 2, + [] + ], + [ + "add", + 424, + 430, + -1, + 2, + [] + ], + [ + "add", + 424, + 425, + 1, + 2, + [] + ], + [ + "add", + 424, + 421, + -1, + 2, + [] + ], + [ + "add", + 424, + 420, + 1, + 2, + [] + ], + [ + "add", + 424, + 419, + 1, + 2, + [] + ], + [ + "add", + 424, + 418, + -1, + 2, + [] + ], + [ + "add", + 424, + 417, + 1, + 1, + [] + ], + [ + "scale", + 424, + 2, + 1, + [] + ] + ], + "after": [ + [ + "add", + 424, + 16, + 1, + 2, + [ + 256, + 128, + 64, + 36, + 20, + 8, + 2, + 1 + ] + ], + [ + "add", + 424, + 44, + 1, + 1, + [ + 256, + 128, + 64, + 36, + 20, + 8, + 2, + 1 + ] + ], + [ + "add", + 16, + 424, + -2, + 1, + [ + 256, + 128, + 64, + 36, + 20, + 8, + 2, + 1 + ] + ] + ] +} diff --git a/research/paired-helper-extension/data/TRANSFORM-428.json b/research/paired-helper-extension/data/TRANSFORM-428.json new file mode 100644 index 0000000000..1593c52045 --- /dev/null +++ b/research/paired-helper-extension/data/TRANSFORM-428.json @@ -0,0 +1,258 @@ +{ + "helper": 428, + "normal": 76, + "before": [ + [ + "add", + 431, + 428, + -1, + 2, + [] + ], + [ + "add", + 426, + 428, + 1, + 2, + [] + ], + [ + "add", + 425, + 428, + 1, + 2, + [] + ], + [ + "add", + 423, + 428, + 1, + 2, + [] + ], + [ + "add", + 422, + 428, + 1, + 2, + [] + ], + [ + "add", + 419, + 428, + -1, + 2, + [] + ], + [ + "add", + 418, + 428, + -1, + 2, + [] + ], + [ + "add", + 271, + 428, + 1, + 2, + [] + ], + [ + "add", + 268, + 428, + 1, + 2, + [] + ], + [ + "add", + 266, + 428, + -1, + 2, + [] + ], + [ + "add", + 265, + 428, + -1, + 2, + [] + ], + [ + "add", + 263, + 428, + -1, + 2, + [] + ], + [ + "add", + 262, + 428, + -1, + 2, + [] + ], + [ + "add", + 258, + 428, + 1, + 2, + [] + ], + [ + "add", + 428, + 431, + 1, + 1, + [] + ], + [ + "add", + 428, + 430, + -1, + 1, + [] + ], + [ + "add", + 428, + 429, + -1, + 2, + [] + ], + [ + "add", + 428, + 427, + 1, + 2, + [] + ], + [ + "add", + 428, + 426, + -1, + 2, + [] + ], + [ + "add", + 428, + 423, + -1, + 2, + [] + ], + [ + "add", + 428, + 422, + 1, + 2, + [] + ], + [ + "add", + 428, + 417, + -1, + 2, + [] + ], + [ + "scale", + 428, + 2, + -1, + [] + ] + ], + "after": [ + [ + "scale", + 428, + -1, + 1, + [ + 256, + 128, + 68, + 32, + 16, + 12, + 2, + 1 + ] + ], + [ + "add", + 428, + 416, + 1, + 2, + [ + 256, + 128, + 68, + 32, + 16, + 12, + 2, + 1 + ] + ], + [ + "add", + 428, + 430, + 1, + 1, + [ + 256, + 128, + 68, + 32, + 16, + 12, + 2, + 1 + ] + ], + [ + "add", + 416, + 428, + -2, + 1, + [ + 256, + 128, + 68, + 32, + 16, + 12, + 2, + 1 + ] + ] + ] +} diff --git a/research/paired-helper-extension/data/TRANSFORM-499.json b/research/paired-helper-extension/data/TRANSFORM-499.json new file mode 100644 index 0000000000..7c22cd7a66 --- /dev/null +++ b/research/paired-helper-extension/data/TRANSFORM-499.json @@ -0,0 +1,322 @@ +{ + "helper": 499, + "normal": 120, + "before": [ + [ + "add", + 319, + 499, + -1, + 4, + [] + ], + [ + "add", + 318, + 499, + -1, + 4, + [] + ], + [ + "add", + 317, + 499, + 1, + 4, + [] + ], + [ + "add", + 316, + 499, + 1, + 4, + [] + ], + [ + "add", + 308, + 499, + -1, + 4, + [] + ], + [ + "add", + 255, + 499, + 1, + 4, + [] + ], + [ + "add", + 254, + 499, + 1, + 4, + [] + ], + [ + "add", + 253, + 499, + -1, + 4, + [] + ], + [ + "add", + 252, + 499, + -1, + 4, + [] + ], + [ + "add", + 247, + 499, + -1, + 4, + [] + ], + [ + "add", + 245, + 499, + 1, + 4, + [] + ], + [ + "add", + 243, + 499, + -1, + 4, + [] + ], + [ + "add", + 241, + 499, + 1, + 4, + [] + ], + [ + "add", + 499, + 319, + 2, + 1, + [] + ], + [ + "add", + 499, + 316, + -1, + 1, + [] + ], + [ + "add", + 499, + 315, + 1, + 1, + [] + ], + [ + "add", + 499, + 312, + 2, + 1, + [] + ], + [ + "scale", + 310, + 1, + -1, + [] + ], + [ + "add", + 499, + 310, + -1, + 1, + [] + ], + [ + "add", + 310, + 499, + 1, + 1, + [] + ], + [ + "add", + 499, + 310, + -1, + 1, + [] + ] + ], + "after": [ + [ + "add", + 499, + 35, + 1, + 1, + [ + 256, + 128, + 72, + 40, + 24, + 4, + 2, + 1 + ] + ], + [ + "add", + 499, + 306, + -1, + 1, + [ + 256, + 128, + 72, + 40, + 24, + 4, + 2, + 1 + ] + ], + [ + "add", + 35, + 499, + -1, + 1, + [ + 256, + 128, + 72, + 40, + 24, + 4, + 2, + 1 + ] + ] + ], + "frame_changes": [ + { + "section": "A", + "parent_index": 3740, + "candidate_index": 3761, + "gate": [ + "add", + 11, + 77, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 66, + 32, + 18, + 8, + 4, + 1 + ], + "new_frame": [ + 256, + 128, + 74, + 40, + 26, + 4, + 1 + ] + }, + { + "section": "A", + "parent_index": 3741, + "candidate_index": 3762, + "gate": [ + "add", + 11, + 35, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 66, + 32, + 18, + 8, + 4, + 1 + ], + "new_frame": [ + 256, + 128, + 74, + 40, + 26, + 4, + 1 + ] + }, + { + "section": "restore", + "parent_index": 40, + "candidate_index": 40, + "gate": [ + "scale", + 499, + -1, + 1 + ], + "old_frame": [ + 256, + 128, + 64, + 32, + 16, + 8, + 4, + 2, + 1 + ], + "new_frame": [ + 256, + 128, + 72, + 40, + 24, + 4, + 2, + 1 + ] + } + ] +} diff --git a/research/paired-helper-extension/data/TRANSFORM-511.json b/research/paired-helper-extension/data/TRANSFORM-511.json new file mode 100644 index 0000000000..7c7bf4b1a1 --- /dev/null +++ b/research/paired-helper-extension/data/TRANSFORM-511.json @@ -0,0 +1,298 @@ +{ + "helper": 511, + "normal": 85, + "before": [ + [ + "add", + 335, + 511, + -1, + 4, + [] + ], + [ + "add", + 334, + 511, + -1, + 4, + [] + ], + [ + "add", + 333, + 511, + 1, + 4, + [] + ], + [ + "add", + 332, + 511, + 1, + 4, + [] + ], + [ + "add", + 326, + 511, + 1, + 4, + [] + ], + [ + "add", + 324, + 511, + -1, + 4, + [] + ], + [ + "add", + 255, + 511, + 1, + 4, + [] + ], + [ + "add", + 252, + 511, + 1, + 4, + [] + ], + [ + "add", + 250, + 511, + -1, + 4, + [] + ], + [ + "add", + 249, + 511, + -1, + 4, + [] + ], + [ + "add", + 247, + 511, + -1, + 4, + [] + ], + [ + "add", + 246, + 511, + -1, + 4, + [] + ], + [ + "add", + 242, + 511, + 1, + 4, + [] + ], + [ + "add", + 511, + 335, + 1, + 1, + [] + ], + [ + "add", + 511, + 334, + 1, + 2, + [] + ], + [ + "add", + 511, + 332, + -1, + 1, + [] + ], + [ + "add", + 511, + 329, + 1, + 1, + [] + ], + [ + "add", + 511, + 328, + 2, + 1, + [] + ], + [ + "add", + 511, + 326, + -1, + 1, + [] + ], + [ + "add", + 511, + 324, + 1, + 2, + [] + ], + [ + "add", + 511, + 322, + -1, + 2, + [] + ], + [ + "scale", + 511, + 2, + 1, + [] + ] + ], + "after": [ + [ + "add", + 511, + 23, + 1, + 1, + [ + 256, + 128, + 65, + 32, + 17, + 8, + 5, + 2 + ] + ], + [ + "add", + 511, + 322, + -1, + 1, + [ + 256, + 128, + 65, + 32, + 17, + 8, + 5, + 2 + ] + ], + [ + "add", + 23, + 511, + -1, + 1, + [ + 256, + 128, + 65, + 32, + 17, + 8, + 5, + 2 + ] + ] + ], + "frame_changes": [ + { + "section": "A", + "parent_index": 3700, + "candidate_index": 3722, + "gate": [ + "add", + 240, + 39, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 65, + 33, + 17, + 9, + 5, + 3 + ], + "new_frame": [ + 256, + 128, + 65, + 34, + 17, + 10, + 5 + ] + }, + { + "section": "A", + "parent_index": 3701, + "candidate_index": 3723, + "gate": [ + "add", + 240, + 23, + 1, + 1 + ], + "old_frame": [ + 256, + 128, + 65, + 33, + 17, + 9, + 5, + 3 + ], + "new_frame": [ + 256, + 128, + 65, + 34, + 17, + 10, + 5 + ] + } + ] +} diff --git a/research/paired-helper-extension/data/WORD-base.json.gz b/research/paired-helper-extension/data/WORD-base.json.gz new file mode 100644 index 0000000000..9be0aa5349 Binary files /dev/null and b/research/paired-helper-extension/data/WORD-base.json.gz differ diff --git a/research/paired-helper-extension/data/WORD-extra.json.gz b/research/paired-helper-extension/data/WORD-extra.json.gz new file mode 100644 index 0000000000..40b38365ea Binary files /dev/null and b/research/paired-helper-extension/data/WORD-extra.json.gz differ diff --git a/research/paired-helper-extension/evidence/ADAPTER-DERIVATION.json b/research/paired-helper-extension/evidence/ADAPTER-DERIVATION.json new file mode 100644 index 0000000000..de4ab3f54e --- /dev/null +++ b/research/paired-helper-extension/evidence/ADAPTER-DERIVATION.json @@ -0,0 +1,111 @@ +{ + "status": "PASS_CHECKED_82_BUFFER_ADAPTER_DERIVATION", + "parent_head": "51309592971e3b5be935599eed2a95404dc7781e", + "parent_manifest_sha256": "9dba3fe371602ec023a54e26c0fd66f69eb7a74be86aab89923529083c14b36f", + "source_commit": "paired-helper-extension-pr2908", + "source_manifest_sha256": "98d57c82a1c7318be3c330c3b66897844d57232f0aaeaea88fb4bebd0a1bedf1", + "source_files": 632, + "comparison_sha256": "2406680a07b43a69b0f12f8462cc43f3616f3c8cb0a46bc767541b45945cd2bf", + "retained_receipt_sha256": "02a4d46fe4e1e368d2d22794a2c769ee28470d6797651848d261ca42b90f23d9", + "buffer_count": 82, + "physical_overhead": 500, + "changes": { + "prepare_extension_native.py": { + "source": "/private/tmp/kappa-round6/public-complete/pr2908/tools/prepare_channel_native.py", + "before_sha256": "4d207b9bbe3e0b8a86d10ad5d5f329a81da0cf56dce6c03e6fdd5b78e581ce91", + "after_sha256": "c5ad3e3d086aae7c9000b7d8c769cbc22a943c738d5808cee52fe71e571a595d", + "replacements": [ + { + "old": "SOURCE_SHA='56cf455752722051d598a7da1e5ee700637fbaef09189f534413dbe6e0525a83'", + "new": "SOURCE_SHA='98d57c82a1c7318be3c330c3b66897844d57232f0aaeaea88fb4bebd0a1bedf1'" + }, + { + "old": "SOURCE_FILES=610", + "new": "SOURCE_FILES=632" + }, + { + "old": "SOURCE_COMMIT='two-sided-helper408-pr2894'", + "new": "SOURCE_COMMIT='paired-helper-extension-pr2908'" + }, + { + "old": "OLD_RECEIPT_SHA='dd36443f2789ffa6deca7210c76ada781e2b9b7e622a546b366f51a475faff3e'", + "new": "OLD_RECEIPT_SHA='02a4d46fe4e1e368d2d22794a2c769ee28470d6797651848d261ca42b90f23d9'" + }, + { + "old": "len(can['zero_buffers'])==73", + "new": "len(can['zero_buffers'])==82" + } + ] + }, + "admit_extension.py": { + "source": "/private/tmp/kappa-round6/public-complete/pr2908/tools/admit_channel408.py", + "before_sha256": "a62c21eac4e0df502cbfb78c88b19a763fd351cde3c11c0588874f84db6992bf", + "after_sha256": "04abab54626f0c512fdf57232f8ce64835fe47d24984838f85cc5bae4934466a", + "replacements": [ + { + "old": " 'channel408': dict(commit='two-sided-helper408-pr2894',manifest='56cf455752722051d598a7da1e5ee700637fbaef09189f534413dbe6e0525a83',helpers=408,source_file_count=610,upstream_head='18d03c447886895ef9abf888398178e0428533ca'),", + "new": " 'paired-extension': dict(commit='paired-helper-extension-pr2908',manifest='98d57c82a1c7318be3c330c3b66897844d57232f0aaeaea88fb4bebd0a1bedf1',helpers=408,source_file_count=632,upstream_head='51309592971e3b5be935599eed2a95404dc7781e')," + }, + { + "old": "COMPARISONS = {", + "new": "COMPARISONS = {\n 'pr2908': dict(pr=2908,head='51309592971e3b5be935599eed2a95404dc7781e',sha256='2406680a07b43a69b0f12f8462cc43f3616f3c8cb0a46bc767541b45945cd2bf',field='kappa')," + }, + { + "old": "ap.add_argument('--source-profile', choices=['channel408'], default='channel408')", + "new": "ap.add_argument('--source-profile', choices=['paired-extension'], default='paired-extension')" + }, + { + "old": "ap.add_argument('--comparison-profile', choices=['pr2894'], default='pr2894')", + "new": "ap.add_argument('--comparison-profile', choices=['pr2908'], default='pr2908')" + }, + { + "old": "zero_buffers_allocated_and_cleared=73", + "new": "zero_buffers_allocated_and_cleared=82" + }, + { + "old": "len(c.get('zero_buffers',[]))==73, 'helper408 physical ABI including all 73 private buffers'", + "new": "len(c.get('zero_buffers',[]))==82, 'paired extension physical ABI including all 82 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+82+2, 'complete physical cost including all actual helpers and 82 buffers'" + } + ] + }, + "extension_blocknorm.py": { + "source": "/private/tmp/kappa-round6/public-complete/pr2908/tools/channel_blocknorm.py", + "before_sha256": "b53ebd53e3948f658c6da4f487a9ea10c9cb0a6acf2435750a32d6efeb9869c0", + "after_sha256": "d3893ef2265b1027f90b33832a3631b7a664bfdcac47962b83149d904bb7578f", + "replacements": [ + { + "old": "len(allocated)==73, 'all73 private zero buffers released'", + "new": "len(allocated)==82, 'all82 private zero buffers released'" + }, + { + "old": "'zero_buffers_allocated_and_cleared':73", + "new": "'zero_buffers_allocated_and_cleared':82" + }, + { + "old": "r['zero_buffers_returned_to_zero']==73", + "new": "r['zero_buffers_returned_to_zero']==82" + }, + { + "old": "physical==live+8+408+73+2", + "new": "physical==live+8+408+82+2" + }, + { + "old": "'zero_buffers':[live+416,live+489], 'coefficient':[live+489,live+491]", + "new": "'zero_buffers':[live+416,live+498], 'coefficient':[live+498,live+500]" + }, + { + "old": "len(mp)==73 and set(mp.values())==set(range(*ns['zero_buffers'])), '73distinct private Z slots'", + "new": "len(mp)==82 and set(mp.values())==set(range(*ns['zero_buffers'])), '82distinct private Z slots'" + }, + { + "old": "T=len(order)//9; live=896*T; physical=live+490", + "new": "T=len(order)//9; live=896*T; physical=live+500" + } + ] + } + } +} diff --git a/research/paired-helper-extension/evidence/ADMISSION-RESULT.json b/research/paired-helper-extension/evidence/ADMISSION-RESULT.json new file mode 100644 index 0000000000..4de28b893a --- /dev/null +++ b/research/paired-helper-extension/evidence/ADMISSION-RESULT.json @@ -0,0 +1,386 @@ +{ + "actual_expected_helpers": 408, + "comparison_claim_sha256": "2406680a07b43a69b0f12f8462cc43f3616f3c8cb0a46bc767541b45945cd2bf", + "comparison_head": "51309592971e3b5be935599eed2a95404dc7781e", + "comparison_kappa": "17203983373542378859309999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "comparison_pr": 2908, + "complex_lower": "344317729439560376121/200000000000000000000000", + "dispatch_sha256": "65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c", + "external_input_sha256": { + "/Users/masonhale/Documents/Codex/2026-10-13/files-pasted-by-the-user-contribute/work/integer-mult-round6/research/paired-helper-extension/allocation/DISPATCH.json": "65e435bd68e97243c003677271b88485a29d4d0fae2dff1354100404a145e74c", + "/Users/masonhale/Documents/Codex/2026-10-13/files-pasted-by-the-user-contribute/work/integer-mult-round6/research/paired-helper-extension/allocation/FILL.json.gz": "19b551af07274931b443ac42588e15df20ec0140fa69b54f3b62a4df9a54ff8e", + "/Users/masonhale/Documents/Codex/2026-10-13/files-pasted-by-the-user-contribute/work/integer-mult-round6/research/paired-helper-extension/allocation/ORDER.json": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1", + "/private/tmp/kappa-round6/public-complete/adapters/extension_blocknorm.py": "d3893ef2265b1027f90b33832a3631b7a664bfdcac47962b83149d904bb7578f", + "/private/tmp/kappa-round6/public-complete/parent-export/pr2894/vendor/pr2857/vendor/pr2839/lift_parent.py": "9a1edd7d4ab4a2f2ac8d15b42b7e40f93653d65026bac59e4c1ce80b486bd60e", + "/private/tmp/kappa-round6/public-complete/parent-export/pr2894/vendor/pr2857/vendor/pr2839/reconstruct_replica.py": "5472811c24aef3852dc7e189dff5060076a6c0b25bfde928da50dcfe9b5bdc15", + "/private/tmp/kappa-round6/public-complete/parent-export/pr2894/vendor/pr2857/vendor/pr2839/replica_parent.py": "48bdbf28f59d80edb266803ec61bf5e22e8fb5e5a0e2b88004b6039147589bd4", + "/private/tmp/kappa-round6/public-complete/pr2908/CLAIM.json": "2406680a07b43a69b0f12f8462cc43f3616f3c8cb0a46bc767541b45945cd2bf" + }, + "fill_sha256": "19b551af07274931b443ac42588e15df20ec0140fa69b54f3b62a4df9a54ff8e", + "gain": "595154921781997337/500000000000000000000000", + "kappa": "17215886471978018806049999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017215886471978018806049999999999999999999998999999999999999999999999", + "native_receipt_sha256": "5c1ea6f03e48673d9b56563494fff2258ee18bc8dacdeb72ba5c07e2044008ca", + "order_sha256": "519d1d5dbb997a219fcfcad34c0b03e7838bef24199784d7e964fa10090f66e1", + "package_manifest_sha256": "bf852fb4ecfa28dddfb8cc6fe7bf53019b3932114e01cba3e026b63ef2b1babd", + "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": "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": "3ef9b2a2fa0dcf2d53884e205b7ac20ae6ef47d173b0d8a5bc97fb2a445fc143", + "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= 0 and + (section != 'A' or index >= x['prelude_events']) and + (section, index) not in seen, 'unique declared non-prelude frame edit') + seen.add((section, index)) + gate = x[section][index] + pm.require(gate[:-1] == edit['gate'] and gate[-1] == edit['old_frame'], + 'exact frame edit preimage') + pm.require(gate[0] in ('add', 'scale') and not 112 <= gate[1] < 224 and + list(pm.basis(edit['new_frame'])) == edit['new_frame'], 'canonical nontarget frame') + gate[-1] = list(edit['new_frame']) + return x + + +def apply_stage(word, transform): + h = transform['helper'] + before, after = transform['before'], transform['after'] + pm.require(h in HELPERS and str(h) not in word['helper_final'], 'fresh declared helper') + pm.require(str(h) not in word['start_extra'], 'zero entrance') + 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') + roles = g[1:3] if g[0] == 'add' else g[1:2] + pm.require(all(224 <= r < 704 and r not in protected and r not in word['removed'] + for r in roles), 'unprotected live helpers only') + frame = list(pm.basis(after[0][-1])) + pm.require(len(frame) == 8 and all(g[0] in ('add', 'scale') and g[-1] == frame + for g in after), 'common terminal hyperplane') + x = refit(word, transform) + 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)] = 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') + profile, inventory = pm.frame_report(x) + x['report']['local_profile'], x['report']['width_inventory'] = profile, inventory + z = copy.deepcopy(x) + z['A'] = z['A'][n:] + x['cleanup'] = pm.derive_cleanup(z, set(map(int, x['helper_final']))) + pm.require({k for k in word if word[k] != x[k]} == ALLOWED, 'exact changed sections') + return x + + +def apply(word, transforms): + pm.require(tuple(t['helper'] for t in transforms) == HELPERS, 'declared composition order') + pm.require(len(word['helper_final']) == 73, 'PR2908 cold endpoint count') + x = word + for transform in transforms: + x = apply_stage(x, transform) + pm.require(len(x['helper_final']) == BUFFERS, 'all nine added buffers charged') + pm.require(x['report']['local_profile'] == PROFILE and + x['report']['width_inventory'] == INVENTORY, 'complete local profile and inventory') + return x diff --git a/research/paired-helper-extension/reproduce.py b/research/paired-helper-extension/reproduce.py new file mode 100644 index 0000000000..dc1eb2d829 --- /dev/null +++ b/research/paired-helper-extension/reproduce.py @@ -0,0 +1,145 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Exact Git exports, declared source stages, fresh native chains, full admission. + +Mason Hale, with substantial OpenAI Codex assistance. The stage/native/release +mechanisms retain Jeremy Diviney's PR2908 and its credited upstream lineage. +No network fetch is performed. Fresh retained bootstrap is the default; +--retained explicitly reuses a completely authenticated parent/native cache. +""" +import argparse +import hashlib +import io +import json +import os +import subprocess +import sys +import tarfile +import time +from fractions import Fraction as Q +from pathlib import Path, PurePosixPath + +P = Path(__file__).resolve().parent +HEAD = '51309592971e3b5be935599eed2a95404dc7781e' +PARENT_MANIFEST = '9dba3fe371602ec023a54e26c0fd66f69eb7a74be86aab89923529083c14b36f' + + +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, out): + prefix = PurePosixPath('research/two-sided-helper-extraction') + 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') == PARENT_MANIFEST + assert tree(out) == read(out / 'MANIFEST.json') + + +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('--dry-run', action='store_true') + args = ap.parse_args() + assert __debug__ + 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 = work / 'pr2908' + export(repo, parent) + upstream = work / 'parent-export/pr2894' + core = upstream / 'vendor/pr2857' + source = work / 'pr2833' + four, preload, channel, final = [work / n for n in ('source4', 'source-pm', 'source2908', 'source')] + 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 + [P / 'tools/build_extension.py', '--source', channel, '--local-package', P, '--out', final]), + ('derive-closed-adapters', py + [P / 'tools/derive_adapters.py', '--parent-package', parent, '--source', final, '--source-manifest', read(P / 'CLAIM.json')['source_manifest_sha256'], '--retained-receipt', retained / 'NATIVE-RECEIPT.json', '--out', adapters]), + ('fresh-current-native', py + [adapters / 'prepare_extension_native.py', '--source', final, '--retained-cache', retained / 'native-cache', '--retained-receipt', retained / 'NATIVE-RECEIPT.json', '--out', native, '--jobs', '1']), + ('complete-admission', py + [adapters / 'admit_extension.py', '--source', final, '--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', parent / 'CLAIM.json', '--source-profile', 'paired-extension', '--comparison-profile', 'pr2908', '--jobs', '1']), + ] + if args.dry_run: + save(work / 'PREFLIGHT.json', {'status': 'EXACT_PARENT_EXPORT_AND_RECIPE_ONLY_NOT_A_REPLAY', 'commands': [[n, list(map(str, c))] for n, c in recipe]}) + print('PASS_PINNED_PR2908_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) + stages = [] + for name, command in recipe: + 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) + 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 admission['release_receipt_sha256'] == sha(candidate / 'release/RELEASE-RECEIPT.json') + assert admission['package_manifest_sha256'] == receipt['manifest_sha256'] + assert tree(P) == pins and tree(parent) == read(parent / 'MANIFEST.json') + save(work / 'RESULT.json', {'status': 'PASS_PAIRED_EXTENSION_COMPLETE_REPLAY', 'kappa': admission['kappa'], + 'source_manifest_sha256': sha(final / '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_PAIRED_EXTENSION_COMPLETE_REPLAY', admission['kappa'], flush=True) + + +if __name__ == '__main__': + main() diff --git a/research/paired-helper-extension/run_registered.py b/research/paired-helper-extension/run_registered.py new file mode 100644 index 0000000000..d6e5dccdf4 --- /dev/null +++ b/research/paired-helper-extension/run_registered.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Exact local/owner/moment replay and binding of recorded complete release. + +This bounded command does not rerun the native or integrated outer replay; +reproduce.py executes that separately from exact Git sources. +""" +import hashlib +import json +import os +import subprocess +import sys +import tempfile +from fractions import Fraction as Q +from pathlib import Path + +P = Path(__file__).resolve().parent + + +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 f != P / 'MANIFEST.json'} + + +def main(): + assert __debug__ + pins = read(P / 'MANIFEST.json') + assert tree() == pins + with tempfile.TemporaryDirectory(prefix='paired-extension-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: + result = subprocess.run([sys.executable, '-B', str(P / script), '--work', str(out / name)], + env=env, stdin=subprocess.DEVNULL, stdout=stream, stderr=subprocess.STDOUT) + if result.returncode: + print(log.read_text()[-8000:]) + raise SystemExit(result.returncode) + 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') + assert local['status'] == 'PASS_NINE_ADDITIONAL_PAIRED_EXTRACTIONS' + assert len(local['semantic_controls']) == 36 + assert claim['status'] == 'CONDITIONAL_CANDIDATE_COMPLETE_FINITE_RELEASE' + assert owner['status'] == 'PASS_PAIRED_EXTENSION_LITERAL_OWNERS_AND_EXACT_MOMENT' + assert admit['status'] == 'PASS_REPLICA_ORDER_FILL_DERIVATIVE_COMPLETE_RELEASE' + assert release['status'] == 'PASS_RELEASE' + assert Q(owner['moment']['target']) == Q(claim['kappa']) == Q(admit['kappa']) == Q(release['kappa_decimal']) + assert owner['profile'] == claim['profile'] == admit['profile'] + assert owner['physical'] == claim['physical_families'] == 66804 + assert release['manifest_sha256'] == admit['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 native['reused_retained_native_count'] == 2 and native['reused_retained_parent'] + 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 claim['source_manifest_sha256'] == native['manifest_sha256'] == admit['source_manifest_sha256'] + assert Q(claim['baseline_kappa']) == Q(admit['comparison_kappa']) == Q(owner['moment']['previous']) + for tag in ('base', 'extra'): + assert native['providers'][tag]['word_sha256'] == sha(P / f'data/WORD-{tag}.json.gz') + assert admit['fill_sha256'] == sha(P / 'allocation/FILL.json.gz') + assert admit['order_sha256'] == sha(P / 'allocation/ORDER.json') + assert admit['dispatch_sha256'] == sha(P / 'allocation/DISPATCH.json') + assert tree() == pins + print('PASS_PAIRED_EXTENSION_LOCAL_OWNER_MOMENT_AND_STORED_RELEASE', claim['kappa']) + print('Native and full integrated admission are authenticated stored evidence here; reproduce.py reruns them.') + + +if __name__ == '__main__': + main() diff --git a/research/paired-helper-extension/structure.py b/research/paired-helper-extension/structure.py new file mode 100644 index 0000000000..8d5bd544ee --- /dev/null +++ b/research/paired-helper-extension/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/paired-helper-extension/tools/audit_allocation_moment.py b/research/paired-helper-extension/tools/audit_allocation_moment.py new file mode 100644 index 0000000000..dfe0ec29e1 --- /dev/null +++ b/research/paired-helper-extension/tools/audit_allocation_moment.py @@ -0,0 +1,81 @@ +# 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. +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()=='2406680a07b43a69b0f12f8462cc43f3616f3c8cb0a46bc767541b45945cd2bf','exact pinned PR2908 full headline') + 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/paired-helper-extension/tools/build_extension.py b/research/paired-helper-extension/tools/build_extension.py new file mode 100644 index 0000000000..5d4afe8bc1 --- /dev/null +++ b/research/paired-helper-extension/tools/build_extension.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Append the declared nine-extraction stage to immutable PR2908 source. + +Overlay/rebuild conventions are credited to Jeremy Diviney's PR2908 builder. +""" +import argparse +import gzip +import hashlib +import json +import shutil +from pathlib import Path + +PARENT = '56cf455752722051d598a7da1e5ee700637fbaef09189f534413dbe6e0525a83' + + +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 / 'PINS.json') + assert all(sha(p / n) == h for n, h in pins.items()) + shutil.copytree(src, out) + local = out / 'new/borrow/paired-extension' + local.mkdir() + copied = ['PINS.json', 'verify.py', 'producer.py', 'structure.py', *pins] + for n in copied: + dest = local / n + dest.parent.mkdir(parents=True, exist_ok=True) + shutil.copy2(p / n, dest) + shutil.copy2(p / 'producer.py', out / 'new/borrow/paired_extension.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 q.read_bytes() == (p / f'data/PARENT-{tag}.json.gz').read_bytes() + shutil.copy2(q, out / f'new/borrow/inputs/CHANNEL408-WORD-{tag}.json.gz') + shutil.copy2(p / f'data/WORD-{tag}.json.gz', q) + word = read(q) + helpers = sorted(set(range(224, 704)) - set(word['removed'])) + providers[pid] = {'widths': [len(word['helper_final'].get(str(h), [0] * 9)) - + len(word['start_extra'].get(str(h), [])) for h in helpers], + 'actual_paid_profile': word['report']['local_profile']} + records[tag] = {'parent_sha256': sha(p / f'data/PARENT-{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 = """ # Nine additional paired directions; all82 cold buffers are charged. + import paired_extension + extension_parent=json.loads(gzip.decompress((D/'inputs'/f'CHANNEL408-WORD-{wt}.json.gz').read_bytes())) + assert chain[-1]==extension_parent + extension_transforms=[json.loads((D/'paired-extension/data'/f'TRANSFORM-{h}.json').read_text()) for h in paired_extension.HELPERS] + extension_word=paired_extension.apply(chain[-1],extension_transforms) + assert set(k_ for k_ in chain[-1] if chain[-1][k_]!=extension_word[k_])==paired_extension.ALLOWED + chain.append(extension_word);steps.append('nine-additional-paired-extractions') +""" + 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('two-sided-helper408-review'")) + assert text.count(line) == 1 + path.write_text(text.replace(line, line + "\nrun('paired-extension-review',P/'new/borrow/paired-extension/verify.py','--work',work/'paired-extension-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/paired_extension.py'} + expected |= {f'new/borrow/words/BORROW-WORD-43{tag}.json.gz' for tag in ('base', 'extra')} + expected |= {f'new/borrow/inputs/CHANNEL408-WORD-{tag}.json.gz' for tag in ('base', 'extra')} + expected |= {'new/borrow/paired-extension/' + n for n in copied} + assert set(changes) == expected and tree(src) == before + save(out / 'MANIFEST.json', after) + result = {'status': 'PASS_SOURCE_BOUND_PAIRED_EXTENSION_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/paired-helper-extension/tools/derive_adapters.py b/research/paired-helper-extension/tools/derive_adapters.py new file mode 100644 index 0000000000..67b81d6f53 --- /dev/null +++ b/research/paired-helper-extension/tools/derive_adapters.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +# Adapter derivation by Mason Hale with OpenAI Codex assistance; inherited +# PR2908/2894/2857/2839 admission and native authors retain their attribution. +"""Derive three closed-profile adapters from exact PR2908 source, with counted patches. +No native/invoice check is removed. Source/hash arguments bind the new declared overlay; +retained_receipt_sha binds only the explicitly reused unchanged parent cache. +""" +from pathlib import Path +import argparse,gzip,hashlib,json,sys +PARENT_HEAD='51309592971e3b5be935599eed2a95404dc7781e' +NEW_COMMIT='paired-helper-extension-pr2908' +FINAL_SOURCE_SHA='98d57c82a1c7318be3c330c3b66897844d57232f0aaeaea88fb4bebd0a1bedf1' +FINAL_SOURCE_FILES=632 +OLD_SOURCE='56cf455752722051d598a7da1e5ee700637fbaef09189f534413dbe6e0525a83' +OLD_RETAINED='dd36443f2789ffa6deca7210c76ada781e2b9b7e622a546b366f51a475faff3e' +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,expected,out,retained_sha): + manifest=json.loads((parent/'MANIFEST.json').read_bytes());need(tree(parent)==manifest,'complete exact parent manifest inventory') + # These pins are independent of the manifest file contents themselves. + need(sha((parent/'MANIFEST.json').read_bytes())=='9dba3fe371602ec023a54e26c0fd66f69eb7a74be86aab89923529083c14b36f','exact PR2908 package manifest') + newsha=sha((source/'MANIFEST.json').read_bytes());need(newsha==expected==FINAL_SOURCE_SHA,'exact final declared source manifest') + files=json.loads((source/'MANIFEST.json').read_bytes());need(len(files)==FINAL_SOURCE_FILES and tree(source)==files,'complete final source inventory') + for tag in ('base','extra'): + wp=source/f'new/borrow/words/BORROW-WORD-43{tag}.json.gz' + w=json.loads(gzip.decompress(wp.read_bytes()));oldword=json.loads(gzip.decompress((parent/f'data/WORD-{tag}.json.gz').read_bytes())) + need(set(map(int,w['helper_final']))==set(map(int,oldword['helper_final']))|{424,428,412,331,299,320,511,304,499},'exact nine extra restored helpers') + need(all(w['helper_final'][h]==U for h,U in oldword['helper_final'].items()),'all inherited restored endpoints retained') + need(len(w['helper_final'])==82 and w['report']['local_profile']=={'1':2416,'2':640,'3':280,'4':110,'5':26,'8':8},'declared82-buffer local profile') + need(w['report']['width_inventory']=={'4':26,'5':2,'7':62,'8':96,'9':222},'declared current helper inventory') + nfiles=len(files);comparison_sha=sha((parent/'CLAIM.json').read_bytes());claim=json.loads((parent/'CLAIM.json').read_bytes()) + need('headline_kappa_source'not in claim and 'kappa'in claim,'headline outer comparison') + need(len(retained_sha)==64 and all(c in'0123456789abcdef'for c in retained_sha),'retained receipt SHA256') + 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='"+NEW_COMMIT+"'"), + ("OLD_RECEIPT_SHA='"+OLD_RETAINED+"'","OLD_RECEIPT_SHA='"+retained_sha+"'"), + ("len(can['zero_buffers'])==73","len(can['zero_buffers'])==82"), + ]) + oldprofile=" 'channel408': dict(commit='two-sided-helper408-pr2894',manifest='"+OLD_SOURCE+"',helpers=408,source_file_count=610,upstream_head='18d03c447886895ef9abf888398178e0428533ca')," + newprofile=" 'paired-extension': dict(commit='"+NEW_COMMIT+"',manifest='"+newsha+"',helpers=408,source_file_count="+str(nfiles)+",upstream_head='"+PARENT_HEAD+"')," + adapt('admit_channel408.py','admit_extension.py',[ + (oldprofile,newprofile), + ("COMPARISONS = {","COMPARISONS = {\n 'pr2908': dict(pr=2908,head='"+PARENT_HEAD+"',sha256='"+comparison_sha+"',field='kappa'),"), + ("ap.add_argument('--source-profile', choices=['channel408'], default='channel408')","ap.add_argument('--source-profile', choices=['paired-extension'], default='paired-extension')"), + ("ap.add_argument('--comparison-profile', choices=['pr2894'], default='pr2894')","ap.add_argument('--comparison-profile', choices=['pr2908'], default='pr2908')"), + ('zero_buffers_allocated_and_cleared=73','zero_buffers_allocated_and_cleared=82'), + ("len(c.get('zero_buffers',[]))==73, 'helper408 physical ABI including all 73 private buffers'","len(c.get('zero_buffers',[]))==82, 'paired extension physical ABI including all 82 private buffers'"), + ("896*T+expected_helpers+8+73+2, 'complete physical cost including all actual helpers and 73 buffers'","896*T+expected_helpers+8+82+2, 'complete physical cost including all actual helpers and 82 buffers'"), + ]) + adapt('channel_blocknorm.py','extension_blocknorm.py',[ + ("len(allocated)==73, 'all73 private zero buffers released'","len(allocated)==82, 'all82 private zero buffers released'"), + ("'zero_buffers_allocated_and_cleared':73","'zero_buffers_allocated_and_cleared':82"), + ("r['zero_buffers_returned_to_zero']==73","r['zero_buffers_returned_to_zero']==82"), + ('physical==live+8+408+73+2','physical==live+8+408+82+2'), + ("'zero_buffers':[live+416,live+489], 'coefficient':[live+489,live+491]","'zero_buffers':[live+416,live+498], 'coefficient':[live+498,live+500]"), + ("len(mp)==73 and set(mp.values())==set(range(*ns['zero_buffers'])), '73distinct private Z slots'","len(mp)==82 and set(mp.values())==set(range(*ns['zero_buffers'])), '82distinct private Z slots'"), + ('T=len(order)//9; live=896*T; physical=live+490','T=len(order)//9; live=896*T; physical=live+500'), + ]) + # The native address dimension and symplectic stock factor are deliberately retained. + 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':'PASS_CHECKED_82_BUFFER_ADAPTER_DERIVATION','parent_head':PARENT_HEAD,'parent_manifest_sha256':sha((parent/'MANIFEST.json').read_bytes()),'source_commit':NEW_COMMIT,'source_manifest_sha256':newsha,'source_files':nfiles,'comparison_sha256':comparison_sha,'retained_receipt_sha256':retained_sha,'buffer_count':82,'physical_overhead':500,'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('--source-manifest',required=True);ap.add_argument('--retained-receipt',type=Path,required=True);ap.add_argument('--out',type=Path,required=True);a=ap.parse_args() + r=derive(a.parent_package,a.source,a.source_manifest,a.out,sha(a.retained_receipt.read_bytes()));print(r['status'],r['source_manifest_sha256'],r['source_files']) diff --git a/research/paired-helper-extension/vendor/audit_local.py b/research/paired-helper-extension/vendor/audit_local.py new file mode 100644 index 0000000000..8224873d04 --- /dev/null +++ b/research/paired-helper-extension/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 pk 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