shader: restore compilation of LDS replay requests #2941

Manually merged
github merged 2 commits from gh-pr/2941/head into gh-pr/2941/base 2026-11-27 01:29:51 +00:00
Owner

@⁠sydney-0o on GitHub · 2026-11-26 22:31 UTC · original
sydney-0o:codex/lds-request-loader → cpp-migration · +82 −15 · 5 files · 2 commits · merged 2026-11-26 22:49 UTC

On cpp-migration at e97c5c7c, the LDS replay CLI stops before compiling a valid slot 67 request with TypeError: load_compute_request() got an unexpected keyword argument 'pipeline_type'. The loader now constructs the requested pipeline after validating the input. Its compute stage can emit the native LDS and VOP2 pragmas and share VGPR write tracking with the standard stage. Returning LDS atomics validate their input operands before recording a write to the destination, including when address and destination alias.

The new CLI regression test compiles the source-built case F shader, inspects the bundle and checks that tampering with the request cannot publish another bundle. The control-flow test also exercises an atomic overwriting a partial d16 value and rejects an alias that reads undefined address bits.

Tested locally on Windows with MSVC and Windows SDK 10.0.26100 DXC at 71d468cf.

cmake --build --preset dev --target compile_dxil
ctest --preset dev --no-tests=error -R '^(native_lds_(request|control_flow)|startup_compute_request_offline)$'

3 passed, 0 skipped, 0 failed. The CLI test compiles the shader and checks its bundle. It does not dispatch it on a GPU.

AI-assisted.

**@⁠sydney-0o** on GitHub · 2026-11-26 22:31 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2941) `sydney-0o:codex/lds-request-loader` → `cpp-migration` · +82 −15 · 5 files · 2 commits · merged 2026-11-26 22:49 UTC On `cpp-migration` at `e97c5c7c`, the LDS replay CLI stops before compiling a valid slot 67 request with `TypeError: load_compute_request() got an unexpected keyword argument 'pipeline_type'`. The loader now constructs the requested pipeline after validating the input. Its compute stage can emit the native LDS and VOP2 pragmas and share VGPR write tracking with the standard stage. Returning LDS atomics validate their input operands before recording a write to the destination, including when address and destination alias. The new CLI regression test compiles the source-built case F shader, inspects the bundle and checks that tampering with the request cannot publish another bundle. The control-flow test also exercises an atomic overwriting a partial d16 value and rejects an alias that reads undefined address bits. Tested locally on Windows with MSVC and Windows SDK 10.0.26100 DXC at `71d468cf`. ```powershell cmake --build --preset dev --target compile_dxil ctest --preset dev --no-tests=error -R '^(native_lds_(request|control_flow)|startup_compute_request_offline)$' ``` 3 passed, 0 skipped, 0 failed. The CLI test compiles the shader and checks its bundle. It does not dispatch it on a GPU. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:29:49 +00:00
github manually merged commit 71d468cfdb into gh-pr/2941/base 2026-11-27 01:29:51 +00:00
Author
Owner

@⁠MasterDomino on GitHub · 2026-11-26 22:49 UTC · original · approved these changes

Review of head 71d468cf, tested merged onto cpp-migration 1cd48bd0. It merges cleanly. Approving and merging.

Code:

  • compile_lds_request.py now goes through load_compute_request(..., pipeline_type=...).
  • The DS path checks every input VGPR before it records the destination of a returning atomic, so an alias with the address or the data is checked first. Stage.u already walks every register of a v[a:b] range.
  • In gfx2hlsl.py, set_v is split into record_v_write plus set_v with the same steps. ComputePipeline.stage_type and the pipeline_type keyword default to the existing classes, so the runtime's translation path is unchanged.

Runs (Windows 11 26300.9974, AMD Radeon RX 9070 XT, release, Windows SDK 10.0.26100 DXC):

  • ctest --preset release --no-tests=error -R '^(native_lds_(request|control_flow|warp|hardware)|startup_compute_request_offline)$': 5/5 passed.
  • All 131 tests/startup_gfx2hlsl_*_check.py run bare: 129 passed. The two draw checks (export_null_draw, mul24_align_draw) need their CTest arguments and fail the same way on every branch when run bare.
  • Control: I restored compile_lds_request.py and gfx2hlsl.py from 1cd48bd0 and ran the new native_lds_request command, and it fails (the CLI exits non-zero). Restoring the PR files makes it pass.
  • No change to the runtime's translations: a copy of a cache written by the current runtime, translated with gfx2hlsl.py --pending and X2W_FXC= (translation only), with the base and with this PR. The outcome is identical for all 4,100 records, 321 ok on both.

The new test compiles and inspects the bundle but does not dispatch it, as the description says. native_lds_hardware still dispatches the DXC path.

AI-assisted; the commands above were run locally.

**@⁠MasterDomino** on GitHub · 2026-11-26 22:49 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2941#pullrequestreview-6081252940) · **approved these changes** Review of head `71d468cf`, tested merged onto `cpp-migration` `1cd48bd0`. It merges cleanly. Approving and merging. **Code:** - `compile_lds_request.py` now goes through `load_compute_request(..., pipeline_type=...)`. - The DS path checks every input VGPR before it records the destination of a returning atomic, so an alias with the address or the data is checked first. `Stage.u` already walks every register of a `v[a:b]` range. - In `gfx2hlsl.py`, `set_v` is split into `record_v_write` plus `set_v` with the same steps. `ComputePipeline.stage_type` and the `pipeline_type` keyword default to the existing classes, so the runtime's translation path is unchanged. **Runs** (Windows 11 26300.9974, AMD Radeon RX 9070 XT, release, Windows SDK 10.0.26100 DXC): - `ctest --preset release --no-tests=error -R '^(native_lds_(request|control_flow|warp|hardware)|startup_compute_request_offline)$'`: 5/5 passed. - All 131 `tests/startup_gfx2hlsl_*_check.py` run bare: 129 passed. The two draw checks (`export_null_draw`, `mul24_align_draw`) need their CTest arguments and fail the same way on every branch when run bare. - **Control:** I restored `compile_lds_request.py` and `gfx2hlsl.py` from `1cd48bd0` and ran the new `native_lds_request` command, and it fails (the CLI exits non-zero). Restoring the PR files makes it pass. - **No change to the runtime's translations:** a copy of a cache written by the current runtime, translated with `gfx2hlsl.py --pending` and `X2W_FXC=` (translation only), with the base and with this PR. The outcome is identical for all 4,100 records, 321 `ok` on both. The new test compiles and inspects the bundle but does not dispatch it, as the description says. `native_lds_hardware` still dispatches the DXC path. AI-assisted; the commands above were run locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.