[PR #7] [MERGED] cf_diff: the scalar "not equal" condition is s_cmp_lg, not s_cmp_ne #67

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

📋 Pull Request Information

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

Base: main ← Head: cf-diff-scalar-lg


📝 Commits (1)

  • 27a7a0c cf_diff: the scalar 'not equal' condition is s_cmp_lg, not s_cmp_ne

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 tools/cf_diff.py (+5 -1)

📄 Description

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_*.)

🔄 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/7 **Author:** [@wavehs](https://github.com/wavehs) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `cf-diff-scalar-lg` --- ### 📝 Commits (1) - [`27a7a0c`](https://github.com/ubiquitarianism/leonida/commit/27a7a0c633174d6f213adab215a69ab338669f15) cf_diff: the scalar 'not equal' condition is s_cmp_lg, not s_cmp_ne ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tools/cf_diff.py` (+5 -1) </details> ### 📄 Description 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_*`.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:16:41 +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#67
No description provided.