Translation: buffer range checks without a division #66
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ThatRecompDev--five-star-recomp!66
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-66"
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?
@guialmm on GitHub · 2026-11-26 22:48 UTC · original
guialmm:fix/buf-limit-no-division→main· +9 −3 · 1 files · 1 commits · merged 2026-11-27 08:00 UTCFixes the E_OUTOFMEMORY group from #9 (21 cases on an RTX 3060, driver 32.0.16.1714).
NVIDIA refuses the pipeline when a guarded store depends on
0xffffffff / stride, whichbuf_limitandsbuf_limitused for the 4 GiB overflow check.buf_index_overflowsanswersindex * stride >= 2^32without dividing: the stride has 14 bits, so splitting the index at bit 18 keeps both products under 32 bits. I checked it against the division for every stride (0..0x3fff).Tests: WARP 550 passed, 0 failed. On the 3060 none of the 21 fail anymore; what's left there is the rootdesc variant (next PR) and what #61/#62 fix.
AI-assisted (Claude), reviewed and tested by me.
@ThatRecompDev on GitHub · 2026-11-26 23:10 UTC · original
thanks, this is a nice one. went through the math: with the 14-bit stride the hi/lo split gives exactly index * stride >= 2^32 and nothing passes 32 bits, and stride 0 behaves like before, so it's equivalent to the division. ran it here together with #61, #62, #67 and our own pending translator changes: 572 passed / 0 failed on WARP, and the buffer, typed view, wave emulation and user-data tests (50) pass on a 4090 too. it changes translation output so it lands with that batch, should be soon
@ThatRecompDev on GitHub · 2026-11-27 08:01 UTC · original
in main now with the translator batch (
976cc3e3). it ran in all of last night's boots on the 4090 without trouble, thanks for this one.