Fix ViewerNode
3D Preview #70
Labels
No Label
abstractions
architecture
bug
distribution
docs
duplicate
enhancement
feature
physical
proposal
question
simulation
tooling
tracker
unconfirmed
ux
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: so-rose/oscillode#70
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
While we had a slower
InfoFlow
operation, duringTransformMathNode
implementation we noticed how absurdly much wasted work theDataChanged
is doing. This amplified especially by the newblfields_deps
work we did, each of which also does aDataChanged
, incidentally.We recalled that
active_kind=set()
really ought to stop propagating forDataChanged
, as when noFlowKind
s are changed, then... Well, no data is changed :).So why didn't we do this before? The problem arises with the
Viewer
node: It is the only node that must know about anyDataChanged
from anywhere in the graph, so it can start a 3D re-previewing procedure.The problem is, this is all expensive as all gosh, and to boot, runs in the very sensitive "adjust-preview" hot loop. It's about as anti- as an anti-pattern can get.
By implementing propagation-stop, we needed the
Viz
node to have a dummy-output-method for itsPreview
output socket, so that theViewer
node would get told about a new plot (and fireShowPlot
on the linked node, which itself now also stops immediately after the first node).So plotting is fine. What isn't fine is 3D preview:
DataChanged
related only to preview alterations never make it all the way to theViewer
, and honestly? They shouldn't. It's a ton of noise/garbage in a really sensitive hot path, which has 0 bearing on real results; a brute force method of teleporting a boolean.The issue is what to do instead. It's clear that the data flow semantics just aren't suited for the 3D preview. The question then becomes, what mechanism is? No easy answers. Probably involves the node tree.
We implemented
PreviewsFlow
, a newFlowKind
that manages all of this. The way it interacts with the caching logic ends up being very elegant and optimized.To prevent duplicate plot invocations, this also led us to perform aggressive
DataChanged
-narrowing by-FlowKind
, to indirectly usedepends_on
logic betweenBLField
s to start theDataChanged
-narrowing right on the sockets themselves, and to upgrade theViewer
node to properly support live values/previews without excessive overhead.