Skip to content

Make the render node finish SVG renders without caller post-processing - #5000

Open
Keavon wants to merge 1 commit into
masterfrom
render-node-readback
Open

Keavon wants to merge 1 commit into
masterfrom
render-node-readback

Conversation

@Keavon

@Keavon Keavon commented Nov 22, 2026

Copy link
Copy Markdown
Member

No description provided.

@Keavon
Keavon requested a review from TrueDoctor as a code owner November 22, 2026 12:35

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 11 files

Confidence score: 3/5

  • In render_node.rs, treating a Pending executor like a missing GPU can finalize the SVG without its effect maps. Return Poll::Pending in this case, as the Vello branch does.
  • In render_node.rs, the spawned future keeps the slot alive after the render node is dropped, so its Drop-based abort cannot cancel orphaned GPU readbacks. Capture a Weak slot and upgrade it only when storing the result.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="node-graph/nodes/gstd/src/render_node.rs">

<violation number="1" location="node-graph/nodes/gstd/src/render_node.rs:161">
P2: The spawned future keeps the slot alive after the render node is dropped, so its `Drop`-based abort never cancels orphaned GPU readbacks. Capture a `Weak` slot and upgrade it only when storing the result, allowing node removal to drop the slot and abort the task.</violation>

<violation number="2" location="node-graph/nodes/gstd/src/render_node.rs:213">
P2: A `Pending` executor is treated the same as a missing GPU here, so the SVG is finalized without its effect maps. The Vello branch returns `Poll::Pending` in this case. Handle `Pending` by returning `Poll::Pending` from the SVG branch, as the Vello branch does.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

effect_maps,
deferred_images,
}
let executor = || executor.eval(&Context::default()).value().map(Item::into_element);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: A Pending executor is treated the same as a missing GPU here, so the SVG is finalized without its effect maps. The Vello branch returns Poll::Pending in this case. Handle Pending by returning Poll::Pending from the SVG branch, as the Vello branch does.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At node-graph/nodes/gstd/src/render_node.rs, line 213:

<comment>A `Pending` executor is treated the same as a missing GPU here, so the SVG is finalized without its effect maps. The Vello branch returns `Poll::Pending` in this case. Handle `Pending` by returning `Poll::Pending` from the SVG branch, as the Vello branch does.</comment>

<file context>
@@ -99,27 +210,23 @@ fn render(
-				effect_maps,
-				deferred_images,
-			}
+			let executor = || executor.eval(&Context::default()).value().map(Item::into_element);
+			svg_readback.poll(output, *footprint, executor, runtime.element(), *source.element())
 		}
</file context>

executor.resolve_deferred_svg_images(&mut svg, &mut finished_image_data, deferred_images).await;
(svg, finished_image_data)
};
let slot = self.clone();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The spawned future keeps the slot alive after the render node is dropped, so its Drop-based abort never cancels orphaned GPU readbacks. Capture a Weak slot and upgrade it only when storing the result, allowing node removal to drop the slot and abort the task.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At node-graph/nodes/gstd/src/render_node.rs, line 161:

<comment>The spawned future keeps the slot alive after the render node is dropped, so its `Drop`-based abort never cancels orphaned GPU readbacks. Capture a `Weak` slot and upgrade it only when storing the result, allowing node removal to drop the slot and abort the task.</comment>

<file context>
@@ -70,12 +73,120 @@ fn render_intermediate<T: 'static + Render + WasmNotSend + Send + Sync>(
+			executor.resolve_deferred_svg_images(&mut svg, &mut finished_image_data, deferred_images).await;
+			(svg, finished_image_data)
+		};
+		let slot = self.clone();
+		runtime.spawn(
+			source,
</file context>

This branch was successfully deployed

1 active deployment
graphite-dev (Preview) — 2e36b622 Deployed Nov 22, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant