Correctness Issues after adopting latest version of Graal
Stefan Marr
java at stefan-marr.de
Thu Apr 10 21:23:55 UTC 2014
Hi:
After adopting the latest Graal/Truffle version, I am seeing correctness issues when running on top of Graal.
I do not see these issues when running on a standard VM with Truffle alone.
So, I am thinking it might be a code generation issue of sorts.
The only clue I found is that the issue is more deterministic when background compilation is disabled, and the results vary when background compilation is enabled.
Not sure, but it might have something to do with function calls.
The smallest test case that I found, which still exhibits the issue is at [1]. Here a sketch:
sum := 0.
1 to: 1000 do: [:i |
i > 500 ifFalse: [sum := sum + 1]].
sum = 500 ifFalse: [ self error: 'Expected 500, got: ' + sum asString].
Note, I tried several things to simplify it, but for instance, when I inline the body of the #> message (greater than), then the problem disappears. It also disappears, if I sprinkle print statements into the benchmark method.
Not sure how to proceed from here, every suggestion welcome.
To reproduce the problem, you’ll need the following branch and execution.
Note, Truffle needs a little patch [2] to compile TruffleSOM at the moment, because Java’s has some issues with the used interfaces.
To checkout the relevant branch of TruffleSOM (graal.sh will need you to set $GRAAL_HOME to work out of the box):
git clone --recursive -b exp/greater-than https://github.com/SOM-st/TruffleSOM.git
ant jar
./graal.sh -cp Smalltalk Examples/Benchmarks/BenchmarkHarness.som GreaterThan 1000 0 1000
The Truffle patch is at [2], and the relevant code can be checked out with:
git clone -b master https://github.com/smarr/graal.git
Do you have any suggestions, how I could verify whether this is a compilation issue, or something in my TruffleSOM code?
Thanks
Stefan
[1] https://github.com/SOM-st/SOM/blob/exp/greater-than/Examples/Benchmarks/GreaterThan.som
[2] https://github.com/smarr/graal/commit/68981f0488a077c454a7b332cf3f6f3b27f1981a
--
Stefan Marr
INRIA Lille - Nord Europe
http://stefan-marr.de/research/
More information about the graal-dev
mailing list