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

Merged
R0Y00 merged 1 commit from upstream-pr/23 into main 2026-11-21 09:35:04 +00:00
R0Y00 commented 2026-11-21 09:33:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T09:33:21Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6527140757 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/23). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T09:33:21Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:41:02 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!23
No description provided.