reprend #2362: rdna2spirv: forward DPP src0 neg/abs to op readers instead of eager 32-bit modify (SHADER-DPP-F16-AND-SIGN-MODS) #2730

Merged
OreoFR merged 3 commits from upstream-pr/2730 into main 2026-11-30 16:24:42 +00:00
OreoFR commented 2026-11-30 13:38:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T13:38:41Z.


Carries #2362 by @ShotTechOp, because it conflicts with main after #2566 and the reminder to merge main (https://github.com/ProjectLeonida/mandy/pull/2362#issuecomment-7232690736) got no answer within the delay of the carry rule. If the author comes back, this carry is dropped.

Item: SHADER-DPP-F16-AND-SIGN-MODS-CARRY (claimed in https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7280119323; original item SHADER-DPP-F16-AND-SIGN-MODS).

What this branch is

  • The author's branch at cf622ce9c, unchanged (no rebase, author commits kept).
  • A merge of main (from the carry preparation of 29/11) that resolves the conflict, then a merge of current main f9f3ec4c6, which had a new conflict (below). Both merge commits carry Co-authored-by the author.
  • Nothing else: the change itself is the original PR's; see #2362 for what and why, and the verifications posted there.

What conflicted and how it was resolved

  • tools/rdna2spirv.py (2 hunks): Gen.dpp_insn keeps main's pass-through of v_cvt_f32_f16; every other op gets neg/abs on args[first] (main's index) instead of the eager 32-bit modify, as the PR does.
  • docs/design.md, DPP row: the PR's sentence on main's text.
  • New with f9f3ec4c6: docs/design.md, DPP row: main rewrote its absent-lane part (present-lane ballot for FI=1); main's text kept, the PR's sentence on Gen.dpp_insn inserted at the same place (after the HW-DPP-NEG-INVALID-LANE sentence).

Tests

  • On this branch (main f9f3ec4c6 merged), Windows 11, Python 3.12, no GPU used: tests/semantic/test_dpp_f16_mods.py: 4 OK; test_dpp_eager_subgroup.py: 8 OK and test_absent_lane_ub.py: 18 OK (main's new DPP tests); tests/test_design_contract_rows.py and tests/test_docs_design_rows.py: OK.
  • Earlier merge: green 4 OK; red (main's rdna2spirv.py): 3 failures; full semantic suite 530 files / 6529 tests, same 2 failures as main.
  • python -I scripts/check_no_game_data.py on every file this PR changes: clean.
  • CI on this PR covers the rest (C++ build and ctest, the full translator suite).

Depends on: none.

Needs an independent verifier before merge (red/green on another machine), as for any carry.

AI-assisted (Claude Code, oreofr-agent).

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5566378564 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2730). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-30T13:38:41Z. --- Carries #2362 by @ShotTechOp, because it conflicts with `main` after #2566 and the reminder to merge `main` (https://github.com/ProjectLeonida/mandy/pull/2362#issuecomment-7232690736) got no answer within the delay of the carry rule. If the author comes back, this carry is dropped. Item: `SHADER-DPP-F16-AND-SIGN-MODS-CARRY` (claimed in https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7280119323; original item `SHADER-DPP-F16-AND-SIGN-MODS`). ### What this branch is - The author's branch at `cf622ce9c`, unchanged (no rebase, author commits kept). - A merge of `main` (from the carry preparation of 29/11) that resolves the conflict, then a merge of current `main` `f9f3ec4c6`, which had a new conflict (below). Both merge commits carry `Co-authored-by` the author. - Nothing else: the change itself is the original PR's; see #2362 for what and why, and the verifications posted there. ### What conflicted and how it was resolved - `tools/rdna2spirv.py` (2 hunks): `Gen.dpp_insn` keeps `main`'s pass-through of `v_cvt_f32_f16`; every other op gets `neg`/`abs` on `args[first]` (`main`'s index) instead of the eager 32-bit `modify`, as the PR does. - `docs/design.md`, DPP row: the PR's sentence on `main`'s text. - New with `f9f3ec4c6`: `docs/design.md`, DPP row: `main` rewrote its absent-lane part (present-lane ballot for FI=1); `main`'s text kept, the PR's sentence on `Gen.dpp_insn` inserted at the same place (after the HW-DPP-NEG-INVALID-LANE sentence). ### Tests - On this branch (`main` `f9f3ec4c6` merged), Windows 11, Python 3.12, no GPU used: `tests/semantic/test_dpp_f16_mods.py`: 4 OK; `test_dpp_eager_subgroup.py`: 8 OK and `test_absent_lane_ub.py`: 18 OK (`main`'s new DPP tests); `tests/test_design_contract_rows.py` and `tests/test_docs_design_rows.py`: OK. - Earlier merge: green 4 OK; red (`main`'s `rdna2spirv.py`): 3 failures; full semantic suite 530 files / 6529 tests, same 2 failures as `main`. - `python -I scripts/check_no_game_data.py` on every file this PR changes: clean. - CI on this PR covers the rest (C++ build and `ctest`, the full translator suite). Depends on: none. **Needs an independent verifier before merge** (red/green on another machine), as for any carry. AI-assisted (Claude Code, oreofr-agent). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
OreoFR commented 2026-11-30 13:46:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T13:46:11Z.


Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12.16 (pytest, no GPU), main f9f3ec4c6.

  • MEASURED, red (main + only this PR's tests): tests/semantic/test_dpp_f16_mods.py: 1 failed.
  • MEASURED, green (main + merge --no-ff of de2acaf95): 4 passed.
  • Not covered: the C++ build, ctest and the rest of the suite (CI).

Not independent: this PR and this check share the same owner (OreoFR). Treat it as a second-machine run, not an independent review.

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7280328857 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2730#issuecomment-7280328857). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-30T13:46:11Z. --- Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12.16 (pytest, no GPU), `main` `f9f3ec4c6`. - MEASURED, red (`main` + only this PR's tests): `tests/semantic/test_dpp_f16_mods.py`: 1 failed. - MEASURED, green (`main` + `merge --no-ff` of `de2acaf95`): 4 passed. - Not covered: the C++ build, `ctest` and the rest of the suite (CI). **Not independent:** this PR and this check share the same owner (OreoFR). Treat it as a second-machine run, not an independent review. AI-assisted: Claude Code
KelboLive commented 2026-11-30 14:16:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T14:16:40Z.


Independent check on Windows/NVIDIA (not the author), at de2acaf95.

  • tests/semantic/test_dpp_f16_mods.py: 4 passed.
  • Related DPP suites: test_dpp_bound_ctrl_modifiers.py 2 passed, test_dpp_eager_subgroup.py 8 passed, test_dpp_compare.py 13 passed.
  • Full translator suite on this branch: 550 files, 6,679 tests, 0 files failed (347 s, 32 jobs).
  • GPU, run_gpu_tests.py --filter dpp on the built runtime/build: 10/11 passed, 1 skipped (cs_dpp_w64, no 64-wide subgroup), including cs_dpp_ops, cs_dpp_cmp and cs_dpp_cmpx.

Machine: NVIDIA RTX 4070 Ti SUPER, driver 621.01 (Windows 32.0.16.2101), Windows 11 Pro 10.0.26200.9711, Python 3.12.10, llvm-mc 21.1.8. The new f16/sign-modifier rule is still CPU-only for the forms the PR adds (no GPU fixture covers them); the existing DPP fixtures are green. No regressions seen.

AI-assisted: yes (opencode).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7281117509 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2730#issuecomment-7281117509). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-30T14:16:40Z. --- Independent check on Windows/NVIDIA (not the author), at `de2acaf95`. - `tests/semantic/test_dpp_f16_mods.py`: **4 passed**. - Related DPP suites: `test_dpp_bound_ctrl_modifiers.py` 2 passed, `test_dpp_eager_subgroup.py` 8 passed, `test_dpp_compare.py` 13 passed. - Full translator suite on this branch: **550 files, 6,679 tests, 0 files failed** (347 s, 32 jobs). - GPU, `run_gpu_tests.py --filter dpp` on the built `runtime/build`: **10/11 passed, 1 skipped** (`cs_dpp_w64`, no 64-wide subgroup), including `cs_dpp_ops`, `cs_dpp_cmp` and `cs_dpp_cmpx`. Machine: NVIDIA RTX 4070 Ti SUPER, driver 621.01 (Windows 32.0.16.2101), Windows 11 Pro 10.0.26200.9711, Python 3.12.10, llvm-mc 21.1.8. The new f16/sign-modifier rule is still CPU-only for the forms the PR adds (no GPU fixture covers them); the existing DPP fixtures are green. No regressions seen. AI-assisted: yes (opencode).
merzleckeier commented 2026-11-30 14:40:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-30T14:40:18Z.


Independent Vulkan GPU A/B for the new DPP modifier cases

I tested de2acaf95 merged onto main b17b22d33 (tree 8ade2fcd9) on CachyOS. I translated the same synthetic cases from tests/semantic/test_dpp_f16_mods.py with each revision, dispatched them through vk_compute_test with the push-constant tail in a UBO, and compared the raw output words lane by lane.

MEASURED, mismatching words on main → with this PR

Case AMD Raphael iGPU, RADV 26.3.1 RTX 4070 SUPER, NVIDIA 620.73.04
Wave32 f16 add and multiply 64 → 0 / 64 48 → 0 / 64
Emulated Wave64 f16 add and multiply 128 → 0 / 128 96 → 0 / 128
Wave32 signaling NaN sign and class 64 → 0 / 64 64 → 0 / 64
Wave32 f16-to-f32 conversion with invalid-lane signed zero 0 → 0 / 32 0 → 0 / 32
Wave32 f16 minimum and compare 32 → 0 / 64 64 → 0 / 64
Native Wave64 f16 add and multiply 128 → 0 / 128 Skipped (32-wide subgroups only)

On both GPUs, negation on main produced the quiet NaN 0xffc00001 and the signaling-NaN class test returned false. With the PR the result was 0xff800001 and the class test returned true in all 32 lanes. The signed-zero case passed on both revisions.

The four stock CPU tests gave 1/4 on main and 4/4 with the PR. The four related DPP and absent-lane suites gave 41/41 on both. All 12 generated modules passed spirv-val --target-env vulkan1.2 (SPIRV-Tools 2026.4). The Vulkan validation layer was unavailable. A second Codex agent independently recomputed the GPU counts from the raw buffers.

Synthetic inputs only. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7281743375 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2730#issuecomment-7281743375). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-11-30T14:40:18Z. --- **Independent Vulkan GPU A/B for the new DPP modifier cases** I tested `de2acaf95` merged onto `main` `b17b22d33` (tree `8ade2fcd9`) on CachyOS. I translated the same synthetic cases from `tests/semantic/test_dpp_f16_mods.py` with each revision, dispatched them through `vk_compute_test` with the push-constant tail in a UBO, and compared the raw output words lane by lane. **MEASURED, mismatching words on `main` → with this PR** | Case | AMD Raphael iGPU, RADV 26.3.1 | RTX 4070 SUPER, NVIDIA 620.73.04 | | --- | ---: | ---: | | Wave32 f16 add and multiply | 64 → 0 / 64 | 48 → 0 / 64 | | Emulated Wave64 f16 add and multiply | 128 → 0 / 128 | 96 → 0 / 128 | | Wave32 signaling NaN sign and class | 64 → 0 / 64 | 64 → 0 / 64 | | Wave32 f16-to-f32 conversion with invalid-lane signed zero | 0 → 0 / 32 | 0 → 0 / 32 | | Wave32 f16 minimum and compare | 32 → 0 / 64 | 64 → 0 / 64 | | Native Wave64 f16 add and multiply | 128 → 0 / 128 | Skipped (32-wide subgroups only) | On both GPUs, negation on `main` produced the quiet NaN `0xffc00001` and the signaling-NaN class test returned false. With the PR the result was `0xff800001` and the class test returned true in all 32 lanes. The signed-zero case passed on both revisions. The four stock CPU tests gave 1/4 on `main` and 4/4 with the PR. The four related DPP and absent-lane suites gave 41/41 on both. All 12 generated modules passed `spirv-val --target-env vulkan1.2` (SPIRV-Tools 2026.4). The Vulkan validation layer was unavailable. A second Codex agent independently recomputed the GPU counts from the raw buffers. Synthetic inputs only. AI-assisted with OpenAI Codex.
MoonEyes commented 2026-11-30 16:22:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T16:22:17Z.


Verified by MoonEyes (another owner than OreoFR) on head de2acaf95: Windows 11, Python 3.14, no LLVM, no GPU run.

  • Red/green on main b17b22d33: tests/semantic/test_dpp_f16_mods.py 4 OK; without the change 3 failures.
  • Corpus slice, tools/rdna2spirv.py --wave64-emulate, shards 0, 12, 24 and 36 of 48 (2,209 shaders), main 20fe0c754 against main + this pull request: 2,209 translated and 2,209 pass spirv-val in both; the SPIR-V is byte-identical (this slice holds no shader that shows the change).

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7284556225 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2730#issuecomment-7284556225). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T16:22:17Z. --- Verified by MoonEyes (another owner than OreoFR) on head `de2acaf95`: Windows 11, Python 3.14, no LLVM, no GPU run. - Red/green on `main` `b17b22d33`: `tests/semantic/test_dpp_f16_mods.py` 4 OK; without the change 3 failures. - Corpus slice, `tools/rdna2spirv.py --wave64-emulate`, shards 0, 12, 24 and 36 of 48 (2,209 shaders), `main` `20fe0c754` against `main` + this pull request: 2,209 translated and 2,209 pass `spirv-val` in both; the SPIR-V is byte-identical (this slice holds no shader that shows the change). AI-assisted (Claude Code).
MoonEyes commented 2026-11-30 16:24:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T16:24:38Z.


Merging. Head de2acaf95 merges cleanly with main 1c78b8219 and does not force a rebase of #2566. Counts equal and SPIR-V byte-identical on the slice; red/green on Windows 11 by another owner. Merged by MoonEyes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7284619482 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2730#issuecomment-7284619482). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T16:24:38Z. --- Merging. Head `de2acaf95` merges cleanly with `main` `1c78b8219` and does not force a rebase of #2566. Counts equal and SPIR-V byte-identical on the slice; red/green on Windows 11 by another owner. Merged by MoonEyes. AI-assisted (Claude Code).
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!2730
No description provided.