leon-thomm/Ryven

Question About Dataflow Mode vs Execute Mode

ArEnSc opened this issue · 9 comments

Hey how are they different algorithmicly ? I know they both use a DAG perhaps the way they are traversed is different? is there a file I can look at? Great project btw!

Alright so I guess both are Dataflow and Exec Flow are DAGs,
the algorithm stages everything as a topological sort so you have an ordering.
Once you have the ordering there is a sequence.
Given the sequence ordering, you find nodes that are apart of the core exec sequence.

For each node in the core exec sequence, you backtrack and find the root or roots update / and execute those nodes moving forward marking them as visited up to your current sequence node and repeat the process? does that sound about right? @leon-thomm

Better question when do you use one over the other?
I know you can use comparison operators in dataflow mode I believe. I guess when looping is a thing that is apart of exec mode ?

they both use a DAG perhaps

not necessarily acyclic! (but usually)

does that sound about right?

Not quite, because - as I just added - not necessarily acyclic. You cannot have a topological sort on a cyclic graph, but you can have a terminating execution if the nodes themselves are engineered carefully.

when do you use one over the other?

So exec has in reality indeed mostly been used to create something like control structures, look at Unreal Engine's Blueprints as the best example, these were the biggest inspiration. For understanding how they work please either read the Guide on the website or, for a newer and more rigorous specification consult the current ryvencore docs here (might receive further changes soon).

That's what is a bit confusing couldn't you create a conditional control structure using dataflow mode anyways? or do you mean state machines in this case?

i am not sure what you are relating to and what exactly is the question

Well, I want to understand the limitations of data flow mode, vs execution mode. As far as I know they appear to be same. I want to understand which one to use for my specific modelling case.
So far I know from your docs, dataflow mode is like shader graph from unreal, and exec mode is like blue prints from unreal. Why would you use one over the other?
I know with data flow mode,
the algorithm is topological sort
update all nodes starting from the first scheduled one and feed forward all the data to each node.
For exec mode, it seems a bit unclear. I have read your documentation.

For Exec mode...
My best guess is that with exec mode you can model sequence flows easier than you can with data flow mode.
That all exec nodes are topologically sorted.
Then executed in order, but a backwards traversal ( back tracking) to update the nodes associated with the exec node to get the inputs then marked as visited and in the next exec node you do the same ignoring the visited nodes.
Then you also have trigger nodes push that trigger an update of the whole sequence

Do you have the algorithm for Exec mode written down anywhere? so I can know what to expect? Thank @leon-thomm for being patent this project is amazing I am just trying to find if it fits with my application.
My application requires that I should be able to create conditional branching and create state machines, as well as push events to the graph

not necessarily acyclic! (but usually)
If this is true how would you figure out the ordering? through labelling perhaps?

@leon-thomm
ok played with the code a bit, noticed in the ryven qt core, can't find exec mode algorithm... I only see the flow algorithm. Second it seems like the UI doesn't update and it greys out the fields the connected outputs to inputs of the nodes. Is there a way to override that and let it update the values in say a for loop node? or is it done because rendering updates to values in those fields is expensive?

Ok I found that version 3 didn't have that code, but version 4 did!

ok I figured this all out by tracing through the code thanks