diff --git a/.github/workflows/complex-read-exchange.yml b/.github/workflows/complex-read-exchange.yml new file mode 100644 index 0000000000..96b2289da6 --- /dev/null +++ b/.github/workflows/complex-read-exchange.yml @@ -0,0 +1,27 @@ +name: Coupled partial read-exchange checks +on: + pull_request: + paths: + - 'research/complex-read-exchange/**' + - '.github/workflows/complex-read-exchange.yml' + workflow_dispatch: +permissions: + contents: read +jobs: + exact-replay: + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + matrix: + python: ['3.11', '3.14'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 + with: + python-version: '${{ matrix.python }}' + - name: Re-enumerate both domains and independently check every refusal + run: python -B -I -O research/complex-read-exchange/verify.py + - name: Confirm verification leaves tracked files unchanged + run: git diff --exit-code diff --git a/research/complex-read-exchange/CLAIM.md b/research/complex-read-exchange/CLAIM.md new file mode 100644 index 0000000000..7c91736928 --- /dev/null +++ b/research/complex-read-exchange/CLAIM.md @@ -0,0 +1,82 @@ +# Complex-supplier research claim: coupled read exchanges + +Prepared for Jason Willems (@at1as) with substantial OpenAI Codex assistance. + +- Base: `66849e1475c930fd7732b1a0067ffee7e1e95f60`. +- Separate branch: `research/complex-kappa-seed21`; completed PR #666 is unchanged. +- Track: complex-supplier improvement, deliberately selected following the user's + request to try improving kappa. Diversification seed **21** was drawn once from + 20..39 using operating-system randomness, not from the gist's unrestricted + 0..99 track lottery. This choice is recorded explicitly. +- Claim recorded: 2026-10-13 04:58 UTC (2026-10-12 America/Los_Angeles). +- Initial bounded session: aim to finish by 06:15 UTC, reserving at least the final + quarter for validation and handoff; do not assume an improvement exists. +- Object: two simultaneous partial entering-copy read-set exchanges on the + promoted P6k4 input to PR #699, retaining its fixed helper boundaries and + owner map. Compare with its four-exchange output, not merely with old #626. +- Dependency: #699 at `03e8d7ca494a083e5053cd6b1228f66b98414479`, plus its + pinned #635 source. The main selected result remains #626/#543. #699 and + #589 are pending/conditional dependencies, not newly accepted frontiers. +- Hypothesis: moves individually rejected by target-frame containment might + become legal together because one shrinks a frame needed by the other. + A complete paid-profile reduction at unchanged widths can improve the complex + moment while preserving the owner assignment and unchanged #589 bit headroom. +- Method: enumerate entering-copy candidates from the literal word, test + simultaneous choices with exact binary frame arithmetic, and check arbitrary + input scalar equality for legal candidates. Price the full paid profile, + including sources, targets, centers, tails, helper ends and idle owners. +- Deliverable: a verified improving construction if found; otherwise a precisely + bounded completed search and reproducible evidence, with no impossibility claim + outside its enumerated class. No unsupported new kappa claim. + +## Candidate selection and overlap + +Three narrow candidates: (0) coupled partial entering-copy exchanges; +(1) mixed-beta nine-term decoders on P112; (2) joint A/cleanup regrouping. +Seed 21 modulo 3 selects candidate 0, after checking that its scope is open. +Candidate 1 has larger potential but requires a new decoder/factory interface; +candidate 2 is less sharply bounded and borders earlier failed regrouping searches. + +Read CONTRIBUTING.md, the selected certificate, current status, PR ledger, +#626 construction/review, and retained negative-search summaries. Refreshed **551 +open PRs through #732**. No pinned coordination issue exists, so this claim is local. +#699's `construction/sw4/NOTES.md` explicitly reports 602 single-pair candidates +and says cross-pair partial combinations were not enumerated. #698 fixes the +scalar word and gate order, #687 moves one read in one raw K-triangle, and #651 +fixes role and delivery rules; these do not close the present simultaneous class. +Owner packing, existing entrance promotions and single-pair exchanges are not +claimed as new work. Scalar primitive reductions alone do not improve kappa. + +Search domain, stopping rule, source hashes, completed coverage and any pivot +will be recorded with the experiment. Delegated work is limited to reproducing +this pinned baseline and reviewing this specific rewrite and its complete cost. + +## Evidence-driven follow-up + +The complete two-pair domain contained 175,456 joint choices across all 1,431 +pairs, requiring both selected masks to be nonempty and at least one partial. +All were rejected by target caps. A preceding shared-direct-target subdomain +covered 5,840 of those choices. The direct-target overlap graph on the 54 eligible +pairs has 16 connected components of size three and six isolated vertices. +One bounded follow-up therefore tests all simultaneous nonempty choices in +those 16 three-pair components, still requiring at least one partial and keeping +known SW4 moves on untouched pairs. This tests a possible three-way repair +without reopening arbitrary gate permutations or unrestricted multi-pair search. + +## Completed result and handoff + +Completed this claim in [PR #775](https://github.com/CrocSwap/integer-mult-bounds/pull/775). +The two-pair domain rejected all 175,456 parameterized cases; the bounded +three-pair follow-up rejected all 27,344 cases in the 16 connected triples. +These are case counts, not counts of distinct completed rewrites. Both independent +engines agreed on every first-refusal digest and the finite coverage. The public +optimized Python 3.13 replay passed, including the exact 728-column SW4 scalar +control and all 13 focused tests; Python 3.11 checks also passed. + +No legal improving candidate was found and no kappa improvement is claimed. +The exclusion applies only to the pinned word and the documented eligibility, +insertion, boundary and frame-floor rules. The direct-target graph does not prove +circuit independence, and arbitrary triples and larger combinations remain open. +The final overlap refresh covered 586 open PRs through #767; #741's frame-growth +construction is credited as a separate approach. This bounded experiment is +complete. Further search classes belong in a separate research claim. diff --git a/research/complex-read-exchange/EXPECTED.json b/research/complex-read-exchange/EXPECTED.json new file mode 100644 index 0000000000..2b85ce0f20 --- /dev/null +++ b/research/complex-read-exchange/EXPECTED.json @@ -0,0 +1,38 @@ +{ + "input_sha256": "0390ec65dc4d47df1887aabdc2ec5b6ddea3cfc8e65582873fdfeba81d100073", + "comparison_sha256": "d232183f233899961bf55cac67a18545ed33548d9a7ca7078990d1a83d557c59", + "domains": { + "two_pairs": { + "arity": 2, + "domain": "all", + "eligible_pairs": 54, + "groups": 1431, + "counts": { + "single_total": 602, + "single_cap": 564, + "single_legal": 38, + "coupled_total": 175456, + "coupled_cap": 175456 + }, + "failure_site_sha256": "fe76c61059ebeb274e91233cf1cc250ebb8d2b6d97fd98c0bf43e92edeaef916", + "failure_witness_sha256": "44f7dc3e0d6d1f498aaaefab7600e9096f5a067cf2baeed4cc1113da5c937e66", + "exact_baseline_columns": 728 + }, + "connected_triples": { + "arity": 3, + "domain": "shared-targets", + "eligible_pairs": 54, + "groups": 16, + "counts": { + "single_total": 602, + "single_cap": 564, + "single_legal": 38, + "coupled_total": 27344, + "coupled_cap": 27344 + }, + "failure_site_sha256": "c238beff39b56afd1a1cbcfd5bd0e5f23ec335bdb248c3ff85d02de2da83446d", + "failure_witness_sha256": "d7d1b65c87927cd8fc20bb950804cc53fad13af0c00c15c52fdfbf85f1ae2444", + "exact_baseline_columns": 728 + } + } +} diff --git a/research/complex-read-exchange/NOTICE.md b/research/complex-read-exchange/NOTICE.md new file mode 100644 index 0000000000..5ac966fb17 --- /dev/null +++ b/research/complex-read-exchange/NOTICE.md @@ -0,0 +1,44 @@ +# Attribution and scope + +Prepared for Jason Willems (@at1as), with substantial OpenAI Codex assistance in +selecting this experiment, writing its search and independent checker, rebuilding +pinned inputs, executing checks, and reviewing scope. Separate Codex agents +reviewed the construction and implementation. No independent human review or +literature-priority claim is made. + +Jeremy Kothe (@jeremykothe2), PR #699 at +`03e8d7ca494a083e5053cd6b1228f66b98414479`, provides the P6k4 supplier, SW4 +read-exchange mechanism, deterministic recipe and admitted comparison profile. +Its `construction/sw4/NOTES.md` explicitly leaves cross-pair partial combinations +open. BRoute is the construction attribution used in that source package; we do +not infer a separate human identity from it. Our scripts implement a new joint +search and an independent checker; the rewrite semantics and frame-floor policy +are inherited, not claimed as new. + +The supplier retains icekylinx's gauge44 factory, Jeremy Kothe's no-triangle, +layered, cold-end and entrance-promotion work, Chafik Boukhalfa's #685 owner map, +eumemic's #589 bit supplier, and the DreamingOfClouds, Rohan Arun, Dominik Scholz, +Jeremy Diviney, jaymosley07 and other upstream contributions credited in the +retained notices. #635 at `a6895a69f8ad98ab45777b03e9e6f48888c39f6f` is the +pinned construction-code dependency used during reconstruction. No new supplier +or kappa improvement is claimed here. + +The input word is a freshly reconstructed artifact with its decompressed content +matched to #699's pin. SW4-RECIPE.json is copied unchanged from its committed +recipe. `inputs/PR699-NOTICE.md`, `inputs/UPSTREAM-NOTICE.md` and `inputs/LICENSE` +preserve its notices and license. SOURCE.json gives exact identities. + +Related #698's fixed-word frame bound, #687's single-triangle relocation result, +#651's delivery restrictions and #717's format limits informed scope selection; +none is imported as a proof of this result. PR #666 is our separate completed +analytic/certificate contribution and is not a dependency. + +New code and documentation: Apache-2.0, as in this repository. The underlying +all-size compilation, realization, hosting, precision/tape and analytic contracts +remain conditional. An independently implemented finite checker does not mean +independent human authorship or full theorem formalization. + +Chafik Boukhalfa's concurrent #741, pinned at +`e516b1463606840a15f80aac1995d64ce0092e89` during final overlap review, changes +eight frames after the full SW4 recipe and claims a stronger conditional bound. +It is credited as distinct progress, not used as a dependency or ruled out here. diff --git a/research/complex-read-exchange/OVERLAP.json b/research/complex-read-exchange/OVERLAP.json new file mode 100644 index 0000000000..d9bee1abd1 --- /dev/null +++ b/research/complex-read-exchange/OVERLAP.json @@ -0,0 +1,80 @@ +{ + "base": "66849e1475c930fd7732b1a0067ffee7e1e95f60", + "open_count": 551, + "highest_pr": 732, + "relevant": [ + { + "headRefOid": "67e9e846d9e8814b2dd01133251bb83fafa8f5b6", + "number": 717, + "title": "Format limits part 2 (no \u03ba claim): erratum to #595, exact invoice prices, frontier-word censuses, decoder floors, spec requirements, centre and fragmentation walls", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/717" + }, + { + "headRefOid": "03e8d7ca494a083e5053cd6b1228f66b98414479", + "number": 699, + "title": "Conditional \u03ba = 0.001660666354374641: four entrance promotions, six dim-8 ends and a width-neutral B read exchange on the PR659 word", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/699" + }, + { + "headRefOid": "ab78f797cffcbeddbb17a7eb069741085ffe3351", + "number": 698, + "title": "Scoped negative result: selected CK B frames are optimal at fixed boundaries", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/698" + }, + { + "headRefOid": "82bbb9c3ac34540f196410d137ebc59d9c2c43a9", + "number": 687, + "title": "Scoped negative result: certify one K-triangle relocation neighborhood", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/687" + }, + { + "headRefOid": "5fc2a0c4e10558f09f03a8e42559dcf8e381e57e", + "number": 685, + "title": "Conditional \u03ba = 0.001660339298410333: four entrance promotions and 72 cold ends", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/685" + }, + { + "headRefOid": "cbf30fdb56126d8cb7594f32e4d9a74ea7cd80a7", + "number": 683, + "title": "Scoped negative result: partial K/M face bypass requires four carriers", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/683" + }, + { + "headRefOid": "4982f0ca66ffe0960b5a6451deb5b66b1039326b", + "number": 659, + "title": "Conditional \u03ba = 0.001656193765416678: gauge44 without K-triangles (56 cold ends), with layered ends", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/659" + }, + { + "headRefOid": "df5b9c41fcea749242af886646dfebb9d86319a7", + "number": 651, + "title": "Research: the complex delivery layer is rigid \u2014 target hosting and raw-face sharing closed exactly", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/651" + }, + { + "headRefOid": "638a5171dd1aca89ff50d07dcbe288b567769804", + "number": 645, + "title": "Gauge44 factory and whole-family assignment for conditional \u03ba = 0.001649483702558979", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/645" + } + ], + "final_refresh": { + "open_count": 586, + "highest_pr": 767, + "relevant": [ + { + "number": 741, + "title": "Conditional \u03ba = 0.001661202643272239: eight B-frame coalescences after SW4", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/741", + "headRefOid": "e516b1463606840a15f80aac1995d64ce0092e89" + }, + { + "number": 699, + "title": "Conditional \u03ba = 0.001660666354374641: four entrance promotions, six dim-8 ends and a width-neutral B read exchange on the PR659 word", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/699", + "headRefOid": "f042731cb332359166e8215839f9a3da28c46c5b" + } + ], + "conclusion": "PR741 raises eight gate frames after the full SW4 exchanges; it does not enumerate the partial-exchange domains here. PR699 advanced by a README/MANIFEST-only commit; construction inputs remain at the pinned bytes." + } +} diff --git a/research/complex-read-exchange/README.md b/research/complex-read-exchange/README.md new file mode 100644 index 0000000000..17eb428b22 --- /dev/null +++ b/research/complex-read-exchange/README.md @@ -0,0 +1,145 @@ +# Coupled partial read exchanges: a finite negative result + +**Attempted complex-supplier improvement; no new kappa.** On the pinned +P6k4 word underlying Jeremy Kothe's [PR #699](https://github.com/CrocSwap/integer-mult-bounds/pull/699), +we enumerated **175,456 two-pair group/mask cases** and a further **27,344 +three-pair cases**. Every candidate violates a target hyperplane under the +specified frame-repair policy. Thus none reaches scalar or global admission. +This closes the stated finite search, not arbitrary multi-pair rewrites. + +The experiment starts from exact promoted-word content +`0390ec65dc4d47df1887aabdc2ec5b6ddea3cfc8e65582873fdfeba81d100073`. +It compares against the existing four-exchange SW4 word +`d232183f233899961bf55cac67a18545ed33548d9a7ca7078990d1a83d557c59`. +Both are freshly reconstructed from pinned sources. The main repository still +selects #626/#543; #699's stronger bound is a pending conditional contribution. + +## Why this could have improved kappa + +PR #699 exchanges reads between an entering helper h and a register r after +`h += r`, adjusting target pre-reads so that the dirty initial value of h is +compensated. It finds four favorable full single-pair exchanges. Its search note +explicitly leaves combinations of partial exchanges across different pairs open. +A change that is frame-illegal alone might be repaired by another change that +shrinks a relevant frame. We test that possibility directly. + +The fixed SW4 local paid profile is +`{1:2548, 2:342, 3:438, 4:186, 5:56, 8:8}`. Its helper residual width is +3778 and rank mass is 5634. With helper identities and start/end frames fixed, +the complete global profile is 72 times the local profile plus idle children +`{1:1, 3:1, 44:1, 48:2396}`. All source, target, center, tail and helper-end +climbs remain charged. This would permit reuse of the existing owner map; +scalar-operation savings alone would not improve the recursive bound. + +The unchanged #589 bit supplier leaves room above #699's complex rate. At the +reported complex endpoint `0.001663428754540205730067`, replacing the entire +SW4 recipe on bare P6k4 would need a local weighted-cost reduction exceeding +about `0.00698679`. Our search instead retains known exchanges on untouched +pairs and compares the jointly refitted profile directly with SW4. Floating +arithmetic is only a nomination aid; every candidate here fails an exact binary +frame check before any floating score is used. No new global moment is claimed. + +## Exact search class + +An eligible pair (h,r) satisfies the following rules in the original B section: + +1. h is an entering helper. Its first B write is `h += r` with coefficient 1, + where r is not a target. Earlier B uses of h are target pre-reads only. +2. Movable reads write a target from h or r, after that copy and before the next + write to either h or r. An h-to-r change requires a unique literal matching + opposite-coefficient pre-read of h; that pre-read is deleted. An r-to-h change + inserts its opposite-coefficient pre-read immediately after h's last existing + pre-read, or at the copy if no pre-read exists. +3. All indices refer to the original input word. Combined edits are applied + once, not sequentially refitted. Conflicting replacements or deletions are + rejected. Known SW4 moves on pairs outside the selected group stay fixed. +4. A moved or inserted gate takes the join of its current operand frames. Every + untouched B gate retains its original frame as a lower bound and also joins + its current operand frames. Early-tail frames retain their original lower + bounds. All helpers keep their original identities and start/end frames. +5. Every selected pair uses a nonempty subset of its movable reads, and at least + one selected pair is partial. All-full combinations are outside the new class. + +There are 54 eligible pairs: 38 have four movable reads, eight have two, and +eight have one. Their 602 nonempty single-pair choices recover the historical +38 legal / 564 cap-rejected split on this current input. Counts in #699's +historical P6k3/NP notes are not assumed; the checker regenerates them on P6k4. + +| Domain | Selected groups | Group/mask cases | Target-cap rejections | +|---|---:|---:|---:| +| All unordered pairs of eligible pairs | 1,431 | 175,456 | 175,456 | +| Connected triples in the direct-target overlap graph | 16 | 27,344 | 27,344 | + +For a group with move counts m_i, the number of choices is +`product_i (2^m_i - 1) - 1`: remove only the all-full choice. +These count parameterized cases, not distinct completed rewrites. Retaining +known full SW4 moves outside a selected group means different group/mask choices +can produce the same completed recipe, including across the two rows. Every +reported case is replayed; no uniqueness claim is made. An initial shared-direct- +target two-pair screen covered 5,840 cases already included in the first row and +is not included again in the 202,800-case total. + +The three-pair follow-up is deliberately narrower than all triples. Its graph +joins two pairs when their movable reads directly touch a common target. It has +16 components of size three and six isolated vertices. **These are not proved +independent circuit components:** downstream target-to-target gates can connect +pairs whose direct target sets are disjoint. The exhaustive two-pair result +includes all such pairs; the triple result covers only the stated 16 groups. + +## Reproduce offline + +Python 3.11+ and the standard library are sufficient. From the repository root: + +```sh +python3 -B -I research/complex-read-exchange/verify.py +``` + +The command reconstructs the known SW4 word, re-enumerates both new domains, +and independently replays every rejection. It checks deterministic evidence +against EXPECTED.json and runs mathematical failure controls. No optimizer, +network, or third-party package is used, and no repository file is rewritten. +Execution timings and tested Python versions are recorded in VALIDATION.md. + +The primary implementation uses reduced binary bases. The independent checker +uses explicit sets of all vectors in each subspace, independently discovers the +eligible pairs, and checks the exact group/mask traversal and first refusal of +every candidate. Failure-site hashes bind the ordered per-candidate evidence; +the independent witness hash also binds an explicit vector outside the target +hyperplane. These hashes summarize recomputed evidence, not replace it. + +As positive controls, both implementations reconstruct the known SW4 word byte +for byte. The independent engine checks its B-end scalar map with exact rational +arithmetic on all 728 input columns and recounts the full frame profile. These +controls distinguish rejection of the new class from blanket rejection. + +## Scope and provenance + +A frame F used by target t must lie in `u_t^perp` over F2. A vector x in F with +`x dot u_t = 1` is a concrete reason that a candidate is inadmissible. Both +implementations find such violations for every member of the stated domains. +This finite result depends on the pinned word, eligibility/insertion rules, +fixed untouched SW4 moves, and the inherited frame-floor policy. + +It does not exclude arbitrary triples or larger groups, alternative pre-read +positions, simultaneous full exchanges, changed scalar factories, relaxed frame +floors, moved boundaries, other helper roles, or a different decoder. No candidate +passed frames, so no new wrapper, phase, owner, invoice or outer-assembly admission +was attempted. The known baseline's source reconstruction and local audits are +recorded separately from the search. Finite checks are not a proof-assistant +formalization or a proof of the full multiplication theorem. + +Base: `66849e1475c930fd7732b1a0067ffee7e1e95f60`. SOURCE.json pins the +reconstructed input and inherited recipe; RECONSTRUCTION.json records the fresh +baseline replay. CLAIM.md records deliberate track selection, OS seed 21 and the +single evidence-driven follow-up. NOTICE.md and retained input notices credit +Jeremy Kothe, BRoute's read-exchange construction, the upstream supplier authors, +and substantial OpenAI Codex assistance. The selected frontier and upstream/ +are unchanged. This contribution is separate from completed PR #666. + +At handoff, the overlap refresh covered 586 open PRs through #767. Concurrent +[#741](https://github.com/CrocSwap/integer-mult-bounds/pull/741) improves the full +SW4 word by raising eight B-gate frames and coalescing paid jumps. That changes +frame annotations without a partial read exchange and is outside this search. +Its reported stronger bound is not ours. #699's head advanced to +`f042731cb332359166e8215839f9a3da28c46c5b` through a README/MANIFEST-only +change; the construction and input bytes used here are unchanged. diff --git a/research/complex-read-exchange/RECONSTRUCTION.json b/research/complex-read-exchange/RECONSTRUCTION.json new file mode 100644 index 0000000000..f5d262331f --- /dev/null +++ b/research/complex-read-exchange/RECONSTRUCTION.json @@ -0,0 +1,338 @@ +{ + "status": "PASS_BASELINE_RECONSTRUCTION_AND_NATIVE_AUDITS", + "python": "3.11.13 (main, Jun 3 2025, 18:38:25) [Clang 16.0.0 (clang-1600.0.26.6)]", + "main_base": "66849e1475c930fd7732b1a0067ffee7e1e95f60", + "dependencies": { + "pr699": { + "head": "03e8d7ca494a083e5053cd6b1228f66b98414479", + "root": "deps/pr699", + "package_manifest_files": 122 + }, + "pr635": { + "head": "a6895a69f8ad98ab45777b03e9e6f48888c39f6f", + "root": "deps/pr635" + } + }, + "words": { + "gauge44": { + "path": "baseline/notri-base/cold44/FULL-WORD.json.gz", + "content_sha256": "78c7aadacb6eec2eeecc124ca236e5bcfdba6a52b30c2971aaa596d1d119b290", + "profile": { + "1": 2514, + "2": 404, + "3": 448, + "4": 160, + "5": 56, + "8": 8 + }, + "local_rank_mass": 5650, + "width_inventory": { + "4": 52, + "5": 48, + "7": 34, + "8": 114, + "9": 244 + }, + "residual_width": 3794 + }, + "no_triangle": { + "path": "baseline/notri-word/cold44/FULL-WORD.json.gz", + "content_sha256": "3e99ba778ab8a97853f50912776247802b529439937176363f6c42786163b1f9", + "profile": { + "1": 2506, + "2": 336, + "3": 472, + "4": 184, + "5": 56, + "8": 8 + }, + "local_rank_mass": 5674, + "width_inventory": { + "4": 64, + "5": 48, + "7": 46, + "8": 114, + "9": 232 + }, + "residual_width": 3818 + }, + "layered_np": { + "path": "baseline/notri-np/layers/FULL-WORD.json.gz", + "content_sha256": "a9de804f194eeb39f52a4c6e54c14d93e881bec4b632694249733ed410b58113", + "profile": { + "1": 2534, + "2": 346, + "3": 458, + "4": 178, + "5": 56, + "8": 8 + }, + "local_rank_mass": 5656, + "width_inventory": { + "4": 64, + "5": 48, + "7": 54, + "8": 116, + "9": 222 + }, + "residual_width": 3800 + }, + "p6n": { + "path": "baseline/p6n/p6n/FULL-WORD.json.gz", + "content_sha256": "34b683fa08f054fe725704ec15b1c8da42f846430999d14d0cae0fcd42296fe2", + "profile": { + "1": 2540, + "2": 358, + "3": 446, + "4": 178, + "5": 56, + "8": 8 + }, + "local_rank_mass": 5650, + "width_inventory": { + "4": 64, + "5": 48, + "7": 54, + "8": 122, + "9": 216 + }, + "residual_width": 3794 + }, + "p6k4": { + "path": "baseline/promo/promo/FULL-WORD.json.gz", + "content_sha256": "0390ec65dc4d47df1887aabdc2ec5b6ddea3cfc8e65582873fdfeba81d100073", + "profile": { + "1": 2572, + "2": 326, + "3": 430, + "4": 194, + "5": 56, + "8": 8 + }, + "local_rank_mass": 5634, + "width_inventory": { + "4": 80, + "5": 32, + "7": 54, + "8": 122, + "9": 216 + }, + "residual_width": 3778 + }, + "sw4": { + "path": "baseline/sw4/sw4/FULL-WORD.json.gz", + "content_sha256": "d232183f233899961bf55cac67a18545ed33548d9a7ca7078990d1a83d557c59", + "profile": { + "1": 2548, + "2": 342, + "3": 438, + "4": 186, + "5": 56, + "8": 8 + }, + "local_rank_mass": 5634, + "width_inventory": { + "4": 80, + "5": 32, + "7": 54, + "8": 122, + "9": 216 + }, + "residual_width": 3778 + } + }, + "steps": { + "notri-base": [ + { + "step": "shadow-early", + "exit_code": 0, + "seconds": 0.249 + }, + { + "step": "shadow-prefix", + "exit_code": 0, + "seconds": 0.38 + }, + { + "step": "gauge-forward", + "exit_code": 0, + "seconds": 0.407 + }, + { + "step": "port0", + "exit_code": 0, + "seconds": 0.333 + }, + { + "step": "port1", + "exit_code": 0, + "seconds": 0.398 + }, + { + "step": "port2", + "exit_code": 0, + "seconds": 0.341 + }, + { + "step": "port3", + "exit_code": 0, + "seconds": 0.35 + }, + { + "step": "cold44-exact", + "exit_code": 0, + "seconds": 2.502 + } + ], + "notri-word": [ + { + "step": "gauge-forward", + "exit_code": 0, + "seconds": 0.412 + }, + { + "step": "port0", + "exit_code": 0, + "seconds": 0.336 + }, + { + "step": "port1", + "exit_code": 0, + "seconds": 0.355 + }, + { + "step": "port2", + "exit_code": 0, + "seconds": 0.357 + }, + { + "step": "port3", + "exit_code": 0, + "seconds": 0.345 + }, + { + "step": "cold44", + "exit_code": 0, + "seconds": 1.764 + } + ], + "notri-np": [ + { + "step": "pivot-swap", + "exit_code": 0, + "seconds": 10.889 + }, + { + "step": "cold44-exact", + "exit_code": 0, + "seconds": 1.785 + }, + { + "step": "layer-end-controls", + "exit_code": 0, + "seconds": 61.699 + }, + { + "step": "native", + "exit_code": 0, + "seconds": 1.544 + }, + { + "step": "ledgers", + "exit_code": 0, + "seconds": 1.008 + }, + { + "step": "local-replay", + "exit_code": 0, + "seconds": 7.391 + }, + { + "step": "wrappers", + "exit_code": 0, + "seconds": 2.257 + } + ], + "p6n": [ + { + "step": "layer-end-controls", + "exit_code": 0, + "seconds": 104.914 + } + ], + "promo": [ + { + "step": "promotion", + "exit_code": 0, + "seconds": 0.255 + }, + { + "step": "promo-controls", + "exit_code": 0, + "seconds": 8.532 + }, + { + "step": "layer-end-controls", + "exit_code": 0, + "seconds": 113.231 + }, + { + "step": "native", + "exit_code": 0, + "seconds": 1.835 + }, + { + "step": "ledgers", + "exit_code": 0, + "seconds": 1.063 + }, + { + "step": "local-replay", + "exit_code": 0, + "seconds": 10.359 + }, + { + "step": "wrappers", + "exit_code": 0, + "seconds": 2.668 + } + ], + "sw4": [ + { + "step": "sw4", + "exit_code": 0, + "seconds": 0.626 + }, + { + "step": "layer-end-controls", + "exit_code": 0, + "seconds": 106.382 + }, + { + "step": "native", + "exit_code": 0, + "seconds": 1.651 + }, + { + "step": "ledgers", + "exit_code": 0, + "seconds": 1.024 + }, + { + "step": "local-replay", + "exit_code": 0, + "seconds": 7.367 + }, + { + "step": "wrappers", + "exit_code": 0, + "seconds": 2.268 + } + ] + }, + "independent_audit_path": "baseline/sw4-independent-audit.json", + "independent_checked_columns": 728, + "scope": "Pinned construction through P6k4 and SW4; native transport, ledgers, forward/dual replay, wrappers, inherited mutation controls, and independent exact scalar/frame audit. Clifford phase generation, global owner admission/exponent repricing, and the full repository suite were not run.", + "receipt_source_sha256": "0a80f22bb7f0e4d5af090750d86c4c277da9f77baaef8198f6dcdb95bd0c3bb8", + "portability_note": "Local execution receipt summarized with work-root-relative paths; all mathematical pins and steps preserved." +} diff --git a/research/complex-read-exchange/SOURCE.json b/research/complex-read-exchange/SOURCE.json new file mode 100644 index 0000000000..c44ad35a87 --- /dev/null +++ b/research/complex-read-exchange/SOURCE.json @@ -0,0 +1,34 @@ +{ + "base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60", + "pr699": { + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/699", + "head": "03e8d7ca494a083e5053cd6b1228f66b98414479", + "package": "research/gauge44-promo-p6k4sw", + "promoted_word": "Rebuilt by pinned construction/promo/reproduce_promo.py --base p6n --k p6n-k4; content pin0390ec65 in construction/sw4/SW4-RECIPE-P6k4.json", + "recipe": "construction/sw4/SW4-RECIPE-P6k4.json" + }, + "pr635": { + "head": "a6895a69f8ad98ab45777b03e9e6f48888c39f6f", + "package": "research/complex-571-cold14-st2" + }, + "inputs": { + "LICENSE": { + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + "P6K4-WORD.json.gz": { + "sha256": "ee8c1c879d9ffc06b53759f19f652b3023e463d804d2e42a0c3a9de3275b852a", + "content_sha256": "0390ec65dc4d47df1887aabdc2ec5b6ddea3cfc8e65582873fdfeba81d100073" + }, + "PR699-NOTICE.md": { + "sha256": "93f803ee9ae9d2f02801cf79335ff1731b71bd82b6b6d0bfc9a1130c1543b63c" + }, + "SW4-RECIPE.json": { + "sha256": "fa58d0ffc95d10b7453daefe4b34404a52895f94126ef973e92e92106cd615fa" + }, + "UPSTREAM-NOTICE.md": { + "sha256": "a75967ebc34e3bf2ff2c25c08e6c7f1a61b0c0d171cfd1b62196ae2caaf2c610" + } + }, + "comparison_content_sha256": "d232183f233899961bf55cac67a18545ed33548d9a7ca7078990d1a83d557c59", + "scope": "Pinned research inputs and inherited builder semantics. Original source notices retained. No selected frontier, supplier, or upstream files changed." +} diff --git a/research/complex-read-exchange/VALIDATION.md b/research/complex-read-exchange/VALIDATION.md new file mode 100644 index 0000000000..14b5f434e7 --- /dev/null +++ b/research/complex-read-exchange/VALIDATION.md @@ -0,0 +1,104 @@ +# Validation record + +Executed on 2026-10-12 America/Los_Angeles (2026-10-13 UTC), macOS arm64. +Repository base: `66849e1475c930fd7732b1a0067ffee7e1e95f60`. +This is contributor execution and AI review, not independent human review or a +proof-assistant formalization. + +## Reconstructed comparison input + +The #699 package at `03e8d7ca494a083e5053cd6b1228f66b98414479` passed its +122-file manifest check. Its #635 dependency was pinned to +`a6895a69f8ad98ab45777b03e9e6f48888c39f6f`. Python 3.11.13 rebuilt gauge44, +no-triangle, the layered NP word, P6n, P6k4, and SW4. Exact content pins matched +at every stage; the recorded driver time was 457 seconds. + +The layered NP, promoted P6k4 and final SW4 stages passed their native transport, +ledger, local replay and wrapper checks. The recorded mutation runs include the +59 NP end controls, 95 P6n end controls, 11 promotion controls, 95 promoted-word +end controls, four SW4 controls and 95 final-word end controls. These are inherited +controls, not newly attributed discoveries. RECONSTRUCTION.json preserves the +execution steps and the exact scope of replay. + +The independent native SW4 audit passed all 728 arbitrary-input columns in +forward and dual orientations, including endpoint frames, entrances and cones. +Clifford phase generation, global owner admission/repricing, the separate bit +supplier rebuild and the repository-wide suite were not repeated. This is +baseline validation; no new supplier was constructed. + +## New finite search and independent replay + +On Python 3.11.13: + +- The primary reduced-basis engine reconstructed P6k4 and known SW4 profiles, + including byte-identical SW4 output. +- Re-enumeration found 54 eligible pairs and all 602 single-pair subsets: 38 legal, + 564 rejected at target caps. This check uses P6k4, not the older input mentioned + in #699's historical notes. +- All 1,431 two-pair groups completed: 175,456 choices with at least one partial + exchange, every one cap-rejected. The final evidence run took 126.357 seconds. +- All 16 connected triple groups in the declared direct-target overlap graph + completed: 27,344 choices, every one cap-rejected. The final evidence run took + 19.576 seconds. This is not arbitrary-triple coverage. +- The independently implemented vector-set engine separately enumerated every + eligible pair and every group/mask combination, then replayed all 202,800 + parameterized cases (some give duplicate completed rewrites). Its first failure site matched the primary engine in every case; + ordered evidence digests agree exactly. +- The independent checker reconstructed known SW4 bytes, recounted the complete + frame profile, preserved each helper boundary, and checked its exact rational + B-end map on all 728 columns. No modular equality assumption is used for that + scalar control. +- All 13 focused tests passed. They cover valid reconstruction, scalar corruption + with legal frames, frame corruption with unchanged scalar maps, retained + compensation, wrong boundaries, conflicting edits, explicit cap witnesses, + non-dyadic coefficients, exact cost signs, optimized external CLI rejection, + and truncated or unfinished domain reports. + +Deterministic failure-site digests: + +- Two pairs: `fe76c61059ebeb274e91233cf1cc250ebb8d2b6d97fd98c0bf43e92edeaef916`. +- Connected triples: `c238beff39b56afd1a1cbcfd5bd0e5f23ec335bdb248c3ff85d02de2da83446d`. + +EXPECTED.json also records the independently recomputed explicit-witness +digests. Its SHA256 is +`440d15502692c31bc39de53349a93f95e48a6eab6a046abb6a57d611c50bb082`. +The public command recomputes mathematical evidence before comparing these +values; matching stored hashes alone is never an admission rule. + +## Packaged public replay + +The complete public isolated, optimized command passed under Python 3.13.4: + +```sh +python3 -B -I -O research/complex-read-exchange/verify.py +``` + +It exited 0 at 2026-10-13 05:23 UTC. Both primary enumerations, both independent +refusal replays, exact evidence equality and all 13 mathematical failure tests +passed. Output ended: + +```text +PASS: 202800 coupled partial choices rejected by both engines; exact 728-column SW4 control; no new kappa +``` + +“Choices” counts group/mask cases and does not assert distinct completed rewrites. +Public log SHA256: `ec8b3b4d4002e233711de3597bbc3946f74abd340225e00bde2f0801157dfee3`. + +The scoped Linux workflow requests Python 3.11 and 3.14; no remote CI pass is +claimed from local execution. + +The selected-record/source-inventory checker passes at the original exact +kappa `51110230636731/31250000000000000`. No selected certificate, supplier, +root Makefile or upstream/ file changes. Documentation links and whitespace +checks pass. Only the new package and its scoped CI workflow are submitted. + +## Research outcome and overlap + +No candidate passed frame legality; no kappa improvement was found. This is an +exhaustive negative result only within the precisely declared finite domains, +not a global barrier for simultaneous exchanges or changed circuits. + +Final overlap inspection covered 586 open PRs through #767. #741 changes eight +frames after full SW4 and is distinct. #699's later head changed only README and +MANIFEST; its construction inputs are unchanged. The base remains pinned and no +sprint coordination issue existed. CLAIM.md records the local claim and result. diff --git a/research/complex-read-exchange/independent_check.py b/research/complex-read-exchange/independent_check.py new file mode 100644 index 0000000000..9724ac85f3 --- /dev/null +++ b/research/complex-read-exchange/independent_check.py @@ -0,0 +1,598 @@ +#!/usr/bin/env python3 +"""Independent finite checks for coupled read-exchange nominations. + +No search or SW4-builder code is imported. Binary subspaces are represented by +all their vectors, and scalar B maps use exact Fractions on every register. +The fixed A+cut prefix is unchanged; equality as maps on arbitrary B inputs +therefore implies equality after that prefix. This does not replace native, +wrapper, phase, owner, finite-invoice or outer-assembly admission. + +With --search-report, exact pricing covers every reported legal profile. +Adding --replay-refusals independently reconstructs the completed finite domain, +checks every F2 refusal and survivor profile, and compares the failure digest. +Neither mode establishes a general impossibility theorem. +Apache-2.0. Prepared with OpenAI Codex assistance. +""" +import argparse +from collections import Counter, defaultdict +from copy import deepcopy +from fractions import Fraction as Q +from functools import lru_cache +import gzip +import hashlib +import itertools +import json +from pathlib import Path + +V, DIM = 112, 9 +CURRENT_B = Q('0.001663428754540205730067') + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def read(path): + raw = Path(path).read_bytes() + if str(path).endswith('.gz'): + raw = gzip.decompress(raw) + return json.loads(raw), hashlib.sha256(raw).hexdigest() + + +def encoded(obj): + return json.dumps(obj, sort_keys=True, separators=(',', ':')).encode() + + +@lru_cache(None) +def span(vectors): + out = {0} + for x in vectors: + need(type(x) is int and 0 <= x < (1 << DIM), 'Invalid F2 vector') + out |= {y ^ x for y in tuple(out)} + return frozenset(out) + + +def subspace(vectors): + return span(tuple(vectors)) + + +def rank(space): + n = len(space) + need(n > 0 and n & (n - 1) == 0, 'Invalid subspace cardinality') + return n.bit_length() - 1 + + +def frame(space): + # The least vector at each occurring highest bit is the reduced pivot row. + return [min(x for x in space if x.bit_length() == bit + 1) + for bit in range(DIM - 1, -1, -1) + if any(x.bit_length() == bit + 1 for x in space)] + + +@lru_cache(None) +def union_space(left, right): + return subspace(frame(left) + frame(right)) + + +FULL = subspace(1 << i for i in range(DIM)) +ZERO = subspace(()) + + +def registers(g): + need(g[0] in ('add', 'scale'), 'Unknown gate opcode') + return g[1:3] if g[0] == 'add' else g[1:2] + + +def coefficient(g): + a, b = g[3:5] if g[0] == 'add' else g[2:4] + need(type(a) is int and type(b) is int and b != 0, 'Invalid rational coefficient') + q = Q(a, b) + need(q.denominator & (q.denominator - 1) == 0, 'Coefficient is not dyadic') + if g[0] == 'scale': + need(q != 0, 'Singular scalar gate') + return q + + +def geometry(word): + n = 2 * V + word['report']['R'] + need(len(word['ports']) == V and n > 2 * V, 'Unexpected geometry') + caps = [frozenset(x for x in range(1 << DIM) + if bin(x & p).count('1') % 2 == 0) for p in word['ports']] + starts = [subspace((p,)) for p in word['ports']] + [ZERO] * (n - V) + ends = [FULL] * V + caps + [FULL] * (n - 2 * V) + for q, f in word.get('start_extra', {}).items(): + need(2 * V <= int(q) < n, 'Non-helper entrance override') + starts[int(q)] = subspace(f) + for q, f in word.get('helper_final', {}).items(): + need(2 * V <= int(q) < n, 'Non-helper terminal override') + ends[int(q)] = subspace(f) + for q in range(n): + need(starts[q] <= ends[q], 'Entrance not contained in terminal frame') + return n, caps, starts, ends + + +def validate_gate(g, n): + for q in registers(g): + need(type(q) is int and 0 <= q < n, 'Gate register out of range') + need(g[0] != 'add' or g[1] != g[2], 'Self-add outside nomination model') + coefficient(g) + + +def scalar_b_map(word): + """Exact linear B map on arbitrary independent B-entry register values.""" + n = 2 * V + word['report']['R'] + rows = [{i: Q(1)} for i in range(n)] + for g in word['B']: + validate_gate(g, n) + t, c = g[1], coefficient(g) + if g[0] == 'scale': + rows[t] = {k: c * x for k, x in rows[t].items() if c * x} + else: + for k, x in tuple(rows[g[2]].items()): + value = rows[t].get(k, Q(0)) + c * x + if value: + rows[t][k] = value + else: + rows[t].pop(k, None) + return rows + + +def scalar_compare(original, candidate): + left, right = scalar_b_map(original), scalar_b_map(candidate) + changed = [i for i, (a, b) in enumerate(zip(left, right)) if a != b] + need(not changed, 'Exact B map changed at registers ' + str(changed[:16])) + return len(left) + + +def rewrite(original, moves): + """Apply validated scalar edits simultaneously using original B indices.""" + n, _, _, _ = geometry(original) + gates = original['B'] + edits, deleted, inserted = {}, set(), defaultdict(list) + for m in moves: + need(m.get('kind') in ('h2r', 'r2h'), 'Unknown move kind') + h, r, i, t = (m[k] for k in ('h', 'r', 'read_index', 'target')) + need(all(type(x) is int for x in (h, r, i, t)), 'Noninteger move index') + need(2 * V <= h < n and str(h) in original['start_extra'], 'Non-entering helper') + need(0 <= r < n and not V <= r < 2 * V and r != h, 'Invalid copy source') + need(0 <= i < len(gates) and V <= t < 2 * V, 'Invalid target read') + writes = [j for j, g in enumerate(gates) if g[1] == h] + need(bool(writes), 'Copy helper has no B write') + copy = writes[0] + need(gates[copy][:5] == ['add', h, r, 1, 1], 'First B write is not the copy') + before = [j for j in range(copy) if h in registers(gates[j])] + need(all(gates[j][0] == 'add' and V <= gates[j][1] < 2 * V + and gates[j][2] == h for j in before), 'Invalid pre-copy use') + stop = next((j for j in range(copy + 1, len(gates)) + if gates[j][1] in (h, r)), len(gates)) + need(copy < i < stop, 'Read outside stable copy interval') + g = gates[i] + source = h if m['kind'] == 'h2r' else r + need(g[:3] == ['add', t, source] and g[3:5] == m['coef'], 'Read/recipe mismatch') + a, b = m['coef'] + need(i not in edits, 'Duplicate read edit') + edits[i] = ['add', t, r if source == h else h, a, b, None] + if m['kind'] == 'h2r': + j = m['delete_preread_index'] + need(type(j) is int and j in before, 'Deleted pre-read outside prefix') + need(gates[j][:5] == ['add', t, h, -a, b], 'Deleted pre-read mismatch') + need(j not in deleted, 'Duplicate pre-read deletion') + deleted.add(j) + else: + j = m['insert_preread_before'] + need(j == (before[-1] + 1 if before else copy), 'Insertion point outside declared rule') + need(m['preread'] == ['add', t, h, -a, b], 'Inserted pre-read mismatch') + inserted[j].append(['add', t, h, -a, b, None]) + need(not deleted.intersection(edits), 'Read both edited and deleted') + out, changed = [], [] + for i, g in enumerate(gates): + for new in inserted.get(i, []): + out.append(deepcopy(new)); changed.append(True) + if i not in deleted: + out.append(deepcopy(edits.get(i, g))); changed.append(i in edits) + word = deepcopy(original) + word['B'] = out + profile, widths = recount(word, refit=changed) + word['report']['local_profile'] = profile + word['report']['local_rank_mass'] = sum(int(k) * v for k, v in profile.items()) + return word, profile, widths + + +def recount(word, refit=None): + """Independent span-set path check and complete inherited paid ledger.""" + n, caps, starts, ends = geometry(word) + cur, paid = starts[:], Counter() + for section in ('A', 'cut', 'B', 'cleanup'): + for g in word[section]: + validate_gate(g, n) + + def move(g, floor=None): + rs = registers(g) + f = subspace(g[-1]) if floor is None else floor + if floor is not None: + for q in rs: + f = union_space(f, cur[q]) + g[-1] = frame(f) + for q in rs: + need(cur[q] <= f, 'Nonmonotone frame at register ' + str(q)) + if V <= q < 2 * V: + need(f <= caps[q - V], 'Target hyperplane violation at ' + str(q)) + d = rank(f) - rank(cur[q]) + if d: + paid[d] += 1 + cur[q] = f + + for g in word['A']: + move(g) + # The unchanged centre-cut interface charges its nested served levels. + levels = {int(t): subspace(f) for t, f in word.get('target_levels', {}).items()} + for q, f in zip(word['centers'], word['center_frames']): + old = subspace(f) + served = {levels.get(g[1] - V, ZERO) for g in word['cut'] if g[2] == q} + for new in sorted(served, key=lambda s: -rank(s)): + need(new <= old, 'Non-nested centre-cut levels') + d = rank(old) - rank(new) + if d: + paid[d] += 1 + old = new + for i, g in enumerate(word['B']): + if refit is None: + move(g) + else: + move(g, ZERO if refit[i] else subspace(g[-1])) + seen = set() + for entry in word.get('early_cleanup', []): + i, f = entry + need(type(i) is int and 0 <= i < len(word['cleanup']) and i not in seen, + 'Invalid or repeated early-cleanup index') + seen.add(i) + g = deepcopy(word['cleanup'][i]); g[-1] = list(f) + if refit is None: + move(g) + else: + move(g, subspace(f)); entry[1] = g[-1] + for q in registers(g): + need(cur[q] <= ends[q], 'Early tail exceeds terminal frame') + for q in range(n): + need(cur[q] <= ends[q], 'Terminal frame violation at ' + str(q)) + d = rank(ends[q]) - rank(cur[q]) + if d: + paid[d] += 1 + widths = [rank(ends[q]) - rank(starts[q]) for q in range(2 * V, n)] + return {str(k): v for k, v in sorted(paid.items()) if v}, widths + + +def boundary_check(original, candidate): + keys = ('ports', 'start_extra', 'helper_final', 'A', 'cut', 'cleanup', + 'target_levels', 'centers', 'center_frames') + for key in keys: + need(original.get(key) == candidate.get(key), 'Changed fixed boundary/section: ' + key) + need(original['report']['R'] == candidate['report']['R'], 'Changed helper count') + need([i for i, _ in original.get('early_cleanup', [])] + == [i for i, _ in candidate.get('early_cleanup', [])], 'Changed scalar tail order') + a, b = geometry(original), geometry(candidate) + need(a[2:] == b[2:], 'Changed per-register entrance or terminal subspace') + widths = [rank(b[3][q]) - rank(b[2][q]) for q in range(2 * V, b[0])] + return {'helper_count': len(widths), 'total_width': sum(widths), + 'per_helper_width_sha256': hashlib.sha256(encoded(widths)).hexdigest()} + + +@lru_cache(None) +def logarithm(n): + """Rational ln(n) interval, via range reduction and positive atanh series.""" + need(type(n) is int and n >= 1, 'Invalid rank in moment') + def small(x): + t = (x - 1) / (x + 1) + value = Q(0); power = t + terms = 70 + for j in range(terms): + value += 2 * power / (2 * j + 1) + power *= t * t + tail = 2 * power / ((2 * terms + 1) * (1 - t * t)) + return value, value + tail + k = n.bit_length() - 1 + a, b = small(Q(n, 1 << k)); c, d = small(Q(2)) + return a + k * c, b + k * d + + +@lru_cache(None) +def weight(n, exponent): + """Bounds on n**(1-exponent); exp(-y) alternating Taylor bounds.""" + lo, hi = logarithm(n) + ylo, yhi = exponent * lo, exponent * hi + need(0 <= ylo <= yhi < 1, 'Exponent outside supported moment interval') + def partial(y, degree): + total, term = Q(1), Q(1) + for j in range(1, degree + 1): + term *= -y / j + total += term + return total + return n * partial(yhi, 17), n * partial(ylo, 16) + + +def price(profile, baseline, exponent=CURRENT_B): + delta = {int(k): profile.get(str(k), 0) - baseline.get(str(k), 0) + for k in set(profile) | set(baseline)} + need(all(type(v) is int and v >= 0 for v in profile.values()), 'Invalid profile count') + need(sum(r * v for r, v in delta.items()) == 0, 'Changed local rank mass') + lo = hi = Q(0) + for r, count in delta.items(): + if not count: + continue + a, b = weight(r, exponent) + lo += count * (a if count > 0 else b) + hi += count * (b if count > 0 else a) + relation = ('identical_profile' if not any(delta.values()) else + 'strictly_cheaper' if hi < 0 else + 'strictly_more_expensive' if lo > 0 else 'unresolved_interval') + return {'relation': relation, 'local_cost_delta_lower': str(lo), + 'local_cost_delta_upper': str(hi), + 'local_rank_mass': sum(int(k) * v for k, v in profile.items()), + 'complete_global_profile_rule': '72 * local + idle {1:1,3:1,44:1,48:2396}', + 'scope': 'Exact sign at stated endpoint; no new endpoint or outer kappa certification.'} + + + +def enumerate_pairs(word): + """Reconstruct the finite eligibility rule directly from scalar B gates.""" + gates = word['B'] + writes, touches = defaultdict(list), defaultdict(list) + for i, g in enumerate(gates): + writes[g[1]].append(i) + for r in registers(g): + touches[r].append(i) + pairs = [] + for helper in sorted(int(x) for x in word['start_extra']): + if not writes[helper]: + continue + copy_index = writes[helper][0] + copy = gates[copy_index] + if copy[0] != 'add' or copy[3:5] != [1, 1]: + continue + source = copy[2] + if V <= source < 2 * V: + continue + prefix = [j for j in touches[helper] if j < copy_index] + if any(gates[j][0] != 'add' or gates[j][2] != helper + or not V <= gates[j][1] < 2 * V for j in prefix): + continue + stops = [j for r in (helper, source) for j in writes[r] if j > copy_index] + stop = min(stops, default=len(gates)) + insertion = max(prefix) + 1 if prefix else copy_index + moves = [] + for i in range(copy_index + 1, stop): + g = gates[i] + if g[0] != 'add' or g[2] not in (helper, source) or not V <= g[1] < 2 * V: + continue + target, a, b = g[1], g[3], g[4] + move = dict(h=helper, r=source, read_index=i, target=target, coef=[a, b]) + if g[2] == helper: + matching = [j for j in prefix if gates[j][:5] == ['add', target, helper, -a, b]] + if len(matching) != 1: + continue + move.update(kind='h2r', delete_preread_index=matching[0]) + else: + move.update(kind='r2h', insert_preread_before=insertion, + preread=['add', target, helper, -a, b]) + moves.append(move) + if moves: + pairs.append(dict(h=helper, r=source, copy_index=copy_index, + stop_index=stop, moves=moves)) + return pairs + + +class RefusalProbe: + """Only the failure path: independently propagate explicit vector sets. + + This deliberately does not price or claim scalar correctness of survivors. + Gates use original B indices; inserted gates use ['insert', original index]. + Tail failure indices are positions in early_cleanup, not cleanup indices. + """ + def __init__(self, word): + self.word = word + _, self.caps, cur, self.ends = geometry(word) + for g in word['A']: + f = subspace(g[-1]) + for q in registers(g): + need(cur[q] <= f, 'Invalid fixed A frame') + cur[q] = f + self.initial = cur + self.gates = [(tuple(registers(g)), subspace(g[-1])) for g in word['B']] + self.tails = [(tuple(registers(word['cleanup'][i])), subspace(f)) + for i, f in word.get('early_cleanup', [])] + + def run(self, moves): + replaced, deleted, inserted = {}, set(), defaultdict(list) + for m in moves: + i = m['read_index'] + if i in replaced: + return ('conflicting_read', i), None + replaced[i] = (m['target'], m['r'] if m['kind'] == 'h2r' else m['h']) + if m['kind'] == 'h2r': + if m['delete_preread_index'] in deleted: + return ('conflicting_delete', i), None + deleted.add(m['delete_preread_index']) + else: + inserted[m['insert_preread_before']].append((m['target'], m['h'])) + if deleted.intersection(replaced): + return ('edit_delete',), None + cur = self.initial[:] + for i, (old_rs, floor) in enumerate(self.gates): + pending = [(rs, ZERO, ['insert', i]) for rs in inserted.get(i, ())] + if i not in deleted: + pending.append((replaced.get(i, old_rs), ZERO if i in replaced else floor, i)) + for rs, f, origin in pending: + for q in rs: + f = union_space(f, cur[q]) + for q in rs: + if V <= q < 2 * V and not f <= self.caps[q - V]: + return ('cap', origin, q), min(f - self.caps[q - V]) + for q in rs: + cur[q] = f + for i, (rs, f) in enumerate(self.tails): + for q in rs: + f = union_space(f, cur[q]) + for q in rs: + if not f <= self.ends[q]: + return ('tail', i, q), min(f - self.ends[q]) + for q in rs: + cur[q] = f + for q, f in enumerate(self.ends): + if not cur[q] <= f: + return ('end', q), min(cur[q] - f) + return None, None + + + +def finite_groups(pairs, arity, domain): + """Enumerate complete groups and their exact nonempty, non-all-full counts.""" + targets = {p['h']: {m['target'] for m in p['moves']} for p in pairs} + groups = [] + for group in itertools.combinations(pairs, arity): + ids = [p['h'] for p in group] + if domain == 'shared-targets': + # Check every cut of this small graph, not the search's reachability code. + connected = True + for mask in range(1, (1 << arity) - 1): + if not any(targets[ids[i]].intersection(targets[ids[j]]) + for i in range(arity) for j in range(arity) + if mask & (1 << i) and not mask & (1 << j)): + connected = False + break + if not connected: + continue + count = 1 + for pair in group: + count *= (1 << len(pair['moves'])) - 1 + groups.append((group, count - 1)) + return groups + +def replay_refusals(word, rec, search, declared_pairs): + need(search['status'] == 'COMPLETE_FINITE_DOMAIN', 'Refusal replay requires a completed domain') + need(search['at_least_one_partial'] is True and search['unchanged_other_sw4_pairs'] is True, + 'Different coupling rule') + arity = search.get('arity', 2) + domain = search['domain'] + need(arity in (2, 3) and domain in ('all', 'shared-targets'), 'Unknown finite domain') + pairs = enumerate_pairs(word) + need(declared_pairs['input_sha256'] == rec['input_sha256'], 'Candidate input pin mismatch') + need(pairs == declared_pairs['pairs'], 'Independent eligible-pair enumeration differs') + all_groups = finite_groups(pairs, arity, domain) + expected_groups = [[*[p['h'] for p in g], n] for g, n in all_groups] + need(expected_groups == search['pairs_tested'], 'Incomplete or inconsistent group/mask declaration') + need(sum(n for _, n in all_groups) == search['counts']['coupled_total'], 'Incomplete candidate total') + probe = RefusalProbe(word) + need(probe.run([])[0] is None, 'Identity unexpectedly refused') + need(probe.run(rec['moves'])[0] is None, 'Known SW4 unexpectedly refused') + count, profiles = Counter(), Counter() + for pair in pairs: + for mask in range(1, 1 << len(pair['moves'])): + moves = [m for i, m in enumerate(pair['moves']) if mask & (1 << i)] + failure, _ = probe.run(moves) + count['single_total'] += 1 + count['single_' + (failure[0] if failure else 'legal')] += 1 + witness_hash = hashlib.sha256() + site_hash = hashlib.sha256() + groups, witnesses = [], [] + for group, _ in all_groups: + ids = [p['h'] for p in group] + fixed = [m for m in rec['moves'] if m['h'] not in ids] + checked = 0 + for masks in itertools.product(*(range(1, 1 << len(p['moves'])) for p in group)): + if all(m == (1 << len(p['moves'])) - 1 for p, m in zip(group, masks)): + continue + moves = fixed + [move for p, mask in zip(group, masks) + for i, move in enumerate(p['moves']) if mask & (1 << i)] + failure, vector = probe.run(moves) + count['coupled_total'] += 1 + count['coupled_' + (failure[0] if failure else 'legal')] += 1 + checked += 1 + site = [ids, list(masks), list(failure) if failure else None] + site_hash.update(encoded(site) + b'\n') + witness_hash.update(encoded(site + [vector]) + b'\n') + if len(witnesses) < 4: + witnesses.append(site + [vector]) + if failure is None: + _, profile, _ = rewrite(word, moves) + profiles[tuple(sorted((int(k), v) for k, v in profile.items()))] += 1 + groups.append(ids + [checked]) + observed = {k: v for k, v in search['counts'].items() + if k.startswith('single_') or k.startswith('coupled_')} + need(dict(count) == observed, 'Independent failure/survivor counts differ') + need(groups == search['pairs_tested'], 'Independent group/mask enumeration differs') + reported = Counter({tuple(sorted((int(k), v) for k, v in x['profile'].items())): x['count'] + for x in search['distinct_legal_profiles']}) + need(profiles == reported, 'Independently recounted surviving profiles differ') + if 'failure_site_sha256' in search: + need(search['failure_site_sha256'] == site_hash.hexdigest(), 'Failure-site digest differs') + return {'status': 'PASS_INDEPENDENT_FINITE_REFUSAL_REPLAY', 'arity': arity, 'domain': domain, + 'eligible_pairs': len(pairs), 'groups': len(groups), 'counts': dict(count), + 'failure_site_sha256': site_hash.hexdigest(), + 'failure_witness_sha256': witness_hash.hexdigest(), 'first_witnesses': witnesses, + 'digest_encoding': 'SHA256 over compact sorted-key JSON [helper_ids,masks,failure] + LF per candidate; witness digest appends least offending F2 vector. Original B index; insertion origin [insert,index]; early_cleanup-list position for tails.', + 'scope': 'Independent complete enumeration and F2 rejection of this pinned finite domain; no general impossibility claim or scalar correctness claim for any survivor.'} + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('word', type=Path, help='Pinned promoted P6k4 input') + ap.add_argument('--baseline-recipe', type=Path, required=True) + ap.add_argument('--recipe', type=Path, help='Nomination containing moves; defaults to baseline SW4') + ap.add_argument('--candidate-word', type=Path, help='Optional emitted word to bind to independent rewrite') + ap.add_argument('--search-report', type=Path, help='Exact-price all reported distinct legal profiles') + ap.add_argument('--output', type=Path) + ap.add_argument('--replay-refusals', action='store_true', help='Independently enumerate the completed --search-report domain and check every refusal') + args = ap.parse_args() + need(not args.replay_refusals or args.search_report is not None, '--replay-refusals needs --search-report') + original, source_sha = read(args.word) + rec, _ = read(args.baseline_recipe) + need(source_sha == rec['input_sha256'], 'Input hash mismatch') + original_profile, _ = recount(original) + need(original_profile == rec['profile_in'], 'Input profile mismatch') + baseline, baseline_profile, _ = rewrite(original, rec['moves']) + need(hashlib.sha256(encoded(baseline)).hexdigest() == rec['output_sha256'], 'Independent SW4 bytes mismatch') + need(baseline_profile == rec['profile_out'], 'SW4 profile mismatch') + scalar_columns = scalar_compare(original, baseline) + nomination = read(args.recipe)[0] if args.recipe else rec + candidate, candidate_profile, _ = rewrite(original, nomination['moves']) + if 'profile' in nomination: + need(candidate_profile == nomination['profile'], 'Nomination profile mismatch') + if args.candidate_word: + submitted, _ = read(args.candidate_word) + need(encoded(submitted) == encoded(candidate), 'Submitted word differs from independent rewrite') + bounds = boundary_check(original, candidate) + need(recount(candidate)[0] == candidate_profile, 'Emitted frame recount mismatch') + scalar_compare(original, candidate) + report = {'status': 'PASS_INDEPENDENT_LOCAL_NOMINATION_CHECK', 'input_sha256': source_sha, + 'baseline_sha256': rec['output_sha256'], + 'candidate_sha256': hashlib.sha256(encoded(candidate)).hexdigest(), + 'exact_scalar_columns': scalar_columns, 'boundary_identity': bounds, + 'profile': candidate_profile, 'exponent': str(CURRENT_B), + 'price': price(candidate_profile, baseline_profile), + 'scope': 'Local recipe, exact B map, F2 paths, boundaries and complete-profile cost comparison; native/global admission remains required.'} + if args.search_report: + search, _ = read(args.search_report) + need(search['input_sha256'] == source_sha and search['comparison_sha256'] == rec['output_sha256'], + 'Search report baseline mismatch') + pricing = [] + for row in search['distinct_legal_profiles']: + profile = {str(k): v for k, v in row['profile'].items()} + pricing.append({'profile': profile, 'reported_count': row['count'], + 'price': price(profile, baseline_profile)}) + report['reported_profiles'] = pricing + if args.replay_refusals: + declared = read(args.search_report.parent / 'CANDIDATES.json')[0] + report['refusal_replay'] = replay_refusals(original, rec, search, declared) + report['negative_evidence_scope'] = ('Independent complete enumeration, F2 refusal replay and survivor-profile recount for the pinned finite domain; no general impossibility claim.' if args.replay_refusals else 'Exact pricing of reported profiles only; no independent enumeration, legality or completeness claim.') + if args.output: + args.output.write_text(json.dumps(report, indent=2) + '\n') + if 'refusal_replay' in report: + r = report['refusal_replay'] + print('PASS independent refusal replay: %d groups, %d candidates; site digest %s' % (r['groups'], r['counts']['coupled_total'], r['failure_site_sha256'])) + relations = Counter(x['price']['relation'] for x in report.get('reported_profiles', [])) + print('PASS independent exact B map (%d columns), F2 paths, helper boundaries; candidate %s; reported profiles %s' + % (scalar_columns, report['price']['relation'], dict(relations))) + + +if __name__ == '__main__': + main() diff --git a/research/complex-read-exchange/inputs/LICENSE b/research/complex-read-exchange/inputs/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/complex-read-exchange/inputs/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/complex-read-exchange/inputs/P6K4-WORD.json.gz b/research/complex-read-exchange/inputs/P6K4-WORD.json.gz new file mode 100644 index 0000000000..31e4d36ecb Binary files /dev/null and b/research/complex-read-exchange/inputs/P6K4-WORD.json.gz differ diff --git a/research/complex-read-exchange/inputs/PR699-NOTICE.md b/research/complex-read-exchange/inputs/PR699-NOTICE.md new file mode 100644 index 0000000000..1b805ff2ae --- /dev/null +++ b/research/complex-read-exchange/inputs/PR699-NOTICE.md @@ -0,0 +1,24 @@ +# Gauge44 attribution and scope + +New contributions by icekylinx, with OpenAI GPT-6 Astra assistance. +Local review and packaging used OpenAI Codex. Apache-2.0 applies; +the license is included. The full original PR635 notice is preserved as +UPSTREAM-NOTICE.md and construction/UPSTREAM-NOTICE.md. + +The new contribution is the changed source-branch gauge and retired-row +completion, source-carried coordinate totals, exact 44-cold-end realization, +and explicit all72 whole-family assignment using concave capacity matching +with integer majorization certificates. The center-carrier generalization +retains the exact ordered common frames and complete native local contract. +Independent local, price, interface and owner fixed-point checks are included. + +The construction retains the credited PR635 K-triangle and porting machinery, +earlier joint-prefix/HPE/frame ancestry and icekylinx's prior factory work. +#645 used the same cited PR543 bit supplier as PR635. This package (research/gauge44-promo-p6k4sw) cites the merged PR589 bit supplier instead, with a derived rank-mass deficit (PROOF-NOTE-BIT.md); #645's retained PR543-based evidence is historical. It builds #645's word without K-triangles (PartialK) and stacks earlier community jp8 layers on it (G44Stack), adds the p6n ends (NoTriReopen), entrance promotions (BlockInvert) and a read-set exchange (BRoute); see README. All-size, realization, +hosting, precision/tape, analytic-transfer and bit H1-H5 assumptions remain +conditional. No upstream license, credit, source pin or AI disclosure is +replaced by this notice. + +PR641 and PR642 were checked as concurrent reported frontier comparisons. +Their endpoints and owner maps are not included here. See CONSTRUCTION.md, +hosting/PROOF.md, independent/ and README.md for the exact contribution scope. diff --git a/research/complex-read-exchange/inputs/SW4-RECIPE.json b/research/complex-read-exchange/inputs/SW4-RECIPE.json new file mode 100644 index 0000000000..b9dea4152a --- /dev/null +++ b/research/complex-read-exchange/inputs/SW4-RECIPE.json @@ -0,0 +1,314 @@ +{ + "name": "SW4", + "description": "BRoute read-set exchange on entering-copy pairs (h,r); indices refer to the input word B section", + "input_sha256": "0390ec65dc4d47df1887aabdc2ec5b6ddea3cfc8e65582873fdfeba81d100073", + "output_sha256": "d232183f233899961bf55cac67a18545ed33548d9a7ca7078990d1a83d557c59", + "pairs": { + "461": 25, + "581": 89, + "591": 415, + "603": 431 + }, + "moves": [ + { + "kind": "h2r", + "h": 461, + "r": 25, + "read_index": 856, + "target": 168, + "coef": [ + -1, + 2 + ], + "delete_preread_index": 27 + }, + { + "kind": "h2r", + "h": 461, + "r": 25, + "read_index": 1208, + "target": 128, + "coef": [ + -1, + 2 + ], + "delete_preread_index": 26 + }, + { + "kind": "r2h", + "h": 461, + "r": 25, + "read_index": 873, + "target": 129, + "coef": [ + -1, + 2 + ], + "insert_preread_before": 28, + "preread": [ + "add", + 129, + 461, + 1, + 2 + ] + }, + { + "kind": "r2h", + "h": 461, + "r": 25, + "read_index": 1193, + "target": 169, + "coef": [ + -1, + 2 + ], + "insert_preread_before": 28, + "preread": [ + "add", + 169, + 461, + 1, + 2 + ] + }, + { + "kind": "h2r", + "h": 581, + "r": 89, + "read_index": 860, + "target": 171, + "coef": [ + -1, + 2 + ], + "delete_preread_index": 58 + }, + { + "kind": "h2r", + "h": 581, + "r": 89, + "read_index": 1288, + "target": 192, + "coef": [ + -1, + 2 + ], + "delete_preread_index": 59 + }, + { + "kind": "r2h", + "h": 581, + "r": 89, + "read_index": 953, + "target": 193, + "coef": [ + -1, + 2 + ], + "insert_preread_before": 60, + "preread": [ + "add", + 193, + 581, + 1, + 2 + ] + }, + { + "kind": "r2h", + "h": 581, + "r": 89, + "read_index": 1197, + "target": 175, + "coef": [ + -1, + 2 + ], + "insert_preread_before": 60, + "preread": [ + "add", + 175, + 581, + 1, + 2 + ] + }, + { + "kind": "h2r", + "h": 591, + "r": 415, + "read_index": 868, + "target": 139, + "coef": [ + 1, + 1 + ], + "delete_preread_index": 62 + }, + { + "kind": "h2r", + "h": 591, + "r": 415, + "read_index": 1296, + "target": 160, + "coef": [ + 1, + 1 + ], + "delete_preread_index": 63 + }, + { + "kind": "r2h", + "h": 591, + "r": 415, + "read_index": 961, + "target": 161, + "coef": [ + 1, + 1 + ], + "insert_preread_before": 64, + "preread": [ + "add", + 161, + 591, + -1, + 1 + ] + }, + { + "kind": "r2h", + "h": 591, + "r": 415, + "read_index": 1205, + "target": 143, + "coef": [ + 1, + 1 + ], + "insert_preread_before": 64, + "preread": [ + "add", + 143, + 591, + -1, + 1 + ] + }, + { + "kind": "h2r", + "h": 603, + "r": 431, + "read_index": 876, + "target": 131, + "coef": [ + 1, + 1 + ], + "delete_preread_index": 70 + }, + { + "kind": "h2r", + "h": 603, + "r": 431, + "read_index": 1300, + "target": 163, + "coef": [ + 1, + 1 + ], + "delete_preread_index": 71 + }, + { + "kind": "r2h", + "h": 603, + "r": 431, + "read_index": 965, + "target": 167, + "coef": [ + 1, + 1 + ], + "insert_preread_before": 72, + "preread": [ + "add", + 167, + 603, + -1, + 1 + ] + }, + { + "kind": "r2h", + "h": 603, + "r": 431, + "read_index": 1213, + "target": 135, + "coef": [ + 1, + 1 + ], + "insert_preread_before": 72, + "preread": [ + "add", + 135, + 603, + -1, + 1 + ] + } + ], + "kappa_ideal_in": 0.0016603565408383088, + "kappa_ideal_out": 0.0016606836036204419, + "W": 3778, + "profile_in": { + "1": 2572, + "2": 326, + "3": 430, + "4": 194, + "5": 56, + "8": 8 + }, + "profile_out": { + "1": 2548, + "2": 342, + "3": 438, + "4": 186, + "5": 56, + "8": 8 + }, + "width_inventory": { + "4": 80, + "5": 32, + "7": 54, + "8": 122, + "9": 216 + }, + "rejection_expected": { + "N1": { + "changed_registers": [ + 168, + 171 + ], + "n": 2 + }, + "N2": { + "first": [ + "cap", + 1192, + 169 + ], + "n": 10 + }, + "N3": { + "changed_registers": [ + 129, + 130, + 169, + 170 + ], + "n": 4 + } + } +} diff --git a/research/complex-read-exchange/inputs/UPSTREAM-NOTICE.md b/research/complex-read-exchange/inputs/UPSTREAM-NOTICE.md new file mode 100644 index 0000000000..ebc24a0168 --- /dev/null +++ b/research/complex-read-exchange/inputs/UPSTREAM-NOTICE.md @@ -0,0 +1,34 @@ +# Attribution and scope + +Four verified provider types are offered to every call: PR571's prefix word with twelve multi-cut cold kernels (PR568's unchanged constructor), the same word with forty width-five entrance promotions (PR569's unchanged frame constructor) before those kernels, PR575's plain joint-prefix provider, and PR568's eight-cold provider. A window MILP with an exact per-pattern model chooses the dispatch and a literal owner map. PR583's six source-bound kernel frame coalescences (its unchanged constructor and negative controls) are applied to every PR571-prefix provider word (ck and atm3), followed by two further coalescences that each first move one addition past two commuting additions (package code/build_gate_moves.py, extending PR583's constructor); a final hyperplane_end step (package code/build_hpe.py) then runs 46 single-gate cleanups h -= p right after part B at the dim-8 join U of their registers, so 46 width-8 entering helpers per call end at U with width 7; each such gate commutes with every earlier cleanup gate on its registers (for 8 of them the partner's one earlier gate x -= p only reads p), and the reordered program is replayed exactly. A window MILP (exact windows, RINS around an LP vertex) gives the dispatch ck 45 / atm3 21 / jp8 6 and the literal owner map. + +Pinned external sources (unchanged; `verify.py` checks their manifests and every file it uses): +- PR568 (`research/complex-multicold`, commit `71c99ac935a33bb7b59a1b4a7af8725a939b0b90`). +- PR571 (`research/structural-gain`, commit `b7bdc5a8de18fcf418cfb9c7d83a2b1097a5e4a3`). +- PR569 (`research/larger-gain`, commit `897213a855b7fb8a1b8b0e552a2f5c42e6c1b326`). +- PR575 (`research/complex-joint-prefix`, commit `eac6f7e378ab622dac50a2fd4b7ef6eab014de44`). +- PR583 (`research/kernel-frame-coalescing`, commit `89be768f0157f5a3d8e4db69cf1748768605eac9`). + +Provider construction is described as typed steps in `data/SPEC.json` (`build`); `verify.py` runs only allowlisted step types with their paired omission audits and checks every input and output content hash. `code/` holds the spec-driven global admission scripts adapted from PR571's `frontier-composition/global-code/` (OpenAI Codex assisted, Apache-2.0): every expected value is read from `data/SPEC.json` and compared only after independent recomputation. `code/generated_identity.py` and `code/generated_identity_controls.py`, and the decompressed-content artifact identities in the bind, audit, invoice, assembly and phase-timing scripts, are taken unchanged from PR586 by chafreaky (`research/promoted-kernel-coalescing`, commit `4846fee5b06af770e9b3a10c36200f673d656725`, OpenAI Codex assisted, Apache-2.0), including its proof-content and reference/metadata mutation controls; the normalization of descriptive width metadata after frame changes follows the same PR. + +In PR601, the owner map was nominated by a HiGHS window MILP (adapted from PR569's `global/nominate_width7.py`) with lazy cross-time Hall cuts; this package's re-solved map is described below. Neither is an admission dependency. + +DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. (The PR601 package this one starts from states: "Prepared by Claude Code (Anthropic) research agents.") Apache-2.0 applies; LICENSE is included. All notices, licenses, source pins and AI disclosures of the pinned sources and their ancestry are retained in those packages and are not replaced by this notice. All inherited conditional assumptions remain conditional. + +**This package (complex-571-cold14, DreamingOfClouds).** It starts from PR601 (jeremykothe2, `research/complex-571-hpem46`, commit `529ab7dcb59d5ea7a5798e9e06cf5b3aee8a1550`). Everything above is kept unchanged except the following: +- every provider chain (ck, atm3, jp8) gains the typed step `cold_end` (`code/build_cold_end.py`, `code/cold_end_controls.py`; recipes `data/recipes/*-cold_end.json.gz`); +- the generalised native chain and the global admission scripts accept cold helpers that end below FULL (with `0:U` wrappers), a refactored exact cleanup, and check the wrapper order; +- `data/PLAN.json` / `data/OWNERS.json.gz` (dispatch and literal owner map) come from a relocate/swap/ejection-chain/provider-flip annealing search started from PR601's map, refined by an exact pattern-restricted owner model (CP-SAT) with a literal edge-colouring expansion (not an admission dependency); +- `data/SPEC.json` holds the expected values, recorded by a discovery run and then checked by a strict run. + +The cold-end construction (a row-plus-column cone condition for low-frame ends, a rank-0 dirt-spread premix and multi-gate lower-frame cleanup) builds on PR591 / PR592 / PR593 / PR601 (jeremykothe2) and our PR599 (Lean: multi-gate and cold hyperplane-end tails). DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. Build on this at your own risk. + +**This package (complex-571-cold14-b3, jeremykothe2).** It is PR604's `complex-571-cold14` (DreamingOfClouds) with ColdBeyond's second cold end per block (two new `cold_end` A-gate primitives, `PROOF-NOTE.md`), ColdSupply's E1 entering pair and reviewed controls, a free dispatch (jp8 ×60, atm3 ×12) and a literal owner map from an exact per-time-Hall window MIP. All other construction, code, controls and proofs are PR604's and earlier contributors', unchanged. + +**This package (complex-571-cold14-k492).** It is complex-571-cold14-b3 with these changes: +- **K-triangle base words.** The leaver-read K-triangle skeleton atom and its read schedule (`data/TRI-SCHEDULE.json`) are by AtomScout, a Claude Code research agent. `code/construct_k_triangle.py` is PR531's `code/construct_504.py` (icekylinx, OpenAI Codex / GPT assisted, Apache-2.0; pinned source `direct_delivery`) extended with that atom. +- **Ported chains.** The PR604/B3 chains are ported stage by stage onto the K-triangle words by `code/build_port_stage.py` (Port480, a Claude Code research agent). `code/build_frame_regroup.py` extends PR583's `build_frames.py` (chafreaky). +- **Helper count R.** The generalisation of the global scripts to the provider helper count R is by GlobalR (a Claude Code research agent), with AtomReviewer's fixes (PROOF-NOTE-R.md). +- **Owner map.** The owner map, the cold_end recipes on the K-triangle words and the package assembly are by Stack492, Port480 and ColdBeyond (Claude Code research agents). + +Build on this at your own risk. diff --git a/research/complex-read-exchange/search.py b/research/complex-read-exchange/search.py new file mode 100644 index 0000000000..5cac617491 --- /dev/null +++ b/research/complex-read-exchange/search.py @@ -0,0 +1,292 @@ +#!/usr/bin/env python3 +"""Bounded coupled entering-copy read-exchange nomination; not theorem admission. + +Searches PR699's explicitly open cross-pair class. The rewrite semantics and +frame-floor policy follow its credited SW4 construction. +Candidate nomination uses floating moment ordering; exact verification is separate. +""" +import argparse +from collections import Counter, defaultdict +from functools import lru_cache +import gzip +import hashlib +import itertools +import json +import math +from pathlib import Path +import time + +V = 112 +FULL = (256, 128, 64, 32, 16, 8, 4, 2, 1) + +@lru_cache(None) +def basis(vectors): + piv = {} + for x in vectors: + while x: + k = x.bit_length() - 1 + if k in piv: + x ^= piv[k] + else: + piv[k] = x + break + for k in sorted(piv): + for j in piv: + if j > k and piv[j] >> k & 1: + piv[j] ^= piv[k] + return tuple(piv[k] for k in sorted(piv, reverse=True)) + +@lru_cache(None) +def join(a, b): + return basis(a+b) + +@lru_cache(None) +def cap_ok(frame, port): + return all((x & port).bit_count() % 2 == 0 for x in frame) + +@lru_cache(None) +def hyper(port): + return basis(tuple(x for x in range(1, 512) if (x & port).bit_count() % 2 == 0)) + +def regs(e): + return e[1:3] if e[0] == 'add' else e[1:2] + +def read(path): + raw = Path(path).read_bytes() + if str(path).endswith('.gz'): + raw = gzip.decompress(raw) + return json.loads(raw), hashlib.sha256(raw).hexdigest() + +def encode(x): + return json.dumps(x, sort_keys=True, separators=(',', ':')).encode() + +class Evaluator: + def __init__(self, word): + self.w = word + n = 2*V+word['report']['R'] + start = [(p,) for p in word['ports']] + [()]*(n-V) + for q, f in word['start_extra'].items(): + start[int(q)] = basis(tuple(f)) + end = [FULL]*V+[hyper(p) for p in word['ports']]+[FULL]*(n-2*V) + for q, f in word['helper_final'].items(): + end[int(q)] = basis(tuple(f)) + cur = start[:] + paid = [0]*10 + for e in word['A']: + f = basis(tuple(e[-1])) + for q in regs(e): + if join(cur[q],f) != f: + raise ValueError(('A containment',q)) + d = len(f)-len(cur[q]) + if d: paid[d] += 1 + cur[q] = f + levels = {int(t):basis(tuple(f)) for t,f in word.get('target_levels',{}).items()} + for q, f in zip(word['centers'],word['center_frames']): + f = basis(tuple(f)) + served = {levels.get(e[1]-V,()) for e in word['cut'] if e[2] == q} + for t in sorted(served,key=lambda x:-len(x)): + if t != f: paid[len(f)-len(t)] += 1 + f = t + self.cur, self.paid, self.end = cur,paid,end + self.gates = [(e[1:3] if e[0]=='add' else e[1:2],basis(tuple(e[-1]))) for e in word['B']] + self.tails = [(regs(word['cleanup'][i]),basis(tuple(f))) for i,f in word.get('early_cleanup',[])] + self.widths = Counter(len(end[q])-len(start[q]) for q in range(2*V,n)) + + def run(self, moves=(), materialize=False): + edits = {} + delete = set() + insert = defaultdict(list) + for m in moves: + i=m['read_index'] + if i in edits: return None,('conflicting_read',i) + edits[i]=[m['target'],m['r'] if m['kind']=='h2r' else m['h']] + if m['kind']=='h2r': + if m['delete_preread_index'] in delete: return None,('conflicting_delete',i) + delete.add(m['delete_preread_index']) + else: + insert[m['insert_preread_before']].append([m['target'],m['h']]) + if delete & set(edits): return None,('edit_delete',) + cur = self.cur[:] + paid = self.paid[:] + frames = [] + def gate(rs, floor, origin): + f=floor + for q in rs: f=join(f,cur[q]) + for q in rs: + if V<=q<2*V and not cap_ok(f,self.w['ports'][q-V]): + return ('cap',origin,q) + for q in rs: + d=len(f)-len(cur[q]) + if d: paid[d]+=1 + cur[q]=f + if materialize: frames.append(list(f)) + return None + for i,(rs,f) in enumerate(self.gates): + for irs in insert.get(i,()): + bad=gate(irs,(),['insert',i]) + if bad:return None,bad + if i in delete:continue + bad=gate(edits.get(i,rs),() if i in edits else f,i) + if bad:return None,bad + tails=[] + for i,(rs,f) in enumerate(self.tails): + for q in rs:f=join(f,cur[q]) + for q in rs: + if join(cur[q],f)!=f or join(f,self.end[q])!=self.end[q]: + return None,('tail',i,q) + for q in rs: + d=len(f)-len(cur[q]) + if d:paid[d]+=1 + cur[q]=f + if materialize:tails.append(list(f)) + for q,f in enumerate(self.end): + if join(cur[q],f)!=f:return None,('end',q) + d=len(f)-len(cur[q]) + if d:paid[d]+=1 + profile={str(k):v for k,v in enumerate(paid) if k and v} + if materialize:return (profile,frames,tails),None + return profile,None + +def candidates(w): + """Fixed pair rule and insertion point follow PR699 NOTES.md. + + Each h2r move requires one literal matching entrance pre-read. Other + pre-read arrangements are outside this search, not silently extrapolated. + """ + gates=w['B'] + found=[] + for h in sorted(map(int,w['start_extra'])): + touched=[i for i,e in enumerate(gates) if h in regs(e)] + writes=[i for i in touched if gates[i][1]==h] + if not writes:continue + ci=writes[0]; e=gates[ci] + if e[0]!='add' or e[3:5]!=[1,1] or V<=e[2]<2*V:continue + r=e[2] + before=[i for i in touched if i>j&1] + profile,bad=ev.run(moves) + counts['single_total']+=1 + counts['single_'+('legal' if profile else bad[0])]+=1 + singles[p['h'],mask]=(profile,bad) + print('SINGLES',dict(counts),flush=True) + pairs_tested=[]; stopped=False + failure_sites=hashlib.sha256() + # Hold known full exchanges on untouched pairs fixed, so any nominated + # pair choice must improve the actual SW4 baseline, not the weaker input. + for group in itertools.combinations(pairs,a.arity): + ids={p['h'] for p in group} + graph={p['h']:set() for p in group} + for p,q in itertools.combinations(group,2): + if {m['target'] for m in p['moves']}&{m['target'] for m in q['moves']}: + graph[p['h']].add(q['h']);graph[q['h']].add(p['h']) + reached={group[0]['h']} + while True: + expanded=reached|set().union(*(graph[x] for x in reached)) + if expanded==reached:break + reached=expanded + if a.pair_domain=='shared-targets' and reached!=ids:continue + fixed=[m for m in rec['moves'] if m['h'] not in ids] + nchecked=0 + for selection in itertools.product(*(masks(len(p['moves'])) for p in group)): + if time.monotonic()-started>a.seconds:stopped=True;break + if all(mask==(1<>j&1] + moves=fixed+selected + profile,bad=ev.run(moves) + nchecked+=1;counts['coupled_total']+=1 + failure_sites.update(encode([[p['h'] for p in group],list(selection),list(bad) if bad else None])+b'\n') + if profile is None: + counts['coupled_'+bad[0]]+=1;continue + counts['coupled_legal']+=1 + key=tuple(sorted((int(k),v) for k,v in profile.items()));profiles[key]+=1 + val=cost(profile) + if val= (3, 11), 'Python 3.11 or newer is required') + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--expected', type=Path, default=HERE / 'EXPECTED.json') + args = ap.parse_args() + source = validate_sources() + expected = load(args.expected) + observed = {'input_sha256': source['inputs']['P6K4-WORD.json.gz']['content_sha256'], + 'comparison_sha256': source['comparison_content_sha256'], 'domains': {}} + with tempfile.TemporaryDirectory(prefix='complex-read-exchange-') as temp: + work = Path(temp) + word = HERE / 'inputs/P6K4-WORD.json.gz' + recipe = HERE / 'inputs/SW4-RECIPE.json' + def run(label, *arguments): + command = [sys.executable, '-B', '-I'] + if not __debug__: + command.append('-O') + command.extend(map(str, arguments)) + result = subprocess.run(command, capture_output=True, text=True) + need(result.returncode == 0, label + ' failed:\n' + (result.stdout + result.stderr)[-6000:]) + print('PASS ' + label, flush=True) + for label, arity, domain in DOMAINS: + out = work / label + run(label + ' primary exhaustive replay', HERE / 'search.py', word, + '--baseline-recipe', recipe, '--out', out, '--arity', arity, + '--pair-domain', domain, '--seconds', 3600) + independent = work / (label + '-independent.json') + run(label + ' independent refusal replay', HERE / 'independent_check.py', word, + '--baseline-recipe', recipe, '--search-report', out / 'SEARCH.json', + '--replay-refusals', '--output', independent) + observed['domains'][label] = domain_receipt(load(out / 'SEARCH.json'), load(independent)) + need(observed == expected, 'Recomputed evidence differs from EXPECTED.json') + run('mathematical failure controls', HERE / 'test_independent.py') + total = sum(row['counts']['coupled_total'] for row in observed['domains'].values()) + print('PASS: %d coupled partial choices rejected by both engines; exact 728-column SW4 control; no new kappa' % total) + + +if __name__ == '__main__': + main()