feat(agc): support unnormalized MC coordinate precision #20891

Open
JJenkx wants to merge 7 commits from upstream-pr/20891 into main
JJenkx commented 2026-11-15 17:38:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-15T17:38:16Z.


What

Earlier review follow-up e181aaff2ebe: MC_COORD_TRUNC combined with texel offsets now throws until native offset/quantization ordering is measured, with 24 compiler regression cases. Existing offset-free MC coverage is preserved.

A proven unnormalized sampler using MC_COORD_TRUNC currently throws. Direct 1D/2D samples now apply the measured coordinate transform: 8 fractional bits with ties-even rounding, or floor with TRUNC_COORD, followed by half-texel truncation for bilinear MC. Clamp modes 0, 1, 2, 3 and 6 are supported. Negative mirrored point indices map to exact texel centers; linear mirroring uses the reflected quantized coordinate. Large finite coordinates avoid scaling overflow.

The existing sampler-transform specialization word carries MC/TRUNC/effective-mag-filter state. Converted filtering and min/max reduction retain explicit refusals. Normalized MC precision remains unimplemented. Native evidence is local RX 6650 XT gfx1032, not PS5 gfx1013 equivalence: 240 initialized procedural RGBA8 dispatches and 5,632 prospective vector checks across ties, both axes, border and mirrored coordinates. Unmeasured formats, 1D native behavior and other gaps are recorded in debt.

Native measurement inputs, kernels and prospective checks, mirror-composition evidence. Structural shader fixtures follow bounded identity-copy chains while retaining their coordinate, arithmetic, dimension, LOD and NoContraction assertions.

Tested

Precision-boundary regression qualification (2026-11-23), public head d226a8de67d6.

Added the four coordinate pairs proposed by @Helldiverr in the R9700 follow-up: 1 - 3/1024, 0.5 - 3/1024, 1 - 3/2048, and 0.5 - 3/2048, each as {x, x}. All 128 original points and the 1e-4 tolerance stay intact; successful MC runs now report the actual 132-pair count. Production code is unchanged.

Same byte-identical fixture source and 41 physical Vulkan cases on RX 6650 XT/RADV Mesa 26.3.1, Linux 7.3.5, with required Vulkan, no shader caches and Khronos validation 1.4.363:

Frozen arm Result
Main production d795f93238fd plus test-only fixture/registration changes (f8823873c4b8) 1 ordinary pass, all 40 MC cases refuse as expected
Previously qualified main+topic integration plus the identical public test delta (0f9ee68369a5) 41/41 pass
Same composition with only the 7-bit scale/reciprocal mutation (493f1a8c6f41) 21 pass; all 20 non-TRUNC cases fail
Same composition with only the 9-bit scale/reciprocal mutation (fde9b61c5a89) 21 pass; all 20 non-TRUNC cases fail

Every 7-bit failure reaches a newly added point (lane 128 or later), closing the original coverage gap. TRUNC cases deliberately remain insensitive to precision. Physical device and actual layer insertion are checked in every process; zero skips, VUIDs or synchronization-hazard identifiers. Frozen banks remain unchanged, builder source/configuration restored. These are focused builds, not new complete SDK/native-title or CPU shader-suite qualifications.

A separate direct native gfx1032 2D unnormalized-MC probe measures the four new points over five clamp modes, both filters and both TRUNC settings: 20 configurations, 40 dispatches, with repeated lanes and dispatches agreeing. Raw samples match predictions saved before execution for the 8-bit model (maximum absolute component error 1.1102826e-08). Both 7-bit and 9-bit models differ above 1e-4 in all 10 non-TRUNC native configurations. This extends local RX 6650 XT evidence; it does not establish PS5 gfx1013, native 1D or tie-rule equivalence. Native HSA does not use Vulkan validation.

Helldiverr independently reports Windows 11 Pro 26300, AMD Radeon AI PRO R9700/gfx1201, driver 32.0.31044.16, GCC 15.2 Release and Khronos 1.4.363: head e181aaff2e merged onto main dfe428e798 as 24e377815d, 41/41 in three runs with per-process validation insertion and zero VUIDs. The same report's private four-point extension passes and makes both precision mutations fail all 20 non-TRUNC cases. Those are contributor-reported Windows results; the native gfx1201 sweep was not completed. The existing 1e-4 bound is retained.

Source bundles/patches, exact pins, builds, raw verbose CTest/JUnit, prospective predictions, native raw samples/kernels and independent review, SHA256 ae44471f0d36170245a74e35d4a5056b56e3c256399900b437c03e24e1cf20b3; uploaded archive downloaded and all 107 manifest payloads verified. Local conventions checks pass with zero errors and the existing debt-length warning. No title, FPS/speedup or console-equivalence claim.

Earlier 2026-11-23 review correction: public head e181aaff2ebe, privately integrated onto main d795f93238fd as b387b4aca5e2. The prior 961d429793d8 plus the new CPU witness fails as expected; current main and the fixed integration pass the shader-memory suite, including all 24 new cases on the integration. Same GPU fixture source/registrations on both arms: main plus probe-only instrumentation has one ordinary pass and 40 expected MC refusals; fixed integration passes all 41. RX6650XT/RADV, required Vulkan/no shader cache, validation1.4.363: 41 physical selections and layer insertions per arm, zero skips/VUIDs, frozen banks unchanged, builder restored. Conventions: zero errors, existing debt-length warnings. No new title/FPS/console-equivalence/Windows claim. Full qualification evidence, SHA256 f18d913292cbe61ce26e855f8d48a4f4361584804e74c0bfc3bfd0d4067fcc88 (download and all34 payload hashes verified). Integration merge is private; published branch remains a linear follow-up.

Historical qualifications below retain their original source pins.

Refreshed without merge commits onto measured main 0694c4cbd6f2. Upstream advanced to 1ac29cd4105b during qualification; fresh local merge-tree checks are clean against that tip. The newer main was not rebuilt in this run; the measured pins below are unchanged. Main's non-MC mirror-once-border (clamp 7) support and minimum-0.5 mirrored coordinate fold are retained; MC clamp 7 remains explicitly unsupported in the descriptor proof. The refreshed production transform selects the existing non-MC fold independently from the measured MC fold.

Linux, RX 6650 XT / RADV Mesa 26.2.7, kernel 7.2.14-arch1-1, GCC 16.2.1. Validation layer 1.4.363 (headers 1.4.335), ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, CTest verbose, frozen independent binaries/libraries. No skips or VUIDs in any current arm; logs confirm layer insertion. Main's own five focused checks pass.

Current source pins, exact patches, configure/build/full test logs, JUnit and binary hashes. Archive SHA-256 a210aa8dfade7211557d739429fb475803f0a17dd92292769345000011f689a9, downloaded archive and all 54 payload hashes verified. These are focused-target builds and regression runs, not a new full-SDK or native-game qualification. No new Windows/macOS, title-unblock or performance claim. The physical Windows worker remains user-paused. Changed-file convention checks report zero errors, with one debt-length warning. The global debt-fold command encounters an unchanged main NKWebKit fragment selector error, recorded separately in the bundle.

Exact refreshed head edce8b2bc190d4847a4b0d6c7d7d663e337aad13:

Frozen libraries / identical feature fixtures Result
main 0694c4c 4 pass / 41 expected unsupported-MC failures
change 45/45 pass

The negative-control dynamic library path and raw AGC hash are checked; all failures match the expected unsupported cases. Candidate CPU shader fixtures remain candidate-compiled in that identical-executable comparison; the separate five-check main arm uses main's own build. The GPU matrix contains 40 weighted MC configurations with 128 coordinate pairs each, scalar 1D and 2D, both filters and TRUNC values. Existing non-MC unnormalized sampling, including mirror-border, remains covered.

Both full CPU shader-memory tests pass with SPIRV-Tools ON (included above) and OFF (2/2). The identity-copy fix is retained; no assertion is relaxed to accept different arithmetic or a bypassed offset.

Historical broader matched full-SDK qualification remains available in 47-case original validation; those archived pins are historical, not the new heads above.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.3.1, Linux 7.3.5; native reference gfx1032 HSA; contributor AMD Radeon AI PRO R9700, driver 32.0.31044.16, Windows 11 Pro 26300 (linked report)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5325344290 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20891). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-11-15T17:38:16Z. --- ### What Earlier review follow-up `e181aaff2ebe`: MC_COORD_TRUNC combined with texel offsets now throws until native offset/quantization ordering is measured, with 24 compiler regression cases. Existing offset-free MC coverage is preserved. A proven unnormalized sampler using MC_COORD_TRUNC currently throws. Direct 1D/2D samples now apply the measured coordinate transform: 8 fractional bits with ties-even rounding, or floor with TRUNC_COORD, followed by half-texel truncation for bilinear MC. Clamp modes 0, 1, 2, 3 and 6 are supported. Negative mirrored point indices map to exact texel centers; linear mirroring uses the reflected quantized coordinate. Large finite coordinates avoid scaling overflow. The existing sampler-transform specialization word carries MC/TRUNC/effective-mag-filter state. Converted filtering and min/max reduction retain explicit refusals. Normalized MC precision remains unimplemented. Native evidence is local RX 6650 XT gfx1032, not PS5 gfx1013 equivalence: 240 initialized procedural RGBA8 dispatches and 5,632 prospective vector checks across ties, both axes, border and mirrored coordinates. Unmeasured formats, 1D native behavior and other gaps are recorded in debt. [Native measurement inputs, kernels and prospective checks](https://github.com/JJenkx/AnyPS5/releases/download/sampler-mc-coord-trunc-gfx1032-20261115/mc-coord-trunc-gfx1032-measurements.zip), [mirror-composition evidence](https://github.com/JJenkx/AnyPS5/releases/download/sampler-mc-coord-trunc-gfx1032-20261115/mc-coord-trunc-gfx1032-mirror-composition.zip). Structural shader fixtures follow bounded identity-copy chains while retaining their coordinate, arithmetic, dimension, LOD and NoContraction assertions. ### Tested **Precision-boundary regression qualification (2026-11-23), public head `d226a8de67d6`.** <!-- pr20891-quantizer-boundaries-d226a8de-20261123 --> Added the four coordinate pairs proposed by @Helldiverr in [the R9700 follow-up](https://github.com/boykopovar/AnyPS5/pull/20891#issuecomment-7104227369): `1 - 3/1024`, `0.5 - 3/1024`, `1 - 3/2048`, and `0.5 - 3/2048`, each as `{x, x}`. All 128 original points and the `1e-4` tolerance stay intact; successful MC runs now report the actual 132-pair count. Production code is unchanged. Same byte-identical fixture source and 41 physical Vulkan cases on RX 6650 XT/RADV Mesa 26.3.1, Linux 7.3.5, with required Vulkan, no shader caches and Khronos validation 1.4.363: | Frozen arm | Result | |---|---| | Main production `d795f93238fd` plus test-only fixture/registration changes (`f8823873c4b8`) | 1 ordinary pass, all 40 MC cases refuse as expected | | Previously qualified main+topic integration plus the identical public test delta (`0f9ee68369a5`) | 41/41 pass | | Same composition with only the 7-bit scale/reciprocal mutation (`493f1a8c6f41`) | 21 pass; all 20 non-TRUNC cases fail | | Same composition with only the 9-bit scale/reciprocal mutation (`fde9b61c5a89`) | 21 pass; all 20 non-TRUNC cases fail | Every 7-bit failure reaches a newly added point (lane 128 or later), closing the original coverage gap. TRUNC cases deliberately remain insensitive to precision. Physical device and actual layer insertion are checked in every process; zero skips, VUIDs or synchronization-hazard identifiers. Frozen banks remain unchanged, builder source/configuration restored. These are focused builds, not new complete SDK/native-title or CPU shader-suite qualifications. A separate direct native gfx1032 2D unnormalized-MC probe measures the four new points over five clamp modes, both filters and both TRUNC settings: 20 configurations, 40 dispatches, with repeated lanes and dispatches agreeing. Raw samples match predictions saved before execution for the 8-bit model (maximum absolute component error `1.1102826e-08`). Both 7-bit and 9-bit models differ above `1e-4` in all 10 non-TRUNC native configurations. This extends local RX 6650 XT evidence; it does not establish PS5 gfx1013, native 1D or tie-rule equivalence. Native HSA does not use Vulkan validation. Helldiverr independently reports Windows 11 Pro 26300, AMD Radeon AI PRO R9700/gfx1201, driver 32.0.31044.16, GCC 15.2 Release and Khronos 1.4.363: head `e181aaff2e` merged onto main `dfe428e798` as `24e377815d`, 41/41 in three runs with per-process validation insertion and zero VUIDs. The same report's private four-point extension passes and makes both precision mutations fail all 20 non-TRUNC cases. Those are contributor-reported Windows results; the native gfx1201 sweep was not completed. The existing `1e-4` bound is retained. [Source bundles/patches, exact pins, builds, raw verbose CTest/JUnit, prospective predictions, native raw samples/kernels and independent review](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261122/pr20891-quantizer-boundaries-d226a8de-linux-20261123.tar.gz), SHA256 `ae44471f0d36170245a74e35d4a5056b56e3c256399900b437c03e24e1cf20b3`; uploaded archive downloaded and all 107 manifest payloads verified. Local conventions checks pass with zero errors and the existing debt-length warning. No title, FPS/speedup or console-equivalence claim. **Earlier 2026-11-23 review correction:** public head `e181aaff2ebe`, privately integrated onto main `d795f93238fd` as `b387b4aca5e2`. The prior `961d429793d8` plus the new CPU witness fails as expected; current main and the fixed integration pass the shader-memory suite, including all 24 new cases on the integration. Same GPU fixture source/registrations on both arms: main plus probe-only instrumentation has one ordinary pass and 40 expected MC refusals; fixed integration passes all 41. RX6650XT/RADV, required Vulkan/no shader cache, validation1.4.363: 41 physical selections and layer insertions per arm, zero skips/VUIDs, frozen banks unchanged, builder restored. Conventions: zero errors, existing debt-length warnings. No new title/FPS/console-equivalence/Windows claim. [Full qualification evidence](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261122/pr20891-mc-offset-proof-e181aaff-linux-20261123.tar.gz), SHA256 `f18d913292cbe61ce26e855f8d48a4f4361584804e74c0bfc3bfd0d4067fcc88` (download and all34 payload hashes verified). Integration merge is private; published branch remains a linear follow-up. Historical qualifications below retain their original source pins. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Refreshed without merge commits onto measured main `0694c4cbd6f2`. Upstream advanced to `1ac29cd4105b` during qualification; fresh local merge-tree checks are clean against that tip. The newer main was not rebuilt in this run; the measured pins below are unchanged. Main's non-MC mirror-once-border (clamp 7) support and minimum-0.5 mirrored coordinate fold are retained; MC clamp 7 remains explicitly unsupported in the descriptor proof. The refreshed production transform selects the existing non-MC fold independently from the measured MC fold. Linux, RX 6650 XT / RADV Mesa 26.2.7, kernel 7.2.14-arch1-1, GCC 16.2.1. Validation layer 1.4.363 (headers 1.4.335), `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer`, CTest verbose, frozen independent binaries/libraries. No skips or VUIDs in any current arm; logs confirm layer insertion. Main's own five focused checks pass. [Current source pins, exact patches, configure/build/full test logs, JUnit and binary hashes](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/sampler-current-main0694-refresh-20261116.tar.gz). Archive SHA-256 `a210aa8dfade7211557d739429fb475803f0a17dd92292769345000011f689a9`, downloaded archive and all 54 payload hashes verified. These are focused-target builds and regression runs, not a new full-SDK or native-game qualification. No new Windows/macOS, title-unblock or performance claim. The physical Windows worker remains user-paused. Changed-file convention checks report zero errors, with one debt-length warning. The global debt-fold command encounters an unchanged main NKWebKit fragment selector error, recorded separately in the bundle. Exact refreshed head `edce8b2bc190d4847a4b0d6c7d7d663e337aad13`: | Frozen libraries / identical feature fixtures | Result | |---|---| | main 0694c4c | 4 pass / 41 expected unsupported-MC failures | | change | 45/45 pass | The negative-control dynamic library path and raw AGC hash are checked; all failures match the expected unsupported cases. Candidate CPU shader fixtures remain candidate-compiled in that identical-executable comparison; the separate five-check main arm uses main's own build. The GPU matrix contains 40 weighted MC configurations with 128 coordinate pairs each, scalar 1D and 2D, both filters and TRUNC values. Existing non-MC unnormalized sampling, including mirror-border, remains covered. Both full CPU shader-memory tests pass with SPIRV-Tools ON (included above) and OFF (2/2). The identity-copy fix is retained; no assertion is relaxed to accept different arithmetic or a bypassed offset. Historical broader matched full-SDK qualification remains available in [47-case original validation](https://github.com/JJenkx/AnyPS5/releases/download/sampler-mc-coord-trunc-gfx1032-20261115/mc-coord-trunc-linux-validation.zip); those archived pins are historical, not the new heads above. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.3.1, Linux 7.3.5; native reference gfx1032 HSA; contributor AMD Radeon AI PRO R9700, driver 32.0.31044.16, Windows 11 Pro 26300 (linked report) - [x] AI-assisted: yes
MarcZX10 commented 2026-11-18 02:19:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T02:19:28Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the inspected implementation and reported validation support merging.

What I ran

Reviewed head 961d429793d81b04a59f41192e9de70a09ba72bb using the prepared diff and repo_read.py. No commands or tests were run in this session; validation details in the PR description are author-reported.

Results

Check Result Note
Diff and included changed files passed Read the implementation, harness, CMake cases and debt note.
Reported validation not run The description reports focused builds, tests and native gfx1032 evidence.
Excluded changed file not run ShaderMemory.cpp full text was excluded as too large.

Findings

Blocking

None identified in the changed code read.

Non-blocking

None.

Not verified

The full core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp was excluded and only its diff hunks were inspected, so this review does not establish that file's complete behavior. No tests were run independently. Native behavior on PS5 gfx1013, other GPUs, and unmeasured formats and sampling modes remains unverified; the PR description explicitly limits its evidence to local RX 6650 XT gfx1032 measurements.

Files read: GuestSamplerResource.cpp, GuestSamplerResource.cpp tests, ImageSampleUnnormalized.cpp, agc_driver_image_sample_mc_coord_trunc_tests.cmake, DescriptorBindingBuilder.cpp, SpirvImageEmitter.cpp, agc-unnormalized-mc-coord-trunc.md, plus description.md, commits.md, manifest.json and diff.patch. Excluded: full ShaderMemory.cpp (too large for the review folder).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5949879962 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20891#pullrequestreview-5949879962). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-18T02:19:28Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the inspected implementation and reported validation support merging. ## What I ran Reviewed head `961d429793d81b04a59f41192e9de70a09ba72bb` using the prepared diff and `repo_read.py`. No commands or tests were run in this session; validation details in the PR description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Diff and included changed files | passed | Read the implementation, harness, CMake cases and debt note. | | Reported validation | not run | The description reports focused builds, tests and native gfx1032 evidence. | | Excluded changed file | not run | `ShaderMemory.cpp` full text was excluded as too large. | ## Findings ### Blocking None identified in the changed code read. ### Non-blocking None. ## Not verified The full `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` was excluded and only its diff hunks were inspected, so this review does not establish that file's complete behavior. No tests were run independently. Native behavior on PS5 gfx1013, other GPUs, and unmeasured formats and sampling modes remains unverified; the PR description explicitly limits its evidence to local RX 6650 XT gfx1032 measurements. Files read: `GuestSamplerResource.cpp`, `GuestSamplerResource.cpp` tests, `ImageSampleUnnormalized.cpp`, `agc_driver_image_sample_mc_coord_trunc_tests.cmake`, `DescriptorBindingBuilder.cpp`, `SpirvImageEmitter.cpp`, `agc-unnormalized-mc-coord-trunc.md`, plus `description.md`, `commits.md`, `manifest.json` and `diff.patch`. Excluded: full `ShaderMemory.cpp` (too large for the review folder).
mihiii1337 commented 2026-11-23 05:04:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-23T05:04:49Z.

Review: CHANGES_REQUESTED


The offset-free MC matrix passes on Windows/Ada, but one newly accepted combination still needs to preserve the old refusal or gain native evidence. SamplerUseOffset is allowed through ProveUnnormalized, while this PR's hardware oracle and all 40 MC fixtures exclude offsets. The emitter folds the integer offset into the f32 coordinate before MC quantization. That ordering is observable: with TRUNC_COORD=1, coordinate -2^-26, and offset +1, add-first rounds to 1.0 and selects texel 1, while quantize-first produces 255/256 and selects texel 0. Before this PR every unnormalized MC case was refused.

Please reject MC+offset in the new MC gate and add a refusal regression, or provide native edge measurements and a runtime test for the ordering. The successful 3×41 RTX 4070 run does not exercise offsets and therefore does not resolve this point.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6016800178 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20891#pullrequestreview-6016800178). Originally posted by [mihiii1337](https://github.com/mihiii1337) on 2026-11-23T05:04:49Z. **Review:** CHANGES_REQUESTED --- The offset-free MC matrix passes on Windows/Ada, but one newly accepted combination still needs to preserve the old refusal or gain native evidence. `SamplerUseOffset` is allowed through `ProveUnnormalized`, while this PR's hardware oracle and all 40 MC fixtures exclude offsets. The emitter folds the integer offset into the f32 coordinate before MC quantization. That ordering is observable: with TRUNC_COORD=1, coordinate `-2^-26`, and offset `+1`, add-first rounds to `1.0` and selects texel 1, while quantize-first produces `255/256` and selects texel 0. Before this PR every unnormalized MC case was refused. Please reject MC+offset in the new MC gate and add a refusal regression, or provide native edge measurements and a runtime test for the ordering. The successful 3×41 RTX 4070 run does not exercise offsets and therefore does not resolve this point. AI-assisted: yes.
mihiii1337 commented 2026-11-23 06:28:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-23T06:28:26Z.

Review: APPROVED


Re-reviewed exact head e181aaff2ebe3506883265e5cd47de8dd7b4a9b7. This resolves my offset-ordering request: ProveUnnormalized now rejects every live MC sampler that has SamplerUseOffset before MC specialization/emission, while leaving the measured offset-free path unchanged.

The regression grid covers both TRUNC values, constant and lane-dynamic offsets, and all six offset sample forms (24 refusal cases) with the specific diagnostic. The author also supplied an independent fixed-integration CPU-suite and RX 6650 XT/RADV result in the review thread. I did not execute agc_shader_memory locally on this revision; my earlier 3×41 RTX 4070 matrix remains evidence only for the byte-identical offset-free GPU path. Hosted checks on this published head are still running and remain a separate merge gate.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6017381018 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20891#pullrequestreview-6017381018). Originally posted by [mihiii1337](https://github.com/mihiii1337) on 2026-11-23T06:28:26Z. **Review:** APPROVED --- Re-reviewed exact head `e181aaff2ebe3506883265e5cd47de8dd7b4a9b7`. This resolves my offset-ordering request: `ProveUnnormalized` now rejects every live MC sampler that has `SamplerUseOffset` before MC specialization/emission, while leaving the measured offset-free path unchanged. The regression grid covers both TRUNC values, constant and lane-dynamic offsets, and all six offset sample forms (24 refusal cases) with the specific diagnostic. The author also supplied an independent fixed-integration CPU-suite and RX 6650 XT/RADV result in the review thread. I did not execute `agc_shader_memory` locally on this revision; my earlier 3×41 RTX 4070 matrix remains evidence only for the byte-identical offset-free GPU path. Hosted checks on this published head are still running and remain a separate merge gate. AI-assisted: yes.
MarcZX10 commented 2026-11-23 06:44:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T06:44:00Z.

Review: COMMENTED


Reviewed — no blocking findings

The inspected implementation has no verified blocking defect, but the full review is incomplete because ShaderMemory.cpp was excluded and no checks were run.

What I ran

Inspected the prepared diff and targeted source at head e181aaff2ebe3506883265e5cd47de8dd7b4a9b7 using the repo_read.py reader. No tests or builds were run.

Results

Check Result Note
Targeted source review passed Seven changed files inspected
Tests and build not run No local execution
Full changed-file review not run ShaderMemory.cpp excluded

Findings

Blocking

None verified in the inspected code.

Non-blocking

None.

Not verified

core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp was excluded because it was too large for the review folder. No tests, build, or runtime behavior were independently verified; the qualification claims in the description are author-reported.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6017495699 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20891#pullrequestreview-6017495699). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-23T06:44:00Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The inspected implementation has no verified blocking defect, but the full review is incomplete because `ShaderMemory.cpp` was excluded and no checks were run. ## What I ran Inspected the prepared diff and targeted source at head `e181aaff2ebe3506883265e5cd47de8dd7b4a9b7` using the `repo_read.py` reader. No tests or builds were run. ## Results | Check | Result | Note | |---|---|---| | Targeted source review | passed | Seven changed files inspected | | Tests and build | not run | No local execution | | Full changed-file review | not run | `ShaderMemory.cpp` excluded | ## Findings ### Blocking None verified in the inspected code. ### Non-blocking None. ## Not verified `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` was excluded because it was too large for the review folder. No tests, build, or runtime behavior were independently verified; the qualification claims in the description are author-reported. ## To get this to a good state Nothing is required.
mihiii1337 commented 2026-11-23 14:43:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-23T14:43:01Z.

Review: COMMENTED


Non-blocking follow-up on exact head e181aaff2ebe3506883265e5cd47de8dd7b4a9b7; my approval remains.

I independently reproduced the reported mutation-coverage gap with a CPU model using the exact 128 coordinates from this Git tree, f32 rounding, the actual 40 RGBA8 modes, and the 1e-4 comparison. The checked-in matrix detects 0/40 modes for a 7-bit quantizer and 4/40 for a 9-bit quantizer; the intended 8-bit model remains 0/40.

The proposed hardening can be reduced to two diagonal pairs without losing coverage: {1 - 3/1024, 1 - 3/1024} and {1 - 3/2048, 1 - 3/2048} make the 7-/8-/9-bit models fail 20/0/20 modes, spanning point and linear filtering, 1D and 2D, and every clamp in this fixture. Because the point boundary at 1.0 is also a half-grid boundary for linear filtering, the two analogous 0.5 - ... pairs add mutant detections but no new configuration category here. The smallest maximum channel error among a detected mode is about 0.07255, so this does not argue for tightening the tolerance.

I recommend adding those two pairs in this PR or a test-only follow-up. I do not make it a blocker: the 8-bit behavior already has native gfx1032 evidence, the new gfx1201 run supports the implementation, and this is regression sensitivity rather than a contradictory result. I did not perform a new build or GPU run for this CPU-model check.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6023618358 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20891#pullrequestreview-6023618358). Originally posted by [mihiii1337](https://github.com/mihiii1337) on 2026-11-23T14:43:01Z. **Review:** COMMENTED --- Non-blocking follow-up on exact head `e181aaff2ebe3506883265e5cd47de8dd7b4a9b7`; my approval remains. I independently reproduced the reported mutation-coverage gap with a CPU model using the exact 128 coordinates from this Git tree, f32 rounding, the actual 40 RGBA8 modes, and the `1e-4` comparison. The checked-in matrix detects 0/40 modes for a 7-bit quantizer and 4/40 for a 9-bit quantizer; the intended 8-bit model remains 0/40. The proposed hardening can be reduced to two diagonal pairs without losing coverage: `{1 - 3/1024, 1 - 3/1024}` and `{1 - 3/2048, 1 - 3/2048}` make the 7-/8-/9-bit models fail 20/0/20 modes, spanning point and linear filtering, 1D and 2D, and every clamp in this fixture. Because the point boundary at `1.0` is also a half-grid boundary for linear filtering, the two analogous `0.5 - ...` pairs add mutant detections but no new configuration category here. The smallest maximum channel error among a detected mode is about 0.07255, so this does not argue for tightening the tolerance. I recommend adding those two pairs in this PR or a test-only follow-up. I do not make it a blocker: the 8-bit behavior already has native gfx1032 evidence, the new gfx1201 run supports the implementation, and this is regression sensitivity rather than a contradictory result. I did not perform a new build or GPU run for this CPU-model check. AI-assisted: yes
mihiii1337 commented 2026-11-23 15:01:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-23T15:01:06Z.

Review: APPROVED


Re-reviewed exact head d226a8de67d6c8948d1469f091f3f4b11fee30f2. The previously approved implementation and MC+offset refusal are unchanged; this head only adds the four reported precision-boundary coordinate pairs and makes the success count dynamic.

My independent f32 CPU model using the exact fixture modes confirms the new matrix distinguishes the intended precision: the 7-bit and 9-bit quantizer mutations each fail all 20 TRUNC_COORD=0 modes, while the intended 8-bit model fails none. git diff --check passes.

I did not run a new build or GPU test. The Radeon gfx1201 41/41 run with these four added coordinates is from the contributor's report and is not counted as mine. Hosted checks for this head are pending. Within that scope, the test-coverage gap is resolved and my approval now applies to the exact head above.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6023916561 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20891#pullrequestreview-6023916561). Originally posted by [mihiii1337](https://github.com/mihiii1337) on 2026-11-23T15:01:06Z. **Review:** APPROVED --- Re-reviewed exact head `d226a8de67d6c8948d1469f091f3f4b11fee30f2`. The previously approved implementation and MC+offset refusal are unchanged; this head only adds the four reported precision-boundary coordinate pairs and makes the success count dynamic. My independent f32 CPU model using the exact fixture modes confirms the new matrix distinguishes the intended precision: the 7-bit and 9-bit quantizer mutations each fail all 20 `TRUNC_COORD=0` modes, while the intended 8-bit model fails none. `git diff --check` passes. I did not run a new build or GPU test. The Radeon gfx1201 41/41 run with these four added coordinates is from the contributor's report and is not counted as mine. Hosted checks for this head are pending. Within that scope, the test-coverage gap is resolved and my approval now applies to the exact head above. AI-assisted: yes
MarcZX10 commented 2026-11-25 09:19:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T09:19:49Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the implementation documents its measurement limits and retains refusals for unmeasured paths.

What I ran

Reviewed head d226a8de67d6c8948d1469f091f3f4b11fee30f2 from the prepared diff and targeted source reads. No tests were run. repo_read.py was used to inspect the review bundle and selected source ranges.

Results

Check Result Note
Diff and targeted source review passed Production changes and included tests reviewed
Test execution not run No test command was run
Full changed-file review not run ShaderMemory.cpp was read only around changed hunks

Findings

Blocking

None.

Non-blocking

None.

Not verified

Read: GuestSamplerResource.cpp, GuestSamplerResource tests, ShaderMemory.cpp changed-hunk ranges, the new CMake test registration, ImageSampleUnnormalized.cpp, DescriptorBindingBuilder.cpp, SpirvImageEmitter.cpp, and the new debt entry, plus the description, commits, manifest, and diff. ShaderMemory.cpp was excluded from the bundle because it was too large; only the changed-hunk ranges were read. No test execution, build, or independent hardware measurement was performed. The reported RX 6650 XT and contributor Windows qualifications are author-reported, not run in this review.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6054819404 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20891#pullrequestreview-6054819404). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T09:19:49Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the implementation documents its measurement limits and retains refusals for unmeasured paths. ## What I ran Reviewed head `d226a8de67d6c8948d1469f091f3f4b11fee30f2` from the prepared diff and targeted source reads. No tests were run. `repo_read.py` was used to inspect the review bundle and selected source ranges. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Production changes and included tests reviewed | | Test execution | not run | No test command was run | | Full changed-file review | not run | `ShaderMemory.cpp` was read only around changed hunks | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Read: `GuestSamplerResource.cpp`, `GuestSamplerResource` tests, `ShaderMemory.cpp` changed-hunk ranges, the new CMake test registration, `ImageSampleUnnormalized.cpp`, `DescriptorBindingBuilder.cpp`, `SpirvImageEmitter.cpp`, and the new debt entry, plus the description, commits, manifest, and diff. `ShaderMemory.cpp` was excluded from the bundle because it was too large; only the changed-hunk ranges were read. No test execution, build, or independent hardware measurement was performed. The reported RX 6650 XT and contributor Windows qualifications are author-reported, not run in this review. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 22:18:19 +00:00 (Migrated from github.com)

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

Review: COMMENTED


The trial merge onto a1b75b0947 was clean. I also attempted a composition with exact #20944, which conflicts in ImageSampleUnnormalized.cpp and the MC_COORD_TRUNC debt fragment. Please preserve this PR’s truncation and ties-even boundary cases when the two branches land together. The shared transform is gated to the proven unnormalized direct cases, so the normalized and unsupported controls still matter. Paired shader-memory and sampling controls are pending.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6179587520 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20891#pullrequestreview-6179587520). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:18:19Z. **Review:** COMMENTED --- The trial merge onto `a1b75b0947` was clean. I also attempted a composition with exact #20944, which conflicts in `ImageSampleUnnormalized.cpp` and the `MC_COORD_TRUNC` debt fragment. Please preserve this PR’s truncation and ties-even boundary cases when the two branches land together. The shared transform is gated to the proven unnormalized direct cases, so the normalized and unsupported controls still matter. Paired shader-memory and sampling controls are pending. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.

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

git switch 'main'
git merge --no-ff 'upstream-pr/20891'
git switch 'upstream-pr/20891'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/20891'
git switch 'upstream-pr/20891'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/20891'
git switch 'main'
git merge --squash 'upstream-pr/20891'
git switch 'main'
git merge --ff-only 'upstream-pr/20891'
git switch 'main'
git merge 'upstream-pr/20891'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!20891
No description provided.