mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-09-26 13:33:34 -04:00
docs(phase-32): cookbook §501-I — manufacturing §172 producer-2 orphans (an s16 read from memory at each use), the shared-scratch store dependence, the laundered first-statement address (func_8017DC80); T4b row (9 banked)
This commit is contained in:
@@ -37327,3 +37327,23 @@ in sched1/local-alloc, both fixed by spelling the addPrim the way libgpu's `P_TA
|
||||
**Law (the whole prologue-weave class, three functions today):** a constant's position in the prologue is not steerable by its
|
||||
source position or by a hard-reg pin — it is decided by which latency stalls exist above it; change the stalls (a multi-set
|
||||
load fills them) and the constants move. Read `-dS`'s ready-list traces for the `T-nn` empty cycles.
|
||||
|
||||
**§501-I — MANUFACTURING §172 PRODUCER-2 ORPHANS ON PURPOSE: read the `s16` from MEMORY at each use, and the shared-scratch
|
||||
store dependence (P32 T4b, `ov_SC07_002:func_8017DC80`, the historic −33 LENGTH wall's last 46 rows banked by a Fable agent —
|
||||
346/346).** Three mechanisms, each one hunk:
|
||||
(A) **Frame 0x70 = two combine USE-orphans, MANUFACTURED.** §172 v2 called an extra orphan "not reachable by re-spelling the same
|
||||
computation". The species that IS reachable: an `s16` field READ FROM MEMORY at each use — here the mode halfword, once in the
|
||||
branch (`& 0xC000`) and once arm-duplicated (`& 0xFFF`). `extendhisi2` (mips.md:2340) force_not_mems the load into a HI reg + the
|
||||
`sll/sra` pair; combine.c:1664 `added_sets_1` keeps the HI reg alive across the 3-way merge, so the `ashift` temp is orphaned by
|
||||
`distribute_notes` (~10835) into a `(use)` → `alter_reg` 8-byte slot per clamp block. The same spelling yields the target's
|
||||
`addu $v1,$v0,$zero` copy (46 → 24). **Corollary to §172:** the orphan rule "the HImode load's reg carries an extra HImode use"
|
||||
is satisfied by a SECOND MEMORY READ of the same halfword in the same block — no need to synthesize a `?:` copy.
|
||||
(B) **DR_TPAGE: one scratch variable carries the len byte AND the tpage word** — `tp = 1; q[3] = tp; … tp = tpage; *(u32 *)(q+4) =
|
||||
tp;`. `schedule_select`'s hazard rule always picks a ready store over ALU insns, so the `sb` must be UNREADY: the shared variable
|
||||
gives it an anti-dependence on the `or`; `tp` becomes 2-set (no birthing boost) and both share `$v1`. `n` must be UNPINNED (a
|
||||
hard-reg `n` dying at `sll n,5` hands `$s0` to the temp via `combine_regs`) (24 → 16; the same idiom is banked at src/800.c:3826).
|
||||
(C) **`la $a0` first:** sched2 places the lowest-LUID body insn first, so `arg = &D_800AF648;` must be the FIRST statement AND carry
|
||||
a zero-byte `__asm__("" : "=r"(arg) : "0"(arg))` — otherwise combine substitutes cse's REG_EQUAL constant into the call-site copy
|
||||
and deletes the first set (16 → MATCH). Inert (do not re-try): the P_TAG-bitfield `setlen/addPrim` here (76, 345 ins — the
|
||||
bitfield is the dial for the §351/§364 SPRT family, not for this DR_TPAGE shape), q/qt/ov pin ablations, DR_TPAGE statement
|
||||
re-orders without the shared scratch, an unlaundered or `$4`-pinned `arg`, call-first source order (33).
|
||||
|
||||
@@ -99,7 +99,7 @@ Scale estimate: 3–5 sessions.
|
||||
`func_80011380` → `.run/m3/opus/func_80011380.c`; `func_801834A4` → `.run/S71_gate14/ov_SC03_105*/`),
|
||||
`exclude_audit --write`, `backlog.py render`; a T3 idiom naming a wall's mechanism re-opens that row
|
||||
(bounded: one attempt, permuter first). Wall table into this file; cookbook §496+; decision log; accelerators.
|
||||
- [ ] **T4b — crack and bank the final 15 (ADDED 2026-09-05 by Drew's directive, supersedes the kill gate: "anything that isn't the original hand-written asm or the PsyQ libs needs to be cracked and banked before we finish"; "before you spawn Fable agents, hand crack each and figure out the blocker to fix it")** (xHigh→Max recommended; Fable agents authorised AFTER the hand pass): for each of the 15 rows (8 NEAR + 7 walls) the coordinator hand-cracks — read the diff + the recorded mechanism, read the compiler (dumps + source), find the lever the record did not try, measure, bank through the verified chain (rtu in the real TU → bank.sh / gate_main) — and only then hands the leftovers to one Fable agent each (brief `.run/P32/t5x/BRIEF.md`). Plumbing landed first: `src/800_c.c` decl/extern edits byte-neutral (this commit). Work dirs `.run/P32/t4b/<fn>/`. **Hand pass DONE 2026-09-05 (S83): all 15 rows read against their diffs and the compiler; 22 spellings measured (all regressions), 0 banks; every row's blocker refined to a named mechanism with the untried lever written in `.run/P32/t4b/<fn>/NOTES.md` (func_80032A74: the transient caller-save area — reload1.c order proven; func_8017DF28: the block-move pseudo reuse vs reorg's branch-target hoist; func_80011380: the target's assignment shape; func_801834A4: sign-hoist vs const-hoist thresholds; …). TU plumbing for func_80039DEC/func_800391D4 committed byte-neutral (`commit:3953`). 15 Fable agents launched ~13:05 MDT (two usage-limit outages, resumed each time via SendMessage). **T4b (1): `main:func_800391D4` BANKED 143dbb89 (`commit:3956`) — a pinned wall: explicit promotion + insn_count pads 7→9 (§501); pin dropped. **T4b (2): `main:func_80039DEC` BANKED 143dbb89 (`commit:3959`) — a pinned wall: the natural switch with duplicated tails, so a2's raw copy keeps 4 refs and wins $a3 (§501-B); pins 7 → 5. **T4b (3): `md_MAIN_009:func_800CD674` BANKED d270f695 (`commit:3964`) — the $a3↔$t1 plateau: a 2-death pseudo is excluded from local_alloc; a fresh single-death pseudo for prim 4 + a zero-byte asm set on prim 3's copy against sched1's birthing boost (§501-C). **T4b (4): `ov_SC06_022:func_8017DF28` BANKED 2a7d7d4e (`commit:3966`) — a pinned wall: one value-returning call made the call a sched1 "birthing" insn (reg_n_sets[$v0]==1); a second $v0 set via RotMatrixY's real pointer-returning type (§501-D); pins 5 → 4. **T4b (5): `main:func_80020DA4` BANKED 143dbb89 (`commit:3969`) — a pinned wall: the $6 pin forbade $a2 at reload's retry (regs_ever_live → bad_spill_regs); unpinned + two zero-byte launders (§501-E); pins 4 → 3; main 3 open. **T4b (6): `ov_SC03_105:func_801834A4` BANKED d305ff6d (`commit:3972`) — a pinned wall: the S71 loop.c proof holds, the lever is cse — a hard-reg copy of the dividend + `sign = half >> 31` at the loop top splits the quantity (§501-F); pins 3 → 2. **T4b (7): `md_MAIN_003:func_800CF3E8` BANKED dd1b32ec (`commit:3976`, module 100% C) — the 27-row alias basin was three passes: sched1 birthing boost (second live set), a phantom USE nop in sched2's model, a local-alloc tie broken by the P_TAG bitfield's flow ref count (§501-G). `main:func_80032A74` stays NEAR 1 — the 0x48 slot is a ghost pseudo, the caller-save route refuted (Fable, 402k tokens).** Agents 3 at a time from `.run/P32/t5x/resume_queue.txt`; **T4b (8): `md_MAIN_009:func_800CD92C` BANKED d270f695 (`commit:3979`, module 100% C) — zero pins: m24 by flow ref count, the tpage constants float when the tag load is multi-set (§501-H).** 6 rows remain (3 running: 39308, 185810, DC80; queued: CF408, CF6D0, 11380).**
|
||||
- [ ] **T4b — crack and bank the final 15 (ADDED 2026-09-05 by Drew's directive, supersedes the kill gate: "anything that isn't the original hand-written asm or the PsyQ libs needs to be cracked and banked before we finish"; "before you spawn Fable agents, hand crack each and figure out the blocker to fix it")** (xHigh→Max recommended; Fable agents authorised AFTER the hand pass): for each of the 15 rows (8 NEAR + 7 walls) the coordinator hand-cracks — read the diff + the recorded mechanism, read the compiler (dumps + source), find the lever the record did not try, measure, bank through the verified chain (rtu in the real TU → bank.sh / gate_main) — and only then hands the leftovers to one Fable agent each (brief `.run/P32/t5x/BRIEF.md`). Plumbing landed first: `src/800_c.c` decl/extern edits byte-neutral (this commit). Work dirs `.run/P32/t4b/<fn>/`. **Hand pass DONE 2026-09-05 (S83): all 15 rows read against their diffs and the compiler; 22 spellings measured (all regressions), 0 banks; every row's blocker refined to a named mechanism with the untried lever written in `.run/P32/t4b/<fn>/NOTES.md` (func_80032A74: the transient caller-save area — reload1.c order proven; func_8017DF28: the block-move pseudo reuse vs reorg's branch-target hoist; func_80011380: the target's assignment shape; func_801834A4: sign-hoist vs const-hoist thresholds; …). TU plumbing for func_80039DEC/func_800391D4 committed byte-neutral (`commit:3953`). 15 Fable agents launched ~13:05 MDT (two usage-limit outages, resumed each time via SendMessage). **T4b (1): `main:func_800391D4` BANKED 143dbb89 (`commit:3956`) — a pinned wall: explicit promotion + insn_count pads 7→9 (§501); pin dropped. **T4b (2): `main:func_80039DEC` BANKED 143dbb89 (`commit:3959`) — a pinned wall: the natural switch with duplicated tails, so a2's raw copy keeps 4 refs and wins $a3 (§501-B); pins 7 → 5. **T4b (3): `md_MAIN_009:func_800CD674` BANKED d270f695 (`commit:3964`) — the $a3↔$t1 plateau: a 2-death pseudo is excluded from local_alloc; a fresh single-death pseudo for prim 4 + a zero-byte asm set on prim 3's copy against sched1's birthing boost (§501-C). **T4b (4): `ov_SC06_022:func_8017DF28` BANKED 2a7d7d4e (`commit:3966`) — a pinned wall: one value-returning call made the call a sched1 "birthing" insn (reg_n_sets[$v0]==1); a second $v0 set via RotMatrixY's real pointer-returning type (§501-D); pins 5 → 4. **T4b (5): `main:func_80020DA4` BANKED 143dbb89 (`commit:3969`) — a pinned wall: the $6 pin forbade $a2 at reload's retry (regs_ever_live → bad_spill_regs); unpinned + two zero-byte launders (§501-E); pins 4 → 3; main 3 open. **T4b (6): `ov_SC03_105:func_801834A4` BANKED d305ff6d (`commit:3972`) — a pinned wall: the S71 loop.c proof holds, the lever is cse — a hard-reg copy of the dividend + `sign = half >> 31` at the loop top splits the quantity (§501-F); pins 3 → 2. **T4b (7): `md_MAIN_003:func_800CF3E8` BANKED dd1b32ec (`commit:3976`, module 100% C) — the 27-row alias basin was three passes: sched1 birthing boost (second live set), a phantom USE nop in sched2's model, a local-alloc tie broken by the P_TAG bitfield's flow ref count (§501-G). `main:func_80032A74` stays NEAR 1 — the 0x48 slot is a ghost pseudo, the caller-save route refuted (Fable, 402k tokens).** Agents 3 at a time from `.run/P32/t5x/resume_queue.txt`; **T4b (8): `md_MAIN_009:func_800CD92C` BANKED d270f695 (`commit:3979`, module 100% C) — zero pins: m24 by flow ref count, the tpage constants float when the tag load is multi-set (§501-H). **T4b (9): `ov_SC07_002:func_8017DC80` BANKED fad71342 (`commit:3983`, the overlay's jr TU 100% C) — manufactured §172 producer-2 orphans (s16 read from memory at each use), the shared-scratch store dependence, a laundered first-statement address (§501-I). `func_80185810` 35 → 13 NEAR (Fable, 471k tokens; residual = the `cl &= 0xFFFF` second-set fence).** 4 rows remain (3 running: 39308, CF408, CF6D0; queued: 11380). Drew 2026-09-05: Fable was permission, not a requirement — Opus is fine where a sibling recipe exists.**
|
||||
- [ ] **T5 — PhaseEnd** (Max, Tier 1 — prompt R27): P7 checkbox walk; milestone demo (R22 fleet N/N, tools-health,
|
||||
`verbatim_check --strict`, final census, wall ledger, parked-5 dispositions via `make audit-disc`,
|
||||
`make report` all three metrics + main `143dbb89…` with/without SDK dirs, corrected denominators); **WAIT
|
||||
|
||||
Reference in New Issue
Block a user