From 8501010eceae5dca5291eeab03147e0ae272bb77 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Wed, 9 Sep 2026 11:35:38 +0000 Subject: [PATCH] Name the attribute read for the type it reads The read is a number read, not a read of whatever the name holds: our model has no coercion, so a name written at another value type is a graph error rather than a conversion. The name says so. Co-Authored-By: Claude Fable 5 --- .../interpreted-executor/src/dynamic_executor.rs | 2 +- node-graph/nodes/graphic/src/graphic.rs | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/node-graph/interpreted-executor/src/dynamic_executor.rs b/node-graph/interpreted-executor/src/dynamic_executor.rs index 09200278a2..cdf04440de 100644 --- a/node-graph/interpreted-executor/src/dynamic_executor.rs +++ b/node-graph/interpreted-executor/src/dynamic_executor.rs @@ -801,7 +801,7 @@ mod test { (NodeId(2), ProtoNode::value(ConstructionArgs::Value(value.into()), vec![])), (NodeId(3), proto_node("graphic_nodes::graphic::WriteAttributeNode", vec![NodeId(0), NodeId(1), NodeId(2)])), (NodeId(4), string_value(read_name)), - (NodeId(5), proto_node("graphic_nodes::graphic::ReadAttributeNode", vec![NodeId(3), NodeId(4)])), + (NodeId(5), proto_node("graphic_nodes::graphic::ReadNumberAttributeNode", vec![NodeId(3), NodeId(4)])), ], } } diff --git a/node-graph/nodes/graphic/src/graphic.rs b/node-graph/nodes/graphic/src/graphic.rs index cb43ad81da..e9d698f599 100644 --- a/node-graph/nodes/graphic/src/graphic.rs +++ b/node-graph/nodes/graphic/src/graphic.rs @@ -390,12 +390,14 @@ pub fn write_attribute<'e, T, V: WireValue>( Ok((content, Attr(parked))) } -/// Reads the attribute `name` names off each lane. An absent attribute reads as -/// the name's own default, so the value carries the declared type either way; -/// the name is constant text the compiler folds into an offset when the graph -/// compiles. +/// Reads the `f64` attribute `name` names off each lane. An absent attribute +/// reads as the name's own default, so the value is always a number; the name +/// is constant text the compiler folds into an offset when the graph compiles. +/// +/// A name written at another value type is a graph error rather than a +/// conversion, so reading a number is never a coercion of one. #[node_macro::node(category("Attributes: Read"))] -pub fn read_attribute<'e>( +pub fn read_number_attribute<'e>( _: impl Ctx, /// The content whose lanes carry the attribute. (content, value): (f64, Attr<'e, Named>),