diff --git a/research/bit-r438-transport-rehost/NOTES-rehost.md b/research/bit-r438-transport-rehost/NOTES-rehost.md new file mode 100644 index 0000000000..e7f2ebb48f --- /dev/null +++ b/research/bit-r438-transport-rehost/NOTES-rehost.md @@ -0,0 +1,204 @@ +# R438 bit hosting: window-respecting optimal re-hosting of the width-8 slack + +**Status: bit headroom only, no new κ; conditional on PR1043 (R438, open and not admitted). Row (b) is also +conditional on the transported word built and replayed by `verify_transport.py` in this package.** The selected record is complex-bound. The bit supplier does +not bind, so nothing here changes κ. This is a finite, scoped slot-model certificate. It is not a +hosted-template emission and not a multiplication theorem. + +## Question + +[PR1043](https://github.com/CrocSwap/integer-mult-bounds/pull/1043) (aliromman) removes helper470 from +the PR589 R439 bit word, giving R438. Its `hosting_change` returns each freed width-8 slot to its own +host copy. Per replica, that leaves remainders `{10:5, 12:3, 14:1}` on top of the PR589 profile. Its +README says it runs no hosting search. + +In the PR1023 slot model (`research/bit589-width-packing`), each replica has width-8 capacity 3996. +That leaves a slack of 3996 − 9·438 = **54** units at R438, against 45 at R439. Where should the 54 +units go, and is that placement window-feasible? + +## Results (all exact; `RECEIPT.json`) + +| Quantity | Value | +|---|---| +| Optimal layout, S = 54 | `10×(42,5) + 1×(42,4)`: ten fully idle 42-slots and one 42-slot holding one helper (remainder 34) | +| Idle profile per replica | `{2:433, 4:444, 6:444, 7:666, 34:1, 42:10}` (1,998 idle children, as PR1043) | +| Hosted rank mass / children (local + idle) | 1,808,352 / 904,320 (unchanged from PR1043) | +| Runner-up layout | `10×(42,5) + 1×(14,1) + 1×(28,3)` | +| Runner-up gap, Σg per replica at c_a + 1e-24 | [0.007902038724851374389941593752047420, …421] | +| Same gap in moment units | [1.390420665268048703185105882609695e-7, …696e-7] | +| PR1043 in-place layout `9×(42,5)+5×(42,1)+3×(28,1)+1×(14,1)`, gap to optimum | Σg 0.116172190755053614177477242754726502…503; moment 2.0441334240402170e-6 | +| Layouts covered by exhaustive cross-check | 10,556,685 (S = 54), 3,160,688 (S = 45) | + +Bit endpoints. Each is accepted at c and rejected at c + 10⁻²⁴ by both pinned engines, with the +inherited surcharge. + +| Row | c | vs PR1043 | vs PR589 | +|---|---|---:|---:| +| PR589 R439 selected (positive control) | 0.001733427039589844234749 | | | +| PR1043 R438, own in-place hosting (positive control) | 0.001734176288479865766692 | 0 | +0.0432% | +| **R438 window optimum, local (a) PR1043** | **0.001734802047828389852783** | **+0.03608%** | +0.07932% | +| R438 runner-up layout, local (a) | 0.001734759469354358444809 | +0.03363% | +0.07687% | +| PR1043 in-place hosting, local (b) | 0.001734220472884893243548 | +0.00255% | +0.04577% | +| **R438 window optimum, local (b) transported word** | **0.001734846264120199151475** | **+0.03863%** | +0.08187% | + +- Local (a) is `{1:1321, 2:1344, 3:78, 4:44, 5:102, 6:11, 7:18}`, read from PR1043's certificate. +- Local (b) is `{1:1322, 2:1342, 3:79, 4:44, 5:102, 6:11, 7:18}`, a declared input; see Scope. +- Both scouting endpoints (0.001734802047828389852783 and 0.001734846264120199151475) are reproduced + exactly. +- **Optimality certificate.** The DP is re-run at each profile's own next grid point c + 10⁻²⁴. + There, the moment of the optimum exceeds one, by both engines. Every other no-bank R438 layout has + a certified larger idle sum Σg, while the child count and local profile stay the same. Its moment is + therefore larger, so no layout in the slot model reaches c + 10⁻²⁴. +- **Window-free equals window-respecting.** The window-free optimum is window-feasible (below). + Windows only remove layouts, so it is also the window-respecting optimum. + +## What `verify_rehost.py` checks + +1. **Bindings and positive controls.** + - The PR589 record and the PR1023 slot model are used through `packing.slot_model`. + - PR589's c is reproduced. + - PR1043's certificate is checked: its baseline equals the PR589 record, and the local delta is + `{1:−2, 2:+2, 3:−1, 7:−1}` with mass 5121 = 8R + 63 + 14v. + - PR1043's nine removed slots and its in-place remainders are **re-derived** from the frozen + selection with seed14's `allocate`. Its hosted profile and c = 0.001734176288479865766692 are + reproduced with `packing.endpoint`. +2. **Exact interval DP (S = 54, generalising `width8_optimality`'s hard-coded 45).** + - It is a top-3 coin-change DP over moves (capacity, unused units u). Move bounds are built from + `packing.g_interval`, and values are exact rationals. + - An independent exhaustive enumeration cross-checks it: per-class partition tables, exact integer + (dyadic) costs, and sorted branch-and-bound over all 10,556,685 layouts. The two must agree on the + top three. + - Uniqueness is certified as L(runner-up) > U(optimum). The runner-up is certified as + L(third) > U(runner-up). + - Slot-count limits are vacuous because 54 ≤ 444, and every capacity is ≢ 0 (mod 8). Each slot + therefore keeps exactly one idle child, and the surcharge is the same for every layout. + - **Positive control at S = 45, c0 + 10⁻²⁴.** The optimum is `9×(42,5)`, which equals PR589's + selected remainders. The runner-up is `8×(42,5)+(14,1)+(42,4)`, with a gap in Σg of + 0.0188836568544…. PR1023's own `width8_optimality` passes, with per-unit runner-up (42,4). +3. **Stage windows.** + - Windows come from seed72's `windows.checked_windows` (global_k anchor plus three predicates), + cross-checked against seed14's independent `schedule/windows`: + - child 0: stages 0–1; child 2: 0–3; child 4: 0–5; + - child 6: 3–8; child 7: 5–8; child 8: 7–8; + - capacity-7 children 1, 3 and 5: one stage each, and they host nothing. + - All 22 splits of the 11 non-full 42-copies were checked. These are x idle copies in child 4, + 10 − x in child 6, and the one-residual copy in child 4 or 6. Children 0, 2, 7 and 8 stay full. + The splits are checked with seed72's `maxflow_assign` and an independent all-subsets Hall test. + **22/22 are feasible.** +4. **Explicit placement.** All 10 idle copies and the one-residual copy go in child 6, as in PR589, + which leaves 9 child-6 copies empty. The stage table is in the receipt. + - Seed14's `allocate` is run with R = 438 on the module instance only. + - Its output must equal PR442's `hosting_core.expand` slot for slot (sha256 `1ef76bb8…`). + - It is audited by seed14's `placement_audit`, which checks windows, owner domain, width, extent, + cell collisions, one occurrence per (stage, helper), completeness and the host-pair-not-active + rule. + - It is also audited by an independent `audit_slots`, which takes active pairs from seed72's + schedule. Seed14's `owners_for_replicas` covers all 126,144 roles across 32 replicas. + - All three remainder histograms equal the DP optimum. + +**Negative controls (29, each must be rejected for the stated reason):** +- A tampered vendored certificate (sha256 pin). +- PR1023's `width8_optimality` on the R438 model (hard-coded slack 45). +- The DP with move (42,4) dropped, which fails the exhaustive cross-check. +- The runner-up claimed optimal. +- The PR1043 in-place layout claimed optimal. +- An optimum profile with the 34-slot dropped (rank mass). +- c + 10⁻²⁴ accepted, for (a) and for (b). +- Child 4's window tightened to {0,1}, and child 6's window tightened to {7,8} (Hall violated; max-flow + agrees). +- 439 helpers per stage into the R438 optimum. +- Placement mutations: stage outside window, cell collision, duplicate helper, missing helper, slot + extent, helper out of domain, width-7 residual, host pair active at a stage (windows widened so that + only this rule can fire), and auditing as R439. Each is rejected by both seed14 and the independent + audit. + +## Commands and runtime + +From the repository root, after the directory is moved to `research//`: + +```sh +python3 -I -B research//verify_rehost.py --out research//RECEIPT.json +python3 -I -B research//verify_rehost.py --check research//RECEIPT.json +``` + +From the repository root: + +```sh +python3 -I -B research/bit-r438-transport-rehost/verify_rehost.py --check research/bit-r438-transport-rehost/verify_rehost.receipt.json +``` + +- The last line is `PASS_R438_WINDOW_REHOST S=54 opt=10x(42,5)+1x(42,4) … controls=29 no_new_kappa`. +- `python3 -O` is refused with a `FAIL_` line and exit 2. +- The run takes about 4–7 s, standard library only, on CPython 3.14.4 (Linux x86_64) with no network. +- `--repo` defaults to three `dirname`s above the script, which is the repo root once the script sits + in `research//`. That default was tested in a mock tree. + +## Inputs and pins + +- **Main-tree files**, read from `--repo`, with sha256 and git-blob pins in `PINS`: + - `research/bit589-width-packing/packing.py` and `research/bit589-width-packing/SOURCES.json`; + - the PR589 record `research/e8-bit-p111-tuned/tune/EXPECTED.json` and the frozen selection + `research/e8-bit-p111-tuned/data/selection9-p111.json`; + - the three pinned engines in `research/native-complex-moment552/engines/`; + - seed72's `verify.py`, `wopt.py` and `windows.py`; + - PR442 `hosting_core.py`, `audit_hosted_k.py` and `global_k.py`; + - seed14's `verify.py`. +- **Base.** Canonical main `0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2`. +- **Vendored.** `vendor/pr1043/CERTIFICATE.json` is a byte copy from PR1043 head + `e309e17f83f5759b1ea1fa24a76f24838784cb4d` (sha256 `32c6cd61…`, blob `56400920…`), with a NOTICE. + +## Scope: checked and not checked + +**Checked.** +- PR1023's slot model: 9 idle children × 222 copies, whole width-8 residuals, no banks, replica-local + hosting. +- The frozen PR442/PR589 nine-stage recipe and its windows. +- Uniformity across replicas is optimal, because the idle sum is additive over replicas and the + per-replica optimum is unique. +- The certificate is grid optimality at each profile's own c + 10⁻²⁴. + +**Not checked.** +- No hosted template was emitted, and none of the following was rerun: `emit_k`, the full + `audit_hosted_k` on a template, `assemble9`, or the native, C++ and NumPy pipeline of PR1043. The + slot-level rules were checked instead. +- Local profile (a) is taken from PR1043's certificate; it is not re-derived from the word here. +- Local profile (b) is a **declared input**: the paid profile of PR1043's word after one A-transport + (op 2027 → position 154 at frame 79). That move is from the PR1345 move class. This script does not rebuild or replay that word; + `verify_transport.py` in this package does. Only its rank mass (5121) and child count (2918) are checked. +- Projector compatibility of mixed occupancy (#1307), owner/physical routing beyond the slot audit, + and the H1–H5 interface were not checked. +- Out of scope: cross-replica owner maps, banks, split residuals and recipe changes. +- All inherited assumptions remain: all-size compilation, common labels and mutable sources, + whole-call hosting, precision and tape, analytic transfer, and the bad-residue surcharge. + +## Open next questions + +1. Emit and audit the R438 hosted template with this selection through PR1043's pipeline (emit_k, + audit_hosted_k, assemble9). That would turn the slot certificate into a complete hosted invoice. +2. Once the transported word (b) is replayed independently, rerun this script with its certified + local profile. +3. Does the single 34-remainder copy pass #1307's projector check? + +## Credits + +- **PR1043**, Ali Romman (@aliromman), with OpenAI Codex assistance: the R438 source-boundary word, its + local profile, `hosting_change` and the endpoint reproduced here. +- **PR1345**, hipotures: the transport atlas move class behind profile (b). +- **PR589, PR510 and PR463**, DreamingOfClouds: the bit word and the nine-stage hosted template. +- **PR555**, eumemic. +- **PR442**, DaysSky: idle-axis hosting and `hosting_core.expand`. +- **PR443/444**, chafreaky: the audit lineage. PR386/436: Zhihao Chen and eumemic. +- **PR1023** (`bit589-width-packing`), Sagar Thakrar: the slot model, `g_interval`, `endpoint` and + `width8_optimality`. +- **seed72** (`bit589-width7-windows-seed72`), Sagar Thakrar: the checked windows and `maxflow_assign`. +- **seed14** (`bit-helper470-window-placement-seed14`), Hanson Sun (@bbMisk), with OpenAI Codex + assistance: `allocate`, `placement_audit`, `owners_for_replicas` and the independent + schedule/windows. +- **PR886** (`bit589-frame-optimum`, frameopt), SethBurkart123: the fixed-word frame optimum, context + for bit-word optimality. +- PR1256, Ross Richardson: helper470 retirement context. +- The retained moment-engine authors. + +Prepared by Sagar Thakrar (thakrarsagar) with substantial AI assistance from Claude (Anthropic) via +Claude Code. Scouting and implementation were AI-assisted; no independent human review is implied. +New material is Apache-2.0. diff --git a/research/bit-r438-transport-rehost/NOTES-transport.md b/research/bit-r438-transport-rehost/NOTES-transport.md new file mode 100644 index 0000000000..c1a983934c --- /dev/null +++ b/research/bit-r438-transport-rehost/NOTES-transport.md @@ -0,0 +1,337 @@ +# R438 bit word: one improving transport, plus two PR1345 atlas crash fixes + +**Status: finite conditional local construction (word, replay, interface checks, priced endpoint) and a tool fix. No new kappa. Conditional on PR1043 (open, not admitted); the hosted program was not emitted or audited.** +The bit supplier does not bind. At the selected frontier +(`certificates/selected-result.json` -> `research/community-frontier1094-audit/ASSEMBLY.json`) +complex is `0.001675462676808103522925`, bit (PR589) is +`0.001733427039589844234749`, and kappa is `0.001672660197076918`. Every bit value +below is larger than the complex value, so kappa is unchanged. + +## Result + +PR1043's R438 word (Ali Romman) reads source77 late, at frame186. That changes +receiver444's path from PR589's `[0,79,509,392,513,1]` to `[0,186,509,392,513,1]`, +so its first two climbs become `(2,2)` instead of `(1,3)`. + +This package moves one elementary A addition: + +- **Before:** op 2027, `444 += 77` at frame186. It is the single-source A gate 1992 of R438. +- **After:** elementary slot 154 (also gate index 154) at frame79. Source77 is + still at its start frame79 there. + +After the move, receiver444's path is again PR589's `[0,79,509,392,513,1]`. Every +surviving register path equals PR589's R439 path. Only helper470's `[0,79,1]` is +gone. The arithmetic is unchanged: the same ADDs, the same D, and the same F2 map. + +| | PR589 R439 | PR1043 R438 | this word (R438-T154) | +|---|---:|---:|---:| +| helpers | 439 | 438 | 438 | +| local native ADDs (incl. D, C) | 24,305 | 24,248 | 24,248 | +| local records | 27,234 | 27,175 | 27,175 | +| local paid profile | `{1:1323,2:1342,3:79,4:44,5:102,6:11,7:19}` | `{1:1321,2:1344,3:78,4:44,5:102,6:11,7:18}` | `{1:1322,2:1342,3:79,4:44,5:102,6:11,7:18}` | +| local paid rank mass | 5,129 | 5,121 | 5,121 | +| fwd / rev bound, local / 9-stage bits | 49,347 / 1,113,070, 93 / 177 | same | same | +| hosted paid children / rank mass | 904,896 / 1,808,352 | 904,320 / 1,808,352 | 904,320 / 1,808,352 | +| bit c | 0.001733427039589844234749 | 0.001734176288479865766692 | **0.001734220472884893243548** | + +- **Exact new c:** `433555118221223310887/250000000000000000000000`. It is accepted + at c and rejected at `c + 1e-24 = 1734220472884893243549/10^24` by both engines, + with the inherited surcharge. +- **Gain:** +4.418441e-8 over PR1043 (+0.002548%) and +7.934e-7 over PR589 (+0.045773%). +- **Hosted profile:** `{1:380736, 2:400256, 3:22752, 4:26784, 5:29376, 6:17344, 7:26496, 10:160, 12:96, 14:32, 42:288}`. +- **Why it gains:** relative to R438 the change is rank1 +1, rank2 -2, rank3 +1 per + call, so 288x that is hosted. `d -> d(64/d)^c` is strictly concave, so `f(1)+f(3) < 2f(2)`. + +**Content pins** (canonical-JSON sha256, PR1043's `word_sha256` convention): + +- R439 `5642fd0e35a1acc11acff8d0c08350c1617e95f310d4d35ad63a651f9eeeba0b` +- R438 `27609b6880f8913900c0e1758c63a482f8588c16fede1bd0071c6df36ef2e285`. This + equals PR1043's CERTIFICATE. FRAME-PATHS.json also matches. +- New word `7aad486877b8c03866b8f1e6f909d12085da347d86aaae891f86f4e2dbc550d1`. + It is stored as `words/r438-t154.json.gz` (gzip file sha256 + `a353999bceac4ac957f540adfd3e5f8768297138b27132eeb83332e2ea4b1022`, mtime 0). + +**Gate format: re-merged.** The original multi-source gate format is kept and no gate is split: + +| Section | Gates | Note | +|---|---:|---| +| A | 2074 | Same as R438; the same 18 multi-source gates in the same order. | +| C | 2573 | PR1043 rule: literal reverse at frame 1. | +| D | 111 | Rebuild equals R438's D. | + +Only the A and C fields differ from R438. + +The scouting application split all A gates. That gives A 2129 / C 2628 gates: the +same elementary op sequence, ADDs 24,248 and the same profile, but word sha `9ad09c84…`. +**It is not used**, and we do not claim that every checker accepts it. + +**Equivalent placements.** + +- The commutation window of op 2027 is `[0, 2111]`. +- The events on 444/77 in that window are at 154, 155, 425, 2028-2034 and 2083. +- Insertion positions 0..425 at frame79 fall into the atlas segments represented by + **154 (chosen), 155 and 425**. Only positions 154, 155, 230 and 425 were built; each of those gives the same + profile, ADDs and frame paths. +- Their word shas: slot155 `5fbf512d…`, slot425 `d05f197e…`. +- Slot 230, R439's helper-birth position, gives `ae5f36b4…`. That is exactly PR589's + word with the birth `A[230]: 470 += 77` retarget to `444 += 77`, the read + `A[1993]: 444 += 470` deleted, and C and D rebuilt by PR1043's rules. In other + words, it is PR1043's deletion done at the helper's birth rather than at its late read. + +## Verification (exact outputs, CPython 3.14.4, Linux x86_64, 4 cores) + +**Step (1).** The vendored PR1043 `build.py` rebuilds R438 from the pinned PR589 word +(`e3e301e6…`, blob `85a4499b…`). It matches PR1043's CERTIFICATE local receipts and +FRAME-PATHS.json. PR1043's own `local_controls` give five rejections and the paid +neutral pair. + +**Step (3a). PR1043 `build.replay`** (arbitrary dirty endpoint, all 660 columns): +`adds 24248, records 27175, profile {1:1322,2:1342,3:79,4:44,5:102,6:11,7:18}, rank_mass 5121, copies 9, forward 49347, reverse 1113070, local_bits 93, nine_stage_bits 177`. +`wlib.paid` gives the same profile. + +**Step (3b). `xcheck_p.py words/… --json`**, exit 0, stdout: +``` +labels: 111 E8 root lines of the 120 (even unimodular lattice of rank 8, Gram det 1; 9 punctured lines); 636 frames, every one closed in the live labels +retained totals at the scatter: COPY ranks [7, 7, 7, 7, 7, 7, 7, 7, 7] (decoder constant 63); every total sits at the hyperplane of a distinct punctured line: True +legality and exact F2 replay on all 660 columns (sources, targets, 438 dirty helpers as symbolic inputs): PASS; gates D/A/B/C = 111/2074/712/2573 + H1_no_target_feeds_z holds + H2_D_frame0_targets_from_helpers holds + H3_A_z_only_scatter_targets_B_split holds + H4_C_literal_reverse_at_full holds + H5_V_identity holds + U_block_form holds + J_identity holds + K_equals_D holds + C_is_U_inverse holds + {"z_gates_A": 2074, "source_writes_A": 0, "z_gates_B": 499, ... "cleanup_gates": 2573} (full line in the receipt) +PASS interleaved interface lemma: hypotheses H1-H5 hold and the conclusion decomposes as U, J = I, D = K, C = U^-1 +``` +The interleaving statistics are identical to R438's. On R438, xcheck's JSON equals +PR1043's certificate `native.candidate.interface` exactly. + +**Step (4). Hosting and price.** + +- **Hosting:** PR1043's own `pipeline.selection()` (vendored) runs on the nine-stage + schedule of `bit589-width7-windows-seed72/windows.py`. That module anchors the + schedule to `global_k.py` and checks its windows three ways. The window capacities + `{0:14,1:7,2:28,3:7,4:42,5:7,6:42,7:28,8:14}` equal `bit589-width-packing`'s + unique slot model. +- **Same hosting change as PR1043:** the output equals PR1043's recorded + `hosting_change` exactly: the 9 removed slots, old `{2:435,4:444,6:444,7:666,42:9}`, + and new `{2:430,4:441,6:443,7:666,10:5,12:3,14:1,42:9}` remainders per replica. + This is expected because hosting depends on R, not on the local word. +- **Recount:** `288·local + 32·remainders` reproduces PR1043's audited R439 and R438 + hosted profiles. PR1043's `check_hosted_change` accepts the new word against the + PR589 audit (a consistency check only: the hosted profile is assembled from the same `288·local + 32·remainders` + identity it checks, so this is not an independent acceptance) (paid calls 904,896 -> 904,320, returned idle rank 2,304). Its + `idle_control` rejects with "Wrong hosted rank mass". +- **Price:** the endpoint uses assemble9.py's lines (`moment.certify`, then the + base-two engine with the surcharge at the lower and upper endpoint) and a second + two-engine check at c and c+1e-24. It reproduces PR589's and PR1043's invoice c + exactly and gives the new c above. + +**Step (5). Local optimality.** + +**PR886 `frameopt.py`** at the new c, about 22 s: + +| Word | Improving components | Smallest alternative delta | Notes | +|---|---:|---:|---| +| new word | **0** | +9.114249e-4 | 157 free gates, 132 components | +| degraded positive control | 37 | | recovers the new profile exactly | +| R438 | 0 | | frame-only cannot see this transport | + +**PR1345 atlas** with `atlas.patch`, line 28 set to the new c, on the new word: + +| Section | Ops | Legal moves | Same profile | Strictly worse | Improving | Smallest strict loss | +|---|---:|---:|---:|---:|---:|---| +| A | 2129 | 5815 | 5579 | 236 | **0** | 8.0046e-6 | +| B | 934 | 3561 | 3226 | 335 | **0** | 1.9424e-3 | + +- **Shared-register pairs:** A has 13,672 pairs, with 224,369 scored, 209,485 same, + 13,995 worse, 889 illegal and **0 improving**. B has 6,006 pairs, with 218,448 + scored, 202,222 same, 15,439 worse, 787 illegal and **0 improving**. +- **Not covered:** whole components exceed the budget (A: one of 1,923; B: five of + 149-206) and are not enumerated, as in PR1345. + +**Negative controls (verify_transport.py; all must reject).** Each word control is +rejected by PR1043 replay and by xcheck_p, except where noted: + +| # | Control | Rejection | +|---:|---|---| +| 1 | Read at frame79 after source77 climbed (slot 426) | "Frame descent"; xcheck "climb not nested: register 77 from frame 186 (dim 2) to frame 79 (dim 1)" | +| 2 | Early read kept at frame186 (slot 154) | same two rejections | +| 3 | Stale R438 C | Replay **accepts**: C is only reordered across commuting gates, so it is F2-correct. xcheck rejects ("H4 … FAILS", "REJECT interface"). So H4, not F2, guards the literal format. | +| 4 | One D operand dropped | "Wrong arbitrary-dirty endpoint"; xcheck "targets not y + x" | +| 5 | R438 hosted profile at the new c | rejected | +| 6 | New profile at c+1e-24 | rejected | +| 7 | Omitted returned idle charge | PR1043 `idle_control` rejects | +| 8 | Flipped byte in the pinned PR589 word | sha256 pin rejects | + +PR1043's own 5 controls also run. Positive controls: the paid neutral ADD pair +(+2 ADDs, same profile), and the new profile is accepted at R438's c. + +## PR1345 atlas bugs (`atlas.patch`, 3 changed lines) + +The atlas file is research/bit589-transport-atlas/atlas.py at head b54a856a. + +1. **Bug 1, line 250 / 282-284.** With any improving single, + `dict(ops=…, **dict(stat), …, improving=improving[:5])` fails with + `TypeError: dict() got multiple values for keyword argument 'improving'`. + The fix counts under `stat['improving_count']`. +2. **Bug 2, lines 375 and 416.** `best = (d, moves)`, so `d[0] < best[0]` compares a + Fraction with a tuple and fails with + `TypeError: '<' not supported between instances of 'Fraction' and 'tuple'`. + The fix uses `best[0][0]`. + +The bug fix does not touch the hard-coded PR589 c on line 28. A separate, asserted +substitution changes it only for the new-word run. + +**`atlas_bugs.py` results.** All PR1043/PR1345 inputs come from the pinned vendored copies. + +| Run | Result | Time | +|---|---|---:| +| pristine file on R438 | exit 1, **TypeError at line 282** (bug 1) | 36 s | +| hunk 1 only on R438 | exit 1, **TypeError at line 416** (bug 2) | 95 s | +| patched on R438 | exit 0 (see below) | 139 s | +| patched on PR589 | output **equals PR1345's result.json** and passes verify.sh's census asserts | 140 s | +| pristine on PR589 (`--full`) | same, so the bugs are latent on PR589 | 169 s (earlier run, 5 jobs on 4 cores) | + +On R438 the patched atlas reports exactly three improving singles: op 2027 -> slots +154/155/425 at frame79, delta -9.110061e-4 each at PR589's c. It also reports 190 +improving A pairs; the best is `[[2027,154,79],[2030,2028,509]]`, which adds nothing +beyond the single move. + +- **Line 375 on these words:** it is unreachable, because every component exceeds the + 200,000-combination budget. Its pristine condition is evaluated on sample values + and raises the same TypeError; the patched condition returns True. +- **Patch controls:** the patch is checked to be the minimal difflib diff of its own + application, and a patch with corrupted context is rejected. +- **Result-comparison controls:** a mutated result.json fails the census, and the R438 + output differs from result.json. + +Prior art: `research/bit589-fixed-option-cross-pairs-seed16/atlas.py` (Cinna Davis) +already uses `best[0][0]` in its adapted cross-pair loop. PR1345's own file was not fixed. + +## Commands and runtime + +From the repository root, after moving this directory to `research//`: + +```sh +python3 -I -B research//verify_transport.py --out # 38-42 s; frameopt/xcheck in 4 subprocesses +python3 -I -B research//verify_transport.py --full --out # 183 s (atlas on the new word: 144 s) +python3 -I -B research//atlas_bugs.py --out # 140 s; 4 atlas runs in parallel +python3 -I -B research//atlas_bugs.py --full # adds the pristine PR589 run (about 3.5 min) +``` + +- **Options:** `--repo ROOT` overrides the default, which is three directory levels + above the script. `--jobs N` sets the number of parallel subprocesses. +- **Output:** each script prints one final `PASS_…`/`FAIL_…` line and refuses `python -O`. +- **Receipts:** `--out` without a path writes `