batch_glb: allow independent texture decodes to overlap #1752
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1752"
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-25T11:14:33Z.
Claimed in the coordination issue as: BATCH-GLB-PER-TEXTURE-DECODE
What and why
TextureCache held its single registry lock while reading PNGs and decoding DDS files. Workers handling unrelated textures had to wait for each other. Each path and requested size now has its own lock and result. Callers sharing a key reuse the decode, including an ordinary decode failure. If the loader raises an unexpected exception, the next request can retry.
Tested
A two-worker barrier timed out on the baseline and completed on the branch. A second regression verified retries and two decode sizes for one path. The existing test still verifies exactly one DDS decode when two workers request the same broken texture.
python -I tests/test_batch_glb.pypassed all 18 tests on this branch (Windows, Python 3.14.7).git diff --checkand the repository game-data scan of all changed paths passed.bcaa13dapassed 6,287 semantic tests across 488 files.GPUs tested: N/A (CPU-only asset tooling).
AI-assisted: Yes.
Checklist
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-25T11:20:00Z.
Review: COMMENTED
Independent check at "
417b78bb". Windows: all 18 batch tests passed. In a separate 12-worker probe, 18 simultaneous requests for three cache keys caused exactly three loader calls. Two different keys reached the loader concurrently. An ordinary decode failure was cached, two requested sizes got separate results, and an unexpected exception allowed a retry.AI-assisted review and CPU-only testing with synthetic inputs.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T11:38:21Z.
#1752 | head
417b78bb62(merged cleanly with main4a54aedcb) |python -I tests/test_batch_glb.py| red on main:FAILED (failures=1, errors=1)(BrokenBarrierErrorunder single-lockTextureCacheand cached decode ignoringmax_size) | green on PR+main:18 tests OK| Windows 11, Python 3.12.10 | AI-assisted: yesAudited
_TextureEntryandTextureCache.get_or_loadintools/batch_glb.py(keying cache entries by(path, max_size)with per-entry locking so distinct texture decodes overlap across worker threads, concurrent loads of the same key deduplicate, and unhandled exceptions leaveentry.resultunset for retry). Also verified clean merges (0conflicts) and combined execution with both #1750 (20 tests OK) and #1751 (19 tests OK), plustests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-28T23:38:28Z.
Tested
417b78bb6merged (no commit) withmainaa918e5d9: Python 3.12.4, Windows 11 10.0.26300, CPU only.check_no_game_data.pyis clean.tests/test_batch_glb.py, 19 tests pass.tools/batch_glb.pyback tomain, 1 failure and 1 error ((b'full', '') != (b'small', '')).git merge-tree). I did not run the two together.No blocker from my side.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T23:50:30Z.
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
mainff9948f65without conflict, and its test file(s) (tests/test_batch_glb.py) pass there. Earlier today the same tests failed onmainwithout the PR (red/green) and a bundle with other open PRs showed no new failures.check_no_game_data.pyis clean. Windows 11, Python 3.14; no GPU needed for these tests.AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.