Tests: verify RDNA2 BVH box16, paired triangles, and scene edge cases #1544
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1554"
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 ivall/xcl. Originally posted by amazedturnip on 2026-11-24T17:36:15Z.
Add integration contract tests for
xcl::gpu::bvhcovering RDNA2 traversal paths not exercised by the inline unit tests: box16 (type 4) half-float AABB decoding and sort order, paired-triangle leaves (type 0 bit 7 -> type 1),@60barycentric vertex rotation bits, unknown node types,t < 0/tmaxculling boundaries, andBvh::trace_sceneskipping instances with missing BLASes.What is in it
crates/xcl/tests/bvh_contract.rs: add integration contract tests forxcl::gpu::bvhcovering box16 (type 4) half-float AABB decoding andsort=false/sort=trueordering, box16 root traversal, paired-triangle leaves (type 0 with bit 7 set -> type 1) and@60barycentric rotation bits, unknown node types returningINVALID, empty/non-empty behind-ray andtmaxculling boundaries, andBvh::trace_sceneskipping instances whoseblas()callback returnsNone.Tested
AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64),XCL_ADAPTER=radeon):cargo test --workspace -- --test-threads=2— 782 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 1 (no heap windows))Not tested
AI use
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T18:50:07Z.
Full-suite run, since this PR has no test report yet. Tested exact head
f4c7bba(on its base9e3831e).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form: 781 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.box16_half_float_decoding_and_sort_order,box16_root_traversal_reaches_triangle_leaf,paired_triangle_leaf_traversal_and_disable_flag,triangle_barycentric_rotation_bits_at_60,unknown_node_types_and_culling_boundaries,trace_scene_skips_missing_blas_and_prebuild_size_scales.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 782 passed, 0 failed, 41 ignored. SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).heap_window_out_of_memory_falls_back_to_the_switch_formwas skipped with--skip. It fails on main9e3831etoo, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (XCL_HEAP_WINDOWSunset). Reported as #1651.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T19:19:23Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.Thanks!
upstream-sync referenced this pull request2026-11-24 23:06:49 +00:00
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T11:58:54Z.
Independent desktop NVIDIA verification of PR #1554 at head
f4c7bba3ed20aa968a54e0394a5d069c26b65956(1commit; exact parent & merge-base:9e3831e1f570d3646e53ab753b19ec07eb8f1485, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12, Wave32-only Ada), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted tests & build (
f4c7bba3)cargo test --release -p xcl --test bvh_contract -- --nocapture(3 consecutive runs)6 passed; 0 failed; 0 ignored; 0 filtered out× 3 (0.00s,0.00s,0.00s,0skipped;box16_half_float_decoding_and_sort_order,box16_root_traversal_reaches_triangle_leaf,paired_triangle_leaf_traversal_and_disable_flag,triangle_barycentric_rotation_bits_at_60,unknown_node_types_and_culling_boundaries,trace_scene_skips_missing_blas_and_prebuild_size_scales)cargo build --release -p xcl1m 02s--testcompile +0.08sincremental--releasebuild, exit0,0new warnings)Paired quiet 60 s retail smoke (
title: 29640639)(Note:
scripts/smoke.ps1at9e3831e1predates9683e7a6and printed the local folder basename ontitle:; replaced below with the standard9683e7a6title hash29640639, with all measured fields verbatim.)Exact parent & merge-base (
9e3831e1f570d3646e53ab753b19ec07eb8f1485):PR #1554 (
f4c7bba3ed20aa968a54e0394a5d069c26b65956):Limits of coverage
crates/xcl/tests/bvh_contract.rs,0production-code changes); all6/6CPU-side BVH contract tests passed3/3(0skipped).AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T15:37:12Z.
merge-check claim
head:
f4c7bba3edImported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T15:41:37Z.
merge-check
base:
9dfbe3ea66head:
f4c7bba3edmerge: clean (trial merge 86081e28562ec53e6c7dba00a90471da00c3df95; git diff --check clean; +221/-0, one new file crates/xcl/tests/bvh_contract.rs)
build: cargo build --workspace -> ok (39 pre-existing warnings, none from the PR's file)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2891 passed, 1 failed, 51 ignored; SKIPPED: 27 (22 "no wave64" — wave32-only GPU, 2 "no heap windows", 1 "cannot disable the driver cache (Developer Mode)", 2 "no xgameruntime.dll"); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, pre-existing on this machine (fails identically on base
9dfbe3ea, same "2D D16 resinfo clobbered v2/v3" assertion). All six new bvh_contract tests pass.review: read the whole diff. Test-only, no production change. The hand-built node bytes match the source decode in bvh.rs exactly: box16 children at at+4k and packed half bounds at at+16+12k in the mn0/mn1|mn2/mx0|mx1/mx2 order the decoder reads, so the NaN-child (t1 NaN -> invalid), inverted-box (mn > mx -> invalid), subnormal 2^-24 bounds and the sort=false slot order vs sort=true closest-first assertions all exercise the real paths. The box32 paired-triangle leaf checks the bit-7 present/clear pair against the @48 header word; the @60 barycentric byte pairs (0x0204) are verified through the rotated (I,J) outputs for both triangles; unknown types 6/7 return [INVALID;4] and empty structures have root INVALID. The prebuild_size expectations (1024/4096/5120) were recomputed by hand from the formula at bvh.rs:73. trace_scene with a missing BLAS returns the farther hit without panicking. No unsafe, no new dependencies, nothing in crates/xcl/src. Duplicates clear: the other open BVH PRs (#1559 audit, #1800/#2302 recompiler, #2087 GPU parity) are all GPU/shader-side, this is the CPU decoder contract.
performance: none; test-only, CPU-only.
verdict: safe to merge
hardware / tool and model: RTX 4070 SUPER (driver 32.0.16.2140), Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 / OpenCode, Qwen 3.8 27B
Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-30T18:13:24Z.
merge-check claim
head:
f4c7bba3edImported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-30T18:20:08Z.
merge-check
base:
abec7ce9eehead:
f4c7bba3edmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2892 passed, 0 failed, 51 ignored (25 SKIPPED: 22 no wave64, 2 no heap windows, 1 cannot disable the driver cache); failing: none; all 6 new tests in tests/bvh_contract.rs passed
review: none. Read the full diff (+221/-0, new file crates/xcl/tests/bvh_contract.rs). Verified all 6 tests against crates/xcl/src/gpu/bvh.rs: box16 half-float decoding (normal, subnormal 2^-24, NaN/inverted culling) and sort/unsorted/tmax behavior, box16 root traversal to a triangle leaf, paired-triangle leaf traversal and bit-7 disable flag at @48, per-triangle barycentric rotation bits at @60 for both type 0 and type 1 triangles, unknown node types (6/7) / empty BVH / t < 0 and strict tmax culling, and trace_scene skipping missing BLAS lookups plus prebuild_size scaling. Pure test-only addition with clean scope; no duplicates found in open/merged PRs or #1607.
performance: none (test-only change; no runtime code modified)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5090 (driver 32.0.16.2101), AMD Ryzen 9 9950X3D, Windows 11 Pro build 26300, Rust 1.100.0 / T3 Code (Antigravity), Gemini 4 Neon (Medium)
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:05:50Z.
Triage (#1607) – head
f4c7bbaTest-only, new
crates/xcl/tests/bvh_contract.rsagainst the publicgpu::bvhAPI on main. #1559 also adds box16/box32 tests, but only for NaN/inf ray directions and zero extents. This PR covers half-float decoding, sort order, paired triangles, the @60 rotation bits and missing BLASes, so there is no overlap. The expectations matchbvh.rs:intersect_nodeon main as I read it.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.