perf(agc): drop pending units a compute dispatch is proven to overwrite (APS5_PROVEN_OVERWRITE) #18369
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18369"
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 klosixgaming-arch on 2026-11-11T12:34:29Z.
What
Some titles reuse one guest address range as a transient pool: within a frame, images of different sizes start at the same address, one pass after another. In Cyberpunk 2077 they are 3200x1800, 2560x1440, 2048x2048, 1848x1040 and 1600x900 images. A compute dispatch that writes a new storage image refreshes it over memory where an earlier image of another shape still holds pending GPU results. The refresh writes those results back to guest memory and uploads the memory into the new image, although the dispatch is about to overwrite them.
This PR lets the driver skip that write-back when the overwrite is proven. Off by default;
APS5_PROVEN_OVERWRITEturns it on andAPS5_ABcan toggle it.Recompiler. A new pass,
ImageOverwriteProof, runs after resource tracking for compute shaders. For each 2D storage image it proves that the shader stores every texel of the addressed level and never reads it:gid < limit(which then needs a dispatch without partial groups), and bounds of the pre-offset coordinate against user data or an immediate that are never tighter than the coordinate itself;The proof is carried in
ImageResourceandDescriptorBindingand stored in the shader disk cache.Driver. A direct dispatch with zero
COMPUTE_STARToffsets records its grid, partial threads and user data. When a storage element with a proof is looked up (in the build, the T1 refresh and the full walk), the driver checks:If all of these hold, the refresh or creation of its image drops the pending units of other images that lie wholly inside the level's covered bytes, instead of writing them back. Covered bytes are whole tile blocks or exact rows, never padding. Images whose pending units are being stored are left alone. DCC images are dropped only when their write-back stores by units, which is the clear hand-over's rule. With the switch on,
ScanPendingandFindPendingcount a pending image as over a range only where one of its pending units lies. After a drop, a larger earlier image keeps pending units only outside the new one.This replaces the unsafe takeover in #18348, which dropped such units without proof.
Tested
Body Type on current
main, 2026-11-15Cyberpunk 2077 (PPSA03974) 02.120.000, character creator Body Type, 3200x1800; Windows 11 (10.0.26200), RTX 5090 (NVIDIA 617.42), Ryzen 9 9950X3D. Both builds are
mainb39603dbdc+ #19071 (the game only reaches the creator with it); the change is merged on top. Each line is the 20 s trace window opened about 80 s after entering the creator, one boot each, the same environment on both sides.APS5_PROVEN_OVERWRITE=1is set on both sides;maindoes not read it.main+ #19071 (262be96458), 130 presents in the window:This PR on the same base (
2f57ee27aa), 138 presents in the window:In-run A/B on this PR's build,
APS5_AB=10:APS5_PROVEN_OVERWRITEfrom 150 s, phases after 200 s (Body Type): n 15 B-A +7.05 +- 0.42 presents/10 s (+11.1% +- 0.7) A 63.4 B 70.5. B turns the proof on: +11.1% +- 0.7.Traces, the two summary lines,
tools/trace_digest.pyoutput (digest-mbase-po.txt,digest-m18369a.txt) and the A/B phases: https://github.com/klosixgaming-arch/AnyPS5/releases/tag/perf-captures-2026-11-15Cyberpunk 2077 (PPSA03974), the intro movie, 3200x1800, warm caches; Windows 11, RTX 5090 (driver 617.42), Ryzen 9 9950X3D. 2026-11-11.
In-run A/B on
a6a7c14dbc(APS5_AB=10:APS5_PROVEN_OVERWRITEfrom 80 s): the B phase beat both neighbouring A phases in all 8 pairs inside the movie. B vs neighbouring A: +1.67 +- 0.15 presents per 10 s (SD 0.42, n 8), +3.4%, with A at 48.8 and B at 50.5. The last pair straddles the end of the movie and is left out. An earlier A/B on the same code plus diagnostic counters gave +1.19 +- 0.12 (n 9), +2.5%, and again B won every pair.In-run A/B on
d5a98f430b(after the review fixes, same settings, 10 pairs): +0.86 +- 0.21 presents per 10 s (SD 0.67), +2.2%, with A at 38.6 and B at 39.4. B was ahead in 9 of 10 pairs. The overall rate was lower in this run than in the one above.Separate runs do not resolve it. On this machine, separate runs move by about 5% with the GPU time per present, because the desktop compositor took 25-50% of the GPU's 3D engine tonight. Five separate runs of this commit (movie windows, presents per 10 s):
Recorder.Syncper presentmain17fec48224The summary lines below are separate runs, so they carry that noise. The in-run A/B is the number to go by.
Summary lines of
mainand of this PR. Same machine and session, with only the capture switches (APS5_TRACE_SECONDS=60:10,APS5_TRACE_SUMMARY_EVERY=10,APS5_TRACE_EVENTS=1048576), plusAPS5_PROVEN_OVERWRITE=1on this PR. Traces, all summary lines, the A/B splits and the frame sheets: https://github.com/klosixgaming-arch/AnyPS5/releases/tag/perf-captures-2026-11-11main17fec48224:this PR,
a6a7c14dbc, withAPS5_PROVEN_OVERWRITE=1:What it drops. A diagnostic build counted, per 10 s of the movie:
Before the DCC rule above, the claims dropped only about 48 units, because 310 of the 660 pending images they touched have DCC.
The proof covers the top programs by takeover traffic that I checked by IR dump. It refuses the others, which a census showed hold about 40% of the units:
Pictures. Frames dumped with the switch on (every 150th frame): the logos, the legal screens, six scenes of the intro movie and the title render correctly. The red streaks over one legal screen are the game's transition effect; a dump with the switch off shows the same streaks over the CD PROJEKT RED logo. Both sheets are in the release.
Tests (Windows, RTX 5090) on
d5a98f430b:shader_image_overwrite_proof(16 cases): a global-id store, two stores per thread, a user-data rectangle, packed A16 coordinates, and an exec-zero skip on the store's mask are proved. A bound whose term wraps below zero for the first lanes, a second read of the image, a tile with gaps, a lane guard, a bound ahead of the coordinate, a 16-bit truncation past 65535, both axes on one group axis, a scalar branch and a skip on another mask are refused.ImageOverwriteCoversrejects a grid with no groups on an axis, a partial group on an axis a full-groups proof needs whole, a short grid, an offset, a short size, a size register past the dispatch's user data and packed coordinates past 65535. Removing the coverage, alias, bound, branch or axis check fails it.agc_storage_discard_covered:DiscardPendingCovereddrops only the 64 KiB units wholly inside the covered range, keeps the unit the range ends in, and drops nothing while another image over the range is being stored. Removing the flushing guard or dropping every touched unit fails it.agc_runtime_switches,agc_runtime_switches_refused,agc_storage_clear_hand_over,agc_driver_storage_one_slice_alias,agc_driver_own_refresh_repack_alias,agc_driver_storage_write_back_no_window,agc_driver_ordered_refresh_failure,agc_driver_depth_clear_hle,agc_driver_copy_surface_bytes.trace_digest.py, main
17fec48224seconds 60:10 from present 382: 48 presents, frame p50 208.1 / p90 218.5 / p99 224.7 / max 224.7 ms, GPU busy 45.0 ms per present
NVIDIA GeForce RTX 5090, NVIDIA 617.42, Windows 10.0.26200, 3200x1800, commit
17fec48224, dropped: noSlowest frames (largest slices inside each, inclusive)
Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.Packet 399.8, Driver.Packet.dispatch 196.9, Driver.Packet.memory_wait 181.4, Driver.Dispatch 139.5, Vulkan.Dispatch 94.0, Vulkan.Dispatch.shader_resources 89.2, Graphics.Draw 60.7, Graphics.Draw.draw_and_resource_release 59.6, batch 44.1, Recorder.Sync 38.1
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
trace_digest.py, this PR a6a7c14dbc with APS5_PROVEN_OVERWRITE=1
seconds 60:10 from present 370: 46 presents, frame p50 219.6 / p90 232.7 / p99 235.4 / max 235.4 ms, GPU busy 44.3 ms per present
NVIDIA GeForce RTX 5090, NVIDIA 617.42, Windows 10.0.26200, 3200x1800, commit a6a7c14dbcff, dropped: no
Slowest frames (largest slices inside each, inclusive)
Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.Packet 421.8, Driver.Packet.dispatch 209.0, Driver.Packet.memory_wait 191.7, Driver.Dispatch 143.7, Vulkan.Dispatch 98.7, Vulkan.Dispatch.shader_resources 94.6, Graphics.Draw 62.9, Graphics.Draw.draw_and_resource_release 61.8, batch 45.3, Recorder.Sync 39.5
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T14:49:35Z.
Review: COMMENTED
Reviewed proven-overwrite pending discard — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Head:
d5a98f430b99dd1f3e65c3ae4608b0a8d5125765(PR 18369, basemain). No build and no test run in this review.Read: the diff for all 21 files in
files.jsonreviewed. Eighteen were read in full from the review folder. Three large files (ShaderResources.cpp,Texture.cpp,tests/Recorder.cpp) were read only through their hunks indiff.patch, plus the ranges ofTexture.cpplisted below.Reader calls at head:
Results
shader_image_overwrite_proofagc_storage_discard_coveredNegative control
Not run. The PR reports removal experiments for its checks (author-reported). I did not repeat them.
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp:485: the gate reads registers0x204,0x205and0x206as bare numbers. The proof assumes a zero dispatch origin, so this gate is what keeps the grid-coverage claim sound. Naming these offsets where they are used would let a reader check the gate without the register map. Failure scenario: if one of these offsets were not the COMPUTE_START register the gate is meant to test, a non-zero origin would pass the check and the driver would drop pending results over texels the dispatch never writes. I did not confirm the register meaning.core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:4277:pendingUnitsOverlaprepeats the per-unit overlap test thatpendingUnitInside(Texture.cpp:4825at head, outside this diff) runs over the samelayerPending,layerBeginandlayerBytes. This is a maintenance risk, not a current defect: a later change to unit bounds in one copy and not the other would make the lookups and the flush pretest disagree about whether an image holds results over a range.Not verified
GetRdnaImageAddressComponentLayout.0x204–0x206as COMPUTE_START offsets: not checked, no register header read.static_assertsizes andfieldCountchanges are in the diff. How stale entries are rejected (ShaderCacheSourceVersion.hpp, which is included byShaderDiskCache.cpp) was not read.Texture.cpp:5068when the test hook runs: ifpending.mutexis held there, the test would deadlock. Not checked.ShaderResources.cppandtests/Recorder.cpp: read by hunk only; surrounding code not read.Sources
github.com/boykopovar/AnyPS5@d5a98f430b/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp (L485)github.com/boykopovar/AnyPS5@d5a98f430b/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp (L4277)To get this to a good state
Nothing is required.
Optional: the two non-blocking points above.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T01:48:35Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed changes add an opt-in compute overwrite proof and use it to discard pending storage image results; I found no verified blocking defect, but could not run the checks needed for a formal approval.
What I ran
Reviewed head
66520ff24fce99c7b58a08b18fd4a26e7caffeacusing the prepared diff andrepo_read.pyfor changed code and targeted context. No build or tests were run.Results
Negative control
Not run. The description reports negative-control tests, but I did not run them on this head.
Findings
Blocking
None verified.
Non-blocking
None.
Sources
Not verified
No build, unit tests, or console run was performed. The review bundle excluded the full text of
ShaderResources.cpp,Texture.cpp, andRecorder.cpp; I read their relevant changed hunks and targeted source ranges throughrepo_read.py. The other 18 changed files were included in the bundle and reviewed.To get this to a good state
Nothing is required. Consider running the reported build and tests on this head before relying on the optimization in a release.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T09:44:18Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected proof and discard paths are consistent with the stated opt-in behavior; I could not complete a full review because three changed files were not available in full text and no checks were run here.
What I ran
Reviewed head
daf1cf37e26b352460c6f3a808bb6b0c83b39baeusing the prepared diff and pinned repository reader. No tests or build checks were run.Results
Findings
Blocking
None in the code inspected.
Non-blocking
None.
Not verified
Full text was read for 15 of 18 changed files.
ShaderResources.cpp,Texture.cpp, andtests/Recorder.cppwere excluded from the review folder because they were too large; I read only targeted ranges of the first two through the reader. I did not read their remaining contents, and did not read the full text oftests/Recorder.cpp. Build, automated tests, and the reported hardware runs were not independently verified.To get this to a good state
Nothing is required. Optional: include the excluded file text in a follow-up review bundle if a complete file-by-file approval is needed.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T11:00:59Z.
Review: COMMENTED
Reviewed — comments
The reviewed portions show a guarded overwrite optimization, but the review is incomplete because several changed files were not read and no checks were run.
What I ran
No commands or tests were run. I inspected the prepared diff and targeted source ranges at head
bf4e6dc777af78f8d90861af5667fc3ad42ec537usingrepo_read.py.Results
Findings
Blocking
None identified in the portions reviewed.
Non-blocking
Sources
core/shader/recompiler/ImageOverwrite.hppcore/shader/recompiler/Optimization/src/ImageOverwriteProof.cpp(lines 1–300)core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp(lines 1510–1620)core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp(lines 6300–6425)review/description.md,review/commits.md,review/manifest.json, andreview/diff.patchNot verified
The full text of these changed files was not read:
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp, andcore/libs/prx/libSceAgcDriver/tests/Recorder.cpp. Other included changed files were not read in full either. No build, tests, or runtime checks were performed.files.jsonwas not available through the reader; the changed-file listing reports these exclusions: none (too large for the review folder), as named above.To get this to a good state
Nothing is required. Optional: complete the review of the remaining changed code and run the relevant tests before making a formal merge decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T22:58:59Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: the overwrite proof can accept stores whose coordinates wrap in 32-bit arithmetic, allowing pending image data to be discarded even though the dispatch does not overwrite the corresponding texels.
What I ran
Reviewed head
48777e63b287a15e1a4ea7c9a6aeaa36440776adusing the preparedreviewbundle and targeted reads throughrepo_read.py. No build or tests were run.Results
Findings
Blocking
core/shader/recompiler/Optimization/src/ImageOverwriteProof.cpp:604— The proof checks the lane component is below2^30, but does not ensure thattile * workgroupId + lanestays within 32-bit unsigned range. The same unchecked addition is accepted byEvaluateforIAdd32at lines 225–236. For example, a store coordinate formed asglobalInvocationId + 0x80000000can wrap to the low image coordinates for high group IDs. With a suitable dispatch and bound, the lane coverage check can prove the low tile while other workgroups wrap onto it, leaving other texels untouched.ImageOverwriteCoversthen accepts the claim and the driver may drop pending data in the claimed bytes. Reject coordinate expressions whose complete dispatched range can overflow, or model 32-bit wrap and prove coverage under the wrapped semantics.Non-blocking
None.
Not verified
ShaderResources.cpp,Texture.cpp, andRecorder.cpp; targeted sections of the first two and the changed test hunk in the diff were read. Other changed files whose full text was present inreview/files/were not all read. Files excluded by the bundle rule were identified from the manifest.To get this to a good state
Reject or safely model wraparound in overwrite coordinates, add a regression test for a coordinate that wraps at 32 bits, then rerun the proof tests and relevant driver tests.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T15:03:11Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
42b37fb97e(full42b37fb97eeec9b0a071404bafd2da2b61a18498), basemain.description.md,commits.md,manifest.json,files.jsonand all ofdiff.patch(1968 lines), plus the house-rule sections of the ruling file.Results
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:12addsRuntimeSwitches.hppa third time. The file already includes it at lines 7 and 10 at this head. Dropping the added line is the smallest fix.core/shader/recompiler/Recompiler.cpp:402runsProveImageOverwritesfor every compute shader, also whenAPS5_PROVEN_OVERWRITEis unset, and the proof is written to the disk cache. The switch only gates the driver (OverwriteClaimFor,FindPending,ScanPending). If "off by default" should cover compile-time work too, gate the proof. The description gives no compile-time cost.d5a98f430b. The reviewed head is42b37fb97e. The named tests should be re-run on this head, or the author should say which later commits changed nothing they cover.Not verified
d5a98f430b, not on this head.ShaderResources.cpp,Texture.cppandtests/Recorder.cppare too large for the review folder, and the other files were read only as diff hunks. Not checked: the callers of the changed functions, the locking aroundDiscardPendingCoveredwhererefreshandPrepareCreationcall it, and whetherOverwriteDispatch()(thread-local) is set on the thread that resolves the bindings.DescriptorBinding920 to 944 bytes,ImageResource108 to 244 bytes, decoder minimum sizes updated). I did not confirm that old caches are rejected.FormatVersionandSourceVersion()are used inShaderDiskCache.cpp, but the search did not find whereFormatVersionis set.ImageOverwriteProof.cppandImageOverwrite.hppas diff only. I did not trace how the IR producers (GetBuiltin,MakeImageAddress) and the RDNA image decoder feed it.Sources
Repository lines are at head
42b37fb97e. Performance captures are at the release link in the description, not checked.To get this to a good state
Nothing is required. The non-blocking points above are optional.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T02:51:30Z.
Review: COMMENTED
Reviewed — comments
Nothing blocks this draft review; the points below are optional.
What I ran
Reviewed head
e702a6223b7609a80a003e21119b027f820c41e8using the prepared review bundle and pinned reader tools. No build or tests were run.Results
Findings
Blocking
None.
Non-blocking
Not verified
The full added lines in
ShaderResources.cpp,Texture.cpp, andRecorder.cppwere not read. Several other changed files were not inspected, includingImageOverwriteProof.cppbeyond selected ranges,ImageOverwriteProoftests beyond the displayed source, the disk-cache changes, and the build and documentation edits. The files excluded from the review folder as too large were read only through selected head ranges. No tests, build, or console behavior were verified.Files read from the review bundle:
description.md,commits.md,manifest.json,README.md, and selected ranges ofdiff.patch. Changed repository files read:Dispatch.cpp,ShaderResources.cpp,Texture.cpp,ImageOverwrite.hpp,ImageOverwriteProof.cpp,ImageOverwriteProoftests, andRecorder.cpp.files.jsonwas unavailable; the changed-file inventory and exclusions were checked through the review-folder listing.To get this to a good state
Nothing is required. Optionally run the new shader image-overwrite proof and AGC recorder tests and share the results.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T20:42:56Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: fix the proof’s handling of wrapped unsigned bounds so it cannot authorize dropping pending image data for a shader that skips texels.
What I ran
Reviewed head
46206fdb7fabf4f63807c06fe48f6962f2709e0b. No build or tests were run. I read the prepared description, commits, manifest, and diff; inspected the proof implementation and tests, dispatch integration, descriptor binding and disk cache serialization, and relevant pending-image code throughrepo_read.py.Results
Findings
Blocking
core/shader/recompiler/Optimization/src/ImageOverwriteProof.cpp:581: the bound validation comparesbound.lane[lane]andcoordinate.lane[lane]as signed affine values, but the shader comparison is unsigned 32-bit (ULessThan32). For a coordinate such asgid - 5, early lanes have negative affine values that represent large unsigned values after wrapping; the current check can still treat the bound as no tighter than the coordinate and accept a proof. A sufficiently large dispatch can therefore passImageOverwriteCoverseven though wrapped coordinates fail the shader predicate and leave texels unwritten. Since the driver uses this proof to discard pending contents, reject any bound or coordinate expression whose unsigned comparison cannot be proven equivalent over all dispatched lanes, including wraparound. The existingWrappingBoundcase checks a different predicate and does not cover this path.Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp, andcore/libs/prx/libSceAgcDriver/tests/Recorder.cppwas excluded from the review folder. I inspected only relevant ranges of the first two throughrepo_read.py; the recorder test additions were not read.To get this to a good state
Fix the unsigned wraparound proof condition and add a regression test where a wrapped coordinate is guarded by an unsigned coordinate bound. Then rerun the image overwrite proof and recorder tests and build on the new head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T00:11:29Z.
Review: COMMENTED
Reviewed — comments
The proof and pending-unit discard path appear deliberately constrained, but I could not complete review of all changed files or run the checks, so a formal merge decision is not justified.
What I ran
Reviewed head
03113f62c51479c79a2a60ff51b4ea53dde284a6using the prepared diff and targeted reads throughrepo_read.py. No build or tests were run.Results
Findings
Blocking
None verified.
Non-blocking
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:319adds a secondRuntimeSwitches.hppinclude, although the header is already included at line 317. Remove the duplicate include.Not verified
The review folder lists 17 changed files. I read the prepared diff and manifest, and targeted source ranges for
Texture.cpp,ShaderResources.cpp,ImageOverwriteProof.cpp, andShaderDiskCache.cpp; full text was not read for these files. I did not read the full text of every changed file. In particular,Texture.cpp,ShaderResources.cpp, andcore/libs/prx/libSceAgcDriver/tests/Recorder.cppwere excluded from the review folder because they were too large; only targeted ranges or searches were inspected. No build, test suite, or negative control was run. The author-reported performance results were not independently verified.To get this to a good state
Nothing is required. Optional: remove the duplicate include in
Texture.cpp.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T01:10:06Z.
Review: COMMENTED
Reviewed — comments
The review covers the overwrite proof and pending-image changes at
5e23e345b29fa1683527947e6a8b10470ba623ae; material uncertainty in proof validation and the unreviewed parts of several large files prevents a formal approval.What I ran
repo_read.py.Results
Findings
Blocking
None verified.
Non-blocking
ImageOverwriteCoverschecksfullGroupsby rejecting a nonzeropartialThreads[axis], but does not requiredispatch.groups[axis]to cover the corresponding image extent. For a store guarded byGlobalInvocationId < DispatchThreadLimit, a group-count value can be nonzero with a thread limit that yields fewer launched groups; the proof could then claim full coverage based on the requested group count even if the effective grid is smaller. Review and validate the dispatch group normalization and thread-limit relationship before relying on this proof. Changed line:core/shader/recompiler/ImageOverwrite.hpp:744.Not verified
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp, andcore/libs/prx/libSceAgcDriver/tests/Recorder.cppwere not read; only relevant diff hunks and targeted ranges were inspected. These were excluded fromfiles/because they were too large.To get this to a good state
Nothing is required. Optional: confirm that partial dispatch limits cannot result in fewer groups than the
groupsvalue used byImageOverwriteCovers, and add a focused test for that case if they can.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T12:08:20Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
247ee996785ac081ca648d1cc0f2344ce71c223f. I inspected the prepared description, commits, manifest and diff, then targeted proof, dispatch, refresh, pending-unit and test code usingrepo_read.py. No build or test commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read all changed files marked
included: truein the manifest, including the added lines incore/shader/recompiler/Optimization/src/ImageOverwriteProof.cpp. I did not read the complete contents ofcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp, orcore/libs/prx/libSceAgcDriver/tests/Recorder.cpp; I inspected only relevant ranges in those files. Build, automated tests, and the reported console performance measurements were not independently verified.To get this to a good state
Nothing is required.