fix(agc): save pending results when a fresh write collect fails #7432

Merged
MarcZX10 merged 3 commits from upstream-pr/7432 into main 2026-10-19 21:43:49 +00:00
MarcZX10 commented 2026-10-18 06:18:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T06:18:48Z.


What

Carries plokmklo’s two commits from contrib/7017-palworld, preserving the original commit authorship, and rebases the fix onto current main.

When MarkWritten cannot collect fresh write-watch data for a covered 64 KiB block, it now releases the tracker lock, runs the existing unwatch hook over that block, then reacquires the lock before removing the range from the watch. This saves pending storage-image bytes before they become inaccessible to the write tracker. A Windows-only regression makes the fresh collect fail over a PAGE_NOACCESS page and checks that the hook covers the affected block without unwinding neighboring blocks.

This addresses the failed-collect path reported in #7017. It does not claim to reproduce Palworld’s title run or resolve the other unsaved-result paths described there. It is distinct from #6308’s import-fallback path and #7048’s storage-image write-back handling; those PRs touch adjacent code and should be reviewed together for composition.

Tested

  • git diff --check upstream/main...HEAD passes.
  • python3 tools/check_conventions.py --base upstream/main passes.
  • The new regression is Windows-only and has not been run locally; Windows CI is needed to exercise its PAGE_NOACCESS collect failure.

Checklist

  • Based on current main; no open PR implements the failed-collect path
  • One topic per PR
  • No comments in code except technical debt
  • No notes or investigation files added
  • Third-party code unchanged
  • Generic behavior, not title-specific
  • Depends on: none
  • Related: #7017, #6308, #7048
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4906897814 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T06:18:48Z. --- ### What Carries plokmklo’s two commits from `contrib/7017-palworld`, preserving the original commit authorship, and rebases the fix onto current `main`. When `MarkWritten` cannot collect fresh write-watch data for a covered 64 KiB block, it now releases the tracker lock, runs the existing unwatch hook over that block, then reacquires the lock before removing the range from the watch. This saves pending storage-image bytes before they become inaccessible to the write tracker. A Windows-only regression makes the fresh collect fail over a `PAGE_NOACCESS` page and checks that the hook covers the affected block without unwinding neighboring blocks. This addresses the failed-collect path reported in #7017. It does not claim to reproduce Palworld’s title run or resolve the other unsaved-result paths described there. It is distinct from #6308’s import-fallback path and #7048’s storage-image write-back handling; those PRs touch adjacent code and should be reviewed together for composition. ### Tested - `git diff --check upstream/main...HEAD` passes. - `python3 tools/check_conventions.py --base upstream/main` passes. - The new regression is Windows-only and has not been run locally; Windows CI is needed to exercise its `PAGE_NOACCESS` collect failure. ### Checklist - [x] Based on current `main`; no open PR implements the failed-collect path - [x] One topic per PR - [x] No comments in code except technical debt - [x] No notes or investigation files added - [x] Third-party code unchanged - [x] Generic behavior, not title-specific - [x] Depends on: none - [x] Related: #7017, #6308, #7048 - [x] AI-assisted: yes
MarcZX10 commented 2026-10-18 06:20:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T06:20:18Z.


I rebased the two contributor-authored commits onto current main (ccb0c0926); both commit authors remain plokmklo. Current checks pass for conventions, eligibility, intake, and reporting. The Build workflow skips all build jobs because its write-watch path selector does not include core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp. A manual dispatch is also unavailable to this account (GitHub returned 403: admin rights required). The Windows-only regression therefore still needs a maintainer-enabled Windows run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246499877 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432#issuecomment-6246499877). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T06:20:18Z. --- I rebased the two contributor-authored commits onto current `main` (`ccb0c0926`); both commit authors remain plokmklo. Current checks pass for conventions, eligibility, intake, and reporting. The Build workflow skips all build jobs because its write-watch path selector does not include `core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp`. A manual dispatch is also unavailable to this account (GitHub returned 403: admin rights required). The Windows-only regression therefore still needs a maintainer-enabled Windows run.
github-actions[bot] commented 2026-10-18 06:28:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T06:28:43Z.


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
PR 6926 docs/dev/debt/libSceAgcDriver.md L95-96
PR 7371 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp L1667

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 2434 docs/dev/debt/libSceAgcDriver.md
PR 4448 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
docs/dev/debt/libSceAgcDriver.md
PR 4449 docs/dev/debt/libSceAgcDriver.md
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5499 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6146 docs/dev/debt/libSceAgcDriver.md
PR 6185 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6187 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6209 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6252 docs/dev/debt/libSceAgcDriver.md
PR 6273 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6280 docs/dev/debt/libSceAgcDriver.md
PR 6292 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6557 docs/dev/debt/libSceAgcDriver.md
PR 6615 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6636 docs/dev/debt/libSceAgcDriver.md
PR 6683 docs/dev/debt/libSceAgcDriver.md
PR 6718 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6727 docs/dev/debt/libSceAgcDriver.md
PR 6730 docs/dev/debt/libSceAgcDriver.md
PR 6759 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6808 docs/dev/debt/libSceAgcDriver.md
PR 6820 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6946 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6947 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6960 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6977 docs/dev/debt/libSceAgcDriver.md
PR 7201 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7256 docs/dev/debt/libSceAgcDriver.md
PR 7332 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7446 docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7505 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7533 docs/dev/debt/libSceAgcDriver.md
PR 7579 docs/dev/debt/libSceAgcDriver.md
PR 7600 docs/dev/debt/libSceAgcDriver.md
PR 7604 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7615 core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7618 docs/dev/debt/libSceAgcDriver.md
PR 7642 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7800 docs/dev/debt/libSceAgcDriver.md
PR 7844 docs/dev/debt/libSceAgcDriver.md
PR 7927 docs/dev/debt/libSceAgcDriver.md
PR 7978 docs/dev/debt/libSceAgcDriver.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246566584 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432#issuecomment-6246566584). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-18T06:28:43Z. --- <!-- 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 | |---|---|---|---| | [PR 6926](https://www.github.com/boykopovar/AnyPS5/pull/6926) | `docs/dev/debt/libSceAgcDriver.md` [L95-96](https://github.com/boykopovar/AnyPS5/blob/bf2c63f853e173c860d3469136dbe5a9f0739ef2/docs/dev/debt/libSceAgcDriver.md#L95-L96) | | | | [PR 7371](https://www.github.com/boykopovar/AnyPS5/pull/7371) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` [L1667](https://github.com/boykopovar/AnyPS5/blob/bf2c63f853e173c860d3469136dbe5a9f0739ef2/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp#L1667) | | | 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 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 4449](https://www.github.com/boykopovar/AnyPS5/pull/4449) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 5058](https://www.github.com/boykopovar/AnyPS5/pull/5058) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5372](https://www.github.com/boykopovar/AnyPS5/pull/5372) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6146](https://www.github.com/boykopovar/AnyPS5/pull/6146) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6187](https://www.github.com/boykopovar/AnyPS5/pull/6187) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6194](https://www.github.com/boykopovar/AnyPS5/pull/6194) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6209](https://www.github.com/boykopovar/AnyPS5/pull/6209) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6223](https://www.github.com/boykopovar/AnyPS5/pull/6223) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6252](https://www.github.com/boykopovar/AnyPS5/pull/6252) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6273](https://www.github.com/boykopovar/AnyPS5/pull/6273) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6548](https://www.github.com/boykopovar/AnyPS5/pull/6548) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6549](https://www.github.com/boykopovar/AnyPS5/pull/6549) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6557](https://www.github.com/boykopovar/AnyPS5/pull/6557) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6636](https://www.github.com/boykopovar/AnyPS5/pull/6636) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6683](https://www.github.com/boykopovar/AnyPS5/pull/6683) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6718](https://www.github.com/boykopovar/AnyPS5/pull/6718) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6727](https://www.github.com/boykopovar/AnyPS5/pull/6727) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6730](https://www.github.com/boykopovar/AnyPS5/pull/6730) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6759](https://www.github.com/boykopovar/AnyPS5/pull/6759) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6820](https://www.github.com/boykopovar/AnyPS5/pull/6820) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6867](https://www.github.com/boykopovar/AnyPS5/pull/6867) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6960](https://www.github.com/boykopovar/AnyPS5/pull/6960) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7256](https://www.github.com/boykopovar/AnyPS5/pull/7256) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7446](https://www.github.com/boykopovar/AnyPS5/pull/7446) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7449](https://www.github.com/boykopovar/AnyPS5/pull/7449) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7505](https://www.github.com/boykopovar/AnyPS5/pull/7505) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7533](https://www.github.com/boykopovar/AnyPS5/pull/7533) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7579](https://www.github.com/boykopovar/AnyPS5/pull/7579) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7600](https://www.github.com/boykopovar/AnyPS5/pull/7600) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7615](https://www.github.com/boykopovar/AnyPS5/pull/7615) | `core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7618](https://www.github.com/boykopovar/AnyPS5/pull/7618) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7800](https://www.github.com/boykopovar/AnyPS5/pull/7800) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7844](https://www.github.com/boykopovar/AnyPS5/pull/7844) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7927](https://www.github.com/boykopovar/AnyPS5/pull/7927) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7978](https://www.github.com/boykopovar/AnyPS5/pull/7978) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8014](https://www.github.com/boykopovar/AnyPS5/pull/8014) | `docs/dev/debt/libSceAgcDriver.md` |
MarcZX10 commented 2026-10-18 12:03:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T12:03:51Z.


Rebased onto current main at 0d078f75d. Both original commits remain authored by plokmklo. I resolved the debt-doc overlap against the current wording and kept this PR’s additional case where results land after the range left the watch while nothing was pending. git diff --check upstream/main...HEAD and python3 tools/check_conventions.py --base upstream/main pass. The Windows-only failed-collect regression still needs a Windows run; the current Linux host cannot exercise Windows write-watch behavior.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6249689158 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432#issuecomment-6249689158). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T12:03:51Z. --- Rebased onto current `main` at `0d078f75d`. Both original commits remain authored by plokmklo. I resolved the debt-doc overlap against the current wording and kept this PR’s additional case where results land after the range left the watch while nothing was pending. `git diff --check upstream/main...HEAD` and `python3 tools/check_conventions.py --base upstream/main` pass. The Windows-only failed-collect regression still needs a Windows run; the current Linux host cannot exercise Windows write-watch behavior.
LeandroLP23 commented 2026-10-18 16:13:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T16:13:25Z.


Windows run of the new regression: it fails, and on main the rest of agc_write_tracking passes.

Radeon 860M (RDNA 3.5), Ryzen AI 7 350, Windows 11 26300, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. main 6efb7261b with #7432, #6912 and #6893 merged on top (no conflicts, disjoint files).

Build agc_write_tracking
main (test file without CheckFailedCollectUnwatch) passes, 3/3
+ this PR (fda9dc9f6) fails, 3/3: write tracking test failed: a collect that failed over a no-access page still produced trusted stamps

So MarkWritten returned a nonzero generation: the fresh collect completed over the PAGE_NOACCESS page instead of failing. On Windows MarkWritten collects through collectWindowsWrites and GuestArenaCollectFreshWrites_nid_postfix, not GuestWriteWatchCollectFresh_nid_postfix. That goes to WindowsMappings::collectResident with Collection::Fresh, which skips GetWriteWatch and reports pages from the collected bitmap. Nothing there reads the page protection, so changing it with GuestArenaSetProtection_nid_postfix does not make the collect fail. The fix's !complete branch is not reached by this test on Windows. It needs another way to make the Windows collect return false, or a test seam on the collect itself.

AI-assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252141057 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432#issuecomment-6252141057). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-18T16:13:25Z. --- Windows run of the new regression: it fails, and on `main` the rest of `agc_write_tracking` passes. Radeon 860M (RDNA 3.5), Ryzen AI 7 350, Windows 11 26300, WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`. `main` `6efb7261b` with #7432, #6912 and #6893 merged on top (no conflicts, disjoint files). | Build | `agc_write_tracking` | |---|---| | `main` (test file without `CheckFailedCollectUnwatch`) | passes, 3/3 | | + this PR (`fda9dc9f6`) | fails, 3/3: `write tracking test failed: a collect that failed over a no-access page still produced trusted stamps` | So `MarkWritten` returned a nonzero generation: the fresh collect completed over the `PAGE_NOACCESS` page instead of failing. On Windows `MarkWritten` collects through `collectWindowsWrites` and `GuestArenaCollectFreshWrites_nid_postfix`, not `GuestWriteWatchCollectFresh_nid_postfix`. That goes to `WindowsMappings::collectResident` with `Collection::Fresh`, which skips `GetWriteWatch` and reports pages from the collected bitmap. Nothing there reads the page protection, so changing it with `GuestArenaSetProtection_nid_postfix` does not make the collect fail. The fix's `!complete` branch is not reached by this test on Windows. It needs another way to make the Windows collect return false, or a test seam on the collect itself. AI-assisted
MarcZX10 commented 2026-10-18 17:27:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T17:27:55Z.


Thanks for testing this on Windows. The no-access-page setup was not a valid way to force GuestArenaCollectFreshWrites to fail: the Windows fresh collector intentionally enumerates its collected bitmap without checking page protection. I replaced that setup with a Windows-only fresh-collect test hook, so the regression deterministically exercises the actual !complete branch. It still verifies that MarkWritten returns no trusted generation, the affected block is unwatched, neighboring blocks remain watched, and the pre-unwatch hook receives the block span. The Linux and MinGW WriteTracking test translation units compile; the Windows GuestMemory translation unit also cross-compiles when using a temporary compatibility shim for this container's older MinGW PROCESSOR_RELATIONSHIP::EfficiencyClass headers. Conventions and diff checks pass against current upstream main. The full Windows test still needs a native run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252912754 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432#issuecomment-6252912754). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T17:27:55Z. --- Thanks for testing this on Windows. The no-access-page setup was not a valid way to force `GuestArenaCollectFreshWrites` to fail: the Windows fresh collector intentionally enumerates its collected bitmap without checking page protection. I replaced that setup with a Windows-only fresh-collect test hook, so the regression deterministically exercises the actual `!complete` branch. It still verifies that `MarkWritten` returns no trusted generation, the affected block is unwatched, neighboring blocks remain watched, and the pre-unwatch hook receives the block span. The Linux and MinGW WriteTracking test translation units compile; the Windows GuestMemory translation unit also cross-compiles when using a temporary compatibility shim for this container's older MinGW `PROCESSOR_RELATIONSHIP::EfficiencyClass` headers. Conventions and diff checks pass against current upstream main. The full Windows test still needs a native run.
LeandroLP23 commented 2026-10-18 17:32:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T17:32:20Z.


Native Windows run of 9485188a1, merged alone onto main 6efb7261b (clean). Radeon 860M, Windows 11 26300, WinLibs GCC 15.2.0 r7, Release.

Build agc_write_tracking
this PR passes, 3/3
this PR with only the three beforeUnwatch lines in MarkWritten removed (hook and test kept) fails: write tracking test failed: a failed collect did not run the unwatch hook over its block

So the fresh-collect hook now reaches the !complete branch on Windows, and the test catches the change.

AI-assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252957582 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432#issuecomment-6252957582). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-18T17:32:20Z. --- Native Windows run of `9485188a1`, merged alone onto `main` `6efb7261b` (clean). Radeon 860M, Windows 11 26300, WinLibs GCC 15.2.0 r7, Release. | Build | `agc_write_tracking` | |---|---| | this PR | passes, 3/3 | | this PR with only the three `beforeUnwatch` lines in `MarkWritten` removed (hook and test kept) | fails: `write tracking test failed: a failed collect did not run the unwatch hook over its block` | So the fresh-collect hook now reaches the `!complete` branch on Windows, and the test catches the change. AI-assisted
MarcZX10 commented 2026-10-18 18:44:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T18:44:00Z.


Thanks for the native Windows retest. The 3/3 pass on 9485188a1, plus the negative control failing when the three beforeUnwatch lines are removed, confirms the regression reaches and protects the !complete path on Windows. This resolves the Windows-specific validation gap I noted earlier. I have not rerun the test locally; this is your reported Radeon 860M / Windows 11 26300 / WinLibs GCC 15.2.0 result.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6253692934 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432#issuecomment-6253692934). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T18:44:00Z. --- Thanks for the native Windows retest. The 3/3 pass on `9485188a1`, plus the negative control failing when the three `beforeUnwatch` lines are removed, confirms the regression reaches and protects the `!complete` path on Windows. This resolves the Windows-specific validation gap I noted earlier. I have not rerun the test locally; this is your reported Radeon 860M / Windows 11 26300 / WinLibs GCC 15.2.0 result.
savvaniss commented 2026-10-19 06:35:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T06:35:48Z.


Intel and AMD Windows data: agc_write_tracking passes with this PR on an Intel UHD 770 and an AMD RX 9070 XT.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, with VkCache emptied first. This head 9485188a1 merged into main 07377573f.

Tests, ×3 UHD 770 RX 9070 XT
This head: agc_write_tracking pass pass

The test files don't build on main without the rest of the PR, so there is no before-run.

I also ran full CTest with this PR and the 13 other open AGC and shader PRs I tested in the same batch merged together (#7668, #7659, #7504, #7426, #7413, #7480, #7465, #7466, #7464, #7449, #7489, #7673, #7560). Neither GPU showed a failure beyond main's own: the five image-table tests (#6647) and agc_driver_sample_multisample_target (#6957) on the UHD 770, and agc_driver_layered_volume_vertex_no_gpl (#4768) on the RX 9070 XT.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6261242519 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432#issuecomment-6261242519). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-19T06:35:48Z. --- Intel and AMD Windows data: `agc_write_tracking` passes with this PR on an Intel UHD 770 and an AMD RX 9070 XT. Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, `ANYPS5_NO_SHADER_CACHE=1`, serial CTest. Intel UHD Graphics 770 (`8086:a780`), driver 32.0.101.7088. AMD Radeon RX 9070 XT (`1002:7550`), driver 32.0.31041.1004, with `VkCache` emptied first. This head `9485188a1` merged into `main` `07377573f`. | Tests, ×3 | UHD 770 | RX 9070 XT | |---|---|---| | This head: `agc_write_tracking` | pass | pass | The test files don't build on `main` without the rest of the PR, so there is no before-run. I also ran full CTest with this PR and the 13 other open AGC and shader PRs I tested in the same batch merged together (#7668, #7659, #7504, #7426, #7413, #7480, #7465, #7466, #7464, #7449, #7489, #7673, #7560). Neither GPU showed a failure beyond `main`'s own: the five image-table tests (#6647) and `agc_driver_sample_multisample_target` (#6957) on the UHD 770, and `agc_driver_layered_volume_vertex_no_gpl` (#4768) on the RX 9070 XT. AI-assisted: yes (Claude Code)
blawesom commented 2026-10-19 08:10:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-19T08:10:38Z.


Rebase handoff — rebased onto current main (authorship unchanged). One docs conflict: the debt entry now carries main's newer explicit-size file-writes sentence alongside your rewritten unwatch-hook paragraph.

One judgment call to review: your fix commit as authored also deleted main's unrelated "Windows host-pointer imports…" debt line — unrelated to this change and unmentioned in the message — so I restored it in the rebase. If the deletion was intentional, drop the line again when you pick it up.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; conventions pass; full suite green apart from the four known main regressions (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/7432
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 3a2906e3c.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6262692161 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432#issuecomment-6262692161). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-19T08:10:38Z. --- **Rebase handoff** — rebased onto current `main` (authorship unchanged). One docs conflict: the debt entry now carries `main`'s newer explicit-size file-writes sentence alongside your rewritten unwatch-hook paragraph. **One judgment call to review:** your fix commit as authored also deleted `main`'s unrelated "Windows host-pointer imports…" debt line — unrelated to this change and unmentioned in the message — so I restored it in the rebase. If the deletion was intentional, drop the line again when you pick it up. Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV): builds; conventions pass; **full suite green apart from the four known `main` regressions** (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR. **To pick it up:** ``` git fetch https://github.com/blawesom/AnyPS5 rebase/7432 git checkout <your branch> git merge --ff-only FETCH_HEAD ``` Head is `3a2906e3c`.
MarcZX10 commented 2026-10-19 16:52:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T16:52:21Z.


Thank you for preparing the rebase and running the full Linux suite. I agree the unrelated “Windows host-pointer imports” debt entry should be preserved. I have not yet adopted the handoff branch, so I’ll inspect its diff and current base before claiming the PR includes that rebase. The reported agc_write_tracking passes on both Windows GPUs are useful; the full-suite result also clearly isolates the four known main failures.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6272478656 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432#issuecomment-6272478656). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T16:52:21Z. --- Thank you for preparing the rebase and running the full Linux suite. I agree the unrelated “Windows host-pointer imports” debt entry should be preserved. I have not yet adopted the handoff branch, so I’ll inspect its diff and current base before claiming the PR includes that rebase. The reported `agc_write_tracking` passes on both Windows GPUs are useful; the full-suite result also clearly isolates the four known main failures.
MarcZX10 commented 2026-10-19 19:32:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T19:32:41Z.


I inspected the current PR diff at 0e03a753cd07. The unrelated “Windows host-pointer imports” debt entry is still present; the docs change is limited to the pending storage-image results entry. The latest head also includes the failed-collection regression test commit. That resolves the preservation concern I raised earlier.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6275569037 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432#issuecomment-6275569037). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T19:32:41Z. --- I inspected the current PR diff at `0e03a753cd07`. The unrelated “Windows host-pointer imports” debt entry is still present; the docs change is limited to the pending storage-image results entry. The latest head also includes the failed-collection regression test commit. That resolves the preservation concern I raised earlier.
adriadam10 commented 2026-10-19 21:44:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T21:44:14Z.


Rebased onto current main (conflict in docs/dev/debt/libSceAgcDriver.md) and restored the "Windows host-pointer imports…" debt line that the debt commit deleted without mention; the unwatch-hook paragraph is kept as written. Checked the lock release/reacquire around beforeUnwatch in MarkWritten and the Windows regression, confirmed by the native Windows runs here (passes; fails with the hook calls removed); merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278068218 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7432#issuecomment-6278068218). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T21:44:14Z. --- Rebased onto current `main` (conflict in `docs/dev/debt/libSceAgcDriver.md`) and restored the "Windows host-pointer imports…" debt line that the debt commit deleted without mention; the unwatch-hook paragraph is kept as written. Checked the lock release/reacquire around `beforeUnwatch` in `MarkWritten` and the Windows regression, confirmed by the native Windows runs here (passes; fails with the hook calls removed); merged.
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!7432
No description provided.