-
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
Limit the number of reported warnings #6577
Conversation
We will be losing warnings that may be important through this. Imagine that a Vector.sort returns 1000 warnings about comparison but some other operation returns 1 very important warning about an encoding issue. With this, we will get the first 100 warnings all being the not so helpful Vector.sort issue and the encoding warning will become swallowed. The idea of the ticket #6283 was to limit reported warnings for If we still want to limit the number of warnings globally, let's just ensure we attach an artificial warning which will indicate that additional warnings were hidden - so that the user will at least know that there are some hidden warnings - without it we are losing data that the user should see. |
And indeed, it may be desirable to have some semi-automatic way to do this, as probably many methods on Vector could do this - like So maybe some global limit could be needed after all. But I still think the But still, I think we absolutely have to have an indicator that 'there are more warnings which are hidden'. |
Yes, we can have "data loss" but do you imagine people scrolling through 100 warnings because 101th was "the important one" ? |
Fair. But we should indicate that there are more warnings that got swallowed - so that the user know that there is something more. And ideally, IMO we should limit the amount of warnings coming from the |
That can be added, yes.
Can be added as well. |
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.
I'd like us to eliminate @TruffleBoundary
one day...
...runtime/src/bench/java/org/enso/interpreter/bench/benchmarks/semantic/WarningBenchmarks.java
Outdated
Show resolved
Hide resolved
...runtime/src/bench/java/org/enso/interpreter/bench/benchmarks/semantic/WarningBenchmarks.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/error/WithWarnings.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/error/WithWarnings.java
Outdated
Show resolved
Hide resolved
That's completely OK. Nobody will scan more than 100 warnings unless really, really interested in.
+1 one to that. |
@@ -28,27 +32,50 @@ | |||
@OutputTimeUnit(TimeUnit.MILLISECONDS) |
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.
Is the warmup sufficient? I have a minor suggestion. You don't have to do this as I plan to do that in the future for all the benchmarks, but it would help with the stability of these benchmarks.
Modify the context to include an option
for -D.engine.TraceCompilationDetails=true
and check whether the output contains any "[engine]" logs, i.e., whether there are any Graal/Truffle compilations going on in the measurement phase. I guess it is enough to redirect the output to the stdout and just look when did the warmup phase ended and whether there are some logs from Graal. If you struggle with that too much, don't do that.
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.
An inspiration how to do that easily is here: #6271 (comment)
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.
Sorry, I missed that comment.
engine/runtime/src/main/java/org/enso/interpreter/runtime/error/WithWarnings.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/error/WithWarnings.java
Outdated
Show resolved
Hide resolved
Artifically limiting the number of reported warnings to 100. Also added benchmarks with random ints to investigate perf issues when dealing with warnings (future task). Closes #6283.
Warnings library now allows for checking if a maximal number of warnings has been reported. Currently that number is fixed. Making it configurable is the job for the next change.
User can pass `--warnings-limit <arg>` to limit the number of warnings reported. This however requires the context to be passed around, to be able to retrieve runtime option.
b787c49
to
429ff1f
Compare
engine/runtime/src/main/java/org/enso/interpreter/runtime/error/WithWarnings.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/Array.java
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Visualization/0.0.0-dev/src/Warnings.enso
Outdated
Show resolved
Hide resolved
engine/polyglot-api/src/main/java/org/enso/polyglot/RuntimeOptions.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/error/WithWarnings.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/error/WithWarnings.java
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/error/WithWarnings.java
Outdated
Show resolved
Hide resolved
Otherwise `reached_max_count` was reporting invalid result.
Used different variations which was confusing.
Pull Request Description
Artifically limiting the number of reported warnings to 100. Also added benchmarks with random Ints to investigate perf issues when dealing with warnings (future task).
Ideally we would have a custom set-like collection that allows us internally to specify a maximal number of elements. But
EnsoHashMap
(and potentiallyEnsoSet
) are still WIP when it comes to being PE-friendly.The change also allows for checking if the limit for the number of reported warnings has been reached. It will visualize by adding an additional "Warnings limit reached." to the visualization.
The limit is configurable via
--warnings-limit
parameter torun
.Closes #6283.
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.