diff --git a/.run/giants/s17_func_801463A0_match101.c b/.run/giants/s17_func_801463A0_match101.c new file mode 100644 index 000000000..e2f37ef09 --- /dev/null +++ b/.run/giants/s17_func_801463A0_match101.c @@ -0,0 +1,66 @@ +// @class: struct +// @stuck: none โ€” MATCH (101 ins). Keys: 8-byte BE0->BE8 unaligned copy via char[8] struct (align 1 -> lwl/lwr/swl/swr); three sh to separate BE0/BE2/BE4 globals; D_80126B78 is s32* loaded once into $s0 at top; three short assigns MUST precede the D_80126B9C read-modify-write so the B9C store schedules last. +#include "common.h" + +typedef struct { char _b[8]; } M8_801463A0; /* size 8, align 1 -> unaligned lwl/lwr copy */ + +extern void func_8014C6F4(void *); +extern void func_80155150(void *); +extern void func_801470C0(s32); +extern void func_80147478(s32); +extern void func_80147118(s32); +extern void func_8014BDE8(s32); +extern short func_801508F8(s32); +extern void func_8014B5B0(s32*); +extern void func_80161D88(void *); + +extern s32 D_80126B58; +extern s32 *D_80126B78; +extern u16 D_80126B5E; +extern u16 D_80126B62; +extern u16 D_80126B66; +extern u16 D_80126C90; +extern u16 D_80126C92; +extern u16 D_80126C94; +extern s32 D_80126B9C; +extern s32 D_80126BA0; +extern u16 D_80126BE0; +extern u16 D_80126BE8; +extern u16 D_80126BE2; +extern u16 D_80126BE4; +extern short D_80126C9E; + +void func_801463A0(void) { + int iVar1; + short sVar2; + + iVar1 = (int)D_80126B78; + func_8014C6F4(&D_80126B58); + func_80155150(&D_80126B58); + ((void (*)(void *))func_801470C0)(&D_80126B58); + ((void (*)(void *))func_80147478)(&D_80126B58); + ((void (*)(void *))func_80147118)(&D_80126B58); + if (iVar1 != 0) { + sVar2 = D_80126B5E + D_80126C90; + *(short *)(iVar1 + 8) = sVar2; + *(int *)(iVar1 + 0x48) = (int)sVar2; + sVar2 = D_80126B62 + D_80126C92; + *(short *)(iVar1 + 0xA) = sVar2; + *(int *)(iVar1 + 0x4C) = (int)sVar2; + sVar2 = D_80126B66 + D_80126C94; + *(short *)(iVar1 + 0xC) = sVar2; + *(unsigned short *)(iVar1 + 0x2C) = *(unsigned short *)(iVar1 + 0x2C) | 0x11; + *(int *)(iVar1 + 0x50) = (int)sVar2; + } + ((void (*)(void *))func_8014BDE8)(&D_80126B58); + *(M8_801463A0 *)&D_80126BE8 = *(M8_801463A0 *)&D_80126BE0; + D_80126BE0 = D_80126B5E; + D_80126BE2 = D_80126B62; + D_80126BE4 = D_80126B66; + D_80126BA0 = D_80126B9C; + D_80126B9C = D_80126B9C & 0x3fffffff; + ((void (*)(void *))func_801508F8)(&D_80126B58); + D_80126C9E = 0; + ((void (*)(void *))func_8014B5B0)(&D_80126B58); + func_80161D88(&D_80126B58); +} diff --git a/phase-ends/CURRENT_PHASE.md b/phase-ends/CURRENT_PHASE.md index 1dc6347ce..7f5c496d5 100644 --- a/phase-ends/CURRENT_PHASE.md +++ b/phase-ends/CURRENT_PHASE.md @@ -2875,3 +2875,29 @@ conditional) ยท main-EXE/B9 + GLM/B6 + resident's 14 walls (P30) ยท behemoths B7 correct inline `lwl/lwr` shape. **Residual: 100 vs 101 ins, 36 mismatched โ€” register assignment (`$a3/$a1` vs the target's `$a1/$a0`) plus one folded instruction.** That is a NORMAL near-miss now, permuter-shaped, not a link failure. Fixed draft preserved: `.run/giants/s17_func_801463A0_symfix.c`. + +- **๐Ÿ”Ž 2026-07-24 (SESSION-17) โ€” `func_801463A0` driven from "gate rejects, cause unknown" to a + MASKED-MATCH with ONE named blocker left. Not banked; the remaining step is a documented ยงH antidote.** + Three byte-measured iterations, each falsifying the previous hypothesis: + | variant | decls | result | + |---|---|---| + | original | `_s` aliases (undefined symbols) | rtu MATCH, gate reject โ€” **the symbol set was missing `D_80126BE8`** | + | struct-typed `&sym` | `extern M8 D_80126BE0;` | 100 vs 101 ins, 36 mismatched | + | array-decay + cast-at-use | `extern u8 D_80126BE0[];` | 100 vs 101, 36 โ€” **identical**, so decay was not the lever | + | **direct-symbol scalar** | `extern u16 D_80126BE0;` | **MATCH (101 ins)** โœ… | + **WHY the length differed (byte-read at idx 76โ€“81):** the target **re-materializes `lui $at,%hi(sym)` + at every scalar store** (2 ins each); the array/struct forms let gcc CSE the address into `$a3` once + and store in 1 โ€” so my drafts were exactly one instruction short. The direct-symbol form restores the + per-store materialization. + **THE REMAINING BLOCKER, named:** in the REAL TU `D_80126BE0`'s canonical decl is + `extern u8 D_80126BE0[];` โ€” and it lives **inside a `DEFINE_func_*` macro body** in + `engine_core.h:19813`. So the `u16` form that MATCHES standalone gives `conflicting types for + D_80126BE0` in the TU (real cc1, via `rtu_match --stderr-out`). + **โ‡’ Two exits, and the cheap one is a trap:** `demacroize` would clear it but banks **ร—1** (+101 ins, + ~0.001pp) and forfeits the ร—138 โ€” **not worth it** for this function. The right exit is the + **ยงH CSE address-fold antidote** (`gcc-2.7.2-map/cse_expr.md` ยงH): a **balanced if/else diamond** + whose label is barrier-preceded makes cse start a FRESH table, killing the fold with **zero asm**, so + the canonical `u8[]` decl can stay and the bank propagates **ร—138 (+13,938 ins)**. That is the next + move on it โ€” deliberate, function-specific work, not a guess. + Preserved: `.run/giants/s17_func_801463A0_match101.c` (the standalone-MATCH form) + + `s17_func_801463A0_symfix.c` (the symbol-corrected form).