sandbox_scene: downsample sRGB albedo in linear light #2443
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2443"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-27T10:16:58Z.
Claimed in the coordination issue as: SANDBOX-SCENE-SRGB-ALBEDO
What and why
The scene packer discarded the DDS color-space tag before filtering albedo. Allow the existing RGBA decoder to take a size limit and pass the decoded color space to the existing filter. A two-by-two black-and-white synthetic texture now averages to 188 for sRGB and 128 for linear UNORM. Both variants are checked against packed scene bytes.
Tested
Windows, Python 3.14.7, synthetic fixtures.
python -I tests/test_sandbox_scene.pypython -I tests/test_dds_png.pypython -I tests/test_dds_png_dx10.pygit diff --checkpassed.GPUs tested: N/A (CPU-only).
AI-assisted: Yes.
Checklist
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T07:35:40Z.
#2443 | head
cb82451594(merged cleanly with main09c153948) |python -I tests/test_sandbox_scene.py| red on main:FAILED (failures=1)(test_texture_filter_honors_dds_color_spaceonfmt=29sRGB produced0x80instead of0xbc) | green on PR+main:13 tests OK(-k test_texture_filter_honors_dds_color_space:1 test OK) | Windows 11, Python 3.12.10 | AI-assisted: yesAudited
decode_dds(..., max_size=...)intools/dds_png.pyandtexture_bytesintools/sandbox_scene.py(forwardingsrgbfrom_decode_ddsintodownscale_rgba), and verified bothPR + main(09c153948) and combined sibling mergesmain + #2443 + #2442andmain + #2444 + #2443 + #2442(0conflicts;14 tests OKintests/test_sandbox_scene.py,9 tests OKintests/test_sandbox_scene_build.py). Also passedtests/test_dds_png.py(100 OK),tests/test_text_write_line_endings.py(3 OK),tests/test_runner_calls_all_tests.py(3 OK), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T14:36:49Z.
Review: COMMENTED
Static code audit against
cb8245159+ec740bcc3. I reproduced the baseline sRGB failure and confirmed that the patch packs 188 for sRGB and 128 for UNORM.MINOR (
tools/dds_png.py:1499,tools/sandbox_scene.py:70) Moving resize intodecode_ddsretains the entire input DDS while filtering. A synthetic 1024×1024 RGBA8 mip chain resized to 256×256 raised Python's peak traced allocation from 9.34 MiB to 11.34 MiB for both tags. Releasingdataafter decode and before resize restored the baseline peak in the same check.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T15:12:34Z.
Red/green: classified READY by oreo-lot3 (red on main
b1619e0a3, green on head merged with main); headcb82451594unchanged since 2026-11-27, before that run.Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main
d48a957bbin GitHub Actions: no new failure.AI-assisted (Claude Code, Claude Opus 5.5)