Skip to content

chore: remove dead Tier 1 files, wire 5 unwired C++ tests, and fix play.ps1 path - #2668

Merged
aslan2142 merged 2 commits into
ProjectLeonida:mainfrom
aslan2142:chore/tier1-main-hygiene
Nov 30, 2026
Merged

aslan2142 merged 2 commits into
ProjectLeonida:mainfrom
aslan2142:chore/tier1-main-hygiene

Conversation

@aslan2142

Copy link
Copy Markdown
Collaborator

Summary

Tier 1 repository hygiene and broken-wiring cleanup on main (12 files, +147 / -1,149):

1. Dead / Accidental / Obsolete File Removal

  • Removed navmeshes.navmesh-decode.json (8.4 KB accidental output dump committed at the repo root with 0 inbound references) and added *.navmesh-decode.json to .gitignore.
  • Removed obsolete victory/ scripts scripts/sync_victory.py and scripts/port_ctl.py (both hardcoded the deleted victory/ subtree; port_ctl.py also hardcoded a personal G:\gta6port path) and cleaned up their stale references in AGENTS.md and docs/port_status.md.
  • Removed dead/unreferenced files:
    • runtime/shims/d3d12_xs_command_list_iid.h (0 includes/symbol refs; superseded inline in runtime/shims/d3d12_xs_device.cpp)
    • runtime/test/shaders/cs_cbv_vector_rows.asm (0 refs across CMake, GPU test runner, C++/Python tests, or docs)
    • tools/world_hotspots.py (0 callers, tests, or doc refs)
  • (Left assets/mandy.png untouched pending maintainer confirmation.)

2. Immediate Broken Wiring Fixes

  • Wired 5 previously unwired C++ unit tests into runtime/CMakeLists.txt:
    • runtime/test/indirect_draw_stats_test.cpp
    • runtime/test/dev_status_test.cpp
    • runtime/test/d3d12_title_image_census_test.cpp
    • runtime/test/pipeline_wait_test.cpp
    • runtime/test/queue_families_test.cpp (gated under if(TARGET Vulkan::Headers))
  • Hardened tests/test_ctest_registration.py: Scans all runtime/test/*_test.cpp files on disk against runtime/CMakeLists.txt (handling foreach / foreach(... IN ITEMS ...) loops and ignoring comments/message() mentions) so future PRs cannot accidentally leave new C++ test files unregistered.
  • Fixed scripts/play.ps1:44: Updated the broken victory\crates\victory-formats\src\bcpack-tables.bin lookup path to the actual d3d12\crates\leonida-formats\src\bcpack-tables.bin path (preserving CRLF line endings).

Testing

  • AI-assisted: Yes (implemented and independently reviewed with AI assistance).
  • Local verification (Linux x86-64, GCC 16.2.1 + Clang -std=c++20 -Wall -Wextra, Raphael iGPU 1002:164e!, no game files):
    • cmake -S runtime -B <build> -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo + build of all 5 newly wired C++ test targets: 0 warnings
    • ctest -R '^(indirect_draw_stats|queue_families|dev_status|d3d12_title_image_census|pipeline_wait)$' --output-on-failure: 5/5 PASS (0.01s)
    • python3 -I tests/test_ctest_registration.py: 13/13 PASS (363/363 on-disk *_test.cpp files wired, 0 phantom)
    • python3 -I tests/test_runtime_paths.py (5/5), tests/test_ci_registration.py (18/18), tests/test_text_write_line_endings.py (3/3), tests/test_runtime_incremental_link.py (2/2), all 13 tests/test_docs_*.py: ALL PASS
    • python3 -m compileall -q make_game.py tools tests & python3 -I scripts/check_no_game_data.py: PASS

@OreoFR

OreoFR commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12.16, Apple clang 21.0.0, main 0eab02a, PR head 1893601. MEASURED:

  • tests/test_ctest_registration.py: red (main + only this test) 1 failed / 13, test_all_test_sources_on_disk_are_wired_in_cmake listing exactly the 5 files this PR wires (d3d12_title_image_census, dev_status, indirect_draw_stats, pipeline_wait, queue_families) → green (main + this PR) 13/13.
  • The 4 CPU-only tests this PR wires, built on their own from the merged tree (clang++ -std=c++20 -Isrc -Ishims test/<name>_test.cpp) and run: indirect_draw_stats_test, dev_status_test, d3d12_title_image_census_test, pipeline_wait_test all exit 0 (ok). queue_families_test not built here (needs the Vulkan headers, not installed on this Mac).
  • The deleted files have no remaining reference in the merged tree (git grep for each name: 0 hits).
  • Merges cleanly with main and with [integration] PageMirror, GPU detile, async queue & RDNA2->SPIR-V performance stack (INTEGRATION-PERF-CPU-GPU-R6) #2566 (git merge-tree).

Not covered: the MSVC build of the 5 tests (Runtime / windows was still running) and queue_families anywhere.

AI-assisted: Claude Code

@merzleckeier

Copy link
Copy Markdown
Contributor

Independent CTest integration and registration check on 18936010d (GitHub merge 198a629f5 onto 0eab02a8b) combined with #2566 22e1349d7 (tree d980ec622).

  • MEASURED CTest ran the five newly registered targets plus submit_frame and vk_gpu_profile. All 7 passed on native CachyOS and on a clang-cl Win64 Release /MD build under Wine 11.22, once per platform on each of RTX 4070 SUPER and Radeon Raphael. The logs confirm that the two [integration] PageMirror, GPU detile, async queue & RDNA2->SPIR-V performance stack (INTEGRATION-PERF-CPU-GPU-R6) #2566 tests reached their Vulkan checks on each GPU.
  • MEASURED The guard passed all 13 checks on the exact PR merge and the combined tree. It also passed all 13 after I added a synthetic test/mandy_registration_probe_test.cpp and built it through foreach(x IN ITEMS mandy_registration_probe) with add_executable(${x}_test test/${x}_test.cpp) and no add_test. CMake built the target, but ctest -N -R ^mandy_registration_probe$ reported zero tests. referenced_test_sources sees the loop-expanded file, while built_test_executables and registered_commands still inspect the unexpanded text.
  • MEASURED Reusing expand_cmake_foreach for the executable/command comparison catches the synthetic omission. It also surfaces vk_compute_test, vk_sampler_test, and vk_store_test, which are invoked by the shader test runners and would need an explicit exception in that check.

Synthetic fixtures only. AI-assisted with OpenAI Codex.

@fiestorra

Copy link
Copy Markdown
Contributor

Independent verification on this machine (Windows 11, MSVC 19.44.35226, RTX 4090), and this one is substantial enough to be worth the detail.

1. It applies. merge-tree clean; 18936010d cherry-picks onto main 1d22590b9 without a conflict. Twelve files, 147 insertions(+), 1149 deletions(-).

2. The new test catches what it claims - the negative control bites. With the PR's tests/test_ctest_registration.py and main's runtime/CMakeLists.txt:

python3 -m pytest tests/test_ctest_registration.py -q
  main's CMakeLists  -> 1 failed, 12 passed
    FAILED CTestRegistrationTest::test_all_test_sources_on_disk_are_wired
  the PR's CMakeLists -> 13 passed

So the test exists to notice that five test sources on disk are not registered, and it does exactly that.

3. The five tests it wires actually build and pass - the part that matters, because wiring a test that fails is worse than leaving it unwired:

cmake --build … --target indirect_draw_stats_test dev_status_test d3d12_title_image_census_test pipeline_wait_test queue_families_test   -> all linked
ctest -R 'indirect_draw_stats|dev_status|d3d12_title_image_census|pipeline_wait|queue_families'
  1/5 indirect_draw_stats        Passed   0.03 sec
  2/5 dev_status                 Passed   0.03 sec
  3/5 d3d12_title_image_census   Passed   0.03 sec
  4/5 pipeline_wait              Passed   0.03 sec
  5/5 queue_families             Passed   0.03 sec
  100% tests passed, 0 tests failed out of 5

4. The whole suite, twice, on this branch:

run 1: 99% tests passed, 1 failed out of 544  -> vulkan_device_markers
run 2: 99% tests passed, 1 failed out of 544  -> xbox_present

Two runs, two different single failures, and neither is caused by this change:

So the deletions and the .gitignore line do not break the suite, and the five wired tests are green.

What I did not test: the pruned scripts (scripts/sync_victory.py, tools/world_hotspots.py, scripts/port_ctl.py) are deleted, and I did not run every workflow that may have called them - a grep for their names across the workflows would be the cheap follow-up, and I have not done it here.

Written with an AI assistant.

@fiestorra

Copy link
Copy Markdown
Contributor

A datapoint that strengthens this pull request: the five sources it wires are exactly the five that are unwired on main, and I checked by a method that could not have missed others.

Running the PR's own test against main's CMakeLists.txt prints the complete set:

runtime/test/*_test.cpp files not wired in runtime/CMakeLists.txt: [
  'test/d3d12_title_image_census_test.cpp',
  'test/dev_status_test.cpp',
  'test/indirect_draw_stats_test.cpp',
  'test/pipeline_wait_test.cpp',
  'test/queue_families_test.cpp']

That is the five, no more and no fewer - so the change leaves no unwired test source behind it.

Why the count matters, and where I nearly got it wrong: I first tried to answer the same question with a grep - every *_test.cpp on disk whose filename does not appear in CMakeLists.txt - and got 24, which would have been a much bigger story and is wrong. runtime/CMakeLists.txt registers families of tests through loops (foreach(_context_test context_pinning context_rundown …) around line 1938 builds test/${name}_test.cpp), so a filename that never appears literally is still wired. The PR's test resolves the same question with the CMake lists rather than with text, which is why it can be trusted to say "five".

Recording that here because the wrong number was plausible and I caught it only by comparing against this test - the sixth measurement error of my session, and the first one caught before it was published.

Written with an AI assistant.

@aslan2142

Copy link
Copy Markdown
Collaborator Author

Applied @merzleckeier's hardening in 31083735a: built_test_executables() and registered_commands() now also run expand_cmake_foreach() (catching foreach-built add_executable targets missing add_test, covered by a new regression test for the exact mandy_registration_probe case, with explicit documented exceptions for the three shader-runner tools vk_compute_test, vk_sampler_test, and vk_store_test alongside d3d12_clear_test). Verified python3 -W error -I tests/test_ctest_registration.py -v (14/14 PASS), test_runtime_paths.py (5/5 PASS), and check_no_game_data.py. Merging with independent verification across macOS (@OreoFR), Linux/Wine on RTX 4070S + Raphael (@merzleckeier), and Windows 11/MSVC on RTX 4090 (@fiestorra), plus green Runtime/windows, Runtime/linux-gpu-tools, and CI/check.

@aslan2142
aslan2142 merged commit f776457 into ProjectLeonida:main Nov 30, 2026
7 of 8 checks passed
@aslan2142
aslan2142 deleted the chore/tier1-main-hygiene branch November 30, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants