Agent-built designs: stop redoing whole-design work on every command (#1148)

A design built over MCP is many small commands, and each one did work over the
whole design, so building or showing a 1,300-body design took minutes:

- moved components were transformed and meshed again after every change; world_state
  now reuses each placed body whose definition and placement are unchanged
- next_d_name searched the design once per candidate number
- Document::eval evaluated every parameter for every expression; now only when the
  expression names one
- param_rows' used_by was quadratic; the desktop no longer gathers completions on every
  change while no text box has focus

solidcraft-cli bench-agent builds a generated ~1,300-body bicycle command by command
and times it (241 s -> 16 s here). Eval output is unchanged apart from timings.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bherbruckandClaude Opus 5.5 authored and GitHub committed 2026-10-14 13:48:39 -04:00
1 parent 37547f8eba
commit 6de8f6db95
11 files changed
+439 -21

No files matched your search

+6 -1
View File
@@ -120,7 +120,12 @@ pub fn open(app: &mut SolveApp) {
/// Draw the dialog when it is open. Called once per frame.
pub fn show(app: &mut SolveApp, ctx: &egui::Context) {
publish(app, ctx);
// Completions are offered only under a focused text box; gathering them evaluates every
// parameter, so a design changing command after command (an agent building over MCP)
// does not pay for it on every change while nobody is typing.
if app.params.is_some() || ctx.memory(|m| m.focused().is_some()) {
publish(app, ctx);
}
let Some(mut d) = app.params.take() else { return };
let t = Tokens::get();
let mut open = true;