Skip to content

Stabilize XDXR inverses for extreme instance scales - #8155

Open
gautch29 wants to merge 1 commit into
ItsNotRexed:mainfrom
gautch29:codex/xdxr-instance-scale
Open

gautch29 wants to merge 1 commit into
ItsNotRexed:mainfrom
gautch29:codex/xdxr-instance-scale

Conversation

@gautch29

Copy link
Copy Markdown

Coordination claim

Depends on: #4011, #5092 (overlap in the builder and regenerated shader only). This branch applies independently to main.

What changed

An invertible TLAS instance matrix can have a determinant outside the float32 range. Mixed scales can also overflow or underflow an inverse cofactor while the determinant remains representable. The builder could drop the instance or store an incorrect inverse in these cases.

For extreme transforms, normalize each matrix row by a power of two before inverting and undo that scaling in the result. The ordinary inverse path is retained for normal-range transforms. Singular controls still produce inactive instances. Nearly dependent rows and widely varying components within a single row remain subject to float32 precision.

Verification

  • Apple M3 Pro, macOS 27.0, MoltenVK 1.4.2. Eight synthetic transform cases pass, covering ordinary and singular controls, out-of-range determinants, and mixed scales that lose cofactors on main.
  • The GPU builder and CPU reference agree on 30 synthetic cases and 26,200 rays. Both XDXR CTests passed.
  • The embedded shader regenerated byte-for-byte with glslc 2026.4 and passed spirv-val --target-env vulkan1.2.

Synthetic geometry only. AI-assisted (Codex).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant