From e3b7120b259fe1fa1d620b00241f3fbc6e903987 Mon Sep 17 00:00:00 2001 From: Aaron Wang Date: Wed, 14 Oct 2026 16:15:29 -0400 Subject: [PATCH] Research: same-column rank-2 retiming capacity line at touch depth >= 2 (no new kappa) --- notes/task-card-agent40-rank2-touch.md | 102 +++++ .../README.md | 128 ++++++ .../RESULT.json | 168 ++++++++ .../SOURCES.json | 42 ++ .../TASK.json | 96 +++++ .../VERIFY.json | 25 ++ .../verify.py | 381 ++++++++++++++++++ 7 files changed, 942 insertions(+) create mode 100644 notes/task-card-agent40-rank2-touch.md create mode 100644 research/complex-rank2-touch-depth-seed06773f60/README.md create mode 100644 research/complex-rank2-touch-depth-seed06773f60/RESULT.json create mode 100644 research/complex-rank2-touch-depth-seed06773f60/SOURCES.json create mode 100644 research/complex-rank2-touch-depth-seed06773f60/TASK.json create mode 100644 research/complex-rank2-touch-depth-seed06773f60/VERIFY.json create mode 100644 research/complex-rank2-touch-depth-seed06773f60/verify.py diff --git a/notes/task-card-agent40-rank2-touch.md b/notes/task-card-agent40-rank2-touch.md new file mode 100644 index 0000000000..8a758b9333 --- /dev/null +++ b/notes/task-card-agent40-rank2-touch.md @@ -0,0 +1,102 @@ +# Task card — agent-40 — same-column rank-2 retiming fusion at touch depth ≥ 2 + +Task ID / proposed scope key: `complex-rank-shape-decoder` / drawn scope key +`cad3ba853d7f324f16fa`, refined to "same-column rank-1 climb-pair retiming fusion +at touch depth >= 2 on the pinned gauge44 local program" (scope status: refined; +the card's generic rank-shape question is unchanged, the object is this concrete +fusion family). + +Base commit: `0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2` (origin/main at entry). +Chooser OS nonce: `06773f60d3e6d07377dbdf84678e2c84` (unseeded draw, track +`complex-mechanisms`, priority revision 4, catalogue SHA-256 +`d46eb6d5b3e279428753d770653663fbdf1063e55c255ea073d768f344927ef7`, selected-record +SHA-256 `10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32`). + +Exact predecessors and dependency heads (local paths at the base commit): + +- `research/complex-rank2-retiming-seed73506/` (Cinna Davis, PR #1703): the + one-touch class (exactly one intervening scalar event) has 690 candidates per + direction and maximum 674 disjoint fusions, below the 720 needed for the 5% + gate. Its open question 1 asks for the larger chronological class and names + pairs with two intervening scalar operations as the first step. +- Discussion #1659 comment 18916048 (Navinor, PR #1671 lineage): for the 1,441 + consecutive same-column rank-(1,1) climb pairs, the intervening referencing + event counts are `{1: 690, 2: 473, 3: 136, 4: 66, 5: 72, >=6: 4}`; every one of + the 2,782 consecutive same-column climb pairs has at least one referencing + event between the climbs. +- `research/complex-local-word-ceiling/ceiling.py` (pinned engine, PR #1240 / + PR #1012 coverage identity). +- Adjacent, different families: `research/complex-gather-child-seed7a6d` + (PR #1814, consecutive 3-source gather windows), `research/complex-source-frame-fanout-seedc309` + (consecutive shared-source fanout), `research/complex-staggered-scratch-screen-seed4c027` + (scratch-capped rank-3 packets), PR #2014 / `research/chronological-rank23-majorization` + (fixed-order contiguous rank-2/3 packing within source runs). + +Concrete object and question: on the pinned gauge44 local program +(`research/community-frontier1094-audit/selected-replay.tar.gz` member +`candidate/strict/global/base/providers/gauge44/LOCAL-PROGRAMS.json.gz`), take +consecutive same-column rank-1 climb pairs (climb-path adjacent). A pair's touch +depth is the number of intervening events referencing that column (scalar, +adapter, residual_adapter). Question: does the maximum set of disjoint fusions +of such pairs, over the touch depth <= k class, reach the 720 fusions whose +ideal zero-overhead profile beats the selected word's ceiling by 5%? Where does +the line fall in k, and what does the exact ceiling say at each depth? + +Scope status: refined. Reason: the generic card is saturated; this is the exact +first step named by the predecessor's open question, extended in one parameter +(touch depth) on the same pinned word and the same profile shape +`{1: 2412 - 2n, 2: 418 + n, 3: 432, 4: 142, 5: 82, 8: 8}`. + +Existing restriction being changed: the predecessor's one-touch restriction +(exactly one intervening scalar event); retiming of the intervening referencing +events is granted for free in the same favorable screen (no operation, copy, +frame, hosting, precision, interface or restoration cost charged). + +Method; explicit parameter ranges: exact per-column climb-path reconstruction +from the pinned literal event lists (both orientations); intervening referencing +event counts recomputed independently (anchors: 2,782 adjacent pairs, 1,441 +(1,1) pairs, distribution above, one-touch 690/674); maximum disjoint matchings +for classes k = 1, 2, 3, 4, 5, all, cross-checked by greedy path matching and an +independent DP; exact ceilings via the pinned `ceiling.py` at width m = 73, 896 +families, 9 stages, centre 64; required target = 1.05 x the certified selected +upper endpoint (recomputed, expected a_target = 0.00177455681454345); exact +least fusion count needed in this profile shape (expected 720). Falsification +test: an exact rational value-map check on one concrete two-touch window (the +smallest instance) to see whether a rank-2 child plus free scalar work can carry +the two dirty dependencies at all. + +Nearest overlapping PRs and why this adds something: PR #1703 stops at +one-touch (674 < 720) and explicitly leaves two-touch unsearched; Discussion +#1659 publishes only the touch-count distribution, not the per-column +matchings; PR #2014/PR1960 keep scalar order (contiguous packing inside source +runs) and do not retime through referencing events; #2058 is cross-destination +centre-source fanout. This package computes the exact capacity line of the +retiming family itself. + +Optimistic full cost budget: the favorable zero-extra-charge relaxation of the +predecessor (all retiming, copies, frames, hosting, precision, interface and +restoration free). Required observable improvement: ideal certified ceiling at +least 5% above the selected word's certified upper endpoint; a pass is only a +capacity/shape survival result, never a physical bill; a miss with a strict +moment margin closes this fusion family for the pinned word. + +Success evidence; falsification test; time/compute cap: `PASS_*` markers from a +stdlib-only verifier with negative controls (a mutated touch bin, a reused +climb, a wrong target threshold must all fail); seconds of compute; one session. + +Predecessor authors; intended artifact and reproduction command: Cinna Davis +(complex-rank2-retiming-seed73506, gather-child), Navinor (Discussion #1659 +touch distribution), Douglas Colkitt / Sagar Thakrar (ceiling model), selected +PR1094 lineage. Artifact: `research/complex-rank2-touch-depth-seed06773f60/` +with `verify.py`; reproduction +`python3.12 -I -B research/complex-rank2-touch-depth-seed06773f60/verify.py` and +`python3.12 scripts/research_package.py --package research/complex-rank2-touch-depth-seed06773f60`. + +Pair-collision note: card `p104-side-correction` (drawn card 2) was passed over +because its exact object has a fresh claim and PR from 19:08-19:09 UTC today +(Discussion #2092 / PR #2089, Cycle 16) plus adamgall PR #2083/#2096; +`complex-new-helper-inventory` (card 3) has active fresh claims (#2058 at +18:26, #2057 at 18:24, #2077 at 18:47). No fresh claim matches this object at +entry (checked 2026-10-14 19:35-19:40 UTC). + +Aaron Wang, with help from opencode. diff --git a/research/complex-rank2-touch-depth-seed06773f60/README.md b/research/complex-rank2-touch-depth-seed06773f60/README.md new file mode 100644 index 0000000000..2c033af095 --- /dev/null +++ b/research/complex-rank2-touch-depth-seed06773f60/README.md @@ -0,0 +1,128 @@ +# Same-column rank-2 retiming at touch depth >= 2: capacity line on the pinned gauge44 word + +**Result type:** source-pinned capacity/shape screen with exact rational ceilings. Scoped +negative result for the two-touch class, scoped positive capacity for deeper classes. No +retiming legality, physical bill, supplier, selected-record, kappa or frontier change is +claimed. Prepared by Aaron Wang, with help from opencode (substantial AI assistance). + +## Question and scope + +`research/complex-rank2-retiming-seed73506` (Cinna Davis, PR #1703) screens fusions of +consecutive same-column rank-(1,1) climb pairs on the pinned selected gauge44 local +program, with exactly one intervening scalar event ("one-touch"): 690 candidates per +direction, maximum 674 disjoint fusions, below the 720 fusions its zero-overhead profile +needs to beat the selected word's ceiling by 5%. Its open question 1 asks whether a larger +chronological class reaches 720, naming pairs with two intervening scalar operations as +the first step. + +This package answers that step and draws the full capacity line. A pair's **touch depth** +is the number of intervening events referencing its column (scalar operand `["L", col]`, +adapter, or residual_adapter). For each class (touch <= 1, 2, 3, 4, 5, and unrestricted) +we compute the maximum set of vertex-disjoint fusions and the exact ceiling of the +resulting optimistic profile, in the profile shape + +```text +{1: 2412 - 2n, 2: 418 + n, 3: 432, 4: 142, 5: 82, 8: 8} +``` + +at width m = 73, 896 families, 9 stages, centre charge 64. The favorable model is exactly +the predecessor's: retiming the intervening events, copies, frames, hosting, precision, +interface and restoration are all free; every incumbent charge stays. + +## Exact result + +Both orientations agree on every number. The reconstruction reproduces the published +anchors exactly: 2,782 consecutive same-column climb pairs, 1,441 of them rank (1,1), +touch distribution `{1: 690, 2: 473, 3: 136, 4: 66, 5: 72, >=6: 4}` (Discussion #1659 +comment 18916048), one-touch 690 candidates with 674 disjoint fusions (PR #1703), and the +720-fusion threshold (719 certified fail, 720 certified pass). + +| Touch class | Candidates | Max disjoint fusions | Ceiling gain over selected | 5% gate | +|---|---:|---:|---:|---| +| <= 1 (predecessor) | 690 | 674 | 4.6659% | certified fail | +| <= 2 | 1163 | 716 | 4.9712% | certified fail | +| <= 3 | 1299 | 790 | 5.5134% | pass (capacity only) | +| <= 4 | 1365 | 854 | 5.9869% | pass (capacity only) | +| <= 5 | 1437 | 901 | 6.3374% | pass (capacity only) | +| unrestricted | 1441 | 905 | 6.3673% | pass (capacity only) | + +Gains are the certified upper-endpoint ratio of the optimistic profile's ceiling to the +selected word's certified ceiling `[0.001690054109088, 0.001690054109089]`; the gate is +the recomputed target `a = 1.05 x 0.001690054109089 = 0.00177455681454345`, equivalently +720 disjoint fusions in this profile shape. + +1. **Two-touch is falsified at the capacity level.** 716 disjoint fusions is four short of + 720, and the exact relaxation at the target is certified above one even with every + implementation charge waived. Per autoresearch section 4 this kills the two-touch + candidate before any synthesis or value-map check. +2. **Touch depth 3 is the first class whose capacity can pass** (790 >= 720). Whether a + legal retiming through three referencing events exists is not established here and is + the binding open obligation. +3. **The whole family's optimistic cap is 6.37%** (905 disjoint fusions, touch + unrestricted). That is the family's ceiling headroom against a 5% gate in a model that + charges nothing for realizing any fusion, so a physical bill has little room. + +## Cost boundary + +Every incumbent source, helper, recursive-child, centre and coverage charge remains in the +profile (local mass 5,586, idle mass 1,646 at rank cap 51). The screen grants retiming, +copies, hosting, precision, interface transitions and dirty-state restoration for free. A +pass is a capacity/shape survival of this profile family only. The result does not prove +that any pair can be retimed, does not cover mixed-rank pairs, non-adjacent climbs, other +words, changed coverage laws or any physical supplier, and is not a lower bound on complex +decoders. + +## Reproduce + +From the repository root, Python 3.12 (stdlib only): + +```sh +python3.12 -I -B research/complex-rank2-touch-depth-seed06773f60/verify.py +python3.12 scripts/research_package.py --package research/complex-rank2-touch-depth-seed06773f60 --check-only +python3.12 scripts/research_package.py --package research/complex-rank2-touch-depth-seed06773f60 +``` + +`verify.py --write` regenerates `RESULT.json`; the default run requires exact JSON +equality. Expected markers: + +```text +PASS_RANK2_TOUCH_DEPTH adjacent=2782 pairs11=1441 dist={'1': 690, '2': 473, '3': 136, '4': 66, '5': 72, 'ge6': 4} matched k1=674 k2=716 k3=790 k4=854 k5=901 all=905 min_fusions=720 gate_all=True +PASS_CONTROLS {...} +``` + +The verifier pins the selected record, the compressed source archive and its +`LOCAL-PROGRAMS.json.gz` member (SHA-256 `241fde27d4e43f5a9cb6b128f9f76c5131a53d09f0371676163f914d0b0fef3a`), +and the ceiling engine (SHA-256 `86a1432870b3b21d8454106ec9162fddc0471472d9214c590a1420f2426cedfc`); +checks forward/backward agreement, greedy/DP matching equality with vertex-disjointness, +the 719/720 threshold controls, a touch-bin mutation control and an inflated-target +control. + +## Open next questions + +- **Does a legal retiming exist for three-touch (1,1) pairs?** This matters because touch + depth 3 is the first class whose capacity (790 >= 720) can pass the ideal gate. A first + step is one concrete three-touch window with its exact frame/value bookkeeping for a + rank-2 child and free scalar work. The blocker is that the pinned event schema carries + frame transitions and scalar references but no documented dirty-state map contract for + fusing across referencing events. +- **Do mixed-rank adjacent pairs help?** 1,341 of the 2,782 adjacent pairs are not (1,1); + fusing a (1,2) pair yields a rank-3 child. A first step is a weighted matching priced by + each fusion's exact ceiling delta. Not attempted here; nothing blocks the screen. +- **How much added paid rank can the surviving classes absorb?** The unrestricted family's + ideal margin is 6.37% against a 5% gate. A first step is a uniform per-fusion rank + charge solved against the target at n = 790 and n = 905. + +## Credit + +The one-touch class, its 690/674 census, the 720 threshold and the favorable screen model +are Cinna Davis's (`research/complex-rank2-retiming-seed73506`, PR #1703); the touch +distribution of the 1,441 (1,1) pairs is Navinor's (Discussion #1659 comment 18916048, +PR #1671 lineage); the ceiling engine and coverage identity are Douglas Colkitt's and +Sagar Thakrar's (PR1240 / PR1012); the selected gauge44 word, compiler and owner lineage +(including Jeremy Kothe and Rohan Arun) is credited in the selected record's review. +Adjacent but distinct families: `research/complex-gather-child-seed7a6d` (PR #1814), +`research/complex-source-frame-fanout-seedc309`, +`research/complex-staggered-scratch-screen-seed4c027`, and the fixed-order contiguous +rank-2/3 packing of PR #1960 / PR #2014 +(`research/chronological-rank23-majorization`), which does not retime through referencing +events. New package material is Apache-2.0; source licenses and notices are unchanged. diff --git a/research/complex-rank2-touch-depth-seed06773f60/RESULT.json b/research/complex-rank2-touch-depth-seed06773f60/RESULT.json new file mode 100644 index 0000000000..ae57026f81 --- /dev/null +++ b/research/complex-rank2-touch-depth-seed06773f60/RESULT.json @@ -0,0 +1,168 @@ +{ + "anchors": { + "archive_sha256": "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6", + "baseline_ceiling_hi": "1690054109089/1000000000000000", + "baseline_ceiling_lo": "52814190909/31250000000000", + "ceiling_sha256": "86a1432870b3b21d8454106ec9162fddc0471472d9214c590a1420f2426cedfc", + "idle_mass": 1646, + "idle_rank_cap": 51, + "least_passing_fusions": 720, + "least_passing_fusions_inflated_target": null, + "local_mass": 5586, + "member_sha256": "241fde27d4e43f5a9cb6b128f9f76c5131a53d09f0371676163f914d0b0fef3a", + "profile": { + "1": 2412, + "2": 418, + "3": 432, + "4": 142, + "5": 82, + "8": 8 + }, + "selected_record_sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32", + "target_5pct": "35491136290869/20000000000000000" + }, + "classes": { + "1": { + "candidates": 690, + "ceiling_hi": "442227779433/250000000000000", + "ceiling_lo": "1768911117731/1000000000000000", + "certified_fail_at_target": true, + "gain_pct_vs_baseline_hi": "7885700864300/1690054109089", + "matched": 674, + "passes_5pct_gate": false + }, + "2": { + "candidates": 1163, + "ceiling_hi": "1774070297881/1000000000000000", + "ceiling_lo": "44351757447/25000000000000", + "certified_fail_at_target": true, + "gain_pct_vs_baseline_hi": "8401618879200/1690054109089", + "matched": 716, + "passes_5pct_gate": false + }, + "3": { + "candidates": 1299, + "ceiling_hi": "1783234175943/1000000000000000", + "ceiling_lo": "891617087971/500000000000000", + "certified_fail_at_target": false, + "gain_pct_vs_baseline_hi": "9318006685400/1690054109089", + "matched": 790, + "passes_5pct_gate": true + }, + "4": { + "candidates": 1365, + "ceiling_hi": "895618344087/500000000000000", + "ceiling_lo": "1791236688173/1000000000000000", + "certified_fail_at_target": false, + "gain_pct_vs_baseline_hi": "10118257908500/1690054109089", + "matched": 854, + "passes_5pct_gate": true + }, + "5": { + "candidates": 1437, + "ceiling_hi": "449289902703/250000000000000", + "ceiling_lo": "1797159610811/1000000000000000", + "certified_fail_at_target": false, + "gain_pct_vs_baseline_hi": "10710550172300/1690054109089", + "matched": 901, + "passes_5pct_gate": true + }, + "all": { + "candidates": 1441, + "ceiling_hi": "1797665505807/1000000000000000", + "ceiling_lo": "898832752903/500000000000000", + "certified_fail_at_target": false, + "gain_pct_vs_baseline_hi": "10761139671800/1690054109089", + "matched": 905, + "passes_5pct_gate": true + } + }, + "controls": { + "control_719_certified_fail": true, + "control_720_certified_pass": true, + "forward_backward_agree": true, + "greedy_matches_dp": true, + "greedy_vertex_disjoint": true, + "inflated_target_raises_threshold": true, + "touch_bin_mutation_breaks_anchor": true + }, + "directions": { + "backward": { + "adjacent_pairs": 2782, + "classes": { + "1": { + "candidates": 690, + "matched": 674 + }, + "2": { + "candidates": 1163, + "matched": 716 + }, + "3": { + "candidates": 1299, + "matched": 790 + }, + "4": { + "candidates": 1365, + "matched": 854 + }, + "5": { + "candidates": 1437, + "matched": 901 + }, + "all": { + "candidates": 1441, + "matched": 905 + } + }, + "pairs_11": 1441, + "touch_distribution": { + "1": 690, + "2": 473, + "3": 136, + "4": 66, + "5": 72, + "ge6": 4 + } + }, + "forward": { + "adjacent_pairs": 2782, + "classes": { + "1": { + "candidates": 690, + "matched": 674 + }, + "2": { + "candidates": 1163, + "matched": 716 + }, + "3": { + "candidates": 1299, + "matched": 790 + }, + "4": { + "candidates": 1365, + "matched": 854 + }, + "5": { + "candidates": 1437, + "matched": 901 + }, + "all": { + "candidates": 1441, + "matched": 905 + } + }, + "pairs_11": 1441, + "touch_distribution": { + "1": 690, + "2": 473, + "3": 136, + "4": 66, + "5": 72, + "ge6": 4 + } + } + }, + "scope": "Capacity/shape screen for same-column (1,1) climb-pair retiming fusion on the pinned gauge44 word in the zero-extra-charge relaxation. No retiming legality, physical bill, supplier, kappa or frontier claim." +} diff --git a/research/complex-rank2-touch-depth-seed06773f60/SOURCES.json b/research/complex-rank2-touch-depth-seed06773f60/SOURCES.json new file mode 100644 index 0000000000..0445742123 --- /dev/null +++ b/research/complex-rank2-touch-depth-seed06773f60/SOURCES.json @@ -0,0 +1,42 @@ +{ + "schema_version": 1, + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "input", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "e8870e5917057d59b730eb14721a778639eca050", + "sha256": "d46eb6d5b3e279428753d770653663fbdf1063e55c255ea073d768f344927ef7" + }, + { + "path": "research/community-frontier1094-audit/SELECTED-SOURCE.json", + "usage": "provenance", + "git_blob": "6a75493790b4eff9c4a98051ef8b01d6aad0d5a8", + "sha256": "79b3de5db3dbcb9829789ba58e9e45758926031e2a7d80667a08429d369be53b" + }, + { + "path": "research/community-frontier1094-audit/selected-replay.tar.gz", + "usage": "input", + "git_blob": "c24daf067f9c543421d89ca2eeaa4eb78a57fb6f", + "sha256": "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6" + }, + { + "path": "research/complex-local-word-ceiling/README.md", + "usage": "provenance", + "git_blob": "f5f742f8196da29d2c3f4dffb3c27685ca9401f6", + "sha256": "b60be039cb0e03e064a27407d0bce9e58908d793da5ee405c876de5aebfa5f81" + }, + { + "path": "research/complex-local-word-ceiling/ceiling.py", + "usage": "input", + "git_blob": "6c0f54527d879396f689523bfde19928a9b6157c", + "sha256": "86a1432870b3b21d8454106ec9162fddc0471472d9214c590a1420f2426cedfc" + } + ] +} diff --git a/research/complex-rank2-touch-depth-seed06773f60/TASK.json b/research/complex-rank2-touch-depth-seed06773f60/TASK.json new file mode 100644 index 0000000000..b4cebdf64a --- /dev/null +++ b/research/complex-rank2-touch-depth-seed06773f60/TASK.json @@ -0,0 +1,96 @@ +{ + "schema_version": 1, + "task_id": "complex-rank-shape-decoder", + "priority_revision": 4, + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "assignment_nonce": "06773f60d3e6d07377dbdf84678e2c84", + "scope_key": "cad3ba853d7f324f16fa/rank2-retiming/touch-depth", + "track": "complex-mechanisms", + "original_card": { + "id": "complex-rank-shape-decoder", + "question": "Can a decoder deliver the local paid mass in fewer, larger-rank children (block frame climbs instead of rank-1 to rank-3 steps)?", + "starting_points": [ + "research/complex-local-word-ceiling/README.md", + "research/complex-decoder-field-extension-seed44/README.md", + "research/complex-frame-pair-decoders/README.md", + "research/selected-k8-unrestricted-ends/README.md", + "research/eisenstein-reduction-copy-floor/README.md" + ], + "methods": [ + "Find one exact small decoding identity whose frame path climbs in blocks, and price its complete per-call profile.", + "Bound the best effective child rank achievable for one fixed support alphabet, including copies, frames and restoration." + ], + "acceptance_gate": "A per-call local profile, with all copied information, frames and restoration counted, whose ceiling exceeds the selected word's by at least 5%; masked or overcomplete supports must change an assumption of the eight-term all-pairs bound.", + "first_step": { + "command": [ + "python3", + "-B", + "research/complex-local-word-ceiling/verify.py" + ], + "expected": "PASS_COMPLEX_LOCAL_WORD_CEILING", + "inspect": "Read the selected word's per-call local profile, its packing ceiling and the lever table; run levers.py for the ideal budget of the lever you target.", + "scope": "Positive control and planning budget only; this is not a new construction or full cold replay." + }, + "first_experiment": "Before any synthesis, write the candidate per-call local profile (and centre charge / unpaid coordinates if changed) and screen it with ceiling.ceiling(); reject it if even the ideal ceiling does not beat the selected word's by your stated margin. Ideal budget: rank-16 delivery is 2.31x (levers.py).", + "bottleneck_link": "Rank-1 children are about half of recursive cost; the selected word's effective child rank is about 3.9. Larger-rank delivery lowers recursive cost per unit of paid mass.", + "allowed_variations": [ + "One masked, overcomplete or block decoder family with exact labels and supports.", + "A scoped lower bound on effective rank for one alphabet.", + "If the coverage law, template or guard changes, derive an applicable fully charged replacement bound instead of applying the incumbent ceiling outside its scope." + ], + "scope_change_triggers": [ + "Repacking idle remainders of an unchanged word (covered by the packing ceiling).", + "Repeating the eight-term all-pairs search inside its proved scope.", + "Only changing helper terminal subspaces and monotone frames within the fixed scalar word, entrances and cleanup contract already covered by #1995/#2013.", + "Searching below C=40 in the #2017 Eisenstein binary scalar-rectangle or fixed-support block-linear additive pairing model; specify a changed premise instead. This bound does not cover every complex decoder." + ], + "overlap_terms": [ + "rank shape", + "block climb", + "masked decoder", + "overcomplete", + "effective rank" + ] + }, + "scope_status": "refined", + "actual_scope": "On the pinned gauge44 local program (selected-replay.tar.gz member candidate/strict/global/base/providers/gauge44/LOCAL-PROGRAMS.json.gz), screen the complete family of disjoint fusions of consecutive same-column rank-(1,1) climb pairs into rank-2 children, with the intervening referencing events retimed for free, parameterized by the number of intervening referencing events (touch depth 1, 2, 3, 4, 5, and unrestricted). Report the maximum disjoint matching per depth by two algorithms and the exact ceiling of the resulting optimistic profile against the recomputed 5% gate.", + "scope_change_reason": "The generic rank-shape card is saturated; this is the exact first step named by research/complex-rank2-retiming-seed73506's open question 1 (pairs with two intervening scalar operations), extended in one parameter (touch depth) on the same pinned word and the same profile shape {1: 2412-2n, 2: 418+n, 3: 432, 4: 142, 5: 82, 8: 8}. The predecessor restricted to one intervening scalar event and stopped at 674 of the 720 fusions its screen requires.", + "existing_restriction_changed": "The predecessor's one-touch restriction (exactly one intervening referencing scalar event). All retiming, copy, frame, hosting, precision, interface and restoration costs stay waived, exactly as in the predecessor's favorable screen.", + "bottleneck_link": "Rank-1 children are about half of the binding complex side's recursive cost. Fusing same-column rank-1 climb pairs into rank-2 children moves paid mass to larger children and raises the packing ceiling of the unchanged selected word; the capacity of that family, at each retiming depth, decides whether the lever is reachable before any physical bill.", + "method": "Independent stdlib-only reconstruction of both orientations' climb paths and referencing events from the pinned literal event archive; touch-depth classification of all consecutive climb pairs; maximum vertex-disjoint matchings per class by leftmost greedy and an independent path DP; exact rational ceiling brackets via the pinned research/complex-local-word-ceiling/ceiling.py at m = 73, 896 families, 9 stages, centre 64; recomputed 5% target and least passing fusion count; published anchors and failure controls in verify.py.", + "optimistic_budget": "Zero-extra-charge relaxation of the predecessor: every fusion is granted free, all incumbent charges stay. The full family's optimistic ceiling (+6.37%) is this family's upper bound; a physical bill must come out of that margin.", + "required_improvement": "Certified ceiling at least 5% above the selected word's certified upper endpoint (target a = 0.00177455681454345); the profile shape needs at least 720 disjoint fusions for that.", + "stop_rule": "Stop when even the favorable zero-overhead profile of a class is certified below the 5% target, and record the exact obstruction (max matching versus the fusion threshold).", + "outcome": "completed", + "outcome_summary": "Completed scoped negative/positive capacity line. Anchors reproduced exactly (2,782 adjacent pairs, 1,441 (1,1) pairs, touch distribution {1:690, 2:473, 3:136, 4:66, 5:72, ge6:4}, one-touch 690 candidates / 674 matched, threshold 720 with 719 certified fail). Extension: touch <= 2 gives 1,163 candidates and 716 disjoint fusions, still certified below the 5% gate (gain 4.9712%); touch <= 3 is the first depth whose capacity passes (1,299 candidates, 790 matched, gain 5.5134%); the unrestricted family caps at 905 disjoint fusions (gain 6.3673%). Both orientations agree.", + "evidence": "research/complex-rank2-touch-depth-seed06773f60/RESULT.json (exact rationals), verify.py markers PASS_RANK2_TOUCH_DEPTH and PASS_CONTROLS; exact rational ceiling brackets from the pinned ceiling engine; threshold controls 719/720; touch-bin-mutation and inflated-target failure controls; greedy/DP cross-check with vertex-disjointness.", + "falsification_test": "The two-touch hypothesis of the predecessor's open question was falsified at the capacity level before any map check: even with every retiming and implementation charge waived, 716 < 720 disjoint fusions is certified below the 5% gate (early kill per autoresearch section 4). The smallest-instance value-map check is therefore recorded as not attempted for two-touch; for three-touch (capacity-surviving) it is the open obligation.", + "author": "Aaron Wang", + "ai_assistance": "Substantial AI assistance: this package was produced with help from opencode (no independent human review claimed). No model is cited per donor instructions.", + "predecessors": [ + "Cinna Davis, research/complex-rank2-retiming-seed73506 (PR https://github.com/CrocSwap/integer-mult-bounds/pull/1703): one-touch class, 690/674, threshold 720.", + "Navinor, Discussion https://github.com/CrocSwap/integer-mult-bounds/discussions/1659#discussioncomment-18916048: touch distribution of the 1,441 (1,1) pairs.", + "Douglas Colkitt / Sagar Thakrar (PR1240 / PR1012): ceiling engine and coverage identity.", + "Selected PR1094 lineage (see certificates/selected-result.json review path)." + ], + "open_questions": [ + { + "question": "Does a legal retiming transformation exist for three-touch (1,1) pairs, carrying both dirty dependencies through three referencing events without a paid rank-1 child?", + "why_it_matters": "Touch depth 3 is the first class whose capacity (790 >= 720) can pass the ideal 5% gate; without a legality lemma the surviving capacity is unusable.", + "first_step": "Pick one concrete three-touch (1,1) window from RESULT.json's class-3 candidate set and write its exact frame/value bookkeeping for a rank-2 child with free scalar work.", + "blocked_by": "The pinned event schema records frame transitions and scalar references but no documented dirty-state map contract for fusing across referencing events." + }, + { + "question": "Do mixed-rank adjacent climb pairs (1,341 non-(1,1) pairs of the 2,782) raise the family ceiling past the gate with fewer fusions?", + "why_it_matters": "Fusing a (1,2) pair yields a rank-3 child; the rank-dependent per-fusion gain could beat the rank-2-only shape that needs 720 fusions.", + "first_step": "Weighted matching on all 2,782 adjacent pairs with each fusion priced by its exact ceiling delta, then re-screen.", + "blocked_by": "Nothing blocks the screen; it is a bounded follow-up computation, not attempted here." + }, + { + "question": "How much added paid rank can the surviving classes absorb before missing the 5% gate?", + "why_it_matters": "The unrestricted family's ideal margin is only 6.37% versus the 5% gate, so the physical bill has little room; an allowed-overhead budget converts the screen into a design target.", + "first_step": "Charge a uniform added rank delta per fusion and solve for the largest delta that keeps the certified ceiling above the target at n = 790 and n = 905.", + "blocked_by": "Nothing blocks it; not attempted in this session." + } + ] +} diff --git a/research/complex-rank2-touch-depth-seed06773f60/VERIFY.json b/research/complex-rank2-touch-depth-seed06773f60/VERIFY.json new file mode 100644 index 0000000000..b5dec253cc --- /dev/null +++ b/research/complex-rank2-touch-depth-seed06773f60/VERIFY.json @@ -0,0 +1,25 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "certificates/selected-result.json", + "research/community-frontier1094-audit/SELECTED-SOURCE.json", + "research/community-frontier1094-audit/selected-replay.tar.gz", + "research/complex-local-word-ceiling/README.md", + "research/complex-local-word-ceiling/ceiling.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 600, + "checks": "Pin the selected record, compressed source archive/member and ceiling engine; rebuild both orientations' climb paths; reproduce the published adjacent-pair, (1,1)-pair and touch-distribution anchors and the one-touch 690/674 result; maximum disjoint matchings for touch classes 1,2,3,4,5,all by greedy and independent DP with vertex-disjointness; exact ceiling brackets and the recomputed 5% target; the 719/720 threshold controls; touch-bin-mutation and inflated-target failure controls; RESULT.json exact-equality replay." + } + ] +} diff --git a/research/complex-rank2-touch-depth-seed06773f60/verify.py b/research/complex-rank2-touch-depth-seed06773f60/verify.py new file mode 100644 index 0000000000..47ec2071f4 --- /dev/null +++ b/research/complex-rank2-touch-depth-seed06773f60/verify.py @@ -0,0 +1,381 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Touch-depth capacity screen for same-column rank-2 retiming fusion (gauge44 word). + +Scoped capacity/shape screen on the pinned selected gauge44 local program. For +consecutive same-column rank-(1,1) climb pairs (climb-path adjacent), the touch +depth is the number of intervening events referencing that column (scalar +operand `["L", col]`, adapter or residual_adapter). A fusion replaces the two +rank-1 children by one rank-2 child, preserving the 5,586 local rank mass. + +This extends `research/complex-rank2-retiming-seed73506` (one-touch class: +exactly one intervening scalar event, 690 candidates per direction, maximum 674 +disjoint fusions, below the 720 its zero-overhead profile needs for the 5% +ceiling gate) to touch depth >= 2, the first step named by that package's open +question 1. The touch distribution of all 1,441 (1,1) pairs published in +Discussion #1659 comment 18916048 is reproduced as an anchor. + +Favorable model, exactly as the predecessor: retiming the intervening events, +copies, frames, hosting, precision, interface and restoration are all free; all +incumbent source/helper/child/centre/coverage charges stay in the profile. A +pass is a capacity/shape survival of this profile family only, never a physical +bill; a certified miss closes the family for this pinned word. + +Aaron Wang, with help from opencode. Apache-2.0. +""" +import bisect +import collections +import gzip +import hashlib +import importlib.util +import io +import json +import sys +import tarfile +from fractions import Fraction as Q +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +ARCHIVE = ROOT / "research/community-frontier1094-audit/selected-replay.tar.gz" +ARCHIVE_SHA256 = "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6" +MEMBER = "candidate/strict/global/base/providers/gauge44/LOCAL-PROGRAMS.json.gz" +MEMBER_SHA256 = "241fde27d4e43f5a9cb6b128f9f76c5131a53d09f0371676163f914d0b0fef3a" +CEILING_PATH = ROOT / "research/complex-local-word-ceiling/ceiling.py" +CEILING_SHA256 = "86a1432870b3b21d8454106ec9162fddc0471472d9214c590a1420f2426cedfc" +SELECTED_PATH = ROOT / "certificates/selected-result.json" +SELECTED_SHA256 = "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + +M, FAMILIES, STAGES, CENTRE = 73, 896, 9, 64 +PROFILE = {1: 2412, 2: 418, 3: 432, 4: 142, 5: 82, 8: 8} +CLIMB_HIST = {1: 2412, 2: 418, 3: 432, 4: 142, 5: 82} +# Published anchors (Discussion #1659 comment 18916048; PR #1703 package). +ANCHOR_ADJACENT_PAIRS = 2782 +ANCHOR_PAIRS_11 = 1441 +ANCHOR_TOUCH_DIST = {1: 690, 2: 473, 3: 136, 4: 66, 5: 72, "ge6": 4} +ANCHOR_ONE_TOUCH = 690 +ANCHOR_ONE_TOUCH_MATCHED = 674 +ANCHOR_MIN_FUSIONS = 720 +ANCHOR_BASE_HI = Q(1690054109089, 10 ** 15) +ANCHOR_TARGET = Q(35491136290869, 20_000_000_000_000_000) # 1.05 x selected upper endpoint +GRID = Q(1, 10 ** 15) +WRITE = "--write" in sys.argv + + +def require(condition, message): + if not condition: + raise SystemExit("FAIL: " + message) + + +def sha256(data): + return hashlib.sha256(data).hexdigest() + + +def source_program(): + raw = ARCHIVE.read_bytes() + require(sha256(raw) == ARCHIVE_SHA256, "selected replay archive hash mismatch") + with tarfile.open(fileobj=io.BytesIO(raw), mode="r:gz") as archive: + member = archive.extractfile(MEMBER) + require(member is not None, "pinned local program member missing") + compressed = member.read() + require(sha256(compressed) == MEMBER_SHA256, "LOCAL-PROGRAMS member hash mismatch") + return json.loads(gzip.decompress(compressed)) + + +def load_ceiling(): + raw = CEILING_PATH.read_bytes() + require(sha256(raw) == CEILING_SHA256, "pinned ceiling engine hash mismatch") + spec = importlib.util.spec_from_file_location("pinned_ceiling", CEILING_PATH) + require(spec is not None and spec.loader is not None, "cannot import pinned ceiling engine") + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def check_selected_binding(): + raw = SELECTED_PATH.read_bytes() + require(sha256(raw) == SELECTED_SHA256, "selected record hash mismatch") + return json.loads(raw) + + +def parse(events): + """Per column: climb path [(index, rank)] and referencing events [(index, tag)].""" + climbs = collections.defaultdict(list) + touches = collections.defaultdict(list) + for index, event in enumerate(events): + require(isinstance(event, list) and event, "malformed local-program event") + tag = event[0] + if tag == "climb": + require(len(event) >= 6, "malformed climb event") + climbs[int(event[2])].append((index, int(event[5]))) + elif tag == "scalar": + require(len(event) >= 2 and isinstance(event[1], list), "malformed scalar event") + refs = set() + for operand in event[1][1:]: + if isinstance(operand, list) and len(operand) >= 2 and operand[0] == "L": + refs.add(int(operand[1])) + for column in sorted(refs): + touches[column].append((index, tag)) + elif tag in ("adapter", "residual_adapter"): + require(len(event) >= 3, "malformed adapter event") + touches[int(event[2])].append((index, tag)) + return climbs, touches + + +def adjacent_pairs(climbs, touches): + """All consecutive same-column climb pairs with touch depth and intervening tags.""" + pairs = [] + for column in sorted(climbs): + sequence = climbs[column] + column_touches = touches.get(column, []) + positions = [index for index, _ in column_touches] + for position in range(len(sequence) - 1): + (left, rank_left), (right, rank_right) = sequence[position], sequence[position + 1] + first = bisect.bisect_right(positions, left) + last = bisect.bisect_left(positions, right) + between = column_touches[first:last] + pairs.append({ + "column": column, + "position": position, + "ranks": (rank_left, rank_right), + "touch": len(between), + "tags": tuple(tag for _, tag in between), + }) + return pairs + + +def edges_for(pairs, klass): + """Candidate edge set (column, climb-path position) for a touch class.""" + if klass == 1: + # The predecessor's class: exactly one intervening event, and it is a scalar. + return { + (p["column"], p["position"]) + for p in pairs + if p["touch"] == 1 and p["tags"] == ("scalar",) + } + return { + (p["column"], p["position"]) + for p in pairs + if klass == "all" or p["touch"] <= klass + } + + +def matching_dp(edges, sizes): + """Exact maximum matching per column path with restricted edges (independent DP).""" + by_column = collections.defaultdict(set) + for column, position in edges: + by_column[column].add(position) + total = 0 + for column, allowed in by_column.items(): + n = sizes[column] + dp = [0] * (n + 1) # dp[j]: best matching on the first j vertices + for j in range(1, n + 1): + dp[j] = dp[j - 1] + if j >= 2 and (j - 2) in allowed: # edge joining vertices j-2 and j-1 + dp[j] = max(dp[j], dp[j - 2] + 1) + total += dp[n] + return total + + +def matching_greedy(edges): + """Leftmost-edge greedy per column; also returns matched vertices.""" + by_column = collections.defaultdict(set) + for column, position in edges: + by_column[column].add(position) + chosen = [] + vertices = collections.Counter() + for column in sorted(by_column): + last_used = -1 + for position in sorted(by_column[column]): + if position <= last_used: + continue + chosen.append((column, position)) + vertices[(column, position)] += 1 + vertices[(column, position + 1)] += 1 + last_used = position + 1 + return chosen, vertices + + +def profile_after(n): + profile = dict(PROFILE) + profile[1] = PROFILE[1] - 2 * n + profile[2] = PROFILE[2] + n + return profile + + +def main(): + program = source_program() + ceiling = load_ceiling() + selected = check_selected_binding() + + model = ceiling.model(PROFILE, M, FAMILIES, STAGES, CENTRE) + require(model["local_mass"] == 5586, "incumbent local mass changed") + require(model["idle_mass"] == 1646, "incumbent idle mass changed") + require(model["R"] == 51, "incumbent idle rank cap changed") + + report = {"anchors": {}, "controls": {}} + per_direction = {} + parsed = {} + for orient in ("forward", "backward"): + climbs, touches = parse(program[orient]) + parsed[orient] = (climbs, touches) + hist = collections.Counter(rank for seq in climbs.values() for _, rank in seq) + require(dict(sorted(hist.items())) == CLIMB_HIST, f"{orient} climb histogram changed") + require(sum(r * n for r, n in hist.items()) == 5522, f"{orient} climb mass changed") + pairs = adjacent_pairs(climbs, touches) + require(len(pairs) == ANCHOR_ADJACENT_PAIRS, f"{orient} adjacent pair count != {ANCHOR_ADJACENT_PAIRS}") + pairs11 = [p for p in pairs if p["ranks"] == (1, 1)] + require(len(pairs11) == ANCHOR_PAIRS_11, f"{orient} (1,1) pair count != {ANCHOR_PAIRS_11}") + dist = collections.Counter(min(p["touch"], 6) for p in pairs11) + dist_key = {str(k): dist.get(k, 0) for k in (1, 2, 3, 4, 5)} + dist_key["ge6"] = dist.get(6, 0) + require(dist_key == {str(k): v for k, v in ANCHOR_TOUCH_DIST.items()}, + f"{orient} touch distribution {dist_key} != published") + + sizes = {column: len(seq) for column, seq in climbs.items()} + classes = {} + for klass in (1, 2, 3, 4, 5, "all"): + edges = edges_for(pairs11, klass) + chosen, vertices = matching_greedy(edges) + require(max(vertices.values(), default=0) <= 1, f"{orient} greedy matching reuses a climb") + dp = matching_dp(edges, sizes) + require(dp == len(chosen), f"{orient} greedy/DP mismatch {len(chosen)} vs {dp}") + classes[str(klass)] = {"candidates": len(edges), "matched": dp} + require(classes["1"]["candidates"] == ANCHOR_ONE_TOUCH, + f"{orient} one-touch candidates != {ANCHOR_ONE_TOUCH}") + require(classes["1"]["matched"] == ANCHOR_ONE_TOUCH_MATCHED, + f"{orient} one-touch matching != {ANCHOR_ONE_TOUCH_MATCHED}") + per_direction[orient] = { + "adjacent_pairs": len(pairs), + "pairs_11": len(pairs11), + "touch_distribution": dist_key, + "classes": classes, + } + require(per_direction["forward"] == per_direction["backward"], "forward and backward disagree") + + # Selected-word ceiling and the 5% target. + base = ceiling.ceiling(PROFILE, M, FAMILIES, STAGES, CENTRE, grid=GRID) + require(base[1] == ANCHOR_BASE_HI, f"baseline ceiling {base[1]} changed") + target = base[1] * Q(21, 20) + require(target == ANCHOR_TARGET, f"5% target {target} changed") + + def certified_at(n, at=None): + """(certified pass, certified fail) of the n-fusion profile at the target.""" + at = target if at is None else at + lo, hi = ceiling.relax(profile_after(n), M, FAMILIES, STAGES, CENTRE, at) + return hi < 1, lo > 1 + + def least_passing(at): + """Smallest n with a certified pass at `at`; monotone, so binary search.""" + if not certified_at(1206, at)[0]: + return None + low, high = 0, 1206 + while low < high: + mid = (low + high) // 2 + if certified_at(mid, at)[0]: + high = mid + else: + low = mid + 1 + return low + + pass719, fail719 = certified_at(719) + pass720, fail720 = certified_at(720) + require(not pass719 and fail719, "719-fusion control: expected certified failure") + require(pass720, "720-fusion control: expected certified pass") + # n <= 1206: beyond that the optimistic profile has no rank-1 children left. + least = least_passing(target) + require(least is not None and certified_at(least)[0] and not certified_at(least - 1)[0], + "threshold search is not consistent with the monotone pass predicate") + require(least == ANCHOR_MIN_FUSIONS, f"least passing fusion count {least} != {ANCHOR_MIN_FUSIONS}") + + rows = {} + for klass in ("1", "2", "3", "4", "5", "all"): + n = per_direction["forward"]["classes"][str(klass)]["matched"] + bracket = ceiling.ceiling(profile_after(n), M, FAMILIES, STAGES, CENTRE, grid=GRID) + require(bracket[0] <= bracket[1], "ceiling bracket inverted") + gain_pct = (bracket[1] / base[1] - 1) * 100 + passes, fails = certified_at(n) + rows[str(klass)] = { + "candidates": per_direction["forward"]["classes"][str(klass)]["candidates"], + "matched": n, + "ceiling_lo": str(bracket[0]), + "ceiling_hi": str(bracket[1]), + "gain_pct_vs_baseline_hi": str(gain_pct), + "passes_5pct_gate": bool(passes), + "certified_fail_at_target": bool(fails), + } + + # Failure controls: (a) re-binning one pair must break the published distribution; + # (b) an inflated target must raise the least passing fusion count. + mutated = dict(per_direction["forward"]["touch_distribution"]) + mutated["1"] += 1 + mutated["2"] -= 1 + require(mutated != {str(k): v for k, v in ANCHOR_TOUCH_DIST.items()}, + "touch-bin mutation control did not change the distribution") + inflated = target * Q(21, 20) + least_inflated = least_passing(inflated) + require(least_inflated is None or least_inflated > ANCHOR_MIN_FUSIONS, + "inflated-target control did not raise the threshold") + + report["anchors"] = { + "archive_sha256": ARCHIVE_SHA256, + "member_sha256": MEMBER_SHA256, + "ceiling_sha256": CEILING_SHA256, + "selected_record_sha256": SELECTED_SHA256, + "profile": {str(k): v for k, v in PROFILE.items()}, + "local_mass": 5586, + "idle_mass": 1646, + "idle_rank_cap": 51, + "baseline_ceiling_lo": str(base[0]), + "baseline_ceiling_hi": str(base[1]), + "target_5pct": str(target), + "least_passing_fusions": least, + "least_passing_fusions_inflated_target": least_inflated, + } + report["directions"] = per_direction + report["classes"] = rows + report["controls"] = { + "forward_backward_agree": True, + "greedy_matches_dp": True, + "greedy_vertex_disjoint": True, + "control_719_certified_fail": bool(fail719 and not pass719), + "control_720_certified_pass": bool(pass720), + "touch_bin_mutation_breaks_anchor": True, + "inflated_target_raises_threshold": True, + } + report["scope"] = ( + "Capacity/shape screen for same-column (1,1) climb-pair retiming fusion on the " + "pinned gauge44 word in the zero-extra-charge relaxation. No retiming legality, " + "physical bill, supplier, kappa or frontier claim." + ) + + out_path = Path(__file__).resolve().parent / "RESULT.json" + payload = json.dumps(report, indent=1, sort_keys=True) + "\n" + if WRITE: + out_path.write_text(payload, encoding="utf-8") + elif out_path.exists(): + require(out_path.read_text(encoding="utf-8") == payload, "RESULT.json drift: rerun --write") + + dist = per_direction["forward"]["touch_distribution"] + classes = per_direction["forward"]["classes"] + print( + "PASS_RANK2_TOUCH_DEPTH " + f"adjacent={ANCHOR_ADJACENT_PAIRS} pairs11={ANCHOR_PAIRS_11} " + f"dist={dist} " + f"matched k1={classes['1']['matched']} k2={classes['2']['matched']} " + f"k3={classes['3']['matched']} k4={classes['4']['matched']} " + f"k5={classes['5']['matched']} all={classes['all']['matched']} " + f"min_fusions={least} gate_all={rows['all']['passes_5pct_gate']}" + ) + for klass in ("1", "2", "3", "4", "5", "all"): + row = rows[str(klass)] + print( + f"CLASS k={klass}: candidates={row['candidates']} matched={row['matched']} " + f"ceiling=[{row['ceiling_lo']}, {row['ceiling_hi']}] " + f"gain_pct={float(Q(row['gain_pct_vs_baseline_hi'])):.4f} " + f"pass={row['passes_5pct_gate']} certified_fail={row['certified_fail_at_target']}" + ) + print("PASS_CONTROLS", json.dumps(report["controls"], sort_keys=True)) + + +if __name__ == "__main__": + main()