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

Manually merged
github merged 2 commits from gh-pr/1192/head into gh-pr/1192/base 2026-11-26 22:47:42 +00:00
Owner

@⁠Jess-Doit on GitHub · 2026-11-24 03:19 UTC · original
Jess-Doit:test/startup-dynamic-sampler-sm60 → main · +103 −1 · 6 files · 2 commits · merged 2026-11-24 03:49 UTC

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).

**@⁠Jess-Doit** on GitHub · 2026-11-24 03:19 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1192) `Jess-Doit:test/startup-dynamic-sampler-sm60` → `main` · +103 −1 · 6 files · 2 commits · merged 2026-11-24 03:49 UTC ## 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).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:47:40 +00:00
github manually merged commit c5fd3ff79b into gh-pr/1192/base 2026-11-26 22:47:42 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 03:27 UTC · original · reviewed

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** on GitHub · 2026-11-24 03:27 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1192#pullrequestreview-6033222906) · **reviewed** 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.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 03:51 UTC · original · reviewed

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).
**@⁠tedin7** on GitHub · 2026-11-24 03:51 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1192#pullrequestreview-6033388700) · **reviewed** 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).
This discussion has been locked. Commenting is limited to contributors.
No description provided.