Skip to content

test(agc): match array sample expectations to the view - #8361

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Amoenus:codex/test-array-window-view-bounds
Oct 22, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Amoenus:codex/test-array-window-view-bounds

Conversation

@Amoenus

@Amoenus Amoenus commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What

Use the selected view's last relative layer, LastArray - baseArray, when checking sampled texels in ImageArrayWindowPastLayerLimit.

The view starting at 8100 has three layers and keeps an upper bound of 2. The view starting at 0 has 8,103 layers. On AMD Radeon Graphics it is valid, but the old expectation clamps coordinate 5 to layer 2: the test fails with 107.000000/255, expected 147/255. The GPU correctly sampled layer 5.

Vulkan 1.4.363 array-layer selection clamps against the image view's layer count. This is a one-line fixture expectation correction.

Windows build prerequisite #8310 has merged and is present in main d6eafa54d0 (source/status checked 2026-10-22). This PR now has no open prerequisite and still contains only the expectation change; main retains the old bound at ImageArrayWindowPastLayerLimit.cpp:123. Historical validation compositions below keep their original pins. Related validation: #8310 (comment).

Tested

Main refresh — 2026-10-22

Rebased the unchanged one-line correction onto main 8499ea52e571b0edfc1feecfd3f6b9944012b359, head fef3c4e35ce0eca2c0fdc049c9541751034befa3; range-diff is unchanged. Main's merged #8310 alignment correction is retained, with no open prerequisite.

The affected library and actual fixture rebuild on Windows 11 / WinLibs GCC 15.2 r7. On the same machine, literal main passes on RTX 5080 and reproduces the exact AMD 107.000000/255, expected 147/255 assertion. This head passes 3/3 on each physical GPU: six passing processes. Both arms require Vulkan, disable the app shader cache/journal, load Khronos 1.4.363 and verify the actual device; zero VUIDs, validation errors/warnings, skips or timeouts. These fresh results replace the need for a #8310 composition in the current Windows comparison.

Cppcheck then clang-tidy takes 7.264 analyzer seconds without parser/configuration failures. No Cppcheck finding; one clang advisory in unchanged main Context.hpp misreads the intentional bytes / sizeof(uint32_t) conversion before pointer arithmetic. The correction adds no diagnostic or suppression. Conventions/whitespace pass. Earlier platform/full-build results below retain their original pins; no new Linux or title result is claimed.

Windows 11 Enterprise 26200, WinLibs GCC 15.2.0 r7 Release, SPIR-V Tools enabled. Both variants build the actual fixture and its runtime dependencies against main 01e5f8f199168a5da99b1e846fd70fcf715b986f:

Source AMD Radeon Graphics NVIDIA RTX 5080
Main + #8310, 6e68f605a3 3/3 reproduce the original assertion failure 3/3 pass
Same + this correction, 5e1c039f1d 3/3 pass, including the 8,103-layer view 3/3 pass, retaining the over-limit refusal

Each invocation uses ctest -V -j1 --timeout 30 -R '^agc_driver_image_array_window_past_layer_limit$', required Vulkan, disabled shader cache/pipeline journal and VK_LAYER_KHRONOS_validation. Actual adapters and device-layer insertion verified: zero validation errors, warnings, VUIDs, skips or timeouts across all twelve executions. Baseline AMD failures are failed tests, recorded as the reproduction.

Cppcheck and clang-tidy report no diagnostics for the corrected fixture. The identical fixture also builds in our full Windows integration (1a10d63334), including default and explicit libs/relinker targets. Paired runtime results above use the separate upstream-production composition. Submission was rebased to main 891d567515 with the identical one-line patch; test results retain their stated pins. Linux and title execution were not tested for this change.

Independent reproduction: wachi35676 confirmed the paired result on Windows 11/WinLibs GCC 15.2.0, main 56b299c3a plus #8310: AMD RDNA2 iGPU fails 3/3 before this change and passes 3/3 after it; RTX 5070 Ti passes 3/3 on both. These are their reported results, separate from our qualification above.

External validation at its reported source pins

himanshusonawane05 reports the expected AMD failure without this correction and a pass with it on main d50ec76da + #8310, RX 7900 XT/gfx1100, proprietary driver 26.8.1, Windows 11/GCC 15.2 r7 Release; no Khronos layer was available. This complements wachi35676's separately recorded iGPU/RTX 5070 Ti comparison.

screamm reports 3/3 focused passes plus both image-array groups passing on main d50ec76da + #8310 ca55e46f9 + this PR 7d2acdb16, RTX 4070/596.21, Windows 11 Pro 26220/GCC 15.2 r7 Release. That NVIDIA run did not reproduce the AMD failure or instrument base-0-view refusal, and did not load Khronos validation. Its requested 300 s limit is not a contribution-policy exemption; no actual over-30 s execution is established by the report.

External results retain their authors, exact compositions and stated limitations; they are not added to our local pass totals.
janzezno reports the matching RADV reproduction and correction: Arch Linux/kernel 7.2.11, RX 7900 GRE/RADV NAVI31, Mesa 26.2.5, GCC 16.2.1 Release; main 50e0624d7, head 7d2acdb16 applied on top. Main fails the same 107/255, expected 147/255 assertion; the correction passes three focused repeats. Required Vulkan and disabled app shader cache were used; the report confirms Khronos loaded on both arms and no VUIDs. #8310 is not needed for that Linux build. These are the contributor's results, not a new local Linux run.

JJenkx reports a full build and 1747/1747 CTest passes, including this fixture, on main 44e3389c8 + #8310 + this PR: RX 6700 XT/gfx1031, AMD proprietary 26.8.1, Windows 11 22621, WinLibs GCC 15.2 UCRT r7 Release. Their Windows build without #8310 still fails on unsupported static alignment, also observed on main 5b59fbc55. No paired expectation-regression run, Khronos result or local verification is inferred from that report.

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; test(agc): align the array window test's texels at run time #8310 is merged
  • Fixes: none
  • Unblocks: none; test portability correction
  • GPUs tested: NVIDIA GeForce RTX 5080, driver 610.62 / 32.0.16.1062; AMD Radeon(TM) Graphics, driver 32.0.21036.18; Windows 11 Enterprise 26200
  • AI-assisted: yes, Codex; author responsible

@github-actions github-actions Bot added the agc libSceAgc* label Oct 20, 2026
@himanshusonawane05

Copy link
Copy Markdown

Tested on AMD Radeon RX 7900 XT (gfx1100, AMD proprietary driver 26.8.1), Windows 11, WinLibs GCC 15.2.0 r7 Release, main d50ec76da, ANYPS5_GPU=7900 ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1:

Not run with VK_LAYER_KHRONOS_validation (no Vulkan SDK on this machine). AI-assisted: yes.

@wachi35676

Copy link
Copy Markdown
Contributor

Confirmed on an AMD proprietary driver. Windows 11, WinLibs GCC 15.2.0, Release, main 56b299c3a with #8310 (needed to compile the test under MinGW) and this PR merged, ANYPS5_REQUIRE_VULKAN=1:

AMD Radeon RDNA2 iGPU (1002:13c0, 2.0.353) RTX 5070 Ti (617.42)
#8310 only fails 3/3: thread 7 component 0 is 107.000000/255, expected 147/255 passes 3/3
#8310 + this PR passes 3/3 passes 3/3

AI-assisted: yes (Claude Code); results above were run on this machine.

@screamm

screamm commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Second independent run, on NVIDIA only. Amoenus already confirmed the build on an RTX 5080 and reported the AMD result.

Host: Windows 11 Pro 26220, NVIDIA GeForce RTX 4070 driver 596.21, Ryzen 7 5700X, WinLibs MinGW-w64 GCC 15.2 r7, Release, BUILD_TESTING=ON, execution tests at their default.
Main d50ec76da, PR head 7d2acdb16, merged on top of #8310 (ca55e46f9), because this branch does not contain that commit.

  • The change replaces the clamp bound of the expected sampled layer, Layers - 1, with LastArray - baseArray. For the window starting at layer 8100 both are 2, so that expectation is the same; only the base-0 window, which a device can sample if it accepts an 8,103-layer view, gets a different bound.
  • The stack builds the agc_driver_image_array_window_past_layer_limit_tests target; ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_driver_image_array_window_past_layer_limit$' --repeat until-fail:3 -j1 --timeout 300 passes 3 of 3 on the RTX 4070, and ctest -R '^agc_driver_image_array' -j1 passes both tests (agc_driver_image_array_sample_on_volume too).
  • tools/check_conventions.py --base origin/main and git diff --check pass.

Not checked: any AMD GPU (so the case this PR fixes was not reproduced here, and I did not instrument the RTX 4070 to log that it refuses the base-0 window), Vulkan validation layers, the rest of the suite, title runs, Linux.

Written with Claude Code assistance (validation by a subagent, reviewed in this session).

@janzezno

Copy link
Copy Markdown
Contributor

Run on RADV.

Host: Arch Linux, kernel 7.2.11, AMD Radeon RX 7900 GRE (RADV NAVI31), Mesa 26.2.5, GCC 16.2.1, Release, BUILD_TESTING=ON.
main 50e0624d7; PR head 7d2acdb16 applied on top (#8310 is not needed to build on Linux).

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R '^agc_driver_image_array_window_past_layer_limit$' -V

  • main: fails with thread 7 component 0 is 107.000000/255, expected 147/255, the values in the description; also fails in 5 of 5 full-suite runs.
  • PR: passes, 3 repeats.
  • No VUID- in either log; the validation layer loaded in both (no was not found but was requested).

@JJenkx

JJenkx commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Another AMD datapoint, discrete RDNA2: Windows 11 22621, AMD Radeon RX 6700 XT (gfx1031, AMD proprietary driver 26.8.1), WinLibs GCC 15.2 UCRT r7, Release, BUILD_TESTING=ON, main 44e3389 with #8310 and this PR merged: the full build completes and ctest passes 1747/1747, including agc_driver_image_array_window_past_layer_limit. Without #8310 the build stops at ImageArrayWindowPastLayerLimit.cpp:33 (requested alignment '65536' exceeds object file maximum 8192), as reported above; still present on main 5b59fbc.

@MarcZX10 MarcZX10 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.

The expected layer must be clamped in the view-relative range before adding the view's base layer. This matches the Vulkan sampling rule clamp(RNE(a), 0, layerCount - 1) + baseArrayLayer; the changed bound LastArray - baseArray expresses that range for this fixture. The one-line correction also preserves the existing over-limit refusal case, as described in the PR.

The reported AMD runs reproduce the old 107-versus-147 assertion and pass with this change; the NVIDIA comparison remains passing. The Windows reports used the required Vulkan and validation layer and found no VUIDs. I reviewed the diff and the updated dependency line (Depends on: #8310); the current heads combine without a merge conflict. Eligibility, intake, conventions, labels, and report checks pass. Product jobs are skipped under the repository's PR workflow policy; I did not run a local build.

Vulkan rule: https://github.com/KhronosGroup/Vulkan-Docs/blob/560d4305e8a6466fa7d07c83ca09429e4d010ff9/chapters/textures.adoc#L690-L700

@Amoenus
Amoenus force-pushed the codex/test-array-window-view-bounds branch from 7d2acdb to fef3c4e Compare October 22, 2026 16:21
@oneandonlydean oneandonlydean self-assigned this Oct 22, 2026
@oneandonlydean
oneandonlydean merged commit 5b6f1a6 into boykopovar:main Oct 22, 2026
11 of 12 checks passed
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.

8 participants