cpu: recompile a multi-unit UCRT console program from its PE entry #455

Manually merged
github merged 1 commit from gh-pr/455/head into gh-pr/455/base 2026-11-26 21:53:18 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-22 04:37 UTC · original
R0Y00:codex/crc-stream-program → main · +292 −9 · 9 files · 1 commits · merged 2026-11-22 04:41 UTC

Refs #317. This exercises the entry-to-exit CPU translation path with a source-built multi-unit Windows console program and an actual UCRT dependency.

The MASM entry reads stdin, calls a separately compiled C++ CRC step, and writes and flushes stdout. The first translation refusal was the indirect getchar import at RVA 0x103d. Bind named UCRT IAT slots with explicit argument and return widths. Unknown providers fail translation.

Windows verification on f1d1492 (MSVC 19.51):

  • ctest --preset dev --no-tests=error -R '^(cpu_aot_direct_calls|cpu_native_(crc_line|exe_image_chain))$' --output-on-failure passed 3/3.
  • ctest --preset release --no-tests=error -R '^cpu_native_crc_line$' --output-on-failure passed 1/1.

Compare stdout bytes, stderr and exit status from native Windows, pe_map on the same image and the generated executable. The standard vector prints CBF43926 with CRLF and exits 0. An empty stream exits 1. A read-only stdout handle exits 2 and leaves the file unchanged. Changing the compiled polynomial changes the expected standard vector to E3069283 on all three runners. Cases also exercise CRLF input, missing newline, an empty line and a 13,000-byte line.

**@⁠R0Y00** on GitHub · 2026-11-22 04:37 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/455) `R0Y00:codex/crc-stream-program` → `main` · +292 −9 · 9 files · 1 commits · merged 2026-11-22 04:41 UTC Refs #317. This exercises the entry-to-exit CPU translation path with a source-built multi-unit Windows console program and an actual UCRT dependency. The MASM entry reads stdin, calls a separately compiled C++ CRC step, and writes and flushes stdout. The first translation refusal was the indirect getchar import at RVA 0x103d. Bind named UCRT IAT slots with explicit argument and return widths. Unknown providers fail translation. Windows verification on f1d1492 (MSVC 19.51): - `ctest --preset dev --no-tests=error -R '^(cpu_aot_direct_calls|cpu_native_(crc_line|exe_image_chain))$' --output-on-failure` passed 3/3. - `ctest --preset release --no-tests=error -R '^cpu_native_crc_line$' --output-on-failure` passed 1/1. Compare stdout bytes, stderr and exit status from native Windows, pe_map on the same image and the generated executable. The standard vector prints CBF43926 with CRLF and exits 0. An empty stream exits 1. A read-only stdout handle exits 2 and leaves the file unchanged. Changing the compiled polynomial changes the expected standard vector to E3069283 on all three runners. Cases also exercise CRLF input, missing newline, an empty line and a 13,000-byte line.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:53:16 +00:00
github manually merged commit f1d14922cb into gh-pr/455/base 2026-11-26 21:53:18 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.