dds_png: preview signed and unsigned BC6H textures #2248

Merged
leonida/mandy
kirigayakazima merged 1 commit from codex/dds-png-bc6h-preview into main 2026-11-28 23:48:31 +00:00

Pull request successfully merged and closed

kirigayakazima commented 2026-11-26 10:23:51 +00:00

Claimed in the coordination issue as: DDS-PNG-BC6H-PREVIEW

Depends on: #140 (overlapping changes in the existing BC7 decoder). #2247 (adjacent format-dispatch cases; keep both handlers when merging). Each branch builds directly on main. These references flag textual merge conflicts.

What and why

Decode signed and unsigned BC6H subresources using the repository’s BC6H block decoder. Reuse the BC7 block traversal and cache, clip blocks at texture edges and map linear RGB to the eight-bit preview range. The synthetic fixtures cover both signedness variants and an incomplete block.

Tested

Windows, Python 3.14.7. The regression failed on the parent commit and passed with this change.

  • python -I tests/test_dds_subresources.py
  • python -I tests/test_dds_png.py
  • python -I tests/test_ttpf_mips.py
  • git diff --check and the changed-path no-game-data scan passed.
  • Shared main baseline: 498 semantic test files, 6,351 tests passed.

GPUs tested: N/A (synthetic CPU tests).

AI-assisted: Yes.

Checklist

  • Based on current main and merges cleanly with the tested base.
  • One topic.
  • No game data, keys or decryption.
  • Translator contract table: N/A.
Claimed in the coordination issue as: [DDS-PNG-BC6H-PREVIEW](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7189018014) Depends on: #140 (overlapping changes in the existing BC7 decoder). #2247 (adjacent format-dispatch cases; keep both handlers when merging). Each branch builds directly on main. These references flag textual merge conflicts. ### What and why Decode signed and unsigned BC6H subresources using the repository’s BC6H block decoder. Reuse the BC7 block traversal and cache, clip blocks at texture edges and map linear RGB to the eight-bit preview range. The synthetic fixtures cover both signedness variants and an incomplete block. ### Tested Windows, Python 3.14.7. The regression failed on the parent commit and passed with this change. - `python -I tests/test_dds_subresources.py` - `python -I tests/test_dds_png.py` - `python -I tests/test_ttpf_mips.py` - `git diff --check` and the changed-path no-game-data scan passed. - Shared main baseline: 498 semantic test files, 6,351 tests passed. GPUs tested: N/A (synthetic CPU tests). AI-assisted: Yes. ### Checklist - [x] Based on current main and merges cleanly with the tested base. - [x] One topic. - [x] No game data, keys or decryption. - Translator contract table: N/A.
DeadlyChirp commented 2026-11-26 10:42:36 +00:00

Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.

  • tests/test_dds_png.py + tests/test_dds_subresources.py: 114 passed, 173 subtests passed (main: 113 passed, 172 subtests).

(AI-assisted test run; output checked by hand.)

Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main. - `tests/test_dds_png.py` + `tests/test_dds_subresources.py`: 114 passed, 173 subtests passed (main: 113 passed, 172 subtests). (AI-assisted test run; output checked by hand.)
lixonik reviewed 2026-11-26 11:08:20 +00:00
lixonik left a comment
No description provided.
Windows 11: 100 DDS/PNG tests and 14 subresource tests passed. I also ran the isolated CLI on authored BC6H UF16 and SF16 blocks, verified metadata plus the exact 4×4 PNG pixels, and checked rejection of typeless BC6H. No findings from these checks. AI-assisted.
lixonik reviewed 2026-11-27 15:50:29 +00:00
lixonik left a comment
No description provided.
Re-verified after rebase at `7811fd88c` (merged cleanly onto `main` `ec91d695c`). - Windows 11, Python 3.12: `python -I -B tests/test_dds_png.py -v` (100/100) and `python -I -B tests/test_dds_subresources.py -v` (14/14, including signed/unsigned BC6H clamping, edge clipping, and truncation) passed; `scripts/check_no_game_data.py` and `git diff --check` clean. - Confirmed `decode_bc6h_block()` in `tools/ttpf_mips.py` produces finite IEEE 754 half-float values (clamped to `0x7BFF`), so the `[0, 1]` preview clamp in `_decode_bptc()` cannot fail on `NaN`/`inf`. - No findings. AI-assisted.
TheGeogeo commented 2026-11-28 23:38:12 +00:00

Tested 7811fd88c merged (no commit) with main aa918e5d9: Python 3.12.4, Windows 11 10.0.26300, CPU only. check_no_game_data.py is clean.

  • Green: test_dds_png.py (102 tests) and test_dds_subresources.py (14 tests) pass.
  • Red: with tools/dds_png.py back to main, test_dds_subresources.py errors twice (Unsupported DXGI format: 96, BC6H signed).

No blocker from my side.

AI-assisted (Claude Code).

Tested `7811fd88c` merged (no commit) with `main` `aa918e5d9`: Python 3.12.4, Windows 11 10.0.26300, CPU only. `check_no_game_data.py` is clean. - Green: `test_dds_png.py` (102 tests) and `test_dds_subresources.py` (14 tests) pass. - Red: with `tools/dds_png.py` back to `main`, `test_dds_subresources.py` errors twice (`Unsupported DXGI format: 96`, BC6H signed). No blocker from my side. AI-assisted (Claude Code).
MoonEyes commented 2026-11-28 23:48:34 +00:00

Merged after TheGeogeo's red/green check (check) (Windows, Python tests, no GPU needed) and a local re-check here. Merged after local re-verification: this PR merged onto main ace0e9d1c without conflict, and its test file(s) (tests/test_dds_png.py, tests/test_dds_subresources.py) pass there. Earlier today the same tests failed on main without the PR (red/green) and a bundle with other open PRs showed no new failures. check_no_game_data.py is clean. Windows 11, Python 3.14; no GPU needed for these tests.

AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.

Merged after **TheGeogeo**'s red/green check ([check](https://github.com/ProjectLeonida/mandy/pull/2248#issuecomment-7247562866)) (Windows, Python tests, no GPU needed) and a local re-check here. Merged after local re-verification: this PR merged onto `main` ace0e9d1c without conflict, and its test file(s) (`tests/test_dds_png.py`, `tests/test_dds_subresources.py`) pass there. Earlier today the same tests failed on `main` without the PR (red/green) and a bundle with other open PRs showed no new failures. `check_no_game_data.py` is clean. Windows 11, Python 3.14; no GPU needed for these tests. _AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes._
Sign in to join this conversation.
No description provided.