Review corrections (kacper-serewis, #3337):
- The (bytes, reason) cache is a TextureCache with its own lock: the pool
runs one model per thread, so two workers reaching the same broken DDS
both entered the decoder and the once-per-batch guarantee only held for
sequential primitives. The new two-model test releases a Barrier of 2
when a second thread gets in, so it fails on the unlocked shape.
- An empty PNG read returned (b'', ''): falsy, so not embedded, and with
no reason, so not reported either. It is now 'the PNG file is empty'
(and the same guard for a DDS decode that produced nothing).
- Two primitives of one model referencing the same broken DDS produced two
identical dropped lines and counted twice; dropped is deduplicated per
model by texture path.
_load_png_bytes swallowed every DDS decode error and returned None, so a
model was written without its texture yet counted in converted N/N with
exit 0, while a PNG that could not be read failed the whole model; a failed
decode was not cached either, so every primitive retried it. batch_convert
also discarded convert_single's error string, counting a failed model
without naming it or saying why.
_load_png_bytes now returns (bytes, reason) and both the PNG read and the
DDS decode take the same path: the texture is left out of that model,
listed per model with its reason, counted in the summary (cached, so a
broken DDS is decoded once) and the exit code stays 1 only when a model
failed -- the fssm_unpack tolerance, made visible. main prints one line
per failed model and per unembedded texture.
A dotted OBJ filename and a named material can select different PNGs even when the clean filename stem matches the material name. Keeping the original empty key prevents either texture from replacing the other.