Files
BFM-decomp/tools
Drew T c0e8fbdaae phase-36: T6 — the rung-D instrument fixed (the target was assembled from a listing), rung R built (R2/R3/R4/R5)
THE INSTRUMENT (R40). Two campaigns returned "0 of 16" with a straight face; both were the harness. The target object had
been assembled from a DISASSEMBLY LISTING, which is a second toolchain with its own answers:
  - objdump prints the pseudo-instruction `move` for `addu rX,rY,$zero`; gas assembles `move` as `or` — 24 wrong words in
    one 234-instruction function, silently;
  - a listing's %hi/%lo pairs come back RESOLVED with no relocation, while every candidate carries one, and the masked
    scorer compares reloc operands.
The permuter therefore scored 28 for a body that IS byte-identical: score 0 was unreachable and every NO-MATCH was its own.
  - tools/delever_permute.py: the target is now the tree's OWN (levered) body compiled by the build's tail into a
    one-function object — the candidates' relocations by construction — and `match_one` must call that body a MATCH against
    the ROM listing before the search starts (R34 keeps it from being circular). Base score for the tree's own body: 0.
  - tools/p16_permute.py `setup(target_o=)` + tools/permuter_ils.py `--target-o` (defaults unchanged).
  - `--positive-control TU FN`: perturb a matching body by one commutative swap, require the permuter back to 0.
  - tools/verbatim_target_s.py --gas now VERIFIES itself: assemble, disassemble, compare word by word with the image,
    `.word 0x…`-patch what does not reproduce (24 in that function), REFUSE what still disagrees. The listing is a public
    artifact (decomp.me) and was wrong for every function containing a `move`.

THE PROFILE. The weight profile now comes from the register a needed pin names, not just the site kind: callee-saved
($16-$23) is an allocation-order residual -> regalloc; caller-saved ($2/$3/$4-$7) is not -> cse. Read from the bytes: the
residual on func_80163EC8 (`register … __asm__("$2")`) is `and v0,v1,v0` against `and v0,v0,v1` — the operand order of one
`&` — and the regalloc profile weights perm_commutative 2.0 while cse weights it 40.0.

RUNG R (tools/delever.py --recipes): the cookbook's byte-neutral shape recipes, mechanically, seeded with the body's
lever-free text — R2 the formerly-pinned declarations permuted, R4 one moved through the whole declaration run, R3 an
initializer split placed after the run (C89), R5 the operand order of one commutative operator (the caller-saved lever, and
the only recipe needing no pinned declaration). Identity control on both the splice and the oracle before any verdict;
markers scrubbed within the banked body's own span only; selftest cases on a fixture whose answers are known by hand.

Also: a threading race in the site cache published the empty dict before filling it and made a whole batch report
"no site in this TU"; the file-scope asm dropper took an asm-LABEL clause for a statement. SETUP + dictionary rows.
2026-09-09 11:08:20 -06:00
..
tools+docs(phase-33.5): task 13.5 — the tools audit + the two dictionaries: tools/tool_census.py (two agreeing enumerations of 327 tool files; docstring/SETUP row/consumers/class derived from the tree; the authored half in config/tool_dictionary.tsv — phase · portability · the NEED each tool answers · what · adapts · verdict — with coverage asserted both ways) → docs/tool-index.md (need-keyed, KEEP-GEN, Reference-index row, wiki + how-to pointers), the kit's tools/MANIFEST.md regenerated (header states live 293 + superseded 28 = 321 rows), and the two verbatim corpora in-tree (Drew, confirmed S91): decomp-architect/corpus/tools/<phase>/ (302 copies + 28 superseded pointers + INDEX) and corpus/cookbook/ (the cookbook, its symptom index, the codegen map, a front page stating what transfers per compiler) — sha1-equal to their sources by tool_census --check in tools-health, regenerated by make kit-corpus; kit_lint exempts the corpus dirs (verbatim evidence) but syntax-checks them; G66 (consult the tool dictionary first) + G67 (translate an inherited idiom through its pass) + two memory seeds (34 at install); SETUP Step 6 installs docs/knowledge-corpus.md and checks the manifest against its own stated total; the ops-setup dictionary rows; the intake's Phase 7 cites G66/G67 and Phase 10 + Part C name the raw-cast → declared-symbol step; templates/layout-contract.md (the five-tool probe, a draft for the split). The review under Drew's criterion: 93 no-consumer tools (one Opus agent's draft, verified: 0 defects, every successor live, 0 live consumers, 0 collisions; four one-off verdicts overturned to STILL-NEEDED) → 34 retired by git mv to tools/sunset/ (28 superseded, 6 one-offs; README review table; SETUP rows moved; Archive-index group). Run 4 (fresh throwaway, the final kit): stopped on my Step-6 check (321 vs the live 293) → both sides derived → resumed → PASS 10/10, manifest 56 == 56, 4 commits, guardrails held (the one foreign path was the timeline regenerated by the detached tools-health). tools-health OK; doc_links --strict rc 0; audit_public OK over 6,842 paths; the purge probe PASSED (Phase 34's gate open). decision-log "P33.5 S91" + accelerators "P33.5 S91" banked; log + checkpoint (NEXT = task 14, xHigh, fresh session)
2026-09-07 22:09:15 -06:00

tools/

Everything under tools/ that this project wrote — the extractor, the byte gate, the matching harness, the campaign machinery, the audits, the Ghidra scripts, the public-flip rewrite package — is licensed under the GNU Affero General Public License v3.0 (the repository's LICENSE). There are no per-file license headers; this statement covers them.

Third-party pieces under tools/ keep their own licenses and are listed in the top-level THIRD_PARTY.md: tools/brave-CUE/ (GPL-3.0, vendored source), the pinned submodules tools/maspsx (MIT), tools/decomp-permuter (MIT), tools/asm-differ (Unlicense) and tools/m2c (GPL-3.0), and the gcc-2.7.2 compiler tarballs under tools/bin/ (GCC, GPL). The Sony SDK directory tools/psyq/ is never part of the repository — it is user-supplied and gitignored.

Where each tool fits and how to run it: docs/SETUP.md ("Tooling inventory"), docs/wave-playbook.md (the matching procedure) and docs/public-flip-runbook.md (the publication procedure).