Files
BFM-decomp/diff_settings.py
T
Drew T 5f937bdda5 feat(phase-6): compiler pinned + matching loop proven (14 matches) — LZSS to Phase 7
- splat.us.exe.yaml: text subseg asm->c (INCLUDE_ASM scaffold); include/common.h
  (committed prelude); Makefile c-rule cpp->cc1->maspsx->as + -Map
- PIN (G8): gcc-2.7.2-psx -O2 -G0 -mips1 -mcpu=3000 -mgas -msoft-float -fgnu-linker
  + maspsx --aspsx-version=2.56 --expand-div; byte-exact on func_80018F20 +
  instruction-identical across 3 idiom classes; --expand-div REQUIRED for div/rem
  (SETUP.md §5.4 PINNED, Makefile MASPSX_FLAGS)
- harness: diff_settings.py (asm-differ mipsel object mode), tools/decompile.py
  (m2c wrapper), tools/permuter/ (decomp-permuter harness + objdump shim), expected/
- 14 real functions matched (asm-differ score 0): func_80018F20 + 13 accessors;
  +14 splat-auto empty no-ops; make check BYTE-IDENTICAL throughout
- 2 instruction-identical near-misses guarded NON_MATCHING (func_80015A74 scheduling,
  func_80016714 phantom frame) -> decomp-permuter candidates
- flywheel: docs/matching-cookbook.md, memory + CLAUDE.md step 5 (consult+evolve), R16
- requirements-python.txt: venv freeze (pycparser<3.0 pinned — permuter needs plyparser)
- LZSS spike: needs jump-table-in-rodata workflow (102 tables, mixed blob) -> Phase 7
- venv: asm-differ + permuter deps installed
- bumps project version 1.5.0 -> 1.6.0
2026-06-14 14:47:01 -06:00

22 lines
1.5 KiB
Python

# asm-differ project config — BFM-decomp (SLUS_007.26, USA, PSX little-endian R3000).
#
# The matching oracle: diff one function's codegen in our build against the
# byte-identical `expected/` baseline. Object mode (-o) is the default workflow:
# .venv/bin/python tools/asm-differ/diff.py -mo <function> # -m rebuild, -o vs object
# Score 0 = matched (instruction-identical incl. regalloc); anything else = not matched.
#
# `expected/` is a snapshot of a SHA1-GREEN build (= the original bytes, since the
# all-INCLUDE_ASM build is byte-identical). Re-snapshot it ONLY after a green build
# (`make expected`) — a stale baseline causes phantom matches/regressions (SETUP.md §6.4).
def apply(config, args):
config["arch"] = "mipsel" # little-endian MIPS, R3000 (PSX CPU)
config["baseimg"] = "expected/build/us/SLUS_007.26.elf" # image-mode target (byte-identical baseline)
config["myimg"] = "build/us/SLUS_007.26.elf" # image-mode current build
config["mapfile"] = "build/us/SLUS_007.26.map" # GNU ld -Map: symbol -> object + address
config["map_format"] = "gnu"
config["expected_dir"] = "expected/" # -o: expected path = expected_dir + objpath
config["build_dir"] = "build/" # (objpath "build/src/800.o" -> expected/build/src/800.o)
config["source_directories"] = ["src", "asm", "include"]
config["objdump_executable"] = "mipsel-linux-gnu-objdump"
config["makeflags"] = []