Repository navigation
fix(shader): translate two compute descriptor refusals (record count only, descriptor moved under a waterfall's EXEC) - #620
Merged
pragyaangaur merged 2 commits intoNov 28, 2026
Conversation
A buffer descriptor loaded only for its record count (dword 2), with its other dwords never read and the buffer never accessed, was refused as "a descriptor read only as data": the view addresses hold only a buffer's address. The record count now comes from the host view's dimensions, the kind from the used-resource entry of the table slot (structured: elements, raw: bytes), as for a buffer read with scalar loads (`lower/descriptor_records.rs`). A per-lane descriptor moved into VGPRs under an EXEC that a waterfall loop then starts with was refused as "a per-lane descriptor written where some lanes may keep the old one": the loop header's lane conditions forget the EXEC before it. The tracer now first checks, on SSA values, that the access's EXEC holds no lane the move's EXEC did not (phis of such, and lane-mask operations that keep or take out lanes), before asking the lane conditions. Tests: a waterfall over a descriptor moved after `v_cmpx` narrowed EXEC (tracing, and sampling on the host GPU), and a program storing a structured buffer's record count (on the host GPU). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both programs' descriptors are the same in every lane, so their single access is uniform: build_with takes the expected count of nonuniform accesses (0 here, 1 for the other waterfalls). The decoder prints a zero SMEM offset with a null soffset as "null". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two compute programs on main are refused by the resource tracker for reasons that turn out to be translatable exactly. This change is independent of the open PRs.
ceb5eb68cd99cb07: "a descriptor read only as data"The program loads a buffer descriptor only to read its record count (dword 2). It never reads the other dwords and never accesses the buffer. The view addresses hold only a buffer's address, so the read was refused.
The record count now comes from the host view:
getDimensionson the table slot's handle. The used-resource entry of that slot gives the kind, structured or raw, so the count is in elements or in bytes, as the console counts them. This is the same rule as for a buffer read with scalar loads. The code is in the newlower/descriptor_records.rs, which keepslower.rsunder the size cap. Any read of the address or format dwords is still refused.e4a9f58e3acfcf7b: "a per-lane descriptor written where some lanes may keep the old one"A descriptor is moved into VGPRs under an EXEC that a
v_cmpxhas narrowed, and a waterfall loop then starts with that same EXEC. The loop header's lane conditions forget the EXEC before the loop, so the check could not show that every lane the loop reads had the move. The solver's satisfiable condition was real, not the solver giving up.Before asking the lane conditions,
Tracer::runsnow checks this on SSA values: the access's EXEC holds no lane the move's EXEC did not hold. Values that pass are:v_cmpxwrites;s_and/s_andn2/s_mov/s_or/s_xorand thesaveexecforms, where they only keep or take out lanes.Anything else falls back to the lane conditions as before.
This shader still needs another change. It now stops later, at a first-lane read inside an outer loop that the per-lane halves cannot make by themselves. The whole-wave retry then refuses it as "a resource waterfall in literal wave64 halves". Getting it through needs a halves change that judges first-lane reads inside a loop one pass at a time. #589, #591, #605 and #606, alone or together, don't cover it. That area is hackgods', so it isn't folded in here.
Tests
All tests use synthetic programs:
v_cmpxnarrowed EXEC. Without the fix it gives exactly the refusal above.waterfall_tests.rs).build_within the GPU tests takes the expected number of nonuniform accesses. Both new programs use the same descriptor in every lane, so their single access is uniform.Checks
victory-shadersuite: 485 passed, 0 failed, 5 ignored. Both new GPU tests pass.victory-shadertests pass.cargo test -p xtaskandcargo xtask policypass.-D warningsis clean on the gnullvm target, for the whole workspace and all targets, with and without--all-features.In game
This is a silent scripted opening, run warm, compared with a warm run of main (d1609d9) on the same script:
ceb5eb68cd99cb07translates. Its host pipeline is built and first bound in the world at overall frame 1921.e4a9f58e3acfcf7bis now refused at the whole-wave retry with "a resource waterfall in literal wave64 halves" instead of the descriptor refusal.🤖 Generated with Claude Code