-
Notifications
You must be signed in to change notification settings - Fork 323
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
Some minor fixes #3874
Some minor fixes #3874
Conversation
3c9e497
to
8977d56
Compare
var typeError = Context.get(this).getBuiltins().error().makeTypeError(that, bool, "that"); | ||
throw new PanicException(typeError, this); | ||
var typeError = Context.get(this).getBuiltins().error().makeTypeError(bool, that, "that"); | ||
return DataflowError.withoutTrace(typeError, this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raising this error without any trace will make it harder to debug.
While I appreciate that in many cases we want to avoid adding traces to Dataflow errors for performance, if we are shifting towards using dataflow errors much more than panics, I think we need to revisit that decision.
Maybe we should have 2 classes of errors? Cheap indicator errors that can happen in hot computations that need to be without trace for performance, and the more expensive 'real errors' that used to most often used to be panics but were shifted to dataflow. For the latter 'class', I'd add traces so we can find out where the error has happened.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Producing stacktrace is expensive. However including getSourceSection()
- e.g. location in the source should be cheap - if that's enough. The DataflowError
has reference to this
- it can use this.getSourceSection()
later to construct where the error comes from and that shall be fast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting point.
Still for the more crucial errors I'd consider a full stacktrace as it can give much more information.
Since getting just the source location is so cheap, maybe we should include this for all dataflow errors? That could be quite helpful for debugging still.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I tested the code the getSourceSection
didn't appear to work - I think it would be a good addition to the Dataflow error so suggest we add a task to pick this up later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please verify the effect on benchmarks. I think it should be OK, but one can never be sure. Run it for your branch and compare with develop
ones.
Consider keeping the more specialized types in the @Specialize
methods, if possible.
.../java/org/enso/interpreter/node/expression/builtin/number/bigInteger/GreaterOrEqualNode.java
Outdated
Show resolved
Hide resolved
var typeError = Context.get(this).getBuiltins().error().makeTypeError(that, bool, "that"); | ||
throw new PanicException(typeError, this); | ||
var typeError = Context.get(this).getBuiltins().error().makeTypeError(bool, that, "that"); | ||
return DataflowError.withoutTrace(typeError, this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Producing stacktrace is expensive. However including getSourceSection()
- e.g. location in the source should be cheap - if that's enough. The DataflowError
has reference to this
- it can use this.getSourceSection()
later to construct where the error comes from and that shall be fast.
01e1093
to
e3d38ad
Compare
Allow Nothing as a key in a Map. Add column_names short hand to Table. Add support for a Map in rename_columns.
Adjusted Map to cope with Nothing keys better. Tests for Nothing key in Map.
Make specialisations return type more specific.
Fix Vector.distinct so returns error on mixed types. Test for Table.rename_columns by Map. Test for Table.column_names.
Add assert to check BigInteger doesn't fit in Long.
e3d38ad
to
bfb914e
Compare
Rather than going through instance checks, introduced a separate node that uses specializations for that. In the process, discovered that ComparatorNode was never used or covered on our test suite. If it did, we would notice that we were comparing Atoms with AtomConstructors, meaning that we would always throw a panic when sort is given a comparator. It made more sense to remove that specialization.
0da8b95
to
a8f322b
Compare
Pull Request Description
Map
to store aNothing
key (fixesVector.distinct
with aNothing
).column_names
method toTable
as a shorthand.Important Notes
Checklist
Please include the following checklist in your PR:
Scala,
Java,
and
Rust
style guides.
./run ide build
and./run ide watch
.