vk_compute_test: VKC_HEAP_FILE refuses an offset of 2^32 and a file past the 4 GiB heap (RT-439) #210

Closed
github-bot wants to merge 2 commits from gh-pr/210/head into gh-pr/210/base
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:44 UTC · original
ubiquitarianism:old-pr/9943 → main · +21 −5 · 1 files · 2 commits · closed without merging

Carried over from old PR 9943 by LouisRiverstone in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9943, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
LouisRiverstone: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

RT-439 (found by @SuarezPM): vk_compute_test accepts VKC_HEAP_FILE=<path>@0x100000000, which is one past the 32-bit heap.

Re-submission of #5878. #5878 was 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 current main.

Checked on #5878 by: Mortify7612 (AMD Radeon RX 9060 XT).

No game files.

AI-assisted (Claude Code): I reviewed the change and re-ran its tests on the merge with main.

**@⁠Andretuta** on GitHub · 2026-11-24 02:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/210) `ubiquitarianism:old-pr/9943` → `main` · +21 −5 · 1 files · 2 commits · closed without merging > Carried over from **old PR 9943** by `LouisRiverstone` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9943`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `LouisRiverstone`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): RT-439 (found by `@SuarezPM`): `vk_compute_test` accepts `VKC_HEAP_FILE=<path>@0x100000000`, which is one past the 32-bit heap. Re-submission of `#5878`. `#5878` was 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 current `main`. Checked on `#5878` by: Mortify7612 (AMD Radeon RX 9060 XT). No game files. AI-assisted (Claude Code): I reviewed the change and re-ran its tests on the merge with `main`.
The offset check was 'parsed > (1ull << 32)', so @0x100000000, one past the
32-bit heap, was accepted and sized a host-visible buffer past 4 GiB (found by
@SuarezPM). It is now '>=', and once the file is read, offset + size must stay
within 2^32 as well (@0xFFFFFFFC with an 8-byte file ran past it the same way).
Both give the usage error, exit 2. On llvmpipe: @0x100000000, @4294967296 and
@0xFFFFFFFC + 8 bytes now exit 2 with the message; @0x40 runs as before;
cs_heap_init and cs_fmt_xy_xyz pass.
@shdann on #5878: the range check ran after the whole file was read into host
memory, so a 32 MiB file at @0xFFFFFFFC was read in full (59 MB peak on
Windows) just to be refused. The file is now opened at its end, its length
checked against 2^32 - offset, and only then read. On llvmpipe a 32 MiB file
at @0xFFFFFFFC exits 2 with an 8 MB peak, the same as an 8-byte one; @0x40 and
a missing file behave as before.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:48:53 +00:00
github-bot closed this pull request 2026-11-26 08:48:53 +00:00
Author
Owner

@⁠LouisRiverstone on GitHub · 2026-11-24 11:20 UTC · original

Taken over by its author in #670 (rebased on main). This draft can be closed.

**@⁠LouisRiverstone** on GitHub · 2026-11-24 11:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/210#issuecomment-7129979524) Taken over by its author in #670 (rebased on main). This draft can be closed.
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 19:09 UTC · original

Closing: everything this pull request changes is already in main. Merging it into main (490f5b9ec) leaves every file as it is. The same change landed with #670.

Thanks for the work! If something here is still missing from main, open a new pull request with what's left.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 19:09 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/210#issuecomment-7171905791) Closing: everything this pull request changes is already in `main`. Merging it into `main` (`490f5b9ec`) leaves every file as it is. The same change landed with #670. Thanks for the work! If something here is still missing from `main`, open a new pull request with what's left. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.