cpu: render one EXE-entry raster draw across native, mapped and AOT runners #554
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/560"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by yummancito on 2026-11-22T12:12:33Z.
The shim-startup EXE now owns a draw phase after the compute dispatch.
draw_requestselects the case anddraw_frame(newcpu_shim_drawprovider) renders the repository's 64x64 test triangle offscreen on D3D12: direct queue, fence-waited copy to a readback buffer, raw RGBA bytes published after the startup output.The native EXE, the
pe_mapmapping (6 explicit shim bindings +mapped host returned, exit 42) and the AOT-lifted build (which callsdraw_request/host_draw_framefrom the lifted entry) agree byte for byte: 16,384 bytes, sha25658d9236355d2cc98, 1176 green pixels per the CPU rule (x >= 8 && y >= 8 && x + y <= 63).Negative controls: a mirrored-X shader variant must exit 20 with a frame that differs from the rule (
be42c453…) but still agrees across runners; an unknown draw case must exit 21 with no frame. Deletingcpu_shim_draw.dllfails at the Windows loader (STATUS_DLL_NOT_FOUND), proving the import is load-bearing and nothing is bypassed.Refs #218 as motivation (one connected vertical slice through loader, runtime, CPU and GPU paths). This does not resolve #218 and does not implement Xbox GPU command translation; no game startup or graphics compatibility is claimed.
Validation: fork CI run https://github.com/yummancito/Xbox2Windows/actions/runs/45020077723 — Windows dev 217/217, Windows /O2 217/217 (both include
cpu_shim_draw_warp), plus both Linux jobs green. Local Release /O2 frame hashes match Development exactly.Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-22T13:22:22Z.
Physical-GPU run for this PR (the fork CI covers
cpu_shim_draw_warponly).Commit:
0472851(PR head),devpreset.5/5 pass, including
cpu_shim_draw_hardware(3.4 s) andcpu_shim_compute_hardware. On both adapters:draw frame: 64x64 RGBA (16384 bytes); CPU rule holds 1176 green pixels, and the draw, flip (exit 20) and bogus (exit 21) cases are checked across the native,pe_mapand AOT runners.ctest -R '^cpu_shim_draw_' --repeat until-fail:10: 10/10 runs green on RTX 3070 and WARP.Debug layer: the draw provider does not enable it, so I made a local, temporary change to
create_device()intests/cpu/shim_draw_gpu.cpp: behind an environment variable, it callsEnableDebugLayer()and setsID3D12InfoQueue::SetBreakOnSeverityfor CORRUPTION and ERROR. With it on,cpu_shim_draw_warpand_hardwarestill pass, so no error or corruption message is raised during the draw. As a control for the instrumentation itself, an extra invalidCreateRootSignature(0, nullptr, 0, …)call makes both tests fail (draw publishes a full frame: expected 16384, got 0). The change was reverted and the PR rebuilt before the repeat run. Debug-layer warnings were not checked.Environment: Windows 11 build 26200.9974, NVIDIA GeForce RTX 3070 (10de:2484), driver 32.0.16.2101, Graphics Tools debug layer; WARP 10.0.26100.9818.
Not tested: AMD or Intel hardware, the
/O2release preset, debug-layer warnings, thecpu_shim_draw.dll-deletion control, and the full suite.AI-assisted: prepared with an AI coding agent and reviewed by a human before posting.
Imported from R0Y00/Xbox2Windows. Originally posted by rwZephyr on 2026-11-22T18:43:13Z.
Independent Windows verification of PR head
04728512d8e87933c3e8fb7cfe6bb0d012d80dd5. AI-assisted report, tests run locally from unmodified PR source.Windows 11 25H2 x64 build
26200.9974, MSVC19.44.35230, Windows SDK10.0.26100, DXC1.8.2502.8, Python3.12.10. A separate DXGI probe using the draw provider’s high-performance adapter selection returned AMD Radeon RX 9070 XT (1002:7550), driver32.0.32029.2010. The draw provider ran without the D3D12 debug layer.With the workspace-local toolchain loaded,
$intakePythonset to the local virtual environment’s Python executable, and the debug CRT DLLs staged alongside thedevbinaries:Both tests passed in both presets (4/4, zero skips). Native,
pe_map, and AOT matched the CPU reference byte for byte for the 64×64 frame (16,384 RGBA bytes, 1,176 green pixels, exit 42). The mirrored control agreed across the three runners, differed from the CPU reference, and exited 20. The unknown draw case exited 21 and published no frame.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T19:22:31Z.
Maintainer review at
17e82dc. I added two harness assertions. The native hardware probe's exact no-adapter diagnostic now reaches CTest as a capability skip, and the three runner comparisons also check the expected startup bytes before the frame.On Windows 11 build 26200 with MSVC 19.51.36244, I tested the patched tree integrated with main
ff7f68a. In both thedevandreleasepresets,ctest --preset <preset> --no-tests=error -R '^cpu_(shim_(draw|compute)_warp|native_shim_startup)$' -Vpassed 3/3, with no skips. The normal and mirrored draws each published 16,384 bytes and the unknown case published none. A mocked child verified the no-adapter 77, rejection of an unrelated 77 diagnostic, rejection of 77 on WARP, and rejection of corrupted startup output. The earlier independent GPU reports remain linked above. The new head is awaiting both Windows jobs.