Repository navigation
lane_masks: track v_and_or_b32, v_xnor_b32, and v_bfi_b32 in VECTOR_BITWISE - #4367
Open
kotekompotek wants to merge 1 commit into
Open
kotekompotek wants to merge 1 commit into
kotekompotek wants to merge 1 commit into
Conversation
…ITWISE Add v_and_or_b32, v_xnor_b32, and v_bfi_b32 to VECTOR_BITWISE in tools/lane_masks.py so per-lane wave masks computed through them under partial EXEC receive all-lanes stores and keep mask status through v_readfirstlane_b32, while non-mask data inputs stay EXEC-gated. Update the Whole-wave masks row in docs/design.md and add unit + semantic interpreter checks in tests/test_lane_masks.py and tests/semantic/test_lane_masks_vector_bitwise.py. Verification (Windows 10 Pro x64, Python 3.12.6, CPU-only; no llvm-mc/spirv-val/WinSDK 10.0.26100): - tests/test_lane_masks.py: ok - tests/semantic/test_lane_masks_vector_bitwise.py: 4 tests OK (Wave32, Wave64 native, Wave64 emulated structural, data control) - docs/line-endings/hygiene/startup checks and 83 pytest checks (3 skipped): OK
Contributor
|
Tested
No game data. AI-assisted (Gemini, Antigravity). |
|
Tested 3637cd8 on Arch Linux (in a VM), CPython 3.14: pass.
|
|
Tested
No GPU, no game data. AI-assisted. |
Kam471
reviewed
Nov 23, 2026
Kam471
left a comment
Contributor
There was a problem hiding this comment.
Ran this at 3637cd86 on Windows 11: tests/test_lane_masks.py -> ok; tests/semantic/test_lane_masks_vector_bitwise.py -> 4 tests, OK; git diff --check clean.
lane_masks now tracks v_and_or_b32, v_xnor_b32 and v_bfi_b32 as vector bitwise mask producers, and the new cases plus the existing mask tests pass. No blocking issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: #4257 (comment)
What and why
AI-assisted contribution (CPU-verified locally on Windows 10 Pro / Python 3.12.6; synthetic shaders only, no game data).
Adds
"v_and_or_b32","v_xnor_b32", and"v_bfi_b32"toVECTOR_BITWISEintools/lane_masks.py. All three instructions compute per-lane 32-bit bitwise combinations (andrdna2spirv.pyalready models all three without operand modifiers changing mask bit meaning). Because they were absent fromVECTOR_BITWISE, building a per-lane wave mask with them leftwrite_all_lanes = False(leaving inactive lanes holding stale values) and broke downstreamv_readfirstlane_b32whole-wave mask reconstruction.Checked open PRs and
#2885(now merged onmain) plus#3225: this change only adds these three opcodes toVECTOR_BITWISEplus dedicated unit/semantic tests anddocs/design.md, and is rebased cleanly onmain.Tested
CPU-only (Windows 10 Pro x64, Python 3.12.6; no
llvm-mc,spirv-as/spirv-val, Windows SDK10.0.26100, or GPU runtime build available locally):tests/test_lane_masks.pyfailed (AssertionErroronv_and_or_b32), andtests/semantic/test_lane_masks_vector_bitwise.pyfailed on 3 of 4 tests (Wave32:32 != 18,Wave64Native:64 != 34,Wave64Emulated:0 != 6; non-mask EXEC control passed).3637cd86on03b09a08):python -I tests/test_lane_masks.py->okpython -I tests/semantic/test_lane_masks_vector_bitwise.py -v->Ran 4 tests in 1.437s OK(Wave32 & Wave64 native execution viaspirv_mini_interp.py,--wave64-emulateSPIR-V structural check, non-mask EXEC control)python -m pytest tests/test_wave64_halves_fixtures.py tests/test_salu_diff.py tests/test_crosslane_fuzz.py -q->85 passed, 3 skipped in 26.41s(llvm-mc/spirv-valskips)tests/test_docs_design_rows.py(2 OK),test_docs_repo_paths.py(2 OK),test_docs_links.py(6 OK),test_docs_list_items.py(2 OK),test_text_write_line_endings.py(3 OK),test_resource_hygiene.py(2 OK),compileall,git diff --check-> all passed.Checklist
docs/design.md, with how it was confirmed.