Skip to content

tests/semantic: restore test_loop_ballot_barrier after structured wave64 emulation - #3953

Closed
ray3242 wants to merge 1 commit into
ItsNotRexed:mainfrom
ray3242:devin/1795386752-loop-ballot-barrier-tests
Closed

ray3242 wants to merge 1 commit into
ItsNotRexed:mainfrom
ray3242:devin/1795386752-loop-ballot-barrier-tests

Conversation

@ray3242

@ray3242 ray3242 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: #3918 (comment) (finding #3796 (comment))

What and why

tests/semantic/test_loop_ballot_barrier.py fails on main (3 failures, 2 errors) since #2089 merged:

This PR changes only the tests (nothing under tools/):

  • The interpreter now runs OpFunctionCall / OpFunctionParameter / OpReturn / OpReturnValue. Each call gets its own SSA and Function-storage frame, pointer arguments work, and barrier and subgroup sync points take the call stack into account.
  • The divergent-loop test now asserts structured emulation, and it adds three subtests with STRUCTURED=False so the barrier-rounds path stays covered. All of them check against the same numeric oracles as before.
  • The new test_loop_ballot_barrier_interpreter.py covers the new interpreter paths: nested calls, local variable initialization, pointer arguments, return values, barriers inside a helper, and calls with the wrong argument count.

Tested

CPU only, no GPU (the suite uses an interpreter).

  • python -m unittest discover -s tests/semantic -p 'test_loop_ballot_barrier.py' -v: OK (15 tests). On main: failures=3, errors=2.
  • Run against tools from just before Translator: structured --wave64-emulate and acyclic single-write execz folding (#884) #2089, the unchanged suite passes, which confirms the failures come from that merge.
  • Full tests/semantic: main has 23 failures and 2 errors; this branch has 20 failures and 0 errors, with the same 20 tracebacks as main (they come from the local SPIR-V tools). No new failures.
  • Mutation check: if the helper call sites are replaced with an unsupported op, all 5 structured-emulation subtests fail, so the call path really runs.
  • python -m compileall -q tests and git diff --check are clean.

AI-assisted (Devin).

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. (N/A: tests only, no new rule.)

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@Vonsek

Vonsek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 62f43b7 on Windows 11 (Ryzen 9 9950X3D; CPU only, no GPU used), Python 3.12.10: python -m unittest discover -s tests/semantic -p "test_loop_ballot_barrier*.py" (both the restored suite and the new interpreter suite) — pass, 21/21 OK.

AI-assisted.

@whattheflop

whattheflop commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Independent Windows integration at exact #3953 head 62f43b7c on main aa2988cc. uv-managed CPython 3.12.13, CPU only.

Full semantic discovery on the three-PR tree 2d29d36e is complete. Main ran 7,456 tests with seven subtest failures and two subtest errors. The integration ran 7,462 tests with zero unexpected failures or errors and 55,614 passing subtests. Both runs had the same one skip and one expected failure under the same environment.

One coverage observation: all 21 ballot/helper tests still pass if subgroup synchronization drops the caller from its site key. An extra two-lane CPU probe reaches the same helper through two different call sites. The current interpreter correctly rejects that divergence, and the probe catches the mutation. This is a self-test coverage gap, with no observed correctness defect in the unchanged #3953 code.

Synthetic inputs only. AI-assisted (Codex).

@ray3242

ray3242 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Closing in favour of #3995: Vonsek claimed EGEN-LOOP-BALLOT-RED in #3796 20 s before my claim in #3918, and both PRs restore the same five cases. Two things #3953 had that #3995 could take if useful:

@Vonsek, I'm happy to send either as a follow-up on top of #3995 if you want it. Thanks to Vonsek and whattheflop for testing. AI-assisted.

@controldebils

Copy link
Copy Markdown

Tested 62f43b7 (contains main aa2988c) on Windows 11, CPython 3.12, CPU only: pass.

  • python -m unittest discover -s tests/semantic -p 'test_loop_ballot_barrier*.py': 21 tests OK (both files).
  • Negative control: test_loop_ballot_barrier.py with main's tools/ and tests/: FAILED (failures=3, errors=2), the same 3 + 2 the PR describes.

AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants