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

Closed
opened 2026-11-26 20:19:32 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/894
Author: @qhukz13
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: cont/nsa-vlist-liveness


📝 Commits (1)

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

📊 Changes

1 file changed (+18 additions, -0 deletions)

View changed files

📝 tests/semantic/test_store_liveins.py (+18 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/894 **Author:** [@qhukz13](https://github.com/qhukz13) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `cont/nsa-vlist-liveness` --- ### 📝 Commits (1) - [`7874db1`](https://github.com/ubiquitarianism/leonida/commit/7874db1508e44e37c1cfdab9a518ef29fa5a1a7d) tests/semantic: NSA address lists are live-ins of read_before_write_vgprs and reg_reads_writes (TEST-NSA-VLIST-LIVENESS) ### 📊 Changes **1 file changed** (+18 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tests/semantic/test_store_liveins.py` (+18 -0) </details> ### 📄 Description 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](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:19:32 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#931
No description provided.