feat(recompiler): add WGSL with native cache compatibility #16391

Open
SteelCrab wants to merge 14 commits from upstream-pr/16391 into main
SteelCrab commented 2026-11-06 15:54:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SteelCrab on 2026-11-06T15:54:26Z.


What

Add a WGSL backend and anyps5-wgsl tools for WebGPU while preserving main's native cache keys, SPIR-V and disk-cache encoding. WGSL requests use distinct keys. Production compiler source-version stamps still change when compiler sources change.

This is the WGSL prerequisite of #6879, replacing closed #9094. The relinker fix #10017 and Emscripten library portability #11341 have merged. Unsupported WGSL cases are recorded in docs/dev/debt/changes/wgsl-native-cache.md. wasm-aot and runtime delivery remain separate follow-ups.

Main 75b480e9c78ea1f13a7079f8f8457b990ea9f28d was merged on 2026-12-01, preserving the reviewed commits and bringing in the upstream macOS replay fix dde92d5b17. The native target fields remain before the WGSL-only key suffix, with main's NaN-failure checks and native serialization. The existing fixture references passed on the refreshed main.

The cache-key review is addressed by including all WGSL emission inputs in WgslSource::Module's key. The key records input presence, compute workgroup and LDS sizes, pixel render-target modes and interpolation settings, and vertex embedded-fetch and clip-space settings. Float fields use their bit patterns. Existing specialization constant/binding keys are preserved, and requests with the same input values still reuse modules. This is confined to the WGSL module cache.

Tested

Ubuntu 26.04.1 x86-64, GCC 15.2, Node 22.22.1 and Chromium 151.0.7922.34; baseline main 75b480e9c78ea1f13a7079f8f8457b990ea9f28d, tested head 6f9c4ff1d06ea0704866c80a22742e9e8fb1d884.

  • Negative control: the new cache tests on the reviewed code 48938a5a32 failed with integer render target: reused stale WGSL module when changing a pixel shader from float to integer output with identical constants and bindings. On the corrected head the tests pass for pixel render-target type, interpolation slot/mode/default and custom mask, vertex embedded fetch and clip-space transform (including +0/-0), compute workgroup dimensions and LDS size, missing/unsupported inputs, repeated identical inputs and restored inputs. Equal input values at different addresses also reuse the module.
  • Independent Release shader-tools builds passed. Main's shader_native_snapshot passed 1/1; the change's shader_native_snapshot and wgsl_native_compat passed 2/2. Three public compute fixtures produced 9/9 byte-identical native files: cache keys, SPIR-V and encoded artifacts. Native-to-WGSL-to-native cache reuse and separate target keys passed.
  • The same external qualification harness, linked independently against each tree, created 3/3 native Vulkan compute pipelines on main and 3/3 on the change. It also built and ran the respective trees' existing shader_cache_file_read, shader_cache_native_paths and request_serializer tests: the four CTests passed 4/4 on each tree. Two Windows-only Python subcases skipped on each Linux run.
  • Both trees used ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer with verbose CTest, on the same Mesa lavapipe / llvmpipe device (vendor 10005, LLVM 21.1.8, Mesa 26.0.8-1ubuntu0.3). Both native Vulkan logs confirm validation-layer insertion, with 0 VUID errors and no missing-layer diagnostic. The installed validation layer is 1.4.341, newer than pinned Vulkan headers 1.4.335. Snapshot and cache tests themselves are CPU-only.
  • Chromium WebGPU created 3/3 WGSL compute pipelines; malformed WGSL was rejected with shader 0:. The checker selects Chromium's SwiftShader backend. The browser check used the four validation variables above; its log confirms layer insertion, without missing-layer or VUID diagnostics. Runtime format placeholders were set to representative values. This checks pipeline creation, not shader dispatch results.
  • The previous head e71ac2f18e passed the full native libs build, including the production shader recompiler, AGC driver and NID patching, from recorded submodule source. Configuration: Release, BUILD_TESTING=ON, ANYPS5_USE_SYSTEM_DEPS=OFF, ANYPS5_ENABLE_SPIRV_TOOLS=OFF. That full project build also passed shader_cache_file_read, shader_cache_native_paths and request_serializer 3/3 with the four validation variables above; the same two Windows-only Python subcases skipped. This is not the complete product/runtime CTest suite.
  • Local code Conventions and the PR diff whitespace check passed. The independent Windows report covers historical head 2125187a95. Full product runtime suites, title execution, vertex/pixel WGSL pipeline validation and physical GPU testing have not run.

CI claim ownership:

Claim Workflow / job
Independent native builds, nine-file comparison, cache reuse, stage-input cache regression cases, three browser compute pipelines, invalid-WGSL rejection and validation-log checks WGSL backend / native-compatibility-and-wgsl
Full native libraries and existing runtime/cache tests on the PR merged into current main Maintainer-dispatched Build / linux and windows
Repository and PR-template rules Conventions / conventions
Replay-process cleanup regression on macOS Build / relinker (macos-latest, clang++)

The dedicated WGSL job tests the submitted head against its shared ancestor with main. The Build workflow tests the current merge. The external native Vulkan qualification is local evidence. The checker uses Node built-ins and Chromium with no new third-party source or Cargo packages.

The previous macOS relinker job failed frame_capture_minimize_replay when killpg(pid, 0) returned EPERM during process-group shutdown. The upstream fix retries that macOS condition within the existing timeout while still requiring the group to disappear. It adds regression tests covering both temporary and persistent errors. On Linux, the updated 22-case replay suite passed on main and prior head 48938a5a32 with 6 platform-specific cases skipped. On main's macOS runner, the replay test passed on the first attempt and the suite passed 1,026/1,026.

On head 48938a5a32, the macOS relinker job passed 1,026/1,026. The previously failing replay test passed on the first attempt. The WGSL job, Conventions, Linux relinker and relinker ASan also passed. The automatic Windows build and tests and Windows relinker jobs passed. The automatic full Linux job was skipped and requires separate maintainer dispatch.

Current head 6f9c4ff1d06 passed local validation above and the WGSL backend job. Its log identifies the pinned baseline and exact candidate, passes the new pixel/vertex/compute cache regression, compares all nine native outputs, and creates 3/3 WebGPU compute pipelines. Conventions, macOS relinker, Linux relinker, Windows relinker and relinker ASan passed. The automatic Windows job passed. The full Linux job was skipped and requires maintainer dispatch.

Landing order and overlap:

  • #14217 and #17611 land before #16391. #14217's author requested that order and preservation of reviewed history; accepted here. The maintainer selected #17611 first. Both remain unmerged as of this refresh. Their code is excluded; this PR remains draft. After they land, merge main, retain all native options and serialization changes, recalculate combined sizes and repeat the byte comparisons and focused tests. No order between those two prerequisites is prescribed here.
  • The 2026-12-01 local preview merged #14217 head 98b083ca99 independently into main 75b480e9c7 and the WGSL head 48938a5a32. With the default target in the three public fixtures, native keys, SPIR-V and artifacts matched 9/9 and both previews created 3/3 native Vulkan compute pipelines on the same llvmpipe device with the validation layer and zero VUID errors. The merged key appends coherentBufferAtomics before the WGSL-only suffix. #17611 head 59203ed861 still conflicts with this main in 12 files, so the two-prerequisite integration remains pending.
  • #15719 and #15917 are merged and included in main. #11551's author confirmed either order works; it is not a prerequisite. #15548 follows #17611 under the maintainer's selected order.
  • The 2026-11-30 tools/pr_overlap.py --branch review/wgsl-main-20261107 --base main --head-repo SteelCrab/AnyPS5 scan against main 1b8f79a5b5 examined 2,147 open PRs and reports nine direct overlaps: #15548, #20130, #22690, #22703, #23242, #27811, #28102, #28295 and #28296. Another 70 PRs already conflict with main and could not be fully compared, including the unmerged prerequisites. The scan exits 2; this is not a compatibility pass. It checked merge commit 5d564ffbff, before the reference-only test commit e71ac2f18e; product sources are identical. The target-field, compiled-variant and artifact/result-size changes need integration review and combined testing after landing. Existing stacks (#17611 → #15548, #22690 → #22703 and #28102 → #28295/#28296) are preserved; no further author agreement 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 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: #14217, #17611
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Mesa lavapipe / llvmpipe (vendor 10005, Mesa 26.0.8-1ubuntu0.3, LLVM 21.1.8) for native pipeline creation; Google SwiftShader via Chromium 151.0.7922.34 for WGSL pipeline creation; Ubuntu 26.04.1 x86-64, Vulkan validation layer 1.4.341; no physical GPU tested
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5190611614 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16391). Originally posted by [SteelCrab](https://github.com/SteelCrab) on 2026-11-06T15:54:26Z. --- ### What Add a WGSL backend and `anyps5-wgsl` tools for WebGPU while preserving main's native cache keys, SPIR-V and disk-cache encoding. WGSL requests use distinct keys. Production compiler source-version stamps still change when compiler sources change. This is the WGSL prerequisite of #6879, replacing closed #9094. The relinker fix #10017 and Emscripten library portability #11341 have merged. Unsupported WGSL cases are recorded in `docs/dev/debt/changes/wgsl-native-cache.md`. wasm-aot and runtime delivery remain separate follow-ups. Main `75b480e9c78ea1f13a7079f8f8457b990ea9f28d` was merged on 2026-12-01, preserving the reviewed commits and bringing in the upstream macOS replay fix [`dde92d5b17`](https://github.com/boykopovar/AnyPS5/commit/dde92d5b1734c659b0c67cd14ea5d374b8cacb43). The native target fields remain before the WGSL-only key suffix, with main's NaN-failure checks and native serialization. The existing fixture references passed on the refreshed main. The [cache-key review](https://github.com/boykopovar/AnyPS5/pull/16391#pullrequestreview-6124736666) is addressed by including all WGSL emission inputs in `WgslSource::Module`'s key. The key records input presence, compute workgroup and LDS sizes, pixel render-target modes and interpolation settings, and vertex embedded-fetch and clip-space settings. Float fields use their bit patterns. Existing specialization constant/binding keys are preserved, and requests with the same input values still reuse modules. This is confined to the WGSL module cache. ### Tested Ubuntu 26.04.1 x86-64, GCC 15.2, Node 22.22.1 and Chromium 151.0.7922.34; baseline main `75b480e9c78ea1f13a7079f8f8457b990ea9f28d`, tested head `6f9c4ff1d06ea0704866c80a22742e9e8fb1d884`. - Negative control: the new cache tests on the reviewed code `48938a5a32` failed with `integer render target: reused stale WGSL module` when changing a pixel shader from float to integer output with identical constants and bindings. On the corrected head the tests pass for pixel render-target type, interpolation slot/mode/default and custom mask, vertex embedded fetch and clip-space transform (including +0/-0), compute workgroup dimensions and LDS size, missing/unsupported inputs, repeated identical inputs and restored inputs. Equal input values at different addresses also reuse the module. - Independent Release shader-tools builds passed. Main's `shader_native_snapshot` passed **1/1**; the change's `shader_native_snapshot` and `wgsl_native_compat` passed **2/2**. Three public compute fixtures produced **9/9 byte-identical native files**: cache keys, SPIR-V and encoded artifacts. Native-to-WGSL-to-native cache reuse and separate target keys passed. - The same [external qualification harness](https://github.com/boykopovar/AnyPS5/pull/16391#issuecomment-6937076195), linked independently against each tree, created **3/3 native Vulkan compute pipelines on main and 3/3 on the change**. It also built and ran the respective trees' existing `shader_cache_file_read`, `shader_cache_native_paths` and `request_serializer` tests: the four CTests passed **4/4 on each tree**. Two Windows-only Python subcases skipped on each Linux run. - Both trees used `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and `VK_LOADER_DEBUG=layer` with verbose CTest, on the same Mesa lavapipe / llvmpipe device (vendor `10005`, LLVM 21.1.8, Mesa `26.0.8-1ubuntu0.3`). Both native Vulkan logs confirm validation-layer insertion, with **0 VUID errors** and no missing-layer diagnostic. The installed validation layer is **1.4.341**, newer than pinned Vulkan headers 1.4.335. Snapshot and cache tests themselves are CPU-only. - Chromium WebGPU created **3/3 WGSL compute pipelines**; malformed WGSL was rejected with `shader 0:`. The checker selects Chromium's SwiftShader backend. The browser check used the four validation variables above; its log confirms layer insertion, without missing-layer or VUID diagnostics. Runtime format placeholders were set to representative values. This checks pipeline creation, not shader dispatch results. - The previous head `e71ac2f18e` passed the full native `libs` build, including the production shader recompiler, AGC driver and NID patching, from recorded submodule source. Configuration: Release, `BUILD_TESTING=ON`, `ANYPS5_USE_SYSTEM_DEPS=OFF`, `ANYPS5_ENABLE_SPIRV_TOOLS=OFF`. That full project build also passed `shader_cache_file_read`, `shader_cache_native_paths` and `request_serializer` **3/3** with the four validation variables above; the same two Windows-only Python subcases skipped. This is not the complete product/runtime CTest suite. - Local code Conventions and the PR diff whitespace check passed. The [independent Windows report](https://github.com/boykopovar/AnyPS5/pull/16391#issuecomment-6689766201) covers historical head `2125187a95`. Full product runtime suites, title execution, vertex/pixel WGSL pipeline validation and physical GPU testing have not run. CI claim ownership: | Claim | Workflow / job | | --- | --- | | Independent native builds, nine-file comparison, cache reuse, stage-input cache regression cases, three browser compute pipelines, invalid-WGSL rejection and validation-log checks | WGSL backend / `native-compatibility-and-wgsl` | | Full native libraries and existing runtime/cache tests on the PR merged into current main | Maintainer-dispatched Build / `linux` and `windows` | | Repository and PR-template rules | Conventions / `conventions` | | Replay-process cleanup regression on macOS | Build / `relinker (macos-latest, clang++)` | The dedicated WGSL job tests the submitted head against its shared ancestor with main. The Build workflow tests the current merge. The external native Vulkan qualification is local evidence. The checker uses Node built-ins and Chromium with no new third-party source or Cargo packages. The [previous macOS relinker job](https://github.com/boykopovar/AnyPS5/actions/runs/46382415241/job/141727141347) failed `frame_capture_minimize_replay` when `killpg(pid, 0)` returned `EPERM` during process-group shutdown. The upstream fix retries that macOS condition within the existing timeout while still requiring the group to disappear. It adds regression tests covering both temporary and persistent errors. On Linux, the updated 22-case replay suite passed on main and prior head `48938a5a32` with 6 platform-specific cases skipped. On [main's macOS runner](https://github.com/boykopovar/AnyPS5/actions/runs/46555233364/job/142328563276), the replay test passed on the first attempt and the suite passed 1,026/1,026. On head `48938a5a32`, the [macOS relinker job](https://github.com/boykopovar/AnyPS5/actions/runs/46569571539/job/142377102912) passed **1,026/1,026**. The previously failing replay test passed on the first attempt. The [WGSL job](https://github.com/boykopovar/AnyPS5/actions/runs/46569571449/job/142377043881), [Conventions](https://github.com/boykopovar/AnyPS5/actions/runs/46569569299/job/142377041170), Linux relinker and relinker ASan also passed. The automatic [Windows build and tests](https://github.com/boykopovar/AnyPS5/actions/runs/46569571539/job/142377102990) and [Windows relinker](https://github.com/boykopovar/AnyPS5/actions/runs/46569571539/job/142377102964) jobs passed. The automatic full Linux job was skipped and requires separate maintainer dispatch. Current head `6f9c4ff1d06` passed local validation above and the [WGSL backend job](https://github.com/boykopovar/AnyPS5/actions/runs/46902514475/job/143535684012). Its log identifies the pinned baseline and exact candidate, passes the new pixel/vertex/compute cache regression, compares all nine native outputs, and creates 3/3 WebGPU compute pipelines. [Conventions](https://github.com/boykopovar/AnyPS5/actions/runs/46902462288/job/143535505044), [macOS relinker](https://github.com/boykopovar/AnyPS5/actions/runs/46902514147/job/143535767725), [Linux relinker](https://github.com/boykopovar/AnyPS5/actions/runs/46902514147/job/143535767652), [Windows relinker](https://github.com/boykopovar/AnyPS5/actions/runs/46902514147/job/143535767687) and [relinker ASan](https://github.com/boykopovar/AnyPS5/actions/runs/46902514147/job/143535767655) passed. The automatic [Windows job](https://github.com/boykopovar/AnyPS5/actions/runs/46902514147/job/143535767604) passed. The full Linux job was skipped and requires maintainer dispatch. Landing order and overlap: - **#14217 and #17611 land before #16391.** [#14217's author requested that order and preservation of reviewed history](https://github.com/boykopovar/AnyPS5/pull/14217#issuecomment-6776683610); [accepted here](https://github.com/boykopovar/AnyPS5/pull/14217#issuecomment-6936890038). [The maintainer selected #17611 first](https://github.com/boykopovar/AnyPS5/pull/17611#issuecomment-6752924007). Both remain unmerged as of this refresh. Their code is excluded; this PR remains draft. After they land, merge main, retain all native options and serialization changes, recalculate combined sizes and repeat the byte comparisons and focused tests. No order between those two prerequisites is prescribed here. - The 2026-12-01 local preview merged #14217 head `98b083ca99` independently into main `75b480e9c7` and the WGSL head `48938a5a32`. With the default target in the three public fixtures, native keys, SPIR-V and artifacts matched **9/9** and both previews created **3/3** native Vulkan compute pipelines on the same llvmpipe device with the validation layer and zero VUID errors. The merged key appends `coherentBufferAtomics` before the WGSL-only suffix. #17611 head `59203ed861` still conflicts with this main in 12 files, so the two-prerequisite integration remains pending. - #15719 and #15917 are merged and included in main. [#11551's author confirmed either order works](https://github.com/boykopovar/AnyPS5/pull/11551#issuecomment-6734545420); it is not a prerequisite. #15548 follows #17611 under the maintainer's selected order. - The 2026-11-30 `tools/pr_overlap.py --branch review/wgsl-main-20261107 --base main --head-repo SteelCrab/AnyPS5` scan against main `1b8f79a5b5` examined 2,147 open PRs and reports nine direct overlaps: **#15548, #20130, #22690, #22703, #23242, #27811, #28102, #28295 and #28296**. Another **70 PRs** already conflict with main and could not be fully compared, including the unmerged prerequisites. The scan exits **2**; this is not a compatibility pass. It checked merge commit `5d564ffbff`, before the reference-only test commit `e71ac2f18e`; product sources are identical. The target-field, compiled-variant and artifact/result-size changes need integration review and combined testing after landing. Existing stacks (#17611 → #15548, #22690 → #22703 and #28102 → #28295/#28296) are preserved; no further author agreement is claimed. <!-- 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. --> ### 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) and the licence notice of code adapted from upstream (see AGENTS.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: #14217, #17611 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: Mesa lavapipe / llvmpipe (vendor 10005, Mesa 26.0.8-1ubuntu0.3, LLVM 21.1.8) for native pipeline creation; Google SwiftShader via Chromium 151.0.7922.34 for WGSL pipeline creation; Ubuntu 26.04.1 x86-64, Vulkan validation layer 1.4.341; no physical GPU tested <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
MarcZX10 commented 2026-11-20 11:02:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T11:02:23Z.

Review: COMMENTED


Reviewed — no blocking findings

Formal approval is not justified because the description identifies unresolved compatibility overlaps with active PRs, so their combined behavior remains unverified.

What I ran

  • Reviewed head 2ad232555d9907fc9f11599ce3b32f9fa88ee615 using the prepared diff and repo_read.py at the pinned head.
  • No build or tests were run during this review.

Results

Check Result Note
Prepared diff and file inventory passed All 20 changed files are included.
Targeted code review passed Inspected cache-key separation, WGSL compilation and materialization, emitter setup, and test setup.
Build and tests not run Relied on the author-reported checks in the PR description.
Combined behavior with overlapping PRs not run The description says these integrations remain unverified.

Findings

Blocking

None verified.

Non-blocking

None.

Not verified

  • Combined runtime behavior and integration with overlapping PRs #9508, #11551, #14217, #20130, and #20519; the description says overlap checks are incomplete and do not establish compatibility.
  • The PR description reports three compute fixtures validated as WebGPU pipelines; vertex and pixel WGSL pipeline validation and physical GPU behavior were not confirmed in the inspected evidence.
  • Tests and builds were not run during this review. The author-reported checks are not independent review runs.
  • Read all 20 changed files listed as included in manifest.json; no changed files were excluded by the manifest. Also read description.md, commits.md, and the relevant ranges of diff.patch. The review-folder README and the repository files.json were not available through the reader.

To get this to a good state

Nothing is required. Consider completing integration review after the overlapping PRs land; the description notes this remains outstanding.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5991622938 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16391#pullrequestreview-5991622938). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T11:02:23Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Formal approval is not justified because the description identifies unresolved compatibility overlaps with active PRs, so their combined behavior remains unverified. ## What I ran - Reviewed head `2ad232555d9907fc9f11599ce3b32f9fa88ee615` using the prepared diff and `repo_read.py` at the pinned head. - No build or tests were run during this review. ## Results | Check | Result | Note | |---|---|---| | Prepared diff and file inventory | passed | All 20 changed files are included. | | Targeted code review | passed | Inspected cache-key separation, WGSL compilation and materialization, emitter setup, and test setup. | | Build and tests | not run | Relied on the author-reported checks in the PR description. | | Combined behavior with overlapping PRs | not run | The description says these integrations remain unverified. | ## Findings ### Blocking None verified. ### Non-blocking None. ## Not verified - Combined runtime behavior and integration with overlapping PRs #9508, #11551, #14217, #20130, and #20519; the description says overlap checks are incomplete and do not establish compatibility. - The PR description reports three compute fixtures validated as WebGPU pipelines; vertex and pixel WGSL pipeline validation and physical GPU behavior were not confirmed in the inspected evidence. - Tests and builds were not run during this review. The author-reported checks are not independent review runs. - Read all 20 changed files listed as included in `manifest.json`; no changed files were excluded by the manifest. Also read `description.md`, `commits.md`, and the relevant ranges of `diff.patch`. The review-folder README and the repository `files.json` were not available through the reader. ## To get this to a good state Nothing is required. Consider completing integration review after the overlapping PRs land; the description notes this remains outstanding.
MarcZX10 commented 2026-11-30 08:35:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T08:35:25Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this draft review; the documented limitations and pending full-build and hosted checks leave material uncertainty about merge readiness.

What I ran

Reviewed head e71ac2f18ec7ff22c5e00368a62362e2e1db5cdd using repo_read.py against the prepared diff and targeted source ranges. No commands or tests were run by me.

Results

Check Result Note
Prepared diff and manifest passed 20 changed files listed
Targeted source review passed Recompiler, cache, emitter, CI, and checker
Build and tests not run Author reports focused runs; full native build pending

Findings

Blocking

None.

Non-blocking

  • The browser check only compiles compute pipelines; the PR description also notes that vertex and pixel WGSL validation and dispatch-result checks have not run. Consider adding those checks before relying on this backend for graphics shader behavior.

Not verified

The full native libs build, hosted checks for this exact head, full runtime suites, title execution, physical GPU behavior, and vertex/pixel WGSL pipeline validation were not verified. I read the prepared description, commits, diff, manifest and all 20 changed-file paths listed by the manifest; no files/ directory was available, so source ranges were read through repo_read.py. Files excluded by preparation rules were not reviewed, including lockfiles, minified files, dist/, build/, and SVG files, if any.

To get this to a good state

Nothing is required. Optional: extend the browser checks to validate vertex and pixel WGSL pipelines and dispatch outputs.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6108977182 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16391#pullrequestreview-6108977182). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-30T08:35:25Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this draft review; the documented limitations and pending full-build and hosted checks leave material uncertainty about merge readiness. ## What I ran Reviewed head `e71ac2f18ec7ff22c5e00368a62362e2e1db5cdd` using `repo_read.py` against the prepared diff and targeted source ranges. No commands or tests were run by me. ## Results | Check | Result | Note | |---|---|---| | Prepared diff and manifest | passed | 20 changed files listed | | Targeted source review | passed | Recompiler, cache, emitter, CI, and checker | | Build and tests | not run | Author reports focused runs; full native build pending | ## Findings ### Blocking None. ### Non-blocking - The browser check only compiles compute pipelines; the PR description also notes that vertex and pixel WGSL validation and dispatch-result checks have not run. Consider adding those checks before relying on this backend for graphics shader behavior. ## Not verified The full native `libs` build, hosted checks for this exact head, full runtime suites, title execution, physical GPU behavior, and vertex/pixel WGSL pipeline validation were not verified. I read the prepared description, commits, diff, manifest and all 20 changed-file paths listed by the manifest; no `files/` directory was available, so source ranges were read through `repo_read.py`. Files excluded by preparation rules were not reviewed, including lockfiles, minified files, `dist/`, `build/`, and SVG files, if any. ## To get this to a good state Nothing is required. Optional: extend the browser checks to validate vertex and pixel WGSL pipelines and dispatch outputs.
MarcZX10 commented 2026-12-01 03:40:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T03:40:58Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Changes are required before merge: include every inputInfo value that affects WGSL output in the module cache key, or avoid reusing modules across different input info.

What I ran

Reviewed head 48938a5a32f20438e51d8eb16b17f44987d6bc39 using read-only source and diff inspection with repo_read.py and shell text searches. No build or tests were run.

Results

Check Result Note
Source inspection passed Found a context-sensitive module cache key
Build not run No compilation performed
Tests not run No test execution performed

Negative control

Not run; no test was executed to confirm that varying inputInfo exposes the stale module.

Findings

Blocking

  • WgslSource::Module keys cached modules using only specialization constants and bindings, but the emitter also uses inputInfo to generate WGSL. For example, pixel target output mode affects the generated output type, and vertex clip-space settings affect position output. A later request with the same constants and bindings but different input info can receive the earlier request's WGSL. Include all emission-relevant input info in the key or do not cache across it. core/shader/recompiler/WgslBackend/src/WgslEmitter.cpp:2286.

Non-blocking

None.

Sources

Not verified

No build, tests, browser validation, or console/GPU execution was performed. The review bundle listed 20 changed files with none excluded by its file rules; 14 changed-file texts were fully inspected. The remaining six were not fully read: core/shader/recompiler/tests/NativeSnapshot.cpp, core/shader/recompiler/tests/ShaderCompatibilityFixtures.hpp, core/shader/recompiler/tests/WgslTarget.cpp, core/shader/recompiler/tests/native_snapshot/CMakeLists.txt, docs/dev/debt/changes/wgsl-native-cache.md, and tools/wgsl-check/check.cjs.

To get this to a good state

Include emission-relevant inputInfo in the cache key or disable reuse across differing input info, and add a regression check that requests modules with identical constants and bindings but different input info.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6124736666 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16391#pullrequestreview-6124736666). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-12-01T03:40:58Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Changes are required before merge: include every `inputInfo` value that affects WGSL output in the module cache key, or avoid reusing modules across different input info. ## What I ran Reviewed head `48938a5a32f20438e51d8eb16b17f44987d6bc39` using read-only source and diff inspection with `repo_read.py` and shell text searches. No build or tests were run. ## Results | Check | Result | Note | |---|---|---| | Source inspection | passed | Found a context-sensitive module cache key | | Build | not run | No compilation performed | | Tests | not run | No test execution performed | ## Negative control Not run; no test was executed to confirm that varying `inputInfo` exposes the stale module. ## Findings ### Blocking - `WgslSource::Module` keys cached modules using only specialization constants and bindings, but the emitter also uses `inputInfo` to generate WGSL. For example, pixel target output mode affects the generated output type, and vertex clip-space settings affect position output. A later request with the same constants and bindings but different input info can receive the earlier request's WGSL. Include all emission-relevant input info in the key or do not cache across it. `core/shader/recompiler/WgslBackend/src/WgslEmitter.cpp:2286`. ### Non-blocking None. ## Sources - [Module cache key and emission call](https://github.com/boykopovar/AnyPS5/blob/48938a5a32f20438e51d8eb16b17f44987d6bc39/core/shader/recompiler/WgslBackend/src/WgslEmitter.cpp#L2286) - [Context-dependent pixel output and vertex position generation](https://github.com/boykopovar/AnyPS5/blob/48938a5a32f20438e51d8eb16b17f44987d6bc39/core/shader/recompiler/WgslBackend/src/WgslEmitter.cpp#L1597) - [Call site supplying request input info](https://github.com/boykopovar/AnyPS5/blob/48938a5a32f20438e51d8eb16b17f44987d6bc39/core/shader/recompiler/Recompiler.cpp#L1674) ## Not verified No build, tests, browser validation, or console/GPU execution was performed. The review bundle listed 20 changed files with none excluded by its file rules; 14 changed-file texts were fully inspected. The remaining six were not fully read: `core/shader/recompiler/tests/NativeSnapshot.cpp`, `core/shader/recompiler/tests/ShaderCompatibilityFixtures.hpp`, `core/shader/recompiler/tests/WgslTarget.cpp`, `core/shader/recompiler/tests/native_snapshot/CMakeLists.txt`, `docs/dev/debt/changes/wgsl-native-cache.md`, and `tools/wgsl-check/check.cjs`. ## To get this to a good state Include emission-relevant `inputInfo` in the cache key or disable reuse across differing input info, and add a regression check that requests modules with identical constants and bindings but different input info.
MarcZX10 commented 2026-12-02 14:28:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-02T14:28:09Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Reviewed prepared diff and source context at head 6f9c4ff1d06ea0704866c80a22742e9e8fb1d884. No tests or builds were run; this was a static review using repo_read.py and the prepared review files.

Results

Check Result Note
Static review not run Review was incomplete
Tests and builds not run No independent execution
Negative control not run Not attempted

Findings

Blocking

None identified in the portions reviewed.

Non-blocking

None.

Sources

Not verified

Source context was read from 13 of the 20 changed paths: workflow, top-level and recompiler CMake files, CacheKey.hpp, CompiledVariant.hpp, Recompiler.cpp, Recompiler.hpp, ShaderDiskCache.cpp, WgslEmitter.hpp, WgslEmitter.cpp, WgslTarget.cpp, tools CMake, WgslCompile.cpp, and WgslTarget.cpp tests. Several were read only at changed hunks or targeted ranges. The full WGSL emitter and these changed files were not read: WgslTarget.hpp, NativeSnapshot.cpp, ShaderCompatibilityFixtures.hpp, native_snapshot/CMakeLists.txt, docs/dev/debt/changes/wgsl-native-cache.md, and tools/wgsl-check/check.cjs. The manifest lists 20 reviewed paths and no excluded paths. A complete review and independent test execution are not verified.

To get this to a good state

Nothing is required. The review remains incomplete, so no approval decision is justified.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6152750620 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16391#pullrequestreview-6152750620). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-12-02T14:28:09Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Reviewed prepared diff and source context at head `6f9c4ff1d06ea0704866c80a22742e9e8fb1d884`. No tests or builds were run; this was a static review using `repo_read.py` and the prepared review files. ## Results | Check | Result | Note | |---|---|---| | Static review | not run | Review was incomplete | | Tests and builds | not run | No independent execution | | Negative control | not run | Not attempted | ## Findings ### Blocking None identified in the portions reviewed. ### Non-blocking None. ## Sources - [WGSL module cache key and emission inputs](https://github.com/boykopovar/AnyPS5/blob/6f9c4ff1d06ea0704866c80a22742e9e8fb1d884/core/shader/recompiler/WgslBackend/src/WgslEmitter.cpp#L2286-L2314) - [WGSL integration in result materialization](https://github.com/boykopovar/AnyPS5/blob/6f9c4ff1d06ea0704866c80a22742e9e8fb1d884/core/shader/recompiler/Recompiler.cpp#L1587-L1677) ## Not verified Source context was read from 13 of the 20 changed paths: workflow, top-level and recompiler CMake files, `CacheKey.hpp`, `CompiledVariant.hpp`, `Recompiler.cpp`, `Recompiler.hpp`, `ShaderDiskCache.cpp`, `WgslEmitter.hpp`, `WgslEmitter.cpp`, `WgslTarget.cpp`, tools CMake, `WgslCompile.cpp`, and `WgslTarget.cpp` tests. Several were read only at changed hunks or targeted ranges. The full WGSL emitter and these changed files were not read: `WgslTarget.hpp`, `NativeSnapshot.cpp`, `ShaderCompatibilityFixtures.hpp`, `native_snapshot/CMakeLists.txt`, `docs/dev/debt/changes/wgsl-native-cache.md`, and `tools/wgsl-check/check.cjs`. The manifest lists 20 reviewed paths and no excluded paths. A complete review and independent test execution are not verified. ## To get this to a good state Nothing is required. The review remains incomplete, so no approval decision is justified.
ligmaSec commented 2026-12-03 22:37:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:37:27Z.

Review: COMMENTED


The trial merge onto c1601e56d5 was clean. I reviewed the native snapshot comparison and separate WGSL key. The workflow installs vulkan-validationlayers from the runner repository and checks that a layer was inserted, but it does not verify its version. Please enforce the repository’s minimum layer version for the Vulkan run. Also keep the host-only byte-for-byte snapshot result distinct from browser execution of the generated WGSL and ensure each native Vulkan case used for comparison runs on both arms.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6179840371 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16391#pullrequestreview-6179840371). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:37:27Z. **Review:** COMMENTED --- The trial merge onto `c1601e56d5` was clean. I reviewed the native snapshot comparison and separate WGSL key. The workflow installs `vulkan-validationlayers` from the runner repository and checks that a layer was inserted, but it does not verify its version. Please enforce the repository’s minimum layer version for the Vulkan run. Also keep the host-only byte-for-byte snapshot result distinct from browser execution of the generated WGSL and ensure each native Vulkan case used for comparison runs on both arms. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/16391:upstream-pr/16391'
git switch 'upstream-pr/16391'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/16391'
git switch 'upstream-pr/16391'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/16391'
git switch 'upstream-pr/16391'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/16391'
git switch 'main'
git merge --squash 'upstream-pr/16391'
git switch 'main'
git merge --ff-only 'upstream-pr/16391'
git switch 'main'
git merge 'upstream-pr/16391'
git push origin 'main'
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!16391
No description provided.