shader_diff: exercise scalar addition and carry (s_add_u32) #453

Manually merged
github merged 1 commit from gh-pr/453/head into gh-pr/453/base 2026-11-26 09:01:00 +00:00
Owner

@⁠EdenBendheim on GitHub · 2026-11-24 05:40 UTC · original
EdenBendheim:ubiq/shader-diff-scalar-add → main · +141 −43 · 3 files · 1 commits · merged 2026-11-24 08:52 UTC

Claim: #14

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.
**@⁠EdenBendheim** on GitHub · 2026-11-24 05:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/453) `EdenBendheim:ubiq/shader-diff-scalar-add` → `main` · +141 −43 · 3 files · 1 commits · merged 2026-11-24 08:52 UTC Claim: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 ### 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:00:59 +00:00
github manually merged commit d94a025f5e into gh-pr/453/base 2026-11-26 09:01:00 +00:00
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 08:52 UTC · original

Merging. Why merged: the shader differential runner now covers scalar add and carry (s_add_u32), and replay commands include --ops.
Why it's good: test-harness only; on main 1c93c86: shader_diff tests 38 -> 42 (11 fail without the change); repo-consistency set 563/563.

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

**@⁠QemmHD** on GitHub · 2026-11-24 08:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/453#issuecomment-7126670213) Merging. Why merged: the shader differential runner now covers scalar add and carry (s_add_u32), and replay commands include --ops. Why it's good: test-harness only; on main 1c93c86: shader_diff tests 38 -> 42 (11 fail without the change); repo-consistency set 563/563. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.