diff --git a/docs/ci-verification.md b/docs/ci-verification.md index 63ba3e9aa8..52b62d0481 100644 --- a/docs/ci-verification.md +++ b/docs/ci-verification.md @@ -1,8 +1,25 @@ # CI verification -## Current selected-family replay: #6030 +## Current selected-family replay: #7000 with #7001 The [selected record](../certificates/selected-result.json) binds conditional +κ = 0.00363005817 to the [application review](research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md), +[validation receipts](research/pr-intake-evidence/pr7000-application/VALIDATION.json), +and [explicit source closure](../certificates/frontier7000-source.json). +`make frontier7000-verify` follows that exact-source selected replay. The review +reuses eleven authenticated preceding executions and records seven fresh serial +application, scalar and complete native-catalogue executions. The earlier +monolithic timeout is retained separately and is not completed coverage. +Consult the receipts for exact commands, source heads and limits. + +The five inherited framework assumptions remain. No complete uniform word, +literal multiplier execution, independent human proof or formal-kernel proof +is asserted. Routine research submissions do not need to rerun this +selected-family replay. The sections below preserve historical checkpoints. + +## Historical selected-family replay: #6030 + +The [historical checkpoint](../certificates/checkpoints/frontier6030.json) binds conditional κ = 0.003125804 to the [proof review](research/pr-intake-evidence/pr6030-audit/PROOF-REVIEW.md), [validation receipts](research/pr-intake-evidence/pr6030-audit/VALIDATION.json), and [explicit source closure](../certificates/frontier6030-source.json). diff --git a/research/bit-helper-exchange-obstruction/EXPECTED.json b/research/bit-helper-exchange-obstruction/EXPECTED.json new file mode 100644 index 0000000000..c5620b7a52 --- /dev/null +++ b/research/bit-helper-exchange-obstruction/EXPECTED.json @@ -0,0 +1 @@ +{"pairs":3112,"pair_sha256":"429a5704dfc0f60d290d5441adaccf2440425502222a9a2becd151e929a182dc","charts":[[0,533,524,0],[1,537,537,0],[2,5,5,0],[3,4,4,0],[4,4,4,0],[5,5,5,0],[6,4,4,0],[7,5,5,0],[8,7,7,0],[9,4,4,0],[10,4,4,0],[11,5,5,0],[12,4,4,0],[13,7,7,0],[14,4,4,0],[15,4,4,0],[16,4,4,0],[17,4,4,0],[18,4,4,0],[19,7,7,0],[20,4,4,0],[21,4,4,0],[22,4,4,0],[23,4,4,0],[24,5,5,0],[25,4,4,0],[26,4,4,0],[27,4,4,0],[28,4,4,0],[29,4,4,0],[30,4,4,0],[31,4,4,0],[32,4,4,0],[33,4,4,0],[34,4,4,0],[35,4,4,0],[36,4,4,0],[37,5,5,0],[38,4,4,0],[39,4,4,0],[40,4,4,0],[41,4,4,0],[42,4,4,0],[43,4,4,0],[44,4,4,0],[45,5,5,0],[46,4,4,0],[47,4,4,0],[48,5,5,0],[49,4,4,0],[50,4,4,0],[51,4,4,0],[52,5,5,0],[53,4,4,0],[54,4,4,0],[55,4,4,0],[56,5,5,0],[57,4,4,0],[58,7,7,0],[59,7,7,0],[60,4,4,0],[61,4,4,0],[62,5,5,0],[63,5,5,0],[64,5,5,0],[65,5,5,0],[66,4,4,0],[67,5,5,0],[68,5,5,0],[69,7,7,0],[70,7,7,0],[71,7,7,0],[72,4,4,0],[73,4,4,0],[74,5,5,0],[75,4,4,0],[76,5,5,0],[77,4,4,0],[78,4,4,0],[79,4,4,0],[80,4,4,0],[81,4,4,0],[82,4,4,0],[83,4,4,0],[84,4,4,0],[85,4,4,0],[86,4,4,0],[87,4,4,0],[88,4,4,0],[89,4,4,0],[90,4,4,0],[91,4,4,0],[92,4,4,0],[93,4,4,0],[94,5,5,0],[95,4,4,0],[96,4,4,0],[97,4,4,0],[98,4,4,0],[99,4,4,0],[100,4,4,0],[101,4,4,0],[102,4,4,0],[103,4,4,0],[104,4,4,0],[105,4,4,0],[106,4,4,0],[107,4,4,0],[108,4,4,0],[109,4,4,0],[110,4,4,0],[111,4,4,0],[112,4,4,0],[113,3,3,0],[114,3,3,0],[115,3,3,0],[116,3,3,0],[117,3,3,0],[118,3,3,0],[119,3,3,0],[120,3,3,0],[121,3,3,0],[122,3,3,0],[123,3,3,0],[124,3,3,0],[125,3,3,0],[126,3,3,0],[127,3,3,0],[128,3,3,0],[129,3,3,0],[130,3,3,0],[131,3,3,0],[132,3,3,0],[133,3,3,0],[134,3,3,0],[135,3,3,0],[136,3,3,0],[137,3,3,0],[138,3,3,0],[139,3,3,0],[140,3,3,0],[141,3,3,0],[142,3,3,0],[143,3,3,0],[144,3,3,0],[145,3,3,0],[146,3,3,0],[147,3,3,0],[148,3,3,0],[149,3,3,0],[150,3,3,0],[151,3,3,0],[152,3,3,0],[153,3,3,0],[154,3,3,0],[155,3,3,0],[156,3,3,0],[157,3,3,0],[158,3,3,0],[159,3,3,0],[160,3,3,0],[161,3,3,0],[162,3,3,0],[163,3,3,0],[164,3,3,0],[165,3,3,0],[166,3,3,0],[167,3,3,0],[168,3,3,0],[169,3,3,0],[170,3,3,0],[171,3,3,0],[172,3,3,0],[173,3,3,0],[174,3,3,0],[175,3,3,0],[176,3,3,0],[177,3,3,0],[178,3,3,0],[179,3,3,0],[180,3,3,0],[181,3,3,0],[182,3,3,0],[183,3,3,0],[184,3,3,0],[185,3,3,0],[186,3,3,0],[187,3,3,0],[188,3,3,0],[189,3,3,0],[190,3,3,0],[191,3,3,0],[192,3,3,0],[193,3,3,0],[194,3,3,0],[195,3,3,0],[196,3,3,0],[197,3,3,0],[198,3,3,0],[199,3,3,0],[200,3,3,0],[201,3,3,0],[202,3,3,0],[203,3,3,0],[204,3,3,0],[205,3,3,0],[206,3,3,0],[207,3,3,0],[208,3,3,0],[209,3,3,0],[210,3,3,0],[211,3,3,0],[212,3,3,0],[213,3,3,0],[214,3,3,0],[215,3,3,0],[216,3,3,0],[217,3,3,0],[218,3,3,0],[219,3,3,0],[220,3,3,0],[221,3,3,0],[222,3,3,0],[223,3,3,0],[224,3,3,0],[225,3,3,0],[226,3,3,0],[227,3,3,0],[228,3,3,0],[229,3,3,0],[230,3,3,0],[231,3,3,0],[232,3,3,0],[233,3,3,0],[234,3,3,0],[235,3,3,0],[236,3,3,0],[237,3,3,0],[238,3,3,0],[239,3,3,0],[240,3,3,0],[241,3,3,0],[242,3,3,0],[243,3,3,0],[244,3,3,0],[245,3,3,0],[246,3,3,0],[247,3,3,0],[248,3,3,0],[249,3,3,0],[250,3,3,0],[251,3,3,0],[252,3,3,0],[253,3,3,0],[254,3,3,0],[255,3,3,0],[256,3,3,0],[257,3,3,0],[258,3,3,0],[259,3,3,0],[260,3,3,0],[261,3,3,0],[262,3,3,0],[263,3,3,0],[264,3,3,0],[265,3,3,0],[266,6,6,0],[267,6,6,0],[268,6,6,0],[269,6,6,0],[270,6,6,0],[271,6,6,0],[272,6,6,0],[273,6,6,0],[274,6,6,0],[275,6,6,0],[276,6,6,0],[277,6,6,0],[278,6,6,0],[279,6,6,0],[280,6,6,0],[281,6,6,0],[282,6,6,0],[283,6,6,0],[284,6,6,0],[285,6,6,0],[286,6,6,0],[287,6,6,0],[288,6,6,0],[289,6,6,0],[290,6,6,0],[291,6,6,0],[292,6,6,0],[293,6,6,0],[294,6,6,0],[295,6,6,0],[296,6,6,0],[297,6,6,0],[298,6,6,0],[299,6,6,0],[300,6,6,0],[301,6,6,0],[302,6,6,0],[303,6,6,0],[304,6,6,0],[305,6,6,0],[306,6,6,0],[307,6,6,0],[308,6,6,0],[309,6,6,0],[310,6,6,0],[311,6,6,0],[312,6,6,0],[313,6,6,0],[314,6,6,0],[315,6,6,0],[316,6,6,0],[317,6,6,0],[318,6,6,0],[319,6,6,0],[320,6,6,0],[321,6,6,0],[322,6,6,0],[323,6,6,0],[324,6,6,0],[325,6,6,0],[326,3,3,0],[327,3,3,0],[328,5,5,0],[329,3,3,0],[330,3,3,0],[331,3,3,0],[332,3,3,0],[333,3,3,0],[334,3,3,0],[335,5,5,0],[336,3,3,0],[337,3,3,0],[338,3,3,0],[339,3,3,0],[340,3,3,0],[341,3,3,0],[342,3,3,0],[343,3,3,0],[344,3,3,0],[345,3,3,0],[346,5,5,0],[347,3,3,0],[348,3,3,0],[349,3,3,0],[350,5,5,0],[351,3,3,0],[352,3,3,0],[353,3,3,0],[354,3,3,0],[355,3,3,0],[356,3,3,0],[357,3,3,0],[358,3,3,0],[359,5,5,0],[360,3,3,0],[361,3,3,0],[362,3,3,0],[363,3,3,0],[364,3,3,0],[365,3,3,0],[366,3,3,0],[367,3,3,0],[368,3,3,0],[369,3,3,0],[370,3,3,0],[371,3,3,0],[372,3,3,0],[373,3,3,0],[374,5,5,0],[375,3,3,0],[376,3,3,0],[377,3,3,0],[378,3,3,0],[379,3,3,0],[380,3,3,0],[381,3,3,0],[382,3,3,0],[383,3,3,0],[384,3,3,0],[385,3,3,0],[386,3,3,0],[387,3,3,0],[388,3,3,0],[389,3,3,0],[390,3,3,0],[391,3,3,0],[392,3,3,0],[393,3,3,0],[394,5,5,0],[395,3,3,0],[396,3,3,0],[397,3,3,0],[398,3,3,0],[399,3,3,0],[400,3,3,0],[401,3,3,0],[402,3,3,0],[403,3,3,0],[404,3,3,0],[405,3,3,0],[406,3,3,0],[407,3,3,0],[408,3,3,0],[409,3,3,0],[410,3,3,0],[411,3,3,0],[412,3,3,0],[413,3,3,0],[414,3,3,0],[415,3,3,0],[416,3,3,0],[417,3,3,0],[418,3,3,0],[419,3,3,0],[420,3,3,0],[421,5,5,0],[422,3,3,0],[423,3,3,0],[424,3,3,0],[425,3,3,0],[426,3,3,0],[427,3,3,0],[428,3,3,0],[429,3,3,0],[430,3,3,0],[431,5,5,0],[432,3,3,0],[433,3,3,0],[434,3,3,0],[435,3,3,0],[436,3,3,0],[437,3,3,0],[438,3,3,0],[439,3,3,0],[440,3,3,0],[441,3,3,0],[442,3,3,0],[443,3,3,0],[444,3,3,0],[445,3,3,0],[446,3,3,0],[447,3,3,0],[448,3,3,0],[449,3,3,0],[450,3,3,0],[451,3,3,0],[452,3,3,0],[453,3,3,0],[454,3,3,0],[455,3,3,0],[456,3,3,0],[457,3,3,0],[458,3,3,0],[459,3,3,0],[460,3,3,0],[461,3,3,0],[462,3,3,0],[463,3,3,0],[464,3,3,0],[465,3,3,0],[466,3,3,0],[467,3,3,0],[468,3,3,0],[469,3,3,0],[470,3,3,0],[471,3,3,0],[472,3,3,0],[473,3,3,0],[474,3,3,0],[475,3,3,0],[476,3,3,0],[477,3,3,0],[478,3,3,0],[479,3,3,0],[480,3,3,0],[481,3,3,0],[482,3,3,0],[483,3,3,0],[484,3,3,0],[485,3,3,0],[486,3,3,0],[487,3,3,0],[488,3,3,0],[489,3,3,0],[490,3,3,0],[491,3,3,0],[492,3,3,0],[493,3,3,0],[494,3,3,0],[495,3,3,0],[496,3,3,0],[497,3,3,0],[498,3,3,0],[499,3,3,0],[500,3,3,0],[501,3,3,0],[502,3,3,0],[503,3,3,0],[504,3,3,0],[505,3,3,0],[506,19,19,0],[507,16,16,0],[508,18,18,0],[509,20,20,0],[510,2,3,0],[511,2,3,0],[512,2,3,0],[513,2,3,0],[514,2,3,0],[515,2,3,0],[516,2,3,0],[517,2,3,0],[518,2,3,0],[519,14,14,0],[520,16,16,0],[521,18,18,0],[522,14,14,0],[523,16,16,0],[524,16,16,0],[525,4,4,0],[526,4,4,0],[527,4,4,0],[528,3,3,0],[529,4,4,0],[530,4,4,0],[531,4,4,0],[532,4,4,0],[533,4,4,0],[534,3,3,0],[535,4,4,0],[536,4,4,0],[537,4,4,0],[538,4,4,0],[539,4,4,0],[540,4,4,0],[541,4,4,0],[542,4,4,0],[543,4,4,0],[544,4,4,0],[545,4,4,0],[546,4,4,0],[547,3,3,0],[548,4,4,0],[549,4,4,0],[550,4,4,0],[551,4,4,0],[552,4,4,0],[553,4,4,0],[554,4,4,0],[555,4,4,0],[556,4,4,0],[557,4,4,0],[558,4,4,0],[559,4,4,0],[560,4,4,0],[561,4,4,0],[562,4,4,0],[563,4,4,0],[564,4,4,0],[565,4,4,0],[566,4,4,0],[567,4,4,0],[568,4,4,0],[569,4,4,0],[570,4,4,0],[571,3,3,0],[572,4,4,0],[573,4,4,0],[574,4,4,0],[575,4,4,0],[576,4,4,0],[577,4,4,0],[578,4,4,0],[579,4,4,0],[580,4,4,0],[581,4,4,0],[582,4,4,0],[583,4,4,0],[584,4,4,0],[585,3,3,0],[586,3,3,0],[587,4,4,0],[588,4,4,0],[589,4,4,0],[590,4,4,0],[591,3,3,0],[592,4,4,0],[593,4,4,0],[594,4,4,0],[595,4,4,0],[596,4,4,0],[597,3,3,0],[598,4,4,0],[599,3,3,0],[600,4,4,0],[601,4,4,0],[602,4,4,0],[603,4,4,0],[604,4,4,0],[605,4,4,0],[606,4,4,0],[607,4,4,0],[608,4,4,0],[609,4,4,0],[610,4,4,0],[611,4,4,0],[612,4,4,0],[613,4,4,0],[614,4,4,0],[615,4,4,0],[616,4,4,0],[617,4,4,0],[618,4,4,0],[619,4,4,0],[620,4,4,0],[621,4,4,0],[622,4,4,0],[623,4,4,0],[624,4,4,0],[625,4,4,0],[626,4,4,0],[627,4,4,0],[628,4,4,0],[629,4,4,0],[630,4,4,0],[631,4,4,0],[632,4,4,0],[633,4,4,0],[634,4,4,0],[635,4,4,0]],"compatible":[]} diff --git a/research/bit-helper-exchange-obstruction/LICENSE b/research/bit-helper-exchange-obstruction/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/bit-helper-exchange-obstruction/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/bit-helper-exchange-obstruction/NOTICE b/research/bit-helper-exchange-obstruction/NOTICE new file mode 100644 index 0000000000..fd6be646e6 --- /dev/null +++ b/research/bit-helper-exchange-obstruction/NOTICE @@ -0,0 +1,72 @@ +Binary two-helper destination exchange obstruction. Apache-2.0. +The word and source programs are retained, with exact origins in ORIGINS.json. + +Mixed paid cutoffs for the P104 ordinary BIT supplier + +Prepared for Clear1nsight with substantial OpenAI Codex assistance. The +new schedule, directed comparison, occurrence controls, and documentation +are offered under Apache-2.0. + +verify.py adapts the Apache-2.0 verifiers from Dugongue's PR #7831 +(2d1fb9c878ae1e292cb918de40fa8e4f7fa7f75e) and Rohan Arun's PR #7835 +(43007c979859fa84ccc3a3509ccacc9620d181fa). Rohan Arun submitted #7835 +through the original X request at +https://x.com/RohanArun/status/2123655584797143516. The source manifest +retains the published #7835 NOTICE. + +Retained predecessor NOTICE from the grade-14 package follows. + +Iterated returns on the P104 ordinary suppliers + +Clear1nsight prepared the successor construction, explicit witnesses and verification +with substantial OpenAI Codex assistance, including independent computational checks. +The new material is offered under Apache-2.0. + +The exact starting words and the rational and binary replay interfaces are from +Clear1nsight's PR #7781. The paid and productive scalar operations, the 48-call +complex schedule, the punctured binary supplier and the common outer application +come from Ali Romman's PR #7776. The two paid projections build on the local +quotient and terminal repair in #7774 and #7781. The binary paired caller and +finite compiler use work by DreamingOfClouds, Jerry Chen (CubeJerry), zxv and the +contributors cited in their retained sources. SYLforge, Rohan Arun, Cinna Davis, +Douglas Colkitt and other predecessors contributed the caller, physical and +analytic framework. The source-fetch helper is adapted from #7774. The immutable +source manifest identifies the public inputs and their notices. + +Paid subdivisions on both P104 suppliers + +Clear1nsight prepared the new binary and rational subdivisions, construction journals, +independent checks and compilation with substantial OpenAI Codex assistance. New +material is offered under Apache-2.0. + +Ali Romman supplied the exact dual supplier in PR #7776, including the residual +binary emitter, productive basis operations, paid layouts, caller and common +finite application. Jerry Chen (CubeJerry) supplied the selected #7000/#7001 +ordinary application. DreamingOfClouds supplied the paired caller and shared +native helper framework. The word and compiler descend from zxv and other +contributors to #6726. PR #7774 supplies closed-caller relay journals, exact +product-grid arithmetic and an independent directed price routine. SYLforge, +Rohan Arun, Cinna Davis and Douglas Colkitt contributed earlier caller, carrier +and physical or analytic frameworks. The source preparation helper is adapted +from Clear1nsight's PR #7774 under Apache-2.0. + +The exact upstream sources and retained notices are identified in SOURCE-LOCK.json. +The reproduction commands fetch all cited mathematical program files from the +pinned public source trees and verify their digests. + +Iterated returns on the P104 ordinary suppliers + +Clear1nsight prepared the successor construction, explicit witnesses and verification +with substantial OpenAI Codex assistance, including independent computational checks. +The new material is offered under Apache-2.0. + +The exact starting words and the rational and binary replay interfaces are from +Clear1nsight's PR #7781. The paid and productive scalar operations, the 48-call +complex schedule, the punctured binary supplier and the common outer application +come from Ali Romman's PR #7776. The two paid projections build on the local +quotient and terminal repair in #7774 and #7781. The binary paired caller and +finite compiler use work by DreamingOfClouds, Jerry Chen (CubeJerry), zxv and the +contributors cited in their retained sources. SYLforge, Rohan Arun, Cinna Davis, +Douglas Colkitt and other predecessors contributed the caller, physical and +analytic framework. The source-fetch helper is adapted from #7774. The immutable +source manifest identifies the public inputs and their notices. diff --git a/research/bit-helper-exchange-obstruction/ORIGINS.json b/research/bit-helper-exchange-obstruction/ORIGINS.json new file mode 100644 index 0000000000..0c46487030 --- /dev/null +++ b/research/bit-helper-exchange-obstruction/ORIGINS.json @@ -0,0 +1,23 @@ +{ + "sources/WORD.json.gz": { + "repository": "CrocSwap/integer-mult-bounds", + "commit": "89a67c404226d51028e135de2b9169e9020d57af", + "path": "research/p104-iterated-returns/binary/WORD.json.gz", + "sha256": "d28f0d28d9d87d5fe57b8ef19e12faf98014f0bbef781987ce22daaa82f21cb9", + "git_blob": "efb2e9d1c3caec25bea36803ca6994997e3256b0" + }, + "sources/bit_native.py": { + "repository": "aliromman/integer-mult-bounds", + "commit": "4f7c67ae387cc91580f469aeda4d508b372b9ec1", + "path": "research/p104-dual-supplier-lift/bit_native.py", + "sha256": "4368c62a5d42f81189d6776b8dba8c85a311b6a199b816244b545c6bb7d3dc1e", + "git_blob": "86d88d7ed25ab24662e82b51dc0180e5af7b3d4f" + }, + "sources/binary_operator.py": { + "repository": "Clear1nsight/integer-mult-bounds", + "commit": "87fbf4f7b35b0f18ab12b5767775a9a424cf0b15", + "path": "research/p104-mixed-rank-supplier/review/binary_operator.py", + "sha256": "36b3da4f72f8a6c946136fbd58b20838c00b0243c2effaf909c20b76967a5349", + "git_blob": "95c6d4ec0f2f33f41f5dd44fe1dd925317727acc" + } +} diff --git a/research/bit-helper-exchange-obstruction/README.md b/research/bit-helper-exchange-obstruction/README.md new file mode 100644 index 0000000000..202a82eae1 --- /dev/null +++ b/research/bit-helper-exchange-obstruction/README.md @@ -0,0 +1,38 @@ +# No profitable equal-mass two-helper exchange at one frozen binary chart + +On the exact 680-owner BIT word used by [#7830](https://github.com/CrocSwap/integer-mult-bounds/pull/7830), 3,112 unordered pairs of productive helpers would improve the signed invoice if their destinations could be exchanged at zero paid cost. **None can be exchanged by one chart-local linear correction with the other paid payloads and their responses fixed.** This excludes 1,979,232 chart/pair combinations. **No verified κ gain.** + +## Construction being tested + +Keep all 2,874 paid packets, all 111 main port pairs and all caller events. Exchange the destinations of two independent productive helpers and relabel the two closing outputs. Their new endpoint pairs must be nested in the actual rational frame atlas. Price only pairs with two positive new grades, the same total grade and a strictly larger smaller grade. For every exponent strictly between zero and one, strict concavity makes the new productive sum larger. These targets would be credited on each of the 36 binary calls. The paid invoice would stay fixed. The test ends before any construction or credit. + +## Why a whole chart can be ruled out + +Write the two helper indices as $i,j$, and let $t=e_i+e_j$ over the binary field. Before relabeling, swapping the two independent output rows changes the public transfer by $tt^T$. Fix a chart and form the following two spaces. + +- The **read space** spans all initial inputs in the chart and all rows ever received there on paid packets. +- The **write space** spans the terminal responses to impulses at every paid send from the chart, together with the public outputs closing there. + +At any clock, every local scalar covector factors through the read space. Every public response to a local intervention factors through the write space because an effect exits on a paid send or a public output. An update at a single cut therefore factors as $G L F$, where the rows of $F$ belong to the read space and the columns of $G$ to the write space. The nonzero row and column of $tt^T$ each require $t$ in the corresponding space. Granting **all** arrivals and sends drops chronology and enlarges the feasible spaces. If either membership fails under this relaxation, changing the clock or ordering independent events cannot rescue this edit with the fixed observations and responses. + +The check takes residues of $e_i,e_j$ modulo each space. Equal residues are equivalent to membership of their sum. Both memberships must hold at the same chart. The packet-graph implementation and the independent forward/adjoint tape implementation agree on the 3,112 pair identities, every chart rank, and zero matches across all 636 charts. The latter also checks every coefficient of the 680-by-680 public native maps and 3,554 dirty retirements in each orientation. The graph verifier includes a control where granting a missing output direction changes the answer. + +An initial temporal screen tried 48 cuts immediately after evenly spaced paid MOVE ordinals (zero-based ordinals `floor(n × 2873 / 47)`, for 0 ≤ n < 48). It found zero matches. The whole-chart proof supersedes that sampling for the declared mechanism. Unequal-mass changes, higher-arity target changes, interventions at two charts and edits that recode the other paid traffic remain open. + +## Reproduce + +Use CPython 3.12 with assertions enabled. The scientific checks need only the standard library and the three pinned source files in this package. + +```sh +python3.12 -IB scripts/research_package.py --package research/bit-helper-exchange-obstruction +``` + +The outputs are `PASS_PACKET_GRAPH_EXCHANGE_EXCLUSION` and `PASS_LITERAL_TAPE_EXCHANGE_EXCLUSION`. `EXPECTED.json` records the ordered pair-list SHA-256 and all chart rows as [chart, read rank, write rank, number of matches]. `ORIGINS.json` pins every vendored input by repository, commit, source path, Git blob and SHA-256. The canonical word digest is `d3aa4426fa8fe7dc167270d01f2515184f2bff6a82744a14e941c5dd3afca27d`. + +The benchmark at the time of the screen was [#7830 at 87fbf4f](https://github.com/Clear1nsight/integer-mult-bounds/tree/87fbf4f7b35b0f18ab12b5767775a9a424cf0b15/research/p104-mixed-rank-supplier), κ ≥ 0.00387992803556 under five premises. Its producer and separate complete application replay were run on their frozen sources. The present package checks only the claimed obstruction. + +## Open next questions + +Can projection of a helper direction remove enough paid arrivals to fund a direct independent return? Set one helper input to zero, find exact same-chart replacements among available arrivals in each orientation, and debit the entire direct bridge before building. This changes another paid payload, so the chart obstruction above does not settle it. + +Clear1nsight supplied the [#7786 native word](https://github.com/CrocSwap/integer-mult-bounds/pull/7786), the #7830 mixed supplier and its independently written literal tape engine. Ali Romman supplied the [#7776 paid-graph extractor and endpoint audit](https://github.com/CrocSwap/integer-mult-bounds/pull/7776). The #7781 helper births and the #6834/#6980/#7001 paired-caller lineage underlie those artifacts. [#7833](https://github.com/CrocSwap/integer-mult-bounds/pull/7833) tests paid ingress repairs at nine specific binary receivers. This contribution tests destination exchange at every chart. OpenAI Codex materially assisted the proof, implementations and replay. Maintainer and independent human review remain open. diff --git a/research/bit-helper-exchange-obstruction/SOURCES.json b/research/bit-helper-exchange-obstruction/SOURCES.json new file mode 100644 index 0000000000..af9d22284d --- /dev/null +++ b/research/bit-helper-exchange-obstruction/SOURCES.json @@ -0,0 +1,24 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "LICENSE", + "usage": "provenance", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + } + ] +} diff --git a/research/bit-helper-exchange-obstruction/TASK.json b/research/bit-helper-exchange-obstruction/TASK.json new file mode 100644 index 0000000000..b4bdefb9e5 --- /dev/null +++ b/research/bit-helper-exchange-obstruction/TASK.json @@ -0,0 +1,117 @@ +{ + "schema_version": 1, + "task_id": "p104-side-correction", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "p104-side-correction", + "question": "Can joint helper bases and a legal causal split improve the complete P104 productive/paid invoice?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "research/p104-helper-subspace-splits/README.md", + "research/dyadic-helper-channel-capacity/README.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "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. 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", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Start with the selected #5599 emitted word and review pending #5718 distinct input/output bases plus #5717/#5719 coverage before claiming work. Pick one uncovered source word, helper group and cut region. Prove the arbitrary-input relation and legal entry/exit corrections, then compare full target and paid profiles. Reject if completion, owned lifetimes or consumer costs repay the gain. A static pairing rank alone is not a physical split.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "P104", + "helper basis", + "helper split", + "5718", + "dyadic capacity" + ], + "existing_checks": [ + { + "scope": "PR #4133: literal-slot defect", + "evidence": "research/p104-literal-slot-defect/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "88666f1dee93fbd85b31fd5d6f91a219e111b5f4", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4136: uniform commutation gap", + "evidence": "research/p104-uniform-commutation-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "281ce601a8be9db470de630759179c23e1dfaa88", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4140: uniform encoding gap", + "evidence": "research/p104-uniform-encoding-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "de25c6525aa866962309df5d107b32d55e6e5628", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4153: source-chart shortcut exhausts its optimistic allowance", + "evidence": "research/p104-source-chart-shortcut/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "9123241fea53df77e51ffe30d9aca1625d4bf3a8", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4154: fiber-tag seam mismatch", + "evidence": "research/p104-fiber-tag-seam/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "4ffcdaee5d6255a9cea1fe53a5424435068089d0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "refined", + "actual_scope": "Decide whether one frozen chart of the #7830 binary native can exchange two helper destinations at a strictly better equal-mass productive price.", + "scope_change_reason": "The assigned incremental search fixes the strongest reproduced binary word and grants all-time chart stock to decide this specific intervention.", + "bottleneck_link": "The BIT signed crossing bounds the complete five-premise #7830 application. A strict equal-mass balancing of two helper ranks would improve every signed moment at fixed paid cost.", + "budget_minutes": 60, + "stop_rule": "48 fixed temporal cuts initially, followed by at most 636 all-time charts under 60 seconds. Require both a readable input difference and an injectable output difference.", + "outcome": "completed", + "evidence": "README.md, ORIGINS.json, verify.py and independently implemented crosscheck.py.", + "author": "Campaign contributor", + "ai_assistance": "Material OpenAI Codex and subagent assistance for proof, adaptation, implementation, independent local replays and packaging.", + "open_questions": [ + { + "question": "Can a projection of one helper be funded by multiple paid withdrawals and a directly charged return?", + "why_it_matters": "This permits an alteration to paid payloads beyond the one-chart obstruction.", + "first_step": "Set one helper input to zero and scan earlier same-chart arrivals for each removable paid row in both orientations. Charge a direct bridge at the original helper grade.", + "blocked_by": "A strictly positive joint price, acyclic construction and both full independent applications are required." + } + ] +} diff --git a/research/bit-helper-exchange-obstruction/VERIFY.json b/research/bit-helper-exchange-obstruction/VERIFY.json new file mode 100644 index 0000000000..21b385a4ce --- /dev/null +++ b/research/bit-helper-exchange-obstruction/VERIFY.json @@ -0,0 +1,19 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": ["{python}", "-I", "-B", "{package}/verify.py"], + "timeout_seconds": 30, + "checks": "Authenticate the frozen inputs and check every profitable equal-mass pair against both full-history chart spans on the paid graph." + }, + { + "argv": ["{python}", "-I", "-B", "{package}/crosscheck.py"], + "timeout_seconds": 30, + "checks": "Recreate all chart ranks, pair identities and nonmembership decisions from the literal forward and adjoint tapes, including independent endpoint and retirement checks." + } + ] +} diff --git a/research/bit-helper-exchange-obstruction/crosscheck.py b/research/bit-helper-exchange-obstruction/crosscheck.py new file mode 100644 index 0000000000..8395155673 --- /dev/null +++ b/research/bit-helper-exchange-obstruction/crosscheck.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +"""Independently check the excluded exchanges from forward and adjoint literal tapes.""" +import hashlib +import itertools +import json +import runpy +from pathlib import Path + +ROOT = Path(__file__).resolve().parent +ENGINE = "36b3da4f72f8a6c946136fbd58b20838c00b0243c2effaf909c20b76967a5349" + + +def quotient(rows, owners): + pivots = {} + + def reduce(row): + residue = 0 + while row: + k = row.bit_length() - 1 + if k in pivots: + row ^= pivots[k] + else: + residue |= 1 << k + row ^= 1 << k + return residue + + for row in rows: + remainder = reduce(row) + if remainder: + pivots[remainder.bit_length() - 1] = remainder + return len(pivots), {i: reduce(1 << i) for i in owners} + + +def main(): + engine = ROOT / "sources/binary_operator.py" + assert __debug__ and hashlib.sha256(engine.read_bytes()).hexdigest() == ENGINE + op = runpy.run_path(str(engine)) + word = op["load_json"](ROOT / "sources/WORD.json.gz", op["WORD_GZIP"], True) + assert op["canonical_hash"](word) == op["WORD"] + atlas = op["Atlas"](word["frames"]) + forward = op["run_tape"](word, atlas, False) + adjoint = op["run_tape"](word, atlas, True) + assert forward.output == op["expected_operator"](False) + assert adjoint.output == op["expected_operator"](True) + assert forward.dirty == adjoint.dirty == 3554 + + owners = range(222, word["public"]) + starts, ends = word["start"], word["final"] + ranks = {i: atlas.grade(starts[i], ends[i]) for i in owners} + pairs = [] + for i, j in itertools.combinations(owners, 2): + old = (ranks[i], ranks[j]) + new = (atlas.grade(starts[i], ends[j]), atlas.grade(starts[j], ends[i])) + if min(new) > min(old) and sum(new) == sum(old): + pairs.append((i, j)) + expected = json.loads((ROOT / "EXPECTED.json").read_bytes()) + assert len(pairs) == expected["pairs"] == 3112 + assert hashlib.sha256(json.dumps(pairs, separators=(",", ":")).encode()).hexdigest() == expected["pair_sha256"] + counts = [] + for chart in sorted(atlas.body): + a, read = quotient((obs.row for obs in forward.stock[chart]), owners) + b, write = quotient((obs.row for obs in adjoint.stock[chart]), owners) + matches = sum(read[i] == read[j] and write[i] == write[j] for i, j in pairs) + assert matches == 0 + counts.append([chart, a, b, matches]) + assert len(counts) == 636 and counts == expected["charts"] + print("PASS_LITERAL_TAPE_EXCHANGE_EXCLUSION 680 public rows each way, 3554 dirty retirements each way, 1979232 decisions") + + +if __name__ == "__main__": + main() diff --git a/research/bit-helper-exchange-obstruction/sources/WORD.json.gz b/research/bit-helper-exchange-obstruction/sources/WORD.json.gz new file mode 100644 index 0000000000..efb2e9d1c3 Binary files /dev/null and b/research/bit-helper-exchange-obstruction/sources/WORD.json.gz differ diff --git a/research/bit-helper-exchange-obstruction/sources/binary_operator.py b/research/bit-helper-exchange-obstruction/sources/binary_operator.py new file mode 100644 index 0000000000..95c6d4ec0f --- /dev/null +++ b/research/bit-helper-exchange-obstruction/sources/binary_operator.py @@ -0,0 +1,324 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Binary operator and caller recount, adapted from the S9 three-ingress replay.""" + +from collections import Counter, defaultdict +from fractions import Fraction +from functools import cache +import gzip +from hashlib import sha256 +import json +from typing import NamedTuple + + +WORD_GZIP = "d28f0d28d9d87d5fe57b8ef19e12faf98014f0bbef781987ce22daaa82f21cb9" +WORD = "d3aa4426fa8fe7dc167270d01f2515184f2bff6a82744a14e941c5dd3afca27d" +LAYOUT = "a0ffffd99fb9b91f0013695877480766319ac51b926ed00dd5f7ec32f2d1e1a6" +CALLER = "757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b" +BRIDGE_PACKET = 3553 +BRIDGE_OWNER = 411 + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def load_json(path, digest, compressed=False): + raw = path.read_bytes() + require(sha256(raw).hexdigest() == digest, f"SHA-256 mismatch for {path}") + return json.loads(gzip.decompress(raw) if compressed else raw) + + +def canonical_hash(value): + return sha256(json.dumps(value, sort_keys=True, separators=(",", ":")).encode()).hexdigest() + + +def rational_rank(rows): + work = [list(row) for row in rows] + rank = 0 + for column in range(8): + pivot = next((j for j in range(rank, len(work)) if work[j][column]), None) + if pivot is None: + continue + work[rank], work[pivot] = work[pivot], work[rank] + for row in work[rank + 1:]: + factor = row[column] / work[rank][column] + if factor: + row[column:] = [x - factor * y for x, y in zip(row[column:], work[rank][column:])] + rank += 1 + return rank + + +def annihilates(left, right): + return all(sum(x * y for x, y in zip(row, dual)) == 0 for row in left for dual in right) + + +class Atlas: + def __init__(self, frames): + self.body = {} + self.dual = {} + for label, rows in frames.items(): + chart = int(label) + body, dual = (tuple(tuple(map(Fraction, row)) for row in rows[k]) for k in ("B", "A")) + require(len(body) == rows["dim"] and len(body + dual) == 8, f"frame counts at {chart}") + require(all(len(row) == 8 for row in body + dual), f"frame dimensions at {chart}") + require(rational_rank(body + dual) == 8 and annihilates(body, dual), + f"frame rank and orthogonality at {chart}") + self.body[chart], self.dual[chart] = body, dual + + @cache + def grade(self, first, second): + low, high = sorted((first, second), key=lambda chart: len(self.body[chart])) + difference = len(self.body[high]) - len(self.body[low]) + return difference if difference > 0 and annihilates(self.body[low], self.dual[high]) else 0 + + def main_contacts(self, starts, ends): + for j in range(111): + head, body = self.body[starts[j]], self.body[ends[j + 111]] + require((len(head), len(body), len(self.body[starts[j + 111]]), + len(self.body[ends[j]])) == (1, 7, 0, 8), f"contact dimensions at {j}") + require(annihilates(head, body) and rational_rank(head + body) == 8, + f"contact decomposition at {j}") + return 111 + + +class Observation(NamedTuple): + label: int + time: int + row: int + + +class Packet(NamedTuple): + source: int + receiver: int + clock: int + arrival: Observation + grade: int + + +class Tape(NamedTuple): + stock: dict + demand: dict + packets: dict + output: list + dirty: int + last_retirement: int + + +def run_tape(word, atlas, reverse, omit=None): + """Track whole-field chart tags and coefficient rows over all public inputs.""" + public, private = word["public"], word["owned_fields"] + start, end = [word[k] for k in (("final", "start") if reverse else ("start", "final"))] + program = word["program"] + identifiers = dict(zip((i for i, event in enumerate(program) if event[0] == "MOVE"), + range(public, public + len(program)))) + cells = [(chart, 1 << owner) for owner, chart in enumerate(start)] + [None] * private + stock, demand, packets = defaultdict(list), defaultdict(list), {} + for owner, chart in enumerate(start): + stock[chart].append(Observation(owner, -1, 1 << owner)) + order = range(len(program) - 1, -1, -1) if reverse else range(len(program)) + opens, retires = ("CLEAR", "INIT") if reverse else ("INIT", "CLEAR") + dirty, last_retirement = 0, None + + for time, clock in enumerate(order): + if clock == omit: + continue + operation, address, *args = program[clock] + require(0 <= address < len(cells), f"field address at {clock}") + cell = cells[address] + if operation in (opens, retires): + chart, = args + require(address >= public and chart in atlas.body, f"private chart at {clock}") + if operation == opens: + require(cell is None, f"activation of a live field at {clock}") + cells[address] = chart, 0 + else: + require(cell is not None and cell[0] == chart, f"private retirement at {clock}") + dirty += bool(cell[1]) + cells[address] = None + last_retirement = clock + elif operation == "ADD": + peer, chart = args + require(0 <= peer < len(cells) and peer != address, f"ADD operands at {clock}") + other = cells[peer] + require(cell is not None and other is not None and cell[0] == other[0] == chart, + f"ADD chart at {clock}") + cells[peer if reverse else address] = chart, cell[1] ^ other[1] + elif operation == "SWAP": + peer, = args + require(0 <= peer < len(cells) and peer != address and cell is not None + and cells[peer] is not None, f"SWAP operands at {clock}") + cells[address], cells[peer] = cells[peer], cell + else: + require(operation == "MOVE" and address >= public, f"operation at {clock}") + source, receiver = args[::-1] if reverse else args + grade = atlas.grade(source, receiver) + require(cell is not None and cell[0] == source and grade > 0, f"MOVE ports at {clock}") + arrival = Observation(identifiers[clock], time, cell[1]) + packets[arrival.label] = Packet(source, receiver, clock, arrival, grade) + demand[source].append(arrival) + stock[receiver].append(arrival) + cells[address] = receiver, cell[1] + + require(all(cell is None for cell in cells[public:]), "unretired private field") + require([chart for chart, _ in cells[:public]] == end, "wrong public endpoints") + output = [row for _, row in cells[:public]] + for owner, chart in enumerate(end): + demand[chart].append(Observation(~owner, len(program), output[owner])) + return Tape(stock, demand, packets, output, dirty, last_retirement) + + +def expected_operator(reverse): + rows = [1 << owner for owner in range(680)] + for j in range(111): + dst, src = (j, j + 111) if reverse else (j + 111, j) + rows[dst] ^= 1 << src + return rows + + +def native_checks(word, atlas): + packets = {row[1] for row in word["program"] if row[0] == "MOVE"} + deleted_add, = [j for j, row in enumerate(word["program"]) + if row[0] == "ADD" and row[1] in packets and row[2] == BRIDGE_OWNER] + out = {} + bridge_bit = 1 << BRIDGE_OWNER + for reverse in (False, True): + tape = run_tape(word, atlas, reverse) + expected = expected_operator(reverse) + require(tape.output == expected, "complete native operator") + require(tape.dirty == 3554, "dirty private retirement count") + bridge = tape.packets[BRIDGE_PACKET] + route = (1, 509) if reverse else (509, 1) + require((bridge.source, bridge.receiver, bridge.clock, bridge.arrival.row, bridge.grade) == + (*route, 31290, bridge_bit, 4), "protected owner-411 bridge geometry and row") + require(tape.output[BRIDGE_OWNER] == bridge_bit, "protected owner-411 return") + require([k for k, p in tape.packets.items() if p.arrival.row & bridge_bit] == [BRIDGE_PACKET], + "protected owner-411 isolation in all paid packets") + changed = run_tape(word, atlas, reverse, omit=deleted_add).output + require([a ^ b for a, b in zip(changed, expected)] == + [bridge_bit if i == BRIDGE_OWNER else 0 for i in range(680)], + "omitting the owner-411 ADD must flip exactly one coefficient") + try: + run_tape(word, atlas, reverse, omit=tape.last_retirement) + except ValueError as error: + require(str(error) == "unretired private field", "dirty retirement omission disposition") + else: + raise ValueError("omitting a dirty retirement was accepted") + out[reverse] = tape + return out[False], out[True], deleted_add + + +def polynomial_shift(poly, factor): + return { + (term[0] ^ factor[0],) + tuple(a + b for a, b in zip(term[1:], factor[1:])): row + for term, row in poly.items() + } + + +def polynomial_xor(left, right): + result = left.copy() + for term, row in right.items(): + combined = result.get(term, 0) ^ row + if combined: + result[term] = combined + else: + result.pop(term, None) + return result + + +def caller_monomial(stages, query=False): + return (int(query),) + tuple(int(i in stages) for i in range(1, 19)) + + +def caller_operator(caller, reverse): + """Use exact stage exponent tuples and the involution q^2 = 1.""" + n = caller["roles"] + rows = [{(0,) * 19: 1 << i} for i in range(n)] + query = caller_monomial((), True) + events = reversed(caller["events"]) if reverse else caller["events"] + for op, *args in events: + if op in ("ADD", "QUERY"): + dst, src = args[::-1] if reverse else args + term = polynomial_shift(rows[src], query) if op == "QUERY" else rows[src] + rows[dst] = polynomial_xor(rows[dst], term) + elif op == "SWAP": + a, b = args + rows[a], rows[b] = rows[b], rows[a] + elif op == "LOCAL": + stage, src, dst = args + if reverse: + src, dst = dst, src + factor = caller_monomial((stage,)) + rows[dst] = polynomial_shift(polynomial_xor(rows[dst], polynomial_shift(rows[src], query)), factor) + rows[src] = polynomial_shift(rows[src], factor) + elif op == "IDLE_ONE": + role, stages = args + rows[role] = polynomial_shift(rows[role], caller_monomial(stages)) + else: + raise ValueError(f"unexpected caller event {op}") + return rows + + +def binary_invoice(word, caller, atlas, tape): + roles, ports, stages = (caller[k] for k in ("roles", "ports", "stages")) + require((roles, ports, stages, caller["native_per_stage"], caller["body_rank"], caller["ambient_rank"]) + == (38, 111, 18, 2, 7, 127), "paired caller dimensions") + stage_order, touched = [], defaultdict(set) + stage_ids = set(range(1, 19)) + native_paid = Counter(packet.grade for packet in tape.packets.values()) + native_targets = Counter(atlas.grade(a, b) for a, b in zip(word["start"][222:], word["final"][222:])) + require(0 not in native_targets and sum(native_targets.values()) == 458, "helper target geometry") + paid, targets = Counter(), Counter() + for op, *args in caller["events"]: + if op == "LOCAL": + stage, a, b = args + require(0 <= a < roles and 0 <= b < roles and a != b and stage in stage_ids + and not (touched[stage] & {a, b}), "disjoint local calls at each stage") + touched[stage].update((a, b)) + stage_order.append(stage) + paid.update(native_paid) + targets.update(native_targets) + elif op == "IDLE_ONE": + a, mask = args + require(0 <= a < roles and mask and len(set(mask)) == len(mask) + and set(mask) <= stage_ids, "charged caller idle mask") + paid[7 * len(mask)] += ports + else: + a, b = args + require(op in ("ADD", "SWAP", "QUERY") and 0 <= a < roles and 0 <= b < roles + and a != b, "caller operation") + if op == "QUERY": + paid[1] += ports + require(stage_order == [stage for stage in range(1, 19) for _ in range(2)], "36 actual local calls") + roots = [] + require(len(caller["diagonal"]) == roles, "caller public diagonal length") + for i, entry in enumerate(caller["diagonal"]): + mask = entry["stages"] + require(entry["q"] == 1 and mask and len(set(mask)) == len(mask) + and set(mask) <= stage_ids, "root productive mask") + roots.append({caller_monomial(mask, True): 1 << i}) + targets[1 + 7 * len(mask)] += ports + require(caller_operator(caller, False) == roots == caller_operator(caller, True), + "all paired caller polynomial coefficients") + require(sum(targets.values()) == 36 * 458 + ports * roles, "complete productive invoice") + return native_paid, native_targets, paid, targets + + +def ordinary_boundary(word, caller, paid, targets): + """Count the incumbent under the source's raw tape and routing allowance model.""" + events = Counter(event[0] for event in caller["events"]) + calls, queries, idles = (events[k] for k in ("LOCAL", "QUERY", "IDLE_ONE")) + ports, roles = caller["ports"], caller["roles"] + owned, public, scratch = word["owned_fields"], word["public"], 4 + native_records = calls * 16 * (owned + public + scratch) * len(word["program"]) + caller_records = ports * (8 * (events["ADD"] + 3 * events["SWAP"]) + 256 * (calls + queries + roles)) + route_groups = 4 * (sum(paid.values()) + sum(targets.values())) + 8 * ports * (calls + idles) + route_records = route_groups * 80 * 134 * 135 + records = native_records + caller_records + route_records + fields = calls * (owned + scratch) + 2 * ports * roles * len(caller["events"]) + fields += 16 * ports * (calls + queries + roles) + require(records == 934_182_831_504 < 10**12 and fields == 6_998_544 < 10**7, + "incumbent ordinary record and field census") + return {"native_calls": calls, "caller_events": dict(events), "raw_records": records, + "raw_records_limit": 10**12, "owned_fields": fields, "owned_fields_limit": 10**7} diff --git a/research/bit-helper-exchange-obstruction/sources/bit_native.py b/research/bit-helper-exchange-obstruction/sources/bit_native.py new file mode 100644 index 0000000000..86d88d7ed2 --- /dev/null +++ b/research/bit-helper-exchange-obstruction/sources/bit_native.py @@ -0,0 +1,198 @@ +"""Build and verify eight causal punctures in the selected binary native word. Apache-2.0.""" +from collections import Counter, defaultdict +from hashlib import sha256 +from heapq import heapify, heappop, heappush +import gzip +import json + +NATIVE = 'research/paired-query-only-bit/retained/inputs/BIT-NATIVE-WORD.json.gz' +NATIVE_SHA = '51203e7fc75ba10bd3ac3f8e675759f47e13d262bea66b6600d1e515095cad78' +# Each row names the original public owner and three zero-based MOVE ordinals. +# Remove the first two MOVEs. Add the second sender's row into the third sender. +PUNCTURES = ( + (633, 2323, 2657, 1599), (638, 2342, 2669, 1617), + (646, 2381, 2695, 1634), (640, 2453, 2743, 1621), + (649, 2496, 2771, 1646), (636, 2497, 2773, 1609), + (651, 2513, 2783, 1662), (635, 2532, 2795, 1608), +) + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def digest(value): + return sha256(json.dumps(value, sort_keys=True, separators=(',', ':')).encode()).hexdigest() + + +def indices(value): + while value: + first = value & -value + yield first.bit_length() - 1 + value ^= first + + +def combine(row, values): + result = 0 + for source in indices(row): + result ^= values[source] + return result + + +def read_pinned(root, path, expected): + raw = (root / path).read_bytes() + need(sha256(raw).hexdigest() == expected, 'source digest for ' + str(path)) + return json.loads(gzip.decompress(raw)) + + +def extract(source): + public = source['public'] + initial = dict(enumerate(source['start'])) + final = dict(enumerate(source['final'])) + rows, moves, clocks = {}, {}, {} + banks = [1 << i for i in initial] + [0]*source['owned_fields'] + for clock, (op, r, *args) in enumerate(source['program']): + if op == 'ADD': + banks[r] ^= banks[args[0]] + elif op in ('INIT', 'CLEAR'): + banks[r] = 0 + elif op == 'SWAP': + s, = args + banks[r], banks[s] = banks[s], banks[r] + else: + need(op == 'MOVE', 'original binary instruction') + k = public + len(moves) + rows[k], moves[k], clocks[k] = banks[r], tuple(args), clock + banks[r] = 1 << k + rows.update({~r: banks[r] for r in final}) + return initial, final, moves, rows, clocks + + +def schedule(initial, final, moves, rows): + chart = initial.copy() + chart.update({k: arrival for k, (_, arrival) in moves.items()}) + need(rows.keys() == moves.keys() | {~r for r in final}, 'every packet and terminal has one row') + count, uses = {}, defaultdict(list) + for k, row in rows.items(): + here = moves[k][0] if k >= 0 else final[~k] + parents = list(indices(row)) + need(all(chart.get(j) == here for j in parents), 'every XOR donor has the current rational chart') + if k >= 0: + count[k] = sum(j in moves for j in parents) + for j in parents: + if j in moves: + uses[j].append(k) + ready = [k for k in moves if not count[k]] + heapify(ready) + order = [] + while ready: + k = heappop(ready) + order.append(k) + for child in uses[k]: + count[child] -= 1 + if not count[child]: + heappush(ready, child) + need(len(order) == len(moves), 'causal binary packet schedule') + return order + + +def basis(initial, moves, rows, order): + values = {r: 1 << r for r in initial} + for k in order: + values[k] = combine(rows[k], values) + for r in initial: + target = 1 << r + if 111 <= r < 222: + target ^= 1 << (r-111) + need(combine(rows[~r], values) == target, 'complete binary public transfer') + # A pulse in a delivered packet gives this column at all outputs. + columns = {j: 0 for j in initial.keys() | moves.keys()} + for r in initial: + for j in indices(rows[~r]): + columns[j] ^= 1 << r + for k in reversed(order): + for j in indices(rows[k]): + columns[j] ^= columns[k] + for r in initial: + expected = 1 << r + if r < 111: + expected ^= 1 << (r+111) + need(columns[r] == expected, 'complete transposed binary public transfer') + return columns + + +def puncture(initial, final, moves, rows, r, zero, alias, donor, send=True): + initial, final, moves = initial.copy(), final.copy(), moves.copy() + del initial[r], final[r], moves[zero], moves[alias] + erased = (1 << r) | (1 << zero) | (1 << alias) + new_rows = {k: row & ~erased for k, row in rows.items() if k not in (~r, zero, alias)} + if send: + new_rows[donor] ^= rows[alias] & ~erased + return initial, final, moves, new_rows + + +def emit_word(source, initial, final, moves, rows, order): + owners = sorted(initial) + public = len(owners) + location = {r: i for i, r in enumerate(owners)} + program = [] + def accumulate(scratch, chart, row): + program.append(['INIT', scratch, chart]) + program.extend(['ADD', scratch, location[j], chart] for j in indices(row)) + for i, k in enumerate(order): + a, b = moves[k] + scratch = public+i + accumulate(scratch, a, rows[k]) + program.append(['MOVE', scratch, a, b]) + location[k] = scratch + output_base = public + len(moves) + for i, r in enumerate(owners): + accumulate(output_base+i, final[r], rows[~r]) + # Exchange the full contents and chart tags only after all output sums are ready. + for i, r in enumerate(owners): + program.append(['SWAP', i, output_base+i]) + program.append(['CLEAR', output_base+i, initial[r]]) + for k in order: + program.append(['CLEAR', location[k], moves[k][1]]) + return dict(schema='BIT-functional-GL-kernel-native/1', public=public, + owned_fields=len(moves)+public, frames=source['frames'], start=[initial[r] for r in owners], + final=[final[r] for r in owners], program=program) + + +def build(root): + source = read_pinned(root, NATIVE, NATIVE_SHA) + initial, final, moves, rows, clocks = extract(source) + start = source['public'] + need((start, len(moves), len(source['frames'])) == (659, 2871, 636), 'selected native inventory') + order = schedule(initial, final, moves, rows) + columns = basis(initial, moves, rows, order) + trace = [] + for index, (r, *ordinals) in enumerate(PUNCTURES): + zero, alias, donor = [start+i for i in ordinals] + need(columns[zero] == 1 << r and columns[alias] ^ columns[donor] == 1 << r, + 'both exact transpose equations for the surrendered helper') + need(moves[alias][0] == moves[donor][0] and clocks[donor] < clocks[alias], + 'same sender bank and later donor in the old reverse order') + trace.append(dict(role=r, original_move_ordinals=ordinals, original_word_clocks=[clocks[k] for k in (zero,alias,donor)], + paid_routes=[list(moves[k]) for k in (zero,alias,donor)], + original_public_boundary=[initial[r], final[r]])) + if index == 0: + bad = puncture(initial, final, moves, rows, r, zero, alias, donor, send=False) + try: + basis(bad[0], bad[2], bad[3], schedule(*bad)) + except ValueError as error: + need(str(error) == 'complete binary public transfer', 'changed-sender control failure') + else: + raise ValueError('missing sender XOR accepted') + initial, final, moves, rows = puncture(initial, final, moves, rows, r, zero, alias, donor) + order = schedule(initial, final, moves, rows) + columns = basis(initial, moves, rows, order) + word = emit_word(source, initial, final, moves, rows, order) + receipt = dict(punctures=trace, checked_prefix_public_dimensions=list(range(659,650,-1)), + surviving_original_owners=sorted(initial), program_sha256=digest(word), + scalar_rows_per_orientation=len(initial), final_public_coefficients=len(initial)**2, + paid_packets=len(moves), largest_sender_xor=max(v.bit_count() for v in rows.values()), + instruction_counts=dict(Counter(e[0] for e in word['program'])), + changed_sender_control_rejected=True) + return word, receipt diff --git a/research/bit-helper-exchange-obstruction/verify.py b/research/bit-helper-exchange-obstruction/verify.py new file mode 100644 index 0000000000..c9f8ecfce6 --- /dev/null +++ b/research/bit-helper-exchange-obstruction/verify.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python3 +"""Check one-chart helper swaps on the deposited paid-packet graph.""" +import gzip +import hashlib +import itertools +import json +import runpy +from collections import defaultdict +from fractions import Fraction +from functools import cache +from pathlib import Path + +HERE = Path(__file__).resolve().parent +WORD = "d3aa4426fa8fe7dc167270d01f2515184f2bff6a82744a14e941c5dd3afca27d" + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def authenticate_sources(): + for name, origin in json.loads((HERE / "ORIGINS.json").read_bytes()).items(): + data = (HERE / name).read_bytes() + blob = f"blob {len(data)}\0".encode() + data + require(hashlib.sha256(data).hexdigest() == origin["sha256"], name) + require(hashlib.sha1(blob).hexdigest() == origin["git_blob"], name) + + +def improving_pairs(word): + frames = word["frames"] + + @cache + def grade(a, b): + low, high = sorted((frames[str(a)], frames[str(b)]), key=lambda f: f["dim"]) + size = high["dim"] - low["dim"] + if size == 0: + return 0 + for row in low["B"]: + for dual in high["A"]: + if sum(Fraction(x) * Fraction(y) for x, y in zip(row, dual, strict=True)): + return 0 + return size + + starts, ends = word["start"], word["final"] + owners = range(222, word["public"]) + grades = {i: grade(starts[i], ends[i]) for i in owners} + require(min(grades.values()) > 0, "existing helpers must be nested") + pairs = [] + for i, j in itertools.combinations(owners, 2): + old_low, old_high = sorted((grades[i], grades[j])) + if old_high - old_low < 2 or starts[i] == starts[j] or ends[i] == ends[j]: + continue + a, b = grade(starts[i], ends[j]), grade(starts[j], ends[i]) + if min(a, b) > old_low and a + b == old_low + old_high: + pairs.append((i, j)) + return pairs + + +def echelon(rows): + basis = {} + for row in rows: + while row: + pivot = (row & -row).bit_length() - 1 + if pivot not in basis: + basis[pivot] = row + break + row ^= basis[pivot] + return basis + + +def residues(rows, owners): + basis = echelon(rows) + ordered = sorted(basis.items()) + result = {} + for i in owners: + row = 1 << i + for pivot, vector in ordered: + if (row >> pivot) & 1: + row ^= vector + result[i] = row + return len(basis), result + + +def main(): + authenticate_sources() + edge = runpy.run_path(str(HERE / "sources/bit_native.py")) + word = json.loads(gzip.decompress((HERE / "sources/WORD.json.gz").read_bytes())) + require(edge["digest"](word) == WORD, "canonical binary word") + initial, final, moves, rows, _ = edge["extract"](word) + order = edge["schedule"](initial, final, moves, rows) + columns = edge["basis"](initial, moves, rows, order) + values = {owner: 1 << owner for owner in initial} + for packet in order: + values[packet] = edge["combine"](rows[packet], values) + + arrivals, departures = defaultdict(list), defaultdict(list) + for owner in initial: + arrivals[initial[owner]].append(1 << owner) + departures[final[owner]].append(1 << owner) + for packet, (source, receiver) in moves.items(): + arrivals[receiver].append(values[packet]) + departures[source].append(columns[packet]) + + pairs = improving_pairs(word) + owners = sorted({i for pair in pairs for i in pair}) + expected = json.loads((HERE / "EXPECTED.json").read_bytes()) + packed = json.dumps(pairs, separators=(",", ":")).encode() + require(len(pairs) == expected["pairs"] == 3112, "profitable pair count") + require(hashlib.sha256(packed).hexdigest() == expected["pair_sha256"], "pair identity") + + charts, matches = [], [] + for chart in sorted(map(int, word["frames"])): + read_rank, read = residues(arrivals[chart], owners) + write_rank, write = residues(departures[chart], owners) + accepted = [(i, j) for i, j in pairs if read[i] == read[j] and write[i] == write[j]] + charts.append([chart, read_rank, write_rank, len(accepted)]) + matches.extend([chart, i, j] for i, j in accepted) + require(charts == expected["charts"] and len(charts) == 636, "two quotient ranks at every chart") + require(matches == expected["compatible"] == [], "one-chart necessity") + # Matching only the read side is insufficient. Adding the missing response + # on the write side must turn this small controlled instance into a match. + _, left = residues([3], (0, 1)) + _, unavailable = residues([], (0, 1)) + _, restored = residues([3], (0, 1)) + require(left[0] == left[1] and unavailable[0] != unavailable[1] + and restored[0] == restored[1], "one-sided and restored controls") + print("PASS_PACKET_GRAPH_EXCHANGE_EXCLUSION 3112 pairs, 636 charts, 0 matches") + + +if __name__ == "__main__": + main() diff --git a/research/historical-selected-replay-gap/README.md b/research/historical-selected-replay-gap/README.md index 55d8cc3b49..36d9a873ca 100644 --- a/research/historical-selected-replay-gap/README.md +++ b/research/historical-selected-replay-gap/README.md @@ -69,7 +69,11 @@ python3 -B scripts/research_package.py --package research/historical-selected-re The direct command prints `PASS_HISTORICAL_SELECTED_REPLAY_GAP`. A registered replay prints `PASS_REGISTERED_RESEARCH_PACKAGE`. Both require Git history -containing the two inspected commits. +containing the two inspected commits and the source and manifest objects at +`2485805a6d47f36ea83ddde6327d453ac82d44dc`. The verifier uses a temporary +sparse checkout of that commit, checks the declared source digests there, and +uses its planner and manifest inventory. The recorded rejections and selection +therefore remain reproducible after later changes to the live Makefile or CI guide. ## Open next questions diff --git a/research/historical-selected-replay-gap/SOURCES.json b/research/historical-selected-replay-gap/SOURCES.json index c1010eec95..62bb8b3950 100644 --- a/research/historical-selected-replay-gap/SOURCES.json +++ b/research/historical-selected-replay-gap/SOURCES.json @@ -4,13 +4,13 @@ "files": [ { "path": "Makefile", - "usage": "input", + "usage": "provenance", "git_blob": "0d683a06b9e7ee162496108ce9a7c5d2ee94fccf", "sha256": "4f2d4f2dcd15139ec82658a975f85ed300897385f85799218539f4c8d60567da" }, { "path": "certificates/partial-swap-network.json", - "usage": "input", + "usage": "provenance", "git_blob": "eccafa830c16170c36faf93045ddf1f638f7bcd4", "sha256": "4c0b9d37e1034b2076e30a70f8e514416298c462d9ee98bc87fe6556b14df786" }, @@ -22,7 +22,7 @@ }, { "path": "docs/ci-verification.md", - "usage": "input", + "usage": "provenance", "git_blob": "63ba3e9aa8bdc5e942b56e34244b92b16f854085", "sha256": "c7d3027e9ad8bcbff68f07aa9576b30fb2f3c76c44d876d40c7fdbf4a3e2228a" }, @@ -34,163 +34,163 @@ }, { "path": "research/clifford-state-performance/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "6f98a0061a5104dfab82c9e806f819b41811f684", "sha256": "396d0f08df24952248140d5c65c51b8c902ef1c580892ff7ea182890530f67ee" }, { "path": "research/community-batch1047-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "5e0f92af463ec12c5e1dcc3effd44081a88af647", "sha256": "07a9daeaf2bda308a92e9a4684f13d5fc766c7772d74801fceb7f4599fdab226" }, { "path": "research/community-batch1099-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "9e13266bf85e627f1b7dc225e9530ea69fd2c7f0", "sha256": "421e1211fb1897c45621dc6801c276e53f2e6f335583c9c9049e535f87c0a3b1" }, { "path": "research/community-batch932-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "cc4d03eb59b9ab3f952735f7e88ff18c2d15d7af", "sha256": "184629cac91a5cfaca50330a88596008b824221433867dcf8117539c913c284a" }, { "path": "research/community-batch970-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "8b9f4111badf7de5d97684799560b55110e9da79", "sha256": "23188ed920e38a54006cb883e181585620821c63bf7e8b5e05d32719417cc37e" }, { "path": "research/community-frontier741-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "a5300d4e7a5381a3f443fc54c768ca6f0f236d68", "sha256": "3c820fb30e1b4d9bcfc6a7ab524375e5b2abd66b940af2c509146104f0bcd79c" }, { "path": "research/community-frontier890-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "d7ff6d777b01d69b6ce84caf25d3b7e4a4d2f211", "sha256": "6b185a9902652f893f3ebd8ada92d2f11b6de6533a9a4d11718a8a4496101128" }, { "path": "research/community-hyperplane599-audit/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "546f37d326d10a99910ae8f908e71ef768524d98", "sha256": "65099d764bfcc39bda5e4d9966783611b094c3522dbdd1435cd498d657a8ef8e" }, { "path": "research/community-k492-audit/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "e538481e4cb16ed936d3195f2dfb5b5a9ca0a76b", "sha256": "2c0f4fa5bc150d05658af2e7c54c4d2c337dd52b7efd3d69530ae73bcbdf452a" }, { "path": "research/community-reconciliation92-audit/MANIFEST.json", - "usage": "input", + "usage": "provenance", "git_blob": "2a2e93685173d5f13cbb5abe740f5d90352e0228", "sha256": "5f501f3c118131e7d069f30ad77186eb2ad6961f9680a0ef105f4514ed41808a" }, { "path": "research/partial-swap-digest/baseline.py", - "usage": "input", + "usage": "provenance", "git_blob": "a2f0190704db83bd8ef48e46e723c49b925804fe", "sha256": "81e9af92cdf38243a540cdcff2062778e449467848d444da37a9553c12ca4c34" }, { "path": "research/r420-two-sided-basis/SOURCES.json", - "usage": "input", + "usage": "provenance", "git_blob": "5d718e11e62f4bcadecf1e02d6b61f87dbe190b0", "sha256": "d9810b0d139c5a1211fd2c1f0d142187cc1fca30026e1e7bc4f9ecfacf1596d1" }, { "path": "research/skip-clones/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "8d1bb3b9c8189e35e5d8bfdfa632d7473e8be0d5", "sha256": "0b68e63e35a97ce6b0cdb6e291b88ebaa8f2dd4afb70b2498f10ee89428258dc" }, { "path": "research/split-skip/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "2ab610b6ea2edd2865fda793ef2168b0c76afb4f", "sha256": "7c2b4646a3ecfef6f881da5c43e4bd0fa9a4d1b00548b8ab458d897e16735134" }, { "path": "scripts/historical-ci-inputs/Makefile", - "usage": "input", + "usage": "provenance", "git_blob": "aff68409021c9d401a6f8013b9dfd7dbcc30f2a8", "sha256": "ea8830dd79da493e2d75baf753d733ff7efbcf2b4794afe41fae0ac8f3055646" }, { "path": "scripts/historical-ci-inputs/ledger-batch932-run_isolated_tests.py", - "usage": "input", + "usage": "provenance", "git_blob": "65db599ab0b1dea0312c4ca048e0bd0f44c3736f", "sha256": "96ea543e6c707424afe247e77bd86c82152f90fc76a0773c4232145da5cdf8d1" }, { "path": "scripts/historical-ci-inputs/ledger-batch932-test_isolated_test_runner.py", - "usage": "input", + "usage": "provenance", "git_blob": "34820a8f24678f918f4d0e7a35380d8013fc3495", "sha256": "628391b6abfbc8674ceec1751867a4392f2cc0b5b66886243e139af86cf355ac" }, { "path": "scripts/historical-ci-inputs/ledger-batch970-verify_selected_result.py", - "usage": "input", + "usage": "provenance", "git_blob": "c755b76e0d44ba4917aa94440ebe54daefce5b2a", "sha256": "d7fd929726b326aeeaf0a3996475adec88eee9aac09ae0bebeeaa0bc1fc8f199" }, { "path": "scripts/historical-ci-inputs/ledger-frontier741-ci-verification.md", - "usage": "input", + "usage": "provenance", "git_blob": "7f3c012504187917a728b9fe87043f0fc8cd006a", "sha256": "a854022e0e1d5d4db4d60e586be3ea56005013ef14a1fc06d02bc06e8529c4b0" }, { "path": "scripts/historical-ci-inputs/partial-swap-context.json", - "usage": "input", + "usage": "provenance", "git_blob": "ad65114886bf34a4fd27e79f3be502389e689faa", "sha256": "833a9642f33aeab2ffea17ec9c6b82e0a953f90192b2c82e10bef21538dccba9" }, { "path": "scripts/historical-ci-inputs/partial-swap-network.json", - "usage": "input", + "usage": "provenance", "git_blob": "52075f2463f60af5e16571347f24274fce73a1ea", "sha256": "f3c4be597b2f2136da4ae2cc80c7454f63c90aa01f84e5b8131cee4dd55de815" }, { "path": "scripts/partial_swap/shared.py", - "usage": "input", + "usage": "provenance", "git_blob": "44a0e454c70f9c4b98e258b8443612e6a119904b", "sha256": "5a0646a50b9f3e8ea55168620a78e8853b0ab810517cefc8cfb8696aedee278a" }, { "path": "scripts/replay_historical_check.py", - "usage": "input", + "usage": "provenance", "git_blob": "1e92fff2782970ef71378f594f2350d245a4db26", "sha256": "5467619c78183d3adc82b0cb55af28e5c1a01fca2b0588677816244b53e2bafd" }, { "path": "scripts/research_package.py", - "usage": "input", + "usage": "provenance", "git_blob": "091b4c8f58bac9a9580d76025b887dc5c873d05f", "sha256": "e1256016e7f51827d04fa2179255989f639ae1d97afaa9c16265f85a0c6abd70" }, { "path": "scripts/run_isolated_tests.py", - "usage": "input", + "usage": "provenance", "git_blob": "a96ab35b315ce492e7fbbfd6c5ae211aa066b541", "sha256": "49eb56dd0fc0d8d8ffdb209970a7adf2176223580646f575d5c22e59543b381c" }, { "path": "scripts/verify_selected_result.py", - "usage": "input", + "usage": "provenance", "git_blob": "6882a4700e410dec569b51ae2eaf1a19cc019195", "sha256": "d6b305eac5b9bdb8172c469ad30a1655a60fa0aceac8b1bf610e1b73f51babd8" }, { "path": "tests/test_isolated_test_runner.py", - "usage": "input", + "usage": "provenance", "git_blob": "343b24abf6719b81805eba5a84c74e57634c8288", "sha256": "3a5470d0b139828b90e19bf9583ddeafcd69f8e34f2824664eb3a2958a52e34d" } diff --git a/research/historical-selected-replay-gap/VERIFY.json b/research/historical-selected-replay-gap/VERIFY.json index 98553e72ed..ab7efa3471 100644 --- a/research/historical-selected-replay-gap/VERIFY.json +++ b/research/historical-selected-replay-gap/VERIFY.json @@ -4,36 +4,7 @@ "python": "3.12", "requirements": [], "inputs": [ - "Makefile", - "certificates/partial-swap-network.json", - "docs/ci-verification.md", - "research/clifford-state-performance/SOURCE.json", - "research/community-batch1047-audit/CONTENT-COVERAGE.json", - "research/community-batch1099-audit/CONTENT-COVERAGE.json", - "research/community-batch932-audit/CONTENT-COVERAGE.json", - "research/community-batch970-audit/CONTENT-COVERAGE.json", - "research/community-frontier741-audit/CONTENT-COVERAGE.json", - "research/community-frontier890-audit/CONTENT-COVERAGE.json", - "research/community-hyperplane599-audit/SOURCE.json", - "research/community-k492-audit/SOURCE.json", - "research/community-reconciliation92-audit/MANIFEST.json", - "research/partial-swap-digest/baseline.py", - "research/r420-two-sided-basis/SOURCES.json", - "research/skip-clones/SOURCE.json", - "research/split-skip/SOURCE.json", - "scripts/historical-ci-inputs/Makefile", - "scripts/historical-ci-inputs/ledger-batch932-run_isolated_tests.py", - "scripts/historical-ci-inputs/ledger-batch932-test_isolated_test_runner.py", - "scripts/historical-ci-inputs/ledger-batch970-verify_selected_result.py", - "scripts/historical-ci-inputs/ledger-frontier741-ci-verification.md", - "scripts/historical-ci-inputs/partial-swap-context.json", - "scripts/historical-ci-inputs/partial-swap-network.json", - "scripts/partial_swap/shared.py", - "scripts/replay_historical_check.py", - "scripts/research_package.py", - "scripts/run_isolated_tests.py", - "scripts/verify_selected_result.py", - "tests/test_isolated_test_runner.py" + "scripts/research_package.py" ], "commands": [ { diff --git a/research/historical-selected-replay-gap/verify.py b/research/historical-selected-replay-gap/verify.py index 83b995941a..9d266c5a4e 100644 --- a/research/historical-selected-replay-gap/verify.py +++ b/research/historical-selected-replay-gap/verify.py @@ -6,8 +6,10 @@ """ import hashlib import importlib.util +import json import subprocess import sys +import tempfile from pathlib import Path ROOT = Path(__file__).resolve().parents[2] @@ -61,31 +63,47 @@ def require(ok, message): raise SystemExit(message) -def load_checker(): - path = ROOT / "scripts/replay_historical_check.py" - spec = importlib.util.spec_from_file_location("historical_selected_replay_gap_checker", path) +def load_module(path): + spec = importlib.util.spec_from_file_location(path.stem, path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) return module +def checkout_snapshot(snapshot, sources, runner, env): + paths = [runner.canonical_relative_path(row["path"]) for row in sources["files"]] + git = ["git", "-c", "maintenance.auto=false", "-c", "gc.auto=0", + "-c", "core.autocrlf=false"] + subprocess.run([*git, "clone", "--quiet", "--shared", "--no-tags", "--no-checkout", + "--", str(ROOT), str(snapshot)], cwd=ROOT, env=env, check=True) + subprocess.run([*git, "update-ref", "--no-deref", "HEAD", INSPECTED], + cwd=snapshot, env=env, check=True) + # The pinned planner reads omitted manifests from the sparse HEAD/index. + patterns = "".join(f"/{path.as_posix()}\n" for path in paths) + subprocess.run([*git, "sparse-checkout", "set", "--no-cone", "--stdin"], + cwd=snapshot, env=env, input=patterns.encode("utf-8"), check=True) + subprocess.run([*git, "read-tree", "-mu", "HEAD"], cwd=snapshot, env=env, check=True) + for path, row in zip(paths, sources["files"], strict=True): + require(hashlib.sha256((snapshot / path).read_bytes()).hexdigest() == row["sha256"], + "historical checkout source digest changed: " + path.as_posix()) + + def entries(checker): for name, config in checker.CONFIG.items(): for entry in [config, *config.get("additional_inputs", [])]: yield name, entry -def reject(checker, entry): +def reject(root, checker, entry): try: - checker.authenticated_input(ROOT, entry) + checker.authenticated_input(root, entry) except ValueError as exc: return str(exc) raise SystemExit("historical input was admitted: " + entry["path"]) -def main(): - require(not sys.flags.optimize, "assertions must stay enabled") - checker = load_checker() +def check_snapshot(root, env): + checker = load_module(root / "scripts/replay_historical_check.py") selected = [entry for name, entry in entries(checker) if name == "tooling-ledger" and entry["path"] == SELECTED_PATH] require(len(selected) == 1, "selected-result checker overlay is not unique") @@ -94,7 +112,7 @@ def main(): require(entry["accepted_live_sha256"] == [SELECTED_ACCEPTED], "accepted selected-checker successors changed") frozen = (checker.INPUTS / entry["input"]).read_bytes() - live = (ROOT / SELECTED_PATH).read_bytes() + live = (root / SELECTED_PATH).read_bytes() require(hashlib.sha256(frozen).hexdigest() == SELECTED_PIN, "frozen selected checker bytes changed") require(hashlib.sha256(live).hexdigest() == SELECTED_LIVE, "live selected checker digest changed") require(SELECTED_LIVE not in (SELECTED_PIN, SELECTED_ACCEPTED), "live checker was already admitted") @@ -102,7 +120,7 @@ def main(): # live successor, not a broken comparison. require(SELECTED_PIN in (SELECTED_PIN, *entry["accepted_live_sha256"]), "pin membership control failed") - require(reject(checker, entry) == REJECTIONS[SELECTED_PATH][1], + require(reject(root, checker, entry) == REJECTIONS[SELECTED_PATH][1], "selected checker rejection text changed") counts = {path: 0 for path in REJECTIONS} @@ -110,7 +128,7 @@ def main(): for _name, item in entries(checker): if item["path"] not in REJECTIONS: continue - message = reject(checker, item) + message = reject(root, checker, item) counts[item["path"]] += 1 messages.setdefault(item["path"], message) for path, (count, message) in REJECTIONS.items(): @@ -118,20 +136,31 @@ def main(): require(messages[path] == message, "rejection text changed for " + path) require(sum(counts.values()) == 19, "rejection total changed") ci = [item for _name, item in entries(checker) if item["path"] == CI_PATH] - require(len(ci) == 1 and hashlib.sha256((ROOT / CI_PATH).read_bytes()).hexdigest() == CI_LIVE, + require(len(ci) == 1 and hashlib.sha256((root / CI_PATH).read_bytes()).hexdigest() == CI_LIVE, "selected CI note digest changed") diff = subprocess.check_output( - ["git", "diff", "--name-only", PARENT, INSPECTED], cwd=ROOT, text=True) + ["git", "diff", "--name-only", PARENT, INSPECTED], cwd=root, env=env, text=True) changed = sorted(name for name in diff.splitlines() if name) require(changed == CHANGED, "inspected commit diff changed") - sys.path.insert(0, str(ROOT / "scripts")) - from research_package import plan_details - details = plan_details(ROOT, set(changed)) + planner = load_module(root / "scripts/research_package.py") + details = planner.plan_details(root, set(changed)) require([row["package"] for row in details] == PLAN_PACKAGES, "helper plan selection changed") matched = {name for row in details for names in row["causes"].values() for name in names} require(sorted(set(changed) - matched) == UNMATCHED, "unmatched plan paths changed") - require(plan_details(ROOT, set()) == [], "empty change set selected a package") + require(planner.plan_details(root, set()) == [], "empty change set selected a package") + + +def main(): + require(not sys.flags.optimize, "assertions must stay enabled") + sources = json.loads(Path(__file__).with_name("SOURCES.json").read_bytes()) + require(sources["base_commit"] == INSPECTED, "historical checkout base changed") + runner = load_module(ROOT / "scripts/research_package.py") + env = runner.git_source_env() + with tempfile.TemporaryDirectory(prefix="historical-selected-replay-") as temporary: + snapshot = Path(temporary) / "snapshot" + checkout_snapshot(snapshot, sources, runner, env) + check_snapshot(snapshot, env) print("PASS_HISTORICAL_SELECTED_REPLAY_GAP") print("selected_checker_live=" + SELECTED_LIVE) print("rejections=19 distinct_paths=7 plan_packages=9")