Closed mike-bourgeous closed 4 months ago
I've worked around the absence of PTY
by rescuing LoadError
in plot.rb. See commit e08d9573b09fd96863055f01db70394c83eedc56.
So far I've run into two TruffleRuby crashes/uncaught exceptions:
rspec
PrecisionMethods#ceil
pry
(on mb-util)
When rspec does run, in addition to the expected plotting failures, there are parsing failures for complex numbers, and differences in default rounding mode.
Saw a repeatable segfault in rspec with seed 17464:
Failures from https://github.com/mike-bourgeous/mb-math/runs/4185434515?check_suite_focus=true --
2) MB::M.parse_complex parses "1 + 1i" correctly Failure/Error: expect(MB::M.round(MB::M.parse_complex(k), 10)).to eq(MB::M.round(v, 10))
expected: (1+1i) got: (1+0i)
10) MB::M::PrecisionMethods#round with positive figs rounds NArrays Failure/Error: expect(MB::M.round(Numo::SFloat[-0.00125, 1.23456], 4)).to eq([-0.0013, 1.2346])
expected: [-0.0013, 1.2346]
got: Numo::SFloat#shape=[2]
[-0.0012, 1.2346]
truffleruby: an internal exception escaped out of the interpreter, please report it to https://github.com/oracle/truffleruby/issues.
Infinite or NaN (java.lang.NumberFormatException)
from java.math.BigDecimal.<init>(BigDecimal.java:923)
from java.math.BigDecimal.<init>(BigDecimal.java:900)
from org.truffleruby.core.numeric.BigIntegerOps.fromDouble(BigIntegerOps.java:263)
from org.truffleruby.core.numeric.FixnumOrBignumNode.fixnumOrBignum(FixnumOrBignumNode.java:65)
from org.truffleruby.core.numeric.FloatNodes$FloatCeilPrimitiveNode.ceil(FloatNodes.java:554)
from org.truffleruby.core.numeric.FloatNodesFactory$FloatCeilPrimitiveNodeFactory$FloatCeilPrimitiveNodeGen.execute(FloatNodesFactory.java:2946)
from org.truffleruby.language.control.IfElseNode.execute(IfElseNode.java:43)
from org.truffleruby.language.control.SequenceNode.execute(SequenceNode.java:36)
from org.truffleruby.language.RubyMethodRootNode.execute(RubyMethodRootNode.java:58)
from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:650)
/home/runner/work/mb-math/mb-math/lib/mb/m/precision_methods.rb:42:in `ceil'
from /home/runner/work/mb-math/mb-math/lib/mb/m/precision_methods.rb:42:in `sigfigs'
from /home/runner/work/mb-math/mb-math/spec/lib/mb/m/special_functions_spec.rb:86:in `block (4 levels) in <top (required)>'
@mike-bourgeous I would recommend to open up corresponding issues in truffleruby repository
Probably not going to work with TruffleRuby for now. May revisit in the future.
Based on a conversation elsewhere, it would be nice to see if TruffleRuby can run my math and sound code faster than CRuby. This would help with the synthesizer demo from mb-surround and my future videos.