perf(shader): balance dense runtime image dispatch #12299
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12299"
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 Filip722 on 2026-10-28T08:22:30Z.
What
Reviewer-requested evidence remains outstanding (2026-11-07). Kept open for investigation. The November 1 captures below do not demonstrate a repeatable gain. Source inspection of main
4204951e771ee2ec2e71507e5390ee2c9b6e9238and PR head12367bdb6c32a65dfdf2c1e255534fd18d0a2fa6found no runtime-selected workload eligible for the balanced-tree path: direct-image selectors are specialization constants in both registration and non-registration paths, while this PR excludes image/sampler tables. This is source analysis, not a new build, hardware test or performance capture. The requested named runtime case and repeatable matched current-main benefit are still missing; this request is not resolved.Express distinct direct-image mode dispatch as a balanced tree while retaining #8716's switch for equivalent modes. The original motivation was a runtime selector; merged #11952 now specializes that selector, so the historical runtime-chain benefit cannot be presumed to remain on current
main. The refreshed diagnostic pair below demonstrates no performance gain.The production change is confined to
EmitImage. In a historical standalone focused RADV robust2 GPL compilation, the loaded game fragment changed 1,911 → 1,821 native instructions and 9,104 → 8,744 code bytes, retaining 32 VGPRs, 128 SGPRs and zero spills. Static branches increase 47 → 73, while the executed first-mode path skips the membership chain and later sequential checks. This is a focused compiler observation, not exact linked-capture ISA or an elapsed-time estimate.PR #8716 deduplicates equivalent case bodies while retaining
OpSwitch. This branch incorporates its refreshed head45998c33789bas the declared prerequisite. Currentmainincludes #11952's direct-mode specialization; the updated comparison keeps that code and #8716 identical in both arms.Tested
Historical integration refresh, 2026-11-01 (exact revisions below). Head
12367bdb6c32a65dfdf2c1e255534fd18d0a2fa6incorporates pinned main5bae1a4bc2cffc66c13e37ce8e63ae48b1b5dd1eand refreshed prerequisite #871645998c33789bc84b5a07a10260ece689b1d9cbde, preserving history. Baseline7673d25f370dae11690a3ec0ea04b061b5791118is that same main plus the same prerequisite. Their source difference is exactly the 40-line balanced-dispatch addition; fixtures and all other sources match.Both exact trees pass all eight focused tests:
agc_shader_memory,agc_driver_depth_plane_sampling,agc_driver_image_address_dimension,agc_driver_image_plane_bias_on_single_level_volume,agc_driver_image_sample_unnormalized,agc_driver_image_table,agc_driver_pixel_implicit_derivatives, andagc_driver_prepared_graphics. Author runs used required Vulkan, shader-cache bypass and Khronos validation with verbose CTest on Radeon 760M, private RADV Mesa 26.2.6/libdrm 2.4.133, Debian 13/Linux 7.2.12-x64v3-xanmod1. Each arm verified seven actual instance/device-layer insertions and the selected private Radeon driver, with no VUIDs, synchronization hazards, missing layers or skips. The historical image-table allocation failure does not reproduce in this setup.The requested downstream refresh retains the separate-heap-source fixture correction, both equivalent-mode switch assertions and current upstream shader changes. Main's current write-watch registrations are retained exactly; the former macOS registration workaround leaves no diff against main.
One predetermined diagnostic AB pair followed two ordinary trace-enabled warmups per arm. Mean frame time is 21.827840 → 21.911022 ms (candidate 0.083182 ms / 0.381% higher); GPU busy time is 18.841 → 18.805 ms/present. This single pair establishes neither a repeatable gain nor a regression, and supplies no renewed performance justification. No timing-based exclusions, replacements or additional pairs were collected. Both measured runs passed scene/input/focus/geometry, per-arm cache-content, loaded-library/driver and complete-trace gates.
PPSA28997 01.008.001, restored stationary camp, same copied save with
resolutionIndex=6requesting 2560×1440 internal rendering, 1920×1080 presentation, active 1152×648 Wayland client, mailbox; Ryzen 5 7640HS/Radeon 760M. Physical internal image allocation/extent was not independently verified for these builds. Both carry the identical private first-present/screenshot observer (dirty:true); no screenshots or input occurred in the timed window. Only AGC and VideoOut binary hashes differ: VideoOut's entire difference is 12 verified telemetry commit-literal bytes, with identical source and all other bytes matching.Both original timing traces, full summaries, trace digests, protocol and provenance hashes are attached as lossless text chunks with a SHA-256-verifying decoder. Only timing evidence is public; game-derived files, saves, images, shaders, ISA, native libraries, hardware captures and console logs remain private.
Summary lines for the sole pair, baseline then candidate:
trace_digest.pysummary excerpts:The new selector specialization materially affects the original performance rationale. The earlier approved report below remains historical evidence for its named revisions, and is neither pooled with this pair nor relabeled as testing this head. Reviewer acceptance of the updated change and its remaining value is still open.
Historical evidence for the exact revisions named below.
Review correction on 2026-10-31: head
5e4b0682fce7c05cb6c1aa08f24948f34eaf19cfincorporates main474030e58424fefdb65e5df9f3820810fbb4553cwith a history-preserving merge. The runtime-image fixture now gives its column a separate four-dword heap source, matching ResourceTracker; no production behavior changed in this correction. This addresses jotitadev's reported interaction with #9749 without weakening nested-table validation or importing #9749 into this branch.On current main plus the previous PR head plus #9749 (
da431b6a63ca),agc_shader_memoryreproduced the reported nested-image-table rejection. The four-line fixture correction makes that combined test pass, retaining the dispatch assertions. Current main and this corrected PR separately ran the same eight focused tests listed below: 7/8 pass on each, with the same existingagc_driver_image_tabledescriptor-allocation failure (-1000069000). Each run verified seven Radeon 760M executions and seven Khronos instance/device-layer insertions; no VUID errors, missing layers or skips. Hardware/driver: AMD Ryzen 5 7640HS / Radeon 760M, RADV Mesa 25.0.7-2+deb13u1, Debian 13.7, Linux 7.2.12-x64v3-xanmod1. Required Vulkan and disabled shader cache were used with verbose CTest.The full overlap scan covered 1,681 open PRs. Manual review of all 18 base-conflicted shared-file branches found no duplicate fixture correction. A real unresolved conflict with #10867 remains in the base-level sampling code inherited from #8716; #10867 changes compute derivative/LOD handling, not this dispatch mechanism. The branches will need a coordinated refresh when either lands. #8716 remains the declared prerequisite; this update does not claim that all other open PRs compose cleanly.
CI correction on 2026-10-31: head
37d4bd020c7b059abdf48c56e37add477f505409removes the duplicate fault-test registration loop fromcore/libs/tests/write_watch/CMakeLists.txt(five deletions, no shader/runtime behavior change). The previous run failed on duplicatewrite_watch_execute-faultandwrite_watch_read-faultnames. Local CMake configuration now succeeds and all 18 tests are registered once with their original arguments and 30-second timeouts. Both actual macOS write-watch jobs now pass on this head: Intel, Arm. Other CI jobs are tracked in that run; this does not claim new shader/GPU or gameplay validation.No new gameplay cohort was run for this fixture correction. The measurements and trace digests below remain historical evidence for their named revisions, not a fresh-main speed claim or confirmation under the later four-pair acceptance protocol.
Historical performance evidence follows. Refreshed exact head
ca770b73f881ed05979a87d4f133f5d572fad1faincorporates main9624d8c6bb9e96b7aa92b815f55690f69b0a88d5, selected live for this update, using a history-preserving merge. The measured baseline isbf134c54d635e5c6d6ea73547210ea0f8e6de1fd. The declared #8716 prerequisite is identical in both arms; this isolates downstream #12299 rather than attributing the combined change to this PR.Focused comparison: 7/8 pass on both sides; the same pre-existing image-table descriptor-allocation failure (-1000069000) remains on both sides. Tests:
agc_shader_memory,agc_driver_depth_plane_sampling,agc_driver_image_address_dimension,agc_driver_image_plane_bias_on_single_level_volume,agc_driver_image_sample_unnormalized,agc_driver_image_table,agc_driver_pixel_implicit_derivatives,agc_driver_prepared_graphics. Baseline fixture overlays, if present, contain only the corresponding PR assertions. Both verbose logs verify the physical AMD Radeon760M (RADV PHOENIX) and actual Khronos validation (7 baseline / 7 candidate insertions), required Vulkan and disabled shader cache. Zero VUID errors, missing layers or skips. Release full-native libraries and focused targets build; conventions and whitespace checks pass. Driver/OS: RADV Mesa25.0.7-2+deb13u1, Debian13/Linux7.2.12-x64v3-xanmod1; Ryzen5 7640HS.Three predeclared warmed pairs A1,B1,B2,A2,A3,B3, all audited. Mean FPS 19.89557 → 20.06535 (+0.853%); mean GPU work 46.893 → 46.480 ms/present.
Baseline FPS range 19.82672–19.97072; candidate 20.01862–20.10712. FPS improves in 3/3 pairs and GPU work is lower in 3/3. Candidate FPS exceeds the entire baseline run range. The observed direction repeats across these samples, with no cross-title/vendor/session claim.
PPSA28997 v01.008.001 stationary camp; same copied save/seven fixed inputs, 1920×1080 internal/output, focused1152×648 Wayland client, mailbox. Each arm ran once to warm its caches, then restarted with fresh copies of its independently warmed shader/driver caches for each capture, seconds90:12. Default buffer, only permitted TRACE_SECONDS/TRACE_DIR; no other TRACE/PROFILE settings and no redirected game log. Game stdout/stderr inherited the terminal. Identical attached screenshot-signal/startup-clock observer is disclosed by dirty flags, removed from source after freezing libraries, and never committed. All50 loaded native and9 guest libraries match the frozen hashes. Scene/focus/input/cache/library/drop audits pass for every capture. No timed numerical exclusions, added repetitions, competing builds or GPU work. Setup interruptions, if any, are disclosed in the attached protocol. Screenshots remain private.
All six original lossless traces, full summaries/digests, paired results, protocol, hashes and common observer. All 43 published files and six decoded original trace hashes were verified after download. Timing-only public evidence; no game files, saves, screenshots, shaders, ISA, native libraries, hardware captures or console logs. Main remained
9624d8c6bbat publication.Landing order remains #8716 → #12299, with Filip722 owning the deduplication-preserving adaptation and combined validation. Acceptance and the prerequisite checklist remain external review matters. No cold-compilation benefit is claimed.
A1
seconds 90:12 from present 2391: 238 presents, frame p50 50.4 / p90 50.8 / p99 55.4 / max 56.1 ms, GPU busy 47.0 ms per present
AMD Radeon 760M (RADV PHOENIX), radv Mesa 25.0.7-2+deb13u1, Linux 7.2.12-x64v3-xanmod1, 1920x1080, commit bf134c54d635 (dirty), dropped: no
Slowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): batch 47.0, Driver.Packet 37.2, Driver.Packet.draw 35.4, Driver.Draw 35.3, Driver.Draw.draw_enqueued 30.4, Recorder.Sync 29.4, Driver.WorkerWait 10.7, Driver.WorkerWait.idle_and_completion_poll 10.7, VideoOut.Flip 10.3, Driver.Present 10.2
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
B1
seconds 90:12 from present 2413: 241 presents, frame p50 49.9 / p90 50.5 / p99 51.2 / max 51.3 ms, GPU busy 46.6 ms per present
AMD Radeon 760M (RADV PHOENIX), radv Mesa 25.0.7-2+deb13u1, Linux 7.2.12-x64v3-xanmod1, 1920x1080, commit
ca770b73f8(dirty), dropped: noSlowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): batch 46.5, Driver.Packet 36.6, Driver.Packet.draw 34.7, Driver.Draw 34.7, Driver.Draw.draw_enqueued 30.0, Recorder.Sync 29.3, Driver.WorkerWait 10.7, Driver.WorkerWait.idle_and_completion_poll 10.7, VideoOut.Flip 10.2, Driver.Present 10.2
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
B2
seconds 90:12 from present 2410: 241 presents, frame p50 49.8 / p90 50.2 / p99 50.9 / max 51.0 ms, GPU busy 46.5 ms per present
AMD Radeon 760M (RADV PHOENIX), radv Mesa 25.0.7-2+deb13u1, Linux 7.2.12-x64v3-xanmod1, 1920x1080, commit
ca770b73f8(dirty), dropped: noSlowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): batch 46.4, Driver.Packet 36.5, Driver.Packet.draw 34.6, Driver.Draw 34.6, Driver.Draw.draw_enqueued 30.0, Recorder.Sync 29.4, Driver.WorkerWait 10.7, Driver.WorkerWait.idle_and_completion_poll 10.7, VideoOut.Flip 10.2, Driver.Present 10.2
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
A2
seconds 90:12 from present 2398: 240 presents, frame p50 50.1 / p90 50.6 / p99 51.4 / max 51.4 ms, GPU busy 46.8 ms per present
AMD Radeon 760M (RADV PHOENIX), radv Mesa 25.0.7-2+deb13u1, Linux 7.2.12-x64v3-xanmod1, 1920x1080, commit bf134c54d635 (dirty), dropped: no
Slowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): batch 46.8, Driver.Packet 36.7, Driver.Packet.draw 34.9, Driver.Draw 34.9, Driver.Draw.draw_enqueued 30.5, Recorder.Sync 29.7, Driver.WorkerWait 10.7, Driver.WorkerWait.idle_and_completion_poll 10.7, VideoOut.Flip 10.2, Driver.Present 10.2
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
A3
seconds 90:12 from present 2398: 239 presents, frame p50 50.2 / p90 50.9 / p99 53.9 / max 55.8 ms, GPU busy 46.8 ms per present
AMD Radeon 760M (RADV PHOENIX), radv Mesa 25.0.7-2+deb13u1, Linux 7.2.12-x64v3-xanmod1, 1920x1080, commit bf134c54d635 (dirty), dropped: no
Slowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): batch 46.8, Driver.Packet 37.0, Driver.Packet.draw 35.1, Driver.Draw 35.1, Driver.Draw.draw_enqueued 30.2, Recorder.Sync 29.4, Driver.WorkerWait 10.7, Driver.WorkerWait.idle_and_completion_poll 10.7, VideoOut.Flip 10.2, Driver.Present 10.2
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
B3
seconds 90:12 from present 2411: 242 presents, frame p50 49.7 / p90 50.2 / p99 50.7 / max 50.8 ms, GPU busy 46.4 ms per present
AMD Radeon 760M (RADV PHOENIX), radv Mesa 25.0.7-2+deb13u1, Linux 7.2.12-x64v3-xanmod1, 1920x1080, commit
ca770b73f8(dirty), dropped: noSlowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): batch 46.4, Driver.Packet 36.4, Driver.Packet.draw 34.6, Driver.Draw 34.6, Driver.Draw.draw_enqueued 29.9, Recorder.Sync 29.3, Driver.WorkerWait 10.7, Driver.WorkerWait.idle_and_completion_poll 10.7, VideoOut.Flip 10.2, Driver.Present 10.2
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-10-28T08:44:42Z.
Review: CHANGES_REQUESTED
The dispatch logic looks internally consistent on the PR base, and the performance report is unusually well scoped. I cannot finish a current-main review on this head, though: it is 18 commits behind
main, andmainhas since changedSpirvImageEmitter.cpp(including the image-store and image-merge-phi changes in9d6b917388andb9d00c5d80). Please rebase/update onto currentmainand rerun the required focused shader tests on the updated head and its matching base; the current report explicitly excludes newer main changes, and the hosted GPU test jobs are skipped. This is needed to check the new structured dispatch against the current emitter and validation baseline.Imported from boykopovar/AnyPS5. Originally posted by imellag on 2026-10-28T18:45:06Z.
Review: COMMENTED
macOS / MoltenVK data point. Apple M4 Pro, macOS 27.2, MoltenVK 1.4.2, x86_64 Release under Rosetta.
maindoesn't run titles on macOS yet, so the base is a support branch, notmain:main750cf6cf48+ only the macOS boot PRs #7631 #10552 #11249 #11447 #11554 #10669 #7804, + #12529 (the revert of #10337, which roughly doubles the GPU time on this GPU and would hide smaller changes). Change: that base + eight open shader performance PRs merged together (#12287 #11952 #12299 #12280 #11368 #11265 #8716 #8958, all clean merges). I did not measure each PR alone.Two alternated runs per side, warm shader cache,
APS5_TRACE_SUMMARY_EVERY=10:Together they don't raise the GPU time on MoltenVK. I'm checking open shader performance PRs on this GPU because #10337 was measured on RADV and doubled it here.
Focused tests below ran with
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationon the same two trees; the layer was found and both logs have the sameVUID-lines (12VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605, 20VUID-vkCreateDescriptorSetLayout-support-09582, from tests that fail the same way on the base).Interaction with #8716. The two merge without a textual conflict, but together they fail
agc_shader_memoryat #8716's new check:runtime image switch deduplication: OpSwitch did not cover every runtime image mode. Each one alone passes it (base + #12299: pass; base + #8716: pass; base + #8716 + #12299: fail; base + #8716 + #11952: pass). This PR turns the direct-imageOpSwitchinto a balancediftree for value-returning images, which is the switch #8716 deduplicates and tests.pr_overlapcan't see this, so could you and @hamb3r agree which lands first and what the second does: keep #8716's deduplication in the cases that still useOpSwitchand narrow its test to them, or drop the deduplication where this tree replaces the switch?This PR on MoltenVK otherwise:
agc_driver_depth_plane_sampling,agc_driver_image_address_dimension,agc_driver_image_sample_unnormalizedandagc_driver_prepared_graphicspass on the base and with the change.agc_driver_image_tablefails on both with the sameVUID-vkCreateDescriptorSetLayout-support-09582, andagc_driver_image_plane_bias_on_single_level_volumefails on both (MoltenVK has no min/max reduction samplers). No GPU regression in the group.AI-assisted: yes (Claude Code ran the builds, runs and tests and drafted this review)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T05:48:50Z.
Review: CHANGES_REQUESTED
Re-checked — changes requested
The new reports add useful context, but this branch is still not based on current
main, and the available gameplay comparison does not demonstrate a repeatable performance gain. The branch is 548 commits behind currentmain52c09d567d2fa453494dd720fcf53a98149468e4; the reviewed code and measurements are based on older snapshots. The one Bendy comparison reports p50 increasing from 40.590 ms to 41.266 ms, p90 improving, and p99 nearly unchanged. The 71-shader SPIR-V sample grows by 0.33%, which may affect pipeline compilation but does not establish an elapsed-time regression by itself.What I ran
0f90dc4f2036866971fd7fa0a3a10520fcf2eb4dwith currentmain52c09d567d2fa453494dd720fcf53a98149468e4.git diff --check.Results
maingit diff --checkmain3a2b919816; hosted GPU/product jobs are skippedPlease update onto current
mainand rerun the focused shader tests and the same-scene baseline/change capture on that integrated head. The report should make the performance benefit reproducible and address the observed shader-input growth; if the updated capture remains neutral, reconsider whether theperfchange is warranted. I did not run the C++ or GPU tests locally.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:36:14Z.
Review: CHANGES_REQUESTED
Re-reviewed exact head
e192e0c3d7e6b8ae7ffbc6984bb54c8b8a2909c8. The current-main focused validation report is useful, but the performance refresh is explicitly pending and the old captures are not a compliant report for this integration. Theperflabel check confirms the required same-title, same-scene, same-machinemain/changeaps5-summary.jsonllines, attached traces, andtools/trace_digest.pyoutput are absent. Please add that report and resolve the previously noted interaction with #8716 before approval. I did not run GPU tests locally.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T09:07:45Z.
Review: CHANGES_REQUESTED
Re-check — changes requested\n\nThe updated report now supplies the required same-scene performance summaries, trace digests and verified trace attachments. The four captures show +0.438% and +0.632% FPS pairs (20.54654 to 20.65645 FPS overall); GPU-time benefit remains inconclusive, so I treat this as a small observed FPS difference rather than a broad or cross-title claim. The paired Radeon/Khronos runs report seven selected tests passing on each side and no new VUIDs, missing layers or skips. I did not run these GPU tests locally.\n\nTwo integration blockers remain:\n\n1. The report is on main
20c907b510, while the PR base is3a40945e62and current main isaaccd0ba39. This head is 9 commits behind current main; the intervening comparison changes 300 paths, many in the AGC driver and shader tests this PR touches. Please refresh onto current main and rerun the focused validation-layer comparison plus the required matched performance captures on the resulting exact head.\n2. The interaction with #8716 remains explicitly unagreed. Its new fixture requires an OpSwitch for a direct image read that this PR replaces with a balanced tree. The PR description says the proposed #12299-first order awaits confirmation and that no combined behavior has been tested. Please coordinate the order and downstream owner, update both checklists, and validate the combined tree with the assertion narrowed to actual fallback-switch cases if that is the agreed resolution.\n\nThe performance evidence resolves my prior missing-report request, but it does not resolve these integration and combined-test blockers. I did not run local builds, tests or captures.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T21:33:19Z.
Review: APPROVED
Re-checked — new head, looks good
The updated exact-head report resolves the missing matched performance and focused-shader evidence; the current-main merge preview is clean and I found no remaining blocking issue.
What I ran
Reviewed exact head
ca770b73f881ed05979a87d4f133f5d572fad1faagainst livemainfc9240dbc5dc89a6b17a739703e00d26318c7716on Linux x86-64 using Git and GitHub CLI. The merge preview is clean;git diff --checkpasses. I did not build or run shader/GPU tests locally.Results
1f20bfa8ef7c33908b3429fa963809570e908993git diff --checkagc_driver_image_tableallocation failure and no new validation errors; not independently run here#8716→#12299Unedited merge-preview output
git diff --checkproduced no output and exited successfully.Findings
Blocking
None found in the reviewed head or current-main merge preview.
Non-blocking
The performance result is specific to the reported Radeon 760M and one title/scene; it supports a narrow observation, not a general hardware claim. The focused and GPU results are author-reported, not independently reproduced here.
Sources
ca770b73f881ed05979a87d4f133f5d572fad1faNot verified
I did not independently run the local build, focused shader tests, Vulkan validation, or GPU captures. The macOS relinker jobs are pending; Linux product and specialized hosted jobs are skipped. No console behavior was tested.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-31T03:19:01Z.
Review: COMMENTED
Merge-skew check of approved shader PRs: this head together with #9749 fails
agc_shader_memory. Each PR passes on its own, and the two merge without a textual conflict. The same happens with #8716, which this PR builds on. cc @hamb3r @EagleBearerYSSetup: Linux (i7-8700, Ubuntu 26.04, GCC 15.2, Release), lavapipe (Mesa 26.0.3),
ANYPS5_NO_SHADER_CACHE=1. Basemain2a1ae91175. Heads: this PRca770b73f8, #9749da431b6a63, #871601514a6e7a. Each tree was merged--no-ffonto thatmain.agc_shader_memorywas run 3 times on each tree.agc_shader_memorymain+ this PRmain+ #9749main+ this PR + #9749main+ #8716 + #9749Cause. The failing case is the non-packed (storage image table) case of
verifyRuntimeImageSwitchDeduplication, from #8716. Its fixture builds oneDescriptorSourcewith aTableColumnand leavesheapSourceat its default of 0, so the column names its own source as its heap.#9749's
EmitTableWordtreats a column as nested whensources.at(column.heapSource).tableColumnhas a value. With this fixture, that parent is the column itself, which is not a buffer column, so emission stops at #9749's new refusal.Columns built by
ResourceTrackerpointheapSourceat the heap's buffer or address source, so the self-reference only comes from the fixture.Fix I checked in the test: give the column a separate heap source (the same lines apply to #8716):
With it,
agc_shader_memorypasses 3/3 onmain+ this PR + #9749, onmain+ #8716 + #9749, and onmain+ this PR alone, so the OpSwitch assertions still run without #9749.The other option is on #9749's side: don't treat a column whose
heapSourceis its own index as nested. That check is repeated inResourceMaterializer.cpp,ShaderDiskCache.cppandSpirvImageEmitter.cpp, so I only checked the fixture fix.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-07T20:33:12Z.
Review: CHANGES_REQUESTED
Thanks for the refresh and for being upfront about the numbers. Correctness looks fine (the balanced tree is only used when no two modes are equivalent, the invalid selector still ends in
OpUnreachable, and the fixture uses a separate heap source), but I can't merge it as a perf change on this evidence:main.To move it forward, please show a case that is still selected at runtime after #11952 (name the shader or fixture) and a same-scene before/after on
mainwithtools/trace_digest.pysummaries that shows a repeatable gain. Otherwise the 40 lines and 145 test lines are maintenance cost without a demonstrated benefit, and it's fine to close it. Feel free to reopen with that evidence.Pull request closed