rdna2spirv: form MUBUF byte offsets in 64 bits (SHADER-MUBUF-OFFSET-WRAP) #1068
Closed
leonida/mandy
Moriz82 wants to merge 0 commits from
split/shader-mubuf-offset-wrap into main
pull from: split/shader-mubuf-offset-wrap
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!1068
Loading…
Reference in a new issue
No description provided.
Delete branch "split/shader-mubuf-offset-wrap"
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 closed
This pull request cannot be reopened because the branch was deleted.
Claimed in the coordination issue as: SHADER-MUBUF-OFFSET-WRAP (claim).
Part of the split of #984 (first child). Depends on: none. Overlaps: none found (searched open and merged pull requests for
buffer_address, stride, index and offset wrap; #513 changes the CBV's V# stride in the runtime, not the translator's address arithmetic; #1021 editsdocs/design.mdnear the swizzled-buffer row).What and why
Gen.buffer_addressintools/rdna2spirv.pyforms the byte offset of every MUBUF/MTBUF access,off + soffset + index * stride(and the swizzled form), in 32 bits and adds it to the 48-bit V# base. The hardware does not wrap there: the RDNA2 ISA (8.1.5) gives the address as base + stride * index + offset with a 48-bit base, and onlyoff(vaddr + inst_offset) wraps at 32 bits. So an index of0xFFFFFFFFwith a 20-byte stride addresses base + 0x13_FFFF_FFEC on the console, while the translated shader turns it into base − 20:OOB_SELECT 3(raw) checksoffset + soffsetagainstNUM_RECORDSand does not look at the index;OOB_SELECT 2(disabled) checks only that the buffer is not empty.Both let the wrapped access through, so a store writes 20 bytes below the buffer and a load reads them. When the view is one slice of a larger pool that is mapped as a whole, that is a silent write into a neighbour's records.
The change forms the linear and the swizzled offset as a 64-bit value and adds that to the base. Nothing else changes: each mode checks exactly what it checked before, and a literal V# and a run-time V# take the same path.
What changed since the first version
The first version also treated every offset above
0xFFFFFFFFas out of range. The reviews showed two faults in that, and both are fixed by removing the bound instead of patching it:What this does not do
docs/d3d12_vulkan.md), so there an offset of 4 GiB or more always leaves the arena. Whether the runtime should refuse an address outside the arena is a separate decision, with the arena size as the bound and not 2^32. It is not part of this pull request.b9b57e2), credited in the source. It was not measured by us on AMD hardware; the contract row anddocs/buffer_bounds.mdsay so. Someone with thetools/hw_oraclesetup could pin it with one probe (raw view, stride 20, index −1).Cost: two or three 64-bit conversions and adds and one 64-bit multiply per access, now for every access including folded structured views (the first version left those alone). On a sample of 200 compute programs of a retail library (translated locally with
--wave64-emulate, not included) 114 modules change and the 200 grow by 0.45 % together; all 200 passspirv-valbefore and after.Tested
Linux (CachyOS, kernel 7.3.5), Python 3.14, LLVM
llvm-mc23.1.5 and SPIRV-Tools v2026.4 from the distribution. GPU suite on an NVIDIA GeForce RTX 4070, driver 620.73.04.python3 -I tests/semantic/test_buffer_offset_wrap.py: 8 tests pass. With the translator of the base commit the same file has 13 failing subtests: index −1 in raw and disabled mode with a literal and a run-time V# (4), the mapped 5 GiB offset in disabled mode (2), a structured index belowNUM_RECORDSwhose product passes 4 GiB in modes 0 and 1 (4), a swizzled offset past 4 GiB with a literal and a run-time V# (2), andoff 0xFFFFFFF0 + soffset 0x20(1). The swizzled control below 4 GiB passes on both. The swizzled cases were added after a review noted that the swizzled path had moved to 64 bits without a case above 4 GiB.python3 -I scripts/run_semantic_tests.py tests/semantic: 471 files, 6,176 tests, 0 files failed.tests/the wayci.ymlruns them: 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.python3 -I scripts/check_no_game_data.py: passes.python3 -I scripts/run_gpu_tests.py(run on the head before the swizzled tests were added; the translator has not changed since): 261 shaders translate and passspirv-val; 202 of 252 tests pass, 49 are skipped and 1 fails (cs_imgstore_cube). The run with the base commit's translator gives the same 202, 49 and 1, test for test. The harness programs came from an older native build on this machine (2026-11-23) and were not rebuilt for this, which is the likely reason for that one failure; it is not a result of this change.Not run by us: native Windows, macOS, an AMD GPU, the
tools/hw_oracleprobe. A reviewer ran the GPU suite on an AMD RX 9070 XT (236 of 252 pass, 16 skipped, 0 failed) one01626be9, which has the same translator as this head.GPUs tested: NVIDIA GeForce RTX 4070 (translation only; see above for what is not measured on hardware).
AI-assisted: yes (Claude Code). The numbers above come from runs on the machine named.
Checklist
32950551eand merges cleanly into currentmain.docs/design.md("Buffer bounds checking"), with how it was confirmed and what is not measured.🤖 Generated with Claude Code
Review of #1068 (SHADER-MUBUF-OFFSET-WRAP)
Head: ff94bdd72ec46c6009129c5c832c8767e180aeae (one commit on 32950551e). Claim: #14 comment 7139398473 by the author, 17:34 UTC, six minutes before the PR was opened; it matches the scope.
Environment: Windows 11, native Python 3 (
-I), LLVM llvm-mc (Windows build), no GPU used (the change has no GPU test, and no AMD GPU is available here).Commands and results
python -I tests/semantic/test_buffer_offset_wrap.py: 4 tests, OK.tests/semantic/test_*matching buffer / tbuffer / mubuf / bounds / oob / swizzle, 26 files) run one by one;test_buffer_formats_all.pyandtest_buffer_swizzle.pythroughscripts/run_semantic_tests.py tests/semantic -p <file> -j 1because they importsupport: all pass (about 300 tests). The full suite was not run.git restore --source=HEAD~1 --worktree -- tools/rdna2spirv.py(the pre-PR translator), new test: FAILED (failures=5), the same five subtests the description names (index -1 in raw, raw literal, disabled, disabled literal;off 0xFFFFFFF0 + soffset 0x20). Restored withgit checkout -- tools/rdna2spirv.py, tree clean.git merge-tree --write-tree origin/main rv/1068(origin/main 3aa975421): clean. No commit on main since the base touchestools/rdna2spirv.pyordocs/buffer_bounds.md.tools/rdna2spirv.py(16 of them): none editsGen.buffer_addressordocs/buffer_bounds.md. #1021 editsdocs/design.mdnear the swizzled-buffer row; a pairwisemerge-treeof #1021 and #1068 is clean.idxenaccess (about 448kidxenlines). About 955 also have a non-zerosoffset(a rough text match). 22 files with[in their names were skipped by the search, so these counts are slightly low. Mostidxenaccesses through a run-time V# get the new check, so most translated compute and graphics modules change (the 2 % size estimate in the description is plausible). I did not translate the corpus to compare SPIR-V.Findings
The skip for literal modes 0 and 1 is not exact (tools/rdna2spirv.py:4148, docs/design.md:501, comment at tools/rdna2spirv.py:4133-4134). The skip assumes that
idx < NUM_RECORDSboundsidx * strideto 32 bits. That holds only whenNUM_RECORDS * stride <= 2^32, and NUM_RECORDS is a run-time word even when word3 is literal. A probe (not part of the PR; F:\recomp\tmp\rv1068-probe.py, using the PR's own helpers): mode 1, stride 20, NUM_RECORDS 0xFFFFFFFF, index 0x0CCCCCCD, soidx * stride= 0x1_0000_0004:s_mov_b32literals: 77 is stored at base + 4 and read back.So the same descriptor gives different results depending on whether the translator folded word3. That needs a very large NUM_RECORDS (0xFFFFFFFF "unbounded" descriptors do occur), so it is a corner case, but the docs state the opposite. Either emit
fitsfor literal modes 0/1 too, skip it only when a literal word2 and stride proveNUM_RECORDS * stride <= 2^32, or say in the row and the comment that the folded path does not check it. A literal structured case belongs in the test as well:test_structured_modes_already_refuse_the_index(tests/semantic/test_buffer_offset_wrap.py:96) covers only the run-time V#, which always takes the new check.How the rule was confirmed (docs/design.md:501, docs/buffer_bounds.md:22-26). AGENTS.md:33-35 asks for a GPU test, a Mesa/LLVM reference, or a count over the corpus. The row cites another project's commit and says it was "not measured by us". It is honest, but it is none of the three. Part of the rule is already backed here: the RX 6800 and gfx1036 measurements in the same row show that
soffsetis added before the mode 3 check without truncation. The new parts are not backed: the full 64-bitindex * strideproduct, the "no effect" outcome in mode 2, and the swizzled offset in 64 bits. Also, "lands tens of GiB past the base and has no effect" is an inference. On hardware an address 80 GiB past the base is either a page fault or another mapping, not a guaranteed no-op. Dropping the access is a reasonable choice for a translator, but the docs and test name present it as hardware behaviour. Suggest saying "treated as out of range (the hardware address is far outside the buffer; what the console does there is not measured)", and asking someone withtools/hw_oraclefor the one probe the description proposes before merging, or recording it as a follow-up.AGENTS.md:21 asks for a hand-written
.asmfixture intests/semantic/. The test writes its assembly inline in Python (tests/semantic/test_buffer_offset_wrap.py:36-65). This is common in the suite (29.asmfixtures against 471 test files), so it is a nit.Minor cost: with a literal mode 3, linear addressing, no index and non-zero soffset,
fitsis emitted although the raw check (off + soffset + end <= NUM_RECORDS, 64-bit, at most 0xFFFFFFFF) already implies it (tools/rdna2spirv.py:4148). It is redundant, not wrong.What I checked and found correct: the 64-bit linear form
off + soffset + idx * stride(tools/rdna2spirv.py:4149-4163), whereoff(vaddr + inst_offset) still wraps at 32 bits, as the existing measured docstring says; the 64-bit swizzled form (4151-4157), which matches the 32-bit formula term by term and with L = 0 reduces toidx * stride + off;fitsis ANDed into every per-dword, typed and atomic check throughcheck_end(4256-4264), and it is computed before any branch, so it dominates its uses; and by reading the code, the folded literal-structured path without soffset emits the same SPIR-V as before (nothing new is emitted, and themodeline only moved).Verdict: the main change is correct for the case it targets (raw and disabled, run-time and literal), the test is real (5 failures without the change), and the PR merges cleanly with no overlapping open PR. Request changes on two points before merging: fix or document finding 1, and reword the "hardware observation / no effect" claim in finding 2, or measure it. Findings 3 and 4 are optional.
AI-assisted.
AI-assisted independent GPU verification (overnight shift, worker w4).
Environment: Windows, Git Bash; runtime built RelWithDebInfo (Ninja, VS2022 BuildTools, SDK 10.0.26100, Vulkan SDK 1.4.363.0).
llvm-mcvia WSL Ubuntu llvm-21; spirv-val on PATH.AMD Radeon iGPU (RDNA2 gfx1035, driver 24.10.24, Vulkan 1.3.280, 128B push constants):
VK_LOADER_DRIVERS_SELECT=*amd-vulkan* LEONIDA_VK_DEVICE=radeon VK_LOADER_LAYERS_DISABLE=~implicit~ LEONIDA_VK_VALIDATION=1 LEONIDA_PC_TAIL_UBO=1 py -3.14 -I scripts/run_gpu_tests.py --work <dir>ms_clip,ms_wave_info_s3: known AMD Windows LLPC 0xC0000005 mesh-shader crashes (SHADER-167; fixes in open PRs #802/#808, not in this base).ms_v5_workgroup: first run lacked spirv-val on PATH; re-run withVulkanSDK/1.4.363.0/Binon PATH → PASS (24/24 workgroup coordinates exact).NVIDIA RTX 4070 SUPER (driver 610.88):
VK_LOADER_DRIVERS_SELECT=*nv-vk* LEONIDA_VK_DEVICE=4070 VK_LOADER_LAYERS_DISABLE=~implicit~ py -3.14 -I scripts/run_gpu_tests.py --work <dir>Translator tests:
py -3.14 -I -m unittest discover -s tests/semantic -p test_buffer_offset_wrap.py→ 4/4 OK.py -3.14 -I scripts/run_semantic_tests.py tests/semantic→ 471 files, 6172 tests, 0 failed.Verdict: verified. The 32-bit buffer-offset wrap change breaks nothing on either GPU; the only AMD failures are the known mesh-shader driver crashes unrelated to this PR.
Thank you both for the reviews. You were right on the main point, so the branch is reworked instead of patched: the
fits <= 0xFFFFFFFFbound is gone. The byte offset is now a 64-bit value added to the 48-bit base, in every mode and for a literal and a run-time V# alike, and each mode checks exactly what it checked before. The title and the description are rewritten to match.@KernelSmoker
NumRecords1, stride 20, index0x10000000) is a test with a literal and a run-time V#: the store lands 5 GiB past the base and the load reads it back.NUM_RECORDS0xFFFFFFFF, stride 20, index0x0CCCCCCD) is a test for modes 0 and 1, literal and run-time: all four store and read at base +0x1_0000_0004.@kawaii-shakal
tools/hw_oracleprobe is still wanted and is not done.One consequence is the opposite of the first version, so I want it to be explicit. Index −1 in mode 2 or 3 is now neither base − 20 nor dropped: it is an access tens of GiB past the base. The runtime's arena is at most 4095 MiB, so that address is always outside it, and on Vulkan that is undefined. If the project wants such an access refused, I think the bound should be the arena size and it should live where the arena is known, as a follow-up. If you would rather have it in this pull request, say so.
Run on the new head (CachyOS, Python 3.14, llvm-mc 23.1.5, SPIRV-Tools v2026.4):
tests/semantic/test_buffer_offset_wrap.pypasses 6 tests, and 11 subtests fail with the base commit's translator and with the previous head's. Full semantic suite: 471 files, 6,174 tests, 0 files failed.scripts/run_gpu_tests.pyon an RTX 4070 (620.73.04): 202 of 252 pass, 49 skipped, 1 fails (cs_imgstore_cube), test for test the same as with the base commit's translator; the harness programs were an older local build, not rebuilt. Not run here: native Windows and AMD. Your runs on the previous head do not carry over, since every indexed access now changes its SPIR-V.🤖 Generated with Claude Code
AMD run (the gap the description lists): RX 9070 XT (RDNA4, GFX1201), AMD proprietary Windows driver 26.11.2 (LLPC, Vulkan 1.4.359), Windows 11, MSVC 2022 RelWithDebInfo.
Head
e01626be9:scripts/run_gpu_tests.pywith this translator: 261 of 261 shaders translated andspirv-val-clean, 236 of 252 pass, 16 skipped, 0 failed (native, subgroup 64).tests/semantic/test_buffer_offset_wrap.py(6): OK.CPU check of
e01626be9merged onto main3aa97542(CachyOS, Python 3.14).test_buffer_offset_wrap.py: 6 pass; 11 failures with main'srdna2spirv.py.run_semantic_tests.py tests/semantic: 471 files / 6,174 tests, 0 failed.mem_diff.py(2,000 programs, seed 661001) is clean on both, so it doesn't reach this case.One gap: the new tests only use the linear path. The swizzled path also moved to 64 bits and has no case above 4 GiB.
Not tested here: GPU, game corpus, what hardware does at such an address. AI-assisted (Claude Code)
@thesubtleties thank you, that gap was real: the swizzled path moved to 64 bits and had no case above 4 GiB. Added to
tests/semantic/test_buffer_offset_wrap.py, with a literal and a run-time V# each:IS8, stride 20, index0x0CCCCCD5(group0x0199999A, element 5): the store and the load are at base +0x1_0000_0054; modulo 2^32 that would be base +0x54;The file now has 8 tests. With the base commit's translator 13 subtests fail (the two swizzled cases above 4 GiB are new among them; the control passes on both). Full semantic suite on the new head: 471 files, 6,176 tests, 0 files failed. The translator itself is unchanged since
e01626be9; only the test and the count in thedocs/design.mdrow changed.@iFeyz thank you for the RX 9070 XT run; the description now cites it.
🤖 Generated with Claude Code
@KernelSmoker I rebased this onto main at
bfef489cand reran the full semantic suite ona656d4f0. All 6,287 tests passed across 488 files. The eight focused cases cover mapped offsets above 4 GiB in mode 2, structured modes 0 and 1, and swizzled addressing, with both literal and runtime descriptors. Could you re-review the current head? The console behavior for an unmapped address remains unmeasured.AI-assisted.
Approving. Merged into current main (9f9a7c5) with no conflicts.
test_buffer_offset_wrap.pypasses, and the full translator suite gives 491 files / 6,300 tests with onlytest_int32_to_f64failing, the same baseline failure as main here (Linux, Python 3.13).I checked that no 32-bit offset survives in the address path. Both the linear and the swizzled forms now build
wideas a%ulong. That covers index·stride as a full 64-bit product, soffset added in 64 bits, and the swizzledmsb·stride + om4shifted in 64 bits. The finalbase + widetakes it directly. Onlyvaddr + inst_offsetstill wraps at 32 bits, as the comment says, and the bound checks are untouched.AI-assisted (Claude).