diff --git a/research/p104-nearest-contact-verification/INPUTS.json b/research/p104-nearest-contact-verification/INPUTS.json new file mode 100644 index 0000000000..73f2c98d68 --- /dev/null +++ b/research/p104-nearest-contact-verification/INPUTS.json @@ -0,0 +1,28 @@ +{ + "files": { + "NOMINATION.json": "4b9d8416befd5a82e46cfdcbe90c1460f02286f6682d661d61990b3041de9483", + "source/NOTICE": "e8e0cabef6cf40d63f3cea3b6403dfd1af8727e40df03f09b2932718bcddc1b0", + "source/PROOF.md": "a599f482ec35ddf84b1ddf72da92a6edbb77b9c4eccab6ffe31fdece2419f099", + "source/RESULT.json": "ab036dc5fd6c1b19255d03007a858325a18bb7de12843687db74d85f146f5020", + "source/SOURCES.json": "d87d48095d56bdc26a2f86e05760915b2b341000e53c1f877d6348331f66dded", + "source/WITNESS.json": "0753bc9933fbb954ec79b3d054b4f60bb3ee5c97801f426d4104da5fc5bc38b3", + "source/WORD-CUSTODY.json": "da8001e3fccfdc040aa87ce4562c0883508719c509087a02cdbd79872b282964", + "source/WORD.json.gz": "b56281a67f84832198be2f2ad36d87b75244d424f1e0a6f4dda2df74f20cc08d", + "source/construct.py": "ab9b0e00e67caac137477c0b8e646ba5604d02a7a0a297c4e3fce9e20105812e", + "source/local-grammar.py": "716d01a342467f87b14d67853d8de30740f9f2fa881afe271db0df5ef8b19697" + }, + "git_blobs": { + "source/NOTICE": "fa0bd1401f5775f4351cfa23b08f3998dba6129e", + "source/PROOF.md": "77ef428c1ad8bc20690edecee92d8dd16c28ba52", + "source/RESULT.json": "d5a73ee8eceab0b4ac6850c06bca7152d3d6800e", + "source/SOURCES.json": "5c13f25a07882c22c7e5ede4f1aaa5cfc94928da", + "source/WITNESS.json": "d3554cd80f0d7534c07b76dd64eadfb228c0c8d6", + "source/construct.py": "ff4d7701fc1eaa7e31a9b937ac7f6c732c6634a9", + "source/local-grammar.py": "e72cb02dba9b68d3bd5934371b5d25a44589c482" + }, + "grammar_scope": "Authenticated declared public grammar, not archive-member or full runtime equality. No source module imported.", + "source_result": "source/RESULT.json", + "witness": "source/WITNESS.json", + "word": "source/WORD.json.gz", + "word_custody": "source/WORD-CUSTODY.json" +} diff --git a/research/p104-nearest-contact-verification/LICENSE b/research/p104-nearest-contact-verification/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/p104-nearest-contact-verification/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-nearest-contact-verification/NOMINATION.json b/research/p104-nearest-contact-verification/NOMINATION.json new file mode 100644 index 0000000000..08cfe66f05 --- /dev/null +++ b/research/p104-nearest-contact-verification/NOMINATION.json @@ -0,0 +1,43 @@ +{ + "fixed_anchors": { + "R": { + "instruction": [ + "ADD", + 140, + 438, + "-1/2", + 794 + ] + }, + "Y": { + "instruction": [ + "ADD", + 144, + 438, + "-1/2", + 911 + ] + } + }, + "missing_anchors": { + "P": { + "required_prefix": [ + "ADD", + 144, + 140, + "1" + ] + }, + "Q": { + "required_prefix": [ + "ADD", + 144, + 140, + "-1" + ] + } + }, + "source": { + "head": "af814f6f3c477fdd13b8f04380a33cf32004966b" + } +} diff --git a/research/p104-nearest-contact-verification/NOTICE b/research/p104-nearest-contact-verification/NOTICE new file mode 100644 index 0000000000..1f04855435 --- /dev/null +++ b/research/p104-nearest-contact-verification/NOTICE @@ -0,0 +1,13 @@ +P104 fixed nearest-contact verification. Apache-2.0; see LICENSE. + +Ali Romman's public paid interior bases, block certificates, author-side +verification and released screening work are credited. Full original notices +are preserved verbatim in source/NOTICE and in the vendored source files. +The source-word, private-reuse, controller, native, compiler, precision and +analytic lineage retains all predecessor credit named there. The elementary +compensated-update identity and binary subspace methods are classical. + +Chris R (Clear1nsight)'s bounded qualification, separate static review and +portable verification packaging used substantial OpenAI Codex assistance. +The scientific core is unchanged except for its package-root assignment. +No source module is imported; no new construction or kappa is claimed. diff --git a/research/p104-nearest-contact-verification/PORTABLE.json b/research/p104-nearest-contact-verification/PORTABLE.json new file mode 100644 index 0000000000..50a1321ee5 --- /dev/null +++ b/research/p104-nearest-contact-verification/PORTABLE.json @@ -0,0 +1,129 @@ +{ + "core_adaptation": "Exactly ROOT=HERE.parents[2] becomes ROOT=HERE. All scientific logic unchanged.", + "inventory_scope": "All package payloads except this inventory and verifier, avoiding self-reference. Those are bound by root publication request and committed-byte checks.", + "original_checker_sha256": "2c747e340f4818a1064608323a877d693b5885bd58a1774e9b82315033649525", + "original_result_sha256": "18dac3a5092667ab5f5118ed6e953d65d558a8d11066e95cc728a069ec01f50f", + "payloads": { + "INPUTS.json": { + "bytes": 1764, + "sha256": "d0a54e640750d418b3be43f19128886e99678372a3c6fb26fe5379de426ae379" + }, + "LICENSE": { + "bytes": 11357, + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + "NOMINATION.json": { + "bytes": 578, + "sha256": "4b9d8416befd5a82e46cfdcbe90c1460f02286f6682d661d61990b3041de9483" + }, + "NOTICE": { + "bytes": 808, + "sha256": "5e45c5dc13a50fba74266169d9a4b5fa5d1fd95d44a4e3ed29b039bcd7cb4c9c" + }, + "PROOF.md": { + "bytes": 2725, + "sha256": "c5f2f8d3d5b2ccd59b1694c8eb604f14f861d472217928945ca3099fa71db038" + }, + "README.md": { + "bytes": 7037, + "sha256": "c08fcf008a16fc9d2b69cb80de772184de99b08dbb5ea984cec7fa78d5709b39" + }, + "SOURCES.json": { + "bytes": 5228, + "sha256": "2af14419c467a50054a4876a33509c3b83925d5680f5d143b2360be8ddcd2c48" + }, + "TASK.json": { + "bytes": 4888, + "sha256": "f2bc4526829cc31491ba61df0bac7815d60fa3a4e42922ffbbdbab571426b419" + }, + "VERIFY.json": { + "bytes": 1081, + "sha256": "5410b0faf5219ae8aed6c0d3f569493b97f588af1b97b2a2bb6e92b86c71c0d3" + }, + "check.py": { + "bytes": 20751, + "sha256": "1218dac4b1ab3fa5d9b143b68a7398cfd2960377df3330744198e626933bf6cb" + }, + "evidence/CORE-ADAPTATION.diff": { + "bytes": 327, + "sha256": "52e4e4dab3e4bd9d8fc95a395f52cb22ae1ba2b19882b3036a082b7adda1ddf1" + }, + "evidence/ORIGINAL-EXECUTION.json": { + "bytes": 1843, + "sha256": "0c0391411d859bc23ab6cfa8d58b31c9edbb9929d6fbe0c0bd4cf624d3b0bf10" + }, + "evidence/ORIGINAL-REQUEST.json": { + "bytes": 1951, + "sha256": "42538882b3ece2d350bc37dbf1d94c95b88ab02a278ca050dced007ab75213cf" + }, + "evidence/POST-REVIEW.json": { + "bytes": 2693, + "sha256": "57fc8e72c5e2fbb27c07bdca1446f23c7aa2e234ed00671413765efde56f74f3" + }, + "evidence/PUBLICATION-CONTEXT.json": { + "bytes": 1341, + "sha256": "efa718513b94666662dc120861ab02e025607a970fc174b6240418ecd4435e38" + }, + "evidence/RESULT-normal.json": { + "bytes": 3233, + "sha256": "18dac3a5092667ab5f5118ed6e953d65d558a8d11066e95cc728a069ec01f50f" + }, + "evidence/RESULT-optimized.json": { + "bytes": 3233, + "sha256": "18dac3a5092667ab5f5118ed6e953d65d558a8d11066e95cc728a069ec01f50f" + }, + "evidence/STATIC-REVIEW.json": { + "bytes": 914, + "sha256": "4ea712eadaa501778c1ae5cbce240e04340e23227f583935ebf9198b1d2752d1" + }, + "evidence/original-check.py": { + "bytes": 20762, + "sha256": "2c747e340f4818a1064608323a877d693b5885bd58a1774e9b82315033649525" + }, + "source/NOTICE": { + "bytes": 2179, + "git_blob": "fa0bd1401f5775f4351cfa23b08f3998dba6129e", + "sha256": "e8e0cabef6cf40d63f3cea3b6403dfd1af8727e40df03f09b2932718bcddc1b0" + }, + "source/PROOF.md": { + "bytes": 5043, + "git_blob": "77ef428c1ad8bc20690edecee92d8dd16c28ba52", + "sha256": "a599f482ec35ddf84b1ddf72da92a6edbb77b9c4eccab6ffe31fdece2419f099" + }, + "source/RESULT.json": { + "bytes": 14703, + "git_blob": "d5a73ee8eceab0b4ac6850c06bca7152d3d6800e", + "sha256": "ab036dc5fd6c1b19255d03007a858325a18bb7de12843687db74d85f146f5020" + }, + "source/SOURCES.json": { + "bytes": 2028, + "git_blob": "5c13f25a07882c22c7e5ede4f1aaa5cfc94928da", + "sha256": "d87d48095d56bdc26a2f86e05760915b2b341000e53c1f877d6348331f66dded" + }, + "source/WITNESS.json": { + "bytes": 7815, + "git_blob": "d3554cd80f0d7534c07b76dd64eadfb228c0c8d6", + "sha256": "0753bc9933fbb954ec79b3d054b4f60bb3ee5c97801f426d4104da5fc5bc38b3" + }, + "source/WORD-CUSTODY.json": { + "bytes": 214, + "sha256": "da8001e3fccfdc040aa87ce4562c0883508719c509087a02cdbd79872b282964" + }, + "source/WORD.json.gz": { + "bytes": 120135, + "git_blob": "8be2b3e1c2d02034d4579bef5d36df7761d826ff", + "sha256": "b56281a67f84832198be2f2ad36d87b75244d424f1e0a6f4dda2df74f20cc08d" + }, + "source/construct.py": { + "bytes": 5439, + "git_blob": "ff4d7701fc1eaa7e31a9b937ac7f6c732c6634a9", + "sha256": "ab9b0e00e67caac137477c0b8e646ba5604d02a7a0a297c4e3fce9e20105812e" + }, + "source/local-grammar.py": { + "bytes": 9392, + "git_blob": "e72cb02dba9b68d3bd5934371b5d25a44589c482", + "sha256": "716d01a342467f87b14d67853d8de30740f9f2fa881afe271db0df5ef8b19697" + } + }, + "schema": "pr5678-nearest-public-payloads/v1" +} diff --git a/research/p104-nearest-contact-verification/PROOF.md b/research/p104-nearest-contact-verification/PROOF.md new file mode 100644 index 0000000000..8950c5edcd --- /dev/null +++ b/research/p104-nearest-contact-verification/PROOF.md @@ -0,0 +1,27 @@ +# The fixed nearest-contact predicate fails + +The public basis construction in Ali Romman's [PR #5678](https://github.com/CrocSwap/integer-mult-bounds/pull/5678), head `af814f6f3c477fdd13b8f04380a33cf32004966b`, supplies the certified scalar anchors + +$$R:\;140\mathrel{+}=-\tfrac12\,438\quad\text{at frame }794,$$ +$$Y:\;144\mathrel{+}=-\tfrac12\,438\quad\text{at frame }911.$$ + +One fixed proposed prerequisite asked whether the two immediately preceding complete semantic contacts of 144 before Y were exactly + +$$P:\;144\mathrel{+}=140,\qquad Q:\;144\mathrel{+}=-140,$$ + +with $P=n,'Public lifetime operation is unsupported/source failure');frame(e[2]) + else: + frame(e[-1]);need(isinstance(e[-2],str) and len(e[-2])<=128,'Bounded exact scalar coefficient') + q=Q(e[-2]);need(q and q.numerator.bit_length()<=256 and q.denominator.bit_length()<=256 and + q.denominator&(q.denominator-1)==0 and abs(q)+1<2**16,'Bounded nonzero dyadic scalar') + if op=='SCALE':need(abs(q.numerator)&(abs(q.numerator)-1)==0,'Dyadic unit SCALE') + else: + need(isint(e[2]) and 0<=e[2]=n,'Public COPY is not the declared grammar') + + +def validate(word,receipt): + need(isinstance(word,dict) and word.get('schema')=='p104-paid-interior-bases/1','Exact emitted source schema') + n,owned=word.get('public'),word.get('owned_fields') + need(n==743 and isint(n) and owned==9 and isint(owned),'Retained public/owned counts') + frames=word.get('frames');need(isinstance(frames,list) and 912<=len(frames)<=4096,'Bounded frame table') + need(all(isinstance(b,list) and len(b)<=9 for b in frames),'Nine-axis frame cap') + spaces=[reduced_basis(b) for b in frames] + need([len(spaces[f]) for f in (794,911,127)]==[6,7,9] and strict(spaces[794],spaces[911]) and strict(spaces[911],spaces[127]),'Published high-pair ordered strict frame chain') + for name in ('initial','final'): + need(isinstance(word.get(name),list) and len(word[name])==n and all(isint(f) and 0<=f=n or (op in ('ADD','COPY') and e[2]>=n):protected.append(e) + if op=='MOVE': + need(current[r]==e[2] and e[4] is (r>=n),'Exact MOVE source/ownership chronology') + need(strict(spaces[e[3]],spaces[e[2]]) if r>=n else strict(spaces[e[2]],spaces[e[3]]),'Typed old MOVE nesting') + current[r]=e[3];continue + semantic.append({'event':i,'instruction':e}) + if op=='INIT': + need(current[r] is None,'Fresh owned lifetime');current[r]=e[2];zero[r-n]=True;life+=1 + peak=max(peak,sum(f is not None for f in current[n:])) + elif op=='CLEAR': + need(current[r]==e[2] and zero[r-n] is not None,'Active owned CLEAR chart');current[r]=None;zero[r-n]=None + else: + need(all(current[a]==e[-1] for a in roles(e)),'Every scalar operand has its declared actual common chart') + if op=='COPY': + need(zero[r-n] is True,'COPY destination proven zero by conservative lifetime bookkeeping') + zero[r-n]=zero[e[2]-n] if e[2]>=n else False + elif op=='ADD' and r>=n: + if e[2]=n,'Public lifetime operation is unsupported/source failure');frame(e[2]) + else: + frame(e[-1]);need(isinstance(e[-2],str) and len(e[-2])<=128,'Bounded exact scalar coefficient') + q=Q(e[-2]);need(q and q.numerator.bit_length()<=256 and q.denominator.bit_length()<=256 and + q.denominator&(q.denominator-1)==0 and abs(q)+1<2**16,'Bounded nonzero dyadic scalar') + if op=='SCALE':need(abs(q.numerator)&(abs(q.numerator)-1)==0,'Dyadic unit SCALE') + else: + need(isint(e[2]) and 0<=e[2]=n,'Public COPY is not the declared grammar') + + +def validate(word,receipt): + need(isinstance(word,dict) and word.get('schema')=='p104-paid-interior-bases/1','Exact emitted source schema') + n,owned=word.get('public'),word.get('owned_fields') + need(n==743 and isint(n) and owned==9 and isint(owned),'Retained public/owned counts') + frames=word.get('frames');need(isinstance(frames,list) and 912<=len(frames)<=4096,'Bounded frame table') + need(all(isinstance(b,list) and len(b)<=9 for b in frames),'Nine-axis frame cap') + spaces=[reduced_basis(b) for b in frames] + need([len(spaces[f]) for f in (794,911,127)]==[6,7,9] and strict(spaces[794],spaces[911]) and strict(spaces[911],spaces[127]),'Published high-pair ordered strict frame chain') + for name in ('initial','final'): + need(isinstance(word.get(name),list) and len(word[name])==n and all(isint(f) and 0<=f=n or (op in ('ADD','COPY') and e[2]>=n):protected.append(e) + if op=='MOVE': + need(current[r]==e[2] and e[4] is (r>=n),'Exact MOVE source/ownership chronology') + need(strict(spaces[e[3]],spaces[e[2]]) if r>=n else strict(spaces[e[2]],spaces[e[3]]),'Typed old MOVE nesting') + current[r]=e[3];continue + semantic.append({'event':i,'instruction':e}) + if op=='INIT': + need(current[r] is None,'Fresh owned lifetime');current[r]=e[2];zero[r-n]=True;life+=1 + peak=max(peak,sum(f is not None for f in current[n:])) + elif op=='CLEAR': + need(current[r]==e[2] and zero[r-n] is not None,'Active owned CLEAR chart');current[r]=None;zero[r-n]=None + else: + need(all(current[a]==e[-1] for a in roles(e)),'Every scalar operand has its declared actual common chart') + if op=='COPY': + need(zero[r-n] is True,'COPY destination proven zero by conservative lifetime bookkeeping') + zero[r-n]=zero[e[2]-n] if e[2]>=n else False + elif op=='ADD' and r>=n: + if e[2]3^t` and `2>2^t`. Thus the complete signed +moment increases by `18 * (7 - 2*2^t - 3^t) > 0` throughout that interval. +The new bill has 66,402 paid calls and rank surplus 760. The local paid rank +mass remains 5,986; the helper rank mass remains 4,266. Their difference is +the 1,664 main progress plus 56 owned descent debt. + +Two rational interval engines verify the full moment and put its unique +raw crossing in `(0.00310815850980, 0.00310815850981)`. The claim is +`0.00310815849`, and the tested saving is `0.003108158495`. + +All scalar changes are priced. The local scalar allowance is 220,290 and +the route allowance is 5,167,000. The retained complete raw ordinary bound +is 184,647,552, below its 1,000,000,000 budget. The power-1024 compiler, +cutoff 17, floor 18, tail parameter 1/5, reserve 10^-12 and decay 39/40 are +unchanged. All 54 strict and four functional outer conditions pass. + +## 5. Verification limits + +The full source archive is authenticated before any retained module is +loaded. The nested predecessor archive is authenticated again before its +local or native checker is loaded. The new checker verifies the source +word and every intermediate complete word. Its separate dense transpose +engine checks 565,504 entries. + +False basis signs, false block coefficients, a missing block certificate, +a missing native transport, a missing owned erasure, an unpaid query and +extra target credit are rejected. The inherited phase, caller and price +controls also run. + +The huge uniform word and rounded multiplier are algorithm-defined and +are not materialized. These are author checks, not independent scientific +acceptance or a proof-kernel theorem. The numerical improvement is small. +No large gain or global optimum is established. diff --git a/research/p104-nearest-contact-verification/source/RESULT.json b/research/p104-nearest-contact-verification/source/RESULT.json new file mode 100644 index 0000000000..d5a73ee8ec --- /dev/null +++ b/research/p104-nearest-contact-verification/source/RESULT.json @@ -0,0 +1,481 @@ +{ + "authenticated_nested_files": 36, + "authenticated_outer_files": 23, + "complete_cost": { + "compiler": { + "H": 80511200000000000, + "N": "2^80511200000000000", + "eta": { + "lower": "0.000000131687557081252595606387", + "upper": "0.000000131687557081252595606388" + }, + "gap": "1/1400000000000", + "integer_test_exponent": 57508, + "logarithm_power": 1024, + "theta": "63/64", + "uniform_saving": "1087855473/350000000000", + "word_materialized": false + }, + "full_forward_calls": 18, + "gain": "34879/25000000000", + "kappa": "310815849/100000000000", + "kappa_decimal": ".00310815849", + "margin_at_previous": { + "lower": "0.338879531362370820661965404439", + "upper": "0.338879531362370820661965404440" + }, + "negative_controls": { + "old_BIT": "Rejected by outer inequalities", + "old_cutoff": "Rejected by completion-tail ratio greater than one" + }, + "nonrecursive": { + "fixed_scalar_growth_bound": "At most 2^(16*26000) before native factors; a declared constant, not an attained norm.", + "local_paid_rank_mass": 5986, + "local_routes": 5167000, + "local_scalar": 220290, + "peak_owned_fields": 2, + "raw_budget": 1000000000, + "raw_scalar_upper": 184647552, + "tensor_native_growth_bound": "Each rank-r Gaussian has row l1 norm at most 2^(rf); use local_paid_rank_mass for the whole word." + }, + "ordinary_BIT": { + "admitted": "17/5000", + "after_cover": "69/20000", + "atom": "1/250", + "before_cover": "3459/1000000", + "ordinary_saving": "8590884599/2500000000000", + "prime_rule": "odd q > 2^26*N^5 avoiding all fixed denominators and rank witnesses" + }, + "outer": { + "functional_checks": { + "actual_new_BIT_stock_sublinear": "348599999999253/350000000000000", + "fixed_halo_explicit_metadata_branch": "26950000000001/350000000000", + "new_BIT_row_stock_sublinear_in_active_group": "1395799999997009/1400000000000000", + "new_semantic_group_guard": "3/1400000000000" + }, + "margins": { + "boundary_algebraic_matrix": "6091990645995648578111/1960000000000000000000000", + "fused_gaussian": "6091990645986945734333/1960000000000000000000000", + "global_coordinate_router": "435142189/140000000000", + "group_bit_router": "609199064738694573433/196000000000000000000000", + "group_scans": "699999999999/700000000000", + "main_transform": "6091990644595648578111/1960000000000000000000000", + "microbox_face_corrections": "26950000000001/350000000000", + "polynomial_products": "1399999999999/1400000000000", + "sparse_union_movement": "802341990645995648578111/1960000000000000000000000" + }, + "parameters": { + "a": "435142189/140000000000", + "b": "4351421891/1400000000000", + "beta": "1399999999997/1400000000000", + "bit_saving": "17/5000", + "cap_xi": "1782341990644595648578111/1960000000000000000000000", + "complex_uniform_saving": "1087855473/350000000000", + "d": "1/1400000000000", + "epsilon": "1399999999999/1400000000000", + "kappa": "310815849/100000000000", + "lambda_": "398756736603/400000000000", + "lambda_prime": "1395648578111/1400000000000", + "layout": "1/1400000000000", + "q": "4351421889/1400000000000", + "r0": "1/14000000000000", + "stop": "1/1400000000000", + "tested_saving": "621631699/200000000000" + }, + "strict_checks": { + "actual_bit_above_effective": "40857811/140000000000", + "actual_logarithmic_gamma_guard": "1/1400000000000", + "actual_logarithmic_group_guard": "177658009357504351421889/980000000000000000000000", + "alpha_logarithm_absorption": "1/14000000000000", + "boundary_algebraic_matrix_above_kappa": "5595648578111/1960000000000000000000000", + "cap_above_band": "802341990644595648578111/1960000000000000000000000", + "cap_below_cell": "177658009354004351421889/1960000000000000000000000", + "cap_below_phase_cell_power": "2137658009355404351421889/1960000000000000000000000", + "complex_above_effective": "1/1400000000000", + "complex_below_one_over_32": "39398578109/1400000000000", + "complex_endpoint": "1/700000000000", + "epsilon_below_one": "1/1400000000000", + "epsilon_positive": "1399999999999/1400000000000", + "fine_prime_halo_umbrella": "7/2", + "fused_gaussian_above_kappa": "5586945734333/1960000000000000000000000", + "gaussian_above_main": "695648578111/980000000000000000000000", + "global_coordinate_router_above_kappa": "1/350000000000", + "global_gamma_power_slack": "9/14000000000000", + "group_below_dimension": "1/700000000000", + "group_bit_router_above_kappa": "698694573433/196000000000000000000000", + "group_gauge_power_slack": "177658009357434351421889/980000000000000000000000", + "group_key_fits_record": "1/700000000000", + "group_positive": "1399999999997/1400000000000", + "group_scans_above_kappa": "21807009033/21875000000", + "halo_covers_generic_inverse_radius": "5", + "improvement_over_user_baseline": "688594035400418148631/500000000000000000000000", + "lambda_above_internal": "1/2800000000000", + "lambda_above_sigma": "3/2800000000000", + "lambda_above_tau": "1/2800000000000", + "lambda_prime_above_lambda": "1/2800000000000", + "lambda_prime_above_leaf": "2795648578109/1960000000000000000000000", + "leaf_saving_above_effective": "1395648578109/1960000000000000000000000", + "main_transform_above_kappa": "4195648578111/1960000000000000000000000", + "membership_arithmetic_fits_record": "1/1400000000000", + "microbox_face_corrections_above_kappa": "53897824289059/700000000000", + "microbox_halo_volume": "110600000000003/1400000000000", + "new_complex_uniform_saving_above_b": "1/1400000000000", + "new_semantic_guard_with_C1_one": "1/1400000000000", + "polynomial_products_above_kappa": "1395648578113/1400000000000", + "positive_layout_slack": "1/1400000000000", + "q_below_effective": "1/1400000000000", + "q_below_internal": "1/1400000000000", + "q_below_leaf": "2795648578109/1960000000000000000000000", + "q_positive": "4351421889/1400000000000", + "short_record_fallback": "1395648578109/1400000000000", + "source_axis_superpolynomial": "1/1400000000000", + "sparse_union_movement_above_kappa": "796250000005595648578111/1960000000000000000000000", + "stop_below_one": "1399999999999/1400000000000", + "stop_positive": "1/1400000000000", + "strassen_integer_power_gap": "1951441519231", + "support_router_span": "3/1400000000000", + "theta_positive_polynomial_power": "2", + "union_header_fits_record": "3/1400000000000", + "union_tag_work_per_visit_fits_record": "3/1400000000000" + } + }, + "paid": { + "1": 40944, + "16": 416, + "2": 8280, + "24": 416, + "3": 8892, + "32": 416, + "4": 1638, + "40": 416, + "48": 416, + "5": 2862, + "56": 416, + "6": 396, + "64": 416, + "7": 270, + "72": 208 + }, + "paid_calls": 66402, + "previous_open_pr5660": "310676333/100000000000", + "productive_fields": 12958, + "query_shears": 15, + "rank_mass_surplus": 760, + "raw_ceiling": { + "derivative_upper": "-739773215192878821828754385468986974565929261970286747281917233/3138550867693340381917894711603833208051177722232017256448", + "interval": [ + "0", + "17/5000" + ] + }, + "raw_headroom": [ + "99/5000000000000", + "1981/100000000000000" + ], + "raw_root_interval": [ + "15540792549/5000000000000", + "310815850981/100000000000000" + ], + "relative_gain_percent": "13951600/310676333", + "strictification": { + "alpha": { + "lower": "0.999999999984953241363199004691", + "upper": "0.999999999984953241363199004692" + }, + "cutoff": 17, + "delta": { + "lower": "0.967532018342092943007295114144", + "upper": "0.967532018342092943007295114145" + }, + "floor": 18, + "gamma": { + "lower": "0.968220587948865237654067176469", + "upper": "0.968220587948865237654067176470" + }, + "normalized_paid_upper": "1048576000976562501/1048576001073741824", + "power": 1024, + "reserve": "1/1000000000000", + "tail_block": 128, + "tail_decay": "39/40", + "tail_offset": "1/5", + "tested": "621631699/200000000000" + }, + "targets": { + "1": 36, + "145": 208, + "17": 416, + "2": 72, + "25": 416, + "33": 416, + "4": 1638, + "41": 416, + "49": 416, + "5": 108, + "57": 416, + "65": 416, + "7": 90, + "73": 208, + "8": 288, + "9": 7398 + }, + "whole_idle_jobs": 3120 + }, + "limits": [ + "The five inherited assumptions and helper endpoint contract remain.", + "The huge uniform word and complete rounded multiplier are not materialized.", + "Author checks do not establish independent scientific acceptance.", + "This gain is small. The requested large gain and a global optimum remain unproved." + ], + "local": { + "endpoint_coefficients": 565504, + "helpers": { + "1": 2, + "2": 4, + "4": 91, + "5": 6, + "7": 5, + "8": 16, + "9": 411 + }, + "owned_fields": 9, + "owned_lifetimes": 11, + "paid": { + "1": 2188, + "2": 460, + "3": 494, + "4": 91, + "5": 159, + "6": 22, + "7": 15 + }, + "paid_rank_mass": 5986, + "peak_owned_fields": 2, + "public_inputs": 743, + "real_scalar_allowance": 220290 + }, + "local_helper_delta": {}, + "local_paid_delta": { + "1": -7, + "2": 2, + "3": 1 + }, + "native": { + "distinct_maps": 2918, + "helper_normalizers": 1070, + "helpers": { + "1": 2, + "2": 4, + "4": 91, + "5": 6, + "7": 5, + "8": 16, + "9": 411 + }, + "main_adapters": 208, + "proof": "Every signed Pauli image and exact global phase; frame induction at every positive tensor width", + "recipe_payload_sha256": "b49a78ea62c2a3bae7f5d2d0ae02900ce52bb17870d488d7959dcc4b4f867915", + "wrong_phase_rejected": true + }, + "negative_controls": { + "extra_target": "Every productive helper has a native target", + "missing_central_translation": "Rejected by the complete Laurent endpoint", + "missing_conjugated_block": "Every affected block has a certificate", + "missing_native_transport": "Scalar destination and coefficient", + "missing_owned_erasure": "All public and owned exits", + "unpaid_query": "Complete field and call counts", + "wrong_basis_sign": "Exact conjugation of the complete scalar block", + "wrong_scalar_block": "Exact conjugation of the complete scalar block" + }, + "physical_caller": { + "central_square_columns": 53248, + "full_calls": 18, + "main_targets": { + "145": 208, + "17": 416, + "25": 416, + "33": 416, + "41": 416, + "49": 416, + "57": 416, + "65": 416, + "73": 208 + }, + "new_paid_jobs": 0, + "physical_contacts": 7488, + "ports": 104, + "route_payload_sha256": "7f4f0ca768ffbc4f93dcff575592c4c67411f46b4289e45b73f715a2ad47b142", + "tensor_rule": "Factorwise native maps; scalar signs stay outside the tensor power.", + "whole_idle_jobs": { + "16": 416, + "24": 416, + "32": 416, + "40": 416, + "48": 416, + "56": 416, + "64": 416, + "72": 208 + }, + "wrapper_sites": [ + 1, + 3, + 5, + 7, + 9, + 11, + 13, + 15, + 17, + 19, + 21, + 23, + 25, + 27, + 29, + 31 + ] + }, + "separate_columns": { + "arithmetic": "Dense integer rows with binary denominators; reverse chronology", + "coefficients": 565504, + "columns": 752 + }, + "source_commit": "3b0b4f37d5005f381ed9cfcccebfbe1ab35c71aa", + "source_local": { + "endpoint_coefficients": 565504, + "helpers": { + "1": 2, + "2": 4, + "4": 91, + "5": 6, + "7": 5, + "8": 16, + "9": 411 + }, + "owned_fields": 9, + "owned_lifetimes": 11, + "paid": { + "1": 2195, + "2": 458, + "3": 493, + "4": 91, + "5": 159, + "6": 22, + "7": 15 + }, + "paid_rank_mass": 5986, + "peak_owned_fields": 2, + "public_inputs": 743, + "real_scalar_allowance": 220220 + }, + "status": "PASS_P104_PAID_INTERIOR_BASES_KAPPA_00310815849", + "steps": [ + { + "endpoint_coefficients": 565504, + "helpers": { + "1": 2, + "2": 4, + "4": 91, + "5": 6, + "7": 5, + "8": 16, + "9": 411 + }, + "owned_fields": 9, + "owned_lifetimes": 11, + "paid": { + "1": 2194, + "2": 457, + "3": 494, + "4": 91, + "5": 159, + "6": 22, + "7": 15 + }, + "paid_rank_mass": 5986, + "peak_owned_fields": 2, + "public_inputs": 743, + "real_scalar_allowance": 220224 + }, + { + "endpoint_coefficients": 565504, + "helpers": { + "1": 2, + "2": 4, + "4": 91, + "5": 6, + "7": 5, + "8": 16, + "9": 411 + }, + "owned_fields": 9, + "owned_lifetimes": 11, + "paid": { + "1": 2192, + "2": 458, + "3": 494, + "4": 91, + "5": 159, + "6": 22, + "7": 15 + }, + "paid_rank_mass": 5986, + "peak_owned_fields": 2, + "public_inputs": 743, + "real_scalar_allowance": 220246 + }, + { + "endpoint_coefficients": 565504, + "helpers": { + "1": 2, + "2": 4, + "4": 91, + "5": 6, + "7": 5, + "8": 16, + "9": 411 + }, + "owned_fields": 9, + "owned_lifetimes": 11, + "paid": { + "1": 2190, + "2": 459, + "3": 494, + "4": 91, + "5": 159, + "6": 22, + "7": 15 + }, + "paid_rank_mass": 5986, + "peak_owned_fields": 2, + "public_inputs": 743, + "real_scalar_allowance": 220268 + }, + { + "endpoint_coefficients": 565504, + "helpers": { + "1": 2, + "2": 4, + "4": 91, + "5": 6, + "7": 5, + "8": 16, + "9": 411 + }, + "owned_fields": 9, + "owned_lifetimes": 11, + "paid": { + "1": 2188, + "2": 460, + "3": 494, + "4": 91, + "5": 159, + "6": 22, + "7": 15 + }, + "paid_rank_mass": 5986, + "peak_owned_fields": 2, + "public_inputs": 743, + "real_scalar_allowance": 220290 + } + ] +} diff --git a/research/p104-nearest-contact-verification/source/SOURCES.json b/research/p104-nearest-contact-verification/source/SOURCES.json new file mode 100644 index 0000000000..5c13f25a07 --- /dev/null +++ b/research/p104-nearest-contact-verification/source/SOURCES.json @@ -0,0 +1,43 @@ +{ + "schema_version": 1, + "base_commit": "df0137efd35e11b4445734bf612bdd4c7ebc330c", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "581f8d87008354eb5b869f7ed9de1317ad837ce8", + "sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "f126dd2e2dad2b669e75d1d0d0bd05c600725602", + "sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72" + }, + { + "path": "research/p104-paid-interior-bases/inputs/pr5660-source.tar", + "usage": "input", + "pin": "head:89c7e069d6b93b7802f946d01886d92970303f86:research/p104-paid-interior-bases/inputs/pr5660-source.tar", + "git_blob": "5b84cf23231082376660b7295744b64655039d8c", + "sha256": "397b1f99061f670ed904198d0458808769c0a8693394bee0d9648f1f280d88d3" + } + ], + "source_export": { + "commit": "3b0b4f37d5005f381ed9cfcccebfbe1ab35c71aa", + "files": 23, + "git_blob": "5b84cf23231082376660b7295744b64655039d8c", + "sha256": "397b1f99061f670ed904198d0458808769c0a8693394bee0d9648f1f280d88d3", + "local_path": "inputs/pr5660-source.tar", + "package": "research/p104-contact-rewrite", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5660" + }, + "predecessors": { + "PR5627": "ed4dc88a09a7d201971f6603b8c2074e95dd9c32", + "PR5643": "a3ff5c628bfc8825553d62d913f3e91f75d6825f", + "PR5644": "c5871955d89bf73506fd68b0a5bf1cf2b3153c02", + "PR5650": "7916490124ac946704339a6a332bb76f06e5db5c", + "PR5651": "853192167b27d44aea0d4bc2b0d52d695fadc7c6", + "PR5660": "3b0b4f37d5005f381ed9cfcccebfbe1ab35c71aa" + }, + "attribution": "PR5660 supplies the complete input word and retains the P104, helper, scalar, native, caller and compiler source chain. Four paid interior basis changes and their exact certificates are new work by Ali Romman with substantial OpenAI Codex assistance. No subagents." +} diff --git a/research/p104-nearest-contact-verification/source/WITNESS.json b/research/p104-nearest-contact-verification/source/WITNESS.json new file mode 100644 index 0000000000..d3554cd80f --- /dev/null +++ b/research/p104-nearest-contact-verification/source/WITNESS.json @@ -0,0 +1,501 @@ +[ + { + "a": 438, + "b": 733, + "coefficient": "-4", + "start_block": 1090, + "end_block": 1314, + "entry_frame": 794, + "exit_frame": 127, + "blocks": [ + { + "index": 1090, + "before": [ + [ + "ADD", + 140, + 733, + "2", + 794 + ], + [ + "ADD", + 140, + 438, + "-1/2", + 794 + ] + ], + "after": [ + [ + "ADD", + 140, + 438, + "-1/2", + 794 + ] + ] + }, + { + "index": 1313, + "before": [ + [ + "ADD", + 160, + 451, + "-1/2", + 911 + ], + [ + "ADD", + 144, + 733, + "2", + 911 + ], + [ + "ADD", + 144, + 438, + "-1/2", + 911 + ] + ], + "after": [ + [ + "ADD", + 160, + 451, + "-1/2", + 911 + ], + [ + "ADD", + 144, + 438, + "-1/2", + 911 + ] + ] + } + ] + }, + { + "a": 119, + "b": 125, + "coefficient": "-1", + "start_block": 703, + "end_block": 705, + "entry_frame": 3, + "exit_frame": 602, + "blocks": [ + { + "index": 703, + "before": [ + [ + "ADD", + 119, + 706, + "2", + 594 + ], + [ + "ADD", + 125, + 706, + "2", + 594 + ], + [ + "ADD", + 128, + 706, + "2", + 594 + ], + [ + "ADD", + 139, + 706, + "2", + 594 + ], + [ + "ADD", + 213, + 706, + "2", + 594 + ] + ], + "after": [ + [ + "ADD", + 213, + 706, + "2", + 594 + ], + [ + "ADD", + 139, + 706, + "2", + 594 + ], + [ + "ADD", + 128, + 706, + "2", + 594 + ], + [ + "ADD", + 125, + 706, + "2", + 594 + ] + ] + }, + { + "index": 704, + "before": [ + [ + "ADD", + 119, + 708, + "-2", + 602 + ], + [ + "ADD", + 125, + 708, + "2", + 602 + ], + [ + "ADD", + 127, + 708, + "2", + 602 + ], + [ + "ADD", + 128, + 708, + "-2", + 602 + ], + [ + "ADD", + 139, + 708, + "2", + 602 + ], + [ + "ADD", + 154, + 708, + "-2", + 602 + ] + ], + "after": [ + [ + "ADD", + 119, + 125, + "1", + 602 + ], + [ + "ADD", + 119, + 708, + "-2", + 602 + ], + [ + "ADD", + 125, + 708, + "2", + 602 + ], + [ + "ADD", + 127, + 708, + "2", + 602 + ], + [ + "ADD", + 128, + 708, + "-2", + 602 + ], + [ + "ADD", + 139, + 708, + "2", + 602 + ], + [ + "ADD", + 154, + 708, + "-2", + 602 + ], + [ + "ADD", + 119, + 125, + "-1", + 602 + ] + ] + } + ] + }, + { + "a": 125, + "b": 128, + "coefficient": "-1", + "start_block": 703, + "end_block": 705, + "entry_frame": 3, + "exit_frame": 602, + "blocks": [ + { + "index": 703, + "before": [ + [ + "ADD", + 119, + 125, + "-1", + 3 + ] + ], + "after": [ + [ + "ADD", + 125, + 128, + "1", + 3 + ], + [ + "ADD", + 119, + 125, + "-1", + 3 + ], + [ + "ADD", + 125, + 128, + "-1", + 3 + ] + ] + }, + { + "index": 704, + "before": [ + [ + "ADD", + 213, + 706, + "2", + 594 + ], + [ + "ADD", + 139, + 706, + "2", + 594 + ], + [ + "ADD", + 128, + 706, + "2", + 594 + ], + [ + "ADD", + 125, + 706, + "2", + 594 + ] + ], + "after": [ + [ + "ADD", + 213, + 706, + "2", + 594 + ], + [ + "ADD", + 139, + 706, + "2", + 594 + ], + [ + "ADD", + 128, + 706, + "2", + 594 + ] + ] + } + ] + }, + { + "a": 128, + "b": 139, + "coefficient": "-1", + "start_block": 703, + "end_block": 705, + "entry_frame": 3, + "exit_frame": 602, + "blocks": [ + { + "index": 703, + "before": [ + [ + "ADD", + 125, + 128, + "-1", + 3 + ], + [ + "ADD", + 125, + 128, + "1", + 3 + ], + [ + "ADD", + 119, + 125, + "-1", + 3 + ], + [ + "ADD", + 125, + 128, + "-1", + 3 + ] + ], + "after": [ + [ + "ADD", + 128, + 139, + "1", + 3 + ], + [ + "ADD", + 125, + 128, + "-1", + 3 + ], + [ + "ADD", + 125, + 128, + "1", + 3 + ], + [ + "ADD", + 119, + 125, + "-1", + 3 + ], + [ + "ADD", + 125, + 128, + "-1", + 3 + ], + [ + "ADD", + 128, + 139, + "-1", + 3 + ] + ] + }, + { + "index": 704, + "before": [ + [ + "ADD", + 213, + 706, + "2", + 594 + ], + [ + "ADD", + 139, + 706, + "2", + 594 + ], + [ + "ADD", + 128, + 706, + "2", + 594 + ] + ], + "after": [ + [ + "ADD", + 213, + 706, + "2", + 594 + ], + [ + "ADD", + 139, + 706, + "2", + 594 + ] + ] + } + ] + } +] diff --git a/research/p104-nearest-contact-verification/source/WORD-CUSTODY.json b/research/p104-nearest-contact-verification/source/WORD-CUSTODY.json new file mode 100644 index 0000000000..31bac5c57d --- /dev/null +++ b/research/p104-nearest-contact-verification/source/WORD-CUSTODY.json @@ -0,0 +1,6 @@ +{ + "bytes": 120135, + "git_blob": "8be2b3e1c2d02034d4579bef5d36df7761d826ff", + "head": "af814f6f3c477fdd13b8f04380a33cf32004966b", + "sha256": "b56281a67f84832198be2f2ad36d87b75244d424f1e0a6f4dda2df74f20cc08d" +} diff --git a/research/p104-nearest-contact-verification/source/WORD.json.gz b/research/p104-nearest-contact-verification/source/WORD.json.gz new file mode 100644 index 0000000000..8be2b3e1c2 Binary files /dev/null and b/research/p104-nearest-contact-verification/source/WORD.json.gz differ diff --git a/research/p104-nearest-contact-verification/source/construct.py b/research/p104-nearest-contact-verification/source/construct.py new file mode 100644 index 0000000000..ff4d7701fc --- /dev/null +++ b/research/p104-nearest-contact-verification/source/construct.py @@ -0,0 +1,147 @@ +"""Apply four checked changes of the public register basis. + +Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. +""" +from copy import deepcopy +from fractions import Fraction as Q +from sources import need + + +def blocks(word): + result, block, frame = [], [], None + for event in word['program']: + if event[0] == 'MOVE': + continue + if event[0] in ('INIT', 'CLEAR'): + if block: + result.append(block) + result.append([event]) + block, frame = [], None + elif frame != event[-1]: + if block: + result.append(block) + block, frame = [event], event[-1] + else: + block.append(event) + if block: + result.append(block) + return result + + +def add(dst, src, coefficient): + for column, value in tuple(src.items()): + value = dst.get(column, Q(0)) + coefficient * value + if value: + dst[column] = value + else: + dst.pop(column, None) + + +def matrix(events, roles, frame): + rows = {r: {r: Q(1)} for r in roles} + for event in events: + op, r = event[:2] + need(op in ('ADD', 'SCALE') and event[-1] == frame, + 'One ordinary scalar block at one chart') + coefficient = Q(event[-2]) + need(r in roles and coefficient != 0, 'Declared scalar destination') + if op == 'SCALE': + rows[r] = {j: coefficient * value for j, value in rows[r].items()} + else: + need(event[2] in roles and event[2] != r, 'Declared scalar source') + add(rows[r], rows[event[2]], coefficient) + return rows + + +def protected(word): + n = word['public'] + return [e for e in word['program'] if e[1] >= n + or (e[0] in ('ADD', 'COPY') and e[2] >= n)] + + +def rebuild(word, scalar): + result = deepcopy(word) + frames = word['initial'][:] + [None] * word['owned_fields'] + program = [] + + def move(r, frame): + if frames[r] != frame: + need(frames[r] is not None, 'Live transport source') + program.append(['MOVE', r, frames[r], frame, r >= word['public']]) + frames[r] = frame + + for event in scalar: + op, r = event[:2] + if op == 'INIT': + need(frames[r] is None, 'Unused owned field') + frames[r] = event[2] + elif op == 'CLEAR': + move(r, event[2]) + frames[r] = None + else: + move(r, event[-1]) + if op in ('ADD', 'COPY'): + move(event[2], event[-1]) + program.append(event[:]) + for r in range(word['public']): + move(r, word['final'][r]) + result['program'] = program + return result + + +def step(word, witness, local): + source = blocks(word) + a, b, q = witness['a'], witness['b'], Q(witness['coefficient']) + start, end = witness['start_block'], witness['end_block'] + entry, exit_frame = witness['entry_frame'], witness['exit_frame'] + need(0 <= a < word['public'] and 0 <= b < word['public'] and a != b, + 'Two distinct public fields') + need(q and q.denominator & (q.denominator - 1) == 0, 'Nonzero dyadic basis') + need(0 < start < end < len(source), 'Internal interval of scalar blocks') + need(0 <= entry < len(word['frames']) and 0 <= exit_frame < len(word['frames']), + 'Declared basis charts') + replacements = {row['index']: row for row in witness['blocks']} + need(len(replacements) == len(witness['blocks']), 'Distinct replacement blocks') + expected = set() + scalar = [] + for index, block in enumerate(source): + if index == start: + scalar.append(['ADD', a, b, str(q), entry]) + roles = {e[1] for e in block} | { + e[2] for e in block if e[0] in ('ADD', 'COPY')} + if start <= index < end and roles & {a, b}: + expected.add(index) + need(index in replacements, 'Every affected block has a certificate') + row = replacements[index] + need(block == row['before'], 'Exact preceding scalar block') + frame = block[0][-1] + roles |= {a, b} + roles |= {e[1] for e in row['after']} | { + e[2] for e in row['after'] if e[0] == 'ADD'} + original = matrix(block, roles, frame) + # R = I + q E_ab. The two operations form R M R^-1. + add(original[a], original[b], q) + for vector in original.values(): + add(vector, {b: Q(1)}, -q * vector.get(a, 0)) + need(matrix(row['after'], roles, frame) == original, + 'Exact conjugation of the complete scalar block') + scalar.extend(row['after']) + else: + scalar.extend(block) + if index + 1 == end: + scalar.append(['ADD', a, b, str(-q), exit_frame]) + need(set(replacements) == expected, 'No extra replacement certificate') + result = rebuild(word, scalar) + need(protected(result) == protected(word), 'Every owned instruction and transport stays fixed') + need(result['initial'] == word['initial'] and result['final'] == word['final'], + 'All public boundaries stay fixed') + return result, local.replay(result) + + +def construct(source, witnesses, local): + word, receipts = source, [] + for witness in witnesses: + word, receipt = step(word, witness, local) + receipts.append(receipt) + word['schema'] = 'p104-paid-interior-bases/1' + return word, receipts diff --git a/research/p104-nearest-contact-verification/source/local-grammar.py b/research/p104-nearest-contact-verification/source/local-grammar.py new file mode 100644 index 0000000000..e72cb02dba --- /dev/null +++ b/research/p104-nearest-contact-verification/source/local-grammar.py @@ -0,0 +1,208 @@ +"""Check the complete P104 word with an independent helper inventory. + +Adapted from Ali Romman's PR5544/5545. David Arias supplied the word; +Cinna Davis supplied private reuse; Gareth Davidson supplied composition. +Prepared by Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. +""" +from collections import Counter +from fractions import Fraction as Q +from functools import lru_cache +from hashlib import sha256 +from pathlib import Path +import gzip +import importlib.util +import json +import sys + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] + +def need(ok, why): + if not ok: + raise ValueError(why) + +def read(path): + raw = path.read_bytes() + return json.loads(gzip.decompress(raw) if path.suffix == '.gz' else raw) + +def load(path, name): + spec = importlib.util.spec_from_file_location(name, path) + module = importlib.util.module_from_spec(spec) + sys.modules[name] = module + spec.loader.exec_module(module) + return module + +def add(dst, src, q): + for k, v in tuple(src.items()): + value = dst.get(k, 0) + q*v + if value: + dst[k] = value + else: + dst.pop(k, None) + +def span(basis): + out = {0} + for v in basis: + need(type(v) is int and 0 < v < 512 and v not in out, 'Independent binary basis') + out |= {x ^ v for x in tuple(out)} + return frozenset(out) + +def replay(w): + public = w['public'] + owned = w.get('owned_fields', 8) + need(type(owned) is int and 8 <= owned <= 9, 'Owned inventory bound') + need(type(public) is int and 735 <= public <= 750, 'Public inventory bound') + need(len(w['initial']) == len(w['final']) == public, 'Public boundary size') + need(len(w['program']) < 26000, 'Fixed operation bound') + frames = [span(x) for x in w['frames']] + rows = [{r:Q(1)} for r in range(public+owned)] + current = list(w['initial']) + [None]*owned + paid, scalar, live_owned, peak = Counter(), 0, set(), 0 + lifetimes = 0 + for e in w['program']: + op, r = e[:2] + need(0 <= r < public+owned, 'Role index') + if op == 'MOVE': + _, r, a, b, private = e + need(current[r] == a and (r in live_owned) == private, 'Transport source and ownership') + need(frames[b] < frames[a] if private else frames[a] < frames[b], 'Nested chronological transport') + paid[abs(len(w['frames'][b])-len(w['frames'][a]))] += 1 + current[r] = b + elif op == 'INIT': + need(r >= public and r not in live_owned, 'Owned initialization') + live_owned.add(r) + lifetimes += 1 + peak = max(peak, len(live_owned)) + rows[r] = {} + current[r] = e[2] + scalar += 2 + elif op == 'CLEAR': + need(r in live_owned and current[r] == e[2], 'Owned erasure at declared frame') + rows[r] = {} + current[r] = None + live_owned.remove(r) + scalar += 2 + else: + q, f = Q(e[-2]), e[-1] + need(q and current[r] == f, 'Scalar destination and coefficient') + n, d = abs(q.numerator), q.denominator + need(d & (d-1) == 0, 'Dyadic scalar coefficient') + need(abs(q)+1 < 2**16, 'Fixed scalar growth bound') + if op == 'SCALE': + need(n & (n-1) == 0, 'Dyadic unit SCALE') + rows[r] = {k:q*x for k,x in rows[r].items()} + scalar += 2*(abs(n.bit_length()-d.bit_length()) + int(q < 0)) + else: + s = e[2] + need(s != r and 0 <= s < public+owned and current[s] == f, 'Common scalar chart') + if op == 'COPY': + need(r in live_owned and not rows[r], 'COPY into cleared owned field') + rows[r] = {k:q*x for k,x in rows[s].items()} + else: + need(op == 'ADD', 'Scalar opcode') + add(rows[r], rows[s], q) + scalar += 2*(3+n.bit_length()-1+n.bit_count()+d.bit_length()-1) + need(not live_owned and 0 < peak <= 2 and current[:public] == w['final'], 'All public and owned exits') + live = set(w['live']) + for r,row in enumerate(rows): + expected = {r:Q(1)} if r < public else {} + if r-112 in live: + expected[r-112] = Q(1) + need(row == expected, 'All public and owned rows') + main = live | {r+112 for r in live} + helpers = Counter(len(w['frames'][w['final'][r]])-len(w['frames'][w['initial'][r]]) for r in range(public) if r not in main) + need(len(live) == len(w['ports']) == 104 and len(main) == 208 and min(helpers) > 0, 'Independent productive inputs') + return {'paid':dict(paid), 'helpers':dict(helpers), 'public_inputs':public, 'owned_fields':owned, 'owned_lifetimes':lifetimes, + 'peak_owned_fields':peak, 'real_scalar_allowance':scalar, 'endpoint_coefficients':(public+owned)*(public+owned), + 'paid_rank_mass':sum(r*count for r,count in paid.items())} + +def reverse_columns(w): + """Check the transpose with dense dyadic rows and the reverse chronology.""" + public = w['public'] + n = public+w.get('owned_fields', 8) + rows = [[int(i == j) for j in range(n)] for i in range(n)] + exponents = [0]*n + for e in reversed(w['program']): + op,r = e[:2] + if op == 'MOVE': + continue + if op in ('INIT','CLEAR'): + rows[r] = [0]*n + exponents[r] = 0 + continue + q = Q(e[-2]) + qe = q.denominator.bit_length()-1 + if op == 'SCALE': + rows[r] = [q.numerator*x for x in rows[r]] + exponents[r] += qe + else: + s = e[2] + level = max(exponents[s], exponents[r]+qe) + a, b = 1 << (level-exponents[s]), q.numerator << (level-exponents[r]-qe) + rows[s] = [a*x+b*y for x,y in zip(rows[s],rows[r])] + exponents[s] = level + if op == 'COPY': + rows[r] = [0]*n + exponents[r] = 0 + r = s + while exponents[r] and not any(x & 1 for x in rows[r]): + rows[r] = [x//2 for x in rows[r]] + exponents[r] -= 1 + for r,row in enumerate(rows): + expected = [0]*n + if r < public: + expected[r] = 1 << exponents[r] + if r in w['live']: + expected[r+112] = 1 << exponents[r] + need(row == expected, 'Independent dense transpose columns') + return {'columns':n, 'coefficients':n*n, 'arithmetic':'Dense integer rows with binary denominators; reverse chronology'} + +def native(w): + n = w['public'] + C = load(ROOT/'research/p104-native-channel/vendor/clifford_exact.py', 'p104_productive_clifford') + V = load(ROOT/'research/p104-native-channel/vendor/native_verify.py', 'p104_productive_gaussian') + @lru_cache(None) + def chart(i): + return C.canonical_frame(9, tuple(w['frames'][i])) + recipes = {} + def check(a,b): + if (a,b) not in recipes: + recipe,_ = C.lower_child(chart(a).adjoint().then(chart(b))) + expected = V.adjoint(V.frame(w['frames'][a],9)) + V.frame(w['frames'][b],9) + V.equal(V.recipe(recipe),expected,'Native chart change and exact global phase') + need(recipe['rank'] == abs(len(w['frames'][a])-len(w['frames'][b])), 'Native boundary rank') + recipes[a,b] = recipe + return recipes[a,b] + for e in w['program']: + if e[0] == 'MOVE': + check(e[2],e[3]) + main = set(w['live']) | {r+112 for r in w['live']} + helper_profile = Counter() + for r in range(n): + if r not in main: + helper_profile[check(w['initial'][r],w['final'][r])['rank']] += 1 + adapters = [] + for r,q in zip(w['live'],w['ports']): + need(w['frames'][w['initial'][r]] == [q], 'Literal central port') + need(span(w['frames'][w['final'][r+112]]) == frozenset(x for x in range(512) if not (x&q).bit_count()%2), 'Literal output hyperplane') + tests = [ + (C.cgate(9,q,1).adjoint().then(chart(w['initial'][r])), V.adjoint((('C',q,1),))+V.frame(w['frames'][w['initial'][r]],9)), + (chart(w['final'][r+112]).adjoint().then(C.cgate(9,q,-1).then(C.fourier(9))), V.adjoint(V.frame(w['frames'][w['final'][r+112]],9))+(('C',q,-1),)+V.fourier(9))] + for actual,expected in tests: + recipe,_ = C.lower_child(actual) + need(recipe['rank'] == 0, 'Free intrinsic main adapter') + V.equal(V.recipe(recipe),expected,'Main endpoint phase') + adapters.append(recipe) + bad = json.loads(json.dumps(next(iter(recipes.values())))) + bad['left']['phase'] = (bad['left']['phase']+1)%4 + a,b = next(iter(recipes)) + try: + V.equal(V.recipe(bad),V.adjoint(V.frame(w['frames'][a],9))+V.frame(w['frames'][b],9),'Wrong phase control') + except ValueError: + pass + else: + raise ValueError('Wrong native phase accepted') + payload = [[a,b,recipes[a,b]] for a,b in sorted(recipes)] + adapters + return {'distinct_maps':len(recipes),'main_adapters':len(adapters),'helper_normalizers':2*sum(helper_profile.values()), + 'helpers':dict(helper_profile),'recipe_payload_sha256':sha256(json.dumps(payload,sort_keys=True,separators=(',',':')).encode()).hexdigest(), + 'wrong_phase_rejected':True, 'proof':'Every signed Pauli image and exact global phase; frame induction at every positive tensor width'} diff --git a/research/p104-nearest-contact-verification/verify.py b/research/p104-nearest-contact-verification/verify.py new file mode 100644 index 0000000000..7e51f21e49 --- /dev/null +++ b/research/p104-nearest-contact-verification/verify.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 +"""Replay one fixed PR5678 nearest-contact falsifier. Apache-2.0.""" +import hashlib +import json +import os +from pathlib import Path, PurePosixPath +import subprocess +import sys +import tempfile +HERE=Path(__file__).resolve().parent +EXPECTED='18dac3a5092667ab5f5118ed6e953d65d558a8d11066e95cc728a069ec01f50f' +ORIGINAL_CORE='2c747e340f4818a1064608323a877d693b5885bd58a1774e9b82315033649525' +WORD_SHA='b56281a67f84832198be2f2ad36d87b75244d424f1e0a6f4dda2df74f20cc08d' +WORD_BLOB='8be2b3e1c2d02034d4579bef5d36df7761d826ff' + +def need(ok,message): + if not ok:raise ValueError(message) +def sha(raw):return hashlib.sha256(raw).hexdigest() +def safe(name): + p=PurePosixPath(name);need(not p.is_absolute() and '..' not in p.parts and p.as_posix()==name,'Canonical local payload path') + f=HERE + for bit in p.parts:f=f/bit;need(not f.is_symlink(),'No payload symlink') + need(f.is_file(),'Missing payload '+name);return f + +def check_bytes(raw,row): + need(len(raw)==row['bytes'] and sha(raw)==row['sha256'],'Payload size/SHA256') + if 'git_blob' in row:need(hashlib.sha1(b'blob '+str(len(raw)).encode()+b'\0'+raw).hexdigest()==row['git_blob'],'Payload Git blob') + +def rejected(action): + try:action() + except ValueError:return 'rejected' + raise ValueError('Integrity control accepted altered bytes') + +def main(): + inventory=json.loads((HERE/'PORTABLE.json').read_bytes()) + need(inventory['original_result_sha256']==EXPECTED and inventory['original_checker_sha256']==ORIGINAL_CORE,'Original evidence binding') + for name,row in inventory['payloads'].items():check_bytes(safe(name).read_bytes(),row) + old=safe('evidence/original-check.py').read_bytes();core=safe('check.py').read_bytes() + need(sha(old)==ORIGINAL_CORE and old.count(b'ROOT=HERE.parents[2]')==1 and old.replace(b'ROOT=HERE.parents[2]',b'ROOT=HERE')==core,'Exactly one ROOT adaptation; scientific core otherwise unchanged') + normal=safe('evidence/RESULT-normal.json').read_bytes() + need(sha(normal)==EXPECTED and normal==safe('evidence/RESULT-optimized.json').read_bytes(),'Entire original result pair') + word=safe('source/WORD.json.gz').read_bytes();row=inventory['payloads']['source/WORD.json.gz'] + need(row['bytes']==120135 and row['sha256']==WORD_SHA and row['git_blob']==WORD_BLOB,'Exact published compressed WORD') + controls={'corrupt_compressed_bytes':rejected(lambda:check_bytes(word[:-1]+bytes([word[-1]^1]),row)), + 'corrupt_scientific_core':rejected(lambda:check_bytes(core+b'\n',inventory['payloads']['check.py']))} + with tempfile.TemporaryDirectory(prefix='pr5678-nearest-cache-') as cache: + command=[sys.executable,'-I','-B','-X','pycache_prefix='+cache] + if sys.flags.optimize:command.append('-O' if sys.flags.optimize==1 else '-OO') + command.append(str(HERE/'check.py'));env=dict(os.environ);env.pop('PYTHONOPTIMIZE',None) + done=subprocess.run(command,cwd=HERE,env=env,capture_output=True,timeout=55,check=False) + need(done.returncode==0 and not done.stderr,'Core must complete without source/binding/resource failure') + need(sha(done.stdout)==EXPECTED,'Entire scientific result must match original SHA256, no excluded fields') + value=json.loads(done.stdout) + need(value['status']=='COMPLETED_FIXED_NEAREST_CONTACT_FALSIFIER' and value['nearest_predicate']['status']=='NEAREST_MISMATCH','Strict completed nearest-contact falsifier') + expected=[{'access':['write'],'event':13344,'instruction':['ADD',144,317,'1',356]}, + {'access':['write'],'event':13463,'instruction':['ADD',144,530,'1',1035]}] + need(value['nearest_predicate']['nearest_144_contacts']==expected,'Exact two immediately preceding semantic contacts') + bound=value['unique_published_context'] + need(bound['R']=={'event':14893,'instruction':['ADD',140,438,'-1/2',794]} and + bound['Y']=={'event':15473,'instruction':['ADD',144,438,'-1/2',911]},'Unique exact published R/Y contexts') + need(value['complete_affected_route_extraction_performed'] is False and value['candidate_paid_invoice'] is None and + value['pricing_or_numeric_powers_evaluated'] is False and value['new_kappa'] is None and + value['changed_full_word_emitted'] is False and value['other_contact_pairs_queried'] is False,'Stop before corridor/routes/prices/construction or another pair') + need('affected_role_routes' not in value and 'signed_affected_local_rank_histogram' not in value,'No conditional route branch ran') + need(value['instruction_count']==25453 and value['decompressed_hard_cap']==16777216,'Exact corpus count and original abort cap') + c=value['controls'];need(len(c)==10 and c['valid_synthetic_conditional_pattern']['outcome']=='accepted' and + c['valid_synthetic_conditional_pattern']['exact_identity'] is True and + all(v=='rejected' for k,v in c.items() if k!='valid_synthetic_conditional_pattern'),'Nine original rejections and exact positive semantic/algebra case') + print(json.dumps({'status':'PASS_PR5678_FIXED_NEAREST_CONTACT_VERIFICATION','scientific_status':value['status'], + 'source_head':value['source_head'],'complete_scientific_output_sha256':sha(done.stdout),'nearest_contacts':expected, + 'core_executions':1,'original_negative_controls_rejected':9,'original_positive_control_accepted':True, + 'portable_integrity_controls':controls,'candidate_paid_invoice':None,'new_kappa':None, + 'core_adaptation':'One ROOT assignment only; source modules never imported.'},sort_keys=True,separators=(',',':'))) + +if __name__=='__main__': + try:main() + except Exception as error: + print(json.dumps({'status':'FAIL_PR5678_NEAREST_CONTACT_REPLAY','failure':type(error).__name__+': '+str(error)},sort_keys=True,separators=(',',':')));sys.exit(1)