diff --git a/research/p104-coalesced-private-reuse-audit/.gitattributes b/research/p104-coalesced-private-reuse-audit/.gitattributes new file mode 100644 index 0000000000..d7fd1ac18e --- /dev/null +++ b/research/p104-coalesced-private-reuse-audit/.gitattributes @@ -0,0 +1,4 @@ +* text eol=lf +# Frozen unified-diff context lines retain their exact whitespace. +inputs/*.patch -text -whitespace +inputs/*.tar.gz -text diff --git a/research/p104-coalesced-private-reuse-audit/LICENSE b/research/p104-coalesced-private-reuse-audit/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/p104-coalesced-private-reuse-audit/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/p104-coalesced-private-reuse-audit/README.md b/research/p104-coalesced-private-reuse-audit/README.md new file mode 100644 index 0000000000..64af63d17b --- /dev/null +++ b/research/p104-coalesced-private-reuse-audit/README.md @@ -0,0 +1,132 @@ +# Independent corroboration of coalesced P104 private reuse + +**A finite composition improvement, not a new selected exponent or an admitted supplier.** + +**Publication checkpoint.** [Gareth Davidson / PR #2305](https://github.com/CrocSwap/integer-mult-bounds/pull/2305), pinned at `335e78619a17b7c418e11306f86a72fd366de35b`, published the same retained-boundary construction after this study's local result was saved. This submission is therefore **independent corroboration, not a new composition or priority claim**. It uses a separately written rational-row/frame interpreter, reproduces the original-word control and also records a released-boundary companion. The public profiles, full width vector, complete native receipt, owner-assignment hash and four exact cost/root/threshold intervals agree with the pinned PR2305 receipt. The shared frozen native, geometry, hosting and interval components are inherited, not independently reimplemented. + +This successor combines David Arias's complete forward word and its 339 common-frame changes in [PR #2152](https://github.com/CrocSwap/integer-mult-bounds/pull/2152) with [1337isnot1337's private-descent reuse in PR #2219](https://github.com/CrocSwap/integer-mult-bounds/pull/2219). PR #2219 explicitly left the coalesced variant untested. All 339 frame changes survive the composition. + +The principal variant retains **every public initial and final frame**, all 735 public registers, and the entire inherited conditional owner-width vector. It saves nine scalar ADDs. Its combined recursive transport histogram replaces exactly **one H2 and one H7 by one H9**. This is a strict local moment saving for every `0 < a < 1`, without a fitted numerical argument. + +The available complete conditional owner invoice still cannot reach the selected result. Its certified kappa upper bound improves from **0.00165234290426035** to **0.00165270058587330**, remaining **1.19328548% below** selected kappa. The predecessor's 1% gain target is not passed. + +## Exact question and sources + +The experiment fixes the public helper with global register number 711 (helper 7), the query for root pair (4,57), source register 133, and private register 738. It does not search all helpers or change the selected frontier. + +- Canonical-main base: `0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2`, priority revision 4. +- PR #2152 source: `05f7aad0f08992ee48ec2dd93e896d9a4567847d`. +- PR #2219 predecessor: `3f913bc17276b68f0c9008a1202b6ce588e77ff6`. +- Selected record: SHA256 `10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32`. + +Both PRs were pending at the entry checkpoint. Their status is not treated as maintainer approval. The source bundle contains 39 unchanged files from PR #2152, including its 13 replay inputs and retained notices. Every unpacked file is checked against its SHA256. The credited PR #2219 patch is retained as an attribution/reference input; the successor does not execute or apply that patch. + +## Construction and finite proof + +The three coalesced contact frames are exactly the ones used by the original-word reuse: + +| Target | Coefficient | Canonical binary basis | Dimension | +| --- | --- | --- | --- | +| 159 | -1 | 2, 12, 16, 33, 64, 128, 261 | 7 | +| 203 | 2 | 2, 12, 33, 80, 144, 261 | 6 | +| 148 | 2 | 45, 82, 144 | 3 | + +Write these frames as F7, F6 and F3. The private copy starts in Hb, of dimension 8, and ends in La, of dimension 1. The literal subspaces satisfy + +```text +La <= F3 <= F6 <= F7 <= Hb. +``` + +After copying actual source 133 and applying its existing normalization -1/2, the private copy descends Hb -> F7 -> F6 -> F3 -> La. It directly supplies the three contacts in that order, then seeds the other helpers as before. The four private rank jumps are 1, 1, 3 and 2, totaling the same seven ranks. + +The helper's original seed, three reads and restoration disappear. Its arbitrary dirt no longer enters any live output, so seven entry-compensation additions are removed. Three direct private reads replace the three helper reads. Net change: 12 deleted ADDs and three inserted ADDs, **20,956 -> 20,947**. + +This retiming is checked on the complete word; nesting alone would not prove it legal. The independent successor interpreter: + +1. reconstructs each public ascent and private descent from the actual scalar chart; +2. checks common charts, private ownership, cleared COPY destinations and fixed public boundaries; +3. propagates exact rational rows over all 735 independent public inputs; +4. requires all 104 live targets to end as their original target plus corresponding original source, and all other public rows to equal their own original input; +5. checks every private transport occurrence belongs to exactly one of the eight sequential private lifetimes. + +The positive control reconstructs the coalesced predecessor's complete histogram with the new interpreter. A second control applies the same successor transformation to the original word and independently reproduces PR #2219's published 5,885-rank profile. Comparison of the two predecessor scalar streams verifies identical operations, coefficients and order with exactly 339 changed charts. None of those 339 events is deleted by the successor. + +The native checker, retained and credited from PR #2152, independently interprets the compiled Gaussian operators: signed Pauli actions and global phases, 208 intrinsic endpoint adapters, and all 4,096 Gaussian basis columns of the eight private paths, for each successor variant. This is not a proof-assistant or independent human review. + +## Two boundary variants and their full invoices + +The main result retains the old full-frame exit for now-unused helper 711. One final rank-nine transport takes its unchanged arbitrary input from the zero chart to the full chart. This pays for retaining the caller's original boundary contract. + +The exploratory released-helper variant instead leaves register 711 untouched in the zero frame. It has a different boundary contract. Its freed width is not passed to the old hosting certificate as if that certificate automatically applied. + +| Quantity | Coalesced predecessor | Retained boundary | Released helper | +| --- | ---: | ---: | ---: | +| Exact public input columns | 735 | 735 | 735 | +| Scalar ADDs | 20,956 | 20,947 | 20,947 | +| Combined local rank mass | 5,894 | 5,894 | 5,885 | +| Private rank mass | 56 | 56 | 56 | +| Literal positive-rank transport occurrences | 3,626 | 3,625 | 3,624 | +| Combined profile change | — | -H2 -H7 +H9 | -H2 -H7 | +| Every old public boundary retained | yes | yes | no: helper 711 remains at zero | + +At moment exponent `a`, rank r costs `(r/m)^(1-a)`. If `q=1-a` and `0t` and `(1-t)^q>1-t`. Hence + +```text +(2/m)^(1-a) + (7/m)^(1-a) > (9/m)^(1-a). +``` + +Thus the retained-boundary histogram is strictly cheaper for every `0(9/m)^(1-a); equal at a=0.", + "unused_helper": 711 + }, + "conditional_hosting": { + "actual_ordinary_widths_sha256": "2bcbd8d810246b0207042b7daac61ea07810e2033188944d3434f3f9d0e399f7", + "assigned_roles": 75888, + "assignment_sha256": "660d86bd36395690c2e0f37084c1bf15ce8277cb354dec5b1589c681bf3ffb77", + "global_emitter_admitted": false, + "per_call_idle_rank_mass": "818", + "remaining_idle_profile": { + "1": 2094, + "12": 13, + "13": 3, + "14": 5, + "15": 5, + "16": 1, + "2": 408, + "23": 1, + "24": 2, + "3": 1833, + "31": 3, + "32": 2, + "39": 8, + "4": 420, + "40": 15, + "43": 1, + "48": 2187, + "5": 1, + "7": 169 + }, + "total_calls": 144, + "valid_for_variant": "boundary_retained only; every public boundary and complete width retained" + }, + "costs": [ + { + "idle_model": "optimistic fractional rank-51", + "kappa_upper_bound": "1676378334989/1001676378334989", + "kappa_upper_decimal": "0.00167357279381542081585612", + "model": { + "R": "51", + "deficit": "328/9", + "idle_mass": "818", + "local_mass": "5894", + "total_mass": "6712", + "w": "832/9" + }, + "moment_at_one_percent_target": [ + "115798026594401014907520249716817218074026211706487942217650300074941273861313/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "115798026594401014907520249716817218074026211706487942217650300074941273861353/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "moment_at_selected": [ + "57895873309932484004509113347261903061690519446446419112848673042832486504953/57896044618658097711785492504343953926634992332820282019728792003956564819968", + "115791746619864968009018226694523806123381038892892838225697346085664973009947/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "name": "baseline_ideal", + "one_percent_target_excluded": true, + "priced_profile": { + "1": "2429", + "2": "558", + "3": "389", + "4": "112", + "5": "108", + "6": "16", + "7": "14" + }, + "relative_to_selected_percent": "0.0545596015315984530369420", + "root_interval": [ + "419094583747/250000000000000", + "1676378334989/1000000000000000" + ], + "selected_threshold_excluded": false + }, + { + "idle_model": "optimistic fractional rank-51", + "kappa_upper_bound": "1676746503639/1001676746503639", + "kappa_upper_decimal": "0.00167393973104766342234213", + "model": { + "R": "51", + "deficit": "328/9", + "idle_mass": "818", + "local_mass": "5894", + "total_mass": "6712", + "w": "832/9" + }, + "moment_at_one_percent_target": [ + "28949471888778650775970089095170833327653233983714441028871285603991269413739/28948022309329048855892746252171976963317496166410141009864396001978282409984", + "28949471888778650775970089095170833327653233983714441028871285603991269413749/28948022309329048855892746252171976963317496166410141009864396001978282409984" + ], + "moment_at_selected": [ + "57895804482775949014417281183091859417994854881979828896680978738548006854143/57896044618658097711785492504343953926634992332820282019728792003956564819968", + "57895804482775949014417281183091859417994854881979828896680978738548006854163/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "name": "retained_ideal", + "one_percent_target_excluded": true, + "priced_profile": { + "1": "2429", + "2": "557", + "3": "389", + "4": "112", + "5": "108", + "6": "16", + "7": "13", + "9": "1" + }, + "relative_to_selected_percent": "0.0764969461807897866217970", + "root_interval": [ + "838373251819/500000000000000", + "1676746503639/1000000000000000" + ], + "selected_threshold_excluded": false + }, + { + "idle_model": "optimistic fractional rank-51", + "kappa_upper_bound": "419487612669/250419487612669", + "kappa_upper_decimal": "0.00167513964934643391460414", + "model": { + "R": "51", + "deficit": "328/9", + "idle_mass": "827", + "local_mass": "5885", + "total_mass": "6712", + "w": "832/9" + }, + "moment_at_one_percent_target": [ + "115797433318778378873536476729383808743416280978213571391961756527739986471327/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "115797433318778378873536476729383808743416280978213571391961756527739986471367/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "moment_at_selected": [ + "14473894905424573607518328445855233035699088067842803814609483703185195274737/14474011154664524427946373126085988481658748083205070504932198000989141204992", + "115791159243396588860146627566841864285592704542742430516875869625481562197937/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "name": "released_ideal", + "one_percent_target_excluded": true, + "priced_profile": { + "1": "2429", + "2": "557", + "3": "389", + "4": "112", + "5": "108", + "6": "16", + "7": "13" + }, + "relative_to_selected_percent": "0.148234068930971035893922", + "root_interval": [ + "67118018027/40000000000000", + "419487612669/250000000000000" + ], + "selected_threshold_excluded": false + }, + { + "idle_model": "actual inherited window invoice", + "kappa_upper_bound": "206884707511/125206884707511", + "kappa_upper_decimal": "0.00165234290426035376348678", + "model": { + "R": "51", + "deficit": "328/9", + "idle_mass": "0", + "local_mass": "6712", + "total_mass": "6712", + "w": "832/9" + }, + "moment_at_one_percent_target": [ + "115806175970668244112225686102154714207580210146774622734802577933379997176669/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "57903087985334122056112843051077357103790105073387311367401288966689998588355/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "moment_at_selected": [ + "28949953738550108612664161769179381210926055752005100353634954731463147100131/28948022309329048855892746252171976963317496166410141009864396001978282409984", + "115799814954200434450656647076717524843704223008020401414539818925852588400565/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "name": "baseline_hosted", + "one_percent_target_excluded": true, + "priced_profile": { + "1": "58645/24", + "12": "13/144", + "13": "1/48", + "14": "5/144", + "15": "5/144", + "16": "1/144", + "2": "3365/6", + "23": "1/144", + "24": "1/72", + "3": "19283/48", + "31": "1/48", + "32": "1/72", + "39": "1/18", + "4": "1379/12", + "40": "5/48", + "43": "1/144", + "48": "243/16", + "5": "15553/144", + "6": "16", + "7": "2185/144" + }, + "relative_to_selected_percent": "-1.21466947393559201476336", + "root_interval": [ + "1655077660087/1000000000000000", + "206884707511/125000000000000" + ], + "selected_threshold_excluded": true + }, + { + "idle_model": "actual inherited window invoice", + "kappa_upper_bound": "1655436526791/1001655436526791", + "kappa_upper_decimal": "0.00165270058587329645926987", + "model": { + "R": "51", + "deficit": "328/9", + "idle_mass": "0", + "local_mass": "6712", + "total_mass": "6712", + "w": "832/9" + }, + "moment_at_one_percent_target": [ + "14475754616422729038573224095752603680520866796893055579079677534300475121289/14474011154664524427946373126085988481658748083205070504932198000989141204992", + "115806036931381832308585792766020829444166934375144444632637420274403800970353/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "moment_at_selected": [ + "115799677299887364470472982748377437556312893879087220982204430317283629098903/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "1809369957810740069851140355443397461817388966860737827846944223707556704671/1809251394333065553493296640760748560207343510400633813116524750123642650624" + ], + "name": "retained_hosted", + "one_percent_target_excluded": true, + "priced_profile": { + "1": "58645/24", + "12": "13/144", + "13": "1/48", + "14": "5/144", + "15": "5/144", + "16": "1/144", + "2": "3359/6", + "23": "1/144", + "24": "1/72", + "3": "19283/48", + "31": "1/48", + "32": "1/72", + "39": "1/18", + "4": "1379/12", + "40": "5/48", + "43": "1/144", + "48": "243/16", + "5": "15553/144", + "6": "16", + "7": "2041/144", + "9": "1" + }, + "relative_to_selected_percent": "-1.19328547654223217026075", + "root_interval": [ + "165543652679/100000000000000", + "1655436526791/1000000000000000" + ], + "selected_threshold_excluded": true + } + ], + "frozen_sources_unchanged": true, + "full_selected_cold_replay": false, + "helper_released": { + "common_scalar_frames": true, + "dirty_restoration": true, + "endpoint_columns_checked": 735, + "exact_endpoint_identity": true, + "live_targets": 104, + "peak_private_copies": 1, + "private_copies": 8, + "private_profile": { + "1": 2, + "2": 1, + "3": 1, + "7": 7 + }, + "private_rank_mass": 56, + "public_profile": { + "1": 2427, + "2": 556, + "3": 388, + "4": 112, + "5": 108, + "6": 16, + "7": 6 + }, + "public_rank_mass": 5829, + "public_registers": 735, + "public_widths_sha256": "35516d8ce58b5991e0737e6cea89be229872a7e31eefdcc95c1094e0865a8201", + "scalar_adds": 20947, + "total_transport_rank_mass": 5885, + "transport_occurrences": 3624, + "transports_sha256": "0755585321d0f3f3d69675389a544455990bd4f88ff7372b85f1a19d5e0b56ae", + "word_sha256": "1088f982f3bccf4aa672975dbfbcca36fe047293ac15e1732794e492f7f9143f" + }, + "native_checks": { + "boundary_retained": { + "distinct_transport_recipes": 2942, + "every_recipe_signed_pauli_action_and_global_phase_checked": true, + "intrinsic_monomial_endpoint_adapters": 208, + "literal_transport_occurrences": 3625, + "native_rank_mass": 5894, + "paid_profile": { + "1": 2429, + "2": 557, + "3": 389, + "4": 112, + "5": 108, + "6": 16, + "7": 13, + "9": 1 + }, + "private_path_gaussian_columns": 4096, + "private_paths": 8, + "recipe_payload_sha256": "af98d5044597101378c7f139b2ecbed22a1411489038169d5f6e6fcfed6aac00", + "scope": "Finite forward operators for the supplied literal scalar/frame witness; its endpoint identity is checked separately. No backward supplier, hosting, precision, or kappa claim.", + "status": "PASS_FINITE_NATIVE_LOWERING", + "wrong_global_phase_control_rejected": true + }, + "helper_released": { + "distinct_transport_recipes": 2941, + "every_recipe_signed_pauli_action_and_global_phase_checked": true, + "intrinsic_monomial_endpoint_adapters": 208, + "literal_transport_occurrences": 3624, + "native_rank_mass": 5885, + "paid_profile": { + "1": 2429, + "2": 557, + "3": 389, + "4": 112, + "5": 108, + "6": 16, + "7": 13 + }, + "private_path_gaussian_columns": 4096, + "private_paths": 8, + "recipe_payload_sha256": "ab17d5297c140aeaf58af360dae544f751118216cf02b9d968800b35f65f5ebb", + "scope": "Finite forward operators for the supplied literal scalar/frame witness; its endpoint identity is checked separately. No backward supplier, hosting, precision, or kappa claim.", + "status": "PASS_FINITE_NATIVE_LOWERING", + "wrong_global_phase_control_rejected": true + } + }, + "negative_controls": { + "ascending_private": "private descent/public ascent violates frame inclusion", + "contact_coefficient": "exact endpoint mismatch at public register 159", + "missing_private_init": "uninitialized private register", + "omit_contact": "exact endpoint mismatch at public register 159", + "retain_dirty_compensation": "exact endpoint mismatch at public register 123" + }, + "new_kappa_claimed": false, + "original_word_reuse_control": { + "common_scalar_frames": true, + "dirty_restoration": true, + "endpoint_columns_checked": 735, + "exact_endpoint_identity": true, + "live_targets": 104, + "peak_private_copies": 1, + "private_copies": 8, + "private_profile": { + "1": 2, + "2": 1, + "3": 1, + "7": 7 + }, + "private_rank_mass": 56, + "public_profile": { + "1": 2609, + "2": 512, + "3": 377, + "4": 132, + "5": 81, + "6": 15, + "7": 6 + }, + "public_rank_mass": 5829, + "public_registers": 735, + "public_widths_sha256": "35516d8ce58b5991e0737e6cea89be229872a7e31eefdcc95c1094e0865a8201", + "scalar_adds": 20947, + "total_transport_rank_mass": 5885, + "transport_occurrences": 3743, + "transports_sha256": "ffbc6165b8dbb23257c46615e62203c8f1c0cf5d2098b548a6ccd1b27b28ec3b", + "word_sha256": "ad1a6936f24cca62d37a1545ac5c422344327332752d224b476d262360f67517" + }, + "predecessors": { + "2152": "05f7aad0f08992ee48ec2dd93e896d9a4567847d", + "2219": "3f913bc17276b68f0c9008a1202b6ce588e77ff6" + }, + "scope": "Finite exact forward composition plus native operators and conditional local+idle invoices; no admitted supplier or new kappa.", + "selected_kappa": "836330098538459/500000000000000000", + "status": "PASS_P104_COALESCED_PRIVATE_REUSE" +} diff --git a/research/p104-coalesced-private-reuse-audit/SOURCES.json b/research/p104-coalesced-private-reuse-audit/SOURCES.json new file mode 100644 index 0000000000..392737aa2a --- /dev/null +++ b/research/p104-coalesced-private-reuse-audit/SOURCES.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "e8870e5917057d59b730eb14721a778639eca050", + "sha256": "d46eb6d5b3e279428753d770653663fbdf1063e55c255ea073d768f344927ef7" + } + ] +} diff --git a/research/p104-coalesced-private-reuse-audit/TASK.json b/research/p104-coalesced-private-reuse-audit/TASK.json new file mode 100644 index 0000000000..7b9bf3d762 --- /dev/null +++ b/research/p104-coalesced-private-reuse-audit/TASK.json @@ -0,0 +1,286 @@ +{ + "schema_version": 1, + "task_id": "p104-side-correction", + "priority_revision": 4, + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "original_card": { + "id": "p104-side-correction", + "question": "Can the native P104 low-rank channel be completed with a legal, fully charged I-G/2 side correction?", + "starting_points": [ + "research/p104-native-channel/README.md", + "research/p104-native-channel/PROOF.md", + "docs/research/community-efficient1000-review.md" + ], + "methods": [ + "Construct one side-correction word at an explicit chronological cut with the needed frames still available.", + "Derive a lower bound on the side correction and hosting costs that decides whether this channel can beat the selected budget." + ], + "acceptance_gate": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the P104 open next questions and its fixed local histogram; inspect why appending I-G/2 after source completion is not justified. #1991 supplies the checked native channel, not the missing correction.", + "scope": "Source-bound orientation only. Read the named package and review before relying on its local evidence; this command is not its replay or supplier admission." + }, + "first_experiment": "Choose one exact side-correction cut and bound its allowed cost from a favorable completed moment at a declared target. Stop or hand off if the necessary source/target access cannot be justified or even the optimistic total misses the target.", + "bottleneck_link": "Completing an already realized changed channel tests a concrete construction opportunity, instead of refining the incumbent packing. A positive local result still needs global and all-size admission.", + "allowed_variations": [ + "One correction factorization, one chronological cut, or one explicit hosting obstruction.", + "A changed correction schedule with an updated full bill and native frame contract." + ], + "scope_change_triggers": [ + "Recompiling the already certified low-rank channel without closing a new obligation.", + "Treating a pending ancestor, local histogram or unpriced side correction as an admitted global supplier." + ], + "overlap_terms": [ + "P104", + "I-G/2", + "side correction", + "native channel", + "1972", + "1991" + ] + }, + "scope_status": "changed", + "actual_scope": "Independent corroboration of the retained-boundary P104 composition also reported by PR2305, using our prior separately written rational-row/frame checker; include original-word positive control and a released-boundary companion.", + "scope_change_reason": "A fresh overlap review found existing P104 correction constructions and cut obstructions. PR2219 explicitly left the coalesced word untested. The session therefore follows that concrete compatibility handoff instead of reconstructing the already published native G/2 channel or repeating a cut theorem.", + "bottleneck_link": "The complex supplier binds. This composition lowers its local recursive moment under unchanged public boundary widths, but the checked conditional local-plus-idle invoice still misses the selected bound. It closes a reusable finite compatibility question, not supplier admission.", + "budget_minutes": 60, + "stop_rule": "One helper, one exact private descent and the 339 pinned frame changes. Stop after exact compatibility and complete stated-model pricing, or a reproducible incompatibility; no wider helper search.", + "outcome": "completed", + "evidence": "RESULT.json binds 735 symbolic input columns, 339 retained chart changes, five rejecting semantic controls, exact native phases and 4096 private Gaussian columns per variant, 75888 inherited conditional placements, and exact rational root/threshold intervals. The actual conditional invoice remains below selected kappa; no improved selected exponent.", + "author": "SHIN09-git, with OpenAI Codex assistance", + "ai_assistance": "Substantial OpenAI Codex assistance in source research, exact construction, independent successor row interpreter, controls, accounting and writing. No separate agent, independent human reviewer or proof assistant was used.", + "open_questions": [ + { + "question": "Can a different contact schedule reduce dominant small-rank cost enough to pass the selected threshold with actual residual packing?", + "why_it_matters": "The present conditional complete invoice remains 1.19328548 percent below selected kappa despite the proven local saving.", + "first_step": "Change one source-bound contact schedule, preserve actual query access and all dirty restoration, then price its complete conditional invoice before native compilation.", + "blocked_by": "No proposed cheaper schedule or improved complete packing has been certified here." + }, + { + "question": "Can the unused helper's zero-width variant be integrated into a new owner contract?", + "why_it_matters": "Its optimistic ceiling is more favorable but an unchanged-width owner receipt cannot certify a changed boundary.", + "first_step": "Construct and check the changed width vector, every owner placement and the resulting residual histogram.", + "blocked_by": "The existing conditional packing assumes all 47 new/reclassified roles have width nine." + }, + { + "question": "Which other private query copies have compatible nested fanout contacts after coalescing?", + "why_it_matters": "Compatibility for helper 7 does not establish a general helper-reuse theorem.", + "first_step": "Inventory one other private copy's actual contact frames and intervening dependencies, then test the smallest exact candidate.", + "blocked_by": "No broader search or claim is included in this round." + } + ], + "original_acceptance_gate_met": false, + "selected_frontier_changed": false, + "nonce": "8ffdbbbf0b1c20484ea54193b101ffc5", + "assigned_track": "complex-mechanisms", + "scope_key": "p104/pr2152-coalesced/helper7-private-descent/retained-boundary-invoice", + "started_at_utc": "2026-10-15T03:34:08Z", + "source_heads": { + "2152": "05f7aad0f08992ee48ec2dd93e896d9a4567847d", + "2219": "3f913bc17276b68f0c9008a1202b6ce588e77ff6" + }, + "publication_status": "Authorized for PR submission; no advance Discussion reservation was posted.", + "overlap": { + "entry_open_prs": { + "records": 508, + "complete_pagination": true, + "fetched_at": "2026-10-15T03:36:20.184469+00:00" + }, + "entry_discussion_records": { + "records": 996, + "complete_pagination": true, + "fetched_at": "2026-10-15T03:41:10.333143+00:00" + }, + "local_records": 1538, + "terms": [ + "P104", + "side correction", + "coalesced AND reuse" + ], + "closest": [ + "https://github.com/CrocSwap/integer-mult-bounds/pull/2152", + "https://github.com/CrocSwap/integer-mult-bounds/pull/2219", + "https://github.com/CrocSwap/integer-mult-bounds/discussions/2218" + ], + "distinction": "PR2219 checks the original fanout word; this successor independently composes the coalesced word and retains all public boundary widths for a comparable conditional invoice. Discussion2218 treats a different (97,5) delayed echo.", + "limits": "Metadata/body searches and local README/TASK/ledger coverage, not every diff or every closed PR. No matches is not proof of novelty.", + "entry_local_records": 1536, + "final_checkpoint": { + "searched_at": "2026-10-15T04:06:09.276308+00:00", + "coverage": { + "open_prs": { + "fetched_at": "2026-10-15T04:00:58.264825+00:00", + "complete_pagination": true, + "records": 513 + }, + "discussions": { + "fetched_at": "2026-10-15T04:06:09.202865+00:00", + "complete_pagination": true, + "records": 1006 + } + }, + "terms": [ + "coalesced", + "reuse" + ], + "matches_total": 11, + "reviewed_remote_matches": [ + { + "kind": "pr", + "number": 2219, + "title": "Record P104 private descent fanout reuse construction", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/2219", + "updated_at": "2026-10-15T00:26:05Z" + }, + { + "kind": "discussion-comment", + "number": 2218, + "title": "FINDING / RELEASED: P104 (97,5) corrected delayed echo passes scalar checks but loses cost screen", + "url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2218#discussioncomment-18937292", + "updated_at": "2026-10-15T00:52:47Z" + }, + { + "kind": "discussion-comment", + "number": 1167, + "title": "Larger κ: proposals that change the current cost structure", + "url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1167#discussioncomment-18936581", + "updated_at": "2026-10-14T23:59:45Z" + } + ], + "finding": "No additional exact composition found in the refreshed metadata search. #2219 remains the closest predecessor; its coalesced variant is explicitly untested.", + "limits": "Remote PR scope is open PRs including drafts. Closed work is searched through local READMEs, TASK metadata and ledger only. No code diffs or arbitrary package files are searched. Recheck relevant heads before submission." + }, + "recent_pr_delta": { + "checked_at_utc": "2026-10-15T04:09:51.7317883Z", + "fetched_records": 100, + "oldest_updated_at": "2026-10-14T22:46:36Z", + "updated_since_checkpoint": 5, + "p104_updates": [] + }, + "new_related_discussion_review": { + "url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2245#discussioncomment-18940216", + "updated_at": "2026-10-15T04:01:08Z", + "distinction": "A prefix-pooled shared-correction-space boundary in the frozen PR1972 trace; not the PR2152 coalesced forward word or helper-7 private-descent composition." + }, + "publication_checkpoint": { + "searched_at": "2026-10-15T05:49:12.094616+00:00", + "coverage": { + "open_prs": { + "fetched_at": "2026-10-15T05:44:09.658360+00:00", + "complete_pagination": true, + "records": 546 + }, + "discussions": { + "fetched_at": "2026-10-15T05:49:12.018057+00:00", + "complete_pagination": true, + "records": 1052 + } + }, + "terms": [ + "coalesced", + "reuse" + ], + "matches_total": 13, + "local_records": 1538, + "limits": "Remote PR scope is open PRs including drafts. Closed work is searched through local READMEs, TASK metadata and ledger only. No code diffs or arbitrary package files are searched. Recheck relevant heads before submission.", + "finding": "PR2305 and Discussion2299 report the same retained-boundary composition. This contribution is reclassified as independent corroboration, with explicit common-component limits and a distinct directory.", + "reviewed_remote_matches": [ + { + "kind": "discussion", + "number": 2299, + "title": "DONE: P104 private reuse composes with coalesced frames; owner invoice still loses", + "url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2299" + }, + { + "kind": "pr", + "number": 2305, + "title": "Compose P104 private descent reuse with coalesced frames", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/2305" + }, + { + "kind": "pr", + "number": 2219, + "title": "Record P104 private descent fanout reuse construction", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/2219" + }, + { + "kind": "discussion-comment", + "number": 2218, + "title": "FINDING / RELEASED: P104 (97,5) corrected delayed echo passes scalar checks but loses cost screen", + "url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2218#discussioncomment-18937292" + }, + { + "kind": "discussion-comment", + "number": 1167, + "title": "Larger κ: proposals that change the current cost structure", + "url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1167#discussioncomment-18936581" + } + ] + } + }, + "upstream_checkpoint": { + "checked_at_utc": "2026-10-15T04:09:53.9484417Z", + "canonical_main": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "source_prs": [ + { + "headRefOid": "05f7aad0f08992ee48ec2dd93e896d9a4567847d", + "number": 2152, + "state": "OPEN", + "updatedAt": "2026-10-14T21:09:24Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/2152" + }, + { + "headRefOid": "3f913bc17276b68f0c9008a1202b6ce588e77ff6", + "number": 2219, + "state": "OPEN", + "updatedAt": "2026-10-15T00:26:05Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/2219" + } + ], + "priority_revision": 4, + "guidance_changed": false, + "source_prs_open": true, + "source_heads_unchanged": true + }, + "finished_at_utc": "2026-10-15T04:18:39.722084+00:00", + "validation_receipt": "VALIDATION.json", + "concurrent_result_comparison": { + "peer_pr": 2305, + "peer_head": "335e78619a17b7c418e11306f86a72fd366de35b", + "peer_receipt_sha256": "580adb3de7037acc6f7e41cc186e8a210463afaa696d57892643d55acd0040c8", + "matched_fields": { + "public_profile": true, + "private_profile": true, + "scalar_adds": true, + "public_registers": true, + "public_widths": true, + "native_receipt": true, + "owner_assignment": true, + "residual_invoice": true, + "baseline_ideal_kappa": true, + "baseline_ideal_root_interval": true, + "baseline_ideal_selected_moment": true, + "retained_ideal_kappa": true, + "retained_ideal_root_interval": true, + "retained_ideal_selected_moment": true, + "baseline_hosted_kappa": true, + "baseline_hosted_root_interval": true, + "baseline_hosted_selected_moment": true, + "retained_hosted_kappa": true, + "retained_hosted_root_interval": true, + "retained_hosted_selected_moment": true + }, + "independence": "Our rational-row/frame interpreter and scientific receipt were committed at ba7577148cbfe04e89892157780aa7fa2a372ac1 before inspecting PR2305. Both studies share frozen predecessor data, native compiler/interpreter, owner checker and interval engine; this is not independent verification of those common components." + }, + "publication_directory_change": { + "from": "p104-coalesced-private-reuse", + "to": "p104-coalesced-private-reuse-audit", + "reason": "Avoid colliding with PR2305's independently submitted package path." + } +} diff --git a/research/p104-coalesced-private-reuse-audit/VALIDATION.json b/research/p104-coalesced-private-reuse-audit/VALIDATION.json new file mode 100644 index 0000000000..9512943e13 --- /dev/null +++ b/research/p104-coalesced-private-reuse-audit/VALIDATION.json @@ -0,0 +1,96 @@ +{ + "status": "PASS_LOCAL_SCOPED_REPLAYS", + "scope": "735-input finite forward composition, native operators and conditional invoices; not a full multiplication theorem, supplier admission or hosted CI.", + "environment": { + "python": "3.12.10", + "implementation": "CPython", + "platform": "Windows-11-10.0.26100-SP0", + "machine": "AMD64", + "external_packages_required": [], + "gpu_required": false + }, + "registered_replay": { + "command": [ + "python", + "-B", + "scripts/research_package.py", + "--package", + "research/p104-coalesced-private-reuse-audit" + ], + "child_command": [ + "python", + "-I", + "-O", + "-B", + "research/p104-coalesced-private-reuse-audit/verify.py" + ], + "status": "PASS_REGISTERED_RESEARCH_PACKAGE", + "verifier_seconds": 161.896, + "initial_verifier_seconds": 165.754, + "final_lf_package_replayed": true + }, + "standalone_replay": { + "command": [ + "python", + "-I", + "-B", + "p104-coalesced-private-reuse/verify.py" + ], + "cwd": "independent source-only directory outside the Git checkout", + "compiler_internal_assertions_enabled": true, + "status": "PASS_P104_COALESCED_PRIVATE_REUSE", + "verifier_seconds": 338.765, + "package_files_unchanged": true + }, + "result_sha256": "bbef1690d3ba352bfa7434854d237e994b215eaf42891f7a582053687352491a", + "core_payload_sha256": { + "construction.py": "b024a97063462e238a7441b06f8cafe308ce30843081869b2ff004304a09796e", + "inputs/pr2152-source.tar.gz": "e5a04ec6854fdf38c8e25a803206e381ae2cf858e98c9e3ceacaf56e98ba2723", + "inputs/PR2219-fanout-helper-reuse.patch": "6eb26b8cb17c5b58d8a69f4c782fd3a822faf945ced2f1ceb7ba33884b562d8a", + "inputs/SOURCE-EXPORT.json": "1cdb237bc91969b4f417227a7f2c5dc3dd1a67bad3f4238d628fc6394a6be137", + "RESULT.json": "bbef1690d3ba352bfa7434854d237e994b215eaf42891f7a582053687352491a", + "verify.py": "069dae1291f6e1b102cd247247243cbd3e1c2535c0e1e9c9528891c9fc22c2d2" + }, + "note": "Timing records describe verifier wall time on this host, not integer-multiplication speed. Source/export hashes provide integrity, not independent mathematical review.", + "checked_core_payload_sha256_before_text_normalization": { + "construction.py": "fddd5cb045668f914aa5d680a00470ad43e1ca66d46c5e4e6cef48e6a0dd85e3", + "inputs/pr2152-source.tar.gz": "e5a04ec6854fdf38c8e25a803206e381ae2cf858e98c9e3ceacaf56e98ba2723", + "inputs/PR2219-fanout-helper-reuse.patch": "6eb26b8cb17c5b58d8a69f4c782fd3a822faf945ced2f1ceb7ba33884b562d8a", + "inputs/SOURCE-EXPORT.json": "29dc9fb3dfce93f7236c618965a65c8ac9cef02684cdbca7d6d208ba187d202a", + "RESULT.json": "05c96e43339ff03bf8292290ee015b1955304b5c56da4d9a73f5dcf278358954", + "verify.py": "8c224b7a5183f23235111655d52d0acbc16b1f46443431a60b7a10182df87014" + }, + "post_replay_text_normalization": { + "changed_files": [ + "inputs/SOURCE-EXPORT.json", + "README.md", + "RESULT.json", + "SOURCES.json", + "TASK.json", + "VALIDATION.json", + "VERIFY.json" + ], + "all_changed_json_values_identical": true, + "purpose": "LF checkout rules preserve portable text and prevent Git newline conversion of the immutable reference patch.", + "frozen_source_bytes_unchanged": true, + "executable_AST_unchanged": true, + "python_trailing_blank_lines_removed": [ + "construction.py", + "verify.py" + ] + }, + "original_package_name": "p104-coalesced-private-reuse", + "publication_replay": { + "status": "PASS_REGISTERED_RESEARCH_PACKAGE", + "verified_at_utc": "2026-10-15T05:51:36.804702+00:00", + "verifier_seconds": 184.527, + "command": [ + "python", + "-B", + "scripts/research_package.py", + "--package", + "research/p104-coalesced-private-reuse-audit" + ], + "core_payload_unchanged": true + } +} diff --git a/research/p104-coalesced-private-reuse-audit/VERIFY.json b/research/p104-coalesced-private-reuse-audit/VERIFY.json new file mode 100644 index 0000000000..342c8718bc --- /dev/null +++ b/research/p104-coalesced-private-reuse-audit/VERIFY.json @@ -0,0 +1,20 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 600, + "checks": "Pinned standalone source export; exact 735-input forward identity, all 339 coalesced chart changes, five semantic controls, native signed Pauli actions/global phases and 4096 Gaussian columns per variant, unchanged public owner widths, 75888 conditional placements, and full stated-model rational local-plus-idle cost intervals. No admitted supplier or new kappa." + } + ] +} diff --git a/research/p104-coalesced-private-reuse-audit/construction.py b/research/p104-coalesced-private-reuse-audit/construction.py new file mode 100644 index 0000000000..28a7f68502 --- /dev/null +++ b/research/p104-coalesced-private-reuse-audit/construction.py @@ -0,0 +1,236 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Combine PR2152's coalesced frames with PR2219's private-descent idea. + +New successor implementation by SHIN09-git with OpenAI Codex assistance. +Predecessor scalar word, charts and the reuse mechanism retain their credit. +This module independently replays rational rows and binary-frame chronology. +""" +from collections import Counter +from fractions import Fraction as Q +import hashlib +import json + +HELPER, PRIVATE, SOURCE = 711, 738, 133 +TARGETS = {148: Q(2), 203: Q(2), 159: Q(-1)} +ZERO = frozenset({0}) + +def require(ok, message): + if not ok: + raise ValueError(message) + +def digest(obj): + return hashlib.sha256(json.dumps(obj, sort_keys=True, separators=(",", ":")).encode()).hexdigest() + +def span(basis): + result = {0} + for x in basis: + require(type(x) is int and 0 <= x < 512, "invalid frame vector") + result |= {y ^ x for y in tuple(result)} + return frozenset(result) + +def dim(frame): + n = len(frame) + require(n > 0 and n & (n-1) == 0, "invalid subspace size") + return n.bit_length()-1 + +def basis(frame): + values, reached = [], ZERO + for x in sorted(frame): + if x not in reached: + values.append(x) + reached = span(values) + require(reached == frame, "frame is not a binary subspace") + return values + +def add_row(target, source, coefficient): + # Copy source entries so even a self-add has well-defined exact semantics. + for j, x in list(source.items()): + value = target.get(j, Q(0)) + coefficient*x + if value: + target[j] = value + else: + target.pop(j, None) + +def scalar_events(built): + return [e for e in built["scalar_operations"] if e["kind"] != "transport"] + +def transform(built, fault=None): + original = scalar_events(built) + contacts = [dict(e) for e in original if e["kind"] == "add" + and e["phase"] == "fanout contact" and e["registers"][1] == HELPER] + require({e["registers"][0]: Q(e["coefficient"]) for e in contacts} == TARGETS, + "exact three helper contacts changed") + require(len(contacts) == 3, "duplicate helper contact") + contacts.sort(key=lambda e: dim(span(e["frame"])), reverse=True) + require([dim(span(e["frame"])) for e in contacts] == [7, 6, 3], + "coalesced contact dimensions changed") + require(span(contacts[2]["frame"]) <= span(contacts[1]["frame"]) <= span(contacts[0]["frame"]), + "contact frames do not form a private descent") + removed = Counter() + removed_indices = [] + result = [] + inserted = False + lineage = [] + for k, event in enumerate(original): + e = dict(event) + uses_helper = e["kind"] in ("add", "scale", "private_copy") and HELPER in e["registers"] + if uses_helper: + require(e["kind"] == "add", "unexpected helper operation") + expected = {"entry compensation": 7, "fanout helper seed": 1, + "fanout contact": 3, "helper restoration": 1} + require(e["phase"] in expected, "unexpected helper dependence") + if fault == "retain_dirty_compensation" and e["phase"] == "entry compensation": + result.append(e); lineage.append(k) + removed[e["phase"]] += 1 + removed_indices.append(k) + continue + result.append(e); lineage.append(k) + if e["kind"] == "scale" and e["registers"] == [PRIVATE]: + require(not inserted and Q(e["coefficient"]) == Q(-1, 2), + "private normalization or lifetime changed") + inserted = True + new_contacts = list(reversed(contacts)) if fault == "ascending_private" else contacts + for i, contact in enumerate(new_contacts): + if fault == "omit_contact" and i == 0: + continue + direct = dict(contact, registers=[contact["registers"][0], PRIVATE], + phase="private query serves coalesced fanout contact") + if fault == "contact_coefficient" and i == 0: + direct["coefficient"] = str(Q(direct["coefficient"]) + 2) + result.append(direct); lineage.append(None) + require(inserted and removed == Counter({"entry compensation":7, "fanout helper seed":1, + "fanout contact":3,"helper restoration":1}), + "wrong exact deletion set") + require(all(HELPER not in e.get("registers", []) for e in result) + or fault == "retain_dirty_compensation", "freed helper still used") + return result, {"removed_by_phase":dict(sorted(removed.items())), + "removed_scalar_indices":removed_indices, + "retained_scalar_indices":[i for i in lineage if i is not None], + "contact_frames":[{"target":e["registers"][0], "coefficient":e["coefficient"], + "basis":e["frame"], "dimension":dim(span(e["frame"]))} + for e in contacts]} + +def replay(events, initial, final, live, *, fault=None): + n = len(initial) + require(n == 735 and len(final) == n, "public stock changed") + current = [frozenset(f) for f in initial] + final = [frozenset(f) for f in final] + rows = [{i: Q(1)} for i in range(n)] + private_frames, private_rows = {}, {} + paid, private_paid = Counter(), Counter() + edges, operations, paths = [], [], [] + active_path = None + peak = created = 0 + discarded = [] + def transport(r, target, phase): + nonlocal active_path + private = r >= n + require(not private or r in private_frames, "uninitialized private register") + old = private_frames[r] if private else current[r] + require(target <= old if private else old <= target, + "private descent/public ascent violates frame inclusion") + if not private: + require(target <= final[r], "public operation exceeds final frame") + rank = abs(dim(target)-dim(old)) + if rank: + e = {"occurrence":len(edges), "register":r, "source_frame":basis(old), + "target_frame":basis(target), "rank":rank, "private":private, "phase":phase} + edges.append(e) + operations.append({"kind":"transport","occurrence":e["occurrence"],"phase":phase}) + (private_paid if private else paid)[rank] += 1 + if private: + require(active_path is not None, "private transport outside lifetime") + active_path.append(e) + if private: + private_frames[r] = target + else: + current[r] = target + def row(r): + return rows[r] if r < n else private_rows[r] + for event in events: + e = dict(event) + kind, phase = e["kind"], e["phase"] + frame = span(e["frame"]) + require(basis(frame) == e["frame"], "noncanonical event frame") + if kind == "private_init": + r = e["register"] + require(type(r) is int and r >= n and r not in private_frames and active_path is None, + "invalid private initialization") + if fault == "missing_private_init" and created == 0: + created += 1 + continue + private_frames[r], private_rows[r] = frame, {} + active_path = [] + created += 1 + peak = max(peak, len(private_frames)) + elif kind == "private_discard": + r = e["register"] + require(r in private_frames, "discard without ownership") + transport(r, frame, phase) + paths.append(active_path) + active_path = None + discarded.append(r) + del private_frames[r], private_rows[r] + elif kind in ("add", "scale", "private_copy"): + rr = e["registers"] + require(len(rr) == (1 if kind == "scale" else 2), "wrong scalar arity") + require(all(type(r) is int and 0 <= r < n+8 for r in rr), "invalid scalar register") + for r in rr: + transport(r, frame, phase) + require(all((current[r] if r < n else private_frames[r]) == frame for r in rr), + "scalar operands differ in frame") + coefficient = Q(e["coefficient"]) + require(bool(coefficient), "zero scalar coefficient") + if kind == "private_copy": + require(rr[0] >= n and rr[1] < n and not row(rr[0]), + "COPY needs a cleared owned register and public source") + private_rows[rr[0]] = {i: coefficient*x for i,x in row(rr[1]).items()} + elif kind == "scale": + scaled = {i: coefficient*x for i,x in row(rr[0]).items()} + if rr[0] < n: rows[rr[0]] = scaled + else: private_rows[rr[0]] = scaled + else: + add_row(row(rr[0]), row(rr[1]), coefficient) + else: + raise ValueError("unknown event kind: "+kind) + operations.append(e) + for r in range(n): + transport(r, final[r], "final public boundary") + require(not private_frames and not private_rows and active_path is None, "private state still live") + require(created == len(discarded) == len(paths) == 8 and peak == 1, + "eight sequential private lifetimes required") + for r in range(n): + expected = {r:Q(1)} + if r-112 in live: + expected[r-112] = Q(1) + require(rows[r] == expected, "exact endpoint mismatch at public register "+str(r)) + require(current == final, "wrong final frames") + require(sum(k*v for k,v in private_paid.items()) == 56, "private COPY rank mass is not 56") + require([e for path in paths for e in path] == [e for e in edges if e["private"]], + "private path coverage differs from events") + profile = lambda c:{str(k):v for k,v in sorted(c.items()) if v} + report = {"public_registers":n, "endpoint_columns_checked":n, "live_targets":len(live), + "exact_endpoint_identity":True, "dirty_restoration":True, "common_scalar_frames":True, + "public_profile":profile(paid), "private_profile":profile(private_paid), + "public_rank_mass":sum(k*v for k,v in paid.items()), "private_rank_mass":56, + "scalar_adds":sum(e["kind"]=="add" for e in operations), + "private_copies":created, "peak_private_copies":peak, + "transport_occurrences":len(edges), "word_sha256":digest(operations), + "transports_sha256":digest(edges), + "complete_public_widths":[dim(final[r])-dim(initial[r]) for r in range(n)]} + return {"report":report,"scalar_operations":operations,"transport_edges":edges, + "private_paths":paths,"initial":initial,"final":final} + +def native_witness(built, ports): + edges = [dict(register=str(e["register"]), old=e["source_frame"], new=e["target_frame"], + occurrence=e["occurrence"], private=e["private"], rank=e["rank"]) + for e in built["transport_edges"]] + lookup = {e["occurrence"]:e for e in edges} + return {"transports":edges, + "private_paths":[[lookup[e["occurrence"]] for e in p] for p in built["private_paths"]], + "scalar_operations":built["scalar_operations"],"ports":ports, + "scalar_operation_word_sha256":built["report"]["word_sha256"], + "transport_occurrences_sha256":built["report"]["transports_sha256"], + "public_profile":built["report"]["public_profile"], + "private_profile":built["report"]["private_profile"]} diff --git a/research/p104-coalesced-private-reuse-audit/inputs/PR2219-fanout-helper-reuse.patch b/research/p104-coalesced-private-reuse-audit/inputs/PR2219-fanout-helper-reuse.patch new file mode 100644 index 0000000000..fbc0f26366 --- /dev/null +++ b/research/p104-coalesced-private-reuse-audit/inputs/PR2219-fanout-helper-reuse.patch @@ -0,0 +1,213 @@ +diff --git a/research/p104-interleaved-search/fanout.py b/research/p104-interleaved-search/fanout.py +index 66472a83..57e09798 100644 +--- a/research/p104-interleaved-search/fanout.py ++++ b/research/p104-interleaved-search/fanout.py +@@ -54,7 +54,7 @@ class NeedHelper(Exception): + """The deterministic cumulative-frame allocator needs another dirty role.""" + + +-def construct(fault=None, fixed=None): ++def construct(fault=None, fixed=None, reuse_helper=None): + """Derive the forward word. Mutations consume the baseline's fixed repairs.""" + inputs = QC.load_inputs() + word, prototype = inputs['word'], inputs['coordinates'] +@@ -100,7 +100,8 @@ def construct(fault=None, fixed=None): + caps.append(cap.copy()) + caps.reverse() + +- def run(compensation=(), repairs=None, mutation=None): ++ def run(compensation=(), repairs=None, mutation=None, reuse_frames=None): ++ active_reuse = reuse_helper if reuse_frames is not None else None + n = oldn + len(helpers) + rows = QC.identity(n) + current = [frames[i] for i in word['start']] + [ZERO] * len(helpers) +@@ -184,16 +185,43 @@ def construct(fault=None, fixed=None): + coefficient = meta['lam'] + (1 if mutation == 'query_coefficient' and term == 0 else 0) + private_rows[owned] = {j: coefficient*x for j,x in private_rows[owned].items()} + events.append(dict(kind='scale', registers=[owned], coefficient=str(coefficient), frame=basis(hb), phase='owned query scaling')) +- transport(owned, line, 'owned Hb to La', True) +- private_paths.append([edges[-1]]) ++ path = [] ++ direct = [c for c in contacts[cut] if c['helper'] == active_reuse] if active_reuse is not None else [] ++ if active_reuse in js: ++ require(direct and all(helpers[c['helper']]['source'] == source for c in direct), ++ 'reused helper contacts do not share the owned query') ++ for c in sorted(direct, key=lambda item: D.dimension(reuse_frames[item['register']]), reverse=True): ++ frame = reuse_frames[c['register']] ++ transport(c['register'], frame, 'reused fanout target chart') ++ before = len(edges) ++ transport(owned, frame, 'owned query to reused fanout contact', True) ++ if len(edges) > before: ++ path.append(edges[-1]) ++ require(current[c['register']] == frame, 'reused contact target is not in the private chart') ++ if mutation != 'missing_reused_contact' or c is not direct[0]: ++ scalar_add(c['register'], owned, Q(c['coefficient']), ++ 'private query copy replaces fanout helper', True) ++ before = len(edges) ++ transport(owned, line, 'owned query to La after reused contacts', True) ++ if len(edges) > before: ++ path.append(edges[-1]) ++ else: ++ before = len(edges) ++ transport(owned, line, 'owned Hb to La', True) ++ if len(edges) > before: ++ path.append(edges[-1]) ++ private_paths.append(path) + for j in js: ++ if j == active_reuse: ++ continue + transport(oldn+j, line, 'fanout helper entrance') + scalar_add(oldn+j, owned, Q(1), 'fanout helper seed', True) + events.append(dict(kind='private_discard', register=owned, frame=basis(line), phase='owned copy end')) + del private_rows[owned], private_frames[owned] + require(not private_rows and not private_frames, 'private copy left live') + for k in range(cut, len(bword)): +- for c in sorted(contacts[k], key=lambda z: (int(z['lower']).bit_count(), z['helper'], z['register'])): ++ for c in sorted((c for c in contacts[k] if c['helper'] != active_reuse), ++ key=lambda z: (int(z['lower']).bit_count(), z['helper'], z['register'])): + r, term = c['register'], helpers[c['helper']]['a'] + cap_here = caps[k][r] + require(current[r] <= cap_here, 'public reader already exceeds future endpoint cap') +@@ -215,6 +243,8 @@ def construct(fault=None, fixed=None): + for r, q in qrows.items(): + require(rows[r] == q, 'actual query bank changed before helper restoration') + for j in range(len(helpers)): ++ if j == active_reuse: ++ continue + transport(oldn+j, FULL, 'fanout helper endpoint') + if repairs is None: + for r, rr in enumerate(response): +@@ -227,6 +257,8 @@ def construct(fault=None, fixed=None): + transport(r, FULL, 'response cleanup') + scalar_add(r,h,Q(c),'response cleanup') + for j,h in enumerate(helpers): ++ if j == active_reuse: ++ continue + transport(h['source'], FULL, 'query bank endpoint') + scalar_add(oldn+j,h['source'],-h['lam'],'helper restoration') + require(rows[oldn+j] == {oldn+j:Q(1)}, 'dirty helper not restored') +@@ -259,16 +291,42 @@ def construct(fault=None, fixed=None): + cleanup=cleanup, ghost_restoration=ghost_restores, contacts=routed_contacts) + + clones = [] ++ reference = None + if fixed is None: + while True: + try: +- preliminary = run() ++ reference = run() + break + except NeedHelper as missing: + helpers.append(helpers[missing.args[0]].copy()) + clones.append([helpers[-1]['a'],helpers[-1]['b']]) + require(len(helpers) <= 31, 'bounded allocator exceeded recorded helper stock') + require(clones == [[3,113],[2,47],[4,57]], 'deterministic helper cloning changed') ++ else: ++ helpers = deepcopy(fixed['helpers']) ++ compensation, repairs, clones = deepcopy(fixed['compensation']), deepcopy(fixed['repairs']), fixed['clones'] ++ reference = run() ++ reuse_frames = None ++ if reuse_helper is not None: ++ reuse_frames = {item['target']: QC.span(item['frame']) for item in reference['contacts'] ++ if item['helper'] == reuse_helper} ++ requested = {c['register'] for cs in contacts.values() for c in cs if c['helper'] == reuse_helper} ++ require(set(reuse_frames) == requested and len(requested) == 3, ++ 'baseline helper does not have exactly three realized contacts') ++ require(set(reuse_frames) == {148, 203, 159}, 'reused helper contact targets changed') ++ f1, f2, f3 = (reuse_frames[target] for target in (148, 203, 159)) ++ la = helpers[reuse_helper]['line'] ++ query = next(q for q in reference['query_records'] ++ if q['pair'] == [helpers[reuse_helper]['a'], helpers[reuse_helper]['b']]) ++ hb = QC.span(query['frame']) ++ require((D.dimension(f1), D.dimension(f2), D.dimension(f3)) == (3, 6, 7) and ++ la <= f1 <= f2 <= f3 <= hb, ++ 'reused contact frames are not the claimed nested descent') ++ target_contacts = [c for c in contacts[cut] if c['register'] in reuse_frames] ++ require(len(target_contacts) == 3 and all(c['helper'] == reuse_helper for c in target_contacts), ++ 'reused target has another same-cut contact writer') ++ preliminary = run(reuse_frames=reuse_frames) if reuse_helper is not None else reference ++ if fixed is None: + compensation = [] + for t in live: + row = preliminary['rows'][v+t] +@@ -280,21 +338,29 @@ def construct(fault=None, fixed=None): + 'dirty coefficient cannot be compensated at frame zero') + compensation.append(['add',v+t,i,-c.numerator,c.denominator,0]) + repairs = dict(cleanup=preliminary['cleanup'], ghost_restoration=preliminary['ghost_restoration']) +- else: +- helpers = deepcopy(fixed['helpers']) +- compensation, repairs, clones = deepcopy(fixed['compensation']), deepcopy(fixed['repairs']), fixed['clones'] + applied_compensation = compensation[1:] if fault == 'missing_entry_compensation' else compensation +- built = run(applied_compensation, repairs, fault) ++ built = run(applied_compensation, repairs, fault, reuse_frames) + require(len(helpers) == 31 and len(built['rows']) == 735, 'exact public stock') + require(not S.endpoint_failures(built['rows'],v,live),'full 735-column endpoint identity failed') +- require(built['copy_paid'] == Counter({7:8}), 'eight complete rank-seven owned copies') + public_recount = Counter(e['rank'] for e in built['transport_edges'] if not e['private']) + require(public_recount == built['paid'], 'public transport occurrence invoice mismatch') + expected = {'1':2611,'2':514,'3':378,'4':132,'5':81,'6':15,'7':6} ++ if reuse_helper is not None: ++ expected = dict(expected) ++ for rank, count in ((1, -2), (2, -2), (3, -1)): ++ expected[str(rank)] += count ++ expected = {rank: count for rank, count in expected.items() if count} ++ require(built['copy_paid'] == Counter({1: 2, 2: 1, 3: 1, 7: 7}), ++ 'one nested-frame reuse replaces exactly one rank-seven private descent') ++ else: ++ require(built['copy_paid'] == Counter({7:8}), 'eight complete rank-seven owned copies') + require(D.profile(built['paid']) == expected,'recorded public invoice changed') + require(len(built['private_paths']) == 8, 'missing private path') + final_widths = [D.dimension(built['final'][r])-D.dimension(ZERO if r >= oldn or r in QC.REMOVED else frames[word['start'][r]]) + for r in range(735)] ++ scalar_adds = Counter(e['phase'] for e in built['scalar_operations'] if e['kind'] == 'add') ++ require(scalar_adds['private query copy replaces fanout helper'] == (3 if reuse_helper is not None else 0), ++ 'direct private contact ADD count') + # Added public helpers start at ZERO, outside the original start array. + report = dict(schema='p104-fanout-forward-report-v1', + scope='Finite forward 735-column identity and literal frame word; not a global supplier or exponent improvement.', +@@ -304,6 +370,9 @@ def construct(fault=None, fixed=None): + query_sources=built['query_records'], deterministic_clones=clones, + contact_count=len(built['contacts']), entry_compensation_additions=len(compensation), + response_cleanup_additions=len(repairs['cleanup']), ghost_restoration_additions=len(repairs['ghost_restoration']), ++ scalar_add_count=sum(scalar_adds.values()), ++ scalar_adds_by_phase=dict(sorted(scalar_adds.items())), ++ private_reused_contact_additions=scalar_adds['private query copy replaces fanout helper'], + candidate_public_profile=D.profile(built['paid']), private_COPY_profile=D.profile(built['copy_paid']), + public_rank_mass=sum(k*n for k,n in built['paid'].items()), + full_735_column_identity_verified=True, all_new_helpers_restored=True, +@@ -312,7 +381,8 @@ def construct(fault=None, fixed=None): + contact_schedule_sha256=digest(built['contacts']), scalar_operation_word_sha256=digest(built['scalar_operations']), + transport_occurrences_sha256=digest(built['transport_edges']), + native_phase_compilation_verified=False, global_hosting_verified=False, +- completed_full_multiplication_supplier=False, kappa_improvement_claimed=False) ++ completed_full_multiplication_supplier=False, kappa_improvement_claimed=False, ++ reused_fanout_helper=reuse_helper) + built.update(report=report, fixed=dict(helpers=helpers, compensation=compensation, repairs=repairs, clones=clones), + ports=[word['ports'][t] for t in live]) + return built +@@ -331,12 +401,15 @@ def native_witness(built=None): + public_profile=built['report']['candidate_public_profile'], private_profile=built['report']['private_COPY_profile']) + + +-def verify(): +- built = construct() ++def verify(reuse_helper=None): ++ built = construct(reuse_helper=reuse_helper) + controls = {} +- for fault in ('query_coefficient','missing_private_initialization','missing_response_cleanup','missing_entry_compensation'): ++ faults = ['query_coefficient','missing_private_initialization','missing_response_cleanup','missing_entry_compensation'] ++ if reuse_helper is not None: ++ faults.append('missing_reused_contact') ++ for fault in faults: + try: +- construct(fault=fault,fixed=built['fixed']) ++ construct(fault=fault,fixed=built['fixed'],reuse_helper=reuse_helper) + except (ValueError,NeedHelper) as error: + controls[fault] = str(error) + else: +@@ -346,4 +419,4 @@ def verify(): + + + if __name__ == '__main__': +- print(json.dumps(verify(),indent=2,sort_keys=True)) ++ print(json.dumps(verify(reuse_helper=7),indent=2,sort_keys=True)) diff --git a/research/p104-coalesced-private-reuse-audit/inputs/SOURCE-EXPORT.json b/research/p104-coalesced-private-reuse-audit/inputs/SOURCE-EXPORT.json new file mode 100644 index 0000000000..ff52e2680a --- /dev/null +++ b/research/p104-coalesced-private-reuse-audit/inputs/SOURCE-EXPORT.json @@ -0,0 +1,51 @@ +{ + "source_pr": 2152, + "source_head": "05f7aad0f08992ee48ec2dd93e896d9a4567847d", + "files": { + "LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "certificates/selected-result.json": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32", + "research/community-frontier1094-audit/ASSEMBLY.json": "1122cb3a575f8c788345fc1bf4c108ac7c3250fb81a5988671f5eb04b3ab3045", + "research/community-frontier1094-audit/SELECTED-SOURCE.json": "79b3de5db3dbcb9829789ba58e9e45758926031e2a7d80667a08429d369be53b", + "research/complex-block-rank-optimum/inputs/selected.json.gz": "16bc0ebb04b4be6c0ade74badc6a0c0cdba4215eda86e4ff9f13abf8ecebd219", + "research/complex-local-word-ceiling/ceiling.py": "86a1432870b3b21d8454106ec9162fddc0471472d9214c590a1420f2426cedfc", + "research/complex-t16-rare-pattern-exchanges/data/OWNERS.json.gz": "87902c528dfab7d503dcf8a784260e3ab6fb7424c418a1820f7261f25be7b6bc", + "research/complex-t16-rare-pattern-exchanges/data/PLAN.json": "7bd786ba8e66408f02aa9ef446eaf20c1bfe981ea2e4dd1e5a929f0aa7767bc0", + "research/complex-t16-rare-pattern-exchanges/data/SPEC.json": "8cb51f25a5da4a29d3783853025b73ff1f452429d4fdb30c599e598bcab0e71d", + "research/complex-t16-rare-pattern-exchanges/upstream1087.tar.gz": "d4acf04daef85d4514f80ec5fcd2492d0c60e5d6c49fa71b3e6523f8db2dea86", + "research/frame-sa504/inputs/hamming/PROTOTYPE.json": "327d2a868043e846381aa58a33053c24425e8cad522ff401b10ec8af1d649a3f", + "research/p104-interleaved-search/CHAINS.json": "8d74eb0473a347d29e3f6e0dc5b9a4dea00bcf400f3725535c21e4e613a099f2", + "research/p104-interleaved-search/COALESCED-FRAMES.json": "5e3d129ec88b23173f75c3d7187c78e96676f43ef1606166f4eadf888adb7a69", + "research/p104-interleaved-search/FANOUT-PLANS.json": "0c2ae264694bbe7c15b9261ba8adf68c9552849effd423894713c68ad23d28ca", + "research/p104-interleaved-search/NATIVE-CHAIN.json": "e3b010f9fd5ccee0e126f7fbf7d47bcd01378d90a94a5aaaa326f462c826aeaa", + "research/p104-interleaved-search/README.md": "bc9e22413f8f4c40e2518fbaf6f9e5c1c3e90aca3867f8b8d3ce21a6db124584", + "research/p104-interleaved-search/RESULT.json": "a62468c1254de900aabb8ef7a59df1225941cd849532cb40b6aa71f6d235b0f4", + "research/p104-interleaved-search/SOURCES.json": "c2f86cfc669745933ea4e6551fbb6b50027a559c3b32b296ba1c502246399a0e", + "research/p104-interleaved-search/TASK.json": "c0c8afa479fd55a565510674772c2e210834d10b9b635dc4d763e6d8c52e93cd", + "research/p104-interleaved-search/VERIFY.json": "98e65938f227064eb171f271279ab3a37d3724a2c3c52d2b494a6df8e5486497", + "research/p104-interleaved-search/actual_queries.py": "cc29ac59cb8d1437f0889bc1a6a8ab55f6761bad34dbb2253ac1965fc1ed7159", + "research/p104-interleaved-search/budget.py": "1dc401c214ca51881e27e16766e33e7dc635f429900a5a5b2435c6872b38e7f4", + "research/p104-interleaved-search/coalesced.py": "e1ab23333ba098bd2ccafd8c9a8c0c79e9126706b37d030f40a4400eaa6a0415", + "research/p104-interleaved-search/coalesced_budget.py": "6c0ffa8fcfd115ad5be31a2e850db55dc5b212a98db521536c4e19d585571af9", + "research/p104-interleaved-search/delivery.py": "49f131e9b8a48ccbf5374f475857b8e19ce105ee931bab70f19e3be6983c4ffd", + "research/p104-interleaved-search/fanout.py": "a6828977971a4c8eb555e06de61646b863c5f025bbe1e0a7b941879dcd5e749b", + "research/p104-interleaved-search/fanout_budget.py": "dacd09d8240313e763b9a29b94b2b04ef274b91f6e8606623e443b1f0bc2642d", + "research/p104-interleaved-search/hosting.py": "0ea35ecf6b4f98bc87b568a7c2e1dbcedb106a1768e9ad46e65a30216e95de5f", + "research/p104-interleaved-search/native_checks.py": "3353e4011e2bc05a33cdfb098ff05d8fa8b92b7daecf5015eda41c18c1d10bdd", + "research/p104-interleaved-search/natural_budget.py": "d6b48cad8cd031817ff4df3ea8e9bfd37deb4cda107cc8f8609d9dbc1d38546e", + "research/p104-interleaved-search/natural_delivery.py": "2ce37d43f6456e1efaafafdb4ade11848a2eb99a215ee5e196a2ec17e0b83572", + "research/p104-interleaved-search/query_construction.py": "d2318ea05d0033da36a430ccf62dac825dd0ecd7d13730a412795ea3cf3dfe78", + "research/p104-interleaved-search/scalar_surgery.py": "ffba4481cc02ba6183970adec229c4a884263ef418393e4ded25a01bdfd3d8f6", + "research/p104-interleaved-search/verify.py": "3dedfa90d0c9655c490640ea675d8a36766827d51be0f1baaceb81e2443406d2", + "research/p104-native-channel/inputs/P104-FIXTURE.json": "516c06f6ec3cb84be588c546108de897650288576dd5fbf5fe44b9c5546ad8a4", + "research/p104-native-channel/notices/FRAME-SA504-NOTICE.md": "a92f49c5ced455160fbedcc8954e3c9255e3605e88ad12ae5a84f1c4302986f1", + "research/p104-native-channel/notices/PR1862-NOTICE.md": "d86f31a4c0bafd4271fe0c0e087a7fc1cd72d5b705e3739c4ba3e9241b7ba3f9", + "research/p104-native-channel/vendor/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "research/p104-native-channel/vendor/native_verify.py": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38" + }, + "reuse_pr": 2219, + "reuse_head": "3f913bc17276b68f0c9008a1202b6ce588e77ff6", + "reuse_patch_sha256": "6eb26b8cb17c5b58d8a69f4c782fd3a822faf945ced2f1ceb7ba33884b562d8a", + "bundle_format": "tar-gzip; compare unpacked file hashes, not compression bytes", + "reuse_author": "1337isnot1337", + "reuse_mechanism": "three private contacts for helper 7, pair (4,57); original word only in PR2219" +} diff --git a/research/p104-coalesced-private-reuse-audit/inputs/pr2152-source.tar.gz b/research/p104-coalesced-private-reuse-audit/inputs/pr2152-source.tar.gz new file mode 100644 index 0000000000..34fa173f9f Binary files /dev/null and b/research/p104-coalesced-private-reuse-audit/inputs/pr2152-source.tar.gz differ diff --git a/research/p104-coalesced-private-reuse-audit/verify.py b/research/p104-coalesced-private-reuse-audit/verify.py new file mode 100644 index 0000000000..5d604594bc --- /dev/null +++ b/research/p104-coalesced-private-reuse-audit/verify.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Read-only exact successor replay. Frozen predecessor files stay unchanged.""" +from collections import Counter +from fractions import Fraction as Q +from pathlib import Path, PurePosixPath +import argparse +import hashlib +import importlib.util +import json +import tarfile +import tempfile +import time + +HERE = Path(__file__).resolve().parent +def module(name, path): + spec = importlib.util.spec_from_file_location(name, path) + result = importlib.util.module_from_spec(spec) + spec.loader.exec_module(result) + return result +R = module("p104_successor_construction", HERE/"construction.py") +require = R.require + +def unpack(destination): + manifest = json.loads((HERE/"inputs/SOURCE-EXPORT.json").read_text(encoding="utf-8")) + require(manifest["source_head"] == "05f7aad0f08992ee48ec2dd93e896d9a4567847d", "wrong PR2152 head") + require(manifest["reuse_head"] == "3f913bc17276b68f0c9008a1202b6ce588e77ff6", "wrong PR2219 head") + require(hashlib.sha256((HERE/"inputs/PR2219-fanout-helper-reuse.patch").read_bytes()).hexdigest() + == manifest["reuse_patch_sha256"], "PR2219 patch drift") + expected = manifest["files"] + with tarfile.open(HERE/"inputs/pr2152-source.tar.gz", "r:gz") as archive: + members = archive.getmembers() + require(len(members) == len(expected) and {m.name for m in members} == set(expected), + "source export inventory changed") + for m in members: + p = PurePosixPath(m.name) + require(m.isfile() and not p.is_absolute() and ".." not in p.parts and "\\" not in m.name, + "unsafe source member") + data = archive.extractfile(m).read() + require(hashlib.sha256(data).hexdigest() == expected[m.name], "source drift: "+m.name) + target = destination.joinpath(*p.parts) + require(target.resolve().is_relative_to(destination.resolve()), "source escapes export") + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(data) + return manifest + +def summarize(built): + report = dict(built["report"]) + report["public_widths_sha256"] = R.digest(report.pop("complete_public_widths")) + report["total_transport_rank_mass"] = report["public_rank_mass"]+report["private_rank_mass"] + return report + +def combined(built): + r=built["report"] + c=Counter({int(k):v for k,v in r["public_profile"].items()}) + c.update({int(k):v for k,v in r["private_profile"].items()}) + return c + +def prices(src, base, baseline, retained, released): + B=module("p104_frozen_budget", src/"budget.py") + engine, _, _, _=B.load_inputs() + H=module("p104_frozen_hosting", src/"hosting.py") + hosting=H.verify(base["report"]) + widths=[retained["report"]["complete_public_widths"][r] for r in hosting["actual_ordinary_registers"]] + require(hosting["actual_ordinary_widths_sha256"]==R.digest(widths), "conditional owner widths differ") + idle={int(k):Q(v,144) for k,v in hosting["remaining_idle_profile"].items()} + require(sum(r*c for r,c in idle.items())==818, "inherited residual invoice differs") + coverage=(B.M-1)*Q(B.FAMILIES,B.STAGES)+B.CENTRE + selected_a=B.SELECTED_KAPPA/(1-B.SELECTED_KAPPA) + target=B.SELECTED_KAPPA*Q(101,100) + target_a=target/(1-target) + def price(name,built,concrete): + profile=combined(built) + if concrete: + profile.update(idle) + require(sum(r*c for r,c in profile.items())==coverage, "local-plus-idle mass mismatch") + model=engine.model(profile,B.M,B.FAMILIES,B.STAGES,B.CENTRE) + if concrete: require(model["idle_mass"]==0, "unpriced residual mass") + bracket=engine.ceiling(profile,B.M,B.FAMILIES,B.STAGES,B.CENTRE) + lo=engine.relax(profile,B.M,B.FAMILIES,B.STAGES,B.CENTRE,bracket[0]) + hi=engine.relax(profile,B.M,B.FAMILIES,B.STAGES,B.CENTRE,bracket[1]) + require(lo[1]<11, "one-percent target no longer excluded") + cap=min(bracket[1]/(1+bracket[1]),B.BIT_LOWER/(1+B.BIT_LOWER)) + return {"name":name,"idle_model":"actual inherited window invoice" if concrete else "optimistic fractional rank-51", + "priced_profile":{str(k):str(v) for k,v in sorted(profile.items())}, + "model":{k:str(v) for k,v in model.items()}, + "root_interval":[str(q) for q in bracket], + "kappa_upper_bound":str(cap),"kappa_upper_decimal":B.decimal(cap), + "relative_to_selected_percent":B.decimal(100*(cap/B.SELECTED_KAPPA-1)), + "moment_at_selected":[str(q) for q in sm],"selected_threshold_excluded":sm[0]>1, + "moment_at_one_percent_target":[str(q) for q in tm],"one_percent_target_excluded":True} + costs=[price("baseline_ideal",baseline,False),price("retained_ideal",retained,False), + price("released_ideal",released,False),price("baseline_hosted",baseline,True), + price("retained_hosted",retained,True)] + require(all(c["selected_threshold_excluded"] for c in costs if c["name"].endswith("_hosted")), + "conditional invoice no longer rejects selected threshold") + require(Q(costs[3]["moment_at_selected"][0])>Q(costs[4]["moment_at_selected"][1]), + "billed improvement not separated exactly") + host={k:hosting[k] for k in ("assigned_roles","total_calls","actual_ordinary_widths_sha256", + "assignment_sha256","remaining_idle_profile")} + host.update(per_call_idle_rank_mass="818", global_emitter_admitted=False, + valid_for_variant="boundary_retained only; every public boundary and complete width retained") + return costs,host,str(B.SELECTED_KAPPA) + +def construct(root, *, native=True): + src=root/"research/p104-interleaved-search" + C=module("p104_frozen_coalesced",src/"coalesced.py") + original=C.F.construct() + base=C.construct(baseline=original) + live=set(range(112))-set(C.QC.REMOVED) + original_scalar, coalesced_scalar=R.scalar_events(original),R.scalar_events(base) + require(len(original_scalar)==len(coalesced_scalar), "predecessor scalar lengths differ") + changes=[] + for k,(a,b) in enumerate(zip(original_scalar,coalesced_scalar)): + require({x:v for x,v in a.items() if x!="frame"}=={x:v for x,v in b.items() if x!="frame"}, + "coalescing changed scalar semantics") + if a["frame"]!=b["frame"]: changes.append(k) + require(len(changes)==339, "expected 339 predecessor frame changes") + baseline=R.replay(coalesced_scalar,base["initial"],base["final"],live) + require(baseline["report"]["public_profile"]==base["report"]["candidate_public_profile"] + and baseline["report"]["private_profile"]==base["report"]["private_COPY_profile"], + "independent baseline replay disagrees") + events,lineage=R.transform(base) + require(set(changes).isdisjoint(lineage["removed_scalar_indices"]) + and set(changes)<=set(lineage["retained_scalar_indices"]), "lost coalesced frame change") + retained=R.replay(events,base["initial"],base["final"],live) + released_final=list(base["final"]);released_final[R.HELPER]=R.ZERO + released=R.replay(events,base["initial"],released_final,live) + require(retained["report"]["complete_public_widths"]==baseline["report"]["complete_public_widths"], + "retained-boundary candidate changed lifetime widths") + require(combined(retained)==combined(baseline)-Counter({2:1,7:1})+Counter({9:1}), + "H2+H7 to H9 invoice changed") + require(combined(released)==combined(baseline)-Counter({2:1,7:1}), "H2+H7 removal changed") + require(retained["report"]["scalar_adds"]==released["report"]["scalar_adds"]==20947 + and baseline["report"]["scalar_adds"]==20956, "nine-ADD delta changed") + old_events,_=R.transform(original) + old_final=list(original["final"]);old_final[R.HELPER]=R.ZERO + old_reuse=R.replay(old_events,base["initial"],old_final,live) + require(combined(old_reuse)==Counter({1:2611,2:513,3:378,4:132,5:81,6:15,7:13}) + and old_reuse["report"]["public_rank_mass"]+56==5885, "PR2219 replication differs") + controls={} + for fault in ("omit_contact","contact_coefficient","ascending_private","retain_dirty_compensation"): + bad,_=R.transform(base,fault=fault) + try: R.replay(bad,base["initial"],released_final,live) + except ValueError as error: + if fault in ("omit_contact", "contact_coefficient", "retain_dirty_compensation"): + require(str(error).startswith("exact endpoint mismatch"), + "semantic control did not reach the endpoint check: "+fault) + controls[fault]=str(error) + else: raise ValueError("semantic negative control accepted: "+fault) + try: R.replay(events,base["initial"],released_final,live,fault="missing_private_init") + except ValueError as error: controls["missing_private_init"]=str(error) + else: raise ValueError("missing private initialization accepted") + native_reports={} + if native: + N=module("p104_frozen_native_checker",src/"native_checks.py") + for name,built in (("boundary_retained",retained),("helper_released",released)): + print("Checking native operators:",name,flush=True) + nr=N.verify(R.native_witness(built,base["ports"])) + require(nr["paid_profile"]=={str(k):v for k,v in sorted(combined(built).items())}, + "native profile does not bind new word") + require(nr["private_paths"]==8 and nr["private_path_gaussian_columns"]==4096, + "native private Gaussian coverage incomplete") + native_reports[name]=nr + costs,host,selected=prices(src,base,baseline,retained,released) + for path,digest in json.loads((HERE/"inputs/SOURCE-EXPORT.json").read_text())["files"].items(): + require(hashlib.sha256((root/path).read_bytes()).hexdigest()==digest, "frozen source modified") + return {"status":"PASS_P104_COALESCED_PRIVATE_REUSE", + "scope":"Finite exact forward composition plus native operators and conditional local+idle invoices; no admitted supplier or new kappa.", + "predecessors":{"2152":"05f7aad0f08992ee48ec2dd93e896d9a4567847d","2219":"3f913bc17276b68f0c9008a1202b6ce588e77ff6"}, + "baseline":summarize(baseline),"original_word_reuse_control":summarize(old_reuse), + "boundary_retained":summarize(retained),"helper_released":summarize(released), + "composition":{"retained_coalesced_frame_changes":339,"removed_by_phase":lineage["removed_by_phase"], + "private_contacts":lineage["contact_frames"],"private_source":133,"private_register":738,"unused_helper":711, + "retained_boundary_delta":{"2":-1,"7":-1,"9":1},"released_boundary_delta":{"2":-1,"7":-1}, + "strict_cost_comparison":"For 0(9/m)^(1-a); equal at a=0."}, + "negative_controls":controls,"native_checks":native_reports,"costs":costs,"selected_kappa":selected, + "conditional_hosting":host,"frozen_sources_unchanged":True, + "full_selected_cold_replay":False,"new_kappa_claimed":False} + +def main(): + ap=argparse.ArgumentParser(description=__doc__) + ap.add_argument("--write-result",action="store_true") + args=ap.parse_args();start=time.perf_counter() + with tempfile.TemporaryDirectory(prefix="p104-coalesced-reuse-") as tmp: + root=Path(tmp);unpack(root) + result=construct(root,native=True) + if args.write_result: + (HERE/"RESULT.json").write_text(json.dumps(result,indent=2,sort_keys=True)+"\n",encoding="utf-8") + else: + require(result==json.loads((HERE/"RESULT.json").read_text(encoding="utf-8")), "stored receipt differs") + for row in result["costs"]: + print(row["name"],"kappa upper",row["kappa_upper_decimal"],"relative %",row["relative_to_selected_percent"],flush=True) + print(result["status"],"columns=735 coalesced_changes=339 semantic_controls=5", + "native=True","seconds="+str(round(time.perf_counter()-start,3)),flush=True) + +if __name__=="__main__": main()