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

Merged
wavehs merged 1 commit from upstream-pr/7 into main 2026-11-24 01:40:23 +00:00
wavehs commented 2026-11-24 01:29:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-24T01:29:59Z.


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_*.)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5464348842 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/7). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-24T01:29:59Z. --- 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_*`.)
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!7
No description provided.