cpu: terminate the native CRC line fixture #481

Merged
Jess-Doit merged 1 commit from upstream-pr/487 into main 2026-11-22 07:39:23 +00:00
Jess-Doit commented 2026-11-22 06:57:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-22T06:57:45Z.


Change

Reuse the shared EXE startup wrapper for the CRC-32 and CRC-32C fixtures from #455. Windows launch exits with the CRC body's status, pe_map returns that status to the host, and the console AOT translator lifts native_entry from the same source EXE.

Refs #281.

Verification

Ten selected CTests passed in each of Debug and Release on Windows 10 22H2 build 19045.6456 with MSVC 19.44.35230 and Zig 0.13.0. Tested aad1801 on 933cbad. The documentation link check also passed.

$targets = @(
  'cpu_crc_line_lifted', 'cpu_crc_castagnoli_lifted', 'pe_map', 'cpu_calls_lifted',
  'cpu_register_probe', 'cpu_exe_original_lifted', 'cpu_exe_inverted_lifted',
  'cpu_exe_pair_lifted', 'cpu_exe_swapped_lifted', 'cpu_exe_framed_lifted',
  'cpu_exe_image_lifted', 'archive_reader_lifted', 'archive_all_lifted'
)
cmake --build --preset dev --target @targets
ctest --preset dev --no-tests=error --timeout 75 -V -R '^(cpu_aot_(direct_calls|exe_entry|exe_call_targets)|cpu_native_(crc_line|exe_(chain|frame_chain|image_chain|termination)|archive_(reader|blast)))$'
.\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py

Repeat the build and CTest commands with --preset release. With a worker held on an event, the native process handle signaled, both pipes reached EOF, stdout matched the expected bytes, stderr was empty, and the exit status matched. EOF before input returned 1. Read-only stdout kept the sink unchanged and returned 2. The mapped host emitted its marker after pe_map_run returned.

Evidence and follow-up

The native launch and pe_map used the same EXE, and the generated AOT binary carried the matching input SHA-256.

Source EXE Debug SHA-256 Release SHA-256
cpu_crc_line.exe e2cf64cf9312bc09877a57e26851cd29f588148085fac7b2202583ba06b6d9bb 04889ae8408c3b413e4d553172875637a7929cd634882ce446a386e3889b002f
cpu_crc_castagnoli.exe 76050665fee9c070f79e59d8e136e9fb28574977033ebcdfe519e513b7cc3f10 bf2b93143be0ed6e06ba227fdb1e1fb7a3fd4338962618b3a5894454b33c7e00

A scratch I/O DLL that skipped ExitProcess only on status 1 reproduced the EOF hang with the same CRC EXE in both configurations. The standard vector still passed. The fixtures and inputs come from the repository's MIT-licensed source. Experiment documentation.

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.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6539557785 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/487). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-22T06:57:45Z. --- ## Change Reuse the shared EXE startup wrapper for the CRC-32 and CRC-32C fixtures from #455. Windows launch exits with the CRC body's status, `pe_map` returns that status to the host, and the console AOT translator lifts `native_entry` from the same source EXE. Refs #281. ## Verification Ten selected CTests passed in each of Debug and Release on Windows 10 22H2 build 19045.6456 with MSVC 19.44.35230 and Zig 0.13.0. Tested `aad1801` on `933cbad`. The documentation link check also passed. ```powershell $targets = @( 'cpu_crc_line_lifted', 'cpu_crc_castagnoli_lifted', 'pe_map', 'cpu_calls_lifted', 'cpu_register_probe', 'cpu_exe_original_lifted', 'cpu_exe_inverted_lifted', 'cpu_exe_pair_lifted', 'cpu_exe_swapped_lifted', 'cpu_exe_framed_lifted', 'cpu_exe_image_lifted', 'archive_reader_lifted', 'archive_all_lifted' ) cmake --build --preset dev --target @targets ctest --preset dev --no-tests=error --timeout 75 -V -R '^(cpu_aot_(direct_calls|exe_entry|exe_call_targets)|cpu_native_(crc_line|exe_(chain|frame_chain|image_chain|termination)|archive_(reader|blast)))$' .\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py ``` Repeat the build and CTest commands with `--preset release`. With a worker held on an event, the native process handle signaled, both pipes reached EOF, stdout matched the expected bytes, stderr was empty, and the exit status matched. EOF before input returned 1. Read-only stdout kept the sink unchanged and returned 2. The mapped host emitted its marker after `pe_map_run` returned. ## Evidence and follow-up The native launch and `pe_map` used the same EXE, and the generated AOT binary carried the matching input SHA-256. | Source EXE | Debug SHA-256 | Release SHA-256 | | --- | --- | --- | | `cpu_crc_line.exe` | `e2cf64cf9312bc09877a57e26851cd29f588148085fac7b2202583ba06b6d9bb` | `04889ae8408c3b413e4d553172875637a7929cd634882ce446a386e3889b002f` | | `cpu_crc_castagnoli.exe` | `76050665fee9c070f79e59d8e136e9fb28574977033ebcdfe519e513b7cc3f10` | `bf2b93143be0ed6e06ba227fdb1e1fb7a3fd4338962618b3a5894454b33c7e00` | A scratch I/O DLL that skipped `ExitProcess` only on status 1 reproduced the EOF hang with the same CRC EXE in both configurations. The standard vector still passed. The fixtures and inputs come from the repository's MIT-licensed source. [Experiment documentation](https://github.com/Jess-Doit/Xbox2Windows/blob/aad18017b2487f7a764605e71930e541e62b66e1/docs/experiments.md#crc-32-console-program-from-the-pe-entry). ## 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. AI-assisted.
upstream-sync closed this pull request 2026-11-24 06:43:18 +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!481
No description provided.