Skip to content

test(tools): run each conventions_wrapped_declarations case as its own test - #15259

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
JJenkx:windows/conventions-wrapped-declarations-per-case
Nov 4, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
JJenkx:windows/conventions-wrapped-declarations-per-case

Conversation

@JJenkx

@JJenkx JJenkx commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What

Register every test_ method in tools/tests/test_check_conventions_wrapped_declarations.py as its own CTest test, with a 20 s limit. The first case keeps the conventions_wrapped_declarations name; each other case is conventions_wrapped_declarations_<Class>_<method>. No test logic changes. unittest.main() already accepts Class.method on the command line.

Why

Each case creates a git fixture with two commits and then starts check_conventions.py as a subprocess. #14412 split the test by class, but on the Windows runner the two class tests still exceed 30 s. Recent main Build runs where the windows job failed only on these two timeouts:

  • 9090972b7e (run 41518923690): conventions_wrapped_declarations and conventions_wrapped_declarations_AbiAliasTests, both ***Timeout at 30.05 and 30.09 s
  • f7d225d8e3 (run 41514145453): the same two tests

Locally the classes take 6.3 s (10 cases) and 5.9 s (7 cases), so the runner is about 5× slower under the parallel CTest load. One case at a time keeps each test far below its limit. This uses the same approach as #15085 (annotate_module).

Tested

Windows 11 (build 22621), AMD Ryzen 9 5950X, Python 3.15, CMake 4. The new block was configured in a minimal CMake project against this file:

  • ctest -N lists 17 tests (10 + 7), the first named conventions_wrapped_declarations.
  • ctest -V: 17 of 17 pass, each output shows Ran 1 test, the slowest takes 1.9 s, and the total is 14.5 s.
  • check_conventions.py --base origin/main passes.
  • check_test_registration.py --scripts (the test_script_registration test in the relinker jobs) passes: 250 test scripts, each run by an add_test or a workflow. The first head, b422a25929, failed it because the script path was only passed through a variable; a45263e026 names the path in the add_test call.

Independent Windows validation by BunnyFl of exact head a45263e026 merged onto main: a full-project CMake configuration discovers all seventeen cases, matching ten WrappedDeclarationTests and seven AbiAliasTests methods; ctest -R '^conventions_wrapped_declarations' -j4 passes 17/17, and verbose output confirms each invocation runs one test. The reviewer reports Windows 11; compiler version and host CPU are unspecified. The four-space discovery-pattern caveat is an optional follow-up; this attribution leaves the approved source head unchanged.

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
  • AI-assisted: yes

🤖 Generated with Claude Code

…n test

Each case builds a git fixture and starts check_conventions.py, so the
two per-class tests from boykopovar#14412 still passed 30 s on the Windows runner
and timed out on main (9090972, f7d225d). Register every test_
method as its own test with a 20 s limit; the first keeps the
conventions_wrapped_declarations name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the build label Nov 2, 2026
check_test_registration.py counts a script as run only when an add_test
argument names its path, so passing it through a variable left
test_check_conventions_wrapped_declarations.py unregistered and failed
test_script_registration in every relinker job.

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

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

@JJenkx approved at a45263e026.

What I ran: this head merged onto main in the real tree (Windows 11, CMake configure of the full project).

  • ctest -N -R '^conventions_wrapped_declarations' lists 17 tests.
  • That matches the test_ methods in the file. Parsing it with ast gives 10 in WrappedDeclarationTests, 7 in AbiAliasTests and none in WrappedDeclarationFixture, which the Tests\( regex rightly skips.
  • ctest -R '^conventions_wrapped_declarations' -j4: 17 of 17 pass.
  • With -V, each of the 17 prints Ran 1 test: one case per registration.

Read in the CMake: the first case keeps the old conventions_wrapped_declarations name, and every other case becomes <Class>.<method>, which unittest.main() accepts. The class comes from the nearest class ...Tests( line above each method (CMakeLists.txt, the CMAKE_MATCH_1 of the class branch).

Optional, not blocking: the ^ def test_ pattern only sees methods indented exactly four spaces. A future test_ method written another way, for example inside a nested helper class, would be left unregistered without any error. A configure-time count could catch that, comparing file(STRINGS ... REGEX "def test_") with the number registered.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head a45263e merged onto main 1c8c0ef · tested 2026-11-04 00:56 UTC · 21 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 ✅ 3,782 passed · 13 failed (0 new, 10 also fail on main, 3 unstable on main) · 62 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
Vulkan validation ✅ no new validation IDs vs main (1431 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.6 s, ⚠️ public_headers 78.5 s, ⚠️ agc_driver_graphics_maps_fallback 74.6 s, ⚠️ agc_driver_graphics 72.8 s, ⚠️ agc_driver_image_sample_unnormalized 54.3 s
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_alpha_to_coverage_sample_mask_export: failed in 3 of the last 10 main runs
agc_driver_pipeline_journal: failed in 8 of the last 10 main runs
agc_driver_submit_progress: failed in 8 of the last 10 main runs
Failing on main too (10, not counted against this PR)
agc_driver_guest_memory_lifetime_direct
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_depth_buffer_clear
agc_driver_native_depth_clears
agc_driver_native_multisample_depth
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Passed on retry (2, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)
agc_driver_emulated_color_compare: Timeout in the parallel run; also passed only on retry in 29 other runs in the last 7 days
vulkan_validation_gate_attribution: Failed in the parallel run; also passed only on retry in 18 other runs in the last 7 days
Validated but not compared (66, not in the main baseline's validation pass)
guest_job_manager_worker_spin_scale_0.1
public_headers
public_headers_compile_0
public_headers_compile_1
public_headers_compile_10
public_headers_compile_11
public_headers_compile_12
public_headers_compile_13
public_headers_compile_14
public_headers_compile_15
public_headers_compile_16
public_headers_compile_17
public_headers_compile_18
public_headers_compile_19
public_headers_compile_2
public_headers_compile_20
public_headers_compile_21
public_headers_compile_22
public_headers_compile_23
public_headers_compile_24
public_headers_compile_25
public_headers_compile_26
public_headers_compile_27
public_headers_compile_28
public_headers_compile_29
public_headers_compile_3
public_headers_compile_30
public_headers_compile_31
public_headers_compile_32
public_headers_compile_33
public_headers_compile_34
public_headers_compile_35
public_headers_compile_36
public_headers_compile_37
public_headers_compile_38
public_headers_compile_39
public_headers_compile_4
public_headers_compile_40
public_headers_compile_41
public_headers_compile_42
public_headers_compile_43
public_headers_compile_44
public_headers_compile_45
public_headers_compile_46
public_headers_compile_47
public_headers_compile_48
public_headers_compile_49
public_headers_compile_5
public_headers_compile_50
public_headers_compile_51
public_headers_compile_52
public_headers_compile_53
public_headers_compile_54
public_headers_compile_55
public_headers_compile_56
public_headers_compile_57
public_headers_compile_58
public_headers_compile_59
public_headers_compile_6
public_headers_compile_60
public_headers_compile_61
public_headers_compile_62
public_headers_compile_63
public_headers_compile_7
public_headers_compile_8
public_headers_compile_9
Validation IDs already present on main (8 IDs in 783 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (783 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_alpha_to_coverage_sample_mask_export, and 775 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_partially_unmapped_plane, agc_driver_depth_plane_unmapped_plane, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, 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 (62)
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_copied_writer_label_order_drain: 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_aftergp
Reproduce
git fetch origin a45263e0263da1a81b7f122ded0d4cd91efaf734 1c8c0efc8c41314402e6966da5bef6ea3d639d10
git checkout 1c8c0efc8c41314402e6966da5bef6ea3d639d10 && git merge --no-ff a45263e0263da1a81b7f122ded0d4cd91efaf734
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.

@Amoenus

Amoenus commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@JJenkx Additional consumer-side validation for a45263e0263da1a81b7f122ded0d4cd91efaf734: our #7085 at cc63469f8be735b648f571d720d127e777635d7f has a hosted Windows relinker failure where684/686 tests pass and only these two class groups time out, both at30.02s.

Using current main b11c7bf84f5d2f636ff60166cc3371bd071e24d5, Windows11/Ryzen9 9950X3D/Python3.13.15, real root CMake configuration (ANYPS5_RELINKER_ONLY=ON, Release/Ninja, GCC15.2 configured), with CTest parallel4:

Composition Result Slowest registration
main + this exact head 17/17 pass 3.012s
current #7085 + this exact head 17/17 pass 3.151s

Both discover all17 AST-listed methods exactly once; verbose output confirms Ran 1 test for each, and all CTest properties retain20s. Both also pass test/script registration, conventions and whitespace checks. Test logic/checker are unchanged. Pins, commands, CTest metadata, JUnit and logs.

The original two class groups also pass locally on both plain main and unchanged #7085, so I did not reproduce the hosted timeout. This validates your registrations and our composition, not the full686-test run or hosted timing. No native/relinker build or GPU run was performed for these Python-only checks; our published branch is unchanged. AI-assisted: yes (Codex).

@oneandonlydean
oneandonlydean merged commit 5d64f35 into boykopovar:main Nov 4, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants