tests: dense image_load tfe fixture, resident status preserved (TFE-DENSE-FIXTURE, by tahffo68hk-hash) #1271

Closed
Mouad-Scriptz-0 wants to merge 1 commit from upstream-pr/1271 into main
Mouad-Scriptz-0 commented 2026-11-24 21:08:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mouad-Scriptz-0 on 2026-11-24T21:08:03Z.


Claimed in the coordination issue as: TFE-DENSE-FIXTURE (#14)

Depends on: none

What and why

This opens @tahffo68hk-hash's fixture patch here, as they asked on #98. The commit is theirs: author and author date are kept from their patch (git am); I'm only the committer.

The evidence for the fix is on #98: on native gfx1036, a resident image_load ... tfe keeps the seeded status VGPR (48 raw-ISA kernels, 192 lanes, three seeds), and LLVM and Mesa ACO initialize that register themselves before the instruction. main's translator already keeps it. #892 has since corrected the two older fixtures (cs_imgload_tfe, cs_imgload_d16_tfe) to expect that.

This PR adds what #892 didn't cover: an independent dense check, runtime/test/shaders/cs_image_tfe_dense.asm. In one row of a resident 8×8 R32_UINT image, it reads x = −1, 0, 1, 2, 8, 9, 10, 11 (in bounds and out of bounds on both sides) with image_load … tfe and image_load … tfe d16, then stores:

  • the full-width data;
  • the status, seeded 0x5a5a03f5, which must be kept;
  • the D16 data, whose seeded 0x5a5a high half must be kept and whose out-of-bounds texels must be zero;
  • the D16 status, seeded 0x5a5a03f6, which must be kept.

It is judged through the existing vk_store_test words path: the expected words are in check.py's STORE_WORDS, which run_gpu_tests.py picks up by itself. docs/design.md gets a "Dense image_load tfe" contract row with the gfx1036, LLVM and ACO references.

Not included: tahffo's second patch, which rewrote the two older fixtures, because #892 already did that on main with its own seeds. The first patch needed one context fix to apply: main has since edited the "Typed image stores" row next to the new row, so I kept main's version of that row and added the new row unchanged.

Tested

Intel Meteor Lake graphics (ANV, Mesa 26.2.7, Fedora 45), test programs rebuilt from main 0b45fdc21:

run cs_image_tfe_dense cs_imgload_tfe cs_imgload_d16_tfe
this branch, native PASS (all 64 words exact) PASS PASS
this branch, LEONIDA_W64_EMULATE=1 PASS PASS PASS
negative control: this branch + #98's translator (status zeroed) FAIL: 16 of 64 sint words differ, word 8 got 0x00000000, expected 0x5a5a03f5 FAIL FAIL

The negative control shows the new fixture catches a translator that clears the status. It's the same 16-of-64 failure tahffo saw on an RTX 5060 Ti. All 3 modules translated and passed spirv-val.

Also OK: tests/test_shader_checks.py, tests/test_run_gpu_tests.py, tests/test_docs_links.py, tests/test_text_write_line_endings.py, tests/test_ci_registration.py, python -m compileall, and scripts/check_no_game_data.py on the three changed files.

GPUs tested: Intel Graphics (Meteor Lake-P, 8086:7d45), ANV Mesa 26.2.7, Fedora Linux 45; tahffo68hk-hash's runs are on #98 (RTX 5060 Ti 617.42, native gfx1036).

AI-assisted: yes

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. (no translator change; the new row records the measured behaviour the translator already has)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5480359515 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1271). Originally posted by [Mouad-Scriptz-0](https://github.com/Mouad-Scriptz-0) on 2026-11-24T21:08:03Z. --- Claimed in the coordination issue as: TFE-DENSE-FIXTURE (#14) Depends on: none ### What and why This opens @tahffo68hk-hash's fixture patch here, as they asked on #98. **The commit is theirs**: author and author date are kept from their patch (`git am`); I'm only the committer. The evidence for the fix is on #98: on native gfx1036, a resident `image_load ... tfe` keeps the seeded status VGPR (48 raw-ISA kernels, 192 lanes, three seeds), and LLVM and Mesa ACO initialize that register themselves before the instruction. `main`'s translator already keeps it. #892 has since corrected the two older fixtures (`cs_imgload_tfe`, `cs_imgload_d16_tfe`) to expect that. This PR adds what #892 didn't cover: an independent **dense** check, `runtime/test/shaders/cs_image_tfe_dense.asm`. In one row of a resident 8×8 R32_UINT image, it reads x = −1, 0, 1, 2, 8, 9, 10, 11 (in bounds and out of bounds on both sides) with `image_load … tfe` and `image_load … tfe d16`, then stores: - the full-width data; - the status, seeded `0x5a5a03f5`, which must be kept; - the D16 data, whose seeded `0x5a5a` high half must be kept and whose out-of-bounds texels must be zero; - the D16 status, seeded `0x5a5a03f6`, which must be kept. It is judged through the existing `vk_store_test words` path: the expected words are in `check.py`'s `STORE_WORDS`, which `run_gpu_tests.py` picks up by itself. `docs/design.md` gets a "Dense `image_load tfe`" contract row with the gfx1036, LLVM and ACO references. **Not included:** tahffo's second patch, which rewrote the two older fixtures, because #892 already did that on `main` with its own seeds. The first patch needed one context fix to apply: `main` has since edited the "Typed image stores" row next to the new row, so I kept `main`'s version of that row and added the new row unchanged. ### Tested Intel Meteor Lake graphics (ANV, Mesa 26.2.7, Fedora 45), test programs rebuilt from `main` `0b45fdc21`: | run | `cs_image_tfe_dense` | `cs_imgload_tfe` | `cs_imgload_d16_tfe` | |---|---|---|---| | this branch, native | PASS (all 64 words exact) | PASS | PASS | | this branch, `LEONIDA_W64_EMULATE=1` | PASS | PASS | PASS | | **negative control:** this branch + #98's translator (status zeroed) | **FAIL**: 16 of 64 sint words differ, word 8 got `0x00000000`, expected `0x5a5a03f5` | FAIL | FAIL | The negative control shows the new fixture catches a translator that clears the status. It's the same 16-of-64 failure tahffo saw on an RTX 5060 Ti. All 3 modules translated and passed `spirv-val`. Also OK: `tests/test_shader_checks.py`, `tests/test_run_gpu_tests.py`, `tests/test_docs_links.py`, `tests/test_text_write_line_endings.py`, `tests/test_ci_registration.py`, `python -m compileall`, and `scripts/check_no_game_data.py` on the three changed files. GPUs tested: Intel Graphics (Meteor Lake-P, 8086:7d45), ANV Mesa 26.2.7, Fedora Linux 45; tahffo68hk-hash's runs are on #98 (RTX 5060 Ti 617.42, native gfx1036). AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (no translator change; the new row records the measured behaviour the translator already has)
GeorgiyDemo commented 2026-11-24 21:14:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by GeorgiyDemo on 2026-11-24T21:14:35Z.


Tested b425df83 on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), binaries from main 66d4f5aa3 (no C++ changed in runtime/test since that build):

  • cs_image_tfe_dense PASS on MoltenVK 1.4.2 ("all 64 words of the uint image, the sint image and the volume exact") and the same PASS on KosmicKrisp (Mesa 26.3.1), 1/1 on each.
  • Note for the resident-status question: this fixture passes with main's translator as it stands, which agrees with #892's expectation (the resident status is left unchanged) rather than with #291 (the translator writes 0 into it). See my comment on #892 — the two cannot both land as written.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7144668616 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1271#issuecomment-7144668616). Originally posted by [GeorgiyDemo](https://github.com/GeorgiyDemo) on 2026-11-24T21:14:35Z. --- Tested `b425df83` on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), binaries from `main` `66d4f5aa3` (no C++ changed in `runtime/test` since that build): - `cs_image_tfe_dense` PASS on **MoltenVK 1.4.2** ("all 64 words of the uint image, the sint image and the volume exact") and the same PASS on **KosmicKrisp** (Mesa 26.3.1), 1/1 on each. - Note for the resident-status question: this fixture passes with `main`'s translator as it stands, which agrees with #892's expectation (the resident status is left unchanged) rather than with #291 (the translator writes 0 into it). See my comment on #892 — the two cannot both land as written. AI-assisted; synthetic fixtures only, no game data.
CodingRule commented 2026-11-25 12:20:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by CodingRule on 2026-11-25T12:20:23Z.


GPU test on an NVIDIA Ada card, for the record: this passes on an RTX 4090.

  • Tested: this branch's head b425df83 merged onto main 0d80bc5d (clean merge), test programs built from that main with scripts\build_runtime.ps1.
  • Command: python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_image_tfe_dense, once native and once with LEONIDA_W64_EMULATE=1.
  • Result: 1/1 translated and spirv-val clean, 1/1 passed in both modes, with the expected words/pixels from the fixture header. Nothing skipped.
  • Device: NVIDIA GeForce RTX 4090 (Ada / AD102), driver 591.86, Vulkan 1.4.325, subgroup 32..32, Windows 11 Pro build 26200. llvm-mc 21.1.8 (scripts\build_llvm_mc.ps1), SPIRV-Tools v2026.4, MSVC 14.44.35207.

Only the filtered fixture(s) were run for this PR, not the full suite or ctest; the full-suite baseline for this card on main is in #1777. Synthetic fixtures only, no game files. AI-assisted (Claude Code ran the tests and wrote this comment).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7162240381 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1271#issuecomment-7162240381). Originally posted by [CodingRule](https://github.com/CodingRule) on 2026-11-25T12:20:23Z. --- GPU test on an NVIDIA Ada card, for the record: this passes on an **RTX 4090**. - **Tested:** this branch's head `b425df83` merged onto `main` `0d80bc5d` (clean merge), test programs built from that `main` with `scripts\build_runtime.ps1`. - **Command:** `python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_image_tfe_dense`, once native and once with `LEONIDA_W64_EMULATE=1`. - **Result:** 1/1 translated and `spirv-val` clean, 1/1 passed in both modes, with the expected words/pixels from the fixture header. Nothing skipped. - **Device:** NVIDIA GeForce RTX 4090 (Ada / AD102), driver 591.86, Vulkan 1.4.325, subgroup 32..32, Windows 11 Pro build 26200. llvm-mc 21.1.8 (`scripts\build_llvm_mc.ps1`), SPIRV-Tools v2026.4, MSVC 14.44.35207. Only the filtered fixture(s) were run for this PR, not the full suite or ctest; the full-suite baseline for this card on `main` is in #1777. Synthetic fixtures only, no game files. AI-assisted (Claude Code ran the tests and wrote this comment).
zmasi commented 2026-11-28 23:46:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:46:46Z.


Native Windows 11 + NVIDIA GeForce RTX 3090 GPU Verification (PASS)

Verified commit b425df836d merged onto main (a9e247cd69) on Windows 11 (10.0.26200, MSVC 19.44.35228, Python 3.12.10, llvm-mc gfx1030) with physical NVIDIA GeForce RTX 3090 (driver 610.88, subgroup 32..32, Vulkan 1.4 + VK_LAYER_KHRONOS_validation 1.4.363.1):

  • Red (main): runtime/test/shaders/cs_image_tfe_dense.asm absent on main.
  • Green (b425df836d + main):
    • python -I runtime/test/shaders/build.py <dir> cs_image_tfe_dense -> 1/1 translated, 1 pass spirv-val.
    • Live RTX 3090 GPU execution (vk_store_test cs_image_tfe_dense.spv words with LEONIDA_VK_VALIDATION=1):
      • 0 Khronos validation errors, and all 32 sint output texels match check.py's STORE_WORDS["cs_image_tfe_dense"] bit-for-bit:
        • Row 0 (full-width image_load ... tfe data at x = -1,0,1,2,8,9,10,11): [0, 100, 101, 102, 0, 0, 0, 0]
        • Row 1 (full-width status VGPR v8): [0x5A5A03F5] * 8 preserved across both in-bounds and out-of-bounds reads
        • Row 2 (d16 image_load ... tfe d16 data): [0x5A5A0000, 0x5A5A0064, 0x5A5A0065, 0x5A5A0066, 0x5A5A0000, 0x5A5A0000, 0x5A5A0000, 0x5A5A0000] (seeded 0x5A5A high half preserved)
        • Row 3 (d16 status VGPR v10): [0x5A5A03F6] * 8 preserved
    • test_docs_table_rows.py (2/2), test_docs_encoding.py (1/1), test_docs_repo_paths.py (5/5), and check_no_game_data.py (0 issues) all pass.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247657727 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1271#issuecomment-7247657727). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T23:46:46Z. --- ## Native Windows 11 + NVIDIA GeForce RTX 3090 GPU Verification (`PASS`) Verified commit `b425df836d` merged onto `main` (`a9e247cd69`) on Windows 11 (`10.0.26200`, MSVC `19.44.35228`, Python `3.12.10`, `llvm-mc` `gfx1030`) with physical **NVIDIA GeForce RTX 3090** (driver `610.88`, subgroup `32..32`, Vulkan `1.4` + `VK_LAYER_KHRONOS_validation` `1.4.363.1`): - **Red (`main`)**: `runtime/test/shaders/cs_image_tfe_dense.asm` absent on `main`. - **Green (`b425df836d` + `main`)**: - `python -I runtime/test/shaders/build.py <dir> cs_image_tfe_dense` -> **`1/1 translated, 1 pass spirv-val`**. - **Live RTX 3090 GPU execution** (`vk_store_test cs_image_tfe_dense.spv words` with `LEONIDA_VK_VALIDATION=1`): - **`0` Khronos validation errors**, and all 32 `sint` output texels match `check.py`'s `STORE_WORDS["cs_image_tfe_dense"]` bit-for-bit: - Row 0 (full-width `image_load ... tfe` data at `x = -1,0,1,2,8,9,10,11`): `[0, 100, 101, 102, 0, 0, 0, 0]` - Row 1 (full-width status VGPR `v8`): `[0x5A5A03F5] * 8` preserved across both in-bounds and out-of-bounds reads - Row 2 (`d16` `image_load ... tfe d16` data): `[0x5A5A0000, 0x5A5A0064, 0x5A5A0065, 0x5A5A0066, 0x5A5A0000, 0x5A5A0000, 0x5A5A0000, 0x5A5A0000]` (seeded `0x5A5A` high half preserved) - Row 3 (`d16` status VGPR `v10`): `[0x5A5A03F6] * 8` preserved - `test_docs_table_rows.py` (`2/2`), `test_docs_encoding.py` (`1/1`), `test_docs_repo_paths.py` (`5/5`), and `check_no_game_data.py` (`0` issues) all pass. AI-assisted.
OreoFR commented 2026-11-29 00:15:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T00:15:30Z.


Verified by OreoFR

  • Base: main a8465211f + PR head b425df836 (merged with --no-ff, no conflict; tested in a package with other PRs that share no file with it)
  • Test: python -I scripts/run_gpu_tests.py --filter tfe (llvm-mc 23.1.6)
  • Red on main: no red possible: the PR only adds the fixture, and main's translator already keeps the status VGPR
  • Green with the PR: 3/3 pass on the GPU: cs_image_tfe_dense (all 64 words exact), cs_imgload_tfe, cs_imgload_d16_tfe
  • Verdict: NO RED (fixture-only; the new dense fixture passes on main's translator, as the PR expects)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11
  • Note: shares docs/design.md with the open #2566; a rebase may be needed if #2566 lands first.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247986651 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1271#issuecomment-7247986651). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T00:15:30Z. --- **Verified by OreoFR** - Base: main `a8465211f` + PR head `b425df836` (merged with --no-ff, no conflict; tested in a package with other PRs that share no file with it) - Test: `python -I scripts/run_gpu_tests.py --filter tfe` (llvm-mc 23.1.6) - Red on main: no red possible: the PR only adds the fixture, and main's translator already keeps the status VGPR - Green with the PR: 3/3 pass on the GPU: `cs_image_tfe_dense` (all 64 words exact), `cs_imgload_tfe`, `cs_imgload_d16_tfe` - Verdict: NO RED (fixture-only; the new dense fixture passes on main's translator, as the PR expects) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 - Note: shares `docs/design.md` with the open #2566; a rebase may be needed if #2566 lands first. AI-assisted (Claude Code, Claude Opus 5.5).
aslan2142 commented 2026-12-01 11:41:41 +00:00 (Migrated from github.com)

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

Review: APPROVED


LGTM. runtime/test/shaders/cs_image_tfe_dense.asm, its check.py expectation, and the docs/design.md note cleanly cover dense image_load tfe / d16 resident status preservation. Clean-room verified, MERGEABLE, and independently verified across MoltenVK and NVIDIA hardware. Holding merge until a fresh green CI pass completes on current main.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130516777 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1271#pullrequestreview-6130516777). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:41:41Z. **Review:** APPROVED --- LGTM. `runtime/test/shaders/cs_image_tfe_dense.asm`, its `check.py` expectation, and the `docs/design.md` note cleanly cover dense `image_load tfe` / `d16` resident status preservation. Clean-room verified, `MERGEABLE`, and independently verified across MoltenVK and NVIDIA hardware. Holding merge until a fresh green CI pass completes on current `main`. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 16:34:34 +00:00 (Migrated from github.com)

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


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