Skip to content

test(agc): keep rectangle corner shaders valid for SPIR-V 1.3 - #8978

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
veosett:codex/rect-list-corner-spirv13
Oct 24, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
veosett:codex/rect-list-corner-spirv13

Conversation

@veosett

@veosett veosett commented Oct 21, 2026

Copy link
Copy Markdown

What

The handwritten vertex shader in agc_driver_rect_list_corner selects vec4 values with scalar boolean conditions. SPIR-V 1.3 requires matching vector conditions; Vulkan validation reports VUID-VkShaderModuleCreateInfo-pCode-08737 even though the pixel assertions and CTest pass. This is the fixture validation error reported during #8884 testing. The relevant rule is implemented in the bundled SPIRV-Tools validator.

Replicate each condition into a bvec4, exercise the existing corner and coverage assertions with SPIR-V 1.3 and also 1.4 when supported, and validate the handwritten vertex/fragment modules through the existing SPIRV-Tools API when enabled. This changes one test fixture.

Tested

Release builds of the rectangle-corner, provoking-vertex and pixel-barycentric-emulation test targets succeeded on Windows (WinLibs GCC 15.2.0 r7) and Ubuntu 24.04 WSL (GCC 13.3), with ANYPS5_ENABLE_SPIRV_TOOLS=ON and bundled dependencies.

Paired baseline: main at f894ba69d30055259a56907563f438379d1275a3 plus only the version-coverage commit b19567729a7b01a92ed2918587933e172fc6889b, retaining the original scalar conditions. Fixed: d68928050c630400811416c2d474eaf21f44903b.

Same-machine baseline/fixed comparison Baseline Fixed
Windows 11, RX 6900 XT 9 CTest passes; rectangle test logs 08737 in all 3 repeats 9 passes; zero VUIDs or validation warnings/errors
Ubuntu 24.04 WSL, lavapipe 9 CTest passes; rectangle test logs 08737 in all 3 repeats 9 passes; zero VUIDs or validation warnings/errors

Each host ran the same three tests three times, without skips. Rectangle runs covered both SPIR-V 1.3 and 1.4, selected the expected four corners, and covered 4096/4096 pixels. The neighboring tests were validation-clean on both baseline and fixed versions. A negative control retaining the scalar conditions with the new SPIRV-Tools preflight failed CTest with Expected vector sizes of Result Type and the condition to be equal on Windows.

Both versions used ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, APS5_NO_PIPELINE_JOURNAL=1, and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, with the portable layer selected by VK_LAYER_PATH. Loader logs confirmed the requested layer was inserted on both hosts; neither contained the missing-layer diagnostic. Linux explicitly selected lavapipe. Test command:

ctest --test-dir <build> -R '^(agc_driver_rect_list_corner|agc_driver_provoking_vertex|agc_driver_pixel_barycentric_emulation)$' -V --parallel 1 --timeout 30 --repeat until-fail:3

python3 tools/check_conventions.py --base origin/main passed. python3 tools/pr_overlap.py --branch codex/rect-list-corner-spirv13 --jobs 4 reported no overlap. No full CTest suite or commercial title was run.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 6900 XT, driver 32.0.21030.2001, Windows 11 Pro 10.0.26100; Mesa lavapipe / llvmpipe LLVM 20.1.2 (software Vulkan), Mesa 25.2.8-0ubuntu0.24.04.4, Ubuntu 24.04 WSL
  • AI-assisted: yes

@github-actions github-actions Bot added the agc libSceAgc* label Oct 21, 2026
@DavidSamir

Copy link
Copy Markdown
Contributor

Independent run on AMD. Windows 11 Pro 26200, AMD Radeon 680M (RDNA 2 iGPU), AMD driver 32.0.21030.2001, WinLibs GCC 15.2.0 r7, Release, Khronos validation layer from SDK 1.4.363 (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation), plus ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1.

ctest -R '^agc_driver_rect_list_corner$' -V:

  • main 1ff5c8ac5: passes, but logs VUID-VkShaderModuleCreateInfo-pCode-08737, Expected vector sizes of Result Type and the condition to be equal: Select (%24 = OpSelect %v4float %18 %23 %22). 2 VUID- lines.
  • This PR merged into the same main: passes, 0 VUID- lines, and no was not found but was requested by env var VK_INSTANCE_LAYERS.

AI-assisted: yes

@adriadam10 adriadam10 self-assigned this Oct 23, 2026
@adriadam10
adriadam10 merged commit 39a36bb into boykopovar:main Oct 24, 2026
11 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked: the OpSelect conditions are now bvec4, SPIR-V 1.3 and 1.4 are both exercised, and the SPIRV-Tools preflight throws on invalid modules, so the scalar version would fail it. DavidSamir's independent AMD run shows the VUID gone. The only red job (agc_compute_pipeline_capture_run, missing fixture binary) also fails on unrelated PRs and this diff touches only RectListCorner.cpp; merged.

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

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants