test(agc): keep waiting for the neighbour copy case's result #6385
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6385"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-15T13:53:42Z.
What
Fixes #6383. In
Run(), theKind::NeighbourCopiedwait returnedOutcome::Missedthe first time the surface image was live whileStorageTexture::AnyPending()was false. It did not check whether the result had reached guest memory. The wait now keeps polling until the surface image is live with results pending, and returnsMissedonly when the result is already stored, asHoldPendingdoes. The timeout message names both conditions. Test-only change, one file.The hypothesis written in #6383 (results already flushed when the image was first seen) was wrong. A local diagnostic (not kept) printed the state at each miss over 30 runs on unchanged main: in 3,215 of 3,218 misses the result was neither pending nor stored, and the first word of the surface still held
Untouchedin 2,899 of them. Only 3 misses had the result stored. Misses occurred in every run, and 4 of 30 runs reached 256.Tested
Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), AMD Ryzen 7 5800X, WinLibs GCC 15.2.0 r7, Ninja, Release, bundled dependencies,
BUILD_TESTING=ON.ANYPS5_NO_SHADER_CACHE=1, fresh process per run.2bc3a760f) onto main:agc_driver_store_over_untrackedpasses 100/100, maximum 0.63 s. TheNeighbourCopiedcase runs to completion in every run; the four cases that printnot run, the surface is not write-watchedare unchanged.f633042df: 40 runs, nonever held pending; 2/40 fail at #6347'sthe first result was not stored, which #6359 addresses.ctest -R "agc_|storage|guest_memory|write_watch" -j 8: 599/600.agc_driver_preparation_scope_settlefailed once under parallel load and passes 11/11 alone; this change does not touch it.python tools/check_conventions.py --base upstream/main: passes.No AMD or Linux run.
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
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T14:02:39Z.
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.
core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cppcore/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cppImported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-15T14:12:16Z.
Current-main Windows refresh (2026-10-16 UTC)
Independent confirmation of @LeandroLP23's AMD result, with both our physical GPUs. Base
5d9dcc42d2ec5401aebd089028b8d4d7410a77b4; unchanged #6359 patch2bc3a760fand unchanged #6385 head0aba57d29462365de0f394b2454919bc6d165f1e. Tested compositions: #6359 only, #6385 only, both.Failures out of 20 fresh processes per cell, 320 total:
Every constrained failure is
the result was never held pending. The one unrestricted main/NVIDIA failure is the distinctthe sampled surface has no live storage image, now #6735. No first-result assertion was observed in this campaign; many constrained main/#6359 runs stop earlier, and this is not proof that #6359's identity predicate is unnecessary. The #6385-only and combined compositions each pass all 80 processes. Main includes the newer output-lifetime/case-table fixes9c765fa0f/d17895ed8; the historical table below retains its older pins.Windows 11 Enterprise 10.0.26200, Ryzen 9 9950X3D, WinLibs GCC15.2.0r7, Release/bundled dependencies/SPIRV-Tools ON. RTX5080 (
10de:2c02, driver610.62/32.0.16.1062) and Radeon integrated graphics (1002:13c0, driver32.0.21036.18). Each selected fixture target builds; source/executable hashes stay fixed within each composition. All processes verify the actual GPU and child affinity:0x1or0xffffffff. Shader cache disabled, driver caches uncontrolled; all processes finish below30s, overall maximum5.803s. These are selected-target builds, not new full app/suite or Linux runs. Passing processes still report four internal watch-transition omissions.I also rebased our unchanged two-line #6359 patch onto main5d as
b15060bd9; its source tree equals the first tested composition. The exact new head rebuilds, passes conventions and Cppcheck/clang-tidy (16.277s, no selected diagnostics/parser failures), and passes5/5 unrestricted processes per GPU. The constrained checks still encounter the independent neighbour wait (4/5 NVIDIA and5/5 AMD). With this unchanged #6385 at 704c04aa8, another20/20 processes pass (five per GPU/profile, maximum0.945s). This adds40 exact-head checks to the320-process comparison.Proposed landing order: #6385 first, then #6359. The two source hunks are independent; this order gives the full fixture its corrected neighbour wait before our final identity-gate validation. #6359 declares this validation prerequisite. #6735 is recorded separately; no fix or causal attribution for that intermittent assertion is claimed here. No production, title or FPS claim. AI-assisted: Codex.
Historical main0e4 comparison, preserved with its original pins
Independent Windows NVIDIA/AMD validation of
0aba57d29462365de0f394b2454919bc6d165f1e.For a matched comparison, I applied your unchanged fixture patch to the same control I had just tested: main
0e4ea13a0bf52fccbfc44c975b25ab7541d63b03plus #6359 (2bc3a760f). The tested composition on our fork differs from controlb4111a275466d75aad260070f46025adbc30ff30only by your patch. This is composition coverage, not a run of the unchanged PR head or latest main.Windows 11 Enterprise 26200, Ryzen 9 9950X3D, WinLibs GCC 15.2.0 r7, Release/bundled dependencies. GPUs: RTX 5080 (Windows driver
32.0.16.1062) and AMD Radeon(TM) Graphics (32.0.21036.18). Target rebuilt successfully. Each cell below is 20 serial fresh processes, shader cache disabled, actual selected GPU verified in every process.0x10x10xffffffff0xffffffffEvery control failure was
the result was never held pending. With the patch, maximum process times were 6.162 s NVIDIA / 0.758 s AMD when constrained and 0.703 s / 0.572 s unrestricted; no timeout (30 s bound). The affinity experiment changes scheduling on this host; it does not establish the scheduling conditions on the RTX 4080 reporter's machine.All patched runs reached the final success message. Four existing write-watch cases still print
not run, the surface is not write-watched; the changed neighbour-copy case is not among those omissions. No source diagnostics or production changes were added. Source and executable hashes remained unchanged throughout each campaign. No title, performance, Linux, full-suite, or #6396 result is claimed.AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-15T14:48:37Z.
@Amoenus Thanks for the NVIDIA/AMD runs, including the single-CPU affinity case: that covers the vendor this PR had no result for. Thanks as well to @MarcZX100 for closing #6396 in favor of this one.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-15T14:55:47Z.
This also fixes the Linux failure I reported in #5671. That one fails with a different message, in the case that runs right after
NeighbourCopied.Linux (Ubuntu 24.04, GCC 13.3, Release, RTX 4070 Ti, NVIDIA 595.99),
ANYPS5_NO_SHADER_CACHE=1, a fresh process per run,mainff23657f3:agc_driver_store_over_untracked_testsmainthe result did not reach a block the CPU left alonemain+ #6385 (0aba57d29)A local diagnostic I didn't keep printed each case's name. On
mainthe failure is always in the last case,a surface whose first block left the write watch with the page before it(NeighbourLeftWatch). When the loop skipsNeighbourCopied, that case passes 3/3. So on Linux, the earlyMissedreturns fromNeighbourCopiedleave something behind that breaks the next case. That matches your finding that the result was stillUntouchedat most misses.Not checked: Windows. I also haven't looked at what exactly carries over between the two cases.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T22:28:03Z.
One test-specific question: this
NeighbourCopiedwait uses globalStorageTexture::AnyPending(), but the case has also just storedsourceand keeps that source image live for the laterCopyFrom. If the source still has pending results, its pending state can satisfy this condition before the destination surface has pending output, so the test may proceed without proving the condition it is meant to wait for. Could this useAnyPendingOverlapson{address, address + SurfaceBytes}(asheldLiveinRunSecondStorealready does) orFindPending(address, SurfaceBytes)? I could not run the GPU fixture here, so this is a code-path concern rather than a reproduced failure.Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-16T03:27:18Z.
@MarcZX100 I ran the GPU fixture on lavapipe (llvmpipe, LLVM 23.1.1) to check your
AnyPending()question at theNeighbourCopiedwait. Your case does happen, though rarely.Setup:
upstream/main5d9dcc42dwith this PR (0aba57d29) merged on top, Release,BUILD_TESTING=ON. I added a local stderr line (not part of the PR) where the wait breaks. For both the destination ({address, address + SurfaceBytes}) and the source surface, it logs:AnyPendingOverlaps, which counts images that are pending or still being flushed.FindPending, which only looks at pending images (likeAnyPending()), and only one based at the start of that range that covers it. For the destination, that is the surface's own image.An env switch picks the break condition. The "load" runs had 16 busy-loop processes on the CPU.
What this shows:
AnyPending()broke the wait while nothing pending or flushing overlapped the destination. The source's image was pending at that moment, which was enough forAnyPending()to return true. The test still passed that run, but it moved on without the condition its comment describes.AnyPendingOverlaps(dst)200/200,FindPending(address, SurfaceBytes)1200/1200.AnyPendingOverlaps(dst)also broke 3 times in its 200 runs with no pending image at the destination's base, the same way as above.Missedretry path is reachable under every condition, including the PR's, and it caused no failure in any run.So I'd take your suggestion, and of the two I'd use
FindPending(address, SurfaceBytes) != nullptr. Both passed every run, but in this fixtureFindPendingonly matches the surface's own image (pending, based ataddress, coveringSurfaceBytes).AnyPendingOverlapson the range also accepts the last-block image or an image that is still flushing. All of this is lavapipe only, not real hardware.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-16T07:41:13Z.
Another AMD run, on an iGPU and on current
main: with each test process pinned to one logical CPU,mainfails 20 of 20 atthe result was never held pending, and this change alone passes 20 of 20.Setup: Windows 11 Home 26300, AMD Radeon 860M (RDNA 3.5,
1002:1114, driver 32.0.13058.8001), Ryzen AI 7 350 (16 threads), WinLibs GCC 15.2.0, Release. Basemain5d9dcc42d, which already has9c765fa0fandd17895ed8in this fixture; both PRs merge onto it cleanly.ANYPS5_NO_SHADER_CACHE=1, a freshctest -R '^agc_driver_store_over_untracked$'per run. "Pinned" meansstart /affinity 1, so ctest and the test process run on CPU 0 only.mainthe result was never held pendingmain+ #6359 (2bc3a760f)never held pendingnever held pendingmain+ this PR (0aba57d29)main+ #6359 + this PRThis matches @Amoenus's single-CPU result on the Radeon iGPU. On this machine
the first result was not stored(#6347) never showed up on currentmain, in any of these runs. Before9c765fa0f, onff23657f3, it failed regularly here.Not tested: Linux, NVIDIA.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-16T08:42:06Z.
Review: APPROVED
Validated unchanged head
0aba57d294merged onto main5d with both RTX5080 and Radeon integrated graphics. Your patch alone passes80/80 fresh processes across both GPUs and single-CPU/unrestricted profiles; matching main fails19/20 NVIDIA and20/20 AMD constrained runs at the pending-result wait. The #6359 combination also passes80/80, plus20/20 after its rebase. Source review agrees with continuing to wait rather than returning Missed before either result state is reached.Exact pins, hardware, conditional omissions and the separate #6735 assertion are in the updated existing report. Selected-target Windows coverage; no new full-suite, title or Linux claim. AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T08:44:53Z.
Thanks for the additional AMD runs. The 20/20 pinned failure on current main and 20/20 pass with this change directly answer my scheduling question; the combined #6359 runs also show the fixes compose. I have no further question on the
AnyPending()case.Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-16T09:04:06Z.
@MarcZX100 @Dextroid17 Thanks, the concern is right: the global
AnyPending()can be satisfied by the source surface. I measured both narrower conditions on the RTX 4080 before choosing.Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), WinLibs GCC 15.2.0 r7, Release,
ANYPS5_NO_SHADER_CACHE=1, a fresh process ofagc_driver_store_over_untracked_testsper run. Base: main5d9dcc42d+ #6452 (main does not build on Windows here without it). "Pinned" isstart /affinity 1.NeighbourCopiedwaitthe result was never held pendingFindLive && AnyPending()(previous head0aba57d29)FindPending(address, SurfaceBytes) != nullptrthe result was never held pendingFindLive && AnyPendingOverlaps({address, address + SurfaceBytes})FindPendingon the destination misses on this GPU, as the stricter predicate of #6396 did (4/100 in #6383), so I did not take it. I pusheddc2f8fb46, which keepsFindLiveand replacesAnyPending()withAnyPendingOverlapson the surface's range, the conditionRunSecondStoreused before #6359. The source surface is outside that range, so its pending results no longer end the wait.The exact new head, merged onto the same base: 0/50 unpinned, 0/50 pinned;
ctest -R agc_ -j 8602/602. Conventions pass. Not run on AMD or Linux at this head.Thanks as well to @Amoenus for the review and to @LeandroLP23 for the Radeon 860M runs.
AI-assisted: yes (runs and change done with Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-16T09:17:40Z.
Rerun of the new head
dc2f8fb46(AnyPendingOverlapson the destination) on the same AMD Radeon 860M setup as above, merged ontomain5d9dcc42d, 20 fresh ctest runs per cell: 20/20 pass pinned to CPU 0 (wheremainfails 20/20) and 20/20 pass unpinned. Same result as the previous head on this machine.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by marco-scheffler on 2026-10-16T21:26:15Z.
Linux data point on NVIDIA.
Ubuntu 24.04.4 (kernel 6.8.0-147), NVIDIA RTX 4000 SFF Ada Generation, driver 595.99.02 (open kernel module), Intel i9-14900, GCC 13.3.0, Release, bundled dependencies, SPIRV-Tools ON. Base
mainbc3c0fc13; patches applied as their diffs toStoreOverUntracked.cpp(#6359 atb15060bd9, this PR atdc2f8fb46).ANYPS5_GPU=RTX,ANYPS5_NO_SHADER_CACHE=1, 20 serial fresh processes per cell, no CPU pinning.the result was never held pending, 9×the result did not reach a block the CPU left alonenever held pending, 11×did not reach a block the CPU left alonethe first result was not storeddid not occur in any run. lavapipe on the same machine passes on main.Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-17T15:35:10Z.
Thanks @oneandonlydean for the merge, and to everyone who ran it on hardware I don't have: @Amoenus (RTX 5080 and Radeon, plus the review), @LeandroLP23 (Radeon 860M), @milescoviello, @SleglJan and @marco-scheffler (Linux), and @Dextroid17 (lavapipe). Thanks as well to @MarcZX100 for spotting the global
AnyPending()wait, which led to the second commit.