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

Merged
RonLogic merged 3 commits from upstream-pr/247 into main 2026-11-22 02:36:06 +00:00
RonLogic commented 2026-11-21 19:13:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-21T19:13:17Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6533246084 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/247). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-21T19:13:17Z. --- 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`.
upstream-sync closed this pull request 2026-11-24 06:42:00 +00:00
R0Y00 commented 2026-11-24 06:47:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T19:14:55Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7067877547 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/247#issuecomment-7067877547). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T19:14:55Z. --- 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.
RonLogic commented 2026-11-24 06:47:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-21T19:17:06Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7067907927 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/247#issuecomment-7067907927). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-21T19:17:06Z. --- 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.
R0Y00 commented 2026-11-24 06:47:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T19:59:34Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7068424600 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/247#issuecomment-7068424600). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T19:59:34Z. --- 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.
RonLogic commented 2026-11-24 06:48:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-21T23:32:19Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7070938724 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/247#issuecomment-7070938724). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-21T23:32:19Z. --- Addressed the [documentation conflict](https://github.com/R0Y00/Xbox2Windows/pull/247#issuecomment-7068424600) 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.
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!244
No description provided.