rdna2spirv: track D16 XYZ writes per destination #701

Open
github-bot wants to merge 1 commit from github-bot/gh-701 into main AGit
Owner

@⁠akimfomin on GitHub · 2026-11-24 12:23 UTC · original
akimfomin:portbridge/d16-xyz-continued → main · +79 −4 · 4 files · 1 commits · open

Claimed in the Continued coordination thread as the D16 XYZ destination classification follow-up to #265.

PortBridge linked the original Reforge and Continued work and reproduced ecox982745’s correction on Continued. The original contributor is credited below and in the commit. The complete four-file change is carried over, including the two synthetic regressions and design note.

What and why

Track the two destination words separately for full-EXEC three-component D16 buffer loads. X/Y overwrite the first word. Only part of the second word keeps its old value. The tests cover both MUBUF and MTBUF cases and preserve the masked-write controls.

Tested

  • Continued base 21625bca8c67 on Windows 11, Python 3.12.14 (CPU).
  • Base passed 135 focused and neighboring checks. This exact four-file change passed 137/137. Adding the two tests without the classifier change reproduced seven failing subchecks.
  • The receiving-side run checks the classifier on CPU. The original Reforge report has the separate hardware evidence.

PortBridge pilot record · Earlier Continued result

AI-assisted with Codex. Original change by ecox982745. PortBridge prepared the transfer and independent CPU check.

**@⁠akimfomin** on GitHub · 2026-11-24 12:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/701) `akimfomin:portbridge/d16-xyz-continued` → `main` · +79 −4 · 4 files · 1 commits · open Claimed in [the Continued coordination thread](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) as the D16 XYZ destination classification follow-up to #265. [PortBridge](https://github.com/akimfomin/PortBridge) linked the original Reforge and Continued work and reproduced [ecox982745’s correction](https://github.com/ecox982745/Leonida/commit/a300ba63d1a9a4cdfde1d64f136728545b4ab7b8) on Continued. The original contributor is credited below and in the commit. The complete four-file change is carried over, including the two synthetic regressions and design note. **What and why** Track the two destination words separately for full-EXEC three-component D16 buffer loads. X/Y overwrite the first word. Only part of the second word keeps its old value. The tests cover both MUBUF and MTBUF cases and preserve the masked-write controls. **Tested** - Continued base `21625bca8c67` on Windows 11, Python 3.12.14 (CPU). - Base passed 135 focused and neighboring checks. This exact four-file change passed 137/137. Adding the two tests without the classifier change reproduced seven failing subchecks. - The receiving-side run checks the classifier on CPU. The [original Reforge report](https://github.com/LeonidaReforge/Leonida/pull/15#issuecomment-7125522634) has the separate hardware evidence. [PortBridge pilot record](https://github.com/akimfomin/PortBridge/issues/4) · [Earlier Continued result](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/265) AI-assisted with Codex. Original change by ecox982745. PortBridge prepared the transfer and independent CPU check.
Apply the original fix by ecox982745 on the Continued base. The linked
tests preserve the distinction between the complete first destination and
the partially preserved second destination on full-EXEC loads.

Source-commit: a300ba63d1
Co-authored-by: ecox982745 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:17:03 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 12:29 UTC · original · approved these changes

Reviewed and verified
dna2spirv: track D16 XYZ writes per destination. Accurately distinguishing the destination words of 3-component packed D16 buffer loads under full EXEC—where word 0 (X/Y) is fully overwritten while word 1 (Z) retains prior high 16-bit contents—refines wave64 tier classification without losing conservative tracking on masked or tagged writes. Comprehensive unit tests in \ ests/test_wave64_halves.py\ validate all permutations. Approved.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 12:29 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/701#pullrequestreview-6039203797) · **approved these changes** Reviewed and verified dna2spirv: track D16 XYZ writes per destination. Accurately distinguishing the destination words of 3-component packed D16 buffer loads under full EXEC—where word 0 (X/Y) is fully overwritten while word 1 (Z) retains prior high 16-bit contents—refines wave64 tier classification without losing conservative tracking on masked or tagged writes. Comprehensive unit tests in \ ests/test_wave64_halves.py\ validate all permutations. Approved.
Author
Owner

@⁠GeorgiyDemo on GitHub · 2026-11-24 12:38 UTC · original

Checked 66dbbf3e on Apple M5 Pro, macOS 26.7.3 (25G342), Python 3.15.2, against main d42773d07:

  • tests/semantic/test_wave64_halves_partial_dst.py: 15 tests OK at this head.
  • The same test file plus tests/semantic/fixtures/ps_wave64_d16_xyz.asm copied onto main: 11 of 15 fail, so the new destination classification is exercised rather than only asserted.

No GPU leg from me: this changes tools/wave64_halves.py, whose fixture here is the semantic interpreter's, and the w64_graphics tier fixtures do not include a D16 XYZ case; I did not rebuild and rerun the full suite on this head. Synthetic fixtures only, no game data. AI-assisted.

**@⁠GeorgiyDemo** on GitHub · 2026-11-24 12:38 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/701#issuecomment-7131731339) Checked `66dbbf3e` on Apple M5 Pro, macOS 26.7.3 (25G342), Python 3.15.2, against `main` `d42773d07`: - `tests/semantic/test_wave64_halves_partial_dst.py`: 15 tests OK at this head. - The same test file plus `tests/semantic/fixtures/ps_wave64_d16_xyz.asm` copied onto `main`: **11 of 15 fail**, so the new destination classification is exercised rather than only asserted. No GPU leg from me: this changes `tools/wave64_halves.py`, whose fixture here is the semantic interpreter's, and the `w64_graphics` tier fixtures do not include a D16 XYZ case; I did not rebuild and rerun the full suite on this head. Synthetic fixtures only, no game data. AI-assisted.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-24 13:23 UTC · original · edited 2026-11-24 14:12 UTC

I compared the Linux CI result here with the run on its exact base 21625bca8. Both llvmpipe jobs report 166 passed, 2 failures and 80 skipped. The same two cases fail in both jobs (cs_imgload_d16_tfe and cs_imgload_tfe), with 64 mismatches each. The D16 case without TFE passes. Base job · PR job

I also merged the approved head 66dbbf3e into current main at 2d73c242 locally. It merged cleanly, kept the same four-file diff, and passed 267 test_wave64*.py checks in 13 files on Windows. The Linux failures above were already present on the PR base.

PortBridge connected this change with ecox982745’s Reforge fix and kept the source and prior independent runs together. Case and revisions

I also compared the macOS Runtime jobs for this same exact base and PR merge. All 248 test result lines match after removing timestamps and temporary path prefixes: 181 pass, 4 fail, and 63 skip. The four failing cases are the same in both jobs (cs_imgload_d16_tfe, cs_imgload_tfe, cs_fma_fused, and ps_ssharp). The first two TFE expectations are already tracked separately. Base macOS job · PR macOS job · TFE follow-up

**@⁠akimfomin** on GitHub · 2026-11-24 13:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/701#issuecomment-7132758424) · edited 2026-11-24 14:12 UTC I compared the Linux CI result here with the run on its exact base `21625bca8`. Both llvmpipe jobs report 166 passed, 2 failures and 80 skipped. The same two cases fail in both jobs (`cs_imgload_d16_tfe` and `cs_imgload_tfe`), with 64 mismatches each. The D16 case without TFE passes. [Base job](https://github.com/ubiquitarianism/leonida/actions/runs/45369028696/job/138417221555) · [PR job](https://github.com/ubiquitarianism/leonida/actions/runs/45393056599/job/138441521538) I also merged the approved head `66dbbf3e` into current `main` at `2d73c242` locally. It merged cleanly, kept the same four-file diff, and passed 267 `test_wave64*.py` checks in 13 files on Windows. The Linux failures above were already present on the PR base. [PortBridge](https://github.com/akimfomin/PortBridge) connected this change with ecox982745’s Reforge fix and kept the source and prior independent runs together. [Case and revisions](https://akimfomin.github.io/PortBridge/cases/pb-044801754884724660835754613454516035131.html) I also compared the macOS Runtime jobs for this same exact base and PR merge. All 248 test result lines match after removing timestamps and temporary path prefixes: 181 pass, 4 fail, and 63 skip. The four failing cases are the same in both jobs (`cs_imgload_d16_tfe`, `cs_imgload_tfe`, `cs_fma_fused`, and `ps_ssharp`). The first two TFE expectations are already tracked separately. [Base macOS job](https://github.com/ubiquitarianism/leonida/actions/runs/45369028696/job/138417222005) · [PR macOS job](https://github.com/ubiquitarianism/leonida/actions/runs/45393056599/job/138441521252) · [TFE follow-up](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/98)
Author
Owner

@⁠Sangonapou on GitHub · 2026-11-24 18:36 UTC · original

Tested 66dbbf3e on NVIDIA GeForce RTX 3080 Ti Laptop (Ampere, subgroup 32..32), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300): pass, on real hardware

Runtime built at this head with scripts\build_runtime.ps1 (MSVC 19.51); llvm-mc 23.1.6, SPIRV-Tools 2026.4. No game files.

  • CPU: tests/semantic/test_wave64_halves_partial_dst.py 15 OK.
  • w64_graphics.py (shaders from build.py at this head): tier A 9/9 and tier B 8/8 ok as two 32-lane halves; tier C 12/12 SKIP (needs a 64-and-32 device or W64G_REF).
  • GPU suite: 257 shaders, 257 translated, 257 pass spirv-val; native 197/248 passed, 49 skipped; LEONIDA_W64_EMULATE=1 229/248 passed, 17 skipped. The only failures are cs_imgload_tfe / cs_imgload_d16_tfe, which fail the same way on main on this card (#892), so nothing new beside the llvmpipe CI comparison above.
**@⁠Sangonapou** on GitHub · 2026-11-24 18:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/701#issuecomment-7140888240) Tested 66dbbf3e on NVIDIA GeForce RTX 3080 Ti Laptop (Ampere, subgroup 32..32), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300): pass, on real hardware Runtime built at this head with `scripts\build_runtime.ps1` (MSVC 19.51); `llvm-mc` 23.1.6, SPIRV-Tools 2026.4. No game files. - CPU: `tests/semantic/test_wave64_halves_partial_dst.py` 15 OK. - `w64_graphics.py` (shaders from `build.py` at this head): tier A 9/9 and tier B 8/8 `ok` as two 32-lane halves; tier C 12/12 `SKIP` (needs a 64-and-32 device or `W64G_REF`). - GPU suite: 257 shaders, 257 translated, 257 pass spirv-val; native 197/248 passed, 49 skipped; `LEONIDA_W64_EMULATE=1` 229/248 passed, 17 skipped. The only failures are `cs_imgload_tfe` / `cs_imgload_d16_tfe`, which fail the same way on `main` on this card (#892), so nothing new beside the llvmpipe CI comparison above.
Author
Owner

@⁠ecox982745 on GitHub · 2026-11-24 22:44 UTC · original

I reran the 12 synthetic pixel-shader probes from our Reforge D16 review on this PR’s head 66dbbf3e and its parent 21625bca. Both runs used the same vk_harness, built from 66dbbf3e, on an RTX 4090 (Windows 11, NVIDIA 616.64, LLVM 23.1.6, SPIRV-Tools 2026.4).

Check Parent PR head
Default-mode shaders translated and passing SPIR-V validation 12/12 12/12
Shaders accepted by --wave64-graphics error 2/12 8/12

The six newly accepted shaders were the three constant-output cases for each of the typed and untyped D16 XYZ buffer loads. Both lane-dependent loads and both asymmetric row-mask controls were still rejected in strict mode. All eight strict-mode binaries on the PR matched their default-mode counterparts byte for byte.

On hardware, all 12 default-mode outputs matched the expected value sets. The per-case pixel histograms were identical between revisions (4,096 pixels per case, 49,152 per revision). The RTX 4090 exercised 32-lane fragment subgroups; native 64-lane fragment subgroups were unavailable. The PR’s focused CPU regression also passed 15/15.

AI-assisted hardware verification using OpenAI Codex and hand-written synthetic inputs. Original D16 correction

**@⁠ecox982745** on GitHub · 2026-11-24 22:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/701#issuecomment-7146595012) I reran the 12 synthetic pixel-shader probes from our Reforge D16 review on this PR’s head `66dbbf3e` and its parent `21625bca`. Both runs used the same `vk_harness`, built from `66dbbf3e`, on an RTX 4090 (Windows 11, NVIDIA 616.64, LLVM 23.1.6, SPIRV-Tools 2026.4). | Check | Parent | PR head | | --- | ---: | ---: | | Default-mode shaders translated and passing SPIR-V validation | 12/12 | 12/12 | | Shaders accepted by `--wave64-graphics error` | 2/12 | 8/12 | The six newly accepted shaders were the three constant-output cases for each of the typed and untyped D16 XYZ buffer loads. Both lane-dependent loads and both asymmetric row-mask controls were still rejected in strict mode. All eight strict-mode binaries on the PR matched their default-mode counterparts byte for byte. On hardware, all 12 default-mode outputs matched the expected value sets. The per-case pixel histograms were identical between revisions (4,096 pixels per case, 49,152 per revision). The RTX 4090 exercised 32-lane fragment subgroups; native 64-lane fragment subgroups were unavailable. The PR’s focused CPU regression also passed 15/15. AI-assisted hardware verification using OpenAI Codex and hand-written synthetic inputs. [Original D16 correction](https://github.com/ecox982745/Leonida/commit/a300ba63d1a9a4cdfde1d64f136728545b4ab7b8)
Author
Owner

@⁠ecox982745 on GitHub · 2026-11-25 04:46 UTC · original

I checked the merge conflict GitHub now reports for #701. At main c7e82e26 and PR head 66dbbf3e, only docs/design.md conflicts. Git merges the classifier and both test files automatically.

I tested this resolution locally: take docs/design.md from c7e82e26 and insert the PR's one row headed Wave64 graphics: three-component D16 buffer loads immediately above Out-of-bounds typed buffer loads and DST_SEL=1. This preserves the newer bounds documentation in full. The resulting diff against main touches the original four PR files and adds exactly one documentation row.

  • CPU: all 195 tests in the five test_wave64_halves*.py files passed. The five design-contract checks and 16 docs-link tests also passed.
  • RTX 4090: I rebuilt vk_harness from the resolved tree and ran the 12 synthetic probes on Windows, NVIDIA 616.64. All 12 translated and passed SPIR-V validation in default mode. Strict mode accepted the same eight as the original head, and all twelve 4,096-pixel histograms matched that head exactly.

This was a local merge check. The open PR still needs its branch updated. AI-assisted verification.

**@⁠ecox982745** on GitHub · 2026-11-25 04:46 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/701#issuecomment-7153148917) I checked the merge conflict GitHub now reports for #701. At `main` `c7e82e26` and PR head `66dbbf3e`, **only `docs/design.md` conflicts**. Git merges the classifier and both test files automatically. I tested this resolution locally: take `docs/design.md` from `c7e82e26` and insert the PR's one row headed **Wave64 graphics: three-component D16 buffer loads** immediately above **Out-of-bounds typed buffer loads and `DST_SEL=1`**. This preserves the newer bounds documentation in full. The resulting diff against main touches the original four PR files and adds exactly one documentation row. - **CPU:** all 195 tests in the five `test_wave64_halves*.py` files passed. The five design-contract checks and 16 docs-link tests also passed. - **RTX 4090:** I rebuilt `vk_harness` from the resolved tree and ran the 12 synthetic probes on Windows, NVIDIA 616.64. All 12 translated and passed SPIR-V validation in default mode. Strict mode accepted the same eight as the original head, and all twelve 4,096-pixel histograms matched that head exactly. This was a local merge check. The open PR still needs its branch updated. AI-assisted verification.
This pull request has changes conflicting with the target branch.
  • docs/design.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/701/head:github-bot/gh-701'
git switch 'github-bot/gh-701'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-701'
git switch 'github-bot/gh-701'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-701'
git switch 'github-bot/gh-701'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-701'
git switch 'main'
git merge --squash 'github-bot/gh-701'
git switch 'main'
git merge --ff-only 'github-bot/gh-701'
git switch 'main'
git merge 'github-bot/gh-701'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.