flip not passing update info in real time
Hey y'all! <3 I've stumbled on another small thing. I noticed in a very simple patch that information wasn't updating between flip and join-top. It got me speculating how interaction events get shared with operations downstream, because what I observed is that the join-top was updating one event/frame later than the changes made upstream. That may be too much speculation, but it explains what I'm seeing.
Please see shared workspace: https://adacad.org/?share=10110718245
A linear sequence in the form of a draft (abb) > is inverted (baa) > and flipped (aab) > and then join[ed]-top with the original (abbaab). But I noticed that changes to the input draft don't update at join-top as expected. The original portion updates immediately, as do the invert and flip operations separately, but the updated flip does not pass correctly to the join-top until some other interaction is made to that operation, or upstream, always lagging one incremental 'frame' behind the rest of the chain of operations.
After poking at this for a while, I imagine that in the backend each user interaction with an operation sends some kind of event trigger downstream that clocks subsequent linked operations to run once and update. At first I wanted to call it a 'frame' (a term borrowed from ORCA, if you are familiar), but I discovered that it's a little different because in ORCA frames are global sequential states, and what I'm observing is definitely related to the given chain of linked operations, and also that it passes from inputs to outputs. I ran two tests: first, to see if any global event would trigger an update (I used an unconnected random operation and changed the variables—the flip into join-top did not update); second, to see if linked operations that are subsequent, or downstream would update the upstream join-top operation (I linked the output of join-top into a rectangle, and altered its size variables—also no change to to the join-top). So if I had to guess, I'd say it's the flip operation that is not passing the update signal as expected. YET IT DOES, just one event/frame/state/whateveryawantacallit late. Lol.
This was my deep dive thinking about code for the evening. I hope it is helpful!
Best Wishes, Jeff
Hi Jeff,
Thanks for your diligence and focus. I'll have to look into it more deeply because when I test it on my computer - it updates as expected (e.g. all changes happening in the same frame). However, I have noticed some lags in the viewer. So before I look deeper, can I ask if you were viewing everything in the workspace (on the dataflow) or tracking the outcome in the viewer?
For what it's worth (and as far as I remember). I when a change happens upstream, I mark all downstream operations as "dirty" then I split out the dataflow into "generations" based on what depends on what. I run all the operations for generation 1, wait for them to complete, then run generation 2. I could look more deeply in this example at that parsing to make sure I am doing it right. If you are experiencing the problem and I'm not, it might have something to do with computational speed so maybe somewhere in my code it's not "waiting" for the right thing to update before it reprocesses.
I'm on my sabattical at the moment so I have had some time to do some deep maintenance on the project. I'll ping you again if I find anything related to this. Thanks for the heads up.