Game Decompilation with Watcom 10.6: Layered Blind Rewriting of LLM Drafts under an Exact Compiler Judge

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).

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-16
DOI
https://doi.org/10.5281/zenodo.24287585
Primary Topic
Software Engineering Research
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Game Decompilation with Watcom 10.6: Layered Blind Rewriting of LLM Drafts under an Exact Compiler Judge

Werner Baumgarten
4 links
Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
preprint

Game Decompilation with Watcom 10.6: Layered Blind Rewriting of LLM Drafts under an Exact Compiler Judge

Werner Baumgarten
preprint en

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).

Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon