feat(agc): apply a T#'s MIN_LOD clamp in the shader without VK_EXT_image_view_min_lod #12662

Merged
Gonic0 merged 1 commit from upstream-pr/12662 into main 2026-11-02 22:35:31 +00:00
Gonic0 commented 2026-10-29 00:52:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Gonic0 on 2026-10-29T00:52:00Z.


What

MoltenVK has no VK_EXT_image_view_min_lod. Since #130, the first T# whose MIN_LOD clamp sits above its base level throws there. ASTRO BOT (PPSA21564 01.007.000) hits this on the title screen. MoltenVK does offer shaderResourceMinLod, which turns the SPIR-V MinLod operand into Metal's min_lod_clamp.

A new target flag, shaderImageMinLod, moves the clamp into the shader. It is set on devices that have shaderResourceMinLod, lack the extension, and do not use graphics pipeline libraries.

  • DescriptorBindingBuilder writes the clamp of each direct image as a float specialization constant at MinLodBase + image. The value is relative to the view's base level and bounded by its last level.
  • Samples of direct images apply it as the MinLod operand, or as an FMax on an explicit LOD that is skipped when the clamp is 0. It combines with an instruction's _cl clamp.
  • On these devices the image view no longer chains the clamp. Image table entries with a clamp are still rejected. Devices that have the extension keep the view clamp.
  • The shader clamp raises λ, where the view clamp raises only the level, so the builder throws wherever the two differ:
    • a paired S# with MAX_LOD below the clamp, no mip filter, or unnormalized coordinates;
    • different magnification and minification filters;
    • a nonzero S# bias on an explicit-LOD sampler;
    • an S# selected at run time;
    • image_get_lod;
    • a gather at a clamp of one level or more;
    • the emulated depth-compare and 11:11:10 samples.
  • APS5_NO_IMAGE_VIEW_MIN_LOD disables the extension, so devices that have it can run this lane.
  • An S# bias on implicit or gradient samples is left to the driver. At a T# clamp of 2.0 and a bias of -1, llvmpipe (LLVM 20.1.2, CI) samples level 1 where MoltenVK and NVIDIA sample level 2, so that case runs in the image-view lane only; the debt entry records it. PPSA21564's title samples such a pair (implicit LOD, T# MIN_LOD 3.0, S# bias -1), so the shader lane cannot reject it.
  • The test skips (77) on a device that has neither lane: no extension, and graphics pipeline libraries keep the clamp out of the shader. The _shader_lane entry skips when its environment does not produce that lane.
  • ValidateShaders now accepts CapabilityMinLod when the device enables shaderResourceMinLod. This also changes devices with the extension: graphics shaders that use an instruction _cl clamp threw "unsupported device capability 42" on every device before.
  • Request serialization moves to version 53, with shaderImageMinLod written after hostInterpolationFirst. main took 51 (#13807) and 52 (#10547), and rejects 50, which several open pull requests write.

The remaining gaps are recorded in docs/dev/debt/shader.md:

  • image tables and registration modules still throw;
  • fetches read below the clamp, which the view clamp leaves undefined;
  • each distinct clamp specializes its own pipeline.

Tested

  • Machine: macOS 27.2, Apple M5 Pro, MoltenVK 1.4.2 (Vulkan SDK 1.4.363), x86_64 build under Rosetta.

  • Build tree: upstream main does not build on macOS without the open macOS port PRs (libkernel). Builds and tests therefore ran on main merged with those, plus this commit. On this branch alone, the touched recompiler and libSceAgcDriver translation units compile and request_serializer_tests passes.

  • agc_driver_image_sample_lod_clamp_tests: passes in the shader lane. It also has a new _shader_lane CTest entry that forces that lane with APS5_NO_IMAGE_VIEW_MIN_LOD=1 and APS5_NO_GPL=1. It now covers:

    • _d_cl, _cl, _d_cl_o, _l and _lz;
    • integer and fractional MIN_LOD over BASE_LEVEL 0 and 1;
    • S# MAX_LOD at the clamp, an S# bias on gradient samples (in the image-view lane only), and negative explicit LODs with an S# bias and no clamp;
    • alternating clamps through cache hits;
    • a prepared-SPIR-V control for the target flag;
    • five rejections with exact messages.

    Each mutation fails it: writing 0, an absolute clamp, a truncated fractional clamp, dropping the MAX_LOD check, or an unconditional FMax on an explicit LOD.

  • Other tests: agc_driver_graphics_tests and agc_shader_disk_cache_tests pass on the current head, and agc_shader_memory_tests on the first commit. agc_driver_recorder_tests did not load Vulkan here, and its minLodTests skips without the extension anyway.

  • PPSA21564 01.007.000:

    • Before: guest texture descriptor uses a minimum LOD clamp, which needs VK_EXT_image_view_min_lod at about 250 s.
    • Probe: the title uses three clamps (MIN_LOD 3, 4 and 1 at base level 0, on 2048² and 4096² textures).
    • After, including the rejections: the title renders and the game reaches the warp sequence that follows it. None of the new rejections fires. The next stop is an unrelated v_permlanex16_b32 in a vertex shader.
  • Not verified: a Linux build, lavapipe (no lavapipe on this Mac; the two lavapipe failures from the CI review are what e006bc1f78 addresses), and the image-view lane.

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. The version 50/51/52 plan agreed with #10359 and #10846 no longer applies: #13807 and #10547 took 51 and 52 on main, which rejects 50, so this PR takes 53, the next free version. The specialization constants move to MinLodBase = 57600, after main's MirrorUnnormalizedBase.
  • Fixes: none
  • Unblocks: PPSA21564 title screen on MoltenVK
  • GPUs tested: Apple M5 Pro, MoltenVK 1.4.2, macOS 27.2
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5060145048 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662). Originally posted by [Gonic0](https://github.com/Gonic0) on 2026-10-29T00:52:00Z. --- ### What MoltenVK has no `VK_EXT_image_view_min_lod`. Since #130, the first T# whose MIN_LOD clamp sits above its base level throws there. ASTRO BOT (PPSA21564 01.007.000) hits this on the title screen. MoltenVK does offer `shaderResourceMinLod`, which turns the SPIR-V `MinLod` operand into Metal's `min_lod_clamp`. A new target flag, `shaderImageMinLod`, moves the clamp into the shader. It is set on devices that have `shaderResourceMinLod`, lack the extension, and do not use graphics pipeline libraries. - `DescriptorBindingBuilder` writes the clamp of each direct image as a float specialization constant at `MinLodBase + image`. The value is relative to the view's base level and bounded by its last level. - Samples of direct images apply it as the `MinLod` operand, or as an `FMax` on an explicit LOD that is skipped when the clamp is 0. It combines with an instruction's `_cl` clamp. - On these devices the image view no longer chains the clamp. Image table entries with a clamp are still rejected. Devices that have the extension keep the view clamp. - The shader clamp raises λ, where the view clamp raises only the level, so the builder throws wherever the two differ: - a paired S# with MAX_LOD below the clamp, no mip filter, or unnormalized coordinates; - different magnification and minification filters; - a nonzero S# bias on an explicit-LOD sampler; - an S# selected at run time; - `image_get_lod`; - a gather at a clamp of one level or more; - the emulated depth-compare and 11:11:10 samples. - `APS5_NO_IMAGE_VIEW_MIN_LOD` disables the extension, so devices that have it can run this lane. - An S# bias on implicit or gradient samples is left to the driver. At a T# clamp of 2.0 and a bias of -1, llvmpipe (LLVM 20.1.2, CI) samples level 1 where MoltenVK and NVIDIA sample level 2, so that case runs in the image-view lane only; the debt entry records it. PPSA21564's title samples such a pair (implicit LOD, T# MIN_LOD 3.0, S# bias -1), so the shader lane cannot reject it. - The test skips (77) on a device that has neither lane: no extension, and graphics pipeline libraries keep the clamp out of the shader. The `_shader_lane` entry skips when its environment does not produce that lane. - `ValidateShaders` now accepts `CapabilityMinLod` when the device enables `shaderResourceMinLod`. This also changes devices with the extension: graphics shaders that use an instruction `_cl` clamp threw "unsupported device capability 42" on every device before. - Request serialization moves to version 53, with `shaderImageMinLod` written after `hostInterpolationFirst`. `main` took 51 (#13807) and 52 (#10547), and rejects 50, which several open pull requests write. The remaining gaps are recorded in `docs/dev/debt/shader.md`: - image tables and registration modules still throw; - fetches read below the clamp, which the view clamp leaves undefined; - each distinct clamp specializes its own pipeline. ### Tested - **Machine:** macOS 27.2, Apple M5 Pro, MoltenVK 1.4.2 (Vulkan SDK 1.4.363), x86_64 build under Rosetta. - **Build tree:** upstream `main` does not build on macOS without the open macOS port PRs (libkernel). Builds and tests therefore ran on `main` merged with those, plus this commit. On this branch alone, the touched recompiler and libSceAgcDriver translation units compile and `request_serializer_tests` passes. - **`agc_driver_image_sample_lod_clamp_tests`:** passes in the shader lane. It also has a new `_shader_lane` CTest entry that forces that lane with `APS5_NO_IMAGE_VIEW_MIN_LOD=1` and `APS5_NO_GPL=1`. It now covers: - `_d_cl`, `_cl`, `_d_cl_o`, `_l` and `_lz`; - integer and fractional MIN_LOD over BASE_LEVEL 0 and 1; - S# MAX_LOD at the clamp, an S# bias on gradient samples (in the image-view lane only), and negative explicit LODs with an S# bias and no clamp; - alternating clamps through cache hits; - a prepared-SPIR-V control for the target flag; - five rejections with exact messages. Each mutation fails it: writing 0, an absolute clamp, a truncated fractional clamp, dropping the MAX_LOD check, or an unconditional `FMax` on an explicit LOD. - **Other tests:** `agc_driver_graphics_tests` and `agc_shader_disk_cache_tests` pass on the current head, and `agc_shader_memory_tests` on the first commit. `agc_driver_recorder_tests` did not load Vulkan here, and its `minLodTests` skips without the extension anyway. - **PPSA21564 01.007.000:** - Before: `guest texture descriptor uses a minimum LOD clamp, which needs VK_EXT_image_view_min_lod` at about 250 s. - Probe: the title uses three clamps (MIN_LOD 3, 4 and 1 at base level 0, on 2048² and 4096² textures). - After, including the rejections: the title renders and the game reaches the warp sequence that follows it. None of the new rejections fires. The next stop is an unrelated `v_permlanex16_b32` in a vertex shader. - **Not verified:** a Linux build, lavapipe (no lavapipe on this Mac; the two lavapipe failures from the CI review are what `e006bc1f78` addresses), and the image-view lane. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none. The version 50/51/52 plan agreed with #10359 and #10846 no longer applies: #13807 and #10547 took 51 and 52 on `main`, which rejects 50, so this PR takes 53, the next free version. The specialization constants move to `MinLodBase = 57600`, after `main`'s `MirrorUnnormalizedBase`. - [x] Fixes: none - [x] Unblocks: PPSA21564 title screen on MoltenVK - [x] GPUs tested: Apple M5 Pro, MoltenVK 1.4.2, macOS 27.2 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
adriadam10 commented 2026-10-29 01:18:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-29T01:18:55Z.

Review: CHANGES_REQUESTED


Agreeing with @oneandonlydean's review; the points below are still open on this head:

  • DescriptorBindingBuilder.cpp:366-370 writes the T# clamp into MinLodBase + image regardless of the S#. With T# MIN_LOD above S# MAX_LOD, MinLod exceeds lod_max, which Vulkan leaves undefined, while the old view clamp applied after the sampler's LOD limit. The debt line in docs/dev/debt/shader.md describes the gap but the code accepts it: either reject that combination (throw) or reproduce the late-clamp semantics.
  • SpirvImageEmitter.cpp: the FMax on an explicit LOD runs before the sampler's limit too, so it has the same problem.
  • Cover the S# MAX_LOD below the clamp case and a sampler with no mip filter with defined output or a clear rejection, and add a fractional MIN_LOD case (e.g. 0x180) to ImageSampleLodClamp.cpp.
  • agc_driver_image_sample_lod_clamp_tests skips unless shaderResourceMinLod is present but never forces the no-extension lane on a device that has the extension, so CI (lavapipe) doesn't exercise shaderImageMinLod. Please add a way to run that lane explicitly.

The rest (relative clamp, base-level handling, v50 serialization, MinLod capability in ValidateShaders) reads correctly.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5691732975 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5691732975). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-29T01:18:55Z. **Review:** CHANGES_REQUESTED --- Agreeing with @oneandonlydean's review; the points below are still open on this head: - `DescriptorBindingBuilder.cpp:366-370` writes the T# clamp into `MinLodBase + image` regardless of the S#. With T# MIN_LOD above S# MAX_LOD, `MinLod` exceeds `lod_max`, which Vulkan leaves undefined, while the old view clamp applied after the sampler's LOD limit. The debt line in `docs/dev/debt/shader.md` describes the gap but the code accepts it: either reject that combination (throw) or reproduce the late-clamp semantics. - `SpirvImageEmitter.cpp`: the `FMax` on an explicit LOD runs before the sampler's limit too, so it has the same problem. - Cover the S# MAX_LOD below the clamp case and a sampler with no mip filter with defined output or a clear rejection, and add a fractional MIN_LOD case (e.g. 0x180) to `ImageSampleLodClamp.cpp`. - `agc_driver_image_sample_lod_clamp_tests` skips unless `shaderResourceMinLod` is present but never forces the no-extension lane on a device that has the extension, so CI (lavapipe) doesn't exercise `shaderImageMinLod`. Please add a way to run that lane explicitly. The rest (relative clamp, base-level handling, v50 serialization, `MinLod` capability in `ValidateShaders`) reads correctly.
MarcZX10 commented 2026-10-29 01:19:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T01:19:21Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The current head does not build in the Linux Release configuration, and the fallback clamp still differs from Vulkan’s defined LOD behavior in several reachable sampling cases.

What I ran

  • Linux GCC 12.2 Release build of agc_driver_image_sample_lod_clamp_tests, agc_shader_memory_tests, and agc_driver_graphics_tests.
  • python3 tools/check_conventions.py --base upstream/main --head HEAD.
  • git diff --check upstream/main...HEAD.
  • git merge-tree --write-tree upstream/main HEAD.
  • Refreshed the hosted checks and inspected the exact current diff at 9d42922fc0d218f0bf7581e2d2a8a1955a75e730.

Results

Check Result
Linux Release build Failed compiling ShaderDiskCache.cpp; diagnostics below
Conventions Passed
Diff whitespace Passed
Merge preview against current main Clean; tree e1e7de7a2f442c0e40b52c674e5f71f8ab8eb416
Hosted checks at review time Windows build and two macOS relinker jobs pending; Linux product, register-context, and write-watch jobs skipped. Ubuntu/Windows relinker, relinker ASAN, conventions, eligibility, intake, labels, and report passed.
Raw compiler diagnostic excerpt
FAILED: core/libs/prx/libSceAgcDriver/CMakeFiles/shader_recompiler_agc_driver.dir/__/__/__/shader/recompiler/ShaderDiskCache.cpp.o 
/tmp/anyps5-pr12664-review/core/shader/recompiler/ShaderDiskCache.cpp:88:46: error: static assertion failed: CompiledShaderArtifact changed: update the artifact encoder
   88 | static_assert(sizeof(CompiledShaderArtifact) == 288, "CompiledShaderArtifact changed: update the artifact encoder");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/tmp/anyps5-pr12664-review/core/shader/recompiler/ShaderDiskCache.cpp:88:46: note: the comparison reduces to ‘(296 == 288)’
/tmp/anyps5-pr12664-review/core/shader/recompiler/ShaderDiskCache.cpp:90:39: error: static assertion failed: RecompileResult changed: update EncodeResult and DecodeResult
   90 | static_assert(sizeof(RecompileResult) == 552, "RecompileResult changed: update EncodeResult and DecodeResult");
      |               ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/tmp/anyps5-pr12664-review/core/shader/recompiler/ShaderDiskCache.cpp:90:39: note: the comparison reduces to ‘(560 == 552)’
ninja: build stopped: subcommand failed.

Negative control

Not run. The build stops at the new Linux structure-size assertions before the focused test binaries can be built.

Findings

Blocking

  1. Linux build fails on the new artifact field. The PR adds shaderImageMinLod to both CompiledShaderArtifact and SpirvTarget, and updates the artifact encoder, but the Linux-only size assertions remain at 288 and 552 bytes. GCC reports actual sizes of 296 and 560. Update the assertions/encoding contract as appropriate and rerun the build.

  2. Explicit LOD is clamped before sampler bias. At EmitSampleOp, the explicit Lod operand is replaced with FMax(lod, clamp); Vulkan then adds sampler.mipLodBias to that operand before applying the LOD bounds. For example, explicit LOD 2, T# MIN_LOD 2, and S# bias -1 produce an effective LOD of 1, below the requested clamp. The guest sampler path accepts negative bias. Preserve the clamp after bias, or reject this combination, and add an explicit-LOD regression case with negative bias.

  3. T# MIN_LOD above S# MAX_LOD yields undefined shader-operand behavior. Vulkan sets lodmin = max(sampler.minLod, shaderOp.minLod), lodmax = sampler.maxLod, and declares the result undefined when lodmin > lodmax. The current shader path emits the T# clamp as shaderOp.minLod without checking the paired sampler’s maximum. The PR’s debt note acknowledges this case, but the runtime currently accepts it. Preserve the view-clamp result or reject the incompatible pair; include the no-mip-filter / maxLOD 0 case.

  4. Emulated sample paths bypass this clamp. EmitSampleOp returns to EmitEmulatedSample for emulated depth comparison and converted 11:11:10 samples before reaching the descriptor-clamp logic. That implementation fetches mip 0 for its texels. Apply the T# clamp to these emulated sample paths or reject the combination explicitly, with focused tests.

  5. The new serializer version collides with three other open PRs. This change moves request serialization from version 49 to 50, as do open #10547 (head 2b1908e3621c0e7a6e62b7f8729cda06d6c5de87), #11483 (head b81b8a12ff1e0b0ccaae3c7e11baebaac54b5e18), and #10846 (head d21510c5d279c8dd35392fa88b453c1e6b180eac), each for a different trailing field. Coordinate a merge order, declare the dependency required by the repository rules, and assign this field a unique version after rebasing onto the resulting main.

Non-blocking

  • The focused GPU tests and the no-extension path could not be exercised locally because compilation stopped at the assertions. The hosted macOS and Windows full-build checks were still pending at the time checked.

Sources

Not verified

  • PS5 hardware behavior.
  • The reported Apple M5 Pro/MoltenVK title run.
  • Full Linux or Windows product tests, focused Vulkan tests, and the pending hosted jobs.
  • Exact console output for the unsupported sampler/image combinations above.

To get this to a good state

  • Fix the size-assertion build failure and rerun the focused build/tests.
  • Preserve or explicitly reject explicit-LOD-plus-negative-bias and T# MIN_LOD-above-S# MAX_LOD combinations.
  • Cover emulated compare and converted sampling.
  • Coordinate and declare the serializer version order, then rebase and rerun checks on the new head.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5691735431 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5691735431). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T01:19:21Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The current head does not build in the Linux Release configuration, and the fallback clamp still differs from Vulkan’s defined LOD behavior in several reachable sampling cases. ## What I ran - Linux GCC 12.2 Release build of `agc_driver_image_sample_lod_clamp_tests`, `agc_shader_memory_tests`, and `agc_driver_graphics_tests`. - `python3 tools/check_conventions.py --base upstream/main --head HEAD`. - `git diff --check upstream/main...HEAD`. - `git merge-tree --write-tree upstream/main HEAD`. - Refreshed the hosted checks and inspected the exact current diff at `9d42922fc0d218f0bf7581e2d2a8a1955a75e730`. ## Results | Check | Result | |---|---| | Linux Release build | Failed compiling `ShaderDiskCache.cpp`; diagnostics below | | Conventions | Passed | | Diff whitespace | Passed | | Merge preview against current `main` | Clean; tree `e1e7de7a2f442c0e40b52c674e5f71f8ab8eb416` | | Hosted checks at review time | Windows build and two macOS relinker jobs pending; Linux product, register-context, and write-watch jobs skipped. Ubuntu/Windows relinker, relinker ASAN, conventions, eligibility, intake, labels, and report passed. | <details> <summary>Raw compiler diagnostic excerpt</summary> ```text FAILED: core/libs/prx/libSceAgcDriver/CMakeFiles/shader_recompiler_agc_driver.dir/__/__/__/shader/recompiler/ShaderDiskCache.cpp.o /tmp/anyps5-pr12664-review/core/shader/recompiler/ShaderDiskCache.cpp:88:46: error: static assertion failed: CompiledShaderArtifact changed: update the artifact encoder 88 | static_assert(sizeof(CompiledShaderArtifact) == 288, "CompiledShaderArtifact changed: update the artifact encoder"); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ /tmp/anyps5-pr12664-review/core/shader/recompiler/ShaderDiskCache.cpp:88:46: note: the comparison reduces to ‘(296 == 288)’ /tmp/anyps5-pr12664-review/core/shader/recompiler/ShaderDiskCache.cpp:90:39: error: static assertion failed: RecompileResult changed: update EncodeResult and DecodeResult 90 | static_assert(sizeof(RecompileResult) == 552, "RecompileResult changed: update EncodeResult and DecodeResult"); | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ /tmp/anyps5-pr12664-review/core/shader/recompiler/ShaderDiskCache.cpp:90:39: note: the comparison reduces to ‘(560 == 552)’ ninja: build stopped: subcommand failed. ``` </details> ## Negative control Not run. The build stops at the new Linux structure-size assertions before the focused test binaries can be built. ## Findings ### Blocking 1. **Linux build fails on the new artifact field.** The PR adds `shaderImageMinLod` to both `CompiledShaderArtifact` and `SpirvTarget`, and updates the artifact encoder, but the Linux-only size assertions remain at 288 and 552 bytes. GCC reports actual sizes of 296 and 560. Update the assertions/encoding contract as appropriate and rerun the build. 2. **Explicit LOD is clamped before sampler bias.** At `EmitSampleOp`, the explicit Lod operand is replaced with `FMax(lod, clamp)`; Vulkan then adds `sampler.mipLodBias` to that operand before applying the LOD bounds. For example, explicit LOD 2, T# MIN_LOD 2, and S# bias -1 produce an effective LOD of 1, below the requested clamp. The guest sampler path accepts negative bias. Preserve the clamp after bias, or reject this combination, and add an explicit-LOD regression case with negative bias. 3. **T# MIN_LOD above S# MAX_LOD yields undefined shader-operand behavior.** Vulkan sets `lodmin = max(sampler.minLod, shaderOp.minLod)`, `lodmax = sampler.maxLod`, and declares the result undefined when `lodmin > lodmax`. The current shader path emits the T# clamp as `shaderOp.minLod` without checking the paired sampler’s maximum. The PR’s debt note acknowledges this case, but the runtime currently accepts it. Preserve the view-clamp result or reject the incompatible pair; include the no-mip-filter / maxLOD 0 case. 4. **Emulated sample paths bypass this clamp.** `EmitSampleOp` returns to `EmitEmulatedSample` for emulated depth comparison and converted 11:11:10 samples before reaching the descriptor-clamp logic. That implementation fetches mip 0 for its texels. Apply the T# clamp to these emulated sample paths or reject the combination explicitly, with focused tests. 5. **The new serializer version collides with three other open PRs.** This change moves request serialization from version 49 to 50, as do open #10547 (head `2b1908e3621c0e7a6e62b7f8729cda06d6c5de87`), #11483 (head `b81b8a12ff1e0b0ccaae3c7e11baebaac54b5e18`), and #10846 (head `d21510c5d279c8dd35392fa88b453c1e6b180eac`), each for a different trailing field. Coordinate a merge order, declare the dependency required by the repository rules, and assign this field a unique version after rebasing onto the resulting `main`. ### Non-blocking - The focused GPU tests and the no-extension path could not be exercised locally because compilation stopped at the assertions. The hosted macOS and Windows full-build checks were still pending at the time checked. ## Sources - PR head `9d42922fc0d218f0bf7581e2d2a8a1955a75e730`: [explicit LOD handling and descriptor clamp](https://github.com/boykopovar/AnyPS5/blob/9d42922fc0d218f0bf7581e2d2a8a1955a75e730/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp#L1553-L1615), [emulated sample dispatch](https://github.com/boykopovar/AnyPS5/blob/9d42922fc0d218f0bf7581e2d2a8a1955a75e730/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp#L1393-L1395), [mip-0 fetches](https://github.com/boykopovar/AnyPS5/blob/9d42922fc0d218f0bf7581e2d2a8a1955a75e730/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp#L1464-L1474), [Linux size assertions](https://github.com/boykopovar/AnyPS5/blob/9d42922fc0d218f0bf7581e2d2a8a1955a75e730/core/shader/recompiler/ShaderDiskCache.cpp#L87-L91), and [request serializer version bump](https://github.com/boykopovar/AnyPS5/blob/9d42922fc0d218f0bf7581e2d2a8a1955a75e730/core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp#L860-L907). - [Vulkan 1.4.351 LOD operation](https://registry.khronos.org/vulkan/specs/1.4-extensions/pdf/vkspec.pdf) defines sampler bias, shader MinLod, and the undefined `lodmin > lodmax` case. - [Open #10547](https://github.com/boykopovar/AnyPS5/pull/10547), [#11483](https://github.com/boykopovar/AnyPS5/pull/11483), and [#10846](https://github.com/boykopovar/AnyPS5/pull/10846) each currently allocate serializer version 50. ## Not verified - PS5 hardware behavior. - The reported Apple M5 Pro/MoltenVK title run. - Full Linux or Windows product tests, focused Vulkan tests, and the pending hosted jobs. - Exact console output for the unsupported sampler/image combinations above. ## To get this to a good state - Fix the size-assertion build failure and rerun the focused build/tests. - Preserve or explicitly reject explicit-LOD-plus-negative-bias and T# MIN_LOD-above-S# MAX_LOD combinations. - Cover emulated compare and converted sampling. - Coordinate and declare the serializer version order, then rebase and rerun checks on the new head.
MarcZX10 commented 2026-10-29 02:57:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T02:57:49Z.

Review: APPROVED


Reviewed — approved

The current head resolves the blocking build and LOD-semantics findings from my previous review. I approve commit 279911dd95b25dc56cff05e7708ed103bf556446.

What I ran

  • Configured a Linux Release build with GCC 12.2 and BUILD_TESTING=ON.
  • Built agc_driver_image_sample_lod_clamp_tests and its dependencies.
  • Built and ran the request serializer test.
  • Ran the shader-clamp and image-view CTest entries.
  • Ran python3 tools/check_conventions.py --base upstream/main --head HEAD, git diff --check upstream/main...HEAD, and a merge preview against current upstream/main.
  • Refreshed hosted checks and inspected the current diff at the exact head above.

Results

Check Result
Linux Release focused build Passed; target linked successfully
request_serializer Passed
Conventions Passed
Diff whitespace Passed
Merge preview Clean; tree f299f5db8359900a0bbb67fe4d50ced8dd9e7b43
agc_driver_image_sample_lod_clamp_shader_lane Could not run: host CPU is below the project's minimum
agc_driver_image_sample_lod_clamp Could not run: same CPU limitation
Hosted checks Windows, Ubuntu/Windows relinker, ASan, conventions, eligibility, labels, and report pass; Linux product and specialized jobs skip; two macOS relinker jobs remain pending

The local GPU test runner stopped before opening Vulkan:

The host CPU (Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz) lacks LZCNT, BMI1, BMI2, MOVBE, AVX2, FMA. The PS5's Zen 2 CPU has these extensions and titles run their instructions natively, so this CPU cannot run them.

The author reports that the shader lane and title scenario pass on an Apple M5 Pro with MoltenVK 1.4.2. I did not independently reproduce those GPU/title results.

Negative control

Control Result
Local mutation test Not run; this host cannot execute the project test binary
Author-reported shader mutations The PR comment reports that clamp truncation and dropping the MAX_LOD validation fail the focused test; not independently reproduced

Findings

Blocking

None found at this head.

The earlier Linux size-assertion failure is fixed; the focused target now builds. The descriptor binding path rejects sampler combinations where shader MinLod would differ from the view clamp, and the tests now include explicit LOD/bias, fractional clamps, cache re-specialization, and the unsupported MAX_LOD/no-mip-filter cases.

Non-blocking

  • Request serialization is version 50, which is also used by other open PRs. Current main remains at 49, so this head is valid against the current base; if another version-50 change lands first, rebase and advance the version before merging this one.
  • I could not execute either Vulkan test locally because the available CPU lacks the required instruction set. The author-reported M5 Pro shader-lane and title tests provide the hardware evidence for this path.

Sources

All code links point to the reviewed commit 279911dd95b25dc56cff05e7708ed103bf556446.

Not verified

  • Local Vulkan execution of either lane.
  • macOS relinker jobs still pending at check refresh.
  • PS5 hardware behavior; the reported title run was performed by the author.

To get to a good state

The current implementation is in good state for review. Reassign the serializer version if another version-50 change reaches main before this PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692326724 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5692326724). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T02:57:49Z. **Review:** APPROVED --- # Reviewed — approved The current head resolves the blocking build and LOD-semantics findings from my previous review. I approve commit `279911dd95b25dc56cff05e7708ed103bf556446`. ## What I ran - Configured a Linux Release build with GCC 12.2 and `BUILD_TESTING=ON`. - Built `agc_driver_image_sample_lod_clamp_tests` and its dependencies. - Built and ran the request serializer test. - Ran the shader-clamp and image-view CTest entries. - Ran `python3 tools/check_conventions.py --base upstream/main --head HEAD`, `git diff --check upstream/main...HEAD`, and a merge preview against current `upstream/main`. - Refreshed hosted checks and inspected the current diff at the exact head above. ## Results | Check | Result | |---|---| | Linux Release focused build | Passed; target linked successfully | | `request_serializer` | Passed | | Conventions | Passed | | Diff whitespace | Passed | | Merge preview | Clean; tree `f299f5db8359900a0bbb67fe4d50ced8dd9e7b43` | | `agc_driver_image_sample_lod_clamp_shader_lane` | Could not run: host CPU is below the project's minimum | | `agc_driver_image_sample_lod_clamp` | Could not run: same CPU limitation | | Hosted checks | Windows, Ubuntu/Windows relinker, ASan, conventions, eligibility, labels, and report pass; Linux product and specialized jobs skip; two macOS relinker jobs remain pending | The local GPU test runner stopped before opening Vulkan: ```text The host CPU (Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz) lacks LZCNT, BMI1, BMI2, MOVBE, AVX2, FMA. The PS5's Zen 2 CPU has these extensions and titles run their instructions natively, so this CPU cannot run them. ``` The author reports that the shader lane and title scenario pass on an Apple M5 Pro with MoltenVK 1.4.2. I did not independently reproduce those GPU/title results. ## Negative control | Control | Result | |---|---| | Local mutation test | Not run; this host cannot execute the project test binary | | Author-reported shader mutations | The PR comment reports that clamp truncation and dropping the MAX_LOD validation fail the focused test; not independently reproduced | ## Findings ### Blocking None found at this head. The earlier Linux size-assertion failure is fixed; the focused target now builds. The descriptor binding path rejects sampler combinations where shader MinLod would differ from the view clamp, and the tests now include explicit LOD/bias, fractional clamps, cache re-specialization, and the unsupported MAX_LOD/no-mip-filter cases. ### Non-blocking - Request serialization is version 50, which is also used by other open PRs. Current `main` remains at 49, so this head is valid against the current base; if another version-50 change lands first, rebase and advance the version before merging this one. - I could not execute either Vulkan test locally because the available CPU lacks the required instruction set. The author-reported M5 Pro shader-lane and title tests provide the hardware evidence for this path. ## Sources All code links point to the reviewed commit `279911dd95b25dc56cff05e7708ed103bf556446`. - [Sampler/image compatibility validation](https://github.com/boykopovar/AnyPS5/blob/279911dd95b25dc56cff05e7708ed103bf556446/core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp#L182-L196) - [Per-image clamp specialization](https://github.com/boykopovar/AnyPS5/blob/279911dd95b25dc56cff05e7708ed103bf556446/core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp#L381-L389) - [SPIR-V clamp emission](https://github.com/boykopovar/AnyPS5/blob/279911dd95b25dc56cff05e7708ed103bf556446/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp#L1591-L1617) - [Shader-lane and regression cases](https://github.com/boykopovar/AnyPS5/blob/279911dd95b25dc56cff05e7708ed103bf556446/core/libs/prx/libSceAgcDriver/tests/execution/ImageSampleLodClamp.cpp#L263-L288) - [Request serializer version and field handling](https://github.com/boykopovar/AnyPS5/blob/279911dd95b25dc56cff05e7708ed103bf556446/core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp#L860-L907), [deserialization](https://github.com/boykopovar/AnyPS5/blob/279911dd95b25dc56cff05e7708ed103bf556446/core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp#L910-L976) - [Vulkan LOD operation and image-level selection](https://github.com/KhronosGroup/Vulkan-Docs/blob/a8b088a3fae12c8575407ea90c7c09bd653db923/chapters/textures.adoc#L1684-L1762) ## Not verified - Local Vulkan execution of either lane. - macOS relinker jobs still pending at check refresh. - PS5 hardware behavior; the reported title run was performed by the author. ## To get to a good state The current implementation is in good state for review. Reassign the serializer version if another version-50 change reaches `main` before this PR.
XairRrR commented 2026-10-29 03:17:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T03:17:17Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The shader-clamp lane works on an NVIDIA RTX 4070 Ti SUPER, but one new test case asks for a rounding that Vulkan leaves to the implementation. Because of it, both agc_driver_image_sample_lod_clamp and the new agc_driver_image_sample_lod_clamp_shader_lane fail on this GPU, and the first one passes on main.

What I ran

  • Head: a8f8087cb5789322d750562faa66f6ba944d4b87
  • main: 3a2b91981651569163768854a1fcdc7193b6667b
  • Merge of head into main: clean (ab662524130a8d8f1aa9dd85e0ac43238aaf9203)
  • Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release, Ninja. These are the first runs on NVIDIA hardware posted in this thread. Earlier reviewers could not run the Vulkan tests, and the author ran them on an Apple M5 Pro.
git diff --check origin/main...pr-head
python3 tools/check_conventions.py --base origin/main
cmake --build build -j10
ctest --test-dir build -j4 --output-on-failure -R '^(request_serializer|agc_shader_memory|agc_shader_disk_cache|agc_driver_graphics)$'
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R agc_driver_image_sample_lod_clamp      # merged tree, then main
# diagnosis: same ctest with the bias of the second Case{0x100u, 1u, 0xfffu, 1u, -128} (ImageSampleLodClamp.cpp:283) set to -96
# negative control: SpirvImageEmitter.cpp from origin/main, test as in the diagnosis run

Results

Check Result
Merge with main Clean
git diff --check Clean
check_conventions.py All conventions checks passed.
Full build (merged tree) Passed
request_serializer, agc_shader_memory, agc_shader_disk_cache, agc_driver_graphics 4/4 passed
agc_driver_image_sample_lod_clamp on main Passed (0.39 s)
agc_driver_image_sample_lod_clamp on the merged tree (image-view lane) Failed
agc_driver_image_sample_lod_clamp_shader_lane on the merged tree Failed
Both entries, with bias -96 in place of -128 on line 283 Both passed (0.52 s and 0.39 s); the shader lane printed passed in the shader-clamp lane
Validation layer Loaded in every run (Insert instance layer "VK_LAYER_KHRONOS_validation"). No was not found but was requested by env var VK_INSTANCE_LAYERS. No VUID- lines on main or on the merged tree
Merged tree, both entries fail on the same case
863: AGC graphics: image_sample_cl with T# MIN_LOD 256 over BASE_LEVEL 1 with S# MAX_LOD 4095, mip filter 1 and LOD bias -128: thread 3 component 0 is 2.000000, expected 1
1/2 Test  #863: agc_driver_image_sample_lod_clamp_shader_lane ...***Failed    0.84 sec
1181: AGC graphics: image_sample_cl with T# MIN_LOD 256 over BASE_LEVEL 1 with S# MAX_LOD 4095, mip filter 1 and LOD bias -128: thread 3 component 0 is 2.000000, expected 1
2/2 Test #1181: agc_driver_image_sample_lod_clamp ...............***Failed    0.59 sec
main, same machine
1180: image sample LOD clamp tests passed
1/1 Test #1180: agc_driver_image_sample_lod_clamp ...   Passed    0.39 sec

Negative control

On the merged tree, with the tie-free test from the diagnosis run, I restored core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp from origin/main and rebuilt.

  • Both entries fail at the prepared-SPIR-V control: a target with the shader clamp does not declare exactly the image's minimum LOD specialization constant.
  • With that control call also skipped, the shader lane still fails on the sampled levels: image_sample_d_cl with T# MIN_LOD 512 over BASE_LEVEL 0 ... thread 0 component 0 is 0.000000, expected 2. The image-view lane passes, as it should.

The test therefore catches a missing shader clamp at run time. I restored every file afterwards.

Findings

Blocking

  1. The new bias case lands exactly on a mip rounding tie, so the test fails on NVIDIA in both lanes. At core/libs/prx/libSceAgcDriver/tests/execution/ImageSampleLodClamp.cpp:283, Case{0x100u, 1u, 0xfffu, 1u, -128} runs Code. Its image_sample_cl and image_sample_l results use integer LODs and integer clamps, and the S# bias is -128/256 = -0.5. Every λ is therefore a half-integer. For thread 3, the explicit LOD is 0, the instruction clamp is 1 and the view clamp is 0, so λ = max(0, 1) − 0.5 = 0.5. Level() (line 98) uses ceil(λ + 0.5) − 1 and expects relative level 0. The Vulkan spec allows ⌈d′ + 0.5⌉ − 1 (preferred) or ⌊d′ + 0.5⌋ (alternative) for VK_SAMPLER_MIPMAP_MODE_NEAREST (Image Level(s) Selection in chapters/textures.adoc). The RTX 4070 Ti SUPER takes the alternative and returns level 1 (absolute 2). This breaks agc_driver_image_sample_lod_clamp, which passes on main, and the new shader-lane entry. Neither failure comes from the driver code: with -96 in place of -128, both entries pass on this GPU.
    Fix: use a bias that keeps λ off .5 for every integer LOD and clamp, such as -96 (verified here) or -64. Alternatively, accept either level when λ is within a small epsilon of a half-integer. The fractional MIN_LOD cases look tie-free, but check them for the same pattern.

Non-blocking

  1. Serialization version 50 also appears in other open PRs. @oneandonlydean and @MarcZX10 already raised this; I have nothing to add.
  2. I checked the parts of the code that stand out, and they look correct:
    • The plan cache key in preparedBindingPlan (Recompiler.cpp) already includes the T# MIN_LOD bits (dwords[1] & ~0xff) and every S# word, so a cached plan cannot reuse a stale clamp.
    • Each compile gets its own variantId, so both target settings can share one process.
    • The filter-mismatch check compares only bit 0 of each filter field, which matches toVkFilter (aniso point is NEAREST, aniso bilinear is LINEAR).
    • shaderImageMinLod is computed after both imageViewMinLod and graphicsPipelineLibrary are final.

Not verified

  • MoltenVK, macOS and the PPSA21564 title results (the title was not launched, as the review rules require).
  • A device that lacks VK_EXT_image_view_min_lod natively. I reached the shader lane only through APS5_NO_IMAGE_VIEW_MIN_LOD=1 and APS5_NO_GPL=1.
  • Graphics-pipeline paths with the shader clamp (only the compute test exercises them), Windows, and lavapipe. Lavapipe may hit the same tie depending on its rounding.

To get this to a good state

  • Move the bias case on line 283 off the rounding tie (for example, -96), or make the expected level tolerant at exact half-integers. Then confirm that both agc_driver_image_sample_lod_clamp entries pass on a non-Apple GPU.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692439566 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5692439566). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T03:17:17Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The shader-clamp lane works on an NVIDIA RTX 4070 Ti SUPER, but one new test case asks for a rounding that Vulkan leaves to the implementation. Because of it, both `agc_driver_image_sample_lod_clamp` and the new `agc_driver_image_sample_lod_clamp_shader_lane` fail on this GPU, and the first one passes on `main`. ## What I ran - Head: `a8f8087cb5789322d750562faa66f6ba944d4b87` - `main`: `3a2b91981651569163768854a1fcdc7193b6667b` - Merge of head into `main`: clean (`ab662524130a8d8f1aa9dd85e0ac43238aaf9203`) - Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release, Ninja. These are the first runs on NVIDIA hardware posted in this thread. Earlier reviewers could not run the Vulkan tests, and the author ran them on an Apple M5 Pro. ```sh git diff --check origin/main...pr-head python3 tools/check_conventions.py --base origin/main cmake --build build -j10 ctest --test-dir build -j4 --output-on-failure -R '^(request_serializer|agc_shader_memory|agc_shader_disk_cache|agc_driver_graphics)$' VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R agc_driver_image_sample_lod_clamp # merged tree, then main # diagnosis: same ctest with the bias of the second Case{0x100u, 1u, 0xfffu, 1u, -128} (ImageSampleLodClamp.cpp:283) set to -96 # negative control: SpirvImageEmitter.cpp from origin/main, test as in the diagnosis run ``` ## Results | Check | Result | |---|---| | Merge with `main` | Clean | | `git diff --check` | Clean | | `check_conventions.py` | `All conventions checks passed.` | | Full build (merged tree) | Passed | | `request_serializer`, `agc_shader_memory`, `agc_shader_disk_cache`, `agc_driver_graphics` | 4/4 passed | | `agc_driver_image_sample_lod_clamp` on `main` | Passed (0.39 s) | | `agc_driver_image_sample_lod_clamp` on the merged tree (image-view lane) | **Failed** | | `agc_driver_image_sample_lod_clamp_shader_lane` on the merged tree | **Failed** | | Both entries, with bias -96 in place of -128 on line 283 | Both passed (0.52 s and 0.39 s); the shader lane printed `passed in the shader-clamp lane` | | Validation layer | Loaded in every run (`Insert instance layer "VK_LAYER_KHRONOS_validation"`). No `was not found but was requested by env var VK_INSTANCE_LAYERS`. No `VUID-` lines on `main` or on the merged tree | <details> <summary>Merged tree, both entries fail on the same case</summary> ```text 863: AGC graphics: image_sample_cl with T# MIN_LOD 256 over BASE_LEVEL 1 with S# MAX_LOD 4095, mip filter 1 and LOD bias -128: thread 3 component 0 is 2.000000, expected 1 1/2 Test #863: agc_driver_image_sample_lod_clamp_shader_lane ...***Failed 0.84 sec 1181: AGC graphics: image_sample_cl with T# MIN_LOD 256 over BASE_LEVEL 1 with S# MAX_LOD 4095, mip filter 1 and LOD bias -128: thread 3 component 0 is 2.000000, expected 1 2/2 Test #1181: agc_driver_image_sample_lod_clamp ...............***Failed 0.59 sec ``` </details> <details> <summary>main, same machine</summary> ```text 1180: image sample LOD clamp tests passed 1/1 Test #1180: agc_driver_image_sample_lod_clamp ... Passed 0.39 sec ``` </details> ## Negative control On the merged tree, with the tie-free test from the diagnosis run, I restored `core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp` from `origin/main` and rebuilt. - Both entries fail at the prepared-SPIR-V control: `a target with the shader clamp does not declare exactly the image's minimum LOD specialization constant`. - With that control call also skipped, the shader lane still fails on the sampled levels: `image_sample_d_cl with T# MIN_LOD 512 over BASE_LEVEL 0 ... thread 0 component 0 is 0.000000, expected 2`. The image-view lane passes, as it should. The test therefore catches a missing shader clamp at run time. I restored every file afterwards. ## Findings ### Blocking 1. **The new bias case lands exactly on a mip rounding tie, so the test fails on NVIDIA in both lanes.** At `core/libs/prx/libSceAgcDriver/tests/execution/ImageSampleLodClamp.cpp:283`, `Case{0x100u, 1u, 0xfffu, 1u, -128}` runs `Code`. Its `image_sample_cl` and `image_sample_l` results use integer LODs and integer clamps, and the S# bias is -128/256 = -0.5. Every λ is therefore a half-integer. For thread 3, the explicit LOD is 0, the instruction clamp is 1 and the view clamp is 0, so λ = max(0, 1) − 0.5 = 0.5. `Level()` (line 98) uses `ceil(λ + 0.5) − 1` and expects relative level 0. The Vulkan spec allows `⌈d′ + 0.5⌉ − 1` (preferred) or `⌊d′ + 0.5⌋` (alternative) for `VK_SAMPLER_MIPMAP_MODE_NEAREST` (Image Level(s) Selection in `chapters/textures.adoc`). The RTX 4070 Ti SUPER takes the alternative and returns level 1 (absolute 2). This breaks `agc_driver_image_sample_lod_clamp`, which passes on `main`, and the new shader-lane entry. Neither failure comes from the driver code: with -96 in place of -128, both entries pass on this GPU. **Fix:** use a bias that keeps λ off .5 for every integer LOD and clamp, such as -96 (verified here) or -64. Alternatively, accept either level when λ is within a small epsilon of a half-integer. The fractional MIN_LOD cases look tie-free, but check them for the same pattern. ### Non-blocking 1. Serialization version 50 also appears in other open PRs. @oneandonlydean and @MarcZX10 already raised this; I have nothing to add. 2. I checked the parts of the code that stand out, and they look correct: - The plan cache key in `preparedBindingPlan` (`Recompiler.cpp`) already includes the T# MIN_LOD bits (`dwords[1] & ~0xff`) and every S# word, so a cached plan cannot reuse a stale clamp. - Each compile gets its own `variantId`, so both target settings can share one process. - The filter-mismatch check compares only bit 0 of each filter field, which matches `toVkFilter` (aniso point is NEAREST, aniso bilinear is LINEAR). - `shaderImageMinLod` is computed after both `imageViewMinLod` and `graphicsPipelineLibrary` are final. ## Not verified - MoltenVK, macOS and the PPSA21564 title results (the title was not launched, as the review rules require). - A device that lacks `VK_EXT_image_view_min_lod` natively. I reached the shader lane only through `APS5_NO_IMAGE_VIEW_MIN_LOD=1` and `APS5_NO_GPL=1`. - Graphics-pipeline paths with the shader clamp (only the compute test exercises them), Windows, and lavapipe. Lavapipe may hit the same tie depending on its rounding. ## To get this to a good state - Move the bias case on line 283 off the rounding tie (for example, -96), or make the expected level tolerant at exact half-integers. Then confirm that both `agc_driver_image_sample_lod_clamp` entries pass on a non-Apple GPU.
XairRrR commented 2026-10-29 03:34:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T03:34:16Z.

Review: APPROVED


Re-checked — approved

a2ece0bdac moves the Code bias case off the nearest-mip rounding tie and makes Level() reject any expected LOD that sits on a tie. Both agc_driver_image_sample_lod_clamp entries now pass on an NVIDIA RTX 4070 Ti SUPER, with no validation errors.

What changed since my last review

  • One new commit, a2ece0bdac ("test(agc): keep the LOD clamp test off nearest-mip rounding ties"). It changes only core/libs/prx/libSceAgcDriver/tests/execution/ImageSampleLodClamp.cpp (+11/−3):
    • The second Code bias case is now Case{0x100u, 1u, 0xfffu, 1u, -96} instead of -128.
    • Level() now Requires that the expected LOD lies more than 1/512 from a half-integer.
    • Check() computes the expected level only for the results a case reads, so the gradient-only runs (one result) keep their -128 bias.
  • Author reply: they agree with the finding and report that the shader lane passes on MoltenVK. They did not re-run NVIDIA or the image-view lane, so I re-ran those here.
  • No production code, build file or description change. main moved to 3f23b35cce in the meantime, and that range touches SpirvImageEmitter.cpp and docs/dev/debt/shader.md. The merge is still clean.

What I ran

  • Head: a2ece0bdac63d6e5b89af7c4bd3f0bfa32b9fb0b
  • main: 3f23b35cce4029d1ef08cf6b69091d96b87fe462
  • Merge of head into main: clean (7757d04229833176b4631d01f6cf239e3519e067). A merge preview against the newer main b433c40f2f, which landed during the run, is also clean.
  • Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release, Ninja.
git diff --check origin/main...pr-head
python3 tools/check_conventions.py --base 3f23b35cce
cmake --build build -j10
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R agc_driver_image_sample_lod_clamp
ctest --test-dir build -j4 --output-on-failure -R '^(request_serializer|agc_shader_memory|agc_shader_disk_cache|agc_driver_graphics)$'
# negative control 1: SpirvImageEmitter.cpp from main, rebuild the test target, rerun both entries
# negative control 2: PR code, but the Code bias case set back to -128, rebuild, rerun both entries
git merge-tree --write-tree b433c40f2f pr-head
Check Result
Merge with main Clean
git diff --check Clean
check_conventions.py All conventions checks passed.
Full build (merged tree) Passed
agc_driver_image_sample_lod_clamp (image-view lane) Passed (0.39 s), image sample LOD clamp tests passed in the image-view lane
agc_driver_image_sample_lod_clamp_shader_lane Passed (0.53 s), image sample LOD clamp tests passed in the shader-clamp lane
Validation layer Insert instance layer "VK_LAYER_KHRONOS_validation" in both runs. No was not found but was requested by env var VK_INSTANCE_LAYERS. 0 VUID- lines
request_serializer, agc_shader_memory, agc_shader_disk_cache, agc_driver_graphics 4/4 passed

I did not rerun main with the validation layer this time. The merged-tree log has no VUID- lines, so the change cannot add any, and my previous review already recorded the main baseline.

Negative control

  1. With SpirvImageEmitter.cpp restored from main (the rest of the PR kept), both entries fail: a target with the shader clamp does not declare exactly the image's minimum LOD specialization constant.
  2. With all PR code in place and only the bias case set back to -128, both entries fail on the new guard before any GPU comparison: image sample LOD clamp: an expected LOD of 0.500000 sits on a nearest-mip rounding tie, which Vulkan leaves to the implementation. The guard therefore catches the case that failed in my last review.

Restoring every production file from main at once does not work as a control: the test no longer compiles, because PipelineSpecialization::MinLodBase and SpirvTarget::shaderImageMinLod are missing. All files were restored afterwards.

Previous findings

  • Blocking 1 (bias case on a rounding tie fails on NVIDIA): Resolved. The case now uses -96. With it, an explicit λ has a fractional part of .625 and the sampled λ .375, both 1/8 from a tie. Both entries pass here, and the new guard rejects the old value (control 2).
  • Non-blocking 1 (serialization version 50 shared with other open PRs): Still open, unchanged. main is still at 49, so it only needs attention at rebase time.
  • Non-blocking 2 (the cache-key, variantId, filter-bit and shaderImageMinLod ordering checks): No longer applies. No production code changed.

New findings

Blocking

None.

Non-blocking

  1. ImageSampleLodClamp.cpp:182: the tie margin of 1/512 is finer than Vulkan's minimum mipmapPrecisionBits of 4. An implementation may snap λ to 1/16 steps before it selects a level, so a future case within 1/32 of a tie could still round either way. Every current case is at least 1/8 away, so nothing fails today. Consider a margin of 1/16 so the guard covers every conformant device.

Not verified

  • MoltenVK and macOS (author-reported pass of the shader lane on a2ece0bdac), Windows and lavapipe.
  • A device without VK_EXT_image_view_min_lod natively. I reached the shader lane only through the _shader_lane entry (APS5_NO_IMAGE_VIEW_MIN_LOD=1, APS5_NO_GPL=1).
  • The PPSA21564 result (the title was not launched, as the review rules require).
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692537066 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5692537066). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T03:34:16Z. **Review:** APPROVED --- # Re-checked — approved `a2ece0bdac` moves the `Code` bias case off the nearest-mip rounding tie and makes `Level()` reject any expected LOD that sits on a tie. Both `agc_driver_image_sample_lod_clamp` entries now pass on an NVIDIA RTX 4070 Ti SUPER, with no validation errors. ## What changed since my last review - One new commit, `a2ece0bdac` ("test(agc): keep the LOD clamp test off nearest-mip rounding ties"). It changes only `core/libs/prx/libSceAgcDriver/tests/execution/ImageSampleLodClamp.cpp` (+11/−3): - The second `Code` bias case is now `Case{0x100u, 1u, 0xfffu, 1u, -96}` instead of `-128`. - `Level()` now `Require`s that the expected LOD lies more than 1/512 from a half-integer. - `Check()` computes the expected level only for the results a case reads, so the gradient-only runs (one result) keep their `-128` bias. - Author reply: they agree with the finding and report that the shader lane passes on MoltenVK. They did not re-run NVIDIA or the image-view lane, so I re-ran those here. - No production code, build file or description change. `main` moved to `3f23b35cce` in the meantime, and that range touches `SpirvImageEmitter.cpp` and `docs/dev/debt/shader.md`. The merge is still clean. ## What I ran - Head: `a2ece0bdac63d6e5b89af7c4bd3f0bfa32b9fb0b` - `main`: `3f23b35cce4029d1ef08cf6b69091d96b87fe462` - Merge of head into `main`: clean (`7757d04229833176b4631d01f6cf239e3519e067`). A merge preview against the newer `main` `b433c40f2f`, which landed during the run, is also clean. - Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release, Ninja. ```sh git diff --check origin/main...pr-head python3 tools/check_conventions.py --base 3f23b35cce cmake --build build -j10 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R agc_driver_image_sample_lod_clamp ctest --test-dir build -j4 --output-on-failure -R '^(request_serializer|agc_shader_memory|agc_shader_disk_cache|agc_driver_graphics)$' # negative control 1: SpirvImageEmitter.cpp from main, rebuild the test target, rerun both entries # negative control 2: PR code, but the Code bias case set back to -128, rebuild, rerun both entries git merge-tree --write-tree b433c40f2f pr-head ``` | Check | Result | |---|---| | Merge with `main` | Clean | | `git diff --check` | Clean | | `check_conventions.py` | `All conventions checks passed.` | | Full build (merged tree) | Passed | | `agc_driver_image_sample_lod_clamp` (image-view lane) | Passed (0.39 s), `image sample LOD clamp tests passed in the image-view lane` | | `agc_driver_image_sample_lod_clamp_shader_lane` | Passed (0.53 s), `image sample LOD clamp tests passed in the shader-clamp lane` | | Validation layer | `Insert instance layer "VK_LAYER_KHRONOS_validation"` in both runs. No `was not found but was requested by env var VK_INSTANCE_LAYERS`. 0 `VUID-` lines | | `request_serializer`, `agc_shader_memory`, `agc_shader_disk_cache`, `agc_driver_graphics` | 4/4 passed | I did not rerun `main` with the validation layer this time. The merged-tree log has no `VUID-` lines, so the change cannot add any, and my previous review already recorded the `main` baseline. ## Negative control 1. With `SpirvImageEmitter.cpp` restored from `main` (the rest of the PR kept), both entries fail: `a target with the shader clamp does not declare exactly the image's minimum LOD specialization constant`. 2. With all PR code in place and only the bias case set back to `-128`, both entries fail on the new guard before any GPU comparison: `image sample LOD clamp: an expected LOD of 0.500000 sits on a nearest-mip rounding tie, which Vulkan leaves to the implementation`. The guard therefore catches the case that failed in my last review. Restoring every production file from `main` at once does not work as a control: the test no longer compiles, because `PipelineSpecialization::MinLodBase` and `SpirvTarget::shaderImageMinLod` are missing. All files were restored afterwards. ## Previous findings - Blocking 1 (bias case on a rounding tie fails on NVIDIA): **Resolved**. The case now uses `-96`. With it, an explicit λ has a fractional part of .625 and the sampled λ .375, both 1/8 from a tie. Both entries pass here, and the new guard rejects the old value (control 2). - Non-blocking 1 (serialization version 50 shared with other open PRs): **Still open**, unchanged. `main` is still at 49, so it only needs attention at rebase time. - Non-blocking 2 (the cache-key, `variantId`, filter-bit and `shaderImageMinLod` ordering checks): **No longer applies**. No production code changed. ## New findings ### Blocking None. ### Non-blocking 1. `ImageSampleLodClamp.cpp:182`: the tie margin of 1/512 is finer than Vulkan's minimum `mipmapPrecisionBits` of 4. An implementation may snap λ to 1/16 steps before it selects a level, so a future case within 1/32 of a tie could still round either way. Every current case is at least 1/8 away, so nothing fails today. Consider a margin of 1/16 so the guard covers every conformant device. ## Not verified - MoltenVK and macOS (author-reported pass of the shader lane on `a2ece0bdac`), Windows and lavapipe. - A device without `VK_EXT_image_view_min_lod` natively. I reached the shader lane only through the `_shader_lane` entry (`APS5_NO_IMAGE_VIEW_MIN_LOD=1`, `APS5_NO_GPL=1`). - The PPSA21564 result (the title was not launched, as the review rules require).
MarcZX10 commented 2026-10-29 05:26:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T05:26:27Z.

Review: APPROVED


Re-checked — approved

The latest change corrects the test inputs that landed on implementation-dependent nearest-mip ties. The production change is unchanged from the implementation I reviewed previously, and the author and an independent reviewer report the adjusted shader-lane test passes on this exact head.

What I ran

  • Reviewed exact head a2ece0bdac63d6e5b89af7c4bd3f0bfa32b9fb0b; the delta since my prior approval is confined to ImageSampleLodClamp.cpp.
  • Ran git merge-tree --write-tree against current main 52c09d567d and git diff --check.
  • Inspected the updated Level() guard, the -96 bias case, and the changed expected-level selection.
  • I did not run the Vulkan test locally.

Results

Check Result
Current-main merge preview Clean
git diff --check Pass
Exact-head test evidence Author and XairRrR report the MoltenVK shader-lane test passes; XairRrR also reports both GPU LOD tests pass on NVIDIA without validation errors
Hosted checks Windows, relinker matrix, ASan, conventions, eligibility, labels, and report pass; macOS x86_64 relinker is pending; Linux, register-context, and write-watch jobs are skipped

Negative control

  • Not run on the latest test-only head. The prior review recorded mutation evidence for the unchanged production path; I am not presenting that as a fresh run.

Findings

No blocking issue found in this exact diff. The test now rejects expected LODs near half-integers, moves the Code case to a bias whose checked LODs are not ties, and computes expected levels only for results the case actually checks.

The console behavior and image-view lane remain unverified as recorded in the PR. The serializer-version coordination with other open PRs also remains a rebase-time integration task.

Sources

Not verified

  • I did not run the Vulkan test locally, validate on console hardware, or run Linux/lavapipe or the image-view lane.
  • The report about NVIDIA validation is from the independent reviewer; I did not reproduce it.

To get this to a good state

No further change is required for the findings in this review. Rebase and resolve the serializer-version coordination if another competing version-50 PR lands first.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693251764 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5693251764). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T05:26:27Z. **Review:** APPROVED --- # Re-checked — approved The latest change corrects the test inputs that landed on implementation-dependent nearest-mip ties. The production change is unchanged from the implementation I reviewed previously, and the author and an independent reviewer report the adjusted shader-lane test passes on this exact head. ## What I ran - Reviewed exact head a2ece0bdac63d6e5b89af7c4bd3f0bfa32b9fb0b; the delta since my prior approval is confined to ImageSampleLodClamp.cpp. - Ran git merge-tree --write-tree against current main 52c09d567d2fa453494dd720fcf53a98149468e4 and git diff --check. - Inspected the updated Level() guard, the -96 bias case, and the changed expected-level selection. - I did not run the Vulkan test locally. ## Results | Check | Result | |---|---| | Current-main merge preview | Clean | | git diff --check | Pass | | Exact-head test evidence | Author and XairRrR report the MoltenVK shader-lane test passes; XairRrR also reports both GPU LOD tests pass on NVIDIA without validation errors | | Hosted checks | Windows, relinker matrix, ASan, conventions, eligibility, labels, and report pass; macOS x86_64 relinker is pending; Linux, register-context, and write-watch jobs are skipped | ## Negative control - Not run on the latest test-only head. The prior review recorded mutation evidence for the unchanged production path; I am not presenting that as a fresh run. ## Findings No blocking issue found in this exact diff. The test now rejects expected LODs near half-integers, moves the Code case to a bias whose checked LODs are not ties, and computes expected levels only for results the case actually checks. The console behavior and image-view lane remain unverified as recorded in the PR. The serializer-version coordination with other open PRs also remains a rebase-time integration task. ## Sources - [PR diff at the approved head](https://github.com/boykopovar/AnyPS5/commit/a2ece0bdac63d6e5b89af7c4bd3f0bfa32b9fb0b) - [Author’s exact-head rerun and explanation](https://github.com/boykopovar/AnyPS5/pull/12662#issuecomment-6487246637) - [Independent NVIDIA LOD test result](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-3401131201) - [Image sample LOD clamp test at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/a2ece0bdac63d6e5b89af7c4bd3f0bfa32b9fb0b/core/libs/prx/libSceAgcDriver/tests/execution/ImageSampleLodClamp.cpp) ## Not verified - I did not run the Vulkan test locally, validate on console hardware, or run Linux/lavapipe or the image-view lane. - The report about NVIDIA validation is from the independent reviewer; I did not reproduce it. ## To get this to a good state No further change is required for the findings in this review. Rebase and resolve the serializer-version coordination if another competing version-50 PR lands first.
MarcZX10 commented 2026-10-29 08:32:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:32:48Z.

Review: CHANGES_REQUESTED


Re-reviewed exact head a2ece0bdac63d6e5b89af7c4bd3f0bfa32b9fb0b after the new integration comment. The reported current-main conflict in core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp reproduces in my merge preview. Please merge current main and retain both test changes. The request-serialization version also needs coordination with the open #10547, #11483, and #10846 work: record the agreed landing order, allocate the next unused version if needed, and update the serializer tests. The earlier shader-lane evidence remains useful, but I cannot keep approval while these integration points are unresolved. I did not run GPU tests locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5694832852 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5694832852). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T08:32:48Z. **Review:** CHANGES_REQUESTED --- Re-reviewed exact head `a2ece0bdac63d6e5b89af7c4bd3f0bfa32b9fb0b` after the new integration comment. The reported current-main conflict in `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` reproduces in my merge preview. Please merge current `main` and retain both test changes. The request-serialization version also needs coordination with the open #10547, #11483, and #10846 work: record the agreed landing order, allocate the next unused version if needed, and update the serializer tests. The earlier shader-lane evidence remains useful, but I cannot keep approval while these integration points are unresolved. I did not run GPU tests locally.
XairRrR commented 2026-10-29 15:48:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T15:48:31Z.

Review: APPROVED


Re-checked — approved

9d6ffe5ed2 merges current main into the branch and resolves the ShaderMemory.cpp conflict without changing any other line of the PR. The merged tree builds, and the LOD clamp lanes and the serializer and shader-memory tests pass on an NVIDIA RTX 4070 Ti SUPER with no validation errors.

What changed since my last review

  • One new commit, the merge 9d6ffe5ed2 of main at bb04a4f1ea. It has no new PR-authored code.
  • I compared the PR's diff against its base before the merge (a2ece0bdac against 3a2b919816) with its diff after the merge (9d6ffe5ed2 against bb04a4f1ea). The only difference is the conflict region in core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp. That region now holds main's color target blend checks (ShaderMemory.cpp:6688-6696), followed by the PR's existing edit to the version 43 fixture line (ShaderMemory.cpp:6697). This confirms the author's statement that nothing else changed.
  • Author reply: the serialization version stays at 50 for now. If #10547, #11483 or #10846 lands first, they will move to the next free number. All three are still open, and main still writes 49.
  • No change to the description or checklist.

What I ran

  • Head: 9d6ffe5ed273dec63d7ae5fceaea4f52fb747eb6
  • main: bb04a4f1ea0175e9e4f149f0359a764d62ff3296 (the merge base, so the head already contains main)
  • Merge of head into main: clean (a48d686bf5d47c199af6789f0467134a5fb8bd55, same tree as the head)
  • Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release, Ninja.
git diff --check origin/main...pr-head
python3 tools/check_conventions.py --base origin/main
cmake --build build -j10
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R agc_driver_image_sample_lod_clamp
ctest --test-dir build -j4 --output-on-failure -R '^(request_serializer|agc_shader_memory|agc_shader_disk_cache|agc_driver_graphics)$'
ctest --test-dir build -j4 --output-on-failure -R '<the 18 other CTest entries that run agc_shader_memory_tests>'
# negative control: RequestSerializer.cpp from main, rebuild agc_shader_memory_tests, rerun agc_shader_memory, restore

Results

Check Result
Merge with main Clean
git diff --check Clean
check_conventions.py All conventions checks passed.
Full build (merged tree) Passed
agc_driver_image_sample_lod_clamp (image-view lane) Passed (0.45 s)
agc_driver_image_sample_lod_clamp_shader_lane Passed (0.65 s)
Validation layer Insert instance layer "VK_LAYER_KHRONOS_validation" in both runs. No was not found but was requested by env var VK_INSTANCE_LAYERS. 0 VUID- lines
request_serializer, agc_shader_memory, agc_shader_disk_cache, agc_driver_graphics 4/4 passed
Other agc_shader_memory_tests entries (agc_shader_bindless, agc_shader_selected_records_*, agc_shader_result_memo_budget*, agc_shader_layout_pair*, …) 18/18 passed
LOD clamp run excerpt
875: [src/VulkanDevice.cpp:1290 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 4070 Ti SUPER vendor=0x10de device=0x2705 subgroup=32
875: image sample LOD clamp tests passed in the shader-clamp lane
1/2 Test  #875: agc_driver_image_sample_lod_clamp_shader_lane ...   Passed    0.65 sec
1196: image sample LOD clamp tests passed in the image-view lane
2/2 Test #1196: agc_driver_image_sample_lod_clamp ...............   Passed    0.45 sec
100% tests passed out of 2

I did not rerun main with the validation layer. The merged-tree log has no VUID- lines, so the change cannot add any, and my first review recorded the main baseline.

Negative control

The merge only touched the serialization checks in ShaderMemory.cpp, so I tested them. With core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp restored from main and the rest of the merged tree kept, agc_shader_memory fails with new requests did not use serialization version 50. After I restored the file, it passes again.

Previous findings

  • Non-blocking, serialization version 50 is also used by #10547, #11483 and #10846: Still open, and the author's plan is fine. All three PRs are still open and main writes 49, so 50 is correct as long as this PR lands first.
  • Non-blocking, the 1/512 tie margin in ImageSampleLodClamp.cpp:182 is finer than the minimum mipmapPrecisionBits of 4: Still open, unchanged and not addressed in the reply. Every current case is at least 1/8 from a tie, so nothing fails today. A 1/16 margin would make the guard hold on any conformant device.
  • oneandonlydean's conflict with main in ShaderMemory.cpp: Resolved. The merge is clean, and both sides' checks are kept and pass.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • MoltenVK and macOS (the author reports passes of request_serializer_tests and the agc_shader_memory_tests entries on this merge), Windows and lavapipe.
  • A device without VK_EXT_image_view_min_lod natively. I reached the shader lane only through the _shader_lane entry.
  • The PPSA21564 result: the review rules do not allow launching a title.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5700700800 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5700700800). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T15:48:31Z. **Review:** APPROVED --- # Re-checked — approved `9d6ffe5ed2` merges current `main` into the branch and resolves the `ShaderMemory.cpp` conflict without changing any other line of the PR. The merged tree builds, and the LOD clamp lanes and the serializer and shader-memory tests pass on an NVIDIA RTX 4070 Ti SUPER with no validation errors. ## What changed since my last review - One new commit, the merge `9d6ffe5ed2` of `main` at `bb04a4f1ea`. It has no new PR-authored code. - I compared the PR's diff against its base before the merge (`a2ece0bdac` against `3a2b919816`) with its diff after the merge (`9d6ffe5ed2` against `bb04a4f1ea`). The only difference is the conflict region in `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp`. That region now holds `main`'s color target blend checks (`ShaderMemory.cpp:6688-6696`), followed by the PR's existing edit to the version 43 fixture line (`ShaderMemory.cpp:6697`). This confirms the author's statement that nothing else changed. - Author reply: the serialization version stays at 50 for now. If #10547, #11483 or #10846 lands first, they will move to the next free number. All three are still open, and `main` still writes 49. - No change to the description or checklist. ## What I ran - Head: `9d6ffe5ed273dec63d7ae5fceaea4f52fb747eb6` - `main`: `bb04a4f1ea0175e9e4f149f0359a764d62ff3296` (the merge base, so the head already contains `main`) - Merge of head into `main`: clean (`a48d686bf5d47c199af6789f0467134a5fb8bd55`, same tree as the head) - Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release, Ninja. ```sh git diff --check origin/main...pr-head python3 tools/check_conventions.py --base origin/main cmake --build build -j10 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R agc_driver_image_sample_lod_clamp ctest --test-dir build -j4 --output-on-failure -R '^(request_serializer|agc_shader_memory|agc_shader_disk_cache|agc_driver_graphics)$' ctest --test-dir build -j4 --output-on-failure -R '<the 18 other CTest entries that run agc_shader_memory_tests>' # negative control: RequestSerializer.cpp from main, rebuild agc_shader_memory_tests, rerun agc_shader_memory, restore ``` ## Results | Check | Result | |---|---| | Merge with `main` | Clean | | `git diff --check` | Clean | | `check_conventions.py` | `All conventions checks passed.` | | Full build (merged tree) | Passed | | `agc_driver_image_sample_lod_clamp` (image-view lane) | Passed (0.45 s) | | `agc_driver_image_sample_lod_clamp_shader_lane` | Passed (0.65 s) | | Validation layer | `Insert instance layer "VK_LAYER_KHRONOS_validation"` in both runs. No `was not found but was requested by env var VK_INSTANCE_LAYERS`. 0 `VUID-` lines | | `request_serializer`, `agc_shader_memory`, `agc_shader_disk_cache`, `agc_driver_graphics` | 4/4 passed | | Other `agc_shader_memory_tests` entries (`agc_shader_bindless`, `agc_shader_selected_records_*`, `agc_shader_result_memo_budget*`, `agc_shader_layout_pair*`, …) | 18/18 passed | <details><summary>LOD clamp run excerpt</summary> ``` 875: [src/VulkanDevice.cpp:1290 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 4070 Ti SUPER vendor=0x10de device=0x2705 subgroup=32 875: image sample LOD clamp tests passed in the shader-clamp lane 1/2 Test #875: agc_driver_image_sample_lod_clamp_shader_lane ... Passed 0.65 sec 1196: image sample LOD clamp tests passed in the image-view lane 2/2 Test #1196: agc_driver_image_sample_lod_clamp ............... Passed 0.45 sec 100% tests passed out of 2 ``` </details> I did not rerun `main` with the validation layer. The merged-tree log has no `VUID-` lines, so the change cannot add any, and my first review recorded the `main` baseline. ## Negative control The merge only touched the serialization checks in `ShaderMemory.cpp`, so I tested them. With `core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp` restored from `main` and the rest of the merged tree kept, `agc_shader_memory` fails with `new requests did not use serialization version 50`. After I restored the file, it passes again. ## Previous findings - Non-blocking, serialization version 50 is also used by #10547, #11483 and #10846: **Still open**, and the author's plan is fine. All three PRs are still open and `main` writes 49, so 50 is correct as long as this PR lands first. - Non-blocking, the 1/512 tie margin in `ImageSampleLodClamp.cpp:182` is finer than the minimum `mipmapPrecisionBits` of 4: **Still open**, unchanged and not addressed in the reply. Every current case is at least 1/8 from a tie, so nothing fails today. A 1/16 margin would make the guard hold on any conformant device. - oneandonlydean's conflict with `main` in `ShaderMemory.cpp`: **Resolved**. The merge is clean, and both sides' checks are kept and pass. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - MoltenVK and macOS (the author reports passes of `request_serializer_tests` and the `agc_shader_memory_tests` entries on this merge), Windows and lavapipe. - A device without `VK_EXT_image_view_min_lod` natively. I reached the shader lane only through the `_shader_lane` entry. - The PPSA21564 result: the review rules do not allow launching a title.
MarcZX10 commented 2026-10-29 21:29:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T21:29:40Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The merge onto 951f374c87 adds useful Mac/MoltenVK results, but live main has since changed ShaderMemory.cpp, and request format 50 is also used by the still-open #10846.

What I ran

Reviewed exact PR head 3584348ef95fab99be2788113fd221d03ee7d719 against live main fc9240dbc5dc89a6b17a739703e00d26318c7716 on Linux x86-64 using Git and GitHub CLI. The merge preview is clean. I ran git diff --check and the repository convention checker; I did not build or run shader/GPU tests locally.

git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-12662-head
git diff --check refs/remotes/upstream/main...refs/review/pr-12662-head
python3 tools/check_conventions.py --base refs/remotes/upstream/main --head refs/review/pr-12662-head
gh pr checks 12662 --repo boykopovar/AnyPS5

Results

Check Result
Merge preview with live main Clean; tree 1ebc94351dc51486573fb0cf091a3de578282030
git diff --check Passed; no output
check_conventions.py Passed
Current-main overlap Since the tested base 951f374c87, live main added a guarded nested-pointer regression in the same ShaderMemory.cpp this PR changes
Author-reported tests On head 3584348ef9, request_serializer_tests and 20 agc_shader_memory_tests entries pass on macOS under Rosetta; the comment also reports conventions passing
Hosted checks Windows, conventions, eligibility, labels, report, Linux/Windows relinker and ASan relinker pass; macOS relinkers are pending; Linux product and specialized jobs are skipped
Request serialization Both this PR and open #10846 currently use request format 50; main remains at 49
Unedited local output
1ebc94351dc51486573fb0cf091a3de578282030
All conventions checks passed.

git diff --check produced no output and exited successfully.

Findings

Blocking

  • The tested branch is behind current main in a changed test file. Head 3584348ef9 incorporates 951f374c87; current main fc9240dbc5 adds a guarded nested-pointer test in core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp, which this PR also changes. The merge preview is clean, but the report does not cover the merged test file. Please update onto live main, keep both changes, and rerun agc_shader_memory_tests plus request_serializer_tests on the resulting exact head.
  • Request format 50 has no agreed landing order. This PR and open #10846 both advance main’s format 49 to 50. If one lands first, the other must account for both serialized changes and use the next format as appropriate. Please coordinate the order, reflect any dependency on the checklist, and update the serializer tests before approval.

Non-blocking

  • The refreshed report describes the shader-lane tests, five failing mutations, and a MoltenVK title run reaching the warp sequence. These are author-reported results; I did not reproduce them. The report correctly identifies the subsequent unrelated shader stop and the unverified Linux/image-view lane.

Sources

Not verified

I did not build the current-main merge, rerun the focused tests or mutations, run on Linux, validate the image-view lane, or reproduce the MoltenVK title result. The current macOS relinker jobs are pending.

To get this to a good state

Integrate live main, preserve the new upstream test, resolve the request-format landing order, and rerun the focused serializer and shader-memory tests. I will recheck the same commands and exact head after that update.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5705221469 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5705221469). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T21:29:40Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The merge onto `951f374c87` adds useful Mac/MoltenVK results, but live `main` has since changed `ShaderMemory.cpp`, and request format 50 is also used by the still-open #10846. ## What I ran Reviewed exact PR head `3584348ef95fab99be2788113fd221d03ee7d719` against live `main` `fc9240dbc5dc89a6b17a739703e00d26318c7716` on Linux x86-64 using Git and GitHub CLI. The merge preview is clean. I ran `git diff --check` and the repository convention checker; I did not build or run shader/GPU tests locally. ```sh git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-12662-head git diff --check refs/remotes/upstream/main...refs/review/pr-12662-head python3 tools/check_conventions.py --base refs/remotes/upstream/main --head refs/review/pr-12662-head gh pr checks 12662 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Merge preview with live `main` | Clean; tree `1ebc94351dc51486573fb0cf091a3de578282030` | | `git diff --check` | Passed; no output | | `check_conventions.py` | Passed | | Current-main overlap | Since the tested base `951f374c87`, live `main` added a guarded nested-pointer regression in the same `ShaderMemory.cpp` this PR changes | | Author-reported tests | On head `3584348ef9`, `request_serializer_tests` and 20 `agc_shader_memory_tests` entries pass on macOS under Rosetta; the comment also reports conventions passing | | Hosted checks | Windows, conventions, eligibility, labels, report, Linux/Windows relinker and ASan relinker pass; macOS relinkers are pending; Linux product and specialized jobs are skipped | | Request serialization | Both this PR and open #10846 currently use request format 50; main remains at 49 | <details><summary>Unedited local output</summary> ```text 1ebc94351dc51486573fb0cf091a3de578282030 All conventions checks passed. ``` `git diff --check` produced no output and exited successfully. </details> ## Findings ### Blocking - **The tested branch is behind current `main` in a changed test file.** Head `3584348ef9` incorporates `951f374c87`; current `main` `fc9240dbc5` adds a guarded nested-pointer test in `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp`, which this PR also changes. The merge preview is clean, but the report does not cover the merged test file. Please update onto live `main`, keep both changes, and rerun `agc_shader_memory_tests` plus `request_serializer_tests` on the resulting exact head. - **Request format 50 has no agreed landing order.** This PR and open #10846 both advance main’s format 49 to 50. If one lands first, the other must account for both serialized changes and use the next format as appropriate. Please coordinate the order, reflect any dependency on the checklist, and update the serializer tests before approval. ### Non-blocking - The refreshed report describes the shader-lane tests, five failing mutations, and a MoltenVK title run reaching the warp sequence. These are author-reported results; I did not reproduce them. The report correctly identifies the subsequent unrelated shader stop and the unverified Linux/image-view lane. ## Sources - [Current-main contribution rule at `fc9240dbc5dc89a6b17a739703e00d26318c7716`](https://github.com/boykopovar/AnyPS5/blob/fc9240dbc5dc89a6b17a739703e00d26318c7716/CONTRIBUTING.md#L57) - [Current-main `ShaderMemory.cpp` change at `fc9240dbc5dc89a6b17a739703e00d26318c7716`](https://github.com/boykopovar/AnyPS5/blob/fc9240dbc5dc89a6b17a739703e00d26318c7716/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp) - [This PR at `3584348ef95fab99be2788113fd221d03ee7d719`](https://github.com/boykopovar/AnyPS5/tree/3584348ef95fab99be2788113fd221d03ee7d719) - [Open #10846 request-format change at `c21a1ee10cdd902758c36e8b13f99c6acc84b604`](https://github.com/boykopovar/AnyPS5/tree/c21a1ee10cdd902758c36e8b13f99c6acc84b604) ## Not verified I did not build the current-main merge, rerun the focused tests or mutations, run on Linux, validate the image-view lane, or reproduce the MoltenVK title result. The current macOS relinker jobs are pending. ## To get this to a good state Integrate live `main`, preserve the new upstream test, resolve the request-format landing order, and rerun the focused serializer and shader-memory tests. I will recheck the same commands and exact head after that update.
MarcZX10 commented 2026-10-29 21:36:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T21:36:46Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The updated head now includes current main and the author reports rerunning the focused tests, but its checklist still leaves the overlapping serializer-version PR unordered.

What I ran

Reviewed head 34eccba19d22a88a224c891e6b9d151e21afd682, based on current main fc9240dbc5dc89a6b17a739703e00d26318c7716. The merge preview is clean. I inspected the 27-line ShaderMemory.cpp addition, current checklist, latest author report, and hosted check statuses. No local build or tests were run.

git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-12662-head
git diff --check refs/remotes/upstream/main...refs/review/pr-12662-head

Results

Check Result
Merge preview onto current main Clean
Diff whitespace check Passed (no output)
Focused tests Author reports request_serializer_tests and 20 agc_shader_memory_tests entries pass on this merged head (Apple M5 Pro, macOS 27.2, x86-64 under Rosetta); not independently rerun
Hosted conventions, eligibility, labels, report Pending at review time
Product Linux and specialized jobs Skipped
Unedited local command output
merge-tree: 1ebc94351dc51486573fb0cf091a3de578282030
diff-check: no output; exit status 0

Findings

Blocking

  • The checklist still says Depends on: none, while this PR and open #10846 both change the request serialization version from 49 to 50. The checklist's “whichever lands second moves to 51” is a contingency, not an agreed landing order. The repository asks authors of overlapping PRs to agree which lands first and record the dependency. Please coordinate with #10846's author, name the first PR, and update this checklist to Depends on: #N as appropriate. See the contribution rule at the reviewed main commit.

Non-blocking

  • The current-main merge is clean, and the new test addition preserves the main-branch guarded nested-pointer case. The author reports the focused suites passing on this head; those results are not locally reproduced.

Not verified

I did not build locally or independently rerun the focused tests. The four hosted checks listed above were still pending; Linux and specialized jobs were skipped.

To get this to a good state

Please agree and record the serializer-version landing order with #10846, then ensure the pending checks complete. I will recheck the same paths and checks on the resulting head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5705303545 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5705303545). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T21:36:46Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The updated head now includes current `main` and the author reports rerunning the focused tests, but its checklist still leaves the overlapping serializer-version PR unordered. ## What I ran Reviewed head `34eccba19d22a88a224c891e6b9d151e21afd682`, based on current `main` `fc9240dbc5dc89a6b17a739703e00d26318c7716`. The merge preview is clean. I inspected the 27-line `ShaderMemory.cpp` addition, current checklist, latest author report, and hosted check statuses. No local build or tests were run. ```sh git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-12662-head git diff --check refs/remotes/upstream/main...refs/review/pr-12662-head ``` ## Results | Check | Result | |---|---| | Merge preview onto current `main` | Clean | | Diff whitespace check | Passed (no output) | | Focused tests | Author reports `request_serializer_tests` and 20 `agc_shader_memory_tests` entries pass on this merged head (Apple M5 Pro, macOS 27.2, x86-64 under Rosetta); not independently rerun | | Hosted conventions, eligibility, labels, report | Pending at review time | | Product Linux and specialized jobs | Skipped | <details> <summary>Unedited local command output</summary> ```text merge-tree: 1ebc94351dc51486573fb0cf091a3de578282030 diff-check: no output; exit status 0 ``` </details> ## Findings ### Blocking - The checklist still says `Depends on: none`, while this PR and open #10846 both change the request serialization version from 49 to 50. The checklist's “whichever lands second moves to 51” is a contingency, not an agreed landing order. The repository asks authors of overlapping PRs to agree which lands first and record the dependency. Please coordinate with #10846's author, name the first PR, and update this checklist to `Depends on: #N` as appropriate. See [the contribution rule at the reviewed main commit](https://github.com/boykopovar/AnyPS5/blob/fc9240dbc5dc89a6b17a739703e00d26318c7716/CONTRIBUTING.md#L67-L70). ### Non-blocking - The current-main merge is clean, and the new test addition preserves the main-branch guarded nested-pointer case. The author reports the focused suites passing on this head; those results are not locally reproduced. ## Not verified I did not build locally or independently rerun the focused tests. The four hosted checks listed above were still pending; Linux and specialized jobs were skipped. ## To get this to a good state Please agree and record the serializer-version landing order with #10846, then ensure the pending checks complete. I will recheck the same paths and checks on the resulting head.
MarcZX10 commented 2026-10-30 05:58:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T05:58:30Z.

Review: APPROVED


Re-checked — new head, looks good

The refreshed branch resolves the current-main merge conflicts while preserving the shader MIN_LOD change, and the reviewed implementation and reported focused tests show no remaining blocker.

What I ran

Reviewed exact head 242aacc3c1e3ee30c9e9a420ec0c3d90565f7a88 against current main 88e2d98f49c949380b45c9cfa266687e28d4443c; the merge preview is clean (fd03fbef49171bdc713628561673471ab323b137). Environment: Linux x86-64. No local build or tests were run.

git diff --check upstream/main...242aacc3c1e3ee30c9e9a420ec0c3d90565f7a88
python3 tools/check_conventions.py --base upstream/main --head 242aacc3c1e3ee30c9e9a420ec0c3d90565f7a88
python3 tools/check_main_sync.py --base upstream/main --head 242aacc3c1e3ee30c9e9a420ec0c3d90565f7a88
git merge-tree --write-tree upstream/main 242aacc3c1e3ee30c9e9a420ec0c3d90565f7a88
gh pr checks 12662 --repo boykopovar/AnyPS5

Results

Check Result
Diff check Passed; no output
Conventions Passed; All conventions checks passed.
Current-main merge preview Clean; tree fd03fbef49171bdc713628561673471ab323b137
Main synchronization Clean merge; ten touched files changed since the branch's merge base
Hosted checks Windows, relinker Linux/Windows/macOS, relinker ASan, conventions, eligibility, labels, and report passed; Linux product, register-context, and write-watch jobs skipped
Author-reported focused tests request_serializer and agc_shader_memory tests passed on Apple M5 Pro/macOS 27.2 under x86-64 Rosetta; I did not independently run them

Findings

Blocking

None found in the reviewed head. The prior merge-conflict blocker is resolved, and the current-main merge is clean.

Non-blocking

The focused macOS test results are author-reported. I did not independently run a local build, CTest, GPU test, console run, or other-OS validation.

Sources

Not verified

No local build or tests were run. Linux product and specialized hosted jobs are skipped. No console behavior or game-level output was verified.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5708611698 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5708611698). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T05:58:30Z. **Review:** APPROVED --- # Re-checked — new head, looks good The refreshed branch resolves the current-main merge conflicts while preserving the shader MIN_LOD change, and the reviewed implementation and reported focused tests show no remaining blocker. ## What I ran Reviewed exact head `242aacc3c1e3ee30c9e9a420ec0c3d90565f7a88` against current `main` `88e2d98f49c949380b45c9cfa266687e28d4443c`; the merge preview is clean (`fd03fbef49171bdc713628561673471ab323b137`). Environment: Linux x86-64. No local build or tests were run. ```sh git diff --check upstream/main...242aacc3c1e3ee30c9e9a420ec0c3d90565f7a88 python3 tools/check_conventions.py --base upstream/main --head 242aacc3c1e3ee30c9e9a420ec0c3d90565f7a88 python3 tools/check_main_sync.py --base upstream/main --head 242aacc3c1e3ee30c9e9a420ec0c3d90565f7a88 git merge-tree --write-tree upstream/main 242aacc3c1e3ee30c9e9a420ec0c3d90565f7a88 gh pr checks 12662 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Diff check | Passed; no output | | Conventions | Passed; `All conventions checks passed.` | | Current-main merge preview | Clean; tree `fd03fbef49171bdc713628561673471ab323b137` | | Main synchronization | Clean merge; ten touched files changed since the branch's merge base | | Hosted checks | Windows, relinker Linux/Windows/macOS, relinker ASan, conventions, eligibility, labels, and report passed; Linux product, register-context, and write-watch jobs skipped | | Author-reported focused tests | `request_serializer` and `agc_shader_memory` tests passed on Apple M5 Pro/macOS 27.2 under x86-64 Rosetta; I did not independently run them | ## Findings ### Blocking None found in the reviewed head. The prior merge-conflict blocker is resolved, and the current-main merge is clean. ### Non-blocking The focused macOS test results are author-reported. I did not independently run a local build, CTest, GPU test, console run, or other-OS validation. ## Sources - [Implementation at the reviewed head](https://github.com/boykopovar/AnyPS5/tree/242aacc3c1e3ee30c9e9a420ec0c3d90565f7a88) - [Author's merge and focused-test report](https://github.com/boykopovar/AnyPS5/pull/12662#issuecomment-6512702655) - [Current main used for the merge preview](https://github.com/boykopovar/AnyPS5/commit/88e2d98f49c949380b45c9cfa266687e28d4443c) ## Not verified No local build or tests were run. Linux product and specialized hosted jobs are skipped. No console behavior or game-level output was verified.
adriadam10 commented 2026-10-30 15:38:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-30T15:38:49Z.

Review: CHANGES_REQUESTED


The full Build for this head (run 41071165756, linux job on CI's lavapipe: llvmpipe LLVM 20.1.2, graphics pipeline libraries on, no VK_EXT_image_view_min_lod) fails two tests that main passes:

  • agc_driver_image_sample_lod_clamp_shader_lane: image_sample_d_cl with T# MIN_LOD 512 over BASE_LEVEL 0 with S# MAX_LOD 4095, mip filter 1 and LOD bias -256: thread 0 component 0 is 1.000000, expected 2. The gradient case with a negative S# bias gives a different level on llvmpipe than on MoltenVK and NVIDIA. Either the shader must not depend on how the driver orders MinLod and the sampler bias (reject or reproduce that combination), or the case must stay off it.
  • agc_driver_image_sample_lod_clamp (default lane): the device has shaderResourceMinLod so ImageSampleLodClamp.cpp:281 does not skip, but with pipeline libraries and no extension neither lane exists and the first clamped descriptor throws guest texture descriptor uses a minimum LOD clamp, which needs VK_EXT_image_view_min_lod, or shaderResourceMinLod without graphics pipeline libraries. The test should skip (exit 77, with a reason matching check_skips.py) when !shaderImageMinLod and the view clamp is unavailable, and the shader-lane entry should skip likewise if the forced environment doesn't produce that lane.

Please rerun both entries on lavapipe (ANYPS5_REQUIRE_VULKAN=1, no shader cache) before pushing again.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5714729303 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5714729303). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-30T15:38:49Z. **Review:** CHANGES_REQUESTED --- The full Build for this head (run 41071165756, `linux` job on CI's lavapipe: llvmpipe LLVM 20.1.2, graphics pipeline libraries on, no `VK_EXT_image_view_min_lod`) fails two tests that `main` passes: - `agc_driver_image_sample_lod_clamp_shader_lane`: `image_sample_d_cl with T# MIN_LOD 512 over BASE_LEVEL 0 with S# MAX_LOD 4095, mip filter 1 and LOD bias -256: thread 0 component 0 is 1.000000, expected 2`. The gradient case with a negative S# bias gives a different level on llvmpipe than on MoltenVK and NVIDIA. Either the shader must not depend on how the driver orders `MinLod` and the sampler bias (reject or reproduce that combination), or the case must stay off it. - `agc_driver_image_sample_lod_clamp` (default lane): the device has `shaderResourceMinLod` so `ImageSampleLodClamp.cpp:281` does not skip, but with pipeline libraries and no extension neither lane exists and the first clamped descriptor throws `guest texture descriptor uses a minimum LOD clamp, which needs VK_EXT_image_view_min_lod, or shaderResourceMinLod without graphics pipeline libraries`. The test should skip (exit 77, with a reason matching `check_skips.py`) when `!shaderImageMinLod` and the view clamp is unavailable, and the shader-lane entry should skip likewise if the forced environment doesn't produce that lane. Please rerun both entries on lavapipe (`ANYPS5_REQUIRE_VULKAN=1`, no shader cache) before pushing again.
jotitadev commented 2026-10-31 03:19:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-31T03:19:03Z.

Review: COMMENTED


Linux lavapipe run of head 22cc617ebe: agc_driver_image_sample_lod_clamp_shader_lane still fails, on two S# bias cases that 22cc617ebe left in the shader lane. The linux job is skipped for this head, so CI hasn't shown it. adriadam10's report on e006bc1f78 named the -256 case; the test stops at its first failure, so later cases didn't show there.

Setup: i7-8700, Ubuntu 26.04, GCC 15.2, Release. lavapipe (Mesa 26.0.3, LLVM 21.1.8) has shaderResourceMinLod and graphics pipeline libraries, but no VK_EXT_image_view_min_lod, like CI's. ANYPS5_NO_SHADER_CACHE=1. Runs on the head alone, and on the head merged --no-ff onto main 2a1ae91175, 3 runs each, with the same result.

  • agc_driver_image_sample_lod_clamp: skipped (no extension, GPL on), as intended.

  • agc_driver_image_sample_lod_clamp_shader_lane: fails 3/3:

    image_sample_d_cl with T# MIN_LOD 256 over BASE_LEVEL 1 with S# MAX_LOD 4095, mip filter 1 and LOD bias -128: thread 5 component 0 is 1.000000, expected 2
    

    With that case moved under !shaderClamp, the next one fails 3/3:

    image_sample_d_cl with T# MIN_LOD 0 over BASE_LEVEL 0 with S# MAX_LOD 4095, mip filter 1 and LOD bias 256: thread 5 component 0 is 2.000000, expected 1
    

Cause. Both results match the llvmpipe order that the debt entry now describes: llvmpipe adds the S# bias after the MinLod clamp. Here the clamp is the instruction's own _cl operand. In the second case the T# clamp is 0, so the shader clamp has no effect: the image_sample_d_cl result depends only on how the driver orders the _cl clamp and the bias. On lavapipe the image-view lane is skipped, so the shader lane is the only entry that runs these cases.

  • The first case is the gradient case with a bias of -128. Only the -256 gradient case moved under !shaderClamp in 22cc617ebe.
  • The Code case with bias -96 passes.

Change I checked: run these two cases only when !shaderClamp, like the -256 one:

-        RunAndCheck(*device, GradientCode, 1u, Case{0x100u, 1u, 0xfffu, 1u, -128}, false);
+        if (!shaderClamp) RunAndCheck(*device, GradientCode, 1u, Case{0x100u, 1u, 0xfffu, 1u, -128}, false);
         if (!shaderClamp) RunAndCheck(*device, GradientCode, 1u, Case{0x200u, 0u, 0xfffu, 1u, -256}, false);
-        for (const auto& item : {Case{0u, 0u, 0xfffu, 1u, 256}, Case{0x100u, 1u, 0xfffu, 1u, -96}}) RunAndCheck(*device, Code, 6u, item, false);
+        if (!shaderClamp) RunAndCheck(*device, Code, 6u, Case{0u, 0u, 0xfffu, 1u, 256}, false);
+        RunAndCheck(*device, Code, 6u, Case{0x100u, 1u, 0xfffu, 1u, -96}, false);

With it, the shader-lane entry passes 3/3 on lavapipe (head merged onto main 2a1ae91175). This drops the shader-lane coverage of those two biases on MoltenVK and NVIDIA. If you want to keep it there, the cases need inputs where the _cl clamp doesn't bind under a bias. I didn't try that.

GPUs tested: lavapipe (Mesa 26.0.3, Linux).

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5720849767 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5720849767). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-31T03:19:03Z. **Review:** COMMENTED --- Linux lavapipe run of head `22cc617ebe`: `agc_driver_image_sample_lod_clamp_shader_lane` still fails, on two S# bias cases that `22cc617ebe` left in the shader lane. The `linux` job is skipped for this head, so CI hasn't shown it. adriadam10's report on `e006bc1f78` named the -256 case; the test stops at its first failure, so later cases didn't show there. Setup: i7-8700, Ubuntu 26.04, GCC 15.2, Release. lavapipe (Mesa 26.0.3, LLVM 21.1.8) has `shaderResourceMinLod` and graphics pipeline libraries, but no `VK_EXT_image_view_min_lod`, like CI's. `ANYPS5_NO_SHADER_CACHE=1`. Runs on the head alone, and on the head merged `--no-ff` onto `main` `2a1ae91175`, 3 runs each, with the same result. - `agc_driver_image_sample_lod_clamp`: skipped (no extension, GPL on), as intended. - `agc_driver_image_sample_lod_clamp_shader_lane`: fails 3/3: ``` image_sample_d_cl with T# MIN_LOD 256 over BASE_LEVEL 1 with S# MAX_LOD 4095, mip filter 1 and LOD bias -128: thread 5 component 0 is 1.000000, expected 2 ``` With that case moved under `!shaderClamp`, the next one fails 3/3: ``` image_sample_d_cl with T# MIN_LOD 0 over BASE_LEVEL 0 with S# MAX_LOD 4095, mip filter 1 and LOD bias 256: thread 5 component 0 is 2.000000, expected 1 ``` **Cause.** Both results match the llvmpipe order that the debt entry now describes: llvmpipe adds the S# bias after the `MinLod` clamp. Here the clamp is the instruction's own `_cl` operand. In the second case the T# clamp is 0, so the shader clamp has no effect: the `image_sample_d_cl` result depends only on how the driver orders the `_cl` clamp and the bias. On lavapipe the image-view lane is skipped, so the shader lane is the only entry that runs these cases. - The first case is the gradient case with a bias of -128. Only the -256 gradient case moved under `!shaderClamp` in `22cc617ebe`. - The `Code` case with bias -96 passes. **Change I checked**: run these two cases only when `!shaderClamp`, like the -256 one: ```diff - RunAndCheck(*device, GradientCode, 1u, Case{0x100u, 1u, 0xfffu, 1u, -128}, false); + if (!shaderClamp) RunAndCheck(*device, GradientCode, 1u, Case{0x100u, 1u, 0xfffu, 1u, -128}, false); if (!shaderClamp) RunAndCheck(*device, GradientCode, 1u, Case{0x200u, 0u, 0xfffu, 1u, -256}, false); - for (const auto& item : {Case{0u, 0u, 0xfffu, 1u, 256}, Case{0x100u, 1u, 0xfffu, 1u, -96}}) RunAndCheck(*device, Code, 6u, item, false); + if (!shaderClamp) RunAndCheck(*device, Code, 6u, Case{0u, 0u, 0xfffu, 1u, 256}, false); + RunAndCheck(*device, Code, 6u, Case{0x100u, 1u, 0xfffu, 1u, -96}, false); ``` With it, the shader-lane entry passes 3/3 on lavapipe (head merged onto `main` `2a1ae91175`). This drops the shader-lane coverage of those two biases on MoltenVK and NVIDIA. If you want to keep it there, the cases need inputs where the `_cl` clamp doesn't bind under a bias. I didn't try that. GPUs tested: lavapipe (Mesa 26.0.3, Linux). Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
jotitadev commented 2026-10-31 04:38:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-31T04:38:50Z.

Review: COMMENTED


Re-run of head bb9fae9d5d merged onto main 0835ec8bdc on lavapipe, the device where the two bias cases failed: fixed.

  • agc_driver_image_sample_lod_clamp_shader_lane: passes 3/3 with VVL 1.4.341 and 1/1 with no layer, no VUID- lines.
  • agc_driver_image_sample_lod_clamp still skips (no VK_EXT_image_view_min_lod, GPL on), as intended.
  • The other tests from the touched files (agc_shader_memory, agc_driver_graphics, agc_driver_graphics_maps_fallback, request_serializer) pass 3/3.

The test change in bb9fae9d5d is the same as the one I checked, so the red run is the one from my earlier review on 22cc617ebe.

GPUs tested: lavapipe (Mesa 26.0.3, LLVM 21.1.8, Linux).

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5721285825 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5721285825). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-31T04:38:50Z. **Review:** COMMENTED --- Re-run of head `bb9fae9d5d` merged onto `main` `0835ec8bdc` on lavapipe, the device where the two bias cases failed: fixed. - `agc_driver_image_sample_lod_clamp_shader_lane`: passes 3/3 with VVL 1.4.341 and 1/1 with no layer, no `VUID-` lines. - `agc_driver_image_sample_lod_clamp` still skips (no `VK_EXT_image_view_min_lod`, GPL on), as intended. - The other tests from the touched files (`agc_shader_memory`, `agc_driver_graphics`, `agc_driver_graphics_maps_fallback`, `request_serializer`) pass 3/3. The test change in `bb9fae9d5d` is the same as the one I checked, so the red run is the one from my earlier review on `22cc617ebe`. GPUs tested: lavapipe (Mesa 26.0.3, LLVM 21.1.8, Linux). Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10 commented 2026-10-31 06:51:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T06:51:13Z.

Review: COMMENTED


Re-checked — new head, baseline evidence still needed

The new lavapipe report says the shader-lane test passes on bb9fae9d5d8b0b8024c34840bb4c40e68530eed2, but the required matched run against current main is not documented and Linux CI is skipped.

Please run agc_driver_image_sample_lod_clamp and agc_driver_image_sample_lod_clamp_shader_lane on current main (ddd99fdadb399867211fc1c33fed62e5a4b73d9f) and this PR head on the same lavapipe machine, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Include the exact commands and logs, confirm the requested validation layer was loaded, and compare the logs for new VUID- errors. I have not built or run these GPU tests locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5721697461 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5721697461). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T06:51:13Z. **Review:** COMMENTED --- # Re-checked — new head, baseline evidence still needed The new lavapipe report says the shader-lane test passes on `bb9fae9d5d8b0b8024c34840bb4c40e68530eed2`, but the required matched run against current `main` is not documented and Linux CI is skipped. Please run `agc_driver_image_sample_lod_clamp` and `agc_driver_image_sample_lod_clamp_shader_lane` on current `main` (`ddd99fdadb399867211fc1c33fed62e5a4b73d9f`) and this PR head on the same lavapipe machine, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`. Include the exact commands and logs, confirm the requested validation layer was loaded, and compare the logs for new `VUID-` errors. I have not built or run these GPU tests locally.
XairRrR commented 2026-11-02 19:12:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T19:12:10Z.

Review: APPROVED


Re-checked — approved

The branch is now one squashed commit (fe18496c95) on current main. It moves request serialization to version 53 and the specialization IDs to MinLodBase = 57600. It no longer rejects an S# bias on implicit or gradient samples, recorded as debt, and it skips on devices that have neither lane. On lavapipe the shader lane passes with no validation errors, and the negative control fails.

What changed since my last review

  • The PR is rewritten as one commit on main 0278ca9831. Compared with 9d6ffe5ed2, these are the changes:
    • Request serialization moves to version 53, written after hostInterpolationFirst. main already writes 52 and rejects 50, so the version-50 plan no longer applies. RequestSerializerTests covers the version 53 field both ways and reads 52 as false. It also moves every tail offset by one.
    • Specialization IDs: MinLodBase is 57600. That is directly after MirrorUnnormalizedBase (57536, which takes up to 32 samplers). MinLodBase + 64 images stays below ImageComponentBase (65536), so the IDs don't overlap.
    • S# bias on implicit or gradient samples is accepted again, as in 22cc617ebe/bb9fae9d5d from the discussion. Only the bias on an explicit LOD is rejected (DescriptorBindingBuilder.cpp:228). The llvmpipe ordering difference is now recorded in docs/dev/debt/shader.md. The three gradient and implicit bias cases that fail on llvmpipe run only in the image-view lane (ImageSampleLodClamp.cpp:305-307).
    • Skips: the test exits 77 when the device has neither lane, and the _shader_lane entry exits 77 when the forced environment doesn't produce the shader lane (ImageSampleLodClamp.cpp:294-301).
  • The description and checklist were updated to match: Depends on: none, version 53.

What I ran

Head fe18496c95ae0b0f03c6956b8b77649c679314f0, main a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8, merged tree e1be4dac1100e7bdaa6b503e2a400b0356ad6b9f. Debian 13 VM, GCC 14.2.0, Release, lavapipe (Mesa 26.1.6, LLVM 19): no VK_EXT_image_view_min_lod, graphics pipeline libraries on.

git diff --check a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8...fe18496c95ae0b0f03c6956b8b77649c679314f0
python3 tools/check_conventions.py --base a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -j4 --test-load 8 --output-on-failure \
  -R '^(agc_driver_image_sample_lod_clamp|agc_driver_image_sample_lod_clamp_shader_lane|request_serializer|agc_shader_memory|agc_shader_disk_cache|agc_driver_graphics)$'
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R '^agc_driver_image_sample_lod_clamp(_shader_lane)?$'
# negative control
git show a4eca2a056:core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp > core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
ninja -C build -j8 -l8 agc_driver_image_sample_lod_clamp_tests
ctest --test-dir build --output-on-failure -R '^agc_driver_image_sample_lod_clamp_shader_lane$'
git show e1be4dac11:core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp > core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
ninja -C build -j8 -l8 agc_driver_image_sample_lod_clamp_tests
git status --porcelain
Check Result
git diff --check Clean
check_conventions.py All conventions checks passed.
Build (script) Passed; 0 new failures, 0 timeouts among 2137 selected tests. 7 known main failures, and 2 main_sync_renames_* tests that fail on main now pass.
agc_driver_image_sample_lod_clamp_shader_lane Passed (4.5 s): image sample LOD clamp tests passed in the shader-clamp lane
agc_driver_image_sample_lod_clamp Skipped (77): skipped, the device has no VK_EXT_image_view_min_lod, and graphics pipeline libraries keep T# minimum LODs out of the shader. check_skips.py accepts it.
request_serializer, agc_shader_memory, agc_shader_disk_cache, agc_driver_graphics 4/4 passed
Validation layer Insert instance layer "VK_LAYER_KHRONOS_validation" in both tests. No was not found but was requested, 0 VUID- lines.
Worktree after the control git status --porcelain empty

Negative control

I restored SpirvImageEmitter.cpp from main and kept the rest of the merged tree, which leaves the target flag and the specialization values without the shader clamp. agc_driver_image_sample_lod_clamp_shader_lane then fails with a target with the shader clamp does not declare exactly the image's minimum LOD specialization constant. With the merged file restored, it passes again.

Previous findings

  • Serialization version 50 shared with #10547, #11483 and #10846: no longer applies. main now writes 52 and rejects 50, and this PR takes 53, the next free number (RequestSerializer.cpp, WriteU32(53u), and the version >= 53u read). request_serializer and agc_shader_memory pass.
  • The 1/512 tie margin in ImageSampleLodClamp.cpp:190 is finer than the minimum mipmapPrecisionBits of 4: still open, non-blocking. The code is unchanged. Every current case still sits at least 1/8 away from a tie, so nothing fails today. A 1/16 margin would hold on any conformant device.

New findings

Blocking

None.

Non-blocking

None. The S# bias on implicit and gradient samples (DescriptorBindingBuilder.cpp:228 rejects only explicit LODs) follows the Vulkan order: the sampler bias comes first, then the MinLod and maxLod clamp. llvmpipe differs from that order, and the debt entry records it. On lavapipe the bias cases that depend on this run only in the image-view lane, so CI does not depend on llvmpipe's ordering.

Not verified

  • The image-view lane: this lavapipe device has no VK_EXT_image_view_min_lod, so agc_driver_image_sample_lod_clamp skipped. The RADV and NVIDIA reports in the discussion cover that lane.
  • No validation comparison against main: the script's baseline has no validation run yet, and the shader-lane test does not exist on main. The merged-tree run has no VUID- lines.
  • agc_driver_graphics took 34.7 s here, running in parallel with other tests. This PR only adds one small capability-validation block to that test (Graphics.cpp). The NVIDIA report from the discussion lists the same test at about 30 s, so I don't count the time against this PR, but I did not time it on main.
  • MoltenVK, Windows, and the PPSA21564 run are author-reported only.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5741943661 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12662#pullrequestreview-5741943661). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T19:12:10Z. **Review:** APPROVED --- # Re-checked — approved The branch is now one squashed commit (`fe18496c95`) on current `main`. It moves request serialization to version 53 and the specialization IDs to `MinLodBase = 57600`. It no longer rejects an S# bias on implicit or gradient samples, recorded as debt, and it skips on devices that have neither lane. On lavapipe the shader lane passes with no validation errors, and the negative control fails. ## What changed since my last review - The PR is rewritten as one commit on `main` `0278ca9831`. Compared with `9d6ffe5ed2`, these are the changes: - **Request serialization** moves to version 53, written after `hostInterpolationFirst`. `main` already writes 52 and rejects 50, so the version-50 plan no longer applies. `RequestSerializerTests` covers the version 53 field both ways and reads 52 as false. It also moves every tail offset by one. - **Specialization IDs:** `MinLodBase` is 57600. That is directly after `MirrorUnnormalizedBase` (57536, which takes up to 32 samplers). `MinLodBase` + 64 images stays below `ImageComponentBase` (65536), so the IDs don't overlap. - **S# bias on implicit or gradient samples** is accepted again, as in `22cc617ebe`/`bb9fae9d5d` from the discussion. Only the bias on an explicit LOD is rejected (`DescriptorBindingBuilder.cpp:228`). The llvmpipe ordering difference is now recorded in `docs/dev/debt/shader.md`. The three gradient and implicit bias cases that fail on llvmpipe run only in the image-view lane (`ImageSampleLodClamp.cpp:305-307`). - **Skips:** the test exits 77 when the device has neither lane, and the `_shader_lane` entry exits 77 when the forced environment doesn't produce the shader lane (`ImageSampleLodClamp.cpp:294-301`). - The description and checklist were updated to match: `Depends on: none`, version 53. ## What I ran Head `fe18496c95ae0b0f03c6956b8b77649c679314f0`, `main` `a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8`, merged tree `e1be4dac1100e7bdaa6b503e2a400b0356ad6b9f`. Debian 13 VM, GCC 14.2.0, Release, lavapipe (Mesa 26.1.6, LLVM 19): no `VK_EXT_image_view_min_lod`, graphics pipeline libraries on. ```sh git diff --check a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8...fe18496c95ae0b0f03c6956b8b77649c679314f0 python3 tools/check_conventions.py --base a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8 ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -j4 --test-load 8 --output-on-failure \ -R '^(agc_driver_image_sample_lod_clamp|agc_driver_image_sample_lod_clamp_shader_lane|request_serializer|agc_shader_memory|agc_shader_disk_cache|agc_driver_graphics)$' env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R '^agc_driver_image_sample_lod_clamp(_shader_lane)?$' # negative control git show a4eca2a056:core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp > core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp ninja -C build -j8 -l8 agc_driver_image_sample_lod_clamp_tests ctest --test-dir build --output-on-failure -R '^agc_driver_image_sample_lod_clamp_shader_lane$' git show e1be4dac11:core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp > core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp ninja -C build -j8 -l8 agc_driver_image_sample_lod_clamp_tests git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | Clean | | `check_conventions.py` | `All conventions checks passed.` | | Build (script) | Passed; 0 new failures, 0 timeouts among 2137 selected tests. 7 known `main` failures, and 2 `main_sync_renames_*` tests that fail on `main` now pass. | | `agc_driver_image_sample_lod_clamp_shader_lane` | Passed (4.5 s): `image sample LOD clamp tests passed in the shader-clamp lane` | | `agc_driver_image_sample_lod_clamp` | Skipped (77): `skipped, the device has no VK_EXT_image_view_min_lod, and graphics pipeline libraries keep T# minimum LODs out of the shader`. `check_skips.py` accepts it. | | `request_serializer`, `agc_shader_memory`, `agc_shader_disk_cache`, `agc_driver_graphics` | 4/4 passed | | Validation layer | `Insert instance layer "VK_LAYER_KHRONOS_validation"` in both tests. No `was not found but was requested`, 0 `VUID-` lines. | | Worktree after the control | `git status --porcelain` empty | ## Negative control I restored `SpirvImageEmitter.cpp` from `main` and kept the rest of the merged tree, which leaves the target flag and the specialization values without the shader clamp. `agc_driver_image_sample_lod_clamp_shader_lane` then fails with `a target with the shader clamp does not declare exactly the image's minimum LOD specialization constant`. With the merged file restored, it passes again. ## Previous findings - **Serialization version 50 shared with #10547, #11483 and #10846:** no longer applies. `main` now writes 52 and rejects 50, and this PR takes 53, the next free number (`RequestSerializer.cpp`, `WriteU32(53u)`, and the `version >= 53u` read). `request_serializer` and `agc_shader_memory` pass. - **The 1/512 tie margin in `ImageSampleLodClamp.cpp:190` is finer than the minimum `mipmapPrecisionBits` of 4:** still open, non-blocking. The code is unchanged. Every current case still sits at least 1/8 away from a tie, so nothing fails today. A 1/16 margin would hold on any conformant device. ## New findings ### Blocking None. ### Non-blocking None. The S# bias on implicit and gradient samples (`DescriptorBindingBuilder.cpp:228` rejects only explicit LODs) follows the Vulkan order: the sampler bias comes first, then the `MinLod` and `maxLod` clamp. llvmpipe differs from that order, and the debt entry records it. On lavapipe the bias cases that depend on this run only in the image-view lane, so CI does not depend on llvmpipe's ordering. ## Not verified - The image-view lane: this lavapipe device has no `VK_EXT_image_view_min_lod`, so `agc_driver_image_sample_lod_clamp` skipped. The RADV and NVIDIA reports in the discussion cover that lane. - No validation comparison against `main`: the script's baseline has no validation run yet, and the shader-lane test does not exist on `main`. The merged-tree run has no `VUID-` lines. - `agc_driver_graphics` took 34.7 s here, running in parallel with other tests. This PR only adds one small capability-validation block to that test (`Graphics.cpp`). The NVIDIA report from the discussion lists the same test at about 30 s, so I don't count the time against this PR, but I did not time it on `main`. - MoltenVK, Windows, and the PPSA21564 run are author-reported only. <!-- anyps5-bots job=1900 head=fe18496c95ae0b0f03c6956b8b77649c679314f0 -->
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!12662
No description provided.