docs(textures_arrays): document tools/dds_png.py preview conversions and limits #2423

Merged
leonida/mandy
Andretuta merged 1 commit from docs/textures-arrays-dds-preview into main 2026-11-28 18:28:47 +00:00

Pull request successfully merged and closed

Andretuta commented 2026-11-27 03:17:21 +00:00

Claimed in the coordination issue as: DOC-TEXTURES-ARRAYS-DDS-PREVIEW (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7208856827)

What and why

  • Add a concise Preview conversions and limits (tools/dds_png.py) subsection to docs/textures_arrays.md covering RGB9E5, float formats, SNORM, UINT/SINT, R10G10B10A2, premultiplied alpha/sRGB handling, and BC6H / HDR clamping limits, verified directly against tools/dds_png.py.

Tested

  • Verified directly against tools/dds_png.py.
  • All tests/test_docs_*.py + tests/test_text_write_line_endings.py: OK.
  • python -I scripts/check_no_game_data.py docs/textures_arrays.md: exit 0.

GPUs tested: n/a

AI-assisted: yes (Antigravity gemini-4-neon)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a — not a translator rule)
Claimed in the coordination issue as: DOC-TEXTURES-ARRAYS-DDS-PREVIEW (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7208856827) ### What and why - Add a concise *Preview conversions and limits (`tools/dds_png.py`)* subsection to `docs/textures_arrays.md` covering `RGB9E5`, float formats, `SNORM`, `UINT`/`SINT`, `R10G10B10A2`, premultiplied alpha/sRGB handling, and `BC6H` / HDR clamping limits, verified directly against `tools/dds_png.py`. ### Tested - Verified directly against `tools/dds_png.py`. - All `tests/test_docs_*.py` + `tests/test_text_write_line_endings.py`: OK. - `python -I scripts/check_no_game_data.py docs/textures_arrays.md`: exit 0. GPUs tested: n/a AI-assisted: yes (Antigravity gemini-4-neon) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. *(n/a — not a translator rule)*
tiguan26 approved these changes 2026-11-27 06:02:03 +00:00
tiguan26 left a comment

Approving. Merged onto current main together with the other doc PRs of this batch: no conflicts, and the doc validators (tests/ -k doc: 95 passed, 207 subtests) pass. Spot-checked against tools/dds_png.py on main: its header says BC6H is not supported (so the Limits line is right today; #2248 would change that, so whichever merges second should update this section), and the shared-exponent formula mantissa * 2^(exponent - 24) is the standard 2^(e-15-9). The SNORM -128/-127 note matches D3D's rule.

Approving. Merged onto current main together with the other doc PRs of this batch: no conflicts, and the doc validators (`tests/` -k doc: 95 passed, 207 subtests) pass. Spot-checked against `tools/dds_png.py` on main: its header says BC6H is not supported (so the Limits line is right today; #2248 would change that, so whichever merges second should update this section), and the shared-exponent formula `mantissa * 2^(exponent - 24)` is the standard 2^(e-15-9). The SNORM -128/-127 note matches D3D's rule.
zmasi commented 2026-11-28 12:02:33 +00:00

VERIFY-2423 — verified head 3be4d9cdc6 merged cleanly with main 030d2039e on Windows 11 Pro (build 26200), synthetic DDS fixtures only.

Red (main 030d2039e) -> Green (030d2039e + 3be4d9cdc6)

  • Red on main:
    • docs/textures_arrays.md lacked ### Preview conversions and limits (\tools/dds_png.py`), while live tools/dds_png.py exercises those exact preview rules (R9G9B9E5_SHAREDEXPDXGI 67mantissa * 2^(exponent - 24)linear clamp, float+inf -> 255and-inf/ negative /NaN -> 0, R8_SNORM -128/-127 -> 0andR16G16B16A16_SNORM -32768/-32767 -> 0, R8_SINT +128bias,BC7reserved mode byte0transparent black, andBC6HDXGI 94..96 raisingDdsError`).
  • Green on merged PR:
    • Programmatic docs/textures_arrays.md + tools/dds_png.py synthetic DDS probe across all documented conversion cases -> OK.
    • python -I tests/test_dds_png.py, tests/test_docs_links.py, tests/test_docs_encoding.py, and tests/test_text_write_line_endings.py -> all OK.

AI-assisted.

`VERIFY-2423` — verified head `3be4d9cdc6` merged cleanly with `main` `030d2039e` on Windows 11 Pro (build 26200), synthetic DDS fixtures only. ### Red (`main` `030d2039e`) -> Green (`030d2039e` + `3be4d9cdc6`) - **Red on `main`**: - `docs/textures_arrays.md` lacked `### Preview conversions and limits (\`tools/dds_png.py\`)`, while live `tools/dds_png.py` exercises those exact preview rules (`R9G9B9E5_SHAREDEXP` DXGI 67 `mantissa * 2^(exponent - 24)` linear clamp, float `+inf -> 255` and `-inf` / negative / `NaN -> 0`, `R8_SNORM` `-128`/`-127 -> 0` and `R16G16B16A16_SNORM` `-32768`/`-32767 -> 0`, `R8_SINT` `+128` bias, `BC7` reserved mode byte `0` transparent black, and `BC6H` DXGI 94..96 raising `DdsError`). - **Green on merged PR**: - Programmatic `docs/textures_arrays.md` + `tools/dds_png.py` synthetic DDS probe across all documented conversion cases -> **OK**. - `python -I tests/test_dds_png.py`, `tests/test_docs_links.py`, `tests/test_docs_encoding.py`, and `tests/test_text_write_line_endings.py` -> **all OK**. AI-assisted.
MoonEyes commented 2026-11-28 18:28:44 +00:00

Red/green: Docs only: Documents tools/dds_png.py preview conversions and limits in docs/textures_arrays.md, matching the decoder on main.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. Docs checked by a separate reviewer against the code on main.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: Docs only: Documents tools/dds_png.py preview conversions and limits in docs/textures_arrays.md, matching the decoder on main. Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. Docs checked by a separate reviewer against the code on main. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.