-
Notifications
You must be signed in to change notification settings - Fork 137
Infinite loop countermeasure #21
Comments
This library is mainly about creating and displaying node graphs using I didn't include this check to avoid over-complicating the example code, but maybe a simple solution using |
Thank you for your response. To add an addendum. However, I think it would be easier to handle this on the library side. |
What I mean is that everything depends on execution semantics. In a graph loops are not infinite, they're just loops, it's up to you how to interpret them. For instance, I can easily imagine a system where the node ports are used for control flow (like in UE5 blueprints or Godot's VisualScripting), where cycles in the graph are used to represent loops in the visual script. Some users of this library want to do just that, and while it's not exactly supported just yet, it's definitely something that I'd like to support. Still, I see your point. If you're thinking about data flow "dependency" graphs like most things Blender uses graphs for, then yes, loops are quite undesirable in that situation because they represent a dependency cycle (i.e. a dependency that can never be fulfilled).
I think this would be helpful. It is fair to assume many applications are going to want an acyclic graph, but this needs to be implemented in a way users that don't need it can disable it 👍 Still a bit busy to work on this actively, but I'd be happy to guide anyone who wants to take on this issue! 😄 |
I see! I understand now. It seems my knowledge was shallow. |
If you build the nodes in this way and click on "👁 Set active" button, the application will crash.
How about providing a way for the library to avoid crashing if the loop is accidentally created?
For example, if I loop in blender, it looks like this and will not compute.
The text was updated successfully, but these errors were encountered: