Run the translated compute–mesh–pixel chain from a source-built PE entry #665

Closed
opened 2026-11-22 18:48:01 +00:00 by R0Y00 · 5 comments
R0Y00 commented 2026-11-22 18:48:01 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T18:48:01Z.


Goal

Connect two existing public experiments. #560 drives an offscreen raster draw from the same source-built EXE in native Windows, pe_map and AOT. #658 verifies that a translated compute shader produces the texture later sampled by the translated indexed mesh and pixel stages. Exercise the translated producer and consumers through a PE-entry frame request and compare the whole observable result across the three runners.

Dependency and scope

#560 landed in 899785e. The draw_request / draw_frame contract is on main. grahamster2 claimed the implementation and is stacking it on the one-frame interface. Start from the public frame reference and stale-texture control in #658. Use one frame per EXE invocation. The two-frame follow-up covers a different acceptance case and already has a prototype. Coordinate any shared provider edits on #218 before starting them.

Acceptance

  • Run two source-built input cases with different compute palettes. For each case, native Windows, pe_map and AOT must agree on the observable request and exit status, and every RGBA byte must match an independent reference.
  • Reuse the stale-texture control from #658. Bind the earlier texture after dispatching both producers and demonstrate that the pixel comparison detects it while unchanged clear pixels still match.
  • Register a focused WARP CTest that exercises the EXE path in both Windows presets. Record the tested SHA, commands and results, and provide a physical-adapter run or capability diagnostic when available.

Claim by commenting with the part you can implement or review and any interface touched. Refs #218, #560 and #658.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6546280264 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/671). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T18:48:01Z. --- ## Goal Connect two existing public experiments. #560 drives an offscreen raster draw from the same source-built EXE in native Windows, `pe_map` and AOT. #658 verifies that a translated compute shader produces the texture later sampled by the translated indexed mesh and pixel stages. Exercise the translated producer and consumers through a PE-entry frame request and compare the whole observable result across the three runners. ## Dependency and scope #560 landed in `899785e`. The draw_request / draw_frame contract is on main. [grahamster2 claimed the implementation](https://github.com/R0Y00/Xbox2Windows/issues/671#issuecomment-7084139376) and is stacking it on the one-frame interface. Start from the public frame reference and stale-texture control in #658. Use one frame per EXE invocation. The [two-frame follow-up](https://github.com/RonLogic/Xbox2Windows/pull/1) covers a different acceptance case and already has a prototype. Coordinate any shared provider edits on #218 before starting them. ## Acceptance - Run two source-built input cases with different compute palettes. For each case, native Windows, `pe_map` and AOT must agree on the observable request and exit status, and every RGBA byte must match an independent reference. - Reuse the stale-texture control from #658. Bind the earlier texture after dispatching both producers and demonstrate that the pixel comparison detects it while unchanged clear pixels still match. - Register a focused WARP CTest that exercises the EXE path in both Windows presets. Record the tested SHA, commands and results, and provide a physical-adapter run or capability diagnostic when available. Claim by commenting with the part you can implement or review and any interface touched. Refs #218, #560 and #658.
grahamster2 commented 2026-11-24 06:48:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by grahamster2 on 2026-11-22T19:08:25Z.


I'd like to take the whole one-frame integration for this issue.

Plan

  • New draw cases on the #560 contract, with no change to the draw_request/draw_frame signatures, shim_startup.asm or translate_shim_startup.py. X2W_SHIM_DRAW_CASE gains chain0, chain1 and chain-stale. draw_request maps each to a new mode, and draw_frame sends those modes to a separate test-only file, tests/cpu/shim_chain_gpu.cpp. That file runs the #658 sequence on one direct queue: the translated gfx1013 compute producer or producers write the raw UAV, the result is copied into a 2×2 texture, and the translated indexed mesh and image_sample_lz pixel stages draw into a 32×32 target. Its root layout matches --compute-mesh-texture.
  • The provider publishes the whole observable result after the startup output: all 4,096 RGBA bytes and the 80-byte mesh export trace. draw_frame returns the mismatch count against the case reference, so the EXE exits 42 on a match and 20 otherwise (the existing bad_draw path).
  • tests/cpu/shim_chain_check.py builds the translated mesh, pixel and two producer shaders, along with both case files, from the generators used by compute_mesh_texture_check.py. It then runs the native EXE, pe_map and AOT for each case. All three runners must produce the same request and exit status, and their bytes must match a Python reference computed independently of D3D12. chain0 dispatches palette A. chain1 dispatches A and then B and binds B. chain-stale dispatches both and binds A against B's reference. The check expects exit 20, the same 276 differing pixels in every runner, and matching clear pixels and trace.
  • CTest: cpu_shim_chain_warp and cpu_shim_chain_hardware (skip 77 when mesh shader tier 1 is missing). They run in both dev and release. Hardware runs: RTX 3080 and an RDNA2 iGPU.

Interfaces touched: #560's tests/cpu/shim_draw_provider.cpp (new modes only), CMake (cpu_shim_draw sources and the two tests), and docs/experiments.md. tests/mesh_entry_draw.cpp, offscreen_check and the #658 harness stay as they are. Their helpers live in the offscreen_check executable, so the DLL keeps its own copy of the sequence instead of sharing one.

Order: I'm building and testing this now on top of #560's head (0472851) and will push it to a branch. When #560 merges, I'll rebase onto main and open the PR. It doesn't overlap the two- and three-frame draft in RonLogic/Xbox2Windows#1: one frame per process, a separate GPU file and no persistent device state.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7084139376 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/671#issuecomment-7084139376). Originally posted by [grahamster2](https://github.com/grahamster2) on 2026-11-22T19:08:25Z. --- I'd like to take the whole one-frame integration for this issue. **Plan** - New draw cases on the #560 contract, with no change to the `draw_request`/`draw_frame` signatures, `shim_startup.asm` or `translate_shim_startup.py`. `X2W_SHIM_DRAW_CASE` gains `chain0`, `chain1` and `chain-stale`. `draw_request` maps each to a new mode, and `draw_frame` sends those modes to a separate test-only file, `tests/cpu/shim_chain_gpu.cpp`. That file runs the #658 sequence on one direct queue: the translated gfx1013 compute producer or producers write the raw UAV, the result is copied into a 2×2 texture, and the translated indexed mesh and `image_sample_lz` pixel stages draw into a 32×32 target. Its root layout matches `--compute-mesh-texture`. - The provider publishes the whole observable result after the startup output: all 4,096 RGBA bytes and the 80-byte mesh export trace. `draw_frame` returns the mismatch count against the case reference, so the EXE exits 42 on a match and 20 otherwise (the existing `bad_draw` path). - `tests/cpu/shim_chain_check.py` builds the translated mesh, pixel and two producer shaders, along with both case files, from the generators used by `compute_mesh_texture_check.py`. It then runs the native EXE, `pe_map` and AOT for each case. All three runners must produce the same request and exit status, and their bytes must match a Python reference computed independently of D3D12. `chain0` dispatches palette A. `chain1` dispatches A and then B and binds B. `chain-stale` dispatches both and binds A against B's reference. The check expects exit 20, the same 276 differing pixels in every runner, and matching clear pixels and trace. - CTest: `cpu_shim_chain_warp` and `cpu_shim_chain_hardware` (skip 77 when mesh shader tier 1 is missing). They run in both `dev` and `release`. Hardware runs: RTX 3080 and an RDNA2 iGPU. **Interfaces touched:** #560's `tests/cpu/shim_draw_provider.cpp` (new modes only), CMake (`cpu_shim_draw` sources and the two tests), and `docs/experiments.md`. `tests/mesh_entry_draw.cpp`, `offscreen_check` and the #658 harness stay as they are. Their helpers live in the `offscreen_check` executable, so the DLL keeps its own copy of the sequence instead of sharing one. **Order:** I'm building and testing this now on top of #560's head (`0472851`) and will push it to a branch. When #560 merges, I'll rebase onto `main` and open the PR. It doesn't overlap the two- and three-frame draft in RonLogic/Xbox2Windows#1: one frame per process, a separate GPU file and no persistent device state.
grahamster2 commented 2026-11-24 06:48:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by grahamster2 on 2026-11-22T19:54:45Z.


Status: #560 is merged, and the integration is up as #682 at 543b951. In dev and release, cpu_shim_chain_warp and cpu_shim_chain_hardware pass on WARP and the RTX 3080. For chain0 and chain1, native, pe_map and AOT agree on all 4,176 published bytes, and the bytes match the Python references. For chain-stale, all three runners exit 20 with A's frame. Against B's reference it differs at exactly 276 pixels, while all 748 clear pixels and the trace match. The RDNA2 iGPU reports mesh_shader_tier=unsupported (capability skip), the same as compute_mesh_texture_hardware on that adapter. The full suite passes 296/296 in both presets. I couldn't check the debug layer here because Graphics Tools isn't installed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7084777048 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/671#issuecomment-7084777048). Originally posted by [grahamster2](https://github.com/grahamster2) on 2026-11-22T19:54:45Z. --- Status: #560 is merged, and the integration is up as #682 at `543b951`. In dev and release, `cpu_shim_chain_warp` and `cpu_shim_chain_hardware` pass on WARP and the RTX 3080. For `chain0` and `chain1`, native, `pe_map` and AOT agree on all 4,176 published bytes, and the bytes match the Python references. For `chain-stale`, all three runners exit 20 with A's frame. Against B's reference it differs at exactly 276 pixels, while all 748 clear pixels and the trace match. The RDNA2 iGPU reports `mesh_shader_tier=unsupported` (capability skip), the same as `compute_mesh_texture_hardware` on that adapter. The full suite passes 296/296 in both presets. I couldn't check the debug layer here because Graphics Tools isn't installed.
R0Y00 commented 2026-11-24 06:48:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T20:12:27Z.


The dependency is ready: #560 merged in 899785e and the post-merge CI passed. The merged fixture uses draw_request() to select the case and draw_frame(DWORD mode) to execute it. Native Windows, pe_map and AOT are compared for the complete frame and the mirrored and unknown-case controls. @grahamster2 you can base the one-frame integration on this merged contract. Please keep the signatures stable and reuse the #658 stale-texture control.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7085032859 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/671#issuecomment-7085032859). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T20:12:27Z. --- The dependency is ready: #560 merged in `899785e` and the post-merge CI passed. The merged fixture uses `draw_request()` to select the case and `draw_frame(DWORD mode)` to execute it. Native Windows, pe_map and AOT are compared for the complete frame and the mirrored and unknown-case controls. @grahamster2 you can base the one-frame integration on this merged contract. Please keep the signatures stable and reuse the #658 stale-texture control.
grahamster2 commented 2026-11-24 06:48:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by grahamster2 on 2026-11-22T20:21:49Z.


@R0Y00 That's what #682 does, on the merged contract at 0a9cc04 (head 543b951):

  • draw_request() / draw_frame(DWORD mode) signatures, the EXE and the AOT import table are unchanged. The chain adds three X2W_SHIM_DRAW_CASE values (chain0, chain1, chain-stale) to #560's provider.
  • The #658 stale-texture control is reused as chain-stale: the earlier texture is bound after both producers dispatch. All three runners exit 20, the frame differs from B's reference at exactly 276 pixels, and all 748 clear pixels and the mesh trace still match.
  • #560's existing frame, mirrored and unknown-case tests are untouched and pass alongside it, in dev and release (296/296 locally; both Windows CI jobs ran cpu_shim_chain_warp).

Ready for review whenever you are.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7085186577 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/671#issuecomment-7085186577). Originally posted by [grahamster2](https://github.com/grahamster2) on 2026-11-22T20:21:49Z. --- @R0Y00 That's what #682 does, on the merged contract at `0a9cc04` (head `543b951`): - `draw_request()` / `draw_frame(DWORD mode)` signatures, the EXE and the AOT import table are unchanged. The chain adds three `X2W_SHIM_DRAW_CASE` values (`chain0`, `chain1`, `chain-stale`) to #560's provider. - The #658 stale-texture control is reused as `chain-stale`: the earlier texture is bound after both producers dispatch. All three runners exit 20, the frame differs from B's reference at exactly 276 pixels, and all 748 clear pixels and the mesh trace still match. - #560's existing frame, mirrored and unknown-case tests are untouched and pass alongside it, in dev and release (296/296 locally; both Windows CI jobs ran `cpu_shim_chain_warp`). Ready for review whenever you are.
R0Y00 commented 2026-11-24 06:48:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T21:11:52Z.


The one-frame integration landed in #682. The WARP fixture ran and passed in both Development and /O2 CI. The native, pe_map and AOT runs compare the full frame and trace, and the stale texture exposes exactly 276 changed covered pixels. Thanks for keeping the draw provider ABI unchanged.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7085863204 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/671#issuecomment-7085863204). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T21:11:52Z. --- The one-frame integration landed in #682. The WARP fixture ran and passed in both Development and /O2 CI. The native, pe_map and AOT runs compare the full frame and trace, and the stale texture exposes exactly 276 changed covered pixels. Thanks for keeping the draw provider ABI unchanged.
Sign in to join this conversation.
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#665
No description provided.