Viewport: keep the model scene in blocks and upload only what changed (#1147) (#1154)

* Viewport: keep the model scene in blocks and upload only what changed

Every change rebuilt the whole model scene (every body's triangles and edges) and
uploaded all of it again, so a design an agent builds one body at a time paid for the
whole model on every command. The scene is now built in blocks of a few bodies, cut
where a body's own key says, and each block's bytes and GPU buffers are kept while the
block comes back unchanged. Body boxes (fit, picking, ground shadow) are kept per mesh.

Rendering is unchanged: the bicycle from bench-agent opens to a byte-identical
screenshot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Browser: find an occurrence's placed bodies by name, not by search per row

Each body row of a placed component searched the placement's bodies for its own, every
frame: quadratic in the component's bodies (720 for the bench-agent bicycle's hardware).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
bherbruckandClaude Opus 5.5 authored and GitHub committed 2026-10-14 14:32:32 -04:00
1 parent 9b0f028f13
commit 39bc87a8cc
5 files changed
+278 -60

No files matched your search

+16
View File
@@ -71,6 +71,22 @@ once per command), but slowly. `solidcraft-cli eval` output for the design corpu
the regression scripts, the generated bicycle and a 3,300-feature agent-built design is
unchanged apart from the timings.
The viewport rebuilt its whole model scene after every change and uploaded all of it again
(every body's triangles and edges, 60 MB for the bicycle where bodies are built on the CPU). It
now builds the scene in blocks of a few bodies, cut where a body's own key says so that adding
or removing a body changes only its block, and keeps each block's bytes and GPU buffers while
the block comes back unchanged. The bodies' boxes (fit, picking, the ground shadow) are kept per
mesh the same way. Built command by command over the control channel (`engine.execute`, then
`ui.inspect`) in the desktop app under Xvfb with software GL:
| desktop, bicycle built over the control channel | main | with #1148 and this |
|---|---:|---:|
| UI work per change at ~1,000 bodies (`frame_ms`) | 1,374 ms | 18 ms |
| model scene build at ~1,000 bodies (`build_ms`) | 41 ms | 1.4 ms |
| whole build | 1,409 s | 210 s |
Most of what is left there is software rendering of 770k triangles per frame.
## STEP import: shells and item solids without copies (2026-10-13)
A file that lists one product definition many times (a bolt used 70 times, a panel in several