shader: probe native gfx1030 FP32 BVH box readback #1616
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1623"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-24T15:13:18Z.
Summary
Add a native Linux HIP readback fixture for
image_bvh_intersect_rayandimage_bvh64_intersect_rayon gfx1030. The kernel returns all four raw DWORDs. Five rays per opcode cover ordered hits, clipping, a disabled child, all-miss and a four-hit node. The runner logs the descriptor, typed pointer, readback and first mismatch with the CPU candidate.Verification
Tested commit
7e7fa40eceba735214574b705cd8163dd90bd699.LLVM and LLD 15 assembled and linked the code object, with one instance of each opcode in disassembly and 80-byte kernel argument segments. Code object SHA-256
9b2e3470f1fef2cd5eea243097dc412d7b36601264d095eaf65c3f612ca796aa. All five CPU ray witnesses and both mutation checks passed. The reversed sort first changes word 0 from0000001dto00000025. Substituting zero for the all-miss fill changes word 0 fromffffffffto00000000. The three Python regressions passed.git diff --check origin/main...HEADandgit merge-tree --write-tree origin/main HEADpassed against71be6f0f5bec7729a259b8090dbb8374e22b3f9a. A merge simulation with the comparison stack and #1587 produced the same tree with this probe applied first or last.Native capture
Volunteers with a Linux HIP
gfx1030adapter can post their readback in #1639.The draft awaits a Linux HIP run on a physical
gfx1030adapter. Userocminfoto confirm the target. Build the code object and select the corresponding HIP ordinal.Please include the adapter target, driver and runtime, command, and all raw DWORDs in the report. The CPU candidate for miss and disabled slots requires native readback before it can be used to justify translator coverage.
Windows host follow-up
Reproduced the LLVM and LLD 15.0.7 build for
7e7fa40eceba735214574b705cd8163dd90bd699in Ubuntu 24.04.4 on WSL2. The code object matched the SHA-256 above, disassembly showed one instance of each BVH opcode, and both kernels reported an 80-byte argument segment.--model-onlypassed all five CPU witnesses and both negative controls. The documentation link, bidi-control and form-coverage checks passed using the Windows development Python environment.The host runs Windows 11 build
26200.9974with a Radeon RX 7900 XTX (gfx1100, Windows driver32.0.32029.2010). In its existing ROCm7.2.1WSL environment,/opt/rocm/bin/rocminforeportedhsa_init Failed, possibly no supported GPU devices, andhipInit(0)returned error100(no ROCm-capable device is detected). Native capture remains pending on a physical Linux HIPgfx1030adapter for all ten cases.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T03:54:47Z.
Review: COMMENTED
Review of head
7e7fa40eceba735214574b705cd8163dd90bd699(read-only, comment only).Status: needs a rebase before it can merge. GitHub reports
CONFLICTING. A localgit merge-tree origin/main HEADshows a single content conflict, indocs/experiments.md(the new section sits next to text that changed on main). The code undertests/gfx1030_bvh_box/merges cleanly.Scope: 4 files, +378 (
box.s,build.sh,check.py, docs section). The probe is a Linux HIP readback fixture. It changes no translator behavior and claims no form coverage. Title is neutral. CI is green on the checks that ran (Linux Python checks, gfx1013 fixtures, Windows build and test).Commands executed locally in a worktree of the head SHA:
python3 tests/gfx1030_bvh_box/check.py --model-only: rc=0. The control lines match the doc (0000001dvs00000025,ffffffffvs00000000).python3 tests/docs_links_check.py: pass (16 files, 348 links).python3 tests/bidi_controls_check.py: pass (1264 files).git diff --check origin/main...HEAD: clean.sh tests/gfx1030_bvh_box/build.sh: not run to completion,llvm-mc-15is not installed on this host. I did not verify the code object or the one-instruction-per-kind disassembly check. No gfx1030 device here, so native readback was not run (the doc says it is pending).reference().--model-onlyfails (AssertionError: sorted ... (37, 29, ...) != (29, 37, ...)). Killed.near <= far and near < extenttonear <= far. Still passes. This is nearly equivalent, becausefarstarts atextentand is only lowered, so the two conditions differ only whennear == extentexactly. No ray inRAYSlands on that boundary.Findings:
RAYS): add one ray whose box entry distance equals the extent exactly. Then thenear < extentstrictness is pinned, and it becomes a useful hardware question (is the clip inclusive or not).kernarg): the<4IQ8xQ10flayout relies on<having no padding. A one-line comment with the offsets (descriptor 0x00, output 0x10, node 0x20, floats 0x28) would help. I checked that it matches thes_loadoffsets inbox.s(node in s12:13, extent s14, origin s15:17, dir s18:20, inverse dir s21:23, and the 32-bit form packs them contiguously).Operand order, descriptor fields and the 32-bit/64-bit pointer encoding look consistent with the cited RDNA 2 tables and Mesa reference. I could not confirm hardware behavior, which the PR itself states is pending.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:25:31Z.
Review: COMMENTED
Re-review of head
4b0c69c35a338af57f642b1f62ae84e73e97e8d7(read-only, comment only).Status: the earlier conflict is resolved. The head is a merge of main into the branch.
git merge-tree --write-tree origin/main HEADnow exits 0 (clean). Files undertests/gfx1030_bvh_box/are byte-identical to the previously reviewed head7e7fa40e. Only the merge with main changed. Scope is still 4 files, +378. Title is neutral. CI on this head: Linux Python checks, gfx1013 fixtures and Windows build/test pass. The coverage chart job and the /O2 job are skipped.Commands executed locally in a worktree of this head:
python3 tests/gfx1030_bvh_box/check.py --model-only: rc=0. Control lines match the doc (0000001dvs00000025,ffffffffvs00000000).python3 tests/docs_links_check.py: pass (18 files, 407 links).python3 tests/bidi_controls_check.py: pass (1489 files).git diff --check origin/main...HEAD: clean.git merge-tree --write-tree origin/main HEAD: rc=0.reference().--model-onlyfails (('sorted', (37, 29, ...), (29, 37, ...))). Killed.near <= far and near < extentchanged tonear <= far. Still passes (rc=0).farstarts atextent, so the two differ only when entry distance equals the extent exactly. No ray inRAYShits that boundary. Survived.build.sh(nollvm-mc-15here), so the code object and the one-instruction-per-kind disassembly check are unverified by me. No gfx1030 device here, so native readback is not run (the doc says it is pending). Win2025 WARP is not relevant: no translator or shader code changes.Findings:
RAYS): add a ray whose entry distance equals the extent. That pins thenear < extentstrictness and gives the hardware run a useful question (is the clip inclusive?).kernarg): a one-line comment with the offsets (descriptor 0x00, output 0x10, node 0x20, floats 0x28) would help.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-25T05:34:39Z.
Rebased/merged current
main(ab9a020c) at4b0c69c3to resolve the single content conflict indocs/experiments.md.Verified locally on
4b0c69c3:python -B tests/gfx1030_bvh_box/check.py --model-only-> passed (sortedandall_misscontrols reported expected differences)python -B tests/docs_links_check.py-> passed (18 Markdown files, 407 links)python -B tests/bidi_controls_check.py-> passed (1,489 tracked files)