mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:30:53 +01:00
[PR #1275] [CLOSED] tests: run raw buffer atomics addressed by soffset alone (TEST-ATOMIC-SOFFSET-BOUNDS) #1306
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1306
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1275
Author: @Moriz82
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:split/test-atomic-soffset-bounds📝 Commits (1)
c53551dtests: run raw buffer atomics addressed by soffset alone (TEST-ATOMIC-SOFFSET-BOUNDS)📊 Changes
1 file changed (+29 additions, -12 deletions)
View changed files
📝
tests/semantic/test_buffer_atomic_fminmax_and_align.py(+29 -12)📄 Description
Claimed in the coordination issue as: TEST-ATOMIC-SOFFSET-BOUNDS (claim).
Part of the split of #984 into small pull requests.
Depends on: none
Overlaps: #984 is the parent integration. #1097 (open, SHADER-BUFFER-BOUNDS) is the runtime half of the integrated commit this test comes from; it has no translator test and this pull request has nothing of the runtime. #850 (open) edits another test of the same file,
test_spirv_emits_alignment_guard; its current diff applies cleanly on this branch. #1068 (open) testssoffsetfor loads and stores, not for atomics. None of the current diffs of #850, #1039 and #1068 adds a buffer atomic with a non-zerosoffset.What and why
Test only; the translator is not changed.
No test runs a buffer atomic with a non-zero scalar offset. The tests and the GPU fixtures hold 57
buffer_atomic_*instructions as text, and all 57 pass0assoffset. The address and bounds code is shared with loads and stores, which do testsoffset, but each of the three atomic lowerings (32-bit integer, float min/max, 64-bit_x2) hands its operands to that code at its own call site. Dropping the operand at any of the three went unnoticed by the whole translator suite (see the mutation below).test_raw_atomic_soffset_onlyaddresses a raw V# throughsoffsetalone, with novaddrand no instruction offset, once per lowering (buffer_atomic_add,buffer_atomic_fmax,buffer_atomic_swap_x2). For each it checks both sides of the raw bound ofdocs/buffer_bounds.md,offset + soffset + size > NUM_RECORDS: withNUM_RECORDS = soffset + sizethe element is updated andglcreturns the old value, and one byte short it is left alone andglcreturns 0. The words in front of the element must keep their sentinel, so an atomic that lands at the V# base instead fails as well.The expected values follow the rule the repository already documents for raw accesses. Nothing new was measured on hardware for this.
Tested
CachyOS (kernel 7.3.5), Python 3.14, SPIRV-Tools v2026.4.
python3 -I tests/semantic/test_buffer_atomic_fminmax_and_align.py: 11 tests pass (10 before, plus the new one with its 6 subtests). It passes on the base commit's translator too, as a pure test addition must.soffsetdropped at the three atomic call sites ofGen.buffer_address(areplaced bya[:3]),python3 -I scripts/run_semantic_tests.py tests/semantic -j 2ran 470 files and 6,169 tests and exactly one file failed, this one, in the 6 subtests of the new test. Its other 10 tests and the other 469 files passed, so without this test the mutation passes the whole translator suite. The mutation was applied to the working tree for that run only and is not in the branch.python3 -I scripts/run_semantic_tests.py tests/semantic -j 2on the branch as committed: 470 files, 6,169 tests, 0 files failed (the base: 470 files, 6,168 tests, 0 failed).tests/the wayci.ymlruns them, andpython3 -I -m compileall -q make_game.py tools tests: 520 files, 519 pass.tests/test_imhex_patterns.pyfails (6 of its 9 tests) and fails the same way on the base commit, so it is not from this change.compileallpasses.python3 -I scripts/check_no_game_data.py: passes.spirv-asandspirv-val --target-env vulkan1.2(SPIRV-Tools v2026.4) on the three in-range modules of the test, written out by hand: all three validate.Not run: any GPU test (there is no GPU fixture for an atomic with a
soffset, and this adds none), thetools/hw_oracleprobe, native Windows, macOS, the runtime build and a game boot.GPUs tested: n/a (CPU interpreter only).
AI-assisted: yes (Claude Code). The numbers above come from runs on the machine named.
Checklist
6293c1c4f, one commit, one file.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.