Skip to content

feat(agc): implement unnormalized S# clamp modes 4 and 5 (half border) - #14964

Open
shahulmubeen-a wants to merge 4 commits into
boykopovar:mainfrom
shahulmubeen-a:feat/agc-unnormalized-half-border
Open

shahulmubeen-a wants to merge 4 commits into
boykopovar:mainfrom
shahulmubeen-a:feat/agc-unnormalized-half-border

Conversation

@shahulmubeen-a

@shahulmubeen-a shahulmubeen-a commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What

A FORCE_UNNORMALIZED S# with clamp mode 4 (clamp-half-border) or 5 (mirror-once-half-border) on X or Y is refused today (after #14963):

guest sampler descriptor uses unnormalized coordinates with clamp mode 4 on X; only wrap, mirror, clamp-to-last-texel, mirror-once, clamp-to-border and mirror-once-border are implemented

These are the last two clamp modes an unnormalized S# refuses. The measurement is the one from #14963 (RDNA2 gfx1036 through tools/hw-oracle, image_sample_lz and image_sample_lz_o, 64x4 linear 32_FLOAT with texel 100 + x + 1000 * y, transparent black and opaque white borders, point and bilinear, a run with unequal filters and a run on a view from mip 1).

What the hardware does:

  • Point filter: mode 4 samples like mode 2 (clamp-to-last-texel) and mode 5 like mode 3 (mirror-once). It never reads the border.
  • Bilinear filter: mode 4 clamps the coordinate to [0, size of the level] and then reads the border past the edge. At or beyond an edge the result is half the edge texel and half the border colour. Mode 5 first mirrors (texel index i < 0 reads -i - 1, each tap on its own, as mode 7), then applies the same clamp at the far edge.
  • Filter choice: with unequal filters the magnification filter decides, as main already assumes for unnormalized samplers: magnification point with minification bilinear never reads the border, the reverse reads half of it.
  • Level size: on a view from mip 1 (32x2) the clamp is at 32, the size of the sampled level.
  • The texel offset is added first. Y behaves like X.
Measured rows (excerpt)

X, 64x4, v = 1.5 (row 1, texel = 1100 + x), transparent black border:

u               -64.5  -63.5   -1.0  -0.25    0.0   0.25    0.5  63.75   64.0   64.5  128.5
clamp 4 point    1100   1100   1100   1100   1100   1100   1100   1163   1163   1163   1163
clamp 4 linear    550    550    550    550    550    825   1100 872.25  581.5  581.5  581.5
clamp 5 point    1163   1163   1100   1100   1100   1100   1100   1163   1163   1163   1163
clamp 5 linear  581.5   1163 1100.5   1100   1100   1100   1100 872.25  581.5  581.5  581.5

With the white border: 550.5, 825.25, 872.5 and 582 in place of 550, 825, 872.25 and 581.5.

Y (u = 10.5, texel = 110 + 1000 * y), linear, transparent black: clamp 4 -9.5:55 0.0:55 0.5:110 3.75:2332.5 4.0:1555 8.5:1555; clamp 5 -9.5:1555 -3.5:3110 -1.0:610 0.0:110 4.5:1555.

Offsets (image_sample_lz_o, linear, transparent black): clamp 4 1.5 + (-3):550 -1.5 + 3:1101 62.5 + 3:581.5; clamp 5 2.5 + (-5):1102 63.5 + 1:581.5.

Unequal filters, clamp 4, transparent black, -1.0 / 0.25 / 64.0: magnification point, minification bilinear 1100 / 1100 / 1163; magnification bilinear, minification point 550 / 825 / 581.5.

View from mip 1 (32x2, v = 0.5, texel 5000 + x), linear, transparent black: clamp 4 -0.25:2500 0.25:3750 31.75:3773.25 32.0:2515.5 64.0:2515.5; clamp 5 -32.5:2515.5 -31.5:5031 0.0:5000 32.5:2515.5.

How the change implements this:

The model check in #14963's first comment (fold to the float below -c, at least 0.5, this clamp, then the host sampler with 8-bit bilinear weights) matches all 1660 measured values, including every mode 4 and 5 row and the mip-1 view.

The debt/libSceAgcDriver.md entry now covers modes 4 and 5; with this change no clamp mode throws for unnormalized coordinates. Anisotropy and MC_COORD_TRUNC still do.

No title I know of uses these modes, so Unblocks is none.

Tested

Windows 11 Pro 26300, NVIDIA GeForce RTX 4070 Ti SUPER (610.88), WinLibs GCC 15.2.0, Release. Tested head: 51aaebd on c1baa5b (#14963) on #11126's head 1c9c1fa.

  • agc_driver_image_sample_unnormalized gains six mode 4 and 5 samplers, checked like the others (all sample instructions, 1-level and 4-level views, and the view from mip 1, whose 6x3 size the clamp has to use):

    • bilinear clamp-half-border on X and Y, opaque white;
    • point clamp-half-border on X with mirror-once-half-border on Y, opaque white;
    • bilinear mirror-once-half-border on X with clamp-half-border on Y, transparent black;
    • point mirror-once-half-border on X with clamp-half-border on Y, opaque black;
    • bilinear mirror on X with mirror-once-half-border on Y, opaque black;
    • point magnification and bilinear minification with clamp-half-border on X and Y, which must sample as point.

    The reference clamps a bilinear coordinate on a mode 4 axis to [0, size] and on a mode 5 axis to [-size, size] before the footprint, mirrors index i < 0 on mode 5, and returns the border colour past the edge for a bilinear mode 4 or 5.

    • With the sources of c1baa5b, it fails with guest sampler descriptor uses unnormalized coordinates with clamp mode 4 on X; only wrap, mirror, clamp-to-last-texel, mirror-once, clamp-to-border and mirror-once-border are implemented.
    • With SpirvImageEmitter.cpp from c1baa5b (no clamp in the shader), it fails with image_sample_lz, bilinear clamp-half-border on X and Y, opaque white, 1-level image: (-1.000000, 2.500000) offset (0, 0) component 0 is 255.000000, expected 127.500000.
  • agc_driver_graphics (the sampler decode test) expects modes 4 and 5 to decode to clamp-to-border with a bilinear magnification filter and clamp-to-edge with a point one, each with the other minification filter. With the sources of c1baa5b it fails with the same mode 4 refusal.

  • I ran 84 sampling and shader tests with ctest -V, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1 on main 926f7dd and on c1baa5b and 51aaebd. The regex was sample|gather|sampler|shader_memory|offset|unnormalized|shader_disk_cache|on_line|on_plane|on_volume|lod|^agc_driver_graphics$.

    • The layer was loaded in every run: there is no was not found but was requested, and each log has the same 9 validation warnings (Undefined-Value-ShaderOutputNotConsumed-DynamicRendering).
    • No log has a VUID- error.
    • Every run passes 83 and skips agc_driver_sample_order_grid_reference, which skips itself on this device (it does not keep depth at custom sample locations).
  • Retested on the head with main merged in (05700f8, main ef0d852): the same regex now matches 104 tests. Run with the validation layer, which VK_LOADER_DEBUG=layer shows inserted as an instance and a device layer: 103 pass and agc_driver_sample_order_grid_reference skips itself. No VUID- lines.

  • tools/check_conventions.py --base origin/main passes.

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: feat(agc): sample unnormalized S#s with mirror and mirror-once clamp modes #11126, feat(agc): implement unnormalized S# clamp mode 7 (mirror-once-border) #14963
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti SUPER, driver 610.88, Windows 11 Pro 26300 (tests); AMD Radeon Graphics iGPU of a Ryzen 9 7950X (gfx1036), AMD Windows driver, for the oracle measurement
  • AI-assisted: yes (written with Claude Code; I reviewed and ran it)

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

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

Pull request Conflicting files (lines on main) Same exports Same new files
PR 12662 core/shader/recompiler/PipelineSpecialization.hpp L51
PR 12980 core/shader/recompiler/PipelineSpecialization.hpp L51

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 907 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 5021 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 5371 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 5609 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6186 docs/dev/debt/libSceAgcDriver.md
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6412 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6488 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6804 core/libs/prx/libSceAgcDriver/Graphics/src/GuestSamplerResource.cpp
core/libs/prx/libSceAgcDriver/tests/GuestSamplerResource.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6808 docs/dev/debt/libSceAgcDriver.md
PR 6987 docs/dev/debt/libSceAgcDriver.md
PR 6989 docs/dev/debt/libSceAgcDriver.md
PR 6995 docs/dev/debt/libSceAgcDriver.md
PR 7002 docs/dev/debt/libSceAgcDriver.md
PR 7085 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7223 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 7256 docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7668 docs/dev/debt/libSceAgcDriver.md
PR 7689 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 8707 docs/dev/debt/libSceAgcDriver.md
PR 9020 docs/dev/debt/libSceAgcDriver.md
PR 9183 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 9318 docs/dev/debt/libSceAgcDriver.md
PR 9335 docs/dev/debt/libSceAgcDriver.md
PR 9356 docs/dev/debt/libSceAgcDriver.md
PR 9387 docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9672 docs/dev/debt/libSceAgcDriver.md
PR 9673 docs/dev/debt/libSceAgcDriver.md
PR 9675 docs/dev/debt/libSceAgcDriver.md
PR 9700 docs/dev/debt/libSceAgcDriver.md
PR 9748 docs/dev/debt/libSceAgcDriver.md
PR 9852 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
PR 9889 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 9895 docs/dev/debt/libSceAgcDriver.md
PR 9897 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
PR 9898 docs/dev/debt/libSceAgcDriver.md
PR 9915 docs/dev/debt/libSceAgcDriver.md
PR 9950 docs/dev/debt/libSceAgcDriver.md
PR 10049 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10193 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10233 docs/dev/debt/libSceAgcDriver.md
PR 10256 docs/dev/debt/libSceAgcDriver.md
PR 10359 docs/dev/debt/libSceAgcDriver.md
PR 10743 docs/dev/debt/libSceAgcDriver.md
PR 10867 core/libs/prx/libSceAgcDriver/tests/execution/ImageSampleUnnormalized.cpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 11825 docs/dev/debt/libSceAgcDriver.md
PR 11998 docs/dev/debt/libSceAgcDriver.md
PR 12120 docs/dev/debt/libSceAgcDriver.md
PR 12565 docs/dev/debt/libSceAgcDriver.md
PR 12567 docs/dev/debt/libSceAgcDriver.md
PR 12790 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 13599 docs/dev/debt/libSceAgcDriver.md
PR 13707 docs/dev/debt/libSceAgcDriver.md
PR 13863 docs/dev/debt/libSceAgcDriver.md
PR 13920 docs/dev/debt/libSceAgcDriver.md
PR 13928 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13929 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13963 docs/dev/debt/libSceAgcDriver.md
PR 13994 docs/dev/debt/libSceAgcDriver.md
PR 14005 docs/dev/debt/libSceAgcDriver.md
PR 14032 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
PR 14212 docs/dev/debt/libSceAgcDriver.md
PR 14302 docs/dev/debt/libSceAgcDriver.md
PR 14311 docs/dev/debt/libSceAgcDriver.md
PR 14344 docs/dev/debt/libSceAgcDriver.md
PR 14561 docs/dev/debt/libSceAgcDriver.md
PR 14621 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
core/shader/recompiler/PipelineSpecialization.hpp
core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14702 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 14853 core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp
PR 14943 docs/dev/debt/libSceAgcDriver.md
PR 14944 core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14976 docs/dev/debt/libSceAgcDriver.md

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 51aaebd merged onto main 93dbd0f · tested 2026-11-02 06:17 UTC · 22 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,451 passed · 5 failed (0 new, 3 also fail on main, 2 unstable on main) · 45 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,501 of 3,165 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (932 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_lookup_log_fits_build 79.7 s, ⚠️ agc_driver_image_sample_unnormalized 52.9 s, ⚠️ agc_driver_graphics_maps_fallback 30.9 s, ⚠️ agc_driver_graphics 30.2 s
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 1 of the last 10 main runs
agc_submit_progress: failed in 6 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (5 IDs in 484 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (484 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 476 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (45)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fps_limit: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_o
Reproduce
git fetch origin 51aaebd7d658689b4f325fec012ff35ce1fae53a 93dbd0f82aea684e95f15f06e7d42c0064af18cf
git checkout 93dbd0f82aea684e95f15f06e7d42c0064af18cf && git merge --no-ff 51aaebd7d658689b4f325fec012ff35ce1fae53a
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@github-actions github-actions Bot added shader core/shader docs agc libSceAgc* labels Nov 2, 2026
@JJenkx

JJenkx commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

AMD check of this stack, since it was tested on NVIDIA only: Radeon RX 6700 XT (RDNA 2), AMD proprietary driver 26.10.1, Windows 11 Enterprise 10.0.22621, WinLibs GCC 15.2.0 UCRT r7, Release.

Exact head 51aaebd7d6, which includes #14963's c1baa5b783, against its base 1c9c1faf4b, #11126's head and already in main. Each was built in its own tree, and runs went through the shared GPU queue with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1.

ctest -R '(image_sample|sampler|border|clamp)' --repeat until-fail:5:

Arm Tests Result VUIDs
base 1c9c1faf4b 41 205/205 pass none
this stack 41 205/205 pass none

This covers the AMD proprietary driver on RDNA 2. RADV and a PS5 were not run.

🤖 Generated with Claude Code

@BunnyFl BunnyFl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An RDNA 4 run, to go with JJenkx's RDNA 2 one. Windows 11, AMD Radeon RX 9070 XT (RDNA 4), AMD proprietary driver 32.0.32015.7029, WinLibs GCC, BUILD_TESTING=ON, with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1.

Head 51aaebd7d6 (which carries #14963's c1baa5b783), merged into current main:

  • agc_driver_image_sample_unnormalized and agc_driver_graphics pass, with 0 VUIDs.
  • With main's GuestSamplerResource.cpp and the four recompiler files restored, both fail, with 0 VUIDs. image_sample_unnormalized stops on guest sampler descriptor uses unnormalized coordinates with clamp mode 7 on X.

So the emitted modes 4, 5 and 7 give the measured gfx1036 values on RDNA 4 as well. The half-border bilinear result and the per-tap mirroring hold on this generation too.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 2, 2026
shahulmubeen-a and others added 2 commits November 4, 2026 08:55
RDNA2 (gfx1036) mirrors texel index i < 0 to -i - 1 under clamp mode 7,
as under modes 1 and 3, and reads the border colour past the edge. Bind
clamp-to-border for a mode 7 axis and fold its coordinate with the
existing mirror specialization. Raise a folded coordinate to at least
0.5: each bilinear tap is mirrored on its own, so the tap at index -1
reads texel 0 again where clamp-to-border would read the border.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RDNA2 (gfx1036) samples clamp mode 4 like clamp-to-last-texel and mode 5
like mirror-once with a point filter. With a bilinear filter both clamp
the coordinate, mode 5 after mirroring, to [0, size of the level] and
read the border colour past the edge, so an edge sample is half texel
and half border. The magnification filter decides, as for the other
unnormalized samplers.

Bind clamp-to-border for a mode 4 or 5 axis when the magnification
filter is bilinear and clamp-to-edge otherwise, set the mirror axis bit
for mode 5, and carry the mode 4 and 5 axes in a new specialization
constant (HalfBorderUnnormalizedBase, 57728). The shader clamps those
axes to the size of level 0 of the bound view, the level an
unnormalized sample reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shahulmubeen-a
shahulmubeen-a force-pushed the feat/agc-unnormalized-half-border branch from 51aaebd to 9b4cca8 Compare November 4, 2026 03:53
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 4, 2026
@RNK123

RNK123 commented Nov 4, 2026

Copy link
Copy Markdown

RADV/RX 9060 XT: agc_driver_image_sample_unnormalized passes 3/3 on this head merged onto main, including the mode 4 and 5 half-border cases. The previous AMD report explicitly left RADV untested.

Head 9b4cca8cb6 merged onto main c2eafe4461. The existing unnormalized-sampling test passed 3/3 on main and 3/3 on the merged tree; the test fixture differs because this PR adds the half-border cases, so the baseline result does not cover those cases. No skipped case was reported. The Radeon and Khronos validation were confirmed in each run, without VUID- or SYNC-HAZARD- diagnostics. A pre-existing unrelated LSFG implicit-layer loading failure appeared on both arms; the requested Khronos layer loaded.

Sensitivity check: on the merged tree, forcing the half-border axis mask to zero at the shader-emission call made the test fail 3/3 for the bilinear X/Y clamp-half-border sample: component 0 was 255 instead of 127.5. Restoring the shader emitter passed 3/3. This is a targeted mutation, not an unmodified-main comparison for the new cases.

Host: CachyOS Linux 7.3.1-1-cachyos, GCC 16.2.1, Release, RX 9060 XT (RADV GFX1200), Mesa 26.2.5-arch3.1, Vulkan 1.4.354, Khronos validation 1.4.363.

Reproduction

Build agc_driver_image_sample_unnormalized_tests on main and the PR merged onto it, then run three times per tree:

export ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1
export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer
export VK_LAYER_PATH="$HOME/.local/share/anyps5-tester/vk-layers/usr/share/vulkan/explicit_layer.d"
ctest --test-dir build-main -V -R '^agc_driver_image_sample_unnormalized$'

Limits: one focused synthetic sampling test, no title, performance measurement or PS5 hardware. The mutation demonstrates sensitivity for the stated bilinear case, not independent confirmation of console behavior. AI-assisted independent hardware test run (GPT-6.1 Terra).

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 9b4cca8 merged onto main 1c8c0ef · tested 2026-11-04 04:37 UTC · 31 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,732 passed · 5 failed (0 new, 3 also fail on main, 2 unstable on main) · 50 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,787 of 3,842 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (952 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.5 s
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 4 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 4 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (8 IDs in 531 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (531 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 523 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
VUID-VkSamplerCreateInfo-addressModeU-01079 (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeU-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeV-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeW-parameter (1 test): agc_driver_image_gather_volume
Skipped (50)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
vide
Reproduce
git fetch origin 9b4cca8cb664e64c3b3e13e82e5df71a801f4363 1c8c0efc8c41314402e6966da5bef6ea3d639d10
git checkout 1c8c0efc8c41314402e6966da5bef6ea3d639d10 && git merge --no-ff 9b4cca8cb664e64c3b3e13e82e5df71a801f4363
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head 9b4cca8 merged onto main 1c8c0ef · tested 2026-11-04 05:33 UTC · 40 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,718 passed · 8 failed (0 new, 7 also fail on main, 1 unstable on main) · 61 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,787 of 3,842 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (952 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.4 s, ⚠️ agc_driver_image_sample_unnormalized 70.6 s, ⚠️ public_headers 69.7 s, ⚠️ agc_shader_sampler_limits 38.8 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 8 of the last 10 main runs
Failing on main too (7, not counted against this PR)
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_multisample_depth
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (8 IDs in 531 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (531 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 523 more
VUID-vkCmdCopyImage-srcImage-01548 (4 tests): agc_driver_depth_clear_hle, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (4 tests): agc_driver_depth_clear_hle, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
VUID-VkSamplerCreateInfo-addressModeU-01079 (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeU-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeV-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeW-parameter (1 test): agc_driver_image_gather_volume
Skipped (61)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_image_table_vouched_lookups: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a watched imported table cannot be vouched for
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_driver_unit_shadow_budget: skipped, the device does not import watched host memory for unit shadows
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_idle_publish_wait: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a forced watch of the import reads its submissions as CPU stores
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_storage_pending_key_refresh: skipped, refreshes over a pending key store are not testable here
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan d
Reproduce
git fetch origin 9b4cca8cb664e64c3b3e13e82e5df71a801f4363 1c8c0efc8c41314402e6966da5bef6ea3d639d10
git checkout 1c8c0efc8c41314402e6966da5bef6ea3d639d10 && git merge --no-ff 9b4cca8cb664e64c3b3e13e82e5df71a801f4363
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@BunnyFl

BunnyFl commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@shahulmubeen-a @danielhorngt a heads-up: this PR and #14621 now take the same specialization constant base.

On main b11c7bf84f the last base is VolumeGatherBase = 57664u (:53). Both PRs add their line right after it. I merged #14964 and then #14621 onto that main, and git stops with a conflict in PipelineSpecialization.hpp, as well as DescriptorBindingBuilder.cpp and docs/dev/debt/libSceAgcDriver.md. So the IDs won't be shared silently, but whichever merges second has to resolve it. Its author then needs the next free base (57792 if nothing else has taken it) and a rerun of its tests. Could you two agree which goes first, and record it with Depends on on the other?

@BunnyFl BunnyFl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@shahulmubeen-a re-checked at 9b4cca8cb6. git range-diff of my approved 51aaebd7d6 against this head shows one change to this PR's own patch: HalfBorderUnnormalizedBase moves from 57600 to 57728 (core/shader/recompiler/PipelineSpecialization.hpp:54), because main now uses 57600 for MinLodBase (:52). #14963's commit underneath is unchanged.

What I ran: head 9b4cca8cb6 merged onto main b11c7bf84f (merge bd34bba607), Windows 11, WinLibs GCC, Release, AMD Radeon RX 9070 XT, driver 32.0.32015.12012, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:

  • agc_driver_image_sample_unnormalized: passes, including the mode 4 and 5 half-border cases. The log has no VUID-, SYNC-HAZARD or missing-layer line.
  • check_conventions.py --base upstream/main passes.
  • pr_overlap.py --branch: 63 open PRs touch the same files, none the same exports. The 57728 clash with #14621 is in my note above. Whichever of you lands second takes the next free base.

@shahulmubeen-a

Copy link
Copy Markdown
Contributor Author

@BunnyFl thanks for catching this. @danielhorngt, a proposal for the order: #14964 first, then #14621 on top of it.

If that works for you, #14621 would move SamplerLodBiasBase to 57792 and record Depends on: #14964. If #14621 is ready first, I'm happy to swap: I'll move HalfBorderUnnormalizedBase to 57792, resolve the DescriptorBindingBuilder.cpp and debt-doc conflicts, rerun the unnormalized sampler tests with the validation layer and add Depends on: #14621 here.

Written by Claude Code, verified by me.

@BunnyFl

BunnyFl commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

@shahulmubeen-a a heads-up on numbering, no change asked of this PR as it stands: HalfBorderUnnormalizedBase = 57728u (core/shader/recompiler/PipelineSpecialization.hpp:54 at 9b4cca8cb6) is the same base #14621 takes for SamplerLodBiasBase at the same line, and #10489 also moves FmaskFormatBase to 57728u. All three are free on main, where the last base is VolumeGatherBase = 57664u. Whichever lands second will need a free base. main has no static_assert that these 64-wide ranges don't overlap (core/shader/recompiler/PipelineSpecialization.hpp:48-53 on main): a merge resolution that keeps both lines would still build. cc @danielhorngt (#14621), @EagleBearerYS (#10489).

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 5, 2026
@oneandonlydean oneandonlydean self-assigned this Nov 5, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 6, 2026
@shahulmubeen-a

Copy link
Copy Markdown
Contributor Author

Thanks man

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 05700f8 merged onto main f8167f3 · tested 2026-11-06 05:07 UTC · 21 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,926 passed · 4 failed (0 new, 3 also fail on main, 1 unstable on main) · 56 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,986 of 4,158 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (987 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_image_sample_unnormalized 33.2 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 1 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (9 IDs in 595 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (595 tests): agc_driver, agc_driver_address_draw_space_reuse, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, and 587 more
VUID-VkShaderModuleCreateInfo-pCode-08737 (14 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_f16_fma_denormal_modes, agc_driver_f16_fma_invalid_nan, agc_driver_float16_fma_rounding, agc_driver_float16_modifiers, agc_driver_float16_native, and 6 more
VUID-VkShaderModuleCreateInfo-pCode-08739 (14 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_f16_fma_denormal_modes, agc_driver_f16_fma_invalid_nan, agc_driver_float16_fma_rounding, agc_driver_float16_modifiers, agc_driver_float16_native, and 6 more
VUID-VkShaderModuleCreateInfo-pCode-08741 (14 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_f16_fma_denormal_modes, agc_driver_f16_fma_invalid_nan, agc_driver_float16_fma_rounding, agc_driver_float16_modifiers, agc_driver_float16_native, and 6 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
VUID-VkPipelineShaderStageCreateInfo-module-parameter (1 test): agc_driver_float16_unused_nan_payloads
VUID-VkPipelineShaderStageCreateInfo-pSpecializationInfo-06849 (1 test): agc_driver_float16_unused_nan_payloads
Skipped (56)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_net_ctl_disconnected: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_device_capability: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_disabled: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_four_k: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_height_only: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_limit: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_malformed: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_host_resolution_width_only: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan de
Reproduce
git fetch origin 05700f8da77e15b9000cdf80d22f5b54f529d9d8 f8167f32cd3795a776b955aa10e8284d4de67aef
git checkout f8167f32cd3795a776b955aa10e8284d4de67aef && git merge --no-ff 05700f8da77e15b9000cdf80d22f5b54f529d9d8
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants