Repository navigation
Conversation
|
I am preparing an AI-assisted backport patch from x2w-microlift for three independently reproducible FP32 corrections: encoded descriptor base is in 256-byte units (keep the upper base byte), unsorted hits preserve original child slots (existing One separate FP16-specific point from RDNA2 ISA Table 49: size encodes the number of nodes minus one, so a single-unit binary16 node at offset == size, including size zero/offset zero, is valid. The current two-unit bounds check and shared size-zero refusal need adjustment for box16. I will keep the standalone FP32 patch source-built/title-neutral and avoid runtime binding changes. |
tedin7
left a comment
There was a problem hiding this comment.
Review of head c7a23a1 (a merge of main on top of the code I read; the PR-only diff is the same 3 files) (comment only).
Read the diff of tools/startup/gfx2hlsl.py (85 lines): kind-4 (binary16) box nodes are now lowered through x2w_bvh_box16_slot / x2w_bvh_intersect_box16, with a 64-byte node alignment check (offset & 0x3f), the same descriptor-size rule in 64-byte units, miss compaction, and a separate path for unsorted boxes (the sort network is not reused, with the reason in a comment). The six half values per child are read as f16tof32 and the box32 maths is reused, which is exact.
The check has what a lowering needs: startup_gfx2hlsl_bvh_dispatch_warp / _hardware run the generated HLSL on a node buffer and compare the readback with the CPU reference(...) for both box32 and box16 cases (including the half-node cases), plus the translator-level startup_gfx2hlsl_bvh.
Ran locally (Linux; no dxc here, so the dispatch part skips): python3 -B tests/startup_gfx2hlsl_bvh_check.py: all ok.
- Mutation A: the
lo.zhalf read changed fromh1toh2in the HLSL helper: the Linux part does NOT catch it (HLSL maths only runs in the dispatch test); only the WARP dispatch can. - Mutation B: accepted kinds reduced to
(5,): the translator control fails (StopIteration, no box16 call).
No defect found. It only lacks a Windows receipt on this head: ctest -R "startup_gfx2hlsl_bvh" (dev + release).
AI-assisted; commands listed were executed locally.
|
Windows receipt on Hardware adapter: AMD Radeon RX 9060 XT ( The translator controls and both DXC compiles pass in dev and release. No code changes since the head you reviewed; this is only the requested Windows receipt. |
|
The focused FP32 correction is available in #3040 now. It also checks the 48-bit node-address end-exclusive bound. Portable CPU model/translator checks passed; GPU dispatch remains unverified on this host. |
|
#3040 has landed on |
Adopt the FP32 BVH descriptor unit decode, 48-bit end-exclusive bound, positional unsorted results and positive-infinity miss keys for both box kinds. Binary16 fixtures are packed as half values and share the independent model; dev and release WARP and RX 9060 XT dispatch pass 21 cases plus six mutants.
|
Merged The binary16 path now shares the #3040 semantics:
The combined check writes four FP32 nodes, four binary16 nodes and 21 rays, and compares the 1232-byte readback. Binary16 bounds are packed as Windows receipt on
The earlier Windows receipt predates the #3040 changes; this one is on the new head. |
What changed
This is the binary16 slice of
image_bvh_intersect_ray, stacked on the merged FP32 box slice (#2922) and the corrected FP32 semantics from #3040.binary16values at bytes 16..63.f16tof32and reuses the slab test, extent clip, inactive-box rule, descriptor validation and sort rules of the FP32 helper.0xfffffffffor holes, and sorted misses use a positive-infinity key.x2w_bvh_intersect_box16for kind 4 and keeps the samesrv <i> bvh base 0x<base> size 0x<size>manifest line.The node layout follows Mesa 25.1.0 RADV's
radv_bvh_box16_node(MIT). No game files or captures are included.Tests
The combined check writes four FP32 nodes, four binary16 nodes and 21 rays and compares the 1232-byte readback. Binary16 bounds are packed as
binary16and read by the independenttests/gfx1030_bvh_box/bvh_model.py; one bound at 1.1 rounds to 1.099609375 so a ray extent between the two values provesf16tof32is used. Six mutants cover miss filling (box32 and box16), unsorted compaction with a box16 witness, the finite miss key, the low-byte base check and the high-byte base handling.Passed on
b7117d46, dev and release:startup_gfx2hlsl_bvh: pass, both DXC compiles ok.startup_gfx2hlsl_bvh_dispatch_warp: pass, 21/21 cases and 6/6 controls on Microsoft Basic Render Driver1414:008c, driver10.0.26100.10068.startup_gfx2hlsl_bvh_dispatch_hardware: pass, 21/21 cases and 6/6 controls on AMD Radeon RX 9060 XT1002:7590, driver32.0.32029.2010.The branch is merged with current
maine1ea515dand preserves the #3040 descriptor/count semantics. The earlier Windows receipt predates those changes.Limits
This is a translator slice. It does not bind the node buffer on a D3D12 device or establish title behavior. The runtime manifest loader does not yet consume the
bvhbaseline, so a real dispatch is refused rather than bound at a wrong address.Refs #870, #1268, #2922, #3040.
AI-assisted.