beehive-lab / TornadoVM

TornadoVM: A practical and efficient heterogeneous programming framework for managed languages
https://www.tornadovm.org
Apache License 2.0
1.17k stars 110 forks source link

Factory methods for some of the types fail the JIT compiler #338

Open jjfumero opened 6 months ago

jjfumero commented 6 months ago

Describe the bug

$ tornado-test -V --fast uk.ac.manchester.tornado.unittests.api.TestInitDataTypes#testInitByteArray

tornado --jvm "-Xmx6g -Dtornado.recover.bailout=False -Dtornado.unittests.verbose=True "  -m  tornado.unittests/uk.ac.manchester.tornado.unittests.tools.TornadoTestRunner  --params "uk.ac.manchester.tornado.unittests.api.TestInitDataTypes#testInitByteArray"
WARNING: Using incubator modules: jdk.incubator.vector
java.lang.NoSuchFieldException: value
    at java.base/java.lang.Class.getDeclaredField(Class.java:2782)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.phases.TornadoTaskSpecialisation.lookupField(TornadoTaskSpecialisation.java:103)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.phases.TornadoTaskSpecialisation.lookupField(TornadoTaskSpecialisation.java:109)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.phases.TornadoTaskSpecialisation.lookupField(TornadoTaskSpecialisation.java:109)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.phases.TornadoTaskSpecialisation.lookupPrimField(TornadoTaskSpecialisation.java:140)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.phases.TornadoTaskSpecialisation.evaluate(TornadoTaskSpecialisation.java:230)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.phases.TornadoTaskSpecialisation.lambda$propagateParameters$4(TornadoTaskSpecialisation.java:301)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.phases.TornadoTaskSpecialisation.propagateParameters(TornadoTaskSpecialisation.java:300)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.phases.TornadoTaskSpecialisation.run(TornadoTaskSpecialisation.java:319)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.phases.TornadoTaskSpecialisation.run(TornadoTaskSpecialisation.java:69)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:434)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:322)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.PhaseSuite.run(PhaseSuite.java:390)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:434)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:322)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLCompiler.emitFrontEnd(OCLCompiler.java:180)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLCompiler.compile(OCLCompiler.java:126)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLCompiler$Request.execute(OCLCompiler.java:509)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLCompiler.compileSketchForDevice(OCLCompiler.java:386)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.runtime.OCLTornadoDevice.compileTask(OCLTornadoDevice.java:261)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.runtime.OCLTornadoDevice.compileJavaToAccelerator(OCLTornadoDevice.java:335)
    at tornado.drivers.opencl@1.0.2-dev/uk.ac.manchester.tornado.drivers.opencl.runtime.OCLTornadoDevice.installCode(OCLTornadoDevice.java:462)
    at tornado.runtime@1.0.2-dev/uk.ac.manchester.tornado.runtime.interpreter.TornadoVMInterpreter.compileTaskFromBytecodeToBinary(TornadoVMInterpreter.java:639)
    at tornado.runtime@1.0.2-dev/uk.ac.manchester.tornado.runtime.interpreter.TornadoVMInterpreter.execute(TornadoVMInterpreter.java:335)
    at tornado.runtime@1.0.2-dev/uk.ac.manchester.tornado.runtime.interpreter.TornadoVMInterpreter.execute(TornadoVMInterpreter.java:873)
    at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
    at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
    at tornado.runtime@1.0.2-dev/uk.ac.manchester.tornado.runtime.TornadoVM.executeSingleThreaded(TornadoVM.java:122)
    at tornado.runtime@1.0.2-dev/uk.ac.manchester.tornado.runtime.TornadoVM.execute(TornadoVM.java:111)
    at tornado.runtime@1.0.2-dev/uk.ac.manchester.tornado.runtime.tasks.TornadoTaskGraph.scheduleInner(TornadoTaskGraph.java:813)
    at tornado.runtime@1.0.2-dev/uk.ac.manchester.tornado.runtime.tasks.TornadoTaskGraph.schedule(TornadoTaskGraph.java:1278)
    at tornado.api@1.0.2-dev/uk.ac.manchester.tornado.api.TaskGraph.execute(TaskGraph.java:776)
    at tornado.api@1.0.2-dev/uk.ac.manchester.tornado.api.ImmutableTaskGraph.execute(ImmutableTaskGraph.java:49)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
    at tornado.api@1.0.2-dev/uk.ac.manchester.tornado.api.TornadoExecutionPlan$TornadoExecutor.execute(TornadoExecutionPlan.java:349)
    at tornado.api@1.0.2-dev/uk.ac.manchester.tornado.api.TornadoExecutionPlan.execute(TornadoExecutionPlan.java:97)
    at tornado.unittests@1.0.2-dev/uk.ac.manchester.tornado.unittests.api.TestInitDataTypes.testInitByteArray(TestInitDataTypes.java:50)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at junit@4.13.2/org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
    at junit@4.13.2/org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at junit@4.13.2/org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
    at junit@4.13.2/org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at junit@4.13.2/org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at junit@4.13.2/org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at junit@4.13.2/org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
    at junit@4.13.2/org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
    at junit@4.13.2/org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
    at junit@4.13.2/org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
    at junit@4.13.2/org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
    at junit@4.13.2/org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
    at junit@4.13.2/org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
    at junit@4.13.2/org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
    at junit@4.13.2/org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
    at junit@4.13.2/org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at junit@4.13.2/org.junit.runners.ParentRunner.run(ParentRunner.java:413)
    at junit@4.13.2/org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at junit@4.13.2/org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at tornado.unittests@1.0.2-dev/uk.ac.manchester.tornado.unittests.tools.TornadoHelper.runTestVerbose(TornadoHelper.java:152)
    at tornado.unittests@1.0.2-dev/uk.ac.manchester.tornado.unittests.tools.TornadoTestRunner.main(TornadoTestRunner.java:36)
Test: class uk.ac.manchester.tornado.unittests.api.TestInitDataTypes#testInitByteArray
    Running test: testInitByteArray          ................  [FAILED] 

How To Reproduce

Use this branch:

https://github.com/jjfumero/TornadoVM/tree/feat/api/factory

Computing system setup (please complete the following information):