mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:35:52 +01:00
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#189
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/137
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/9868📝 Commits (4)
b2ac5f1rdna2spirv: keep NaN-pattern constants out of float-typed selects in image_bvh (#6623)69af8b7test_image_bvh_tri: a NaN vertex with a payload returns the canonical NaN words (#6623)57729cbtest_image_bvh_tri: one blank line between methodscc05917test_image_bvh_tri: no select pairs the NaN or miss constant with a computed word📊 Changes
2 files changed (+52 additions, -3 deletions)
View changed files
📝
tests/semantic/test_image_bvh_tri.py(+31 -1)📝
tools/rdna2spirv.py(+21 -2)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Claimed in the coordination issue as:
#6623, in#7496Replaces
#7595, closed in the PR cleanup; same change, rebased onto main20cff7e36.Fixes
#6623What and why
On KosmicKrisp (Mesa 26.3.1, Vulkan on Metal),
cs_bvhandcs_bvh32return0x7fc00000where the box miss word should be0xffffffff. KosmicKrisp's MSL type inference gives anOpSelectthe first concrete type that reaches it. In theimage_bvh*_intersect_raylowering that is float (the result words share registers with bitcast floats), so the select's NaN-pattern constant is printed as(NAN), which Metal reads as0x7FC00000. Two selects are affected: the box branch's0xFFFFFFFFmiss index andcanon()'s0xFFC00000NaN word.KosmicKrisp's bitwise ops never take a float type, so a local helper
usel_k(c, k, x)buildsc ? k : xas(x & keep) | (k & pick), wherekeepandpickare selects between two constants (justx | pickfork = 0xFFFFFFFF). Only those two call sites change. The result words are the same on every driver. This is a workaround; the real fix belongs in Mesa'snir_to_msl.Tests
test_a_nan_with_a_payload_returns_the_canonical_nan: a payload NaN vertex must returnff800000 ffc00000 ffc00000 ffc00000; ausel_kthat drops its mask fails it.test_no_select_mixes_the_nan_or_miss_constant_with_a_computed_word(asked for by@kapitche): noOpSelectin the generated module pairs0xFFC00000/0xFFFFFFFFwith a computed operand. It fails on main (8 such selects) and passes here, on any machine.Tested
run_gpu_tests.py --filter cs_bvh0/2 → 2/2;(NAN)literals in the MSL ofcs_bvh/cs_bvh3216 → 0; full suite 174 → 176 passed, onlycs_bvh/cs_bvh32changed. MoltenVK 1.4.2: no differences.#7595others found no change against main on RTX 3080/3080 Ti/4060 Ti/5060 Laptop/5070/5070 Ti/5090, GTX 1660 SUPER, RX 6650 XT/6800 XT/6900 XT/7800 XT, Radeon 660M and other RDNA2 iGPUs, Steam Deck (RADV), Intel Arc B580 and Raptor Lake, and llvmpipe.tests/semantic/test_image_bvh_{tri,box,tri_hw,box_hw}.py18 passed.AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed. (No new instruction rule: the same words are produced through other SPIR-V ops.)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.