mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-03 08:07:25 -04:00
a8ae190fa3
- src/shared/clearTbl40.h: CLEAR_TBL40 macro = the matched byte-clear loop body, authored ONCE; instantiated at both func_80037004 and func_80037334 in src/800.c (one source -> two vrams) - matched first try; clean rebuild main -> 143dbb89 BYTE-IDENTICAL WITH the shared C AND WITHOUT it (INCLUDE_ASM stub fallback) -> dual invariant proven (R22 clean rebuilds, both states) - config/dedup.us.yaml: I0_clearTbl40 group registered (h_exact a0744d60…); dedup_integrate --check validates it; negative tests (corrupt hash / wrong vram) fail-closed (exit 1) - tools/progress.py: count dedup-shared members as REAL via the registry (the macro form isn't a parseable function def); REAL 52 -> 54, byte-identical 50.24% -> 50.33%; honest measurement (P9) - tools/dedup_integrate.py: display vram in hex in diagnostics - the machinery half of the Phase-11 milestone is proven on the byte-verified EXE
5.4 KiB
5.4 KiB
CURRENT PHASE — Phase 11: Cross-binary dedup pipeline
Generation: Gen2 (4th phase) · Target version: 1.11.0 · Effort: Max (default) · Plan approved: 2026-06-16
Authoritative scope: docs/gen2-roadmap.md lines 105–117. Full plan: ~/.claude/plans/plan-mode-enabled-max-purring-kite.md
Owner decisions (2026-06-16)
- Report + machinery; defer collapse. Prove the cross-binary report via
sig_imageover overlays; prove the share machinery via an intra-binaryh_exactcollapse (byte-gated, stub fallback); wire cross-binary plumbing ready. First true two-binary collapse → Phase 13. - PsyQ 4.7 = sha-record only (already committed:
tools/psyq/conv47/+psyq-4.7-converted.zip). Linking → Phase 12.
Byte-verified facts (anchors)
- EXE
SLUS_007.26byte-identical = SHA1143dbb89f34491258bbc27810d0a12ec8b43a8dd. - Resident
8e17e02ff8954d07c979449198f7e1645046b353. - EXE↔resident share NO collapsible code (h_exact=0; h_norm=2 trivial 4-ins leaves) — 4.0 vs 4.7 + different roles.
- Proof group (intra-EXE, h_exact):
func_80037004≡func_80037334(9 ins, identical externals incl.D_80076251). Fallback:def_cbready≡def_cbread(10 ins, 1 call) orSYS_OBJ_538(3-way).
Task checklist
- T1 [xHigh] —
dup_report.py --cross→docs/duplicates.cross.md(multi-sig ingest, binary tag, cross/intra split,(count−1)×nins×4rank, per-member rows); wiredmake report(gated BINARY=main). Per-binary reports byte-stable. DONE (commitcommit:0060). EXE↔resident cross groups = 0 (confirms the byte-finding). - T2 [Max] —
config/dedup.us.yamlschema +tools/dedup_integrate.py(byte-honesty VALIDATOR, fail-closed on hash drift) +make reportdedup-check gate. DONE. Verified: --check passes on empty registry; clean rebuild main →143dbb89(no-op proven, R22). Refinement below. - T3 [xHigh] — intra-binary collapse PROOF. DONE.
src/shared/clearTbl40.hmacroCLEAR_TBL40instantiated at bothfunc_80037004/func_80037334insrc/800.c; matched first try. Clean rebuild143dbb89WITH shared-C AND WITHOUT (stub) — dual invariant. I0 indedup.us.yaml; dedup-check PASS; negative tests (wrong hash/vram) fail-closed. progress REAL 52→54 (2 dedup-shared), 50.33%. - T4 [Max] —
tools/sig_image.py:h_exact+ boundary detection. Verify ≥99% h_exact vs.run/sig.resident.jsonl, zero UNEXPLAINED. - T5 [Max] —
sig_image.py:h_normnormToken replica + resident acceptance gate (≥98% non-GTE; GTE/noncontig documented). Scope guard: ship h_exact + self-consistent h_norm if calibration over-runs. - T6 [xHigh] — sign 134 overlays @
0x80128158(deterministic loop, no fan-out); add to dup_report BINARIES; regeneratedocs/duplicates.cross.mdwith real cross-binary groups. - T7 [xHigh; PhaseEnd=Max] — 4.7 sha-record + docs note; cookbook §11; SETUP/psyq-worklist/README refresh; regenerate reports; PhaseEnd.
Milestone (gate 2)
Cross-binary report spans ≥2 binaries; one shared C body fills ≥2 addresses byte-gated, EXE 143dbb89/resident
8e17e02f byte-identical with-and-without dedup (clean rebuild R22); plumbing accepts an overlay member w/o Makefile
change; 0 NON_MATCHING in default build.
Deviations / refinements (for the PhaseEnd)
- D1 — Game-code dedup is SOURCE-LEVEL, not a
psyq_integrateobject-swap. The approved plan said "forkpsyq_integrate.py(.ld interpose) for the cross case." The byte-reality:psyq_integrate's swap only works for separate library subsegment stub objects; game-code functions are interior to one object per binary (build/src/800.o,build/resident/resident.o), and the linker can't excise interior bytes. So a shared body is authored once (a macro insrc/shared/<fn>.h) and instantiated at each member site in each binary's.c(same bytes at each vram). The byte-gate is the existing per-binarymake check;dedup_integrate.pyis the byte-honesty validator (fail-closed on hash drift), not an interpose engine. The.ldinterpose stays the library mechanism (Phase 8, untouched). Milestone + owner decisions unchanged; tool is simpler + byte-correct. Consequence: noSRC_SHARED_DIROBJS exclusion needed (shared bodies are.h, skipped by the*.cglob); no build-recipe change (dedup-check lives inmake report).
Blockers
(none)
Progress log
- 2026-06-16: Phase planned at Max via 3 Explore + 2 Plan agents; owner approved. Key finding (EXE↔resident share nothing) reshaped the milestone to "report + machinery; defer collapse."
- 2026-06-16: T1 done (
commit:0060) —dup_report --cross→duplicates.cross.md; per-binary reports byte-stable; EXE↔resident cross groups = 0. - 2026-06-16: T2 done —
dedup.us.yamlregistry +dedup_integrate.pyvalidator +make reportgate; clean rebuild main143dbb89(no-op, R22). Recorded deviation D1 (source-level share). Next: T3 proof. - 2026-06-16: T3 done — machinery half of the milestone PROVEN. Shared body
CLEAR_TBL40(src/shared/clearTbl40.h) →func_80037004+func_80037334; matched first try; clean rebuild143dbb89WITH shared-C and WITHOUT (stub); I0 validated, fail-closed negatives pass; REAL 52→54.progress.pytaught to count dedup members (registry source-of-truth). Next: T4 (sig_image h_exact) — the report half's tooling.