Skip to content

Tests: verify RDNA2 BVH box16, paired triangles, and scene edge cases - #1554

Open
amazedturnip wants to merge 1 commit into
xcl-dev:mainfrom
amazedturnip:xcl/tests-bvh-box16-triangle-pair-and-scene-contract-013434
Open

amazedturnip wants to merge 1 commit into
xcl-dev:mainfrom
amazedturnip:xcl/tests-bvh-box16-triangle-pair-and-scene-contract-013434

Conversation

@amazedturnip

@amazedturnip amazedturnip commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Add integration contract tests for xcl::gpu::bvh covering 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), @60 barycentric vertex rotation bits, unknown node types, t < 0 / tmax culling boundaries, and Bvh::trace_scene skipping instances with missing BLASes.

What is in it

  • crates/xcl/tests/bvh_contract.rs: add integration contract tests for xcl::gpu::bvh covering box16 (type 4) half-float AABB decoding and sort=false/sort=true ordering, box16 root traversal, paired-triangle leaves (type 0 with bit 7 set -> type 1) and @60 barycentric rotation bits, unknown node types returning INVALID, empty/non-empty behind-ray and tmax culling boundaries, and Bvh::trace_scene skipping instances whose blas() callback returns None.

Tested

  • Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build
  • AMD (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))
  • Verification / negative control: new test suite — verified 3x deterministic

Not tested

  • Retail Xbox Series X|S title (not available on this host)
  • NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64)

AI use

  • Antigravity CLI (Gemini 4 Hydrogen (Medium)) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).

Add integration contract tests for xcl::gpu::bvh covering box16 half-float decoding and sort=false ordering, paired-triangle leaves (type 0 + bit 7 -> type 1) with @60 barycentric rotation bits, unknown node types, behind-ray/tmax culling, and trace_scene missing-BLAS handling.
@futurepro62

futurepro62 commented Nov 24, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head f4c7bba (on its base 9e3831e).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_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.
  • The new tests ran and passed: 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.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, 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_form was skipped with --skip. It fails on main 9e3831e too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (XCL_HEAP_WINDOWS unset). Reported as Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #1651.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.

Thanks!

@Decodere

Copy link
Copy Markdown
Contributor

Independent desktop NVIDIA verification of PR #1554 at head f4c7bba3ed20aa968a54e0394a5d069c26b65956 (1 commit; exact parent & merge-base: 9e3831e1f570d3646e53ab753b19ec07eb8f1485, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted tests & build (f4c7bba3)

Command Result
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, 0 skipped; 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 xcl Clean build (1m 02s --test compile + 0.08s incremental --release build, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

(Note: scripts/smoke.ps1 at 9e3831e1 predates 9683e7a6 and printed the local folder basename on title:; replaced below with the standard 9683e7a6 title hash 29640639, with all measured fields verbatim.)

Exact parent & merge-base (9e3831e1f570d3646e53ab753b19ec07eb8f1485):

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1549 (PresentX 1549)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14715 MB

PR #1554 (f4c7bba3ed20aa968a54e0394a5d069c26b65956):

xcl-smoke v1
commit: f4c7bba3ed20aa968a54e0394a5d069c26b65956
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1600 (PresentX 1600)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14712 MB

Limits of coverage

  • This PR is test-only (crates/xcl/tests/bvh_contract.rs, 0 production-code changes); all 6/6 CPU-side BVH contract tests passed 3/3 (0 skipped).
  • The 60 s retail smoke confirms non-regression of the unchanged runtime binary at this commit (single-run frame/commit delta vs. parent reflects normal startup variance, not this PR).

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

@saintwolf

Copy link
Copy Markdown
Contributor

merge-check claim
head: f4c7bba

@github-actions github-actions Bot added area:tests Unit, integration, e2e tests, or testtitle gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test) needs-1st-check Passes gates; needs first independent merge-check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU labels Nov 30, 2026
@saintwolf

Copy link
Copy Markdown
Contributor

merge-check
base: 9dfbe3e
head: f4c7bba
merge: 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 9dfbe3e, 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

@github-actions github-actions Bot added needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) and removed needs-1st-check Passes gates; needs first independent merge-check (#3041) labels Nov 30, 2026
@coolpersonnn

Copy link
Copy Markdown
Contributor

merge-check claim
head: f4c7bba

@coolpersonnn

Copy link
Copy Markdown
Contributor

merge-check
base: abec7ce
head: f4c7bba
merge: 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)

@github-actions github-actions Bot added ready-to-merge Has 2 independent safe merge-checks on current head (#3041) and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU labels Nov 30, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Triage (#1607) – head f4c7bba

Test-only, new crates/xcl/tests/bvh_contract.rs against the public gpu::bvh API 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 match bvh.rs:intersect_node on 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.

@throny throny added needs:amd-test Needs a test report or merge-check on an AMD GPU and removed ready-to-merge Has 2 independent safe merge-checks on current head (#3041) labels Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests Unit, integration, e2e tests, or testtitle gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test) needs:amd-test Needs a test report or merge-check on an AMD GPU off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants