cpu: drive a D3D12 compute dispatch from the translated shim EXE #525

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

@⁠R0Y00 on GitHub · 2026-11-22 09:14 UTC · original
R0Y00:codex/shim-compute-integration → main · +476 −5 · 8 files · 3 commits · merged 2026-11-22 09:21 UTC

Change

Follow-up to #511, coordinated in the original PR. Extend its source-built CRT-free startup body to allocate, submit a compute job, release the allocation and return a status. The shared x64 translator reads the linked PE starting at AddressOfEntryPoint. The generated process records the SHA-256 of that input. Windows and pe_map run the same original file.

The EXE owns the branches, lifetime and import arguments. A fixture DLL implements the host boundary with XMem and a D3D12 queue, using the existing source-built compute shader. An independent byte oracle checks the GPU readback. The CPU test checks that the exact pointer returned in each process is passed on to dispatch and release.

Verification

Tested commit 64071d4 on Windows 11 build 26200.9974, MSVC 19.51, RTX 4060 Laptop (32.0.16.1656) and WARP (10.0.26100.9818). The integration test uses the default D3D12 debug-layer setting and does not enable it.

. ./tools/dev.ps1
foreach ($preset in 'dev','release') {
  cmake --build --preset $preset --parallel 10 --target cpu_shim_startup_lifted pe_map
  ctest --preset $preset --no-tests=error -R '^(cpu_native_shim_startup|cpu_shim_compute_(warp|hardware))$'
}

Three tests in each configuration. The 4096- and 8192-byte cases both pass attribute 0xa8004000, dispatch once with different seeds, read back 16 bytes, free once and exit 42. The SIZE_MAX case gets null from XMemAlloc, performs zero compute dispatches and frees, publishes zero compute bytes and exits 17. The original startup allocation and both missing-provider controls still run in the baseline test. The experiment and expected byte strings are documented in docs/experiments.md.

Source-built fixtures under the project's MIT license. AI-assisted implementation and verification.

**@⁠R0Y00** on GitHub · 2026-11-22 09:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/525) `R0Y00:codex/shim-compute-integration` → `main` · +476 −5 · 8 files · 3 commits · merged 2026-11-22 09:21 UTC ## Change Follow-up to #511, coordinated in [the original PR](https://git.gtahub.st/github/R0Y00--Xbox2Windows/pulls/511). Extend its source-built CRT-free startup body to allocate, submit a compute job, release the allocation and return a status. The shared x64 translator reads the linked PE starting at AddressOfEntryPoint. The generated process records the SHA-256 of that input. Windows and pe_map run the same original file. The EXE owns the branches, lifetime and import arguments. A fixture DLL implements the host boundary with XMem and a D3D12 queue, using the existing source-built compute shader. An independent byte oracle checks the GPU readback. The CPU test checks that the exact pointer returned in each process is passed on to dispatch and release. ## Verification Tested commit 64071d4 on Windows 11 build 26200.9974, MSVC 19.51, RTX 4060 Laptop (32.0.16.1656) and WARP (10.0.26100.9818). The integration test uses the default D3D12 debug-layer setting and does not enable it. ```powershell . ./tools/dev.ps1 foreach ($preset in 'dev','release') { cmake --build --preset $preset --parallel 10 --target cpu_shim_startup_lifted pe_map ctest --preset $preset --no-tests=error -R '^(cpu_native_shim_startup|cpu_shim_compute_(warp|hardware))$' } ``` Three tests in each configuration. The 4096- and 8192-byte cases both pass attribute 0xa8004000, dispatch once with different seeds, read back 16 bytes, free once and exit 42. The SIZE_MAX case gets null from XMemAlloc, performs zero compute dispatches and frees, publishes zero compute bytes and exits 17. The original startup allocation and both missing-provider controls still run in the baseline test. The experiment and expected byte strings are documented in docs/experiments.md. Source-built fixtures under the project's MIT license. AI-assisted implementation and verification.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:58:54 +00:00
github manually merged commit 64071d4e79 into gh-pr/525/base 2026-11-26 21:58:56 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.