Repository navigation
Conversation
|
Tested f102755 on Windows 11, CPython 3.14.7, CPU only (no GPU, no game files): pass. For 128 synthetic textures, the cache accounting test recorded 256 length requests on this head and 16,512 on merge base I also compared 1,600 lookups with a fixed random seed (5470). The input contained 18 synthetic DDS files and one missing path. I cleared the cache after each group of 400 lookups and tested budgets of 0, 320, 1,600, and 16,000 bytes. Both revisions returned the same PNG data and retained the same keys in the same order after each lookup. On this head the byte counter matched the sum of the resident PNG lengths after every lookup. I ran these files with AI-assisted. |
kacper-serewis
left a comment
There was a problem hiding this comment.
AI-assisted independent review. At f102755, all 44 synthetic operations across four budgets retained identical FIFO entries and return values on parent and head. The incremental count equaled the independently summed bytes after every operation. Two cached textured placements produced byte-identical world and GLB files; both revisions used default OPAQUE for their three textured primitives. This verifies cache parity but does not test #4960's BLEND/MASK behavior in combination.
kacper-serewis
left a comment
There was a problem hiding this comment.
AI-assisted CPU integration with #4960 at 3fb166c, clean tree eb377335. Against #4960 alone, world.json and all six GLBs were byte-identical at PNG budgets 0, 1 and 256 MiB. All 42 textured primitives resolved to embedded images matching the cached DDS pixels: 24 OPAQUE, 10 MASK (effective cutoff 0.5) and 8 BLEND. The test combined two cached placements and texture manifests, added four translated copies to force reuse, and varied only the budget in temporary source copies. Single-worker CLI.
|
At I ran that sequence at the default 256 MiB cache budget and again at 256 KiB to force FIFO eviction. Every GLB matched the parent byte for byte at both budgets (12,569,240 output bytes per sequence, 404 embedded material uses and four skips). After every chunk I also compared the retained keys in order and their PNG contents, and checked the new byte counter against the sum of resident PNG lengths. All matched. The default cache retained every key; at 256 KiB, 133 keys present at one chunk boundary were gone by the next, summed over the sequence. This checks output and cache behavior through the chunk writer using real decoder inputs. CPU only, CachyOS, AI-assisted (OpenAI Codex). |
Kam471
left a comment
There was a problem hiding this comment.
Head f102755f0358 · Verdict: LGTM
python -I -m pytest tests/test_world_png_cache.py -q → 5 passed, 2 subtests; existing tests/test_world_build.py → 59 passed, 124 subtests. git diff --check clean.
Accounting is now O(1) per insert/evict and resets from an externally cleared cache; FIFO order, oversized-entry retention, failed decodes and exact-budget behavior are pinned. No blockers.
What and why
BUILD-1739, claimed before implementation.
The instanced world builder sums every retained PNG's length after every new texture. While entries fit within the budget, adding N textures performs quadratic accounting work. Profiling 1,000 valid synthetic DDS files on unchanged main recorded 501,500 visits to that cache-sum generator.
Track resident PNG bytes on insertion and eviction. Cache keys, FIFO order, the strict over-budget comparison, negative caching, process lifetime and the exception that retains one oversized PNG are preserved. An explicitly cleared cache resets the total on its next miss. The separate threaded cache used by baked builds is unchanged.
Validation
Windows x64, Python 3.14.6, CPU only.
Integration
Based on upstream main
3faac557. Depends on: none.Fresh exact-head three-way checks of
tools/world_build.pywith #1981, #3938, #5108, #4261, #4433, #4960 and #5047 have no conflicts. Those PRs do not change this cache function; #4960 uses it from its existing caller. The earlier cache-key fixes #2283 and #2875 are already in main.All inputs are original synthetic fixtures. No game files or GPU work. AI-assisted: yes.