[PR #106] wave64_emulate_opt: ds_append and ds_consume always barrier under --wave64-emulate #158

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

📋 Pull Request Information

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

Base: main ← Head: old-pr/9838


📝 Commits (1)

  • 29cb288 wave64_emulate_opt: ds_append and ds_consume always barrier

📊 Changes

2 files changed (+12 additions, -0 deletions)

View changed files

📝 tests/semantic/test_wave64_emulate_opt.py (+11 -0)
📝 tools/wave64_emulate_opt.py (+1 -0)

📄 Description

Carried over from old PR 9838 by tedin7 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9838, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
This branch conflicts with the current main and needs a rebase.
tedin7: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

@ItsNotRexed: an exe PR, as you asked.

What

ds_append and ds_consume join _ALWAYS_BARRIER_OPS in tools/wave64_emulate_opt.py, with a unit test on the classification (_insn_may_barrier and _classify_block_body).

Why

Under --wave64-emulate these two ops hand the LDS counter's old value to every lane through an exchange round, which emits OpControlBarrier. Without the entry, a block holding one can be classed sync-free in a 128+ thread group and make_game.py --stages shaders aborts with "unexpected OpControlBarrier in sync-free multi-wave block". @autogenes-sudo reported this on #7154 with the #3976 translator; an independent check with the same one-line fix is in the #3976 thread.
Honest scope: today's origin/main translator does not emit ds_append/ds_consume (#3976 was closed in the org migration), so this prepares the classification for when it lands; it does not change output on current main.

Tested

python3 -I tests/semantic/test_wave64_emulate_opt.py on origin/main 2d53a8055 + this commit: 31 tests OK. Negative control: without the one-line change the new test fails ("False is not true : ds_append"). Synthetic data only; no game files.


🔄 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/106 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9838` --- ### 📝 Commits (1) - [`29cb288`](https://github.com/ubiquitarianism/leonida/commit/29cb2886987256f1dcb99d3fa0783eac3c41184f) wave64_emulate_opt: ds_append and ds_consume always barrier ### 📊 Changes **2 files changed** (+12 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tests/semantic/test_wave64_emulate_opt.py` (+11 -0) 📝 `tools/wave64_emulate_opt.py` (+1 -0) </details> ### 📄 Description > Carried over from **old PR 9838** by `tedin7` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9838`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > This branch conflicts with the current `main` and needs a rebase. > `tedin7`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): `@ItsNotRexed`: an exe PR, as you asked. ## What `ds_append` and `ds_consume` join `_ALWAYS_BARRIER_OPS` in `tools/wave64_emulate_opt.py`, with a unit test on the classification (`_insn_may_barrier` and `_classify_block_body`). ## Why Under `--wave64-emulate` these two ops hand the LDS counter's old value to every lane through an exchange round, which emits `OpControlBarrier`. Without the entry, a block holding one can be classed sync-free in a 128+ thread group and `make_game.py --stages shaders` aborts with "unexpected OpControlBarrier in sync-free multi-wave block". `@autogenes-sudo` reported this on `#7154` with the `#3976` translator; an independent check with the same one-line fix is in the `#3976` thread. Honest scope: today's `origin/main` translator does not emit `ds_append`/`ds_consume` (`#3976` was closed in the org migration), so this prepares the classification for when it lands; it does not change output on current main. ## Tested `python3 -I tests/semantic/test_wave64_emulate_opt.py` on `origin/main` 2d53a8055 + this commit: 31 tests OK. Negative control: without the one-line change the new test fails ("False is not true : ds_append"). Synthetic data only; no game files. --- <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#158
No description provided.