test(agc): stamp the guest writes the recorder tests make behind the driver's back #6155

Merged
Dextroid17 merged 1 commit from upstream-pr/6155 into main 2026-10-17 11:27:13 +00:00
Dextroid17 commented 2026-10-14 23:44:03 +00:00 (Migrated from github.com)

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


What

Three writes in agc_driver_recorder_tests change guest memory directly and never call GuestMemory::MarkWritten: the two memsets (0x22, 0x33) in resourceReadTests and guest[offset + 8] ^= 0xffu in misalignedRegionTests. Since 98ce8af56 (#5906, draw snapshot reuse) the draw snapshot trusts the stamp, so it hands back the old bytes and the checks second draw observed overwritten input and the shader's patched offset into the draw snapshot misses the view's bytes fail. This adds a MarkWritten after each write, 3 lines in tests/Recorder.cpp. No driver code changes.

This only shows on top of the (9) a scan under a pending write was kept fix, because that check stops the run first. That fix is #5883 (the same hunk as 6bd076c19), so this PR is stacked on it.

Discussion and the bisect: #1532.

Tested

  • Lavapipe (llvmpipe, Mesa 26.2.4, LLVM 23.1.1; CachyOS, Linux 7.2.9), default CMake build (CMAKE_BUILD_TYPE empty, so unoptimized), main ab9a47684. Branch plus the #5883 hunk: agc_driver_recorder_tests, no arguments, exit 0, Recorder read tracking and label tests passed, 3 of 3, about 2 s each.
  • Without the stamps (main plus the #5883 hunk only) the run stops at second draw observed overwritten input. With the two memsets stamped it stops next at the shader's patched offset into the draw snapshot misses the view's bytes (3 of 3, main eea428ca8). With the (9) hunk, the run passes at 11adb34bc (parent of 98ce8af56) and stops at second draw observed overwritten input at 98ce8af56, 2 of 2 each.
  • python tools/check_conventions.py --base upstream/main passes.
  • fma-rc reported the same change (rebuilt from my description on #1532) passing 3 of 3 on RTX 5080, RADV and lavapipe. I did not run those.
  • Not tested: this branch alone without the #5883 hunk (it stops at the (9) check), Windows, any title. This does not show the driver is correct for a CPU write that is not stamped; it only changes the test.

Checklist

  • Based on current main; no other open PR implements the same functions (#5883 is the (9) hunk only; it does not touch these writes)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code
  • Unimplemented paths throw: n/a
  • No notes or images added
  • No third-party code
  • Generic behaviour, not specific to one title
  • Depends on: #5883
  • Unblocks: none
  • GPUs tested: lavapipe (llvmpipe, Mesa 26.2.4), Linux
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4866052309 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6155). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-14T23:44:03Z. --- ### What Three writes in `agc_driver_recorder_tests` change guest memory directly and never call `GuestMemory::MarkWritten`: the two `memset`s (0x22, 0x33) in `resourceReadTests` and `guest[offset + 8] ^= 0xffu` in `misalignedRegionTests`. Since 98ce8af56 (#5906, draw snapshot reuse) the draw snapshot trusts the stamp, so it hands back the old bytes and the checks `second draw observed overwritten input` and `the shader's patched offset into the draw snapshot misses the view's bytes` fail. This adds a `MarkWritten` after each write, 3 lines in `tests/Recorder.cpp`. No driver code changes. This only shows on top of the `(9) a scan under a pending write was kept` fix, because that check stops the run first. That fix is #5883 (the same hunk as 6bd076c19), so this PR is stacked on it. Discussion and the bisect: #1532. ### Tested - Lavapipe (llvmpipe, Mesa 26.2.4, LLVM 23.1.1; CachyOS, Linux 7.2.9), default CMake build (CMAKE_BUILD_TYPE empty, so unoptimized), main ab9a47684. Branch plus the #5883 hunk: `agc_driver_recorder_tests`, no arguments, exit 0, `Recorder read tracking and label tests passed`, 3 of 3, about 2 s each. - Without the stamps (main plus the #5883 hunk only) the run stops at `second draw observed overwritten input`. With the two memsets stamped it stops next at `the shader's patched offset into the draw snapshot misses the view's bytes` (3 of 3, main eea428ca8). With the (9) hunk, the run passes at 11adb34bc (parent of 98ce8af56) and stops at `second draw observed overwritten input` at 98ce8af56, 2 of 2 each. - `python tools/check_conventions.py --base upstream/main` passes. - fma-rc reported the same change (rebuilt from my description on #1532) passing 3 of 3 on RTX 5080, RADV and lavapipe. I did not run those. - Not tested: this branch alone without the #5883 hunk (it stops at the (9) check), Windows, any title. This does not show the driver is correct for a CPU write that is not stamped; it only changes the test. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (#5883 is the (9) hunk only; it does not touch these writes) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code - [x] Unimplemented paths throw: n/a - [x] No notes or images added - [x] No third-party code - [x] Generic behaviour, not specific to one title - [x] Depends on: #5883 - [x] Unblocks: none - [x] GPUs tested: lavapipe (llvmpipe, Mesa 26.2.4), Linux - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-15 12:15:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:15: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.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5021 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6222 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6373 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6747 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6946 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6947 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191813519 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6155#issuecomment-6191813519). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:15:39Z. --- <!-- pr-overlap --> 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. | Pull request | Shared files not compared | |---|---| | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6222](https://www.github.com/boykopovar/AnyPS5/pull/6222) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6373](https://www.github.com/boykopovar/AnyPS5/pull/6373) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` |
Sign in to join this conversation.
No reviewers
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!6155
No description provided.