Repository navigation
Conversation
|
Independent Vulkan check of One issue in I verified that replacement locally. Both modules validated, and 128 contended workgroups produced the expected final max and 6,144 old-value returns consistent with a valid atomic order. The mini-interpreter on this base needs to recognize |
|
Tested on Linux (WSL2 Ubuntu), Python 3.10.12, CPU only: pass. With upstream/main merged (clean), tests/semantic/test_buffer_atomic_fminmax_and_align.py runs 10 tests, OK. Negative control: restoring tools/rdna2spirv.py to upstream/main makes the tests fail (25 failures, 64 errors). Hardware measurements in the new design.md row are not reproducible here. Trial merge with #2722 conflicts in docs/design.md only: both add a row at the same spot in the contract table, keep both; rdna2spirv.py merges cleanly, and #2711 and #2715 merge cleanly. |
|
Additional check on The semantic sweep and the negative-control counts above are confirmed here:
On the data-race point raised above, confirmed from the emitted SPIR-V. A one-lane The seed read What this machine cannot confirm: the gfx1036 measurements themselves (native RDNA2, not reproducible on Ada), and the translated hardware path — this PR adds no GPU fixture for Verdict: LGTM for the semantic logic; the non-atomic seed load is the one thing to fix before merge. AI-assisted review. |
|
Tested Native hardware, independent of the PR's own probes. AMD Radeon(TM) Graphics, the RDNA2 iGPU of a Ryzen 9 9950X3D (
The aligned control cases did modify memory as expected, so the dropped cases aren't an artefact of the harness. Correction: the subnormal flush follows the wave's
So with denormals enabled the result is exact Vulkan regression run (
No failures on either side. Tools: MSVC (VS 2022 Build Tools), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0 (SPIRV-Tools v2026.4), CPU: I didn't re-check the non-atomic seed |
|
Tested Your own checks, reproduced. Both match your counts. Note GPU check, hand-written and not pushed. Two synthetic compute shaders using the That is Before/after on the same GPU, which is where this gets interesting. On On
Unverified and left open: AI-assisted (Capy, DeepSeek V4.1 Flash). Synthetic shaders only, no game data, nothing pushed. |
|
Corpus run of
AI-assisted (Claude Code). Counts only; nothing from the game files is included. |
|
Thank you everyone for the thorough reviews and independent GPU/corpus runs — @duudiis, @ricarmandoagent, @TheMrBeez, and @whoalin1! Addressed both reviewer findings in
Re-verified locally:
(AI-assisted.) |
bd935b5 to
9043bb9
Compare
…denorm32 subnormal behavior
9043bb9 to
2d2a405
Compare
|
Tested 2d2a405 (a re-test at the new head) on AMD Radeon RX 9070 XT (RADV GFX1201, wave32/64) and the Ryzen 7 9800X3D iGPU (RADV RAPHAEL_MENDOCINO, gfx1036), Mesa 26.2.6, Linux 7.3.4: pass, no regressions.
No game files. AI-assisted. |
Claimed in #2516 (#2516 (comment)).
Summary
gfx1036, wave32 & wave64):Gen.atomic_aligned(addr, align_bytes)(OpUConvert %uint+OpBitwiseAnd+OpIEqual ... 0) and guarded all six atomic emitters (global_atomic,global_atomic_float,global_atomic_x2,buffer_atomic,buffer_atomic_float,buffer_atomic_x2) on(addr & 3) == 0(32-bit) or(addr & 7) == 0(64-bit_x2).OpPhi ... 0written viaGen.dst(...), fixingglobal_atomic*so active unaligned lanes receive0/(0, 0)while inactive lanes (EXEC = 0) preservevdst— matching realgfx1036hardware.buffer_atomic*_x2(answering the prior "not measured" note inGen.buffer_atomic_x2):gfx1036across all fourOOB_SELECTmodes (wave32 and wave64), confirming thatfixed_fmt=62(all-or-nothing 8-byte bounds) matches hardware exactly.buffer_atomic_fminandbuffer_atomic_fmax(+2 RDNA2 ISA coverage):OpAtomicCompareExchange+GLSL.std.450NMin/NMaxCAS loop intoGen._emit_atomic_fminmax_cas(noSPV_EXT_shader_atomic_float_min_maxcapability required) and addedGen.buffer_atomic_float, enforcing V# bounds, 4-byte natural alignment, andglcreturn (ldsand non-1-VGPRvdataraiseUnsupported).docs/design.mddocumenting the measurements and the measured L2 atomic-unit approximation (sNaNquieting and f32 subnormal flushing to+0, not modelled byNMin/NMax).Native RDNA2 (
gfx1036) hardware measurementsMeasured via
tools/hw_oracle/in both wave32 and wave64 on AMD Radeon(TM) Graphics (gfx1036), Windows driver32.0.21042.62(wave32 and wave64 agreed on every probe):buffer_atomic*,buffer_atomic*_x2,buffer_atomic_fmin/fmax,buffer_atomic_cmpswap,global_atomic*,global_atomic*_x2,global_atomic_fmin):(addr & 3) == 0:offset=1,offset=2,base+2 offset=0are dropped;base+2 offset=2succeeds._x2atomics require(addr & 7) == 0:offset=2,offset=4,base+4 offset=0,stride=16 off=4,stride=12 off=4are dropped even underOOB_SELECT = 2(DISABLED);base+4 offset=4succeeds.0/(0, 0)tovdst/vdataon activeglclanes, and preservevdst/vdataon inactive lanes (EXEC = 0).buffer_atomic_{swap,and,or,xor}_x2):OOB_SELECT = 3(RAW):0/8and8/16succeed;0/7,0/5,0/4,8/15,8/12drop all-or-nothing.OOB_SELECT = 0(STRUCTURED_WITH_OFFSET):stride=8 off=0,stride=16 off=8,stride=12 off=0succeed;stride=7 off=0,stride=12 off=8,stride=8 idx=1drop.OOB_SELECT = 1(STRUCTURED):idx < num_records(0/4,0/8,8/8succeed).OOB_SELECT = 2(DISABLED):num_records != 0(8/8succeeds;num_records == 0drops).buffer_atomic_fmin/buffer_atomic_fmax:±inf,-0vs+0(fmin(-0, +0) = -0,fmax(-0, +0) = +0), andqNaN(returns non-NaN operand) matchNMin/NMax.sNaN(0x7f800001 -> 0x7fc00001) and flushes f32 subnormals (0x00000001,0x00000002) to+0(documented as a known approximation indocs/design.md).Notes on sibling PRs
buffer_atomic_{inc,dec}) and tests(semantic): add interpreter tests for global_atomic_fmin and global_atomic_fmax #2548 (global_atomic_{fmin,fmax}tests) touch adjacent lines inGen.buffer_atomicandtests/semantic/test_global_atomics.pyrespectively. Tests here live in a standalone file (tests/semantic/test_buffer_atomic_fminmax_and_align.py) and thedocs/design.mdrow is appended as a unique-topic row at the bottom of the contract table to minimize merge conflicts.Verification
gfx1036), Windows driver32.0.21042.62(native RDNA2 ISA probes viatools/hw_oracle/, wave32 & wave64). Localspirv-val/ Vulkan SDK was not installed in this environment; SPIR-V structure, dominance,OpSelectionMerge/OpLoopMerge/OpPhiinvariants, and execution were verified viaspirv_mini_interpand full semantic test runs.python -I tests/semantic/test_buffer_atomic_fminmax_and_align.py -v— 10/10 passedpython -m unittest discover -s tests/semantic— 2,577 ran, OK (3 skipped, 0 failures)python -I tools/mem_diff.py --programs 200 --family buffer_atomic --seed 42— 200/200 pass, 0 mismatchpython -m compileall -q make_game.py tools tests— OKpython -I tests/semantic/regen_fixtures.py --check— OKpython -I tests/test_docs_links.py,test_docs_list_items.py,test_docs_repo_paths.py,test_tool_startup.py,test_tool_stdout_encoding.py,test_text_write_line_endings.py,test_shader_checks.py(60/60),test_shader_meta.py(15/15),test_isa_coverage.py(10/10, 3 skipped) — all OK