perf(agc): read-only stencil binds trigger redundant publication #14842
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by lgqdaxia on 2026-11-01T19:34:30Z.
Title and scene
Asset-free
agc_driver_stencil_plane_memorytest. No controlled commercial-title scene performance comparison is provided; the report currently establishes redundant publication work through component tests.What is slow or what changed
After a stencil plane has been published successfully, a draw that cannot write stencil marks it dirty again. The next
FlushDepthPlanesreturns redundant publication work. On tested main snapshotf2d874c1fdccf781c0fa5d86619bb5dd8894b958,DepthSurfaceViewreceives depth write intent but unconditionally marks mirrorable stencil stale. The native depth writer predicate also counts all-KEEP stencil operations with nonzero write masks as a writer.This is a performance candidate. Required same-scene main/PR performance summaries and traces are missing; no FPS or end-to-end speed improvement is claimed.
Summary lines
Not provided for the required same-machine, same-scene main/PR comparison. No FPS or end-to-end speed improvement is claimed.
Traces
The paired performance traces required by this form are not provided. Component-test logs and the correctness controls below do not replace those traces.
Digest
A paired performance-trace digest is not provided.
Capture
The capture protocol below is unverified for the missing paired performance report:
Test and reproduction
Asset-free
agc_driver_stencil_plane_memory; no game dump or save is needed.0x18, publishes it, and confirms a second flush is empty. Two preservation controls then check real HTILE stencil clears consumed by sampling or a depth-only flush before a read-only rebind. Both controls pass on the original production logic.The fixture also checks all-KEEP/nonzero-mask and zero-mask/REPLACE draws, unchanged stored bytes, real writes and retirement. The clear controls protect behavior the optimization must preserve.
Qualification
At final head
27607b4a961ff89a0d53a963fd08442db153728b, an incremental AGC rebuild/link completed and the five focused CTests for stencil memory, depth-buffer memory, sampling, plane fills and fast clear passed 5/5, once each. The NVIDIA GPU and validation layer were confirmed; noVUID-,SYNC-HAZARDor whole-CTest skip was reported. The two memory fixtures' conditional write-watch portions remain unexercised as detailed below.Newer main snapshot
e0caf1360035286bd22b9f2a3030e97b880ffb28was checked statically: all four candidate base files are unchanged from testedf2, and the exact patch passes an independent index apply check. The candidate is not rebased toe0; shared DCC/StorageTexture behavior changed and the combined runtime has not been tested.Historical causal comparison at pre-rename
d1a0dbe2:Windows 11 (10.0.26200), MinGW GCC 15.2.0, NVIDIA GeForce RTX 3080 Laptop GPU / NVIDIA 610.74. An AGC native SDK and the focused executables were built from the tested f2 snapshot plus candidate code; the tested d1 production translation units were force-recompiled and linked. The registration audit checked 1,692 executables.
That historical comparison used one run per variant, the same stencil fixture and shared unchanged SDK objects:
f2d874c1production TUs/headere5c02408DepthSurface TU controld1a0dbe2The original control rebuilds the two original production TUs/header and three trace-identity TUs, sharing all other unchanged objects. It is not a second independent whole-tree build. The
e5control swaps only its DepthSurface TU; its shared trace identity remainsd1. Shader caching was disabled throughout, including for any shared candidate-derived cache fingerprint.agc_driver_depth_plane_fillandagc_driver_depth_fast_clearadditionally pass 2/2 on each off2d874c1andd1a0dbe2(one run each), covering stencil fills/alias inheritance and HTILE/direct-clear controls. Both fixtures complete with the NVIDIA GPU and validation layer confirmed, noVUID-/SYNC-HAZARD, and no conditional early return or skipped CTest.agc_driver_depth_plane_buffer_memoryandagc_driver_depth_plane_samplingpass on all three variants. The unmodified original stencil fixture passes on original and pre-rename candidate logic. Every run loaded the requested validation layer and selected the NVIDIA GPU; noVUID-orSYNC-HAZARDmessages were found. No whole CTest was skipped. The conditional write-watched portions of both stencil-plane-memory and depth-plane-buffer-memory were not exercised; the latter returns before its later CPU-write/HTILE cases. The new stencil clear-order controls ran before the stencil fixture's conditional branch. No full CTest suite, hosted CI, Linux or other-GPU result is claimed.Related work and proposed patch
The candidate uses
DepthSurfaceViewWithStencilWriteIntent; the legacy three-argument entry point stays conservative. ThestencilTestedcontract in #9533, #9717, #9742, #13021 and #13023 is distinct fromstencilWritten. Real storage-image writes from #12617 must still mark stencil dirty; these combinations have not been runtime-tested.This builds on #12210. #12617 handles pending storage-image writes into stencil; #10382 handles analogous BDA leases. Neither is implemented here. The recorded 2026-11-01 issue/PR/Discussion searches found no same-root report or fix.
Proposed branch: lgqdaxia/AnyPS5:codex/quarry-write-intent,
27607b4a961ff89a0d53a963fd08442db153728b. Draft PR #14843 remains unmerged and acceptsperf numbers missinguntil the required performance report exists. With #10760 already open, the one-open-PR intake policy may close it automatically. The branch remains available for anyone to use, adapt, replace or ignore while pursuing an independent fix.AI-assisted: yes