Repository navigation
startup: lower the FP32 box case of image_bvh_intersect_ray - #2922
Conversation
|
CI caught a manifest regression in the first head: the new |
|
Clarification for review: the |
|
A stacked binary16 slice is ready on |
KelboLive
left a comment
There was a problem hiding this comment.
PR #2922 by @lambirou -- startup: lower the FP32 box case of image_bvh_intersect_ray
What works
- Solid foundational work establishing the 0x100 linear layout in gfx10_layout.h with careful derivation from AMD addrlib
- The linear_mode = 0 constant elegantly extends block_log2() to accept mode 0 without changing the tiled modes switch logic
- supports() check is correct: mode == linear_mode bypasses the block_log2 >= 12 requirement since linear has no tail
- Test infrastructure is excellent -- linear_order_control (expected failure with largest mip first), linear_addrlib (338K element addresses), and the unpadded negative control all add strong coverage
- Documentation accurately restates addrlib's linear mode algorithm in clear, testable terms
Issues
- supports() currently allows block-compressed formats (BC1-BC7) in linear mode via the fallthrough -- BC formats are block-based and don't have linear row semantics; consider gating them out explicitly like 1D does in #2929
- The check script in startup_address_console_check.py builds linear backing bytes from addrlib equations. This is correct but the linear path could break if the hardcoded equations drift from addrlib; a comment linking to the Mesa commit that derives these equations would help
Recommendations
- Good discipline in including the negative control (unpadded rows test) to verify the 256-byte pitch requirement
- Consider adding a TODO or assert in supports() that blocks linear mode for BC formats until explicitly validated against addrlib
Overall
A well-researched, well-tested implementation. The linear layout extension is cleanly separated from tiled modes. Minor concern about BC format handling in linear mode, but the existing refusal behavior is safe. Ready for merge.
R0Y00
left a comment
There was a problem hiding this comment.
The Python controls, DXC compile and five registered WARP helper cases pass on 2ec454f9 integrated with main 22107932 (Windows 11 build 26200.9974, SDK 10.0.26100, WARP 10.0.26100.9818, debug layer enabled, zero errors). Two cases are still missing from the fixture.
- With the sort bit clear, the nonadjacent comparisons can reorder hits whose keys are equal. I ran the existing raw-UAV harness with children
(0x25, disabled, 0x2d, 0x35), depths(4, 1, 2, 3), the existing forward ray and extent 19. CPU reference gives(0x25, 0x2d, 0x35, 0xffffffff)in child order. The current CPU network model and actual WARP readback both return(0x25, 0x35, 0x2d, 0xffffffff). Please explicitly compact in original order when sorting is disabled and include this three-hit case before carrying the helper into the stacked binary16 slice. - The GPU miss-fill control says it checks all-miss case 2, but it reads
mutant[128:132], which is sorted case 0. The original case 0 already contains hits, so the current!= (INVALID,) * 4assertion passes even if the mutation does nothing. Please compare case 2 (136:140) and assert a predicted mismatch against its unmodified all-miss result.
|
Both findings are fixed in
Local result: |
R0Y00
left a comment
There was a problem hiding this comment.
The two findings are resolved at 94e90292 on current main 3e9542a6. With sorting disabled, the original three-hit counterexample now preserves child order. The updated miss-fill mutation examines the all-miss case and detects changed values there.
I rebuilt offscreen_check and ran ctest --preset <dev|release> --no-tests=error -V -R '^startup_gfx2hlsl_bvh'. Both presets passed 3/3 with no skips, including six exact cases and the miss-fill negative control on WARP and RTX 4060 Laptop. Windows 11 build 26200.9974, SDK 10.0.26100 DXC, WARP driver 10.0.26100.9818, RTX driver 32.0.16.1656, debug layer enabled with zero errors or warnings. Hosted Windows, Linux Python and gfx1013 checks are green. This confirms the translator and the standalone helper readback. A runtime binding for the BVH manifest remains a separate slice.
What changed
This is the first translation slice of
image_bvh_intersect_rayintools/startup/gfx2hlsl.py.The supported slice is deliberately narrow:
image_bvh64_intersect_rayis refused by name.0xfffffffffor misses.ByteAddressBufferbinding in the manifest.The emitted HLSL helper follows the public Mesa RADV box test and sorting network (MIT), including the inactive-box rule, the inverse-direction clamp and equal-key ordering. No code from the GPL-3.0 DexNom/VIctory reference is copied.
Tests
Output ends with:
The check covers the CPU reference against the existing gfx1030 box fixture, the emitted sort network, the sort-bit negative control, the all-miss result, manifest and buffer binding, the four-result call, sort-disabled translation, and one refusal control per unsupported shape (no partial output). DXC compiled the emitted HLSL.
Existing
startup_gfx2hlsl_{op_refusals,refusals,compute_controls}still pass.Limits
This slice does not run on a GPU in the game path. It becomes useful once the compute Dispatch path can bind and dispatch the translated program. The triangle and 16-bit box cases are the next slices; the CPU model and witness set in #2921 are the oracle for them.
Refs #870, #1412, #1268.
AI-assisted.