-
Notifications
You must be signed in to change notification settings - Fork 636
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
DYN-6527: Fix graph update for primitive input nodes that are first initialized to null #14703
DYN-6527: Fix graph update for primitive input nodes that are first initialized to null #14703
Conversation
@@ -275,7 +275,7 @@ private List<AssociativeNode> BuildSSA(List<AssociativeNode> astList, ProtoCore. | |||
BinaryExpressionNode bnode = (node as BinaryExpressionNode); | |||
int generatedUID = ProtoCore.DSASM.Constants.kInvalidIndex; | |||
|
|||
if (context.applySSATransform && core.Options.GenerateSSA) | |||
if (context.applySSATransform && core.Options.GenerateSSA && !bnode.IsInputExpression) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skip SSA for cases such as this:
a = null;
// update a
a = <some primitive>;
which would after SSA turn into this:
temp = null;
a = temp;
...
a = <some primitive>; // breaks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think this is a good constraint to have on SSA, or should we mark this as a temporary workaround and file a task to fix the optimization in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see any reason why we need to SSA a simple expression like a = null;
in the first place, which essentially states that each variable should be assigned exactly once.
UI Smoke TestsTest: success. 2 passed, 0 failed. |
UI Smoke TestsTest: success. 2 passed, 0 failed. |
UI Smoke TestsTest: success. 2 passed, 0 failed. |
UI Smoke TestsTest: success. 2 passed, 0 failed. |
UI Smoke TestsTest: success. 2 passed, 0 failed. |
UI Smoke TestsTest: success. 2 passed, 0 failed. |
UI Smoke TestsTest: success. 2 passed, 0 failed. |
UI Smoke TestsTest: success. 2 passed, 0 failed. |
UI Smoke TestsTest: success. 2 passed, 0 failed. |
UI Smoke TestsTest: success. 2 passed, 0 failed. |
…nitialized to null (DynamoDS#14703) * remove coreclr-ncalc references * add failing test for dropdown node * cleanup * update tests * attempt initial fix * cleanup * update test * review comments * add code comments (cherry picked from commit 8987869)
* remove duplicate dyf file warning from preview generation process (#14711) - dynamo would issue a warning and fail to publish a package if an 'unqualified' file is being used, such as a dyf file already under package control - this check is done when publishing package locally, but I have incorrectly added it to the process of creating a build preview, which stops the process for both local and online submit workflow (cherry picked from commit 3ea1c5c) * update (#14710) Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com> (cherry picked from commit d5e6c9b) * remove package version limitation (#14716) - now allows package version to start with 0 - cannot have 0.0.0 package version (cherry picked from commit 992e54c) * Localize menu items is Graphic Element Scale dropdown (#14714) * Fix PostDiff job * fix (cherry picked from commit 006113e) * remove dynamo sandbox app.config (#14713) * remove config * remove autogen stuff (cherry picked from commit 0947455) * DYN-6527: Fix graph update for primitive input nodes that are first initialized to null (#14703) * remove coreclr-ncalc references * add failing test for dropdown node * cleanup * update tests * attempt initial fix * cleanup * update test * review comments * add code comments (cherry picked from commit 8987869) --------- Co-authored-by: Deyan Nenov <dnenov@archilizer.com> Co-authored-by: pinzart90 <46732933+pinzart90@users.noreply.github.com> Co-authored-by: Ashish Aggarwal <ashish.aggarwal@autodesk.com> Co-authored-by: Michael Kirschner <mjk.kirschner@gmail.com> Co-authored-by: aparajit-pratap <aparajit.pratap@autodesk.com>
…nitialized to null (DynamoDS#14703) * remove coreclr-ncalc references * add failing test for dropdown node * cleanup * update tests * attempt initial fix * cleanup * update test * review comments * add code comments
* DYN-6527: Fix graph update for primitive input nodes that are first initialized to null (#14703) * remove coreclr-ncalc references * add failing test for dropdown node * cleanup * update tests * attempt initial fix * cleanup * update test * review comments * add code comments * cherry-pick PR 14637 --------- Co-authored-by: Michael Kirschner <mjk.kirschner@gmail.com>
* DYN-6527: Fix graph update for primitive input nodes that are first initialized to null (#14703) * remove coreclr-ncalc references * add failing test for dropdown node * cleanup * update tests * attempt initial fix * cleanup * update test * review comments * add code comments * cherry-pick PR 14637 * cherry-pick PR 14394 * cherry-pick PR 14740 * Fix for element binding messagebox display on saveas (#14424) * remove coreclr-ncalc references * fix for element binding messagebox on saveas * cherry pick PRs 14424, 14500 * build fix --------- Co-authored-by: Michael Kirschner <mjk.kirschner@gmail.com>
Purpose
Dropdown nodes (inheriting from
DropDownBase
) that produce primitive inputs were affected by changes done in #12835 where ifSelectedIndex
was set to -1 (the default value), then when the node was updated to a different dropdown enum value, it wouldn't update. The node would continue to returnnull
in this case as theSelectedIndex
value of -1 builds a null node.This issue is not specific to dropdown node and can happen when primitive input ASTs (e.g. strings) are constructed in the following way:
Case 1:
as opposed to this case where it works:
Case 2:
If I change the default value of
SelectedIndex
inDropdownBase
to 0, such that anull
AST is not first constructed, the node update works as expected.WIP: Trying to work on a fix to handle the case where the input variable (graphnode) is first assigned to another variable that isnull
, and is later updated to a new primitive value.In case 1, the instructions generated look like:
In case 2, they look like:
After the optimization to skip recompilation in #12835, execution should pick up from the instruction after the
pop _lx
in the update cycle for it to work, but owing to the AST being an identifier in case 1, and not a primitive, the program counter was not being set to that instruction (after the pop).The attempted fix is to avoid doing a static single assignment (SSA) transformation to convert something like
a = null;
totemp_identifier = null; a = temp_identifier;
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
(FILL ME IN) Brief description of the fix / enhancement. Mandatory section
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of