Skip to content

test(agc): cover untracked texture writes through unchanged image tables - #1610

Open
Thimo188 wants to merge 2 commits into
mainfrom
upstream-pr/27676
Open

Thimo188 wants to merge 2 commits into
mainfrom
upstream-pr/27676

Conversation

@Thimo188

@Thimo188 Thimo188 commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Imported from boykopovar/AnyPS5#27676, originally opened by kteal.

Source commit: 4cd32ed8af8d8127212fe49b7728691e15663d8a. 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

Add a GPU regression test for a CPU write that changes a texture's pixels while its image descriptor stays identical. A cache that trusts the descriptor alone can silently render old pixels.

The test dispatches twice to warm the cache, updates the untracked source and advances the collection epoch. The new epoch invalidates the whole-table cache entry. When the driver resolves the same descriptor again, the GPU must see the new texels from the texture cache. A neighboring descriptor must still sample its original texture.

In Planet Zoo's Goodwin House, all 4,778 cached-texture comparisons sampled across ten 1080p frames lacked a write generation. They all matched. This test exercises the case a reuse optimization still has to handle when the bytes change. Planet Zoo bring-up

Tested

On Windows 11 build 26200, agc_driver_image_table_reuse passed on main (460d3ece6f) and on this branch. The new agc_driver_image_table_reuse_untracked_mutation CTest passed on both GPUs listed below. Both configurations required Vulkan, disabled the shader cache and loaded Khronos validation 1.4.363. No VUIDs were logged.

Before opening this PR, the overlap scan checked 2,470 open PRs. I reviewed the six inconclusive comparisons. boykopovar#6340 tests pending writes to tracked entries and mixed DCC entries. Its ported fixture merges cleanly with this test. boykopovar#7642, boykopovar#9508, boykopovar#10193, boykopovar#13928 and boykopovar#13929 register a different test in the shared CMake file. boykopovar#15529 separately checks the revalidation path after an untracked write. The new readback also passed on both adapters with boykopovar#15529 applied to the experimental Goodwin House renderer.

In a private negative-control build, I made the cached-texture byte comparison always report equal. The new test failed on the changed-texel readback on Intel and NVIDIA. Restoring the comparison made it pass on both.

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: Windows 11, Intel Iris Xe Graphics (32.0.101.7088) and NVIDIA GeForce RTX 4070 Laptop GPU (32.0.16.2124)
  • AI-assisted: yes

Summary by CodeRabbit

  • Tests
    • Added automated coverage for image-table behavior when pixel data changes without tracked guest-memory writes. The test verifies that later dispatches use the updated pixels while neighboring entries remain unchanged.
    • The test skips when a Vulkan test device is unavailable and has a 30-second timeout.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Image table reuse test

Layer / File(s) Summary
Mutation test and CTest registration
core/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cpp, core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_reuse_tests.cmake
Adds the --untracked-mutation test path. It verifies that dispatch returns updated texels after a CPU pixel change and collect epoch advance, while an adjacent entry remains unchanged. Registers the case with CTest, including skip handling, timeout, working directory, and Windows PATH setup.

Possibly related PRs

  • Thimo188/AnyPS5#271: Changes validation of cached AGC resource templates over untracked memory, which is the cache-validity path covered by this test.

Suggested reviewers: oneandonlydean, slegljan, jamespslater

Change: Other

Merge Risk: Minimal · up to 4cd32

This change only adds a regression test and its CTest registration, so production behavior is unaffected. No actionable merge-blocking risk remains.

Security architecture risk: Minimal · up to 4cd32

The change adds test coverage for texture refresh after a CPU write without changing how libSceAgcDriver handles texture updates in production.

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: 2
  • Waived: $0.50 (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: 60ff4486-6629-40a5-ac7b-d6dd6438cec0
Commits

Reviewing files that changed from the base of the PR and between 4131f51 and 4cd32ed.

Files selected for processing: 2

  • core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_reuse_tests.cmake
  • core/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cpp

Limit details: You’ve used all 10 included reviews currently available.

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