Skip to content

feat(agc): load and store signed packed image formats - #17623

Draft
johnohhh1 wants to merge 10 commits into
boykopovar:mainfrom
johnohhh1:feat/shader-missing-format
Draft

johnohhh1 wants to merge 10 commits into
boykopovar:mainfrom
johnohhh1:feat/shader-missing-format

Conversation

@johnohhh1

@johnohhh1 johnohhh1 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds direct image load/store support for signed packed formats 31/35/38/42/45/49: 11_11_10_SNORM/SINT, 10_11_11_SNORM/SINT and 2_10_10_10_SNORM/SINT, using this project's little-endian names. Views use R32_UINT; packed fields are sign-extended and use the existing typed-buffer normalization/store conversion, including D16 results and partial masks.

Identifiers/layouts: AMD RDNA 1 ISA §8.2.8 Table 47 and Mesa gfx10 tables at 418c4cfa. Conversion uses the existing image-format and typed-buffer helpers. An RDNA2 comparison matched the tested loads for all six formats and stores for five. Exact half values for the 2-bit SNORM field of format 45 were the exception. RDNA2 results Sampling, gathers/LOD queries, image tables, packed accesses and a missing W selector remain refused; render targets and a title unblock are not claimed.

The November 25 refresh resolves five conflicts and preserves the merged format-131 support from #17701. All 103 upstream decoder rows remain in order, plus six signed rows.

The signed-image test fragment now explicitly registers format 31 under the existing agc_driver_image_packed_signed name and configures all six cases together. Format 31 passes its argument directly. The six test names, timeouts, skip behavior, environment and working directory are unchanged. CMake review

Draft/order hold. #25877 fixes 2-bit SNORM half rounding in the shared typed-buffer conversion. Ordering with the still-open #16260 also needs agreement. The table-count agreement is preserved.

Tested

Fresh BUILD_TESTING=ON configuration and focused Release build pass at d3026eec157984de812051bc14047ac5d6dfbd92. CTest lists exactly six signed-format cases, with format 31 as the explicit argument to the unsuffixed test. The paired run used the same fixtures against frozen main fbd2175e5c1a0bcde352b81b19a1cb45db3c7b47.

Device Main + final fixtures PR
NVIDIA GeForce RTX 5070 Ti (595.99.02) 11/18 18/18
llvmpipe (Mesa 26.0.8, LLVM 21.1.8) 11/18 18/18

The loader inserted Khronos validation 1.4.341 throughout. No VUIDs or skips. Hosted Windows CI for this head is pending.

Earlier rounding comparison. In a separate comparison, the RDNA2 half-rounding expectation and #25877's buffer fixture reproduced two failures on each device. With #25877 applied, those two cases passed, and the complete selection passed 19/19 on both devices with validation active and no VUIDs. The draft branch retains the standalone fixture while #25877 is under review. The result applies to the earlier tested integration.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: fix(shader): round a 2-bit SNORM buffer store component away from zero at 0.5 #25877
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5070 Ti /595.99.02 and llvmpipe /Mesa 26.0.8 /LLVM 21.1.8, Ubuntu 26.04.1
  • AI-assisted: yes (Codex)

@johnohhh1

Copy link
Copy Markdown
Contributor Author

@AlexWhitehouse this adds direct load/store support for signed codes 31/35/38/42/45/49, separate from #15450’s unsigned formats. The paired main/patch run is in the description: 5/12 → 12/12 on Linux RTX 5070 and llvmpipe, with the same fixtures and no VUID errors. No AMD/PS5 measurement or title run claimed.

For the shared mapping, DCC and format-helper lines, can we use #14628 → #15450 → this PR? I’ll handle the rebase and rerun the format tests afterward.

@akkadbakkad89 the overlap with #14709, #16253 and #16427 is the format-table array size; none of those formats is implemented here. Are you okay with whichever lands second rebasing that count? @ycbuzi #16260 also shares the table/conversion infrastructure, but its unsigned scaled formats are separate. Happy to keep the same rebase arrangement there if that works for you.

#16423 changes the neighboring debt paragraph; this addition does not rewrite it. This stays a draft until the code merge order is agreed.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 16427 core/shader/recompiler/RdnaDecoder/src/RdnaDescriptorFormat.cpp L17
PR 24523 core/shader/recompiler/RdnaDecoder/include/RdnaDecoder/RdnaDescriptorFormat.hpp L45
core/shader/recompiler/RdnaDecoder/src/RdnaDescriptorFormat.cpp L174-175

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 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 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 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 6488 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 7275 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 7684 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 7689 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 8246 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 9633 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 9969 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 10193 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 10359 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10867 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 11551 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 12324 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12746 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12828 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13148 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13928 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 13929 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 14853 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 15456 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 15555 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 16935 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 16953 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 17943 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 18029 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 18082 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 18106 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 18107 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 18173 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 18829 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 19557 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 19610 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 20030 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 21199 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 21211 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 22029 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 22424 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 22434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 22546 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 22628 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 22647 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 22675 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 22697 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 23242 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 23252 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 23632 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 24049 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 24661 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 24714 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 24781 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 26012 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 27133 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 28176 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 28193 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 28228 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 28229 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 28237 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 28387 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 28400 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 28469 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 28470 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 28487 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 28673 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 28808 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
PR 28964 core/libs/prx/libSceAgcDriver/CMakeLists.txt

@johnohhh1

Copy link
Copy Markdown
Contributor Author

Rebased cleanly onto main 651eb9a25ec088b1ececf6e920a10625a431d455; new head f947e6ac5e0a9bdecbb2263015b3612f6468d37c. git range-diff reports the contribution patch unchanged.

Fresh paired Linux checks used the identical fixtures and rebuilt the three affected executables on both revisions: main 5/12 pass, rebased patch 12/12 pass, on NVIDIA RTX 5070 (595.99.02) and llvmpipe (LLVM 21.1.8), Ubuntu 26.04.1. Required Vulkan and the Khronos validation layer were enabled and shader caching disabled; neither side logs a VUID error or missing-layer warning. Conventions and all 20 shader-scan Python tests pass. The earlier successful Windows CI belongs to 330e36bcbd; no fresh Windows or native AMD/PS5 run is claimed.

@SHOnnay I checked #17701: its format-131 floating-point loads are distinct from these six signed formats, but the mapping/array/conversion lines overlap. Would you be okay with whichever merges second rebasing those shared lines, or do you prefer a specific order? This remains draft while the existing #14628 → #15450 → #17623 proposal and the newer overlap are coordinated.

@NathanFahey23

Copy link
Copy Markdown
Contributor

Windows and NVIDIA run with the validation layer, for head f947e6a merged with --no-ff onto main b12b49a (a90ee9bc6e, clean merge).

GPU NVIDIA GeForce RTX 4080 (10de:2704), driver 32.0.16.2101
Host Windows 11 Home 10.0.26300
Toolchain WinLibs GCC 15.2.0 UCRT posix-seh r7, Release, BUILD_TESTING=ON
Environment ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Vulkan SDK 1.4.363.1)
Tests ctest -R "^(agc_|shader|video_out|guest_video)" -V, one at a time
this PR
Tests 1631/1635 passed (16 skipped)
VUID- errors 0

The six new tests pass: agc_driver_image_packed_signed and its _35, _38, _42, _45, _49 variants.

The four failures are not from this PR. agc_driver_msaa_dcc_clear_2, _4, _8 ("a same-value CPU color store did not invalidate multisampled DCC residency") and agc_driver_native_depth_publication ("a native depth publication overwrote a byte the guest stored") fail the same way on main b12b49a alone on this machine, 4 of 4. I did not run the rest of the suite on that main, so the comparison covers only those four tests.

AI-assisted: yes.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 10, 2026
@johnohhh1
johnohhh1 force-pushed the feat/shader-missing-format branch from f947e6a to ded4d34 Compare November 10, 2026 20:46
@johnohhh1

Copy link
Copy Markdown
Contributor Author

Resolved the main conflict and rebased onto 9ab989dfa17925774020fcda4e29ec6de99d2ae8; refreshed head ded4d34501e433ccb9f3a5e741ad7cfc2f72aff9. The conflict was beside our debt entry: upstream's new D16 measurements are retained, and all eight code/test files match the prior published head byte-for-byte.

Fresh paired Linux checks rebuilt the three affected executables with identical fixtures: main 5/12 → patch 12/12 on RTX 5070 (595.99.02) and llvmpipe, Ubuntu 26.04.1. Vulkan required, cache disabled and Khronos validation enabled; no VUID or missing-layer warnings on either side. All 20 shader-scan tests and conventions pass. The final full Linux build also passed (cmake --build build -j24).

Thanks to NathanFahey23 for the Windows RTX 4080 report on the previous f947e6ac5e integration; that result is kept separate from this fresh Linux run. No fresh Windows/AMD/PS5/title test claimed. This stays draft while the previously requested overlap order is agreed; no code prerequisite or new combined integration is claimed.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 10, 2026
@johnohhh1
johnohhh1 force-pushed the feat/shader-missing-format branch from ded4d34 to 1370362 Compare November 11, 2026 11:20
@johnohhh1

Copy link
Copy Markdown
Contributor Author

Refreshed onto main 3f7fb01f27c6e4018eaff6b1f6a0f8244af074d3; new head 1370362822469fde625e31672c1c06af97be2d37. Clean rebase, unchanged contribution patch, all eight code/test files byte-identical to ded4d34501.

Fresh paired Linux validation with identical fixtures: main 5/12 → patch 12/12 on RTX 5070 (595.99.02) and llvmpipe (Mesa 26.0.8 / LLVM 21.1.8), Ubuntu 26.04.1. Required Vulkan, cache disabled and Khronos validation enabled; zero skips, VUIDs or missing-layer warnings. Full Linux build, 20 shader-scan tests and conventions pass.

The old Windows failure was three worker-spin tests hitting their 20-second limit. This base includes upstream #18213/#18214; all three pass locally with the upstream timeout. Fresh Windows CI is pending; this is not a new local Windows run. Earlier peer Windows evidence remains attributed to its original revision. Keeping this draft while the format overlap order is coordinated.

@akkadbakkad89

Copy link
Copy Markdown
Contributor

@johnohhh1 — agreed, the #14628 → #15450 → #17623 order and the "whichever lands second rebases the count" arrangement work for #14709, #16253 and #16427.

I re-checked the shared lines on current heads: the overlap is the kFormatInfoTable array size plus appended rows in RdnaDescriptorFormat.cpp — #16427 only adds FormatX24_8_32Float (83→84) and none of your six signed codes (31/35/38/42/45/49) is implemented in any of the three, so the eventual conflict is the one-line count plus row insertion — mechanical to resolve either direction.

For context: #16427 was just rebased onto current main (head 8e99c88877) — it already absorbed upstream's sparse-uploaded-slot repack refactor while keeping the three-mode repack dispatch, so its table-line state is stable and shouldn't move again before merge. No signed-format work is in flight on my side, so there's nothing further to coordinate beyond the count.

One note: whichever of ours lands first, please keep the rows ordered by format code when rebasing — the table is index-addressed, so an out-of-order insert silently maps wrong formats.

@johnohhh1
johnohhh1 force-pushed the feat/shader-missing-format branch from 1370362 to 68732fa Compare November 13, 2026 10:46
@johnohhh1

Copy link
Copy Markdown
Contributor Author

The Windows job for head 68732fa961605da1f336af41b7960e6b4da76760 built successfully, then failed only guest_socket_stream_options out of 4,338 selected tests (some other tests skipped). It aborts at line 132 with errno 22. That line expects ENOPROTOOPT for an unknown TCP option with a negative length; Windows rejects the length first with EINVAL.

Its pinned main was eb33fb7dd774d56d0123b04b1f56b57c59a520c4, before Dean's merged #19489 (0294cba8dcab511f5b0c01129d340a207e631c9f) reverted that assertion. I checked the exact failed-base source against the merged revert. No signed-format source change is needed for this failure.

Could a maintainer start a fresh Build workflow for #17623 so eligibility captures main including that revert? Our rerun request returned HTTP 403 (repository admin rights required). Rerunning only the failed job would retain the old eligibility base. This remains draft for the existing prerequisite/overlap coordination; this note is not a fresh GPU validation or a green-CI claim.

AI-assisted log/source diagnosis: yes (Codex).

@johnohhh1

Copy link
Copy Markdown
Contributor Author

Refreshed to 5195f1de9e50e7656f1004468a2ce83cc1e04e14 by merging tested main 3c620812fbf9040bd8aa30612a12bb1b012f212f, including the #19489 socket-test revert. Normal fast-forward push; the signed-format scope and refusal behavior are unchanged.

Fresh paired Linux results, identical fixtures: main 9/16 → PR 16/16 on both RTX 5070 /595.99.02 and llvmpipe /Mesa 26.0.8 /LLVM 21.1.8, Ubuntu 26.04.1/GCC 15.2/Release. Both full configured builds, the three selected executable builds and all 29 shader-scan tests pass. The four merged unsigned controls pass on both sides. Vulkan required, shader cache disabled, Khronos validation loader insertion confirmed; zero skips, VUIDs or missing-layer warnings.

New-head CI is triggered; this is not a fresh Windows/native AMD/PS5 or title run. The description is shorter and names the remaining #14628/overlap-order hold explicitly. Draft retained; no owner agreement or title unblock is assumed.

AI-assisted validation/reporting: yes (Codex).

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 14, 2026
@johnohhh1

johnohhh1 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Refreshed this draft to 5d73a41ecfd41d0ab9acfa476291fe4dccaec644 on main 3251ad6944310157bce40d8261493142a38067eb. The merge retains main's new mappings/helper and 107 format rows, and moves the signed-format gap into the required debt fragment. #14628 and #15450 have merged; their old prerequisite is cleared.

Same final fixtures, full rebuilt Linux builds, Ubuntu 26.04.1/GCC 15.2/Release: main passes 10/17 and this head passes 17/17 on both NVIDIA RTX 5070 (595.99.02) and llvmpipe (Mesa 26.0.8/LLVM 21.1.8). Required Vulkan, cache off, validation 1.4.341 and loader logging: layer insertion confirmed, no VUIDs, skips or missing-layer warnings. All 29 shader-scan tests and current conventions pass. Both shader-memory modes additionally pass 20 consecutive Linux runs each (40 executions); this is not Windows validation.

For the old Windows failure: the exact main baseline also crashed agc_shader_memory with 0xc0000374; the old PR job crashed the same executable in coherent mode. That does not establish identical cause or a Windows fix. Could a collaborator run fresh Linux/Windows CI for this head when convenient?

Keeping the draft/order hold for #17701/#16260. The fresh overlap report still fails closed on other conflicted peers; no overlap clearance, native AMD/PS5 measurement or title run is claimed.

AI-assisted repair, validation and reporting: yes (Codex).

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 16, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 16, 2026
@johnohhh1

Copy link
Copy Markdown
Contributor Author

Resolved the new format-table count conflict and refreshed to 819b7d08f7032b5bcf85b671c5079f2fb38a90eb on frozen main 9879a6aed0d11a11f735a617bf266b9fc55d71dc. All 102 main rows are preserved in order, plus our six signed rows (108 total). Contribution additions/deletions across all eight core files are unchanged from 5d73a41ecf after normalizing the count literal; the execution fixtures are unchanged.

Same final fixtures, full rebuilt Linux builds, Ubuntu 26.04.1/GCC 15.2/Release:

Device Main + final fixtures Refreshed PR
NVIDIA RTX 5070 /595.99.02 10/17 17/17
llvmpipe /Mesa 26.0.8 /LLVM 21.1.8 10/17 17/17

All four runs require Vulkan, disable the shader cache and confirm Khronos validation 1.4.341 insertion with loader logging. No VUIDs, skips or missing-layer warnings. All 29 shader-scan tests and current conventions pass.

The prior head 5d73a41ecf passed hosted Windows CI, as now recorded in the description. That result belongs to its exact integration; could a collaborator run fresh Linux/Windows CI for this new head when convenient? Keeping the draft for outstanding #17701/#16260 owner/order coordination and conflicted-peer overlap comparisons. No new native AMD/PS5 or title run is claimed.

AI-assisted repair, validation and reporting: yes (Codex).

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 17, 2026

@artor410 artor410 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of the code plus a Windows / NVIDIA Ampere run of the current head. I found no defects.

Windows run of 819b7d08f7

Setup: Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 3070 Ti (10de:2482, Ampere), driver 610.88, WinLibs GCC 15.2.0 r7, Release. The PR was merged onto main fbaae8a79d with --no-ff (clean merge). Runs used ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1. The first run of each side also had VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer (SDK 1.4.363.0).

These 17 tests are the same set as in your table: agc_driver_image_packed_signed and _35/_38/_42/_45/_49, agc_driver_graphics, and the unsigned controls image_converted_unorm, image_load_packed, image_store_packed, image_packed16_* and image_depth24*.

tree result
main plus only this PR's three test files 10 of 17
this PR merged 17 of 17, in 3 of 3 runs

On main, the six signed tests stop with sampled image descriptor uses an unsupported format. agc_driver_graphics stops with unsupported guest texture format 31. With the PR, each signed format prints load/store, D16, swizzle, clamps and guard checks passed, so CheckRefusals, including the sampling refusal, passes for the SINT codes too. The loader inserts the layer in the 16 tests that open a device (agc_driver_graphics uses mocks). There were no VUID- messages and no missing-layer lines on either side.

Code read

  • Load: for SNORM/SINT the unpack switches to OpBitFieldSExtract, and SNORM then goes through the existing NormalizeFormatComponent. That maps a field to x / (2^(n-1) - 1) with the most negative code clamped to -1.0 and zero kept at +0. For the 2-bit field of 2_10_10_10 this gives -1, -1, 0 and 1 for codes -2 to 1.
  • SINT store: the new branch uses EmitFormatStoreComponent, which clamps to [-2^(n-1), 2^(n-1)-1] before masking ([-2, 1] for the 2-bit field). EmitD16StoreComponent sign-extends the 16-bit value first.
  • Field layouts: they come from the existing GetImageFormatInfo rows that the merged buffer and unsigned image paths already use. I did not re-derive them from the ISA here.
  • Format 31: the cmake fragment's loop lists 35/38/42/45/49 only, but agc_driver_image_packed_signed runs the executable without an argument, which selects 31. All six are covered.

Not covered: native AMD or PS5 measurement, sampling (which is still refused, as stated), and titles.

AI-assisted: yes (Claude Code). I ran the tests above and read the code at this head.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 819b7d08f7032b5bcf85b671c5079f2fb38a90eb. I did not run commands or tests; execution results in the PR description are author-reported.

Results

Check Result Note
Code review passed Changed implementation and test inspected
Build and tests not run Reports in description not independently verified

Findings

Blocking

None.

Non-blocking

  • Fresh hosted Windows CI is still pending for this refreshed head, as the description notes. The earlier Windows run was on a different head.
  • Native AMD/PS5 behavior, store rounding and NaN conversion remain unmeasured, as documented in the debt entry.

Not verified

I read all eight changed files listed as reviewed in the manifest: TextureFormat.cpp, TextureFormat.cpp (tests), agc_driver_image_packed_signed_tests.cmake, ImagePackedSigned.cpp, ResourceMaterializer.cpp, RdnaDescriptorFormat.hpp, RdnaDescriptorFormat.cpp, and SpirvImageEmitter.cpp; I also read the debt fragment. No changed files were excluded by files.json (that file was not available through the review reader). I did not run builds, tests, CI, console, or hardware checks. Claims about those runs and peer PR coordination were not independently verified.

To get this to a good state

Nothing is required. Optional: obtain fresh hosted Windows CI for this head and retain the documented console measurement follow-up.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 21, 2026
@Lyrnc

Lyrnc commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Hardware measurements for the six formats, since the debt entry says there is no native AMD measurement. I ran image_store and image_load on real RDNA2 hardware (Ryzen 9800X3D iGPU, gfx1036, through tools/hw-oracle's HIP runtime). A linear 32×1 2D T# is read back from memory with buffer_load_dword. Each format was then compared against the formulas in ImagePackedSigned.cpp, using the same per-lane inputs the test uses ((lane + 3c) % 24 over your integers / normalized arrays, identity swizzle, full DMASK).

Loads: bit-exact on all six formats. I used your texel pattern (lane * (2c + 1) + c) plus 8 edge words per format: 0, 1, max, min, -1, min+1, 2, -2 in every field. X/Y/Z (and W for 45/49) match max(-1, v / (2^(b-1) - 1)) and the SINT sign extension with a 0-ulp gap. The 3-ulp tolerance is not needed on this hardware.

Stores: 5 of 6 formats bit-exact. 31, 35, 38, 42 and 49 match the test's expected words on all 32 lanes, including the NaN → 0, ±inf, denormal and out-of-range inputs.

Format 45 differs on the 2-bit X field at ±0.5:

lane X input hardware test expects
3, 27 0x3f000000 (0.5) 0x7ff80805 (X = +1) 0x7ff80804 (X = 0)
4, 28 0xbf000000 (-0.5) 0x8057f003 (X = -1) 0x8057f000 (X = 0)

The hardware rounds a 2-bit SNORM field away from zero at ±0.5, not to nearest even. The 10-bit fields of the same words match. The typed-buffer store path has the same bug. #25877 fixes it there, in EmitFormatStoreComponent, which this PR reuses for its stores. So once #25877 lands, the store result for 45 becomes the hardware value and these four lanes of CheckStores would fail unless the expectation also rounds ±0.5 away from zero for 2-bit fields. Something like bits == 2 ? (|v| >= 0.5 ? sign(v) : 0) : nearbyint(...) would do it. Whichever of the two PRs lands second will need to adjust.

For reference, the same measurement on 10_10_10_2 SNORM/SINT (51/55, which #22717 refuses because no NVIDIA/AMD/Intel driver exposes A2B10G10R10_SNORM/SINT): loads match the same formulas exactly. Stores match except the 2-bit W field at ±0.5, which also rounds away from zero. So routing 51/55 through this PR's R32_UINT conversion would work on those devices once both land.

Windows run of this PR. Head 819b7d08f7 merged onto main 8c254da48b (local f98d98a27a). The merge conflicts in five files, all with main's format-131 (alpha float) work: remapGuestFormat, the DCC clear test list, the ResourceMaterializer conversion block and the 6E4 append, the table count (now 109), and the PackImageTexel unorm line. Each conflict resolves by keeping both sides. Windows 11 Pro 10.0.26200, WinLibs GCC 15.2.0 Release, ANYPS5_REQUIRE_VULKAN=1, three runs per GPU:

GPU result
NVIDIA GeForce RTX 5080, 610.88 16/16 ×3
AMD Radeon (gfx1036 iGPU), 32.0.21045.16010 16/16 ×3

The tests were agc_driver_image_packed_signed, _35, _38, _42, _45, _49, agc_driver_graphics, agc_driver_image_unsigned_packed32_{37,41,44,48}, agc_driver_image_packed16_load and agc_driver_image_packed16_storage_{133..136}. No validation layer, and the full ^agc_ suite was not run.

AI-assisted: yes (Claude Code)

…igned-formats-20261125

# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/src/TextureFormat.cpp
#	core/libs/prx/libSceAgcDriver/tests/TextureFormat.cpp
#	core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
#	core/shader/recompiler/RdnaDecoder/src/RdnaDescriptorFormat.cpp
#	core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 25, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — changes requested

CMake registers no test named agc_driver_image_packed_signed, so configuring with BUILD_TESTING enabled fails at the test properties call.

What I ran

Reviewed head 1b8c079768a67e96eb5e7df023fbd1075c75e43f using the prepared diff and repository reader. No build or tests were run.

Results

Check Result Note
Diff and changed code review failed Found a CMake configuration defect
Build and tests not run No commands executed

Findings

Blocking

  • core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_packed_signed_tests.cmake:2 sets properties on agc_driver_image_packed_signed, but this file registers only tests named agc_driver_image_packed_signed_<format> at line 5. Repository search found no registration for the unsuffixed test name. With testing enabled, set_tests_properties names an unknown test and causes CMake configuration to fail. Remove the unsuffixed property call or register the corresponding test.

Non-blocking

None.

Not verified

No build, test suite, hardware behavior, or CI results were independently verified. The description reports Linux GPU test results and says fresh Windows CI is pending. All nine changed files listed in the manifest were included in the prepared diff; repository source was consulted for the CMake test name.

To get this to a good state

Register the unsuffixed test or remove the invalid property call, then rerun CMake configuration with BUILD_TESTING enabled and the relevant tests.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — comments

The signed packed image change is inspected at head d3026eec157984de812051bc14047ac5d6dfbd92; no concrete blocking defect was verified, but the stated draft/order hold and missing PS5 measurements prevent a formal approval.

What I ran

Read the prepared diff and all ten changed files marked included in the manifest. No build or tests were run by me; the build and hardware results in the description are author-reported.

Results

Check Result Note
Diff and changed files passed All ten included files read
Build and execution tests not run Results reported by author only
PS5 behavior not run Not verified on console

Findings

Blocking

None verified.

Non-blocking

  • The description records an outstanding format 45 SNORM half-rounding difference and a dependency on #25877, and says ordering with #16260 still needs agreement. Resolve those draft/order holds before treating the implementation and comparison results as final.
  • PS5 behavior remains unmeasured; the documented RDNA2 comparison is evidence for that device only.

Not verified

I did not run the build or execution tests, inspect CI output, validate the external comparison, or verify behavior on PS5. No changed files were excluded by the manifest. The test and build results described in the PR were not independently run here.

To get this to a good state

Nothing is required for a code fix based on this review. The PR description identifies the outstanding dependency and ordering agreement as draft holds.

@ligmaSec ligmaSec left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added agc_driver_image_packed_signed fixture passed on Linux/lavapipe. In the paired run, agc_driver_gcn_scalar_buffer_base passed and agc_driver_image_table hit its 30-second limit on both main at 9d362fb088fc and this head. The Vulkan runs required the device, disabled the shader cache, and loaded Khronos validation 1.4.369. Neither side reported a missing layer or a VUID.

AI-assisted: yes.

@MertCtn

MertCtn commented Dec 5, 2026

Copy link
Copy Markdown

Reviewed the signed conversion path against the current tree (static review, no GPU run on this base):

  • The approach mirrors the validated unsigned path: IsConvertedSignedTextureFormat + remap to R32_UINT, OpBitFieldSExtract for Sint/Snorm, Snorm folded into the existing NormalizeFormatComponent path (which already handles Snorm in SpirvFormatConvert.cpp), poison guards in ResourceMaterializer and 0x2ac8 shader swizzle consistent with the converted unorm handling (except 2_10_10_10, which keeps its alpha). No defects found in the read-through.
  • Debt fragment is honest about the gaps (format-45 2-bit SNORM store rounding vs fix(shader): round a 2-bit SNORM buffer store component away from zero at 0.5 #25877, unverified SNORM NaN/D16/partial-store behavior).
  • Overlap note: this is complementary to feat(shader): sample packed 11_11_10, 10_11_11 and 2_10_10_10 UScaled/SScaled images #28878 (same hunks, different format rows — unsigned 32/33/39/40/46/47 vs signed 31/35/38/42/45/49). I validated the shared helper structure on current main there (14/14 agc_driver_image_* tests, 0 validation errors), but not these signed rows themselves.
  • Heads-up: this branch is ~4300 commits behind main, and SpirvImageEmitter.cpp / RdnaDescriptorFormat.cpp moved upstream since, so the rebase will likely conflict. If you rebase, I can run the new agc_driver_image_packed_signed tests on NVIDIA (Windows, validation layers on) and report back — same setup I used for feat(shader): sample packed 11_11_10, 10_11_11 and 2_10_10_10 UScaled/SScaled images #28878.

This branch has not been deployed

No deployments
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.

8 participants