Tests: compute cases bind their literal sampler; the integer gathers clamp on NVIDIA too #62

Manually merged
github merged 1 commit from github-bot/gh-62 into main 2026-11-27 08:00:57 +00:00 AGit
Owner

@⁠guialmm on GitHub · 2026-11-26 17:42 UTC · original
guialmm:fix/compute-case-literal-sampler → main · +10 −4 · 4 files · 1 commits · merged 2026-11-27 08:00 UTC

On a real GPU, TypedImageViewWarpTests fails for cs_typed_uint_gather and cs_typed_sint_gather (both direct values): the edge lanes read one texel off, e.g. 0xa0000004 for 0xa0000007. This is the "integer gather off by a texel" item from #9.

Why. As @⁠upipibi worked out in #9: the gather samples its literal S#, which reads the desktop sampler at its StaticSampler slot, but ComputeCase binds no samplers, so that slot is empty. WARP treats the empty slot as clamp and NVIDIA as wrap, so every lane whose x+1 or y+1 is past the edge reads texel 0.

Change. Tests only:

  • ComputeCase takes Samplers, like the pixel cases, and ComputeCaseRunner passes them in its three bindings.
  • The gathers bind their sampler with PixelMemoryCases.LiteralSampler (now internal), for the S# they set (0x92, 0xc00000, 0x4000000, 0).

Checked on an RTX 3060 (12 GB, driver 32.0.16.1714), Windows 11, on main b1b6655:

  • dotnet build FiveStar.slnx: no warnings.
  • FIVESTAR_TEST_ADAPTER=hardware, TypedImageViewWarpTests: 4 failed before, 28 of 28 pass after.
  • WARP: TypedImageViewWarpTests 28 of 28; whole shader project 550 passed, 14 skipped, 0 failed; FiveStar.Architecture.Tests 31 of 31.

AI-assisted (Claude Code, Claude Opus 5.5): wrote the change from the diagnosis in #9 and ran the tests above on my machine.

**@⁠guialmm** on GitHub · 2026-11-26 17:42 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/62) `guialmm:fix/compute-case-literal-sampler` → `main` · +10 −4 · 4 files · 1 commits · merged 2026-11-27 08:00 UTC On a real GPU, `TypedImageViewWarpTests` fails for `cs_typed_uint_gather` and `cs_typed_sint_gather` (both `direct` values): the edge lanes read one texel off, e.g. `0xa0000004` for `0xa0000007`. This is the "integer gather off by a texel" item from #9. **Why.** As @⁠upipibi worked out in #9: the gather samples its literal S#, which reads the desktop sampler at its `StaticSampler` slot, but `ComputeCase` binds no samplers, so that slot is empty. WARP treats the empty slot as clamp and NVIDIA as wrap, so every lane whose x+1 or y+1 is past the edge reads texel 0. **Change.** Tests only: - `ComputeCase` takes `Samplers`, like the pixel cases, and `ComputeCaseRunner` passes them in its three bindings. - The gathers bind their sampler with `PixelMemoryCases.LiteralSampler` (now `internal`), for the S# they set (`0x92, 0xc00000, 0x4000000, 0`). Checked on an RTX 3060 (12 GB, driver 32.0.16.1714), Windows 11, on `main` `b1b6655`: - `dotnet build FiveStar.slnx`: no warnings. - `FIVESTAR_TEST_ADAPTER=hardware`, `TypedImageViewWarpTests`: 4 failed before, 28 of 28 pass after. - WARP: `TypedImageViewWarpTests` 28 of 28; whole shader project 550 passed, 14 skipped, 0 failed; `FiveStar.Architecture.Tests` 31 of 31. AI-assisted (Claude Code, Claude Opus 5.5): wrote the change from the diagnosis in #9 and ran the tests above on my machine.
cs_typed_uint_gather and cs_typed_sint_gather sample a literal S#, which
reads the desktop sampler at its StaticSampler slot. ComputeCase bound no
samplers, so that slot was empty: WARP clamped the edge lanes and NVIDIA
wrapped them, one texel off (from #9, diagnosed there by upipibi).
ComputeCase now takes Samplers like the pixel cases, and the gathers bind
their sampler with PixelMemoryCases.LiteralSampler.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:16:22 +00:00
Author
Owner

@⁠ThatRecompDev on GitHub · 2026-11-26 21:32 UTC · original

this is exactly the fix upipibi described in #9, small and tests only. ran the shader suite here with it, all green on WARP. it'll go in with the translator batch since we tested them together, thanks for picking it up

**@⁠ThatRecompDev** on GitHub · 2026-11-26 21:32 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/62#issuecomment-7203820427) this is exactly the fix upipibi described in #9, small and tests only. ran the shader suite here with it, all green on WARP. it'll go in with the translator batch since we tested them together, thanks for picking it up
github manually merged commit 0e1350bd40 into main 2026-11-27 08:00:57 +00:00
Author
Owner

@⁠ThatRecompDev on GitHub · 2026-11-27 08:01 UTC · original

merged with the translator batch (976cc3e3), thanks! shader suite on the merged tree: 581 passed, 0 failed.

**@⁠ThatRecompDev** on GitHub · 2026-11-27 08:01 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/62#issuecomment-7213055551) merged with the translator batch (976cc3e3), thanks! shader suite on the merged tree: 581 passed, 0 failed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.