Game Decompilation with Watcom 10.6: Layered Blind Rewriting of LLM Drafts under an Exact Compiler Judge
Year: 2026
Type: preprint
Abstract: Matching decompilation reconstructs C or C++ source code that the original historical compiler translates into the original binary, byte for byte. Language-model drafts and random mutation both stall on the long tail of large legacy programs: iterative patching gets trapped in local minima, single-model sampling hits a systematic blind-spot floor, and register allocation is governed by unstable compiler-internal sorts. This paper presents Layered Blind Rewriting, a method and mathematical framework that closes this long tail to 100 % byte identity. An exact compiler judge exploits single partial hits without majority voting, so an ensemble of independent drafts from diverse (including weaker and cheaper) model families beats a single strong model when combined by horizontal recombination (the Mixer) and vertical inpainting (Layering). When all model families fail on the same section although the structure already matches ("blind spot vs. wax"), the method switches to a bit-exact inverse model of the compiler's allocator: for Watcom C/C++ 10.6, its two-phase unstable ShellSort over registers and stack slots. This removed 88.3 % of the artificial steering ("ghost") variables without losing a single byte of identity. We further document the blind spot of per-function comparison versus the full linked image, post-match cleanup and verified bug fixing, two linker traps when code shifts, and a binary patch format that shares no 64-byte window with the original. The method completed the byte-exact reconstruction of a 1990s DOS game built with Watcom C/C++ 10.6 (571 translation units, 6,834 functions, 2,477,899 bytes, zero patched bytes) alongside two earlier 16-bit games of the same series. English and German versions included. Companion paper to "Matching Decompilation as a Puzzle" (doi:10.5281/zenodo.23806061).
Author: Baumgarten, Werner
Language: English
Subfield: Information Systems
Field: Computer Science
Domain: Physical Sciences
Keywords: shell sort, binary patching
Open Access status: green
OpenAlex ID: W7233758970
