You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On macOS, an empty write-watch range at an unaligned address was rounded out to its containing page before checking its length. Registering or unregistering zero bytes could change coverage; an empty protection notification could change the recorded page protection; and an empty host-write end could remove a real active write on that page, allowing collection to protect it prematurely.
Check the original range before page rounding in registration, unregistration, protection changes and host-write begin/end. Keep the existing check after rounding. No Linux or Windows backend code changes.
Tested
macOS 26.6.2, Apple Silicon, AppleClang 21.0.0.21000334, Release:
The new write_watch_empty regression fails on the original production source with an empty registration watches a page and passes with the fix.
Standalone macOS write-watch suite: 9/9 pass natively (arm64), and 9/9 pass as x86_64 under Rosetta. Both builds compile the production GuestWriteWatch.cpp.
The new test covers aligned and unaligned empty ranges, existing coverage, actual kernel page protections, an active nonempty host write, and tracking of a subsequent real write. Each CTest retains the existing 30-second limit; all observed tests finished in under one second.
python3 tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch codex/macos-empty-write-watch-ranges reports no overlap with open pull requests.
Not tested: full-project builds, Linux/Windows runtime tests or titles. Full build validation is pending; this PR is a draft. A maintainer can start the project's manual Build workflow for this PR. No title unblock or performance improvement is claimed.
While the code was written by hand, AI assisted with the PR due to language barriers and guided the GitHub workflow.
Checklist
Based on current main; no other open PR implements the same functions
Verified on macOS 27.0.1 (26A434), Apple M4, x86-64 under Rosetta 2: the standalone write-watch build (core/libs/tests/write_watch) passes ctest 9/9 with this change.
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.
Checked the diff: the length check now runs on the original range before page rounding in Register, Unregister, ProtectionChanged, BeginHostWrite and EndHostWrite of the macOS backend, and the post-rounding check is kept. No Linux/Windows code changes. write_watch_empty covers aligned and unaligned empty ranges, kernel protections and an active host write; 9/9 confirmed by @011010 on macOS (Rosetta). Linux build and ctest are green (the test is macOS-only); merging once the macOS job in the full Build passes.
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
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
On macOS, an empty write-watch range at an unaligned address was rounded out to its containing page before checking its length. Registering or unregistering zero bytes could change coverage; an empty protection notification could change the recorded page protection; and an empty host-write end could remove a real active write on that page, allowing collection to protect it prematurely.
Check the original range before page rounding in registration, unregistration, protection changes and host-write begin/end. Keep the existing check after rounding. No Linux or Windows backend code changes.
Tested
macOS 26.6.2, Apple Silicon, AppleClang 21.0.0.21000334, Release:
The new
write_watch_emptyregression fails on the original production source withan empty registration watches a pageand passes with the fix.Standalone macOS write-watch suite: 9/9 pass natively (
arm64), and 9/9 pass asx86_64under Rosetta. Both builds compile the productionGuestWriteWatch.cpp.The new test covers aligned and unaligned empty ranges, existing coverage, actual kernel page protections, an active nonempty host write, and tracking of a subsequent real write. Each CTest retains the existing 30-second limit; all observed tests finished in under one second.
python3 tools/check_conventions.py --base origin/main,python3 tools/check_test_registration.py /private/tmp/anyps5-write-watchandgit diff --checkpass.python3 tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch codex/macos-empty-write-watch-rangesreports no overlap with open pull requests.Not tested: full-project builds, Linux/Windows runtime tests or titles. Full build validation is pending; this PR is a draft. A maintainer can start the project's manual Build workflow for this PR. No title unblock or performance improvement is claimed.
While the code was written by hand, AI assisted with the PR due to language barriers and guided the GitHub workflow.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)