Skip to content
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

Heterogeneous list update gives infinite loop #9334

Merged
merged 20 commits into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7156f6e
Add check for invalid cutom node name
reddyashish Dec 3, 2018
5c88c44
Removing trailing spaces
reddyashish Dec 3, 2018
827b090
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
reddyashish Dec 4, 2018
d055de4
Moving the function to utilities class
reddyashish Dec 4, 2018
085fb51
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
reddyashish Dec 10, 2018
12538ab
Revert "Merge branch 'master' of https://github.com/DynamoDS/Dynamo"
reddyashish Dec 10, 2018
101857b
Revert "Revert "Merge branch 'master' of https://github.com/DynamoDS/…
reddyashish Dec 10, 2018
5659d22
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
reddyashish Dec 10, 2018
c3a97df
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
reddyashish Dec 13, 2018
6987cfa
Adding tests - QNTM-3928
reddyashish Dec 13, 2018
68194bd
Comments
reddyashish Dec 13, 2018
77193b5
Moving the test to NodeViewCustomizationTests.cs
reddyashish Dec 13, 2018
3b522b1
Deleting changes to SerializationTests.cs
reddyashish Dec 13, 2018
2b85fc0
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
reddyashish Dec 13, 2018
68eeba9
Create SerializationTests.cs
reddyashish Dec 13, 2018
4a76a7a
Update SerializationTests.cs
reddyashish Dec 13, 2018
bb11dd8
moving the test to UtilityTests.ca
reddyashish Dec 13, 2018
9b37a3d
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
reddyashish Dec 20, 2018
e8d7b8a
Heterogeneous list update gives infinite loop
reddyashish Dec 20, 2018
d91009e
Moving the test dyn file
reddyashish Dec 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 17 additions & 20 deletions src/Engine/ProtoCore/Lang/Replication/Replicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,35 +212,32 @@ public static List<List<StackValue>> ComputeAllReducedParams(
var indices = ri.Zipped ? ri.ZipIndecies : new List<int> { ri.CartesianIndex };
foreach (int index in indices)
{
//This should generally be a collection, so we need to do a one phase unboxing
var targets = reducedParams.Select(r => r[index]).ToList();
foreach (var target in targets)
StackValue target = basicList[index];

if (!target.IsArray)
{
if (!target.IsArray)
{
System.Console.WriteLine("WARNING: Replication unbox requested on Singleton. Trap: 437AD20D-9422-40A3-BFFD-DA4BAD7F3E5F");
continue;
}
}

var array = runtimeCore.Heap.ToHeapObject<DSArray>(target);
if (array.Count == 0)
{
var array = runtimeCore.Heap.ToHeapObject<DSArray>(target);
if (array.Count == 0)
{
continue;
}
}

var arrayStats = ArrayUtils.GetTypeExamplesForLayer(target, runtimeCore).Values;
var arrayStats = ArrayUtils.GetTypeExamplesForLayer(target, runtimeCore).Values;

List<List<StackValue>> clonedList = new List<List<StackValue>>(reducedParams);
reducedParams.Clear();
List<List<StackValue>> clonedList = new List<List<StackValue>>(reducedParams);
reducedParams.Clear();

foreach (StackValue sv in arrayStats)
foreach (StackValue sv in arrayStats)
{
foreach (List<StackValue> lst in clonedList)
{
foreach (List<StackValue> lst in clonedList)
{
List<StackValue> newArgs = new List<StackValue>(lst);
newArgs[index] = sv;
reducedParams.Add(newArgs);
}
List<StackValue> newArgs = new List<StackValue>(lst);
newArgs[index] = sv;
reducedParams.Add(newArgs);
}
}
}
Expand Down
15 changes: 14 additions & 1 deletion test/DynamoCoreTests/DSEvaluationModelTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Dynamo.Graph.Nodes.ZeroTouch;
using NUnit.Framework;


namespace Dynamo.Tests
{
[Category("DSExecution")]
Expand Down Expand Up @@ -1173,6 +1172,20 @@ public void TestMAGN9507()
OpenModel(dynFilePath);
AssertPreviewValue("3bf992eb-ecc9-4fcc-a90b-9b1ee7e925e9", 3);
}

[Test, Category("UnitTests")]
public void TestHeterogenousList()
{
// open test graph
RunModel(@"core\dsevaluation\test_hetereogenous_list.dyn");

var guidX = "d7c44c9098d647e0bbd4be8fa2c842eb";
var guidY = "a5463d1fb5d0457da51e563a5707d1cd";
var guidZ = "d35348ab082c451aac9fc2e8a04f7263";
AssertPreviewValue(guidX, new object[] { null, null, null, 5 });
AssertPreviewValue(guidY, new object[] { null, null, null, 10.2 });
AssertPreviewValue(guidZ, new object[] { null, null, null, 15.2 });
}
}

[Category("DSCustomNode")]
Expand Down
Loading