Repository navigation
Conversation
|
!build (Run ID 40217970365) |
There was a problem hiding this comment.
2 issues found across 2 files
Confidence score: 3/5
- In
editor/src/messages/portfolio/document/utility_types/network_interface/layout.rs, inserting Map after GPU raster data can selectRead Raster, whose output isRaster<CPU>, and wire an incompatible function. Exclude GPU raster data from this selection. - In
editor/src/messages/portfolio/document/utility_types/network_interface/layout.rs, the auto-created Read node stays at the Map’s old position when the Map is moved to the feeder. Create the Read node after the Map reaches its final position.
You’re at about 92% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
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="editor/src/messages/portfolio/document/utility_types/network_interface/layout.rs">
<violation number="1" location="editor/src/messages/portfolio/document/utility_types/network_interface/layout.rs:1187">
P2: `Read Raster` returns `Raster<CPU>`, but this branch also selects it for `Raster<GPU>` content. Inserting Map after GPU raster data therefore wires an incompatible mapped function; do not select this node for GPU data unless a GPU-compatible reader exists.</violation>
<violation number="2" location="editor/src/messages/portfolio/document/utility_types/network_interface/layout.rs:1200">
P2: `insert_node_before_input` creates the Read node before moving an absolute Map to the feeder's position, so the Read node remains at the Map's old location. Run the auto-creation after the Map's final positioning and branch shift, or move the created Read node with the Map.</violation>
</file>
Reply to a comment to ask cubic a question or push back. It learns from your replies.
Re-trigger cubic
| }; | ||
|
|
||
| let mut read_template = read_definition.default_node_template(); | ||
| let map_position = self.position(node_id, network_path).unwrap_or_default(); |
There was a problem hiding this comment.
P2: insert_node_before_input creates the Read node before moving an absolute Map to the feeder's position, so the Read node remains at the Map's old location. Run the auto-creation after the Map's final positioning and branch shift, or move the created Read node with the Map.
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 editor/src/messages/portfolio/document/utility_types/network_interface/layout.rs, line 1200:
<comment>`insert_node_before_input` creates the Read node before moving an absolute Map to the feeder's position, so the Read node remains at the Map's old location. Run the auto-creation after the Map's final positioning and branch shift, or move the created Read node with the Map.</comment>
<file context>
@@ -1154,8 +1154,59 @@ impl NodeNetworkInterface {
+ };
+
+ let mut read_template = read_definition.default_node_template();
+ let map_position = self.position(node_id, network_path).unwrap_or_default();
+ let read_position = map_position + IVec2::new(-NODE_CHAIN_WIDTH, 2);
+ read_template.node_type_metadata = NodeTypePersistentMetadata::node(read_position);
</file context>
| let read_proto_id = match element_name.as_deref() { | ||
| Some("Vector") => graphene_std::context::read_vector::IDENTIFIER, | ||
| Some("Graphic") => graphene_std::context::read_graphic::IDENTIFIER, | ||
| Some("Raster" | "Raster<CPU>" | "Raster<GPU>") => graphene_std::context::read_raster::IDENTIFIER, |
There was a problem hiding this comment.
P2: Read Raster returns Raster<CPU>, but this branch also selects it for Raster<GPU> content. Inserting Map after GPU raster data therefore wires an incompatible mapped function; do not select this node for GPU data unless a GPU-compatible reader exists.
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 editor/src/messages/portfolio/document/utility_types/network_interface/layout.rs, line 1187:
<comment>`Read Raster` returns `Raster<CPU>`, but this branch also selects it for `Raster<GPU>` content. Inserting Map after GPU raster data therefore wires an incompatible mapped function; do not select this node for GPU data unless a GPU-compatible reader exists.</comment>
<file context>
@@ -1154,8 +1154,59 @@ impl NodeNetworkInterface {
+ let read_proto_id = match element_name.as_deref() {
+ Some("Vector") => graphene_std::context::read_vector::IDENTIFIER,
+ Some("Graphic") => graphene_std::context::read_graphic::IDENTIFIER,
+ Some("Raster" | "Raster<CPU>" | "Raster<GPU>") => graphene_std::context::read_raster::IDENTIFIER,
+ Some("Color") => graphene_std::context::read_color::IDENTIFIER,
+ Some("Gradient") => graphene_std::context::read_gradient::IDENTIFIER,
</file context>
| Some("Raster" | "Raster<CPU>" | "Raster<GPU>") => graphene_std::context::read_raster::IDENTIFIER, | |
| Some("Raster" | "Raster<CPU>") => graphene_std::context::read_raster::IDENTIFIER, |
Wasm: 41.85 MB — JS: 0.73 MB — CSS: 0.13 MB — Fonts: 0.69 MB — Images: 0.09 MB — All Assets: 43.49 MB |
|
I want to try again once @Keavon |
|
Feel free to do so @Ankit-cs just open a new pr |
Closes #4792
Description
When dragging or splicing a Map node into a wire/chain (such as after a Stroke node), the Map node's primary input 0 (
content) receives the upstream type (e.g.Vector), while its secondary input 1 (mapped) defaults to expectingString[]. This caused a type mismatch error when dropping the node onto a wire.Changes
NodeNetworkInterface::insert_node_betweenandinsert_node_before_inputinlayout.rs:auto_create_read_node_for_mapto detect when a Map node is inserted onto a wire.mappedinput is unconnected, it queries the upstream output type feeding input 0 (content).Vector,Graphic,Raster,Color,Gradient,Number,String) to the correspondingRead Xnode (read_vector,read_graphic, etc.).Read Xnode directly below the chain (offset byIVec2::new(-NODE_CHAIN_WIDTH, 2)relative to Map).Read Xnode's output to the Map node'smappedinput.Tests
inserting_map_node_into_chain_auto_creates_read_nodeincharacterization_tests.rsto verify that inserting a Map node into a chain carrying vector data automatically creates and wires theRead Vectornode at the expected relative coordinates.