cpu: translate distinct direct call targets at EXE entry #247

Manually merged
github merged 3 commits from gh-pr/247/head into gh-pr/247/base 2026-11-26 21:37:21 +00:00
Owner

@⁠RonLogic on GitHub · 2026-11-21 19:13 UTC · original
RonLogic:cpu/exe-multiple-call-targets → main · +96 −25 · 8 files · 3 commits · merged 2026-11-22 02:36 UTC

Extends the source-built EXE experiment from #228. The entry translator collects internal functions by RVA, emits each distinct function once, and binds each call site to its target. Each translated caller uses the existing named mix_args import profile.

The native and translated fixtures select between two internal functions. Swapping only the call targets changes the import arguments, output bytes, and exit status for both selectors. Empty stdin exercises the I/O error path. The original single-target and inverted-branch tests also pass.

Tested on Windows x64 at 72876b0 with upstream 6ee1e6c:

ctest --test-dir out/build/followup --no-tests=error -R '^cpu_' -V

All 32 CPU tests passed with no skips, including the upstream PE header checks from #240. Before this change, translation of the two-target fixture stopped with expected a single separate internal callee.

**@⁠RonLogic** on GitHub · 2026-11-21 19:13 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/247) `RonLogic:cpu/exe-multiple-call-targets` → `main` · +96 −25 · 8 files · 3 commits · merged 2026-11-22 02:36 UTC Extends the source-built EXE experiment from #228. The entry translator collects internal functions by RVA, emits each distinct function once, and binds each call site to its target. Each translated caller uses the existing named `mix_args` import profile. The native and translated fixtures select between two internal functions. Swapping only the call targets changes the import arguments, output bytes, and exit status for both selectors. Empty stdin exercises the I/O error path. The original single-target and inverted-branch tests also pass. Tested on Windows x64 at `72876b0` with upstream `6ee1e6c`: ```powershell ctest --test-dir out/build/followup --no-tests=error -R '^cpu_' -V ``` All 32 CPU tests passed with no skips, including the upstream PE header checks from #240. Before this change, translation of the two-target fixture stopped with `expected a single separate internal callee`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:37:19 +00:00
github manually merged commit d7ae01da80 into gh-pr/247/base 2026-11-26 21:37:21 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-21 19:14 UTC · original

At 5cb4994d, CMakeLists.txt and tests/cpu/exe_entry_check.py conflict with main after #240. Please keep the header guard inputs and their rejection controls alongside both direct targets and the target-swap control. Please rerun cpu_aot_exe_entry with the combined argument list.

**@⁠R0Y00** on GitHub · 2026-11-21 19:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/247#issuecomment-7067877547) At `5cb4994d`, `CMakeLists.txt` and `tests/cpu/exe_entry_check.py` conflict with main after #240. Please keep the header guard inputs and their rejection controls alongside both direct targets and the target-swap control. Please rerun `cpu_aot_exe_entry` with the combined argument list.
Author
Owner

@⁠RonLogic on GitHub · 2026-11-21 19:17 UTC · original

Thanks for flagging the conflict with #240. I merged main into the PR branch at 72876b0 and kept both sets of checks. cpu_aot_exe_entry receives all six inputs, including the I/O and mix_args provider DLLs. cpu_aot_exe_call_targets covers the two direct targets and the target-swap control.

I reran both tests locally on Windows x64:

ctest --test-dir out/build/followup --no-tests=error -R '^cpu_aot_exe_(entry|call_targets)$' -V

Both passed. The run confirmed successful translation of the four-directory EXE and rejection of all three invalid PE header cases. The full local CPU run on the same commit also passed all 32 tests.

**@⁠RonLogic** on GitHub · 2026-11-21 19:17 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/247#issuecomment-7067907927) Thanks for flagging the conflict with #240. I merged main into the PR branch at `72876b0` and kept both sets of checks. `cpu_aot_exe_entry` receives all six inputs, including the I/O and `mix_args` provider DLLs. `cpu_aot_exe_call_targets` covers the two direct targets and the target-swap control. I reran both tests locally on Windows x64: ```powershell ctest --test-dir out/build/followup --no-tests=error -R '^cpu_aot_exe_(entry|call_targets)$' -V ``` Both passed. The run confirmed successful translation of the four-directory EXE and rejection of all three invalid PE header cases. The full local CPU run on the same commit also passed all 32 tests.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-21 19:59 UTC · original

The code and fixture conflicts have been resolved on 72876b0; only docs/experiments.md now conflicts. Please retain both the distinct-call-target results and main's EXE comparison evidence when refreshing the branch.

**@⁠R0Y00** on GitHub · 2026-11-21 19:59 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/247#issuecomment-7068424600) The code and fixture conflicts have been resolved on `72876b0`; only `docs/experiments.md` now conflicts. Please retain both the distinct-call-target results and main's EXE comparison evidence when refreshing the branch.
Author
Owner

@⁠RonLogic on GitHub · 2026-11-21 23:32 UTC · original

Addressed the documentation conflict in d7ae01d. docs/experiments.md now includes both the distinct-call-target and target-swap results and the same-image Windows, pe_map_run, and AOT comparison from main. The combined branch also retains the PE header guard checks from #240.

All 44 CPU tests and the documentation link check passed locally on Windows x64. All three CI jobs for d7ae01d passed.

**@⁠RonLogic** on GitHub · 2026-11-21 23:32 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/247#issuecomment-7070938724) Addressed the [documentation conflict](https://git.gtahub.st/github/R0Y00--Xbox2Windows/pulls/247) in `d7ae01d`. `docs/experiments.md` now includes both the distinct-call-target and target-swap results and the same-image Windows, `pe_map_run`, and AOT comparison from main. The combined branch also retains the PE header guard checks from #240. All 44 CPU tests and the documentation link check passed locally on Windows x64. All three [CI jobs for `d7ae01d`](https://github.com/R0Y00/Xbox2Windows/actions/runs/44960831561) passed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.