[PR #1175] rdna2spirv: order image_sample, image_gather4, image_bvh and ignore ds_nop in --wave64-emulate (OLD-10011) #1208

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1175
Author: @ambroseautomation
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: carry/old-10011-w64x-image-order


📝 Commits (1)

  • 3a6b0cc fix(rdna2spirv): order image_sample, image_gather4, image_bvh and ignore ds_nop in --wave64-emulate

📊 Changes

3 files changed (+79 additions, -4 deletions)

View changed files

📝 tests/semantic/test_w64x_scalar_load_order.py (+75 -0)
📝 tools/rdna2spirv.py (+3 -3)
📝 tools/wave64_emulate_opt.py (+1 -1)

📄 Description

Claimed in the coordination issue as: OLD-10011 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142121243)

What and why

Carries forward old-pr/10011 (draft #282, original commit author totonii preserved; indexed in #17), rebased cleanly onto current main.

Fixes memory-ordering coverage under --wave64-emulate in tools/rdna2spirv.py (Gen.x_memory_order) and tools/wave64_emulate_opt.py (_x_memory_order_access):

  • Counts image_sample*, image_gather4*, and image_bvh* as memory reads so RAW/WAR hazards against earlier or later stores in the same wave trigger an ordering round/barrier across emulated halves.
  • Ignores ds_nop alongside ds_swizzle_b32/ds_bpermute_b32/ds_permute_b32 so it is not misclassified as an LDS write.
  • Adds regression tests in tests/semantic/test_w64x_scalar_load_order.py for image_store -> image_sample_lz (RAW), image_sample_lz -> image_store (WAR), and mirror parity between Gen.x_memory_order and wave64_emulate_opt._x_memory_order_access.

Tested

  • python -m unittest discover -s tests/semantic -p test_w64x_scalar_load_order.py -v: 8 tests, OK.
  • python -I scripts/run_semantic_tests.py tests/semantic: 470 files, 6,171 tests, 0 files failed.
  • python -m compileall -q make_game.py tools tests: exit 0.
  • python -I scripts/check_no_game_data.py tools/rdna2spirv.py tools/wave64_emulate_opt.py tests/semantic/test_w64x_scalar_load_order.py: exit 0 (no game data).

GPUs tested: n/a (CPU SPIR-V interpreter semantic suite on Windows 11 Pro 64-bit, Python 3.12.10)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a — --wave64-emulate memory ordering parity)

🔄 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/1175 **Author:** [@ambroseautomation](https://github.com/ambroseautomation) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `carry/old-10011-w64x-image-order` --- ### 📝 Commits (1) - [`3a6b0cc`](https://github.com/ubiquitarianism/leonida/commit/3a6b0ccd7a430b6883375f563c52c3559b6db420) fix(rdna2spirv): order image_sample, image_gather4, image_bvh and ignore ds_nop in --wave64-emulate ### 📊 Changes **3 files changed** (+79 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `tests/semantic/test_w64x_scalar_load_order.py` (+75 -0) 📝 `tools/rdna2spirv.py` (+3 -3) 📝 `tools/wave64_emulate_opt.py` (+1 -1) </details> ### 📄 Description Claimed in the coordination issue as: OLD-10011 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142121243) ### What and why Carries forward `old-pr/10011` (draft #282, original commit author `totonii` preserved; indexed in #17), rebased cleanly onto current `main`. Fixes memory-ordering coverage under `--wave64-emulate` in `tools/rdna2spirv.py` (`Gen.x_memory_order`) and `tools/wave64_emulate_opt.py` (`_x_memory_order_access`): - Counts `image_sample*`, `image_gather4*`, and `image_bvh*` as memory reads so RAW/WAR hazards against earlier or later stores in the same wave trigger an ordering round/barrier across emulated halves. - Ignores `ds_nop` alongside `ds_swizzle_b32`/`ds_bpermute_b32`/`ds_permute_b32` so it is not misclassified as an LDS write. - Adds regression tests in `tests/semantic/test_w64x_scalar_load_order.py` for `image_store -> image_sample_lz` (RAW), `image_sample_lz -> image_store` (WAR), and mirror parity between `Gen.x_memory_order` and `wave64_emulate_opt._x_memory_order_access`. ### Tested - `python -m unittest discover -s tests/semantic -p test_w64x_scalar_load_order.py -v`: 8 tests, OK. - `python -I scripts/run_semantic_tests.py tests/semantic`: 470 files, 6,171 tests, 0 files failed. - `python -m compileall -q make_game.py tools tests`: exit 0. - `python -I scripts/check_no_game_data.py tools/rdna2spirv.py tools/wave64_emulate_opt.py tests/semantic/test_w64x_scalar_load_order.py`: exit 0 (no game data). GPUs tested: n/a (CPU SPIR-V interpreter semantic suite on Windows 11 Pro 64-bit, Python 3.12.10) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a — `--wave64-emulate` memory ordering parity) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1208
No description provided.