rdna2spirv: explicit-gradient samples with compare or offset (SHADER-… #1480

Closed
vsking2000 wants to merge 1 commit from upstream-pr/1480 into main
vsking2000 commented 2026-11-25 01:13:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by vsking2000 on 2026-11-25T01:13:07Z.


…SAMPLE-GRAD-FORMS)

image_sample_c_d, image_sample_c_d_cl, image_sample_d_o, image_sample_d_cl_o, image_sample_c_d_o and image_sample_c_d_cl_o were refused by name. They combine pieces the translator already has as GPU-tested rules (depth compare, explicit gradients, _o offsets, the min-LOD clamp): address order offset, z-compare, dP/dx, dP/dy, coordinates, clamp, as LLVM (AMDGPUSampleVariants, lowerImage) and Mesa ACO both emit it. The sample is OpImageSample(Dref)ExplicitLod with Grad, Offset and MinLod in that order; a16 keeps the compare and the f32 gradients whole.

Refused with a reason: compare on a 3D image, 3D gradient forms with tfe/lwe, and the _o forms under --texel-offset-fallback (the shifted level is not computed from explicit gradients). The _cd and g16 forms stay refused. docs/design.md gets a row; the two rows that listed these as refused now point to it. Not run on a GPU.

Claude-Session: https://claude.ai/code/session_01Y7fbZYVY7EtLknWBZUfSLf

Claimed in the coordination issue as:

Depends on:

Fixes:

What and why

Tested

GPUs tested:

AI-assisted:

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5483182830 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1480). Originally posted by [vsking2000](https://github.com/vsking2000) on 2026-11-25T01:13:07Z. --- …SAMPLE-GRAD-FORMS) image_sample_c_d, image_sample_c_d_cl, image_sample_d_o, image_sample_d_cl_o, image_sample_c_d_o and image_sample_c_d_cl_o were refused by name. They combine pieces the translator already has as GPU-tested rules (depth compare, explicit gradients, _o offsets, the min-LOD clamp): address order offset, z-compare, dP/dx, dP/dy, coordinates, clamp, as LLVM (AMDGPUSampleVariants, lowerImage) and Mesa ACO both emit it. The sample is OpImageSample(Dref)ExplicitLod with Grad, Offset and MinLod in that order; a16 keeps the compare and the f32 gradients whole. Refused with a reason: compare on a 3D image, 3D gradient forms with tfe/lwe, and the _o forms under --texel-offset-fallback (the shifted level is not computed from explicit gradients). The _cd and g16 forms stay refused. docs/design.md gets a row; the two rows that listed these as refused now point to it. Not run on a GPU. Claude-Session: https://claude.ai/code/session_01Y7fbZYVY7EtLknWBZUfSLf Claimed in the coordination issue as: <!-- the item ID from the open "Coordinating who works on what" issue, for example TEST-17, or a link to your claim --> Depends on: <!-- #N for every pull request this one builds on or conflicts with (the coordination issue's Commands section, AGENTS.md); delete the line if it builds on none and conflicts with none --> Fixes: <!-- #N for each issue this closes (GitHub closes it on merge); delete the line if it closes none --> ### What and why <!-- What this changes and the problem it solves. --> ### Tested <!-- What you ran and on which GPU and driver (CONTRIBUTING.md). For the shader translator: how many shaders translate and pass spirv-val, before and after. --> GPUs tested: <!-- vendor, model, driver and OS of each GPU the GPU tests ran on, or n/a --> AI-assisted: <!-- yes or no (AGENTS.md asks a coding agent to say so) --> ### Checklist - [ ] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [ ] One topic; follow-up work goes in a new pull request. - [ ] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
GeorgiyDemo commented 2026-11-25 01:20:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by GeorgiyDemo on 2026-11-25T01:20:25Z.


Tested a768a6501 on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against main b4b7756e8 (translator-only PR; binaries from the build at 66d4f5aa3):

  • python3 -m unittest test_sample_grad_forms (from tests/semantic): OK at this head. The same file on main fails 2 + 34 errors — the six new combined forms (image_sample_c_d, _c_d_cl, _d_o, _d_cl_o, _c_d_o, _c_d_cl_o) are refused there.
  • GPU regression, --filter ps_sample_ on MoltenVK 1.4.2: 6/6 PASS (ps_sample_c, ps_sample_c_b, ps_sample_c_lz, ps_sample_c_lz_a16, ps_sample_implicit_sint, ps_sample_implicit_uint).
  • Not run: GPU execution of the six new forms themselves — no .asm fixture for them locally; the semantic suite is the evidence.

AI-assisted; synthetic fixtures only, no game data.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7149446403 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1480#issuecomment-7149446403). Originally posted by [GeorgiyDemo](https://github.com/GeorgiyDemo) on 2026-11-25T01:20:25Z. --- Tested `a768a6501` on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against `main` `b4b7756e8` (translator-only PR; binaries from the build at `66d4f5aa3`): - `python3 -m unittest test_sample_grad_forms` (from `tests/semantic`): **OK** at this head. The same file on `main` fails **2 + 34 errors** — the six new combined forms (`image_sample_c_d`, `_c_d_cl`, `_d_o`, `_d_cl_o`, `_c_d_o`, `_c_d_cl_o`) are refused there. - GPU regression, `--filter ps_sample_` on **MoltenVK 1.4.2**: **6/6 PASS** (`ps_sample_c`, `ps_sample_c_b`, `ps_sample_c_lz`, `ps_sample_c_lz_a16`, `ps_sample_implicit_sint`, `ps_sample_implicit_uint`). - Not run: GPU execution of the six new forms themselves — no `.asm` fixture for them locally; the semantic suite is the evidence. AI-assisted; synthetic fixtures only, no game data.
MoonEyes commented 2026-11-27 22:43:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T22:43:00Z.


Hi @vsking2000, thanks for this pull request.

CONTRIBUTING.md asks contributors to claim their work in the coordination issue ("Coordinating who works on what", currently #1608) before opening a pull request: post claiming: <ID> there, or a one-line description if the item is not listed yet, and put the ID in the pull request. I could not find a claim from you for this one (the ID SHADER-SAMPLE-GRAD-FORMS appears in the pull request, but there is no claiming: line for it).

The claim matters because "it is claimed in the coordination issue by the pull request's author" is the first item on the maintainers' checklist for a mergeable pull request, and because it lets others see that the work is taken before they write it a second time.

Could you post the claim in #1608 and add the ID to the pull request description? If you already claimed it in another form, a link to your comment is enough.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7229558502 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1480#issuecomment-7229558502). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T22:43:00Z. --- Hi @vsking2000, thanks for this pull request. CONTRIBUTING.md asks contributors to claim their work in the coordination issue ("Coordinating who works on what", currently #1608) before opening a pull request: post `claiming: <ID>` there, or a one-line description if the item is not listed yet, and put the ID in the pull request. I could not find a claim from you for this one (the ID `SHADER-SAMPLE-GRAD-FORMS` appears in the pull request, but there is no `claiming:` line for it). The claim matters because "it is claimed in the coordination issue by the pull request's author" is the first item on the maintainers' checklist for a mergeable pull request, and because it lets others see that the work is taken before they write it a second time. Could you post the claim in #1608 and add the ID to the pull request description? If you already claimed it in another form, a link to your comment is enough. AI-assisted (Claude Code, Claude Opus 5.5).
MoonEyes commented 2026-11-28 18:01:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T18:01:46Z.


Hi @vsking2000, thanks for this pull request. It currently conflicts with main (conflicting file(s): docs/design.md, tools/rdna2spirv.py), 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:7243473459 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1480#issuecomment-7243473459). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T18:01:46Z. --- Hi @vsking2000, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `docs/design.md`, `tools/rdna2spirv.py`), 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:47:33 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


This PR cannot merge in its current state:

  • Merge conflicts with main in docs/design.md and tools/rdna2spirv.py.
  • No CI run on current head a768a65.
  • Please also link the coordination-issue claim in the PR description per CONTRIBUTING.md.

Please rebase onto current main and obtain a green CI run.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130615961 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1480#pullrequestreview-6130615961). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:47:33Z. **Review:** CHANGES_REQUESTED --- This PR cannot merge in its current state: - **Merge conflicts** with `main` in `docs/design.md` and `tools/rdna2spirv.py`. - **No CI run** on current head `a768a65`. - Please also link the coordination-issue claim in the PR description per `CONTRIBUTING.md`. Please rebase onto current `main` and obtain a green CI run. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 16:36:25 +00:00 (Migrated from github.com)

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


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:7317884993 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1480#issuecomment-7317884993). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:36:25Z. --- 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!1480
No description provided.