Repository navigation
fix(agc): exclude host arena holes from write-watch proofs - #3594
Merged
adriadam10 merged 1 commit intoOct 11, 2026
Merged
adriadam10 merged 1 commit into
adriadam10 merged 1 commit into
Conversation
Collaborator
|
Checked on Linux merged onto current main: libSceAgcDriver build and ctest (390/390, |
This was referenced Oct 11, 2026
9 tasks done
oneandonlydean
added a commit
that referenced
this pull request
Oct 12, 2026
StoredOver still read block stamps for a range in a host region inside the guest arena interval, which Watched reports as unwatched since #3594.
9 tasks done
Scramblrrrr
pushed a commit
to Scramblrrrr/AnyPS5
that referenced
this pull request
Oct 12, 2026
On Windows agc_write_tracking has failed since boykopovar#3594 with write tracking test failed: an unwatched range reads as not stored over from the check in CheckSharedBlock: if (!Watched(outside, unwatched.size())) Require(StoredOver(outside, unwatched.size(), TrackerGeneration()), "an unwatched range reads as not stored over"); The host stack array lies in a host hole of the guest arena. boykopovar#3594 made Watched, collectWrites, UnchangedSince, UnchangedSinceAll and storeOwn reject ranges overlapping such holes, but StoredOver, MarkWritten, WrittenSince, ChangedBlocks and ImportWatched still accepted them through WriteTracker::covers(), so StoredOver proved a range not stored over while Watched called it unwatched (boykopovar#4087). The exclusion now lives in WriteTracker::covers() on Windows, which every query already asks, and the per-function checks are removed. Host holes are padded to the allocation granularity and the tracker blocks are 64 KiB from the arena base, so no block is shared between a hole and arena memory, and ranges outside the holes get the same answers as before. A new case enumerates the arena for a host hole and checks every query against it; on the previous code StoredOver, MarkWritten, StoreOwnBytes, WrittenSince and ChangedBlocks fail it. Fixes boykopovar#4087 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Scramblrrrr
pushed a commit
to Scramblrrrr/AnyPS5
that referenced
this pull request
Oct 12, 2026
On Windows agc_write_tracking has failed since boykopovar#3594 with write tracking test failed: an unwatched range reads as not stored over from the check in CheckSharedBlock: if (!Watched(outside, unwatched.size())) Require(StoredOver(outside, unwatched.size(), TrackerGeneration()), "an unwatched range reads as not stored over"); The host stack array lies in a host hole of the guest arena. boykopovar#3594 made Watched, collectWrites, UnchangedSince, UnchangedSinceAll and storeOwn reject ranges overlapping such holes, but StoredOver, MarkWritten, WrittenSince, ChangedBlocks and ImportWatched still accepted them through WriteTracker::covers(), so StoredOver proved a range not stored over while Watched called it unwatched (boykopovar#4087). The exclusion now lives in WriteTracker::covers() on Windows, which every query already asks, and the per-function checks are removed. Host holes are padded to the allocation granularity and the tracker blocks are 64 KiB from the arena base, so no block is shared between a hole and arena memory, and ranges outside the holes get the same answers as before. A new case enumerates the arena for a host hole and checks every query against it; on the previous code StoredOver, MarkWritten, StoreOwnBytes, WrittenSince and ChangedBlocks fail it. Fixes boykopovar#4087 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
oneandonlydean
pushed a commit
that referenced
this pull request
Oct 12, 2026
On Windows agc_write_tracking has failed since #3594 with write tracking test failed: an unwatched range reads as not stored over from the check in CheckSharedBlock: if (!Watched(outside, unwatched.size())) Require(StoredOver(outside, unwatched.size(), TrackerGeneration()), "an unwatched range reads as not stored over"); The host stack array lies in a host hole of the guest arena. #3594 made Watched, collectWrites, UnchangedSince, UnchangedSinceAll and storeOwn reject ranges overlapping such holes, but StoredOver, MarkWritten, WrittenSince, ChangedBlocks and ImportWatched still accepted them through WriteTracker::covers(), so StoredOver proved a range not stored over while Watched called it unwatched (#4087). The exclusion now lives in WriteTracker::covers() on Windows, which every query already asks, and the per-function checks are removed. Host holes are padded to the allocation granularity and the tracker blocks are 64 KiB from the arena base, so no block is shared between a hole and arena memory, and ranges outside the holes get the same answers as before. A new case enumerates the arena for a host hole and checks every query against it; on the previous code StoredOver, MarkWritten, StoreOwnBytes, WrittenSince and ChangedBlocks fail it. Fixes #4087 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
10 tasks done
10 tasks done
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Windows reserves the guest arena around existing host mappings. WriteTracker initializes coverage for the arena address interval, including those excluded host regions. A range inside a host-owned hole can therefore be reported as write-watched and sent to GetWriteWatch even though it was not allocated with MEM_WRITE_WATCH. Native copied-read reuse testing exposed error 87; debugger address layouts did not reproduce it.
Reject host-region overlaps before collecting or accepting write-watch proofs, including bulk unchanged queries. Collection returns zero (tracking unavailable), and eligibility/unchanged proofs return false, so callers take their existing fresh-copy or comparison path. The existing store path already excludes these regions. No exception suppression or assumption that untracked memory is unchanged is introduced.
The Windows regression enumerates an actual host exclusion inside the arena rather than depending on ASLR placement of a heap allocation. It checks eligibility, collection and both unchanged-query APIs, plus ordinary host-heap rejection and unchanged bytes. Guest memory is not dereferenced during arena enumeration. Related #2863 optimizes queue-worker write-watch walks; this correction addresses excluded-region eligibility. Depends on: none.
Tested
Head 56d08f2, base main a11c8f7. Windows 11, Ryzen 7800X3D, Release MinGW GCC 15.2, SPIRV-Tools OFF.
agc_driver_graphics: PASS, final run 4.81 seconds.an arena host hole was reported as write-watched(0.36 seconds). Restored the fix, explicitly rebuilt, and repeated the passing test.The correction was also tested in the separate 007 performance integration: six selected Vulkan checks passed. That experimental stack and its title data are not part of this PR. Its game runs still hit a host-memory guard and no visible frame was verified; this fix does not establish playability or solve memory pressure.
Checklist