[PR #2261] d3d12_texture_uav_test: fill the tagged descriptor table for its bare .spv (GPU-TEXTURE-UAV-1D-REGRESSION) #2264

Open
opened 2026-11-26 21:20:36 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2261
Author: @CodingRule
Created: 11/26/2026
Status: 🔄 Open

Base: main ← Head: texture-uav-test-tagged-table


📝 Commits (1)

  • 409da28 d3d12_texture_uav_test: fill the tagged descriptor table for its bare .spv (GPU-TEXTURE-UAV-1D-REGRESSION)

📊 Changes

1 file changed (+11 additions, -0 deletions)

View changed files

📝 runtime/test/d3d12_texture_uav_test.cpp (+11 -0)

📄 Description

Claimed in the coordination issue as: GPU-TEXTURE-UAV-1D-REGRESSION (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7190199537)

What and why

cs_texture_uav in scripts/run_gpu_tests.py (the D3D-78 fixture, run through d3d12_texture_uav_test <spv>) fails on main wherever the test program is built:

kind 0 mip 0 first 0 count 1 texel 0: got 0x11, expected 0x3f9
line 650: check_case(device.Get(), dispatch, one_d, texture(one_d, 1), source, copy, false, 0, 0, 1, true)

The first GPU case reads back its seed: the dispatch stored nothing.

Cause, found by bisecting the translator against one fixed set of test programs (ed94fbef good, a73a57e13 bad, first bad 9f98dcc61):

  • 9f98dcc61 made --descriptor-table tagged the translator's default. A tagged module reads the kind word next to each table index and takes the array's fallback (index 0, where stores are dropped) when the word does not mark its T# as bound in that array.
  • The device fills the kind word only when the loaded shader library's index says a module reads it (descriptor_table_census); with no library the layout is plain and the word stays 0 (d3d12_vulkan_device.cpp, "descriptor table: plain (all 0 modules)").
  • This test gives the device a bare .spv and no library. The sibling tests (d3d12_m4_compute, d3d12_buffer_uav, ...) load a folder with index.json, which is why they were not affected, and ctest runs this one with --descriptors-only, which is why CI did not see it.

It is the shader, not the program: yesterday's d3d12_texture_uav_test fails with today's module, today's passes with yesterday's module.

The fix is in the test: when it is given a shader and LEONIDA_DESCRIPTOR_TABLE is not set, it asks for the tagged table. The kind word is additive and a plain module never reads it, so that suits a module of either translation; the variable still decides when someone sets it.

One file, test only. I left the device's no-library default alone: whether a device with no index should fill the kind word is a runtime decision for whoever owns that contract, and this does not depend on it.

Tested

main a73a57e13, scripts\build_runtime.ps1 (MSVC 14.44.35207, RelWithDebInfo), llvm-mc 21.1.8, SPIRV-Tools v2026.4.

python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_texture_uav before after
native 0/1, 3 of 3 runs 1/1, 3 of 3 runs
LEONIDA_W64_EMULATE=1 0/1 1/1
LEONIDA_DESCRIPTOR_TABLE=plain (forced mismatch, to show the variable still decides) 0/1 0/1
the unpatched program with LEONIDA_DESCRIPTOR_TABLE=tagged 1/1

After: texture UAVs: 14 GPU cases (10 compared with WARP), format/range/refusal checks passed. ctest -R texture_uav (the --descriptors-only mode, which this does not touch) passes.

The records that list cs_texture_uav as failed so far (#2204) say the test program was not built there; this is the failure a machine that does build it gets.

GPUs tested: NVIDIA GeForce RTX 4090, driver 591.86, Vulkan 1.4.325, Windows 11 Pro build 26200

AI-assisted: yes (Claude Code found the failure, bisected it, wrote the change and ran the tests)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2261 **Author:** [@CodingRule](https://github.com/CodingRule) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `texture-uav-test-tagged-table` --- ### 📝 Commits (1) - [`409da28`](https://github.com/ubiquitarianism/leonida/commit/409da28db73dd249c24c4aba175a33369ebbcc7b) d3d12_texture_uav_test: fill the tagged descriptor table for its bare .spv (GPU-TEXTURE-UAV-1D-REGRESSION) ### 📊 Changes **1 file changed** (+11 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/d3d12_texture_uav_test.cpp` (+11 -0) </details> ### 📄 Description Claimed in the coordination issue as: GPU-TEXTURE-UAV-1D-REGRESSION (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7190199537) ### What and why `cs_texture_uav` in `scripts/run_gpu_tests.py` (the D3D-78 fixture, run through `d3d12_texture_uav_test <spv>`) fails on `main` wherever the test program is built: ``` kind 0 mip 0 first 0 count 1 texel 0: got 0x11, expected 0x3f9 line 650: check_case(device.Get(), dispatch, one_d, texture(one_d, 1), source, copy, false, 0, 0, 1, true) ``` The first GPU case reads back its seed: the dispatch stored nothing. Cause, found by bisecting the translator against one fixed set of test programs (`ed94fbef` good, `a73a57e13` bad, first bad `9f98dcc61`): - `9f98dcc61` made `--descriptor-table tagged` the translator's default. A tagged module reads the kind word next to each table index and takes the array's fallback (index 0, where stores are dropped) when the word does not mark its T# as bound in that array. - The device fills the kind word only when the loaded shader library's index says a module reads it (`descriptor_table_census`); with no library the layout is plain and the word stays 0 (`d3d12_vulkan_device.cpp`, "descriptor table: plain (all 0 modules)"). - This test gives the device a bare `.spv` and no library. The sibling tests (`d3d12_m4_compute`, `d3d12_buffer_uav`, ...) load a folder with `index.json`, which is why they were not affected, and ctest runs this one with `--descriptors-only`, which is why CI did not see it. It is the shader, not the program: yesterday's `d3d12_texture_uav_test` fails with today's module, today's passes with yesterday's module. The fix is in the test: when it is given a shader and `LEONIDA_DESCRIPTOR_TABLE` is not set, it asks for the tagged table. The kind word is additive and a plain module never reads it, so that suits a module of either translation; the variable still decides when someone sets it. One file, test only. I left the device's no-library default alone: whether a device with no index should fill the kind word is a runtime decision for whoever owns that contract, and this does not depend on it. ### Tested `main` `a73a57e13`, `scripts\build_runtime.ps1` (MSVC 14.44.35207, RelWithDebInfo), llvm-mc 21.1.8, SPIRV-Tools v2026.4. | `python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_texture_uav` | before | after | |---|---|---| | native | 0/1, 3 of 3 runs | 1/1, 3 of 3 runs | | `LEONIDA_W64_EMULATE=1` | 0/1 | 1/1 | | `LEONIDA_DESCRIPTOR_TABLE=plain` (forced mismatch, to show the variable still decides) | 0/1 | 0/1 | | the unpatched program with `LEONIDA_DESCRIPTOR_TABLE=tagged` | 1/1 | | After: `texture UAVs: 14 GPU cases (10 compared with WARP), format/range/refusal checks passed`. `ctest -R texture_uav` (the `--descriptors-only` mode, which this does not touch) passes. The records that list `cs_texture_uav` as failed so far (#2204) say the test program was not built there; this is the failure a machine that does build it gets. GPUs tested: NVIDIA GeForce RTX 4090, driver 591.86, Vulkan 1.4.325, Windows 11 Pro build 26200 AI-assisted: yes (Claude Code found the failure, bisected it, wrote the change and ran the tests) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#2264
No description provided.