[PR #1415] OLD-5237: rdna2spirv: the PS FRONT_FACE VGPR holds 0xffffffff / 0 (SHADER-892) #1445

Open
opened 2026-11-26 20:21:17 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1415
Author: @Tortoche
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: test-5237


📝 Commits (2)

  • 697b176 rdna2spirv: the PS FRONT_FACE VGPR holds 0xffffffff / 0, the form the game's shaders test (SHADER-892)
  • caa7d81 docs/design.md: the FRONT_FACE count rules out ±1.0; all-bits over 1/0 is the hardware's other form

📊 Changes

3 files changed (+56 additions, -5 deletions)

View changed files

📝 docs/design.md (+1 -1)
➕ tests/test_ps_front_face.py (+47 -0)
📝 tools/rdna2spirv.py (+8 -4)

📄 Description

Item ID: OLD-5237 (SHADER-892)
Carried forward from Draft #40 (old-pr/5237 by rafaelpssz), rebased onto main (58be9cdf8) with original commit authorship preserved.
Claimed in #14: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143844913

AI-assisted: yes

Summary

  • tools/rdna2spirv.py: store OpSelect %uint %ff 0xffffffff 0 into the pixel shader FRONT_FACE system VGPR (SPI_BARYC_CNTL.FRONT_FACE_ALL_BITS = 1), matching how all 345 corpus shaders that read it test it against integer 0 (v_cmp_ne_u32 / v_cmp_eq_u32).
  • tests/test_ps_front_face.py: hand-written synthetic pixel shader test verifying OpSelect %uint %ff 0xffffffff 0 into v4 and absence of the old float form (%ffm1).
  • docs/design.md: updated the PS system inputs contract row to document 0xffffffff / 0 and the corpus count.

Tests Executed (Linux, CPU/translator/runtime-build suites; no local GPU or game-data run performed)

  • python -I scripts/run_semantic_tests.py tests/semantic: 470 files, 6168 tests, 0 files failed (exit 0; 4060 s with 4 jobs)
  • python -I tests/test_ps_front_face.py: 1/1 passed (Ran 1 test in 0.022s, OK)
  • python -I tests/test_shader_meta.py: 28/28 passed (Ran 28 tests in 0.348s, OK)
  • python -I tests/test_docs_links.py: 16/16 passed (Ran 16 tests in 0.981s, OK)
  • python -I tests/test_design_contract_rows.py: 5/5 passed (Ran 5 tests in 0.025s, OK)
  • python -I tests/test_text_write_line_endings.py: 3/3 passed (Ran 3 tests in 257.636s, OK)
  • node --test tests/test_viewer_streaming.cjs: 57/57 passed (tests 57, pass 57, fail 0)
  • python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/test_ps_front_face.py docs/design.md: passed (exit 0, zero game data)
  • python -m compileall -q make_game.py tools tests: passed (exit 0)
  • ctest --test-dir runtime/build -C RelWithDebInfo --output-on-failure: 68/71 passed, 2 skipped (shader_library_corpus, vk_sync_validation), 1 timeout (36 - xdxr_build_check at 1502.94s under CPU contention); re-run isolated ctest --test-dir runtime/build -C RelWithDebInfo -R '^xdxr_build_check$' --output-on-failure: 2/2 passed (xdxr_build 3.48s, xdxr_build_check 617.85s) -> 69 passed, 2 skipped, 0 failed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1415 **Author:** [@Tortoche](https://github.com/Tortoche) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test-5237` --- ### 📝 Commits (2) - [`697b176`](https://github.com/ubiquitarianism/leonida/commit/697b1761d250c63bc70dfba586982f0aed2b57ac) rdna2spirv: the PS FRONT_FACE VGPR holds 0xffffffff / 0, the form the game's shaders test (SHADER-892) - [`caa7d81`](https://github.com/ubiquitarianism/leonida/commit/caa7d811253ee7cb276633cea87a0d56bda078b0) docs/design.md: the FRONT_FACE count rules out ±1.0; all-bits over 1/0 is the hardware's other form ### 📊 Changes **3 files changed** (+56 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -1) ➕ `tests/test_ps_front_face.py` (+47 -0) 📝 `tools/rdna2spirv.py` (+8 -4) </details> ### 📄 Description Item ID: `OLD-5237` (`SHADER-892`) Carried forward from Draft #40 (`old-pr/5237` by `rafaelpssz`), rebased onto `main` (`58be9cdf8`) with original commit authorship preserved. Claimed in #14: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143844913 AI-assisted: yes ### Summary - `tools/rdna2spirv.py`: store `OpSelect %uint %ff 0xffffffff 0` into the pixel shader `FRONT_FACE` system VGPR (`SPI_BARYC_CNTL.FRONT_FACE_ALL_BITS = 1`), matching how all 345 corpus shaders that read it test it against integer 0 (`v_cmp_ne_u32` / `v_cmp_eq_u32`). - `tests/test_ps_front_face.py`: hand-written synthetic pixel shader test verifying `OpSelect %uint %ff 0xffffffff 0` into `v4` and absence of the old float form (`%ffm1`). - `docs/design.md`: updated the `PS system inputs` contract row to document `0xffffffff` / `0` and the corpus count. ### Tests Executed (Linux, CPU/translator/runtime-build suites; no local GPU or game-data run performed) - `python -I scripts/run_semantic_tests.py tests/semantic`: **470 files, 6168 tests, 0 files failed** (exit 0; 4060 s with 4 jobs) - `python -I tests/test_ps_front_face.py`: **1/1 passed** (`Ran 1 test in 0.022s`, `OK`) - `python -I tests/test_shader_meta.py`: **28/28 passed** (`Ran 28 tests in 0.348s`, `OK`) - `python -I tests/test_docs_links.py`: **16/16 passed** (`Ran 16 tests in 0.981s`, `OK`) - `python -I tests/test_design_contract_rows.py`: **5/5 passed** (`Ran 5 tests in 0.025s`, `OK`) - `python -I tests/test_text_write_line_endings.py`: **3/3 passed** (`Ran 3 tests in 257.636s`, `OK`) - `node --test tests/test_viewer_streaming.cjs`: **57/57 passed** (`tests 57, pass 57, fail 0`) - `python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/test_ps_front_face.py docs/design.md`: **passed** (exit 0, zero game data) - `python -m compileall -q make_game.py tools tests`: **passed** (exit 0) - `ctest --test-dir runtime/build -C RelWithDebInfo --output-on-failure`: **68/71 passed, 2 skipped** (`shader_library_corpus`, `vk_sync_validation`), 1 timeout (`36 - xdxr_build_check` at 1502.94s under CPU contention); re-run isolated `ctest --test-dir runtime/build -C RelWithDebInfo -R '^xdxr_build_check$' --output-on-failure`: **2/2 passed** (`xdxr_build` 3.48s, `xdxr_build_check` 617.85s) -> **69 passed, 2 skipped, 0 failed**. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1445
No description provided.