Skip to content

Port upstream shader/GPU correctness wave 4 (17 PRs: descriptor uses, reachability, barriers, PSO/library fixes) - #4

Merged
devin-ai-integration[bot] merged 43 commits into
mainfrom
devin/shader-wave-4
Nov 24, 2026
Merged

devin-ai-integration[bot] merged 43 commits into
mainfrom
devin/shader-wave-4

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Wave 4 of upstream Marvisak/VIctory ports: 17 PRs of shader-lowering and GPU correctness fixes (+5168/−337, 24 files).

Shaders:

  • #1225 + #1231 (stacked): trace code-table addresses through v_readfirstlane of a uniform value; uniform phis (loop counters) resolve under those addresses
  • #1230: path-sensitive reachability for Missing values across phi joins (#736) — handle_deps tracks reads feeding a cached handle
  • #1229: redundant partial descriptor writes keep the prior per-lane word; lane-preserving VGPR moves (#750)
  • #1221: v_cndmask_b32 resolves Structured::other and constant masks
  • #1145: bitcode latch folding, unreachable phi edges, replace_const caching
  • #1130: a descriptor load read only as data takes its kind from another load of the same entry (same_entry_use)
  • #1056 + #1055: scalar s_load_dword*/s_buffer_load_dword* from a root view's address / a UAV read their memory (root_view_smem)
  • #1043: 16-bit compares ignore VOP3 op_sel
  • #1042: canonical system-value names in ISG1/OSG1 signature parts

GPU:

  • #1228: wait_for_shader_writes on sync and enhanced barrier groups (orders dependent compute dispatches, #732)
  • #1152: host_blend drops blending on integer render targets (#806)
  • #1135: detile only texture subresources affected by writes
  • #1126: FreshTable releases its dynamic descriptor slots on drop; a rejected bind gives back only the tables it reserved
  • #1040 + #1041: drop unsupported UAV/RT flags on typed host textures and omit the clear value when RT is dropped; zero PSO padding bytes and dedupe pipeline-library stores (stored set)

Merge notes: handle_deps keyed by HEAD's 6-tuple handle key (props included); descriptor_data keeps the raw-console-words fallback after same_entry_use fails; State::dynamic converted to Vec<FreshTable> with sentinel keys for root-SRV/address-map reservations.

Tests: clippy -D warnings and cargo fmt clean. One GPU-dependent test (host_texture_drops_unsupported_uav_flag_for_b5g5r5a1) depends on adapter feature reporting; SM 6.6 host tests still skip on GPU-less machines as before.

Link to Devin session: https://app.devin.ai/sessions/39a24dfe2c184165b42b2108a96286b6
Open in Devin Desktop: https://app.devin.ai/desktop/session/39a24dfe2c184165b42b2108a96286b6?variant=devin
Requested by: @Personed

gabrielcruzg3 and others added 30 commits November 24, 2026 03:26
RDNA2 reads only the low half in v_cmp_*/v_cmpx_* over f16, u16 and i16,
whatever op_sel says; VIctory honoured it and compared the wrong half. The
arithmetic paths still honour op_sel. Adds a test for the f16 and u16
compares with op_sel set and clear (#833).
A change to a title texture's memory detiled every mip and slice again,
and the watched path read the whole memory back first. A streamed
texture filling page by page paid for all of it at every submission
that sampled it.

Layout::extents gives the tiled byte ranges each subresource is detiled
from. Watched memory now reads again only the pages written since the
last detiling; memory that is hashed instead is hashed per 64 KiB page.
Either way only the subresources overlapping a changed page are
detiled. The first detiling, and memory whose read copy is gone, still
take the whole texture, and every subresource is still copied into the
host texture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add hex = "0.4" crate dependency to victory-loader
- Replace custom hexDecode() with hex::decode()
- Add parse_victory_patch() and apply_victory_patches() functions
- Support format: <module>:<rva hex>:<hex bytes>
- Log patch applications via tracing::info!
s_buffer_load_dword* through a table's UAV took the constant buffer
path: a CBV handle at the heap index of a UAV. Reading through it
removes the device (WARP: "The GPU device instance has been
suspended"). Such a load now reads the UAV raw, as a raw SRV is read
and as vector buffer accesses read a UAV.

The test writes a value to the VALU tests' raw UAV, reads it back with
a scalar buffer load and stores that; it removed the WARP device before
this change and passes on the hardware GPU and WARP after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An s_load_dword* whose address is a root descriptor's, and whose
result the program never uses as a descriptor, reads that buffer's
data. It stopped with "a descriptor read only as data". It is now read
as global loads from a root view already are: a root SRV raw, a root
CBV (or a root view the used-resource list does not name) as a
constant buffer. A root UAV still stops, with its own reason.

Test: dwords 2 and 3 of a root SRV and of a root CBV read with one
s_load_dwordx2 and stored, exact on the hardware GPU and WARP; main
refuses the program.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… use

The console compiler reads sizes from a descriptor's bits (a texture's
height and base level, say) in a loop of its own, apart from the loop
that samples through the same heap entry. That load's dwords were never
used as a resource, so its kind was unknown and the program was refused
("a descriptor read only as data"). Another load of the same entry (the
same parameter and offset, and the same computed term or the first lane
of the same VGPR in a waterfall pass) that is used as a resource now
gives the kind, and the fields are rebuilt from the host view as for any
descriptor read as data.

Translation census over the title's 26,503 containers, on #439's tree:
22,656 translated instead of 21,909 (747 more, none lost); the refusal
falls from 819 programs to 53, and 19 of the others reach a later one.
Of the shaders a run on an RTX 3060 refused, 172 more translate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SDn5GupcrERtCYPyoztdtG
The console ignores blending on integer render targets and the title
leaves it on (the world has a mesh pipeline blending into an R8_UINT
target). D3D12 does not allow it: vkd3d-proton refuses such a pipeline
with E_INVALIDARG and its draws are lost. The host pipeline now turns
blending off on integer targets; with one description for all targets,
each target gets its own copy so the others keep theirs.

(cherry picked from commit 169efcb84eb5d9d83c0af7fe525a54ada86f3a0d)
…form value

The console compiler builds the address of a table in the code in VGPRs
(s_getpc_b64 plus a uniform index through v_mov/v_lshlrev/v_add_co) and reads
it back with v_readfirstlane_b32 before the s_load. When every lane holds the
same value the first lane's read is that value, so the load is traced as if
it used the VGPR sum directly; a per-lane source is still refused, now by
name ("an address read from the first lane of a per-lane value").

Uniformity is decided from scalars, constants and first-lane reads through a
list of VALU operations (memoised per value).

Two tests: a uniform code-table address is traced (offset and computed index
checked); a per-lane one is refused by name. Measured on an integration tree:
ColorDownsampleCS and InitCS now translate and validate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwHrL6fhkpeG9ByE1rJxrt
Stacked on the first-lane code-table change.

A code-table lookup walked by a loop counter (s_getpc_b64 + 4*i, i a VGPR phi
whose exit is uniform) was refused as "an address read from the first lane of
a per-lane value". A phi is now uniform when its arguments are and no
lane-divergent branch (or loop it can leave lane by lane) can send lanes to it
along different edges (greatest fixed point; divergent branches taint the
joins and loops they reach). Uniform exits recognised: execz, scc of uniform
values, vcc from comparisons of uniform values. v_readlane_b32 is uniform too,
and a guarded VALU write needs its old value uniform.

Measured on an integration tree: PrefilterAndIntegrateIrradianceSH and
IrradianceCache_IntegrateIrradianceSH now translate and validate (dxil.dll);
compute programs emitted 2212 -> 2214 there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwHrL6fhkpeG9ByE1rJxrt
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Personed and others added 9 commits November 24, 2026 18:13
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Personed and others added 4 commits November 24, 2026 18:20
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Merge fixes:
- interp(): a missing v_interp_p1 lowers to Missing (which check_missing_reach
  refuses when live), not an unconditional zero write.
- descriptor_data(): read console descriptor words only when the descriptor-
  words handle is already bound for the program; unbound words stay Missing
  and a live read refuses, as upstream expects.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The test's GPU is not WARP: hardware that supports typed UAV on
B5G5R5A1_UNORM or render-target on B4G4R4A4_UNORM keeps the flag, which
the unconditional asserts rejected. Compare the kept flag with what
CheckFeatureSupport reports on the running adapter.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot merged commit 08df6fa into main Nov 24, 2026
4 checks passed
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.