upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorKacper Serewis <kacper@serewis.nl>2026-11-22 20:55:15 +0100
committerKacper Serewis <kacper@serewis.nl>2026-11-22 20:55:15 +0100
commit7cfd20230afd829e719db1914aedffebfc422737 (patch)
tree6816f4bc08c4bf49d128966c7de589f94af9bc59 /docs
parent162821017ea3c286c8bec860f3ff94f037912061 (diff)
SHADER-605: reproduce signed-zero image stores with direct SPIR-V
Diffstat (limited to 'docs')
-rw-r--r--docs/testing.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/testing.md b/docs/testing.md
index 060da9905..2733b79bf 100644
--- a/docs/testing.md
+++ b/docs/testing.md
@@ -327,6 +327,29 @@ The GPU tools of `runtime/test/shaders` (`vk_compute_test`, `vk_harness`, ...) r
327| `vulkaninfo` lists `Microsoft Direct3D12 (<gpu>)` next to the real GPU and the tests run on it | The Windows "OpenCL™, OpenGL® and Vulkan® Compatibility Pack" installs Mesa's Dozen, a Vulkan-on-D3D12 layer that reports `DISCRETE_GPU` like the native card | Current `main` prefers a native ICD over Microsoft's vendor (`0x1414`) in the runtime and every harness; set `LEONIDA_VK_DEVICE=<part of the real GPU name>` to select explicitly. See #915. | 327| `vulkaninfo` lists `Microsoft Direct3D12 (<gpu>)` next to the real GPU and the tests run on it | The Windows "OpenCL™, OpenGL® and Vulkan® Compatibility Pack" installs Mesa's Dozen, a Vulkan-on-D3D12 layer that reports `DISCRETE_GPU` like the native card | Current `main` prefers a native ICD over Microsoft's vendor (`0x1414`) in the runtime and every harness; set `LEONIDA_VK_DEVICE=<part of the real GPU name>` to select explicitly. See #915. |
328| A GPU test that uses `image_load` (or lighting built from real shaders) reads zeros from its image; @Silliana saw every texel except pixel (0,0) come back zero in their own layer (#603, not reproduced here) | In this runtime the shader turns the T# words into an index through the descriptor hash table (`runtime/src/descriptor_table.h`: a miss gives index 0), and index 0 is a 1×1 image of zeros (`runtime/src/vulkan_bindless.h`), so a hand-built or zeroed T# that was never registered reads zeros even at (0,0). The translator does not compare coordinates with the T# size, and `cs_imgload.asm` only uses its T# words as a hash key | Register the descriptor through the runtime (for D3D12, create it with `CreateShaderResourceView`) so its T# hits the table, with the image's real width and height (stored as size − 1, see `runtime/src/gfx10_descriptors.h`) | 328| A GPU test that uses `image_load` (or lighting built from real shaders) reads zeros from its image; @Silliana saw every texel except pixel (0,0) come back zero in their own layer (#603, not reproduced here) | In this runtime the shader turns the T# words into an index through the descriptor hash table (`runtime/src/descriptor_table.h`: a miss gives index 0), and index 0 is a 1×1 image of zeros (`runtime/src/vulkan_bindless.h`), so a hand-built or zeroed T# that was never registered reads zeros even at (0,0). The translator does not compare coordinates with the T# size, and `cs_imgload.asm` only uses its T# words as a hash key | Register the descriptor through the runtime (for D3D12, create it with `CreateShaderResourceView`) so its T# hits the table, with the image's real width and height (stored as size − 1, see `runtime/src/gfx10_descriptors.h`) |
329 329
330### Signed zero in a float storage image (SHADER-605)
331
332Build `vk_store_test` as above and put `spirv-as` and `spirv-val` on PATH. Run this standalone
333probe from the repository root, passing the path to the executable you built:
334
335```powershell
336python -I runtime/test/shaders/probe_signed_zero.py runtime/build/vulkan/vk_store_test.exe
337```
338
339The probe assembles and validates two hand-written Vulkan 1.2 compute modules. Each requests
340`SignedZeroInfNanPreserve 32` and executes three constant `OpImageWrite` instructions into
341a `VK_FORMAT_R32G32B32A32_SFLOAT` image. Only the SPIR-V image format changes (`Unknown` or
342`Rgba32f`). The harness copies the images back, issues a transfer-write to host-read barrier,
343waits for completion, and compares all 768 words, including 756 prefilled guard words.
344A bit mismatch prints the word index and returns exit code 1. Both variants run even if the
345first comparison fails.
346
347On a GeForce RTX 5070 with Windows driver 616.56, both formats matched 765/768 words.
348In the first texel, `(-0, +0, +0, +0)`, word 0 read back as positive zero. The second texel,
349`(-0, 1, +0, +0)`, retained every bit. In the third, `(-0, -0, +0, +0)`, words 8 and 9 both
350read back as positive zero. All guards matched. This reproduces the discrepancy independently
351of RDNA translation. Other GPUs and drivers have yet to be tested with this probe.
352
330## Posting your result 353## Posting your result
331 354
332Use the template at the top of [#166](https://github.com/ItsNotRexed/Leonida/issues/166): GPU, driver, subgroup 355Use the template at the top of [#166](https://github.com/ItsNotRexed/Leonida/issues/166): GPU, driver, subgroup