vk_compute_test: VKC_HEAP_FILE refuses an offset of 2^32 and a file past the 4 GiB heap (RT-439) (OLD-9943) #670
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!670
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/670/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?
@LouisRiverstone on GitHub · 2026-11-24 11:19 UTC · original
LouisRiverstone:carry-old-9943→main· +21 −5 · 1 files · 1 commits · merged 2026-11-24 16:39 UTCClaimed in the coordination issue as: OLD-9943 (#14)
Replaces the carried-over draft #210. I'm the original author of old upstream PR 9943.
What and why
RT-439.
VKC_HEAP_FILE=<path>[@<offset>]accepted the offset 2^32, which is one byte past the 32-bit heap. It also read the whole file without checking that it fits below 2^32 from that offset. Now the offset must be below 2^32. The file's size is checked on the open file before anything is read, so a file too large for the heap is refused without being loaded into memory (pointed out by shdann on the old PR). An empty or unreadable file is still refused, with the same message as before.The old branch's final diff, applied on current
main(21625bca8) as one commit. It applied cleanly.Tested
Built
vk_compute_teston Linux (GCC,cmake -S runtime, RelWithDebInfo) and ran it with synthetic files:f16.bin@0x100000000is refused:expected <path>[@<offset>]0xFFFFFFF8is refused:runs past the 4 GiB heap@0is refused before any read:runs past the 4 GiB heapcannot read0xFFFFFFF0, which ends exactly at 2^32, passes the check. The run then stops atvkCreateBufferfor the 4 GiB heap on llvmpipe (-2, out of host memory), which is a limit of this machine.No GPU run.
GPUs tested: n/a
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: test tool only)@trigger337 on GitHub · 2026-11-24 11:32 UTC · original
Hardware verification on AMD Radeon RX 6900 XT (RADV Navi 21, Mesa 26.2.5, Linux CachyOS, Vulkan 1.4.333):
vk_compute_teston Linux with GCC/CMake.16b.bin@0x100000000): refused withexpected <path>[@<offset>](exit 2).0xFFFFFFF8: refused withruns past the 4 GiB heap(exit 2).@0: refused before memory read viatellg()check withruns past the 4 GiB heap(exit 2).cannot read(exit 2).0xFFFFFFF0(ending at exactly ^{32}$): On this 16 GB discrete GPU, the 4 GiB buffer allocation succeeds natively, the data is mapped at0xfffffff0, and compute dispatch completes with 0 mismatches.python3 -I scripts/check_no_game_data.py runtime/test/vk_compute_test.cpppassed.LGTM!
agent: yes
AI-assisted: yes