From e92faf763d6d0d3df13e7bd542bff237ba879c83 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 6 Sep 2026 15:58:01 +0000 Subject: [PATCH] Correct docs that misstate what the code does --- node-graph/interpreted-executor/src/dynamic_executor.rs | 2 +- node-graph/libraries/core-types/src/record/access.rs | 1 - node-graph/libraries/core-types/src/record/promote.rs | 2 +- node-graph/libraries/core-types/src/record/run.rs | 6 +++--- node-graph/libraries/core-types/src/registry.rs | 6 +++--- node-graph/libraries/graphic-types/src/graphic/legacy.rs | 2 +- node-graph/node-macro/src/codegen.rs | 5 ++--- node-graph/node-macro/src/codegen/classify.rs | 4 ++-- 8 files changed, 13 insertions(+), 15 deletions(-) diff --git a/node-graph/interpreted-executor/src/dynamic_executor.rs b/node-graph/interpreted-executor/src/dynamic_executor.rs index 246ff78ebd..8b4e886f60 100644 --- a/node-graph/interpreted-executor/src/dynamic_executor.rs +++ b/node-graph/interpreted-executor/src/dynamic_executor.rs @@ -418,7 +418,7 @@ impl BorrowTree { self.nodes.insert(id, (node, path)); } - /// Calls the `Node::serialize` for that specific node, returning for example the captured io record for a monitor node. The node path must match the document node path. + /// Calls the `Node::serialize` for that specific node, returning for example the captured context snapshot for a monitor node. The node path must match the document node path. pub fn introspect(&self, node_path: &[NodeId]) -> Result, IntrospectError> { let (id, _) = self.source_map.get(node_path).ok_or_else(|| IntrospectError::PathNotFound(node_path.to_vec()))?; let (node, _path) = self.nodes.get(id).ok_or(IntrospectError::ProtoNodeNotFound(*id))?; diff --git a/node-graph/libraries/core-types/src/record/access.rs b/node-graph/libraries/core-types/src/record/access.rs index 79cd8208b9..caba698705 100644 --- a/node-graph/libraries/core-types/src/record/access.rs +++ b/node-graph/libraries/core-types/src/record/access.rs @@ -38,7 +38,6 @@ impl<'r> Rec<'r> { /// An opaque record value: every non-empty record spills to a claimed frame /// and the value carries its pointer, while an empty record carries nothing. -/// Only [`Layout::rec`] reads it, against the wiring-proven layout. #[derive(Clone, Copy)] pub struct RecordValue<'e> { pub(in crate::record) ptr: *const u8, diff --git a/node-graph/libraries/core-types/src/record/promote.rs b/node-graph/libraries/core-types/src/record/promote.rs index c0f734445f..edc00dc4e5 100644 --- a/node-graph/libraries/core-types/src/record/promote.rs +++ b/node-graph/libraries/core-types/src/record/promote.rs @@ -370,7 +370,7 @@ mod tests { let bounds = (base as usize, buffer.len() * 8); let length = "shared across lanes".len(); unsafe { write_element_sized(base, String::from("shared across lanes"), &transient, length) }.unwrap(); - // A carried field byte-copies the reference, so both lanes name the one park. + // A carried element byte-copies its park reference, so both lanes name the one park. let shared = unsafe { base.cast::<*const u8>().read() }; unsafe { base.add(stride).cast::<*const u8>().write(shared) }; diff --git a/node-graph/libraries/core-types/src/record/run.rs b/node-graph/libraries/core-types/src/record/run.rs index 14d0cb9634..31f5795ea0 100644 --- a/node-graph/libraries/core-types/src/record/run.rs +++ b/node-graph/libraries/core-types/src/record/run.rs @@ -314,8 +314,8 @@ impl<'e> GroupItem<'e> { } /// Re-parks an owned item's lanes into `arena`, restoring the resident - /// form; `None` reports arena exhaustion. A resident item returns a plain - /// clone. + /// form; `None` reports arena exhaustion. A resident item re-adopts into + /// `arena`, sharing only where its lanes already live there. pub fn replay<'a>(&self, arena: &'a crate::arena::Arena) -> Option> { let ItemStorage::Owned(owned) = &self.storage else { // A resident item re-serves at the target arena's own lifetime, @@ -584,7 +584,7 @@ impl graphene_hash::CacheHash for GroupItem<'_> { let stride = self.layout.lane_stride(); let frames = self.frames(); for lane in 0..self.len { - // SAFETY: `adopt` filled `len` lanes of `layout`. + // SAFETY: the constructors store `len` lanes of `layout` at the layout's stride. unsafe { record_content_hash(&self.layout, frames.add(lane * stride), state) }; } } diff --git a/node-graph/libraries/core-types/src/registry.rs b/node-graph/libraries/core-types/src/registry.rs index 5bfab4b02a..1ec11fa733 100644 --- a/node-graph/libraries/core-types/src/registry.rs +++ b/node-graph/libraries/core-types/src/registry.rs @@ -20,7 +20,7 @@ pub struct NodeMetadata { pub context_features: Vec, pub memoize: bool, pub inject_scope: bool, - /// The macro appended its hidden `_runtime` and `_source` fields as the last two entries of `fields`. + /// Set where `_runtime` and `_source` are the last two entries of `fields`. pub async_source_fields: bool, } @@ -389,8 +389,8 @@ mod tests { assert_eq!(held.len(), 4); } - /// Evaluates its content at three promoted index levels and serves the - /// collected elements. + /// Evaluates its content at three indices of one promoted level and serves + /// the collected elements. struct RepeatNode { content: Node0, inner: Layout, diff --git a/node-graph/libraries/graphic-types/src/graphic/legacy.rs b/node-graph/libraries/graphic-types/src/graphic/legacy.rs index abbd3e811a..ab6f745e7a 100644 --- a/node-graph/libraries/graphic-types/src/graphic/legacy.rs +++ b/node-graph/libraries/graphic-types/src/graphic/legacy.rs @@ -91,7 +91,7 @@ pub fn group_to_legacy_graphic(group: &core_types::record::Group) -> Graphic<'st } /// The group as a legacy `List`: a `Graphic` run becomes the items, -/// another typed run becomes one item holding its typed list. +/// another typed run becomes one de-tabled leaf item per lane. pub fn group_to_legacy_list(group: &core_types::record::Group) -> List> { let item = &group.content; if let Some(mut list) = run_to_legacy_list::(item) { diff --git a/node-graph/node-macro/src/codegen.rs b/node-graph/node-macro/src/codegen.rs index d8adf7e9f3..4f206255ad 100644 --- a/node-graph/node-macro/src/codegen.rs +++ b/node-graph/node-macro/src/codegen.rs @@ -728,7 +728,7 @@ pub(crate) struct NodePlan { /// The field and generic derivation shared by the struct/metadata side and the /// impl side, computed once in [`generate_node_code`] and passed to -/// [`generate_node_impl`]. `regular_fields` is the carrier-skipped slice both +/// [`generate_node_impl`]. `regular_fields` is the non-data field slice both /// sides agree on. pub(crate) struct NodeFields<'a> { pub(crate) data_fields: Vec<&'a ParsedField>, @@ -1531,8 +1531,7 @@ pub(crate) fn generate_node_impl(crate_ident: &CrateIdent, parsed: &ParsedNodeFn }); // The extent override is the leveled `extent_at`; consumers query the - // composite `extent(ctx, Level)`, which the trait derives from it. A node - // without `extent = fn` keeps the scalar default (one item at every level). + // composite `extent(ctx, Level)`, which the trait derives from it. // The typed extent surface: the node's inputs in declaration order (values // readable without unsafe, inputs as per-level extent queries, derived // content promoted per copy), then the level paired with the node's depth. diff --git a/node-graph/node-macro/src/codegen/classify.rs b/node-graph/node-macro/src/codegen/classify.rs index e095c1e59d..cf7d820fa8 100644 --- a/node-graph/node-macro/src/codegen/classify.rs +++ b/node-graph/node-macro/src/codegen/classify.rs @@ -120,7 +120,7 @@ pub(crate) fn routing_value_indices(regular_fields: &[&ParsedField], generic: &I } /// The lazy inputs declaring attribute reads, with their indices into the -/// unit-skipped regular fields. +/// regular fields. pub(crate) fn lazy_read_fields<'a>(regular_fields: &[&'a ParsedField]) -> Vec<(usize, &'a ParsedField)> { regular_fields .iter() @@ -130,7 +130,7 @@ pub(crate) fn lazy_read_fields<'a>(regular_fields: &[&'a ParsedField]) -> Vec<(u .collect() } -/// The indices (into the unit-skipped regular fields) of value inputs whose +/// The indices (into the regular fields) of value inputs whose /// reads resolve against their own input rather than the carrier's. pub(crate) fn reading_secondary_indices(regular_fields: &[&ParsedField], skips_carrier: bool) -> Vec { regular_fields