pe: add cpu_stdio_exe_aot CLI entry and synthetic validation suite #1974

Merged
Ammmae0x merged 2 commits from upstream-pr/1981 into main 2026-11-24 22:59:13 +00:00
Ammmae0x commented 2026-11-24 22:35:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-24T22:35:24Z.


Change

Extract main(argv=None) -> int in tools/cpu_stdio_exe_aot.py, add an offline synthetic AMD64 PE32+ unit and CLI refusal test suite in tests/cpu_stdio_exe_aot_check.py, and register cpu_stdio_exe_aot_check in CMakeLists.txt.

  • Verify positive translation paths for direct entry points, --entry-export with aot_source_sha256 provenance, STARTUP_ONLY (cpu_exe_io.dll!finish_exe) skipping under --entry-export, and allow_process_exit=True with a noreturn import.
  • Verify refusal paths for non-AMD64 / non-PE32+ / non-console / DLL / non-executable headers, TLS and delay-import directories, duplicate import slots, unbound named/ordinal/startup-only imports, unverified entry RVAs, insufficient exit-code return widths, and CLI exit code 1 without tracebacks on OSError, pefile.PEFormatError, and ValueError.

AI-assisted.

Verification

  • python.exe -B tests/cpu_stdio_exe_aot_check.py -v: Ran 10 tests, OK.
  • ctest --preset dev --no-tests=error -R "^(cpu_stdio_exe_aot_check|cpu_aot_exe.*)$" --output-on-failure: 4/4 passed (cpu_aot_exe_entry, cpu_aot_exe_call_targets, cpu_aot_exe_nested_calls, cpu_stdio_exe_aot_check; 1259 total tests configured).
  • ctest --preset release --no-tests=error -R "^(cpu_stdio_exe_aot_check|cpu_aot_exe.*)$" --output-on-failure: 4/4 passed (1259 total tests configured).
  • python.exe -B tests/form_coverage_check.py: passed.
  • python.exe -B tests/docs_links_check.py: passed (Checked 18 Markdown files and 387 links).
  • python.exe -B tests/bidi_controls_check.py: passed (Checked 1378 tracked source, script and build/CI files: no bidirectional controls).

Evidence and follow-up

All test fixtures in tests/cpu_stdio_exe_aot_check.py are constructed deterministically in-memory using synthetic AMD64 PE32+ bytes and require no external files or game assets.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6592778771 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1981). Originally posted by [Ammmae0x](https://github.com/Ammmae0x) on 2026-11-24T22:35:24Z. --- ## Change Extract `main(argv=None) -> int` in `tools/cpu_stdio_exe_aot.py`, add an offline synthetic AMD64 PE32+ unit and CLI refusal test suite in `tests/cpu_stdio_exe_aot_check.py`, and register `cpu_stdio_exe_aot_check` in `CMakeLists.txt`. - Verify positive translation paths for direct entry points, `--entry-export` with `aot_source_sha256` provenance, `STARTUP_ONLY` (`cpu_exe_io.dll!finish_exe`) skipping under `--entry-export`, and `allow_process_exit=True` with a `noreturn` import. - Verify refusal paths for non-AMD64 / non-PE32+ / non-console / DLL / non-executable headers, TLS and delay-import directories, duplicate import slots, unbound named/ordinal/startup-only imports, unverified entry RVAs, insufficient exit-code return widths, and CLI exit code `1` without tracebacks on `OSError`, `pefile.PEFormatError`, and `ValueError`. AI-assisted. ## Verification - `python.exe -B tests/cpu_stdio_exe_aot_check.py -v`: `Ran 10 tests`, `OK`. - `ctest --preset dev --no-tests=error -R "^(cpu_stdio_exe_aot_check|cpu_aot_exe.*)$" --output-on-failure`: `4/4` passed (`cpu_aot_exe_entry`, `cpu_aot_exe_call_targets`, `cpu_aot_exe_nested_calls`, `cpu_stdio_exe_aot_check`; `1259` total tests configured). - `ctest --preset release --no-tests=error -R "^(cpu_stdio_exe_aot_check|cpu_aot_exe.*)$" --output-on-failure`: `4/4` passed (`1259` total tests configured). - `python.exe -B tests/form_coverage_check.py`: passed. - `python.exe -B tests/docs_links_check.py`: passed (`Checked 18 Markdown files and 387 links`). - `python.exe -B tests/bidi_controls_check.py`: passed (`Checked 1378 tracked source, script and build/CI files: no bidirectional controls`). ## Evidence and follow-up All test fixtures in `tests/cpu_stdio_exe_aot_check.py` are constructed deterministically in-memory using synthetic AMD64 PE32+ bytes and require no external files or game assets. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets.
upstream-sync closed this pull request 2026-11-24 23:03:24 +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!1974
No description provided.