tests: report each split sampler mismatch and detect omitted stores #2398

Merged
RavenCurseBurg merged 4 commits from upstream-pr/2406 into main 2026-11-25 17:25:51 +00:00
RavenCurseBurg commented 2026-11-25 15:30:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T15:30:30Z.


Refs #1115. The strict translated sampler fixture now names the plain or renamed table, reports the index and bits of every mismatching word over all three swaps, and returns failure if any readback differs. An earlier failure also survives a later capability skip.

The previous fixture accepted a shader that omitted both comparison stores during swap 1. Both expected values carried over from swap 0. The readback now fills the UAV with four distinct sentinels before each dispatch. The new negative control must report exactly words 2 and 3 in swap 1, with bits c0400000 and c0800000, and still examine swap 2. I verified that the old renderer returned success for that shader on all three local adapters.

Local adapter (driver) Plain and renamed translated tables Paired direct HLSL
Intel UHD Graphics 770 (32.0.101.5973) Strict exit 1. Words 1 and 3 differ in each swap for both tables Dispatch-thread index passes. Group index reproduces the same three rows
NVIDIA RTX 4060 (32.0.15.9579) All 12 words per table match Both index sources pass
In-box WARP (10.0.26100.9711) All 12 words per table match Both index sources pass

Intel's readbacks were 0.25 0.25 0 0, 0.75 0.75 0 0, and 0.25 0.25 1 1 for swaps 0, 1, and 2. The missing-store control detected both unwritten words on Intel, NVIDIA and WARP. Local translated programs used DXC 1.9.2609.5, project-pinned SPIRV-Tools and patched SPIRV-Cross. The embedded direct controls reported DXC 1.9.2602.17. The local debug layer was unavailable.

Windows Server 2025 WARP validation passed both registered CTests, with the debug layer enabled and both absent writes detected. The checked renderer is from c601e6e9. Subsequent commits add the measured hardware results to the docs and clarify the Python summary. I reran the final driver on all three local adapters. The two existing direct index control binaries compiled byte-for-byte identically before and after the HLSL edit with DXC 1.9.2609.5.

Reproduce with the pinned SPIR-V tools configured:

cmake --build --preset dev --target offscreen_check
ctest --preset dev --no-tests=error -V -R '^(spirv_sampler_views|sampler_index_control)_(hardware|warp)$'

AI assistance: Codex + GPT-6.2 Astra (xhigh).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6608002792 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2406). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T15:30:30Z. --- Refs #1115. The strict translated sampler fixture now names the plain or renamed table, reports the index and bits of every mismatching word over all three swaps, and returns failure if any readback differs. An earlier failure also survives a later capability skip. The previous fixture accepted a shader that omitted both comparison stores during swap 1. Both expected values carried over from swap 0. The readback now fills the UAV with four distinct sentinels before each dispatch. The new negative control must report exactly words 2 and 3 in swap 1, with bits `c0400000` and `c0800000`, and still examine swap 2. I verified that the old renderer returned success for that shader on all three local adapters. | Local adapter (driver) | Plain and renamed translated tables | Paired direct HLSL | | --- | --- | --- | | Intel UHD Graphics 770 (32.0.101.5973) | Strict exit 1. Words 1 and 3 differ in **each** swap for both tables | Dispatch-thread index passes. Group index reproduces the same three rows | | NVIDIA RTX 4060 (32.0.15.9579) | All 12 words per table match | Both index sources pass | | In-box WARP (10.0.26100.9711) | All 12 words per table match | Both index sources pass | Intel's readbacks were `0.25 0.25 0 0`, `0.75 0.75 0 0`, and `0.25 0.25 1 1` for swaps 0, 1, and 2. The missing-store control detected both unwritten words on Intel, NVIDIA and WARP. Local translated programs used DXC 1.9.2609.5, project-pinned SPIRV-Tools and patched SPIRV-Cross. The embedded direct controls reported DXC 1.9.2602.17. The local debug layer was unavailable. [Windows Server 2025 WARP validation](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45645071330) passed both registered CTests, with the debug layer enabled and both absent writes detected. The checked renderer is from `c601e6e9`. Subsequent commits add the measured hardware results to the docs and clarify the Python summary. I reran the final driver on all three local adapters. The two existing direct index control binaries compiled byte-for-byte identically before and after the HLSL edit with DXC 1.9.2609.5. Reproduce with the pinned SPIR-V tools configured: ```powershell cmake --build --preset dev --target offscreen_check ctest --preset dev --no-tests=error -V -R '^(spirv_sampler_views|sampler_index_control)_(hardware|warp)$' ``` AI assistance: Codex + GPT-6.2 Astra (xhigh).
KelboLive commented 2026-11-25 16:05:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-25T15:57:01Z.


APPROVED: Focused fix reporting per-split sampler mismatches and detecting omitted store operations. Clear test-driven approach. No game files added.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167457176 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2406#issuecomment-7167457176). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-25T15:57:01Z. --- APPROVED: Focused fix reporting per-split sampler mismatches and detecting omitted store operations. Clear test-driven approach. No game files added.
tedin7 commented 2026-11-25 17:01:27 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:08:27Z.

Review: COMMENTED


Review of head 2eda1777 (tests only: sampler.py, sampler_readback.cpp, sampler_index_control.hlsl, docs/experiments.md).

What I checked:

  • The readback now fills the UAV with four distinct sentinels before each dispatch, so a shader that skips a store can no longer pass by carrying the previous swap's value.
  • All three swaps are still examined and any mismatch makes the run fail, with word index and bits printed.
  • The new negative control (OMIT_STORES_ON_ORDINARY_SWAP in sampler_index_control.hlsl, run from check_missing_stores in sampler.py) asserts exact exit code, exactly words 2 and 3 of swap 1 with the sentinel bits, and the mismatch message. It is a real D3D12 readback, not a string check, and a skip (exit 77) is propagated.
  • The macro is off by default, so the two existing index controls compile as before.
  • Scope is small and additive. I found no open or merged PR covering the same sentinel/omitted-store check.

No blocking findings. Next: update with main, CI, Win2025 WARP dev+release.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6060944927 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2406#pullrequestreview-6060944927). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:08:27Z. **Review:** COMMENTED --- Review of head 2eda1777 (tests only: `sampler.py`, `sampler_readback.cpp`, `sampler_index_control.hlsl`, `docs/experiments.md`). What I checked: - The readback now fills the UAV with four distinct sentinels before each dispatch, so a shader that skips a store can no longer pass by carrying the previous swap's value. - All three swaps are still examined and any mismatch makes the run fail, with word index and bits printed. - The new negative control (`OMIT_STORES_ON_ORDINARY_SWAP` in `sampler_index_control.hlsl`, run from `check_missing_stores` in `sampler.py`) asserts exact exit code, exactly words 2 and 3 of swap 1 with the sentinel bits, and the mismatch message. It is a real D3D12 readback, not a string check, and a skip (exit 77) is propagated. - The macro is off by default, so the two existing index controls compile as before. - Scope is small and additive. I found no open or merged PR covering the same sentinel/omitted-store check. No blocking findings. Next: update with main, CI, Win2025 WARP dev+release. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 17:01:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:17:17Z.


Win2025 WARP receipt for head 2eda1777 after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 2eda17771b79e803e6c0dd95ed402ac2fd5dd1bc:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev -- -j 2): 4.60s (configure 0.00s)
    • Test (ctest --preset dev -R 'spirv_sampler_views_warp' --parallel 6 --no-tests=error --output-on-failure): 1/1 passed (0.93s: spirv_sampler_views_warp 0.82s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release -- -j 2): 3.63s (configure 0.00s)
    • Test (ctest --preset release -R 'spirv_sampler_views_warp' --parallel 6 --no-tests=error --output-on-failure): 1/1 passed (0.76s: spirv_sampler_views_warp 0.67s)
  • sccache: 2/6 hits; wall 16.1s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167756229 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2406#issuecomment-7167756229). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:17:17Z. --- Win2025 WARP receipt for head 2eda1777 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `2eda17771b79e803e6c0dd95ed402ac2fd5dd1bc`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev -- -j 2`): `4.60s` (configure `0.00s`) - Test (`ctest --preset dev -R 'spirv_sampler_views_warp' --parallel 6 --no-tests=error --output-on-failure`): **1/1 passed** (`0.93s`: `spirv_sampler_views_warp` `0.82s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release -- -j 2`): `3.63s` (configure `0.00s`) - Test (`ctest --preset release -R 'spirv_sampler_views_warp' --parallel 6 --no-tests=error --output-on-failure`): **1/1 passed** (`0.76s`: `spirv_sampler_views_warp` `0.67s`) - `sccache`: 2/6 hits; wall `16.1s` AI-assisted; commands listed were executed locally.
RavenCurseBurg commented 2026-11-25 17:01:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T16:21:48Z.


@tedin7 I checked the reviewed head 2eda1777 against upstream main at 7092683a. It contains that main commit, and all three upstream CI jobs passed.

I also rebuilt offscreen_check from this exact head with the stock dev (Debug) and release presets on Windows Server 2025. Both WARP CTests passed in each build with the D3D12 debug layer enabled. Both translated tables produced all three expected swaps, the two direct index controls matched, and the omitted-store control reported exactly words 2 and 3 of swap 1 with c0400000 and c0800000.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167851040 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2406#issuecomment-7167851040). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T16:21:48Z. --- @tedin7 I checked the reviewed head `2eda1777` against upstream `main` at `7092683a`. It contains that main commit, and all three upstream CI jobs passed. I also rebuilt `offscreen_check` from this exact head with the stock [dev (Debug)](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45652416347/job/139340126951) and [release](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45652416347/job/139340127464) presets on Windows Server 2025. Both WARP CTests passed in each build with the D3D12 debug layer enabled. Both translated tables produced all three expected swaps, the two direct index controls matched, and the omitted-store control reported exactly words 2 and 3 of swap 1 with `c0400000` and `c0800000`.
upstream-sync closed this pull request 2026-11-25 18:01:00 +00:00
MasterDomino commented 2026-11-25 18:01:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T17:25:46Z.

Review: APPROVED


Approved at head 2eda1777. The change is test fixtures and docs: tests/spirv_window/sampler_readback.cpp, sampler.py, tests/sampler_index_control.hlsl and docs/experiments.md. This adds an AMD adapter to the author's Intel, NVIDIA and WARP table, plus a negative control on the renderer change.

Environment

  • Windows 11 build 26300, --preset dev, offscreen_check built at 2eda1777.
  • The pinned SPIR-V tools from tools/setup-spirv-tools.ps1, and DXC 1.8.2502.11 from SDK 10.0.26100.

Normal run

ctest --preset dev --no-tests=error -V -R '^(spirv_sampler_views|sampler_index_control)_(hardware|warp)$'
  • 4/4 pass, with no skips.
  • On the AMD Radeon RX 9070 XT (1002:7550, driver 32.0.32029.2010):
    • Translated tables: the plain and renamed tables match all 12 words in each of swaps 0–2: sample 0.25 0.75 / 0.75 0.25 / 0.25 0.75, comparison 0 1 / 0 1 / 1 0. That is the RTX 4060 and WARP row of the table, not the UHD 770 one.
    • Direct HLSL controls: both the dispatch-thread and group-index controls pass in every swap.
  • Missing-store control: detected on AMD and WARP, at exactly sampler swap 1 word 2: expected=00000000 actual=c0400000 and word 3: expected=3f800000 actual=c0800000.

Negative control on the renderer change

I restored tests/spirv_window/sampler_readback.cpp to the merge base 7092683a, which has no sentinel fill, kept the PR's sampler.py, and rebuilt offscreen_check:

  • spirv_sampler_views_hardware fails: AssertionError: missing comparison stores: exit 0. The old renderer accepts the shader that omits both comparison stores, which is the false pass the description reports.
  • After restoring the PR's renderer and rebuilding, all 4 tests pass again.

Merge checks: the branch merges cleanly with current main. Required CI passed at this head. The /O2 and coverage skips come from explicit workflow conditions. There are no review threads.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6062031877 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2406#pullrequestreview-6062031877). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T17:25:46Z. **Review:** APPROVED --- Approved at head `2eda1777`. The change is test fixtures and docs: `tests/spirv_window/sampler_readback.cpp`, `sampler.py`, `tests/sampler_index_control.hlsl` and `docs/experiments.md`. This adds an AMD adapter to the author's Intel, NVIDIA and WARP table, plus a negative control on the renderer change. ### Environment - Windows 11 build 26300, `--preset dev`, `offscreen_check` built at `2eda1777`. - The pinned SPIR-V tools from `tools/setup-spirv-tools.ps1`, and DXC 1.8.2502.11 from SDK 10.0.26100. ### Normal run ```powershell ctest --preset dev --no-tests=error -V -R '^(spirv_sampler_views|sampler_index_control)_(hardware|warp)$' ``` - **4/4 pass, with no skips.** - **On the AMD Radeon RX 9070 XT** (1002:7550, driver 32.0.32029.2010): - **Translated tables:** the plain and renamed tables match all 12 words in each of swaps 0–2: sample `0.25 0.75` / `0.75 0.25` / `0.25 0.75`, comparison `0 1` / `0 1` / `1 0`. That is the RTX 4060 and WARP row of the table, not the UHD 770 one. - **Direct HLSL controls:** both the dispatch-thread and group-index controls pass in every swap. - **Missing-store control:** detected on AMD and WARP, at exactly `sampler swap 1 word 2: expected=00000000 actual=c0400000` and `word 3: expected=3f800000 actual=c0800000`. ### Negative control on the renderer change I restored `tests/spirv_window/sampler_readback.cpp` to the merge base `7092683a`, which has no sentinel fill, kept the PR's `sampler.py`, and rebuilt `offscreen_check`: - **`spirv_sampler_views_hardware` fails:** `AssertionError: missing comparison stores: exit 0`. The old renderer accepts the shader that omits both comparison stores, which is the false pass the description reports. - **After restoring the PR's renderer and rebuilding,** all 4 tests pass again. Merge checks: the branch merges cleanly with current `main`. Required CI passed at this head. The `/O2` and coverage skips come from explicit workflow conditions. There are no review threads. AI-assisted; commands listed were executed locally.
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!2398
No description provided.