Add the leveled boundary helpers and the deep group element copy

This commit is contained in:
Dennis Kobert
2026-08-22 11:48:26 +00:00
parent 8eaa541c8c
commit 5821816228
10 changed files with 399 additions and 17 deletions

View File

@@ -15,6 +15,7 @@ wasm = ["graphene-std/wasm"]
graphene-std = { workspace = true }
graph-craft = { workspace = true }
graphene-core = { workspace = true }
graphic-types = { workspace = true }
wgpu-executor = { workspace = true }
core-types = { workspace = true }
dyn-any = { workspace = true }

View File

@@ -145,15 +145,16 @@ impl DynamicExecutor {
}
/// Calls the `Node::serialize` for that specific node, returning for example the cached value for a monitor node. The node path must match the document node path.
/// A monitor's record capture materializes its element here against the
/// arena, inside the introspection window, so consumers downcast the
/// element type directly. The captured input context stays on the
/// serialized io record for consumers that need it.
/// A monitor's record capture materializes here against the arena, inside
/// the introspection window, so consumers downcast the legacy value type
/// directly: a rank-0 capture yields its element and a level capture its
/// legacy list. The captured input context stays on the serialized io
/// record for consumers that need it.
pub fn introspect(&self, node_path: &[NodeId]) -> Result<Arc<dyn std::any::Any + Send + Sync + 'static>, IntrospectError> {
let result = self.tree.introspect(node_path)?;
if let Some(io) = result.downcast_ref::<core_types::memo::IORecord<core_types::context::CtxSnapshot, core_types::record::RecordCapture>>() {
let arena = self.arena.lock().unwrap_or_else(PoisonError::into_inner);
return io.output.materialize_element(&arena).map(Arc::from).ok_or(IntrospectError::NoData);
return graphic_types::boundary::capture_to_legacy(&io.output, &arena).map(Arc::from).ok_or(IntrospectError::NoData);
}
Ok(result)
}