Skip to content

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
MoonEyes merged 3 commits into
ProjectLeonida:mainfrom
OreoFR:carry/pr-2362
Nov 30, 2026

Conversation

@OreoFR

@OreoFR OreoFR commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Carries #2362 by @ShotTechOp, because it conflicts with main after #2566 and the reminder to merge main (#2362 (comment)) 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 #2570 (comment); original item SHADER-DPP-F16-AND-SIGN-MODS).

What this branch is

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

ShotTechOp and others added 3 commits November 26, 2026 21:00
dpp_insn: main's v_cvt_f32_f16 pass-through kept; every other op gets neg/abs forwarded on args[first] (main's index) instead of the eager 32-bit modify, as the PR does. design.md DPP row: PR sentence on main's text.

Co-authored-by: ShotTechOp <95485630+ShotTechOp@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Current main after ProjectLeonida#2566. New conflict on top of the earlier carry merge:
docs/design.md, DPP row: main rewrote the absent-lane part of the row
(present-lane ballot for FI=1); main's text is kept and the PR's sentence on
Gen.dpp_insn forwarding neg/abs is inserted at the same place as before,
after the HW-DPP-NEG-INVALID-LANE sentence.

Co-authored-by: ShotTechOp <95485630+ShotTechOp@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OreoFR

OreoFR commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator Author

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Collaborator

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).

@MoonEyes
MoonEyes merged commit bd466f8 into ProjectLeonida:main Nov 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants