[PR #453] [MERGED] shader_diff: exercise scalar addition and carry (s_add_u32) #504

Closed
opened 2026-11-26 20:18:06 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/453
Author: @EdenBendheim
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD

Base: main ← Head: ubiq/shader-diff-scalar-add


📝 Commits (1)

  • d94a025 shader_diff: exercise scalar addition and carry

📊 Changes

3 files changed (+141 additions, -43 deletions)

View changed files

📝 tests/test_shader_diff.py (+11 -12)
➕ tests/test_shader_diff_scalar_add.py (+87 -0)
📝 tools/shader_diff.py (+43 -31)

📄 Description

Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123163799

What changed

  • tools/shader_diff.py: Generate s_add_u32 from seeded SGPRs by default and add --ops filtering for focused runs and replay, exporting both the running sum and scc carry into the two least-recently-written export VGPRs so both CPU oracles compare them.
  • tests/test_shader_diff_scalar_add.py & tests/test_shader_diff.py: Deterministic synthetic tests covering default generation, --ops s_add_u32 replay, ordinary addition, 32-bit wraparound (0xffffffff + 1, 0xffffffff + 2), negative mismatch control, and updated fixture seeds preserving register-allocation boundary coverage.

Testing & Disclosure

  • AI-assisted: Implemented with Codex (gpt-6.2-sol) and reviewed with Codex (gpt-6.2-astra).
  • Environment: macOS 27.3, Apple M1 Max (CPU-only, synthetic programs, zero game data).
  • Verified on ubiquitarianism/leonida main (8f481cf16): pytest tests/test_shader_diff.py (20/20), test_shader_diff_exit.py (18/18), test_shader_diff_scalar_add.py (4/4), 10/10 --ops s_add_u32 runs, 3/3 self-test canaries, check_no_game_data.py, LF check — all passed.

🔄 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/453 **Author:** [@EdenBendheim](https://github.com/EdenBendheim) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `ubiq/shader-diff-scalar-add` --- ### 📝 Commits (1) - [`d94a025`](https://github.com/ubiquitarianism/leonida/commit/d94a025f5e07234371fe13b3fca82f32cee75cbe) shader_diff: exercise scalar addition and carry ### 📊 Changes **3 files changed** (+141 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_shader_diff.py` (+11 -12) ➕ `tests/test_shader_diff_scalar_add.py` (+87 -0) 📝 `tools/shader_diff.py` (+43 -31) </details> ### 📄 Description Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123163799 ### What changed - **`tools/shader_diff.py`**: Generate `s_add_u32` from seeded SGPRs by default and add `--ops` filtering for focused runs and replay, exporting both the running sum and `scc` carry into the two least-recently-written export VGPRs so both CPU oracles compare them. - **`tests/test_shader_diff_scalar_add.py` & `tests/test_shader_diff.py`**: Deterministic synthetic tests covering default generation, `--ops s_add_u32` replay, ordinary addition, 32-bit wraparound (`0xffffffff + 1`, `0xffffffff + 2`), negative mismatch control, and updated fixture seeds preserving register-allocation boundary coverage. ### Testing & Disclosure - **AI-assisted:** Implemented with Codex (`gpt-6.2-sol`) and reviewed with Codex (`gpt-6.2-astra`). - **Environment:** macOS 27.3, Apple M1 Max (CPU-only, synthetic programs, zero game data). - **Verified on `ubiquitarianism/leonida` `main` (`8f481cf16`):** `pytest tests/test_shader_diff.py` (20/20), `test_shader_diff_exit.py` (18/18), `test_shader_diff_scalar_add.py` (4/4), 10/10 `--ops s_add_u32` runs, 3/3 self-test canaries, `check_no_game_data.py`, LF check — all passed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:06 +01:00
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#504
No description provided.