From d105734cf81c1bd0dd0ce9b00aacf41559a9199d Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 22:31:24 +0000 Subject: [PATCH] material-graph: evaluate_all skips nodes already run as inputs, removing the double evaluation and thumbnail of every node --- crates/material-graph/src/graph.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/material-graph/src/graph.rs b/crates/material-graph/src/graph.rs index f4fc04eb35..df24f6cb2e 100644 --- a/crates/material-graph/src/graph.rs +++ b/crates/material-graph/src/graph.rs @@ -2014,6 +2014,11 @@ impl Graph { let mut seen = HashSet::new(); order.retain(|i| seen.insert(*i)); for id in order { + // already run (and thumbnailed) as an input of an earlier node of this call; its result was freed after its + // readers finished, so running it again would only compute and thumbnail the same node a second time + if cache.thumbs.as_ref().is_some_and(|t| t.contains_key(&id)) { + continue; + } match eval_node(self, id, &ctx, &[], &mut cache).and_then(|value| value.into_host(id, ec)) { Ok(t) => { if Some(id) == first || keep.contains(&id) {