Commit Graph

63 Commits

Author SHA1 Message Date
9df9fbfee4 Merge pull request #3923 from Maxime Mansiet
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:09:35 -05:00
04975128eb Merge pull request #3907 from Oleg Makarov
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:09:28 -05:00
9def8c5c3c Merge pull request #3199 from Tayar
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:06:59 -05:00
f487e2a9d1 studio: dispose the previous model's geometry, materials and textures
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
2026-11-22 23:26:17 +01:00
c6ad43620a studio: show only the latest model a click asked for
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
2026-11-22 23:23:55 +01:00
2baf85b035 Viewer: time out stalled startup manifests (TEST-858) 2026-11-23 01:23:21 +03:00
e616e64480 studio: render model and texture names as text, not HTML
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
2026-11-22 23:22:39 +01:00
e823aa1ffc Keep browser shortcuts from triggering viewer actions 2026-11-22 19:16:10 -03:00
1c4c6474e5 Merge pull request #3795 from Oleg Makarov 2026-11-22 17:03:51 -05:00
0763843dac Merge pull request #3502 from shdann 2026-11-22 17:02:22 -05:00
ca79926396 Merge pull request #3395 from kotorvr 2026-11-22 17:01:51 -05:00
918acc3271 Merge pull request #3365 from shdann 2026-11-22 17:01:42 -05:00
40ccbab001 Viewer: time out stalled chunk downloads (BUILD-1074) 2026-11-23 00:36:18 +03:00
f0bdc5789b viewer: a second viewer on a port a running one serves is refused on Windows too
HTTPServer sets SO_REUSEADDR. On Windows that lets a second socket bind a
port that is already being listened on, so a second `serve.py --port N`
printed its URL and then received no requests while the first viewer kept
answering. ViewerServer leaves the option off on Windows, where a restart
needs none, and keeps it elsewhere; the second viewer now stops with the
existing "can't listen on port" line.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 23:43:11 +03:00
a45ec655f6 viewer: serve only the page outside /world/
serve.py put its device-name, alternate-data-stream and trailing-dot
guards in front of /world/ only; every other path went straight to
SimpleHTTPRequestHandler. On Windows GET /NUL opened the device (200,
empty) and /index.html::$DATA, /index.html. and /index.html%20 were
served. The viewer folder holds one page, so outside /world/ the server
now answers "/" and "/index.html" and nothing else (404), matched
before any decoding. Without --world, /world/ is 404 as well instead of
falling through to a world folder that happens to sit beside the page.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 20:21:49 +00:00
e16aa5fd32 Merge pull request #3314 from Shrey Ratna 2026-11-22 15:16:53 -05:00
d79b94edad Merge pull request #3205 from wxrrry 2026-11-22 15:15:41 -05:00
698d270ef2 viewer: the right Ctrl key slows the camera too
The help line says "Shift fast · Ctrl slow", and the speed factor tests
both Shift keys but only ControlLeft, so holding the right Ctrl key moved
at full speed.

The test runs the viewer's own main loop for one synthetic frame per key
and compares how far E climbs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 23:15:10 +03:00
670d84b904 Merge pull request #3140 from Max Hurst 2026-11-22 15:15:04 -05:00
39c984fe4a Merge pull request #3118 from airp1ane 2026-11-22 15:14:56 -05:00
5f5efae004 Merge pull request #2457 from Vonsek 2026-11-22 15:10:48 -05:00
07087692bf viewer: a Ctrl+C right after the serving line stops the viewer too
serve.py printed "viewer: http://..." before entering the try that catches KeyboardInterrupt.
test_ctrl_c_stops_the_viewer_without_a_traceback sends SIGINT as soon as it reads that line, and
when the signal was handled between the print and the try, the interrupt escaped: exit -2 and a
traceback. Under load that is 24 of 300 runs with 12 at once (300 of 300 clean with the print inside
the try); a parallel pytest run on main failed the test this way.

The print is inside the try now, and a new in-process test raises the interrupt from printing that
line, so the case is checked every time instead of by chance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:01:53 +00:00
1f56528d30 tools: add standalone local 3D asset studio and texture gallery 2026-11-22 22:40:33 +03:00
6f06dfd46a Enable viewer drag-to-look on pointer lock error events 2026-11-22 19:29:57 +00:00
6ac2d12a42 Viewer: reject malformed LOD tier names 2026-11-22 14:26:50 -05:00
57400b83fa Merge pull request #2704 from Vonsek 2026-11-22 13:17:12 -05:00
f6d884b42c Merge pull request #2555 from Kosmabb8 2026-11-22 13:16:08 -05:00
6acd829c89 Merge pull request #2449 from tikD1337 2026-11-22 13:15:24 -05:00
c4bee344ef Merge pull request #2399 from AAyberkU 2026-11-22 13:14:44 -05:00
722c4fd97c merge: preserve upstream changes alongside the asset fix 2026-11-22 19:08:58 +01:00
dd3a843435 fix(viewer): match normals across generated terrain borders
Neighboring tiles share heights, but their normals came from disjoint triangle neighborhoods and produced a lighting seam.
2026-11-22 18:56:36 +01:00
c9679c00f0 viewer: reject Windows device aliases on Python 3.12 2026-11-22 18:27:32 +01:00
eef47a90d4 fix(viewer): keep orphan HD outside LOD handoffs
Standalone high-detail chunks have their own band and can share a cell with the normal detail chain.
2026-11-22 18:12:49 +01:00
ec670d350b fix(viewer): keep a cached LOD visible during tier loading
Crossing a draw-band boundary hid the existing tier while its replacement was still downloading or parsing, leaving an empty cell.
2026-11-22 18:06:20 +01:00
8c56529973 fix(viewer): reject duplicate Host headers and malformed Host values (BUILD-532)
send_head checked self.headers.get("Host"), which returns only the first
Host field, so "Host: 127.0.0.1" followed by "Host: evil.example" was
served. Requests with more than one Host field now get 400 (RFC 7230
section 5.4); a single field is checked as before, and a request without
one is still allowed for local tools.

host_allowed now rejects malformed values it used to accept: text after
an IPv6 literal's "]" other than ":port" ("[::1]junk"), a second colon,
more than one trailing dot, and ports that are not 1-5 ASCII digits up
to 65535 ("localhost:abc", "localhost:65536", full-width digits). The
length cap runs before int(), so a port of thousands of digits cannot
hit Python's int conversion limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:04:49 +01:00
a1343528f7 scripts, viewer: a redirected stdout no longer dies on a path outside the code page
Under `python -I` on Windows a redirected stdout is strict ANSI, so printing a path with a character outside the
code page raised UnicodeEncodeError. tools/ guards against it at the start of every __main__ block and
tests/test_tool_stdout_encoding.py enforces that, but only for tools/. viewer/serve.py died before it started
serving and scripts/audit_shader4_regs.py exited 1 after writing its report; bench_wave64.py and run_gpu_tests.py
print the same kind of output unguarded. All four get the guard, and the check now covers scripts/ and viewer/.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ABh36DZ2sZNq3ChN6EZJs
2026-11-22 19:55:36 +03:00
d18f8f65d8 Merge pull request #2156 from TripleA 2026-11-22 11:42:20 -05:00
0fcbbf3cbb fix(viewer): stop drag-to-look when the primary button is released 2026-11-22 17:07:57 +01:00
eee69f2bc4 Viewer: share the camera position through the URL hash (P key) 2026-11-22 16:57:00 +01:00
08f1822374 Viewer: show WebGL startup failures in the overlay 2026-11-22 15:26:47 +01:00
48002bd265 Merge pull request #1425 from bbareth 2026-11-22 06:38:01 -05:00
02ba5f28b2 Viewer: hide cached LOD chunks outside their draw band 2026-11-22 12:18:39 +01:00
342ba8cd41 Viewer: report an invalid explicit --world directory 2026-11-22 12:13:12 +01:00
3696b3706e Merge pull request #1352 from jakeefr 2026-11-22 05:37:53 -05:00
867910e329 viewer: a port in use is one line, and Ctrl+C stops the server without a traceback
Starting serve.py while a viewer is still running on the port ended in an OSError traceback from socketserver, and
stopping it with Ctrl+C in a KeyboardInterrupt one. The first is now an argument error that names the port and
points at --port 0; the second prints "viewer: stopped" and closes the socket.

tests/test_viewer_serve.py: two tests, both fail on the old code. The Ctrl+C one is skipped on Windows and gives
its child the default SIGINT disposition, so it also passes under a runner that has SIGINT ignored.
2026-11-22 10:04:47 +00:00
99a40c54b1 world_build: instanced placements with bounded memory, and LOD chunk sets
--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>
2026-11-22 10:02:54 +00:00
09db8acbba Merge pull request #993 from bobcatchris 2026-11-22 01:08:13 -05:00
e53ce0d54d viewer: test the serve.py guards, and make a bad --port a usage error
viewer/serve.py holds the DNS-rebinding Host check, the /world/ traversal
resolver and the 403s in front of them, and nothing tested it: the CI viewer
job runs only the streaming tests. tests/test_viewer_serve.py covers the Host
allow/deny matrix, path resolution (.., encoded %2e%2e, backslashes, NUL,
drive letters, reserved device names, directories, a symlink out of the
world) and the HTTP layer on a loopback server (200 with no-store, the .glb
MIME type, HEAD, query strings, 403 for a foreign Host and for traversal).

--port was a plain int, so 70000 or -1 reached socketserver and ended in
OverflowError; 0 bound a free port but printed the URL of port 0. It is now
an argparse type limited to 0-65535, and the message prints the bound port.

Negative control on main: the CLI test fails (exit 1 with a traceback) and
port_number does not exist. With the change: 21/21. The node viewer tests
still pass 29/29. Standard library only, temporary world folder, no game data.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-21 23:34:13 -06:00
86bb28b7b1 Viewer: defer chunk bounds helpers until requested 2026-11-22 05:12:09 +01:00
d54b9c3628 Merge pull request #824 from FreddyxS 2026-11-21 22:37:50 -05:00