Prevent stack overflow in model relay through introduction of NaN values into model and other causes
Description
So far our "link counting system" described in FLUID-5303 is inactive, which leaves us at high risk of runaway propagation of updates. We should at least add back in a safety net of some kind to ensure that runaway propagation triggers a framework diagnostic rather than a stack overflow.
We should also fix the algorithm in fluid.model.isSameValue to cut off the currently dominant possibility for failure to settle - any NaN that gets into the model will ensure that it can never compare equal to itself. This was observed during development of Flocking -
Clark Kent: I get the most informative error <error> Antranig Basman: ! From where Clark Kent: fetchChangeChildren Antranig Basman: All it says is <error"? Clark Kent: yes, literally <error> Antranig Basman: This must be Chrome It's got far far worse at diagnostics recently Clark Kent: yes Firefox is telling me I have too much recursion Antranig Basman: Yup, it calls fluid.audioSystem.calcNumBlocks with (undefined, undefined) It returns NaN which then gets into the model and then everything goes bananas
So far our "link counting system" described in FLUID-5303 is inactive, which leaves us at high risk of runaway propagation of updates. We should at least add back in a safety net of some kind to ensure that runaway propagation triggers a framework diagnostic rather than a stack overflow.
We should also fix the algorithm in fluid.model.isSameValue to cut off the currently dominant possibility for failure to settle - any NaN that gets into the model will ensure that it can never compare equal to itself. This was observed during development of Flocking -
Clark Kent: I get the most informative error
<error>
Antranig Basman: !
From where
Clark Kent: fetchChangeChildren
Antranig Basman: All it says is <error"?
Clark Kent: yes, literally <error>
Antranig Basman: This must be Chrome
It's got far far worse at diagnostics recently
Clark Kent: yes
Firefox is telling me I have too much recursion
Antranig Basman: Yup, it calls fluid.audioSystem.calcNumBlocks with (undefined, undefined)
It returns NaN which then gets into the model and then everything goes bananas