feat(agc): run registered merged hull programs (binary type 3) #6679
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6679"
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 SleglJan on 2026-10-16T04:12:35Z.
What
PPSA11386 (007 First Light) registers its tessellation hull programs as type 3: one binary with the local and the hull part, addressed through
SPI_SHADER_PGM_LO_LS(SH 0x148), with noSPI_SHADER_PGM_LO_HS. The local part runs on the lanes belows3[7:0]and writes LDS, ans_barrierfollows, and the hull part runs on the lanes belows3[15:8]and may store the registers the local part filled.mainskips type 3 at registration (#1893) and its draw decode asks 0x148 for a type-5 local half, so the title stops in its level load:registered program refers to an incompatible shader binary type#3444 handles a header fused at runtime that selects a registered back half; a registered type-3 binary has no back half to select.
Changes:
mergedHull. The hull user-data address (SH 0x102/0x103) is optional for it:s[0:1]take it, without the range check, when the draw sets it and are zero otherwise (the separate hull half keeps requiring and checking it). Type 3 is prepared with its stage group like type 5 and takes its float mode fromRSRC1_HS.gl_VertexIndexandgl_InstanceIndexin a 16-byte record per input control point.v2andv5come from the record of control pointmin(gl_InvocationID, inputs - 1),v3is the relative vertex id, and the LDS becomes a per-control-point output array (ControlShared): a control point writes its own record and reads any record of its patch after the barrier, with the stride taken from the code as for the local stride. Registers live across the barrier stay in the invocation.HostSubgroupSize1, as vertex programs do without vertex subgroups). Its lanes aregl_InvocationID, not host subgroup invocations, andmain's hull lowering already turns every lane-dependent value into a per-invocation one (lane id, own-lane bits) and refuses other lane masks. In the test's merged program thes_cbranch_execzaround the local part is the only wave-level operation left: with the device's subgroup it took a subgroup ballot (GroupNonUniform,GroupNonUniformBallot), which lavapipe rejects in the tessellation control stage (subgroup capability 61 is unsupported for shader stage 2). With one lane per invocation the branch tests the invocation's own lane and the module declares no subgroup capability, on lavapipe and on hardware alike.s_barrierthat some invocations do not reach or that sits in a loop; reads or writes of another lane's register (v_readlane_b32,v_writelane_b32, DPP,ds_swizzle_b32,ds_permute_b32,ds_bpermute_b32,v_permlane16_b32), which one lane per invocation does not hold; outputs beyond the device's tessellation control limits; fetch subroutines.AppendProgramMemory, used by the draw and byPrepareGraphicsStages); a request's memory regions must not overlap (RequestMemoryView memory regions overlapotherwise).UserDataWords). The local and hull stages both hold SH 0x10c onwards;mainwrote only the first, the local stage, which of a merged program only writes the vertex record. Separate hull halves now get the words in both halves too, as both read the same registers.mergedHullis part of the recompile cache key of the local and hull stages, the draw decode comparison and key, and the request serialization: version 39, a byte at the end of the tessellation configuration.gl_InvocationIDwhen it writes a per-control-point output (ControlOutput,ControlShared), not only when it reads its lane id: those writes are indexed by it.PrepareGraphicsStagestakes its memory fromAppendProgramMemorytoo, so it now leaves out empty regions, as the draw already did.The
Merged hull programsentry indocs/dev/debt/shader.mdrecords where this differs from the console: the same control point of the same patch per hull lane, the register layout taken from the separate halves (not measured on hardware), the one-lane wave-mask branch (an invocation whose own lane fails skips the scalar instructions the console runs for the wave) andv_readfirstlane_b32(the invocation's own value), runtime buffer loads for the vertex fetches, and the optional user-data address.Overlap (trial merges with
git merge-treeof the 98 open PRs that touch the same files, against this branch and againstmain3aa4448ed3; 82 give the same result with both, 40 of them merging cleanly):mainwrites version 38. #4650 took 35 (target.depthRangeRemapand, with a vertex context,depthRemapMode), #6503 took 36 (target.float32FlushToZero), #6762 took 37 (the pixel stage'sstencilOperationValueExport) and #6941 took 38 (the mesh barycentric layout, a flag after the draw fields); #6470 took 34 before that. So this change takes 39 and readsmergedHullonly from 39 on; version 38 and older requests read as not merged.PreparedControlFlow::MatchesinRecompiler.cpp, on the line after the one where this change addsmergedHull, and #7691 and #6188 an include line inDrawCache.hppwhere this change adds one; they conflict textually.TessellationLowering.cpponly on theLoweringmembers (itsDependenceenum and map besidelocalStrideandsharedStride).docs/dev/debt/shader.md; placement only.maininDraw.cpp, and with this change in the same files; #6188 too, plus theDrawCache.hppinclude above. #6946 (fbe1f8b1ec) merges withmaincleanly and conflicts with this change inDraw.cpp(theAppendProgramMemorycall and the record'sUserDataWordspatch). #7642 and #6946 each turn the per-drawmemoryandprogramsinto a per-draw tail;AppendProgramMemorythen fills the tail's vector.Tested
mainef0eed9b31, after #7623 changed the debt line next to this change's entry (placement only). There, on the Linux build node, the change's own 12 tests pass (request_serializer,agc_shader_memory,agc_driver_tessellation,agc_tessellation_factor_ring, theagc_driver_prepared_graphicstests, the two journal tests, #6931'sagc_driver_pipelined_indirect_drawandguest_requested_exit). The wider runs below are onmain3aa4448ed3. #6941 took request version 38 there, so this change writes 39 and readsmergedHullonly from 39. Both sides wrote 38, so git mergedRequestSerializer.cppwithout a conflict at the old number; the tests catch that, as they did on the rebase onto #4650's 35.verifyMergedHullConfigurationfinds the flag 52 bytes from the end; the fields after it include the draw fields, #6941's mesh barycentric flag, #4650's depth-remap fields and #6503's flag. It reads version 30, 31, 32, 34, 35, 36, 37 and 38 requests as not merged.main's version 38 format.main's new 1000-character limit, with the gap first.lastDrawablescan after this change's threeUserDataWordslookups (one textual conflict inDraw.cpp).writablePrograms;AppendProgramMemoryfills the vectormainreserves.request_serializer,agc_shader_memory,agc_driver_tessellation,agc_tessellation_factor_ring,agc_driver_prepared_graphics,agc_driver_prepared_graphics_prebuild_unset,agc_pipeline_journal,agc_driver_pipeline_journalandguest_requested_exitpass.ctest -R 'agc|shader|recompiler|request|tess', 814 tests: this change passes 735, skips 60 and fails 19, and so doesmain3aa4448ed3built the same way, with the same skips and the same failures:shader_cache_runtime_sources,agc_driver_lookup_log_fits_build, plus 17 of the 18 listed below for324e0e48e(agc_driver_storage_write_back_overhangpasses now). The container does not permit userfaultfd, and 15 of those 17 report guest memory that is not write-watched or needs to be.agc_driver_pipelined_indirect_draw, #6931's test, passes on both.main324e0e48e, the previous head (4e7fa2be5, version 35): 744 of 762 pass, the same asmain324e0e48e. Both fail the same 18:agc_driver_bc_block_copy,agc_driver_depth_compare_copy,agc_driver_guest_memory_lifetime_converted,agc_driver_image_srgb_sample_copy,agc_driver_image_srgb_sample_copy_forced,agc_driver_image_table_vouched_lookups,agc_driver_image_table_vouch_queued_draws,agc_driver_msaa_dcc_clear_2,agc_driver_msaa_dcc_clear_4,agc_driver_msaa_dcc_clear_8,agc_driver_native_depth_bda_clear,agc_driver_native_depth_clear_refusals,agc_driver_native_depth_clears,agc_driver_native_depth_retirement,agc_driver_native_multisample_depth,agc_driver_staged_clear_sampled_read,agc_driver_storage_write_back_overhang,agc_storage_kept_unit_settle.BUILD_TESTING=ON, lavapipe (Mesa 26.2.4, LLVM 23.1.1).ctest -R 'agc|shader|recompiler|request'onmain92e50418f, with the earlier version-31 head:main: 591 of 601 pass.agc_storage_kept_unit_settle,agc_pending_key_stores,agc_driver_bc_block_copy,agc_driver_depth_compare_copy,agc_driver_native_multisample_depth,agc_driver_staged_clear_sampled_read,agc_driver_storage_write_back_overhang,agc_driver_native_depth_retirement,agc_driver_native_depth_clears,agc_driver_native_depth_clear_refusals(most need write watching, which the container does not have).MergedHull*inTessellation.cpp) are written for these tests. Each is an eight-dword entry, thenmain'sLocalCode(without itss_swappc), two dwords of glue andmain'sHullCodewith one LDS read offset changed (LocalCodeandHullCodeare from the same file). The entry's lane id isHullCode's, and its other instructions are assembled withllvm-mc(gfx1010).MergedHullReadLane'sv_readlane_b32is also assembled withllvm-mc(gfx1030).MergedHullDivergentBarrierinserts ans_barrier.MergedHullRegisters,MergedHullForeignRecordandMergedHullOutsidePatchchange a store's registers or an LDS offset by hand. The entry's layout and the vertex-table slots ofCheckMergedHullVertexTablesfollow PPSA11386's merged programs, and the entry's first seven dwords (the lane test) also occur in them; apart fromHullCode's ownv_mbcntpair, no run of four consecutive dwords from these programs occurs in the title's shader binaries captured here. ThePreparedGraphics.cppcases use 64 filler words ands_endpgm, asmain'sFixturedoes.agc_driver_tessellation: two merged-hull draws (MergedHullCode, andMergedHullRegisters, whose hull part stores a register its local part filled) checked like the separate-hull draws (RequirePatches); refusals for more input than output control points, an LDS write into another control point's record, an LDS read past the patch's records, a divergents_barrierand av_readlane_b32of lane 0 (which the one-lane emitter would otherwise compile); the merged hull stage compiled with the device target declares noGroupNonUniformcapability; registration and graphics ABI resolution of a type-3 stage group (twice, the second from the prepared ABI).agc_driver_prepared_graphics: the decode of a merged hull draw at ABI resolution and at draw time (roles, entry points, user SGPR layout, user-data address set, unset, zero, and set to an unmapped address that the program does not need), its program memory listed once and accepted byRequestMemoryView(and used as the stages' request memory), the user-data words of SH 0x10e in both stages, preparation as two separate stages that the draw reuses, separate halves still decoded as before and still requiring the address; a merged program's vertex tables read from its user-data slots behind the eight hidden words.agc_shader_memoryandrequest_serializer: themergedHullbyte round-trips; version 30, 31, 32, 34, 35, 36, 37 and 38 requests (38 ismain's current format; with and without tessellation) read as not merged, keep their fields and re-serialize to the version 39 bytes; the version 39 fixtures; version 40 is rejected. With the field read from version 35 on, as git merged it on the rebase onto #4650, both fail withRequestSerializer: truncated data.main1b1f8483c(after #5405 took version 32), the same node:request_serializer,agc_shader_memory,agc_driver_tessellation,agc_tessellation_factor_ring, the fouragc_driver_prepared_graphicstests andguest_requested_exitpass (9 of 9).ctest -R 'agc|shader|recompiler|request': this change 617 of 626 pass,main1b1f8483cbuilt the same way 617 of 626; both fail the same nine (agc_driver_bc_block_copy,agc_driver_depth_compare_copy,agc_driver_native_depth_clear_refusals,agc_driver_native_depth_clears,agc_driver_native_depth_retirement,agc_driver_native_multisample_depth,agc_driver_staged_clear_sampled_read,agc_driver_storage_write_back_overhang,agc_storage_kept_unit_settle).maineb901bcf4with the previous head 36529f17d, the same node:request_serializer,agc_shader_memory,agc_driver_tessellation,agc_tessellation_factor_ring, the fouragc_driver_prepared_graphicstests andguest_requested_exitpass (9 of 9).main92e50418f, earlier head):mainwith only the tests that compile there (the type-3 registration case inagc_driver_tessellation, the serializer fixtures):agc_driver_tessellationfails withregistered program refers to an incompatible shader binary type,agc_shader_memorywithnew requests did not use serialization version 31(39 now), andrequest_serializeraborts on its version fixture. The other new cases use the new field and functions; with the change and one part reverted at a time, the check written for that part fails: the draw decode not detecting type 3 (agc_driver_prepared_graphicsandagc_driver_tessellation:registered program refers to an incompatible shader binary type); nomergedHullbyte in the serialization (a merged hull configuration was lost in serialization,request_serializeraborts); the lowering not treating the program as merged (unsupported LDS access in a tessellation stage); the hull stage at the device subgroup size (the hull stage of a merged hull program declares subgroup operations ...); no cross-lane refusal (a tessellation program was accepted although another lane's register: av_readlane_b32of lane 0 compiles silently); the program memory without the dedupe (a merged hull draw's program memory does not list each code and header region once);UserDataWordsstopping at the first program (an indirect draw's user-data register does not reach both stages of a merged hull program); the hull user-data address required (merged shader user-data address is null); the optional address range-checked (guest memory is not readable at 0x10); the read-past-patch check removed (a tessellation program was accepted although reads LDS outside its patch's control point records).MergedHullCodewithout the one-lane layout declared capabilities 61 and 64 with oneOpGroupNonUniform*instruction; with itss_cbranch_execzreplaced bys_nopit declared neither, so the branch is the only source.Draw.cppindirect record loop (onlyUserDataWordsis), the draw key'smergedHull, and the refusals for outputs beyond the device limits, a barrier in a loop and fetch subroutines.agc_driver_tessellationtakes under 1 s on the node.tools/check_conventions.py --base upstream/mainandgit diff --checkpass.maineb901bcf4: NVIDIA GeForce RTX 3080 (615.78.08), CachyOS (Linux 7.2.10), GCC 16.2.1, Release withBUILD_TESTING=ON,ctest -R 'agc|shader|recompiler|pm4|draw|position|tess|hull|request':agc_driver_stencil_ref_exportskips andagc_driver_store_over_untrackedfails.mainbuilt the same way: the same 625 pass, the same skip and the same failure, on the same test list.agc_driver_store_over_untrackedfails on both withthe result did not reach a block the CPU left alone; #6347 tracks the same test failing on Windows.main4186f06a9plus open PRs, unpublished local fixes the title needs, local logging and scripted input, and the title's two feedback-wait limits widened in its executable as described in #6172 (local only). These runs used the earlier version-31 head, before #6931's queued indirect path; the version changes do not touch the draw path.main-based stack without a merged-hull change stopped in the level load after present 1188 withregistered program refers to an incompatible shader binary type.mainup to5d9dcc42d, the title stops in the level load after present 1195 withmerged shader user-data address is null: a merged hull draw there leaves the hull user-data address null.Checklist
main; #6612 builds on this changeNotImplemented_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 milescoviello on 2026-10-16T04:17:51Z.
A note on overlap: #6612 (Crimson Desert, PPSA25286, opened 10-15) also takes a registered type-3 program at 0x148 with nothing at 0x108, in the same lines of
DrawDecode.cpp(L96-101) and inTessellationLowering.cpp. Whichever lands second needs a rebase.The two handle it differently. #6612 compiles the program twice: once as the local role, with no hull threads in
s3, and once as the hull role, with no local vertices. The values then go through the existing local-to-hull LDS path. That split can't carry VGPRs from the local part into the hull part across the barrier. YourMergedHullRegisterscase covers that, and you say 007 First Light needs it, so your approach looks like the more general one.Crimson Desert's merged hull draw has
VGT_LS_HS_CONFIG0x1043f (63 patches, 4 input and 4 output control points), so your refusal for more input than output control points wouldn't apply to it. Its halves pass 16-bit values through LDS, and #6612 adds 16-bit LDS writes in local programs and reads in hull programs for that. I haven't run it on your path. The title still needs #6612's tessellation-to-geometry path either way, so I can't check it with this PR alone.If this lands first, I'll move #6612 onto your merged hull, drop its type-3 split, and check that Crimson Desert gets as far as before.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T04:35:01Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/shader/recompiler/tests/RequestSerializerTests.cppL217, L221-222, L257, L261-262, L283, L407-413, L422, L427-428, L443, L445core/shader/recompiler/Optimization/src/TessellationLowering.cppL959-960, L962core/shader/recompiler/tests/RequestSerializerTests.cppL217, L221-222, L257, L261-262, L283, L407-413, L422, L427-428, L443, L445docs/dev/debt/shader.mdL172core/shader/recompiler/tests/RequestSerializerTests.cppL217, L257, L283, L407-411, L422, L443, L445core/libs/prx/libSceAgcDriver/Execution/include/Driver/Draw/DrawCache.hppL13, L46-47core/shader/recompiler/Recompiler.cppL146-147core/shader/recompiler/tests/RequestSerializerTests.cppL217, L221-222, L257, L261-262, L283, L407-413, L422, L427-428, L443, L445docs/dev/debt/shader.mdL172docs/dev/debt/shader.mdL172docs/dev/debt/shader.mdL172docs/dev/debt/shader.mdL172Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Translation/src/InstructionTranslator.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/StageIO.hppcore/shader/recompiler/Optimization/src/ShaderInfoCollector.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Draw/DrawCache.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/shader/recompiler/Recompiler.hppdocs/dev/debt/shader.mddocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/tests/RequestSerializerTests.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Draw/DrawCache.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/shader/recompiler/Recompiler.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/Optimization/include/Optimization/ShaderStageInputInfo.hppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cppcore/shader/recompiler/tests/RequestSerializerTests.cppdocs/dev/debt/shader.mddocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Draw/DrawCache.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/Optimization/include/Optimization/ShaderStageInputInfo.hppcore/shader/recompiler/Optimization/src/ShaderInfoCollector.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/Translation/src/ShaderInputInfoBuilder.cppcore/shader/recompiler/tests/RequestSerializerTests.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Draw/DrawCache.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Draw/DrawCache.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ProgramMetadata.hppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRegisterKey.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/Translation/src/InstructionTranslator.cppdocs/dev/debt/shader.mddocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ProgramMetadata.hppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppdocs/dev/debt/shader.mdcore/shader/recompiler/Recompiler.cppdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Draw/DrawCache.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ProgramMetadata.hppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppdocs/dev/debt/shader.mdcore/shader/recompiler/Recompiler.hppdocs/dev/debt/shader.mdcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/tests/RequestSerializerTests.cppdocs/dev/debt/shader.mddocs/dev/debt/shader.mdImported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T12:08:25Z.
A heads-up on the request version: #5884 merged with version 31 for
MeshConfiguration::outputPrimitiveSize, somainnow writes 31 withoutmergedHull. This PR still merges textually, but it readsmergedHullunderversion >= 31. A version 31 request frommainwith a tessellation configuration would then have the byte after its tessellation fields read asmergedHull. I hit it while rebasing #6612 on top of this PR. #6639 has moved its point fields to 32, so whichever of the two lands second would take 33.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-16T13:00:30Z.
Thanks @milescoviello, good catch: after #5884 this PR still merged cleanly with
main, since both made the same 30 to 31 edits. This PR now writes 32 and readsmergedHullonly from 32 on, and a new test checks thatmain's version 31 requests, with and without tessellation, read as not merged and keep their fields. That test fails with the old>= 31gate. #6639 and the others that also take 32 are listed under Overlap. #6612's first commit is the old head 8f93aa0bd, so it needs a restack onto the new one.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-16T17:40:39Z.
Fresh Windows11/RTX5070Ti617.42 cross-test on current integrationc6bd8b539047dacb9ddc95b41c45e69b78d39f19 (main
d9b696ddb+ shared-table/007 boot stack + canonical #6679 36529f17d and #63649fffceaa9; #4339 excluded):30/30 selected native controls PASS15.94s, no skips. Includes storage_flush_ordering, storage_write_back_overhang, depth_storage_dispatch, tessellation, prepared_graphics and its unset/0/1 prebuild cases, serializer, shader memory/disk cache, shared tables and draw-cache checks.6364 negative control: retained the new fixture and other integration code, removed only FlushPending's PendingWriterSerial/Reap/Sync/FinishUpTo wait block, rebuilt the unpatched driver and ran the fixture. It FAILS in0.37s with
storage flush ordering, writer in flight: the pending image's store put its older texels over a newer address-based store. Restored the exact committed Texture.cpp, rebuilt patched modules, and30/30PASS14.53s. Source/conventions clean. This is a wait-only negative in our integration, not a standalone main red/green.Public branch https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-level-two-lane . Matched driver/Agc/VideoOut now staged together, same2GiBfree/28GiBprivate guard. Starting007; title level/cinematic outcome still pending, so the native pass is not claimed as playable gameplay. AI-assisted: Codex; title data local.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-16T20:14:21Z.
@milescoviello #6679 is rebased onto
main1b1f8483c. #5405 merged with request version 32 (target.spannedWaves), somergedHullnow reads from version 33. The new head is 01947dd9b. Against 36529f17d it changes only the request version (the writer, the reader limit and themergedHullgate) and the serializer tests; the rest of the change, the debt entry included, is the same. #6612's first commit, 734a8f5ef, is 36529f17d rebased ontomain452494439, so it needs another restack, and its first commit should readmergedHullfrom 33. #6639 and #6801 also write 33 now; whichever lands first keeps it.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T18:54:53Z.
@SleglJan following up, sorry for the late answer: #6612 now carries this PR's current head unchanged.
git range-diffshows 53c0af2c16 identical to #6612's first commit (52a658cb7f), restacked onmain8625038579today. The tessellation tests pass there 2 runs of 2.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T01:30:18Z.
@SleglJan a heads-up: this PR conflicts with
mainagain.mainis now at request serialization version 34. The pixel stage'siteratesSamples,positionLocationandsampleLocationsread from 34, and there's no use of 33. SomergedHullneeds version 35.I rebased your commit onto
main017f2151cafor #6612, which stacks on it, and pushed it asoffer/6679-main-017f2151(1254a68e84, you as author) in case it saves you time. It still merges withmainb5be95ff0b. Against your head it changes only:mergedHullreads from 35;NVNQQSMAAAA=for 35,NVNQQSQAAAA=(36) as unsupported, themain34replay inRequestSerializerTests.cpp, and version 34 added to the old-version loop inverifyMergedHullConfiguration. Main's version 34 fields are pixel-only, so the tessellation-control request there doesn't contain them;The conflicts were all version numbers: the writer, the reader limit, and the tests' expected bytes. I'm running the serializer and tessellation tests on it now and will post the results here. I'll restack #6612 on whatever head you choose.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T01:54:19Z.
@SleglJan results for
offer/6679-main-017f2151(1254a68e84) on Linux, RTX 4070 Ti:request_serializer,agc_shader_memory(withverifyMergedHullConfiguration, now also over version 34),agc_driver_tessellation,agc_tessellation_factor_ring,agc_pipeline_journalandagc_driver_pipeline_journalall pass.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T02:19:41Z.
@milescoviello thanks, that saved me the work. I took your 1254a68e8 as is. Since then
mainmoved to324e0e48e, and #6312 madeDriver::drawreadprogramsthrough a const alias, which conflicted inDraw.cpp. The head is now 4e7fa2be5:writablePrograms;ProgramMemorybecameAppendProgramMemory, which fills the vectormainreserves, so #6312's single allocation for the draw's memory regions stays.The request version is 35, as in your branch. Tests are in the description: on the Linux node, the serializer, tessellation, prepared-graphics and journal tests pass, and the
agc|shader|recompiler|request|tessset fails the same 18 tests asmainbuilt the same way. #6612 conflicts today: its first commit is the previous head, so stacking it means swapping that commit for 4e7fa2be5 and rebasing.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T02:23:21Z.
@SleglJan thanks. I've restacked #6612 on 4e7fa2be5 locally: its three commits now sit on your head instead of the previous one. Two conflicts, both from
main:ShaderRegistry.cpp: keptmain's new order (push offset, then the deferral check, then the vertex decode inside itstry), with #6612'sStageWaveSizeandStageMeshConfigurationin place of the fixed wave size andstages.mesh.Draw.cpp: #6612's|| capturedplusmain'sKeepMultisampleTargetloop.The result merges cleanly with
main40393b0f9. I'm building it now and will run the AGC, shader, request and tessellation set on 4e7fa2be5 and on the restack before I push.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T02:39:52Z.
@SleglJan #6612 is pushed on top of 4e7fa2be5 (head 9825024871). On the Linux node (RTX 4070 Ti), the AGC, shader, request, journal and tessellation set passes 609 of 610 with it, against 608 of 609 on 4e7fa2be5 alone. The one failure on both is
agc_driver_bda_device, the fence timeout from #7584. The tessellation, serializer and journal tests pass 3 of 3.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T04:37:35Z.
@milescoviello a heads-up for #6612: #4650 merged and took request version 35, so this PR moved again. The head is now d919e6384 on
main676d42396, and it writes 36 and readsmergedHullonly from 36. On the rebase, git merged this PR'sversion >= 35uread without a conflict. #4650's version 35 requests have no flag, so on those that read takes the next field's first byte asmergedHulland shifts every later read by one. The serializer tests catch it astruncated data. #6612 carries the 35 read from 4e7fa2be5, so its restack needs this head.The test side:
verifyMergedHullConfiguration.main's version 35 format (main35, wasmain34).#6801 and #7410 also write 36, so after the first of the three lands, the next one takes 37.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T06:17:32Z.
@SleglJan thanks for the heads-up. I've restacked #6612 on d919e6384 locally. #4650's depth remap pushes against the same push-constant limit that #6612's
StagePushLimitreplaced, so the helper now takes the depth remap mode, inmain's order (mesh, tessellation before rasterization, depth remap, then the slot). Its journal format becomes 5. Tests are running, and I'll push when they pass.One more collision since then: #6503 merged at
main9817d53cc9and writes request version 36 (the f32 flush-to-zero flag, readif (version >= 36u)). So d919e6384's 36 now conflicts withmaintoo, and the next free version is 37. #6639 moves its point fields to 37 in the rebase I'm testing now. Whichever of #6679 and #6639 lands first keeps 37, and the other takes 38. I'll restack #6612 on whatever head you settle on.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T06:25:28Z.
@milescoviello thanks. The head to restack #6612 on is 3b69fde44 on
main46f27623c, after #6503's version 36 (target.float32FlushToZero, a trailing flag after #4650's depth-remap fields). It writes 37 and readsmergedHullonly from 37. In the tests:main's version 36 format (main36).#6801 now also writes 37, and so will #6639 after your rebase. The first of the three to land keeps 37, the second takes 38 and the third 39.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T11:29:58Z.
@SleglJan thanks for the version map. #6612 now carries 3b69fde441's patch unchanged as its first commit (same patch id, rebased as 15949ba712), on
mainf72c7aacfa, because adriadam10 asked for thequadListconflict withmainto be resolved. Its head is 235f5130c0, and the tessellation, journal and request serializer tests pass 3 of 3 there. #6639 takes 37 or 38, whichever of the three is free when it lands, as you laid out.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T16:09:54Z.
@SleglJan a heads-up on versions:
maintook request version 37 itself, in simonbronk's7563b4a480(stencil operation value export, readif (version >= 37u)into the pixel info). So #6679's 37 now collides withmain, and the next free version is 38. My #6639 is moving its point fields to 38 in the rebase I'm testing now. As before, whichever of #6679, #6801 and #6639 lands first keeps 38, and the next takes 39. I'll restack #6612 on your head again once #6679 is rebased.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T16:19:39Z.
@milescoviello thanks, rebased: the head is 83a04aba0 on
main0fbfd91e5. It writes 38 and readsmergedHullonly from 38. In the tests:main's version 37 format (main37).Both conflicts adriadam10 listed on #6612 (
Draw.cppwith #6931, andRequestSerializerTests.cpp) are in this PR's commit, and this head resolves them; #6612's own three commits apply onto it without a conflict (git merge-tree). InDraw.cpp: the three record lookups stayUserDataWords(programs, roles, ...), so every program that holds the register gets the word, both stages of a merged hull program included. #6931'slastDrawablescan follows them. Each record's words are patched and its stages rebuilt before the check that queues the last drawable record, so the queued draw carries them. No test covers that path with a merged hull draw yet. The debt entry is also down to 999 characters, undermain's 1000-character check (which counts the whole line).#6941 already writes 38 on a base with #6762. Its version lines are the same as this PR's, so git merges
RequestSerializer.cppbetween the two without a conflict, and only the tests file stops. #6639 moving to 38 makes three at 38 (#6679, #6941, #6639); #6801 and #7410 still write 37 on bases before #6762, and #7332 reads its two target flags from 38. Whichever lands first keeps 38, the next takes 39, and so on.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T16:26:03Z.
@SleglJan thanks, that was quick. #6612's three commits apply onto 83a04aba0 without a conflict here too (77d218a50a). The graphics, journal, serializer and tessellation runs on it are queued, and I'll push #6612 when they pass. #6639 is now at 38 too (01119658d8), so of the three at 38, whichever lands first keeps it.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T22:36:39Z.
@SleglJan another version heads-up: #6941 merged at 3:17 PM PDT with request version 38 for its mesh barycentric layout (read
if (version >= 38u && reader.ReadBool())in the graphics section). So #6679'smergedHullat 38 now collides withmain, and the next free version is 39. I've moved #6639's point fields to 39 (a2554533a6, pushed), so of the two at 39, whichever lands first keeps it and the other takes 40. In #6941's tests, the old-format fixtures get its field throughInsertMeshBarycentricFlagbefore the version byte is raised, which is where I needed to add it inRequestSerializerTests.cpp. #6612 follows your rebase; I'll restack it once #6679 is on 39.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T23:05:38Z.
@milescoviello thanks, rebased. The head is 30541537b on
main3aa4448ed3; it writes 39 and readsmergedHullonly from 39. In the tests:main's version 38 format (main38), withInsertMeshBarycentricFlagas in #6941's own fixtures.Both sides wrote 38, so git merged
RequestSerializer.cppwithout a conflict at the old number, and onlyRequestSerializerTests.cppstopped. #6639 and #6801 (on #6639's commits) also write 39, on bases with #6941, and merge the same way against this head, so whichever of #6639 and this change lands first keeps 39. #7332 also writes 39, on a base from before #6941. 30541537b is ready for the #6612 restack. #6612's head 77d218a50a still carries 83a04aba0's version 38 read, which collides with #6941's 38; restacked onto this head it reads 39 with the rest of this change, as #6612 adds no version of its own. Its three commits then conflict only wheremainchanged since0fbfd91e5(CacheKey.hpp,Draw.cpp,DrawCapture.cpp,ShaderValidation.cpp).AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T23:28:04Z.
@SleglJan thanks. #6612 is restacked onto 30541537b (09356fedba, pushed). As you said, it reads 39 with the rest of your change. The four conflicts were all
main's mesh barycentric change (#6941), inCacheKey.hpp,ShaderValidation.cpp,Draw.cppandDrawCapture.cpp, and both sides are kept in each. The graphics, tessellation, journal, serializer, mesh and geometry tests pass, 16 of 16, 3 of 3. The 1.4.363 validation layer gives no messages on your head or on #6612's.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T13:17:22Z.
Thanks, the merged hull path reads correctly, and all changed files compile on current
main. One question before merge, about the test data:The six 87-88 dword test programs (the
MergedHull*cases inTessellation.cppand the one inPreparedGraphics.cpp) don't say how they were made. Were they assembled by hand (or written for this test) rather than copied from a title's shader binary? The repository can't carry code taken from game files, so a sentence in the description saying how they were produced is enough.Also a heads-up on ordering: request version 39 is also used by #7888, #7410, #6801 and #6639, so whichever of these merges second will need to move to 40.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T13:27:40Z.
Thanks for the heads-up @oneandonlydean. If this lands first, I will move #6639 to 40. #6801 (JJenkx) builds on #6639 and would follow it. The test-data question is for @SleglJan.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T14:18:53Z.
@oneandonlydean they were written for these tests, from the programs already in
Tessellation.cpp.How each
MergedHull*program is built. In order:s_mov_b64 exec, -1, computes the lane id asHullCodedoes, runsv_cmpx_lt_u32against the local lane count ins3[7:0], thens_cbranch_execz. Its new instructions were assembled withllvm-mc(gfx1010).main'sLocalCode, without itss_swappc.main'sHullCode, with one LDS read offset changed (8 to 72).The variants:
MergedHullReadLanereplaces threev_mov_b32with av_readlane_b32and av_mov_b32, assembled withllvm-mc(gfx1030).MergedHullDivergentBarrierinserts ans_barrier, so its branch moves by one.MergedHullRegistersstores two other registers:buffer_store_dwordx2 v[8:9]instead ofbuffer_store_dwordx4 v[2:5].MergedHullForeignRecordandMergedHullOutsidePatcheach change one LDS offset.llvm-mc's disassembler.The
PreparedGraphics.cppcases use 64 filler words ands_endpgm, asmain'sFixturedoes.CheckMergedHullVertexTablesbuilds the same words inline, with its own header.Where PPSA11386 comes in:
HullCode's ownv_mbcntpair, which is inmain, no run of four consecutive dwords from these programs occurs in the title's shader binaries I captured.CheckMergedHullVertexTables(10 and 12) are also the ones that title's merged headers use.If you'd rather the tests share neither the seven dwords nor those slots, I'll re-encode the entry and move the slots.
One value from the title. Checking this, I found it in the tests:
CheckMergedHullVertexTablesfilled the four user-data slots that must not be read as vertex tables with a word pair copied from a PPSA11386 run log. I've replaced it with a made-up pair, so the head is now8b8219dcef. Nothing else changed. The prepared-graphics, tessellation, serializer and shader-memory tests pass on the Linux build node (lavapipe, 7 of 7). @milescoviello #6612 needs a restack onto8b8219dceffor that one test line.Description: it now has a paragraph on how the programs were made. In its version list, #7410 and #7888 are now at 39, and #7332, which is closed, is gone. The second to land takes 40, as milescoviello said for #6639 and #6801.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-20T16:01:12Z.
An AMD data point after the merge.
agc_driver_tessellationfails on AMD's proprietary Windows driver, on an AMD Radeon RDNA2 iGPU (1002:13c0, driver 32.0.21042.62,ANYPS5_GPU=AMD), 3 of 3:Setup: Windows 11, WinLibs GCC 15.2.0, Release,
ANYPS5_REQUIRE_VULKAN=1. The tree ismaind073fe6a1plus #7410, which only touches compute wave64 shared VGPRs. On the RTX 5070 Ti (617.42), the same build passes. I haven't looked into the cause.AI-assisted: yes (Claude Code); results above were run on this machine.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T18:15:15Z.
@wachi35676 thanks for the data point. I can't reach that case on an AMD GPU here. On the Ryzen 9 7950X3D's iGPU (RDNA2, RADV, Mesa 26.2.4),
agc_driver_tessellationcrashes inside the driver in the fourth separate-hull case (HullDynamicIndex). WithAPS5_NO_GPL=1it segfaults too; I didn't trace where. That matches #5444, Mesa 26.2'snir_opt_varyingscrash on a hull that reads a control point at a computed index. The build wasmain68323bae7with #5799, #6868, #5372, #6918, #7643 and #6679 (at 0307183985).The test stops at its first failure, so in your run the separate-hull cases before the merged ones passed. (16, 24, 40, 255) is the test's background colour, so the level-1 patch wasn't drawn at all. The difference is in what the merged lowering adds to the same patches.
Three things on your machine would narrow it down:
pipelineLibrary=value in the device's "Vulkan features" line.APS5_NO_GPL=1, so the draws go without graphics pipeline libraries. If the merged cases then pass, it's the library link on that driver.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, to see whether anyVUID-appears before the failure.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T01:15:08Z.
Regression on AMD (Windows):
agc_driver_tessellationfails since this merge on an AMD Radeon RX 6700 XT (gfx1031, AMD proprietary driver 26.8.1,maxMeshOutputLayers8), Windows 11 22621, WinLibs GCC 15.2 UCRT r7, Release, freshBUILD_TESTING=ONbuild:3177d1989(this merge's first parent): passes5ccf1824d(this merge): fails, and still fails onmain57fdffd91:The tested GPUs above are lavapipe and an RTX 3080, so this may be AMD-specific. I can run a build or a diagnostic on this card if that helps.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-21T01:48:09Z.
@JJenkx thanks for the bisect, and yes, a run on that card would help. An AMD data point from Linux first:
main339217ebc9.HullDynamicIndexcrashes RADV before the merged cases are reached (#5444). I also dropped the neighbouringDomainComputedPointlocally; I didn't check it on its own.agc_driver_tessellation_testspasses 3 of 3 runs, including both merged-hull draws, withpipelineLibrary=1in the "Vulkan features" line. It also passes withAPS5_NO_GPL=1(pipelineLibrary=0), and underVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationwith noVUID-.So RADV draws the merged programs. @wachi35676's RTX 5070 Ti passes on the same Windows build, so what you both see points to AMD's proprietary Windows driver. On the RX 6700 XT, the same three checks I asked @wachi35676 for above would narrow it down:
pipelineLibrary=value in the device's "Vulkan features" line.APS5_NO_GPL=1. If the merged cases then pass, it's the library link on that driver.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, to see whether anyVUID-appears before the failure.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T03:20:18Z.
@SleglJan the three checks on the RX 6700 XT (Windows 11 22621, AMD driver 26.8.1, MinGW GCC 15.2 Release),
agc_driver_tessellation_testsbuilt frommain6c12024f7:tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1.pipelineLibrary=1): fails atAGC graphics: merged hull program, unculled: the level-1 patch was not drawn as one flat triangle, centre (16, 24, 40, 255). WithAPS5_NO_GPL=1(pipelineLibrary=0): fails at the same check, but the centre is(255, 243, 0, 255). So it is not only the library link. Without libraries something is drawn at the centre, but still not the flat triangle.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationloaded nothing and the zeroVUID-count means nothing. I will add it if I can install the layer.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-21T03:44:53Z.
@JJenkx thanks, that helps. The two colours say different things about patch 0:
So patch 0 differs between the two modes on that driver, while NVIDIA and RADV draw it flat. The domain program passed earlier in the same run with the separate hulls, so the difference is in the merged program's local or hull half. Either the merged lowering relies on behaviour Vulkan doesn't guarantee, or the driver mishandles it. I'm reading the lowering now. If a diagnostic build would separate the candidates, I'll push one to a branch on my fork and ask you to run it.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T04:04:31Z.
Correction to my last comment: the
APS5_NO_GPL=1difference does not reproduce. Five more runs each, same build and machine: all ten fail at the same check with centre(16, 24, 40, 255), whetherpipelineLibrary=1orpipelineLibrary=0. The single yellow(255, 243, 0, 255)result was only the first no-library run (possibly the first time those pipelines were built without libraries; not established). So turning off the library link changes nothing on this driver: the merged-hull draw leaves the clear colour either way.Check 3 is still not done. The only Windows build of the validation layer I could get without the SDK (MSYS2's, 1.4.363) needs the GCC 16 C++ runtime. Loaded into this GCC 15.2 build, it hangs at layer initialization. I will report it if I get a working layer.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-21T04:51:21Z.
@JJenkx thanks for the correction. With the centre background in all ten runs, the library link is out. The validation-layer check waits for a working layer.
A diagnostic build would separate the remaining candidates. The branch
diag/merged-hull-amdon my fork is one commit (2127ffe37d) onmain7ab4b2e561.main.APS5_DIAG_MERGED_CONSUMEandAPS5_DIAG_MERGED_BARRIERchange only merged-hull draws;APS5_DIAG_MERGED_READBACKchanges every tessellation draw.0included.From the build directory, with
agc_driver_tessellation_testsonly. In cmd the binary istests\agc_driver_tessellation_tests.exe. Set the variables first, and clear the previous switch between runs (set APS5_DIAG_MERGED_CONSUME=).ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 tests/agc_driver_tessellation_testsAPS5_DIAG_MERGED_CONSUME=1: the domain stage reads the hull's shared records, so that hull output has a consumer.APS5_DIAG_MERGED_BARRIER=1: the merged hull's barrier gets memory semantics (AcquireRelease | WorkgroupMemory, Device scope).APS5_DIAG_MERGED_READBACK=1:APS5_DIAG_MERGED_CONSUME=place, which moves the records without the consumer.On a driver that works, runs 1, 2, 3 and 5 print "Tessellation tests passed", and run 4 ends with "20 checks failed, 20 of them the level-0 patch drawn by design" and exits 0. In run 4, patch 0's blue shows what its hull read as the level source:
All five runs pass on an RTX 3080 and lavapipe, and on RADV (gfx1036) with the two computed-index cases skipped locally (#5444). There, run 4 ends 16 of 16. Runs 2–4 under the validation layer on the RTX report no
VUID-.AI-assisted: yes (Claude Code)