mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:15:52 +01:00
[PR #184] [CLOSED] rdna2spirv: an out-of-range s_buffer_load reads through the buffer's base (llvmpipe segfault) #237
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#237
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/184
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:old-pr/9916📝 Commits (6)
6c91f85rdna2spirv: an out-of-range s_buffer_load is loaded with no branch, from the V# base (llvmpipe segfault)f5caa21scalar_load: out of range, the branchless s_buffer_load reads the heap base, not the V# based47a4a5Merge remote-tracking branch 'origin/main' into HEAD4affd83Merge remote-tracking branch 'origin/main' into HEADe168cbbMerge remote-tracking branch 'origin/main' into HEAD98cefe9Merge remote-tracking branch 'origin/main' into HEAD📊 Changes
8 files changed (+313 additions, -28 deletions)
View changed files
📝
docs/design.md(+1 -0)📝
runtime/test/shaders/check.py(+3 -1)➕
runtime/test/shaders/cs_smem_oob_far.asm(+73 -0)📝
scripts/run_gpu_tests.py(+4 -2)➕
tests/semantic/fixtures/disasm/cs_smem_oob_far.s(+55 -0)📝
tests/semantic/test_scalar_mem_smem.py(+15 -1)➕
tests/semantic/test_smem_oob_safe_address.py(+144 -0)📝
tools/rdna2spirv.py(+18 -24)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Problem. An out-of-range
s_buffer_loadsegfaults llvmpipe, the CI's GPU. The translated code is correct: ans_buffer_loadwhose bound is only known at run time guards each dword with anOpSelectionMergeonoff + 4·i + 4 <= NUM_RECORDS · strideand gives 0 outside it. llvmpipe (Mesa 26.0.8, LLVM 21.1.8) executes the guarded load anyway.Found on
#3039. Running its fixturecs_w32_late_exton llvmpipe locally,vk_compute_testcrashes with SIGSEGV (exit 139). Every 32-wide GPU passed it, because their stray read returns garbage that is thrown away. Word 6 iss12 = -4, offset:20: 0xFFFFFFFC + 20 =0x100000010bytes, pastNUM_RECORDS = 0xFFFFFFFF, so it must read 0 (#1948). The guarded load at that address is 4 GB past the buffer.Re-submission of
#4573.#4573was closed unmerged during the 2026-11-23 22:45 UTC cleanup, along with the other open PRs. This is the same branch, now merged with currentmain.Checked on
#4573by: SweatierKey (Linux), kapitche (WSL2 Ubuntu), TreXito (Linux 6.18), cxchhh (Tesla V100-SXM2-32GB), Ayinaki (RTX 5070), tunczzz (RTX 5070 Ti), searyecheesepeaceful (610M), KkelebekK (780M), MatyEjsr (NVIDIA GeForce RTX 3090), lunarminus (760M), sovljanskii (Apple M4), Mortify7612 (AMD Radeon RX 9060 XT) and 3 more.No game files.
AI-assisted (Claude Code): I reviewed the change and re-ran its tests on the merge with
main.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.