Skip to content

feat(shader): resolve nested image tables through runtime pointers - #7223

Merged
oneandonlydean merged 19 commits into
boykopovar:mainfrom
yabanana:feature/nested-resource-tables
Nov 4, 2026
Merged

oneandonlydean merged 19 commits into
boykopovar:mainfrom
yabanana:feature/nested-resource-tables

Conversation

@yabanana

@yabanana yabanana commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What

Related to #6191. Resolve image descriptors through a scalar-buffer record, a runtime pointer, a V#, then a second independent key. The fixtures model the first GetImageResource dword-0 shape reported for Ratchet & Clank; full-title behavior on this head is unverified. Sampler and direct pointer-Phi extensions remain separate in #7395.

The materializer captures exact 64-bit record pointers and shares equal child tables. SPIR-V searches a sorted pointer dictionary, then uses the existing inner-table lookup. The actual pointer selected by a low-word Phi, including loop back edges and constant arms, stays dynamic. Unknown pointers fault; parent scans, child snapshots and final map size remain bounded.

The 20 October update includes Yunus Shaikh's offered shared-child-consumer fix, preserving authorship. A child T# word used by another instruction could leave a runtime read through a V# that exists only in the snapshot, causing a driver crash. Such children are now refused, with a regression test.

Main is merged without rewriting the published commits, preserving #7395's ancestry. Integration retains main's selected columns, #6232 pointer hops, per-column SharedValues storage and scratch maps. Nested child-header and leaf-record indices use separate scratch maps. Snapshot hashes and resolution memo identity include child tables and pointers. New tests verify unchanged snapshot sharing and compare child-only and pointer-only mutations with uncached resolution. Disk-plan format is 51 over the tested main's 50; image-table ABI remains 3. This preserves the maintainer's integration and avoids reusing main's disk-cache version.

Parent scans allow at most 524288 records and inner snapshots at most 1048576 key slots per shader; the final map is capped at 32 MiB. The synthetic fixture covers 348156 outer records and 131072 inner positions from the public report without embedding title code or captures. Nested samplers, other pointer origins, shared descriptor-word consumers and deeper nesting remain refused.

Ordering: this PR supplies the base for #7395, which owns the S# and direct pointer-Phi extensions. Earlier overlaps already merged into main are integrated here. The #7395/#7684/#6488 ordering discussion remains relevant to later integration; no combined result with unmerged branches is claimed. No ARM64-port branch was changed.

The 24 October integration includes Yunus Shaikh's offered merge and cache fix with authorship. Both helper sets are retained. In TryMakeIndirectColumn, only the merged buffer low word uses PointerRecordOrigin; other reads use UnwrapTableRead with its null check. Main's AvailableAt dominance check remains. The 27 October merge retains main's runtime ABI 14 and advances this PR's disk format to 49, keeping image-table ABI 3.

Tested

30 October integration: head 7f36e41c458c2abbf06c5a638636869ed9a4cc59, tested base e471817c68d4e1b1e44b0ce369ed88bafe4ae8ed. Main now uses disk format 50, so this head uses 51; image-table ABI 3/runtime ABI 14 remain. Published ancestry is preserved. The two offered test-only commits from EagleBearerYS were cherry-picked with authorship: valid shared-V#/additional-T# consumer shapes are no longer pinned to rejection; production refusals were not weakened.

Both key budgets reset at the beginning of every TableSnapshotter attempt. A single nested image column now participates in the descriptor-epoch check. New agc_shader_nested_snapshot_retry uses 262145 parent keys and 524289 child keys, forces one invalidation, verifies per-attempt coverage through each last key and compares the final parent/child snapshots (keys, pointers, words and codes) against an undisturbed capture. It accounts for the enclosing materializer's revalidation, which could otherwise hide a truncated discarded attempt. Three separate negative controls fail: removing only the parent reset, only the child reset, or only nested epoch eligibility. Restoring all changes passes (final 2.33 s; timeout 20 s).

Fresh paired llvmpipe checks:11 common passes on each revision, same two 32-lane skips;3/3 nested GPU cases pass. Flip, teardown and exact RGBA checks pass. Max common15.50 s main/14.49 s candidate; nested12.72 s. Required validation-layer insertion confirmed, shader/Mesa caches disabled; normalized messages match, no new VUIDs, existing pNext-layer VUID retained. Original disk-cache full/codec executables pass both revisions: 4/4, actual formats50/51, SHA256-verified binaries and multiprocess checks. Final test-timeout registration leaves the tested executable hashes unchanged. Full public-header compilation passes: 374 libraries / 14,864 exports; conventions and whitespace pass.

Environment: GCC 13.3 cross compiler on ARM64, Ubuntu24.04; software GPU Mesa25.2.8 llvmpipe/LLVM20.1.2 under QEMU-user10.2.3. Full-kernel cache tests use Alpine 6.12.110/QEMU system 8.2.2 TCG cpu=max,smap=off,2 vCPUs, 1536 MiB. Earlier SMAP-on issue remains unqualified. No new native Windows/title/physical-GPU execution by the author.

Contributor physical-GPU evidence belongs to preceding head 0dbf5478b2, not this fix: XairRrR reports10/10 focused passes on RTX4070TiSUPER/615.78.08, matched main7/7, zeroVUIDs and three failing production-removal controls. TechLevelZero reports RTX2000Ada/595.99.02:2343 passes,5 existing/unstable-main failures,41skips and no new validation IDs; the three nested cases were validated but not compared to main's validation pass. These reports do not validate the new retry regression or claim a title unblock.

29 October current integration: head 0dbf5478b2aaaac7f2a5f7a12e3724d9a2346461, main f7e84c4cf1609cc10bac95a44cd431805e5ebc8a. Disk format 50 versus main 49; image-table ABI 3 and runtime ABI 14 retained. Normal merge preserves contributor ancestry. #12051 is closed without merge, so no memo gate or speculative dependency was added.

Matched fresh llvmpipe runs: 11 common passes each, the same two 32-lane color-readback skips, plus 3/3 nested passes on the candidate. Flip/flip-compute, teardown and exact RGBA readback pass. Maximum common runtime: main 13.31 s, candidate 13.21 s; nested maximum 11.54 s. No performance claim. Vulkan is required, shader/Mesa caches disabled, Khronos layer insertion verified; normalized validation messages match, with no new VUIDs. The pre-existing pNext VUID from layer 1.3.275 remains.

Original freshly built disk-cache executables pass full and resource-plan-codec modes on both revisions (4/4) in a full Linux kernel, exercising actual format-49/50 serialization/rejection and multiprocess paths. SHA256-verified originals, no substitute cache executable. Kernel VM: Alpine 6.12.110, QEMU system 8.2.2 TCG, cpu=max,smap=off, two vCPUs, 1536 MiB; GPU runs: Mesa 25.2.8 llvmpipe LLVM20.1.2 under QEMU user10.2.3, Ubuntu24.04, GCC 13.3 cross compiler. Complete public-header audit/compilation (373 libraries / 13,451 exports), conventions and whitespace pass. No new physical-GPU/title/native-Windows claim. Earlier evidence below remains tied to its original revisions.

27 October head 153400ba2b1193870e4dc7046fa18638214c2ae9, integrated main 0d62324ce25ebe4087984b9da143779ce99e7a88. On that earlier base main used disk format 48 and the candidate used 49. Published ancestry/contributor authorship retained. Image-table ABI stays 3; runtime ABI follows main at 14.

Matched software-GPU runs pass 11 common CTests per revision, including bindless Phi, shader memory, serializer, table cache/reuse, bindless images, flip/flip-compute, address-space teardown, D32 and exact uint8x4 RGBA readback. Both skip the same two optimized color32/color64 cases: 32 subgroup lanes required, llvmpipe has 8. Candidate also passes 3/3 nested cases. Slowest common case: main 14.87 s, candidate 14.03 s; nested max 13.42 s. No test or rejection guard was weakened.

The original, newly built shader disk-cache executable and its resource-plan codec mode each pass on both revisions in the full Linux-kernel VM (four successful executions). These tests exercise the actual format-48/49 encoder/decoder, previous-format rejection and multiprocess paths, with unmodified test code. SHA256-verified binaries are used. An inherited user-mode adapter redirected the initial disk-cache run to an old executable; that result is excluded. The redirect is removed from the new lab builds, and the qualified GPU comparison was rerun separately. No stale replacement executable is counted as current-head evidence.

Ubuntu 24.04 x86-64 build, GCC 13.3 cross compiler hosted on ARM64. GPU path: QEMU user 10.2.3, Mesa 25.2.8 llvmpipe / LLVM 20.1.2 (256-bit), SPIRV-Tools at main's pinned revision. Vulkan is required; shader/Mesa caches disabled; ctest -V requests Khronos validation, and loader logs confirm insertion. Normalized messages match main, including its existing VUID-VkDeviceCreateInfo-pNext-pNext for type 1000574000 with layer 1.3.275. No new VUIDs; not zero validation errors. CPU cache tests use Alpine 6.12.110-0-virt / QEMU system 8.2.2 TCG cpu=max, two vCPUs, 1536 MiB. Write watching uses the existing byte-comparison fallback.

All-library public-header audit/compilation passes (368 libraries, 12,811 exports); current-main conventions/whitespace pass. Final-commit GPU binaries match the tested hashes. Full upstream Linux/Windows CI still needs a maintainer dispatch.

Historical Tamalero physical/title results at 74700a08d stay attributed to that earlier head and its reported sampler refusal, not a frame or title run of this head. No new physical-GPU/title or speed claim. Sampler/direct-pointer-Phi extensions remain separate in #7395.

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 confirmed on the updated head; the earlier head passed the first image refusal in PPSA01474 as reported above
  • GPUs tested: current head: Mesa llvmpipe software renderer, Mesa 25.2.8 / LLVM 20.1.2, Ubuntu 24.04.5 x86-64 under QEMU 10.2.3. Preceding 74700a0: contributor-reported NVIDIA RTX 4090 and AMD Radeon Pro V620/RADV on Linux (driver versions not supplied); earlier f454944: contributor-reported NVIDIA RTX 3070 / 617.42 and Intel UHD 630 / igvk64 on Windows 11; NVIDIA RTX 4090 on Linux (driver not specified).
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 907 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1896 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5315 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 5609 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 6146 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6235 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 6290 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ResourcePlan.hpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 6416 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 6488 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/ImageTableAbi.hpp
core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ControlFlowInfo.hpp
core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ResourcePlan.hpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6858 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 6905 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6924 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 6970 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.cpp
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 7275 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7392 docs/dev/debt/shader.md
PR 7410 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
docs/dev/debt/shader.md
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7522 core/shader/recompiler/Recompiler.cpp
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7622 core/shader/recompiler/ShaderDiskCache.cpp
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/ImageTableAbi.hpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 7684 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ControlFlowInfo.hpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 7689 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/ShaderDiskCache.cpp
PR 8004 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
docs/dev/debt/shader.md
PR 8089 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8246 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8458 docs/dev/debt/shader.md
PR 8484 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8592 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8707 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9020 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 9183 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 9335 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 9356 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 9387 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 9508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 9671 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/shader.md
PR 9712 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9748 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 9852 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 9884 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9889 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 9897 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 10000 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 10043 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10049 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 10069 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10193 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/ImageTableAbi.hpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 10233 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
docs/dev/debt/shader.md
PR 10351 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 10359 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 10442 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10489 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 10556 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
docs/dev/debt/shader.md
PR 10652 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 10757 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 10867 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 10920 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11265 core/shader/recompiler/Recompiler.cpp
PR 11351 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 11483 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
docs/dev/debt/shader.md
PR 11551 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 11557 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/shader.md
PR 12120 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12132 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
docs/dev/debt/shader.md
PR 12299 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 12316 docs/dev/debt/shader.md
PR 12323 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12324 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ControlFlowInfo.hpp
core/shader/recompiler/Recompiler.cpp
PR 12458 docs/dev/debt/shader.md
PR 12548 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
docs/dev/debt/shader.md
PR 12662 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 12746 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12764 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
docs/dev/debt/shader.md
PR 12790 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 12828 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 12840 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Recompiler.cpp
PR 12855 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12944 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 12980 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 12994 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13131 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13148 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13169 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13262 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13517 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.cpp
PR 13707 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13928 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/ImageTableAbi.hpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 13929 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/ImageTableAbi.hpp
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 14032 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 14051 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 14068 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 14072 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 14081 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 14085 docs/dev/debt/shader.md
PR 14212 docs/dev/debt/shader.md
PR 14217 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
docs/dev/debt/shader.md
PR 14218 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
docs/dev/debt/shader.md
PR 14247 docs/dev/debt/shader.md
PR 14265 core/shader/recompiler/Recompiler.cpp
docs/dev/debt/shader.md
PR 14341 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 14367 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
PR 14377 docs/dev/debt/shader.md
PR 14561 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 14621 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 14627 docs/dev/debt/shader.md
PR 14628 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 14633 docs/dev/debt/shader.md
PR 14636 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 14692 docs/dev/debt/shader.md
PR 14702 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 14793 docs/dev/debt/shader.md
PR 14795 docs/dev/debt/shader.md
PR 14821 docs/dev/debt/shader.md
PR 14830 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 14871 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/shader.md
PR 14880 core/shader/recompiler/Recompiler.cpp
PR 14888 docs/dev/debt/shader.md
PR 14900 docs/dev/debt/shader.md
PR 14904 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
docs/dev/debt/shader.md
PR 14909 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/shader.md
PR 14913 docs/dev/debt/shader.md
PR 14944 core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/ShaderDiskCache.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 14963 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 14964 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 15015 core/libs/prx/libSceAgcDriver/CMakeLists.txt

@github-actions github-actions Bot added build shader core/shader docs agc libSceAgc* labels Oct 17, 2026
@akkadbakkad89

Copy link
Copy Markdown
Contributor

First physical-GPU runs (existing coverage is QEMU/lavapipe-class only): head f4549448f, Windows 11, MinGW (WinLibs GCC 15.2.0), Release, serial fresh processes:

  • NVIDIA RTX 3070 (driver 617.42): agc_driver_nested_image_table, _large, _budget, agc_driver_image_table, _cache, _cache_bounds, _reuse, agc_driver_bindless_images, agc_shader_bindless, agc_shader_memory, agc_shader_disk_cache — 11/11 pass.
  • Intel UHD 630 (ANYPS5_GPU=UHD, igvk64): same 11/11 pass.

@Tamalero

Copy link
Copy Markdown
Contributor

Linux confirmation on Ratchet & Clank: Rift Apart (PPSA01474), RTX 4090, main 5361e69de, the PR's two commits cherry-picked (one test-only conflict in tests/execution/ImageTable.cpp, resolved by keeping both role checks), one run each:

Build Stop
without this PR ~405 s, GetImageResource dword 0 is not a valid runtime value at pc=0x6b80 (the #6191 chain), compute 0x116bb66d00
with this PR ~465 s, GetSamplerResource dword 0 is not a valid runtime value at pc=0x6b74, compute 0x116bb63500, through the same Phi(Phi(ReadConstBuffer@pc=0x1aa8 …)) record

So the T# half of the chain resolves, as @ps54all saw on Windows, and the next stop is the sampler of the same record.

Tested and written by Claude (AI assistant) on a contributor's machine.

@Tamalero

Copy link
Copy Markdown
Contributor

@yabanana the next stop after this PR is the sampler of the same record, in both titles that have this shape so far: Ratchet & Clank (GetSamplerResource dword 0 at pc=0x6b74, above and in #6191) and Marvel's Wolverine (images and samplers through the same chain, #6191). Is a nested sampler table in scope for this PR or a follow-up? I can run either on Ratchet the same day, and send the S# words and keys of a failing record if that helps with a fixture.

Tested and written by Claude (AI assistant) on a contributor's machine.

@MarcZX10

Copy link
Copy Markdown
Contributor

I checked head f4549448f: the PR explicitly leaves nested samplers unsupported, while the new table lookup path already has a sampler-table branch. That makes nested S# handling a plausible follow-up, but it shares the planner/materializer and cache snapshot machinery, so I am holding off on a parallel patch until the merge ordering is clear. For a focused regression fixture, could you share a sanitized S# descriptor and the two key sequences (or expected sampled result) from the failing shape? That would let us test a synthetic chain without title shader data.

@Tamalero

Copy link
Copy Markdown
Contributor

@MarcZX100 here is the shape, from a local diagnostic that evaluates the refused chain against guest memory at registration (Ratchet & Clank: Rift Apart, main 5361e69de + this PR). Addresses are masked (A, B, P0), offsets and alignment are real.

Common part (all three loads below use it):

  • V# read from the SRT at pc=0x1a9c, offsets 0x270..0x27c: A_lo 00100011 00054ffc 00005204 (stride 16, 0x54ffc records).
  • Record key1 at pc=0x1aa8: a 64-bit pointer at key1 * 16 + 0x8 / + 0xc. Record 0 holds P0, record 1 holds P0 + 0x120, so the pointers select consecutive 0x120-byte blocks.
  • key1 is not a plain value: it is ReadFirstLane(SelectU32(LogicalAnd(...), IAdd32(Phi, Phi), Phi(...))), a loop over the lanes' keys, so the real key sequence is per lane at run time. I can only show what records 0 and 1 hold, not which records a dispatch selects.

The three loads from the selected block:

pc Descriptor Read Second key This PR
0x6b80 T# through a V# in the block, indexed by key2 yes resolves it
0x6b74 S# 4 dwords directly at block +0xb0 no stops here (GetSamplerResource dword 0)
0x7cbc T# 8 dwords directly at block +0x0; the pointer goes through four nested Phis (loop iterations) no stops here, once the S# is worked around locally

Words at those offsets, records 0 and 1:

  • S# at +0xb0: record 1 00000003 00700080 00000000 00000000 (a plausible sampler: LOD 0x080–0x700); record 0 B_lo 00200011 00002000 00005204, which looks like a buffer descriptor rather than an S#, so not every record holds a sampler there.
  • T# at +0x0: record 0 C_lo cb300000 003fc03f b00503ac 0000017f 00700050 00000000 00000000 (plausible 2D T#); record 1 does not look like an image descriptor.

So a synthetic fixture would be: a record table (16-byte records, pointer at +0x8), blocks of 0x120 bytes, an S# at block +0xb0 selected by the lane-loop key alone, and, for the 0x7cbc case, a T# at block +0x0 with the block pointer merged through a few loop Phis. To see past the S# stop I replaced unresolvable S#s with an all-zero sampler locally (not for upstream); that is how the 0x7cbc stop showed up.

Tested and written by Claude (AI assistant) on a contributor's machine.

@MarcZX10

Copy link
Copy Markdown
Contributor

Thanks, this is enough to define a useful synthetic regression without retaining title data. It should keep the per-lane key1 loop dynamic, select blocks through the 16-byte record pointer at +8, and cover the heterogeneous records: one selected block with the valid S# at +0xb0, another with a non-sampler value there, plus the T# at +0 whose pointer passes through the nested loop Phis. The local all-zero sampler substitution is a diagnostic only; the upstream test should exercise the real sampler descriptor and keep the unsupported path explicit if it is not implemented. This confirms the follow-up needs sampler resolution and a second pointer-chain case; I’ll avoid a parallel patch until the scope/order with #7223 is settled.

@EagleBearerYS

Copy link
Copy Markdown
Contributor

@yabanana, thanks for #7223. Two things came up while building on it.

A crash on this head. When another instruction also reads a nested child's T# words, lavapipe crashes inside the shader. The child's V# words are planning-only loads that are never emitted, so the other consumer keeps a runtime read through a V# that exists only in the snapshot. Commit 0df7d3256e refuses such a child, the same way #7223 already refuses a V# with another consumer, and adds the case to agc_driver_nested_image_table. That case is a SIGSEGV on f454944 and passes with the commit. It's a single commit on top of your head, and you're welcome to take it as is. It's the first commit on branch feat/shader-nested-sampler-tables.

The S# half. The same branch has the sampler half that this PR leaves for later. It's stacked on your head and doesn't change your commits:

The new tests are agc_driver_nested_sampler_table, agc_driver_pointer_phi_sampler_table and two disk-cache round trips. On your head they fail with GetSamplerResource dword 0 is not a valid runtime value, and the consumer case is a SIGSEGV. On the branch they pass on GitHub's Linux runner; on Windows the GPU tests skip and the disk-cache tests pass (run).

We plan to open the S# half shortly as a separate PR stacked on #7223 ("Depends on: #7223"), unless you'd rather fold it into this one. If you would, say so and the commits are yours to take.

@blawesom

Copy link
Copy Markdown
Contributor

Stack note: this PR is the base of #7395 — its head f4549448f is the merge-base, so #7395's series builds directly on these two commits. I rebased the full stack onto current main as blawesom:rebase/7395 (verified: builds, conventions pass, full suite green apart from the known main regression agc_driver_tessellation — Mesa, #5444), which covers this PR's rebase as well. If the two land separately, #7395 should rebase onto this one rather than onto main directly; if they land together, the single rebase/7395 branch serves both.

…mers

A T# read from a nested child table stayed a runtime read when one of
its words also fed another instruction. That read goes through a V#
that exists only in the snapshot, so the dispatch read a garbage
address; lavapipe crashed in the shader. The nested branch now refuses
a child whose descriptor words are used by anything but equal handles,
as it already does for a V# with another consumer.

(cherry picked from commit 0df7d32)
hugodearaujo pushed a commit to hugodearaujo/AnyPS5 that referenced this pull request Nov 4, 2026
…sharp-reuse

6e403b4 is boykopovar#9457 with the stack's merges of boykopovar#7395's main merge after
boykopovar#7223. FormatVersion stays this branch's 71. In the debt file, boykopovar#7395 adds
a sentence on nested children's registered views to "Nested image
tables", which this branch rewrites. The entry keeps this branch's wording,
and the sentence moves into its own entry after it, since both together
are over the debt files' 1000 characters.
hugodearaujo pushed a commit to hugodearaujo/AnyPS5 that referenced this pull request Nov 4, 2026
b41beed is boykopovar#9790 with the stack's merges of boykopovar#7395's main merge after
boykopovar#7223. FormatVersion stays this branch's 73, and the debt file keeps this
branch's three entries, with boykopovar#7395's "Nested image table children" entry
added after "Nested image tables".
liskeee pushed a commit to liskeee/AnyPS5 that referenced this pull request Nov 5, 2026
6e403b4 is boykopovar#9457 with the stack's merges of boykopovar#7395's main merge after
boykopovar#7223. The conflicts are this branch's own: FormatVersion 70 and its
pointer-keyed chase debt entry.
liskeee pushed a commit to liskeee/AnyPS5 that referenced this pull request Nov 5, 2026
…ords-on-c2

f498717 is boykopovar#9633 with the stack's merges of boykopovar#7395's main merge after
boykopovar#7223. The conflicts are this branch's own: FormatVersion 72 and its
wording of the pointer-keyed chase debt entry.
oneandonlydean pushed a commit that referenced this pull request Nov 8, 2026
#7223 takes FormatVersion 56 on main, above this branch's 54, so this
branch moves to 57, the next number no open pull request holds.
oneandonlydean pushed a commit that referenced this pull request Nov 21, 2026
An S# or T# loaded through a pointer that a scalar record holds was
refused when a Phi merged the pointer's low word with constants, so
recompiling failed with "GetSamplerResource dword 0 is not a valid
runtime value". Such a column is now pointer-keyed: the snapshot
captures every record's pointer and the descriptor behind it, the map
holds #7223's sorted pointer dictionary with descriptor records as its
codes, and the GPU looks up the actual 64-bit pointer. A pointer that
was not captured faults as outside the snapshot, and a null one as
unmapped.

The plan gains TableColumn::pointerKeyed and the snapshot gains
ImageTableColumnSnapshot::pointerKeyed, so the disk-cache format moves
to 43 and the image-table ABI to 4.
oneandonlydean pushed a commit that referenced this pull request Nov 21, 2026
# Conflicts:
#	core/shader/recompiler/ShaderDiskCache.hpp
oneandonlydean pushed a commit that referenced this pull request Nov 21, 2026
…at, 51

yabanana's #7223 now takes 50 above main's 49, so this PR takes 51 and a cache written by #7223's recompiler is not read as this one's.
oneandonlydean pushed a commit that referenced this pull request Nov 21, 2026
…lines

The nested image table and nested sampler table tests no longer check
refusals: d908758 dropped the shared V# and other-consumer T# cases,
and the nested sampler refusal cases went before it. Their success lines
now say only what they check. The nested image table line comes from
#7223 (ad44bc4) and is in this branch through its merges of #7223.
oneandonlydean pushed a commit that referenced this pull request Nov 21, 2026
…at, 63

yabanana's #7223 now takes 51, the number this PR had, and 52-62 are held by the open PRs: #10000 52, #8939 53, #10489 54, #9457 55, #9633 56, #9749 57, #10193 58, #9790 59, #9969 60, #10846 61, #7642 62. So this PR takes 63 and a cache written by #7223's recompiler is not read as this one's.
oneandonlydean pushed a commit that referenced this pull request Nov 26, 2026
…at, 53

#7395 now takes 51 above #7223's 50, and 52 is held by #10000, so this PR takes 53.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build docs shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.