gpu: test runtime indexing of a bounded sampler table #1185

Merged
Jess-Doit merged 2 commits from upstream-pr/1192 into main 2026-11-24 03:49:48 +00:00
Jess-Doit commented 2026-11-24 03:19:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T03:19:06Z.


Change

Refs #1143.

Add a source-built desktop Shader Model 6.0 check for a two-entry sampler table. A root constant chooses between wrap and clamp while the table and texture stay fixed. A forced-index-zero control repeats the wrap result for both requests. This is a desktop SM 6.0 check of the runtime behaviour, not the translator change #1143 asks for: the startup translator (in #1135) still substitutes a default sampler, and dynamic resource-heap indexing is not covered here.

Verification

Tested e85989aa (rebased on 645b9697) on Windows 10 22H2 build 19045.6456, GTX 1060 6GB driver 32.0.15.6094, and in-box WARP 10.0.19041.5794.

. .\tools\dev.ps1
$env:XBOX2WINDOWS_ADAPTER = '1060'
foreach ($preset in 'dev', 'release') {
    cmake --preset $preset
    cmake --build --preset $preset --target offscreen_check -j 2
    ctest --preset $preset --no-tests=error -R dynamic_sampler_index -V
}

Debug and Release each passed 2/2 with zero skips. Both adapters read 3e800000,3f400000 for runtime selection and 3e800000,3e800000 for the fixed-zero control. Replacing the runtime selector with literal zero failed both tests in each preset at the index-one word. Rebuilding after restoring the selector passed 2/2 in each preset. (The mutation runs were on the pre-rebase commit a00c3c89; the rebase only merged a neighbouring declaration in tests/desktop_gpu.h, and the rebased commit passed 2/2 again in both presets.) The D3D12 debug layer reported zero warnings and errors.

AI-assisted (Codex, reviewed with Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6573848421 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1192). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-24T03:19:06Z. --- ## Change Refs #1143. Add a source-built desktop Shader Model 6.0 check for a two-entry sampler table. A root constant chooses between wrap and clamp while the table and texture stay fixed. A forced-index-zero control repeats the wrap result for both requests. This is a desktop SM 6.0 check of the runtime behaviour, not the translator change #1143 asks for: the startup translator (in #1135) still substitutes a default sampler, and dynamic resource-heap indexing is not covered here. ## Verification Tested `e85989aa` (rebased on `645b9697`) on Windows 10 22H2 build `19045.6456`, GTX 1060 6GB driver `32.0.15.6094`, and in-box WARP `10.0.19041.5794`. ```powershell . .\tools\dev.ps1 $env:XBOX2WINDOWS_ADAPTER = '1060' foreach ($preset in 'dev', 'release') { cmake --preset $preset cmake --build --preset $preset --target offscreen_check -j 2 ctest --preset $preset --no-tests=error -R dynamic_sampler_index -V } ``` Debug and Release each passed 2/2 with zero skips. Both adapters read `3e800000,3f400000` for runtime selection and `3e800000,3e800000` for the fixed-zero control. Replacing the runtime selector with literal zero failed both tests in each preset at the index-one word. Rebuilding after restoring the selector passed 2/2 in each preset. (The mutation runs were on the pre-rebase commit `a00c3c89`; the rebase only merged a neighbouring declaration in `tests/desktop_gpu.h`, and the rebased commit passed 2/2 again in both presets.) The D3D12 debug layer reported zero warnings and errors. AI-assisted (Codex, reviewed with Claude Code).
upstream-sync closed this pull request 2026-11-24 06:46:49 +00:00
tedin7 commented 2026-11-24 06:46:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T03:27:41Z.

Review: COMMENTED


Reviewed e85989aa (diff + Linux doc/bidi checks; Windows build/D3D12/WARP tests were not run locally).

Findings

No functional or AGENTS.md issues found in the diff:

  • tests/binding_mips.hlsl & tests/binding_mips.cpp: dispatches a source-built cs_6_0 shader with a 2-entry shader-visible sampler heap (wrap at index 0, clamp at index 1) and a 2-texel R32_FLOAT texture sampled at U = 1.25, plus a forceZero shader control (3e800000,3f400000 vs 3e800000,3e800000).
  • tests/offscreen_check.cpp & CMakeLists.txt: registers dynamic_sampler_index_{hardware,warp} behind kGateSm60SamplerViews with SKIP_RETURN_CODE 77 and TIMEOUT 45.
  • docs/experiments.md: updated with the new section and reproduction command; wording is title-neutral.

Checks run on Linux

  • python3 -B tests/docs_links_check.py: passed (15 Markdown files, 265 links).
  • python3 -B tests/bidi_controls_check.py: passed (971 tracked files).
  • Windows build and D3D12/WARP execution (offscreen_check / dynamic_sampler_index_*) were not run locally.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6033222906 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1192#pullrequestreview-6033222906). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T03:27:41Z. **Review:** COMMENTED --- Reviewed `e85989aa` (diff + Linux doc/bidi checks; Windows build/D3D12/WARP tests were not run locally). ### Findings No functional or `AGENTS.md` issues found in the diff: - `tests/binding_mips.hlsl` & `tests/binding_mips.cpp`: dispatches a source-built `cs_6_0` shader with a 2-entry shader-visible sampler heap (wrap at index 0, clamp at index 1) and a 2-texel `R32_FLOAT` texture sampled at `U = 1.25`, plus a `forceZero` shader control (`3e800000,3f400000` vs `3e800000,3e800000`). - `tests/offscreen_check.cpp` & `CMakeLists.txt`: registers `dynamic_sampler_index_{hardware,warp}` behind `kGateSm60SamplerViews` with `SKIP_RETURN_CODE 77` and `TIMEOUT 45`. - `docs/experiments.md`: updated with the new section and reproduction command; wording is title-neutral. ### Checks run on Linux - `python3 -B tests/docs_links_check.py`: passed (15 Markdown files, 265 links). - `python3 -B tests/bidi_controls_check.py`: passed (971 tracked files). - Windows build and D3D12/WARP execution (`offscreen_check` / `dynamic_sampler_index_*`) were not run locally.
tedin7 commented 2026-11-24 06:46:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T03:51:32Z.

Review: COMMENTED


Retest on Linux at commit c5fd3ff7 (delta e85989aa..c5fd3ff7; Windows build/tests were not executed locally).

Findings

  • c5fd3ff7 merges main (59eb7812) and preserves both --dynamic-sampler-index (#1192) and --sampler-index-control (#1115) in CMakeLists.txt and tests/offscreen_check.cpp.
  • Minor formatting nit in tests/offscreen_check.cpp:1029: missing newline between }; and constexpr CapabilityGate kGateSm60RawUavDump{.

Checks run (Linux, c5fd3ff7)

  • /root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (16 Markdown files, 273 links).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (1011 tracked files).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6033388700 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1192#pullrequestreview-6033388700). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T03:51:32Z. **Review:** COMMENTED --- Retest on Linux at commit `c5fd3ff7` (delta `e85989aa..c5fd3ff7`; Windows build/tests were **not** executed locally). ### Findings - `c5fd3ff7` merges `main` (`59eb7812`) and preserves both `--dynamic-sampler-index` (`#1192`) and `--sampler-index-control` (`#1115`) in `CMakeLists.txt` and `tests/offscreen_check.cpp`. - Minor formatting nit in `tests/offscreen_check.cpp:1029`: missing newline between `};` and `constexpr CapabilityGate kGateSm60RawUavDump{`. ### Checks run (Linux, `c5fd3ff7`) - `/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py`: passed (`16` Markdown files, `273` links). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py`: passed (`1011` tracked files).
Sign in to join this conversation.
No reviewers
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!1185
No description provided.