agc_driver_recorder_tests: on Linux NVIDIA a reported import write does not invalidate a cache, and the test has never run in CI #1532

Closed
opened 2026-10-08 11:24:03 +00:00 by Dextroid17 · 22 comments
Dextroid17 commented 2026-10-08 11:24:03 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-08T11:24:03Z.


Status 2026-10-12 — cause found: the test's ordering, not the library; and it reproduces on AMD.

@fma-rc pinned the (w) stop: the import happens inside image->MarkDirty() — the test zeroes the DCC
keys, and (his words, "from reading, not run") clear-coded keys reach HostImportFor via
MarkDccUncompressed / StoreUncompressedOnGpu — i.e. one line before the test takes cached.
Taking cached first makes the section pass on both an RTX 5080 and RADV (Radeon 610M, Mesa 26.1.4). So
the assertion's ordering is wrong and the invalidation path it probes is fine: a test bug, not an AGC
cache bug
.

AMD: it reproduces on RADV as well as NVIDIA, so it was never vendor-specific — only one card was
available when this was filed. Note the comparing device in the thread (gfx1036, Mesa 26.2.1) skips the
section; why the two Mesa builds decide differently is not yet established.

CI visibility — correcting this report: the binary is registered with ctest, but only for its
flag-scoped sub-runs (agc_pipeline_cache, agc_pipeline_library*, agc_unchanged_cpu_stamps,
agc_host_import_unmap). The no-argument full run has no entry, and the two failing sections are
reached only by that full run — which is why neither device's failure showed up. "Built but not
registered" was too broad.

Remaining: #3103 (merged) fixes both stale expectations and @adriadam10 reports the full run no
longer stops at (s)/(w) on current main (checked on RADV). Registering the full run is #3354,
closed by the intake policy ten seconds after it opened, so it is not upstream. Full detail and credits
in my comment below.


On main (084aeeb6), running agc_driver_recorder_tests on a real NVIDIA GPU fails here:

AGC graphics: (w) a cache over the pages the import reported sees no change
EXIT=1

The assertion is core/libs/prx/libSceAgcDriver/tests/Recorder.cpp:2130:

const bool importWrites = probe.writtenAtImport != 0;
...
Require(!import->unwatched && Watched(address, bytes), "(w) an import under the watch decision left the watch");
CollectWritesUncached(address, surfaceBytes);
if (importWrites) {
    Require(!UnchangedSince(address, surfaceBytes, cached), "(w) a cache over the pages the import reported sees no change");

importWrites is true on this device: the probe reports 4 of 4 pages written when the import is taken, so the block runs and the claim fails — a cache taken before the import still reads as unchanged over pages the import reported as written. On lavapipe writtenAtImport is 0, so the same block is skipped and this assertion never runs there.

It is not #1046. The failure is byte-identical with and without that PR applied (its extra GPU-fill probe reads 0 on this device, so the watch decision does not change); only the diagnostic line differs. So this is on main.

Why nothing reports it. The test is add_test_executable(... EXCLUDE_FROM_ALL) with no matching add_test, so it is one of the built-but-not-run tests that tools/check_test_registration.py records by name. It is not the same failure as lavapipe's — lavapipe stops earlier, at the partial publish did not copy exactly the partly covered unit (#1429) — so today two devices fail this binary at two different assertions and neither is visible in a run.

Reproduce (Release, BUILD_TESTING=ON; the binary is not in ctest, so run it directly):

cmake --build build --target agc_driver_recorder_tests --parallel
./build/tests/agc_driver_recorder_tests        # NVIDIA: exit 1 at Recorder.cpp:2130

Under lavapipe, for contrast, it fails the same binary at the partial publish check instead:

export VK_ICD_FILENAMES=<lavapipe manifest>
export ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx
./build/tests/agc_driver_recorder_tests        # llvmpipe: the partial publish did not copy exactly the partly covered unit

Environment: RTX 3080 Ti, NVIDIA 615.71.09, Linux 7.2.9 (CachyOS), GCC 16.2.1, Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON.

What I did not settle: whether the assertion or the invalidation path is wrong, and whether the same happens on AMD — there is only an NVIDIA card here. The probe line on this device reads:

[write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 4 after the import); imported ranges stay watched

So imports stay watched, and a reported write through that path does not reach the cache. Is that expected to hold on a real GPU, or should the assertion be gated on the watch decision? If it is the same class as #1133, say so and I will keep it out of the way; otherwise it is worth a line before the test is registered in ctest, because registering it makes CI green on lavapipe while leaving this red on NVIDIA.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5760865686 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-08T11:24:03Z. --- > **Status 2026-10-12 — cause found: the test's ordering, not the library; and it reproduces on AMD.** > > @fma-rc pinned the `(w)` stop: the import happens inside `image->MarkDirty()` — the test zeroes the DCC > keys, and (his words, "from reading, not run") clear-coded keys reach `HostImportFor` via > `MarkDccUncompressed` / `StoreUncompressedOnGpu` — i.e. **one line before** the test takes `cached`. > Taking `cached` first makes the section pass on both an RTX 5080 and RADV (Radeon 610M, Mesa 26.1.4). So > the assertion's ordering is wrong and the invalidation path it probes is fine: **a test bug, not an AGC > cache bug**. > > **AMD:** it reproduces on RADV as well as NVIDIA, so it was never vendor-specific — only one card was > available when this was filed. Note the comparing device in the thread (gfx1036, Mesa 26.2.1) skips the > section; why the two Mesa builds decide differently is not yet established. > > **CI visibility — correcting this report:** the binary *is* registered with ctest, but only for its > flag-scoped sub-runs (`agc_pipeline_cache`, `agc_pipeline_library*`, `agc_unchanged_cpu_stamps`, > `agc_host_import_unmap`). The **no-argument full run has no entry**, and the two failing sections are > reached only by that full run — which is why neither device's failure showed up. "Built but not > registered" was too broad. > > **Remaining:** **#3103** (merged) fixes both stale expectations and @adriadam10 reports the full run no > longer stops at `(s)`/`(w)` on current `main` (checked on RADV). Registering the full run is **#3354**, > closed by the intake policy ten seconds after it opened, so it is not upstream. Full detail and credits > in my comment below. --- On `main` (`084aeeb6`), running `agc_driver_recorder_tests` on a real NVIDIA GPU fails here: ``` AGC graphics: (w) a cache over the pages the import reported sees no change EXIT=1 ``` The assertion is `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp:2130`: ```cpp const bool importWrites = probe.writtenAtImport != 0; ... Require(!import->unwatched && Watched(address, bytes), "(w) an import under the watch decision left the watch"); CollectWritesUncached(address, surfaceBytes); if (importWrites) { Require(!UnchangedSince(address, surfaceBytes, cached), "(w) a cache over the pages the import reported sees no change"); ``` `importWrites` is true on this device: the probe reports **4 of 4 pages written when the import is taken**, so the block runs and the claim fails — a cache taken before the import still reads as unchanged over pages the import reported as written. On lavapipe `writtenAtImport` is 0, so the same block is skipped and this assertion never runs there. **It is not #1046.** The failure is byte-identical with and without that PR applied (its extra GPU-fill probe reads 0 on this device, so the watch decision does not change); only the diagnostic line differs. So this is on `main`. **Why nothing reports it.** The test is `add_test_executable(... EXCLUDE_FROM_ALL)` with no matching `add_test`, so it is one of the built-but-not-run tests that `tools/check_test_registration.py` records by name. It is not the same failure as lavapipe's — lavapipe stops earlier, at `the partial publish did not copy exactly the partly covered unit` (#1429) — so today two devices fail this binary at two different assertions and neither is visible in a run. **Reproduce** (Release, `BUILD_TESTING=ON`; the binary is not in ctest, so run it directly): ``` cmake --build build --target agc_driver_recorder_tests --parallel ./build/tests/agc_driver_recorder_tests # NVIDIA: exit 1 at Recorder.cpp:2130 ``` Under lavapipe, for contrast, it fails the same binary at the partial publish check instead: ``` export VK_ICD_FILENAMES=<lavapipe manifest> export ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx ./build/tests/agc_driver_recorder_tests # llvmpipe: the partial publish did not copy exactly the partly covered unit ``` **Environment:** RTX 3080 Ti, NVIDIA 615.71.09, Linux 7.2.9 (CachyOS), GCC 16.2.1, Release, `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`. **What I did not settle:** whether the assertion or the invalidation path is wrong, and whether the same happens on AMD — there is only an NVIDIA card here. The probe line on this device reads: ``` [write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 4 after the import); imported ranges stay watched ``` So imports stay watched, and a reported write through that path does not reach the cache. Is that expected to hold on a real GPU, or should the assertion be gated on the watch decision? If it is the same class as #1133, say so and I will keep it out of the way; otherwise it is worth a line before the test is registered in ctest, because registering it makes CI green on lavapipe while leaving this red on NVIDIA. Written with AI assistance.
klosixgaming-arch commented 2026-10-08 11:53:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T11:53:35Z.


This is an important test failure that's not visible in CI because the test isn't registered. Based on my review of recent PRs related to the AGC driver and shader recompiler, I can provide some context:

The fact that this test fails on real NVIDIA GPUs but passes on lavapipe suggests a difference in how write protection is handled between the two drivers. The probe line showing "4 of 4 pages written after the import" indicates that imports are staying watched, but reported writes through that path aren't reaching the cache.

Some observations based on similar issues I've seen:

  1. This could be related to how NVIDIA's driver handles write protection for imported memory ranges
  2. The fact that it's not affected by PR #1046 (as noted in the issue) suggests this is a separate issue
  3. Registering this test in ctest would make CI fail on NVIDIA, which might not be desirable until the underlying issue is fixed

I'd suggest investigating whether the assertion or the invalidation path is wrong, as suggested in the issue. If it's the same class as #1133 (which deals with similar write-back issues), that might provide some clues about the root cause.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6059274455 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6059274455). Originally posted by [klosixgaming-arch](https://github.com/klosixgaming-arch) on 2026-10-08T11:53:35Z. --- This is an important test failure that's not visible in CI because the test isn't registered. Based on my review of recent PRs related to the AGC driver and shader recompiler, I can provide some context: The fact that this test fails on real NVIDIA GPUs but passes on lavapipe suggests a difference in how write protection is handled between the two drivers. The probe line showing "4 of 4 pages written after the import" indicates that imports are staying watched, but reported writes through that path aren't reaching the cache. Some observations based on similar issues I've seen: 1. This could be related to how NVIDIA's driver handles write protection for imported memory ranges 2. The fact that it's not affected by PR #1046 (as noted in the issue) suggests this is a separate issue 3. Registering this test in ctest would make CI fail on NVIDIA, which might not be desirable until the underlying issue is fixed I'd suggest investigating whether the assertion or the invalidation path is wrong, as suggested in the issue. If it's the same class as #1133 (which deals with similar write-back issues), that might provide some clues about the root cause.
Dextroid17 commented 2026-10-08 12:11:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-08T12:11:28Z.


Follow-up with a measurement, because it moves the question from "which of the two is wrong" to something narrower.

I instrumented the failing block (local only) to print the premise and the state around it, and ran it on the same GPU:

[diag #1532] probe.atImport=4 importWrites=1 cached=160 after=161 unchanged=1 writtenSince=0

Reading it against Execution/include/GuestMemory.hpp:

  • cached=160 → after=161 is not evidence of a write. The header says the tracker generation is bumped by every collect ("every collect and MarkWritten bumps it"), so one more collect moves it by one on its own.
  • unchanged=1 and writtenSince=0 together say the import created for this window left no collected CPU write over the window.

So on this device the premise and the range it is asserted about come from different places:

  • ProbeImportWriteProtection builds its own range — mmap 4 pages, touch every page, register the watch, then createImport — and reports 4 of 4 pages dirty at the import here.
  • The window's own import (the one the assertions are about) reports nothing to the tracker.

The block therefore runs because an import over a fresh mmapped scratch reports writes, and then asserts that a different, already-watched window's import did the same. That is why the first assertion fails before any cache or invalidation claim is tested: importWrites is a device-level proxy, and it does not transfer to this range.

Two readings, and they lead to different fixes:

  1. Test side. The premise should be the window's own observation. The file already has the shape for this ("host imports unavailable: the import window not tested", "no write watching: the import window not tested"): if the window's import reports no writes, print that and return, or gate the block on it. Then the assertions only run where the case exists. The cost is that on this device the case is then not exercised at all.
  2. Code side. An import over an existing watched mapping should report writes the way one over fresh memory does on this driver, and the difference is what is wrong. If that is the answer, then the assertions are right and something in the import path (what it touches, or when the watch is armed relative to the import) is the defect.

I cannot separate those two without knowing the shadow stamping rule for an import that lands on already-watched memory — which is the question in the issue. I am happy to take #1 as a PR if the intent is that the block covers only the devices where the window's import reports writes; if it is #2, then the measurement above is the starting point and the fix belongs in the import path instead.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6059565038 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6059565038). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-08T12:11:28Z. --- Follow-up with a measurement, because it moves the question from "which of the two is wrong" to something narrower. I instrumented the failing block (local only) to print the premise and the state around it, and ran it on the same GPU: ``` [diag #1532] probe.atImport=4 importWrites=1 cached=160 after=161 unchanged=1 writtenSince=0 ``` Reading it against `Execution/include/GuestMemory.hpp`: - **`cached=160 → after=161` is not evidence of a write.** The header says the tracker generation is bumped by *every collect* ("every collect and MarkWritten bumps it"), so one more collect moves it by one on its own. - **`unchanged=1` and `writtenSince=0`** together say the import created for *this window* left no collected CPU write over the window. So on this device the premise and the range it is asserted about come from different places: - `ProbeImportWriteProtection` builds its own range — `mmap` 4 pages, touch every page, register the watch, then `createImport` — and reports **4 of 4 pages dirty at the import** here. - The window's own import (the one the assertions are about) reports **nothing** to the tracker. The block therefore runs because an import over a *fresh mmapped scratch* reports writes, and then asserts that a *different, already-watched* window's import did the same. That is why the first assertion fails before any cache or invalidation claim is tested: `importWrites` is a device-level proxy, and it does not transfer to this range. Two readings, and they lead to different fixes: 1. **Test side.** The premise should be the window's own observation. The file already has the shape for this ("host imports unavailable: the import window not tested", "no write watching: the import window not tested"): if the window's import reports no writes, print that and return, or gate the block on it. Then the assertions only run where the case exists. The cost is that on this device the case is then not exercised at all. 2. **Code side.** An import over an existing watched mapping *should* report writes the way one over fresh memory does on this driver, and the difference is what is wrong. If that is the answer, then the assertions are right and something in the import path (what it touches, or when the watch is armed relative to the import) is the defect. I cannot separate those two without knowing the shadow stamping rule for an import that lands on already-watched memory — which is the question in the issue. I am happy to take #1 as a PR if the intent is that the block covers only the devices where the window's import reports writes; if it is #2, then the measurement above is the starting point and the fix belongs in the import path instead. Written with AI assistance.
fisherjoey commented 2026-10-08 18:00:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T18:00:20Z.


AMD data, plus a second NVIDIA driver.

The startup probe on our two devices (Nobara 44, Linux 7.2, GCC 16.2.1, Release, main 4b005b22):

Device [write-watch] host imports resolve write protection
RTX 5070 Ti, NVIDIA 595.91.07 no (0 of 4 scratch pages written after a GPU read, 4 after the import); imported ranges stay watched
RADV, Ryzen 5 7600X iGPU (gfx1036), Mesa 26.2.1 yes (4 of 4 scratch pages written after a GPU read, 4 after the import); imported ranges are compared

The NVIDIA line matches yours on 615.71.09, so the 595 branch also reports 4 pages at the import. RADV reports 4 at the import too, but there imports are compared, not watched, so the device never reaches the state the (w) block asserts about. The test says so itself: host imports are compared, not watched: the import window not tested.

agc_driver_recorder_tests, 3 runs per cell:

Device main 4b005b22 main + #1046 (your resolution onto 4b005b22)
RTX 5070 Ti, 595.91.07 0 of 3 pass, all exit 1 at (w) a cache over the pages the import reported sees no change 0 of 3 pass, same assertion. Probe: 0 ... after a GPU read, 0 after a GPU write, 4 after the import
RADV gfx1036, Mesa 26.2.1 3 of 3 pass 3 of 3 pass. Probe: 4 ... after a GPU read, 4 after a GPU write, 4 after the import

So on NVIDIA 595 the result is the same as on your 615: #1046's GPU-write counter reads 0 here, the watch decision doesn't change, and the binary stops at the same line with or without it. On RADV the (w) block never runs, with or without the PR. That fits your reading that importWrites is a device-level proxy. Neither of our devices exercises the window's own import reporting writes.

On NVIDIA the dma-buf probe is skipped on main (dma-buf imports unavailable: the dma-buf import probe not tested), so #1329's guard is active and isn't part of this failure.

If you push the instrumented [diag #1532] build to a branch, I can run it on both devices and post the lines.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6065964924 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6065964924). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-08T18:00:20Z. --- AMD data, plus a second NVIDIA driver. The startup probe on our two devices (Nobara 44, Linux 7.2, GCC 16.2.1, Release, `main` 4b005b22): | Device | `[write-watch] host imports resolve write protection` | |---|---| | RTX 5070 Ti, NVIDIA 595.91.07 | `no (0 of 4 scratch pages written after a GPU read, 4 after the import); imported ranges stay watched` | | RADV, Ryzen 5 7600X iGPU (gfx1036), Mesa 26.2.1 | `yes (4 of 4 scratch pages written after a GPU read, 4 after the import); imported ranges are compared` | The NVIDIA line matches yours on 615.71.09, so the 595 branch also reports 4 pages at the import. RADV reports 4 at the import too, but there imports are compared, not watched, so the device never reaches the state the `(w)` block asserts about. The test says so itself: `host imports are compared, not watched: the import window not tested`. `agc_driver_recorder_tests`, 3 runs per cell: | Device | `main` 4b005b22 | `main` + #1046 (your resolution onto 4b005b22) | |---|---|---| | RTX 5070 Ti, 595.91.07 | 0 of 3 pass, all exit 1 at `(w) a cache over the pages the import reported sees no change` | 0 of 3 pass, same assertion. Probe: `0 ... after a GPU read, 0 after a GPU write, 4 after the import` | | RADV gfx1036, Mesa 26.2.1 | 3 of 3 pass | 3 of 3 pass. Probe: `4 ... after a GPU read, 4 after a GPU write, 4 after the import` | So on NVIDIA 595 the result is the same as on your 615: #1046's GPU-write counter reads 0 here, the watch decision doesn't change, and the binary stops at the same line with or without it. On RADV the `(w)` block never runs, with or without the PR. That fits your reading that `importWrites` is a device-level proxy. Neither of our devices exercises the window's own import reporting writes. On NVIDIA the dma-buf probe is skipped on main (`dma-buf imports unavailable: the dma-buf import probe not tested`), so #1329's guard is active and isn't part of this failure. If you push the instrumented `[diag #1532]` build to a branch, I can run it on both devices and post the lines.
Dextroid17 commented 2026-10-08 18:25:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-08T18:25:15Z.


Useful — that pins the split down to the vendor, not to one driver branch.

  NVIDIA 595.91.07 (5070 Ti)   no  (0 after a GPU read, 4 after the import)  -> watched
  NVIDIA 615.71.09 (3080 Ti)   no  (0 after a GPU read, 4 after the import)  -> watched
  RADV gfx1036 (Mesa 26.2.1)   yes (4 after a GPU read, 4 after the import)  -> compared
  lavapipe                     yes (0 after a GPU read, 4 after a GPU write) -> compared

Two NVIDIA driver branches agree with each other and differ from both RADV and lavapipe, so the write-watch decision the assertion depends on is vendor-shaped: on NVIDIA the GPU read leaves those pages unwritten and the import itself reports all four, which is why the cache check then sees "no change" over pages the import said were written, while RADV and lavapipe dirty the pages on the read and end up comparing the ranges instead.

That is the same conclusion I measured on this machine when I instrumented the block (probe.atImport=4 importWrites=1 cached=160 after=161 unchanged=1 writtenSince=0): the pages really are already in the cache before the import is registered, so the test's premise — that a cache over those pages must see a change — holds on the comparing devices and not on the watching ones. It also means the failure is not a regression from the PR that registers the test; it fails at the same line on main with and without it.

So the two options I listed earlier stand, and this data argues for the second: make the premise device-independent (assert the import's own observation rather than an absolute page count), or gate the block on the decision the device actually took (unwatchImports), which is what my instrumentation showed differs.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6066384614 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6066384614). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-08T18:25:15Z. --- Useful — that pins the split down to the vendor, not to one driver branch. ``` NVIDIA 595.91.07 (5070 Ti) no (0 after a GPU read, 4 after the import) -> watched NVIDIA 615.71.09 (3080 Ti) no (0 after a GPU read, 4 after the import) -> watched RADV gfx1036 (Mesa 26.2.1) yes (4 after a GPU read, 4 after the import) -> compared lavapipe yes (0 after a GPU read, 4 after a GPU write) -> compared ``` Two NVIDIA driver branches agree with each other and differ from both RADV and lavapipe, so the write-watch decision the assertion depends on is vendor-shaped: on NVIDIA the GPU read leaves those pages unwritten and the import itself reports all four, which is why the cache check then sees "no change" over pages the import said were written, while RADV and lavapipe dirty the pages on the read and end up comparing the ranges instead. That is the same conclusion I measured on this machine when I instrumented the block (`probe.atImport=4 importWrites=1 cached=160 after=161 unchanged=1 writtenSince=0`): the pages really are already in the cache before the import is registered, so the test's premise — that a cache over those pages must see a change — holds on the comparing devices and not on the watching ones. It also means the failure is not a regression from the PR that registers the test; it fails at the same line on `main` with and without it. So the two options I listed earlier stand, and this data argues for the second: make the premise device-independent (assert the import's own observation rather than an absolute page count), or gate the block on the decision the device actually took (`unwatchImports`), which is what my instrumentation showed differs. Written with AI assistance.
popcoder565 commented 2026-10-09 08:48:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T08:48:39Z.


Windows data point. On Windows, host imports are compared or settle-checked rather than write-protected, so this assertion's premise differs there.

Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), GCC 15.2.0 (WinLibs r7), Release. agc_driver_recorder_tests was built explicitly, since it's EXCLUDE_FROM_ALL.

So the failure looks Linux-only. Registering the test on Windows would still need a skip for the CI runner, which has no Vulkan device.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077616068 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6077616068). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T08:48:39Z. --- Windows data point. On Windows, host imports are compared or settle-checked rather than write-protected, so this assertion's premise differs there. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), GCC 15.2.0 (WinLibs r7), Release. `agc_driver_recorder_tests` was built explicitly, since it's `EXCLUDE_FROM_ALL`. - `main` f1451396: passes 3/3. - `main` 6cc0503d + #2093 (needed to build) + #1847: passes 5/5. So the failure looks Linux-only. Registering the test on Windows would still need a skip for the CI runner, which has no Vulkan device. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
fma-rc commented 2026-10-10 17:56:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-10T17:56:08Z.


Cause found, and it also fails on an AMD device here: the window's import does report its pages, but it is created inside image->MarkDirty(), one line before the test takes cached. The stamps are then older than cached, so UnchangedSince(address, surfaceBytes, cached) is true, and the test's own HostImportFor only finds the existing import. Taking cached before MarkDirty() makes the section pass on both devices.

Setup: main 57f96fd2, Arch Linux 7.2.9, GCC 16.2.1, Release. RTX 5080 (615.78.08) and Radeon 610M (RADV, Mesa 26.1.4). Both print host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 4 after the import); imported ranges stay watched, so on this Mesa the AMD device runs the section too. To reach importWindowTests in today's full run, two earlier stops have to be out of the way: #2864 merged (pin wait in unitShadowTests), and an explicit FlushPending before the (s) check in staleGenerationTests, as the unwatched branch of storageRefreshTests already has.

Measured with temporary prints in ImportWatched and in the test (same numbers on both devices unless noted):

Point in importWindowTests Observation
after the StorageTexture constructor, after recorder.Keep no import covers the block (per-statement markers run on the RTX 5080 only)
inside image->MarkDirty() ImportWatched runs over the whole block: 0 pages in the walk before the import, 65 in the walk after it (64 surface pages and the key page), generation 3 -> 5
cached 8
after the test's HostImportFor unchanged=1 writtenSince=0 changed=0,0,0,0, then the reported assertion
same, with cached taken before MarkDirty() cached=4, import at generation 4 -> 6, unchanged=0 writtenSince=0 changed=2,2,2,2; all three (w) requirements hold

So the product does what the block asserts (a change the cache sees, BlockMaybeWritten, not a CPU store); the test compares against a generation taken after the import.

Test-only change that makes it pass:

--- a/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
+++ b/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
@@ importWindowTests
-        image->MarkDirty();
         const auto cached = CollectWritesUncached(address, surfaceBytes);
         Require(cached != 0 && UnchangedSince(address, surfaceBytes, cached), "(w) the cache's generation is not current before the import");
+        image->MarkDirty();
         const auto* import = HostImportFor(base, address, bytes);
Full agc_driver_recorder_tests run, no arguments, 3 runs each RTX 5080 RADV, Radeon 610M
#2864 + the (s) flush stops at (w) a cache over the pages the import reported sees no change same
#2864 + the (s) flush + the change above exit 0, Recorder read tracking and label tests passed, 3 of 3 3 of 3

With those three pieces the full run is green on both devices; the only not tested line left is dma-buf imports unavailable: the dma-buf import probe not tested.

From reading, not run: MarkDirty() imports because the test zeroes the DCC keys, and for clear-coded keys it goes through MarkDccUncompressed to StoreUncompressedOnGpu, which calls HostImportFor (Graphics/src/DccMetadata.cpp). The guard Require(!HostImportCovers(...)) sits right after the constructor, so it does not see that import.

Not established: why the RADV device reported above on Mesa 26.2.1 takes the "compared" decision while this one on 26.1.4 stays watched.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100497349 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6100497349). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-10T17:56:08Z. --- Cause found, and it also fails on an AMD device here: the window's import does report its pages, but it is created inside `image->MarkDirty()`, one line before the test takes `cached`. The stamps are then older than `cached`, so `UnchangedSince(address, surfaceBytes, cached)` is true, and the test's own `HostImportFor` only finds the existing import. Taking `cached` before `MarkDirty()` makes the section pass on both devices. **Setup:** `main` 57f96fd2, Arch Linux 7.2.9, GCC 16.2.1, Release. RTX 5080 (615.78.08) and Radeon 610M (RADV, Mesa 26.1.4). Both print `host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 4 after the import); imported ranges stay watched`, so on this Mesa the AMD device runs the section too. To reach `importWindowTests` in today's full run, two earlier stops have to be out of the way: #2864 merged (pin wait in `unitShadowTests`), and an explicit `FlushPending` before the (s) check in `staleGenerationTests`, as the unwatched branch of `storageRefreshTests` already has. **Measured** with temporary prints in `ImportWatched` and in the test (same numbers on both devices unless noted): | Point in `importWindowTests` | Observation | |---|---| | after the `StorageTexture` constructor, after `recorder.Keep` | no import covers the block (per-statement markers run on the RTX 5080 only) | | inside `image->MarkDirty()` | `ImportWatched` runs over the whole block: 0 pages in the walk before the import, 65 in the walk after it (64 surface pages and the key page), generation 3 -> 5 | | `cached` | 8 | | after the test's `HostImportFor` | `unchanged=1 writtenSince=0 changed=0,0,0,0`, then the reported assertion | | same, with `cached` taken before `MarkDirty()` | `cached=4`, import at generation 4 -> 6, `unchanged=0 writtenSince=0 changed=2,2,2,2`; all three (w) requirements hold | So the product does what the block asserts (a change the cache sees, `BlockMaybeWritten`, not a CPU store); the test compares against a generation taken after the import. **Test-only change** that makes it pass: ```diff --- a/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp @@ importWindowTests - image->MarkDirty(); const auto cached = CollectWritesUncached(address, surfaceBytes); Require(cached != 0 && UnchangedSince(address, surfaceBytes, cached), "(w) the cache's generation is not current before the import"); + image->MarkDirty(); const auto* import = HostImportFor(base, address, bytes); ``` | Full `agc_driver_recorder_tests` run, no arguments, 3 runs each | RTX 5080 | RADV, Radeon 610M | |---|---|---| | #2864 + the (s) flush | stops at `(w) a cache over the pages the import reported sees no change` | same | | #2864 + the (s) flush + the change above | exit 0, `Recorder read tracking and label tests passed`, 3 of 3 | 3 of 3 | With those three pieces the full run is green on both devices; the only `not tested` line left is `dma-buf imports unavailable: the dma-buf import probe not tested`. **From reading, not run:** `MarkDirty()` imports because the test zeroes the DCC keys, and for clear-coded keys it goes through `MarkDccUncompressed` to `StoreUncompressedOnGpu`, which calls `HostImportFor` (`Graphics/src/DccMetadata.cpp`). The guard `Require(!HostImportCovers(...))` sits right after the constructor, so it does not see that import. **Not established:** why the RADV device reported above on Mesa 26.2.1 takes the "compared" decision while this one on 26.1.4 stays watched. AI-assisted: yes
fma-rc commented 2026-10-10 23:37:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-10T23:37:24Z.


Update on the full run after today's merges. On main 181420f8 the pin wait is gone (#2864 is in), and the run now stops earlier, on both an RTX 5080 and RADV (Radeon 610M):

AGC graphics: (s) the storage image imported its memory before a generation was taken

That is the Watched(address, bytes) check right after the StorageTexture is constructed in staleGenerationTests. I bisected main with #2864's commit and my two test fixes applied at each step: the first merge where it fails is #2699. Since that change StorageTexture::upload calls HostImportFor for the fast-cleared surface, so the image imports its memory in the constructor, which this section assumes it does not.

With 4f9ddffc reverted on 181420f8 plus the two test fixes, the full run exits 0 on both devices. I have not worked out whether the section should now take its generation before constructing the image or whether the early import is a problem for what (s) guards.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6103382554 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6103382554). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-10T23:37:24Z. --- Update on the full run after today's merges. On `main` 181420f8 the pin wait is gone (#2864 is in), and the run now stops earlier, on both an RTX 5080 and RADV (Radeon 610M): ``` AGC graphics: (s) the storage image imported its memory before a generation was taken ``` That is the `Watched(address, bytes)` check right after the `StorageTexture` is constructed in `staleGenerationTests`. I bisected `main` with #2864's commit and my two test fixes applied at each step: the first merge where it fails is #2699. Since that change `StorageTexture::upload` calls `HostImportFor` for the fast-cleared surface, so the image imports its memory in the constructor, which this section assumes it does not. With 4f9ddffc reverted on 181420f8 plus the two test fixes, the full run exits 0 on both devices. I have not worked out whether the section should now take its generation before constructing the image or whether the early import is a problem for what (s) guards.
oneandonlydean commented 2026-10-11 05:06:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T05:06:32Z.


@fma-rc could you run the full recorder test with #3103 plus milescoviello's 7cc5adfb from #3179? That commit keeps the fast-clear copy where an import window can stamp watched memory, which is the #2699 path your bisect found. If the (s) the storage image imported its memory before a generation was taken stop goes away with it, #3103 can close this once that fix is in.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6105688100 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6105688100). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T05:06:32Z. --- @fma-rc could you run the full recorder test with #3103 plus milescoviello's `7cc5adfb` from #3179? That commit keeps the fast-clear copy where an import window can stamp watched memory, which is the #2699 path your bisect found. If the `(s) the storage image imported its memory before a generation was taken` stop goes away with it, #3103 can close this once that fix is in.
fma-rc commented 2026-10-11 05:38:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-11T05:38:12Z.


Ran it: the stop does not go away with 7cc5adfb. The full agc_driver_recorder_tests run (no arguments) still ends on the same line, on both the RTX 5080 and RADV (Radeon 610M), Linux, GCC 16.2.1:

[gpu] lease wait failed: AGC graphics: vkWaitForFences recorder: Vulkan result -4
AGC graphics: (s) the storage image imported its memory before a generation was taken
Tree RTX 5080 RADV
main 961b25fe + #3103 stops on (s) stops on (s)
7cc5adfb (on 961b25fe) + #3103 stops on (s) stops on (s)
main f90ccd79 + #3103 stops on (s) stops on (s)

All six logs are 155 lines and end the same way. I ran 7cc5adfb on its own base because it no longer cherry-picks onto main f90ccd79: it conflicts in GuestBufferMemory.cpp with 60f12c88.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6105900863 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6105900863). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-11T05:38:12Z. --- Ran it: the stop does not go away with `7cc5adfb`. The full `agc_driver_recorder_tests` run (no arguments) still ends on the same line, on both the RTX 5080 and RADV (Radeon 610M), Linux, GCC 16.2.1: ``` [gpu] lease wait failed: AGC graphics: vkWaitForFences recorder: Vulkan result -4 AGC graphics: (s) the storage image imported its memory before a generation was taken ``` | Tree | RTX 5080 | RADV | |---|---|---| | `main` 961b25fe + #3103 | stops on `(s)` | stops on `(s)` | | `7cc5adfb` (on 961b25fe) + #3103 | stops on `(s)` | stops on `(s)` | | `main` f90ccd79 + #3103 | stops on `(s)` | stops on `(s)` | All six logs are 155 lines and end the same way. I ran `7cc5adfb` on its own base because it no longer cherry-picks onto `main` f90ccd79: it conflicts in `GuestBufferMemory.cpp` with 60f12c88.
adriadam10 commented 2026-10-11 07:55:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:55:20Z.


Partly addressed by #3103: the full recorder run no longer stops at (s)/(w) on current main (checked on RADV); registering the full run with ctest is still open.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106882312 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6106882312). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T07:55:20Z. --- Partly addressed by #3103: the full recorder run no longer stops at (s)/(w) on current main (checked on RADV); registering the full run with ctest is still open.
blawesom commented 2026-10-11 08:36:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T08:36:35Z.


Registering the full run: #3354 adds the no-argument run to ctest as agc_driver_recorder. Verified 3/3 on RADV (Radeon RX 9070, Mesa 26.2.4); CI's lavapipe exercises the watched-import path that #3226 validated for the registered agc_unit_shadow test.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107193488 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6107193488). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-11T08:36:35Z. --- Registering the full run: #3354 adds the no-argument run to ctest as `agc_driver_recorder`. Verified 3/3 on RADV (Radeon RX 9070, Mesa 26.2.4); CI's lavapipe exercises the watched-import path that #3226 validated for the registered `agc_unit_shadow` test.
Dextroid17 commented 2026-10-12 16:12:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-12T16:12:42Z.


Thanks — that answers both of the questions this report ended on, and both came out the opposite way from
what I was worried about.

@fma-rc's diagnosis: the import happens inside image->MarkDirty() — the test zeroes the DCC keys, and
(his words, "from reading, not run") clear-coded keys reach HostImportFor through MarkDccUncompressed
and StoreUncompressedOnGpu — which is one line before the test takes cached. Taking cached first
makes the section pass. So the assertion's ordering is wrong and the invalidation path it probes is fine:
a test bug, not an AGC cache bug.

On AMD: it reproduces. @fma-rc reproduced it on RADV (Radeon 610M, Mesa 26.1.4) as well as on the
RTX 5080, so it was never NVIDIA-specific — I simply had one card here. Worth keeping in view, though: the
comparing device in this thread (gfx1036, Mesa 26.2.1) takes the "compared" watch decision and the section
never runs there, and why the two Mesa builds decide differently is still unexplained.

On CI visibility: the binary is registered with ctest, but only for its flag-scoped sub-runs
(agc_pipeline_cache, agc_pipeline_library*, agc_unchanged_cpu_stamps, agc_host_import_unmap). The
no-argument full run has no ctest entry, and staleGenerationTests / importWindowTests are only
reached by that full run — which is why neither device's failure was visible. My "built but not registered"
was too broad.

Where the thread stands: #3103 (merged) hoists the checks above the StorageTexture constructor and
fixes the (s) step's pending flush, and @adriadam10 reports the full run no longer stops at (s)/(w) on
current main (checked on RADV). The remaining item is registering the full run — #3354, which the
intake policy closed ten seconds after it opened, so it is not upstream yet.

One thing still unanswered from the report: #1133. On the evidence above this reads as an ordinary
test-ordering bug rather than that class, but I have not read #1133 closely enough to say so with
confidence — say the word and I will.

I have folded the AMD datapoint and the ordering finding into the issue body — see the status block at the
top. Thanks to @fma-rc for the diagnosis and the bisect, @fisherjoey for the vendor/Mesa comparison,
@oneandonlydean for the re-run ask, @adriadam10 for the partial-address note, and @blawesom for the
registration work.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6128087609 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6128087609). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-12T16:12:42Z. --- Thanks — that answers both of the questions this report ended on, and both came out the opposite way from what I was worried about. @fma-rc's diagnosis: the import happens *inside* `image->MarkDirty()` — the test zeroes the DCC keys, and (his words, "from reading, not run") clear-coded keys reach `HostImportFor` through `MarkDccUncompressed` and `StoreUncompressedOnGpu` — which is **one line before** the test takes `cached`. Taking `cached` first makes the section pass. So the assertion's ordering is wrong and the invalidation path it probes is fine: **a test bug, not an AGC cache bug**. On AMD: it reproduces. @fma-rc reproduced it on RADV (Radeon 610M, **Mesa 26.1.4**) as well as on the RTX 5080, so it was never NVIDIA-specific — I simply had one card here. Worth keeping in view, though: the comparing device in this thread (gfx1036, Mesa 26.2.1) takes the "compared" watch decision and the section never runs there, and why the two Mesa builds decide differently is still unexplained. On CI visibility: the binary *is* registered with ctest, but only for its flag-scoped sub-runs (`agc_pipeline_cache`, `agc_pipeline_library*`, `agc_unchanged_cpu_stamps`, `agc_host_import_unmap`). The **no-argument full run has no ctest entry**, and `staleGenerationTests` / `importWindowTests` are only reached by that full run — which is why neither device's failure was visible. My "built but not registered" was too broad. Where the thread stands: **#3103** (merged) hoists the checks above the `StorageTexture` constructor and fixes the `(s)` step's pending flush, and @adriadam10 reports the full run no longer stops at `(s)`/`(w)` on current `main` (checked on RADV). The remaining item is registering the full run — **#3354**, which the intake policy closed ten seconds after it opened, so it is not upstream yet. One thing still unanswered from the report: **#1133**. On the evidence above this reads as an ordinary test-ordering bug rather than that class, but I have not read #1133 closely enough to say so with confidence — say the word and I will. I have folded the AMD datapoint and the ordering finding into the issue body — see the status block at the top. Thanks to @fma-rc for the diagnosis and the bisect, @fisherjoey for the vendor/Mesa comparison, @oneandonlydean for the re-run ask, @adriadam10 for the partial-address note, and @blawesom for the registration work. Written with AI assistance.
fdfawef324 commented 2026-10-14 20:42:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-14T20:42:00Z.


Both parts look resolved on main e6ef803ce:

  • (w) stop: #3103 (merged 2026-10-11) takes cached before the StorageTexture is created (core/libs/prx/libSceAgcDriver/tests/Recorder.cpp:4870-4873); #3874 (merged 2026-10-13) then replaced the reported assertion with the import-window compare checks (:4888-4896) and reports the full run 3/3 on Linux RTX 4090.
  • CI: #5211 (merged 2026-10-14) registers the no-argument run as agc_driver_recorder (core/libs/prx/libSceAgcDriver/CMakeLists.txt:1094-1095), carrying #3354.

Verified by source check on main e6ef803ce only; I did not run the binary on NVIDIA. If @Dextroid17 confirms the full run passes on main, this can be closed.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6177999056 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6177999056). Originally posted by [fdfawef324](https://github.com/fdfawef324) on 2026-10-14T20:42:00Z. --- Both parts look resolved on `main` `e6ef803ce`: - `(w)` stop: #3103 (merged 2026-10-11) takes `cached` before the `StorageTexture` is created (`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp:4870-4873`); #3874 (merged 2026-10-13) then replaced the reported assertion with the import-window compare checks (:4888-4896) and reports the full run 3/3 on Linux RTX 4090. - CI: #5211 (merged 2026-10-14) registers the no-argument run as `agc_driver_recorder` (`core/libs/prx/libSceAgcDriver/CMakeLists.txt:1094-1095`), carrying #3354. Verified by source check on `main` `e6ef803ce` only; I did not run the binary on NVIDIA. If @Dextroid17 confirms the full run passes on `main`, this can be closed. AI-assisted: yes
Dextroid17 commented 2026-10-14 21:03:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-14T21:03:09Z.


Confirming on main 92b892f15 (CachyOS, Linux 7.2.9, lavapipe/llvmpipe Mesa 26.2.4), Release, no-argument agc_driver_recorder_tests, built explicitly (EXCLUDE_FROM_ALL):

The full run does not pass here. It exits 1, 3 of 3, at a later stop than the ones in this thread:

host imports are compared
batch stamps off
AGC graphics: (9) a scan under a pending write was kept     (tests/Recorder.cpp:1286)

So the (w) and (s) stops are gone, as reported above, but the full run is not green on lavapipe. I have not looked into (9) yet. Not established: whether it is a real failure or specific to this machine. My user is not in the kvm group that owns /dev/udmabuf, and I have not tested whether that matters.

CI: the comment above says #5211 registers the full run as agc_driver_recorder. That merge was reverted by c7b219364 (it needs /dev/udmabuf, which the self-hosted Linux runners lack), so on current main the no-argument run again has no ctest entry. Please don't close this on the registration claim.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6178445027 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6178445027). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-14T21:03:09Z. --- Confirming on main 92b892f15 (CachyOS, Linux 7.2.9, lavapipe/llvmpipe Mesa 26.2.4), Release, no-argument `agc_driver_recorder_tests`, built explicitly (EXCLUDE_FROM_ALL): The full run does not pass here. It exits 1, 3 of 3, at a later stop than the ones in this thread: host imports are compared batch stamps off AGC graphics: (9) a scan under a pending write was kept (tests/Recorder.cpp:1286) So the (w) and (s) stops are gone, as reported above, but the full run is not green on lavapipe. I have not looked into (9) yet. Not established: whether it is a real failure or specific to this machine. My user is not in the `kvm` group that owns /dev/udmabuf, and I have not tested whether that matters. CI: the comment above says #5211 registers the full run as `agc_driver_recorder`. That merge was reverted by c7b219364 (it needs /dev/udmabuf, which the self-hosted Linux runners lack), so on current main the no-argument run again has no ctest entry. Please don't close this on the registration claim. AI-assisted: yes
fma-rc commented 2026-10-14 22:23:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-14T22:23:01Z.


Same here on main b9d9ec605, and not only on lavapipe: the no-argument agc_driver_recorder_tests exits 1 at AGC graphics: (9) a scan under a pending write was kept 3 of 3 on NVIDIA RTX 5080 (615.78.08), RADV (Raphael iGPU) and lavapipe. My user is in kvm with access to /dev/udmabuf, so that is not what decides it.

The (9) check is the one 6bd076c19 rewrote ("an unknown pending write was not synchronized before proving keys"). That commit came in with #5211 and went out again with its revert c7b219364, while the driver behaviour it tested stayed on main. With only that hunk of 6bd076c19 applied on b9d9ec605, (9) passes and the run stops at the next check, AGC graphics: second draw observed overwritten input, 3 of 3 on all three devices. I have not looked into that one yet.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179826096 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6179826096). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-14T22:23:01Z. --- Same here on main b9d9ec605, and not only on lavapipe: the no-argument `agc_driver_recorder_tests` exits 1 at `AGC graphics: (9) a scan under a pending write was kept` 3 of 3 on NVIDIA RTX 5080 (615.78.08), RADV (Raphael iGPU) and lavapipe. My user is in `kvm` with access to /dev/udmabuf, so that is not what decides it. The (9) check is the one 6bd076c19 rewrote ("an unknown pending write was not synchronized before proving keys"). That commit came in with #5211 and went out again with its revert c7b219364, while the driver behaviour it tested stayed on main. With only that hunk of 6bd076c19 applied on b9d9ec605, (9) passes and the run stops at the next check, `AGC graphics: second draw observed overwritten input`, 3 of 3 on all three devices. I have not looked into that one yet.
Dextroid17 commented 2026-10-14 22:28:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-14T22:28:36Z.


Thanks for tracing (9) to the 6bd076c19 hunk. Your result answers the kvm question I left open: it is not what decides it.

Correction: my earlier comment said "Release", but my build used CMake's default (CMAKE_BUILD_TYPE empty, so unoptimized). I cannot prove what the cache held at the time of that run, but nothing I use sets it to Release. The stop was the same, (9) 3 of 3.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179923024 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6179923024). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-14T22:28:36Z. --- Thanks for tracing (9) to the 6bd076c19 hunk. Your result answers the kvm question I left open: it is not what decides it. Correction: my earlier comment said "Release", but my build used CMake's default (CMAKE_BUILD_TYPE empty, so unoptimized). I cannot prove what the cache held at the time of that run, but nothing I use sets it to Release. The stop was the same, (9) 3 of 3. AI-assisted: yes
fma-rc commented 2026-10-14 22:33:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-14T22:33:59Z.


The next stop, second draw observed overwritten input, bisects to the merge of #5906 (0ae1deb85): with the (9) hunk applied, the full run passes at its parent fa539dd9b and fails from the merge on (lavapipe; NVIDIA and RADV fail the same on b9d9ec605). Details are on that PR. Astro's Playroom with that PR's APS5_VERIFY_DRAW_SNAPSHOTS=1 shows 0 differing of 4.2 million checks, so I only see it in the test so far.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180014018 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6180014018). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-14T22:33:59Z. --- The next stop, `second draw observed overwritten input`, bisects to the merge of #5906 (0ae1deb85): with the (9) hunk applied, the full run passes at its parent fa539dd9b and fails from the merge on (lavapipe; NVIDIA and RADV fail the same on b9d9ec605). Details are on that PR. Astro's Playroom with that PR's `APS5_VERIFY_DRAW_SNAPSHOTS=1` shows 0 differing of 4.2 million checks, so I only see it in the test so far.
Dextroid17 commented 2026-10-14 22:50:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-14T22:50:29Z.


Following up on the three stops, on main eea428ca8 (CachyOS, Linux 7.2.9, lavapipe/llvmpipe, default CMake build with CMAKE_BUILD_TYPE empty, so unoptimized), no-argument agc_driver_recorder_tests, rebuilt each time:

  1. (9) a scan under a pending write was kept: as found above. A temporary print placed after the scan showed DescribePendingWrite returning nothing (info=0) and a non-zero generation (52). By reading DccMetadata.cpp, the scan's WaitForKeyWriters syncs through the unknown pending write, so the scan counts as stable and a proof is cached. That matches what 6bd076c19's rewrite expects ("synchronizes before caching a proof"). Applying that hunk (the same 4 added / 5 removed lines as #5883) clears it.
  2. second draw observed overwritten input (Recorder.cpp:1965): with (9) fixed, it passes at 11adb34bc (the parent of 98ce8af56) and fails at 98ce8af56 itself, 2 of 2 each, which agrees with fma-rc's bisect to #5906. The test does memset(element, 0x22, ...) with no GuestMemory::MarkWritten. Adding AgcDriver::GuestMemory::MarkWritten(element, elementBytes) after each of the two memsets clears it, 3 of 3.
  3. A third stop appears after that: the shader's patched offset into the draw snapshot misses the view's bytes (misalignedRegionTests). It does guest[offset + 8] ^= 0xffu; with no stamp. One MarkWritten(view, elementBytes) after it makes the full run exit 0, 3 of 3.

So with the (9) hunk plus 3 MarkWritten calls (7 added / 5 removed lines in tests/Recorder.cpp, tests only) the full run passes here. On fma-rc's question on #5906, "the test block is outside what the stamp covers, or the test needs updating": stamping the written block is enough on lavapipe, which points at the test, but that is my reading. It does not show the driver is correct for a CPU write that is not stamped.

Not checked: NVIDIA, RADV, Windows, a title, and whether other stops follow on those devices. I did not change any driver code. I can post the diff if useful.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180240968 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6180240968). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-14T22:50:29Z. --- Following up on the three stops, on main eea428ca8 (CachyOS, Linux 7.2.9, lavapipe/llvmpipe, default CMake build with CMAKE_BUILD_TYPE empty, so unoptimized), no-argument `agc_driver_recorder_tests`, rebuilt each time: 1. `(9) a scan under a pending write was kept`: as found above. A temporary print placed after the scan showed `DescribePendingWrite` returning nothing (info=0) and a non-zero generation (52). By reading DccMetadata.cpp, the scan's `WaitForKeyWriters` syncs through the unknown pending write, so the scan counts as stable and a proof is cached. That matches what 6bd076c19's rewrite expects ("synchronizes before caching a proof"). Applying that hunk (the same 4 added / 5 removed lines as #5883) clears it. 2. `second draw observed overwritten input` (Recorder.cpp:1965): with (9) fixed, it passes at 11adb34bc (the parent of 98ce8af56) and fails at 98ce8af56 itself, 2 of 2 each, which agrees with fma-rc's bisect to #5906. The test does `memset(element, 0x22, ...)` with no `GuestMemory::MarkWritten`. Adding `AgcDriver::GuestMemory::MarkWritten(element, elementBytes)` after each of the two memsets clears it, 3 of 3. 3. A third stop appears after that: `the shader's patched offset into the draw snapshot misses the view's bytes` (misalignedRegionTests). It does `guest[offset + 8] ^= 0xffu;` with no stamp. One `MarkWritten(view, elementBytes)` after it makes the full run exit 0, 3 of 3. So with the (9) hunk plus 3 `MarkWritten` calls (7 added / 5 removed lines in `tests/Recorder.cpp`, tests only) the full run passes here. On fma-rc's question on #5906, "the test block is outside what the stamp covers, or the test needs updating": stamping the written block is enough on lavapipe, which points at the test, but that is my reading. It does not show the driver is correct for a CPU write that is not stamped. Not checked: NVIDIA, RADV, Windows, a title, and whether other stops follow on those devices. I did not change any driver code. I can post the diff if useful. AI-assisted: yes
fma-rc commented 2026-10-14 23:27:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-14T23:27:41Z.


I rebuilt your change from the description (the (9) hunk of 6bd076c19, MarkWritten(element, elementBytes) after the 0x22 and 0x33 memsets in the snapshot test, MarkWritten(view, elementBytes) after guest[offset + 8] ^= 0xffu; 7 added, 5 removed in tests/Recorder.cpp) on main 2559e9623. The no-argument full run exits 0 with Recorder read tracking and label tests passed, 3 of 3 each on NVIDIA RTX 5080 (615.78.08), RADV (Raphael iGPU) and lavapipe. No further stop on any of them.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180745295 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6180745295). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-14T23:27:41Z. --- I rebuilt your change from the description (the (9) hunk of 6bd076c19, `MarkWritten(element, elementBytes)` after the 0x22 and 0x33 memsets in the snapshot test, `MarkWritten(view, elementBytes)` after `guest[offset + 8] ^= 0xffu`; 7 added, 5 removed in `tests/Recorder.cpp`) on main 2559e9623. The no-argument full run exits 0 with `Recorder read tracking and label tests passed`, 3 of 3 each on NVIDIA RTX 5080 (615.78.08), RADV (Raphael iGPU) and lavapipe. No further stop on any of them.
frankea commented 2026-10-15 22:11:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-15T22:11:37Z.


Windows/NVIDIA data point for the full run. agc_driver_recorder_tests with no arguments on main 31cbb55d7, Windows 11 (26200), RTX 4090 (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 r7, Release, run from build/tests with core/libs/libs/unpatched on PATH: exit 1 at

AGC graphics: (9) a scan under a pending write was kept

The (w) and (s) stops from the original report are gone here, as #3103 intended; the run reaches section (9), the same stop #6075 saw on an RTX 5060 and that was reported on lavapipe when #6075 was closed into this issue. The flag-scoped sub-runs that CTest registers (agc_pipeline_cache, agc_pipeline_library*, agc_import_watch) pass on this box. The write-watch probe line for the record: host imports of write-watched memory keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, ...).

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203337602 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6203337602). Originally posted by [frankea](https://github.com/frankea) on 2026-10-15T22:11:37Z. --- Windows/NVIDIA data point for the full run. `agc_driver_recorder_tests` with no arguments on `main` 31cbb55d7, Windows 11 (26200), RTX 4090 (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 r7, Release, run from `build/tests` with `core/libs/libs/unpatched` on `PATH`: exit 1 at ``` AGC graphics: (9) a scan under a pending write was kept ``` The `(w)` and `(s)` stops from the original report are gone here, as #3103 intended; the run reaches section (9), the same stop #6075 saw on an RTX 5060 and that was reported on lavapipe when #6075 was closed into this issue. The flag-scoped sub-runs that CTest registers (`agc_pipeline_cache`, `agc_pipeline_library*`, `agc_import_watch`) pass on this box. The write-watch probe line for the record: `host imports of write-watched memory keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, ...)`. AI-assisted: yes (Claude Code).
MarcZX10 commented 2026-10-16 00:54:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T00:54:22Z.


I opened PR #6642 to register the no-argument agc_driver_recorder_tests flow in CTest, with the Vulkan-unavailable skip code, a 30-second timeout, and the Windows libc DLL path. This carries forward the handoff from #3354; its author reported 3/3 full-run passes on RADV and all nine recorder CTest entries green. Here, conventions and git diff --check pass, but I could not configure or run locally because the SDL2 submodule is absent, XRandR support is unavailable, and the host has no /dev/dri device.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6205530607 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6205530607). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T00:54:22Z. --- I opened [PR #6642](https://github.com/boykopovar/AnyPS5/pull/6642) to register the no-argument `agc_driver_recorder_tests` flow in CTest, with the Vulkan-unavailable skip code, a 30-second timeout, and the Windows `libc` DLL path. This carries forward the handoff from #3354; its author reported 3/3 full-run passes on RADV and all nine recorder CTest entries green. Here, conventions and `git diff --check` pass, but I could not configure or run locally because the SDL2 submodule is absent, XRandR support is unavailable, and the host has no `/dev/dri` device.
juanpimg commented 2026-10-20 13:19:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by juanpimg on 2026-10-20T13:19:46Z.


While working on the remaining item of this issue I measured every flag-scoped mode of agc_driver_recorder_tests and of the two other flag-scoped driver tests, on two devices, and posted the registrations as #8445. The measurements may be useful to whoever picks the full run up, so here they are.

Devices

  • NVIDIA GeForce RTX 4060 Laptop GPU, driver 615.78.08, compute capability 8.9
  • Intel Iris Xe Graphics, Mesa 26.2.4 ANV, Vulkan 1.4.354

CachyOS Linux 7.2.9-2-cachyos, GCC 16.2.1, Release build, BUILD_TESTING=ON. The
default Vulkan enumeration on this machine shows both GPUs, so the device was selected
with VK_ICD_FILENAMES for the NVIDIA runs and with the default for the Intel runs.

Results, exit code and wall time (77 means skipped)

Mode NVIDIA Intel
agc_driver_recorder_tests --completion-labels-only 0, 0.21 s 0, 0.06 s
agc_driver_recorder_tests --cmask-only 0, 0.14 s 0, 0.08 s
agc_driver_recorder_tests --cube-only 0, 0.14 s 0, 0.10 s
agc_driver_store_idle_results_tests (bare) 0, 0.34 s 0, 0.45 s
agc_driver_store_idle_results_tests --idle-epoch-wake 0, 0.34 s 0, 0.27 s
agc_driver_stencil_ref_export_unused_tests (bare) 0, 0.28 s 0, 0.23 s
agc_driver_stencil_ref_export_unused_tests --case keep 0, 0.28 s 0, 0.23 s
agc_driver_stencil_ref_export_unused_tests --case invert 0, 0.28 s 0, 0.22 s

The three recorder modes cover completionCountTests, afterRecordedWorkTests,
directCompletionLabelTests, labelTests, lateLabelTests, largeLabelTests,
cmaskPassTests and singleCubeTests, which no ctest entry reached before.

A pre-existing failure worth separating from the registration work

The remaining six cases of agc_driver_stencil_ref_export_unused_tests — compare,
back-compare, replace, fail-replace, depth-fail-replace and partial-replace —
exit 1 with

AGC graphics: a dependent reference without native stencil export was admitted

The failure is identical on both devices, so it is not device specific: the test expects
the driver to refuse a dependent stencil reference that has no native stencil export, and
the driver admits it. It fails on main as well, independently of the registration work,
and it is the reason those six cases are not registered in #8445.

I have not touched the driver. If someone wants to take that refusal on, the case that
seems to expose it best is compare.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6291810121 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1532#issuecomment-6291810121). Originally posted by [juanpimg](https://github.com/juanpimg) on 2026-10-20T13:19:46Z. --- While working on the remaining item of this issue I measured every flag-scoped mode of `agc_driver_recorder_tests` and of the two other flag-scoped driver tests, on two devices, and posted the registrations as #8445. The measurements may be useful to whoever picks the full run up, so here they are. **Devices** - NVIDIA GeForce RTX 4060 Laptop GPU, driver 615.78.08, compute capability 8.9 - Intel Iris Xe Graphics, Mesa 26.2.4 ANV, Vulkan 1.4.354 CachyOS Linux 7.2.9-2-cachyos, GCC 16.2.1, Release build, `BUILD_TESTING=ON`. The default Vulkan enumeration on this machine shows both GPUs, so the device was selected with `VK_ICD_FILENAMES` for the NVIDIA runs and with the default for the Intel runs. **Results, exit code and wall time (77 means skipped)** | Mode | NVIDIA | Intel | |---|---|---| | `agc_driver_recorder_tests --completion-labels-only` | 0, 0.21 s | 0, 0.06 s | | `agc_driver_recorder_tests --cmask-only` | 0, 0.14 s | 0, 0.08 s | | `agc_driver_recorder_tests --cube-only` | 0, 0.14 s | 0, 0.10 s | | `agc_driver_store_idle_results_tests` (bare) | 0, 0.34 s | 0, 0.45 s | | `agc_driver_store_idle_results_tests --idle-epoch-wake` | 0, 0.34 s | 0, 0.27 s | | `agc_driver_stencil_ref_export_unused_tests` (bare) | 0, 0.28 s | 0, 0.23 s | | `agc_driver_stencil_ref_export_unused_tests --case keep` | 0, 0.28 s | 0, 0.23 s | | `agc_driver_stencil_ref_export_unused_tests --case invert` | 0, 0.28 s | 0, 0.22 s | The three recorder modes cover `completionCountTests`, `afterRecordedWorkTests`, `directCompletionLabelTests`, `labelTests`, `lateLabelTests`, `largeLabelTests`, `cmaskPassTests` and `singleCubeTests`, which no ctest entry reached before. **A pre-existing failure worth separating from the registration work** The remaining six cases of `agc_driver_stencil_ref_export_unused_tests` — `compare`, `back-compare`, `replace`, `fail-replace`, `depth-fail-replace` and `partial-replace` — exit 1 with ``` AGC graphics: a dependent reference without native stencil export was admitted ``` The failure is identical on both devices, so it is not device specific: the test expects the driver to refuse a dependent stencil reference that has no native stencil export, and the driver admits it. It fails on `main` as well, independently of the registration work, and it is the reason those six cases are not registered in #8445. I have not touched the driver. If someone wants to take that refusal on, the case that seems to expose it best is `compare`.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#1532
No description provided.