fix(shader): split scalar-address descriptor phis #7694

Merged
Ondra97 merged 2371 commits from upstream-pr/7694 into main 2026-11-02 07:56:25 +00:00
Ondra97 commented 2026-10-19 00:46:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-19T00:46:24Z.


What

An image descriptor merged from a literal T# and a scalar-address load was rejected during preparation with GetImageResource dword 0 is not a valid runtime value. Recreate the loaded descriptor arm when its offset is a memory-independent expression of user data and constants. Pointer reuse still requires dominance and same-block instruction order; memory-derived offsets remain refused after SRT planning.

Copied raw reads retain their original block dependencies. Both the SRT tape and interpreted evaluators activate a descriptor only after all its required load blocks are reached. A skipped loaded arm stays null even with a stale nonzero pointer; a taken unmapped read still fails. The copies are planning-only and add no GPU memory access.

The rebase preserves main's descriptor-web state-limit diagnostic, 32-field MemoryInfo encoding, newer image/artifact fields and 144-byte IrValue assertion. Required block indices remain serialized, validated on decode and included in source interning. Main uses cache format 50, so this combined schema uses 51. The Linux/libstdc++ guards remain sizeof(DescriptorSource) == 216 with four aggregate fields and sizeof(TableColumn) == 112.

A dedicated agc_shader_descriptor_phis mode runs the existing Phi scenarios with both SRT cross-verifiers enabled. The full shader-memory test and the existing type-zero/pending-write tests are retained.

Tested

November 1 current-main refresh: base f2d874c1fdccf781c0fa5d86619bb5dd8894b958, submitted head 4c4b442a12a9a109d023d809d1baea7b6a3c6973. The existing topic/review-fix history and authorship are preserved. The registration conflict is resolved with agc_test_split.py resolve: the isolated descriptor-Phi test now belongs to tests/cmake/agc_shader_memory_tests.cmake, preserving its 30-second limit and both SRT cross-verification properties. All other registered shader-memory and disk-cache modes remain.

The merged code retains main's 144-byte IrValue check, its 32-field MemoryInfo and newer image/artifact fields, plus this PR's 216-byte/four-field DescriptorSource, requiredBlocks serialization and decoded-index validation. Standalone cache format remains 51 versus main's 50; this refresh adds no new instruction semantics.

Windows 11 Pro 10.0.26300, AMD Ryzen 9 7900X, 31.7 GiB RAM, WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT, Ninja Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=ON, pinned bundled dependencies. NVIDIA GeForce RTX 4070 Ti SUPER, driver 621.01 / 32.0.16.2101; Khronos validation manifest API 1.4.335.

  • Complete production relinker/libs and every selected shader/cache/replay/GPU fixture build on both revisions.
  • 43/43 shared focused CTests pass on main; 44/44 pass on the submitted head, zero failures/skips. The one additional case is the isolated descriptor-Phi mode. The selection contains every currently registered mode of the shader-memory and disk-cache executables, both replay tests, actual image-table/depth-clear GPU execution and patched-library loading.
  • Both full selections use ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, serial verbose CTest. Logs confirm actual RTX selection and instance/device layer insertion, with no missing requested layer, VUID or validation warning/error. The isolated Phi case enables APS5_VERIFY_SRT_TAPE=1 and APS5_VERIFY_SRT_COMPACT=1 through its CTest properties; the remaining tests keep their standard settings.
  • Fresh negative control: replacing only ResourceTracker.cpp with its exact base blob, while retaining the PR fixture/schema, makes agc_shader_descriptor_phis fail with GetImageResource dword 0 is not a valid runtime value at LoadAddressU32@pc=0x00000058. The fixed tracker is restored byte-for-byte and SHA-256 checked, then all production targets are rebuilt and the full final selection above passes on exact submitted sources. The failed control is not counted as a pass.
  • The Phi regression retains skipped mapped/unmapped/null-root checks, taken-unmapped refusal, planning-only copied reads, interpreted/tape comparisons, cache round trips and invalid decoded block rejection. It stops at validated SPIR-V; the separate image-table/depth-clear cases are the actual GPU checks.
  • Conventions, strict main synchronization, whitespace and registration checks pass. No test is removed, disabled or given a raised timeout.

Reproduction with the supported toolchain/layer configured:

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build --target agc_driver_depth_clear_hle_tests agc_driver_image_table_tests agc_shader_disk_cache_tests agc_shader_memory_tests agc_shader_replay agc_shader_replay_requests_tests libs patched_libraries_tests relinker --parallel 8
$env:ANYPS5_REQUIRE_VULKAN = '1'
$env:ANYPS5_NO_SHADER_CACHE = '1'
$env:VK_INSTANCE_LAYERS = 'VK_LAYER_KHRONOS_validation'
ctest --test-dir build -R '^(agc_driver_depth_clear_hle|agc_driver_image_table|agc_shader_bindless|agc_shader_cache_housekeeping_device|agc_shader_cache_housekeeping_extended|agc_shader_cache_housekeeping_extended\-long|agc_shader_cache_housekeeping_plain|agc_shader_descriptor_phis|agc_shader_disk_cache|agc_shader_disk_cache_host_stderr|agc_shader_disk_cache_large_file|agc_shader_disk_cache_long_paths|agc_shader_disk_cache_pack_ownership|agc_shader_entry_lane_proof_budget|agc_shader_frontend_pair|agc_shader_frontend_pair_off|agc_shader_layout_pair|agc_shader_layout_pair_off|agc_shader_memory|agc_shader_prebuilt_discovery_device|agc_shader_prebuilt_discovery_extended|agc_shader_prebuilt_discovery_extended\-forward|agc_shader_prebuilt_discovery_extended\-long|agc_shader_prebuilt_discovery_plain|agc_shader_prebuilt_discovery_plain\-long|agc_shader_prebuilt_discovery_relative|agc_shader_quad_mask_no_demote|agc_shader_region_merge|agc_shader_replay_requests|agc_shader_replay_tool|agc_shader_result_memo_budget|agc_shader_result_memo_budget_masked|agc_shader_result_memo_budget_threads|agc_shader_selected_records_direct_image_limit|agc_shader_selected_records_direct_pair_limit|agc_shader_selected_records_image_limit|agc_shader_selected_records_pair_limit|agc_shader_specialized_bda_abi_full|agc_shader_specialized_bda_abi_none|agc_shader_srt_read_patching|agc_shader_table_snapshot_reuse|agc_shader_table_snapshot_reuse_unmasked|agc_shader_type_zero_image_materialization|patched_libraries)$' -j 1 -V --no-tests=error --output-on-failure

Other standalone schema changes, including #10351's stencilAttachmentExport, use format 51 for different layouts. Their unchanged heads are not a combined schema. When one lands, the other must rebase, retain both serialized field sets and advance the combined version (52 for exactly these two changes); downstream #11551 must then use the next combined version. No new functional dependency between the unrelated features or mixed-stack execution is claimed.

The historical native Linux executions below belong to their exact older heads. These new executions are Windows; they do not claim a fresh native Linux run. The previously documented optional global SRT-verifier/all-Raw callback-count interaction is not reported as fixed by this rebase; standard memory modes and the isolated verified-Phi mode are all retained and executed. No original title shader, title/homebrew run, full CTest suite or speedup is claimed.

Earlier validation (historical source pins and environments)

Revalidated on 2026-10-30: final base 1edecd693c36f2f2d37851db54b990c56c6f5900, submitted head 0f2c8f4cc7b9a3468583e53e1978cda985d6ff3e. Main was merged into the existing branch, retaining the five original topic patches and their history.

Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X, 31.7 GiB RAM; WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT; Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=ON, pinned bundled dependencies. NVIDIA GeForce RTX 4070 Ti SUPER, driver 621.01 / 32.0.16.2101; Khronos validation 1.4.335.

  • Full production relinker/libs and every selected shader/cache/replay/GPU fixture build passed on the submitted sources. All 374 patched libraries loaded, zero failures.
  • 43/43 shared focused tests passed on main e049725553c4cf9770eb06d2ab1a211059efd29d; 44/44 passed on the submitted head, zero failures or skips. The extra case is the dedicated descriptor-Phi cross-verification mode. The selection includes every registered shader-memory/disk-cache mode, both replay tests, image-table execution, depth-clear HLE and patched libraries. Main advanced with unrelated library/tool changes; the shader, driver, kernel/libc and CMake inputs used by the paired GPU tests are unchanged between the tested main and the final base, and the final head was fully rebuilt and retested.
  • Both GPU logs confirm the actual RTX and instance/device validation layers, with no missing requested layer, VUIDs, validation warnings or errors. The reported agc_driver_depth_clear_hle crash/common-parent diagnostic from the older contributor run did not reproduce on either current Windows tree. This does not establish that the earlier native-GPU report is fixed.
  • The isolated Phi case enables APS5_VERIFY_SRT_TAPE=1 and APS5_VERIFY_SRT_COMPACT=1 through CTest. It checks planning-only copied reads, skipped mapped/unmapped/null roots, taken-unmapped refusal, explicit interpreted/tape queries, cache round trips and rejected invalid block indices. It stops at validated SPIR-V; image-table/depth-clear provide actual GPU coverage.
  • Fresh negative control: substituting only the exact base ResourceTracker.cpp, while keeping the new fixture and schema, makes the isolated Phi case fail at LoadAddressU32@pc=0x00000058 with the original invalid-runtime-value error. The fixed file was restored byte-for-byte, touched, rebuilt and the same case passed; the submitted tree was subsequently rebuilt and the complete focused selection rerun.

Optional global cross-verification control: exporting both SRT verification flags to the entire suite produced the same two failures on clean main and the preliminary rebased PR: agc_shader_type_zero_image_materialization and agc_shader_memory, both at main's synthetic all-Raw pending-write assertion. That assertion includes an exact eight-read callback count. These failed controls are not counted as passes. Standard execution passes both existing cases; the new dedicated mode enables cross-verification specifically for the descriptor-Phi scenarios, without removing or skipping the other tests. No fix for the broader optional-mode interaction is claimed.

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
cmake --build build --target agc_driver_depth_clear_hle_tests agc_driver_image_table_tests agc_shader_disk_cache_tests agc_shader_memory_tests agc_shader_replay agc_shader_replay_requests_tests libs patched_libraries_tests relinker --parallel 8
$env:ANYPS5_REQUIRE_VULKAN = '1'
$env:ANYPS5_NO_SHADER_CACHE = '1'
$env:VK_INSTANCE_LAYERS = 'VK_LAYER_KHRONOS_validation'
ctest --test-dir build -R '^(agc_driver_depth_clear_hle|agc_driver_image_table|agc_shader_bindless|agc_shader_cache_housekeeping_device|agc_shader_cache_housekeeping_extended|agc_shader_cache_housekeeping_extended\-long|agc_shader_cache_housekeeping_plain|agc_shader_descriptor_phis|agc_shader_disk_cache|agc_shader_disk_cache_host_stderr|agc_shader_disk_cache_large_file|agc_shader_disk_cache_long_paths|agc_shader_disk_cache_pack_ownership|agc_shader_entry_lane_proof_budget|agc_shader_frontend_pair|agc_shader_frontend_pair_off|agc_shader_layout_pair|agc_shader_layout_pair_off|agc_shader_memory|agc_shader_prebuilt_discovery_device|agc_shader_prebuilt_discovery_extended|agc_shader_prebuilt_discovery_extended\-forward|agc_shader_prebuilt_discovery_extended\-long|agc_shader_prebuilt_discovery_plain|agc_shader_prebuilt_discovery_plain\-long|agc_shader_prebuilt_discovery_relative|agc_shader_quad_mask_no_demote|agc_shader_region_merge|agc_shader_replay_requests|agc_shader_replay_tool|agc_shader_result_memo_budget|agc_shader_result_memo_budget_masked|agc_shader_result_memo_budget_threads|agc_shader_selected_records_direct_image_limit|agc_shader_selected_records_direct_pair_limit|agc_shader_selected_records_image_limit|agc_shader_selected_records_pair_limit|agc_shader_specialized_bda_abi_full|agc_shader_specialized_bda_abi_none|agc_shader_srt_read_patching|agc_shader_table_snapshot_reuse|agc_shader_table_snapshot_reuse_unmasked|agc_shader_type_zero_image_materialization|patched_libraries)$' -j 1 -V --output-on-failure --no-tests=error
python tools/check_conventions.py --base origin/main
python tools/check_main_sync.py --base origin/main --strict
python tools/check_test_registration.py build
python tools/pr_overlap.py --branch codex/pr7694-rebase-20261030 --repo boykopovar/AnyPS5 --jobs 4
git diff origin/main...HEAD --check

Exact-head native Linux verification checked out submitted SHA 0f2c8f4cc7b9a3468583e53e1978cda985d6ff3e directly; the workflow lives only on the separate verification branch, outside this PR.

Ubuntu 24.04.5 LTS x86-64, AMD EPYC 9V74 80-Core Processor, 15Gi visible RAM, g++-14 (Ubuntu 14.2.0-4ubuntu2~24.04.1) 14.2.0; Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=ON, pinned recursive dependencies. Both shader-memory and shader-disk-cache targets built, including the native libstdc++ layout assertions (DescriptorSource 216 bytes/four fields, MemoryInfo 32 fields) and cache format 51.

ctest --test-dir build -R '^agc_shader_(memory|disk_cache|descriptor_phis)$' -V --output-on-failure --no-tests=error --repeat until-fail:3 passed 3/3 tests in all three repetitions (9 executions), zero failures or skips. The dedicated Phi case enables both SRT verification flags through its CTest properties; the full memory and cache tests retain their standard environment. The guarded-read marker appears six times, from the full-memory and isolated-Phi executions. These are CPU preparation, serialization and SPIR-V-validation checks; this job uses no GPU.

Conventions, strict main synchronization, whitespace and registration checks pass. The final overlap scan lists 85 peers. Shared production patches from the original 44 were inspected, with no second implementation of copied-read requiredBlocks provenance. The 41 additional entries share test/registration areas and add no changes to the affected production paths; none uses the new descriptor-Phi mode name. #7223/#7395 and their table follow-ups change independent layout/decoder fields, while #6488/#7642/#10193 add lane/device-table paths and #7684 bounds keys. Composing these schemas must retain both field sets, recalculate size/count/minimum-list assertions and select a new combined cache version. Version numbers on other standalone branches do not identify the same schema. No peer merge-order agreement or mixed-stack runtime validation is claimed.

No complete CTest suite, original title shader, title/homebrew execution or performance improvement is claimed. Earlier validation is retained below with its own revisions, hardware and scope.

Earlier submitted-revision validation (historical)

Base 12686b52de3db682868a420d196682bdf539dd83; submitted head fefe7bc97e80948a20f11e715c5e24f92f3b4f16.

Windows 11 Pro 10.0.26300, Ryzen 9 7900X, 31.7 GiB RAM, WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT, CMake 4.3.1, Ninja 1.13.2, Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=ON, pinned bundled dependencies. NVIDIA GeForce RTX 4070 Ti SUPER, driver 617.42 / 32.0.16.1742; Khronos validation 1.4.335.

  • Built relinker, libs, patched_libraries_tests, agc_shader_memory_tests, agc_shader_disk_cache_tests, agc_shader_replay, agc_shader_replay_requests_tests and agc_driver_image_table_tests on both exact revisions with cmake --build <build> --target <targets> --parallel 8.
  • Identical focused selection: 26/26 passed on main and 26/26 on the fix, zero skips. This includes every registered mode of agc_shader_memory_tests, shader disk cache, both shader replay tests, patched libraries and driver image table. The selection now includes main's three result-memo budget modes as well as the earlier 23 cases. Each library-load check loaded 368 patched libraries, zero failures.
  • Both runs set APS5_VERIFY_SRT_TAPE=1, APS5_VERIFY_SRT_COMPACT=1, ANYPS5_GPU='RTX 4070 Ti SUPER', ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Loader logs confirm instance and device validation-layer insertion and the actual selected RTX. Both have zero VUIDs, validation warnings, validation errors and missing-layer reports.
  • The fixed regression covers skipped mapped/unmapped/null roots, taken mapped/unmapped roots, no skipped-read fault reports, planning-only copies, cache-plan round trips, invalid cached block indices, and explicit SRT tape/interpreted queries. The synthetic fragment stops at validated SPIR-V; it is not dispatched on the GPU. agc_driver_image_table is the hardware GPU check.
  • Fresh negative control: with the exact base ResourceTracker.cpp and the current regression kept, agc_shader_memory fails at LoadAddressU32@pc=0x58 with the original invalid-runtime-value error. Restoring the tracker byte-for-byte, rebuilding and rerunning the registered test passes with the skipped/taken-arm regression marker.

Native Linux verification is recorded in the exact-head run. Its workflow is on a separate verification branch and checks out the submitted head directly.

Ubuntu 24.04.5 LTS x86_64, AMD EPYC 7763, approximately 15 GiB visible RAM, GCC 14.2.0, Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=ON, pinned bundled dependencies. Native agc_shader_memory_tests and agc_shader_disk_cache_tests build, including the Linux-only layout assertions. ctest --test-dir build -R '^agc_shader_(memory|disk_cache)$' -V --output-on-failure --no-tests=error --repeat until-fail:3 with both SRT verification flags passes 2/2 in all three repetitions, zero skips. The guarded-read regression marker appears on every memory-test run. These are CPU shader preparation, serialization and SPIR-V validation checks.

Conventions, strict main-sync, whitespace and test registration checks pass. Registration counts 1,452 Windows test executables, with none unregistered; the executed Windows selection is the 26 tests above.

The overlap scanner reports a direct cache layout/decoder collision with #7223 and shared files it cannot automatically compare. I inspected the shared changes of all 48 peer PRs from the fetched heads. None adds this copied-read requiredBlocks provenance. #7223/#7395 and their pointer-table follow-ups add independent TableColumn fields; #6488/#7642/#10193 add lane/device-table paths; #7684 bounds table keys. Composing them must preserve both sets of fields, recompute layout assertions and decoder limits, and choose a cache version for the combined schema. Source-lead tracing in #5609 belongs after guard activity is applied. No peer implementation, agreed merge order or mixed-stack validation is claimed here.

No complete CTest suite, original title shader, title/homebrew execution or speedup is claimed.

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
  • 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 4070 Ti SUPER, driver 621.01 / 32.0.16.2101, Windows 11 Pro 10.0.26300 (image-table and depth-clear HLE)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4914266347 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7694). Originally posted by [Ondra97](https://github.com/Ondra97) on 2026-10-19T00:46:24Z. --- ### What An image descriptor merged from a literal T# and a scalar-address load was rejected during preparation with `GetImageResource dword 0 is not a valid runtime value`. Recreate the loaded descriptor arm when its offset is a memory-independent expression of user data and constants. Pointer reuse still requires dominance and same-block instruction order; memory-derived offsets remain refused after SRT planning. Copied raw reads retain their original block dependencies. Both the SRT tape and interpreted evaluators activate a descriptor only after all its required load blocks are reached. A skipped loaded arm stays null even with a stale nonzero pointer; a taken unmapped read still fails. The copies are planning-only and add no GPU memory access. The rebase preserves main's descriptor-web state-limit diagnostic, 32-field `MemoryInfo` encoding, newer image/artifact fields and 144-byte `IrValue` assertion. Required block indices remain serialized, validated on decode and included in source interning. Main uses cache format 50, so this combined schema uses **51**. The Linux/libstdc++ guards remain `sizeof(DescriptorSource) == 216` with four aggregate fields and `sizeof(TableColumn) == 112`. A dedicated `agc_shader_descriptor_phis` mode runs the existing Phi scenarios with both SRT cross-verifiers enabled. The full shader-memory test and the existing type-zero/pending-write tests are retained. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> November 1 current-main refresh: base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`, submitted head `4c4b442a12a9a109d023d809d1baea7b6a3c6973`. The existing topic/review-fix history and authorship are preserved. The registration conflict is resolved with `agc_test_split.py resolve`: the isolated descriptor-Phi test now belongs to `tests/cmake/agc_shader_memory_tests.cmake`, preserving its 30-second limit and both SRT cross-verification properties. All other registered shader-memory and disk-cache modes remain. The merged code retains main's **144-byte `IrValue`** check, its 32-field `MemoryInfo` and newer image/artifact fields, plus this PR's **216-byte/four-field `DescriptorSource`**, `requiredBlocks` serialization and decoded-index validation. Standalone cache format remains 51 versus main's 50; this refresh adds no new instruction semantics. Windows 11 Pro 10.0.26300, AMD Ryzen 9 7900X, 31.7 GiB RAM, WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT, Ninja Release, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, pinned bundled dependencies. NVIDIA GeForce RTX 4070 Ti SUPER, driver 621.01 / 32.0.16.2101; Khronos validation manifest API 1.4.335. - Complete production `relinker`/`libs` and every selected shader/cache/replay/GPU fixture build on both revisions. - **43/43 shared focused CTests pass on main; 44/44 pass on the submitted head**, zero failures/skips. The one additional case is the isolated descriptor-Phi mode. The selection contains every currently registered mode of the shader-memory and disk-cache executables, both replay tests, actual image-table/depth-clear GPU execution and patched-library loading. - Both full selections use `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, serial verbose CTest. Logs confirm actual RTX selection and instance/device layer insertion, with no missing requested layer, VUID or validation warning/error. The isolated Phi case enables `APS5_VERIFY_SRT_TAPE=1` and `APS5_VERIFY_SRT_COMPACT=1` through its CTest properties; the remaining tests keep their standard settings. - Fresh negative control: replacing only `ResourceTracker.cpp` with its exact base blob, while retaining the PR fixture/schema, makes `agc_shader_descriptor_phis` fail with `GetImageResource dword 0 is not a valid runtime value` at `LoadAddressU32@pc=0x00000058`. The fixed tracker is restored byte-for-byte and SHA-256 checked, then all production targets are rebuilt and the full final selection above passes on exact submitted sources. The failed control is not counted as a pass. - The Phi regression retains skipped mapped/unmapped/null-root checks, taken-unmapped refusal, planning-only copied reads, interpreted/tape comparisons, cache round trips and invalid decoded block rejection. It stops at validated SPIR-V; the separate image-table/depth-clear cases are the actual GPU checks. - Conventions, strict main synchronization, whitespace and registration checks pass. No test is removed, disabled or given a raised timeout. Reproduction with the supported toolchain/layer configured: ```powershell cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON cmake --build build --target agc_driver_depth_clear_hle_tests agc_driver_image_table_tests agc_shader_disk_cache_tests agc_shader_memory_tests agc_shader_replay agc_shader_replay_requests_tests libs patched_libraries_tests relinker --parallel 8 $env:ANYPS5_REQUIRE_VULKAN = '1' $env:ANYPS5_NO_SHADER_CACHE = '1' $env:VK_INSTANCE_LAYERS = 'VK_LAYER_KHRONOS_validation' ctest --test-dir build -R '^(agc_driver_depth_clear_hle|agc_driver_image_table|agc_shader_bindless|agc_shader_cache_housekeeping_device|agc_shader_cache_housekeeping_extended|agc_shader_cache_housekeeping_extended\-long|agc_shader_cache_housekeeping_plain|agc_shader_descriptor_phis|agc_shader_disk_cache|agc_shader_disk_cache_host_stderr|agc_shader_disk_cache_large_file|agc_shader_disk_cache_long_paths|agc_shader_disk_cache_pack_ownership|agc_shader_entry_lane_proof_budget|agc_shader_frontend_pair|agc_shader_frontend_pair_off|agc_shader_layout_pair|agc_shader_layout_pair_off|agc_shader_memory|agc_shader_prebuilt_discovery_device|agc_shader_prebuilt_discovery_extended|agc_shader_prebuilt_discovery_extended\-forward|agc_shader_prebuilt_discovery_extended\-long|agc_shader_prebuilt_discovery_plain|agc_shader_prebuilt_discovery_plain\-long|agc_shader_prebuilt_discovery_relative|agc_shader_quad_mask_no_demote|agc_shader_region_merge|agc_shader_replay_requests|agc_shader_replay_tool|agc_shader_result_memo_budget|agc_shader_result_memo_budget_masked|agc_shader_result_memo_budget_threads|agc_shader_selected_records_direct_image_limit|agc_shader_selected_records_direct_pair_limit|agc_shader_selected_records_image_limit|agc_shader_selected_records_pair_limit|agc_shader_specialized_bda_abi_full|agc_shader_specialized_bda_abi_none|agc_shader_srt_read_patching|agc_shader_table_snapshot_reuse|agc_shader_table_snapshot_reuse_unmasked|agc_shader_type_zero_image_materialization|patched_libraries)$' -j 1 -V --no-tests=error --output-on-failure ``` Other standalone schema changes, including #10351's `stencilAttachmentExport`, use format 51 for different layouts. Their unchanged heads are not a combined schema. When one lands, the other must rebase, retain both serialized field sets and advance the combined version (52 for exactly these two changes); downstream #11551 must then use the next combined version. No new functional dependency between the unrelated features or mixed-stack execution is claimed. The historical native Linux executions below belong to their exact older heads. These new executions are Windows; they do not claim a fresh native Linux run. The previously documented optional global SRT-verifier/all-Raw callback-count interaction is not reported as fixed by this rebase; standard memory modes and the isolated verified-Phi mode are all retained and executed. No original title shader, title/homebrew run, full CTest suite or speedup is claimed. <details> <summary>Earlier validation (historical source pins and environments)</summary> Revalidated on 2026-10-30: final base `1edecd693c36f2f2d37851db54b990c56c6f5900`, submitted head `0f2c8f4cc7b9a3468583e53e1978cda985d6ff3e`. Main was merged into the existing branch, retaining the five original topic patches and their history. Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X, 31.7 GiB RAM; WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT; Release, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, pinned bundled dependencies. NVIDIA GeForce RTX 4070 Ti SUPER, driver 621.01 / 32.0.16.2101; Khronos validation 1.4.335. - Full production `relinker`/`libs` and every selected shader/cache/replay/GPU fixture build passed on the submitted sources. All 374 patched libraries loaded, zero failures. - **43/43 shared focused tests passed on main** `e049725553c4cf9770eb06d2ab1a211059efd29d`; **44/44 passed on the submitted head**, zero failures or skips. The extra case is the dedicated descriptor-Phi cross-verification mode. The selection includes every registered shader-memory/disk-cache mode, both replay tests, image-table execution, depth-clear HLE and patched libraries. Main advanced with unrelated library/tool changes; the shader, driver, kernel/libc and CMake inputs used by the paired GPU tests are unchanged between the tested main and the final base, and the final head was fully rebuilt and retested. - Both GPU logs confirm the actual RTX and instance/device validation layers, with no missing requested layer, VUIDs, validation warnings or errors. The reported `agc_driver_depth_clear_hle` crash/common-parent diagnostic from the older contributor run did not reproduce on either current Windows tree. This does not establish that the earlier native-GPU report is fixed. - The isolated Phi case enables `APS5_VERIFY_SRT_TAPE=1` and `APS5_VERIFY_SRT_COMPACT=1` through CTest. It checks planning-only copied reads, skipped mapped/unmapped/null roots, taken-unmapped refusal, explicit interpreted/tape queries, cache round trips and rejected invalid block indices. It stops at validated SPIR-V; image-table/depth-clear provide actual GPU coverage. - Fresh negative control: substituting only the exact base `ResourceTracker.cpp`, while keeping the new fixture and schema, makes the isolated Phi case fail at `LoadAddressU32@pc=0x00000058` with the original invalid-runtime-value error. The fixed file was restored byte-for-byte, touched, rebuilt and the same case passed; the submitted tree was subsequently rebuilt and the complete focused selection rerun. Optional global cross-verification control: exporting both SRT verification flags to the entire suite produced the same two failures on clean main and the preliminary rebased PR: `agc_shader_type_zero_image_materialization` and `agc_shader_memory`, both at main's synthetic all-Raw pending-write assertion. That assertion includes an exact eight-read callback count. These failed controls are not counted as passes. Standard execution passes both existing cases; the new dedicated mode enables cross-verification specifically for the descriptor-Phi scenarios, without removing or skipping the other tests. No fix for the broader optional-mode interaction is claimed. ```powershell cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ cmake --build build --target agc_driver_depth_clear_hle_tests agc_driver_image_table_tests agc_shader_disk_cache_tests agc_shader_memory_tests agc_shader_replay agc_shader_replay_requests_tests libs patched_libraries_tests relinker --parallel 8 $env:ANYPS5_REQUIRE_VULKAN = '1' $env:ANYPS5_NO_SHADER_CACHE = '1' $env:VK_INSTANCE_LAYERS = 'VK_LAYER_KHRONOS_validation' ctest --test-dir build -R '^(agc_driver_depth_clear_hle|agc_driver_image_table|agc_shader_bindless|agc_shader_cache_housekeeping_device|agc_shader_cache_housekeeping_extended|agc_shader_cache_housekeeping_extended\-long|agc_shader_cache_housekeeping_plain|agc_shader_descriptor_phis|agc_shader_disk_cache|agc_shader_disk_cache_host_stderr|agc_shader_disk_cache_large_file|agc_shader_disk_cache_long_paths|agc_shader_disk_cache_pack_ownership|agc_shader_entry_lane_proof_budget|agc_shader_frontend_pair|agc_shader_frontend_pair_off|agc_shader_layout_pair|agc_shader_layout_pair_off|agc_shader_memory|agc_shader_prebuilt_discovery_device|agc_shader_prebuilt_discovery_extended|agc_shader_prebuilt_discovery_extended\-forward|agc_shader_prebuilt_discovery_extended\-long|agc_shader_prebuilt_discovery_plain|agc_shader_prebuilt_discovery_plain\-long|agc_shader_prebuilt_discovery_relative|agc_shader_quad_mask_no_demote|agc_shader_region_merge|agc_shader_replay_requests|agc_shader_replay_tool|agc_shader_result_memo_budget|agc_shader_result_memo_budget_masked|agc_shader_result_memo_budget_threads|agc_shader_selected_records_direct_image_limit|agc_shader_selected_records_direct_pair_limit|agc_shader_selected_records_image_limit|agc_shader_selected_records_pair_limit|agc_shader_specialized_bda_abi_full|agc_shader_specialized_bda_abi_none|agc_shader_srt_read_patching|agc_shader_table_snapshot_reuse|agc_shader_table_snapshot_reuse_unmasked|agc_shader_type_zero_image_materialization|patched_libraries)$' -j 1 -V --output-on-failure --no-tests=error python tools/check_conventions.py --base origin/main python tools/check_main_sync.py --base origin/main --strict python tools/check_test_registration.py build python tools/pr_overlap.py --branch codex/pr7694-rebase-20261030 --repo boykopovar/AnyPS5 --jobs 4 git diff origin/main...HEAD --check ``` [Exact-head native Linux verification](https://github.com/Ondra97/AnyPS5/actions/runs/41046492245) checked out submitted SHA `0f2c8f4cc7b9a3468583e53e1978cda985d6ff3e` directly; the workflow lives only on the separate verification branch, outside this PR. Ubuntu 24.04.5 LTS x86-64, AMD EPYC 9V74 80-Core Processor, 15Gi visible RAM, g++-14 (Ubuntu 14.2.0-4ubuntu2~24.04.1) 14.2.0; Release, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, pinned recursive dependencies. Both shader-memory and shader-disk-cache targets built, including the native libstdc++ layout assertions (`DescriptorSource` 216 bytes/four fields, `MemoryInfo` 32 fields) and cache format 51. `ctest --test-dir build -R '^agc_shader_(memory|disk_cache|descriptor_phis)$' -V --output-on-failure --no-tests=error --repeat until-fail:3` passed **3/3 tests in all three repetitions (9 executions), zero failures or skips**. The dedicated Phi case enables both SRT verification flags through its CTest properties; the full memory and cache tests retain their standard environment. The guarded-read marker appears six times, from the full-memory and isolated-Phi executions. These are CPU preparation, serialization and SPIR-V-validation checks; this job uses no GPU. Conventions, strict main synchronization, whitespace and registration checks pass. The final overlap scan lists 85 peers. Shared production patches from the original 44 were inspected, with no second implementation of copied-read `requiredBlocks` provenance. The 41 additional entries share test/registration areas and add no changes to the affected production paths; none uses the new descriptor-Phi mode name. #7223/#7395 and their table follow-ups change independent layout/decoder fields, while #6488/#7642/#10193 add lane/device-table paths and #7684 bounds keys. Composing these schemas must retain both field sets, recalculate size/count/minimum-list assertions and select a new combined cache version. Version numbers on other standalone branches do not identify the same schema. No peer merge-order agreement or mixed-stack runtime validation is claimed. No complete CTest suite, original title shader, title/homebrew execution or performance improvement is claimed. Earlier validation is retained below with its own revisions, hardware and scope. <details> <summary>Earlier submitted-revision validation (historical)</summary> <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Base `12686b52de3db682868a420d196682bdf539dd83`; submitted head `fefe7bc97e80948a20f11e715c5e24f92f3b4f16`. Windows 11 Pro 10.0.26300, Ryzen 9 7900X, 31.7 GiB RAM, WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT, CMake 4.3.1, Ninja 1.13.2, Release, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, pinned bundled dependencies. NVIDIA GeForce RTX 4070 Ti SUPER, driver 617.42 / 32.0.16.1742; Khronos validation 1.4.335. - Built `relinker`, `libs`, `patched_libraries_tests`, `agc_shader_memory_tests`, `agc_shader_disk_cache_tests`, `agc_shader_replay`, `agc_shader_replay_requests_tests` and `agc_driver_image_table_tests` on both exact revisions with `cmake --build <build> --target <targets> --parallel 8`. - Identical focused selection: **26/26 passed on main and 26/26 on the fix, zero skips**. This includes every registered mode of `agc_shader_memory_tests`, shader disk cache, both shader replay tests, patched libraries and driver image table. The selection now includes main's three result-memo budget modes as well as the earlier 23 cases. Each library-load check loaded 368 patched libraries, zero failures. - Both runs set `APS5_VERIFY_SRT_TAPE=1`, `APS5_VERIFY_SRT_COMPACT=1`, `ANYPS5_GPU='RTX 4070 Ti SUPER'`, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`. Loader logs confirm instance and device validation-layer insertion and the actual selected RTX. Both have **zero VUIDs, validation warnings, validation errors and missing-layer reports**. - The fixed regression covers skipped mapped/unmapped/null roots, taken mapped/unmapped roots, no skipped-read fault reports, planning-only copies, cache-plan round trips, invalid cached block indices, and explicit SRT tape/interpreted queries. The synthetic fragment stops at validated SPIR-V; it is not dispatched on the GPU. `agc_driver_image_table` is the hardware GPU check. - Fresh negative control: with the exact base `ResourceTracker.cpp` and the current regression kept, `agc_shader_memory` fails at `LoadAddressU32@pc=0x58` with the original invalid-runtime-value error. Restoring the tracker byte-for-byte, rebuilding and rerunning the registered test passes with the skipped/taken-arm regression marker. Native Linux verification is recorded in the [exact-head run](https://github.com/Ondra97/AnyPS5/actions/runs/40472112333). Its workflow is on a separate verification branch and checks out the submitted head directly. Ubuntu 24.04.5 LTS x86_64, AMD EPYC 7763, approximately 15 GiB visible RAM, GCC 14.2.0, Release, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, pinned bundled dependencies. Native `agc_shader_memory_tests` and `agc_shader_disk_cache_tests` build, including the Linux-only layout assertions. `ctest --test-dir build -R '^agc_shader_(memory|disk_cache)$' -V --output-on-failure --no-tests=error --repeat until-fail:3` with both SRT verification flags passes **2/2 in all three repetitions, zero skips**. The guarded-read regression marker appears on every memory-test run. These are CPU shader preparation, serialization and SPIR-V validation checks. Conventions, strict main-sync, whitespace and test registration checks pass. Registration counts 1,452 Windows test executables, with none unregistered; the executed Windows selection is the 26 tests above. The overlap scanner reports a direct cache layout/decoder collision with #7223 and shared files it cannot automatically compare. I inspected the shared changes of all 48 peer PRs from the fetched heads. None adds this copied-read `requiredBlocks` provenance. #7223/#7395 and their pointer-table follow-ups add independent `TableColumn` fields; #6488/#7642/#10193 add lane/device-table paths; #7684 bounds table keys. Composing them must preserve both sets of fields, recompute layout assertions and decoder limits, and choose a cache version for the combined schema. Source-lead tracing in #5609 belongs after guard activity is applied. No peer implementation, agreed merge order or mixed-stack validation is claimed here. No complete CTest suite, original title shader, title/homebrew execution or speedup is claimed. </details> </details> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> NVIDIA GeForce RTX 4070 Ti SUPER, driver 621.01 / 32.0.16.2101, Windows 11 Pro 10.0.26300 (image-table and depth-clear HLE) - [x] AI-assisted: <!-- yes / no --> yes
savvaniss commented 2026-10-19 07:42:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T07:42:54Z.


Intel and AMD Windows data: the 15 shader tests this PR touches pass on an Intel UHD 770 and an AMD RX 9070 XT.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, with VkCache emptied first. This head 30d44b39a merged into main 6b8228b2b.

Tests, ×3 UHD 770 RX 9070 XT
This head: the 15 tests built from tests/ShaderMemory.cpp (agc_shader_memory, agc_shader_bindless, agc_shader_frontend_pair, agc_shader_layout_pair and the others) 15 of 15 pass 15 of 15 pass

tests/ShaderMemory.cpp has changed on main since this branch's base, so I have no clean before-run.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6262245138 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7694#issuecomment-6262245138). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-19T07:42:54Z. --- Intel and AMD Windows data: the 15 shader tests this PR touches pass on an Intel UHD 770 and an AMD RX 9070 XT. Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, `ANYPS5_NO_SHADER_CACHE=1`, serial CTest. Intel UHD Graphics 770 (`8086:a780`), driver 32.0.101.7088. AMD Radeon RX 9070 XT (`1002:7550`), driver 32.0.31041.1004, with `VkCache` emptied first. This head `30d44b39a` merged into `main` `6b8228b2b`. | Tests, ×3 | UHD 770 | RX 9070 XT | |---|---|---| | This head: the 15 tests built from `tests/ShaderMemory.cpp` (`agc_shader_memory`, `agc_shader_bindless`, `agc_shader_frontend_pair`, `agc_shader_layout_pair` and the others) | 15 of 15 pass | 15 of 15 pass | `tests/ShaderMemory.cpp` has changed on `main` since this branch's base, so I have no clean before-run. AI-assisted: yes (Claude Code)
DavidAmsellem commented 2026-10-19 17:22:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DavidAmsellem on 2026-10-19T17:22:08Z.


First AMD-on-Linux (RADV) run of this PR. Merged onto main dbac9fa15 (clean merge), built in full and compared with the same main, on the same machine.

AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release.

Full suite (ANYPS5_REQUIRE_VULKAN=1 ctest -j8): 1638/1640 with this PR, against 1638/1640 on main. The failures are the same two on both, so this PR adds none: agc_driver_image_table_vouched_lookups (#7766, fixed by #7916) and agc_driver_guest_memory_lifetime (#7784).

agc_shader_memory passes. The PR adds no new ctest entry, and no test is skipped or removed compared with main.

GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273049409 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7694#issuecomment-6273049409). Originally posted by [DavidAmsellem](https://github.com/DavidAmsellem) on 2026-10-19T17:22:08Z. --- First AMD-on-Linux (RADV) run of this PR. Merged onto `main` `dbac9fa15` (clean merge), built in full and compared with the same `main`, on the same machine. AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release. Full suite (`ANYPS5_REQUIRE_VULKAN=1 ctest -j8`): **1638/1640 with this PR, against 1638/1640 on `main`**. The failures are the same two on both, so this PR adds none: `agc_driver_image_table_vouched_lookups` (#7766, fixed by #7916) and `agc_driver_guest_memory_lifetime` (#7784). `agc_shader_memory` passes. The PR adds no new ctest entry, and no test is skipped or removed compared with `main`. GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38 AI-assisted: yes
DavidAmsellem commented 2026-10-19 18:16:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DavidAmsellem on 2026-10-19T18:16:54Z.


First AMD-on-Linux (RADV) run of this PR. Merged onto main dbac9fa15 (clean merge), built in full and compared with the same main, on the same machine.

AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release.

Full suite (ANYPS5_REQUIRE_VULKAN=1 ctest -j8) at e46aefc56: 1638/1640 with this PR, against 1638/1640 on main. The two failures are the same on both, so this PR adds none: agc_driver_image_table_vouched_lookups (#7766, fixed by #7916) and agc_driver_guest_memory_lifetime (#7784).

Comparing the JUnit output with main: this PR adds no ctest entry, and none is skipped or removed.

This checks correctness only; I did not measure performance.

GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6274106411 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7694#issuecomment-6274106411). Originally posted by [DavidAmsellem](https://github.com/DavidAmsellem) on 2026-10-19T18:16:54Z. --- First AMD-on-Linux (RADV) run of this PR. Merged onto `main` `dbac9fa15` (clean merge), built in full and compared with the same `main`, on the same machine. AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release. Full suite (`ANYPS5_REQUIRE_VULKAN=1 ctest -j8`) at `e46aefc56`: **1638/1640 with this PR**, against 1638/1640 on `main`. The two failures are the same on both, so this PR adds none: `agc_driver_image_table_vouched_lookups` (#7766, fixed by #7916) and `agc_driver_guest_memory_lifetime` (#7784). Comparing the JUnit output with `main`: this PR adds no ctest entry, and none is skipped or removed. This checks correctness only; I did not measure performance. GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38 AI-assisted: yes
ahmadmuj commented 2026-10-25 11:57:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ahmadmuj on 2026-10-25T11:57:32Z.

Review: COMMENTED


Reviewed head 30d44b39a merged onto current main a5a780eaa (clean merge). Linux, GCC 13.3, Release, built only agc_shader_memory_tests. CPU side only; the new case stops at SPIR-V, so no GPU needed.

What I ran:

  • agc_shader_memory on the merge: passes, 3 of 3.
  • Main's ResourceTracker.cpp with your test: fails with GetImageResource dword 0 is not a valid runtime value; chain: Phi(Immediate, LoadAddressU32@pc=0x00000058(...)). pc 0x58 is the new s_load_dwordx8, so the red run really comes from the new case.
  • Same merge with -DANYPS5_ENABLE_SPIRV_TOOLS=ON (what the Linux CI job configures): passes, so the module from the new case gets through validation.
  • tools/check_conventions.py --base origin/main: passes.

One gap: the loaded arm now gets read even when its branch is skipped.

The copied LoadAddressU32 lands in the merge block, so capture evaluates it on both paths. I ran your shader again with rawUserData[7] = 0, so s_cbranch_scc1 jumps over the s_load:

rawUserData[0] Result
0x500000 (mapped) Capture holds both T#s, including 0x21080... read from memory the shader never loads on this path
0x900000 (nonzero, outside rawRegions) CaptureResources and Recompile throw EvaluateRuntimeSources failed to evaluate runtime sources: descriptor source 1 dword 0: LoadAddressU32(...)
0 Works (null root); the second T# reads back as zero

Main treats this as wrong elsewhere: verifyGuardedDescriptorSources requires a skipped T# to stay null ("a valid T# behind a skipped branch was read", tests/ShaderMemory.cpp:1495 on main). With this PR, a draw that takes the literal arm while s[0:1] holds a stale nonzero pointer fails on the CPU side, even though the shader never touches that address. Main fails this shader for every input, so this isn't a regression, just a part the fix doesn't cover yet.

Could the copied read stay under its arm's condition, the way guarded sources already do? Or, if reading it on both paths is intended, could the test add the s7 = 0 case with an unmapped pointer so the behaviour is pinned down?

Not checked: running it on a GPU (I only have lavapipe, and the new case doesn't dispatch), and whether the copied read also runs unconditionally in the generated SPIR-V.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5643109101 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7694#pullrequestreview-5643109101). Originally posted by [ahmadmuj](https://github.com/ahmadmuj) on 2026-10-25T11:57:32Z. **Review:** COMMENTED --- Reviewed head `30d44b39a` merged onto current main `a5a780eaa` (clean merge). Linux, GCC 13.3, Release, built only `agc_shader_memory_tests`. CPU side only; the new case stops at SPIR-V, so no GPU needed. What I ran: - `agc_shader_memory` on the merge: passes, 3 of 3. - Main's `ResourceTracker.cpp` with your test: fails with `GetImageResource dword 0 is not a valid runtime value; chain: Phi(Immediate, LoadAddressU32@pc=0x00000058(...))`. pc 0x58 is the new `s_load_dwordx8`, so the red run really comes from the new case. - Same merge with `-DANYPS5_ENABLE_SPIRV_TOOLS=ON` (what the Linux CI job configures): passes, so the module from the new case gets through validation. - `tools/check_conventions.py --base origin/main`: passes. One gap: the loaded arm now gets read even when its branch is skipped. The copied `LoadAddressU32` lands in the merge block, so capture evaluates it on both paths. I ran your shader again with `rawUserData[7] = 0`, so `s_cbranch_scc1` jumps over the `s_load`: | `rawUserData[0]` | Result | |---|---| | `0x500000` (mapped) | Capture holds both T#s, including `0x21080...` read from memory the shader never loads on this path | | `0x900000` (nonzero, outside `rawRegions`) | `CaptureResources` and `Recompile` throw `EvaluateRuntimeSources failed to evaluate runtime sources: descriptor source 1 dword 0: LoadAddressU32(...)` | | `0` | Works (null root); the second T# reads back as zero | Main treats this as wrong elsewhere: `verifyGuardedDescriptorSources` requires a skipped T# to stay null ("a valid T# behind a skipped branch was read", `tests/ShaderMemory.cpp:1495` on main). With this PR, a draw that takes the literal arm while s[0:1] holds a stale nonzero pointer fails on the CPU side, even though the shader never touches that address. Main fails this shader for every input, so this isn't a regression, just a part the fix doesn't cover yet. Could the copied read stay under its arm's condition, the way guarded sources already do? Or, if reading it on both paths is intended, could the test add the `s7 = 0` case with an unmapped pointer so the behaviour is pinned down? Not checked: running it on a GPU (I only have lavapipe, and the new case doesn't dispatch), and whether the copied read also runs unconditionally in the generated SPIR-V. AI-assisted: yes
ahmadmuj commented 2026-10-25 17:39:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ahmadmuj on 2026-10-25T17:39:46Z.

Review: COMMENTED


Re-checked head 97b4b5d63 merged onto main 2e1c72239 (clean merge). Linux x86-64, GCC 13.3, libstdc++, Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON like the linux CI job. Built agc_shader_memory_tests and agc_shader_disk_cache_tests only.

This head doesn't build on Linux. ShaderDiskCache.cpp:112:

error: static assertion failed: DescriptorSource changed: update the plan encoder
static_assert(sizeof(DescriptorSource) == 192, ...)

That block sits under #if defined(__linux__) && defined(__x86_64__) && defined(__GLIBCXX__), so a Windows build never sees it. The new std::vector<std::uint32_t> requiredBlocks adds 24 bytes, so it needs to be 216. The linux job is skipped on this head, so CI hasn't caught it yet.

With only that line changed locally to 216, the fix itself checks out:

  • agc_shader_memory and agc_shader_disk_cache pass, 3 of 3.
  • Our earlier table is now covered by your new rows. With s7 = 0 and roots 0x500000, 0x900000 and 0, the loaded T# stays null, nothing reports a null root or fault, and capture and recompile succeed. The taken unmapped arm still fails with failed to evaluate runtime sources.
  • Red runs, each one change on top of this head:
    • ApplySourceBlockGuards returning true at the top: fails with descriptor Phi: a skipped scalar-address T# was read.
    • Only the SrtTape::Run guard call removed: same failure, so the tape path is pinned on its own too.
    • encodePlan writing an empty requiredBlocks: fails with descriptor Phi: the cached plan lost its raw read guard, so the cache round trip is really tested.
  • tools/check_conventions.py --base origin/main passes.

Not checked: a GPU run (the synthetic case stops at validated SPIR-V, and I only have lavapipe), and other open PRs that also bump the cache to 48.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5644387709 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7694#pullrequestreview-5644387709). Originally posted by [ahmadmuj](https://github.com/ahmadmuj) on 2026-10-25T17:39:46Z. **Review:** COMMENTED --- Re-checked head `97b4b5d63` merged onto main `2e1c72239` (clean merge). Linux x86-64, GCC 13.3, libstdc++, Release, `-DANYPS5_ENABLE_SPIRV_TOOLS=ON` like the linux CI job. Built `agc_shader_memory_tests` and `agc_shader_disk_cache_tests` only. **This head doesn't build on Linux.** `ShaderDiskCache.cpp:112`: ``` error: static assertion failed: DescriptorSource changed: update the plan encoder static_assert(sizeof(DescriptorSource) == 192, ...) ``` That block sits under `#if defined(__linux__) && defined(__x86_64__) && defined(__GLIBCXX__)`, so a Windows build never sees it. The new `std::vector<std::uint32_t> requiredBlocks` adds 24 bytes, so it needs to be 216. The linux job is skipped on this head, so CI hasn't caught it yet. With only that line changed locally to 216, the fix itself checks out: - `agc_shader_memory` and `agc_shader_disk_cache` pass, 3 of 3. - Our earlier table is now covered by your new rows. With `s7 = 0` and roots `0x500000`, `0x900000` and `0`, the loaded T# stays null, nothing reports a null root or fault, and capture and recompile succeed. The taken unmapped arm still fails with `failed to evaluate runtime sources`. - Red runs, each one change on top of this head: - `ApplySourceBlockGuards` returning `true` at the top: fails with `descriptor Phi: a skipped scalar-address T# was read`. - Only the `SrtTape::Run` guard call removed: same failure, so the tape path is pinned on its own too. - `encodePlan` writing an empty `requiredBlocks`: fails with `descriptor Phi: the cached plan lost its raw read guard`, so the cache round trip is really tested. - `tools/check_conventions.py --base origin/main` passes. Not checked: a GPU run (the synthetic case stops at validated SPIR-V, and I only have lavapipe), and other open PRs that also bump the cache to 48. AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!7694
No description provided.