Repository navigation
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.
|
41751ea to
bb1d46d
Compare
…eir memory Pending storage-image results are stored when something reads their memory or when the queue goes idle. An unmap left them pending, and the idle store only dropped them if the range was still unregistered when it ran. A title that maps new memory over the same addresses first (Unity's allocator does) got the stale results written into its new data. The unmap observer now drops the results pending in images inside the unmapped range (DiscardPendingInside), and is installed once a storage image exists. Heavenly Bodies (PPSA04246) on Windows crashed in 6 of 15 traced runs with heap corruption at its first mission load; with this change 0 of 15, and the stale write-backs into earlier unmapped ranges went from 28-87 per run to none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bb1d46d to
4709383
Compare
|
NVIDIA, Windows. GeForce RTX 4080 SUPER, driver 616.92 (32.0.16.1692), Windows 11 Pro 26200, Ryzen 9 7950X3D, WinLibs GCC 15.2.0 r7, Release. This PR 4709383 merged into
With this PR the idle store test did not print Not run with AI-assisted: yes |
|
Closing this for now because of the open-PR limit in CONTRIBUTING (one open PR until an author's first merge). I'll reopen it once the limit allows. The branch stays as it is. |
|
Additional Windows/AMD qualification of head Windows 11 10.0.26200, Ryzen 5 5600X, 16 GiB RAM, Radeon RX 6700 XT, AMD Vulkan driver 26.8.1, WinLibs GCC 15.2.0 r7, Release. The same 14 focused fixture binaries were run against the unchanged baseline runtime and the integration. Vulkan was required, the application shader cache disabled, and
The other cases cover idle-store yielding and concurrent reads, multisample retirement/guards, guest-memory lifetime, pipelined/pattern/constant/clamped fills, key coverage, depth-storage reuse and exact pending surfaces. For Another Crab's Treasure (PPSA20423, 02.000.000; bring-up #8239), a separate eight-run title screen of the same source reached the beach seven times and had one near-null loading crash. This does not establish a crash-rate reduction or an FPS improvement. The generic unmap/remap corruption is reproduced and resolved by the fixture; the title's remaining loading failure has not been attributed to it. Only this AMD GPU was tested locally. AI-assisted implementation integration and testing: yes, Codex, continuing the local ZCode investigation. |
|
@BunnyFl Independent Linux/RADV qualification of your existing change on pinned main Fetchable integration: Ryzen 9 7950X, RX 6650 XT, RADV Mesa 26.2.6, Linux 7.2.11, GCC16.2.1 Release. Same five frozen fixture executables in both arms; raw-loader bindings verified; only
Zero skips, no skipped remap check, zero VUIDs/missing layers; ten actual layer insertions per arm. Frozen libraries/executables remain unchanged. One matched five-case run per arm, not a broad stress claim. The first pair with main's original idle-yield fixture segfaulted in that control on both runtimes. Those failures remain in the bundle. I then used actual #14066 Exact pins/source diffs, fetchable-branch map, immutable identities/loader paths, all initial/final logs/JUnit and build receipts, SHA-256 No new Windows, title unblock or performance claim. KLONOA's allocation-code crash motivated this check, but its relationship to this lifetime bug is unproven; the title candidate is only prepared. I have left this PR's state unchanged. AI-assisted: yes (Codex). |
What
Pending storage-image results are stored when something reads their memory, or by the queue 0 worker once every queue has been idle for 50 ms. An unmap left them pending: since e3ce9ba the idle store waits for the unmap's mutation and drops the results only when it then finds the range unregistered. A title that maps new memory over the same addresses before the idle store runs gets the stale results written into its new data.
Heavenly Bodies (PPSA04246, Unity) does this at its first mission load. With
APS5_TRACE_MEMORY=1 APS5_TRACE_FLUSH=1, run trace-7 onmain:The 16 MiB block mapped at line 10203 is Unity's heap; the idle store at line 10297 writes the image of the unmapped range over it, and the allocator reads the overwritten words (
0x27219a960lies in that image). The other crashes are access violations on other threads (AssetGarbageCollectorHelper,UnityGfxDeviceWorker,Gfx Task Executor, unnamed ones) after the same kind of idle store.This PR:
retireUnmapped, also called for allocation removals) drops the results pending in images lying wholly inside the removed range throughStorageTexture::DiscardPendingInside, the path a fill over a whole image already takes. For block-unit images it drops the pending units inside the range.StorageTexture::AnyCreated), next to the multisample and depth guards that already share it.IdleStoreOverUnmapmaps the surface again at the same address inside the unmap's mutation and checks that the idle store andFlushAllPendingdo not write the old results into it. Its previous check that the results are still pending while the mutation is held no longer applies, as they are dropped at the unmap; when the address cannot be mapped again it keeps the previous settle check.Lock order: the observer runs under the registry mutation and takes
Pending().mutex, which is a leaf (no path takes the registry lock while holding it; seeblocksKept). A store that holds a lease finishes beforeRequireUnpinnedlets the unmap proceed.Still not covered (debt entry): an image only partly inside an unmapped range, and memory reused without an unmap.
Overlap (
tools/pr_overlap.py): #7600 also extendsretireUnmappedand the observer condition inMultisampleTarget.cppfor its multisampled clear records; whichever merges second keeps both calls and both conditions. #6926 and #8707 edit the same #1970 debt entry for other cases (host writes over pending results, DCC images with several mips); only the text needs merging.Tested
Windows 11 Pro 10.0.26200, AMD Radeon RX 9070 XT (AMD proprietary driver 26.10.1, LLPC), WinLibs GCC 15.2.0 r7.
Heavenly Bodies (PPSA04246, 01.006.004), converted from the dump on
main53a0a27, with this PR rebased onto that commit for the second row. 45 s runs from start into the first mission (cross pressed every 2 s throughAPS5_PAD_INPUT_FILE),APS5_PROFILE_DRAW=1 APS5_LOG_TIMESTAMPS=1 APS5_TRACE_FLUSH=1 APS5_TRACE_MEMORY=1, after one warm-up run:main53a0a27Every crashed run had 61 or more such stores. The crashes are access violations on
Loading.PreloadManager,Gfx Task Executorand unnamed threads, and onceunsupported PM4 packet type: header 0x00000000in an overwritten command buffer. With this PR the idle store still runs (37-42 stores per run instead of 88-145); only the stores into unmapped ranges are gone. Earlier, onmain7ab4b2e with the same settings,maincrashed in 6 of 15 runs and this PR in 0 of 15; withoutAPS5_TRACE_FLUSH/APS5_TRACE_MEMORY,maincrashed in 2 of 15. One of three played runs on 7ab4b2e also crashed there (AssetGarbageCollectorHelper).GPU tests on
main0aa55ef and on this PR rebased onto it,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R "idle_store|multisample_retirement|native_multisample_depth|cached_image_multisample|host_import|guest_memory_lifetime|flip_stores|pipelined_fill|pattern_buffer_fill|fill_cover|depth_storage_reuse|memory_value_fill|pending_exact|clamped_global_fill|constant_dword_fill" -V:mainwith this PR'sIdleStoreOverUnmap.cpp: 30 of 31 passed,agc_driver_idle_store_over_unmapfailed withidle store over unmap: results of the unmapped surface were stored into the memory mapped over it.agc_host_import_sparseskipped (udmabuf imports are Linux only); the validation layer loaded (nowas not found but was requested by env var VK_INSTANCE_LAYERS) and neither log has aVUID-error.Rebased onto
main3e91c8e after #7600 merged. #7600 also extendsretireUnmappedand the unmap observer condition inMultisampleTarget.cpp; the rebase keeps both calls (forgetSingleClearsandDiscardPendingInside) and both conditions (anySingleClears()andStorageTexture::AnyCreated()), and changes nothing else. The GPU tests above were run again there, withagc_driver_graphicsandagc_driver_msaa_dcc_clear_2/4/8(where #7600's tests are) added:mainwith this PR's test 34 of 35 passed (agc_driver_idle_store_over_unmapfailed with the same message), this PR 35 of 35,agc_host_import_sparseskipped, the validation layer loaded and noVUID-error.tools/check_conventions.py --base upstream/mainpasses.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)The investigation, the change and this description were prepared with AI assistance (Claude Code); the in-game observations were made by me.
🤖 Generated with Claude Code