diff --git a/.run/P36/agents/ov_SC04_011__func_8012956C/related.txt b/.run/P36/agents/ov_SC04_011__func_8012956C/related.txt new file mode 100644 index 000000000..2e1441ab0 --- /dev/null +++ b/.run/P36/agents/ov_SC04_011__func_8012956C/related.txt @@ -0,0 +1,123 @@ +=== lever-free bodies in ov_SC04_011 sharing a callee or global with func_8012956C (19 found; top 6 by shared symbols) — read them for the SHAPE === +--- func_801299C8 (src/ov_SC04_011/ov_SC04_011.c:622) shares 3: D_801ED9C8 D_801ED9C9 D_801ED9CA --- +void func_801299C8(arg0, arg1, arg2) +s16 arg0; +s16 arg1; +u8 *arg2; +{ + u32 r; + u32 g; + u32 b; + s32 i; + + if (arg0 != 0) { + switch (arg1) { + case 1: + r = D_801F163A; + g = D_801F1562; + b = D_801F1540; + D_801ED9C8[0] = r * 5 >> 3; + D_801ED9C9[0] = g << 3; + D_801ED9CA[0] = (s32)(b * 255) >> 4; + D_801ED9C8[4] = (s32)(r * 143) >> 4; + D_801ED9C9[4] = g * 25 >> 1; + D_801ED9CA[4] = (s32)(b * 255) >> 4; + D_801ED9C8[8] = (s32)(r * 255) >> 4; + D_801ED9C9[8] = (s32)(g * 255) >> 4; + D_801ED9CA[8] = (s32)(b * 255) >> 4; + D_801ED9C8[12] = (s32)(r * 143) >> 4; + D_801ED9C9[12] = (s32)(g * 255) >> 4; + D_801ED9CA[12] = (s32)(b * 45) >> 2; + break; + case 0: + case 2: + i = arg1 * 4; + D_801ED9C8[i] = arg2[0x44] * D_801F163A >> 4; + D_801ED9C9[i] = arg2[0x45] * D_801F1562 >> 4; + D_801ED9CA[i] = arg2[0x46] * D_801F1540 >> 4; + i = (arg1 + 1) * 4; + D_801ED9C8[i] = arg2[0x47] * D_801F163A >> 4; + D_801ED9C9[i] = arg2[0x48] * D_801F1562 >> 4; + D_801ED9CA[i] = arg2[0x49] * D_801F1540 >> 4; + break; + case 3: + case 4: + arg2[0x20] = D_801F163A << 3; + arg2[0x21] = D_801F1562 << 3; + arg2[0x22] = D_801F1540 << 3; + break; + } + } +} + +--- func_80129428 (src/shared/ov/func_80129428.h:4) shares 1: D_80114EE0 --- +void func_80129428(void) { + D_80114EE0 = 1; +} + +--- func_8012943C (src/shared/ov/func_8012943C.h:4) shares 1: D_80114EE0 --- +void func_8012943C(void) { + D_80114EE0 = 0; +} + +--- func_8013D330 (src/ov_SC04_011/ov_SC04_011_jr_8013C98C.c:1203) shares 1: D_801F1620 --- +void func_8013D330(void) { + if ((D_801F163A & 0xff) != D_801F16AE) { + D_801F163A = ((D_801F163A & 0xff) < D_801F16AE) ? (D_801F163A + 1) : (D_801F163A - 1); + } + if ((D_801F1562 & 0xff) != D_801F161C) { + D_801F1562 = ((D_801F1562 & 0xff) < D_801F161C) ? (D_801F1562 + 1) : (D_801F1562 - 1); + } + if ((D_801F1540 & 0xff) != D_801F1561) { + D_801F1540 = ((D_801F1540 & 0xff) < D_801F1561) ? (D_801F1540 + 1) : (D_801F1540 - 1); + } + D_801F1620 = 1; +} + +--- func_80136ECC (src/shared/ov/func_80136ECC.h:6) shares 1: D_800A6518 --- +void func_80136ECC(s16 a0, s16 a1, s16 a2, s16 a3, u8 r, u8 g, u8 b) { + struct { + u32 tag; + s16 x0; + s16 y0; + s16 x1; + s16 y1; + u8 r; + u8 g; + u8 b; + } line; + line.x0 = a0; + line.tag = 0; + line.y0 = a1; + line.x1 = a2; + line.y1 = a3; + line.r = r; + line.g = g; + line.b = b; + GsSortLine(&line, &D_800A6518[(u16)D_800B9A02 * 20], 0); +} + +--- func_80137BD8 (src/shared/ov/func_80137BD8.h:11) shares 1: D_800A6518 --- +void func_80137BD8(s32 a0) { + u8 buf[8]; + if ((*(s32 *)(a0 + 8) & 0x1000) != 0) { + func_801392FC(a0, *(u8 *)(a0 + 0x1E), + &D_800A6518[(u16)D_800B9A02 * 20]); + if (*(u8 *)(a0 + 0x20) != 0) { + func_801397B0(a0); + } + } + if (D_80127524 == a0) { + if (*(s16 *)(a0 + 4) == 7) { + buf[0] = 0x39; + buf[1] = 0xFF; + buf[2] = 0x71; + func_80137DD4(a0, buf, &D_800A6518[(u16)D_800B9A02 * 20]); + } else if (*(s16 *)(a0 + 4) == 3) { + if ((D_800B99D8 & 4) != 0) { + func_80139680(a0, &D_800A6518[(u16)D_800B9A02 * 20]); + } + } + } +} + diff --git a/phase-ends/CURRENT_PHASE.md b/phase-ends/CURRENT_PHASE.md index ae025569a..3962309d9 100644 --- a/phase-ends/CURRENT_PHASE.md +++ b/phase-ends/CURRENT_PHASE.md @@ -1519,6 +1519,19 @@ accumulate here as the phase produces them.** already banked) and ADDED to the do-while question for Drew** — if he rules the class a lever, this body is one of its members. The agent also found `build/` deleted mid-run (the fleet gate's `make clean`): METHOD step 1 now dumps the target from `.run/P36/delever/baseline/`. `apply-body … IDENTICAL … KEPT`; `--propagate: 128 of 128`. + R22 `check-all: 218 passed, 0 failed of 218`; `lever_census --check: 15,239 pin/asm sites … 0 UNMARKED — OK`. +- **S103 — T7 agent c17: `func_8013D9B0` READ, not closed (96 → 15 in plain C; 140 vs 141) — and the last 15 are a GTE + HEADER MACRO, not the body.** Plain-C moves: one walked `Cmd_8013D53C *p` (the siblings' struct; two `u16*` + casts + had made a third walked pointer), `s16 rect[4]` filled field by field (replaces all four `"memory"` barriers), + LoadImage given both arguments (the target keeps `img` live in `a1`), the flag set in both arms (15 → 24 refs, beats + the pointer for `$s0`; the delay-slot filler re-merges the stores), `fc = gte;` inside the guard. The residual: a + `move t4,v0` before `swc2 $29,0(t4)` that no C variable can own, because `include/gte_inline.h`'s `gte_stORGB` does not + write `$12` itself. **Proof in scratch (asm, not claimable):** `gte_stORGB` respelled `"move $12, %0\n\tswc2 $29, + 0($12)" :: "r"(p) : "$12", "memory"` scores 2 (PsyQ `inline_o.h`'s `$12-$15` clobber list scores 6); a second macro + merged scores 0. The four macros are used only by the 134 `func_8013D9B0` copies, and a macro change must ship with a + new body for every copy (the old bodies pin the pointer to `$12`). **This is T5's GTE question** (one GTE header + under Sony's names; the phase plan says a clobber VARIANT is a lever, not a second spelling) **— for Drew, not a + bank.** The agent refused a dead second store that also reached 0. ## 🛑 SESSION CHECKPOINT — S103 (2026-09-10): T0–T6 ☑, **T7 RUNNING — the agent lane at FIVE, every landing harvested**. 24,119 → **16,273 sites** (−7,846) in this session; 20 agent draws (14 closed = 15 functions incl. a twin pair, 1 read without closing, 5 in flight at writing; c5/c6 relaunched on Opus after Fable ran out of credits) + 17 classes closed by generators alone (`delever_regen`); generators **R22, R23** added and R23 widened; `--try` learned header TUs; CI's `verbatim_check` fixed and wired into tools-health; R22 `check-all: 218 passed, 0 failed of 218` at every bank | `lever_census --check` OK (16,273 marked, 0 UNMARKED) · `lever_progress --check` OK (37 milestones) · last commit `750797a04` @@ -1614,6 +1627,11 @@ setsid nohup nice -n 10 .venv/bin/python tools/delever_regen.py --families R22 R - **Drew's call, asked in S103:** does `do { … } while (0);` count as a lever? (banked with one so far: c5's `func_8015D738` and c15's `func_80135EB0` in S103, a4 and b8 in S102; and its cousin: c13's DEAD INITIALISER — `s16 size = 0;` flow deletes, whose only job is to stop `scan_loop` hoisting a constant; c9 refused the do-nothing reassignment form) It is R7's move, banked in S102 (a4, b8) and S103 (c5's `func_8015D738`, where it is the barrier the removed `asm` was — c5 flagged it), uncounted by the census, 1,347 in `src/`. If yes: a census class + a residue to work down. +- **Drew's call (T5, the GTE header):** c17 showed `func_8013D9B0`'s last 15 (134 copies) are `include/gte_inline.h`'s + `gte_stORGB` spelling: an `inline_o`-style macro that writes `$12` itself (clobber `$12` only) takes the plain-C body to + 2, a second merged macro to 0 — a clobber list that differs from Sony's own (`$12-$15` scores 6). Whether a GTE macro + may be respelled that way (the plan calls a clobber variant a lever) decides this class. Evidence: + `.run/P36/agents/ov_SC04_011__func_8013D9B0/scratch/PA.c`, `PROOF_K1.c`, `mechanism.md`. - The declaration debt, measured at S103's open (`.run/P36/s103/argcheck.json`, 94,001 rows): **91,846 are calls that pass FEWER arguments than the definition** (the R19 population — which side is wrong is a types-phase question: a definition may carry a phantom parameter), 1,731 have every call passing enough but sit in units `decl_repair` did not