Skip to content

test(agc): watch the sparse flush image again when a GPU store leaves it unwatched - #1914

Open
Thimo188 wants to merge 1 commit into
mainfrom
upstream-pr/28086
Open

Thimo188 wants to merge 1 commit into
mainfrom
upstream-pr/28086

Conversation

@Thimo188

@Thimo188 Thimo188 commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Imported from boykopovar/AnyPS5#28086, originally opened by Ducengarth.

Source commit: 8b3eb6fb3c04a254d5ed70857e35cf862510cb4e. The import branch preserves this fetched upstream PR snapshot. The description and validation below are copied from upstream; no new code changes or test runs were made for this import. Original reviews, discussions, and attachments remain at the linked upstream PR.


What

agc_driver_upload_cache_read_only_flush fails on Linux at every run since boykopovar#27438:

AGC graphics: sparse fixture requires an unwatched page inside a backed piece

The SparsePendingWrite case in boykopovar#27438 has three phases. Its third phase unwatches page 2 of the image and requires pages 0 and 3 to stay watched. On hosts whose host imports do not stay write-watched (Linux and macOS, ImportWatched with staysWatched == false), the GPU store of the second phase already unwatches the whole image. A probe after each step on Linux shows it:

after upload(before):  pages 0-3 watched=1, page 4 (gap) watched=1, page 5 watched=0
after Store(...):      pages 0-3 watched=0, page 4 watched=1, page 5 watched=0

So the third phase could never start there. On Windows the store keeps the pages watched, so the test passed there. boykopovar#27438's linux job was skipped, so CI never ran the case on Linux.

The fix registers the image for write watching again before the third phase when it is no longer watched. The third phase then runs from the same mixed coverage as on Windows. On Windows the condition is false and nothing changes; the driver is not touched.

Tested

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • 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
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3090 Ti, Windows 11 (validation layer 1.4.363); llvmpipe (Mesa, LLVM 20.1.2), Linux under WSL2 Ubuntu 24.04
  • AI-assisted: yes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated a sparse upload-cache test to ensure writes are watched for the image range when needed.

… it unwatched

On hosts whose host imports do not stay write-watched (Linux and macOS),
the GPU store in SparsePendingWrite unwatches the image pages, so the
interior-unwatch phase added in boykopovar#27438 always failed its precondition
there. Register the image again before that phase; where the store keeps
the pages watched (Windows) nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes

SparsePendingWrite now registers write watching for the image range when GuestMemory::Watched reports that the range is not watched.

Changes

Image range write watching

Layer / File(s) Summary
Conditional watch registration
core/libs/prx/libSceAgcDriver/tests/execution/UploadCacheReadOnlyFlush.cpp
SparsePendingWrite registers write watching for the image range if the range is not watched.

Change: Other

Merge Risk: Minimal · up to 8b3eb

This only changes a test setup step so the sparse pending-write test re-registers write watching when the image has become unwatched. No production behavior changes, and no merge-blocking risk remains.

Security architecture risk: Minimal · up to 8b3eb

The change restores write watching on the test’s own image allocation so the sparse upload test can exercise mixed watch coverage. It does not change the AGC driver’s production behavior or expose a new interface.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 1
  • Waived: $0.25 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d1177507-f4ae-4ccf-9a6f-5d48b51c09a4
Commits

Reviewing files that changed from the base of the PR and between 4131f51 and 8b3eb6f.

Files selected for processing: 1

  • core/libs/prx/libSceAgcDriver/tests/execution/UploadCacheReadOnlyFlush.cpp

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants