maxitg / SetReplace

C++/Wolfram Language package for exploring set and graph rewriting systems
MIT License
219 stars 46 forks source link

SetReplace Linux-ARM error #641

Closed alexchenfeng closed 3 years ago

alexchenfeng commented 3 years ago

The problem

I have compiled SetReplace-0.3.165 on Raspberry Pi armhf, and when running WolframModel it gives me an error

LibraryFunction::cfta:
   Argument {9223372036854775807, 2, 9223372036854775807,
     9223372036854775807, 9223372036854775807} at position 2 should be a rank
    1 tensor of machine-size integers.

TAG: v0.3.165

In[1]:= <<SetReplace`;
In[2]:= WolframModel[{{x, y}} -> {{x, y}, {y, z}}, {{1, 2}}, 10, "FinalState"]
Screen Shot 2021-05-11 at 2 52 34 PM

Version

In[] := SystemInformation["Small"]
Screen Shot 2021-05-11 at 2 50 37 PM
In[] := $SetReplaceGitSHA

In[4]:= $SetReplaceGitSHA Out[4]= daaa3c7021e2cf4160f185afdfebf5f9f5c97e05*

maxitg commented 3 years ago

It looks like the issue is that we are passing 2^63 - 1 for unspecified step spec parts, and that does not work on 32-bit systems.

@alexchenfeng, could you try specifying all step specs as a workaround (I don't have a 32-bit system on hand to check myself)?

WolframModel[{{x, y}} -> {{x, y}, {y, z}}, {{1, 2}}, <|"MaxGenerations" -> 10, "MaxEvents" -> 100000, 
  "MaxVertices" -> 100000, "MaxVertexDegree" -> 100000, "MaxEdges" -> 100000|>, "FinalState"]

We could potentially get around this by passing a -1 and converting it back to maxInt64 on the C++ side.

alexchenfeng commented 3 years ago

It looks like the issue is that we are passing 2^63 - 1 for unspecified step spec parts, and that does not work on 32-bit systems.

@alexchenfeng, could you try specifying all step specs as a workaround (I don't have a 32-bit system on hand to check myself)?

WolframModel[{{x, y}} -> {{x, y}, {y, z}}, {{1, 2}}, <|"MaxGenerations" -> 10, "MaxEvents" -> 100000, 
  "MaxVertices" -> 100000, "MaxVertexDegree" -> 100000, "MaxEdges" -> 100000|>, "FinalState"]

We could potentially get around this by passing a -1 and converting it back to maxInt64 on the C++ side.

Thank you, result is:

In[1]:= <<SetReplace`;

In[2]:= $SetReplaceGitSHA

Out[2]= daaa3c7021e2cf4160f185afdfebf5f9f5c97e05*

In[3]:= WolframModel[{{x, y}} -> {{x, y}, {y, z}}, {{1, 2}}, <|"MaxGenerations" -> 10, "MaxEvents" -

100000, "MaxVertices" -> 100000, "MaxVertexDegree" -> 100000, "MaxEdges" -> 100000|>, "FinalState"]

LibraryFunction::cfsa: Argument 3315471533 at position 8 should be a machine-size integer.

Segmentation fault (core dumped)

maxitg commented 3 years ago

@alexchenfeng, could you check #648? The piece I missed last time was the random seed. It should work now if I haven't missed anything else.

alexchenfeng commented 3 years ago

@alexchenfeng, could you check #648? The piece I missed last time was the random seed. It should work now if I haven't missed anything else. Thank you , it works fine now.