Repository navigation
Conversation
SirKingg
left a comment
There was a problem hiding this comment.
Independent review at a574976; AI-assisted.
Native D3D11 Texture2D.Load on Windows, NVIDIA RTX 4070 Ti / driver 610.88: the synthetic signed mode-14 minimum and all 16 interpolation weights match CPU exactly in RGBA float32 bits, including -infinity. Three further synthetic blocks exercised signed wrap in both directions and unsigned wrap: 64 texels total, no skipped GPU cases. The only observed differences were 16 channel results of GPU +0 versus CPU -0 in two wrap cases. This is pre-existing at 561b65a, not caused by this change; reported separately at #6089 (comment).
An independent exhaustive comparison of all 65,536 signed 16-bit endpoints against the published Microsoft BC6H unquantize/finish formulas found the same sole pre-existing difference at -1; all others match. Reference: https://learn.microsoft.com/en-us/windows/win32/direct3d11/bc6h-format
Windows CPU synthetic suites: python -I tests\test_ttpf_mips.py 78 passed; python -I tests\test_bcpack.py 17 passed; python -I tests\test_bcpack_history_calib.py 19 passed; python -I tests\test_ttpf_assets.py 25 passed, 3 skipped (POSIX-only file modes, unbuilt rpf9dump, missing numpy). These CPU suites are not GPU tests. No game files used.
|
AI-assisted Windows CPU check at Each block also went through the stock DDS exporter using a synthetic zlib-backed texture pool. Compressed DDS output was byte-identical across revisions, and decoding those DDS payloads reproduced each revision’s direct half-word results. The stock mip check returned the same finite errors. The focused suite passed six with one exporter-dependent skip on head. Synthetic CPU fixtures only. |
|
Related to @SirKingg's finding (#6089 (comment)), since this PR rewrites the same function: at this head h = (abs(val) * 31) >> 5
return lut[h | 0x8000] if val < 0 and h else lut[h]A regression case: a synthetic signed mode-14 block whose interpolant is -1 should decode to |
|
I replayed the original endpoint finding in a scratch integration of #6120 I also repeated the independent MSVC/bcdec 我在临时组合 #6120 我还重跑了 MSVC 编译的独立 bcdec |
|
Verified the minimum endpoint and interpolation on an RTX 3080 Ti, CachyOS, NVIDIA 620.73.04. I uploaded the two synthetic mode-14 blocks as
I also tried a separate constant red endpoint of −1. Its GPU result was positive zero on all 32 texels tested; this PR’s CPU result was negative zero. That independently reproduces the distinct case tracked by #6175. Synthetic inputs only, AI-assisted. |
Claimed in coordination issue #6089. Thanks to the contributor who narrowed this down to one 16-byte block in the original report.
What changed
A signed BC6H mode-14 endpoint can be −32768. The CPU decoder clamped it before interpolation, then clamped the output to the largest finite half. This changed the raw texels at the endpoint and at nearby interpolation weights. The decoder now keeps the full signed endpoint and applies the format's final scale. The minimum yields the half-word 0xfc00 (negative infinity). Khronos Data Format §20.2 · Microsoft BC6H format notes
Verification
On an Apple M3 Pro with macOS 15.6.1 and Python 3.14.2, using the CPU and synthetic blocks:
AI-assisted. The checks used no game content, keys or GPU driver.
Signed-zero review follow-up
The review also identified the pre-existing zero-sign case for an interpolated value of −1. It is being corrected in #6175. The changes touch the same return statement. I combined them locally on a574976 by preserving the full mode-14 endpoint and applying the sign bit only when the scaled magnitude is nonzero. All 80 tests in the combined ttpf_mips suite passed, including both PRs’ regressions. After #6120 lands, #6175 will need that one-line reconciliation.