GPU BVH: preserve small invertible instance transforms (#1488) #1688
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1688
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1688"
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?
@Adika713 on GitHub · 2026-11-24 19:18 UTC · original
Adika713:fix/bvh-inverse-finite-range→main· +23 −0 · 1 files · 1 commits · draftPart of #1488.
The absolute determinant cutoff in PR #1633 rejects some finite, invertible instance transforms: its own 1e-11 × 1e-10 × 1e-10 test has determinant 1e-31 but a finite f32 inverse. This change rejects only zero/non-finite determinants, then checks the serialized f32 inverse for non-finite values before returning it.
What is in it
crates/xcl/src/gpu/bvh.rs: replace the scale-dependent determinant threshold with zero/non-finite detection plus a finite-output check.world_to_object_keeps_small_invertible_transforms, covering the 1e-31 determinant case and a finite-precision overflow fallback.Tested
cargo build --workspace --locked: passed; two existingAtomic::fetch_updatedeprecation warnings.cargo test -p xcl --lib gpu::bvh::tests::world_to_object_keeps_small_invertible_transforms -- --exact --test-threads=1: 1 passed, 0 failed, 0 ignored.cargo test -p xcl --lib gpu::bvh::tests:: -- --test-threads=4: 8 passed, 0 failed, 0 ignored.git diff --check: clean.Not tested
AI use
@upipibi on GitHub · 2026-11-24 22:50 UTC · original
NVIDIA run: RTX 3070 8 GB, driver 616.56, Windows 11, debug,
0f45226merged ontomain689f2db(clean). Tests matchingbvh, includingworld_to_object_keeps_small_invertible_transformsand the GPU BVH tests: 12 passed, 0 failed.AI-assisted (Claude Code). Synthetic tests only.
@throny on GitHub · 2026-11-25 00:15 UTC · original
Two contributors checked independently and found that #1521 #1633 solves the same problem (for #1488) in a different way: #1607, group D52. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@Adika713 on GitHub · 2026-11-25 00:28 UTC · original
@throny
Thanks for the D52 hint and for the independent RTX 3070 run.
I checked the current diffs of the other D52 PRs. #1521 (head
172041475f0518b778603ed1d1b980514881eb96) now guardsworld_to_objectwithif !det.is_finite() || det == 0.0plus a finite-output check, and its testinverse_preserves_small_scales_and_rejects_unrepresentable_resultscovers the same small-scale and overflow cases as this PR. That is functionally the same runtime fix as #1688, so #1688 no longer adds a separate runtime change relative to #1521.The remaining distinction is #1633: its
world_to_objectandbuild_topstill usedet.abs() <= 1e-30 || !det.is_finite(). That absolute cutoff rejects finite, invertible transforms; #1633's owntinymatrix1e-11 x 1e-10 x 1e-10has determinant1e-31, below the cutoff, even though the serialized f32 inverse is representable. This PR's rationale is to validate the inverse instead of applying a scale-dependent cutoff.Suggestion for the maintainers: consolidate on one implementation rather than three overlapping ones. #1521 already covers the runtime path; #1633 additionally sanitizes singular instances in
build_top. If #1521 is chosen, #1688 can be closed as superseded, and the cutoff counterexample above can be used to update #1521/#1633's tests. I am not changing any PR state myself.Note: #1688's PR-description check is still failing because the required paired retail-title smoke blocks were not run on its head. If this PR is kept rather than consolidated, I will add a real pair before asking for review.
AI use: OpenCode with Big Pickle (opencode/big-pickle) prepared this draft from
gh pr diffreads of #1521 and #1633 and the full #1688 thread; no comment was posted.@throny on GitHub · 2026-11-25 00:29 UTC · original
@Adika713 thanks for the comparison. One correction: the RTX 3070 run isn't mine; the D52 hint came from the #1607 script. Your reading of the three diffs counts as a check of D52 if you post it in #1607 as an
xcl-checkblock with the heads you read, for example"verdict": "suggest 1521; same change as 1688"if that's your finding. #1633 can stay out of that verdict, since a verdict may name only part of a group. That's how it reaches the maintainers' table.AI use: Claude Code (Claude Opus 5.5).
@Toons29 on GitHub · 2026-11-25 03:35 UTC · original
Regression run of
0f452264on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 101 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.github-bot referenced this pull request2026-11-26 06:18:30 +00:00
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.