Repository navigation
fix(agc): publish and retire native depth owners under an initial multisampled colour import - #17956
Conversation
|
Windows GPU check of head Setup: Windows 11 Enterprise 22621, AMD Radeon RX 6700 XT (driver 32.0.21045.16010), WinLibs GCC 15.2 UCRT, Release, These five tests pass in 3 of 3 runs each, 15 of 15, none skipped:
All test and AI-assisted: yes. |
|
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.
|
|
Game-level data point on Windows from Asterix & Obelix Slap Them All! (PPSA08576). It stops on the native multisample depth publication Setup: RX 6700 XT, Windows 11 Enterprise 22621. Each run is a single 240 s boot through the shared FIFO, with scripted X presses. Only
With #17956, the window was still black at the 45 s screenshot, and the title bar read Limits:
Evidence is kept locally under AI-assisted: yes. |
|
Follow-up on my Asterix (PPSA08576) data point. I ran one more boot with a local diagnostic build of this PR: It logged exactly one line, then aborted with the same message at 13.4 s: What this shows:
Correction to my earlier comment: this run stopped at 13.4 s, close to the 13.9 s main baseline. So the 51.7 s from the earlier single #17956 run was most likely run-to-run variance, not progress. The diagnostic patch and logs are kept locally under AI-assisted: yes. |
|
@JJenkx Thanks for tracking it down to the call. As you found, that read is a texture read, which passes I think the 15 comes from the HTILE expansion, not from the guest:
The expansion should probably leave words of tiles outside the extent as the guest holds them. That belongs in its own fix on |
|
An NVIDIA run, since the PR has AMD and lavapipe results only: RTX 3070 (8 GB), driver 610.57.04, Debian 13, kernel 6.12.115, GCC 13.3.0 Release, validation layer 1.4.335,
AI-assisted: yes |
|
@JJenkx Thanks for the Windows run. I've added it to Tested. If you run it again, the other tests whose expectations this PR changes are the three |
|
@Doorriiaann Thanks for the NVIDIA run and the negative control. They match the RADV and lavapipe results: all nine modes pass at 2, 4 and 8 samples, and on #17915's head the same five tests fail with the same messages. I've added your run to Tested. |
|
#16363 and #16365 are merged, so I merged With the validation layer, the same command as before (73 tests): 71 pass, |
|
#16364 is merged, so I merged With the validation layer, the same command as before (74 tests): 72 pass, |
|
#15941 merged Against #15941's head, the merge changes only this PR's files, with the same lines as this PR's own commits, apart from that entry's wording. With the validation layer, the same command as before (75 tests): 73 pass, |
…fore publishing the depth owners under it The import published and retired every native depth owner under the colour footprint and only then checked that the footprint is mapped, so a footprint running into unmapped memory retired a kept owner and still refused. The mapping check now runs first; the new case covers a footprint whose tail past a kept owner is unmapped.
|
Merged #17915's head
@vojenfr thanks for the PPSA03706 run and the backtrace. They're in the description, and the title is in Unblocks. @malekaifa thanks for the PPSA09806 report; a run of this head would show whether it gets past that refusal there too. |
|
NVIDIA run of the new head b5e79ef: the two new native depth tests pass and nothing in the selection regresses. Setup: RTX 3070 8 GB, NVIDIA 610.57.04, Ryzen 5 5600X, Debian 13 (kernel 6.12.115), GCC 13.3.0 Release, validation layer 1.4.335. Base is the merge-base 6db6a3e, head is b5e79ef.
Every run selects the RTX 3070; every Vulkan test's log shows the layer inserted, none reports it missing, and no log has a AI-assisted: yes |
|
@Doorriiaann thanks for the RTX 3070 run of the new head. It's in the description under Runs by others. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head b5e79ef455f9f624df7bc385bac268a4c27354a5 using the pinned repo_read.py reader. I did not run build or test commands; this review environment provides read-only access.
Results
| Check | Result | Note |
|---|---|---|
| Changed-file review | passed | All seven changed files were read. |
| Build and tests | not run | Results in the PR description are author-reported. |
| Negative control | not run | The PR description reports base and mutation failures. |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not independently reproduce the reported tests, mutation checks, or console behavior. All seven changed files listed in the manifest were included and read; no changed files were listed as excluded. The review-folder listing did not provide files.json.
To get this to a good state
Nothing is required.
Superseabas
left a comment
There was a problem hiding this comment.
Windows check of head b5e79ef455 with GCC 16 on an NVIDIA and an AMD GPU, merged onto main 11f95ea8f6, which now includes #17915 (clean merge). The Windows runs listed so far are an RX 6700 XT on an older head; this adds NVIDIA on Windows and the current head.
Setup: Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (x86_64-ucrt-posix-seh, r3), Release full build, run from PowerShell with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. GPUs, each picked with ANYPS5_GPU: NVIDIA GeForce RTX 5070 Ti (621.01) and the Ryzen 7 7700X's integrated AMD Radeon (1002:164e, Adrenalin 26.10.2). This was built together with #21763, which touches other files.
^(agc_driver_native_depth.*|agc_driver_native_multisample.*|agc_driver_sample_multisample_target.*|agc_shader_memory.*)$:main35 of 35, and with this PR 36 of 36 in 3 of 3 runs, on both GPUs. The new one isagc_driver_native_depth_colour_import. The only skip, on both sides, isagc_driver_native_depth_driver_queued_fill, which skips on Windows by design. NoVUID-lines.- Red check: without the new
RequireNoResidentDepthRead_nid_no_patch(…, DepthReadCause::Attachment)call beforerequireUnowned,agc_driver_native_depth_colour_importfails on the Radeon with the title's stop,AGC graphics: initial multisample color contents overlap resident native depth.
The reordering reads right to me. Another colour owner still refuses first, and an unmapped footprint now refuses before any depth owner is published or retired. The publication runs where the targets lock isn't held.
AI-assisted: yes (Claude Code)
malekaifa
left a comment
There was a problem hiding this comment.
Reviewed exact head b5e79ef455f9f624df7bc385bac268a4c27354a5. The production change distinguishes attachment-driven depth publication from ordinary access/reuse, publishes and retires overlapping native depth before initial multisample colour capture, and checks the colour footprint is fully guest-mapped before publication. The added regressions cover another identity and colour-over-owner ordering. Exact-head Windows validation from Superseabas passed the focused depth selection on NVIDIA and AMD with validation enabled; MarcZX10 found no blocking source issue. I have not rerun the requested PPSA09806 title on this exact head, so that title-specific confirmation remains unverified rather than a blocker. AI-assisted: yes
|
@hugodearaujo Current head |
|
@malekaifa merged The lines in the other five files match On the RX 9070 XT with the validation layer, the focused depth set gives 89 tests, all passing except the 2 skips @Superseabas thanks for the Windows runs on both GPUs and for the red check. They're in the description. |
malekaifa
left a comment
There was a problem hiding this comment.
Re-reviewed exact head c3ac3b0f62842c19e3fcb6c8bb141b1d993a2869 after the current-main merge. git range-diff shows the two still-relevant branch commits (67cb2b1877a0, b5e79ef455f9) unchanged; the removed old commit is now upstream via #17915. The PR delta correspondingly shrank from seven files to five. The merge-resolved debt entry preserves the reviewed publication/retirement wording without the duplicate main entry, and git diff --check is clean. Hosted Windows/conventions/eligibility/report/portability/PR/labels checks are green, and the author reports the focused RX 9070 XT depth set at 89 tests with only the same two skips as main and 0 VUIDs. No new blocker found. AI-assisted: yes
What
Assassin's Creed Mirage (PPSA13960) binds new 4-sample colour targets over the memory of 4-sample D32S8 depth owners without HTILE that it drew and that were then published and kept. With #17915, the next stop at the end of the prologue cinematic is:
Why it stops. Before a multisampled colour target's first draw,
PrepareMultisampleTargetForDraw_nid_no_patchimports its initial contents from guest memory (#15986, #16086). Its preflightrequireUnownedrefuses when any active native depth guard overlaps the colour footprint. It doesn't publish or retire anything (#15986's non-mutating preflight). So a kept owner, published with no guest byte taken and kept by #15941, stops the import even though its samples are already in guest memory. A host-written owner stops it too.In our runs the colour footprint covered the owner's depth plane (a 1720x968 x4 B10G11R11 target over a 1720x968 x4 owner) or part of its stencil plane (a 960x540 x4 R16F target over a 960x540 x4 owner's stencil plane).
The change (
MultisampleTarget.cpp, the start of the import):initial multisample color contents overlap another native owner) runs first, on its own. If another colour target owns the bytes, the import still refuses there, before any depth owner is touched.initial multisample color contents are not fully mapped), moved up from after the publication. A footprint that runs into unmapped memory refuses before any depth owner is published or retired.RequireNoResidentDepthRead_nid_no_patch(target.address, bytes, std::nullopt, true, DepthReadCause::Attachment)runs over the colour footprint. That publishes every host-written depth owner under the footprint and, since the cause isAttachment(fix(agc): retire a published native depth owner when a depth target of another identity binds its planes #17915), retires every owner over it once it's published, kept or not. One call covers all of an owner's planes: each plane, HTILE included, has its own guard with the owner's shared state, and the footprint is tested against all of them.requireUnownedthen runs as before, at the same three points.Why here, and why it's legal. The publication refuses while a multisampled colour target is being acquired (
HoldsMultisampleTargetsLock()). At this point the targets lock isn't held: the import takes it only in a scoped block before, and again after the capture. The draw path (Draw.cpp) calls the import without it too. The publication takes the GPU mutex, which is recursive and already held by the draw, and the surface and depth guard locks, in the same order as the depth attachment's reads. No colour guard lock is held across it.Why
Attachmentand notReuse.Reuseretires only an owner whose publication took a guest byte, so a kept owner, the title's case, would stay active and the import would still stop. A colour target is a new owner of the same bytes, which is whatAttachmentmeans in #17915; two active owners of the same bytes can't coexist. For undecided bytes, both causes take the guest's byte, which #15941's debt entry already lists for "colour target" reuse.What the import then reads. Its capture runs after the publication, through the read guard and
FlushGpuWrites. So it holds the published samples, or the bytes a kept owner already published, or the results of storage writes still pending over a kept owner's plane. On the console the colour target reads whatever bytes are there; that this matches is inferred, not measured on a PS5.What still refuses. Everything that refuses inside the publication, before the retirement: a written owner the publication can't handle (D16/D32-only, an unapplied clear, a sampling refusal), pending storage writes over a written owner's plane, and a resident colour alias over a plane. The owner then stays resident and no colour target is created. Publication inside a GPU completion, or with the targets lock held, can't be reached from this point.
Other effects.
hostEverWritten=0) was already retired by any guest read (fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941). Now the colour import retires it too, instead of refusing.DepthSurfaceHoldsstops serving it, and the owner is released at the next depth creation once the view is dropped.... overlap another native ownerinstead of... overlap resident native depth.Two existing expectations change accordingly:
--aliased-depthNewTargetAfterImport(AGC: four native multisample depth tests fail on main since #6973 #15964/feat(agc): preserve uniform initial multisample draw contents #15986) now expects that message. It still requires the depth owner to stay resident.--initial-uniform_refusals(feat(agc): preserve uniform initial multisample draw contents #15986) used a never-written D32 owner, which the import now retires. The case now marks the owner written, so the publication can't handle it, and expects that refusal with the owner resident and its view unchanged. It stays a non-mutating refusal.The debt entries for the initial colour contents and for D32S8 guest publication say this.
Tested
Linux 7.2.14, AMD Radeon RX 9070 XT, RADV (Mesa 26.2.6), Release with tests; and lavapipe (LLVM 23.1.4) for the new and changed tests.
New test,
agc_driver_native_depth_colour_import(--colour-over-owner), at 2, 4 and 8 samples:The fixture. A D32S8 owner without HTILE (120x68) is imported over uniform planes and drawn (per-sample depth, stencil 0x40 + sample). Then an R32F colour target (R8 over the stencil plane) of the same extent, samples and XOR is prepared for its first draw.
What each passing mode checks:
The modes:
DepthSurfaceHoldsrefuses it, and the view still holds the owner's samples;native multisample depth publication over pending storage image writes is not implemented;initial multisample color contents overlap another native owner, and the depth owner is untouched;sample-preserving guest publication of native multisample depth is not implemented for this owner;initial multisample color contents are not fully mapped.In 6-9 the owner stays resident, guest memory is unchanged and no colour target is created.
The harness. This mode creates the test's device the way
main's sample-import modes do, withshaderStorageImageMultisampleandshaderStorageImageWriteWithoutFormat, which the non-uniform upload needs (feat(agc): upload nonuniform initial multisample draw contents #16086). The mode skips without them, as in test(agc): skip the multisample target checks without formatless multisampled storage writes #17152.Red on the base without the change (#17915's head + the tests only), each mode on its own (a local harness, not in this PR), on lavapipe, where every mode fails at its first sample count (4):
AGC graphics: initial multisample color contents overlap resident native depth. Modes 6-8 fail because the base refuses with that message instead of the one the mode expects, for examplemultisample target refusal did not match initial multisample color contents overlap another native owner: AGC graphics: initial multisample color contents overlap resident native depth;--aliased-depth depth-only|stencil|no-stencilon the same mismatch, and--initial-uniform_refusalswithinitial color capture did not refuse a resident depth owner it cannot publish;Green with it. Lavapipe: the new test (18 cases), the four
--aliased-depth/--aliased-stenciltests and the sevennative_color_initialtests pass, 12 of 12. RADV: below.Mutations (lavapipe):
Reuseinstead ofAttachment: modes 0, 1, 2, 4 and 5 fail withAGC graphics: initial multisample color contents overlap resident native depth. Mode 3 passes through the existing never-written rule, and 6-8 pass.a colour import refused over another colour owner retired the depth owner.a colour import refused over an unmapped tail retired the kept depth owner or imported; modes 0-8 pass.Validation layer, paired, same machine (
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1,ctest -V -R "native_color_initial|native_depth|native_multisample|depth_storage|depth_surface|agc_storage_|multisample_guest|repeat_storage_guard|cached_image|storage_flush_ordering|storage_one_slice|storage_read_during|storage_write_back|msaa_address_on_plane"):agc_storage_pending_key_refresh,agc_storage_clear_hand_over). The new test is the 73rd and ran 27 cases (9 modes at 2, 4 and 8 samples).VUID-line or "was not found but was requested".Conventions.
tools/check_conventions.py --base e7c3bfd130passes on both (exit 0).Runs by others.
c2f6018794merged ontomain5c26d4f, a clean merge. Windows 11 Enterprise 22621, AMD Radeon RX 6700 XT (driver 32.0.21045.16010), WinLibs GCC 15.2 UCRT, Release.agc_driver_native_multisample_depth,agc_driver_sample_multisample_target,agc_driver_native_depth_other_identity,agc_driver_native_depth_overwritten_planesandagc_driver_native_depth_colour_importpass 3 of 3 each, none skipped.ctest -V -Rpattern above, 3 runs on each side.maindf5829d (the merge base): 70 tests, all pass 3 of 3.c2f6018794: 73 tests, all pass 3 of 3. That includesagc_driver_native_depth_colour_import(all nine modes at 2, 4 and 8 samples, 27 cases), the fouraliasedtests and the sevennative_color_initialtests.VUID-line, and the layer was found.NativeMultisampleDepth.cpp,SampleMultisampleTarget.cppand test CMake file on2b61bc285e(fix(agc): retire a published native depth owner when a depth target of another identity binds its planes #17915's head, without the change), 2 runs. The same five tests fail with the same messages as above:agc_driver_native_depth_colour_import, the three--aliased-depthtests andagc_driver_native_color_initial_uniform_refusals.agc_driver_native_depth_aliased_stenciland the other sixnative_color_initialtests pass there.839a783bf7, after the merges of fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941 andmain(comment), 3 runs on each side:main3339e01 has 74 tests and this PR 76 (with fix(agc): retire a published native depth owner when a depth target of another identity binds its planes #17915'sagc_driver_native_depth_other_identity), all pass 3 of 3. NoVUID-line. Negative control on fix(agc): retire a published native depth owner when a depth target of another identity binds its planes #17915's head0f80c9148bwith this PR's test files: the same five tests fail 3 of 3 with the same messages, andaliased_stenciland the other sixnative_color_initialtests pass.839a783bf7, Linux, AMD Radeon RX 9070 XT (RADV, Mesa 26.2.5), GCC 16.2.1, Release, validation layer 1.4.363,ctest -R agc_driver. 1121 of 1122 pass; the one failure,agc_driver_tessellation(a segfault), is one they report on unmodifiedmaintoo. NoVUID-line, andcheck_conventionspasses.b5e79ef455against its merge basemain6db6a3e, 3 runs each,ctest -R '(native_color_initial|native_depth|native_multisample|depth_storage|depth_surface|^agc_storage_|sample_multisample_target)'.agc_driver_native_depth_colour_importandagc_driver_native_depth_other_identitypass 3 of 3, and the other 73 matching tests pass 219 of 219 on both sides. Every run selects the RTX 3070, the layer is inserted in every Vulkan test's log, and no log has aVUID-line.main1bdf1d5e46with this PR at839a783bf7merged locally.mainstops after about 90 s, at the first scene change after the intro, onnative multisample depth publication cannot distinguish an unwritten byte from a same-value guest store, andmain+ fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941 alone stops at the same place (89 s). With this PR the title ran through at least four more scene changes, 179 s and 5,233 frames, to a clean exit.b5e79ef455merged ontomain11f95ea8f6(with fix(agc): retire a published native depth owner when a depth target of another identity binds its planes #17915), Windows 11 Home, WinLibs GCC 16.2.0, Release, validation layer, RTX 5070 Ti (621.01) and a Ryzen 7 7700X's integrated Radeon (Adrenalin 26.10.2).^(agc_driver_native_depth.*|agc_driver_native_multisample.*|agc_driver_sample_multisample_target.*|agc_shader_memory.*)$:main35 of 35, this PR 36 of 36 in 3 of 3 runs on both GPUs; the only skip isagc_driver_native_depth_driver_queued_fillon both sides; noVUID-line. Without theAttachmentread beforerequireUnowned,agc_driver_native_depth_colour_importfails on the Radeon with the title's stop.On current
main. #17915 is merged, so the diff againstmainis now this change alone:MultisampleTarget.cpp,NativeMultisampleDepth.cpp,SampleMultisampleTarget.cpp, the test CMake file and the debt doc.DepthSurface.hppandDepthSurface.cppcome frommainunchanged. The head,c3ac3b0f62, mergesmainbfcd717 intob5e79ef455. The code and test lines are the same as inb5e79ef455's own diff over #17915. Git merged the debt doc without a conflict but kept two copies of the D32S8 publication entry,main's (#21719) and this change's. The merge keeps one, whose sentence now reads "Only a reuse taking a guest byte, a new depth or multisampled colour target or a guest write retires the owner." It builds, and the validation command withagc_storage_write_back_scratchleft out gives 89 tests: 87 pass and the same 2 skip. Onmainbfcd717 the same command gives 88 tests: 86 pass and the same 2 skip. Neither log has aVUID-line or "was not found but was requested".check_conventionspasses, with thedebt-lengthwarning that entry already has onmain.The title. Assassin's Creed Mirage (PPSA13960): title, New Game, Assassin, Full Synchronization Off, 720 s per run, interleaved, 5 runs per side.
The tree.
maine7c3bfd + fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941 + fix(agc): import a native multisample D32S8 target over uneven planes once its first draw wrote every sample #16363 + fix(agc): retire a published native depth owner when a depth target of another identity binds its planes #17915's commit + fix(agc): store storage results pending under a multisampled color target before it takes the memory #13963 + fix(agc): publish native multisample depth next to a storage image whose pending units lie past its planes #16364 + fix(agc): leave a single-sample view over a published native multisample depth owner to guest memory #16365 + fix(agc): start a new native multisample depth owner when an overwriting draw binds a published owner under pending storage units #17890, with logging that prints where this change retires an owner.A local experiment on both sides. It's identical on both sides and isn't part of any PR. A guest access over a host-only multisampled colour target retires the target instead of refusing. Without it, those refusals (fix(agc): store storage results pending under a multisampled color target before it takes the memory #13963/fix(agc): claim a multisampled color target that a single-sample storage image store overlaps #13248's territory) stop the title before this point, as in fix(agc): retire a published native depth owner when a depth target of another identity binds its planes #17915's runs.
Base: 4 of 5 runs stop on the message.
The fifth run took a slow loading path and didn't reach the point.
With this change: 5 of 5 run to the 720 s close with no exception. The change retired a kept owner (
hostWritten=0,hostEverWritten=1) 5 times, in 3 runs. That includes the same 1720x968 x4 depth-plane case (twice) and the stencil-plane case (twice). The other two runs took the slow loading path.Limit. Around this point the title nearly stops presenting, about 0.05 frames per second, and its frames turn to garbage, then black.
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)initial multisample color contents overlap resident native depthat the end of the prologue cinematic (with a local experiment for the other colour refusals; the picture after it is not yet right); PPSA03706, by vojenfr, past its first scene change after the intro (fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941 alone stops there)