[PR #1334] [CLOSED] rdna2spirv: zero the tfe/lwe status VGPR on image_load and image_load_mip (OLD-10022) #1364

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1334
Author: @ambroseautomation
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: carry/old-10022-image-load-tfe-zero


📝 Commits (1)

  • c778ef9 rdna2spirv: zero the tfe/lwe status VGPR on image_load and image_load_mip

📊 Changes

3 files changed (+113 additions, -10 deletions)

View changed files

📝 docs/design.md (+1 -1)
➕ tests/semantic/test_image_load_tfe.py (+95 -0)
📝 tools/rdna2spirv.py (+17 -9)

📄 Description

Summary

Coordination item: OLD-10022 (carry-forward of old-pr/10022, preserving original author Nikita Romanovich).

Problem & Root Cause

On RDNA2, image_load and image_load_mip with tfe or lwe write a trailing status VGPR vdata[data_vgprs] (where data_vgprs = (popcount(dmask) + 1) // 2 under d16, else popcount(dmask)) with 0 on resident accesses for active lanes while preserving inactive lanes. Previously tools/rdna2spirv.py did not zero that trailing status VGPR, leaving stale values in the status register.

Implementation

  • Updates tools/rdna2spirv.py to write 0 to the trailing tfe/lwe status VGPR on image_load and image_load_mip (respecting d16 packed register count and active EXEC lanes).
  • Adds the contract documentation sentence to the Typed image loads row in docs/design.md.
  • Adds CPU semantic regression tests in tests/semantic/test_image_load_tfe.py covering tfe, lwe, coherent/mip loads, and d16 packed offset calculation.

Tests Run

Environment: Windows 11 Pro 64-bit, Python 3.12.10, synthetic fixtures only (no game data).

  • python -I -m py_compile tools/rdna2spirv.py tests/semantic/test_image_load_tfe.py — PASS
  • python tests/semantic/test_image_load_tfe.py -v — 3/3 PASS
  • pytest tests/test_docs_links.py -v — 16/16 PASS
  • python -I scripts/run_semantic_tests.py tests/semantic — 472 files, 6,180 tests, 0 files failed (519 s, 16 jobs)
  • python -I scripts/check_no_game_data.py docs/design.md tests/semantic/test_image_load_tfe.py tools/rdna2spirv.py — PASS

Disclosure

AI-assisted: yes (carry-forward, rebase onto current main, and full semantic suite verification; original implementation by Nikita Romanovich).


🔄 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/1334 **Author:** [@ambroseautomation](https://github.com/ambroseautomation) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `carry/old-10022-image-load-tfe-zero` --- ### 📝 Commits (1) - [`c778ef9`](https://github.com/ubiquitarianism/leonida/commit/c778ef95fa48edb489f4e2410b43e7816191f7b1) rdna2spirv: zero the tfe/lwe status VGPR on image_load and image_load_mip ### 📊 Changes **3 files changed** (+113 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -1) ➕ `tests/semantic/test_image_load_tfe.py` (+95 -0) 📝 `tools/rdna2spirv.py` (+17 -9) </details> ### 📄 Description ## Summary Coordination item: `OLD-10022` (carry-forward of `old-pr/10022`, preserving original author `Nikita Romanovich`). ### Problem & Root Cause On RDNA2, `image_load` and `image_load_mip` with `tfe` or `lwe` write a trailing status VGPR `vdata[data_vgprs]` (where `data_vgprs = (popcount(dmask) + 1) // 2` under `d16`, else `popcount(dmask)`) with `0` on resident accesses for active lanes while preserving inactive lanes. Previously `tools/rdna2spirv.py` did not zero that trailing status VGPR, leaving stale values in the status register. ### Implementation - Updates `tools/rdna2spirv.py` to write `0` to the trailing `tfe`/`lwe` status VGPR on `image_load` and `image_load_mip` (respecting `d16` packed register count and active `EXEC` lanes). - Adds the contract documentation sentence to the `Typed image loads` row in `docs/design.md`. - Adds CPU semantic regression tests in `tests/semantic/test_image_load_tfe.py` covering `tfe`, `lwe`, coherent/mip loads, and `d16` packed offset calculation. ## Tests Run Environment: Windows 11 Pro 64-bit, Python 3.12.10, synthetic fixtures only (no game data). - `python -I -m py_compile tools/rdna2spirv.py tests/semantic/test_image_load_tfe.py` — PASS - `python tests/semantic/test_image_load_tfe.py -v` — 3/3 PASS - `pytest tests/test_docs_links.py -v` — 16/16 PASS - `python -I scripts/run_semantic_tests.py tests/semantic` — **472 files, 6,180 tests, 0 files failed** (519 s, 16 jobs) - `python -I scripts/check_no_game_data.py docs/design.md tests/semantic/test_image_load_tfe.py tools/rdna2spirv.py` — PASS ## Disclosure AI-assisted: yes (carry-forward, rebase onto current `main`, and full semantic suite verification; original implementation by Nikita Romanovich). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:59 +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#1364
No description provided.