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

Unsupported specialization error related to Warnings #8552

Closed
GregoryTravis opened this issue Dec 14, 2023 · 6 comments · Fixed by #8583
Closed

Unsupported specialization error related to Warnings #8552

GregoryTravis opened this issue Dec 14, 2023 · 6 comments · Fixed by #8583
Assignees
Labels
--bug Type: bug -compiler p-high Should be completed in the next sprint

Comments

@GregoryTravis
Copy link
Contributor

I am getting this error in my Map_Error WIP:

    - [FAILED] an error thrown inside map with on_problems=Problem_Behavior.Report_Warning should be attached as a warning [52ms]
        Reason: An unexpected panic was thrown: (Unimplemented.Error Unsupported specialization: Unexpected values provided for InvokeMethodNodeGen@11675922: [org.enso.interpreter.runtime.state.State@3e0d722f, UnresolvedSymbol<is_a>, WithWarnings{11 has 0 warnings}, [Ljava.lang.Object;@435a2e1f], [State,UnresolvedSymbol,WithWarnings,Object[]])
        at <enso> Array_Like_Helpers.vector_from_function(Internal)
        at <enso> Array_Like_Helpers.vector_from_function(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-aarch64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Internal/Array_Like_Helpers.enso:87:15-68)
        at <enso> Vector.map_with_index(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-aarch64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso:704:9-100)

Ocurring in this test.

At this particular revision I have a bug in which Array.hasWarnings() returns true, but Array.getWarnings() returns an empty list. If I add logic to not add the empty list of warnings to the value, the problem goes away.

@GregoryTravis GregoryTravis added p-low Low priority --bug Type: bug labels Dec 14, 2023
@JaroslavTulach JaroslavTulach added -compiler p-high Should be completed in the next sprint and removed p-low Low priority labels Dec 15, 2023
@JaroslavTulach
Copy link
Member

What's the revision where the problem appeared? The latest revision is ee92e19 - is it still reproducible there?

@GregoryTravis
Copy link
Contributor Author

@JaroslavTulach Yes precisely that revision.

@JaroslavTulach
Copy link
Member

Following @GregoryTravis steps I can see there is an instance of WithWarnings wrapping value 11 and having no warnings. The question for @hubertp (as the author of current warnings implementation) is: shall we be able to construct WithWarnings instance that doesn't have any warnings? The code seems to be ready for that - the hasWarnings checks for size() > 0 - however our specializations don't seem to handle this correctly.

I can add assert warnings.size() > 0 into the constructor and then I get:

Execution finished with an error: java.lang.AssertionError
        at <java> org.enso.runtime/org.enso.interpreter.runtime.error.WithWarnings.wrap(WithWarnings.java:86)
        at <java> org.enso.runtime/org.enso.interpreter.runtime.data.vector.Array.readArrayElement(Array.java:110)
        at <java> org.enso.runtime/org.enso.interpreter.runtime.data.vector.ArrayGen$InteropLibraryExports$Cached.readArrayElementNode_AndSpecialize(ArrayGen.java:150)
        at <java> org.enso.runtime/org.enso.interpreter.runtime.data.vector.ArrayGen$InteropLibraryExports$Cached.readArrayElement(ArrayGen.java:131)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibrary$Asserts.readArrayElement(InteropLibrary.java:3996)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.readArrayElement(InteropLibraryGen.java:8819)
        at <java> org.enso.runtime/org.enso.interpreter.runtime.data.vector.Vector$Generic.readArrayElement(Vector.java:228)
        at <java> org.enso.runtime/org.enso.interpreter.runtime.data.vector.ArrayLikeAtNode.vectorAt(ArrayLikeAtNode.java:63)
        at <java> org.enso.runtime/org.enso.interpreter.runtime.data.vector.ArrayLikeAtNodeGen.executeAndSpecialize(ArrayLikeAtNodeGen.java:136)
        at <java> org.enso.runtime/org.enso.interpreter.runtime.data.vector.ArrayLikeAtNodeGen.executeAt(ArrayLikeAtNodeGen.java:97)
        at <java> org.enso.runtime/org.enso.interpreter.node.expression.builtin.immutable.AtVectorNode.execute(AtVectorNode.java:23)

Or we can unwrap a value when there are no warnings. But returning WithWarnings which has no warnings just confuses the specializations. Opinions, @hubertp?

@hubertp
Copy link
Contributor

hubertp commented Dec 18, 2023

The question for @hubertp (as the author of current warnings implementation) is: shall we be able to construct WithWarnings instance that doesn't have any warnings? The code seems to be ready for that - the hasWarnings checks for size() > 0 - however our specializations don't seem to handle this correctly.

I can add assert warnings.size() > 0 into the constructor and then I get:

Or we can unwrap a value when there are no warnings. But returning WithWarnings which has no warnings just confuses the specializations. Opinions, @hubertp?

If I did, then probably unconsciously. I don't think we should have WithWarnings with no warnings inside them.

@JaroslavTulach JaroslavTulach linked a pull request Dec 19, 2023 that will close this issue
2 tasks
@enso-bot
Copy link

enso-bot bot commented Dec 19, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-12-18):

Progress: - UnsupportedSpecialization is duplicate: #8551

Next Day: Finish UnsupportedSpecialization

@enso-bot
Copy link

enso-bot bot commented Dec 20, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-12-19):

Progress: - PR integrated: #8583

Next Day: Create a PR for DataflowErrors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -compiler p-high Should be completed in the next sprint
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants