From 94b14c3640fb6fdf8ff0dbc794db903c5ded535e Mon Sep 17 00:00:00 2001 From: Wentao Li Date: Thu, 15 Oct 2026 16:33:37 +0000 Subject: [PATCH 1/2] Research: three-repeat partitioned 8q priced obstruction (no new kappa) Freestanding PR1898 (b,a,x)=(38,2,2) fifth alphabet at Q=8: three-repeat (excess-3) partitioned dual covering census 0; tariff cannot undercut 436. Prepared by Wentao Li with substantial AI assistance. --- .../CERTIFICATE.json | 113 ++++++ .../MASTER-HANDOFF.md | 55 +++ .../NOTICE.md | 36 ++ .../independent-walks-threerepeat-8q/PROOF.md | 109 ++++++ .../README.md | 86 +++++ .../SOURCES.json | 24 ++ .../TASK.json | 108 ++++++ .../VERIFY.json | 52 +++ .../independent.py | 200 +++++++++++ .../independent-walks-threerepeat-8q/model.py | 335 ++++++++++++++++++ .../test_package.py | 100 ++++++ .../verify.py | 235 ++++++++++++ 12 files changed, 1453 insertions(+) create mode 100644 research/independent-walks-threerepeat-8q/CERTIFICATE.json create mode 100644 research/independent-walks-threerepeat-8q/MASTER-HANDOFF.md create mode 100644 research/independent-walks-threerepeat-8q/NOTICE.md create mode 100644 research/independent-walks-threerepeat-8q/PROOF.md create mode 100644 research/independent-walks-threerepeat-8q/README.md create mode 100644 research/independent-walks-threerepeat-8q/SOURCES.json create mode 100644 research/independent-walks-threerepeat-8q/TASK.json create mode 100644 research/independent-walks-threerepeat-8q/VERIFY.json create mode 100644 research/independent-walks-threerepeat-8q/independent.py create mode 100644 research/independent-walks-threerepeat-8q/model.py create mode 100644 research/independent-walks-threerepeat-8q/test_package.py create mode 100644 research/independent-walks-threerepeat-8q/verify.py diff --git a/research/independent-walks-threerepeat-8q/CERTIFICATE.json b/research/independent-walks-threerepeat-8q/CERTIFICATE.json new file mode 100644 index 0000000000..6e8cfca622 --- /dev/null +++ b/research/independent-walks-threerepeat-8q/CERTIFICATE.json @@ -0,0 +1,113 @@ +{ + "schema_version": 1, + "status": "PASS_INDEPENDENT_WALKS_THREEREPEAT_8Q_OBSTRUCTION", + "scope": "Five-source common-B mutable-source Q/R/X alphabet (PR1898) at (b,a,x)=(38,2,2). Freestanding three-repeat (excess-3) layers inside partitioned independent dual walks at total Q=8 on shapes (2,6), (3,5), and (4,4): every dual has covering count 0; no dirt-legal covering schedule exists, so none undercuts tariff 436. Answers preferred next19 / shared-dirt OQ1 (fifth priced alphabet) without editing leave-alones through #2861/#2860/#2858/#2851 or pending shared-dirt tip.", + "claim": { + "Q": 8, + "partitions": [ + [ + 2, + 6 + ], + [ + 3, + 5 + ], + [ + 4, + 4 + ] + ], + "alphabet": "three_repeat_partitioned_independent_dual", + "three_repeat_26_covering": 0, + "three_repeat_26_valid_walks": 930, + "three_repeat_26_shape_32": 930, + "three_repeat_26_shape_41": 0, + "three_repeat_35_covering": 0, + "three_repeat_35_valid_multisets": 0, + "three_repeat_44_covering": 0, + "three_repeat_44_valid_walks": 0, + "covering_min_R": null, + "tariff_floor_at_X0": null, + "endpoint_Q6_tariff": 436, + "undercuts_436_after_complete_bill": false, + "beats_distinct_floors": false, + "answers_fifth_priced_alphabet_q8": true, + "answers_shared_dirt_oq1_fifth_alphabet": true, + "soft_overlap_shared_dirt": "safe_independent_excess_axis_not_dirt_coupling", + "oq_answer": "The named fifth priced readout alphabet under PR1898 (b,a,x)=(38,2,2) beyond same-walk / dirty-shadow / partitioned dual / one-repeat / two-repeat / shared-dirt is the three-repeat (excess-3) companion of partitioned independent duals at Q=8. Exact covering census: (2,6) covering 0 on 930 valid longs (only shape {3,2}; {4,1} never restores; span \u22644 so coset union \u22648); (3,5) covering 0 because shape {d:4} never restores; (4,4) covering 0 because excess 3 is impossible on length-4 (max excess 2). No covering R exists, so the alphabet cannot undercut tariff 436 after a complete dirty bill. Leave-alones through #2861/#2860/#2858/#2851 and pending shared-dirt tip are not reopened; soft-overlap with shared-dirt is avoided (excess axis, independent dirt).", + "no_new_kappa": true + }, + "three_repeat_2_plus_6": { + "kind": "three_repeat_partition_2_plus_6", + "Q": 8, + "valid_walks": 930, + "shape_32": 930, + "shape_41": 0, + "covering_pairs": 0, + "attainable_R": [], + "histogram": {}, + "min_R": null, + "structural_max_span": 4, + "structural_max_coset_union": 8, + "first_witnesses": {} + }, + "three_repeat_3_plus_5": { + "kind": "three_repeat_partition_3_plus_5", + "Q": 8, + "short_tables": 465, + "long_multisets": 0, + "covering_pairs": 0, + "attainable_R": [], + "histogram": {}, + "min_R": null, + "note": "shape_{d:4}_never_restores", + "structural_max_label_count_long": 1, + "first_witnesses": {} + }, + "three_repeat_4_plus_4": { + "kind": "three_repeat_partition_4_plus_4", + "Q": 8, + "valid_three_repeat_l4_walks": 0, + "covering_pairs": 0, + "attainable_R": [], + "histogram": {}, + "min_R": null, + "note": "excess_3_impossible_on_length4_max_excess_2", + "first_witnesses": {} + }, + "champion": { + "covering_any_partition": false, + "tariff_floor_at_X0": null, + "endpoint_Q6": 436, + "undercuts_436_after_complete_bill": false, + "distinct_26_min_R": 92, + "distinct_35_min_R": 98, + "distinct_44_min_R": 100, + "one_repeat_26_min_R": 112, + "one_repeat_35_min_R": 112, + "one_repeat_44_min_R": 112, + "two_repeat_26_covering": 0, + "shared_dirt_partition_min_R": 82, + "three_repeat_covering_min_R": null, + "comparison_tariffs": { + "distinct_26_at_R92_X0": 488, + "one_repeat_at_R112_X0": 528, + "shared_dirt_at_R82_X0": 468, + "endpoint_Q6": 436 + } + }, + "unit_tariff": { + "b": 38, + "a": 2, + "x": 2 + }, + "tariff_check": { + "formula": "38*Q + 2*R + 2*X", + "three_repeat_covering_floor": null, + "distinct_26_at_R92_X0": 488, + "one_repeat_at_R112_X0": 528, + "shared_dirt_at_R82_X0": 468, + "endpoint_Q6": 436 + } +} diff --git a/research/independent-walks-threerepeat-8q/MASTER-HANDOFF.md b/research/independent-walks-threerepeat-8q/MASTER-HANDOFF.md new file mode 100644 index 0000000000..82f30fc3ed --- /dev/null +++ b/research/independent-walks-threerepeat-8q/MASTER-HANDOFF.md @@ -0,0 +1,55 @@ +# Master handoff — independent-walks-threerepeat-8q + +## Deliverable + +| Field | Value | +|---|---| +| Branch | `cursor/independent-walks-threerepeat-8q-60b9` | +| Tip SHA | branch HEAD (`git rev-parse HEAD` on this branch); research package commit `b299447020f4e64a0954cf1161f8a38f41435ce2` | +| Package | `research/independent-walks-threerepeat-8q/` | +| Claim | Freestanding `#840`-style priced alphabet: **three-repeat** (excess-3) partitioned independent dual at Q=8 under PR1898 `(b,a,x)=(38,2,2)` | +| Result | Exact covering census **0** on `(2,6)` / `(3,5)` / `(4,4)`; cannot undercut tariff **436** | +| Kappa | none | + +## Answers + +- Preferred next19 / shared-dirt OQ1: named fifth alphabet beyond same-walk / + dirty-shadow / partitioned dual / one-repeat / two-repeat / shared-dirt. +- Soft-overlap with pending shared-dirt: safe (independent excess axis; no + dirt coupling; package path and census disjoint). + +## Exact census + +| Shape | Valid | Covering | Structural bound | +|---|---:|---:|---| +| `(2,6)` | 930 (`{3,2}` only; `{4,1}` never restores) | 0 | span ≤4 ⇒ coset ∪ ≤8 | +| `(3,5)` | 0 (`{d:4}` never restores) | 0 | — | +| `(4,4)` | 0 (excess 3 impossible on L4) | 0 | — | + +## Leave-alone respected + +Through #2861 / #2860 / #2858 / #2851; pending +`cursor/shared-dirt-walks-8q-60b9@fc3a2cb3`; #2846/#2840/#2836/#2817/#2779/ +#2764/#2761; deferred soft-overlaps untouched. + +## Verify gate + +```sh +python3.12 -I -B research/independent-walks-threerepeat-8q/verify.py +python3.12 -I -O -B research/independent-walks-threerepeat-8q/verify.py +python3.12 -I -B research/independent-walks-threerepeat-8q/independent.py +python3.12 -I -B research/independent-walks-threerepeat-8q/test_package.py +python3.12 -B scripts/research_package.py --package research/independent-walks-threerepeat-8q +``` + +## Attribution + +Author: Wentao Li \ +Disclosure: Prepared by Wentao Li with substantial AI assistance. +`TASK.json` `ai_assistance` without product/model names. +Never `Co-authored-by: Victor Li`. + +## Next open + +1. Sixth priced alphabet under PR1898 at Q=8 beyond three-repeat? +2. Q=9 partitioned independent dual companion (vs #2677 same-walk floor 466)? diff --git a/research/independent-walks-threerepeat-8q/NOTICE.md b/research/independent-walks-threerepeat-8q/NOTICE.md new file mode 100644 index 0000000000..fcce32acae --- /dev/null +++ b/research/independent-walks-threerepeat-8q/NOTICE.md @@ -0,0 +1,36 @@ +# Notice + +New material in this directory is Apache-2.0. + +Predecessor credit (do not alter historical notices elsewhere): + +- Arham Tahir / PR1898 `research/mutable-source-minimum-queries` — five-source + alphabet, minimum-query endpoint, abstract complete-call tariff `(b,a,x)=(38,2,2)`. +- ywz65 / open PR2455 `research/mutable-source-six-query-xor` — component lemma + and restored interaction-graph census at six queries. +- Arham Tahir / PR1370 — path-local shear lowering. +- TennisBowling / PR1524 — equal-price theorem and unequal-price handoff. +- Ross Richardson / PR943/934 — prefix framework. +- Fork path-lowered `research/mutable-source-789q-invoice` / open #2677 — + distinct-slot spectrum and champion path at Q=8; not edited. +- Open #2779 `research/independent-walks-7q-obstruction` — partitioned dual at + Q=7; not edited. +- Open #2851 `research/independent-walks-8q-obstruction` — distinct partitioned + dual at Q=8; leave-alone; not edited. +- Open #2861 `research/independent-walks-onerepeat-8q` — one-repeat (2,6) at + Q=8; leave-alone; not edited. +- Open #2860 `research/independent-walks-tworepeat-8q` — two-repeat at Q=8; + leave-alone; not edited. +- Open #2858 `research/independent-walks-onerepeat-35-44` — one-repeat + (3,5)/(4,4) at Q=8; leave-alone; not edited. +- Pending `cursor/shared-dirt-walks-8q-60b9@fc3a2cb3` + `research/shared-dirt-walks-8q` — shared-dirt at Q=8; OQ1 answered here; + leave-alone; not edited or competed. +- Open #2846 / #2840 / #2836 / #2817 / #2764 / #2761 / #2715 / #2686 / #2643 — + leave-alone through #2851; not edited. +- Deferred soft-overlaps (transfer-coupled-dual/shapes; shared-XOR; host + screens) — not opened. +- Live pin: `research/mutable-source-shear-cost/CERTIFICATE.json`. + +Prepared by Wentao Li (VictorLiwentao, @Is__Victor) with substantial AI +assistance. diff --git a/research/independent-walks-threerepeat-8q/PROOF.md b/research/independent-walks-threerepeat-8q/PROOF.md new file mode 100644 index 0000000000..78ce9b19bb --- /dev/null +++ b/research/independent-walks-threerepeat-8q/PROOF.md @@ -0,0 +1,109 @@ +# Three-repeat partitioned walks cannot cover at Q=8 + +This is a scoped obstruction in the five-source common-B mutable-source alphabet +of [PR1898](https://github.com/CrocSwap/integer-mult-bounds/pull/1898) at unit +tariff `(b,a,x)=(38,2,2)`. It names one freestanding `#840`-style priced +readout alphabet at eight queries beyond same-walk / dirty-shadow / partitioned +dual / one-repeat / two-repeat / shared-dirt: the **three-repeat** (excess-3) +companion of partitioned independent duals. It answers preferred next19 and +open question 1 of pending `cursor/shared-dirt-walks-8q-60b9@fc3a2cb3`. + +No new kappa is claimed. Leave-alone packages through #2861 / #2860 / #2858 / +#2851 are not edited. Pending shared-dirt tip is not edited or competed. +Soft-overlap with shared-dirt is avoided: this package stays on the +independent-dirt excess axis and does not couple the dirt coefficient. + +## Setup + +Retain queries `Q_j`, readouts `R_m: y_m += A_m z`, and paid source shears +`X_(s,t)`. A **restored walk** of length `n≥2` is an open slot list starting at +`0` whose closed completion has only nonzero edges. + +The **excess** of a walk is `Σ (count(ℓ)−1)` over nonzero labels. One-repeat +has excess `1`. Two-repeat has excess `2`. **Three-repeat** means excess +exactly `3`. + +A **three-repeat partitioned dual** of total query count `Q = 8` is a pair of +valid restored walks of lengths `(n_0,n_1)` with `n_0+n_1=8` and `n_0,n_1≥2`, +where at least one side is three-repeat, with independent dirt and dual +even-parity cost + +```text +R = Σ_{m=1}^{31} min_α ( e0[α] + e1[α ⊕ m] ). +``` + +Up to swap the only partitions are `(2,6)`, `(3,5)`, and `(4,4)`. + +The abstract complete-call tariff at `(b,a,x)=(38,2,2)` is `38·Q + 2·R + 2·X`. + +## Fixture A: partition `(2,6)` + +Short walk `(0,σ)`. Long walk of length 6 with excess 3 on five nonzero slots +forces exactly two distinct nonzero labels. Restoring shapes: + +| Shape | Restores? | Count | +|---|---|---:| +| `{d:3,e:2}` | yes | **930** | +| `{d:4,o}` | no | 0 | +| Total valid | — | **930** | + +**Lemma (span ≤ 4).** Two labels span a subspace of rank ≤ 2, hence size ≤ 4. + +**Lemma (coset union ≤ 8).** Pairing with short `(0,σ)` reaches at most +`span ∪ (span ⊕ σ)`, size ≤ 8 < 32. Dual covering is therefore impossible. + +**Census.** Exact covering count **0** (machine-checked on all `930·31` +pairs). Shape `{4,1}` is exhaustively checked never to restore. + +## Fixture B: partition `(3,5)` + +Short walk: distinct-label length-3 (`C(31,2)=465` even tables). Long walk: +excess 3 on four nonzero slots forces shape `{d:4}`. + +Any ordering of `(0,d,d,d,d)` has an adjacent zero-XOR edge on the closed walk. + +**Census.** Valid three-repeat length-5 walks: **0**. Covering count **0**. + +## Fixture C: partition `(4,4)` + +Three nonzero slots admit at most excess `2` (shape `{d:3}`). Excess `3` is +impossible on length-4. + +**Census.** Valid three-repeat length-4 walks: **0**. Covering count **0**. + +## Tariff consequence + +No covering three-repeat partitioned dual exists at `Q=8`. There is therefore +no dirt-legal `R` and no complete-call tariff in this alphabet that can undercut +the six-query endpoint `436`. By comparison: + +| Alphabet | Covering min R | Tariff floor (X=0) | Undercuts 436? | +|---|---:|---:|---| +| Distinct partitioned (`#2851`) | 92 | 488 | no | +| One-repeat partitioned (pending) | 112 | 528 | no | +| Two-repeat partitioned (pending) | — (covering 0) | — | no | +| Shared-dirt partitioned (pending) | 82 | 468 | no | +| **Three-repeat partitioned (this)** | **— (covering 0)** | **—** | **no** | + +## Scope limits + +- Fixes the **three-repeat** (excess-3) partitioned independent-walk interface at + total `Q=8`. Same-walk, dirty-shadow, distinct partitioned, one-repeat, + two-repeat, and shared-dirt leave-alones / pending tips are outside and not + edited. +- Soft-overlap with pending shared-dirt is avoided: this package does not couple + dirt coefficients (R-side shared-dirt) and stays on the independent excess + axis. +- Transfer-coupled dual/shapes, shared-XOR, and host screens remain deferred + soft-overlaps and are not opened. +- No new kappa and no multiplication theorem are claimed. + +## Relation to predecessors + +| Prior | Already proves | This package adds | +|---|---|---| +| PR1898 | Min `Q=6`, endpoint tariff 436, `(b,a,x)=(38,2,2)` | — | +| #2851 | Partitioned independent dual at `Q=8` has `R≥92` | — | +| pending onerepeat / tworepeat | Excess-1 / excess-2 companions | — | +| pending shared-dirt | Shared-dirt `R≥82`; OQ1 asks for fifth alphabet | — | +| **This** | — | **Three-repeat dual at `Q=8` has covering 0 on all shapes; cannot undercut 436; answers next19 / shared-dirt OQ1 without competing with shared-dirt** | diff --git a/research/independent-walks-threerepeat-8q/README.md b/research/independent-walks-threerepeat-8q/README.md new file mode 100644 index 0000000000..fc9eaf48ec --- /dev/null +++ b/research/independent-walks-threerepeat-8q/README.md @@ -0,0 +1,86 @@ +# Three-repeat partitioned-walk obstruction at eight queries + +**Scoped obstruction / priced alphabet; no new kappa.** Freestanding +`#840`-style priced obstruction under +[#1898](https://github.com/CrocSwap/integer-mult-bounds/pull/1898) at +`(b,a,x)=(38,2,2)`. Names one new dirt-legal readout alphabet at `Q=8` beyond +same-walk / dirty-shadow / partitioned dual / one-repeat / two-repeat / +shared-dirt: **three-repeat** (excess-3) layers inside partitioned independent +duals on shapes `(2,6)`, `(3,5)`, and `(4,4)`. Answers preferred next19 and +open question 1 of pending `cursor/shared-dirt-walks-8q-60b9@fc3a2cb3`. + +| Dual schedule | Valid objects | Exact covering | Undercuts 436? | +|---|---:|---:|---| +| Distinct partitioned (#2851) | — | min R=92 | no | +| One-repeat (pending tips) | — | min R=112 | no | +| Two-repeat (pending) | — | 0 | no | +| Shared-dirt (pending) | — | min R=82 | no | +| Three-repeat `(2,6)` | **930** walks | **0** | **no** | +| Three-repeat `(3,5)` | **0** multisets | **0** | **no** | +| Three-repeat `(4,4)` | **0** walks | **0** | **no** | + +Span lemmas: `(2,6)` long span ≤4 so coset union ≤8; `(3,5)` shape `{d:4}` +never restores; `(4,4)` excess 3 impossible on length-4. No covering `R` +exists, so the alphabet cannot undercut tariff `436`. Soft-overlap with +pending shared-dirt is avoided (independent excess axis; no dirt coupling). + +## Reproduction + +```sh +python3.12 -I -B research/independent-walks-threerepeat-8q/verify.py +python3.12 -I -O -B research/independent-walks-threerepeat-8q/verify.py +python3.12 -I -B research/independent-walks-threerepeat-8q/independent.py +python3.12 -I -B research/independent-walks-threerepeat-8q/test_package.py +python3.12 -B scripts/research_package.py --package research/independent-walks-threerepeat-8q +``` + +Expected: + +```text +PASS_INDEPENDENT_WALKS_THREEREPEAT_8Q_OBSTRUCTION covering_26=0 covering_35=0 covering_44=0 ... answers_fifth_priced_alphabet_q8 no_undercut_436 no_new_kappa +PASS_INDEPENDENT_WALKS_THREEREPEAT_8Q covering_26=0 covering_35=0 ... answers_fifth_priced_alphabet_q8 no_undercut_436 no_new_kappa +PASS_INDEPENDENT_WALKS_THREEREPEAT_8Q_PACKAGE_TESTS groups=6 +PASS_REGISTERED_RESEARCH_PACKAGE research/independent-walks-threerepeat-8q outcome=completed +``` + +Default verify is read-only. Admission uses `need()`; `-O` also passes. + +## Overlap + +Base commit `0b1cccf86e2f5132ed286a26ef0a681a495740ea`. Direct predecessors: +PR1898, #2851 (distinct partitioned dual at Q=8), pending onerepeat / +tworepeat / shared-dirt tips, #2846/#2840/#2779/#2677. Leave-alone through +#2861 including #2860, #2858, #2851, #2846, #2840, #2836, #2817, #2779, +#2764, #2761 is respected; those packages are not edited. Pending +`cursor/shared-dirt-walks-8q-60b9@fc3a2cb3` is not edited or competed +(OQ1 answered here on a non-competing excess axis). Deferred soft-overlaps +(transfer-coupled-dual/shapes; shared-xor; host screens) are not opened. + +## Open next questions + +1. Does any sixth priced readout alphabet under PR1898 `(b,a,x)=(38,2,2)` + (beyond same-walk / dirty-shadow / partitioned dual / one-repeat / + two-repeat / shared-dirt / three-repeat) undercut `436` at `Q=8`? + Why it matters: remaining unequal-price handoff after three-repeat is closed. + First step: name one new alphabet outside leave-alones and census dirt-legal R. + Blocked by: leave-alones through #2861/#2860/#2858/#2851; pending shared-dirt; + deferred soft-overlaps. +2. Does a Q=9 partitioned independent dual companion undercut tariff `436` + (beyond the same-walk Q=9 floor `466` of #2677)? + Why it matters: extends the partitioned dual alphabet off the Q=8 leave-alone + cluster without competing with shared-dirt. + First step: census distinct-label partitions `(2,7)`/`(3,6)`/`(4,5)`. + Blocked by: larger search; expected not to undercut 436 if R≥62. + +## Credit + +Credit **Arham Tahir / PR1898**, **ywz65 / PR2455**, **PR1370**, fork **789q** / +**#2677**, **#2779**, open **#2851** / **#2861** / **#2860** / **#2858** +(leave-alone; not edited), pending shared-dirt tip (OQ1 answered here; not +edited or competed), open **#2846** / **#2840** / **#2836** / **#2817** / +**#2764** / **#2761** (leave-alone), **TennisBowling / PR1524**, **Ross +Richardson / PR943**, and the retained mutable-source lineage. Live input pin: +`research/mutable-source-shear-cost/CERTIFICATE.json`. Prepared by Wentao Li +([VictorLiwentao](https://github.com/VictorLiwentao), +[@Is__Victor](https://x.com/Is__Victor)) with substantial AI assistance. +Apache-2.0. No independent human review or multiplication theorem is claimed. diff --git a/research/independent-walks-threerepeat-8q/SOURCES.json b/research/independent-walks-threerepeat-8q/SOURCES.json new file mode 100644 index 0000000000..719b378cbd --- /dev/null +++ b/research/independent-walks-threerepeat-8q/SOURCES.json @@ -0,0 +1,24 @@ +{ + "schema_version": 1, + "base_commit": "0b1cccf86e2f5132ed286a26ef0a681a495740ea", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "06c96f5579bb67ed1b86d334e78fbed7da6945f1", + "sha256": "6686ad58f1fbdbc87134a78901b60fd53a20d3984355e91defbbebc9e9fa8075" + }, + { + "path": "research/mutable-source-shear-cost/CERTIFICATE.json", + "usage": "input", + "git_blob": "48958451bc819f2caa13bf3d9609423706ffb8a0", + "sha256": "665435375c025bbcf69eadf43bd9aeae44eb12fefdf12a78d5bfd66abde4ae3c" + } + ] +} diff --git a/research/independent-walks-threerepeat-8q/TASK.json b/research/independent-walks-threerepeat-8q/TASK.json new file mode 100644 index 0000000000..202b23b8b2 --- /dev/null +++ b/research/independent-walks-threerepeat-8q/TASK.json @@ -0,0 +1,108 @@ +{ + "schema_version": 1, + "task_id": "connector-alphabet-change", + "priority_revision": 4, + "base_commit": "0b1cccf86e2f5132ed286a26ef0a681a495740ea", + "original_card": { + "id": "connector-alphabet-change", + "question": "Does one explicit extension of the connector alphabet offer a favorable completed budget?", + "starting_points": [ + "research/universal-connector-boundary/README.md", + "certificates/selected-result.json" + ], + "methods": [ + "Construct and charge a legal extra operation on a minimal instance.", + "Prove a target-specific bound after adding one specified operation family." + ], + "acceptance_gate": "State which fixed-alphabet premise changes and charge its implementation; do not declare it free.", + "first_step": { + "command": [ + "python3", + "-B", + "research/universal-connector-boundary/verify.py" + ], + "expected": "PASS_UNIVERSAL_CONNECTOR_BOUNDARY", + "inspect": "Reproduce the 945-pairing control, then read Exact interface to list the allowed calls.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Add exactly one legally priced operation and test a tiny dirty-input instance before enumerating larger cases.", + "bottleneck_link": "A new legal connector operation could change recursive interface cost; a larger census in the same alphabet is a separate side result.", + "allowed_variations": [ + "Choose one additional operation and a small source count for its first counterexample." + ], + "scope_change_triggers": [ + "Keeping the alphabet and only increasing the source count; record this as a changed assignment." + ], + "overlap_terms": [ + "universal connector", + "source-toggle", + "connector alphabet" + ] + }, + "scope_status": "changed", + "actual_scope": "Freestanding #840-style priced obstruction under PR1898 (b,a,x)=(38,2,2): name the three-repeat (excess-3) partitioned independent dual alphabet at total Q=8 on shapes (2,6)/(3,5)/(4,4), show exact covering census 0 on every shape and therefore no undercut of tariff 436, answering preferred next19 / shared-dirt OQ1 (fifth priced alphabet) without editing leave-alones through #2861/#2860/#2858/#2851 or pending shared-dirt tip, and without soft-competing with shared-dirt (excess axis / independent dirt).", + "scope_change_reason": "The drawn connector-alphabet card is redirected to the explicit remaining freestanding Q=8 fifth-alphabet handoff left by pending shared-dirt-walks-8q OQ1 on the #1898 lineage, using a new package name outside hard leave-alones through #2861/#2860/#2858/#2851, pending shared-dirt tip, and deferred transfer-coupled-dual/shapes / shared-XOR / host-screen soft-overlaps.", + "bottleneck_link": "A priced three-repeat companion of the partitioned dual at Q=8 decides whether relaxing beyond two-repeat / shared-dirt on the independent-excess axis reopens an undercut of the six-query endpoint after the distinct / one-repeat / two-repeat / shared-dirt / dirty-shadow collapses.", + "budget_minutes": 60, + "stop_rule": "Stop after (2,6)/(3,5)/(4,4) three-repeat covering censuses, span lemmas, tariff consequence, package tests; no leave-alone reopen, no pending shared-dirt edit/compete, no shared-XOR reopening, no host screens.", + "outcome": "completed", + "evidence": "CERTIFICATE.json covering_26=0 (valid 930; only {3,2}; {4,1}:0); covering_35=0 ({d:4} never restores); covering_44=0 (excess 3 impossible on L4); span≤4 / coset≤8; no undercut 436; independent checker; corruption controls.", + "author": "Wentao Li", + "ai_assistance": "Substantial AI assistance for derivation, implementation, checking and writing.", + "open_questions": [ + { + "question": "Does any sixth priced readout alphabet under PR1898 (b,a,x)=(38,2,2) (beyond same-walk / dirty-shadow / partitioned dual / one-repeat / two-repeat / shared-dirt / three-repeat) undercut 436 at Q=8?", + "why_it_matters": "Remaining unequal-price handoff after three-repeat is closed.", + "first_step": "Name one new alphabet outside leave-alones and census dirt-legal R.", + "blocked_by": "Leave-alones through #2861/#2860/#2858/#2851; pending shared-dirt tip; deferred soft-overlaps." + }, + { + "question": "Does a Q=9 partitioned independent dual companion undercut tariff 436 (beyond the same-walk Q=9 floor 466 of #2677)?", + "why_it_matters": "Extends the partitioned dual alphabet off the Q=8 leave-alone cluster without competing with shared-dirt.", + "first_step": "Census distinct-label partitions (2,7)/(3,6)/(4,5) for covering min R.", + "blocked_by": "Larger search; expected tariff floor ≥466 even at X=0 if R≥62." + } + ], + "predecessors": [ + { + "pr": 1898, + "credit": "Arham Tahir; minimum-query endpoint and abstract tariff fixture" + }, + { + "pr": 2861, + "credit": "Wentao Li; one-repeat (2,6) at Q=8; leave-alone; not edited" + }, + { + "pr": 2860, + "credit": "Wentao Li; two-repeat at Q=8; leave-alone; not edited" + }, + { + "pr": 2858, + "credit": "Wentao Li; one-repeat (3,5)/(4,4) at Q=8; leave-alone; not edited" + }, + { + "pr": 2851, + "credit": "Wentao Li; distinct partitioned dual at Q=8; leave-alone; not edited" + }, + { + "ref": "cursor/shared-dirt-walks-8q-60b9@fc3a2cb3", + "credit": "Wentao Li; shared-dirt at Q=8; OQ1 answered here; leave-alone; not edited or competed" + }, + { + "pr": 2846, + "credit": "Wentao Li; transfer-coupled onerepeat at Q=7; leave-alone" + }, + { + "pr": 2840, + "credit": "Wentao Li; dirty-shadow at Q=8; leave-alone" + }, + { + "pr": 2779, + "credit": "Wentao Li; partitioned independent walks at Q=7" + }, + { + "pr": 2677, + "credit": "Wentao Li; Q=7–9 invoice / distinct-slot Q=8 baseline" + } + ] +} diff --git a/research/independent-walks-threerepeat-8q/VERIFY.json b/research/independent-walks-threerepeat-8q/VERIFY.json new file mode 100644 index 0000000000..a6c0abfc21 --- /dev/null +++ b/research/independent-walks-threerepeat-8q/VERIFY.json @@ -0,0 +1,52 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/mutable-source-shear-cost/CERTIFICATE.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Three-repeat (2,6)/(3,5)/(4,4) dual censuses; span lemmas; covering 0; certificate match; source pins" + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Same admission under PYTHONOPTIMIZE via need()" + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/independent.py" + ], + "timeout_seconds": 180, + "checks": "Separate three-repeat dual census, covering 0, tariff consequence" + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/test_package.py" + ], + "timeout_seconds": 600, + "checks": "Corruption rejection, duplicate JSON keys, -O controls, independent replay" + } + ] +} diff --git a/research/independent-walks-threerepeat-8q/independent.py b/research/independent-walks-threerepeat-8q/independent.py new file mode 100644 index 0000000000..6a9a0cbe86 --- /dev/null +++ b/research/independent-walks-threerepeat-8q/independent.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python3 +"""Independent three-repeat partitioned dual census at Q=8. + +Does not import model.py or verify.py. Prepared by Wentao Li with substantial +AI assistance. Apache-2.0. +""" +from __future__ import annotations + +import json +from collections import Counter +from itertools import combinations, permutations +from pathlib import Path + +HERE = Path(__file__).resolve().parent +CERT_PATH = HERE / "CERTIFICATE.json" +INF = 99 + +EXPECTED_26_COVERING = 0 +EXPECTED_35_COVERING = 0 +EXPECTED_44_VALID = 0 +EXPECTED_26_WALKS = 930 +EXPECTED_26_32 = 930 +EXPECTED_35_MULTISETS = 0 +ENDPOINT = 436 + + +def fail(message): + raise SystemExit(f"FAIL_INDEPENDENT: {message}") + + +def even_table(slots): + n = len(slots) + even = [INF] * 32 + even[0] = 0 + for bits in range(1, 1 << n): + size = bits.bit_count() + if size % 2: + continue + value = 0 + for i in range(n): + if bits >> i & 1: + value ^= slots[i] + if size < even[value]: + even[value] = size + return even + + +def dual_R(e0, e1): + reach0 = [(a, e0[a]) for a in range(32) if e0[a] < INF] + total = 0 + for m in range(1, 32): + best = INF + for a, c0 in reach0: + c1 = e1[a ^ m] + if c1 < INF: + best = min(best, c0 + c1) + if best >= INF: + return None + total += best + return total + + +def path_X(slots): + closed = slots + (0,) + total = 0 + for a, b in zip(closed, closed[1:]): + delta = a ^ b + if delta == 0: + return None + total += 2 * (delta.bit_count() - 1) + return total + + +def find_restoring(multiset_nz): + for perm in set(permutations(multiset_nz)): + walk = (0,) + perm + if path_X(walk) is not None: + return walk + return None + + +def gf2_span(vals): + basis = [] + for v in vals: + x = v + for b in basis: + x = min(x, x ^ b) + if x: + basis.append(x) + basis.sort(reverse=True) + span = {0} + for b in basis: + span |= {s ^ b for s in span} + return frozenset(span), len(basis) + + +def slots_from_ms(ms): + nz = [] + for lab, cnt in sorted(Counter(ms).items()): + nz.extend([lab] * cnt) + return (0,) + tuple(nz) + + +def census_26(): + walks = [] + for d, e in combinations(range(1, 32), 2): + for triple, pair in ((d, e), (e, d)): + w = find_restoring((triple, triple, triple, pair, pair)) + if w is None: + fail("{3,2} should restore") + walks.append(w) + for d in range(1, 32): + for o in range(1, 32): + if o == d: + continue + if find_restoring((d, d, d, d, o)) is not None: + fail("{4,1} should never restore") + if len(walks) != EXPECTED_26_32: + fail(f"32 count {len(walks)}") + if len(walks) != EXPECTED_26_WALKS: + fail(f"walks {len(walks)}") + covering = 0 + for walk in walks: + span, rank = gf2_span(walk) + if rank > 2 or len(span) > 4: + fail("span bound") + e1 = even_table(slots_from_ms(walk[1:])) + for sigma in range(1, 32): + if dual_R(even_table((0, sigma)), e1) is not None: + covering += 1 + if covering != EXPECTED_26_COVERING: + fail(f"26 covering {covering}") + return covering, len(walks) + + +def census_35(): + valid = 0 + for d in range(1, 32): + if find_restoring((d, d, d, d)) is not None: + valid += 1 + if valid != EXPECTED_35_MULTISETS: + fail(f"35 multisets {valid}") + covering = 0 + if covering != EXPECTED_35_COVERING: + fail(f"35 covering {covering}") + return covering, valid + + +def census_44(): + valid = 0 + for d in range(1, 32): + for e in range(1, 32): + for f in range(1, 32): + walk = (0, d, e, f) + if path_X(walk) is None: + continue + counts = Counter(walk[1:]) + excess = sum(c - 1 for c in counts.values()) + if excess == 3: + valid += 1 + if valid != EXPECTED_44_VALID: + fail(f"44 valid {valid}") + return valid + + +def main(): + pinned = json.loads(CERT_PATH.read_text(encoding="utf-8")) + c26, n26 = census_26() + c35, n35 = census_35() + v44 = census_44() + claim = pinned["claim"] + if claim["three_repeat_26_covering"] != c26: + fail("26 claim drift") + if claim["three_repeat_35_covering"] != c35: + fail("35 claim drift") + if claim["three_repeat_44_valid_walks"] != v44: + fail("44 claim drift") + if claim["undercuts_436_after_complete_bill"] is not False: + fail("undercut claim") + if claim["endpoint_Q6_tariff"] != ENDPOINT: + fail("endpoint") + if claim.get("answers_fifth_priced_alphabet_q8") is not True: + fail("fifth alphabet flag") + print( + "PASS_INDEPENDENT_WALKS_THREEREPEAT_8Q", + f"covering_26={c26}", + f"covering_35={c35}", + f"valid_26={n26}", + f"multisets_35={n35}", + f"valid_44={v44}", + "tariff_floor=None", + "answers_fifth_priced_alphabet_q8", + "no_undercut_436", + "no_new_kappa", + ) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/research/independent-walks-threerepeat-8q/model.py b/research/independent-walks-threerepeat-8q/model.py new file mode 100644 index 0000000000..208c2486db --- /dev/null +++ b/research/independent-walks-threerepeat-8q/model.py @@ -0,0 +1,335 @@ +"""Three-repeat partitioned independent-walk duals at Q=8. + +Names one freestanding priced readout alphabet under PR1898 +(b,a,x)=(38,2,2) beyond same-walk / dirty-shadow / partitioned dual / +one-repeat / two-repeat / shared-dirt: the three-repeat (excess-3) +companion of partitioned independent duals on shapes (2,6), (3,5), and +(4,4). + +Answers preferred next19 / shared-dirt OQ1 without editing leave-alones +through #2861/#2860/#2858/#2851 or pending shared-dirt tip. + +Self-contained relative to PR1898 / #2779 / iw8q / excess-repeat lineage. +Prepared by Wentao Li with substantial AI assistance. Apache-2.0. +""" +from __future__ import annotations + +from collections import Counter +from itertools import combinations, permutations + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +INF = 99 + +EXPECTED = { + "Q": 8, + "distinct_26_min_R": 92, + "distinct_35_min_R": 98, + "distinct_44_min_R": 100, + "one_repeat_26_min_R": 112, + "one_repeat_35_min_R": 112, + "one_repeat_44_min_R": 112, + "two_repeat_26_covering": 0, + "two_repeat_35_covering": 0, + "two_repeat_44_covering": 0, + "shared_dirt_partition_min_R": 82, + "partition_26_covering": 0, + "partition_26_valid_walks": 930, + "partition_26_shape_32": 930, + "partition_26_shape_41": 0, + "partition_35_covering": 0, + "partition_35_valid_multisets": 0, + "partition_35_shape_4_never_restores": 0, + "partition_35_short_tables": 465, + "partition_44_covering": 0, + "partition_44_valid_walks": 0, + "length4_three_repeat_valid": 0, + "tariff_floor_at_X0": None, + "endpoint_tariff_Q6": 436, + "undercuts_436": False, +} + + +def tariff_qrx(q, r, x, extra=0): + """Abstract complete-call tariff at (b,a,x)=(38,2,2), plus optional extras.""" + leaves = 28 * q + r + nodes = 9 * q + dispatch = q + r + x + return leaves + nodes + x + dispatch + extra + + +def even_table(slots): + need(type(slots) is tuple and slots and slots[0] == 0, "slots must start at 0") + n = len(slots) + even = [INF] * 32 + even[0] = 0 + for bits in range(1, 1 << n): + size = bits.bit_count() + if size % 2: + continue + value = 0 + for i in range(n): + if bits >> i & 1: + value ^= slots[i] + if size < even[value]: + even[value] = size + return even + + +def dual_independent_R(e0, e1): + """Σ_m min_a (e0[a] + e1[a⊕m]) with independent even-parity ports.""" + reach0 = [(a, e0[a]) for a in range(32) if e0[a] < INF] + total = 0 + for m in range(1, 32): + best = INF + for a, c0 in reach0: + c1 = e1[a ^ m] + if c1 < INF: + cost = c0 + c1 + if cost < best: + best = cost + if best >= INF: + return None + total += best + return total + + +def path_X(slots): + closed = slots + (0,) + total = 0 + for a, b in zip(closed, closed[1:]): + delta = a ^ b + if delta == 0: + return None + total += 2 * (delta.bit_count() - 1) + return total + + +def valid_restored_walk(slots): + if type(slots) is not tuple or not slots or slots[0] != 0: + return False + if len(slots) < 2: + return False + return path_X(slots) is not None + + +def gf2_span(vals): + basis = [] + for v in vals: + x = v + for b in basis: + x = min(x, x ^ b) + if x: + basis.append(x) + basis.sort(reverse=True) + span = {0} + for b in basis: + span |= {s ^ b for s in span} + return frozenset(span), len(basis) + + +def excess_nonzero(slots): + """Σ (count−1) over nonzero labels; three-repeat has excess 3.""" + need(type(slots) is tuple and slots and slots[0] == 0, "slots form") + return sum(c - 1 for c in Counter(slots[1:]).values()) + + +def is_three_repeat_nonzero(slots): + return excess_nonzero(slots) == 3 + + +def find_restoring(multiset_nz): + for perm in set(permutations(multiset_nz)): + walk = (0,) + perm + if path_X(walk) is not None: + return walk + return None + + +def slots_from_multiset(ms): + nz = [] + for lab, cnt in sorted(Counter(ms).items()): + nz.extend([lab] * cnt) + return (0,) + tuple(nz) + + +def three_repeat_l6_walks(): + """Restoring three-repeat length-6 walks: only shape {3,2} restores. + + Excess 3 on five nonzero slots forces exactly two distinct labels. + Shapes: {d:3,e:2} (restores) and {d:4,o} (never restores: adjacent d→d). + """ + walks_32 = [] + for d, e in combinations(range(1, 32), 2): + for triple, pair in ((d, e), (e, d)): + walk = find_restoring((triple, triple, triple, pair, pair)) + need(walk is not None, "{3,2} should restore") + need(is_three_repeat_nonzero(walk), "excess 3") + walks_32.append(walk) + # Shape {4,1} never restores. + never_41 = 0 + for d in range(1, 32): + for o in range(1, 32): + if o == d: + continue + need(find_restoring((d, d, d, d, o)) is None, "{4,1} never restores") + never_41 += 1 + need(never_41 == 930, "{4,1} enumeration") + need(len(walks_32) == EXPECTED["partition_26_shape_32"], "32 count") + need(EXPECTED["partition_26_shape_41"] == 0, "41 valid is 0") + need(len(walks_32) == EXPECTED["partition_26_valid_walks"], "L6 total") + return walks_32 + + +def three_repeat_l5_never_restores(): + """Three-repeat length-5 is shape {d:4}; closed walk always has a zero edge.""" + valid = 0 + for d in range(1, 32): + if find_restoring((d, d, d, d)) is not None: + valid += 1 + need(valid == EXPECTED["partition_35_shape_4_never_restores"], "L5 {4}") + return valid + + +def length4_three_repeat_count(): + """Length-4 cannot host excess 3 (3 nonzero slots ⇒ max excess 2).""" + # Exhaustive: every 3-slot multiset with excess 3 is impossible, so 0. + # Max excess shapes on L4: {d:3} has excess 2 (two-repeat). + valid = 0 + for d in range(1, 32): + # No multiset of size 3 has excess 3; check vacuously that no + # restoring walk of length 4 has excess 3. + for e in range(1, 32): + for f in range(1, 32): + walk = (0, d, e, f) + if path_X(walk) is not None and excess_nonzero(walk) == 3: + valid += 1 + need(valid == EXPECTED["length4_three_repeat_valid"], "L4 three-repeat") + return valid + + +def structural_rank_bound_l6(walk): + """Three-repeat L6 has exactly 2 distinct nonzero labels ⇒ rank ≤2 ⇒ |span|≤4.""" + labels = set(walk[1:]) + need(len(labels) == 2, "three-repeat L6 exactly 2 labels") + span, rank = gf2_span(walk) + need(rank <= 2, "rank ≤2") + need(len(span) <= 4, "|span|≤4") + return span, rank + + +def census_three_repeat_26(): + """Short (0,σ) × three-repeat length-6; covering count 0 by span lemma + census.""" + walks_32 = three_repeat_l6_walks() + for walk in walks_32: + structural_rank_bound_l6(walk) + covering = 0 + hist = Counter() + for walk in walks_32: + e1 = even_table(slots_from_multiset(walk[1:])) + span, _rank = gf2_span(walk) + need(len(span) <= 4, "span bound") + for sigma in range(1, 32): + e0 = even_table((0, sigma)) + # Coset bound: reachable masks ⊆ span ∪ (span ⊕ σ). + union = span | {v ^ sigma for v in span} + need(len(union) <= 8, "coset union ≤8") + r = dual_independent_R(e0, e1) + if r is not None: + covering += 1 + hist[r] += 1 + need(covering == EXPECTED["partition_26_covering"], "26 covering") + need(len(hist) == 0, "26 empty spectrum") + return { + "kind": "three_repeat_partition_2_plus_6", + "Q": 8, + "valid_walks": len(walks_32), + "shape_32": len(walks_32), + "shape_41": 0, + "covering_pairs": covering, + "attainable_R": [], + "histogram": {}, + "min_R": None, + "structural_max_span": 4, + "structural_max_coset_union": 8, + "first_witnesses": {}, + } + + +def census_three_repeat_35(): + """Distinct length-3 × three-repeat length-5 {4}; covering count 0 (never restores).""" + tables3 = [even_table((0,) + nz) for nz in combinations(range(1, 32), 2)] + need(len(tables3) == EXPECTED["partition_35_short_tables"], "L3 count") + valid5 = three_repeat_l5_never_restores() + need(valid5 == EXPECTED["partition_35_valid_multisets"], "35 valid") + covering = 0 + # Vacuous dual: no three-repeat L5 restoring multiset exists. + need(covering == EXPECTED["partition_35_covering"], "35 covering") + return { + "kind": "three_repeat_partition_3_plus_5", + "Q": 8, + "short_tables": len(tables3), + "long_multisets": valid5, + "covering_pairs": covering, + "attainable_R": [], + "histogram": {}, + "min_R": None, + "note": "shape_{d:4}_never_restores", + "structural_max_label_count_long": 1, + "first_witnesses": {}, + } + + +def census_three_repeat_44(): + """Three-repeat length-4 is impossible; covering count 0 vacuously.""" + valid = length4_three_repeat_count() + need(valid == EXPECTED["partition_44_valid_walks"], "44 valid") + return { + "kind": "three_repeat_partition_4_plus_4", + "Q": 8, + "valid_three_repeat_l4_walks": valid, + "covering_pairs": 0, + "attainable_R": [], + "histogram": {}, + "min_R": None, + "note": "excess_3_impossible_on_length4_max_excess_2", + "first_witnesses": {}, + } + + +def champion_analysis(): + """No covering champion; record tariff consequence and comparison floors.""" + need(EXPECTED["partition_26_covering"] == 0, "26 cover") + need(EXPECTED["partition_35_covering"] == 0, "35 cover") + need(EXPECTED["partition_44_covering"] == 0, "44 cover") + need(EXPECTED["undercuts_436"] is False, "no undercut") + endpoint = EXPECTED["endpoint_tariff_Q6"] + need(endpoint == 436, "endpoint") + need(tariff_qrx(8, 92, 0) == 488, "distinct 26 floor sanity") + need(tariff_qrx(8, 112, 0) == 528, "one-repeat floor sanity") + need(tariff_qrx(8, 82, 0) == 468, "shared-dirt floor sanity") + return { + "covering_any_partition": False, + "tariff_floor_at_X0": None, + "endpoint_Q6": endpoint, + "undercuts_436_after_complete_bill": False, + "distinct_26_min_R": EXPECTED["distinct_26_min_R"], + "distinct_35_min_R": EXPECTED["distinct_35_min_R"], + "distinct_44_min_R": EXPECTED["distinct_44_min_R"], + "one_repeat_26_min_R": EXPECTED["one_repeat_26_min_R"], + "one_repeat_35_min_R": EXPECTED["one_repeat_35_min_R"], + "one_repeat_44_min_R": EXPECTED["one_repeat_44_min_R"], + "two_repeat_26_covering": EXPECTED["two_repeat_26_covering"], + "shared_dirt_partition_min_R": EXPECTED["shared_dirt_partition_min_R"], + "three_repeat_covering_min_R": None, + "comparison_tariffs": { + "distinct_26_at_R92_X0": tariff_qrx(8, 92, 0), + "one_repeat_at_R112_X0": tariff_qrx(8, 112, 0), + "shared_dirt_at_R82_X0": tariff_qrx(8, 82, 0), + "endpoint_Q6": endpoint, + }, + } diff --git a/research/independent-walks-threerepeat-8q/test_package.py b/research/independent-walks-threerepeat-8q/test_package.py new file mode 100644 index 0000000000..289f74dde7 --- /dev/null +++ b/research/independent-walks-threerepeat-8q/test_package.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python3 +"""Package fault controls for independent-walks threerepeat 8q. Wentao Li + AI.""" +from __future__ import annotations + +import json +import shutil +import subprocess +import sys +import tempfile +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +PKG_NAME = "independent-walks-threerepeat-8q" + + +def need(ok, message): + if not ok: + raise SystemExit(f"FAIL_TEST: {message}") + + +def run(args, cwd=None): + return subprocess.run(args, cwd=cwd or ROOT, text=True, capture_output=True) + + +def main(): + # 1) Default read-only verify. + proc = run([sys.executable, "-I", "-B", str(HERE / "verify.py")]) + need(proc.returncode == 0, proc.stderr + proc.stdout) + need("PASS_INDEPENDENT_WALKS_THREEREPEAT_8Q_OBSTRUCTION" in proc.stdout, proc.stdout) + + # 2) -O admission via need(). + proc = run([sys.executable, "-I", "-O", "-B", str(HERE / "verify.py")]) + need(proc.returncode == 0, proc.stderr + proc.stdout) + need("PASS_INDEPENDENT_WALKS_THREEREPEAT_8Q_OBSTRUCTION" in proc.stdout, proc.stdout) + + # 3) Certificate claim corruption fails. + with tempfile.TemporaryDirectory() as tmp: + tmp_path = Path(tmp) + research = tmp_path / "research" / PKG_NAME + shutil.copytree(HERE, research) + pinned = tmp_path / "research" / "mutable-source-shear-cost" + pinned.mkdir(parents=True) + shutil.copy2( + ROOT / "research" / "mutable-source-shear-cost" / "CERTIFICATE.json", + pinned / "CERTIFICATE.json", + ) + cert = research / "CERTIFICATE.json" + data = json.loads(cert.read_text(encoding="utf-8")) + data["claim"]["three_repeat_26_covering"] = 1 + cert.write_text(json.dumps(data, indent=2) + "\n", encoding="utf-8") + proc = run([sys.executable, "-I", "-B", str(research / "verify.py")], cwd=tmp_path) + need(proc.returncode != 0, "corrupted certificate should fail") + + # 4) Source pin corruption rejection. + with tempfile.TemporaryDirectory() as tmp: + tmp_path = Path(tmp) + research = tmp_path / "research" / PKG_NAME + shutil.copytree(HERE, research) + pinned = tmp_path / "research" / "mutable-source-shear-cost" + pinned.mkdir(parents=True) + src = ROOT / "research" / "mutable-source-shear-cost" / "CERTIFICATE.json" + (pinned / "CERTIFICATE.json").write_bytes(src.read_bytes() + b"\n") + proc = run([sys.executable, "-I", "-B", str(research / "verify.py")], cwd=tmp_path) + need(proc.returncode != 0, "source drift should fail") + + # 5) Independent checker. + proc = run([sys.executable, "-I", "-B", str(HERE / "independent.py")]) + need(proc.returncode == 0, proc.stderr + proc.stdout) + need("PASS_INDEPENDENT_WALKS_THREEREPEAT_8Q" in proc.stdout, proc.stdout) + + # 6) Duplicate JSON key rejection. + with tempfile.TemporaryDirectory() as tmp: + tmp_path = Path(tmp) + research = tmp_path / "research" / PKG_NAME + shutil.copytree(HERE, research) + pinned = tmp_path / "research" / "mutable-source-shear-cost" + pinned.mkdir(parents=True) + shutil.copy2( + ROOT / "research" / "mutable-source-shear-cost" / "CERTIFICATE.json", + pinned / "CERTIFICATE.json", + ) + cert = research / "CERTIFICATE.json" + raw = cert.read_text(encoding="utf-8") + corrupted = raw.replace( + '"schema_version": 1,', + '"schema_version": 1,\n "schema_version": 2,', + 1, + ) + need(corrupted != raw, "failed to inject duplicate key") + cert.write_text(corrupted, encoding="utf-8") + proc = run([sys.executable, "-I", "-B", str(research / "verify.py")], cwd=tmp_path) + need(proc.returncode != 0, "duplicate JSON key should fail") + + print("PASS_INDEPENDENT_WALKS_THREEREPEAT_8Q_PACKAGE_TESTS groups=6") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/research/independent-walks-threerepeat-8q/verify.py b/research/independent-walks-threerepeat-8q/verify.py new file mode 100644 index 0000000000..6a620cc70b --- /dev/null +++ b/research/independent-walks-threerepeat-8q/verify.py @@ -0,0 +1,235 @@ +#!/usr/bin/env python3 +"""Three-repeat partitioned independent-walks at Q=8; read-only default. + +Prepared by Wentao Li with substantial AI assistance. Apache-2.0. +""" +from __future__ import annotations + +import argparse +import hashlib +import json +import sys +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(HERE)) +from model import ( # noqa: E402 + EXPECTED, + census_three_repeat_26, + census_three_repeat_35, + census_three_repeat_44, + champion_analysis, + tariff_qrx, + valid_restored_walk, +) + +CERT_PATH = HERE / "CERTIFICATE.json" +SOURCES_PATH = HERE / "SOURCES.json" + + +def need(ok, message): + if not ok: + raise SystemExit(f"FAIL: {message}") + + +def sha256(path: Path) -> str: + return hashlib.sha256(path.read_bytes()).hexdigest() + + +def load_json_reject_duplicates(path: Path): + text = path.read_text(encoding="utf-8") + + def _hook(pairs): + out = {} + for key, value in pairs: + if key in out: + raise ValueError(f"duplicate JSON key {key!r} in {path}") + out[key] = value + return out + + return json.loads(text, object_pairs_hook=_hook) + + +def check_source_pins(): + sources = load_json_reject_duplicates(SOURCES_PATH) + for rec in sources["files"]: + if rec["usage"] != "input": + continue + live = ROOT / rec["path"] + need(live.is_file(), f"missing input {rec['path']}") + need(sha256(live) == rec["sha256"], f"source bytes mismatch: {rec['path']}") + + +def build_certificate(): + need(not valid_restored_walk((0,)), "length-1 invalid") + need(not valid_restored_walk((0, 1, 1, 1, 1)), "length-5 three-repeat invalid") + + census26 = census_three_repeat_26() + need(census26["covering_pairs"] == EXPECTED["partition_26_covering"], "26 covering") + need(census26["valid_walks"] == EXPECTED["partition_26_valid_walks"], "26 walks") + need(census26["shape_32"] == EXPECTED["partition_26_shape_32"], "32") + need(census26["shape_41"] == EXPECTED["partition_26_shape_41"], "41") + + census35 = census_three_repeat_35() + need(census35["covering_pairs"] == EXPECTED["partition_35_covering"], "35 covering") + need( + census35["long_multisets"] == EXPECTED["partition_35_valid_multisets"], + "35 multisets", + ) + + census44 = census_three_repeat_44() + need(census44["covering_pairs"] == EXPECTED["partition_44_covering"], "44 covering") + need( + census44["valid_three_repeat_l4_walks"] == EXPECTED["partition_44_valid_walks"], + "44 walks", + ) + + champ = champion_analysis() + need(champ["covering_any_partition"] is False, "no covering") + need(champ["undercuts_436_after_complete_bill"] is False, "no undercut") + need(champ["tariff_floor_at_X0"] is None, "no R floor") + + cert = { + "schema_version": 1, + "status": "PASS_INDEPENDENT_WALKS_THREEREPEAT_8Q_OBSTRUCTION", + "scope": ( + "Five-source common-B mutable-source Q/R/X alphabet (PR1898) at " + "(b,a,x)=(38,2,2). Freestanding three-repeat (excess-3) layers inside " + "partitioned independent dual walks at total Q=8 on shapes (2,6), " + "(3,5), and (4,4): every dual has covering count 0; no dirt-legal " + "covering schedule exists, so none undercuts tariff 436. Answers " + "preferred next19 / shared-dirt OQ1 (fifth priced alphabet) without " + "editing leave-alones through #2861/#2860/#2858/#2851 or pending " + "shared-dirt tip." + ), + "claim": { + "Q": 8, + "partitions": [[2, 6], [3, 5], [4, 4]], + "alphabet": "three_repeat_partitioned_independent_dual", + "three_repeat_26_covering": 0, + "three_repeat_26_valid_walks": EXPECTED["partition_26_valid_walks"], + "three_repeat_26_shape_32": EXPECTED["partition_26_shape_32"], + "three_repeat_26_shape_41": EXPECTED["partition_26_shape_41"], + "three_repeat_35_covering": 0, + "three_repeat_35_valid_multisets": EXPECTED["partition_35_valid_multisets"], + "three_repeat_44_covering": 0, + "three_repeat_44_valid_walks": 0, + "covering_min_R": None, + "tariff_floor_at_X0": None, + "endpoint_Q6_tariff": EXPECTED["endpoint_tariff_Q6"], + "undercuts_436_after_complete_bill": False, + "beats_distinct_floors": False, + "answers_fifth_priced_alphabet_q8": True, + "answers_shared_dirt_oq1_fifth_alphabet": True, + "soft_overlap_shared_dirt": "safe_independent_excess_axis_not_dirt_coupling", + "oq_answer": ( + "The named fifth priced readout alphabet under PR1898 " + "(b,a,x)=(38,2,2) beyond same-walk / dirty-shadow / partitioned " + "dual / one-repeat / two-repeat / shared-dirt is the three-repeat " + "(excess-3) companion of partitioned independent duals at Q=8. " + "Exact covering census: (2,6) covering 0 on 930 valid longs " + "(only shape {3,2}; {4,1} never restores; span ≤4 so coset union " + "≤8); (3,5) covering 0 because shape {d:4} never restores; (4,4) " + "covering 0 because excess 3 is impossible on length-4 (max " + "excess 2). No covering R exists, so the alphabet cannot undercut " + "tariff 436 after a complete dirty bill. Leave-alones through " + "#2861/#2860/#2858/#2851 and pending shared-dirt tip are not " + "reopened; soft-overlap with shared-dirt is avoided (excess axis, " + "independent dirt)." + ), + "no_new_kappa": True, + }, + "three_repeat_2_plus_6": census26, + "three_repeat_3_plus_5": census35, + "three_repeat_4_plus_4": census44, + "champion": champ, + "unit_tariff": {"b": 38, "a": 2, "x": 2}, + "tariff_check": { + "formula": "38*Q + 2*R + 2*X", + "three_repeat_covering_floor": None, + "distinct_26_at_R92_X0": tariff_qrx(8, 92, 0), + "one_repeat_at_R112_X0": tariff_qrx(8, 112, 0), + "shared_dirt_at_R82_X0": tariff_qrx(8, 82, 0), + "endpoint_Q6": EXPECTED["endpoint_tariff_Q6"], + }, + } + return cert + + +def compare_certificate(live, pinned): + need(live["status"] == pinned["status"], "status") + need(live["claim"] == pinned["claim"], "claim drift") + need( + live["three_repeat_2_plus_6"]["covering_pairs"] + == pinned["three_repeat_2_plus_6"]["covering_pairs"], + "26 covering drift", + ) + need( + live["three_repeat_2_plus_6"]["valid_walks"] + == pinned["three_repeat_2_plus_6"]["valid_walks"], + "26 walks drift", + ) + need( + live["three_repeat_3_plus_5"]["covering_pairs"] + == pinned["three_repeat_3_plus_5"]["covering_pairs"], + "35 covering drift", + ) + need( + live["three_repeat_3_plus_5"]["long_multisets"] + == pinned["three_repeat_3_plus_5"]["long_multisets"], + "35 multisets drift", + ) + need( + live["three_repeat_4_plus_4"]["covering_pairs"] + == pinned["three_repeat_4_plus_4"]["covering_pairs"], + "44 covering drift", + ) + need( + live["three_repeat_4_plus_4"]["valid_three_repeat_l4_walks"] + == pinned["three_repeat_4_plus_4"]["valid_three_repeat_l4_walks"], + "44 walks drift", + ) + need(live["tariff_check"] == pinned["tariff_check"], "tariff drift") + need( + live["champion"]["undercuts_436_after_complete_bill"] + == pinned["champion"]["undercuts_436_after_complete_bill"], + "undercut drift", + ) + + +def main(argv=None): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "--write-certificate", + action="store_true", + help="rewrite CERTIFICATE.json (maintenance only)", + ) + args = parser.parse_args(argv) + + check_source_pins() + live = build_certificate() + + if args.write_certificate: + CERT_PATH.write_text(json.dumps(live, indent=2) + "\n", encoding="utf-8") + print("WROTE_CERTIFICATE", CERT_PATH) + return 0 + + pinned = load_json_reject_duplicates(CERT_PATH) + compare_certificate(live, pinned) + claim = pinned["claim"] + print( + "PASS_INDEPENDENT_WALKS_THREEREPEAT_8Q_OBSTRUCTION", + f"covering_26={claim['three_repeat_26_covering']}", + f"covering_35={claim['three_repeat_35_covering']}", + f"covering_44={claim['three_repeat_44_covering']}", + f"valid_26={claim['three_repeat_26_valid_walks']}", + "answers_fifth_priced_alphabet_q8", + "no_undercut_436", + "no_new_kappa", + ) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) From 0aa5cf439fdf210a455b78b46b16b3c92ca38f87 Mon Sep 17 00:00:00 2001 From: Wentao Li Date: Thu, 15 Oct 2026 16:33:37 +0000 Subject: [PATCH 2/2] Docs: drop stale tip SHA from three-repeat 8q handoff Point MASTER-HANDOFF at branch HEAD only (post-squash), matching #2860/#2867 handoff style. Leave-alone through #2867. Prepared by Wentao Li with substantial AI assistance. --- research/independent-walks-threerepeat-8q/MASTER-HANDOFF.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/research/independent-walks-threerepeat-8q/MASTER-HANDOFF.md b/research/independent-walks-threerepeat-8q/MASTER-HANDOFF.md index 82f30fc3ed..11235be0fc 100644 --- a/research/independent-walks-threerepeat-8q/MASTER-HANDOFF.md +++ b/research/independent-walks-threerepeat-8q/MASTER-HANDOFF.md @@ -5,7 +5,7 @@ | Field | Value | |---|---| | Branch | `cursor/independent-walks-threerepeat-8q-60b9` | -| Tip SHA | branch HEAD (`git rev-parse HEAD` on this branch); research package commit `b299447020f4e64a0954cf1161f8a38f41435ce2` | +| Tip SHA | branch HEAD (`git rev-parse cursor/independent-walks-threerepeat-8q-60b9`) | | Package | `research/independent-walks-threerepeat-8q/` | | Claim | Freestanding `#840`-style priced alphabet: **three-repeat** (excess-3) partitioned independent dual at Q=8 under PR1898 `(b,a,x)=(38,2,2)` | | Result | Exact covering census **0** on `(2,6)` / `(3,5)` / `(4,4)`; cannot undercut tariff **436** | @@ -28,8 +28,7 @@ ## Leave-alone respected -Through #2861 / #2860 / #2858 / #2851; pending -`cursor/shared-dirt-walks-8q-60b9@fc3a2cb3`; #2846/#2840/#2836/#2817/#2779/ +Through #2867 / #2861 / #2860 / #2858 / #2851; #2846/#2840/#2836/#2817/#2779/ #2764/#2761; deferred soft-overlaps untouched. ## Verify gate