Skip to content

tests/semantic: NSA address lists are live-ins of read_before_write_vgprs and reg_reads_writes (TEST-NSA-VLIST-LIVENESS) - #894

Merged
ubiquitarianism merged 1 commit into
ProjectLeonida:mainfrom
qhukz13:cont/nsa-vlist-liveness
Nov 24, 2026
Merged

ubiquitarianism merged 1 commit into
ProjectLeonida:mainfrom
qhukz13:cont/nsa-vlist-liveness

Conversation

@qhukz13

@qhukz13 qhukz13 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: TEST-NSA-VLIST-LIVENESS

What and why

read_before_write_vgprs and reg_reads_writes in tools/rdna2spirv.py add the registers of an NSA address list (regs += x["r"] for a vlist operand, lines 16678 and 16939 on main), but no test reached that line. With tools/semantic_mutants.py from #734, removing either line survived all twelve test files that name these functions, run together; everything else in the two functions was caught.

tests/semantic/test_store_liveins.py now checks:

  • image_sample v0, [v2, v3], ...: reads {2, 3}, writes {0};
  • image_load v[4:7], [v2, v5, v9], ...: reads the non-contiguous {2, 5, 9} (a range from v2 would read v2..v4 and miss v5 and v9), writes {4..7};
  • the same load after v_mov_b32 v5, 0: only v2 and v9 are live-ins for read_before_write_vgprs.

Test only, no translator change.

Tested

  • python -m unittest discover -s tests/semantic -p test_store_liveins.py: 4 tests OK.
  • semantic_mutants --function read_before_write_vgprs / --function reg_reads_writes with this file: the line-16678 and line-16939 removals now fail it (3 failures each).
  • tests/test_semantic_translator_use.py, scripts/check_no_game_data.py: OK.

Linux, CPU only; no GPU, no game files.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

…gprs and reg_reads_writes (TEST-NSA-VLIST-LIVENESS)

Both functions add the registers of an NSA address list (`regs += x["r"]` for a "vlist" operand), but no test reached
it: with tools/semantic_mutants.py (ProjectLeonida#734), removing either line survived all twelve test files that name these
functions, run together. test_store_liveins.py now checks an image_sample with [v2, v3], an image_load with the
non-contiguous [v2, v5, v9] (a range from v2 would read v2..v4 and miss v5 and v9), and a list register written
earlier (v5 is then no live-in). Both mutants now fail the file.

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

Copy link
Copy Markdown

Independent verification on Windows 11, Python 3.14:n- python -I tests/test_audit_shader4_regs.py: 20/20 passed.n- No game data or GPU used. AI-assisted.

@ubiquitarianism
ubiquitarianism merged commit 1504c1a into ProjectLeonida:main Nov 24, 2026
3 checks passed
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