Files
kdm-re/docs/cutover.md
T
ulw-execute a176c63736 docs: scope spec + RE to the official clean release only
Reference only the official KDM-2016021900 game: the 9 Konami modules in
contents/modules/ plus data/arkdata/prop. Remove community/PC-hardware glue
(deahook/DEALibacio, spice2x/spicetools, launcher.exe, gamestart.bat,
bemanitools, NVENC/CUDA stubs) and non-release modules (kmd/ksm/kuc/libinput/
libacio_mbr) as game evidence. Correct the "22-DLL" framing to the real
9-module set; reframe the boot chain on arkkdm.dll's own dll_entry_init/
dll_entry_main -> gameMain binding. Kinect10.dll referenced only as gamekdm's
external Microsoft NUI runtime dependency. Fix ea3-config.xml -> eamuse-config.xml.
Per-byte sizes/RVAs from the earlier contaminated install marked UNVERIFIED
pending re-check against the clean-release binary.
2026-11-28 20:37:18 -05:00

121 lines
6.2 KiB
Markdown

# PURE build cutover procedure
T17 establishes a build mechanism, not a completed game cutover. The three
T11 routines have differential evidence in `task-11.log`; the rest of
`re/rvadb.json` is not at 100% verified coverage. Windows full-game QA is
still required. A slice smoke test cannot authorize deployment.
## Build modes
The default build remains the hybrid proxy plus detour installer.
`BUILD_PURE=ON` excludes both targets and their source files. It never links
an original game DLL or its import libraries.
The full mode requires every function in the target DLL's RVA database to
have `status=verified` (verified / function_count = 100%, no rounding).
Missing, duplicate, unknown, `orig`, `stub`, or `reimpl` records fail closed.
The gate also traverses callees and rejects missing or unverified reachable
functions. Full mode conservatively treats **every recorded function as a
root**, covering exports, callbacks, constructors, TLS and DLL entry points,
and possible indirect targets already present in the database.
Ghidra's graph contains only resolved edges. Before full cutover, audit
indirect calls, vtables, callbacks, dynamic lookups, imports, entry points,
and assembly against the final source/link map. Add missing targets to the
database and repeat the gate; 100% of an incomplete inventory is insufficient.
Companion DLLs require their own complete inventories and equivalent checks.
System APIs may remain imports; no original game or companion implementation
may be linked or dynamically loaded, including through transitive imports.
```sh
source ~/.nix-profile/etc/profile.d/nix.sh
source ./activate.sh
cmake -S . -B build-pure-full \
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-i686.cmake \
-DBUILD_PURE=ON
```
This must currently fail with `not yet at coverage`. Even after metadata
reaches 100%, the scaffold refuses a full artifact until the reconstructed
entry point and complete source graph are integrated. Do not replace that
refusal with the proxy or with slice stubs.
## Slice mechanism validation
```sh
cmake -S . -B build-pure \
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-i686.cmake \
-DBUILD_PURE=ON -DPURE_SLICE=ON
cmake --build build-pure
(cd build-pure && WINEDEBUG=-all wine gamekdm_pure_host.exe)
```
`gamekdm_pure_slice.dll` is deliberately named differently from the shipping
DLL. Its small C interface exposes the three reconstructed routines to a
mock host compiled with the same toolchain. `gameMain` is an explicit
unsupported stub returning -17; camera get/set are supplied by the host's
mock sensor. All remaining game subsystems are outside this mini-build.
No generic fake implementations of thousands of unknown signatures are
generated, and no stub is counted as verified.
The slice gate requires the three `status=verified` claims in
`re/pure-slice-status.json`, reconciles their RVAs against `re/rvadb.json`,
and traverses the canonical database's reconstructed dependency graph.
This temporary evidence overlay is accepted only by slice mode; full mode
uses only canonical `re/rvadb.json` statuses. The only original edges omitted in slice
mode are the two clamp helpers now implemented inline in `box_distance.cpp`,
and MSVC's security-cookie helper replaced by the compiler runtime. These
edge substitutions never apply to the full gate. Camera virtual dispatch
ends at the explicit host mock, not a Kinect/original binary.
To prove that a new internal dependency cannot silently enter the slice:
```sh
cmake -S . -B build-pure-reject \
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-i686.cmake \
-DBUILD_PURE=ON -DPURE_SLICE=ON -DPURE_REQUIRE_RVA=0x00009e20
```
Expect a nonzero configure exit and `not yet at coverage` naming gameMain.
The gate runs at configuration and before each build, so a subsequent
status downgrade also blocks rebuilding. `PURE_REQUIRE_RVA` adds roots;
it cannot replace the mandatory roots or relax coverage.
Inspect the final PE imports and linker inputs, then run the mock host in
a directory without original DLLs. T17 evidence lives in
`/home/athapa/kdm-re/.omo/evidence/gamekdm-decomp-linux/task-17.log`.
## Final cabinet/original-binary runtime full-game QA
Only begin this checklist with a complete, stub-free build and the full
coverage/reachability and dependency audits passed. Preserve a separate
known-good hybrid installation for rollback. Record build/source hashes,
rvadb hash, Windows version, Kinect runtime/driver,
GPU/driver, input mappings, logs, and screenshots with each result.
- [ ] Stage the complete pure build in an isolated game directory; remove
original game/companion DLLs from its loader search paths. Confirm
PE32 ABI, gameMain name/ordinal/calling convention and required exports.
- [ ] Launch through the cabinet/original-binary runtime. Inspect loaded
modules and dynamic-load traces: no original binary or proxy/detour.
Boot, asset loading, attract mode and title/menu navigation succeed.
- [ ] Check service/test menu, calibration, coin/start, cabinet buttons,
card/profile/save behavior and supported offline/network modes.
- [ ] Exercise Kinect startup, tracking acquisition/loss/reacquisition,
both players, validity boundaries, cursor selection, camera elevation,
reconnect and device-error recovery on the real hardware.
- [ ] Play complete songs in each supported mode/difficulty and multiplayer;
compare timing, scoring, combo, animations, audio/video sync and results
with the recorded hybrid baseline. Check pause/exit/retry transitions.
- [ ] Verify configuration/profile persistence after shutdown and restart;
exercise missing assets, cancelled loads and supported error paths.
- [ ] Run repeated sessions and a sustained play/attract soak; inspect frame
pacing, memory/handles, crash logs, shutdown and restart behavior.
- [ ] Confirm all differential/golden checks still pass. Attach QA evidence
and owner acceptance. Keep cutover incomplete for any failing item,
unresolved indirect target, stub, or original-binary dependency.
Promote the isolated installation only after all gates and checklist items
pass. Roll back by restoring the separate known-good installation; never
silently load an original DLL as a fallback inside the pure build.