-
Notifications
You must be signed in to change notification settings - Fork 654
Dyn-3640 - Recover execution after clearing cyclic dependency from graph #11896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
b1f93ff
e6d13cb
92668f3
911eebe
a1991d8
cab16c9
2b6042f
de95c61
9b8979a
857df3b
907cc81
4943f08
850e915
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,6 +224,8 @@ private void ApplyChangeSetModified(ChangeSetData changeSet) | |
|
||
DeactivateGraphnodes(changeSet.RemovedBinaryNodesFromModification); | ||
|
||
ReActivateGraphNodesInCycle(changeSet.RemovedBinaryNodesFromModification); | ||
|
||
// Undefine a function that was removed | ||
UndefineFunctions(changeSet.RemovedFunctionDefNodesFromModification); | ||
|
||
|
@@ -254,6 +256,35 @@ private void ApplyChangeSetForceExecute(ChangeSetData changeSet) | |
} | ||
} | ||
|
||
private void ReActivateGraphNodesInCycle(List<AssociativeNode> nodeList) | ||
{ | ||
var assocGraph = core.DSExecutable.instrStreamList[0].dependencyGraph; | ||
var graphNodes = assocGraph.GetGraphNodesAtScope(Constants.kInvalidIndex, Constants.kInvalidIndex); | ||
|
||
foreach (var node in nodeList) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will nodeList usually be quite small? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are only those nodes that are modified in a single delta execution run. I guess it could be a long list if the user is in manual mode and has made a large number of edits to their graph before hitting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be worth profiling this change or monitoring the perf benchmark tests after this goes in to see if there is a significant slowdown as a result of this additional check on each delta execution. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
{ | ||
var bNode = node as BinaryExpressionNode; | ||
if (bNode == null) continue; | ||
|
||
var identifier = bNode.LeftNode as IdentifierNode; | ||
if (identifier == null) continue; | ||
|
||
GraphNode rootNode = null; | ||
foreach(var gNode in graphNodes) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this all graphNodes in the entire graph? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't think of a case where we can have a cycle in a single code block node scope or function definition scope as we disallow variable redefinitions in code block nodes 🤔 |
||
{ | ||
if(identifier.Value == gNode.updateNodeRefList[0].nodeList[0].symbol.name) | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are these always valid ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
rootNode = gNode; | ||
aparajit-pratap marked this conversation as resolved.
Show resolved
Hide resolved
|
||
break; | ||
} | ||
} | ||
if (rootNode == null) return; | ||
|
||
// walk the dependency graph for the rootNode and clear cycles from dependent graph nodes | ||
rootNode.ClearCycles(graphNodes); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Deactivate a single graphnode regardless of its associated dependencies | ||
/// </summary> | ||
|
@@ -1401,21 +1432,13 @@ private bool CompileAndExecute(List<AssociativeNode> astList) | |
private void PostExecution() | ||
{ | ||
ApplyUpdate(); | ||
HandleWarnings(); | ||
} | ||
|
||
/// <summary> | ||
/// Handle warnings that will be reported to the frontend | ||
/// </summary> | ||
private void HandleWarnings() | ||
{ | ||
SuppressResovledUnboundVariableWarnings(); | ||
SuppressResolvedUnboundVariableWarnings(); | ||
} | ||
|
||
/// <summary> | ||
/// Removes all warnings that were initially unbound variables but were resolved at runtime | ||
/// </summary> | ||
private void SuppressResovledUnboundVariableWarnings() | ||
private void SuppressResolvedUnboundVariableWarnings() | ||
{ | ||
runnerCore.BuildStatus.RemoveUnboundVariableWarnings(runnerCore.DSExecutable.UpdatedSymbols); | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.