From 80c666c3a1e6a7d8de2ce6cbf22f9bd60639c1b1 Mon Sep 17 00:00:00 2001 From: Dugongue <49054532+Dugongue@users.noreply.github.com> Date: Thu, 22 Oct 2026 10:56:31 -0700 Subject: [PATCH] Compare native RAM against packed TM and prove safe portfolio adoption --- research/ram-route-comparison/.gitattributes | 1 + research/ram-route-comparison/CHECKS.json | 26 ++ research/ram-route-comparison/LICENSE | 201 +++++++++++++++ research/ram-route-comparison/MANIFEST.json | 24 ++ .../PACKED-TM-BASELINE.md | 53 ++++ .../ram-route-comparison/PORTFOLIO-THEOREM.md | 23 ++ research/ram-route-comparison/README.md | 35 +++ .../SCIENTIFIC-SOURCES.json | 17 ++ research/ram-route-comparison/SOURCES.json | 18 ++ .../ram-route-comparison/SWITCH-DECISION.md | 53 ++++ research/ram-route-comparison/TASK.json | 80 ++++++ research/ram-route-comparison/VERIFY.json | 44 ++++ .../baseline/FAIR-COMPARISON.md | 59 +++++ .../ram-route-comparison/baseline/OVERLAP.md | 50 ++++ .../baseline/PACKED-IO.md | 159 ++++++++++++ .../ram-route-comparison/baseline/PROOF.md | 112 ++++++++ .../ram-route-comparison/baseline/README.md | 51 ++++ .../baseline/SOURCE-PINS.json | 22 ++ .../baseline/check_comparison.py | 40 +++ .../check_packed_simulation.py | 73 ++++++ .../native/NATIVE-TRANSFER.md | 93 +++++++ .../ram-route-comparison/native/RESULT.json | 242 ++++++++++++++++++ research/ram-route-comparison/verify.py | 34 +++ 23 files changed, 1510 insertions(+) create mode 100644 research/ram-route-comparison/.gitattributes create mode 100644 research/ram-route-comparison/CHECKS.json create mode 100644 research/ram-route-comparison/LICENSE create mode 100644 research/ram-route-comparison/MANIFEST.json create mode 100644 research/ram-route-comparison/PACKED-TM-BASELINE.md create mode 100644 research/ram-route-comparison/PORTFOLIO-THEOREM.md create mode 100644 research/ram-route-comparison/README.md create mode 100644 research/ram-route-comparison/SCIENTIFIC-SOURCES.json create mode 100644 research/ram-route-comparison/SOURCES.json create mode 100644 research/ram-route-comparison/SWITCH-DECISION.md create mode 100644 research/ram-route-comparison/TASK.json create mode 100644 research/ram-route-comparison/VERIFY.json create mode 100644 research/ram-route-comparison/baseline/FAIR-COMPARISON.md create mode 100644 research/ram-route-comparison/baseline/OVERLAP.md create mode 100644 research/ram-route-comparison/baseline/PACKED-IO.md create mode 100644 research/ram-route-comparison/baseline/PROOF.md create mode 100644 research/ram-route-comparison/baseline/README.md create mode 100644 research/ram-route-comparison/baseline/SOURCE-PINS.json create mode 100644 research/ram-route-comparison/baseline/check_comparison.py create mode 100644 research/ram-route-comparison/check_packed_simulation.py create mode 100644 research/ram-route-comparison/native/NATIVE-TRANSFER.md create mode 100644 research/ram-route-comparison/native/RESULT.json create mode 100644 research/ram-route-comparison/verify.py diff --git a/research/ram-route-comparison/.gitattributes b/research/ram-route-comparison/.gitattributes new file mode 100644 index 0000000000..625449502b --- /dev/null +++ b/research/ram-route-comparison/.gitattributes @@ -0,0 +1 @@ +* -text diff --git a/research/ram-route-comparison/CHECKS.json b/research/ram-route-comparison/CHECKS.json new file mode 100644 index 0000000000..bea73bee21 --- /dev/null +++ b/research/ram-route-comparison/CHECKS.json @@ -0,0 +1,26 @@ +{ + "baseline/check_comparison.py": { + "status": "PASS_FAIR_COMPARISON_ARITHMETIC", + "source_parameter_cases": 110880, + "current_kappa_native": "15108879/5000000000", + "current_kappa_packed_TM": "15108879/5000000000", + "strict_computational_superiority_established": false, + "historical_native_only_gain": "1/2500000000", + "scope": "Exact parameter arithmetic and source hashes; universal dominance and portfolio arguments are written proofs, not benchmark results." + }, + "check_packed_simulation.py": { + "status": "PASS_FINITE_PACKED_TM_MACRO_CONTROLS", + "macro_cases": 32256, + "halting_cases": 22207, + "boundary_offset_cases": 28720, + "fixed_tapes": 2, + "binary_alphabet": true, + "macro_lengths": [ + 1, + 2, + 3, + 4 + ], + "scope": "Finite exact simulation and masked writeback controls, not universal proof or native runtime evidence." + } +} diff --git a/research/ram-route-comparison/LICENSE b/research/ram-route-comparison/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/ram-route-comparison/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/ram-route-comparison/MANIFEST.json b/research/ram-route-comparison/MANIFEST.json new file mode 100644 index 0000000000..fd84af1c0d --- /dev/null +++ b/research/ram-route-comparison/MANIFEST.json @@ -0,0 +1,24 @@ +{ + ".gitattributes": "8b9c3028d6467ff3be7c793141927841d70f47f52d0590677438f488ca154992", + "baseline/check_comparison.py": "aeecb8ffbed4678df59c00b6091ba03dd3a7397b732347ef10ea0dc0c899c0fd", + "baseline/FAIR-COMPARISON.md": "b1722a543ac76edbaad6707d6273ad994519dab810d2ae6233592563d4f3f27f", + "baseline/OVERLAP.md": "d6c20147e749ee4bb5931413fe8bda56c8a8f6aa4d8681867c0c2ed0426047a5", + "baseline/PACKED-IO.md": "3197b3763d6c8ac7733ed128b4191b19ae0fd22a9d94d90cf80ca2a3b9459120", + "baseline/PROOF.md": "788535dea58df897055de81175acdea9abb149604ad9bdf7ee36b6100982d541", + "baseline/README.md": "7d5226933a90c875ea217f1814c15bac1206da38abb5373e1a4583ea02d09f4f", + "baseline/SOURCE-PINS.json": "b9b044e804a24e6dd6eaf542e31cc911734c0cf538b541e471fe2bc74b55438e", + "check_packed_simulation.py": "61f06928598ccf6b7dd8b2f3881a9874314fe836c7f3e4a99b28b095da7a1221", + "CHECKS.json": "de3d667736d8f14aa1c5be7c816374b61adc00293dbc3807fdf6a8008ebe868f", + "LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "native/NATIVE-TRANSFER.md": "f19fb98feb3c20ca23ab03b339ffde5243fd4587a7620624a0b7a3678faac0ab", + "native/RESULT.json": "a3a7a590340ec774ede7ce68ccf76689e73910942fc48ae00eea664ff00c50ec", + "PACKED-TM-BASELINE.md": "effd00e02e35c28e434e082d62defff3a97621c99529a3ff237664b587c35b8e", + "PORTFOLIO-THEOREM.md": "f976b9702877f60fe71585d0bd76654ca9fd2d207e03e2b5eac00a20e046fb6c", + "README.md": "26ccd6dc0ef2e79882dbeaca3ba78f0a0296c767b5304c73ccbbdf7830d11870", + "SCIENTIFIC-SOURCES.json": "b1e8097d716f112e4b97ee4297b80407aa03ab4784084ad78a08a9a4624c7ba3", + "SOURCES.json": "918c9cbe30ff30332defb39b3ce6d5cea4c16f4f51853910ab5d83a6546a4582", + "SWITCH-DECISION.md": "78c462e9f0179af0dd3a91fc6f1e07b1764970db2fbb10cef06ab883ecd56901", + "TASK.json": "3b4c4ebab8daaa8d04110f35708bcde3b72c9640468f508843d48df2d08f832c", + "VERIFY.json": "14a97fee6299272a45a844edb0bc15274987c80868b02ba0697b26d37d214bcf", + "verify.py": "53dce678c6d54ac2b4257dd15d5d34368778cd47183999692ef7a592beb1807f" +} diff --git a/research/ram-route-comparison/PACKED-TM-BASELINE.md b/research/ram-route-comparison/PACKED-TM-BASELINE.md new file mode 100644 index 0000000000..132dfa9d56 --- /dev/null +++ b/research/ram-route-comparison/PACKED-TM-BASELINE.md @@ -0,0 +1,53 @@ +# A packed finite-alphabet multitape baseline on Word RAM + +Prepared for Dugongue with substantial OpenAI Codex assistance. Informal sufficient simulation theorem; no Lean formalization and no claim of novelty for classical finite-control tabulation. + +## Theorem and model + +Fix a deterministic machine M with k tapes, a fixed finite alphabet of size s >= 2, and fixed finite control. Each step reads/writes one symbol per tape and moves each head by at most one. Let T(n) be a supplied time horizon, with n <= T(n) <= n^d for a fixed d, covering the execution in question. For every fixed rational 0 < alpha < 1 (or a rational interior choice below any proposed real exponent), a uniform standard Word RAM with sufficiently large fixed word width w = C log(n+2), unit bounded-word arithmetic, Boolean operations and both logical shifts simulates M on a packed n-bit input in + + O(T(n)/log(n+2) + n/log(n+2) + n^alpha polylog(n+2)) + +word operations and O((T(n)+n)/log(n+2) + n^alpha) words of owned storage. The input/output conversion, exact early halt, head movements and tape changes are included. A work/output tape of length at most T+n can be scanned and decoded within the same bound. For multiplication with an explicitly designated O(n)-bit output, its final packed output cost is O(n/log n). No unbounded-integer instruction, nonuniform advice table, or free initialized dirty arena is used. + +The finitely many small n below the tabulation threshold use a direct simulator. Construction and evaluation of the supplied time horizon are charged separately; a polynomial-time bound does not automatically give its value for free. For a fixed explicit elementary time bound, its usual O(polylog n) evaluation is absorbed by the displayed setup. Alternatively the theorem can take a valid horizon as an explicit input parameter. The result is a fixed-k, fixed-alphabet theorem; neither k nor s may grow silently with n. + +## Table construction + +Put h = ceil(log2 s) and b = max(1,floor(alpha log2(n+2)/(2kh))) above a sufficiently large fixed cutoff. Encode each tape in blocks of b symbols, occupying bh <= w bits per word. Each head is stored as a block address plus an offset in [0,b). This representation avoids division for address updates. + +A macro reads a length-(2b+1) window centered at each tape head. During its next b transitions, no head can leave its own window, and no symbol outside these windows can be read or modified. The finite lookup key consists of the source control state and all k windows, with the heads understood to start at the central position b. Its bit length is + + kh(2b+1) + O(1) <= alpha log2(n+2) + O(1). + +Enumerate every key, reject invalid alphabet codes, and directly execute at most b source transitions on each valid key. Store the final control state, the rewritten k windows, each head displacement in [-b,b], and the number of transitions actually performed before a halt. An already halted state performs zero transitions and changes nothing. Each entry has O(b) bits; for sufficiently large n it fits in a fixed number of words (indeed one after enlarging the cutoff for the fixed alpha). Each key is a word-addressable table index. Building and initializing the dense table costs O(2^(kh(2b+1)) poly(b)) = O(n^alpha polylog n) native operations. The direct enumeration algorithm depends only on M and the numeric n, not on an input-dependent oracle. + +Equivalently, valid-key count is |Q| s^(k(2b+1)) = O(2^(2kb log2(s))); the dense h-bit encoding includes a constant-exponent allowance for invalid codes. The choice using h pays that allowance explicitly. + +## Reading and rewriting across block boundaries + +A centered window intersects at most four b-symbol blocks: its first symbol may be at any offset, and its length is 2b+1. Read those O(1) words, concatenate their relevant fields using a fixed number of shifts, masks and Boolean operations, and concatenate the k fixed windows into the key. If concatenating four blocks spans more than one word, use a fixed-size limb tuple and the usual carry-free cross-limb shifts; no wide integer operation is unit cost. The final table key and window fit a fixed number of words. No per-symbol loop occurs online. + +The table supplies the full rewritten windows. Update each of the same O(1) blocks by a masked write that replaces only its intersection with the window. All symbols outside that window remain literal old symbols, including in the first and last intersected blocks. Head displacement has magnitude at most b; update the offset by this signed displacement and adjust the block address by at most one in either direction. A displacement plus an offset in [0,b) lies in [-b,2b), so a constant number of comparisons and additions suffices. Registers can use an explicit sign/magnitude or biased representation; negative natural subtraction is never assumed to wrap. + +Because k is fixed, each complete macro uses O(1) word operations. The instruction set must include logical right shift directly if division is excluded; a right shift derived from division cannot be reused in a purported division-free simulation. + +## Memory, initialization, input and output + +Reserve a physical tape window large enough for the n-symbol input plus T moves and 4b guard symbols at each end. Its logical origin is offset by T+4b; the same bounded-address offset is applied to all head operations. It contains O(T+n) symbols per tape and hence O((T+n)/b) packed words. Explicitly initialize every owned word to the blank-symbol block; this costs O((T+n)/log n). Exterior memory remains arbitrary and is never accessed. Near either end of the reserved region, the extra 4b-symbol guards ensure every final macro window and its four whole containing blocks are physically readable even if the machine halts or reaches its horizon during that macro. For an exact horizon stop at a nonmultiple of b, either tabulate every remaining duration 0 through b (a polylog n setup factor) or directly execute the final fewer than b steps; O(log n) extra work is absorbed by setup. + +Use an auxiliary b-bit conversion table to map packed input chunks to h-bit tape-symbol blocks and decode the output blocks. Its size is at most 2^b poly(b), already within n^alpha polylog n. Read/write n bits in O(n/b) chunks; conversion is not charged once per bit. For a fixed input syntax with separators or several operands, their fixed number of offsets and boundary fragments take O(n/b) work as well. All table and tape addresses fit in O(log n) bits because the horizon is polynomial; choose the fixed coefficient C to cover d, the constant number of tapes, setup tables and scratch. An allocation of n^d words is not charged as one operation: the actual O((T+n)/log n) owned words are initialized as above. + +## Correctness and genuine halt + +Relate a source configuration to its exact tape symbols in the packed arena, its control state, and its recorded head block/offset pairs. The window locality observation proves that the table's bounded execution uses exactly the same transition sequence as the global machine. Masked writeback preserves all unobserved cells and applies exactly the changed cells. The head and state updates are literal. Induction over macros proves exact configuration correspondence. If the source halts after j < b steps, the entry records that halt and j, preserves the resulting tape, and stops immediately after this macro lookup; no fictitious post-halt transitions occur. Thus the simulation gives both the correct output and genuine source halt. A final partial horizon is treated separately as above. + +## Fair comparison with a native multiplication claim + +Suppose a conditional fixed-tape multiplier has T(n) = O(n (log n)^(1-kappa)) for fixed 0 < kappa < 1, with a fixed alphabet and an ordinary packed binary input/output interface. The theorem gives a conditional Word RAM multiplier in + + O(n/(log n)^kappa). + +Indeed T/log n has that order, n/log n is smaller, and for every fixed alpha < 1, n^alpha polylog n = o(n/(log n)^kappa). The simulation preserves whatever mathematical hypotheses the original multiplier needs; it does not verify those hypotheses independently. + +Consequently a direct native implementation attaining exactly this same kappa may have valuable operational, proof-dependency or instruction-set advantages, but its exponent alone does not strictly beat the best TM-derived Word RAM baseline. A fair strict-improvement claim must exceed the actually transferred comparator or strengthen a clearly stated model/assumption contract. This note supplies a positive explicit baseline algorithm; it is not a universal impossibility result about native multiplication or future improvements. diff --git a/research/ram-route-comparison/PORTFOLIO-THEOREM.md b/research/ram-route-comparison/PORTFOLIO-THEOREM.md new file mode 100644 index 0000000000..2d69eda067 --- /dev/null +++ b/research/ram-route-comparison/PORTFOLIO-THEOREM.md @@ -0,0 +1,23 @@ +# A native-first portfolio preserves the better proven route + +Prepared for Dugongue with substantial OpenAI Codex assistance. Informal universal theorem; no worldwide novelty claim for dovetailing. + +Fix two correct terminating packed-integer multiplication algorithms A and B on the same bounded-word RAM instruction model. Count every input-specific setup, table construction, computation and output operation. Assume their address bounds are polynomial in n and their required word widths are O(log n), with fixed constants. Both logical shifts and word multiplication are allowed; a route using fewer primitives is also an algorithm on this model. Let t_A(x,y) and t_B(x,y) be their actual instruction costs. + +There is a uniform portfolio multiplier with total operation cost + + O(min(t_A(x,y), t_B(x,y)) + ceil(n/w)) + +and no assumption that either route wins. This is an implementable sufficient construction, not a proposed theorem conditioned on an unknown fast gadget. + +Construction: retain one readonly packed input, prepare two disjoint virtual machine contexts and private writable memory arenas, and alternate one simulated RAM instruction from each. Every input-dependent preparation instruction is part of that schedule. Stop when either context genuinely halts with its complete packed output. Return that output buffer, or copy it once if the public ABI fixes a separate output buffer. + +Correctness follows because each context has the same state evolution as its standalone program; disjoint writable arenas prevent interference. Both algorithms are correct under their explicitly retained premises, so either returned product is exact. Dovetailing does not make an incorrect candidate safe: both correctness contracts are required. + +At most 2*min(t_A,t_B) source instructions are scheduled before the first halt. Each is implemented by a constant number of target instructions because the two fixed instruction sets are finite, register contexts are bounded, and memory accesses use explicit disjoint arena offsets. An extra fixed address bit or larger fixed multiplier in w absorbs the sum of the two polynomial address envelopes. If the sources use different fixed word-width constants, emulate each source width by a fixed number of words and mask modular arithmetic at that width. This is constant overhead; no unbounded integer is treated as a word. Program counters, halt tests and code lookup are charged. Each setup allocation is initialized only through its own charged operations. The final copy, if required, costs O(n/w). These facts prove the stated bound. + +If A and B both have proven upper bound O(n/(log n)^kappa) with kappa < 1, the portfolio has that same bound because n/w = O(n/log n) is no larger. Thus a native-first experimental backend can be added without abandoning the transferred TM guarantee. This is a positive safe-adoption theorem, not proof that the native backend is faster. + +For a stronger asymptotic upper-bound claim, a native proof of O(n/(log n)^(kappa+delta)) for fixed delta > 0 would improve the currently stated comparison envelope by a factor (log n)^delta. It would not prove an actual runtime separation from a baseline known only by an upper bound: the baseline may also run faster than its proved bound. A real runtime-separation theorem needs additional information about the baseline cost. + +This theorem concerns the mathematical portfolio construction. Neither complete asymptotic multiplication implementation has been emitted here, so no practical portfolio benchmark is claimed. Credit classical algorithm dovetailing and the bounded-word/dirty-arena compiler precedents described in the preceding native package. diff --git a/research/ram-route-comparison/README.md b/research/ram-route-comparison/README.md new file mode 100644 index 0000000000..5daaa45ff9 --- /dev/null +++ b/research/ram-route-comparison/README.md @@ -0,0 +1,35 @@ +# Comparing native Word RAM with the TM route on equal footing + +The present evidence supports a native research backend, not an exclusive switch justified by a proved computational advantage. + +The decisive comparison is on the SAME Word RAM, packed input/output, exact product contract, charged setup and word width C log n. The optimized TM route is not one RAM instruction per tape step. PR #4541 constructs logarithmic-window batching with total cost + + O((T(n)+n+m)/log(n+2) + (n+2)^(1/16)*log(n+2)). + +For multiplication with m <= 2n and the retained conditional TM bound T(n)=O(n*(log n)^(1-kappa)), this already gives O(n/(log n)^kappa) RAM operations. The additive setup and IO terms are absorbed for the present fixed kappa below 1. Its instruction model does not require word MUL or DIV. PR #4552 independently checks its parameters and packed macro simulation; that finite review does not establish all antecedent multiplication assumptions. PR #4553 separately covers packed codecs. + +Our latest native result also gives O(n/(log n)^0.0030217758), under its explicitly retained native/analytic premises. Thus the +4e-10 number improves the previously reported NATIVE backend in PR #4635; it is not a stronger Word RAM complexity guarantee than transferring the same latest TM bound. The native construction avoids the TM simulator, which is architectural independence rather than an established speedup. Its DIV-free variant does not change this comparison. + +A useful next success would be a strictly stronger complete native upper bound on that common model, or a complete implementation showing a measured advantage under a specified workload and hardware. A smaller proved upper bound is a stronger guarantee; it does not alone prove the old algorithm has a slower actual runtime. Neither source presently supplies a complete practical implementation or a claimed usable cutoff. + +## Positive adoption result + +PORTFOLIO-THEOREM.md constructs a uniform native-first portfolio that alternates the two correct RAM algorithms in disjoint contexts, charges each route's setup, and returns the first completed exact product. Its cost is O(min(t_native,t_packed)+n/w), with constant dispatch/arena overhead. Consequently an experimental native backend can be adopted while retaining the better runtime of the two up to constant overhead. This is a universal sufficient construction, not an impossibility result or an invented speed advantage. Correctness requires the stated correctness contracts of both candidates; racing an unproved implementation does not certify its answer. + +The literature worker's SWITCH-DECISION.md supplies the comparison table, exact meaning of a positive exponent gap, and a full-product benchmark protocol. The packed-simulation theorem and independent small-machine checks, when present alongside this report, are supplementary operational evidence. No fresh Lean kernel proof, complete multiplier, actual comparative benchmark or new kappa is claimed by this decision document. + +## Evidence and predecessor credit + +Primary project sources: https://github.com/CrocSwap/integer-mult-bounds/pull/4541 , https://github.com/CrocSwap/integer-mult-bounds/pull/4552 and https://github.com/CrocSwap/integer-mult-bounds/pull/4553 . The actual native proof is pinned in the preceding native-wordram-tightening package. Exact-head source reads and their limits are recorded by the comparison workers; public API refresh was rate-limited. No selected frontier, canonical DAG, proof module, predecessor package or uploaded branch has been changed. + +Credit Dugongue's #4541/#4630/#4635 native and transfer work, Ryanson Jonathan/pinterbanget's #4552/#4553 checks, Hopcroft/Paul/Valiant's classical logarithmic simulation, Fuerer's machine-model analysis, the Lax/Problem 1.8 compiler lineage, Cao Yifan's #4610 source profile, Cinna Davis and retained supplier/compiler/analytic contributors, and all credited source owners. Prepared for Dugongue with substantial OpenAI Codex assistance: one lead and three comparison/review workers. Classical dovetailing and logarithmic simulation are credited precedents, not novelty claims. + +## Reproduction + +Run `python3 -I -O -B research/ram-route-comparison/verify.py` from the repository root, or run verify.py from a Git-free package copy. Python 3.12 standard library only; no network or Windows dependency. The proof documents establish informal universal constructions; finite checks address parameters and packed window execution. No new kappa or practical speedup is claimed. + +The frozen native proof and arithmetic receipt are in native/, with their local source commit and hashes in SCIENTIFIC-SOURCES.json. This is source evidence for the compared conditional claim, not an independently rerun native compiler or proof of its inherited universal premises. The portfolio may retain a TM-derived branch during validation; it is not the final TM-free architecture requested for a native production backend. + +## Open next questions + +The next useful result is a complete improved native bound after all costs, or an implemented full-product comparison with declared setup/reuse policy and hardware. Begin with the actual dominant provider/controller invoice and literal ownership/precision ports; neither a generic table theorem nor an isolated native kernel supplies that missing gain. Independently review the supplied universal simulation/portfolio proofs before relying on this report as accepted mathematics. diff --git a/research/ram-route-comparison/SCIENTIFIC-SOURCES.json b/research/ram-route-comparison/SCIENTIFIC-SOURCES.json new file mode 100644 index 0000000000..4a57b5492a --- /dev/null +++ b/research/ram-route-comparison/SCIENTIFIC-SOURCES.json @@ -0,0 +1,17 @@ +{ + "baseline": { + "head": "46ca24a88b5194725a82c02003aac8aea0c6f53a", + "pr": 4541, + "pins": "baseline/SOURCE-PINS.json" + }, + "native": { + "source_commit": "9bb3f3f72925e8825c8b4851dfdc8e92b72db949", + "status": "local source-bound conditional native deliverable, not scientific acceptance", + "source_prefix": "research/native-wordram-tightening/transfer/", + "files": { + "NATIVE-TRANSFER.md": "f19fb98feb3c20ca23ab03b339ffde5243fd4587a7620624a0b7a3678faac0ab", + "RESULT.json": "a3a7a590340ec774ede7ce68ccf76689e73910942fc48ae00eea664ff00c50ec" + } + }, + "coverage": "Frozen comparison; current broad API refresh rate-limited. No exhaustive history claim." +} diff --git a/research/ram-route-comparison/SOURCES.json b/research/ram-route-comparison/SOURCES.json new file mode 100644 index 0000000000..4916cee8e5 --- /dev/null +++ b/research/ram-route-comparison/SOURCES.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "base_commit": "b58ad9ef4d4e861b0eaa5dba41742bdc072dca51", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "c35482cd9035843b15a634cc8276a7e1e40e8395", + "sha256": "6fe0a099b89aa2aed796a13c3a21dafc63f3388ebf397464e44e0451893b9375" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "f126dd2e2dad2b669e75d1d0d0bd05c600725602", + "sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72" + } + ] +} diff --git a/research/ram-route-comparison/SWITCH-DECISION.md b/research/ram-route-comparison/SWITCH-DECISION.md new file mode 100644 index 0000000000..790b0e3f23 --- /dev/null +++ b/research/ram-route-comparison/SWITCH-DECISION.md @@ -0,0 +1,53 @@ +# A fair decision about the Word RAM backend + +**Recommendation:** develop the native Word RAM implementation while retaining the packed TM-derived backend as a correctness and cost reference. Current evidence supports the new backend as a constructive alternative; it does not yet establish a superior native exponent against the best eligible packed transfer, a practical speedup, or a reason to discard the reference backend. + +Prepared for Dugongue with substantial OpenAI Codex assistance, 2026-10-22. This note distinguishes proved upper bounds, measured performance and lower bounds. + +## Compare the same task and instructions + +Use packed binary operands of at most n bits and return their exact product in at most 2n bits. Both backends run on one bounded-word RAM with w = C log(n+2), where C is a fixed sufficiently large constant. Charge all input conversion, preparation, allocation, routing, arithmetic, restoration, recovery and output. A word instruction multiplies only bounded-size words. It does not multiply arbitrary n-bit integers or operate exactly on unrestricted complex numbers. + +| Backend or theorem | Charged complexity | Meaning | +|---|---|---| +| Conditional multitape theorem | O(n (log n)^(1−κ)) tape steps | A different cost model; not the fair direct RAM competitor. | +| Packed transfer, PR #4541 | O(n / (log n)^κ) RAM operations | Preserves the supplied TM κ, including packed input/output and fresh table setup. | +| Native Gaussian assembly, PR #4635 and successors | O(n / (log n)^κ) RAM operations | Uses native arithmetic, routing and analytic recovery; no TM simulation in its execution. | +| Classical complex FFT on Fürer’s log-RAM | O(n) RAM operations | Published baseline; ordinary word packing alone is not a new κ mechanism. | +| GMP on an actual fixed-word computer | Runtime depends on input size, thresholds and machine | Appropriate for empirical claims over stated sizes, not a substitute for a growing-word asymptotic proof. | + +PR #4541’s public statement pays O((T(n)+n+m)/log(n+2) + (n+2)^(1/16) log(n+2)) for a fixed finite machine with a known polynomial envelope and output cap m. For T(n) = O(n (log n)^(1−κ)), m ≤ 2n and 0 < κ < 1, this yields O(n / (log n)^κ). Its core does not require word MUL/DIV, so it remains an available competitor in the stronger RAM that permits them. Comparing native arithmetic to an unoptimized one-tape-step-per-RAM-instruction simulator would therefore omit an existing relevant competitor. Source: [PR #4541](https://github.com/CrocSwap/integer-mult-bounds/pull/4541), whose published construction credits Hopcroft–Paul–Valiant’s logarithmic simulation and explicitly handles packed IO. + +For a shared admitted supplier exponent κ, the packed transfer and native assembly presently have the **same stated asymptotic class**. A stronger κ available to one route must first be checked for transfer eligibility on the other. A small reserve tightening in a source supplier must not be counted twice as an architectural advantage. Native execution can remove TM-specific obligations or avoid a BIT supplier, but that is a scope benefit until it changes the complete complexity guarantee under comparable assumptions. + +## A positive sufficient criterion for a stronger guarantee + +Suppose one actual native algorithm has a proved complete cost upper bound A(n) = a n / (log n)^κ_N and an eligible packed reference has a proved complete cost upper bound B(n) = b n / (log n)^κ_P, with positive fixed a,b and κ_N > κ_P. Include setup and IO in these bounds, or prove they are absorbed by the same bounds. Then + + A(n) / B(n) = (a/b) (log n)^−(κ_N−κ_P) → 0. + +This proves a strictly stronger asymptotic **upper-bound guarantee** for the native construction. It is already a sound complexity-based reason to prefer that proved guarantee. It does not prove actual running-time ratio T_native(n)/T_reference(n) → 0: two upper bounds do not determine that ratio, and the reference might run faster than its stated bound. An actual ratio conclusion additionally needs a suitable reference lower bound, a tight cost characterization, or a direct algorithm-specific comparison. + +The proof of the displayed limit is elementary: put Δ = κ_N−κ_P > 0; log n tends to infinity and x^−Δ tends to zero. For any desired envelope ratio 0 < ρ < 1, the explicit sufficient condition is log n ≥ (a/(ρ b))^(1/Δ). Without proved numerical constants and valid cutoffs, this is not a usable practical crossover. None is claimed here. + +A sufficient research deliverable for this criterion identifies the actual native program or constructive family, exact changed paid mechanism, complete cost invoice, common instruction model, exact predecessor comparison, coefficient/prefix precision bounds and inherited assumptions. It then verifies the strict exponent gap. The criterion is positive and constructive; it does not assert that no other algorithm can do better. + +## What would justify a practical replacement + +Produce two complete exact-product implementations and compare them on the same input representation, compiler settings, hardware and thread budget. Include one-shot setup in the one-shot measurement; if a persistent context reuses tables, report its preparation separately and state the batch size used to amortize it. Check every computed product against an independent exact oracle outside the timed region. Use repeated paired trials, report distributions and retain raw observations, rather than timing only a favorable primitive. + +Use geometrically spaced sizes plus dense samples around algorithm thresholds; include zero, sparse, random, maximal-digit, unbalanced and carry-heavy inputs. Record peak memory and failure/cutoff behavior. Avoid source-path, hostname or user-account metadata in public benchmark artifacts. A local Gaussian kernel improvement or certificate-replay speedup is not a complete multiplier benchmark. + +These choices are motivated by actual implementation behavior: GMP selects among seven multiplication families using size thresholds, and its documentation identifies allocation and call overhead for small operands. Its FFT implementation has size rounding and parameter transitions that produce step-like timings. See the primary [GMP multiplication documentation](https://gmplib.org/manual/Multiplication-Algorithms), [FFT documentation](https://gmplib.org/manual/FFT-Multiplication), and [efficiency discussion](https://gmplib.org/manual/Efficiency). The protocol above is our proposed fair comparison; the GMP documentation is not being cited as an endorsement of this project’s algorithms. + +At present there is no complete practical native multiplier, validated usable crossover or end-to-end comparative benchmark in the inspected deliverable. Reporting those absences is a limit on the recommendation, not a standalone research result. + +## Why native work remains useful + +The native construction offers a direct implementation route on the machine the user wants to target. It permits experiments with bounded-word arithmetic, matrix-boundary kernels, explicit coefficient reuse and practical memory layouts without simulating tape transitions. Its complex-only supplier interface may admit progress that a currently available TM assembly cannot yet use. Retaining both backends lets future work exploit those opportunities while preserving a runnable comparison once complete implementations exist. This is a recommendation to pursue and compare the native backend, with a concrete stronger-guarantee criterion, not a claim that the existing equal-κ bound already compels an exclusive switch. + +## Predecessor credit and search limits + +Credit Dugongue’s PR #4541 packed transfer and PR #4554/#4630/#4635 native adapters and assembly; Cao Yifan’s #4610 word; Cinna Davis and the #4470 supplier/controller lineage; the retained Problem 1.8 Word RAM sources; Hopcroft, Paul and Valiant; Fürer; Harvey and van der Hoeven; and all source-specific credited contributors. Independent checks #4552 and #4553 concern parts of #4541 and do not replace a universal proof audit. + +Fürer’s primary [2014 log-RAM paper](https://arxiv.org/abs/1402.1811) separates O(log n)-bit unit-cost arithmetic from refined depth costs and proves the classical O(n) multiplication baseline. It does not show that this conditional native construction is faster in practice. The companion literature search covered 43 recorded queries and selected primary papers/Lean sources; neither this note nor that search establishes exhaustive worldwide priority or an optimal RAM lower bound. diff --git a/research/ram-route-comparison/TASK.json b/research/ram-route-comparison/TASK.json new file mode 100644 index 0000000000..f33476f1d8 --- /dev/null +++ b/research/ram-route-comparison/TASK.json @@ -0,0 +1,80 @@ +{ + "schema_version": 1, + "task_id": "uniform-transfer-audit", + "priority_revision": 7, + "base_commit": "b58ad9ef4d4e861b0eaa5dba41742bdc072dca51", + "original_card": { + "id": "uniform-transfer-audit", + "question": "Does one quantified step of the proposed #4100 all-size construction hold at its actual caller?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/unconditional-batched-crt/README.md" + ], + "methods": [ + "Prove one missing implication with explicit quantified hypotheses.", + "Find an exact counterexample at the claimed interface boundary." + ], + "acceptance_gate": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read PROOF.md and AUDIT.md in #4100. Select one distinct obligation: CRT total repair, native/free-algebra lifting, precision/conditioning, or complete fixed-tape cost. This is an author-submitted proof, not an accepted unconditional theorem.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "first_experiment": "Check live handoffs; name one proposition, its caller, quantified domain and dependency closure. Independently prove the implication or exhibit a precise gap/counterexample. Prioritize CRT.md total repair or COMPLEX.md free-algebra lift only if unclaimed. Stop at the chosen obligation; do not substitute finite samples or root arithmetic for an all-size proof, or launch the complete package by default.", + "bottleneck_link": "Finite supplier improvements are useful only under the retained transfer obligations.", + "allowed_variations": [ + "One CRT repair, native lift, precision/conditioning or tape-cost proposition, with its exact caller." + ], + "scope_change_triggers": [ + "Replacing a quantified obligation with another finite smoke test.", + "Treating archive intake, an author PASS receipt or a finite composed fixture as discharge of the universal hypotheses." + ], + "overlap_terms": [ + "uniform transfer", + "all-size", + "precision", + "4100", + "unconditional-batched-crt" + ], + "existing_checks": [ + { + "scope": "PR #4100: proposed unconditional construction and finite checks, without independent acceptance.", + "evidence": "research/unconditional-batched-crt/README.md", + "remaining": "Independent proof audit of one caller-bound all-size implication; all other premises remain explicit.", + "status": "author-checked", + "source_commit": "337d04939571a637aeab54a0f58f54fde811663a", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Fair same-model comparison of native Word RAM and packed-TM multiplication, with constructive simulation and a safe portfolio adoption theorem.", + "scope_change_reason": "User requested the existing comparison report as a publishable deliverable. Current equal exponents do not prove exclusive native superiority.", + "bottleneck_link": "Prevents counting an existing logarithmic TM-to-RAM packing advantage as a new native advantage; gives a constructive adoption guarantee.", + "budget_minutes": 20, + "stop_rule": "Package frozen comparison, source-bind claims, run exact finite components and publisher preflight.", + "outcome": "completed", + "evidence": "README.md, PORTFOLIO-THEOREM.md, PACKED-TM-BASELINE.md, baseline/FAIR-COMPARISON.md and verify.py.", + "author": "Dugongue", + "ai_assistance": "Prepared for Dugongue with substantial OpenAI Codex assistance; one lead and three comparison workers.", + "open_questions": [ + { + "question": "Can a complete native provider/caller improve the common RAM bound?", + "why_it_matters": "Would provide a stronger complexity guarantee.", + "first_step": "Change the actual paid invoice and recheck every recurring native row.", + "blocked_by": "No such gain is claimed in this comparison." + }, + { + "question": "Does an emitted native multiplier beat the packed reference at usable sizes?", + "why_it_matters": "Would support an implementation switch.", + "first_step": "Implement both complete products with common ABI and explicit setup/reuse policy.", + "blocked_by": "No complete practical implementation or comparative benchmark is supplied." + } + ] +} diff --git a/research/ram-route-comparison/VERIFY.json b/research/ram-route-comparison/VERIFY.json new file mode 100644 index 0000000000..2832583217 --- /dev/null +++ b/research/ram-route-comparison/VERIFY.json @@ -0,0 +1,44 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/ram-route-comparison/.gitattributes", + "research/ram-route-comparison/baseline/check_comparison.py", + "research/ram-route-comparison/baseline/FAIR-COMPARISON.md", + "research/ram-route-comparison/baseline/OVERLAP.md", + "research/ram-route-comparison/baseline/PACKED-IO.md", + "research/ram-route-comparison/baseline/PROOF.md", + "research/ram-route-comparison/baseline/README.md", + "research/ram-route-comparison/baseline/SOURCE-PINS.json", + "research/ram-route-comparison/check_packed_simulation.py", + "research/ram-route-comparison/CHECKS.json", + "research/ram-route-comparison/LICENSE", + "research/ram-route-comparison/native/NATIVE-TRANSFER.md", + "research/ram-route-comparison/native/RESULT.json", + "research/ram-route-comparison/PACKED-TM-BASELINE.md", + "research/ram-route-comparison/PORTFOLIO-THEOREM.md", + "research/ram-route-comparison/README.md", + "research/ram-route-comparison/SCIENTIFIC-SOURCES.json", + "research/ram-route-comparison/SOURCES.json", + "research/ram-route-comparison/SWITCH-DECISION.md", + "research/ram-route-comparison/TASK.json", + "research/ram-route-comparison/VERIFY.json", + "research/ram-route-comparison/verify.py", + "research/ram-route-comparison/MANIFEST.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Check source-bound comparison, parameter cases, independent packed macro execution and corruption control; no improved exponent or native superiority claimed." + } + ] +} diff --git a/research/ram-route-comparison/baseline/FAIR-COMPARISON.md b/research/ram-route-comparison/baseline/FAIR-COMPARISON.md new file mode 100644 index 0000000000..6b8f7182e2 --- /dev/null +++ b/research/ram-route-comparison/baseline/FAIR-COMPARISON.md @@ -0,0 +1,59 @@ +# Fair same-model comparison and a positive dominance criterion + +The current native route and the packed-TM route have the same certified conditional Word RAM exponent: kappa = 0.0030217758. The direct native construction removes the TM dependency from its execution proof; that architectural change alone does not establish a faster algorithm. + +Prepared for Dugongue with substantial OpenAI Codex assistance. Apache-2.0. This is an informal sufficient comparison theorem and source audit, not a timing experiment or a new multiplication theorem. + +## Actual baseline, not one RAM instruction per TM transition + +PR #4541 at 46ca24a88b5194725a82c02003aac8aea0c6f53a proves a uniform packed-window simulator for a fixed finite k-tape machine. If its actual run takes T transitions, has total binary input n, output cap m and a fixed polynomial time/address envelope, its bounded-word RAM cost is + + O((T+n+m)/log(n+2) + (n+2)^(1/16) log(n+2)). + +It charges table generation on every input, all reads before writes, signed origins, packed binary codecs, partial chunks and genuine halting. Its instruction set is additive/Boolean with logical shifts, indirect memory and branches; it needs neither multiplication nor division. This is therefore a valid baseline on the stronger multiplication-enabled Word RAM used by the direct native route. Both results must use packed input/output, logarithmic word width with sufficiently large fixed coefficient, and the same zero-initialized fresh-memory convention when compared. A one-bit-per-word ABI would impose an additional linear input/output floor on both. + +PR #4552 at a821e926e3d7eaeae8b12be974dc5083360f6494 independently checks the exact parameter arithmetic and macro-step invariant. PR #4553 independently checks packed codecs; neither finite check proves the supplied multiplication antecedent. The packed-simulation construction is credited to Dugongue and the classical Hopcroft-Paul-Valiant method, with the explicit sub-n-log-n packed-IO treatment credited to #4541. + +Consequently every complete fixed-machine conditional bound + + T(n) = O(n (log n)^(1-kappa_T)), 0 < kappa_T < 1, + +already gives a same-model packed RAM bound O(n/(log n)^kappa_T). Apply this to the latest complete conditional TM antecedent at kappa_T = 0.0030217758 only with all of its own retained hypotheses. The direct native transfer at kappa_R = 0.0030217758 then matches the exponent. Comparing it instead with O(T) would invent a logarithmic advantage that #4541 already supplies. + +## Positive sufficient theorem: better certified bound + +Let two correct algorithms operate on the same packed ABI and Word RAM. Suppose the packed-TM source has the complete bound above at kappa_T, and a fully charged native construction has + + R_N(n) <= C_N n (log n)^(-kappa_N) (log log n)^a + +for fixed a >= 0 and C_N, with all setup, precision, restoration and output terms included. If kappa_N > kappa_T, then for every 0 < eta < kappa_N-kappa_T, + + R_N(n) = O(n/(log n)^(kappa_T+eta)). + +Proof: put x = log n. For each fixed a and positive delta, (log x)^a = o(x^delta). Take delta = kappa_N-kappa_T-eta. Substitute in the complete native bound. The packed-simulator setup n^(1/16) log n and packed-IO term n/log n are lower order than n/(log n)^kappa_T, so its stated upper envelope is O(n/(log n)^kappa_T). The native theorem therefore supplies a strictly smaller certified asymptotic envelope. This conclusion compares guarantees; upper bounds alone do not prove that one actual implementation is faster on every large input. + +For an actual asymptotic runtime speedup, the additional sufficient hypothesis is that the baseline run itself has time Omega(n/(log n)^kappa_T) on the compared input family. Under that explicit hypothesis the same calculation proves R_N/R_baseline tends to zero. With explicit constants and cutoffs, a finite crossover certificate is the check + + C_N (log n)^(-(kappa_N-kappa_T)) (log log n)^a < c_baseline. + +No such lower bound, constants or crossover has been established for the present complete multipliers. They must not be inferred from headline big-O statements. + +## Positive robust adoption theorem + +If both complete algorithms are available with the same packed ABI and independently owned work arenas, alternate one bounded native instruction from each until either genuinely halts, then return its verified output. This uniform portfolio is correct and takes O(min(R_N,R_S)+n/log n) target operations (at most 2 min(R_N,R_S) scheduled source steps, plus constant dispatch/relocation overhead), with the memory sum of the two executions. Each side receives the same input headers and immutable input; unrelated dirty storage is untouched by its ownership protocol. The result follows by counting the alternation rounds until the first completion. It preserves whichever complete bound is stronger and gives a safe comparison harness. It retains a simulated TM branch, so it is a validation/transition strategy, not the user's requested final TM-free execution architecture. + +A wholly TM-free production replacement requires the direct native implementation and its proof. Its adoption can be justified structurally by the removed tape semantics and the ability to improve native row tariffs independently, but a statement of computational superiority requires the strict inequality or concrete cost certificate above. + +## Preparation distinction + +The particular #4541 simulator explicitly constructs every short-window table row. Write lambda=floor(log2(n+2)), c for alphabet-code width, K for the least power of two at least k, r for its epoch length, and b=s+kc(2r+1). Above its fixed cutoff, r >= lambda/(128Kc), hence + + b >= k lambda/(64K). + +Thus that chosen eager simulator's table generation has at least 2^b = Omega(n^(k/(64K))) row writes, as well as its proven upper bound O(n^(1/16) log n). If an actual native caller has the retained n^o(1) preparation bound, its preparation is asymptotically smaller than this chosen eager table construction. This is a positive subroutine comparison, not a whole-multiplication speedup: both setup costs remain below the main n/(log n)^kappa work. It is not a lower bound for every possible simulator, and amortizing tables across repeated inputs changes the comparison. + +## Scope and next actionable checkpoint + +The exact current comparison is equal kappa under separate conditional proof chains. A convincing larger native saving must change a complete native row or supplier/consumer invoice and beat the packed-TM exponent after all native terms are paid. A practical switch claim instead needs emitted instruction counts or reproducible same-ABI measurements, including setup and IO. The positive dominance criterion specifies exactly what either path must establish, without using a naive TM simulator as a weakened baseline. + +Sources: https://github.com/CrocSwap/integer-mult-bounds/pull/4541 ; https://github.com/CrocSwap/integer-mult-bounds/pull/4552 ; https://github.com/CrocSwap/integer-mult-bounds/pull/4553 ; https://github.com/CrocSwap/integer-mult-bounds/pull/4610 ; https://github.com/CrocSwap/integer-mult-bounds/pull/4635 . Frozen #4541 source bytes and hashes are preserved alongside this note; source reading, not an exhaustive all-history audit, is claimed. diff --git a/research/ram-route-comparison/baseline/OVERLAP.md b/research/ram-route-comparison/baseline/OVERLAP.md new file mode 100644 index 0000000000..f88cf29130 --- /dev/null +++ b/research/ram-route-comparison/baseline/OVERLAP.md @@ -0,0 +1,50 @@ +# Overlap: packed RAM corollary, original source and classical simulation + +## What the original manuscript states + +The retained OpenAI manuscript is pinned at openai/math commit adc7f1241b42e322a6451854ab7e4b4c146bf78a. Its introduction states the multiplication result on a single fixed finite-alphabet, fixed-tape-count TM, with the exact fixed-width MSB-first product. Its history section distinguishes storage-modification machines and Groff's RAM result with excluded preprocessing; its exact-DFT discussion uses unbounded exact complex scalars and explicitly separates bit complexity. No packed bounded-word multiplication corollary appears in those inspected passages. + +The current upstream path history returned only its initial commit. Four inspected source files match the pinned upstream manifest exactly. Their hashes and public original URLs are in OVERLAP-SOURCES.json. + +Relevant originals: +- Introduction, lines 13–29: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/Integer-multiplication-below-n-log-n-September-23-2026/build/sections/00-introduction.tex +- History, lines 28–34 and 141–164: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/Integer-multiplication-below-n-log-n-September-23-2026/build/sections/01-history.tex +- Fixed-tape model, Section 2: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/Integer-multiplication-below-n-log-n-September-23-2026/build/sections/02-streams.tex + +## The classical simulation precedent + +Hopcroft, Paul and Valiant's *On Time versus Space and Related Problems* (FOCS 1975), Section 4, Theorem 5, gives a logarithmic RAM simulation speedup using precomputed bounded TM blocks. It explicitly assumes t(n)>=n log n and explains that its RAM needs n operations to examine the input. Corollary 3 applies this to multiplication, obtaining O(n log log n) from the then-available TM algorithm, while keeping numbers O(log n) bits long. + +Primary source: https://www-wjp.cs.uni-saarland.de/publikationen/HPV75.pdf , printed page 63 (PDF page 7). SHA-256: 4700da81799d5e8794d37c2fdcc43eb06c3ec252ed9b878ce56805df5f88e57c. + +Therefore the generic Four-Russians TM simulation is classical. The original theorem's stated t>=n log n hypothesis cannot simply be ignored when applying it to t=n(log n)^(1-kappa). A complete present proof must supply its packed-I/O variant, charge its preprocessing and establish bounded words and addresses. + +## What is different in the present application + +The proposed constructive variant uses Theta(log n)-step local windows and pays uniform sublinear table generation. With packed binary input/output and explicit codecs, its cost is +$$ +O\left(\frac{T(n)+n}{\log(n+2)} ++n^\epsilon\operatorname{polylog}(n)\right) +$$ +for a chosen fixed epsilon<1. At a fixed 0=2, a power of two, and r>=1, also a power of two. The simulated tape +alphabet uses blank symbol 0 and logical bit codes 1,2. Other symbols may exist +internally, but an output binary prefix contains only 1 and 2 before its first +blank. Let beta=2^r. An n-bit operand arrives in exactly ceil(n/r) little-endian +base-beta digit words; the final digit's unused high bits must be zero. The +length header n, table arenas, input/output arrays and all pointers fit in +bounded w-bit words. Require 2cr+8=8, d>=1 give + + T+n+m+16 <= 2^(a-4) (n+2)^d. + +The machine receives packed binary input in power-of-two chunks as specified below. Its conventional TM input protocol uses two nonblank bit symbols distinct from blank, at fixed tape origins; its output is an MSB-first binary word at a fixed origin, terminated by blank or occupying the whole m-cell cap. A fixed alphabet relabeling and ordinary linear-time TM protocol conversion can arrange this standard interface. Such conversion time is part of T, not an uncharged oracle. + +There is a uniform finite-program Word RAM algorithm, fixed before n and independent of actual T and physical word width, with word width w >= C_M (floor(log2(n+2))+1), that produces exactly the same integer output in fixed-width packed LSB form. It uses only literal assignment, indirect LOAD/STORE, ADD, natural SUB, Boolean operations, shifts, branches and word input/output. It uses no multiplication/division instruction, supplied lookup table, advice string, randomization or unit-cost exact complex cell. Its total cost is + + O_M((T+n+m)/log(n+2) + (n+2)^(1/16) log(n+2)). (1) + +All constants and the fixed program may depend on M and the chosen envelope constants a,d; the M subscript below includes those fixed constants. Every address and intermediate value fits in a word. A nonhalting TM computation is not converted to a halt by an artificial epoch boundary: every finite prefix within the same numerical envelope is simulated faithfully. The halting theorem itself assumes the stated finite T. + +The RAM memory starts identically zero, as in the actual Problem 1.8 RamStd model used in PR #4538. All newly allocated table, tape, IO, descriptor and scratch arenas are disjoint. The numeric span of memory is polynomial in n; zero initialization of that model is not a clearing algorithm for arbitrary dirty storage. + +## 1. Uniform parameter choice and complete setup + +Let lambda=floor(log2(n+2)), ell=lambda+1. Choose c, a fixed power of two, large enough to encode the fixed alphabet, and c>=2 so blank and the two bit codes fit. Let K be the least power of two at least k and s=max(1,ceil(log2 Q)). Define + + q = floor(lambda/(64 K c)); + r = largest power of two <= max(1,q); + B = 4r; L = 2r+1. + +Because 64Kc is a power of two, q is obtained by a right shift; r is obtained by a doubling loop. lambda is computed by repeatedly right-shifting n+2. This costs O(log(n+2)) word operations. r is Theta_M(log(n+2)), with the small-input cutoff absorbed in machine-dependent constants; in particular r >= lambda/(128Kc) when lambda>=1. + +The local table has one row for every bit pattern consisting of a state field and k windows of L consecutive c-bit symbols. Its key size is + + b = s + kc(2r+1). + +For lambda >= max(64Kc,64s), we have r>=1, 64kcr<=lambda and 64s<=lambda. Since 2r+1<=3r, + + 16b <= 16s + 48kcr <= lambda. + +Thus all 2^b rows, including invalid/unreachable state or symbol patterns, number at most (n+2)^(1/16). The finitely many smaller inputs have a fixed table-size bound depending only on M. No universal statement about an arbitrary Q is inferred from the Q=3 parameter tests; the state-bit cutoff is explicit. + +For each row, place each local head at offset r in its window and simulate up to r literal M transitions, stopping at the first missing transition. Save the terminal state, a true-halt flag, elapsed transition count, all k updated windows, and the k final local head offsets. Missing transitions on invalid patterns may be defined as halt; valid runs never use invalid encodings. Dispatch over the fixed finite transition table costs a machine-dependent constant per local step. Construction therefore costs O_M(r 2^b) operations. Store each row in a fixed power-of-two stride of at least 2k+3 words, so its address is formed by a shift and an addition. Every entry is generated during the run from M and r; no table is supplied for free. + +The binary codec tables in PACKED-IO.md contain O(2^r+2^(cr)) rows and take O(r 2^(cr)) setup. Their exponent is smaller than b, so they fit the same startup bound. This pays setup for every input, without amortizing over an unspecified batch of inputs. + +## 2. Ordinary coordinates, packed words and address safety + +Use a fixed polynomial origin + + H = 2^(a+d*ell). + +This is computed by a shift whose exponent uses fixed-constant repeated addition. The program knows a,d as machine constants; it does not receive T or a time-horizon advice string. A signed TM coordinate z is represented at nonnegative position H+z. The envelope implies H is more than sufficient for every visited position and the margin r; no truncating subtraction of a left window origin changes its intended value. + +A tape word stores B fields. Take a fixed power-of-two interleaving stride J>=k. Tape i, block u, is stored at + + dataBase + J*u + i. + +The table base is a fixed machine-dependent power of two above every reserved register/scratch cell (at least 512 in the model); the data base lies above all table and reserved cells. This remains valid for large fixed k, rather than assuming a 512-cell prefix suffices for every machine. Dividing a position by B and reducing it modulo B are right shift and AND because B is a power of two. Different tapes and blocks have different addresses; all metadata, rows, IO buffers and descriptors have separate arenas. + +A window of L<=B consecutive cells spans at most two packed words. If its first word supplies a fields, read its suffix and, only if needed, the low L-a fields of the next word. Shift, OR and mask these fields into one word. To write it back, clear only the corresponding field masks and OR in the two fragments. The Boolean identities prove preservation of every neighboring field and every unused high bit, with arbitrary dirty values there. This is a constant-size additive/Boolean operation sequence per tape, even when a window crosses a packed block boundary. The implementation provides generalized bounded-length chunks for input/output as well. + +This ordinary-coordinate representation matters: a signed interval is not a contiguous bitstring under the unpacked compiler's zigzag mapping. No strided gather, negative-bank reversal or arbitrary bit permutation is assumed to cost one operation. + +To see a logarithmic width suffices globally, note that key bits are at most s+3kc+lambda/32 for all inputs, table row size is fixed, H has a+d*ell+1 bits, and every visited coordinate lies within the supplied polynomial envelope. Multiplying a block index by the fixed interleaving stride is a shift. Adding all IO/descriptor arenas and margins still has polynomial numeric span. A sufficiently large fixed C_M bounds all these exponents and literals. For example, uniform_parameters in tabulated_tm.py uses the conservative coefficient a+d+s+rowLog+strideLog+4kc+32 for its table/tape envelope; a caller includes its fixed IO arena constants in C_M. Word width also exceeds 4cr+1, so masks, reservoirs and all shifted fields fit. At every greater physical word width, the same intended operations and output are obtained. This is bounded-word computation, not an unbounded-register simulation. + +## 3. One macro step and genuine halt + +Maintain the invariant: the saved state is M's state, head i is H plus its signed TM position, and every represented tape field equals its TM symbol. Initially encoded input fields establish the invariant, and every uninitialized field is blank because RAM memory is zero. + +At a macro boundary, fetch all k windows centered on the current heads before performing any tape writes. Form their concatenated key with the current state and fetch the generated row in O_M(1) word operations. Apply every updated window at its old position and set + + newHead_i = oldHead_i + savedLocalHead_i - r. + +All subtractions are safe under the polynomial-origin bound. During r TM transitions a head moves at most r, so it never reads or writes outside the supplied 2r+1-cell window; the final move may reach an endpoint, still inside the window. The local table's literal transition simulation and the all-reads-before-writes discipline therefore preserve the full invariant, including distinct tapes at coincident coordinates. Applying a returned complete window also preserves every cell outside it. + +If a missing transition is seen before r successful transitions, the true-halt flag is set and elapsed counts only actual transitions. If the r-th transition reaches a halting configuration, the next macro detects that missing transition with elapsed zero. Thus at most floor(T/r)+1 macro calls are needed for a halting run. An epoch completing r transitions without a flag does not itself halt. This proves both exact halting semantics and O_M(T/r+1) simulation cost. + +The operational model records its displayed primitive operations, not exact fully emitted RamStd instruction counts. All source loops are over fixed k or the explicit bounded table/epoch counters. Fixed-size dispatch, register assignment and branch lowering alter only machine-dependent constants. No local table lookup is counted as a whole TM step oracle: the complete table construction is explicit and charged above. + +## 4. Packed external ABI, including partial chunks + +Let each operand arrive as exactly ceil(length/r) little-endian r-bit digit words, with unused high bits zero; the logical lengths are supplied as bounded headers. The physical list-length prefix is also paid and fits in a word. For w=Theta(log n), this is an ordinary constant-density packing of the binary input. The format is determined by n, not by the unknown physical w, so it works at all sufficiently large word widths. Input bit length n is the declared padded binary length, not the number of list entries or the numerical value of an all-zero operand. + +The codec explicitly tabulates expansion from binary r-bit chunks into c-bit codes 1/2, and decoding from c-bit chunks to binary values with prefix lengths and validity. It handles reversed chunk order for MSB input and reversed output descriptors for fixed LSB output. Read, store, reverse and masked-insert O(n/r) chunks. Separate operands may use separate tapes. If they share a tape, use one continuous reservoir across operands and delimiters; concatenating separately padded partial chunks would insert blank cells and is incorrect. A fixed binary length header costs only O(log n) cells and fits the startup allowance. + +The output decoder reads at most ceil(m/r) coded chunks, stops at the first blank or cap, reverses the retained descriptors, writes exactly ceil(m/r) LSB digit words, and pads only high bits with zeros. This preserves the numeric value even for leading zeros, zero itself and a short terminated prefix. A full-width output need not expose its following terminator. No bit-by-bit external IO pass costing Theta(n) is hidden here. The detailed reservoir and first-blank proofs are in PACKED-IO.md. + +Counting generated setup, simulation, input and output now gives + + O_M(r 2^b + log(n+2) + T/r + (n+m)/r + 1), + +which implies (1). The total buffer footprint and the polynomial numeric address envelope were included above. Arbitrary dirty reuse would require separately paid initialization; the theorem does not silently change the zero-initialized RamStd model. + +## Corollary: the supplied multiplication bound + +Suppose a fixed deterministic multitape machine multiplies two padded n-bit integers in + + T(n) = O(n (log n)^(1-kappa)), 0=n log n because its input scan costs n. We use the method as precedent and supply the packed-input/packed-output construction explicitly for the sub-n-log-n regime; that theorem's original hypothesis is not simply dropped. PR #4538 supplies this project's exact bounded-word machine and packed-field refinement precedents. The current proof and code do not claim to have invented tabulation or established worldwide priority for the corollary. + +Sources and inspected overlap are recorded in OVERLAP.md and OVERLAP-SOURCES.json. The finite implementations check the displayed model; an emitted complete RamStd program, formal compiler refinement, isolated Linux execution and a new TM paid-profile witness are separate future work. They are not assumed as hidden mathematical gadgets in the algorithm above. diff --git a/research/ram-route-comparison/baseline/README.md b/research/ram-route-comparison/baseline/README.md new file mode 100644 index 0000000000..84d57c3372 --- /dev/null +++ b/research/ram-route-comparison/baseline/README.md @@ -0,0 +1,51 @@ +# Packed Word RAM multiplication transfer + +**Positive result:** a complete fixed multitape algorithm taking T(n) steps has a uniform bounded-word RAM implementation taking + + O((T(n)+n+m)/log(n+2) + (n+2)^(1/16) log(n+2)) + +operations, with explicitly packed binary input, output cap m, paid generated lookup tables, sufficient logarithmic word width and a fixed polynomial address envelope. Thus a supplied conditional integer-multiplication theorem T(n)=O(n(log n)^(1-kappa)) gives **O(n/(log n)^kappa)** RAM operations, including setup and IO. This is a genuine asymptotic improvement over the constant-overhead RAM backend in PR #4538. + +**No improved TM kappa is claimed.** The exponent kappa is inherited from the supplied TM theorem; its assumptions are not discharged. The current selected value is 0.0023 (#4359). Pending #4535 claims 0.003020165 using #4532/#4470; its arithmetic audit #4536 is not a complete proof audit. Neither selected-result files nor their suppliers are changed. No best-known unconditional RAM record, practical speedup or historical priority is asserted. + +## What changed and why it matters + +The previous PR gave constant overhead per TM step and packed storage. This package tabulates Theta(log n) consecutive TM steps and applies each generated row to a constant number of packed words. Crucially, a second generated codec avoids losing that gain in a linear bit-per-word input/output scan. The full native multiplication algorithm can therefore be transferred as an entire fixed TM, rather than requiring every analytic or recursive component to be rewritten before any target-model time gain is available. + +The target is the Problem 1.8 RamStd instruction semantics used in #4538: finite bounded words and addresses, zero-initialized memory, shared register/data semantics and successful-instruction cost. Algorithms use ADD, monus SUB, Boolean operations, shifts, loads/stores, branches and word IO. Word multiplication/division and exact complex-cell arithmetic are not used. The methods and proof are informal; the operational models are not complete emitted RamStd programs or Lean formalizations. + +## Review and reproduce + +Start with [PROOF.md](PROOF.md) for the complete construction, hypotheses, address proof and multiplication corollary. [PACKED-IO.md](PACKED-IO.md) proves binary expansion, reversed/capped output and padding. [TABULATED-MULTIPLY.md](TABULATED-MULTIPLY.md) provides a supplementary constructive word-MUL elimination lemma; the main simulation does not rely on it. [OVERLAP.md](OVERLAP.md) compares actual primary and project sources. + +From the repository root, Python 3.12 and standard library only: + +```sh +python3 scripts/research_package.py --package research/packed-ram-speedup --check-only +python3 scripts/research_package.py --package research/packed-ram-speedup +``` + +A Git-free extracted package can run `python3 -I -O -B verify.py`. The verifier authenticates the exact package inventory and every listed source before launching isolated optimized checks. The composed fixture also authenticates and directly compiles dependency source bytes, avoiding cached bytecode. No network, GitHub access, native compiler, GPU or Lean installation is required for the finite replays. + +The generic `run_packed` entry point computes its epoch and polynomial origin from the declared total length, generates all tables anew, and composes the codecs with the TM simulation without any supplied runtime fuel. Its caller supplies a fixed machine and proves the stated polynomial envelope. The composed checker includes one fresh invocation of that generic runner. + +The main model actually constructs every row of each finite test table and compares macro state, signed heads and every potentially affected tape cell against a separate literal TM interpreter. Controls include early/epoch-boundary halt, nonhalting prefixes, arbitrary dirty window neighbors, corrupted table rows and insufficient width. The codec checks partial chunks, leading zeros, blank termination, dirty post-terminator cells and seven actual decoder mutations. The composed positive fixture is one fixed 144-state machine multiplying all pairs of 2-bit integers through the entire packed codec/window/table/output chain. It is **not an all-length multiplier** or a claim that the huge frontier TM has been materialized. + +## Frontier work and remaining scope + +Three workers and the root also investigated changed native contact graphs, general Clifford frames, whole-prefix retiming and deferred helper compensation. No completely paid cheaper Fourier-rank profile was obtained. A faster free monomial wrapper or an entrance-only deletion with unaccounted prefix contacts cannot justify a larger TM kappa. These local attempts are not packaged as the research result: the positive complete-model transfer above is the result. + +The implementation is a finite operational model with an informal universal proof, not a kernel certificate. Fully emitting and refining the parametric RamStd code remains a concrete implementation task. Literal primitive-operation counts in model reports are not exact emitted instruction counts. All standard fixed-loop/control lowering contributes only machine-dependent constants to the proved asymptotic bound. Tests ran on Windows with portable Python; Linux-hosted execution is not claimed. + +## Open next questions + +- **Emit the whole parametric backend.** Why: makes the complete all-length uniform RAM program executable against RamStd.step. First step: lower table generation and the two-word window merge to finite labels, preserving source hashes and the fixed polynomial origin. Blocker: current executable is the operational model, not a serialized full program. +- **Bind a published complete TM instance.** Why: turns the generic corollary into a fully source-bound application. First step: select either #4359's admitted conditional supplier or #4535's stronger pending supplier and carry its whole source/assumption manifest into the transfer. Blocker: their enormous algorithm-defined transition machine is not materialized here; finite arithmetic audits do not prove those antecedents. +- **Change an actually paid native profile.** Why: a better TM kappa requires a new productive/paid moment, beyond free-wrapper savings. First step: construct one exact all-input coupled-contact rewrite and serialize every owned transport and prefix observation before scoring it. Blocker: no such cheaper complete invoice was established in this session. +- **Measure crossover and practical memory.** Why: machine-dependent table constants can be enormous. First step: report table rows, setup, steady-state work and memory separately for a real bounded machine. Blocker: finite tiny fixtures do not predict a useful threshold for the theoretical multiplier. + +## Credit + +Prepared for Dugongue with substantial OpenAI Codex assistance and three parallel agents. The logarithmic simulation/tabulation method is classical: credit John Hopcroft, Wolfgang Paul and Leslie Valiant (1975), Section 4. Martin Fuerer's 2014 log-RAM model and linear-time multiplication results are model-comparison precedents, not displaced unconditional results. Preserve the existing Problem 1.8 RAM/IMP/compiler and tensor/frame source credits through #4538, and Szymon Torunczyk/GPT's compositional-polytime lineage. + +The conditional multiplication antecedent retains the original OpenAI manuscript, Dillon's #4532, hexapode's #4535, Cinna Davis's #4470 and native/controller lineage, zxv's compiler and flow work, Jacob Alan Sussman's mixed-target recursion, Ryanson Jonathan's mirror/audit work, Dugongue's compact consumer/Word RAM work, and all physical, precision, prime, analytic and recovery contributors. PRs #647/#956 already construct exact-scalar RAM providers in their own models; this package does not relabel them as finite-word bit algorithms. Source-specific notices remain authoritative. New work is Apache-2.0; no independent human peer review is claimed. diff --git a/research/ram-route-comparison/baseline/SOURCE-PINS.json b/research/ram-route-comparison/baseline/SOURCE-PINS.json new file mode 100644 index 0000000000..451c8a067a --- /dev/null +++ b/research/ram-route-comparison/baseline/SOURCE-PINS.json @@ -0,0 +1,22 @@ +{ + "PROOF.md": { + "head": "46ca24a88b5194725a82c02003aac8aea0c6f53a", + "source": "research/packed-ram-speedup/PROOF.md", + "sha256": "788535dea58df897055de81175acdea9abb149604ad9bdf7ee36b6100982d541" + }, + "PACKED-IO.md": { + "head": "46ca24a88b5194725a82c02003aac8aea0c6f53a", + "source": "research/packed-ram-speedup/PACKED-IO.md", + "sha256": "3197b3763d6c8ac7733ed128b4191b19ae0fd22a9d94d90cf80ca2a3b9459120" + }, + "README.md": { + "head": "46ca24a88b5194725a82c02003aac8aea0c6f53a", + "source": "research/packed-ram-speedup/README.md", + "sha256": "7d5226933a90c875ea217f1814c15bac1206da38abb5373e1a4583ea02d09f4f" + }, + "OVERLAP.md": { + "head": "46ca24a88b5194725a82c02003aac8aea0c6f53a", + "source": "research/packed-ram-speedup/OVERLAP.md", + "sha256": "d6c20147e749ee4bb5931413fe8bda56c8a8f6aa4d8681867c0c2ed0426047a5" + } +} diff --git a/research/ram-route-comparison/baseline/check_comparison.py b/research/ram-route-comparison/baseline/check_comparison.py new file mode 100644 index 0000000000..4795cc5c1d --- /dev/null +++ b/research/ram-route-comparison/baseline/check_comparison.py @@ -0,0 +1,40 @@ +"""Exact arithmetic checks for the fair comparison; Apache-2.0. +Dugongue with substantial OpenAI Codex assistance. +""" +from fractions import Fraction as F +from pathlib import Path +import json,hashlib +R=Path(__file__).resolve().parent + +def need(b,msg): + if not b:raise ValueError(msg) + +def params(lam,k,c,s): + K=1 + while K=F(lam,128*K*c),'epoch lower bound') + need(b>=F(k*lam,64*K),'eager table lower exponent') + if lam>=max(64*K*c,64*s):need(16*b<=lam,'table upper exponent') + cases+=1 + kT=F('0.0030217758');kN=F('0.0030217758');old=F('0.0030217754') + need(kN==kT,'current same-model exponents equal') + need(kN-old==F(1,2500000000),'historical native-only gain') + # Concrete strict-improvement witness for the sufficient criterion, not a new algorithm. + candidate=kT+F(1,1000000);eta=F(1,2000000) + need(candidate-kT-eta>0,'positive logarithmic absorption slack') + return {'status':'PASS_FAIR_COMPARISON_ARITHMETIC','source_parameter_cases':cases,'current_kappa_native':str(kN),'current_kappa_packed_TM':str(kT),'strict_computational_superiority_established':False,'historical_native_only_gain':str(kN-old),'scope':'Exact parameter arithmetic and source hashes; universal dominance and portfolio arguments are written proofs, not benchmark results.'} +if __name__=='__main__':print(json.dumps(check(),indent=2)) diff --git a/research/ram-route-comparison/check_packed_simulation.py b/research/ram-route-comparison/check_packed_simulation.py new file mode 100644 index 0000000000..105cd9925d --- /dev/null +++ b/research/ram-route-comparison/check_packed_simulation.py @@ -0,0 +1,73 @@ +"""Finite independent controls for fixed-tape packed macro locality/writeback. +These finite Python tests do not certify asymptotic native instruction costs. +""" +from random import Random +import itertools,json + +def need(p,m): + if not p:raise ValueError(m) + +def run(table,state,tapes,heads,steps): + tapes=[list(t) for t in tapes];heads=list(heads);done=0 + for _ in range(steps): + if state==3:break + symbols=tuple(tapes[i][heads[i]] for i in range(2)) + nxt,writes,moves=table[state,symbols] + for i in range(2): + tapes[i][heads[i]]=writes[i];heads[i]+=moves[i] + state=nxt;done+=1 + return state,tapes,heads,done + +def pack(tape,b): + return [sum(v<>off)&((1<<(2*b+1))-1) + +def replace(blocks,head,b,code): + q,off=divmod(head-b,b);mask=(1<<(2*b+1))-1 + combined=sum(blocks[q+j]<<(j*b) for j in range(4)) + combined=(combined&~(mask<>(j*b))&((1<>(i*(2*b+1)))&((1<<(2*b+1))-1) for i in range(2)] + for state in range(4): + local=[[v>>j&1 for j in range(2*b+1)] for v in codes] + entry=run(table,state,local,[b,b],b) + newcodes=[sum(v<>(j%b)&1 for j in range(12*b)] for blocks in packed] + actual=run(table,state,tapes,heads,b) + delta=[entry[2][i]-b for i in range(2)] + need(out==actual[1] and entry[0]==actual[0] and entry[3]==actual[3],'macro simulation') + need([heads[i]+delta[i] for i in range(2)]==actual[2],'head displacement') + for i in range(2): + need(all(out[i][j]==original[i][j] for j in range(12*b) + if not heads[i]-b<=j<=heads[i]+b),'dirty exterior') + checks+=1;halts+=entry[0]==3;boundary+=any(o in(0,b-1) for o in offsets) + print(json.dumps({'status':'PASS_FINITE_PACKED_TM_MACRO_CONTROLS', + 'macro_cases':checks,'halting_cases':halts,'boundary_offset_cases':boundary, + 'fixed_tapes':2,'binary_alphabet':True,'macro_lengths':[1,2,3,4], + 'scope':'Finite exact simulation and masked writeback controls, not universal proof or native runtime evidence.'},indent=2)) +if __name__=='__main__':main() diff --git a/research/ram-route-comparison/native/NATIVE-TRANSFER.md b/research/ram-route-comparison/native/NATIVE-TRANSFER.md new file mode 100644 index 0000000000..309eb9edc7 --- /dev/null +++ b/research/ram-route-comparison/native/NATIVE-TRANSFER.md @@ -0,0 +1,93 @@ +# Conditional native Word RAM κ = 0.0030217758 + +The source-bound sufficient assembly in this package transfers the current PR #4610 saving to Word RAM **without a TM simulator or multiplier**. It improves the previously published native Word RAM value in PR #4635 from 0.0030217754 to 0.0030217758, an exact gain of 1/2,500,000,000. It does not improve PR #4610's global headline, change its paid profile, or claim a new raw root. This is a native transfer tightening, not a new supplier mechanism. + +Prepared for Dugongue with substantial OpenAI Codex assistance. Apache-2.0; retained source notices apply. + +## Exact sufficient conclusion and inherited mathematics + +Assume the retained actual all-fiber native word and whole-job monomial normalizers, chronological finite compiler, owned storage/erasure contract, capped Gaussian and Toeplitz circuits, fine-padding Gaussian/Poisson reduction, conditioning/precision bounds, and exact integer recovery proofs enumerated in PR #4630 and PR #4635. Under these explicit source-bound mathematical premises, packed n-bit integer multiplication is computable in + + O(n / (log n)^0.0030217758) + +unit-cost Word RAM operations with word width C log n for a sufficiently large fixed C and bounded-word multiplication/division. Every coefficient occupies O(1) such words; arbitrary-precision arithmetic is not unit cost. All recurring address, gathering, restoration and group-table operations remain paid. The Python Fraction checker is a proof verifier, not an implementation of that tariff. + +No finite arithmetic replay establishes the inherited all-fiber algebra, numerical conditioning, uniform compiler or analytic recovery proofs. No fresh Lean, physical phase replay, usable cutoff, practical speedup, unconditional theorem or independent human acceptance is claimed here. + +## Fresh native provider funding + +Freeze PR #4610 at `20bb93cd990d2ff683e4d0fc56b87a42cd5d3296`. Its latest arithmetic gives + + q_C = 1057621533 / 350000000000, + H = 38569300000000000, + N = 2^H. + +These are not inferred from the TM multiplication headline. `provider_rebind.py` freshly reconstructs the full paid and target inventories from the literal round-three word and retained p16 controller, checks equality with the latest source inventory, and reruns Dillon's retained exact critical-root/mirror/majorant engine. The canonical native payload remains SHA-256 `cfcd36b40326d7a5815e1db5313444379b3fb756b27d5201c561574c085cc0dd`. There are 64,404 paid jobs, 10,928 productive fields and rank-mass surplus 752. All 18 LOCAL calls, 15 QUERY_SHEAR calls, 15 IDLE calls, diagonal targets and source-helper copies are counted. + +The fresh rational engine isolates the critical exponent θ in + + 0.99697822412 < θ < 0.99697822414. + +The funded retained majorant is + + L(x) ≤ A x^θ (133 + log x)^(2/5), + A = n0^(1−θ)/(133 + log n0)^(2/5), + n0 = 145 · 1024^650. + +The exact source capacity is greater than 0.982097, mirror ratio below 0.562811, and majorant funding lower bound 0.048546 exceeds required upper bound 0.04282. The majorant's retained theorem concerns the actual chronological construction; a histogram alone would be insufficient. + +We have log A < 0.003022 · (8 + 6500) < 20. Since 133 + H < 2^56 and log N < H, + + (2/5) log(133 + log N) < 112/5. + +The exact rational lower bound for finite absorption is + + (1 − 0.99697822414 − q_C) H · (2/3) − 212/5 + = 6611668/5 > 0. + +Here log 2 > 2/3. Thus L(N) < N^(1−q_C), establishing precisely the native provider inequality required by PR #4635's arbitrary-provider theorem. The fixed rank and instruction inventory are effectively specified, not materialized; they are constants independent of n. Their astronomical initialization is a fixed constant rather than input-dependent advice. + +## All nine native rows and strict margins + +Set κ = 15108879/5000000000, c = 3/32, and use the retained universal formulas + + q = (κ + q_C)/2, + stop = (q_C − q)/(2q_C), + δ = min(1/100, (q−κ)/(4(q+1)), (c−q)/16), + ε = 1−δ, β = 1−3δ, + r = δ/10, ℓ = δ/100, + ξ = ε(1+q) − c + ℓ. + +The exact instantiated values are q = 2115243063/700000000000, stop = 1/1410162044, and δ = 3/2808460972252. The complete rational parameter and guard table is in RESULT.json. Let p = Θ(log n), T p = Θ(n), dimension d = Θ(p^ε), group height g = Θ(p^β) and cap B = Θ(p^ξ). The actual native row tariffs are O(T p^(1−s) polylog p): + +| Native row | Saving s | +|---|---| +| Main simultaneous transform | εq | +| Standalone complete-address routing | 1 | +| Fused Gaussian circuits | 1−ε+qβ | +| Additional standalone address passes | 1 | +| Group scans and lookups | 1−ε+β | +| Boundary factors, both couplings and periodic closure | c+ξ−ε | +| Indexed sparse-axis visits | 1/2+ξ−ε | +| Global-precision polynomial record products | ε | +| Core-face recovery | 79−ε−β | + +Every saving is strictly greater than κ. The minimum excess, attained by the main row, is + + 8419037187567 / 1965922680576400000000000 > 0. + +The positive stopped-provider margin is 3/1400000000000. All cap, gamma, membership, full-coordinate group-key and chirp guards are positive. In particular the complete key exponent is β+1−ε = 1−2δ < 1; the actual lookup preparation is n^o(1), not an oracle. The group-chirp guard is 1−(β+2ξ−2+r)>0. The conservative boundary certificate is the exact integer inequality 7^16 < 2^45. The fixed strict margins absorb each polylog p factor and finish the sufficient native assembly. + +These formulas and the 3/32 native caller range are credited to PR #4635; no priority is claimed for them. The fresh contribution is their exact source-bound instantiation at the latest full funded conditional provider saving, with a freshly rerun native majorant and unchanged complete tariff. + +## Verification and controls + +Run `python3 -I -O -B verify.py`. The checker uses only the standard library and explicit exceptions. It verifies source hashes, reconstructs the literal full invoice, freshly funds the critical root and majorant, and checks every native rational guard. Five additional controls reject the closed provider endpoint, an above-provider target, the closed 3/32 caller endpoint, an unfunded provider saving, and a wrong latest paid profile. The inherited critical engine also rejects an unfunded mirror and wrong root. No solver is trusted. The optimized-parent replay passes. + +## Credit, overlap and remaining work + +The latest native profile is Cao Yifan's PR #4610, preserving Cinna Davis's PR #4470 joint-helper and controller lineage. This transfer reuses Dugongue's PR #4630 and #4635 native constructions, Dillon's critical-root engine, zxv's compiler/majorants, Jacob Alan Sussman's chronological integer matching, Ryanson Jonathan's mirror analysis, Vlado Vojdanovski's tensor/phase circuits, Chafik Boukhalfa's fine-padding reduction, Tim Trudgian's prime bounds, Harvey and van der Hoeven's Gaussian/Poisson and integer-recovery foundations, and all retained source owners. + +PR #4641 already independently identifies the profile-only source of the earlier native gain; we agree. PR #4703 supplies complementary B/C providers but no profitable complete controller. PR #4694 and #4698 expose coupled centers and a homogeneous two-call consumer; their real chart embedding is unresolved and is not used here. PR #4658 and #4659 bound retained path-family searches; none is claimed as a universal Word RAM barrier. PR #4707 tightens the older selected raw root and is below this source profile. Canonical main was observed unchanged at b58ad9ef4d4e861b0eaa5dba41742bdc072dca51. This is not a maintainer-selected-frontier update. + +Open next questions are a new fully admitted scalar/helper word changing the raw moment, an affordable actual coupled-center embedding, and independent review of the inherited all-fiber/compiler/analytic interfaces. The current result does not turn any of those missing proofs into assumed research success. diff --git a/research/ram-route-comparison/native/RESULT.json b/research/ram-route-comparison/native/RESULT.json new file mode 100644 index 0000000000..e09e698343 --- /dev/null +++ b/research/ram-route-comparison/native/RESULT.json @@ -0,0 +1,242 @@ +{ + "status": "PASS_LATEST_NATIVE_TRANSFER_ARITHMETIC", + "word_ram_kappa": "15108879/5000000000", + "previous_native_kappa": "15108877/5000000000", + "native_gain": "1/2500000000", + "complete_paid_profile_changed": false, + "new_global_kappa_claimed": false, + "new_operator_replay_claimed": false, + "provider": { + "status": "PASS_SOURCE_BOUND_CRITICAL_PROVIDER", + "source_pr": 4610, + "source_head": "20bb93cd990d2ff683e4d0fc56b87a42cd5d3296", + "critical_root": { + "critical_root_interval": [ + "24924455603/25000000000", + "49848911207/50000000000" + ], + "endpoint_target_minus_paid": [ + [ + "-3/1000000", + "-1/500000" + ], + [ + "1/500000", + "3/1000000" + ] + ], + "uniform_mean_gap_lower": "1041727/1000000", + "derivative_floor": "1", + "beta": "141/250", + "source_capacity_lower": "982097/1000000", + "mirror_upper": "562811/1000000", + "maximizing_cell": [ + "1/48", + "1/41" + ], + "funded_mirror_cells": [ + { + "left": "1/72", + "right": "1/65", + "upper_ratio": "282619/1000000" + }, + { + "left": "1/65", + "right": "1/64", + "upper_ratio": "37509/250000" + }, + { + "left": "1/64", + "right": "1/57", + "upper_ratio": "47799/100000" + }, + { + "left": "1/57", + "right": "1/56", + "upper_ratio": "7583/25000" + }, + { + "left": "1/56", + "right": "1/49", + "upper_ratio": "108593/200000" + }, + { + "left": "1/49", + "right": "1/48", + "upper_ratio": "187981/500000" + }, + { + "left": "1/48", + "right": "1/41", + "upper_ratio": "562811/1000000" + }, + { + "left": "1/41", + "right": "1/40", + "upper_ratio": "412273/1000000" + }, + { + "left": "1/40", + "right": "1/33", + "upper_ratio": "560789/1000000" + }, + { + "left": "1/33", + "right": "1/32", + "upper_ratio": "269/625" + }, + { + "left": "1/32", + "right": "1/25", + "upper_ratio": "546937/1000000" + }, + { + "left": "1/25", + "right": "1/24", + "upper_ratio": "17623/40000" + }, + { + "left": "1/24", + "right": "1/17", + "upper_ratio": "527791/1000000" + }, + { + "left": "1/17", + "right": "1/16", + "upper_ratio": "225137/500000" + }, + { + "left": "1/16", + "right": "1/9", + "upper_ratio": "127249/250000" + }, + { + "left": "1/9", + "right": "1/8", + "upper_ratio": "60647/1000000" + }, + { + "left": "1/8", + "right": "1/7", + "upper_ratio": "9019/500000" + }, + { + "left": "1/7", + "right": "1/5", + "upper_ratio": "3127/250000" + }, + { + "left": "1/5", + "right": "1/4", + "upper_ratio": "13321/1000000" + } + ], + "conclusion": "Unique crossing on this bracket; critical-root hypotheses hold.", + "scope": "Rank-inventory admission criterion; native and outer obligations inherited." + }, + "critical_majorant": { + "parameters": { + "a": 1, + "b": 1, + "height_base": 1024, + "ell0": 650, + "s": "1/20", + "lambda": "1/10", + "p": "2/5", + "c": "133", + "guards": { + "U": ".963", + "V": ".992", + "Q": "1.001", + "d": "1.03", + "beta": ".564" + }, + "upper_exponent": ".997067" + }, + "uniform_interval": [ + "24924455603/25000000000", + "997067/1000000" + ], + "uniform_mean_gap_lower": "520743/500000", + "forward_ordering_margin_lower": "58203/1000000", + "mixed_tail_upper": "481197/500000", + "root_tail_upper": "991631/1000000", + "moment_ratio_upper": "250079/250000", + "mirror_upper": "563151/1000000", + "source_capacity_lower": "982097/1000000", + "tangent_exponent_upper": "199413/200000", + "funding_lower": "24273/500000", + "required_funding_upper": "2141/50000", + "ordinary_base_cutoff": "145*1024^650", + "normalization": "A=n0^(1-theta)/(c+log(n0))^p, where theta is the isolated root", + "conclusion": "L(n)<=A*n^theta*(c+log(n))^p for every integer n>=1, under the stated contracts.", + "scope": "Critical-exponent leaf-count majorant; no new outer endpoint or physical admission." + }, + "uniform_saving": "1057621533/350000000000", + "fixed_rank_encoding": "2^38569300000000000", + "fixed_rank_materialized": false, + "finite_absorption_log_margin": "6611668/5", + "negative_controls": { + "unfunded_mirror": true, + "wrong_root": true + }, + "scope": "Exact profile arithmetic and funded critical majorant; actual all-fiber algebraic supplier and whole-job normalizers are explicitly inherited proofs, not finite tests." + }, + "native_parameters": { + "provider": "1057621533/350000000000", + "target": "15108879/5000000000", + "q": "2115243063/700000000000", + "stop": "1/1410162044", + "delta": "3/2808460972252", + "epsilon": "2808460972249/2808460972252", + "beta": "2808460972243/2808460972252", + "spare": "3/28084609722520", + "layout": "3/280846097225200", + "xi": "1787558006859539432758687/1965922680576400000000000", + "savings": { + "main": "5940577589255932758687/1965922680576400000000000", + "standalone_routing": "1", + "fused_gaussian": "5940577591343241300309/1965922680576400000000000", + "standalone_addressing": "1", + "group_scans": "1404230486123/1404230486126", + "boundary": "5940577589276932758687/1965922680576400000000000", + "sparse_visits": "804596666573439432758687/1965922680576400000000000", + "record_products": "2808460972249/2808460972252", + "core_face_recovery": "54062873715854/702115243063" + }, + "guards": { + "stopped_provider": "3/1400000000000", + "stop_positive": "1/1410162044", + "stop_below_one": "1410162043/1410162044", + "epsilon_below_one": "3/2808460972252", + "beta_positive": "2808460972243/2808460972252", + "beta_below_epsilon": "3/1404230486126", + "cap_above_band": "804596666571339432758687/1965922680576400000000000", + "cap_below_dimension": "178364673714760567241313/1965922680576400000000000", + "global_gamma": "27/28084609722520", + "group_chirp": "178364673719905567241313/982961340288200000000000", + "group_key": "3/1404230486126", + "membership": "3/2808460972252", + "spare_positive": "3/28084609722520", + "strassen_integer_certificate": "1951441519231", + "main_excess": "8419037187567/1965922680576400000000000", + "standalone_routing_excess": "4984891121/5000000000", + "fused_gaussian_excess": "10506345729189/1965922680576400000000000", + "standalone_addressing_excess": "4984891121/5000000000", + "group_scans_excess": "3499968041056005543623/3510576215315000000000", + "boundary_excess": "8440037187567/1965922680576400000000000", + "sparse_visits_excess": "798656088992602537187567/1965922680576400000000000", + "record_products_excess": "3499968041059755543623/3510576215315000000000", + "core_face_recovery_excess": "270303760405018505543623/3510576215315000000000" + }, + "minimum_excess": "8419037187567/1965922680576400000000000" + }, + "negative_controls": { + "closed_provider_endpoint": true, + "above_provider": true, + "closed_native_boundary": true, + "unfunded_native_provider": true, + "wrong_complete_paid_profile": true + }, + "scope": "Fresh exact arithmetic and source-bound sufficient transfer; inherited all-fiber algebra, native execution, whole-job, compiler, precision, analytic and recovery premises remain explicit." +} diff --git a/research/ram-route-comparison/verify.py b/research/ram-route-comparison/verify.py new file mode 100644 index 0000000000..9bbaa339c6 --- /dev/null +++ b/research/ram-route-comparison/verify.py @@ -0,0 +1,34 @@ +"""Fair route comparison checks; Apache-2.0. Dugongue with OpenAI Codex assistance.""" +from pathlib import Path +from hashlib import sha256 +import json,subprocess,sys,tempfile,shutil +R=Path(__file__).resolve().parent + +def need(ok,why): + if not ok:raise ValueError(why) + +def authenticate(root): + m=json.loads((root/'MANIFEST.json').read_bytes()) + names={str(f.relative_to(root)).replace(chr(92),'/') for f in root.rglob('*') if f.is_file() and '__pycache__' not in f.parts and f!=root/'MANIFEST.json'} + need(names==set(m),'Unexpected or missing file') + for n,h in m.items():need(sha256((root/n).read_bytes()).hexdigest()==h,'Source drift: '+n) + return len(m) + +def check(): + count=authenticate(R) + if '--hash-only' in sys.argv:return {'status':'PASS_COMPARISON_HASHES','files':count} + sources=json.loads((R/'SCIENTIFIC-SOURCES.json').read_bytes()) + for n,h in sources['native']['files'].items():need(sha256((R/'native'/n).read_bytes()).hexdigest()==h,'Native source drift') + native=json.loads((R/'native/RESULT.json').read_bytes()) + need(native['word_ram_kappa']=='15108879/5000000000','Native comparison exponent changed') + with tempfile.TemporaryDirectory(prefix='ram-compare-') as td: + temp=Path(td);outputs={} + for i,s in enumerate(['baseline/check_comparison.py','check_packed_simulation.py']): + r=subprocess.run([sys.executable,'-I','-B','-X','pycache_prefix='+str(temp/str(i)),str(R/s)],cwd=R,capture_output=True,text=True,encoding='utf-8',timeout=90) + need(r.returncode==0,s+': '+r.stderr);outputs[s]=json.loads(r.stdout) + need(outputs['baseline/check_comparison.py']['strict_computational_superiority_established'] is False,'Scope changed') + copy=temp/'controls';shutil.copytree(R,copy,ignore=shutil.ignore_patterns('__pycache__','*.pyc')) + def guard():return subprocess.run([sys.executable,'-I','-O','-B','-X','pycache_prefix='+str(temp/'guard'),str(copy/'verify.py'),'--hash-only'],capture_output=True,timeout=20).returncode + need(guard()==0,'Clean baseline rejected');f=copy/'baseline/PROOF.md';b=f.read_bytes();f.write_bytes(b+bytes([10]));need(guard()!=0,'Changed source accepted');f.write_bytes(b);need(guard()==0,'Restored baseline rejected') + return {'status':'PASS_FAIR_RAM_ROUTE_COMPARISON','new_kappa_claimed':False,'strict_native_superiority_claimed':False,'source_corruption_control':'REJECTED_AFTER_CLEAN_BASELINE_ACCEPTED','components':outputs,'scope':'Exact finite source/parameter/window controls and supplied informal constructive proofs. No full multiplier, practical benchmark, new Lean audit or new exponent.'} +if __name__=='__main__':print(json.dumps(check(),indent=2))