Statically recompile an x64 CPU leaf function and verify both branches #23

Manually merged
github merged 1 commit from gh-pr/23/head into gh-pr/23/base 2026-11-26 21:22:46 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-21 09:33 UTC · original
R0Y00:codex/cpu-leaf-aot → main · +244 −2 · 9 files · 1 commits · merged 2026-11-21 09:35 UTC

Build a source-owned AMD64 fixture with MASM and read the exported function's machine code from its PE runtime-function interval. Translate the supported encodings to C++ offline, then use MSVC to compile and link a separate x64 DLL. CMake builds the translation from the linked input on each relevant change.

The Windows differential test compares returns, output writes and adjacent guard words for 263 inputs. Five inputs take the below-threshold branch and 258 take the other branch. All 263 inputs distinguish the separately assembled and translated inverted branch. Decoder controls exercise unsupported and truncated instructions, invalid targets and a missing return.

Local checks: ctest --preset dev --no-tests=error -R '^cpu_leaf_aot_branches$' -V passed. ctest --preset dev --no-tests=error -E '_hardware$' completed with 35 passes and one WARP wave64 capability skip. The PE intake regression now clears the optional shell architecture hint and checks the native architecture through Windows. README and experiment notes include scope and reproduction commands.

Refs #22 for the next direct-call experiment.

**@⁠R0Y00** on GitHub · 2026-11-21 09:33 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/23) `R0Y00:codex/cpu-leaf-aot` → `main` · +244 −2 · 9 files · 1 commits · merged 2026-11-21 09:35 UTC Build a source-owned AMD64 fixture with MASM and read the exported function's machine code from its PE runtime-function interval. Translate the supported encodings to C++ offline, then use MSVC to compile and link a separate x64 DLL. CMake builds the translation from the linked input on each relevant change. The Windows differential test compares returns, output writes and adjacent guard words for 263 inputs. Five inputs take the below-threshold branch and 258 take the other branch. All 263 inputs distinguish the separately assembled and translated inverted branch. Decoder controls exercise unsupported and truncated instructions, invalid targets and a missing return. Local checks: `ctest --preset dev --no-tests=error -R '^cpu_leaf_aot_branches$' -V` passed. `ctest --preset dev --no-tests=error -E '_hardware$'` completed with 35 passes and one WARP wave64 capability skip. The PE intake regression now clears the optional shell architecture hint and checks the native architecture through Windows. README and experiment notes include scope and reproduction commands. Refs #22 for the next direct-call experiment.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:22:45 +00:00
github manually merged commit f97be9b17b into gh-pr/23/base 2026-11-26 21:22:46 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.