mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #1210] xdxr_build: take the BOX16 half sign without a shift-then-mask (AMD driver miscompile) #1242
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#1242
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/1210
Author: @whoalin1
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:amd-val-box16-sign📝 Commits (1)
4a4aa9bxdxr_build: take the BOX16 half sign without a shift-then-mask📊 Changes
3 files changed (+7691 additions, -7687 deletions)
View changed files
📝
docs/bvh.md(+4 -1)📝
runtime/src/xdxr_build.comp(+4 -2)📝
runtime/src/xdxr_build.inc(+7683 -7684)📄 Description
Claimed in the coordination issue as: XDXR-BOX16-SIGN-AMD (claim)
Depends on: none
What and why
On the AMD Windows driver (24.10.24, Vulkan 1.3.280, gfx1035), every
MINIMIZE_MEMORYBOX16 build throughxdxr_build.compproduced corrupt boxes:tools/xdxr_bvh.py check-buildreported ~20,727 problems ("child box not inside its parent's box") and essentially all rays missed. BOX32 builds of the same trees were bit-exact, and NVIDIA produced correct output from the identical SPIR-V module — an AMD shader-compiler miscompile, not a logic bug.Bisection isolated
half_directed()inruntime/src/xdxr_build.comp: it computed the half's sign as(u >> 16) & 0x8000. The bit-equivalent(u & 0x80000000u) >> 16produces correct output on the same driver. In SPIR-V the old form isOpShiftRightLogical+OpBitwiseAndwith a0x8000mask; the new form reuses the existing0x80000000constant. Deterministic across runs and across-O/-O0glslc output.Changes:
runtime/src/xdxr_build.comp: one-line rewrite + comment.runtime/src/xdxr_build.inc: regenerated with glslc from Vulkan SDK 1.4.363.0 (the large diff is SPIR-V result-ID renumbering).docs/bvh.md: note in the BOX16 section.Tested
vk_xdxr_build_test+xdxr_bvh.py check-build --rays 1000on the AMD iGPU: 20,727 problems → all cases match (box16/paired/extremes/refit).d3d12_xdxr_rt+ its check on AMD iGPU: all match (was failing before).py -3.14 -I tests/test_xdxr_bvh.py: 47 tests OK.LEONIDA_VK_VALIDATION=1ctest sweep on AMD iGPU: 0 VUIDs (unrelated suite run the same session).GPUs tested: AMD Radeon Graphics (Ryzen 5 7600 iGPU, gfx1035-class RDNA2, driver 24.10.24, Vulkan 1.3.280, Windows 11); NVIDIA GeForce RTX 4070 SUPER (driver 610.88, Windows 11)
AI-assisted: yes (Devin)
Checklist
mainand merges cleanly🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.