Repository navigation
fix(agc): bind the sample order depth set after its pipeline - #9503
oneandonlydean merged 2 commits into
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The one-line reorder is valid Vulkan state usage: the spec says compatible descriptor sets may be bound without a pipeline having been bound first, so rebinding immediately after each pipeline is legal (Vulkan descriptor-set binding rules). The live overlap scan reports no open-PR overlap. The reported RX 6700 XT red/green runs and RGD fault location are useful evidence; policy checks pass, while hosted product/relinker jobs are skipped. I did not run local tests.
Before merge, please complete the repository-required GPU validation comparison for this AGC change. CONTRIBUTING.md requires the same focused tests on main and the change, on the same machine/GPU, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, using ctest -V; verify the layer was actually found and compare logs for new VUID- errors. The current test report does not include that run and says the CTest/RGD logs remain local. Please run the focused sample-order tests with those settings and attach the concise results/logs (including any #8310 test-only overlay or #9056 combination needed to interpret the run). I’m requesting changes for this required GPU validation evidence, not for the reorder itself.
|
Confirmed on AMD's Windows driver. On an RDNA 2 iGPU (
Details in #9507. AI-assisted: yes (Claude Code); results above were run on this machine. |
|
@MarcZX10 Thanks. Here is the validation run. Setup: Radeon RX 6700 XT, AMD driver 26.10.1, Windows 11 22621, base Each arm ran
The layer is Vulkan-ValidationLayers
How to read the table:
Logs of all four arms and the RGD summary: 20261022-sample-order-validation-9503.tar.gz |
MarcZX10
left a comment
There was a problem hiding this comment.
The author has now supplied the required focused Vulkan validation comparison in comment 6330588455: same RX 6700 XT/Windows setup, sample-order ctest with VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, and ANYPS5_REQUIRE_VULKAN=1; loader output confirms the layer loaded, and the table compares VUIDs across main, this PR, and the #9056/#9057 combination. The comparison reports no VUIDs in the combined passing arm and no additional VUID category from this reorder. The original gfx1036 reporter also confirms #9503 fixes the device loss with GPL enabled. I reviewed the diff and report; I did not run local tests.
|
Some 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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
The one-line reorder remains technically sound, and the RX 6700 XT validation-layer comparison now satisfies the GPU evidence requirement for the reported test arms: the layer load is confirmed, the focused ctest -V runs use all required environment settings, and the author compares VUIDs including the #9056/#9057 combinations. The iGPU reporter also confirms the device-loss fix. I am requesting changes for the newly reported overlap with #9508: its current head and this PR both edit SampleOrder.cpp at the sample-order draw path, but #9503 still says Depends on: none and has no author-agreed order or rebase plan. Please compare the exact hunks with #9508’s author, document which lands first and add Depends on: #N if required, then rerun overlap after rebasing. Also, the validation report and tests are against a6dcea9 while current upstream main is ab347d1; update to current main and repeat the focused validation comparison there before merge. Hosted product jobs are skipped; I did not run local tests.
3192893 to
68b1c30
Compare
|
@MarcZX10, thanks. Two updates: Overlap with #9508. Both PRs touch only the sampled-pass
The changes are compatible, and the second to land keeps both: the wrapped call, inside the lambda. I've proposed to Raghav314 on #9508 that this PR goes first, and offered to rebase onto theirs if they'd rather. The Rebase. This PR is now rebased onto current Still to do: repeat the focused validation-layer comparison on that base on the RX 6700 XT, with the same four arms as before. That's a GPU run, so it waits for this machine's turn in the launch queue. I'll post it here when it's done. |
|
Reviewed; the move is right. Previously One nit: each of the up-to-8 stencil-bit draws re-binds an identical descriptor set where one bind after the first pipeline would also satisfy ordering; negligible next to the draws themselves. Not worth changing if the per-draw bind keeps the code simpler. |
|
Thanks @fogydes. I'll keep the bind next to each pipeline bind in the |
68b1c30 to
ba1a4d0
Compare
|
@MarcZX10 here is the current-main rebase and the repeated four-arm validation comparison you asked for. Head: Arms, each a fresh Release build of
Setup:
Results: identical in all three runs of each arm.
This is the same picture as my earlier run on
The overlap order with #9508 that we agreed is unchanged: this PR first, then #9508 wraps inside the draw lambda after the pipeline. |
Dismissing a stale review: the requested changes were addressed after it (new head and/or updated description with the asked-for runs) and the merge queue blocks on it. Please request changes again if anything is still open.
|
Tested on an AMD Radeon RX 6600 XT (Navi 23, 0x73ff), AMD driver 32.0.21045.16010, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release,
Same result in every run. On this device this PR clears AI-assisted: yes |
|
@JJenkx thanks for this. I wrote the |
|
Linux/RADV cross-check (the runs above are all Windows). AMD RX 7900 GRE, RADV / Mesa 25.2.8, kernel 6.8, Ubuntu 24.04.
All four
AI-assisted: yes. |
Fresh Linux current-main comparison (2026-10-24)Head
This is not validation-clean: both arms log Fresh build/test logs, JUnit, exact patch and comparison runner, SHA256 |
|
Refresh on current
Setup: Windows 11 Enterprise 22621, RX 6700 XT, AMD 26.10.1, MinGW-w64 GCC 15.2 UCRT, Release. AI-assisted: yes. |
…bind-after-pipeline # Conflicts: # core/libs/prx/libSceAgcDriver/Graphics/src/SampleOrder.cpp
|
Refreshed onto Conflict: in
Still needed after #16752.
Neither arm had any AI-assisted: yes. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head aee9406abdfed628f16db8851e08c1db97465c83. Read the PR description, commit summary, manifest, diff, and the changed function in SampleOrder.cpp. No commands or tests were run; repo_read.py was not available through the review tools.
Results
| Check | Result | Note |
|---|---|---|
| Change and context review | passed | Reviewed the sole changed line and its draw callback. |
| Tests | not run | No tests run for this review. |
Findings
Blocking
None.
Non-blocking
None.
Not verified
SampleOrder.cpp was the only changed file and was read around the modified draw callback. No excluded changed files were listed in the manifest. The repository reader and files not included in the review bundle were not inspected. The hardware test reports in the PR description were author-supplied and were not independently reproduced.
To get this to a good state
Nothing is required.
Superseabas
left a comment
There was a problem hiding this comment.
Windows re-check of the refreshed head aee9406abd on the Ryzen 7 7700X's integrated Radeon (1002:164e), the GPU from my earlier report. Merged onto main 0f4538fa02 (b730e8566b, clean merge; the only change is the one line in SampleOrder.cpp).
Setup: Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (x86_64-ucrt-posix-seh, r3), Release, run from PowerShell with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and the Khronos validation layer. GPUs: AMD Radeon integrated (Adrenalin 26.10.2) and NVIDIA GeForce RTX 5070 Ti (621.01).
ctest -R '^agc_driver_sample_order' (4 tests: sample_order, sample_order_planning, sample_order_grid_reference, sample_order_recipe_depth_locations), 3 runs, then agc_driver_sample_order_grid_reference alone 10 more times:
main 0f4538fa02 |
this PR merged | |
|---|---|---|
| Radeon, the set | 3 of 4 pass, in 3 of 3 runs | 4 of 4 pass, in 3 of 3 runs |
Radeon, grid_reference × 10 |
0 of 10 | 10 of 10 |
| RTX 5070 Ti, the set | 4 of 4 pass (grid_reference skips), in 3 of 3 runs |
the same |
- On
mainthe Radeon still fails as before, with "the exact path differs from the reference in 379 color and 2048 depth samples". With this PR it reports 0 color and 0 depth samples, and "the exact path renders Village's 2x checkerboard like the device's 2x2 sample location grid, bit for bit". - The RTX 5070 Ti skips
grid_referenceon both sides, because the device doesn't keep depth drawn at custom sample locations. So it gives no comparison here. - No validation messages on either GPU, on either side.
So the merge resolution around #16752's recording.BindPipeline(context, pipeline, slots), which binds the descriptor set after each pipeline bind inside the draw lambda, still fixes this GPU.
Not run: the full ^agc set on this head.
AI-assisted: yes (Claude Code)
What
SampleOrders::Depthbound its sampled-image descriptor set once, aftervkCmdBeginRenderPassand before any pipeline. Each draw then bound its own pipeline. On AMD's Windows driver, the first draw's pixel shader read its image descriptor from address0x200000000, and the device was lost.agc_driver_sample_order_grid_referencefails on that driver with:Radeon GPU Detective 1.6.3.7 places the page fault in the sample order pixel shader:
Draw(VertexCount=3)).s_load_dwordx8 s[12:19], s[0:1]. Its address is built ass0 = s7, s1 = 0x2, so the shader received a descriptor set address of 0.How I narrowed it down, on that device, with local switches that are not in this PR:
The set is now bound right after each pipeline, inside
draw. The Vulkan rules allow the old order, since the layout is the same object. Binding after the pipeline is equivalent and avoids this driver's behaviour.Tested
Windows 11 Enterprise 10.0.22621, AMD Radeon RX 6700 XT, AMD proprietary driver 26.10.1 (Adrenalin 25.10.45.16), WinLibs GCC 15.2 UCRT, Release. Base
maina6dcea9; #8310's test change is applied locally so that MinGW builds it. Each test was run 10 times one after another:mainagc_driver_sample_order_grid_referencethe composite of uniform renders: sample 0 of pixel (0, 0) holds depth 1.08e33agc_driver_sample_orderagc_driver_sample_order_recipe_depth_locationsWith this PR and #9056, the full suite passes 1872 of 1875. The 3 that fail:
patched_librariesfails the same way onmainhere:LoadLibraryExerror 127.agc_driver_image_array_window_past_layer_limitfails onmainhere as well.agc_driver_tessellationis fixed by fix(shader): index tessellation attributes at a constant address with constants #8884 on this device, 10/10 (see my comment there).tools/check_conventions.pypasses.The RGD text summary and the full ctest log are kept locally. I can attach them on request.
Additional independent evidence (2026-10-24)
brummilab reports three runs per variant on main
60465afd3ac4, AMD Radeon RX 6600 XT (Navi 23), driver32.0.21045.16010, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release. This PR uses headba1a4d0cd; #9056 uses53949c077.The reporter obtained the same result in all three runs. These are attributed independent observations, not locally reproduced; validation layers were not enabled. They add a second device/driver observation and do not replace the earlier validation-layer comparison or establish title performance. The author of the original descriptor bind confirms that binding after each pipeline is the intended equivalent ordering.
The agreed ordering with #9508 is recorded on the dependency checklist below. A fresh focused validation comparison against the then-current main remains outstanding; these peer tests use their stated pinned base, and Windows is currently user-paused.
Fresh Linux current-main comparison (2026-10-24)
Head
24f5d3aaab5274bb9510c7b0721508b5569ec8f0merges mainb930da950d5d076c19d8e6a025805f3799cadbc5into the original branch. The only main/change production difference is the descriptor-bind reorder. Both full focused targets rebuilt on the same Ryzen 9 7950X / Radeon RX 6650 XT (RADV NAVI23), Mesa 26.2.4, Linux 7.2.9, GCC 16.2.1 Release.agc_driver_sample_order,_grid_reference,_recipe_depth_locations, and_planningpass 4/4 on main and 4/4 on the change, without skips. Each ran separately withctest -V,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 MESA_SHADER_CACHE_DISABLE=true VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, explicit layer path/RADV ICD and loader diagnostics. All six physical test logs confirm actual Khronos insertion. Planning is a mock test and does not supply physical validation coverage.This is not validation-clean: both arms log
VUID-VkWriteDescriptorSet-descriptorType-00337(sampled image view lacks sampled usage). The VUID identifier appears 6 / 14 / 12 times respectively in the sample-order / grid-reference / recipe-depth logs on each build; planning has zero. These are log occurrences, not a count of distinct error messages. No new VUID type or increased occurrence count, missing-layer warning, device loss or timeout appears. No #9056/#9057 changes are folded in. This is Linux unit evidence; it does not reproduce the AMD Windows device loss, replace the older Windows reports or claim title/FPS improvement. Windows remains user-paused.Fresh build/test logs, JUnit, exact patch and comparison runner, SHA256
8bbc77d4a48811cd5dcb042aad1b9fc53af89a63a74d21a1b7768c0074734337.Current Linux qualification — 2026-10-29
Refreshed head
1b8af30a2bac5fa1f3b6800599b46726adb2fc21integrates pinned main5454cd2e455994d992aca39335ce60507eeda1eb.The descriptor bind remains after pipeline binding inside the draw callback. The existing agreement is #9503 first, then #9508’s author refreshes its descriptor-heap integration. A fresh manual hunk review confirms #9508 must move its heap-aware bind accordingly. The automated overlap fetch failed with unresolved deltas; this is recorded rather than reported as a clean automated overlap audit. No fresh negative control or affected-AMD-GPU reproduction is claimed.
Fresh matched Linux Release builds on AMD Radeon RX6650XT / RADV, with SPIRV-Tools enabled: main 12 passes and change 12 passes (three repetitions of each focused group), zero skips and zero VUIDs. Actual Khronos validation-layer instance insertions are 9 on main and 9 on the change. CPU-only groups are not counted as GPU coverage. Conventions, whitespace and submodule-pointer checks pass. Later-main merge previews were clean; those preview trees were not executed. Every GPU harness used the shared reservation and launch queue.
Evidence: raw logs, JUnit and source receipts; SHA-256
6a2fabb6619b69017f29fc3ce403661c6fb4fbd899869c6a82a6ed62920ab48d. Queue and cleanup receipts. Current overlap audit, including fetch failure. No new Windows, macOS, native-title or performance qualification is claimed. Earlier measurements retain their original source pins.AI-assisted: yes (Codex).
Current qualification — 2026-10-30
Integrated the one-line topic onto main
08a10d225306ad102b57408e2ef7566bcfb829b2atddffce84287cbf752b7e70e478a6be78029f9215. This includes the newer PipelineCache.cpp and ShaderResources.cpp paths identified by the review. The bind remains inside the draw callback immediately after pipeline binding; its topic range-diff is identical and current-main gitlinks are retained. Historical39fc186 results remain historical.Fresh matched Release builds with SPIRV-Tools enabled on AMD Radeon RX 6650 XT / RADV Mesa 26.2.4, Khronos validation layer 1.4.363: all four focused groups pass three times on both main and the change (12 per arm), no skips, VUIDs or compatibility warnings; nine actual layer insertions per arm. The grid-reference test executes three times per arm: both report zero color/depth differences. Its approximate control differs in 1544 samples. This validates the integrated path; it does not demonstrate a failing baseline or a performance gain on this GPU.
Conventions, whitespace, source/binary manifests and exact-head verification pass. The agreed order remains this PR first, then #9508's author refreshes its heap-aware bind into the same post-pipeline location. Current #9508 at
82f76ffastill needs that composition; its source was not changed. Whole GPU harnesses used the shared reservation/FIFO and service-owned PTYs; cleanup completed. No new Windows, native-title or FPS claim; earlier affected-GPU reports retain their pins.Evidence: immutable source and qualification receipts, SHA-256
26a1d57ff804acd2418467e4c1b7344d6d3e0bd0b8bd677be1416aa1d43c840b(download verified).Later-main driver qualification scope — 2026-10-30
The later current-main report tests public topic
ddffce84287cas private integration01ade978ac4a10beae136d4c7602412a5c7ebb8con main5ecef095b61e7a406b279c97896f3a8a6fbd6353. Only the one-line bind reorder differs between the paired trees. Four cases execute and pass on each arm, including the grid reference, with three actual validation-layer insertions per arm, zero skips and zero VUIDs. SPIRV-Tools is disabled on both arms: this qualifies the requested driver/grid comparison, with no shader-optimizer coverage or new Windows/device-loss/performance claim. The earlier08a SPIRV-Tools-enabled report remains separately pinned. Public source was not rewritten for this later private integration.AI-assisted: yes (Codex).
Additional Windows driver reports (2026-11-06)
AlfaRojo's RDNA 2 integrated-GPU report compares main
b611e634f7with headddffce8428merged aseeef87d41f: grid-reference fails on main and passes 3/3 with this PR. #14341 alone fails; the combination passes. These are independent Windows measurements without validation layers.irwanrivaldi's Radeon 860M (RDNA 3.5) report uses main
b11c7bf84fplus the same PR head, AMD driver32.0.32015.7029, without #14341 or validation layers. Main differs from the reference in 402 color and 2048 depth samples. With this PR, all depth samples match, but 42 color samples still differ in all three runs, so grid-reference still fails on that device. The other three sample-order tests pass. This does not establish a complete fix for #12277 or all AMD devices. The remaining color mismatch needs separate diagnosis on an affected driver; no new local reproduction is claimed.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)vkCmdBindDescriptorSetsline inSampleOrder.cpp; agreed order with @Raghav314: this PR first, then feat(agc): GPU descriptor heap on VK_EXT_descriptor_heap (APS5_GPU_HEAP) #9508 puts its wrapped call inside thedrawlambda aftervkCmdBindPipeline(author confirmation).