Skip to content

test(agc): map the GCN color target test memory below the ASan shadow gap - #16020

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
xXPBSXx:fix/agc-gcn-color-target-asan-memory
Nov 10, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
xXPBSXx:fix/agc-gcn-color-target-asan-memory

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

What

agc_gcn_color_target, added to main with #9892, fails in the ASan and UBSan run: cannot allocate test memory below 1 TiB. On Linux the test maps its memory with MAP_FIXED_NOREPLACE at 4 GiB steps from 4 GiB up to 1 TiB, and under ASan on x86_64 that whole range lies in the shadow gap (0x8fff7000 to 0x2008fff6fff), so every mapping fails. In ASan builds the search now starts at 0x60000000, below the low shadow, as tests/execution/FlatStore.cpp already does for its guest window. Other builds and Windows are unchanged.

Tested

Ubuntu 24.04 under WSL2, GCC 13.3.0, configured as sanitizers.yml does (Release, ANYPS5_ENABLE_ASAN=ON, -fsanitize=undefined -fno-sanitize=vptr, same ASAN_OPTIONS and UBSAN_OPTIONS), ctest -R '^agc_gcn_color_target$':

  • main 1e24993fa3: failed 3 of 3 runs with cannot allocate test memory below 1 TiB.
  • this change on the same main: passed 3 of 3 runs.
  • tools/check_conventions.py --base upstream/main passes.

Overlap: all 1827 open pull requests were checked on 2026-11-05 at 09:28 UTC against main 7ad9749ed0; two change GcnColorTarget.cpp (#15700, #12315). #15700 merges with and without this change without a conflict; #12315 already conflicts with main without it, and this change adds no conflict. Neither touches the memory search.

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: n/a (test-only change to where the test maps its memory)
  • AI-assisted: yes

AI-assisted (Claude Code).

🤖 Generated with Claude Code

… gap

Under ASan the range from 4 GiB to 1 TiB lies in the shadow gap, so the
test could not map its memory there and failed in the sanitizer run.
Start the search at 0x60000000 in ASan builds, as the flat store test
does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JJenkx

JJenkx commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Windows check of head 3cf19910fb, merged onto main aafd88b74b (73e050d097, clean merge).

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.

  • agc_gcn_color_target passes in 3 of 3 runs, none skipped. It creates no Vulkan instance, so this covers the test memory mapping on Windows, not GPU execution.

AI-assisted: yes.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 3cf1991 merged onto main c5bd55a · tested 2026-11-05 11:22 UTC · 11 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 ✅ 1,129 passed · 1 failed (0 new, 1 also fail on main) · 4 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 1,134 of 3,972 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 (547 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 111.5 s
Failing on main too (1, not counted against this PR)
agc_driver_image_table
Validation IDs already present on main (9 IDs in 466 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (466 tests): 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, agc_driver_bda_span_reads, and 458 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 (1 test): 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 (4)
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_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
Reproduce
git fetch origin 3cf19910fbf01a442167c604a53c98c38434943c c5bd55a89a07d39840867cc671f622f3d7c4869c
git checkout c5bd55a89a07d39840867cc671f622f3d7c4869c && git merge --no-ff 3cf19910fbf01a442167c604a53c98c38434943c
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.

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the ASan path (ANYPS5_ENABLE_ASAN is a global compile definition, hint 0x60000000 sits below the low shadow like FlatStore.cpp), non-ASan and Windows/macOS paths unchanged; confirmed by @StepFPV under ASan+UBSan, @JJenkx on Windows and @TechLevelZero on NVIDIA; 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.

4 participants