From bc05792bcba405118bdab09e0a22de2b5252cf55 Mon Sep 17 00:00:00 2001 From: Christopher Williams Date: Thu, 24 Sep 2026 10:56:40 -0400 Subject: [PATCH] =?UTF-8?q?phase11:=20merge=2045=20+=20cookbook=20154=20?= =?UTF-8?q?=E2=80=94=20581=20bodies=20/=20590=20regions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Worker A's 0x800F452C (112 B, maspsx=epilogue, second attempt) -- a sibling of its own 0x800F4098, matched with the mid-function-branch-target lever applied first try. Worker A asked FIVE TIMES for the lui-page rule to be prominent, having made the mistake five times. It is now cookbook 154 and the FIRST of the five things the workflow doc tells a new worker, with all five instances tabulated. The fifth instance added the missing half: the immediate is a SIGNED DISPLACEMENT, and the signature of the error is 'a residual of ONE differing byte whose only difference is a lui or addiu immediate'. Also confirmed from worker A's side: the shape A/B correction works -- 0x800F452C is a shape-B row and closed with the single token, so the tail filter is obsolete and A has dropped it. --- config/regions.tsv | 1 + docs/MATCHING_COOKBOOK.md | 27 +++++++++++++++++++++++++++ docs/ORCHESTRATOR_WORKFLOW.md | 20 ++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/config/regions.tsv b/config/regions.tsv index fb95238..34fc18f 100644 --- a/config/regions.tsv +++ b/config/regions.tsv @@ -484,6 +484,7 @@ 0x800F4098 0x800F4100 src/func_800F4098.c maspsx=epilogue 0x800F42AC 0x800F430C src/func_800F42AC.c maspsx=epilogue 0x800F44D0 0x800F452C src/func_800F44D0.c maspsx=epilogue +0x800F452C 0x800F459C src/func_800F452C.c maspsx=epilogue 0x800F5200 0x800F521C src/func_800F5200.c 0x800F5AF8 0x800F5B40 src/func_800F5AF8.c 0x800F5B40 0x800F5B70 src/func_800F5B40.c diff --git a/docs/MATCHING_COOKBOOK.md b/docs/MATCHING_COOKBOOK.md index db49d41..a2ec1d2 100644 --- a/docs/MATCHING_COOKBOOK.md +++ b/docs/MATCHING_COOKBOOK.md @@ -2525,3 +2525,30 @@ by a worker who has not seen it: Worker D's `0x800FAF84` writes through `sp+16` with the saved `s0` at `sp+24`, so the local is **8 bytes** while the callee writes past it. **That is a real property of the original.** + +### 154. *** READ THIS FIRST: derive every absolute address from the (page, signed immediate) PAIR *** + +**Worker A asked for this line five times, having made the mistake five times. It is the single most +repeated error in this project, so it goes first.** + + lui a0,0x8011 + addiu a0,a0,-6504 <- the address is 0x80110000 - 6504 = 0x8010E698 + <- NOT 0x8011E698, and NOT 0x8010E6A8 + +**The `lui` immediate is the PAGE. The second instruction's immediate is a SIGNED DISPLACEMENT from +that page.** Reading the printed value as "the low half of the address" is wrong, and reading the +magnitude without its sign is wrong in the same way. + +**THE SIGNATURE IS DIAGNOSTIC:** *a residual of ONE differing byte whose only difference is a `lui` +or `addiu` immediate.* If you see that, you have made this error — do not go looking for a source +shape. Worker A's five instances: + +| row | error | cause | +|---|---|---| +| gp-relative | `sw zero,2132(gp)` read as the wrong global | offset guessed instead of derived from `_gp = 0x80121938` | +| `0x800F44D0` | `lui v0,0x8012; lw v0,-22316(v0)` read as 0x8012A8D4 | the page is not part of the address; correct is **0x8011A8D4** | +| `0x800F42AC` | read as 0x8011E644 | correct is **0x8010E644** | +| `0x800F4098` | read as 0x8011E5F4 | correct is **0x8010E5F4** | +| `0x800F452C` | read as 0x8010E6A8 | **the sign**: correct is **0x8010E698** | + +**Derive it arithmetically, every time: `page * 0x10000 + sign_extend(immediate)`.** diff --git a/docs/ORCHESTRATOR_WORKFLOW.md b/docs/ORCHESTRATOR_WORKFLOW.md index 1abb1be..5a95405 100644 --- a/docs/ORCHESTRATOR_WORKFLOW.md +++ b/docs/ORCHESTRATOR_WORKFLOW.md @@ -436,3 +436,23 @@ so the ledger is session-scoped by design — it coordinates live workers, not h assumption the work assignment rests on.** Adjacency optimised *which* row to take without anyone revisiting *who owns it*. When you adopt a worker-discovered heuristic, re-check what it assumes about your own process. + + +## The five things to tell a new worker FIRST (Phase 11) + +Ordered by how much time each has cost workers in practice: + +1. **Derive every absolute address from the `(page, signed immediate)` PAIR** — `lui a0,0x8011` / + `addiu a0,a0,-6504` is `0x80110000 - 6504 = 0x8010E698`, not `0x8011E698` and not `0x8010E6A8`. + **The signature of getting this wrong is a residual of ONE differing byte whose only difference is + a `lui` or `addiu` immediate.** This was the most repeated error in the phase — five instances, + all one worker. +2. **A match is `differing_bytes=0` AND `result=MATCH`,** and the whole-binary gate must stay green. + Functional equivalence is not a match. +3. **Cost is tie-break density, not size.** 548 B matched first attempt; 176 B took nine and never + closed. **Prefer a repetitive body over a small one**, and prefer small among equal redundancy + because the milestone counts BODIES. +4. **When the structure is confirmed and only register numbers differ, CLASSIFY — do not grind.** + That is the allocator class, and it is where most failures live. +5. **Check the row is free with a CONTAINMENT test** (a region's end address is exclusive), **append + `wip` before starting, and append `released` only for a row you yourself took.**