Skip to content

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

Open
guialmm wants to merge 1 commit into
ThatRecompDev:mainfrom
guialmm:fix/compute-case-literal-sampler
Open

guialmm wants to merge 1 commit into
ThatRecompDev:mainfrom
guialmm:fix/compute-case-literal-sampler

Conversation

@guialmm

@guialmm guialmm commented Nov 26, 2026

Copy link
Copy Markdown

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
guialmm force-pushed the fix/compute-case-literal-sampler branch from 5559bd8 to 3574ec1 Compare November 26, 2026 17:44
…clamp on NVIDIA too

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 ThatRecompDev#9, diagnosed there by upipibi).
ComputeCase now takes Samplers like the pixel cases, and the gathers bind
their sampler with PixelMemoryCases.LiteralSampler.
@guialmm
guialmm force-pushed the fix/compute-case-literal-sampler branch from 3574ec1 to 2eab112 Compare November 26, 2026 18:06
@ThatRecompDev

Copy link
Copy Markdown
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants