Skip to content

fix(libSceAgcDriver): collect writes before second retile in unit shadow test - #1608

Closed
neuralsin wants to merge 1 commit into
boykopovar:mainfrom
neuralsin:fix/recorder-unit-shadow-test
Closed

neuralsin wants to merge 1 commit into
boykopovar:mainfrom
neuralsin:fix/recorder-unit-shadow-test

Conversation

@neuralsin

Copy link
Copy Markdown
Contributor

Summary

In the unit shadow tests in core/libs/prx/libSceAgcDriver/tests/Recorder.cpp, PublishShadow(unit3, ...) at line 1437 publishes unit 3, copying data into the host import and marking pages of unit 3 dirty under write-watch. A second retile at line 1451 then re-marks unit 3 as shadowed using TrackerGeneration().

Because the dirty pages resulting from the prior publish were not collected before the second retile, the subsequent partial publish at line 1456 (PublishShadow(unit3 + 100, ..., PartialUnits)) collected them, advancing unit 3's written stamp beyond its retile generation. This caused changedUnits to conclude that guest memory had been modified after the retile (BlockWritten), dropping unit 3 without copying it and returning 0 instead of 1.

Collecting writes across the import range prior to the second retile clears the lingering dirty marks from the first publish, allowing unit 3's retile generation to stay current and the partial publish to succeed.

Closes #1429.

Checklist

  • Code passes python tools/check_conventions.py --base origin/main
  • Verified compilation and reproduction test under WSL/lavapipe (unitShadowTests passes lines 1456-1465)

…dow test

In the unit shadow tests in Recorder.cpp, PublishShadow publishes unit 3, copying data into the host import and marking pages in unit 3 dirty under write-watch. A second retile on unit 3 then marks the range shadowed using the current tracker generation. Because the dirty pages from the prior publish were not collected before the second retile, the subsequent partial publish collected them, advancing unit 3's written stamp and causing changedUnits to falsely drop unit 3 as stale (BlockWritten).

Collect writes across the import range prior to the second retile so that lingering dirty stamps from the previous publish are cleared.

Closes boykopovar#1429.
@MarcZX10

MarcZX10 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

I checked this against current main f1451396: head 10af4ec2 is 1 commit ahead and 186 behind, with merge base 63c57d22. CONTRIBUTING asks PRs to stay based on current main; please rebase and rerun the focused test and conventions on the final head. Since #1046 also addresses #1429 and touches Recorder.cpp, please clarify in the PR whether this retile test fix is complementary to that write-watch fix, and resolve any overlap reported by CI before merge.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: #1046 fixes #1429 in GuestBufferMemory.cpp (device writes reaching the write watch), and collecting the writes in the test would hide that case. If #1046 doesn't cover it after all, please reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agc_driver_recorder_tests: partial publish drops a shadowed unit without copying it

3 participants