BVH: keep absent children behind real hits #230

Closed
github-bot wants to merge 4 commits from gh-pr/230/head into gh-pr/230/base
Owner

@⁠space-de on GitHub · 2026-11-24 22:50 UTC · original
space-de:fix/bvh-absent-child-sort → main · +6 −2 · 2 files · 4 commits · closed without merging

Fixes #173.

When a BVH child pointer is NONE, its stored bounds can still intersect the ray. The current slab test then gives that absent child a finite distance, so the sorting network can place the NONE sentinel ahead of a real hit. Traversal that stops at the first absent child can miss valid geometry.

Require a present child in both implementations: the CPU reference and the matching DXIL emitter. Absent children now remain misses with infinite distance, so sorting keeps valid intersections ahead of them.

Checks

  • cargo check -p victory-shader --locked
  • cargo clippy -p victory-shader --locked -- -D warnings
  • rustfmt --edition 2024 --check crates/victory-shader/src/bvh.rs crates/victory-shader/src/emit/intersect.rs
  • git diff --check

No in-game run was performed. This is a BVH traversal correctness fix; no frame-rate improvement is claimed.

**@⁠space-de** on GitHub · 2026-11-24 22:50 UTC · [original](https://github.com/fxceless/victory-fork/pull/230) `space-de:fix/bvh-absent-child-sort` → `main` · +6 −2 · 2 files · 4 commits · closed without merging Fixes #173. When a BVH child pointer is `NONE`, its stored bounds can still intersect the ray. The current slab test then gives that absent child a finite distance, so the sorting network can place the `NONE` sentinel ahead of a real hit. Traversal that stops at the first absent child can miss valid geometry. Require a present child in both implementations: the CPU reference and the matching DXIL emitter. Absent children now remain misses with infinite distance, so sorting keeps valid intersections ahead of them. **Checks** - `cargo check -p victory-shader --locked` - `cargo clippy -p victory-shader --locked -- -D warnings` - `rustfmt --edition 2024 --check crates/victory-shader/src/bvh.rs crates/victory-shader/src/emit/intersect.rs` - `git diff --check` No in-game run was performed. This is a BVH traversal correctness fix; no frame-rate improvement is claimed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:38:56 +00:00
github-bot closed this pull request 2026-11-26 03:38:56 +00:00
Author
Owner

@⁠kaayzouee on GitHub · 2026-11-25 01:23 UTC · original

Duplicate of #213?

**@⁠kaayzouee** on GitHub · 2026-11-25 01:23 UTC · [original](https://github.com/fxceless/victory-fork/pull/230#issuecomment-7149491535) Duplicate of #213?

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.