batch_glb: allow independent texture decodes to overlap #1752

Open
github-bot wants to merge 1 commit from github-bot/gh-1752 into main AGit
Owner

@⁠kirigayakazima on GitHub · 2026-11-25 11:14 UTC · original
kirigayakazima:codex/batch-glb-per-texture-decode → main · +44 −4 · 2 files · 1 commits · open

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.py passed all 18 tests on this branch (Windows, Python 3.14.7).
  • git diff --check and the repository game-data scan of all changed paths passed.
  • The five independent changes were also merged locally. Both affected test files passed together (50 tests) and the three character-model consumer suites passed (28 tests). The shared base at bcaa13da passed 6,287 semantic tests across 488 files.

GPUs tested: N/A (CPU-only asset tooling).
AI-assisted: Yes.

Checklist

  • Based on current upstream main.
  • One topic.
  • Only synthetic test fixtures. No game data, keys or decryption.
  • Translator contract table: N/A.
**@⁠kirigayakazima** on GitHub · 2026-11-25 11:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1752) `kirigayakazima:codex/batch-glb-per-texture-decode` → `main` · +44 −4 · 2 files · 1 commits · open Claimed in the coordination issue as: [BATCH-GLB-PER-TEXTURE-DECODE](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### 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.py` passed all 18 tests on this branch (Windows, Python 3.14.7). - `git diff --check` and the repository game-data scan of all changed paths passed. - The five independent changes were also merged locally. Both affected test files passed together (50 tests) and the three character-model consumer suites passed (28 tests). The shared base at `bcaa13da` passed 6,287 semantic tests across 488 files. GPUs tested: N/A (CPU-only asset tooling). AI-assisted: Yes. ### Checklist - [x] Based on current upstream main. - [x] One topic. - [x] Only synthetic test fixtures. No game data, keys or decryption. - Translator contract table: N/A.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:03:42 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-25 11:20 UTC · original · reviewed

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.

**@⁠lixonik** on GitHub · 2026-11-25 11:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1752#pullrequestreview-6056672863) · **reviewed** 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1752/head:github-bot/gh-1752'
git switch 'github-bot/gh-1752'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1752'
git switch 'github-bot/gh-1752'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1752'
git switch 'github-bot/gh-1752'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1752'
git switch 'main'
git merge --squash 'github-bot/gh-1752'
git switch 'main'
git merge --ff-only 'github-bot/gh-1752'
git switch 'main'
git merge 'github-bot/gh-1752'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.