feat(shader): decode more GCN instructions and take a GCN image's dimension from its T# #9889
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9889"
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 savvaniss on 2026-10-22T20:49:13Z.
What
The shader half of Get-fix/AnyPS5#1, moved upstream. #9430 has merged, so it goes straight on
main, as the maintainers asked on #6977. These are GCN decoder and translation gaps that the Hasbro Family Fun Pack (CUSA03312) hit on #6977's branch. Thes_setreg_imm32_b32fix from the same pull request is already in #9430. The AGC half is in its own pull request on #9431, #9891.GcnBufferFormats().V_RSQ_CLAMP_F32(VOP1 0x2c, VOP3 0x1ac) has no RDNA opcode. It decodes asV_RSQ_F32taggedVRsqClampF32, and an infinite result becomes the largest finite float of the same sign.s_cmpk_*,s_addk_i32) have the same opcodes on RDNA. They are now in the GCN table.s_buffer_load_dwordx4with a literal.image_get_resinforeports its depth as 6 times its slices.ImageResource::gatheredflag records the gather.Shader disk cache
FormatVersionis 51, the next number above main's 50. 48 and 49 were used onmainfor other layouts. It must stay unique: if another pull request that changes the schema lands first, this one takes the next free number again before it merges. MarcZX10's coordination note is https://github.com/boykopovar/AnyPS5/pull/9889#issuecomment-6357420480.ImageResourcekeeps bothgatheredand main'soptionalDescriptor, which gives 47 serialized fields.gatheredno longer fits in the padding beforebyElements, sosizeof(ImageResource)is 100, up from main's 96.Sources
I read each source below. "ISA" is AMD Sea Islands Series Instruction Set Architecture Reference Guide, revision 1.3, December 2013. LLVM links are at commit
48d0dc8f61. Nothing here was measured on GCN hardware, because none is available to me: the RX 9070 XT has no such opcodes. The same sources are indocs/dev/debt/shader.md.SQ_SRC_LITERAL). LLVM's CI encodinggetSMRDEncodedLiteralOffset32and its CI test, where index 256 encodes0x100V_RSQ_CLAMP_F32clamps ±inf to ±max floatV_RSQ_F32, because the ISA gives the same formula and names only infinities as clamped. LLVM'sfminnumexpansion would turn a NaN into the largest float. A measurement on GCN hardware would settle itimage_get_resinfoWhat the sources changed. Reading section 8.2.5 showed this pull request was wrong before: it read a stray VGPR as the slice for an array T# without DA, and it read a LOD from the index's slot for a non-indexed T# with DA. It also pinned the first of these in a test. Both now follow the ISA.
Reconciled with
mainMerged with
maindf58e736c8(merge commits; no rebase or force-push). Each rule the review named:787b6a6720, #11507). The rejection runs for GCN too, andGcnImageWordsputslast_arrayin the depth field it reads. A store through a short cube is refused and a sample through one selects its cube mode, both tested. The GCN branch had also dropped main's cube mode for stores, which table 8.8 lists; it is back.b9d00c5d80). The emitter's slice guard does not apply on GCN. The hardware measurement behind it is RDNA's, while on GCN section 8.2.5 says the index is ignored for a non-indexed T#, and a test pins that.e3f644040c). The conversion mode exists in the inferred dimension only. A store through a 2D T# of that format selects it, and a 3D one is refused, both tested.adjustedSample(f27177dd9b). It cannot arise on GCN, because the GCN opcode table has no_aopcodes (0xa0 and up).0a3ea213e1). It no longer applies on GCN: it was measured on RDNA, and table 8.9 has no 2D MSAA row.Tested
Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release, AMD Radeon RX 9070 XT (driver 32.0.31041.1004),
ANYPS5_GPU=AMD,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation.Head
25d1c6c20b(30 Oct, test-only, no merge): TechLevelZero's NVIDIA run, built with-DANYPS5_ENABLE_SPIRV_TOOLS=ON, showedagc_shader_memoryfailing onGCN store address: a 2D T# without DA. It reproduces on Windows with that option, also on this head merged withmain91db3f79f7, and passes without it: the optimizer folds the constant address into anOpConstantComposite, which the test's module walker did not read. The walker now reads it. Rerun at this head with the option on, RX 9070 XT, validation layer:agc_gcn_decode,agc_shader_memory,agc_shader_disk_cache,agc_driver_gcn_rsq_clampandagc_driver, 5 of 5, noVUID-line. NVIDIA and Linux were not rerun at this head; the merge withmainwas not pushed.Validation layer.
agc_gcn_decode,agc_shader_memory,agc_shader_disk_cacheandagc_driverran three times each onmainfd41cca5d9, and those four plus the newagc_driver_gcn_rsq_clampran three times each on this branch at27b568f3fb.VUID-line orwas not found but was requested by env var VK_INSTANCE_LAYERS.agc_driverandagc_driver_gcn_rsq_clampopen a Vulkan device, and everySelected GPUline names the RX 9070 XT. The other three are recompiler tests with no Vulkan instance, so the layer says nothing about them.b9f70328fdadds only ashader.mdcommit to27b568f3fb.mainhas since moved to5abba98955, with no change undercore/shaderandFormatVersionstill 50.New and changed tests.
agc_gcn_decodegains MTBUF (including the reserved bit),V_RSQ_CLAMP_F32, SOPK and SMRD literal cases.agc_shader_memorygains tables over 1D, 2D, 3D, cube, 1D-array and 2D-array T#s with and without DA, for the selected mode, forimage_sample_l(each coordinate and the LOD traced back to its VGPR) and forimage_store(each coordinate). It also covers cube and 2Dimage_get_resinfo, the refusals, short cubes, 11_11_10 stores and the tracker'sgathered.agc_driver_gcn_rsq_clampis a new execution test that runs on the GPU, in VOP1 and VOP3 form.rsq_clamp(+0)is0x7f7fffffandrsq_clamp(-0)is0xff7fffff. Denormals, ±inf, ±1, a quiet NaN and a signaling NaN matchv_rsq_f32, except that an infinite result clamps.Each part removed on its own at
a16b8cd7a6(only the test built and run, same environment). Every removal fails:agc_gcn_decodeagc_gcn_decodeVRsqClampF32tagagc_gcn_decodeagc_gcn_decodeagc_gcn_decodeagc_gcn_decodeagc_shader_memoryagc_shader_memoryagc_shader_memoryagc_shader_memoryagc_shader_memoryagc_shader_memoryagc_shader_memoryagc_shader_memorygatheredflagagc_shader_memoryimage_get_resinfoagc_shader_memorygatheredin the disk cache codecagc_shader_disk_cacheagc_driver_gcn_rsq_clampagc_driver_gcn_rsq_clampLinux. WSL Ubuntu, g++ 15.2.0, CMake 4.2.3, Unix Makefiles, Release, at
b9f70328fd.ANYPS5_REQUIRE_VULKAN=1andANYPS5_NO_SHADER_CACHE=1:agc_gcn_decode,agc_shader_memory,agc_shader_disk_cache,agc_driver_gcn_rsq_clampandagc_driver. All 5 pass. The validation layer was not on for this run.sizeof(ImageResource) == 96restored,ShaderDiskCache.cppfails withstatic assertion failed.PipelineJournal.cppis built as part oflibSceAgcDriver, and this pull request adds no field toStateorShaderStages.CUSA03312, not rerun on this head. Each fix removed a stop in Risk or Monopoly Plus on
ps4/limbo-gpuat93eeee0141(#6977's head then), with Get-fix/AnyPS5#2 and local stand-ins forsceGnmDrawInitDefaultHardwareState200andsceGnmUpdate*Shader(Get-fix/AnyPS5#1 has the details). The array-index and refusal changes above came after those runs, so a title that reaches a newly refused case now stops with that case's message. The titles also need #9431 and #9432.Tools.
tools/check_conventions.py --base origin/mainpasses with no findings.tools/pr_overlap.py --branch feat/gcn-cusa03312-instructionslists these as conflicting:RuntimeImageModes.v_cmpx, ntamas94) changes neighbouring lines ofGcnInstructionDecoder.cppandshader.md.ImageResourcesizeofand field-count lines inShaderDiskCache.cpp.ShaderMemory.cpptest.Many others could not be compared because they conflict with
main, among them several that changeFormatVersion. All of the listed ones compose. Whichever lands second resolves the conflict and takes the next freeFormatVersion.Test-only change, 1 Nov. Head
aadcd7d1a2, atoneandonlydean's request. It removes theexpectFailureassertions for a 3D T# with DA, a sample through a 2D MSAA T# and a depth comparison through a 1D or 1D-array T#, plusGcnType2DMsaa, which nothing else used. The production refusals and their debt entry are unchanged, and those three rows left the table above.agc_shader_memorypasses in a fresh Release build on Windows withANYPS5_GPU=AMD,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1and the validation layer, 1 of 1, noVUID-line. This test selects no Vulkan device, so it names no GPU. Not rerun at this head:agc_gcn_decode,agc_shader_disk_cache,agc_driver_gcn_rsq_clamp,agc_driver, NVIDIA, Linux, any title. No product code changed since25d1c6c20b.Merge of
maina4eca2a056, 2 Nov. Headdcd79190d6. Conflicts:ImageResource(this branch'sgatherednext to main'slayerRowsCompatible,layerRowsandmaxArrayLayers, all kept, in the struct, codec andagc_shader_disk_cachesample), theImageResourceguards (sizeof108, unchanged bygatheredbecause it fills padding, measured with a probe built by MinGW GCC 15.2; field count 50),FormatVersion52 (both sides had 51), andinspectImageDescriptor, which keeps main's layer-rows block and this branch's removal of the address-count throw. Run on the RX 9070 XT with the environment above:agc_gcn_decode,agc_shader_disk_cacheand its 4 option runs,agc_shader_memoryand 21 option runs ofagc_shader_memory_tests,agc_driver_gcn_rsq_clampand main'sagc_driver_image_array_rows_past_layer_limit: 29 passed, 1 skipped (agc_driver_image_array_rows_past_layer_limit: the device allows every array a T# can describe), noVUID-line, everySelected GPUline names the RX 9070 XT. Not rerun:agc_driver, Linux (thesizeofguard is Linux-only and was not compiled there), CUSA03312.check_conventions.pypasses.Merge of
maind1ae628bc2, 3 Nov. Head4d2e2907e4. Conflicts:GcnOpcodeTables.hppVop3size (this branch'sv_rsq_clamp_f32entry plus main's 36 new entries, 361; entries checked sorted with no duplicate key) andtests/GcnDecode.cpp(main'sVop3FormsOfMappedVop2AndVopcDecodekept next to this branch's four cases).FormatVersionstays 52 (main 51). No Linuxsizeofguard changed on either side. Windows, WinLibs GCC, Release, AMD RX 9070 XT, validation layer,ANYPS5_NO_SHADER_CACHE=1:agc_gcn_decode,agc_driver_gcn_rsq_clamp,agc_shader_disk_cache*(5) andagc_shader_memorywith the other builtagc_shader_*tests, 41/41 pass, noVUID-.check_conventions.pypassed. Not rerun: the other execution tests, Linux, CUSA03312.Merge of
main4f41f4c375, 3 Nov. Head6e939dea9b. Conflicts:DecodeGcnInstructionkeeps this branch'sv_rsq_clamp_f32override next to main'sv_cmpxsecond destination, anddocs/dev/debt/shader.mdkeeps main's newGCN v_cmpxentry under this branch's GCN entries. Main movedFormatVersionto 52, the value this branch used, so it is now 53. No Linuxsizeofor field-count guard changed on main. Windows, WinLibs GCC, Release, RX 9070 XT, validation layer,ANYPS5_NO_SHADER_CACHE=1:agc_driver_gcn_compare_exec_writes(main's, which runs the decoder path this merge touched),agc_driver_gcn_rsq_clamp,agc_gcn_decode,agc_shader_disk_cacheandagc_shader_memorypass, 3 of 3 runs, noVUID-line, no skip. Not rerun: the other focused tests, Linux, games.Merge of
main5b1d381d5a, 4 Nov. Head5d76f19c0f. Conflict:FormatVersion, which main moved to 56, so it is now 57. Main also addedImageResource::volumeGatherand set theImageResourcefield count to 50, the value this branch used forgathered, so git merged the count without a conflict and the Windows build stopped at that assert (51 fields). The count is now 51; both fields are in the info encoder and decoder. Linux:ShaderDiskCache.cppcompiles with-fsyntax-onlyon WSL Ubuntu g++ 15.2 (x86-64, libstdc++), so itssizeofguards hold; nothing was linked or run there. Windows, WinLibs GCC, Release, RX 9070 XT, validation layer,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1:agc_gcn_decode,agc_driver_gcn_rsq_clamp, the 5agc_shader_disk_cache*tests and the 36agc_shader_memory_teststests pass, 43 of 43, one run, noVUID-line;Selected GPUnames the RX 9070 XT. Not rerun:agc_driver,agc_driver_gcn_compare_exec_writes, the per-part removals, Linux tests, games.Merge of
main4180951e90, 5 Nov. Head409358e59b. A clean merge to rerun CI.relinker (macos-latest, clang++, x86_64)job on5d76f19c0ffailed only becauseguest_none_relocationshit its 20 s limit. This PR doesn't touchcore/relinker, andmainnow runs that test as two halves (#15526).FormatVersionstays 57 (mainis at 56).ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1:agc_gcn_decode,agc_driver_gcn_rsq_clamp, the 5agc_shader_disk_cache*tests andagc_shader_memorypass, 8 of 8, in one run. There is noVUID-line, and theSelected GPUline names the RX 9070 XT.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 XairRrR on 2026-10-29T03:56:44Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The head builds, its focused tests pass and fail correctly when the behaviour is reverted, but it no longer merges with
main(5 files, including the disk cache schema), and the PR does not name a source for the new instruction semantics.What I ran
68a68256b3e322dc1a15f017206e6dcebf497312main:b433c40f2f46aa2e59e19806010a839ac8572d6407da04f94713ed0f780c16e6cee2aa59d2221d75The merge with
mainconflicted, so I aborted it and built and tested the head on its own. Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Ninja, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree.Results
mainb433c40f2fgit diff --checktools/check_conventions.py --base origin/mainAll conventions checks passed.-Wstringop-overflowwarnings from GCC 16, in code this PR does not changeagc_gcn_decodeagc_shader_memoryagc_shader_disk_cacheVUID-lines /was not found but was requested by env var VK_INSTANCE_LAYERSConflicting files
mainside of each conflict:ImageResourcegainedsampledOnlyandoptionalDescriptor: the field count is 45 andFormatVersionis 49.ResourceMaterializer.cppgaineddescriptorIsShortCube(#11507) at the place where this PR addsgcnDescriptorDimension.ctest at the head
Negative control
The PR conflicts with
main, andmainhas 160 commits undercore/shadersince the merge base, so I reverted to the merge base07da04f947instead of tomain.ResourceMaterializer.cpp,ResourceTracker.cpp,GcnInstructionDecoder.cpp,GcnOpcodeTables.hpp,SpirvImageEmitter.cpp,TranslationContext.hpp,FloatInstructions.cpp,MemoryResourceHelpers.cppandVectorInstructions.cpp. I kept the newgatheredfield, theVRsqClampF32enum and its decoder lists, and the disk cache changes, so the tests still compile. Results:agc_gcn_decodefailed:GCN MTBUF opcode 7 at program counter 0 is not implemented.agc_shader_memoryfailed:GCN dimensions: a 2D-inferred image does not offer every T# dimension at run time.agc_shader_disk_cachepassed, as expected, because its encoder was kept.SpirvImageEmitter.cpp.agc_shader_memoryfailed:GCN volume sample: a sample through a 3D T# does not take its z from the third address VGPR.After I restored the head files, both tests passed again. I did not repeat the other single-part removals in the description's table.
Findings
Blocking
The PR conflicts with
main, andFormatVersion48 is already taken.ShaderDiskCache.hpp:16sets 48.mainis now at 49.mainalready used 48 for otherImageResourcelayouts: #8077 addedoptionalDescriptorand #11507 addedsampledOnly, each under 48, andb9f4f65904then moved both to 49. A cache entry written as 48 by one layout would be decoded with another layout's field order. This is the case MarcZX10 warned about.mainagain.Resources.hpp, keep bothoptionalDescriptorandgathered.fieldCount<ImageResource>()assertion to 46.sampleVariant()in the disk cache test for both.FormatVersionabove 49.sizeof(ImageResource)is still what the description says.No source is given for the new instruction semantics. CONTRIBUTING.md:8 asks a PR that adds or changes shader instruction semantics to name an exact source (ISA section, LLVM, ACO or Mesa file) or a hardware measurement. The description and the debt entries give none for these:
GcnInstructionDecoder.cpp:292-308);GcnInstructionDecoder.cpp:113-124);V_RSQ_CLAMP_F32turning ±inf into ±max float, with NaN and negative inputs handled likeV_RSQ_F32(FloatInstructions.cpp:614-625);The existing debt entry cites shadPS4's
opcodes.honly for opcode numbers. Please cite the Sea Islands ISA sections (SMRD, MTBUF, VOP1 opcode list, MIMG address) or an LLVM/Mesa file for each item, in the description and in theshader.mdentry.Non-blocking
Re-check the GCN paths against the materializer changes on
mainwhen you resolve the conflict. Since the merge base,mainhas added rules that this PR's GCN branches either skip or rewrite:787b6a6720, #11507), applied whendecoded.cube && (storage || !base.sampledOnly);b9d00c5d80);e3f644040c).Two places need checking:
RuntimeImageModes(ResourceMaterializer.cpp:1909-1927) returns before every rule after it.mem.imageDimension != image.dimension(SpirvImageEmitter.cpp:1941-1952). That is also true formain's intended remaps, such as a 1D mode under a 2D or 2D-array store.A GCN case for a cube T# under a 2D-inferred sample, and one for a store, would show whether the merged rules compose.
One known-wrong case runs without an error. The new debt line says that a 1D depth-comparison T# reads the VGPR after x as y, where the hardware would use the centre of row 0. The behaviour is known, so the GCN path could throw for
remappedDepth1Duntil the address is rebuilt, rather than sample at an arbitrary y. The same gap exists on the merge base. It is recorded in debt, which is why this is not blocking.The
V_RSQ_CLAMP_F32translation is untested. The description says so. Aagc_gcn_decode-style or execution case forrsq_clamp(+0) == 0x7f7fffffandrsq_clamp(-0) == 0xff7fffffwould pin the clamp.floatUnaryClampInfinityalso repeatsfloatUnaryline for line before the clamp; a shared helper would keep their NaN handling the same.Not verified
maineither: with the merge failing there was no merged result to compare against, and these three tests open no Vulkan device.agc_driver, or any test that creates a Vulkan device. The validation-layer comparison asked for AGC and shader recompiler changes therefore has no data from this machine.VRsqClampF32tag and the tracker'sgathered. Revert 1 covered them together. I also did not repeat the disk cache encoder removal.To get this to a good state
main.ImageResourcefields, set the field count to 46, and take aFormatVersionabove 49.RuntimeImageModesand the emitter againstmain's short-cube and 1D-store rules.V_RSQ_CLAMP_F32and MIMG address semantics.agc_gcn_decode,agc_shader_memoryandagc_shader_disk_cacheon the merged tree.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T20:04:07Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
This pull request does not merge cleanly into
main(096c45570f): headdcd79190d6conflicts incore/libs/prx/libSceAgcDriver/tests/GcnDecode.cppcore/shader/recompiler/RdnaDecoder/src/GcnOpcodeTables.hppPlease rebase it onto current
main. I will review the change once it merges cleanly.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T07:34:17Z.
Review: APPROVED
Re-checked — approved
Since my last review the author merged
mainseveral times, made DA decide the array index, added ISA and LLVM sources to the description and todocs/dev/debt/shader.md, made a 1D depth comparison throw and added theagc_driver_gcn_rsq_clampexecution test. All four previous findings are resolved, and the merged tree builds and passes the focused tests. The negative controls fail as they should.What changed since my last review
68a68256b3:de3f97fa8b: array-ness now comes from DA (Sea Islands ISA §8.2.5). Two new refusals: a 3D T# with DA, and a depth comparison through a 1D or 1D-array T#. Cube mode for stores is back, andimage_get_resinforeports a cube's depth as 6 × slices.a16b8cd7a6: a test for the reserved MTBUF word 1 bit.b9f70328fd: the GCN debt entries are split, each stating its gap first and citing its sources.25d1c6c20b: the test's module walker now followsOpConstantComposite. This fixes the-DANYPS5_ENABLE_SPIRV_TOOLS=ONfailure TechLevelZero reported.aadcd7d1a2: removes theexpectFailureassertions that pinned unimplemented forms, as oneandonlydean asked.main. The last one wasd1ae628bc2.floatUnaryandfloatUnaryClampInfinitynow sharefloatUnaryValue.FormatVersionis 52, andmainhas 51.ImageResourcehas 50 fields, andsizeofis still 108.main" section and a per-part removal table.What I ran
4d2e2907e4101d50543455eb2fe99246b81bb526,maind1ae628bc2f62459cce1e9872ba5632c938c71f2, merged with--no-ffinto tree0fe3d2b272620320358ed4e40f2380936faf5dac.The script's selected run on the merged tree (build.json) ran 2141 tests:
git diff --checkcheck_conventions.pyAll conventions checks passed.libsagc_driver_division, the denormal-mode tests,vector_constant_factor_tininess, oneunwrap_selfcase) also fail onmain. 113 skips, all expected.mainlayer_missing_inempty, 0 tests with a newVUID-agc_gcn_decode,agc_driver_gcn_rsq_clamp,agc_shader_disk_cache,agc_shader_memoryNegative control
GcnInstructionDecoder.cpp,GcnOpcodeTables.hpp,ResourceMaterializer.cpp,ResourceTracker.cpp,SpirvImageEmitter.cpp,TranslationContext.hpp,FloatInstructions.cpp,MemoryResourceHelpers.cppandVectorInstructions.cppfrommain. I kept thegatheredfield, theVRsqClampF32enum and its decoder lists so the tests still compile. All three tests failed:agc_driver_gcn_rsq_clamp:GCN VOP3-promoted opcode 428 at program counter 8 is not implementedagc_gcn_decode: failedagc_shader_memory:GCN dimensions: an image with DA does not offer every T# dimension at run timegatheredencode and decode lines from the mergedShaderDiskCache.cpp.agc_shader_disk_cachefailed withentry round trip: shader info differs.After that I restored the merged files and rebuilt. All four tests passed again, and
git status --porcelainwas empty.Previous findings
main,FormatVersion48 already taken. Resolved.d1ae628bc2.ShaderDiskCache.hpp:16sets 52, abovemain's 51.gatheredis encoded and decoded next tomain's fields, and the field-count assertion is 50.shader.mdcite Sea Islands ISA 1.3 sections and LLVM at a fixed commit for each item: MTBUF §13.6, SMRD table 7.1 plus LLVM for the dword unit,V_RSQ_CLAMP_F32§12.8, MIMG §13.7, §8.2.4/8.2.5 and tables 8.7–8.11, resinfo §12.16.rsq_clampinputs, a cube without DA, and the LOD slot after a non-indexed T# with DA.main's materializer rules. Resolved.ResourceMaterializer.cpp:2089-2107returns before offering other dimensions.agc_shader_memorynow has cube, store, short-cube and 11_11_10 cases, and negative control 1 makes it fail.ResourceMaterializer.cpp:243-245.V_RSQ_CLAMP_F32translation was untested and duplicatedfloatUnary. Resolved.floatUnaryValue.agc_driver_gcn_rsq_clampruns VOP1 and VOP3 forms on the device. It passes on lavapipe here and fails when the translation is reverted.New findings
Blocking
None.
Non-blocking
None. I also checked these parts of the new code and found nothing to report:
VRsqClampF32tag: VOP1 bits [31:25] = 0x3f with opcode [16:9] = 0x2c, and VOP3 bits [31:26] = 0x34 with opcode [25:17] = 0x1ac. Every switch onVRsqF32also listsVRsqClampF32.Not verified
v_rsq_clamp_f32is recorded as unmeasured in debt.-DANYPS5_ENABLE_SPIRV_TOOLS=ON. TechLevelZero's NVIDIA and AMD runs at earlier heads used it and passed after25d1c6c20b.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T15:56:30Z.
Review: APPROVED
Re-checked — approved
The only new commit is
6e939dea9b, a merge ofmain4f41f4c375. It resolves the conflicts inDecodeGcnInstructionanddocs/dev/debt/shader.mdcorrectly and movesFormatVersionto 53, one abovemain's 52. The merged tree builds and passes the focused tests.What changed since my last review
No PR commit was rewritten. delta.patch shows commits 1–14 unchanged, and the only new commit is the merge
6e939dea9b.DecodeGcnInstruction:GcnInstructionDecoder.cpp:374-378now has both pieces:v_rsq_clamp_f32opcode override;main'sv_cmpxdestination2.They are independent. The override only changes
opfor VOP1 0x2c and VOP3 0x1ac, which are not VOPC compares. ThecompareDestinationline still runs after it.docs/dev/debt/shader.md:main's newGCN v_cmpxentry sits next to this branch's split GCN entries. Nothing from either side was lost.FormatVersion:ShaderDiskCache.hpp:16is 53.main4f41f4c375is at 52, so the bump is still unique.Description: it gained a "Merge of
main4f41f4c375" paragraph that matches what I see in the merge.What I ran
Head
6e939dea9bb49ed64e8778ee4b17be71bc466f81,main4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree2182aab91a4150b58d6236980a23d3d109da8e36. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19).git diff --checkcheck_conventions.pyAll conventions checks passed.libs(script)main. 114 skips, all expected.main)layer_missing_inis empty. 0 tests have a newVUID-line.agc_gcn_decode,agc_driver_gcn_rsq_clamp,agc_shader_disk_cache,agc_shader_memoryagc_driver_gcn_compare_exec_writes(main's test, runs the merged decoder path)Negative control. I removed only the
VRsqClampF32override line, which is the line the merge conflict touched, and rebuilt. Both tests failed:agc_gcn_decodefailed withVOP1 v_rsq_clamp_f32 did not decode as VRsqClampF32and the same message for VOP3.agc_driver_gcn_rsq_clampfailed withVOP1 of 0x00000000: 0x7f800000 ... expected the largest positive float.After restoring the merged file and rebuilding, both pass and
git status --porcelainis empty.Previous findings
My previous review (at
4d2e2907e4) had no open findings. Its four earlier findings were already resolved, and this merge leaves them resolved:main/FormatVersionalready taken: Resolved. The PR merges cleanly, and 53 is abovemain's 52.shader.mdafter the merge.main's materializer rules: Resolved. The merge does not touchResourceMaterializer.cpp, andagc_shader_memorypasses.V_RSQ_CLAMP_F32untested and duplicated: Resolved. The negative control above shows the tests still cover it after the merge.New findings
Blocking
None.
Non-blocking
None.
Not verified
main'sagc_driver_gcn_compare_exec_writes: it skips here (lavapipe has 8-lane subgroups), so this machine does not run thev_cmpxpath next to the new override. The author reports it passing on an RX 9070 XT.-DANYPS5_ENABLE_SPIRV_TOOLS=ON: I did not build with this option at this head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T09:56:02Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected decoder, image materialization, SPIR-V emission, and cache changes show no verified blocking defect; I could not run checks at this head, so a formal approval is not justified.
What I ran
Reviewed head
5e18a55f603540af2f6aa329369cf2ab1e697286. I read the prepared description, commit list, manifest and diff, plus targeted repository code throughrepo_read.py. No commands or tests were run. The author reports earlier test runs, but those reports do not establish results for this exact head.Results
Findings
Blocking
None verified in the code inspected.
Non-blocking
None.
Sources
Reviewed the prepared diff and targeted head code for GCN instruction decoding, image dimension selection and coordinate emission, reciprocal square root translation, resource tracking, and shader disk cache serialization.
Not verified
ShaderMemory.cppis listed as excluded because it is too large for the review folder; I inspected its added diff but not the full file. I did not read the full text of every changed file or run builds and tests at this head. The prepared description's validation reports are author-supplied and refer to earlier heads. No other exclusions were listed in the file listing.To get this to a good state
Nothing is required. Optional: report focused build and test results for this exact head.