Repository navigation
test(agc): write the depth-rejection plane with a draw, not a CPU fill - #28297
Conversation
The 4_4_4_4 partial write test's depth-rejection case filled its D32
depth plane (swizzle mode 0) with 1.0 on the CPU. That relies on two
documented driver gaps: the driver keeps such a plane in its host image
only and does not read CPU writes to it ("Depth planes in guest memory",
"Depth surfaces created over storage writes"), and a depth surface
outlives the guest memory it mirrors ("Stale depth planes over reused
guest memory", which closes when surfaces are retired on allocation
changes). A first call passes because a new depth surface starts at
DB_DEPTH_CLEAR, which the test also sets to 1.0. A second call in one
process can get its depth block at the address the first call freed,
where the first call's surface is still resident with 0.5 on the
checkerboard pixels that survived, and its first draw is then rejected
there ("pixel (0, 0) holds 0xe743, expected 0x93c6").
The case now writes 1.0 with an always-passing, depth-writing draw at
z 1.0 before its draws, so its starting depth no longer depends on which
surface is resident, and reads the color block back after that draw, as
the test does before every other fill, so the CPU fill does not race
the draw's pending color results. The draw setup takes the depth compare
op for it. A depthSwizzle of 24 would move the case onto the
mirrored-plane path, which is not what it tests.
Tested with the validation layer on an RTX 4090 (Windows 11) and on
lavapipe: agc_driver_packed_unorm4444_partial_write passes on main and
with the change, and neither logs the driver's pending-results warning;
with the case called twice in one process it fails on main and passes
with the change. The depth, partial write, 4444, interlock, occlusion,
sample and stencil tests give every test the same result on main and
with the change. In the complete suite every test also has the same
result on both, apart from agc_driver_pm4_stall_prompt_lock, which
failed once with the change and passes 5 of 5 when run alone on both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NAAUzVZz5igZcosJFfZ3kV
|
No actionable comments were generated in the recent review. Walkthrough
Change: Other Merge Risk:
|
|
Windows at this head ( Setup:
The added test lines have no platform guard. AI-assisted: yes. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The change at head c105de86e060254b55fd13176021ad77e9bd2793 is limited to the depth rejection test and its initialization draw appears consistent with the intended test behavior.
What I ran
Read the prepared description, commit summary, manifest, diff, and the changed file ranges relevant to DrawSetup, ReadBack, and DepthRejection. No tests were run in this review. The description's test runs are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Patch review | passed | One test file changed |
| Tests run by reviewer | not run | Author-reported results only |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The remainder of the changed file and repository context outside the targeted ranges were not read. The author-reported Windows and Linux test runs were not independently verified. files.json was not available through the reader, so excluded-file status was not verified; the manifest lists one reviewed file, whose relevant ranges were read.
To get this to a good state
Nothing is required.
|
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.
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.
|
|
Tested
GPU: 4 GPU tests (AGC) passed twice on a GTX 1650 SUPER (Windows 11, Vulkan required, validation layer on, shader cache off), with this pull request merged into main AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
Plyxen
left a comment
There was a problem hiding this comment.
I read the diff at c105de86e0. Windows 11, GCC 15.2, merged into main at 6c6b29320fe together with other open PRs (so not an isolated build), with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 and VK_LAYER_KHRONOS_validation on an RTX 5080 (621.24) and a Radeon iGPU (26.11.2).
agc_driver_packed_unorm4444_partial_write: pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has aVUID-orSYNC-HAZARDline.- No control: it is a test change. The depth-rejected draws still run ("a depth-rejected merge" is in the summary line on both GPUs).
Not checked: the driver on which the CPU fill failed.
AI-assisted: yes (Claude Code)
ligmaSec
left a comment
There was a problem hiding this comment.
The changed packed-unorm fixture builds. It loaded validation layer 1.4.369 on both main and the patched tree, then skipped on both because lavapipe lacks fragmentShaderPixelInterlock. The paired GCN scalar-buffer control passed with Vulkan required and shader cache disabled. Neither log contains a missing-layer diagnostic or a VUID- entry. The draw-seeded depth rejection case still needs a device with pixel interlock.
AI-assisted: yes.
What
DepthRejectionintests/execution/PackedUnorm4444PartialWrite.cppcan fail when it runs twice in one process. The change is to the test only.Reproduction on
main: callDepthRejection(*device, block, layout, color);a second time inmain(). The second call can fail at its first draw (how often is under Tested):Cause: the case "clears" its depth plane by writing 1.0 into it with
memcpy, which relies on documented driver gaps indocs/dev/debt/libSceAgcDriver.md:DepthTargetkeeps the defaultdepthSwizzle0, and the driver resyncs a depth plane from guest memory only for single-sampleD32_SFLOAT/D32_SFLOAT_S8_UINTwith swizzle mode 24 (mirrorable()inDepthSurface.cpp). Any other plane stays in the host image only, and CPU writes to it are not read.A first call passes because a new depth surface starts at its clear depth, which the test also sets to 1.0. A second call can get its depth block at the address the first call freed, where the first call's surface is still resident with 0.5 on the checkerboard pixels that survived, so its first draw is rejected there.
Change: the case now writes 1.0 with an always-passing, depth-writing draw at z 1.0 before its draws, so its starting depth no longer depends on which surface is resident. The CPU fill is removed. The draw also writes the color block, so the case reads the block back after it, as the test does before every other CPU fill; without that read-back the fill races the draw's pending color results and the driver logs
guest memory changed while GPU results were pending; keeping the CPU's blocks.DrawSetupgains the depth compare op for the new draw, withLESSas before for every other draw. SettingdepthSwizzle24 instead would move the case onto the mirrored-plane path, which is not what it tests.What does not change: no driver code, no other test case and no test registration.
tools/pr_overlap.pystops at #7642 because it cannot fetch that pull request's head. A copy that skips the nine pull requests whose heads cannot be fetched (#7642, #9508, #10193, #13928, #13929, #14217, #14218, #24048 and #26766, none of which touches this file) finds no overlapping change. #17056, #23258, #23281 and #24049 touch this file but conflict withmain, so it could not compare them; none of them changesDepthRejectionorDrawSetup.Tested
Both platforms ran with
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layerandctest -V, onmain6f6f6c8e6band the change. Every log below shows the layer inserted, no "was not found" line, 0VUID-lines and 0SYNC-HAZARDlines.Windows 11, NVIDIA GeForce RTX 4090 (driver 621.24), validation layer 1.4.363:
agc_driver_packed_unorm4444_partial_write: 20 of 20 runs passed with the change and 20 of 20 on main, at most 1.45 s. Neither logsguest memory changed while GPU results were pending.DepthRejectioncalled twice in one process: on main 0 of 20 runs passed, all 20 with the message above; with the change 20 of 20 passed. ("Main" here is the change's build withPackedUnorm4444PartialWrite.cppput back to itsmaincontents, restored afterwards and its hash checked.)depth|partial_write|4444|interlock|occlusion|sample|stencil, 256 tests,-j 8: 252 passed and 4 were skipped, none failed, with the change and on main alike.-j 8 --timeout 300, 7467 tests (2379agc_): with the change 7428 passed, 2 failed and 37 were skipped (agc_: 2351, 1, 27); on main 7429 passed, 1 failed and 37 were skipped (agc_: 2352, 0, 27).windows_write_watchfailed on both ("cannot restore full resident run protection").agc_driver_pm4_stall_prompt_lockfailed only with the change ("a video output registration waited for the driver lock while the stall prompt was open"); run alone, it passed 5 of 5 times with the change and 5 of 5 on main (it opens no Vulkan device, so these logs have no layer lines), and its executable,agc_driver_pm4_tests, does not build fromPackedUnorm4444PartialWrite.cpp. The run with the change overlapped other work on this PC; the main run did not. Every other test has the same result on both. The 4444 test logs no pending-results warning in either run.tools/vulkan_validation_gate.pywithmain6f6f6c8e6bas baseline and the change as candidate, targetsagc_driver_packed_unorm4444_partial_write_testsandlibs,--tests '^agc_driver_packed_unorm4444_partial_write$' --gpu NVIDIA --repeat 20: status complete, exit code 0, no problems and no new diagnostics. All 20 iterations returned 0 on each side. The only message either side counts isUndefined-Value-ShaderOutputNotConsumed-DynamicRendering, 200 times in the baseline's 20 runs and 200 times in the change's. The test took 0.60 to 1.34 s per run on the baseline and 0.60 to 1.30 s with the change.main1f27e2abfabefore opening. The two commits since6f6f6c8e6bbring feat(agc): keep page digests instead of copies of sampled snapshots outside the write watch #28258, which touches neitherPackedUnorm4444PartialWrite.cpp,DepthSurface.cppnor the test registration. On1f27e2abfa:agc_driver_packed_unorm4444_partial_writepassed 20 of 20 runs;DepthRejectioncalled twice passed 20 of 20 with the change and 0 of 20 withmain's file, all 20 with the message above; the area set, now 257 tests, had 253 passed, 4 skipped and none failed. NoVUID-,SYNC-HAZARDor pending-results line.Linux, lavapipe (llvmpipe, Mesa 25.2.8, LLVM 20.1.2) in an Ubuntu 24.04 container, validation layer 1.4.335,
GALLIUM_OVERRIDE_CPU_CAPS=avx.userfaultfdfails withEPERMin this container, so there is no guest write watch and the tests that need it fail here onmainas well. "Main" is the same build withPackedUnorm4444PartialWrite.cppput back to itsmaincontents (restored afterwards and its hash checked):agc_driver_packed_unorm4444_partial_write: 20 of 20 runs passed with the change and 20 of 20 on main, at most 0.82 s. Neither logsguest memory changed while GPU results were pending.DepthRejectioncalled twice in one process: on main 10 of 20 runs passed and 10 failed with the message above; with the change 20 of 20 passed.depth|partial_write|4444|interlock|occlusion|sample|stencil, 250 tests,-j 6: 157 passed, 63 failed and 30 were skipped, with the change and on main alike; every test has the same result on both.-j 6 --timeout 120, 7352 tests (2329agc_): 6812 passed, 219 failed and 321 were skipped, with the change and on main alike (agc_: 1878, 209, 242); every test has the same result on both, and the 4444 test logs no pending-results warning in either.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
Summary by CodeRabbit