compute: bind fixed UAV strides and lower stride compares for descriptor SCC (Part of #3224, #2935) #3811

Manually merged
github merged 1 commit from github-bot/gh-3809 into main 2026-12-02 02:44:29 +00:00 AGit
Owner

@⁠timbot103 on GitHub · 2026-12-02 01:18 UTC · original
timbot103:shader/compute-descriptor-scc → main · +336 −102 · 16 files · 1 commits · merged 2026-12-02 02:38 UTC

## Summary

Extends provable symbolic descriptor-field SCC handling in native direct compute (Part of #3226, #2935; listed under "No open PR" on #3226, 2 shaders / 430,886 dispatches):

  • Fixed raw UAV stride provenance (src/gfx1013_direct_compute.inl, src/gfx1013_compute_native.h, src/direct_compute_cache.cpp, src/native_compute_pipeline.*, src/startup_stubs/d3d12_compute_dispatch.inl, src/startup_stubs/native_mesh86.inl): generalizes stride_srvs -> stride_sources (ComputeStrideSource { shader_register, writable }) so fixed table raw_buffer_uav slots (including shared read-write raw views) supply their bound guest stride via udsrc <k> uav_stride <u> on both the published manifest route and in-process native compute route (Mesh86 explicitly rejects writable stride sources). Non-raw_buffer_uav views on a writable stride slot stay refused.
  • Explicit 32-bit scalar comparisons on stride symbols (src/gfx1013_direct_compute.inl): lowers s_cmp_* (SOPC) and s_cmpk_* (SOPK) when comparing Symbol::Type::stride or Symbol::Type::byte_stride (max(stride, 1)) instead of failing with unbound numeric SGPR.
  • Indexed table descriptor provenance (src/gfx1013_compute_native.cpp): preserves indexed_descriptor stride provenance on s_bfe_u32 ... 0xe0010 (with a non-zero definition sentinel strictly on the derived stride symbol so indexed_descriptor.definition == i.pc stays intact for mesh/graphics/heap-window consumers), ensuring an indexed table stride still refuses cleanly with numeric SCC from a symbolic descriptor field.
  • SCC liveness audit & fail-closed controls: verifies uses_scc_after across all supported SOP1/SOP2/SOPC/SOPK forms (tests/native_scc_liveness_check.py, 25/25 mutation kills), while keeping zero_stride_word, clear_oob, indexed/heap/CBV strides, and non-raw writable views refused with numeric SCC from a symbolic descriptor field.

Verification

Tested on Windows 11 (26200.9974), MSVC 19.44, Ninja, Windows SDK 10.0.26100.0, app-local WARP 1.0.22, and NVIDIA GeForce RTX 5080 (driver 32.0.16.2140; D3D12 debug layer unavailable on this host):

  • Debug (dev): ctest --preset dev --no-tests=error -R '^(native_descriptor_scc_|startup_compute_descriptor_scc_|native_scc_liveness|native_compute_manifest_|native_direct_container|native_direct_mesh|native_global_srv_heap_replay)' — 14/14 passed (0 failed, 0 skipped), covering mixed SRV/UAV strides on both native and published runtime dispatch routes plus mesh/heap regressions.
  • Release (release): 12/12 passed (0 failed, 0 skipped) for all targets above not linking xg_xs.dll (local host AV quarantines Release xg_xs.dll, which startup_stream_consumer links as a dependency; startup_compute_descriptor_scc_{hardware,warp} passed in Debug and also passed in the subagent's Release run using an alternate build path).
  • git diff --check origin/main..HEAD: clean; zero new MSVC /W4 warnings on edited lines.

AI-assisted.

**@⁠timbot103** on GitHub · 2026-12-02 01:18 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3809) `timbot103:shader/compute-descriptor-scc` → `main` · +336 −102 · 16 files · 1 commits · merged 2026-12-02 02:38 UTC ## Summary Extends provable symbolic descriptor-field SCC handling in native direct compute (Part of #3226, #2935; listed under "No open PR" on #3226, 2 shaders / 430,886 dispatches): - **Fixed raw UAV stride provenance (`src/gfx1013_direct_compute.inl`, `src/gfx1013_compute_native.h`, `src/direct_compute_cache.cpp`, `src/native_compute_pipeline.*`, `src/startup_stubs/d3d12_compute_dispatch.inl`, `src/startup_stubs/native_mesh86.inl`):** generalizes `stride_srvs` -> `stride_sources` (`ComputeStrideSource { shader_register, writable }`) so fixed table `raw_buffer_uav` slots (including shared read-write raw views) supply their bound guest stride via `udsrc <k> uav_stride <u>` on both the published manifest route and in-process native compute route (Mesh86 explicitly rejects writable stride sources). Non-`raw_buffer_uav` views on a writable stride slot stay refused. - **Explicit 32-bit scalar comparisons on stride symbols (`src/gfx1013_direct_compute.inl`):** lowers `s_cmp_*` (SOPC) and `s_cmpk_*` (SOPK) when comparing `Symbol::Type::stride` or `Symbol::Type::byte_stride` (`max(stride, 1)`) instead of failing with `unbound numeric SGPR`. - **Indexed table descriptor provenance (`src/gfx1013_compute_native.cpp`):** preserves `indexed_descriptor` stride provenance on `s_bfe_u32 ... 0xe0010` (with a non-zero `definition` sentinel strictly on the derived `stride` symbol so `indexed_descriptor.definition == i.pc` stays intact for mesh/graphics/heap-window consumers), ensuring an indexed table stride still refuses cleanly with `numeric SCC from a symbolic descriptor field`. - **SCC liveness audit & fail-closed controls:** verifies `uses_scc_after` across all supported SOP1/SOP2/SOPC/SOPK forms (`tests/native_scc_liveness_check.py`, 25/25 mutation kills), while keeping `zero_stride_word`, `clear_oob`, indexed/heap/CBV strides, and non-raw writable views refused with `numeric SCC from a symbolic descriptor field`. ## Verification Tested on Windows 11 (`26200.9974`), MSVC `19.44`, Ninja, Windows SDK `10.0.26100.0`, app-local WARP `1.0.22`, and NVIDIA GeForce RTX 5080 (driver `32.0.16.2140`; D3D12 debug layer unavailable on this host): - **Debug (`dev`):** `ctest --preset dev --no-tests=error -R '^(native_descriptor_scc_|startup_compute_descriptor_scc_|native_scc_liveness|native_compute_manifest_|native_direct_container|native_direct_mesh|native_global_srv_heap_replay)'` — **14/14 passed** (0 failed, 0 skipped), covering mixed SRV/UAV strides on both native and published runtime dispatch routes plus mesh/heap regressions. - **Release (`release`):** **12/12 passed** (0 failed, 0 skipped) for all targets above not linking `xg_xs.dll` (local host AV quarantines Release `xg_xs.dll`, which `startup_stream_consumer` links as a dependency; `startup_compute_descriptor_scc_{hardware,warp}` passed in Debug and also passed in the subagent's Release run using an alternate build path). - `git diff --check origin/main..HEAD`: clean; zero new MSVC `/W4` warnings on edited lines. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 01:24:52 +00:00
github-bot force-pushed github-bot/gh-3809 from c2d4b8b023 to fcd86dfbd5 2026-12-02 02:14:19 +00:00 Compare
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-02 02:09 UTC · original

The Linux job's final failing check is tests/standin_exports_check.py. Please reconcile the D3D12 stand-in export expectations after rebasing on current main and rerun the check. Most other FAIL lines in that log are from expected mutation controls.

**@⁠R0Y00** on GitHub · 2026-12-02 02:09 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3809#issuecomment-7332541723) The Linux job's final failing check is `tests/standin_exports_check.py`. Please reconcile the D3D12 stand-in export expectations after rebasing on current main and rerun the check. Most other `FAIL` lines in that log are from expected mutation controls.
Author
Owner

@⁠timbot103 on GitHub · 2026-12-02 02:35 UTC · original

@⁠R0Y00 Rebased onto main (3ecfbad7, picking up 4be65468's standin_exports_check.py fix) as fcd86dfb; standin_exports_check.py (470/470), startup_triage_run_check.py, and all Windows/Linux CI checks are now green.

AI-assisted.

**@⁠timbot103** on GitHub · 2026-12-02 02:35 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3809#issuecomment-7332990774) @⁠R0Y00 Rebased onto `main` (`3ecfbad7`, picking up `4be65468`'s `standin_exports_check.py` fix) as `fcd86dfb`; `standin_exports_check.py` (470/470), `startup_triage_run_check.py`, and all Windows/Linux CI checks are now green. AI-assisted.
github manually merged commit 273c8d38a8 into main 2026-12-02 02:44:29 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.