Repository navigation
fix(agc): store a multi-mip DCC image whole only while another live image overlaps it - #8707
Conversation
|
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.
|
f26593d to
e614e9c
Compare
|
Run on AMD hardware. Host: Arch Linux, kernel 7.2.11, AMD Radeon RX 7900 GRE (RADV NAVI31), Mesa 26.2.5, GCC 16.2.1, Release,
|
e614e9c to
9fed3ab
Compare
|
@LeoFeitosa thanks, the single
Also a heads-up: #6202, #6718 and #6820 each add a new |
9fed3ab to
0b5b196
Compare
|
@oneandonlydean thanks, both done in 0b5b196:
Neither change touches behaviour (a moved definition and a docs line); |
|
@LeoFeitosa thanks, both look right. A delta review of |
…stores FlushPending waited for the newest unfinished batch that writes anywhere in the flushed range (boykopovar#6364), but its write-backs store only the pending layers the range overlaps, or every pending layer when the image stores whole (DCC keys not uncompressed) or may widen a partial store. A writer elsewhere in the range cannot be overwritten by those stores, yet each such wait submitted the open batch or finished the in-flight ones under the GPU mutex. The flush now asks for writers over the 64 KiB blocks of the layers it stores, the granularity of the write-back's own unit publishes; an image with many separate pending runs is checked over their hull. For an image that stores whole, that includes its pending layers outside the range, which the range check left out. A DCC image with more than one mip is checked over all of its pending layers too: more than today's write-back stores for it, so the check stays sufficient if the write-back stores such an image whole, as boykopovar#8707 proposes. When the flush publishes unit shadows, an address-based dispatch's heap lease over the range is still waited for: such a dispatch stamps its pages only at completion, so the publish could not tell its writes from fresh shadow units otherwise. APS5_FLUSH_WAIT_WHOLE_RANGE=1 checks the whole range as before. The storage flush ordering test gains two cases, each with a GPU fill noted in the open batch: a fill inside the flushed range but past the image's pending layer, which the flush no longer submits or waits for while both the image's texel and the fill land; and a fill inside the pending layer, which it still waits for, so that the fill's block keeps its bytes and a texel in another block is stored. A recorder test pins the DCC clause: a three-mip image with uncompressed keys, flushed over its first unit, completes the batch of a writer over its last pending unit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I tried this PR on SILENT HILL: The Short Message (PPSA10112), the title #7579 was reverted for in #8265, and it stalls again here. Setup: Windows 11 (build 26200), RTX 5090, driver 617.42, game version 01.000.001, Without the PR (120 s): a steady 138 to 221 presents per 10 s (p50 44.7 to 56.8 ms), no GPU timeouts. With the PR, two runs from the same build:
So it is repeatable here, and the frame rate does not degrade slowly: it stops presenting after 30 to 60 s. The PR's own test passes on this build: AI-assisted: yes. Written with AI assistance and reviewed by me. |
|
@klosixgaming-arch thanks, that is a clear regression, and the same title #7579 was reverted for. I'm converting this PR to draft until it is understood. What this PR changes is which pending units a write-back stores: for a DCC storage image with more than one mip, every pending 64 KiB unit is stored at each write-back, instead of only the units the access touches ( Yes, a trace would help. One run with the PR, from start-up until it stops presenting, with:
If it is one image (or a few) stored whole over and over, the rule can be narrowed to the RoboCop case: an image whose memory another live surface also uses, which is what the description says about the menu background. I'd send that as a revised head for you to try, and re-run the RoboCop menu check on it here. |
|
@LeoFeitosa I'm holding this PR until we understand the stall reported above (#8707 (comment)). On PPSA10112 (Windows, RTX 5090, driver 617.42) the title presents normally at its menu without this PR. With the PR it stops presenting after 30 to 60 s, in both runs, and the log shows This is also the title #7579 was reverted for in #8265. Since this PR stores every pending unit of a multi-mip DCC storage image, I'd like to rule out the same mechanism before it merges. Could you look at this?
@klosixgaming-arch thank you for the careful A/B. One small thing would help: could you confirm that |
…stores FlushPending waited for the newest unfinished batch that writes anywhere in the flushed range (boykopovar#6364), but its write-backs store only the pending layers the range overlaps, or every pending layer when the image stores whole (DCC keys not uncompressed) or may widen a partial store. A writer elsewhere in the range cannot be overwritten by those stores, yet each such wait submitted the open batch or finished the in-flight ones under the GPU mutex. The flush now asks for writers over the 64 KiB blocks of the layers it stores, the granularity of the write-back's own unit publishes; an image with many separate pending runs is checked over their hull. For an image that stores whole, that includes its pending layers outside the range, which the range check left out. A DCC image with more than one mip is checked over all of its pending layers too: more than today's write-back stores for it, so the check stays sufficient if the write-back stores such an image whole, as boykopovar#8707 proposes. When the flush publishes unit shadows, an address-based dispatch's heap lease over the range is still waited for: such a dispatch stamps its pages only at completion, so the publish could not tell its writes from fresh shadow units otherwise. APS5_FLUSH_WAIT_WHOLE_RANGE=1 checks the whole range as before. The storage flush ordering test gains two cases, each with a GPU fill noted in the open batch: a fill inside the flushed range but past the image's pending layer, which the flush no longer submits or waits for while both the image's texel and the fill land; and a fill inside the pending layer, which it still waits for, so that the fill's block keeps its bytes and a texel in another block is stored. A recorder test pins the DCC clause: a three-mip image with uncompressed keys, flushed over its first unit, completes the batch of a writer over its last pending unit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 017123e)
…stores FlushPending waited for the newest unfinished batch that writes anywhere in the flushed range (boykopovar#6364), but its write-backs store only the pending layers the range overlaps, or every pending layer when the image stores whole (DCC keys not uncompressed) or may widen a partial store. A writer elsewhere in the range cannot be overwritten by those stores, yet each such wait submitted the open batch or finished the in-flight ones under the GPU mutex. The flush now asks for writers over the 64 KiB blocks of the layers it stores, the granularity of the write-back's own unit publishes; an image with many separate pending runs is checked over their hull. For an image that stores whole, that includes its pending layers outside the range, which the range check left out. A DCC image with more than one mip is checked over all of its pending layers too: more than today's write-back stores for it, so the check stays sufficient if the write-back stores such an image whole, as boykopovar#8707 proposes. When the flush publishes unit shadows, an address-based dispatch's heap lease over the range is still waited for: such a dispatch stamps its pages only at completion, so the publish could not tell its writes from fresh shadow units otherwise. APS5_FLUSH_WAIT_WHOLE_RANGE=1 checks the whole range as before. The storage flush ordering test gains two cases, each with a GPU fill noted in the open batch: a fill inside the flushed range but past the image's pending layer, which the flush no longer submits or waits for while both the image's texel and the fill land; and a fill inside the pending layer, which it still waits for, so that the fill's block keeps its bytes and a texel in another block is stored. A recorder test pins the DCC clause: a three-mip image with uncompressed keys, flushed over its first unit, completes the batch of a writer over its last pending unit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0b5b196 to
ac2bc11
Compare
|
@oneandonlydean @klosixgaming-arch I pushed a narrower rule as a new head, rebased on Rule: a multi-mip DCC storage image with uncompressed keys is stored whole only while another live storage image overlaps its memory, which is the RoboCop menu background case from the description. Every other multi-mip DCC image goes back to On the questions:
Tested (Windows 11 build 26200, RTX 5070 Ti, driver 617.42, WinLibs GCC 15.2.0, Release):
Not yet run on this head: the RoboCop menu check and the wider |
…stores FlushPending waited for the newest unfinished batch that writes anywhere in the flushed range (boykopovar#6364), but its write-backs store only the pending layers the range overlaps, or every pending layer when the image stores whole (DCC keys not uncompressed) or may widen a partial store. A writer elsewhere in the range cannot be overwritten by those stores, yet each such wait submitted the open batch or finished the in-flight ones under the GPU mutex. The flush now asks for writers over the 64 KiB blocks of the layers it stores, the granularity of the write-back's own unit publishes; an image with many separate pending runs is checked over their hull. For an image that stores whole, that includes its pending layers outside the range, which the range check left out. A DCC image with more than one mip is checked over all of its pending layers too: more than today's write-back stores for it, so the check stays sufficient if the write-back stores such an image whole, as boykopovar#8707 proposes. When the flush publishes unit shadows, an address-based dispatch's heap lease over the range is still waited for: such a dispatch stamps its pages only at completion, so the publish could not tell its writes from fresh shadow units otherwise. APS5_FLUSH_WAIT_WHOLE_RANGE=1 checks the whole range as before. The storage flush ordering test gains two cases, each with a GPU fill noted in the open batch: a fill inside the flushed range but past the image's pending layer, which the flush no longer submits or waits for while both the image's texel and the fill land; and a fill inside the pending layer, which it still waits for, so that the fill's block keeps its bytes and a texel in another block is stored. A recorder test pins the DCC clause: a three-mip image with uncompressed keys, flushed over its first unit, completes the batch of a writer over its last pending unit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The RoboCop menu check on the new head ac2bc11 is done. The narrower rule keeps the menu fix. Setup: RoboCop: Rogue City - Unfinished Business (PPSA28329), Windows 11 (build 26200), RTX 5070 Ti, driver 617.42. The exe and the title's
There was no Not run yet on this head: the wider |
|
The wider set on ac2bc11 finished too:
That leaves PPSA10112 as the only open check for this head. |
|
Hi One thing got lost in the rebase to Small one in the description: it lists five call sites; with main's |
|
@oneandonlydean you're right, and thanks for catching it. My approval at |
ff8b1a9 to
8cb5915
Compare
|
@oneandonlydean thanks, you're right. 8cb5915 puts the debt entry back in |
✅ 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 (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 (13 IDs in 548 tests)Skipped (49)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 (8, not counted against this PR)Validated but not compared (1, not in the main baseline's validation pass)Validation IDs already present on main (8 IDs in 549 tests)Skipped (60)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. |
# Conflicts: # docs/dev/debt/libSceAgcDriver.md
✅ 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 (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 (9 IDs in 550 tests)Skipped (55)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. |
BunnyFl
left a comment
There was a problem hiding this comment.
@LeoFeitosa re-checked at 02a5bfcceb. Against ff8b1a9219, the head I approved, the only change to your commit is the debt entry, back in docs/dev/debt/libSceAgcDriver.md; the rest is a merge of main.
On 02a5bfcceb merged onto main 78e4248fea (Windows 11, WinLibs GCC 15.2.0, Release, AMD Radeon RX 9070 XT, driver 32.0.32015.12012), ctest -V with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and your regex agc_storage|agc_tiled|repack|dcc|^agc_driver_graphics$|pending_after_unwatch|texture_format|clear_keys|hand:
- 60 tests: 57 pass and the three
agc_driver_msaa_dcc_compared_import_*skip ("Linux comparison mode only"); - with
main'sTexture.cppandTexture.hpp, onlyagc_storage_dcc_mip_writebackfails ("the write-back stored 16384 of 344064 texels"), as before; - no missing-layer line and no
VUID-orSYNC-HAZARDmessage on either side.
check_conventions.py passes. pr_overlap.py --branch finds no shared exports; #6926 shares lines in docs/dev/debt/libSceAgcDriver.md, and 72 PRs that conflict with main couldn't be compared.
Approving again at 02a5bfcceb.
AI-assisted: yes (Claude Code)
|
Windows and NVIDIA run, for head 02a5bfc merged with
No regressions on this GPU. AI-assisted: yes. |
|
Test runs for head Linux: Ubuntu 26.04.1, RTX 4070 Ti, NVIDIA 615.71.09, GCC 15.2, Release.
Windows: Windows 11 VM, GeForce GT 1030 (Pascal), NVIDIA 582.78, WinLibs GCC 15.2 UCRT, Release.
Every test I ran passes on this head, apart from any skips listed. AI-assisted: yes (Claude Code) Re-run on head Test runs for head Linux: Ubuntu 26.04.1, RTX 4070 Ti, NVIDIA 615.71.09, GCC 15.2, Release.
Windows: Windows 11 VM, GeForce GT 1030 (Pascal), NVIDIA 582.78, WinLibs GCC 15.2 UCRT, Release.
Failing on this head: AI-assisted: yes (Claude Code) |
|
Ran this PR merged onto
Failures
|
…stores FlushPending waited for the newest unfinished batch that writes anywhere in the flushed range (boykopovar#6364), but its write-backs store only the pending layers the range overlaps, or every pending layer when the image stores whole (DCC keys not uncompressed) or may widen a partial store. A writer elsewhere in the range cannot be overwritten by those stores, yet each such wait submitted the open batch or finished the in-flight ones under the GPU mutex. The flush now asks for writers over the 64 KiB blocks of the layers it stores, the granularity of the write-back's own unit publishes; an image with many separate pending runs is checked over their hull. For an image that stores whole, that includes its pending layers outside the range, which the range check left out. A DCC image with more than one mip is checked over all of its pending layers too: more than today's write-back stores for it, so the check stays sufficient if the write-back stores such an image whole, as boykopovar#8707 proposes. When the flush publishes unit shadows, an address-based dispatch's heap lease over the range is still waited for: such a dispatch stamps its pages only at completion, so the publish could not tell its writes from fresh shadow units otherwise. APS5_FLUSH_WAIT_WHOLE_RANGE=1 checks the whole range as before. The storage flush ordering test gains two cases, each with a GPU fill noted in the open batch: a fill inside the flushed range but past the image's pending layer, which the flush no longer submits or waits for while both the image's texel and the fill land; and a fill inside the pending layer, which it still waits for, so that the fill's block keeps its bytes and a texel in another block is stored. A recorder test pins the DCC clause: a three-mip image with uncompressed keys, flushed over its first unit, completes the batch of a writer over its last pending unit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 017123e)
What
A storage image with DCC metadata and more than one mip now stores every pending 64 KiB block unit at each write-back while another live storage image overlaps its memory, as an image under a clear code already does, instead of only the units the access touches. Without an overlapping image it keeps
main's selection: applied to every multi-mip DCC image, the first head stopped PPSA10112 presenting after 30 to 60 s (see the comments). The rule is one private method,StorageTexture::storesWhole(), used by the seven places that computed it:writeBack,pendingUnitInside(the flush pretest),evictStale,skippedResultsInside,clearHandOver(#7427),noteLayersBehindandPrepareCreation. The others carry the comment "writeBack's selection for the access", so they follow the same selection.This is the RoboCop menu fix in the block path, replacing #7579, which tracked these images as one unit and was reverted in #8265 because it stopped SILENT HILL: The Short Message (PPSA10112).
In RoboCop: Rogue City - Unfinished Business (PPSA28329) the main menu background is a 1920x1080, six-mip DCC storage image with uncompressed keys whose memory other surfaces of the frame also use. Stored unit by unit, a local trace shows its last 59 units stored only by a late access each frame, and the menu shows bokeh lights and stale purple tiles instead of the RoboCop artwork. Which reader takes those bytes before they are stored is not identified; the debt entry says so.
New test
agc_storage_dcc_mip_writeback(agc_driver_recorder_tests --dcc-mip-writeback-only): a 512x512, three-mipR_Ximage, cleared and pending, flushed through an access to its first 64 KiB. With DCC keys uncompressed and a live one-mip image over the same memory every texel of every mip must reach memory; with DCC keys uncompressed alone, and without DCC, only the accessed unit's texels must. Each case flushes the rest before it ends.Tested
Windows 11 (build 26200), NVIDIA GeForce RTX 5070 Ti, driver 617.42, WinLibs GCC 15.2.0 r7, Release. #8310 applied locally (not part of this PR) so the test targets build with WinLibs.
anyps5.logof each run kept:main559f35d wrong 3 of 3, this change on 559f35d right 3 of 3, no fatal error in any run. The same on bcf29de before the rebase. One local build with only thewriteBackrule behind a switch: wrong with it off, right with it on (one run each).ctest -R "agc|storage|texture|tiling|dcc" -j8onmain559f35d and on this change on it: 859/860 and 859/861 passed. The failures areagc_shader_disk_cache_large_fileon both ("cannot remove the large file test directory", a Windows file lock) andagc_driver_lookup_log_fits_buildon this change; both pass when run again alone on both builds.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest -R 'agc_storage|agc_tiled|repack|dcc|^agc_driver_graphics$|pending_after_unwatch|texture_format|clear_keys|hand' -V -j1, LunarG layer 1.4.363:main31/31, this change 32/32 (the 31 plus the new test), 0VUID-in both logs, no "was not found but was requested by env var VK_INSTANCE_LAYERS" line.VUID-).writeBackrule only) againstmaine9a5a0c, 3 runs each: theoutside the write watch without the guest bytes savedstop did not come back (0 of 3) (report). This version also changes the three other selections; a run of it there would be welcome.python tools/check_conventions.py --base origin/main: passes.Known risk: storing every pending unit at once widens the span
writeBackLayerschecks withChangedBlocks. A span that reaches a block outside the write watch makes every stored unit need its saved bytes, which is the refusal #8265 removed. #7048 and #7604 (APS5_TRACE_WATCH=unsaved) are the ways to look at it if it shows up.Overlap: #6202 and #6718 add new copies of the old
dccAddress != 0 && uploadedKeys != DccKeys::Uncompressedtest; whichever lands after this one would readstoresWhole()instead.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)