test(agc): skip the arena host hole checks when no host region lies in the arena #4660

Closed
kr4y4 wants to merge 1 commit from upstream-pr/4660 into main
kr4y4 commented 2026-10-12 18:15:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kr4y4 on 2026-10-12T18:15:19Z.


What

agc_driver_graphics sometimes fails on Windows with write-watched arena contained no host exclusion to test, from hostWriteWatchExclusionTests in BdaResources.cpp (#3594). The check needs a host region inside the guest arena, and whether there is one depends on the process's address layout.

  • On Windows the arena is reserved before main runs. Its host regions are whatever the process had already mapped in [0x2_0000_0000, 0xFC_0000_0000). In my runs they were 2 MiB private reservations with a few committed pages, at addresses that changed with every start.
  • I printed the count from Arena() (a local change, not part of this PR) over 200 starts of agc_driver_graphics_tests.exe on main 2a5eca11c. 5 starts had no host region; the others had 14 to 16. Those 5 starts fail the check.
  • #4584's description reports the same failure in 2 of 10 runs.

The check now prints that the arena host holes were not tested when there is no host region, as the file already does when write watch or the arena is unavailable. When there is one, which is most starts, it runs as before. The host heap checks after it always run.

Tested

Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, main 2a5eca11c, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU.

  • Before: this check failed agc_driver_graphics twice on the RTX 4070 in my runs of two unrelated pull requests, which don't touch the arena. On plain main it passed 25 of 25 runs on each GPU, which fits a rate of about 2.5 %.
  • After: agc_driver_graphics passes on both GPUs with --repeat until-fail:3.
  • I also forced the "no host region" case locally, by making the loop never match a host region. The test then prints the new line and the rest of agc_driver_graphics passes on both GPUs.
  • tools/check_conventions.py --base origin/main passes, and tools/pr_overlap.py finds no overlap with open pull requests.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4833311213 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4660). Originally posted by [kr4y4](https://github.com/kr4y4) on 2026-10-12T18:15:19Z. --- ### What `agc_driver_graphics` sometimes fails on Windows with `write-watched arena contained no host exclusion to test`, from `hostWriteWatchExclusionTests` in `BdaResources.cpp` (#3594). The check needs a host region inside the guest arena, and whether there is one depends on the process's address layout. - On Windows the arena is reserved before `main` runs. Its host regions are whatever the process had already mapped in [0x2_0000_0000, 0xFC_0000_0000). In my runs they were 2 MiB private reservations with a few committed pages, at addresses that changed with every start. - I printed the count from `Arena()` (a local change, not part of this PR) over 200 starts of `agc_driver_graphics_tests.exe` on `main` 2a5eca11c. 5 starts had no host region; the others had 14 to 16. Those 5 starts fail the check. - #4584's description reports the same failure in 2 of 10 runs. The check now prints that the arena host holes were not tested when there is no host region, as the file already does when write watch or the arena is unavailable. When there is one, which is most starts, it runs as before. The host heap checks after it always run. ### Tested Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, `main` 2a5eca11c, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. - Before: this check failed `agc_driver_graphics` twice on the RTX 4070 in my runs of two unrelated pull requests, which don't touch the arena. On plain `main` it passed 25 of 25 runs on each GPU, which fits a rate of about 2.5 %. - After: `agc_driver_graphics` passes on both GPUs with `--repeat until-fail:3`. - I also forced the "no host region" case locally, by making the loop never match a host region. The test then prints the new line and the rest of `agc_driver_graphics` passes on both GPUs. - `tools/check_conventions.py --base origin/main` passes, and `tools/pr_overlap.py` finds no overlap with open pull requests. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
xXPBSXx commented 2026-10-12 20:35:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T20:35:38Z.


Windows test of #4660 (MinGW GCC, Release, Windows 10, RTX 4080 SUPER, agc_driver_graphics through ctest, main 0428328b7 + this PR):

  • With the change: 30 runs, 30 passed. The new line arena host holes not tested did not appear in any of them, so the "no host region" case was not hit and the new branch itself was not exercised in my runs.
  • Plain main, same machine: earlier today 2 failures in 10 runs (3e0e01f35), and 0 failures in 23 later runs (44ab0c39e); I stopped the later series at 23 because a game was started. Together 2 in 33. Across all the failures I saw today (3 including one on the line-strip branch), I read the final message in one case only: it was write-watched arena contained no host exclusion to test, as this PR describes; for the others I only saw the vkAllocateMemory lines, so I can't say they were the same failure.
  • The [gpu] host import ... failed at vkAllocateMemory (-2); falling back to copies lines also appear in the passing runs (30 of 30 here, 23 of 23 on main), so they are not related to this failure.

Not tested: the skip path was not forced here.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6132168075 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4660#issuecomment-6132168075). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T20:35:38Z. --- Windows test of #4660 (MinGW GCC, Release, Windows 10, RTX 4080 SUPER, `agc_driver_graphics` through ctest, main `0428328b7` + this PR): - With the change: 30 runs, 30 passed. The new line `arena host holes not tested` did not appear in any of them, so the "no host region" case was not hit and the new branch itself was not exercised in my runs. - Plain `main`, same machine: earlier today 2 failures in 10 runs (`3e0e01f35`), and 0 failures in 23 later runs (`44ab0c39e`); I stopped the later series at 23 because a game was started. Together 2 in 33. Across all the failures I saw today (3 including one on the line-strip branch), I read the final message in one case only: it was `write-watched arena contained no host exclusion to test`, as this PR describes; for the others I only saw the `vkAllocateMemory` lines, so I can't say they were the same failure. - The `[gpu] host import ... failed at vkAllocateMemory (-2); falling back to copies` lines also appear in the passing runs (30 of 30 here, 23 of 23 on `main`), so they are not related to this failure. Not tested: the skip path was not forced here. AI-assisted (Claude Code).
github-actions[bot] commented 2026-10-12 20:44:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T20:44:16Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#4746 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp L807-829
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6132292867 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4660#issuecomment-6132292867). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T20:44:16Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #4746 | `core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` [L807-829](https://github.com/boykopovar/AnyPS5/blob/5f01c808219237ba9bdcbf02f6e1db5075fd61a9/core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp#L807-L829) | | |
kr4y4 commented 2026-10-12 21:08:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kr4y4 on 2026-10-12T21:08:10Z.


Closing in favor of #4746, which reserves the host hole so the check runs on every start instead of being skipped. The Windows results are in https://github.com/boykopovar/AnyPS5/pull/4746#issuecomment-6132622925.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6132633670 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4660#issuecomment-6132633670). Originally posted by [kr4y4](https://github.com/kr4y4) on 2026-10-12T21:08:10Z. --- Closing in favor of #4746, which reserves the host hole so the check runs on every start instead of being skipped. The Windows results are in https://github.com/boykopovar/AnyPS5/pull/4746#issuecomment-6132622925. Written with AI assistance.

Pull request closed

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!4660
No description provided.