rdna2spirv: track D16 XYZ writes per destination #701

Closed
akimfomin wants to merge 1 commit from upstream-pr/701 into main
akimfomin commented 2026-11-24 12:23:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by akimfomin on 2026-11-24T12:23:29Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5472074656 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/701). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-24T12:23:29Z. --- Claimed in [the Continued coordination thread](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7131221270) 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://github.com/ubiquitarianism/leonida/pull/265#issuecomment-7128554846) AI-assisted with Codex. Original change by ecox982745. PortBridge prepared the transfer and independent CPU check.
abnalstlll-byte commented 2026-11-24 12:29:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T12:29:40Z.

Review: APPROVED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6039203797 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/701#pullrequestreview-6039203797). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T12:29:40Z. **Review:** APPROVED --- 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.
GeorgiyDemo commented 2026-11-24 12:38:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by GeorgiyDemo on 2026-11-24T12:38:58Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7131731339 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/701#issuecomment-7131731339). Originally posted by [GeorgiyDemo](https://github.com/GeorgiyDemo) on 2026-11-24T12:38:58Z. --- 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.
akimfomin commented 2026-11-24 13:23:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by akimfomin on 2026-11-24T13:23:20Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7132758424 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/701#issuecomment-7132758424). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-24T13:23:20Z. --- 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://github.com/ubiquitarianism/leonida/pull/98#issuecomment-7120919542)
Sangonapou commented 2026-11-24 18:36:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Sangonapou on 2026-11-24T18:36:43Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7140888240 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/701#issuecomment-7140888240). Originally posted by [Sangonapou](https://github.com/Sangonapou) on 2026-11-24T18:36:43Z. --- 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.
ecox982745 commented 2026-11-24 22:44:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-24T22:44:46Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7146595012 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/701#issuecomment-7146595012). Originally posted by [ecox982745](https://github.com/ecox982745) on 2026-11-24T22:44:46Z. --- 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)
ecox982745 commented 2026-11-25 04:46:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-25T04:46:17Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7153148917 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/701#issuecomment-7153148917). Originally posted by [ecox982745](https://github.com/ecox982745) on 2026-11-25T04:46:17Z. --- 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.
MoonEyes commented 2026-11-27 23:20:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T23:20:14Z.


Hi @akimfomin, thanks for this pull request. It currently conflicts with main (conflicting file(s): docs/design.md), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7230061713 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/701#issuecomment-7230061713). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T23:20:14Z. --- Hi @akimfomin, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `docs/design.md`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
aslan2142 commented 2026-12-01 11:52:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:52:34Z.

Review: CHANGES_REQUESTED


Reviewed against current main: tracking D16 XYZ partial writes per destination in tools/wave64_halves.py looks solid, but this branch conflicts with main in docs/design.md and has failing CI. Please rebase onto current main so CI runs cleanly.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130705042 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/701#pullrequestreview-6130705042). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:52:34Z. **Review:** CHANGES_REQUESTED --- Reviewed against current `main`: tracking D16 XYZ partial writes per destination in `tools/wave64_halves.py` looks solid, but this branch conflicts with `main` in `docs/design.md` and has failing CI. Please rebase onto current `main` so CI runs cleanly. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 16:31:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:31:20Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7317744999 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/701#issuecomment-7317744999). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:31:20Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!701
No description provided.