dds_png: compress scanlines without staging the entire image #2249
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2249
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/dds-png-bounded-scanlines"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: DDS-PNG-BOUNDED-SCANLINES
What and why
Feed PNG filter bytes and RGBA rows to one zlib compressor incrementally. A 1024×1024 zero-filled synthetic texture on Windows reduced peak allocations measured by tracemalloc after source allocation from 4,579,376 to 384,418 bytes. Existing tests also decode and compare the image data.
Tested
Windows, Python 3.14.7. The regression failed on the parent commit and passed with this change.
python -I tests/test_dds_png.pypython -I tests/test_dds_subresources.pypython -I tests/test_dds_png_dx10.pygit diff --checkand the changed-path no-game-data scan passed.GPUs tested: N/A (synthetic CPU tests).
AI-assisted: Yes.
Checklist
Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.
tests/test_dds_png.py: 101 passed, 143 subtests passed (main: 100 passed).(AI-assisted test run; output checked by hand.)
Approving a9ec081f1.
Scanlines go to a streaming
zlibcompressor one by one with their filter byte, instead of being copied into a second image-sized buffer first; the decompressed data is the same, so the PNG is too.Merged onto
maind1dff7949in one batch with 22 other tool PRs of this series (no conflicts), on Linux with Python 3.13.tests/test_dds_png.py: 101 passed (main: 100). AI-assisted (Claude Code, Claude Opus 5.5).Red/green: tests/test_dds_png.py fails on main (4579376 bytes of scanline storage, not below 1048576) and passes with the PR merged, on GitHub Actions Linux and natively on Windows.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)