mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:05:54 +01:00
[PR #735] [MERGED] OLD-9481: restore old upstream PR 9481 - world_build: drop a staged chunk PNG once no later chunk uses it #774
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#774
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/735
Author: @aslan2142
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:world-build-png-budget📝 Commits (1)
198b5c5world_build: drop a staged chunk PNG once no later chunk uses it (BUILD-WORLD-BAKED-PNG-BUDGET)📊 Changes
2 files changed (+195 additions, -26 deletions)
View changed files
📝
tests/test_world_build.py(+150 -0)📝
tools/world_build.py(+45 -26)📄 Description
Claimed in the coordination issue as: OLD-9481 https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7132371964
Restoration of my original pull request, old upstream PR 9481 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at9600cf0c64; the commit applies unchanged, sincetools/world_build.pyandtests/test_world_build.pyhave not changed on main since the original base.What and why
_build_staged_worldintools/world_build.py(the spatial, grid and baked-placement builds) keeps every decoded chunk PNG in its single-flight cache until the build returns. The PNGs held grow with the chunk count._SharedPng(an event plus the bytes);world.jsonare byte-identical.StagedPngRetentionTestintests/test_world_build.py, on synthetic chunks with uniform 4x4 DDS textures:Tested
Linux, Python 3.14.10, CPU only, synthetic inputs (no game files):
python -I tests/test_world_build.py:A synthetic 24-chunk build on main and on this branch:
Decoded PNGs held while each chunk is written (main → this branch):
The 4-worker counts depend on thread timing.
python -m compileall -q tools tests,git diff --check, andpython -I scripts/check_no_game_data.pyon both changed files: all clean.On the old repository, the original pull request had five independent checks: Linux, a four-worker concurrency run, and Windows on Python 3.11 and 3.13.
GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.