In Gen.buffer_address (tools/rdna2spirv.py), emit
`OpShiftRightLogical %ulong wide %c64_32` followed by
`OpIEqual %bool hi_w %cl0` instead of
`OpULessThanEqual %bool wide %clffffffff`.
NVIDIA 580.82.07 NVVM aborts pipeline creation (`NVVM compilation failed: 3`,
VkResult -13) on the unsigned 64-bit compare when a literal V# folds `wide`
to `0 + idx * stride` (reported and A/B-tested on L4 by @kevincommits in
ubiquitarianism/leonida#1608#issuecomment-7208330785). Over uint64,
`(wide >> 32) == 0` is mathematically identical to `wide <= 0xFFFFFFFF`.
Since lower_addr64 (SHADER-423), the 64-bit compare still reaches the driver
with --int64-addresses, and by default in any module the lowering leaves in
its Int64 form (a 64-bit scalar op such as s_lshl_b64 elsewhere in the
shader). Where the lowering does apply, the new form lowers to a high-word
`== 0` test, without the pair compare's redundant low-word
`<= 0xFFFFFFFF` term.
tests/semantic/test_buffer_offset_wrap.py runs every access (including the
exact 32-bit boundary cases: `0xFFFFFFFC` dword, `0xFFFFFFFF` byte vs
`0x1_0000_0000`) three ways: lowered (default), --int64-addresses, and
default with Int64 kept. It checks that no compare with the 32-bit limit is
emitted in any of them (raw and after spirv_opt.optimize), that the Int64
forms test `(wide >> 32) == 0`, and that the modules pass spirv-val when it
is on PATH.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/rdna2spirv.py: main's d16 "destination is also read" check (now
DST_ALSO_READ, plus buffer_load_format_d16_hi_x) gains the PR's flat_load_
prefix. docs/design.md: main's 8/16-bit global row is kept and the PR's
"Flat memory" row follows it.
Co-authored-by: tiagonogueiraa-bit <360313680+tiagonogueiraa-bit@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in the x_memory_order docstring (tools/rdna2spirv.py): main already
ignores ds_nop (80417b9c4), so the PR's part still new is ordering
image_sample, image_gather4 and image_bvh; its docstring is kept. The PR's
parity test probe gains x_one_lane, which main's Gen.x_memory_order reads.
Co-authored-by: totonii <totonicontato@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apply published_mode(out_file) to temporary listing before atomic replacement,
and restore write permission (0o600) before unlinking in finally block
when replace fails, preventing Windows PermissionError [WinError 5] and
stranded temporary files.
agent: yes
AI-assisted: yes
Apply published_mode(asm/spv) to temporary files before atomic replacement,
and restore write permission (0o600) before directory cleanup in exception block
when replace fails, preventing Windows PermissionError [WinError 5] and
stranded temporary files.
agent: yes
AI-assisted: yes
Apply published_mode(spv) to temporary staged SPV before atomic replacement,
and restore write permission (0o600) before directory cleanup in exception block
when replace fails, preventing Windows PermissionError [WinError 5] and
stranded temporary files.
agent: yes
AI-assisted: yes
Apply published_mode(out) to staged manifest file before atomic replacement,
and restore write permission (0o600) before TemporaryDirectory cleanup in
exception block when replace fails, preventing Windows PermissionError [WinError 5]
and stranded temporary files.
agent: yes
AI-assisted: yes
Apply published_mode(path) to temporary cache file before atomic replacement,
and restore write permission (0o600) before unlink in exception block when
replace fails, preventing Windows PermissionError [WinError 5] and stranded
temporary cache files.
agent: yes
AI-assisted: yes
Round 9b translator fixes for rendering correctness and Mandy d3d12/ parity:
1. Unconditional CS & MS LDS OOB bounds (Mandy 21633b328 parity):
- Record g.lds_declared from PSV0.shared for MS and RSRC2.LDS_SIZE for CS.
- Whenever g.lds_declared > 0 (opt-out --no-lds-bounds), set
g.lds_dwords = g.lds_bound = min(g.lds_declared, 16384) so every LDS
read, write, sub-dword, wide, and atomic op goes through lds_access()
(OOB reads return 0, OOB writes/atomics dropped instead of wrapping).
2. PS DB_SHADER_CONTROL bit 12 EarlyFragmentTests (Mandy f33940415/bf479a3cd):
- Add fssm_header.db_shader_control() reading u32 at E + 0x138 (0x24C for
rec = 0xB0; 3,023/12,101 corpus PS have bit 12 DEPTH_BEFORE_SHADER set).
- Emit OpExecutionMode %main EarlyFragmentTests (opt-out --no-early-depth)
and record early_depth in shader_meta when bit 12 is set and the PS does
not export depth/stencil (no exp mrtz, DB_SHADER_CONTROL & 0x7 == 0, no
OSG1 SV_Depth*/SV_StencilRef).
3. Defensive mesh epilogue & PS helper-lane quad swizzle:
- MeshEXT and --mesh-compute epilogues explicitly write CullPrimitiveEXT =
true (1) and (0, 0, 0) when %mli < %msp and !%ms_has_prim.
- Lower quad-local ds_swizzle_b32 in PS via OpGroupNonUniformQuadBroadcast /
OpGroupNonUniformQuadSwap (GroupNonUniformQuad capability) so Vulkan 2x2
helper invocations participate on AMD RADV while EXEC-masked lanes still
read 0.
Verified: compileall, check_no_game_data.py, 6,674/6,674 semantic tests (0
failures), 200/200 corpus slice (200/200 spirv-val), plus targeted LDS MS
(5/5), LDS CS (60/60), early-depth PS (120/120), and PS quad-swizzle (50/50)
corpus slices (100% spirv-val). AI-assisted.