Skip to content

chore: remove 13 dead one-off scripts, fix /home/nolan test paths, drop unused imports (CHORE-TIER2A-PYTHON-CLEANUP) - #2704

Merged
aslan2142 merged 2 commits into
ProjectLeonida:mainfrom
aslan2142:chore/tier2a-python-cleanup
Nov 30, 2026
Merged

aslan2142 merged 2 commits into
ProjectLeonida:mainfrom
aslan2142:chore/tier2a-python-cleanup

Conversation

@aslan2142

Copy link
Copy Markdown
Collaborator

Item ID: CHORE-TIER2A-PYTHON-CLEANUP (claimed in #2570, follow-up to #2668)

AI-assisted: yes (implemented and independently audited via read-only adversarial review).

Summary

Removes 13 dead / completed one-off research scripts and their dedicated tests (-3,370 LOC, all verified zero external callers and zero doc/workflow references), fixes the last 3 hardcoded /home/nolan/... QEMU paths in tests/test_x64_recomp_*.py, and removes 7 verified unused imports across 6 surviving tools/scripts (22 files changed, +4 / -3,392).

1. Deleted files (13 files, -3,370 LOC — 0 callers, 0 doc/CI refs)

  • tools/valu_int_diff.py + tests/test_valu_int_diff.py: redundant integer VALU fuzzer superseded by vint_diff.py + wint_diff.py + pk16_diff.py + sad_diff.py (72/73 v_* opcodes duplicated; sole remaining opcode v_lerp_u8 is already covered by tests/semantic/test_{alu,valu}_lerp_u8.py, tests/semantic/test_int_ext_fixture.py, runtime/test/shaders/cs_w32_int_ext.asm, and tools/int_hw_probe.py).
  • tools/turing_atlas.py + tests/test_turing_atlas.py: completed one-off Turing PR-body atlas generator.
  • tools/dpp_hw_probe.py + tests/test_dpp_hw_probe.py: completed one-off AMD RX 7800 XT DPP hardware probe.
  • tools/draw_ownership.py + tests/test_draw_ownership.py: completed one-off ASSET-70 measurement campaign script.
  • scripts/carve_all.ps1 + tests/test_carve_all_brackets.py + tests/test_carve_all_paths.py: initial-commit research wrapper ((research tool; the build itself doesn't need it)).
  • scripts/meta_to_xml.ps1 + tests/test_meta_to_xml_paths.py: initial-commit PS 5.1 script requiring external CodeWalker.Core.dll.

2. Fixed & cleaned surviving files (9 files, +4 / -22 LOC)

  • Removed last 3 hardcoded /home/nolan/.nix-profile/bin/qemu-system-aarch64 paths: tests/test_x64_recomp_bitops.py, tests/test_x64_recomp_rcl_rcr.py, tests/test_x64_recomp_std_str.py now use os.environ.get("QEMU_AARCH64") or shutil.which("qemu-system-aarch64") or "" (matching tools/x64_recomp.py:3924 and sibling tests; git grep /home/nolan now returns 0 hits repo-wide).
  • Removed 7 verified unused imports (0 AST/string/test-patch uses):
    • tools/image_fuzz.py: re
    • tools/leonida_launcher.py: shutil
    • tools/probe_gfx1036_vcmp16.py: math, spirv_mini_interp as si
    • tools/shader_link_check.py: Declaration
    • scripts/bench_wave64.py: json
    • scripts/bench_translate.py: statistics

3. Intentionally kept (verified active or referenced)

  • tools/anim_skel_match.py & tools/anim_skeleton_match.py: distinct purposes, both cited in docs/animation.md (:154, :352) and enforced by test_docs_repo_paths.py.
  • tools/analyze_4240_full.py: referenced by tests/test_missing_input_exit_codes.py and tests/test_tool_stdout_encoding.py.
  • tools/batch_glb.py, tools/{cvt,dot,f16misc,mode,vrel}_diff.py, tools/int3_cause.py, scripts/{corpus_watch,shader_stats,bench_translate}.py: active CI fuzzers or actively maintained developer utilities.
  • scripts/run_gpu_tests.py: left untouched to avoid conflicting with open PRs.

Testing

Tested on Linux (x86-64, no GPU required):

  • python3 -m compileall -q make_game.py tools tests scripts — PASS
  • python3 -I make_game.py --help — PASS
  • python3 -I scripts/check_no_game_data.py — PASS
  • tests/test_ci_registration.py (18/18), tests/test_runtime_paths.py (5/5), tests/test_runner_calls_all_tests.py (3/3), tests/test_tool_startup.py (2/2) — ALL PASS
  • All 13 tests/test_docs_*.py — ALL PASS
  • Unit tests for every modified file (test_x64_recomp_{bitops,rcl_rcr,std_str}.py + clean-skip check without QEMU, test_image_fuzz*.py 98 passed / 1 skipped, test_leonida_launcher.py 15/15, test_probe_gfx1036_vcmp16.py 11/11, test_shader_link_check.py 54 ran / 1 skipped, test_bench_wave64.py 15/15, test_bench_translate.py 10/10) — ALL PASS

…op unused imports (CHORE-TIER2A-PYTHON-CLEANUP)
@OreoFR

OreoFR commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Checked by OreoFR on macOS 27.2.1, Apple M5 (arm64, QEMU path: qemu-system-aarch64 11.1.3 from Homebrew on PATH), Python 3.12.16 -I, main dcba958, PR head 45df09b. MEASURED:

  • Deleted tools/scripts have no remaining reference in main + this PR (git grep of valu_int_diff, turing_atlas, draw_ownership, dpp_hw_probe, carve_all, meta_to_xml: 0 hits each).
  • tests/test_x64_recomp_bitops.py 9/9, test_x64_recomp_rcl_rcr.py 5/5, test_x64_recomp_std_str.py 5/5, OK both on main and with this PR. No red here: on this Mac qemu-system-aarch64 is found on PATH either way, so the hardcoded /home/nolan/... candidate on main is never needed; the change is a cleanup rather than a fix you can see fail.
  • The 6 surviving files with removed imports (tools/image_fuzz.py, leonida_launcher.py, probe_gfx1036_vcmp16.py, shader_link_check.py, scripts/bench_translate.py, bench_wave64.py) compile (py_compile).
  • Merges cleanly with main and with [integration] PageMirror, GPU detile, async queue & RDNA2->SPIR-V performance stack (INTEGRATION-PERF-CPU-GPU-R6) #2566.

Not covered: whether the deleted tools still had users outside the repository (a maintainer's call).

AI-assisted: Claude Code

… p2 narrow

Update `tests/semantic/test_interp_computed_ij_fallback.py` (ProjectLeonida#2239) to
narrow `v_interp_p2_f16` reference expectations toward zero (`f16_rtz` /
`f16_rtz_bits`), matching `SHADER-468` (ProjectLeonida#1181).

AI-assisted.
@aslan2142

Copy link
Copy Markdown
Collaborator Author

Carried #2633's fix (c717967d0, author unchanged — @zmasi) to align tests/semantic/test_interp_computed_ij_fallback.py with SHADER-468 toward-zero v_interp_p2_f16 narrowing (which is currently failing CI/semantic-tests on main). Verified test_interp_computed_ij_fallback.py 9/9 PASS locally; will drop cleanly on rebase if #2633 merges first. Thanks @OreoFR for verifying on macOS!

@aslan2142
aslan2142 merged commit 4014af7 into ProjectLeonida:main Nov 30, 2026
9 checks passed
@aslan2142
aslan2142 deleted the chore/tier2a-python-cleanup branch November 30, 2026 09:31
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.

3 participants