TEST-FCMPSWAP-NAN-POSTSTATE: check memory after the buffer NaN atomic #515
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!515
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/515/head"
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?
@csmith105 on GitHub · 2026-11-24 06:44 UTC · original
csmith105:codex/fcmpswap-nan-poststate→main· +30 −7 · 3 files · 1 commits · merged 2026-11-24 07:39 UTCClaimed as TEST-FCMPSWAP-NAN-POSTSTATE.
What and why
The buffer NaN case in
cs_w32_fcmpswapstores only the atomic's returned old value. Both correct floating-point comparison and an incorrect integer comparison return the same old NaN, so the existing oracle accepts an erroneous store of 1.0.Read memory at byte 0x48 after the atomic and expose it in output slot 7. The eight expected words stay unchanged. A targeted negative control substitutes integer comparison for only this NaN atomic and proves that the fixture now rejects the wrong update. Signed-zero cases retain GPU return-value coverage, and
test_float_cmpswap.pyretains old-value and memory checks for NaNs.This addresses the coverage gap identified in docs-only #413. It does not change that PR's documentation row or depend on it. No translator or runtime changes.
Tested
On the RTX 3080, all four synthetic variants translate and pass
spirv-val:These native runs used normal Vulkan validation, SPIRV-Tools 2026.4 and Khronos validation layers 1.4.357.0. GPU-assisted validation was also attempted on the original fixture, but reported an unrelated LDS atomic/read pair at byte 0xC0. Both accesses are guarded to lane zero; this is consistent with GPUAV's documented mixed atomic/non-atomic limitation. The failed receipt is retained; a GPUAV pass is not claimed.
a960c06fdplus this patch: 465 files, 6,106 tests, zero failed files (403 seconds, eight jobs). Rebased cleanly ontoc023a365aand repeated the focused fixture tests; the intervening main changes affect only runtime C++ files.git diff --checkpass.GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 610.88, Windows 11 build 26300; wave32/subgroup 32. Hand-written synthetic inputs only.
AI-assisted: yes (Codex).
Checklist
mainand merges cleanly.@pwu2775-dev on GitHub · 2026-11-24 07:37 UTC · original · reviewed
Code read of
a672a598against main: no issues.The fixture, its generated disassembly (
cs_w32_fcmpswap.s) and the Python expectations agree: the NaN case now reads memory at byte 0x48 afterbuffer_atomic_fcmpswap, soout[7]is the stored word (unchanged NaN0x7FC00000) instead of the returned old value, which is NaN whether or not the comparison matched. The new negative control swaps in the integercmpswapand checks that it storesONEand changes only the last word, so the old fixture's blind spot is actually covered.AI-assisted: review by Codex (gpt-6.1-terra); the conclusions were checked against the tests I ran, listed in my test comment.
@pwu2775-dev on GitHub · 2026-11-24 07:37 UTC · original
Tested
a672a598on NVIDIA GeForce RTX 4070, driver 617.42, Windows 11 10.0.26300, MSVC (VS 2022), Vulkan SDK 1.4.363.0, Ninja RelWithDebInfo: pass.tests/semantic/test_fcmpswap_fixture.py: 5/5 (including the new negative control).run_gpu_tests.py --filter fcmpswap:cs_w32_fcmpswap1/1, words0 1065353216 2143289344 1065353216 2147483648 1077936128 1065353216 2143289344(out[7] =0x7FC00000, memory after the NaN case).ctest: 302/303 passed; the one failure isd3d12_execute_indirect_validation, which is the red-on-main case in #504 and fails the same way on all three PRs. I did not rerun it onmainitself.run_gpu_tests.py: 197/248 passed, 49 skipped; withLEONIDA_W64_EMULATE=1: 229/248 passed, 17 skipped, the same totals as my unmodified-mainrecord in #534.Code read: no issues; details in my review: #515
AI-assisted: review by Codex (gpt-6.1-terra).
@QemmHD on GitHub · 2026-11-24 07:39 UTC · original
Merging. Why merged: the fcmpswap fixture now checks memory after the NaN atomic instead of the returned value, which can't tell a match from a miss; a negative control proves it catches an integer compare.
Why it's good: security-reviewed; on main
d42773dthe new test fails and passes with this PR (5/5); the GPU fixture passes on an RTX 4070 SUPER.AI-assisted (Claude Code, Claude Opus 5.5).