Repository navigation
Conversation
…on real BVH nodes A differential tool. It samples nodes and realistic rays from runtime XDXR structures (for the game's BLASes, the output of tools/bvh_rehydrate.py, read from the user's work folder). It packs them into tools/hw_oracle kernels with tools/bvh_tri_probe.py's layout and checks (PR ItsNotRexed#4202), with the box child ids replaced by ids inside the oracle buffer and types 0, 1, 4 and 5 only. It runs any checkout's translator on the same words, and prints mismatch counts by class, with exact-arithmetic margins telling rule from rounding. It also carries the arithmetic the RX 6800 matched: every float op rounded toward zero. The test uses synthetic structures and nine invented rows measured on the RX 6800. docs/bvh.md §7c holds the counts from 39 rehydrated console BLASes: 2,289 steps. Boxes match RTZ slab arithmetic 849/849. Triangle words 1-3 match the RTZ model in 1,440/1,440 and every word in 1,400. No game data; no translator change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/test_text_encoding.py and tests/test_text_write_line_endings.py failed on five opens without encoding= and two writes without newline=. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Correction: when I opened this, |
|
Request changes: The five offending opens are Everything else checked is fine: Also: Unverified here: the §7c/ AI-assisted review, no game data, no GPU. |
…n strings Review by @tupacfan04 on ItsNotRexed#4945. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Thanks @tupacfan04. All four addressed at b9eaa12: the five opens pin |
|
Tested b9eaa12 on CachyOS Linux (Python tooling only, no GPU used): pass.
The RX 6800 measurements are not reproduced here. AI-assisted. |
|
Independent check of Environment: Windows 11, CPython 3.15.2, no game files.
No negative control possible — Note for the coordinator: this PR's commit also touches AI-assisted (Devin). |
|
Tested
|
|
For §7b, a related data point (details in #4202 (comment)):
§7b says "the 32- and 64-bit forms agree on all triangle cases" on the RX 6800. That does not hold on this iGPU, so a run of RDNA4 (RX 9070 XT, AI-assisted (Claude Code). |
|
@shelbykb2 I'd like to repeat the real-node run on the What I tried, counts only:
I didn't pass AI-assisted (Claude Code). |
Claimed in #4683 (comment).
What and why
The first comparison of the native
image_bvh_intersect_rayinstruction with the translator on the game's own nodes, and the first with inputs that are not exact binary fractions. Result: the RX 6800 rounds every float operation of this instruction toward zero; the translator rounds to nearest. With that one change a model reproduces every box result and every triangle result except 40 exact edge ties.tools/bvh_hw_diff.pysamples nodes and realistic rays from rehydrated structures, runs the translator on them and scores results;tests/test_bvh_hw_diff.pyuses synthetic structures and 9 measured rows with invented coordinates. No translator change here and no game data: counts only.Measurement
AMD Radeon RX 6800 (gfx1030), AMD driver 26.11.2, Windows 11,
tools/hw_oracle. 39 console BLASes rehydrated withtools/bvh_rehydrate.py; one traversal step per case, default descriptor, node types 0, 1, 4, 5. 118 dispatches, 2,289 cases, 236 controls (all bit-exact); 32- and 64-bit forms agree on all triangle cases. Each kernel differs from one that had already run only in data constants; box child ids are replaced by in-buffer ids, so the hardware's handling of real child ids is not tested.Node types reachable from the 39 roots: BOX32 81,290; BOX16 3,346 (every root); TRI0 219,960 (every leaf); TRI1-3, instance and AABB nodes never occur as a pointer. 85.7% of leaves hold a second triangle, in the TRI1 slots.
mainmain+ #4202 + #4750What it means for the translator
Matching the hardware bit for bit needs toward-zero rounding in the box slab and the whole triangle step (SPIR-V
RoundingModeRTZor an emulation). #3567's author measured the same on an RX 6900 XT. That change is not in this PR.Tested (ebd27d1 on
3faac557)python -I tools/bvh_hw_diff.py --self-testandtests/test_bvh_hw_diff.py,tests/test_docs_*.py,test_ci_registration.py,test_text_encoding.py: pass.tools/bvh_tri_probe.pyfrom rdna2spirv: BVH triangle words as measured on RDNA2: raw scaled numerators, hardware tie rule, invalid rays #4202; sampling, translating and scoring work onmainalone.Limits
gfx1030 only. The toward-zero model was fitted after the runs and then confirmed on 42 synthetic rows. Default descriptor (the game sets big_page; a separate measurement is in progress). 5 BOX16 nodes with a bound of exactly 0.0 were re-drawn by a safety check, so that case is under-sampled. Node types 6/7 not run.
AI-assisted (Claude Code; an Opus worker ran the measurement, I reviewed the kernels' safety gate and re-ran the tests).
🤖 Generated with Claude Code