fix(agc): validate guest sampler parameter bounds and unnormalized coordinate constraints #12904
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12904"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by slopgobblercobbler on 2026-10-29T13:57:19Z.
What
Validates parameter bounds and unnormalized coordinate constraints for guest samplers in
libSceAgcDriver.Sampler::Validateperforms all parameter bounds checks.maxAnisotropy <= context.limits.maxSamplerAnisotropywith!descriptor.anisotropyEnable, allowing unconstrained anisotropy ratios when anisotropic filtering is disabled per Vulkan spec.info.maxAnisotropysets1.0fwhenanisotropyEnableis false, matching Vulkan valid usage expectations and existingGuestSamplerResourcetest assertions.unnormalizedCoordinates: requires matching min and mag filters (minFilter == magFilter) and zero LOD range (minLod == 0.0f && maxLod == 0.0f).core/libs/tests/SamplerParameterBounds.cppverifying valid unnormalized setup, mismatched filters rejection, isolated non-zero min/max LOD rejections, unsupported address mode rejections, and disabled anisotropy acceptance with above-limit values clamped to 1.0.samplerMirrorClampToEdge).RunSamplerParameterBoundsTests(tests/GuestSamplerResource.cpp)unnormRepeattest case with zero LOD range (minLod = 0.0f; maxLod = 0.0f;) to isolate unsupported address mode rejection.docs/dev/debt/libSceAgcDriver.md.Tested
python tools/check_conventions.py --base upstream/main --head HEAD: 0 findings.SamplerParameterBounds.cppcompiles and passes all test assertions.VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1): 0 new VUID validation errors across 1,192 GPU tests.agc_driver_graphics,agc_driver_graphics_maps_fallback, andsampler_parameter_boundspass 3/3.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T14:16:35Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The validator accepts unnormalized samplers that violate Vulkan requirements, rejects a legal disabled-anisotropy descriptor, and the required AGC validation-layer GPU comparison is absent.
What I ran
Reviewed head
c9c8a50e0c3af92aa14e6432a1b00bf5b3806c9bagainstmainatbb04a4f1ea0175e9e4f149f0359a764d62ff3296; the merge preview is clean (treede87dac774956c682086e2fafbab749566f04562). Environment: Linux 6.1.0-54-amd64, Python 3.11.2. I ran the conventions and diff checks and inspected the exact-head implementation and tests. I did not run the C++ test or Vulkan validation:/dev/driis absent andvulkaninfois unavailable.Results
vulkaninfoUnedited local output
Negative control
vkCreateSamplerdoes not perform Vulkan validation.Findings
Blocking
unnormalizedCoordinates, Vulkan requiresminFilter == magFilterandminLod == maxLod == 0.Validatedoes not enforce those constraints.BaseDescriptor()setsmaxLodto 16, and the unnormalized-coordinate tests callValidatewith descriptors that retain that value; the constructor passes it through tovkCreateSampler. Add both checks and tests that isolate each invalid case.maxAnisotropy <= maxSamplerAnisotropycheck is unconditional. Vulkan ignoresmaxAnisotropywhenanisotropyEnableis false and applies the limit only when it is true. Guard the limit check withanisotropyEnable, and test that an above-limit ignored value is accepted when anisotropy is disabled.CONTRIBUTING.mdrequires AGC changes to run the same focused CTest tests onmainand the change underVK_LAYER_KHRONOS_validationon the same GPU, compare VUID output, and report the GPU and driver. The PR marksGPUs tested: n/aand gives no such comparison. Please provide the required paired run before this is ready for approval.Non-blocking
None found beyond the findings above.
Sources
a8b088a3fae12c8575407ea90c7c09bd653db923: unnormalized filter/LOD constraints, anisotropy bounds, and ignoredmaxAnisotropywhen disabled.Not verified
No C++ build/test, Vulkan validation-layer run, other GPU vendor/driver, Windows/macOS runtime, or console behavior was verified locally. Hosted Windows was queued and Linux/specialized runtime jobs were skipped when queried.
To get this to a good state
Enforce and test the unnormalized filter/LOD rules, apply the anisotropy limit only when anisotropy is enabled, and provide the repository-required paired AGC validation-layer GPU results. I will rerun the same checks on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-29T16:22:14Z.
Review: CHANGES_REQUESTED
Thanks for the PR. Checked the diff against
mainand the two earlier reviews; I agree with them, and there is more to fix:Sampler.cpp:66-72: the clamps onmipLodBias,maxAnisotropy,minLodandmaxLodcan never change a value, becauseValidate(called first in the constructor) already rejects every out-of-range input they would clamp. Pick one behaviour: reject (drop the clamps and fix the title/description) or clamp (remove the over-limitRequires and test the clamp through the constructor with a lower device limit).Sampler.cpp:38-43: withunnormalizedCoordinates, Vulkan requiresminFilter == magFilterandminLod == maxLod == 0. Neither is checked, and the default descriptor in the tests hasmaxLod16. Add both checks with one test per case.Sampler.cpp:33: themaxAnisotropy <= maxSamplerAnisotropycheck applies even whenanisotropyEnableis false, where Vulkan ignores the value. Guard it withanisotropyEnableand test that an above-limit value is accepted when disabled.mainand on this branch withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, same GPU, confirm no newVUID-errors, and fillGPUs testedwith the GPU and driver.Sampler.cpp(listed in the overlap bot comment).Feel free to push the updated head; we will re-review it.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T23:31:35Z.
Review: CHANGES_REQUESTED
Re-checked — new head, changes requested
The sampler checks now enforce the reported unnormalized-coordinate and disabled-anisotropy cases, but mirror-clamp capability validation and the repository-required AGC hardware comparison are still missing.
What I ran
Reviewed exact PR head
21d35f06c34d8d60f3e1ef2cb712bf372f5afe85against its recorded base202037c3d7d9ff15c914e20f0a637b888ffbc06f; also previewed a merge against refreshedmain1189ec3003672bb364dd9f3119ead7b3976e3c83, which merged cleanly. Environment: Debian GNU/Linux x86_64, kernel6.1.0-54-amd64, Python 3.11.2. No build or tests were run locally.Results
mainSamplerParameterBounds.cpptest passing; I did not run it locally.Unedited output from checks
Findings
Blocking
IsValidAddressModetreatsVK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGEas valid without checking the device feature or enabled extension. The reviewed tree requests Vulkan 1.1 and contains nosamplerMirrorClampToEdgequery/enable path in the AGC device context. The test's fakevkCreateSampleraccepts every descriptor, so its mirror-clamp case cannot expose the resulting Vulkan validation error on devices without support. Please carry the queried/enabled capability intoContextand reject this mode when unavailable, or otherwise ensure the runtime enables it; test both supported and unsupported cases.CONTRIBUTING.mdrequires the same focused tests onmainand the change, withVK_LAYER_KHRONOS_validation, on the same GPU, and the GPU/driver/OS recorded. The PR reports only a standalone mock-based test and lists no GPU. Please provide that paired result, including validation output, before approval.Non-blocking
None found beyond the blockers above. The new source checks do cover equal min/mag filters, zero LOD for unnormalized coordinates, and the disabled-anisotropy limit case.
Sources
70304594e73a065c7da6485165a59ff3d928e719mainNot verified
I did not build or run the C++ test, execute Vulkan validation on hardware, or check behavior on other GPU vendors or PS5 hardware. The hosted Windows job was pending when checked.
To get this to a good state
Add capability-aware mirror-clamp validation and tests, then attach the repository-required paired AGC run with GPU and driver details. I will rerun the same source checks and review the new exact head.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-30T00:41:38Z.
Review: CHANGES_REQUESTED
Thanks for the update. The three earlier points (unreachable clamps, unnormalized min/mag filters and LOD range, anisotropy limit with anisotropy disabled) are fixed in
21d35f06c3and each has its own test. Two points remain:Sampler.cpp:28/Sampler.cpp:18:VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGEis accepted as valid, but the device never enablessamplerMirrorClampToEdge(VulkanDevice.cpponly enablessamplerAnisotropy) andContexthas no field for it, so a guest S# with that mode (GuestSamplerResource.cpp:37-41) creates a sampler that breaks the Vulkan valid-usage rule. Since this PR is about validating descriptors against device capabilities, either gate the mode on the feature (add it toContext, require it inValidate, test both outcomes) or enable the feature on the device when available and throw otherwise.guest_sampler_resource|sampler_parameter_bounds) onmainand on this branch withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationon the same GPU, confirming the branch adds no newVUID-errors. Please attach the logs to the PR and fillGPUs testedwith the GPU and driver instead ofn/a.Feel free to push the updated head; we will re-review it.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-30T13:01:17Z.
Review: CHANGES_REQUESTED
Thanks, the mirror clamp gating is in (
Context::samplerMirrorClampToEdge, the extension enabled inVulkanDevice.cpp,Sampler::Validaterequiring it, tests for both outcomes), and the include path fix is fine.One point remains:
GPUs testedis stilln/a. Please run the same focused tests (ctest --test-dir build -R 'guest_sampler_resource|sampler_parameter_bounds' -V) onmainand on this branch withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationon the same machine and GPU, confirm neither log containswas not found but was requested by env var VK_INSTANCE_LAYERS, and that the branch adds no newVUID-errors. Attach both logs to the PR and fillGPUs testedwith the GPU and driver.Feel free to push or comment when it is attached; we will re-review.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-30T17:32:22Z.
Review: CHANGES_REQUESTED
Thanks, the
maxLod = 1.0ffix inUnnormalizedNonZeroMinLodisolates the zero-LOD rule correctly.One point from the previous review is still open:
GPUs testedis stilln/a. Please runctest --test-dir build -R 'guest_sampler_resource|sampler_parameter_bounds' -Vonmainand on this branch withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationon the same machine and GPU. Confirm neither log containswas not found but was requested by env var VK_INSTANCE_LAYERSand that the branch adds no newVUID-errors. Attach both logs to the PR and fillGPUs testedwith the GPU and driver.Feel free to push or comment when it is attached; we will re-review.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-30T20:14:27Z.
Review: COMMENTED
The NVIDIA run on
f5d16595a2still failsagc_driver_graphicsandagc_driver_graphics_maps_fallback, now withguest sampler descriptor with unnormalized coordinates requires zero min and max LOD. It's the test, not the GPU: theunnormRepeatcase inRunSamplerParameterBoundsTests(tests/GuestSamplerResource.cpp) copiesvalid, whosemaxLodis 12 (maxLodRaw = 0xc00). The new zero-LOD check inSampler::Validateruns before the address-mode check, so the sampler is rejected for its LOD and never reaches theREPEATrejection the test expects.Fix (test only):
Runs:
f5d16595a2merged ontomain16345cad6a, Ubuntu 26.04, GCC 15.2, Release,-DANYPS5_ENABLE_SPIRV_TOOLS=ON,ANYPS5_REQUIRE_VULKAN=1,-j1.agc_driver_graphicsagc_driver_graphics_maps_fallbacksampler_parameter_boundsGPUs tested: NVIDIA RTX 3070 (595.99.02), lavapipe (Mesa 26.0.3).
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T02:52:45Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The current head still overlaps the open #13145 change without a declared landing order, and the required paired AGC validation evidence for this head is not available.
What I ran
Reviewed all seven changed files at head
dfd658114df5a4324ab4236a563ab58b3e681022against base7feb37ee3e30e10139b483fb4df689d5b5b69ab8. The individual PR head merges cleanly against currentmain; a pairwise merge preview with open #13145 conflicts inSampler.cppandGuestSamplerResource.cpp. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0, Git 2.39.5. I did not build or compile.Results
Commands and unedited check output
Precheck table:
The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check 7feb37ee3e30e10139b483fb4df689d5b5b69ab8...dfd658114df5a4324ab4236a563ab58b3e681022/usr/bin/python3 tools/check_conventions.py --base 7feb37ee3e30e10139b483fb4df689d5b5b69ab8 --head dfd658114df5a4324ab4236a563ab58b3e681022 --title fix(agc): validate guest sampler parameter bounds and unnormalized coordinate constraints --body /tmp/anyps5-pr-precheck/12904-20261103/pr-body.md/usr/bin/python3 tools/pr_abi_audit.py --base 7feb37ee3e30e10139b483fb4df689d5b5b69ab8 --head dfd658114df5a4324ab4236a563ab58b3e681022 --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 12904 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/12904-20261103/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./usr/bin/python3 /tmp/anyps5-pr-precheck/12904-20261103/head-dfd658114df5-24c2f242/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/12904-20261103/head-dfd658114df5-24c2f242 --json core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp core/libs/prx/libSceAgcDriver/Graphics/src/Sampler.cpp core/libs/prx/libSceAgcDriver/tests/GuestSamplerResource.cpp core/libs/prx/libSceAgcDriver/tests/cmake/sampler_parameter_bounds_tests.cmake core/libs/tests/SamplerParameterBounds.cpp docs/dev/debt/libSceAgcDriver.mdNo changed Python test module in tools/ can be run as a no-build base-source control.Negative control
I could not run a negative control: the C++ test requires an exact-head build, which was not run. The author reports focused tests passing on an RTX 3070 and lavapipe, but those reports are not a paired main-versus-head validation-log comparison.
Findings
Blocking
Unresolved overlapping PR order. Open #13145 (
3217ab2466261204083091f0f3ee5b26a443782b) and this PR both change the sampler capability/validation path andGuestSamplerResource.cpp. A fresh pairwise merge preview conflicts inSampler.cppandGuestSamplerResource.cpp, while this PR still saysDepends on: none. Please coordinate with #13145’s author on which lands first, record that order inDepends on, then resolve the resulting integration against the agreed head. The repository requires overlapping PRs to agree on order and declare it.Required paired AGC validation evidence is missing. This change modifies the AGC driver. The PR describes focused tests passing on GPUs, but does not provide matching
mainand current-head logs from the same machine and GPU showing the requested-layer marker is present and no newVUID-errors were introduced. Please attach the paired logs and their exact base/head SHAs, or link existing evidence that meets those conditions.Non-blocking
CMakeLists.txtglobs and includes everytests/cmake/*.cmakefragment, including the new fragment, which registerssampler_parameter_bounds.Sources
Not verified
I did not build or run CTest locally, run a negative control, or verify console behavior. I did not independently reproduce the author-reported GPU tests. The current-head pairwise integration with #13145 conflicts, and the hosted Windows check is pending.
To get this to a good state
Agree and record the order with #13145, resolve the overlapping integration, and attach paired
main/new-head AGC validation logs from the same machine and GPU, including exact SHAs and confirmation that the requested validation layer loaded and no new VUIDs appeared. Once the new head and required hosted checks are available, I will rerun the no-build precheck, stack/integration check, and exact-head diff review.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T17:57:41Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: the head declares
samplerMirrorClampToEdgetwice in two structs, so the library does not compile (by reading; not built here).What I ran
52f31a4158d6359991eec91f86263735ac8f18e4againstmain.diff.patch.samplerMirrorClampToEdgeincore/libs/prx/libSceAgcDriverwith the repository reader.Commands
Results
Contextand inVulkanDevice::StateFindings
Blocking
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp:271adds a secondbool samplerMirrorClampToEdge = false;directly after the existing one at line 269. The same happens incore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp:678, a second copy of the member inVulkanDevice::Stateafter line 676. A class cannot declare the same data member twice, so the libSceAgcDriver sources fail to compile. Fix: delete the two added lines (Context.hpp:271andVulkanDevice.cpp:678).Non-blocking
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp:2035: the head already setsstate->samplerMirrorClampToEdgeand pushes the extension name atVulkanDevice.cpp:1912-1913. The addedhasExtensionblock pushes the same extension name again. Remove it. Whether the validation layer rejects the duplicate name is not verified.core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp:4890: the assignment repeats the one at line 4888 with the same value. Remove it along with the duplicate member.diff.patchshows that change. Either the description or the diff is out of date.Not verified
SamplerParameterBounds.cpp: not built or run.files.jsonwas not opened, and the full texts infiles/were not read. The review relies ondiff.patchand the search at head.core/libs/prx/libSceAgcDriver/tests/cmake/sampler_parameter_bounds_tests.cmake: whether the parent CMake includes it is not checked.docs/dev/debt/libSceAgcDriver.mdsays.To get this to a good state
samplerMirrorClampToEdgemember inContext.hppand inVulkanDevice::State.VulkanDevice.cpp:4890and the duplicate extension push atVulkanDevice.cpp:2035.sampler_parameter_boundson the new head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T18:57:45Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: the new guest sampler LOD bias test expects rejections that
Sampler::Validatedoes not make, so it fails as written.What I ran
f85354a009(base: main)diff.patchand the head source with the reader.Results
sampler_parameter_boundstest (read only)tests/cmake/*.cmakeis globbedcheck_conventions.pyFindings
Blocking
core/libs/prx/libSceAgcDriver/tests/GuestSamplerResource.cpp:389and:393(diff.patch line 159 and 164): the test setsmaxSamplerLodBiasto 15 and then expectslodBias = 16.0fandlodBias = -16.0fto be rejected with "requests a LOD bias beyond the device limit".Sampler.cpp:13treats any bias beyondSamplerLodBiasShaderThreshold(15) as applied in the shader, andSampler.cpp:47skips the device-limit check for those. SoValidateaccepts both values,reject(GuestSamplerResource.cpp:70) throws "expected guest sampler rejection", and the test fails. The standalone test avoids this by using 14.5 under a limit of 14 (core/libs/tests/SamplerParameterBounds.cpp:205). The description saysagc_driver_graphicspasses 3/3, which does not fit this reading. Please rerun it on the new head after the fix.context.limits.maxSamplerLodBiasto 14 in that case and use14.5fand-14.5f, as the standalone test does.Non-blocking
core/libs/tests/SamplerParameterBounds.cpp:205(diff.patch line 468): a code comment. The PR checklist says code has no comments except technical-debt references. Consider removing it or moving the explanation to the debt file.core/libs/prx/libSceAgcDriver/Graphics/src/Sampler.cpp:79: the description says "Dropped unreachable clamping in constructor". The diff shows no removed clamping in the constructor; the only constructor change ismaxAnisotropybecoming1.0fwhen anisotropy is off. Consider correcting the description.Not verified
docs/dev/debt/libSceAgcDriver.md:651. I did not check it against hardware.Sampler.cppwas read through the diff and at head lines 56 to 90.GuestSamplerResource.cpp,SamplerParameterBounds.cpp, the CMake fragment and the debt doc were read through the diff, with targeted searches. No file was read in full.To get this to a good state
GuestSamplerResource.cpp(see Blocking).agc_driver_graphicsandsampler_parameter_boundson the new head and report the output.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T04:52:55Z.
Review: APPROVED
Reviewed — looks good
The sampler validation changes and added tests look sound at the reviewed head; no blocking defects were found in the changed code.
What I ran
Reviewed head
ff033200c460f8fdba1a1d6eebb36708efa5a603usingrepo_read.pyagainst the prepared diff and repository source. No test or build commands were run. The author reports standalone and GPU tests passing; those runs were not independently verified.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Tests, build, CI, and console behavior were not run or independently confirmed. Read:
Sampler.cpp,GuestSamplerResource.cpp,sampler_parameter_bounds_tests.cmake,SamplerParameterBounds.cpp, andlibSceAgcDriver.md. No changed files were excluded; all five files listed as reviewed in the manifest were read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T00:07:12Z.
Review: COMMENTED
Actionable comments posted: 1
Architecture findings (1)
Advisory architecture findings (1)
935f434e-0809-422a-af96-2e3e50fdd4b5Reviewing files that changed from the base of the PR and between
265dbcfee7andfad18d1629.core/libs/prx/libSceAgcDriver/Graphics/src/Sampler.cppcore/libs/prx/libSceAgcDriver/tests/GuestSamplerResource.cppcore/libs/prx/libSceAgcDriver/tests/cmake/sampler_parameter_bounds_tests.cmakecore/libs/tests/SamplerParameterBounds.cppdocs/dev/debt/libSceAgcDriver.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T00:20:17Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The anisotropy bound check accepts a NaN ratio, allowing an invalid Vulkan sampler to reach
vkCreateSampler.What I ran
Reviewed head
fad18d16296084a3f1b4759f414a29d2936003fd. No commands or tests were run;repo_read.pywas used to inspect the prepared diff and repository files at the pinned head. The full text ofSampler.cpp,SamplerParameterBounds.cpp, and the new CMake test file was read; relevant ranges ofGuestSamplerResource.cppandGuestSamplerResourcetests were read, along with the changed documentation entry. No files were excluded by rule in the manifest.Results
Negative control
Not run; no test execution was performed.
Findings
Blocking
core/libs/prx/libSceAgcDriver/Graphics/src/Sampler.cpp:90: When anisotropy is enabled,maxAnisotropy <= limitdoes not reject NaN because the comparison is false; the lower-bound check on line 91 also passes for NaN. The value is then copied toVkSamplerCreateInfo::maxAnisotropy, violating its required finite range and potentially causing sampler creation or validation failure. Reject non-finite anisotropy values when anisotropy is enabled (for example, checkstd::isfinitebefore the bounds checks), and add a NaN case to the bounds tests.Non-blocking
None.
Sources
Not verified
The full
GuestSamplerResource.cppand fullGuestSamplerResource.cpptest file were not read; only relevant ranges were inspected. No tests, builds, convention checks, GPU runs, or console checks were run in this review. The reported test and GPU results in the PR description were not independently verified.To get this to a good state
Reject NaN anisotropy values when anisotropy is enabled and add a regression test. Then run the sampler bounds test and relevant integration tests on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:54:34Z.
Review: COMMENTED
Sampler::Validaterejects NaN, but the shader-applied bias arm bypasses the device's range check, so both signed infinities are accepted whenShaderAppliesLodBiasis true. That path sends zero bias to Vulkan and leaves the original value to shader handling. Please decide whether this validation boundary accepts only finite values and cover each sign in the shader-applied case. The tests shown exercise NaN and finite bounds. The trial merge is clean. Please put the debt edit in a fragment. I have no paired Vulkan result for this head yet.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.