A backslash inside an inline comment ended the logical line and swallowed the next face. Split the comment before testing for a continuation; a backslash in the code before the comment still continues.
Squaring finite components could turn a valid normal into the fallback direction. Normalize with a stable length and rescale only when the length cannot preserve the direction.
On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").
tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--placements used to copy a model's geometry into every placement and keep
all copies until chunking (#1183 review: 22 GB for a 700 m box). Now each
model's OBJ is parsed once into a packed cache file, each chunk stores every
model it uses once, and the placements are instance transforms:
EXT_mesh_gpu_instancing by default (three.js GLTFLoader reads it), one plain
glTF node per placement with --instancing nodes, or the old baked copies
with --instancing bake. Chunks are written as soon as they are built; with
--jobs N, packing and chunk writing run in N processes, at most 4N jobs in
flight. Memory is about 100 bytes per placement plus the models of the
chunks being written.
Every instance TRS has a positive determinant. A negative XY scale is folded
into the rotation; a negative Z scale draws a mirrored copy of the mesh
(glTF Y negated, winding reversed). Zero-scale placements are counted as
degenerate_scale. iter_placements streams the rows load_placements selects,
with the same checks (load_placements is unchanged).
--lod-sets builds one chunk set per lodLevel tier (c_<tier>_<x>_<z>, with
the tier and grid cell in each chunk record) and writes lod_bands to
world.json: a camera-distance band per tier from the entities' median
childLodDist/lodDist. The viewer loads a tiered chunk while the horizontal
distance to its cell is in the band (32 m slack before unloading), so each
cell shows one tier; worlds without lod_bands stream as before, and the
manifest check rejects unknown tiers, unordered bands and missing cells.
glb_writer: pack_primitive and _MaterialTable are factored out of build_glb
(output unchanged), plus build_instanced_glb / write_instanced_glb and
instance_bounds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
read_glb_summary() took buffers[0]'s limit from the embedded BIN chunk even
when the buffer has a uri, so a legal external buffer with no BIN chunk made
every bufferView "exceed buffer 0 (... > 0)". An external buffer's limit is
now its declared byteLength (which must be a non-negative int); the BIN
chunk check applies only to an embedded buffer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
glb_writer._output_mode and rtti_scan._report_mode read the umask with
os.umask(0) then os.umask(mask). The umask is process-wide, so any thread
creating a file in that window got mask 0. A probe file created with mode
0666 gives the same bits (and honours a directory's default ACL) without
changing anything. Raised by kapitche on #750 and #728.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_output_mode reads the umask by setting it to 0 and back, and the umask is
process-wide. Two threads publishing new GLBs could interleave so that the
process stayed at umask 0 and one file got mode 0666. A module lock makes the
set-and-restore atomic for every writer here.
The staging file comes from NamedTemporaryFile, which creates it 0600, so
every GLB written since #425 has been owner-only on Linux. The staging file
now gets the replaced file's mode, or 0666 minus the umask for a new one,
before the replace. Same issue @VictorJulianiR found in rtti_scan (#750).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-ups to review points on two merged PRs.
#425 (@SourNuht): write_glb said overlapping writers all publish complete
files, but on Windows os.replace onto the same destination raises
PermissionError while another writer is replacing it. 8 threads x 40 writes
to one path failed 43-152 of 320 calls. A replace that hits PermissionError is
now retried with a short backoff (about 1.3 s in total), Windows only; a lasting
hold still raises and leaves the old file. Other errors are not retried.
#441 (@ToxicmaggotRP): the stage, binding and feature filters were never
reached by the tests (the rejected entries had no files, so they dropped out
earlier), and only dispatch-side instability was tested. Tests only; each of
those filters now fails a test when removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use a unique same-directory staging file and close it before atomic replacement. Preserve unrelated sibling .tmp files and clean only this writer's staging file on failure. AI-assisted (Codex).