Skip to content

Commit 89fe867

Browse files
committed
Fix tests
1 parent 876a14a commit 89fe867

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

node-graph/gcore/src/memo.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,12 @@ where
9393

9494
drop(cache_guard);
9595

96+
let fut = self.node.eval(input);
97+
let cache = self.cache.clone();
98+
9699
Box::pin(async move {
97-
let value = self.node.eval(input).await;
98-
*self.cache.lock().unwrap() = Some((hash, Arc::new(value.clone())));
100+
let value = fut.await;
101+
*cache.lock().unwrap() = Some((hash, Arc::new(value.clone())));
99102
value
100103
})
101104
}

node-graph/gcore/src/vector/algorithms/instance.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use crate::instances::{InstanceRef, Instances};
22
use crate::raster_types::{CPU, RasterDataTable};
33
use crate::vector::VectorDataTable;
4-
use crate::{ Context, Ctx, ExtractIndex, ExtractVarArgs, GraphicElement, GraphicGroupTable, WithIndex};
4+
use crate::{Context, Ctx, ExtractIndex, ExtractVarArgs, GraphicElement, GraphicGroupTable, WithIndex};
55
use glam::DVec2;
66

77
#[node_macro::node(name("Instance on Points"), category("Instancing"), path(graphene_core::vector))]
88
async fn instance_on_points<T: Into<GraphicElement> + Default + Send + Clone + 'static>(
9-
ctx: impl Ctx + WithIndex,
9+
ctx: impl Ctx + WithIndex + Sync,
1010
points: VectorDataTable,
1111
#[implementations(
1212
Context -> GraphicGroupTable,

node-graph/graph-craft/src/document/value.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ impl Display for TaggedValue {
397397

398398
pub struct UpcastNode {
399399
value: MemoHash<TaggedValue>,
400-
inspected: Cell<bool>,
401400
}
402401
impl<'input> Node<'input, DAny<'input>> for UpcastNode {
403402
type Output = FutureAny<'input>;
@@ -407,13 +406,12 @@ impl<'input> Node<'input, DAny<'input>> for UpcastNode {
407406
}
408407

409408
fn introspect(&self) -> graphene_core::memo::MonitorIntrospectResult {
410-
let inspected = self.inspected.replace(true);
411-
graphene_core::memo::MonitorIntrospectResult::Evaluated((Arc::new(self.value.clone().into_inner()) as Arc<dyn std::any::Any + Send + Sync>, !inspected))
409+
graphene_core::memo::MonitorIntrospectResult::Evaluated((Arc::new(self.value.clone().into_inner()) as Arc<dyn std::any::Any + Send + Sync>, true))
412410
}
413411
}
414412
impl UpcastNode {
415413
pub fn new(value: MemoHash<TaggedValue>) -> Self {
416-
Self { value, inspected: Cell::new(false) }
414+
Self { value }
417415
}
418416
}
419417
#[derive(Default, Debug, Clone, Copy)]

node-graph/graphene-cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ fn compile_graph(document_string: String, application_io: Arc<WasmApplicationIo>
180180
let mut network = load_network(&document_string);
181181
fix_nodes(&mut network);
182182

183-
let substitutions: std::collections::HashMap<String, DocumentNode> = preprocessor::generate_node_substitutions();
183+
let substitutions = preprocessor::generate_node_substitutions();
184184
preprocessor::expand_network(&mut network, &substitutions);
185185

186186
let mut wrapped_network = wrap_network_in_scope(network, Arc::new(FontCache::default()), EditorMetadata::default(), application_io);

node-graph/interpreted-executor/benches/run_demo_art_criterion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn update_executor<M: Measurement>(name: &str, c: &mut BenchmarkGroup<M>) {
1515
c.bench_function(name, |b| {
1616
b.iter_batched(
1717
|| (executor.clone(), proto_network.clone()),
18-
|(mut executor, network)| futures::executor::block_on(executor.update(black_box(network, None))),
18+
|(mut executor, network)| futures::executor::block_on(executor.update(black_box(network), None)),
1919
criterion::BatchSize::SmallInput,
2020
)
2121
});

0 commit comments

Comments
 (0)