Repository navigation
fix(agc): import a native multisample D32S8 target without HTILE whose planes each hold one value - #14005
Conversation
…e planes each hold one value
|
Windows GPU run of head Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, Radeon RX 6700 XT with AMD proprietary driver 26.10.1 (Vulkan 1.4.315), WinLibs GCC 15.2.0 UCRT r7, Ninja, Release,
AI-assisted: yes (Claude Code). |
|
@hugodearaujo Reviewed at |
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (4, not counted against this PR)Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validated but not compared (1, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 428 tests)Skipped (50)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
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.
|
…ple D32S8 import The stencil plane of a native multisample D32S8 target imported from uniform planes can be sampled as an 8-bit uint at its own address: the sampled descriptor check accepts it, and the sample shadow copies the stencil aspect with the depth. --uniform-planes reads both planes back with a non-zero stencil in each fill, so a host stencil cleared to DB_STENCIL_CLEAR instead of the plane's byte fails.
|
@oneandonlydean Thanks, you're right: the stencil half of the import was never read back. Done in Reading the stencil plane needed a change outside the test as well.
Checks on RADV (RX 9070 XT), 2, 4 and 8 samples:
The six native depth tests ( AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
I reviewed head f7841c78d58b7ec1e6c498157b6e4238bb882fc5; the uniform-plane depth/stencil import, stencil sampling path, and focused regression coverage are consistent with the documented limits.
What I ran
The PR head was f7841c78d58b7ec1e6c498157b6e4238bb882fc5 and the base was 474030e58424fefdb65e5df9f3820810fbb4553c. The merge preview against that base was clean. Environment: Linux 6.1 x86_64, Python 3.11.2, Git 2.39.5; I did not configure, build, or compile AnyPS5.
python3 tools/pr_precheck.py --pr 14005 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-14005-precheck
git diff --check 474030e58424fefdb65e5df9f3820810fbb4553c...f7841c78d58b7ec1e6c498157b6e4238bb882fc5
python3 tools/pr_abi_audit.py --base 474030e58424fefdb65e5df9f3820810fbb4553c --head f7841c78d58b7ec1e6c498157b6e4238bb882fc5 --json
python3 tools/pr_test_quality.py --root /tmp/anyps5-14005-exact --json core/libs/prx/libSceAgcDriver/CMakeLists.txt core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp docs/dev/debt/libSceAgcDriver.md
python3 tools/pr_stack_check.py 14005 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-14005-stack-finalThe precheck and audit scripts are local review-workspace helpers, not files from this PR. The PR source used for the test-quality inspection was extracted from the exact head SHA.
Results
| Check | Result |
|---|---|
| Diff check | Passed. |
| Conventions and PR template | Passed. |
| Export ABI audit | Not applicable: no export declarations, definitions, or aliases changed. |
| Test registration heuristic | It emitted a possible-unregistered warning; inspection confirmed this test source is picked up by the tests/execution/*.cpp CMake glob, and the new --uniform-planes CTest entry is present. The warning is a heuristic false positive. |
| Base merge preview | Clean against 474030e58424fefdb65e5df9f3820810fbb4553c. |
| Author-reported GPU validation | The PR description reports RADV / RX 9070 XT validation runs: focused depth tests passed 5/5 on main at 73f4f7e06e4f210a8c6570e335fd654dc0a86134 and 6/6 on this PR head, with no new VUID- messages or missing validation-layer message. It also reports negative controls that fail when the stencil clear or shadow-copy changes are removed. I did not independently run these GPU tests. The current PR base is 474030e58424fefdb65e5df9f3820810fbb4553c; its merge preview is clean, but the author-reported baseline was not rerun at that newer base SHA. |
| Hosted CI | Windows workflow completed successfully with 2,524 selected tests passing. The native multisample depth tests were skipped: the workflow built ExecutionTestNotBuilt.cpp for that test target, and the full libs and CTest-selection steps were skipped. Linux and specialized jobs were skipped. |
Local check output
All conventions checks passed.
{
"status": "not_applicable",
"symbols": [],
"findings": [],
"limitations": [
"No changed APS5_VABI declaration/definition or APS5_EXPORT alias was recognized in the PR diff."
]
}
{
"findings": [
{
"path": "core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp",
"line": 1,
"kind": "possible-unregistered-cpp-test",
"message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
}
],
"negative_control_candidates": [],
"limits": [
"Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
"A test that passes against base is not by itself proof that the PR test is inadequate.",
"Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
]
}
The test-quality output above is the heuristic's unedited JSON; the CMake source glob and test declaration were checked manually at this head. git diff --check produced no output and exited successfully. The precheck's overall status was affected by its isolated archive lacking the local ABI and test-quality helper scripts; I reran those checks against the exact-head source as shown above.
Sources
- The import validates watched, non-overlapping planes and stable write generations before accepting uniform depth/stencil values: DepthSurface.cpp at the reviewed head.
- The multisample descriptor accepts the stencil plane at its own address, and the sample shadow copies the depth and stencil aspects: DepthSurface.cpp at the reviewed head, sample-shadow copy.
- The regression fetches depth and stencil for every sample, checks refused plane shapes, and is registered as a CTest case: NativeMultisampleDepth.cpp at the reviewed head, CMake registration.
- The repository requires same-machine, same-GPU validation-layer tests for AGC changes: CONTRIBUTING.md at the reviewed base.
Not verified
- I did not independently reproduce the author-reported RADV/GPU runs or negative controls.
- The Windows job did not execute the native multisample depth tests:
agc_driver_native_depth_uniform_planesand the existingagc_driver_native_multisample_depthwere skipped, and the productlibsbuild/full CTest steps were skipped. Linux and specialized CI jobs were skipped. - The same focused GPU comparison was not rerun against the current base SHA
474030e58424fefdb65e5df9f3820810fbb4553c; the PR reports its baseline at73f4f7e06e4f210a8c6570e335fd654dc0a86134. - Console behavior and equivalence of the inferred uniform-plane layout remain unmeasured, as the PR's debt note states.
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (2, not counted against this PR)Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validated but not compared (1, not in the main baseline's validation pass)Validation IDs already present on main (5 IDs in 428 tests)Skipped (50)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
✅ NVIDIA GPU test: passedPR head
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (4, not counted against this PR)Validated but not compared (1, not in the main baseline's validation pass)Validation IDs already present on main (5 IDs in 476 tests)Skipped (44)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Merged
RX 9070 XT, RADV, with the validation layer: the 14 AI-assisted: yes (Claude Code) |
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validated but not compared (1, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 517 tests)Skipped (45)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
✅ AMD GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (12, not counted against this PR)Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validated but not compared (1, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 513 tests)Skipped (54)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
What
A native multisample depth target is imported for sampling only when its HTILE proves the initial clear. A D32S8 target with a separate stencil plane and no HTILE at all is refused at creation, and the title stops at the first sample of its depth. Before #9533/#9717 the message was the first one below; on current
mainit is the second:Without HTILE the DB reads and writes both planes uncompressed, so their guest bytes are the initial contents. When every 32-bit word of the sample-aware depth plane (
MultisampledDepthBytes_nid_no_patch(extent, 4, samples)) is the same float in [0, 1] and every byte of the stencil plane (MultisampledDepthBytes_nid_no_patch(extent, 1, samples)) is the same value, every sample holds those values whatever the Z_X sample order. This PR imports such a target:prepareDepthSamplingsends a D32S8 target with a separate stencil plane and no HTILE toprepareUniformPlaneSampling. It keeps the Z_X / single slice / XOR / alignment checks of the HTILE path, syncs and flushes both plane ranges, takes their write generations, reads both planes (64 KiB at a time) and checks again that nothing wrote them meanwhile. The two plane ranges then play the part the depth and HTILE ranges play for an HTILE target: guards, the guest-write check at each sample, retirement.DB_DEPTH_CLEAR/DB_STENCIL_CLEAR.CheckResource: for a target without HTILE the sampled descriptor must name no metadata (dccAddress0); its pipe-aligned and ITERATE_256 bits are not compared, since they only describe metadata.maina4eca2a056, both come frommain's stencil model (feat(agc): sample the stencil plane of a native multisampled D32S8 target #9717):CheckResource's stencil identity, the stencil sample-count check inSampled, andsampleShadowStencil. This path uses them unchanged.main's HTILE path, the import is refused (attachment rendering kept) when a multisampled colour target covers either plane.Still refused, each with its own message: a depth plane with more than one word or a float outside [0, 1] (
native multisample depth plane without HTILE does not hold one depth value in [0, 1]), a stencil plane with more than one byte value, overlapping planes, HTILE stencil, and guest writes racing the import. D16/D32 without HTILE keep their refusal, and D32S8 with HTILE takesmain's path (#9533). Publication of a written surface is still not implemented.A new debt entry, next to the one for native multisampled depth sampling, says that the single-value rule is inferred from the layout, not measured on the console.
Why: Assassin's Creed Mirage (PPSA13960 01.007.000)
On
main+ #13963 (which contains #13248), in the first real-time scene after New Game (Basim in the dark), the title binds a 4x D32S8 1920x1080 target with a separate stencil plane and no HTILE, and a compute shader samples its depth. A diagnostic build (local only:main+ #13963 + logging, and a hack that let this target through) printed, when the 1920x1080 target was created and on its first draw:and, from an earlier run of the same scene, the refusal's target fields:
Both planes are all zero (depth 0.0, stencil 0), not
DB_DEPTH_CLEAR(1.0). The title's 960x540 4x D32S8 targets on the title screen hold several values (first=0x01010101 same=1778688of 2211840 words) and stay refused as before. Letting those through too (the hack, first version) stopped the title at 75 s on the title screen withsample-preserving guest publication of native multisample depth is not implemented, so a rule that took any plane would be a regression there.Same route in both builds (title, Menu Narration skipped, cursor to New Game, Assassin, Full Synchronization Off), one 1300 s run each,
main73f4f7e + #13963 37417ce as the base:compute shader 0x10b4c8ad00: AGC graphics: native multisample stencil or depth format import is not implementedcompute shader 0x10b4c89700: AGC graphics: sample-preserving guest publication of native multisample depth is not implementedWith the change the target is imported and the title moves to the next refusal in the same frame: an access over the planes after the host has drawn into them. That is the publication direction (host to guest), which this PR does not implement. #13021 publishes written D32S8 surfaces but is stacked on #9533 and #6300; #9950 publishes written D32 surfaces only (
target.format == VK_FORMAT_D32_SFLOAT), so a D32S8 surface keeps a refusal there. #9950 also takessampling.initial[1]as the HTILE range; for a target imported here that entry is the stencil plane, so a later extension of #9950 to D32S8 would have to tell the two apart.Tested
On the merge with
maina4eca2a056(d2399ff2cd), same machine, withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1(VK_LOADER_DEBUG=layershows the layer inserted): the 14agc_driver_native_depth_*,agc_driver_native_multisample_depthandagc_driver_cached_image_multisample_guardtests pass onmainand on the merge, andagc_driver_native_depth_uniform_planespasses on the merge (15/15), with noVUID-line. With the dispatch toprepareUniformPlaneSamplingremoved,--uniform-planesfails withnative multisample stencil import requires HTILE stencil metadata. Withmain's stencil clear value, it fails witha uniform stencil plane without HTILE was not imported into every sample: sample 0 holds 0, the plane 195. Without the no-HTILE branch inCheckResource, it fails withnative multisample depth sampled metadata or XOR mismatch. The results below are from the heads before that merge.Linux 7.2.11, RADV (Mesa 26.2.6), AMD Radeon RX 9070 XT, Release,
BUILD_TESTING=ON, onmain73f4f7e.agc_driver_native_depth_uniform_planes(agc_driver_native_multisample_depth_tests --uniform-planes), 2, 4 and 8 samples, 129x67 D32S8 with a separate stencil plane and no HTILE:R8_UINTview atstencilAddressreturns the plane's stencil byte;guest writes.main'sDepthSurface.cppfails with the title's message:refusal did not match does not hold one depth value: AGC graphics: native multisample stencil or depth format import is not implemented. Withthis->sampling.initialStencil.value_or(target.clearStencil)replaced bytarget.clearStencil(the host stencil starts atDB_STENCIL_CLEAR, 0), it fails witha uniform stencil plane without HTILE was not imported into every sample: sample 0 holds 0, the plane 195, and so it does whenrefreshSampleShadowcopies only the depth aspect. Withc9987271e3'sDepthSurface.cppthe stencil read fails withnative multisample depth sampled identity or format mismatch.agc_driver_native_multisample_depth,agc_driver_native_depth_retirement,_clears,_clear_refusals,_buffer_clearand 52agc_driver_(depth|native|sample_multisample|multisample)entries pass. Onf7841c78d5the 53 entries that regex selects pass under the validation layer, with noVUID-line.c9987271e3againstf7841c78d5, same machine and settings as below plusVK_LOADER_DEBUG=layer, on the six tests: 6/6 on each, the loader inserted the layer 17 times on each, noVUID-line and nowas not found but was requestedon either.ctest -V -R "native_(multisample_depth|depth)"withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1:main5/5, this change 6/6 (the five plus the new test). NoVUID-line and nowas not found but was requestedin either log. Before thecreateSampleShadowchange the new test raised 12VUID-VkImageMemoryBarrier-image-03320.tools/check_conventions.pypasses.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository