Skip to content

[upstream #982] Tests: implicit-LOD sample offset test uses s_wqm and the host's LOD - #133

Closed
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/982
Closed

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/982

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 24, 2026

Copy link
Copy Markdown
Owner

gpu_ps_image_sample_offset_implicit_lod_between_mips fails on Apple's D3DMetal (macOS, CrossOver) for two reasons, neither in the code it tests. Part of #258.

  1. The program has no s_wqm, which a console shader runs before an implicit-LOD sample. On D3DMetal, quads along a diagonal of the test's triangle have helper lanes. Their u / v stay 0, so 30 pixels read mip 3 (300 where 30.25 is expected). A plain HLSL Sample with the same offset, texture and triangle has no such pixels.
  2. The expected values assume a host LOD of exactly 0.25. A plain HLSL CalculateLevelOfDetail on D3DMetal returns 0.2421875 for every pixel, so even correct sampling misses the 0.02 tolerance (25.22 where 26 is expected).

What is in it

  • crates/xcl/src/gpu/recomp/tests.rs: the program starts with S_WQM_B64 exec, exec, and the expected values blend the two mips by the host's own LOD, read by a plain HLSL draw of the same triangle, texture and sampler. The tolerance and the per-mip texel check are unchanged. The test also asserts that the host LOD lies between mips 0 and 1.

Tested

Regression run

Test-only change in tests.rs: no xcl-smoke blocks.

Not tested

  • Windows GPUs by me (see the independent runs above), and Intel GPUs by anyone.
  • The release build.

AI use

  • Claude Code with Claude Opus 5.5 found the two causes with probe shaders, wrote the change, ran the tests and mutations on the Mac, and wrote this description.

Mirror of xcl-dev#982 (auto-synced, do not edit).

gpu_ps_image_sample_offset_implicit_lod_between_mips failed on D3DMetal
(macOS, CrossOver) for two reasons outside the code it tests:

- Its program had no s_wqm, which a console shader runs before an
  implicit-LOD sample. On D3DMetal, quads along a diagonal of the test's
  triangle have helper lanes; their u / v stayed 0 and 30 pixels read
  mip 3. A plain HLSL Sample with the same offset has no such pixels.
- The expected values assumed a host LOD of exactly 0.25. D3DMetal's
  CalculateLevelOfDetail returns 0.2421875 for every pixel.

The program now starts with s_wqm, and the expected values blend the
two mips by the host's own LOD, read by a plain HLSL draw of the same
triangle, texture and sampler. The tolerance and the per-mip texel
check are unchanged: moving mip 1 by mip 0's offset still fails the
test, and so does leaving s_wqm out. (#258)

Assisted-by: Claude Code (Claude Opus 5.5)
@ufoptg

ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR xcl-dev#982 was closed or merged.

@ufoptg ufoptg closed this Nov 25, 2026
@ufoptg
ufoptg deleted the upstream-pr/982 branch November 25, 2026 00:09
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