fix(shader): split descriptor webs whose paths fold or hold invalid arms #8077
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8077"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by 0xcrstn on 2026-10-19T20:10:37Z.
What
A T# chosen at run time among SRT descriptors through a descriptor web (a jump table, loop-carried T# registers) failed to plan when one path's dwords depended on the program counter, EXEC or a lane mask, and failed at capture when an arm the run never takes held no valid T#. PPSA23566 compute shader 0x1163c84000 stops on main with
GetImageResource dword 0 is not a valid runtime value, then withruntime image descriptor is invalid.InvalidDescriptorBDA fault (new IRDescriptorFault, gated by the image instruction's EXEC).APS5_STRICT_DESCRIPTOR_WEBSrestores the refusal.gfx10-rsrc.json) is bound as a null image, and a lane that selects it records the same fault. Splits along incoming edges keep requiring a valid T#, as on main.validImageDescriptortreats a FORMAT outside the GFX10 table as invalid.Both assumptions are recorded in
docs/dev/debt/shader.md.Related gaps not changed here (pre-existing on main):
ShaderAddressResources.cpp: a shader with an image table reads its fault buffer back only when a table record is poisoned, so a descriptor fault in such a shader is not reported.WebSelectorpicks LaneSelector's first select in tuple order, not from the latest block.Tested
Windows 11 Pro, NVIDIA RTX 5090 (driver 32.0.16.1742).
b6583dd86+ this PR reaches the tutorial fight; shader 0x1163c84000 is prepared and dispatched with noInvalidDescriptorfault in the session.agc_driver_descriptor_web_faults(GPU: per-arm reads, faults at the read for a folded path and for a selected undefined arm, none with EXEC empty), plusagc_shader_memoryandagc_shader_disk_cacheadditions.b6583dd86+ this PR (excludingwindows_icon,optional_plt,empty_tls,windows_address_space,dynamic_segment): all pass exceptagc_driver_pass_input_hazardandagc_driver_pixel_lds, which fail identically on main.252cbc29b:agc_shader_memory,agc_shader_disk_cache,agc_shader_disk_cache_large_fileandagc_driver_descriptor_web_faultspass;tools/check_conventions.pypasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by 0xcrstn on 2026-10-19T20:27:03Z.
The overlaps with #6612, #6679, #6959, #7623, #7694 and #7803 are adjacent insertions (debt entries appended at the end of the same list, neighbouring test functions in ShaderMemory.cpp, a helper next to
descriptorDimension), not the same functionality. No dependency in either direction; whichever merges first, I'll rebase this one.Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-20T01:56:34Z.
Windows runs on an NVIDIA card and an AMD iGPU (the PR lists only an RTX 5090), plus a check of the format table.
Setup: Windows 11 26300, MinGW GCC 15.2 Release,
maineb7500680+ this PR (7517b4484, merges cleanly). GPUs: RTX 5070 Ti (NVIDIA 617.42) and Ryzen 5 9600X Radeon iGPU (ANYPS5_GPU=AMD, 32.0.21042.62), both withANYPS5_REQUIRE_VULKAN=1.agc_driver_descriptor_web_faults,agc_shader_memoryandagc_shader_disk_cachepassed 3 of 3 on each GPU.agc_driver_descriptor_web_faults_tests. It fails on both GPUs withGetImageResource dword 0 is not a valid runtime value; chain: Phi(ReadConst(GetSrtResource, Immediate), Phi(...)).ShaderMemory.cppdoesn't compile against main's headers (optionalDescriptor,IsDefinedImageFormat), so that test has no separate negative control.APS5_STRICT_DESCRIPTOR_WEBS=1: the new test fails as the switch intends, and the error now names the reason:...; descriptor web: a descriptor dword depends on the program counter, EXEC or a lane mask. No test covers this switch. Note that the code treatsAPS5_STRICT_DESCRIPTOR_WEBS=0as off, whileENVIRONMENT.mdlists the variable aspresence.DefinedImageFormats({1-77, 128-154, 156-182, 265-292}) matches theGFX10_FORMATenum in Mesa's currentsrc/amd/registers/gfx10-rsrc.jsonexactly: 160 values from 0 to 292, in the ranges 0-77, 128-154, 156-182 and 265-292, with 0 beingINVALID. The IR check (UndefinedImageWords) and the CPU check (undefinedImageWords) agree on what counts as null: base address dword 0 and the low 8 bits of dword 1 are zero, as innullImageDescriptor.ctest -R "agc|shader|spirv|recomp"(824 tests): on NVIDIA 3 failed (msaa_dcc_clear_4,pass_input_hazard,sgpr_pattern_fill_keys); on AMD 4 failed (msaa_dcc_clear_4,layered_volume_vertex_no_gpl,draw_cache_reuse_off,stencil_replay_no_gpl). All of these also fail on main on this machine. No new failures.check_conventions.py --base origin/mainpasses.AI-assisted: yes (Claude Code); results above were run on this machine.
Imported from boykopovar/AnyPS5. Originally posted by Longziip on 2026-10-20T17:32:02Z.
Tested on EA SPORTS UFC 6 (PPSA23566, 01.004.000), the title this unblocks (#5996).
Setup: Windows 11 Pro 26300, AMD Ryzen 7 5700X, NVIDIA GeForce RTX 4060 8 GB (driver 616.64), 32 GB RAM, WinLibs GCC 15.2.0 Release.
main77e31219c+ this PR (7e2eb2c0d; the only conflict wasdocs/dev/debt/shader.md, both entries kept) + #8126. Relinked with--windows --registry --module-dir ., run withAPS5_LAZY_SHADER_PREPARE=1.mainstops after the title on shader0x1163c84000withGetImageResource dword 0 is not a valid runtime value; chain: Phi(Phi(...ReadConst(GetSrtResource, Immediate)...)).