In my first attempt to ask this question I demonstrated my lack of understanding of Mutables, but didn’t really get at the underlying issue I was trying to understand. So here goes another try…
tldr: Why doesn’t the visualization get called when the simulation takes longer than the interval between updates?
I have a control variable con that gets updated via the view input event mechanism at an interval controlled by the user using a slider. The control variable is then consumed by a simulation sim that takes a long time to update (in real cases due to lots of compute, but here with a delay of 50 ms). (The simulation is maintained in a Mutable that I hope I am now using correctly!) The simulation is then consumed by a visualization viz that displays the current state of the simulation.
If the interval between control updates is longer than the time it takes for the simulation to actually update, then everything works fine. But if the interval between control updates is shorter than the time for the simulation to update, the visualization no longer gets called.
I understand that the next update to con is occurring before viz gets called in the current update, but I thought that the computation would get pushed through the whole dependency graph before the next update would be “allowed” to begin.
You can try this for yourself in this notebook. First, Start the updates. You will see the visualization updating with each update of the simulation. Now try lowering the interval between updates with the slider. When the interval drops below 50 ms, the updates to the visualization become intermittent and then cease entirely. You can Stop the updates, and Reset the simulation so you can experiment around with it.