cf_diff: the scalar "not equal" condition is s_cmp_lg, not s_cmp_ne #7

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

@⁠wavehs on GitHub · 2026-11-24 01:29 UTC · original
wavehs:cf-diff-scalar-lg → main · +5 −1 · 1 files · 1 commits · merged 2026-11-24 01:40 UTC

Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository has no such issue yet. No open pull request touches tools/cf_diff.py.

Depends on: none.

What and why

CCS is shared by the fuzzer's vector compares (v_cmp_ne_* exists in VOPC) and by the scalar sif shape, which emitted s_cmp_ne_u32. SOPC has no ne encoding — s_cmp_lg_* is the RDNA2 "less-than-or-greater-than" form, and rdna2spirv correctly refuses s_cmp_ne_* (tests/semantic/test_sopc_validation.py lists it as a nonexistent mnemonic). One of the six seeded programs therefore came back as translator unsupported: s_cmp_ne_u32:

FAILED tests/test_cf_diff.py::test_small_fixed_seed_run_is_clean[structured-32]
E  AssertionError: {'pass': 5, 'skip': {'translator unsupported: s_cmp_ne_u32': 1}, ...}
E  assert 5 == 6

(and the same for [dispatch-loop-32]).

The fuzzer now maps the condition to lg at the scalar emission site only; the vector compares keep v_cmp_ne_*. cf_ref already treats ne and lg as the same predicate, so the reference side is unchanged.

Tested

main@30daa6958, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files, spirv-val for the translated programs:

tree tests/test_cf_diff.py
main@30daa6958 structured-32 and dispatch-loop-32 fail with pass 5 != 6
this commit 68 passed, 64 subtests (test_cf_diff.py + test_cf_ref.py)

tests/semantic/test_sopc_validation.py still passes (79 passed with the two files above), compileall clean, check_no_game_data.py clean.

AI-assisted: yes.

Checklist

  • 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. (Not applicable: no translator change; the translator is right to refuse s_cmp_ne_*.)
**@⁠wavehs** on GitHub · 2026-11-24 01:29 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/7) `wavehs:cf-diff-scalar-lg` → `main` · +5 −1 · 1 files · 1 commits · merged 2026-11-24 01:40 UTC Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository has no such issue yet. No open pull request touches `tools/cf_diff.py`. Depends on: none. ### What and why `CCS` is shared by the fuzzer's vector compares (`v_cmp_ne_*` exists in VOPC) and by the scalar `sif` shape, which emitted `s_cmp_ne_u32`. SOPC has no `ne` encoding — `s_cmp_lg_*` is the RDNA2 "less-than-or-greater-than" form, and `rdna2spirv` correctly refuses `s_cmp_ne_*` (`tests/semantic/test_sopc_validation.py` lists it as a nonexistent mnemonic). One of the six seeded programs therefore came back as `translator unsupported: s_cmp_ne_u32`: ``` FAILED tests/test_cf_diff.py::test_small_fixed_seed_run_is_clean[structured-32] E AssertionError: {'pass': 5, 'skip': {'translator unsupported: s_cmp_ne_u32': 1}, ...} E assert 5 == 6 ``` (and the same for `[dispatch-loop-32]`). The fuzzer now maps the condition to `lg` at the scalar emission site only; the vector compares keep `v_cmp_ne_*`. `cf_ref` already treats `ne` and `lg` as the same predicate, so the reference side is unchanged. ### Tested `main@30daa6958`, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files, `spirv-val` for the translated programs: | tree | `tests/test_cf_diff.py` | |---|---| | `main@30daa6958` | `structured-32` and `dispatch-loop-32` fail with `pass 5 != 6` | | this commit | 68 passed, 64 subtests (`test_cf_diff.py` + `test_cf_ref.py`) | `tests/semantic/test_sopc_validation.py` still passes (79 passed with the two files above), `compileall` clean, `check_no_game_data.py` clean. AI-assisted: yes. ### Checklist - [x] 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. (Not applicable: no translator change; the translator is right to refuse `s_cmp_ne_*`.)
CCS serves both v_cmp (VOPC, where v_cmp_ne_* exists) and the sif shape's
s_cmp, but SOPC has no 'ne' encoding: rdna2spirv correctly refuses
s_cmp_ne_u32 (tests/semantic/test_sopc_validation.py lists it as a
nonexistent mnemonic). One of the six seeded programs then came back as
'translator unsupported: s_cmp_ne_u32' and test_small_fixed_seed_run_is_clean[structured-32]
failed with pass 5 != 6 (dispatch-loop-32 likewise). Map 'ne' to the
real encoding 'lg' at the scalar emission site only; the vector compares
keep v_cmp_ne_*.

(cherry picked from commit 9ccfea42211aa7268ddd5a91ff2b9f0eb20adb1a)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:39:59 +00:00
github manually merged commit 27a7a0c633 into gh-pr/7/base 2026-11-26 08:40:01 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.