From 5927ac1aa8aa9914c025e6b9e3ecf37e1f8daa0e Mon Sep 17 00:00:00 2001 From: ToikY <27568617+ToikY@users.noreply.github.com> Date: Thu, 5 Nov 2026 16:31:23 -0800 Subject: [PATCH] research: review literal retained-record inverse and caller guards --- .../retained-record-inverse-review/LICENSE | 201 +++++++++ .../retained-record-inverse-review/NOTICE | 21 + .../retained-record-inverse-review/README.md | 42 ++ .../RECORD-ASSEMBLED-REVIEW.md | 31 ++ .../RECORD-CODE-DRAFT-SEAL.json | 42 ++ .../RECORD-CODE-DRAFT.md | 101 +++++ .../RECORD-CROSS-DERIVATION.md | 90 ++++ .../RECORD-DERIVATION-DRAFT.md | 134 ++++++ .../RECORD-DERIVATION-SEAL.json | 17 + .../retained-record-inverse-review/REVIEW.md | 100 +++++ .../SOURCE-PINS.json | 125 ++++++ .../SOURCES.json | 66 +++ .../retained-record-inverse-review/TASK.json | 135 ++++++ .../inputs/LICENSE | 201 +++++++++ .../inputs/NOTICE | 50 +++ .../inputs/PROOF.md | 282 ++++++++++++ .../inputs/README.md | 62 +++ .../inputs/ROOT-NOTICE | 415 ++++++++++++++++++ .../inputs/SOURCES.json | 36 ++ .../inputs/ledger.py.txt | 190 ++++++++ .../inputs/produce.py.txt | 102 +++++ .../inputs/sampler.py.txt | 226 ++++++++++ .../inputs/verify.py.txt | 177 ++++++++ 23 files changed, 2846 insertions(+) create mode 100644 research/retained-record-inverse-review/LICENSE create mode 100644 research/retained-record-inverse-review/NOTICE create mode 100644 research/retained-record-inverse-review/README.md create mode 100644 research/retained-record-inverse-review/RECORD-ASSEMBLED-REVIEW.md create mode 100644 research/retained-record-inverse-review/RECORD-CODE-DRAFT-SEAL.json create mode 100644 research/retained-record-inverse-review/RECORD-CODE-DRAFT.md create mode 100644 research/retained-record-inverse-review/RECORD-CROSS-DERIVATION.md create mode 100644 research/retained-record-inverse-review/RECORD-DERIVATION-DRAFT.md create mode 100644 research/retained-record-inverse-review/RECORD-DERIVATION-SEAL.json create mode 100644 research/retained-record-inverse-review/REVIEW.md create mode 100644 research/retained-record-inverse-review/SOURCE-PINS.json create mode 100644 research/retained-record-inverse-review/SOURCES.json create mode 100644 research/retained-record-inverse-review/TASK.json create mode 100644 research/retained-record-inverse-review/inputs/LICENSE create mode 100644 research/retained-record-inverse-review/inputs/NOTICE create mode 100644 research/retained-record-inverse-review/inputs/PROOF.md create mode 100644 research/retained-record-inverse-review/inputs/README.md create mode 100644 research/retained-record-inverse-review/inputs/ROOT-NOTICE create mode 100644 research/retained-record-inverse-review/inputs/SOURCES.json create mode 100644 research/retained-record-inverse-review/inputs/ledger.py.txt create mode 100644 research/retained-record-inverse-review/inputs/produce.py.txt create mode 100644 research/retained-record-inverse-review/inputs/sampler.py.txt create mode 100644 research/retained-record-inverse-review/inputs/verify.py.txt diff --git a/research/retained-record-inverse-review/LICENSE b/research/retained-record-inverse-review/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/retained-record-inverse-review/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/retained-record-inverse-review/NOTICE b/research/retained-record-inverse-review/NOTICE new file mode 100644 index 0000000000..61b0443bd7 --- /dev/null +++ b/research/retained-record-inverse-review/NOTICE @@ -0,0 +1,21 @@ +External written review of the literal retained-record inverse +Prepared by ToikY with substantial OpenAI Codex assistance, 2026-11-05. + +Ali Romman PR6546 owns the complete stochastic numerical caller, literal +retained-state inverse, error proof and direct bill. The unchanged source +is pinned atff038070b8d122a43993f2b2524154323cc6b4d7. This package reviews +the actual inverse/caller-premise implication without executing its suite +or claiming a new caller, error bound, count, retention floor or bill. + +Ali's PR6526/6532/6509, Nick Petalas6418/6438 and distinct6594 capacity, +Ali6547 zero-fiber, zxv6066, DreamingOfClouds6030/P104, Cinna Davis4088/2226 +and every author in the exact retained source package NOTICE keep their +credit and assistance disclosures. Rounding, residue retention and reversed +record composition are classical. All native/compiler/source lineage remains. + +Original package NOTICE, root NOTICE, Apache-2.0 license, source headers and +source provenance are retained under inputs/. Executable originals are inert +.txt copies; this subset is not the full runnable original verification suite. +Separate AI roles are not blind, human or kernel acceptance. No predecessor +endorsement, physical admission, multiplication theorem, kappa/frontier/adoption +change or merge is asserted. The Apache-2.0 terms remain unchanged. diff --git a/research/retained-record-inverse-review/README.md b/research/retained-record-inverse-review/README.md new file mode 100644 index 0000000000..ae966713d4 --- /dev/null +++ b/research/retained-record-inverse-review/README.md @@ -0,0 +1,42 @@ +# External review of the literal retained-record inverse + +This written proof-to-code audit reviews Ali Romman’s [PR #6546](https://github.com/CrocSwap/integer-mult-bounds/pull/6546), exact head `ff038070b8d122a43993f2b2524154323cc6b4d7`. Its scope is the whole retained-record inverse and the actual producer/ledger premises used before calling it. The caller, inverse, error bounds, event/column counts and retained-state bill are existing source results, not new constructions or numerical replays here. + +Read [REVIEW.md](REVIEW.md) beside the exact inert [sampler](inputs/sampler.py.txt), [source proof](inputs/PROOF.md), [ledger](inputs/ledger.py.txt), [producer](inputs/produce.py.txt) and [verifier call site](inputs/verify.py.txt). The useful bridge is from the literal guards and records to an exact descending induction over every opcode, rather than a claim that a local rounding identity alone certifies a complete caller. + +## Evidence and exposure + +[SOURCE-PINS.json](SOURCE-PINS.json) binds ten retained objects: eight from the pending source package and the canonical root license/NOTICE. The foreign source commit, root/research/package tree chain, file modes and exact blobs are checked separately. [SOURCES.json](SOURCES.json) contains only ten actual canonical provenance bindings: guide8 plus root license/NOTICE. The pending source files are not falsely declared to be canonical ancestors. + +The original [package NOTICE](inputs/NOTICE), [root NOTICE](inputs/ROOT-NOTICE), [license](inputs/LICENSE), [README](inputs/README.md) and source headers remain unchanged. [Original SOURCES.json](inputs/SOURCES.json) retains the source author’s selected WORD and native compiler/oracle pins. Their raw bodies, full event membership, all columns and numerical outcomes were not reread or rechecked by this audit. This is an inert, deliberately scoped text subset, with executable originals named `.py.txt`; it is not a runnable copy of the original suite. + +Abstract and source-aware code first drafts are sealed separately before cross-reading. The abstract role knows the target theorem but did not open current source/peer before sealing; historical familiarity is not excluded. The code role read sampler/proof during earlier scouting. Root read that scout and the source PR body before claiming, then actual source after the claim. Their later source/peer and assembled checks are retained, without a claim of blindness, human review or kernel acceptance. Substantial OpenAI Codex assistance is disclosed. + +All written weakening controls are **UNEXECUTED**. No source import, NumPy operation/install, producer, native constructor, dense caller, word scan, all-column comparison, source fixture, mutation, ledger analysis, endpoint decoder or proof kernel ran. There is no scientific `VERIFY.json` hook. Reproduction is reading the proof and sealed notes against exact inert sources. Byte/metadata/export/public/hosted helper checks are separate evidence and do not certify the original numerical suite. + +## Exact domain and remaining obligations + +The inverse uses genuine Python integer components in equal-length lists of Gaussian pairs, `N=512^f` for positive integer `f`, fixed valid nine-bit route recipes, in-range seeds, immutable word/recipes and a noninterfering seed callback. `ledger.analyze` before `execute` supplies nonzero dyadic scalar coefficients, fractional SCALE numerator ±1, distinct aligned ADD/COPY operands and allocation/frame premises. The sampler alone is not a hostile arbitrary-program, dtype or shape admission API; scalar `zip` relies on equal shapes. + +The payload sampler uses Python arbitrary-precision integers. NumPy int64 appears in separate fixed producer verification, which is outside this review’s executed evidence. The actual record uses shifted Euclidean residues `(p*x+seed) mod D`, including signed inputs. It is not silently interchangeable with an unshifted or truncated record convention. Native reversal preserves each original layer seed index while reversing the layer order and left/right monomials. + +COPY and CLEAR retain actual old field values, including noise or dirty data; ideal zeros do not erase those values for free. Reused labels require event-indexed records and reverse chronological restoration. INIT inverse checks an exact zero before removal. Same-seed recovery proves an injection on reached augmented states, not an inverse of output fields alone, a total fixed-register hardware permutation, physical record erasure or a new memory minimum. + +The source’s numerical error/precision proof, source word’s reported successful validation, all-column semantic correspondence, 54 fields, 578N residue bits, seed bill, peak 824, finite outcomes and historical CI remain inherited author evidence, not freshly certified. PRs #6547/#6594’s recovery-capacity results remain distinct. Fresh conditional randomness is needed for the forward error theorem; deterministic inversion needs the retained values and does not make them fresh again. + +The original formal-interface card is retained in full in [TASK.json](TASK.json), with scope explicitly **changed** to written review and its formal/kernel gate unmet. Physical sampling, reversible gates, fixed tape routing, retained-data cleanup, accelerated recursive pricing, outer error recovery, complete native/compiler/ownership/precision/analytic/full-supplier obligations and all five selected assumptions remain. No κ/frontier/adoption change or merge follows. + +## Selection and credit + +Canonical main `7c49fe32c55de02c2c873655c804b16e4c3fef0a` and guide8 were refreshed at the checkpoint; selected #6030, κ `781451/250000000`, takes precedence over stale #5599 prose. The baseline check is source bindings only. The latest Hub and Discussion index, all 700 open/draft full PR bodies and heads across eight complete pages `[100×7,0]`, targeted all-state exact-package/#6546-inverse/audit searches, source PR and empty comment timeline were checked before the [scoped claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19429470). + +Nearest #6547/#6594 capacity floors and #6573/#6574 local contracts are distinct. Source #6546 already proves its full inverse and has extensive checks; this audit does not claim those were missing. Prior 99 PRs and B13 results #6745–#6750 are excluded. Sparse local notes, hidden Discussion history, arbitrary diffs and unindexed work remain unknown; empty matches are not novelty proof. + +Ali Romman owns #6546 and retained #6526/#6532/#6509 work. Retain Nick Petalas #6418/#6438, distinct #6594 capacity and Ali’s #6547 zero-fiber work, zxv #6066, DreamingOfClouds #6030/P104 lineage, Cinna Davis #4088/#2226 and every original NOTICE author. Classical rounding, quotient/remainder reconstruction and reverse-record composition are not new methods. ToikY prepared this external review with substantial OpenAI Codex assistance and separate abstract, code, metadata and byte roles; no predecessor endorsement is implied. + +## Open next questions + +1. Can a proof kernel check the literal shifted-residue, same-seed Gaussian pair, route/layer inverse and chronological field-map induction, including the caller guards? Written roles do not meet that gate. +2. Which physical implementation supplies the retained-record service and its full entropy/field/residue ownership, placement, work and return-cleanup bill? A direct exact reference is not a fast recursive supplier or reversible physical circuit. + +These follow-ons are unreserved. Publication requires maintainer edits and auto-merge disabled; actual settings and hosted receipts are separate from the frozen package. No selected-frontier file is changed. diff --git a/research/retained-record-inverse-review/RECORD-ASSEMBLED-REVIEW.md b/research/retained-record-inverse-review/RECORD-ASSEMBLED-REVIEW.md new file mode 100644 index 0000000000..365a04da87 --- /dev/null +++ b/research/retained-record-inverse-review/RECORD-ASSEMBLED-REVIEW.md @@ -0,0 +1,31 @@ +# Assembled retained-record inverse review + +Cross-reviewed 2026-11-06 around00:30UTC, after both first drafts were sealed and source cross-reading released. This is a cross-review, not another independent derivation. No scientific source, word scan, NumPy operation/import/install, constructor, caller, ledger/producer, finite test, numerical experiment or kernel was executed. Only inert text/source and metadata hash/time operations were used. Existing notes, seals and package files were left unchanged. + +Exact read versions: + +- Package REVIEW.md SHA256 `5df997c37f2d31027ddb780363fa4de03c482572aa0b27cb52ae28e5f762d7d3`. +- Package README.md SHA256 `f6baa078a45b2a02fdcbd06927ad56e09b1c1f8a82a39afa5892ffaeed802978`. +- Peer abstract RECORD-DERIVATION-DRAFT.md SHA256 `0897e63208288b5b0303a92d638467fd4fce23f5ebe60ec49323223e333a3407`. +- Peer source cross-note RECORD-CROSS-DERIVATION.md SHA256 `e66904c000de8734c8194e2b119e35952c75f150dfa8d13b5c5f9238fe614c5b`. +- My first source-aware draft remains immutable at `be6e2c8c9c6c272da7a6718699705c11ba80a34c00c6fcb549a0f40a99fd2b6b`. + +## Verdict + +Qualified PASS on the actual successful producer/ledger path and the declared Python-integer/common-shape/immutable-record domain. No additional correction is requested. This binds the exact assembled version above, not a later edit by inference. + +The review correctly describes `ledger.analyze` before `execute` as a guard implication, while the source author's successful membership validation of the fixed word remains inherited. It does not claim to have read/scanned the binary word or rerun22803events/native columns. The declared raw source SHA values and canonical provenance are not presented as a new raw-body verification or a full runnable closure. Distinct ADD source, nonzero dyadic scalars, fractional numerator±1, frame and lifecycle conditions are supplied by the preceding source path, not silently attributed to every permissive sampler helper. + +The pair proof correctly uses conserved sum, parity and retained sign to reproduce the same correction center and exactly undo its affine difference rotation. The native composition reverses the original layer INDEX order and preserves each seeds[j], with correct left/right inverse placement. This is an inverse of the actual integer map under valid routes, not an inference from only an ideal matrix inverse or the source's error theorem. + +The literal seed-shifted residue identity is exact for negative inputs and numerator±1. The cross-note's relationship to the abstract unshifted residue is also correct: for `p*x=D*q0+r0`, `b=floor((r0+u)/D)`, the actual `y=q0+b`, `r=r0+u-D*b` give `D*y+r-u=p*x`. Publication uses the actual record r and does not mix it with the abstract correction formula. The dyadic bit-width assumption and integer nonzero exact-division domain are explicitly preserved. The unsupported self-ADD example demonstrates failure of the literal subtract-inverse for that call, not universal noninjectivity of self-ADD. + +The snapshot and descending event arguments are valid on the stated representation. All relevant field assignments create new outer lists, native starts with a new monomial list, and integer pairs/zero tuples are immutable. Actual old COPY/CLEAR values remain available despite noise and reused labels; records are keyed by event, and later lifetimes are undone first. Dictionary value/label equality is the correct obligation, not insertion-order or object identity. `tape[j]=None` does not destroy the local record already bound for that inverse step. + +Python integer payload arithmetic avoids the proposed fixed-dtype overflow issue on this actual domain. NumPy int64 is confined to separate source producer verification, not the sampler's all-width arithmetic. Algebraic shape-preserving composition is accurately distinguished from actual execution of all tensor widths or feasible materialization at all sizes. The final state plus valid records determines the original input, while output fields alone, arbitrary malformed packets, all randomness, physical reversible erasure or a total finite-register permutation are not claimed. + +## Evidence, exposure and limits + +The abstract and source-aware drafts' differing exposures, post-seal convention reconciliation and earlier scout history are disclosed without a fresh-blind/human/kernel claim. Nine and eight overlapping written controls are explicitly UNEXECUTED, not17 independent experiments. No original source control, numerical result, error constant, retained-state total or capacity floor is recounted as new evidence. + +The source caller/inverse,54field/578N/seed/824 budgets and all-column/finite/error results remain Ali Romman's source results.6547/6594 capacity floors,6532/6526/6509 local work and all original native/compiler/rounding notices keep their credit. All physical sampling/tape/gates, retained-state cleanup, accelerated recursive price, outer recovery and selected native/ownership/compiler/precision/analytic/full-supplier obligations remain open. The written audit has no scientific replay hook or complete native closure, and no κ/frontier/adoption or merge change follows. diff --git a/research/retained-record-inverse-review/RECORD-CODE-DRAFT-SEAL.json b/research/retained-record-inverse-review/RECORD-CODE-DRAFT-SEAL.json new file mode 100644 index 0000000000..6cc49e4fdd --- /dev/null +++ b/research/retained-record-inverse-review/RECORD-CODE-DRAFT-SEAL.json @@ -0,0 +1,42 @@ +{ + "current_peer_or_coordinator_draft_read_before_seal": false, + "draft": { + "bytes": 15506, + "path": "/private/tmp/contribution-batch-b13-20261105T2038Z/session-07/RECORD-CODE-DRAFT.md", + "sha256": "be6e2c8c9c6c272da7a6718699705c11ba80a34c00c6fcb549a0f40a99fd2b6b" + }, + "inert_source_objects": [ + { + "git_blob": "178000008b30144cf607dabd0d1759056fd4a644", + "path": "research/selected-absolute-stochastic-caller/PROOF.md" + }, + { + "git_blob": "2f7ba4b7d01213beb2a3b070658617ff992e715e", + "path": "research/selected-absolute-stochastic-caller/sampler.py" + }, + { + "git_blob": "5ed6163e903da47268a3ca44786126e6e978dff6", + "path": "research/selected-absolute-stochastic-caller/produce.py" + }, + { + "git_blob": "728b2901176f11de2958c0e296061755b7305727", + "path": "research/selected-absolute-stochastic-caller/ledger.py" + }, + { + "git_blob": "aea6fd3df8b1d666cf963ce1e338a0a4074035aa", + "path": "research/selected-absolute-stochastic-caller/verify.py" + }, + { + "git_blob": "dc4e6683f6a58b47654bf93b2117ea31b8255ec6", + "path": "research/selected-absolute-stochastic-caller/SOURCES.json" + } + ], + "limits": "No source/new scientific imports, compilation, NumPy installation/import, source-word scan, constructors, callers, finite experiments, native columns, tests, census, numerical verification or kernel. Only inert source and metadata hashes/time.", + "prior_exposure": "Session05 scout read source proof, sampler and PR body; current role explicitly source-aware, not blind.", + "role": "source-aware whole-record inverse code audit", + "schema_version": 1, + "scientific_execution": false, + "sealed_at_utc": "2026-11-06T00:22:27.630825+00:00", + "source_head": "ff038070b8d122a43993f2b2524154323cc6b4d7", + "source_repository": "aliromman/integer-mult-bounds" +} diff --git a/research/retained-record-inverse-review/RECORD-CODE-DRAFT.md b/research/retained-record-inverse-review/RECORD-CODE-DRAFT.md new file mode 100644 index 0000000000..4370d04ec1 --- /dev/null +++ b/research/retained-record-inverse-review/RECORD-CODE-DRAFT.md @@ -0,0 +1,101 @@ +# Source-aware whole-record inverse audit + +## Verdict, source and exposure + +Qualified PASS for the fixed source word, valid recipe/data shapes and actual producer/ledger path. The local records and reverse dispatch recover the reached input state; no source implementation defect was established. This is an external written audit of Ali Romman's PR6546, not a new inverse/caller, retention floor, error theorem, inventory or all-column replay. + +Exact source head `ff038070b8d122a43993f2b2524154323cc6b4d7`, directory `research/selected-absolute-stochastic-caller/`. Inert objects inspected: + +| File | Git blob | +| --- | --- | +| sampler.py | 2f7ba4b7d01213beb2a3b070658617ff992e715e | +| PROOF.md | 178000008b30144cf607dabd0d1759056fd4a644 | +| produce.py | 5ed6163e903da47268a3ca44786126e6e978dff6 | +| ledger.py | 728b2901176f11de2958c0e296061755b7305727 | +| verify.py | aea6fd3df8b1d666cf963ce1e338a0a4074035aa | +| SOURCES.json | dc4e6683f6a58b47654bf93b2117ea31b8255ec6 | + +Prior session05 scouting exposed the source PROOF/sampler/body; this role is source-aware, not fresh blind. No current peer or coordinator draft was read before sealing. No source/new scientific program, NumPy import/install, constructor, caller, source-word scan, all-column comparison, test, mutation, census, numerical experiment or kernel was executed. Only inert source and provenance metadata were read. Reading guard/producer code does not rerun their previously reported outcomes. + +The source54 retained whole fields,578N residue bits,5952f+18592 seed bits,824 peak fields,22803-event/all-column results, error/score maxima and finite receipts remain author evidence. The6547/6594 recovery floors are not rederived. Error/concentration/precision claims are outside this audit. + +## 1. Actual source-to-caller preconditions + +`SOURCES.json` pins the canonical selected WORD.json.gz at Git22f9ab02d1b73ea0aa4b07ce445a14cc2602c760, SHA2567834725d9e34ee846a9ccc615221ea81e0201613938afa185d2eda0c9a6c232f, and the two native compiler/oracle inputs. This note read the binding, not the binary word or those predecessor program bodies. + +`produce.main` loads that word, compiles its actual MOVE edge endpoints from nine-axis frames, requires recipe rank1..8, constructs/checks the fixed-size recipe matrices and writes JSON recipes. `verify.run` hashes its pinned inputs, loads the same selected word, runs that producer, then calls `ledger.analyze(word,bound['ranks'])` BEFORE `execute`. The relevant actual ledger gates are: + +- MOVE matches old frame and owned flag, then updates the frame; +- INIT requires an unused owned label; CLEAR requires its live frame, then closes it; +- scalar q is nonzero, has power-of-two denominator and matches the target frame; +- noninteger SCALE has numerator±1; an integer SCALE is permitted by the guard; +- ADD/COPY source differs from target and has the same frame; +- selected COPY has coefficient1 and the prescribed owned/ideal-row premise; +- final live-owned set is empty and final frames/ideal endpoint are checked. + +These guard implications bind the inverse's key hypotheses to the source's actual call path. No new22803-event validation is claimed. The fixed word/recipes and callback remain unmodified during the call. The callback supplies genuine in-range seeds and has no interfering side effects. + +The theorem's input representation is a mapping of exactly the intended public labels to lists of N=512^f Gaussian INTEGER pairs, with common N and positive integer f. Current full-caller fixture construction in `verify.run` is explicit Python integers in lists of tuples, width1; the larger tensor fixture is a native call, not a complete all-width caller execution. The all-width conclusion is a composition argument under those shapes, not an assertion that the entire caller was run at every f. + +`execute` is not a hostile-program/NumPy/shape admission API. For example its scalar ADD uses ordinary zip, and equal list lengths are an invariant, not independently checked at that line. Equal N holds initially by the theorem; INIT creates N, COPY preserves N, scalar operations preserve N, and native checks N, so this invariant closes on the declared path. A mismatched packet is outside that proof. Self-COPY would in fact be recoverable by the old-value record, although the selected ledger forbids it; ADD's distinct source is genuinely needed by the displayed subtract-inverse. + +## 2. Pair and native inverse on arbitrary integer magnitudes + +`sampler.pair`27–44 computes sum s and difference d. The correction vector c is a deterministic function of conserved s and the retained sign. When parity needs correction it is a signed unit on the odd sum component; otherwise it is zero. Subtracting c, applying i (or-i in inverse), then adding c keeps d in the parity class required for integer halves. The explicit even-numerator gate checks that property. + +Writing R for multiplication by i, its difference map is `d'=R(d-c)+c`. The output sum remains s, so the inverse recomputes the SAME c from that sum/sign and uses `R^-1(d'-c)+c=d`. This is exact for every Gaussian integer input and either valid sign, without a fairness or size assumption. A changed inverse sign generally changes c and is not the same inverse. + +`route`47–60 builds a phase-Z4 monomial permutation and checks its destination permutation. The actual nine-bit recipe domain comes from the source compiler, not arbitrary row widths. `monomial`63–76 applies that permutation independently on f nine-bit digits and adds their phase exponents; the inverse reads the same destinations and negates those phases. This is the literal tensor monomial inverse, with all global phases retained. + +`native`79–92 checks positive integer f, N and seed count. Forward composition is right monomial, ordered pair layers, left monomial. Inverse starts with left inverse, reverses the layer INDEX order while retaining each original seeds[j], and ends with right inverse. Each layer consists of disjoint coordinate pairs and has the exact pair inverse. Therefore the composition reverses exactly for any valid retained signs and any f; this does not re-establish the recipe's intended source operator by an all-column comparison. + +The sampler uses Python arbitrary-precision integers/lists, not NumPy fixed-width payload arrays. No fixed-int64 all-width payload-overflow claim is needed. NumPy int64 appears in the separate fixed512-coordinate producer comparison. Its range checks/unchanged oracle outcomes are inherited verification, not extended here to arbitrary f. Feeding NumPy scalars to the permissive helpers can change arithmetic semantics and is not the certified representation. + +## 3. Signed quantization, ADD and SCALE records + +For q=p/D in lowest terms with D positive, `quantized`95–98 computes `y=floor((p*x+u)/D)` in Python integers and checks a genuine in-range seed. The same u is used for every real/imaginary component in that stage; no independence across components is needed for exact inversion. + +ADD's forward increment depends only on its distinct preserved source, coefficient and seed. After later instructions have been undone, that source has its exact forward-time value. Recomputing and subtracting the SAME increment reverses ADD; no per-component residue is needed. A self-ADD would not have that preserved-source invariant and cannot be silently included in the theorem. + +For noninteger SCALE, let `r=(p*x+u) mod D`. Euclidean quotient/remainder give `p*x+u=D*y+r`, including negative x and p, because D>0. The actual source restriction p=±1 therefore gives exactly `x=p*(D*y+r-u)`. `pack_remainders`101–113 stores the real/imaginary residues in their sequential little-endian bit fields; `restore_division`116–133 reads the same order, checks length and unused high padding, and uses that identity. + +Crucially bits=`D.bit_length()-1` is log2(D) only for power-of-two D. The pack/restore helpers do not independently check that condition; it is an explicit source proof premise and actual preceding ledger gate. They do check abs(p)=1 for fractional division. No promise for arbitrary denominators such as3 follows from their permissive call signatures. + +For integer SCALE, u=0 and rounding is exact multiplication by nonzero p. Reverse first checks exact divisibility, then divides. Negative p is safe: a divisible integer's Python floor quotient is its exact quotient. The selected proof states signed powers of two, but the local inverse only needs a nonzero integer; the ledger forbids zero. The sampler alone is not a validator of every arbitrary integer coefficient/program. + +## 4. COPY/CLEAR/INIT, reused labels and record aliasing + +Every forward instruction appends its own record in chronological order, independent of reused field labels. COPY keeps the ACTUAL old destination list then installs a new source list, not merely its ideal zero value. CLEAR keeps the whole actual old field and removes the label. INIT requires that label absent and creates the all-zero N-vector. Forward COPY coefficient1 is checked locally as well as in the ledger. + +Saved old lists are not later mutated through aliases in this execution path. COPY, ADD and quantized SCALE assign new outer lists. Monomial makes a new list before native pair updates; the Gaussian pairs are immutable integer tuples in the actual caller. INIT's repeated zero tuple is immutable. Initial/output snapshots also copy their outer field lists. Consequently storing `record=fields[r]` preserves the old numerical value without requiring a deep copy of mutable payload cells. External concurrent mutation or different component representations are outside the call contract. + +After undoing all later instructions, the state is exactly the output of the current forward instruction. Reverse COPY checks its current equality with the restored source and reinstates its old destination. Reverse CLEAR requires the label absent and restores its saved value. Reverse INIT checks zero and removes the field. If a label was cleared, reused by a later INIT, and cleared again, the later lifetime is undone first; the earlier CLEAR then restores the correct earlier list. Records are indexed by event j, so reuse does not replace an earlier record under one label key. + +This is a descending induction over the fixed word. The native/scalar inverses establish its local steps; COPY/CLEAR/INIT establish its ownership steps. It concludes exact recovery of the supplied initial mapping, as the final equality guard checks. `tape[j]=None` releases the stored slot only after its value is bound to the current local record; this does not change the record used for that inverse step. + +## 5. What invertibility does and does not mean + +The augmented forward endpoint plus its valid retained records determines the original input. Exact inversion holds for arbitrary valid supplied seed values; freshness/unbiasedness is a separate premise for the source's error theorem. The deterministic test callback is therefore not a randomness certificate. Later forward stages cannot infer fresh conditional randomness from replaying a retained seed. + +The implementation restores fields and returns a separately copied output snapshot. It does not return a physical full-register permutation, restore every seed as fresh random tape, justify erasing those records for free or admit a reversible fixed-tape implementation. Setting Python record slots to None and releasing managed objects is not itself reversible hardware cleanup. In particular this audit does not call the returned initial fields alone an injective map of all original randomness; seeds/records are the information used by the inverse. + +Arbitrary correlations among public inputs are allowed by the pointwise integer identities. They do not make output/record/input statistically independent. Arbitrary ambient physical fields and tape heads are not modeled by this indexed Python reference, so no physical spectator/owner return claim is fabricated from its dictionary equality. + +## 6. Written weakening controls — UNEXECUTED + +1. **Lost division residue:** at q=1/2,u=0, inputs0 and1 both round to0. Their residues distinguish them. Omitting the record destroys injectivity; this is already a source control theme, not a new observed result. +2. **Wrong signed division convention:** for x=1,p=-1,D=2,u=0, floor gives y=-1,r=1 and the source formula recovers1. Truncating that quotient to0 with the same residue instead recovers-1. Signed floor and nonnegative remainder must be paired. +3. **Unsupported scalar domain:** denominator3 is outside the dyadic contract and its residues need not fit bit_length(D)-1 bits. Fractional numerator3 is rejected by the source division-record guard. Integer zero is forbidden by the preceding ledger. None is a counterexample to the selected valid caller. +4. **Self-ADD:** x←x+x followed by subtracting the increment recomputed from changed x does not recover a general x. The actual ledger's source!=target gate is necessary for the shown ADD inverse. This does not allege that the selected word contains such an instruction. +5. **Discard old COPY/CLEAR value:** ideal-zero or owned labels can hold numerical error. Overwriting their actual old values without a record loses information; a final copied value or a public ideal identity does not reconstruct it for free. Event-indexed records are also needed across reused-label lifetimes. +6. **Wrong seed/order:** replacing a pair sign or scalar seed on reversal changes the quantizer/center; reversing a composed native without reversing its layer order requires an extra commutation identity not used here. Exact-grid examples can hide such errors, so the all-integer local inverse argument is the relevant obligation. +7. **Shape/dtype weakening:** scalar zip can truncate unequal field lengths, and fixed-width numerical scalar types can overflow. The theorem uses common N and Python integers; the actual initial builder and operation invariants supply them. No hostile packet validator is claimed. +8. **Freshness/physical overclaim:** recovering integer fields after consuming retained records does not supply a fresh entropy reservoir, record-erasure implementation, full-state hardware permutation, physical tape bound or the old fast-child tariff. These require different contracts. + +No control was run and no source finite count, corruption outcome or error constant was newly certified. + +## Conclusion and credit + +The actual producer/ledger path supplies the crucial dyadic, nonzero, fractional-numerator, distinct-operand, frame and ownership preconditions. The literal sampler then has a complete compositional reached-state inverse under the stated shapes and immutable Python integer representation. No new large NumPy/source-word replay is required for this written implication, and none was performed. This is not arbitrary-program/API validation or a new full selected-caller numerical execution. + +Credit Ali Romman6546 and6532/6526/6509, source native/compiler and rounding lineage; DreamingOfClouds6030 selected word; Cinna Davis4088/2226 representations; Nick Petalas6418/6438 ensemble/reuse work; zxv6066 stochastic-shear/restored-randomness warning; all original notices.6547/6594 retain their distinct recovery-floor results. Native all-columns, complete compiler/physical/stock/tape/precision/analytic/outer, accelerated child price, human/kernel acceptance and all five selected assumptions remain. No κ/frontier/adoption change or merge follows. diff --git a/research/retained-record-inverse-review/RECORD-CROSS-DERIVATION.md b/research/retained-record-inverse-review/RECORD-CROSS-DERIVATION.md new file mode 100644 index 0000000000..b52286ce23 --- /dev/null +++ b/research/retained-record-inverse-review/RECORD-CROSS-DERIVATION.md @@ -0,0 +1,90 @@ +# Post-seal source binding of the retained-record derivation + +**Verdict: qualified PASS for the actual fixed-source producer/ledger/caller path and valid Python-integer field representation. No material record-inverse gap was found.** The source's record convention is not literally the unshifted residue notation in my abstract draft; that distinction is resolved explicitly below rather than changing the sealed draft. + +My target-known first draft remains SHA256 `0897e63208288b5b0303a92d638467fd4fce23f5ebe60ec49323223e333a3407`. After both seals I read actual `INPUTS/{sampler.py.txt,PROOF.md,produce.py.txt,verify.py.txt,ledger.py.txt}` and peer `RECORD-CODE-DRAFT.md`, provided SHA256 `be6e2c8c9c6c272da7a6718699705c11ba80a34c00c6fcb549a0f40a99fd2b6b`. No first note/seal, source or package was edited. No source/new scientific program, source-word scan, NumPy import/install, constructor, all-column test, numerical experiment, mutation, census or kernel was executed. + +Source: Ali Romman's PR6546 at `ff038070b8d122a43993f2b2524154323cc6b4d7`, `research/selected-absolute-stochastic-caller/`. Source pins identified by the peer are sampler `2f7ba4b7d01213beb2a3b070658617ff992e715e`, PROOF `178000008b30144cf607dabd0d1759056fd4a644`, producer `5ed6163e903da47268a3ca44786126e6e978dff6`, ledger `728b2901176f11de2958c0e296061755b7305727`, verifier `aea6fd3df8b1d666cf963ce1e338a0a4074035aa`. This note statically binds the coordinator-authenticated copies; it does not newly validate their source/receipt outcomes. + +## 1. Actual producer and ledger define the relevant domain + +`verify.run` authenticates its pinned source inputs, loads the selected word, invokes the recipe producer, and calls `ledger.analyze` before `execute`. The source's successful selected-word scan is inherited evidence, not reproduced here. Reading those guards establishes the implication they would enforce on the actual successful path; it is not a new verification of all22803 events or an arbitrary-program admission theorem. + +The ledger checks nonzero scalar coefficients, dyadic positive denominators, target frame, numerator+/-1 for noninteger SCALE, distinct same-frame ADD/COPY operands, selected unit COPY, MOVE frame/ownership, INIT/CLEAR ownership lifetimes and final frame/ideal endpoints. The MOVE Boolean is ownership information, not an inverse flag. Integer SCALE's local inverse needs a nonzero signed integer and exact divisibility; the source's selected powers-of-two restriction is a narrower word fact, not needed to justify signed exact division itself. + +The scalar helpers alone do not establish all these constraints. In particular `pack_remainders` uses `D.bit_length()-1`; this equals log2(D) only under the preceding dyadic denominator premise. The source checks abs(p)=1 locally for division records, but does not turn the helper into a general arbitrary-denominator API. The guard path supplies the needed conjunction. + +Initial values in the actual caller fixture are a mapping of the intended public labels to lists of Gaussian integer tuples, with common N=512^f and positive integer f. Shape preservation is an invariant: INIT creates N entries, COPY preserves N, scalar operations preserve N when lengths agree, and native validates N. ADD's `zip` is not an independent malformed-shape validator. The general inverse conclusion is conditional on the common-shape contract and no interfering mutation, not on accepting arbitrary arrays/programs. + +## 2. Actual fractional residue is seed-shifted + +For one component the code uses + + y = (p*x+u)//D, + r = (p*x+u)%D, + +with D>0 and0<=u0, 0<=u=15minutes verification before01:13:57Z. No source/NumPy import, producer/densecaller/all-column/sourcefixture/census/largeanalysis execution, new scientific program, kernel/native/Docker/paid work or dependency installation.", + "method": "Target-known abstract inverse draft sealed before current source/peer; source-aware code draft separately sealed before peer; then source/peer and exact assembled review. Root prior scout/PR-body and lateractualsource exposure disclosed; historical familiarity not excluded, no blind/human/kernel claim.", + "bottleneck_link": "Retained-state recovery requires exact seeds, residue convention, snapshot ownership and word-order bindings; an abstract rounding identity alone does not establish the whole caller inverse or cleanup of retained information.", + "family_decision": "Independent review of existing complete retained-record dispatch and actual analyze-before-execute contract, distinct from6547/6594capacity floors and6747/6750DDG/reversal audits. No newcaller, errorbound, retentionfloor or bill.", + "outcome": "partial", + "scientific_status": "WRITTEN_RETAINED_INVERSE_REVIEW_NO_GAP_FOUND", + "author": "ToikY", + "ai_assistance": "Substantial OpenAI Codex with separate target-known abstract, source-aware code, metadata and finalbyte roles; code earlier source6546scout disclosed, seals before cross-reading.", + "credit": "AliRomman6546caller/inverse/error/bill with6526/6532/6509; NickPetalas6418/6438 andseparate6594capacity, Ali6547zero-fiber; zxv6066stochasticABI/freshness warning; DreamingOfClouds6030word/P104lineage; CinnaDavis4088/2226/nativecompiler and all sourceNOTICE authors. Classical rounding/residue/retained-record methods. ToikY/OpenAI Codex external review.", + "claim_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19429470", + "overlap": { + "at": "2026-11-06T00:15:53.602694+00:00", + "live_open_prs": 700, + "complete_pages": [ + 100, + 100, + 100, + 100, + 100, + 100, + 100, + 0 + ], + "source_head": "ff038070b8d122a43993f2b2524154323cc6b4d7", + "queries": "Hub/index andallstate exactpackage/6546inverse/6546audit;nearest6547/6594capacity and6573/6574localblocks,sourcePR/emptycomments. No direct whole-record externalreview identified amongreturnedresults; sourcealreadyowns fullinverse and extensivefinitechecks.", + "limits": "Sparse36notes/8881unsearched; hidden/unindexed/diff/unpublished work UNKNOWN; hash/decimal substring falsepositives not mathematical overlap, no noveltyfromabsence.", + "excluded": "99 priorPRs plus6745\u20136750; source6546construction/22803events/1477632columns/54fields/578N/824/error andallpriorfinitevalues notnew/recounted." + }, + "remaining_obligations": [ + "Original formal/kernel gate unmet; source-awareAI agreement not blind/human/kernelacceptance.", + "Source wholeword successfulscan/1477632columns/numeric/error/count/bill/retention/fixture outcomes not rerun. Actual literal guard implication is audited; source upstream WORD/compiler bytes only declared context pins unless separatelychecked. This inert subset is not a runnable originalsuite closure.", + "ExactPythoninteger values/equalN/list-of-tuples input, immutable word/recipes, valid seeds and9bit permutations/rank domain, ledger nonzero dyadic scalar/noninteger numerator\u00b11/nonalias/frame/lifetime premises. sampler alone is not arbitrary hostile-program admission.", + "Reached-state injection with retained seeds/oldfields/residues, not full-state identical-register permutation, physical entropy erasure or a memory minimum. Conditionalfreshness needed forforwarderror is not needed fordeterministic same-seed inverse and is not restored by it.", + "No dense/NumPy/native/circuit/tape/sampling/retainedcleanup/acceleratedrecursive/outer/fullsupplier/allfive selectedassumption discharge, kappa/frontier/adoption/merge." + ], + "open_questions": [ + { + "question": "Can the exact whole-record inverse and literal caller guard implication be checked in a proof kernel?", + "why_it_matters": "Written roles do not meet formal acceptance.", + "first_step": "Formalize shifted Euclidean residues, same-seed Gaussian pair, route/layer inverse and chronological field-map induction.", + "blocked_by": "No proof-kernel budget or development in this written session." + }, + { + "question": "Which physical implementation realizes the retained-record service and complete cleanup bill?", + "why_it_matters": "A direct exact Python recovery is not a reversible physical circuit or a fast recursive child.", + "first_step": "Bind entropy/oldfield/residue ownership, tape placement, primitive work and return cleanup beforeadmission.", + "blocked_by": "Source explicitly leaves physical sampling/gates/tape/retainedcleanup/acceleratedrecursive/outer obligations open." + } + ], + "evidence": "Target-known abstract sealed00:20:58.234048UTC SHA0897e63208288b5b0303a92d638467fd4fce23f5ebe60ec49323223e333a3407 before current source/peer; source-aware code sealed00:22:27.630825 SHAbe6e2c8c9c6c272da7a6718699705c11ba80a34c00c6fcb549a0f40a99fd2b6b beforepeer, prior scout/history disclosed. Exact source/peer cross SHAe66904c000de8734c8194e2b119e35952c75f150dfa8d13b5c5f9238fe614c5b reconciles actual seed-shifted Euclidean residue with abstract unshifted formulation and purePythonpayload vs separateNumPyproducer. REVIEW13711B SHA5df997c37f2d31027ddb780363fa4de03c482572aa0b27cb52ae28e5f762d7d3. Abstract9/code8 overlapping UNEXECUTED controls, not17experiments. Literal ledger guards beforeexecute imply nonzero/dyadic/numerator/domain/alias/lifetime conditions; successful source wholeword/allcolumn/finite/error/bill outcomes notrerun. Source10/88526B (8foreign+2canonicalroots), canonical10provenance/fullcard/claim and remoteGitcommit-root-research-package modes/blob/size custody checked. Threeupstreammainword/compiler path/blob/mode identities checkedonly; rawbodies/SHA notnewchecked. Zero source/science/NumPy/kernel commands, no runnableoriginalsuiteclosure. Assembled/commit/export/public/CI receipts separate." +} diff --git a/research/retained-record-inverse-review/inputs/LICENSE b/research/retained-record-inverse-review/inputs/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/retained-record-inverse-review/inputs/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/retained-record-inverse-review/inputs/NOTICE b/research/retained-record-inverse-review/inputs/NOTICE new file mode 100644 index 0000000000..b2820d48cf --- /dev/null +++ b/research/retained-record-inverse-review/inputs/NOTICE @@ -0,0 +1,50 @@ +New work: Ali Romman with substantial OpenAI Codex assistance. No subagents. +Apache-2.0. + +DreamingOfClouds supplies the selected PR6030 word. Its P104 lineage through +PR5907, PR5827, PR5811, PR5786 and earlier work remains credited. +https://github.com/CrocSwap/integer-mult-bounds/pull/6030 + +Ali Romman's PR6526 supplies the exact signed forward/reverse transfer method +and Hilbert tail proof. The new package changes the local error contract and +supplies the complete numerical caller and retained-state inverse. +https://github.com/CrocSwap/integer-mult-bounds/pull/6526 + +Ali Romman's PR6532 supplies the pair map, conditional moment proof and route +formula adapted in sampler.py. PR6509 supplies the prior deterministic center +family. PR6540 supplies a distinct coarse-grid codec and eight rank checks. +https://github.com/CrocSwap/integer-mult-bounds/pull/6532 +https://github.com/CrocSwap/integer-mult-bounds/pull/6509 +https://github.com/CrocSwap/integer-mult-bounds/pull/6540 + +Nick Petalas supplies PR6438's unbiased reversible ensemble construction and +PR6418's adaptive reuse bound. zxv's PR6066 supplies the reversible stochastic +shear ABI and earlier warning that restored randomness need not be fresh. +https://github.com/CrocSwap/integer-mult-bounds/pull/6438 +https://github.com/CrocSwap/integer-mult-bounds/pull/6418 +https://github.com/CrocSwap/integer-mult-bounds/pull/6066 + +Cinna Davis, 1337isnot1337, PR4088 and PR2226, supplies the consumed exact +native representations. All source notices remain unchanged. The compiler +retains the work of icekylinx, DreamingOfClouds, vendor531, Rohan Arun and the +preceding Gaussian lineage. Source coordinate code and source compiler remain +separate implementations; neither source is authored by this package. +https://github.com/CrocSwap/integer-mult-bounds/pull/4088 +https://github.com/CrocSwap/integer-mult-bounds/pull/2226 + +Tekalign's reversible lifting, JoyboyBrian's rounded ports, Arham Tahir's +numerical work and the PR4743/PR5485 lineage precede the pair construction. +Chris R / Clear1nsight and the credited PR4017 contributors supplied a distinct +source-bound deterministic native circuit with dirty scratch. +https://github.com/CrocSwap/integer-mult-bounds/pull/5485 +https://github.com/CrocSwap/integer-mult-bounds/pull/4017 + +Ali Romman's PR6499 supplies a different exact scalar grid contract between +independent native returns; PR6506 lowers that scalar layer to Boolean +circuits. Their native return/error and reset premises are not imported. +https://github.com/CrocSwap/integer-mult-bounds/pull/6499 +https://github.com/CrocSwap/integer-mult-bounds/pull/6506 + +Integer residue retention, scalar stochastic rounding, martingale orthogonality +and the concentration argument are established mathematics. No global +literature priority or physical reversible implementation is claimed. diff --git a/research/retained-record-inverse-review/inputs/PROOF.md b/research/retained-record-inverse-review/inputs/PROOF.md new file mode 100644 index 0000000000..178000008b --- /dev/null +++ b/research/retained-record-inverse-review/inputs/PROOF.md @@ -0,0 +1,282 @@ +# An absolute-error numerical caller with retained inverse state + +This result supplies a complete integer numerical execution of the selected +[PR #6030](https://github.com/CrocSwap/integer-mult-bounds/pull/6030) word and its literal inverse. It also proves error bounds for every +tensor width. It does not supply a physical reversible circuit, a fast recursive +native child, a fixed multitape schedule or a new complete kappa. The selected +frontier and all five framework assumptions remain unchanged. + +## Source and contract + +The source is the 22,803-event selected word pinned in SOURCES.json. It has +770 public fields, 29 owned labels, 31 INIT/CLEAR lifetimes, 23 COPY events, +18,404 ADDs, 861 SCALEs and 3,453 MOVEs. A field has N=512^f complex coordinates, +where f is a positive integer. The operator at each frame is the tensor power +of its 512-coordinate source frame. This defines the explicit tensor lift of +this fixed word. It does not identify every recursive caller with that lift. + +Every stored real and imaginary component is an integer times the same positive +grid spacing h. Public input integers are arbitrary. Each forward rounding +stage receives a new uniform seed, conditional on the entire previous state. +It can use one seed for all coordinates of that stage. The inverse retains and +reuses that stage's seed. No later forward stage can reuse it under this proof. + +The source compiler gives a recipe L C_r R for every one of the 2,886 distinct +MOVE edges. The independent coordinate implementation checks all 512 columns +of every recipe: 1,477,632 column comparisons. Both source modules run unchanged +with assertions enabled. The new matrix interpreter uses the same route tables +as the sampler, with exact linear pair arithmetic. Integer range checks keep +all matrix comparisons below the int64 limit. The rank counts for ranks 1 +through 8 are 2219, 457, 496, 100, 163, 11, 6 and 1. Their weighted sum is 5952. +The source's last MOVE Boolean is an ownership flag, not an inverse flag. + +## Completed numerical primitives and their inverses + +The central Gaussian pair is + +```text +C = [[1+i, 1-i], [1-i, 1+i]] / 2. +``` + +For integer Gaussian x,y put s=x+y and d=x-y. If Re(s)+Im(s) is even, let +c=0. Otherwise let c be sign(Re(s)) when Re(s) is odd, and `i*sign(Im(s))` +otherwise. With a fresh fair sign sigma, use + +```text +d' = i*(d-sigma*c)+sigma*c, +x' = (s+d')/2, y' = (s-d')/2. +``` + +All halves are exact integers. The sum s stays fixed, so the inverse uses +-i in the same formula and the same sign. The mean is the ideal C pair. The +squared error is h^2 when c is nonzero and zero otherwise. Thus one complete +layer of N/2 pairs has conditional mean-zero defect, squared error at most +`N*h^2/2`, and pathwise norm at most `h*sqrt(N/2)`. A common sign for the layer +is sufficient. These pair facts and their construction are prior [PR #6532](https://github.com/CrocSwap/integer-mult-bounds/pull/6532) work. + +A rank-r tensor native operator has `r*f` such layers, between its exact tensor +monomials. Use a fresh sign at each layer and reverse layers in the opposite +order for decoding. Conditional zero mean and unitary ideal layers give + +```text +E(native output | input) = (L C_r R)^tensor f input, +E(||native defect||^2 | input) <= r*f*N*h^2/2, +||native defect|| <= r*f*h*sqrt(N/2). +``` + +The stage construction need not attain the least variance of the complete +native operator. [PR #6540](https://github.com/CrocSwap/integer-mult-bounds/pull/6540) gives a different changed-grid interface and sharper +pointwise variance class; its grid and residue contract is not substituted here. + +For a scalar q=p/D in lowest terms, D is a power of two in the source. Given a +fresh uniform u in [0,D), round each component v by `floor((p*v+u)/D)`. Integer +q needs no seed and is exact. For noninteger q, each coordinate has the exact +mean `q*v`, variance at most 1/4 and absolute error below one grid unit. Hence a +complete complex field has variance at most `N*h^2/2` and pathwise norm at most +`h*sqrt(2N)`. Dependence between coordinates does not change these bounds. + +ADD performs y += `round(q*x)` and preserves x. Its inverse subtracts the same +integer increment from the restored x, with the retained seed. It needs no +residue label. Every noninteger SCALE in this source has p=+1 or p=-1. Store +for each real component the residue `v=(p*x+u)` mod D, using log2(D) bits. From +the rounded y, recover `x=p*(D*y+v-u)`. Integer SCALE factors are signed powers +of two; their inverses divide exactly on the reached image. + +COPY has coefficient one. Retain its old destination, then copy the source. +Its inverse checks the copied value and restores the old destination. CLEAR +retains the entire old field, and its inverse restores it. INIT inserts a zero +field; its inverse checks zero and removes that field. Thirty of the 31 ideal +CLEAR inputs are nonzero. This construction does not treat their data as free +clean scratch or prove that the retained values can be erased from outputs. + +Reverse all 22,803 instructions. Each step receives the state that its forward +step produced, because later steps have already been reversed. The local +inverse rules therefore recover every public input exactly. This is a bijective +encoding of reached states with a retained record, not a full-state permutation +on identical finite hardware registers. No unpriced dirty compensation follows. + +## Exact decoded transfer coefficients + +Decode each field by its current unitary frame. Ideal MOVE is then the identity; +ADD, SCALE, COPY and resets act by their displayed scalar word. The source frame +and ownership ledger is checked at every event. Independent forward and +transposed backward sweeps agree on every signed defect coefficient of every +final field. Reverse-cut checks also reconstruct each peak below. + +For cut t and field v, let c_j be the signed scalar transfer from a completed +instruction's defect to that field. Retain a defect only for native MOVEs and +noninteger ADD/SCALE instructions. Define + +```text +M(t,v) = sum_native j rank(j)*c_j^2, +S(t,v) = sum_noninteger scalar j c_j^2, +AM(t,v) = sum_native j rank(j)*abs(c_j), +AS(t,v) = sum_noninteger scalar j abs(c_j). +``` + +Shared earlier errors must be combined with their signs before squaring. +COPY propagates an existing error; it is not a fresh independent error. CLEAR +kills later transfer but cannot remove an earlier prefix excursion. The exact +maxima of all four scores occur at cut 20644, field 558: + +```text +M = 23423, +S = 161509/8, +AM = 2957, +AS = 4917/2. +``` + +Cut numbers count completed source events. The maximum ideal row L1 norm is +850, at cut 20479, field 558. Every ideal final row has the source's required +identity or identity-plus-productive-input form. RESULT.json records all 799 +final scores, coefficient digests, peak checks and ideal CLEAR inputs. + +## All-width absolute error bounds + +Let e(t,v) be the difference from the ideal execution with the same input. +All ideal charts and transfer coefficients are deterministic. At each native +microstage, the later ideal stages form a deterministic unitary map. Fresh +conditional zero mean makes distinct microstage and scalar defects orthogonal +in expectation, even when their inputs depend on earlier rounded values. +For every field at every cut, + +```text +E||e(t,v)||^2 <= (N*h^2/2) * (23423*f + 161509/8), +||e(t,v)|| <= h*sqrt(N/2) * (2957*f + 4917) for every seed stream. +``` + +There is no division by the input norm and no small relative-error premise. +The bound is valid for every input size. It also holds at zero input; in that +case this specific program in fact remains exactly zero. + +For a Hilbert-space martingale with increments bounded by deterministic b_j, +its sum S satisfies `Pr(||S||>=R) <= 2*exp(-R^2/(2*sum b_j^2))`. For completeness, +put a=||x|| and d=Re/a, with ||z||<=b. The increasing convex function +`cosh(lambda*sqrt(s))` lies below its secant on [(a-b)^2,(a+b)^2]. Therefore + +```text +cosh(lambda*||x+z||) + <= cosh(lambda*a)*cosh(lambda*b) + + (d/b)*sinh(lambda*a)*sinh(lambda*b). +``` + +Conditional zero mean removes the second term. The zero-a or zero-b cases +follow directly. Iterate, use cosh(x)<=exp(x^2/2), and apply Markov's inequality +with lambda=R/sum(b_j^2). This proves the stated bound. Zero total increment +bound gives zero error separately. This classical argument is also retained +in [PR #6526](https://github.com/CrocSwap/integer-mult-bounds/pull/6526); no new concentration inequality is claimed. + +For a fixed cut, each native microstage contributes a squared bound +`c_j^2*N*h^2/2`. Each noninteger scalar contributes at most `4*c_j^2*N*h^2/2`. +Only one field changes at each source event. A union over the 22,803 event +destinations covers all fields at all prefixes, including fields later cleared. +For every epsilon>0, + +```text +Pr(max_all_fields_and_prefixes ||e|| >= epsilon) + <= 45606 * exp(-epsilon^2 / (N*h^2*(23423*f + 161509/2))). +``` + +Unlike a relative contract, these deterministic absolute bounds require no +feedback stopping argument. Scalar and native coordinate correlations are +allowed; fresh forward randomness remains a necessary premise. + +At f=1, `h=epsilon*2^-12` makes every individual RMS error below epsilon. +With `h=epsilon*2^-16` the simultaneous failure probability is below 2^-40. +These are different guarantees, not least physical precisions or a direct +comparison with [PR #6526](https://github.com/CrocSwap/integer-mult-bounds/pull/6526)'s input-relative guards. The rational certificate proves +an even weaker exponent 8388608/208355 sufficient: the first 65 positive terms +of its exponential already exceed `45606*2^40`. The actual width-one binary-grid +exponent at 16 bits is twice that value. + +For a simple all-width rule, let b be the least nonnegative integer with +4^b>=f. Since f>=1, each displayed squared bound is at most f times its +width-one value. It suffices to choose + +```text +h = epsilon * 2^(-ceil(9*f/2)-8-b) for individual RMS error, +h = epsilon * 2^(-ceil(9*f/2)-11-b) for simultaneous failure below 2^-40. +``` + +The direct width-one RMS check improves the first sufficient rule by one bit. +No probability statement is inferred from the deterministic test seed stream. + +## Complete direct work and retained-state bill + +The literal reference uses ordinary integer operations and indexed storage. +A forward run uses `2976*f*N` rounded pair butterflies and 6906 tensor monomial +coordinate passes. A route pass reads f address digits per coordinate. The +inverse pays the same counts. Each pair uses at most 13 real additions or +subtractions, four exact halves and three sign changes, plus parity, bounds +and control checks. Each monomial applies at most two payload sign changes +per coordinate. There is no free native query or free Gaussian tensor power. + +The 18,404 ADDs and 861 SCALEs each evaluate two scalar components per +coordinate. ADD also pays two destination additions per coordinate. Reverse +ADD repeats its quantizer and subtracts. Reverse SCALE reads its residue or +performs an exact signed power-of-two division. The coefficients have absolute +numerators at most 16 and denominators at most 16, so their ordinary integer +work is linear in the signed payload width. Packing, reads, writes, domain +checks and buffer initialization are included, not treated as zero work. + +The exact retained budget for this uncompressed schedule is + +```text +fresh retained seed bits = 5952*f + 18592, +division residue bits = 578*N, +retained old whole-field values = 23 COPY + 31 CLEAR = 54 fields, +peak live plus retained values = 824 fields. +``` + +At width one these are 24,544 seed bits and 295,936 residue bits. The forward +schedule allocates 31 zero fields and copies 23 destinations. Reverse traversal +releases the corresponding values after use. These are upper bounds for this +specific record format, not joint information minima or clean hardware costs. +The checker also keeps copies of all 770 initial fields and all 770 output +fields to compare its inverse. Those verification copies are additional +storage and field-copy work; they are not included in the 824-field schedule. + +The two monomial routes for each distinct edge store 512 nine-bit destinations +and 512 two-bit phases each: 32,507,904 logical table bits for all 2,886 edges, +plus the small source recipes and rank/frame tables. The compiler and table +setup are finite costs. The dense all-column comparison is verification work, +not a hidden zero-cost runtime primitive. + +For input components of magnitude below 2^w, w>=1, the ideal field norm is +at most `850*sqrt(2*N)*2^w`. The pathwise bound above bounds the additional error. +A sufficient signed stored-component width is + +```text +W = w + ceil(9*f/2) + ceil(log2(1700+2957*f+4917)) + 2. +``` + +Six more bits suffice for displayed pair/scalar temporary arithmetic. This is +a sufficient width, not an optimum. The reference uses `O(f*N*W)` indexed bit +work per full forward/inverse word, with the fixed event counts above; address +arithmetic also costs O(f) bits and is covered since W>=f. Its data storage is +`O(N*W)`, with all field/verification-copy constants stated above, plus residues, +seeds and fixed route tables. A physical sampler, reversible gate lowering, +fixed tape routing, retained-data cleanup, accelerated recursive child costs, +outer error recovery and independent proof acceptance remain open. The direct +`O(f*N*W)` evaluation is not priced as the selected fast recursive supplier. + +## Verification and limits + +The registered normal and optimized commands regenerate every source recipe +and compare every matrix column. Source assertions stay enabled in a normal +subprocess. Both exact transfer sweeps and all reverse peak checks run. +Local finite checks enumerate pair inputs, every seed for all source scalar +coefficients, signed division residues and a complete mixed stochastic +trajectory. A 262,144-coordinate rank-eight tensor round trip exercises all +16 active layers. A separate exact-grid tensor input is seed independent and +agrees on all 262,144 coordinates with the source oracle. A dense width-one +run executes and reverses the complete +source word. A separate source-coordinate decoder checks all 770 final fields. +Semantic controls retain lost-residue, wrong-seed, reused-seed, signed-COPY, +CLEAR-prefix, global-phase and conjugation failures. Source byte changes are +rejected. RESULT.json gives the exact counts and hashes. + +These checks and the written proof establish the stated numerical contract. +They do not constitute an independent human review, proof-kernel acceptance, +a full predecessor scientific replay, a selected cold replay, or any of the +five complete framework assumption discharges. diff --git a/research/retained-record-inverse-review/inputs/README.md b/research/retained-record-inverse-review/inputs/README.md new file mode 100644 index 0000000000..55cfda784c --- /dev/null +++ b/research/retained-record-inverse-review/inputs/README.md @@ -0,0 +1,62 @@ +# A complete stochastic numerical caller with absolute error bounds + +The selected 22,803-event [PR #6030](https://github.com/CrocSwap/integer-mult-bounds/pull/6030) word now has a same-grid integer execution +with a literal retained-state inverse. Every one of its 2,886 distinct native +edges is checked on all 512 columns. A dense complete caller run and reverse +replay pass. A separate source-coordinate decoder checks all 770 final fields. + +For N=512^f and grid h, every field at every completed source prefix satisfies + +```text +E||error||^2 <= (N*h^2/2)*(23423*f + 161509/8). +``` + +At width one, grid spacing `epsilon*2^-12` suffices for individual RMS error +below epsilon. Spacing `epsilon*2^-16` gives simultaneous error below epsilon +with probability greater than 1-2^-40. These are absolute-error +contracts. They do not require a relative allowance that fails at small inputs. +The proof includes all-width rules and every retained value and direct cost. + +No complete kappa, physical reversible circuit, fast recursive supplier, +fixed tape schedule or selected assumption discharge is claimed. All five +framework assumptions and the selected frontier remain unchanged. + +- [PROOF.md](PROOF.md): complete numerical ABI, proof, error and work bounds. +- [RESULT.json](RESULT.json): exact source, transfer, execution and control receipt. +- [sampler.py](sampler.py): integer primitives, full caller and literal inverse. +- [ledger.py](ledger.py): signed coefficients from forward and reverse sweeps. +- [produce.py](produce.py): every native edge, checked against the separate source. +- [endpoint.py](endpoint.py): independent decoded numerical endpoint. +- [verify.py](verify.py): complete registered replay and rejection controls. +- [SOURCES.json](SOURCES.json), [NOTICE](NOTICE): source pins and attribution. + +Use CPython 3.12 and NumPy 2.3.4: + +```sh +python3.12 -B scripts/research_package.py --package research/selected-absolute-stochastic-caller +``` + +Both registered modes keep source assertions enabled in normal subprocesses. +The replay regenerates all 1,477,632 native column comparisons and the complete +caller. It also checks 2,401 pair inputs, 48 wide integer round trips, 2,015 +scalar contexts, 5,140 division round trips, all 32 seeds of a mixed trajectory, +and a 262,144-coordinate rank-eight tensor inverse. A separate exact-grid +input checks the tensor operator against the independent source oracle. Seven semantic controls, +two operator mutations and three actual source-corruption rejections remain. +These checks support the written theorem; they are not independent acceptance. + +The claim followed fresh canonical-main and public PR/Discussion checks, with +a second exact-main README/TASK search. Prior [PR #6526](https://github.com/CrocSwap/integer-mult-bounds/pull/6526) supplies the signed +stochastic caller method; [PR #6532](https://github.com/CrocSwap/integer-mult-bounds/pull/6532) supplies the conserved-sum pair sampler. +[PR #6540](https://github.com/CrocSwap/integer-mult-bounds/pull/6540)'s changed-grid codec is distinct. The complete same-grid caller join, +absolute budgets, full source-edge binding and explicit retained record are +new here. No subagents were used. + +## Open next questions + +A physical reversible implementation must price seed access, routing, records +and their cleanup. It must preserve arbitrary external dirty values under its +actual encoding. The direct native execution here is not the accelerated +recursive supplier. Bind one fast child to this numerical ABI, then recompute +the complete caller, tape, precision and outer bill. No such result follows +from the finite source checks or the information-preserving reference alone. diff --git a/research/retained-record-inverse-review/inputs/ROOT-NOTICE b/research/retained-record-inverse-review/inputs/ROOT-NOTICE new file mode 100644 index 0000000000..59d8e0cf31 --- /dev/null +++ b/research/retained-record-inverse-review/inputs/ROOT-NOTICE @@ -0,0 +1,415 @@ +A sharper exponent for integer multiplication +Copyright 2026 Douglas Colkitt + +This project includes unmodified source files from OpenAI's manuscript +"Integer multiplication below n log n" and its accompanying repository: +https://github.com/openai/math +Commit: adc7f1241b42e322a6451854ab7e4b4c146bf78a + +The original manuscript identifies OpenAI as its author. Its Apache-2.0 +license is retained at upstream/LICENSE. The exact source URLs and hashes +are recorded in upstream/manifest.json. Proposed modifications are supplied +as separate files under patches/; upstream source files remain unchanged. + +The original local research note, scripts, certificates, patches, and +documentation were prepared by Douglas Colkitt with assistance from OpenAI +Codex. The community release incorporates work by the contributors identified +in the notices below; it is not solely Douglas Colkitt's work. +This project is not an official OpenAI release or an OpenAI endorsement. + +Related contributions (not imported in this checkpoint): +Zhihao Chen (jacklightChen), PR #7, supplied an earlier ternary five-subset +motif, finite-alphabet transfer and a different compressed producer: +https://github.com/CrocSwap/integer-mult-bounds/pull/7 +The present checkpoint claims no priority for that motif. Related compressed +complex-network work was submitted by eumemic in PR #3: +https://github.com/CrocSwap/integer-mult-bounds/pull/3 +The pending contributions and their stronger bounds require their own review; +this notice does not represent adoption or verification of their claims. + +Additional community work, including parallel and superseded submissions, is +acknowledged in CONTRIBUTORS.md, with pinned submission metadata in +docs/research/contribution-snapshot.json. These acknowledgements do not imply +joint authorship of the checkpoint, incorporation of pending code, or verification +of submitted mathematical claims. Original source-specific notices remain in force. + +Community release (accepted by conditional maintainer audit): +The following original contributor notices apply to the imported PR #39 chain. +The preceding non-import statements describe the preserved 2^-30 checkpoint. + +Ternary five-subset construction and common-four-point resynthesis +Copyright 2026 Zhihao Chen (jacklightChen) + +This is Zhihao Chen's first submission of this specific construction to this +repository. Research, proof development, code and verification were prepared +with substantial assistance from GPT-6 Astra (OpenAI Codex), as identified by +the contributor. This is not independent review or an OpenAI endorsement. +Future research building on this contribution should explicitly acknowledge +Zhihao Chen (jacklightChen), cite the accompanying note and pull request, and +retain the preceding contributors' attribution. This notice records research +provenance; the repository's Apache-2.0 license remains unchanged. + +Dependencies retained from eumemic's Claude-assisted PRs #3 and #5: +https://github.com/CrocSwap/integer-mult-bounds/pull/3 +https://github.com/CrocSwap/integer-mult-bounds/pull/5 +PR #5 commit: d3d370c34937503bd3fa63c83d505a05e8e50893 +These include complex_circuit.py, complex_network.py, fast_gaussian.py, +their generators, construction notes and certificates. The Gaussian input +scaling proof is corrected in this derivative; see the modification notice below. +Aligned pairing also appears in Bortlesboat's PR #2. Retained totals and bank +sharing appear in dleen's PR #4 and cheaper retained centers in eumemic's PR #6. +Their results and ideas are credited separately from this new construction. + +Bulk recursion and controlled tensor basis, 8 October 2026 +Copyright 2026 icekylinx + +The new projector batching, controlled simultaneous basis, mixed-width tape +recursions, whole-residual complex recursion, and dependency-path precision +guard in the batched-23 proof package are contributed by icekylinx, developed +with substantial OpenAI GPT-6 Astra assistance. Review corrections and +repository integration were prepared with OpenAI Codex assistance. They build on the retained +PR #7 finite producers and the preceding contributions credited above. +The new package retains the repository's Apache-2.0 license and the original +authors' attribution. It is not an official OpenAI release or endorsement. + +Modification notice, 8 October 2026 (icekylinx): the retained fast Gaussian +proof now bounds shifted approximation error by F=2^ceil(1.14 alpha^2). +The P=34p precision budget and asymptotic exponent are unchanged. New batching +checks are integrated into make verify. Existing attribution and licenses +are retained. + +Partial-swap extension, 8 October 2026 +Copyright 2026 icekylinx + +The partial-swap framing, binary retained-total triple construction, +dependency-preserving positive labels and carrier reuse, unequal (25,23,57) +common basis, improved complex batching, and exact assembly are contributed +by icekylinx with substantial OpenAI GPT-6 Astra and Codex assistance. +This extension directly inherits PR #10, commit +62691e395a0458ce089a1c7b5d89e74291e95e29. The portable producer adapters +modify the retained paired-exclusion and shared-point implementations credited +above. The original licenses, attribution, and Gaussian correction are retained. + +Endpoint-gauge extension, 8 October 2026 +Copyright 2026 icekylinx + +The complementary auxiliary endpoint gauges, (32,30,40) controlled basis, +general nondegenerate binary phase residuals, retained-center complex producer, +updated path guard and exact assembly are contributed by icekylinx with +substantial OpenAI GPT-6 Astra and Codex assistance. This extension inherits +f2ab41aebad47861caf6316282c1793e5513845e and its PR #10 ancestry. New portable +adapters retain the paired-exclusion and shared-point contributions credited +above. Original licenses, notices and the Gaussian correction are retained. + +Structured-basis and semantic-bulk extension, 8 October 2026 +Copyright 2026 icekylinx + +The selected (32,30,36) bit construction, A1/A5 block refinements, fixed +middle-axis I+J profiles with bounded-minor CRT certificates, mixed dyadic +complex centers, complete data-front batching and circuit-specific assembly +are contributed by icekylinx with substantial OpenAI GPT-6 Astra and Codex +assistance. The immediate parent is ed90fd940279c336ebc45968631bdebfb087b505. + +The semantic/bulk compatibility argument, literal scalar charge, product row +stock and parameterization adapt Zhihao Chen (jacklightChen)'s PR #23, +commit 661ebabc1076c9f525d7ce4967c876b203fa9827. Translated complex endpoints +are adopted from the same contributor's PR #21, +commit 5ba6cf0bfb68f2be8d15610e7972207c50254d6a, following eumemic's source-frame +work and the earlier nested-basis contributions. + +Completed-child semantic precision, arbitrary-coordinate routing, phase-cell +Gaussian inversion and bulk tape transfer are credited to the RaD project +(hipotures), commit 45d9b60355872041f9275f77c057514def0d45bc, exposed through +PR #20 at 4f8d6c8272b5ff307a0da51df545ec3cd96a8b6e. Their selected proof +sources retain their separate CC0 license and original NOTICE under +references/semantic-bulk/rad20. The PR #23 source retains its recorded OpenAI +Codex assistance; RaD retains its recorded Codex and GPT-6.1-Sol Ultra +assistance. These are source attributions, not claims about this session's +runtime model. Related contributions by Rohan Arun and Aurel Prosz remain +acknowledged in the imported notices. No exclusive priority or additional +license condition is asserted. + +Copied retained-center extension, 8 October 2026 +Copyright 2026 icekylinx + +The copied retained-center schedule in both orientations, its complex-phase +transfer, the Wm-N+L rank budget, and the selected (25,23)/(28,28) composition +are contributed by icekylinx with substantial OpenAI GPT-6 Astra and Codex +assistance. This extension inherits PR #32 at +0ef3aeb61f55cc0b321ce6a0ef00acee25cefe52 and the preceding PR #10/#18/#24 work. + +The two-stage topology and paid copied-stream endpoint correction are due +to Aurel Prosz (Paureel), c82d09eb4781b68435e3fa3eb6beea72fa900fab, +through Zhihao Chen (jacklightChen)'s PR #29 unequal-axis composition, +9d963275075fa98f1da821e27757b238dafd6b3c. That source also credits Swapnil +Jain's two-stage development at ae405eb474d1486b2d8aef90139869f927f4836a. + +The contiguous corner method, incidence factorization and exact partition +certificates are due to Rohan Arun (PR #31), method commit +02f68f95369c39955c5ffcfddbd75cd83e26b305. The selected (25,23) certificate +specializes Dominik Scholz's parameterization (PR #33), +a499a345c040aa15b68e984a0904eadc485c7a7e. Their source notices and proof +snapshots are preserved in references/copied-centers. Historical OpenAI +Codex, GPT-6 Astra and Anthropic Claude Opus 5.5 assistance is credited to +the respective imported sources. Existing PR #21/#23 and RaD attribution, +licenses and the Gaussian correction remain in force. + +Copied centers with reversed (23,25) data corners, 2026-10-08 +Rohan Arun with substantial OpenAI Codex assistance supplies the composition, +exact dimension23 controls and cost/assembly integration. James Chang's PR34 +supplies the reversed boundary family; icekylinx's PR36 supplies copied retained +centers and the selected complex graph. The balanced assembly remains attributed +to RaD/hipotures and its PR34 specialization. Retain Dominik Scholz PR33, Rohan +Arun PR31, Zhihao Chen PR29/21/23, Paureel/Aurel Prosz, Swapnil Jain, icekylinx, +eumemic, Douglas Colkitt, OpenAI and all earlier notices and hypotheses. +This is not a claim of formal verification, new foundational rank identities, +global optimality or measured runtime speedup. + +Fixed middle basis with copied reversed corners (2026-10-08): +Rohan Arun, with substantial OpenAI Codex assistance. Composition and +simultaneous-basis proof retain icekylinx PR32/36, James Chang PR34, +Dominik Scholz PR35/38, Zhihao Chen, Paureel, Swapnil Jain, RaD/hipotures, +eumemic and all preceding attribution and licenses. See research/copied-fixed-reversed. + +Changed-graph composition with copied centers and fixed bases, 8 October 2026 +Prepared with OpenAI Codex assistance. +The new composition uses icekylinx PR36 copied centers and PR32 fixed-I+J +projectors/profiler, Dominik Scholz PR35 two fixed factors and CRT argument, +Zhihao Chen (jacklightChen) PR29/23 interfaces, Aurel Prosz (Paureel) and +Swapnil Jain's two-stage development, Rohan Arun PR25/31 corner methods, +Dominik Scholz PR33/38 dimension/composition work; James Chang (jamesyc) +PR34 reversed geometry and balanced transfer; Rohan Arun PR37/39/40 +reversed integration, modular data tests and both-fixed baseline; +RaD (hipotures) PR41 changed scalar DAGs, alternating point order and +independent role compiler; RaD balanced routing/bulk interfaces, and all +retained predecessors. +Complete attribution and the conditional proof boundary are recorded in +research/copied-fixed/PROOF.md; imported originals and source pins are retained. +Original Apache-2.0 and CC0 notices remain applicable. + +Community follow-up integration (PRs #49, #45 and #26), 8 October 2026: +Rohan Arun contributes weighted carrier matching and climbed summand/leave-one-out +orders (PRs #44/#47/#49), with Anthropic Claude assistance. The final construction +composes Chafik Boukhalfa's changed-graph checks, exact rational data recovery and +reordered exclusion sums (PRs #43/#46/#48, OpenAI Codex assistance) with RaD / +hipotures's alternating pair order and independent physical role compiler (#41). +All predecessor attribution and conditional proof interfaces remain in force. + +Alejandro Zarzuelo Urdiales contributes Gaussian parity and canonical arithmetic +proofs, finite tensor execution, profile precision accounting and mixed-center +reference checks (#45), with substantial OpenAI Codex assistance. See +research/gaussian-parity-synthesis/PROVENANCE.md for his full attribution. +Ryan S / princezuda contributes historical Lean certificate arithmetic, algebraic +frame/movement/guard lemmas and independent paired-circuit checks (#26). Original +source notices and historical snapshots are preserved. Neither formal package +claims a full formal proof of the multiplication algorithm or a new kappa. + +Joint frame compilation of skip-prefix strips + +The local compiler and exact finite witnesses were prepared by eumemic with +substantial OpenAI Codex assistance. Avi Eisenberg / ikeboy with Anthropic +Claude assistance supplied the unmodified PR #53 skip-prefix producer. +The pinned PR #48 pipeline is Chafik Boukhalfa's contribution, incorporating +Rohan Arun, RaD / hipotures, icekylinx, Dominik Scholz, James Chang, +Zhihao Chen, Aurel Prosz / Paureel, Swapnil Jain, eumemic, Douglas Colkitt, +OpenAI, David Harvey, Joris van der Hoeven and the earlier contributors +credited in the retained sources. See references/frame-compiler/pr48/NOTICE +and references/frame-compiler/pr53/NOTICE for their original attribution. +No authorship or review by those predecessors is claimed for this compiler. + +Joint dual-skip/frame-compiler composition (2026-10-08) +--------------------------------------------------- +Rohan Gupta / gupt1156 with Anthropic Claude assistance: PR55 dual-skip +scalar graph; original LICENSE and NOTICE are retained under +references/frame-compiler/pr55. eumemic with substantial OpenAI Codex +assistance: PR57 joint reversible frame compiler, serialized physical-word +replay and profile reconstruction. Chafik Boukhalfa with OpenAI Codex +assistance: this composition, independent integration and exact certificate. +Avi Eisenberg / ikeboy, Rohan Arun, RaD / hipotures, icekylinx, and all +predecessor authors retain the notices above and in pinned source files. +No original copyright or Apache-2.0 notice is removed. + +Ranked reclamation after the PR58 joint-dual composition (2026-10-08) +---------------------------------------------------------------- +Chafik Boukhalfa with OpenAI Codex assistance: prioritize retired physical +slots by descending current frame rank, retaining slot ID as the tie-breaker; +complete replay, exact profiles, comparison and adversarial controls. +The dedicated joint_dual_reclaim_compiler.py is derived from eumemic's PR57 +compiler. Its original shared compiler remains byte-identical. The PR55 +producer and all preceding attribution remain unchanged. The complete PR58 +comparison certificate and its original source/proof provenance are retained +under references/frame-compiler/pr58. + +Skip-prefix strip producer, 8 October 2026 +By Avi Eisenberg (ikeboy), with Anthropic Claude (Claude Opus 5.5) +assistance. The skip-prefix leave-one-out strip layout in +research/skip-strips/skip_graph.py is new. Everything else reuses Chafik +Boukhalfa's PR #43/#46/#48 research/copied-fixed pipeline, its verification +code, exact data recovery and support-order sorting, together with: +- Rohan Arun's PR #44 weighted carrier matching optimizer; +- RaD (hipotures) PR #41 alternating point order; +- every predecessor credited above. +Complete attribution and the conditional proof boundary are recorded in +research/skip-strips/PROOF.md. Original Apache-2.0 and CC0 notices remain +applicable. + +Local split-pair skip-prefix research continuation (2026-10-08) +Prepared with substantial OpenAI Codex assistance at the user's request. +New contribution: singleton/pair recursive partition refinement, finite summand +order and moment search, and verified composition with inherited paid clones. +Avi Eisenberg/ikeboy with Anthropic Claude assistance: PR53 skip-prefix strips. +Chafik Boukhalfa with OpenAI Codex assistance: PR54 original-envelope clone +specialization and PR43/46/48 checking interfaces. RaD/hipotures: PR51 +whole-chain/source-partition cloning and earlier producer/interfaces. +Rohan Arun: PR44 weighted matching and earlier fixed/reversed work, with all +stated historical AI assistance. All predecessor notices remain applicable. + +Original-envelope whole-chain clones on skip-prefix strips (research/skip-clones): +Chafik Boukhalfa, prepared with OpenAI Codex assistance. The complete-chain +source-partition clone operation is adapted from RaD / hipotures, PR #51, +with original envelopes retained here. The scalar base is Avi Eisenberg's +PR #53 skip-prefix layout, prepared with Anthropic Claude assistance. +All credited PR #43/#46/#48, PR #44 and earlier code/proof notices remain +in force. This extension is provided under the repository's Apache-2.0 terms. + +Community review checkpoint #50–#61, 8 October 2026 +Maintainer integration and independent arithmetic: Douglas Colkitt, with OpenAI Codex. +Avi Eisenberg / ikeboy: skip-prefix strip framework (#53), with Anthropic Claude. +Rohan Gupta / gupt1156: parallel order search (#50, stated Antigravity assistance) +and dual-suffix strips (#55, Anthropic Claude assistance). +Eumemic: equal-frame joint compilation and paid signal reclamation (#57), with Codex. +Chafik Boukhalfa: original-envelope paid clones (#54), composition (#58) and ranked +reclamation (#60), with Codex. Rohan Arun: order search (#52) and positive-frame +composition (#56), with Anthropic Claude and stated Codex validation assistance. +RaD / hipotures: enlarged frames, source partitions and paid whole-chain clones +(#51), with Codex. Rohan Garg / rohangar1: singleton/pair recursion and paid-clone +composition (#59), with Codex. Alejandro Zarzuelo Urdiales: exact parameter +refinement, scoped Lean arithmetic, matrix/parity and search tools (#61), with +his disclosed multi-tool and Codex assistance. +Parallel #50/#52 records are reviewed and credited without replacing the earlier +climbed-48 implementation; their exact commit history is retained. The separate +#51 witness is retained as research; its source-graph/negative-basis data proof +has not received the same full replay as #56's consumed compiler machinery. +See docs/research/community-round2-review.md for precise validation boundaries. +All earlier licenses, contributions and notices remain applicable. + +Interval strips and core-aware pair assembly + +The interval leave-one-out strips and the core-aware group-pair assembly in +research/pair-assembly were prepared by Avi Eisenberg / ikeboy with Anthropic +Claude assistance. They build on PR #53's skip-prefix pipeline and its +inherited PR #48 sources. The stacked witness in research/pair-assembly/frame +uses eumemic's PR #57 joint frame compiler unchanged; its driver and verifier +are adaptations of PR #57's skip_frame_compiler.py, skip_frame_compose.py and +verify_skip_frame.py. Original notices are retained. + +Stopped product-ring extension, 9 October 2026 +Copyright 2026 icekylinx + +The opposite-bank generic projector factorization, componentwise atom-ring +adapters, stopped recurrence and outer ordinary-interchange conversion, +aligned pair-star producer with rational centers, exact denominator-21 +grid and selected (23,23)/(24,24) composition are contributed by icekylinx +with substantial OpenAI GPT-6 Astra and Codex assistance. This extension +builds on merged PR #36, 11817ccacb564bb7f98789c20dc11d3fece207e3, and is +integrated on upstream main 56b66d58297deca1d7dd130247d720e960f77a37. + +The retained ordinary leaf uses the preceding projector, corner and +copied-center proofs. The selected two-stage topology retains Aurel Prosz +(Paureel), Swapnil Jain and Zhihao Chen's credits; the semantic assembly +retains PR #21/#23 and RaD's attribution. Paired producers, carrier matching, +original source notices and each imported license remain unchanged. + +Partial-gauge extension, 9 October 2026 +Copyright 2026 icekylinx + +The pair-first cube assembly, compatible backward frame enlargement, +partial source-gauge schedule and stopped whole-projector composition are +contributed by icekylinx with substantial OpenAI GPT-6 Astra and Codex +assistance, extending PR #104 at 948ce1510df750f4c18b96bdaef436a86f8bf834. + +The physical deferred bit word, reflected event accounting, fan-order +clarification and signed two-stage endpoint are adopted from Zhihao Chen +(jacklightChen), PR #97, e15350b66e4bf796153a68c240a6cc1b788abe3e, with +Codex assistance. Its deferred readouts, V leaves, lifted frames and frozen +witness originate in Swapnil Jain's 741e7aa078392553815df7926ee17ac5e25a8c38, +with the original Claude disclosure retained. Cyclic interval and core-aware +pair primitives build on Avi Eisenberg (ikeboy), PR #62, +ad0f25ff7b23cff7f08ad237c2254e6ecf74257e, with Anthropic Claude assistance. +Prior two-stage, copied-center, ordinary-leaf, semantic/bulk, routing and +precision credits remain in force. Imported source notices and licenses +are preserved under references/partial-gauge/; see SOURCES.json. + +Three-stage cover extension, 9 October 2026 +Copyright 2026 icekylinx + +The arbitrary-subspace Clifford frame theorem, three-stage Cayley geometry, +weighted q-adic GL cover, unit-lower weighted compiler, charged local-ring +fallback, uniform batching, internal row borrowing and exact composition +are contributed by icekylinx with substantial OpenAI GPT-6 Astra assistance. This +repository integration uses Codex assistance and extends +PR #115, cf60442983c153a3a0f5272ea4713f99eba13c86. + +The selected local complex DAG and support/label replay are adopted from +Copyright 2026 eumemic, PR #117, cbb05ce504d571546d9b7794c186a613c659c3bf, +with its original Apache-2.0 terms and Claude assistance disclosure. +The unchanged bit physical word retains Zhihao Chen (jacklightChen), +PR #97, and Swapnil Jain's underlying witness and assistance notices. +The prior opposite-bank, stopped ordinary-leaf, copied-center, topology, +semantic/bulk, precision and analytic credits remain applicable. +Original source notices and license bytes are preserved in +references/three-stage-cover/pr117/ and references/partial-gauge/. + +Paired-cube and shared-core extension, 9 October 2026 +Copyright 2026 icekylinx + +The paired-coordinate triple-cube identity, signed overlap channels, +original-source involution, coordinate-star centers, concrete frame/carrier +compiler, chronological source gauges, PR97 gauge-subset selection, +orthogonal cross-stage routing and exact supplier/assembly integration +are contributed by icekylinx with substantial OpenAI GPT-6 Astra assistance. +Repository integration uses Codex assistance and extends PR #130 at +6a9970a530119174507904e23592fd59ede19a5d. + +The substantial completed-core workspace-sharing principle is credited to +an664, PR #128, 530588a019b4a74f09180680c9e3961bf649ec89, with its reported +OpenAI Codex assistance. No source code, partition or serialized witness +from that PR is imported. The new routing and paired-motif integration +are described separately and claim no exclusive priority for broad sharing, +paired-coordinate, Fourier or carrier-matching ideas. + +Selected coarse queries restrict the retained eumemic PR #117 positive DAG; +its original Apache-2.0 and Claude assistance notices remain unchanged. +The bit word and original frames retain Zhihao Chen's PR #97 and Swapnil +Jain's frozen witness, notices and historical assistance disclosures. +Earlier generalized Clifford, three-stage, uniform weighted recursion, +ordinary-leaf, semantic/bulk, precision and analytic credits remain in force. +Source-specific license bytes are preserved under references/. + +October 9 recycled-bit integration: +DaysSky (#150), William Porter/hpst3r (#147), Thomas Marchand/Th0rgal (#146), +Rohan Gupta/gupt1156 (#148), James Chang/jamesyc (#124), SovereignSteak (#122). +The original notices and assistance disclosures are retained under research/, +including research/recycled-bit-integration/NOTICE. Andrew Barnes/Bortlesboat +(#101) repairs shared verifiers using rfu08's #64 counterexample. rfu08's +scoped finite and formal-transfer packages are included separately; they do +not establish the full multiplication theorem. Earlier and parallel credits +remain applicable. Douglas Colkitt integrated these with OpenAI Codex assistance. + +SovereignSteak PR151 independently supplies the matching gauge/recycling +composition and the selected 473/10^6 atom refinement; its original package +and assistance disclosure are retained under research/gauge-recycling/. + +October 9 coordinated-frame and completed-entrance-bank integration: +Dugongue PR186, 166a34d75e853e933855f0f7e940fe77c4bb6b8d, builds on +Chafik Boukhalfa/chafreaky's PR181, 7fb2194801e3a10f54772c7f0d5505035a4fc0ad, +and eumemic's PR168 v4, 4a3c769e5c5430e7114c4d3e099ff34664677f17. +The frozen package and prerequisite archive preserve all author, source-license +and assistance notices, including PR175's compiler optimization. DaysSky's +carrier closure, James Chang's terminal substitution and balanced assembly, +geckods' stopping refinements and all preceding framework credits remain. +Rohan Arun's PR185 bootstrap and chafreaky's PR182 bit refinement are reviewed +parallel contributions; their gains are not added to the selected witness. +Douglas Colkitt integrated the package and supplied the bank scheduling +supplement with OpenAI Codex assistance, under Apache-2.0. The all-size +interfaces remain conditional; finite verification is not full formalization. diff --git a/research/retained-record-inverse-review/inputs/SOURCES.json b/research/retained-record-inverse-review/inputs/SOURCES.json new file mode 100644 index 0000000000..dc4e6683f6 --- /dev/null +++ b/research/retained-record-inverse-review/inputs/SOURCES.json @@ -0,0 +1,36 @@ +{ + "schema_version": 1, + "base_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "d59b5035e7b4cbaa9d688a1d32dd0d6eb79c466a", + "sha256": "9b8d0eea95b3bf0dfcb7938a732a6439b87a2685dec2a5ab9e525b3b34debbfa" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "research/p104-helper470-twin-rung-removal/WORD.json.gz", + "usage": "input", + "git_blob": "22f9ab02d1b73ea0aa4b07ce445a14cc2602c760", + "sha256": "7834725d9e34ee846a9ccc615221ea81e0201613938afa185d2eda0c9a6c232f" + }, + { + "path": "research/staged544-mixed-fourth-entry/native/vendor/native/new/code/borrow/bw_gauss.py", + "usage": "input", + "git_blob": "1ff29dfb244e2114de8e586a450ae9fb70308d58", + "sha256": "0884b14d6d77cde419a3c773ad9b21d0d18de1e6e20e6b6d5add458ed32ba4cb" + }, + { + "path": "research/staged544-mixed-fourth-entry/native/vendor/native/new/code/borrow/vendor/clifford/clifford_exact.py", + "usage": "input", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + } + ] +} diff --git a/research/retained-record-inverse-review/inputs/ledger.py.txt b/research/retained-record-inverse-review/inputs/ledger.py.txt new file mode 100644 index 0000000000..728b290117 --- /dev/null +++ b/research/retained-record-inverse-review/inputs/ledger.py.txt @@ -0,0 +1,190 @@ +"""Compute exact signed defect transfers and check them in reverse order. + +The forward/reverse method credits the selected-word analysis in PR6526. +""" + +from collections import Counter +from fractions import Fraction as Q +from hashlib import sha256 +from math import isqrt + + +def need(ok, label): + if not ok: + raise ValueError(label) + + +def add(row, other, q): + for j, v in other.items(): + z = row.get(j, Q(0))+q*v + if z: + row[j] = z + else: + row.pop(j,None) + + +def digest(row): + return sha256(''.join(f'{j}:{v};' for j,v in sorted(row.items())).encode()).hexdigest() + + +def noise_weight(e, rank): + if e[0] == 'MOVE': + return rank, 0 + if e[0] in {'ADD','SCALE'} and Q(e[-2]).denominator > 1: + return 0, 1 + return 0, 0 + + +def score(row, weights): + out = [Q(0)]*4 + for j,c in row.items(): + m,s = weights[j] + out = [a+b for a,b in zip(out,(c*c*m,c*c*s,abs(c)*m,abs(c)*s))] + return out + + +def reverse(word, weights, cut, role): + row, errors = {role:Q(1)}, {} + for j in reversed(range(cut)): + e = word['program'][j] + op,r = e[:2] + c = row.get(r,Q(0)) + if c and any(weights[j]): + errors[j] = c + if op in {'INIT','CLEAR'}: + row.pop(r,None) + elif op == 'SCALE' and c: + row[r] = c*Q(e[-2]) + elif op in {'ADD','COPY'}: + if c: + add(row,{e[2]:c},Q(e[-2])) + if op == 'COPY': + row.pop(r,None) + return row, errors + + +def analyze(word, ranks): + public = word['public'] + count = public+word['owned_fields'] + rows = [{} for _ in range(count)] + ideal = [{r:Q(1)} if r=public and r not in live and frames[r] is None, 'INIT') + live.add(r) + frames[r] = e[2] + else: + need(r in live and frames[r]==e[2], 'CLEAR') + erasures.append([j,r,sum(map(abs,ideal[r].values()),Q(0))]) + live.remove(r) + frames[r] = None + rows[r],ideal[r],scores[r] = {},{},[Q(0)]*4 + else: + need(op in {'ADD','COPY','SCALE'}, 'opcode') + q=Q(e[-2]) + need(q and q.denominator & (q.denominator-1)==0 and frames[r]==e[-1], 'scalar ABI') + bits=q.denominator.bit_length()-1 + scalar_seed_bits += bits + if op == 'SCALE': + need(abs(q.numerator)==1 or q.denominator==1, 'division numerator') + scale_residue_units += bits + rows[r] = {k:q*v for k,v in rows[r].items()} + ideal[r] = {k:q*v for k,v in ideal[r].items()} + scores[r] = [v*(q*q if k<2 else abs(q)) for k,v in enumerate(scores[r])] + else: + s=e[2] + need(s!=r and frames[s]==frames[r], 'scalar operands') + if op=='COPY': + need(r in live and not ideal[r] and q==1, 'selected COPY') + rows[r],ideal[r],scores[r] = rows[s].copy(),ideal[s].copy(),scores[s].copy() + else: + add(ideal[r],ideal[s],q) + for k,v in rows[s].items(): + old=rows[r].get(k,Q(0));new=old+q*v + m,sweight=weights[k] + delta=(new*new-old*old,abs(new)-abs(old)) + scores[r]=[a+b for a,b in zip(scores[r],(delta[0]*m,delta[0]*sweight,delta[1]*m,delta[1]*sweight))] + if new: + rows[r][k]=new + else: + rows[r].pop(k,None) + if any(weights[j]): + rows[r][j]=Q(1) + m,s=weights[j] + scores[r]=[a+b for a,b in zip(scores[r],(m,s,m,s))] + norm=sum(map(abs,ideal[r].values()),Q(0)) + if norm>ideal_peak[0]: + ideal_peak=[norm,j+1,r] + m,s,am,ass=scores[r] + for k,v in enumerate((m,s,am,ass,m+s,m+4*s,am+2*ass)): + if v>peaks[k][0]: + peaks[k]=[v,j+1,r] + need(not live and frames[:public]==word['final'], 'all final frames') + for r in range(count): + target={r:Q(1)} if r 45606*(1 << 40): + need(Q(1 << 32,512*q) >= x, 'binary grid tail follows from exact exponential bound') + return {'normalized_width_one_rms_guard':rms,'normalized_width_one_tail_guard':g, + 'tail_exponent':x,'positive_taylor_degree':64,'positive_taylor_lower':lower, + 'failure_bound':'2^-40','union_changed_fields':22803, + 'width_one_binary_grid_rms_bits':next(t for t in range(32) if 256*peaks[4][0] < (1 << (2*t))), + 'width_one_binary_grid_tail_bits':16, + 'width_one_binary_grid_tail_exponent':Q(1 << 32,512*q)} + raise ValueError('tail certificate range') diff --git a/research/retained-record-inverse-review/inputs/produce.py.txt b/research/retained-record-inverse-review/inputs/produce.py.txt new file mode 100644 index 0000000000..5ed6163e90 --- /dev/null +++ b/research/retained-record-inverse-review/inputs/produce.py.txt @@ -0,0 +1,102 @@ +"""Check every distinct selected native edge with two exact representations.""" + +import gzip +import hashlib +import json +import sys +from collections import Counter +from pathlib import Path + +import numpy as np + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(HERE)) +from sampler import need, route + + +def matrix_monomial(z, rec): + real, imag = z + dest, phases = route(rec) + rr, ii = np.empty_like(real), np.empty_like(imag) + for src, (dst, p) in enumerate(zip(dest, phases)): + a, b = real[src], imag[src] + if p == 0: + rr[dst], ii[dst] = a, b + elif p == 1: + rr[dst], ii[dst] = -b, a + elif p == 2: + rr[dst], ii[dst] = -a, -b + else: + rr[dst], ii[dst] = b, -a + return rr, ii + + +def recipe_matrix(rec): + re, im = matrix_monomial((np.eye(512, dtype=np.int64), np.zeros((512,512), dtype=np.int64)), rec['right']) + for axis in range(rec['rank']): + lo = np.array([j for j in range(512) if not j >> axis & 1]) + hi = lo ^ (1 << axis) + sr, si, dr, di = re[lo]+re[hi], im[lo]+im[hi], re[lo]-re[hi], im[lo]-im[hi] + re[lo], im[lo], re[hi], im[hi] = sr-di, si+dr, sr+di, si-dr + return matrix_monomial((re, im), rec['left']) + + +def main(): + need(__debug__, 'source assertions remain enabled') + for item in json.loads((HERE/'SOURCES.json').read_text())['files']: + if item['usage'] == 'input': + need(hashlib.sha256((ROOT/item['path']).read_bytes()).hexdigest() == item['sha256'], 'source bytes') + src = ROOT/'research/staged544-mixed-fourth-entry/native/vendor/native/new/code/borrow' + sys.path[:0] = [str(src), str(src/'vendor/clifford')] + import bw_gauss + from clifford_exact import canonical_frame, lower_child + word = json.loads(gzip.decompress((ROOT/'research/p104-helper470-twin-rung-removal/WORD.json.gz').read_bytes())) + charts, recipes, ranks, counts = {}, {}, [], Counter() + controls = 0 + for e in word['program']: + if e[0] != 'MOVE': + ranks.append(0) + continue + old, new = e[2:4] + key = f'{old},{new}' + if key not in recipes: + for t in (old,new): + if t not in charts: + charts[t] = canonical_frame(9, word['frames'][t]) + rec, compiled = lower_child(charts[old].adjoint().then(charts[new])) + need(1 <= rec['rank'] <= 8, 'selected native rank') + actual_re, actual_im = recipe_matrix(rec) + re, im, exponent = bw_gauss.frame( + bw_gauss.frame(bw_gauss.eye(9), word['frames'][old], 9, -1), + word['frames'][new], 9) + need(exponent <= 18 and np.max(np.abs(re)) <= 1 << 18 and + np.max(np.abs(im)) <= 1 << 18 and np.max(np.abs(actual_re)) <= 1 << 8 and + np.max(np.abs(actual_im)) <= 1 << 8, 'integer matrix range') + need(np.array_equal(actual_re << exponent, re << rec['rank']) and + np.array_equal(actual_im << exponent, im << rec['rank']), 'all columns of every native edge') + if not recipes: + need(not (np.array_equal(-actual_im << exponent, re << rec['rank']) and + np.array_equal(actual_re << exponent, im << rec['rank'])), 'global phase mutation is rejected') + need(not (np.array_equal(actual_re << exponent, re << rec['rank']) and + np.array_equal(-actual_im << exponent, im << rec['rank'])), 'conjugate mutation is rejected') + controls = 2 + recipes[key] = rec + rank = recipes[key]['rank'] + ranks.append(rank) + counts[rank] += 1 + out = Path(sys.argv[1]) + data = {'recipes':recipes,'ranks':ranks} + encoded = (json.dumps(data,sort_keys=True,separators=(',',':'))+'\n').encode() + (out/'native.json').write_bytes(encoded) + (out/'source-summary.json').write_text(json.dumps({ + 'events':len(word['program']),'distinct_edges':len(recipes),'frames':len(charts), + 'full_operator_columns':len(recipes)*512,'move_events':sum(counts.values()), + 'rank_counts':{str(k):v for k,v in sorted(counts.items())}, + 'native_stage_count_per_tensor_axis':sum(k*v for k,v in counts.items()), + 'all_recipe_sha256':hashlib.sha256(encoded).hexdigest(), + 'source_assertions_enabled':__debug__,'operator_mutation_controls':controls},indent=2)+'\n') + + +if __name__ == '__main__': + main() diff --git a/research/retained-record-inverse-review/inputs/sampler.py.txt b/research/retained-record-inverse-review/inputs/sampler.py.txt new file mode 100644 index 0000000000..2f7ba4b7d0 --- /dev/null +++ b/research/retained-record-inverse-review/inputs/sampler.py.txt @@ -0,0 +1,226 @@ +"""Run the integer caller and retain every value required by its inverse. + +The pair map and route formula extend Ali Romman's PR6532 implementation. +""" + +from fractions import Fraction as Q +from hashlib import sha256 + + +def need(ok, label): + if not ok: + raise ValueError(label) + + +def phase(z, p): + a, b = z + p %= 4 + if p == 0: + return a, b + if p == 1: + return -b, a + if p == 2: + return -a, -b + return b, -a + + +def pair(x, y, seed, inverse=False): + need(type(seed) is int and seed in (-1, 1), "pair seed") + a, b = x + c, d = y + sr, si, dr, di = a+c, b+d, a-c, b-d + cr = ci = 0 + if (sr+si) % 2: + if sr % 2: + cr = seed if sr > 0 else -seed + else: + ci = seed if si > 0 else -seed + dr, di = dr-cr, di-ci + dr, di = (di, -dr) if inverse else (-di, dr) + dr, di = dr+cr, di+ci + nums = sr+dr, si+di, sr-dr, si-di + need(all(v % 2 == 0 for v in nums), "integer pair output") + a, b, c, d = (v//2 for v in nums) + return (a, b), (c, d) + + +def route(rec): + dest, phases = [], [] + n = len(rec["matrix_rows"]) + for x in range(1 << n): + dest.append(sum(((row & x).bit_count() % 2) << j + for j, row in enumerate(rec["matrix_rows"])) ^ rec["offset"]) + p = rec["phase"] + for j in range(n): + if x >> j & 1: + p += rec["linear_Z4"][j] + p += 2 * (((rec["quadratic_rows"][j] >> (j+1)) & (x >> (j+1))).bit_count() % 2) + phases.append(p % 4) + need(sorted(dest) == list(range(1 << n)), "monomial permutation") + return dest, phases + + +def monomial(values, routing, f, inverse=False): + dest, phases = routing + out = [None] * len(values) + for src in range(len(values)): + dst, p = 0, 0 + for axis in range(f): + digit = (src >> (9*axis)) & 511 + dst |= dest[digit] << (9*axis) + p += phases[digit] + if inverse: + out[src] = phase(values[dst], -p) + else: + out[dst] = phase(values[src], p) + return out + + +def native(values, routes, rank, seeds, f=1, inverse=False): + need(type(f) is int and f >= 1 and len(values) == 512**f, "native shape") + axes = [9*j+k for j in range(f) for k in range(rank)] + need(len(seeds) == len(axes), "native seed count") + left, right = routes + out = monomial(values, left if inverse else right, f, inverse) + order = reversed(range(len(axes))) if inverse else range(len(axes)) + for j in order: + stride = 1 << axes[j] + for start in range(0, len(out), 2*stride): + for low in range(stride): + a, b = start+low, start+low+stride + out[a], out[b] = pair(out[a], out[b], seeds[j], inverse) + return monomial(out, right if inverse else left, f, inverse) + + +def quantized(values, q, seed): + d = q.denominator + need(type(seed) is int and 0 <= seed < d, "scalar seed") + return [((q.numerator*a+seed)//d, (q.numerator*b+seed)//d) for a, b in values] + + +def pack_remainders(values, q, seed): + d = q.denominator + bits = d.bit_length()-1 + need(abs(q.numerator) == 1 and bits > 0, "division residue contract") + out = bytearray((2*len(values)*bits+7)//8) + pos = 0 + for z in values: + for v in z: + residue = (q.numerator*v+seed) % d + for k in range(bits): + out[pos//8] |= ((residue >> k) & 1) << (pos % 8) + pos += 1 + return bytes(out) + + +def restore_division(values, q, seed, packed): + d = q.denominator + bits = d.bit_length()-1 + need(abs(q.numerator) == 1 and bits > 0, "division residue contract") + size = 2*len(values)*bits + need(len(packed) == (size+7)//8, "residue byte length") + need(not size % 8 or packed[-1] >> (size % 8) == 0, "residue padding") + out, pos = [], 0 + for z in values: + value = [] + for v in z: + rem = 0 + for k in range(bits): + rem |= ((packed[pos//8] >> (pos % 8)) & 1) << k + pos += 1 + value.append(q.numerator * (d*v+rem-seed)) + out.append(tuple(value)) + return out + + +def digest(fields): + h = sha256() + for r, values in sorted(fields.items()): + h.update(f"{r}:".encode()) + for a, b in values: + h.update(f"{a},{b};".encode()) + return h.hexdigest() + + +def execute(word, recipes, initial, seed_value, f=1): + """Use supplied seeds; a deterministic test stream is not a randomness proof.""" + fields = {r: list(v) for r, v in initial.items()} + tape, routes = [], {} + peak_fields = len(fields) + retained_fields = scalar_seed_bits = native_seed_bits = residue_bits = 0 + max_abs = max(abs(t) for v in fields.values() for z in v for t in z) + for j, e in enumerate(word["program"]): + op, r = e[:2] + if op == "INIT": + need(r not in fields, "allocate unused field") + fields[r] = [(0, 0)] * (512**f) + record = None + elif op == "CLEAR": + record = fields.pop(r) + retained_fields += 1 + elif op == "COPY": + need(Q(e[3]) == 1, "selected exact COPY coefficient") + record = fields[r] + fields[r] = list(fields[e[2]]) + retained_fields += 1 + elif op == "MOVE": + key = f"{e[2]},{e[3]}" + rec = recipes[key] + if key not in routes: + routes[key] = (route(rec['left']), route(rec['right'])) + raw = [seed_value(j, k, 2) for k in range(rec['rank']*f)] + need(all(type(v) is int and v in (0,1) for v in raw), 'fresh bit range') + record = [1 if v else -1 for v in raw] + native_seed_bits += len(record) + fields[r] = native(fields[r], routes[key], rec['rank'], record, f) + else: + need(op in {'ADD', 'SCALE'}, "known scalar instruction") + q = Q(e[-2]) + seed = seed_value(j, 0, q.denominator) if q.denominator > 1 else 0 + scalar_seed_bits += q.denominator.bit_length()-1 + record = (seed, None) + if op == 'ADD': + inc = quantized(fields[e[2]], q, seed) + fields[r] = [(a+c, b+d) for (a,b),(c,d) in zip(fields[r],inc)] + else: + if q.denominator > 1: + packed = pack_remainders(fields[r], q, seed) + residue_bits += 2*len(fields[r])*(q.denominator.bit_length()-1) + record = (seed, packed) + fields[r] = quantized(fields[r], q, seed) + tape.append(record) + peak_fields = max(peak_fields, len(fields)+retained_fields) + if r in fields: + max_abs = max(max_abs, max(abs(t) for z in fields[r] for t in z)) + output = {r: list(v) for r, v in fields.items()} + for j in reversed(range(len(tape))): + e, record = word['program'][j], tape[j] + tape[j] = None + op, r = e[:2] + if op == 'INIT': + need(all(z == (0,0) for z in fields.pop(r)), "reverse allocation is zero") + elif op == 'CLEAR': + need(r not in fields, "restore cleared field") + fields[r] = record + elif op == 'COPY': + need(fields[r] == fields[e[2]], "reverse COPY value") + fields[r] = record + elif op == 'MOVE': + key = f"{e[2]},{e[3]}" + fields[r] = native(fields[r], routes[key], recipes[key]['rank'], record, f, True) + else: + q, (seed, packed) = Q(e[-2]), record + if op == 'ADD': + inc = quantized(fields[e[2]], q, seed) + fields[r] = [(a-c, b-d) for (a,b),(c,d) in zip(fields[r],inc)] + elif q.denominator > 1: + fields[r] = restore_division(fields[r], q, seed, packed) + else: + need(all(t % q.numerator == 0 for z in fields[r] for t in z), "reverse integer scale") + fields[r] = [(a//q.numerator,b//q.numerator) for a,b in fields[r]] + need(fields == initial, "literal complete inverse") + return output, {'initial_sha256':digest(initial),'output_sha256':digest(output), + 'retained_field_values':retained_fields,'peak_live_and_retained_fields':peak_fields, + 'native_seed_bits':native_seed_bits,'scalar_seed_bits':scalar_seed_bits, + 'division_residue_bits':residue_bits,'max_absolute_payload':max_abs, + 'all_events_forward_and_reverse':len(tape)} diff --git a/research/retained-record-inverse-review/inputs/verify.py.txt b/research/retained-record-inverse-review/inputs/verify.py.txt new file mode 100644 index 0000000000..aea6fd3df8 --- /dev/null +++ b/research/retained-record-inverse-review/inputs/verify.py.txt @@ -0,0 +1,177 @@ +"""Verify the source join, all signed transfers, moments and retained inverse.""" + +import gzip +import hashlib +import itertools +import json +import subprocess +import sys +import tempfile +from fractions import Fraction as Q +from pathlib import Path + +HERE=Path(__file__).resolve().parent +ROOT=HERE.parents[1] +sys.path.insert(0,str(HERE)) +from sampler import execute, native, need, pack_remainders, pair, quantized, restore_division, route +from ledger import analyze, reverse, tail_certificate + + +def check_source(data, expected): + need(hashlib.sha256(data).hexdigest()==expected,'source hash mismatch') + + +def cpair(x,y): + a,b=x;c,d=y + return ((a-b+c+d)/2,(a+b+d-c)/2),((a+b+c-d)/2,(b-a+c+d)/2) + + +def finite(word): + pairs=0 + for a,b,c,d in itertools.product(range(-3,4),repeat=4): + x,y=(a,b),(c,d) + actual=[pair(x,y,s) for s in (-1,1)] + for s,out in zip((-1,1),actual): + need(pair(*out,s,True)==(x,y),'pair exact inverse') + target=cpair(tuple(map(Q,x)),tuple(map(Q,y))) + need(all(Q(actual[0][j][k]+actual[1][j][k],2)==target[j][k] + for j in range(2) for k in range(2)),'pair exact mean') + mse=sum((Q(out[j][k])-target[j][k])**2 for out in actual for j in range(2) for k in range(2))/2 + need(mse==((a+b+c+d)%2),'pair conditional second moment') + pairs+=1 + wide=0 + for bit in (0,1,17,64,257,1024): + for signs in itertools.product((-1,1),repeat=2): + x=(signs[0]*(1 << bit)+1,-(1 << bit));y=(signs[1]*(1 << bit),3) + for s in (-1,1): + need(pair(*pair(x,y,s),s,True)==(x,y),'unbounded integer pair') + wide+=1 + scalars=0 + coefficients=sorted({Q(e[-2]) for e in word['program'] if e[0] in {'ADD','SCALE'}}) + for q in coefficients: + for v in range(-32,33): + outputs=[quantized([(v,-v)],q,u)[0] for u in range(q.denominator)] + need(sum(x for x,y in outputs)==q.numerator*v,'scalar exact mean real') + need(sum(y for x,y in outputs)==-q.numerator*v,'scalar exact mean imaginary') + need(sum((Q(x)-q*v)**2+(Q(y)+q*v)**2 for x,y in outputs)/q.denominator<=Q(1,2),'scalar variance') + scalars+=1 + divisions=0 + for q in sorted({Q(e[2]) for e in word['program'] if e[0]=='SCALE' and Q(e[2]).denominator>1}): + for v in range(-128,129): + for u in range(q.denominator): + original=[(v,1-v)] + packed=pack_remainders(original,q,u) + need(restore_division(quantized(original,q,u),q,u,packed)==original,'division exact residue inverse') + divisions+=1 + # Exhaust every fresh seed of a mixed two-pair/scalar trajectory. + x,y=(Q(1),Q(1)),(Q(2),Q(-1)) + a,b=cpair(x,y);a=tuple(v-Q(3,4)*w for v,w in zip(a,b));b=tuple(v/2 for v in b) + expected=cpair(a,b) + totals=[[Q(0),Q(0)],[Q(0),Q(0)]] + cases=0 + for s,u,v,t in itertools.product((-1,1),range(4),range(2),(-1,1)): + a,b=pair((1,1),(2,-1),s) + inc=quantized([b],Q(-3,4),u)[0];a=tuple(x+y for x,y in zip(a,inc)) + rem=pack_remainders([b],Q(1,2),v);b=quantized([b],Q(1,2),v)[0] + out=pair(a,b,t) + for j in range(2): + for k in range(2):totals[j][k]+=out[j][k] + a,b=pair(*out,t,True);b=restore_division([b],Q(1,2),v,rem)[0] + inc=quantized([b],Q(-3,4),u)[0];a=tuple(x-y for x,y in zip(a,inc)) + need(pair(a,b,s,True)==((1,1),(2,-1)),'mixed inverse') + cases+=1 + need(all(totals[j][k]/cases==expected[j][k] for j in range(2) for k in range(2)),'mixed exact mean') + controls=0 + try: + pair((0,0),(1,0),True) + except ValueError: + controls+=1 + else: + raise ValueError('boolean pair seed accepted') + original=[(1,0)] + q=Q(1,2) + need(quantized(original,q,0)==quantized([(0,0)],q,0),'lost division residue collision') + controls+=1 + need(pair(*pair((0,0),(1,0),1),-1,True)!=((0,0),(1,0)),'wrong inverse seed witness') + controls+=1 + reused=Q(0);fresh=Q(0) + for u in range(2): + x=quantized([(1,0)],q,u)[0][0] + reused+=Q(quantized([(x,0)],q,u)[0][0])-Q(x,2) + for v in range(2):fresh+=Q(quantized([(x,0)],q,v)[0][0])-Q(x,2) + need(reused/2==Q(1,4) and fresh==0,'adaptive reused-seed bias') + controls+=1 + toy={'program':[['MOVE',0,0,1,False],['COPY',1,0,'1',1],['ADD',0,1,'-1',1],['CLEAR',1,1]]} + weights=[(1,0),(0,0),(0,0),(0,0)] + _,row=reverse(toy,weights,3,0) + need(not row,'signed COPY cancellation') + _,row=reverse(toy,weights,4,1) + need(not row,'CLEAR kills later error') + _,row=reverse(toy,weights,2,1) + need(row=={0:Q(1)},'CLEAR does not erase earlier prefix excursion') + controls+=3 + return {'pair_inputs':pairs,'wide_pair_roundtrips':wide,'scalar_contexts':scalars, + 'division_roundtrips':divisions,'mixed_seed_trajectories':cases,'semantic_controls':controls} + + +def run(generate=False): + corrupt=0 + for item in json.loads((HERE/'SOURCES.json').read_text())['files']: + if item['usage']=='input': + data=(ROOT/item['path']).read_bytes();check_source(data,item['sha256']) + try: + check_source(data+b'!',item['sha256']) + except ValueError: + corrupt+=1 + else: + raise ValueError('corrupt source accepted') + word=json.loads(gzip.decompress((ROOT/'research/p104-helper470-twin-rung-removal/WORD.json.gz').read_bytes())) + with tempfile.TemporaryDirectory() as tmp: + folder=Path(tmp) + subprocess.run([sys.executable,'-I','-Werror','-B',str(HERE/'produce.py'),tmp],check=True,timeout=900) + sources=json.loads((folder/'source-summary.json').read_text());bound=json.loads((folder/'native.json').read_text()) + ledger,weights=analyze(word,bound['ranks']);ledger['tail']=tail_certificate(ledger['prefix_peaks']) + checks=finite(word) + initial={r:[(((r*17+j*29)%23)-11,((r*31+j*7)%19)-9) for j in range(512)] for r in range(word['public'])} + def seeds(j,k,d): + return int.from_bytes(hashlib.sha256(f'selected-absolute-fixture:{j}:{k}'.encode()).digest()[:8],'little')%d + output,caller=execute(word,bound['recipes'],initial,seeds) + need(caller['native_seed_bits']==ledger['native_seed_bits_per_tensor_axis'] and + caller['scalar_seed_bits']==ledger['scalar_seed_bits'] and + caller['division_residue_bits']==512*ledger['division_residue_bits_per_complex_coordinate'],'exact caller budget') + (folder/'fixture.json').write_text(json.dumps({'initial':initial,'output':output},separators=(',',':'))) + key,rec=next((key,r) for key,r in bound['recipes'].items() if r['rank']==8) + values=[((j%11)-5,(j%7)-3) for j in range(512**2)] + bits=[1 if k%3 else -1 for k in range(16)] + routes=route(rec['left']),route(rec['right']) + transformed=native(values,routes,8,bits,2) + need(native(transformed,routes,8,bits,2,True)==values,'rank-eight full tensor inverse') + tensor={'coordinates':len(values),'active_stages':16, + 'output_sha256':hashlib.sha256(repr(transformed).encode()).hexdigest()} + exact_input=[(a << 16,b << 16) for a,b in values] + exact_output=native(exact_input,routes,8,bits,2) + need(native(exact_input,routes,8,[-v for v in bits],2)==exact_output,'exact tensor seed independence') + tensor['exact_output_sha256']=hashlib.sha256(repr(exact_output).encode()).hexdigest() + (folder/'tensor-fixture.json').write_text(json.dumps({'edge':list(map(int,key.split(','))), + 'initial':exact_input,'output':exact_output},separators=(',',':'))) + subprocess.run([sys.executable,'-I','-Werror','-B',str(HERE/'endpoint.py'),tmp],check=True,timeout=180) + endpoint=json.loads((folder/'endpoint.json').read_text()) + for r,err in enumerate(endpoint['squared_errors']): + am,ass=ledger['final_scores'][r][2:] + need(Q(err)<=256*(am+2*ass)**2,'decoded numerical endpoint bound') + result={'schema_version':1,'status':'PASS_SELECTED_ABSOLUTE_STOCHASTIC_CALLER', + 'base_commit':'7c49fe32c55de02c2c873655c804b16e4c3fef0a','source':sources, + 'ledger':ledger,'finite':checks,'caller':caller,'endpoint':endpoint,'tensor':tensor, + 'source_corruption_controls':corrupt,'selected_frontier_changed':False} + result=json.loads(json.dumps(result,default=str)) + if generate: + (HERE/'RESULT.json').write_text(json.dumps(result,indent=2)+'\n') + else: + need(result==json.loads((HERE/'RESULT.json').read_text()),'committed exact receipt') + print('PASS_SELECTED_ABSOLUTE_STOCHASTIC_CALLER') + print(json.dumps({k:result[k] for k in ('source','finite','caller','tensor','source_corruption_controls')},sort_keys=True)) + + +if __name__=='__main__': + need(sys.argv[1:] in ([],['--generate']), 'verify arguments') + run(bool(sys.argv[1:]))