-
Notifications
You must be signed in to change notification settings - Fork 39
wip: fix #203, setup configuration interface to ignore reports #204
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
Conversation
16a6ef4 to
6c17ab3
Compare
Codecov Report
@@ Coverage Diff @@
## master #204 +/- ##
==========================================
+ Coverage 87.35% 87.50% +0.14%
==========================================
Files 12 12
Lines 1542 1568 +26
==========================================
+ Hits 1347 1372 +25
- Misses 195 196 +1
Continue to review full report at Codecov.
|
362c2f3 to
3c9f852
Compare
07cb770 to
46db6a5
Compare
JET Benchmark ResultJudge resultBenchmark Report for /home/runner/work/JET.jl/JET.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTargetBaselineTarget resultBenchmark Report for /home/runner/work/JET.jl/JET.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoBaseline resultBenchmark Report for /home/runner/work/JET.jl/JET.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoRuntime information
Architecture: x86_64
JET Benchmark ResultJudge resultBenchmark Report for /home/runner/work/JET.jl/JET.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTargetBaselineTarget resultBenchmark Report for /home/runner/work/JET.jl/JET.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoBaseline resultBenchmark Report for /home/runner/work/JET.jl/JET.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoRuntime information
Architecture: x86_64
|
This PR set-ups `ignored_patterns` interface to ignore certain patterns
of reports, which can be configured by users extensively.
`ignored_patterns` is supposed to be an iterator of predicate function
and if any of given `ignored_patterns` matches a report in question,
the report will just be ignored (and nor cached).
The predicate function will be called _before_ a report is actually
constructed for the possible cut-off of the computational cost to
construct the report. Thus its signature is:
`(T::Type{<:InferenceErrorReport}, interp::JETInterpreter, sv::InferenceState, spec_args::Tuple)`, where:
- `T` specifies the kind of report
- `interp` gives the context of whole analysis
- `sv::InferenceState` gives the local context of analysis
- and `spec_args` will be report-specific arguments
To inject predicate checks, now each report is constructed via `@report!`
macro, which first checks if the report matches any of `ignored_patterns`,
and if not, constructs the report and pushes it to `JETInterpreter` as
the previous `report!` function did.
This PR also defines `DEFAULT_IGNORED_PATTERNS`, namely `ignored_patterns`
applied by default. Currently it consists of `ignore_corecompiler_undefglobal`,
which ignores undefined global names in `Core.Compiler`, and it should
have some positive effects, like reduce false positive error reports
involved with `Base.return_types` and its family in general, improve
analysis performance for JET's self-profiling, etc.
The support of user-predicate functions specified via .JET configuration
file is somewhat tricky, but currently this PR uses RuntimeGeneratedFunctions.jl
and it seems to work. I'm not sure if `@nospecialize` notations works
correctly in `RuntimeGeneratedFunction`s, so some insights or benchmarks
on it will be very welcomed.
This is an alternative for #204, and will supersedes it. This PR setups `report_pass::ReportPass` interface, which controls overall `JETInterpreter`'s error report analysis and can be extensively configured by trait overloads; now users can implement their own report pass and set up new report logic, ignore existing reports, etc. By default, JET offers `BasicPass<:ReportPass` and `SoundPass<:ReportPass`, but the latter is still in very WIP. Also, the configuration support via TOML file would be really hard given this PR. I think we will move to Julia file based configuration support. This interface also suggests the possibility of pluggable analysis requested #169, by allowing users to subtype `JETInterpreter`. The changes are kinda really big, and so maybe I will focus on coding in this PR and leave documentation and examples to another PR.
This is an alternative for #204, and will supersedes it. This PR setups `report_pass::ReportPass` interface, which controls overall `JETInterpreter`'s error report analysis and can be extensively configured by trait overloads; now users can implement their own report pass and set up new report logic, ignore existing reports, etc. By default, JET offers `BasicPass<:ReportPass` and `SoundPass<:ReportPass`, but the latter is still in very WIP. Also, the configuration support via TOML file would be really hard given this PR. I think we will move to Julia file based configuration support. This interface also suggests the possibility of pluggable analysis requested #169, by allowing users to subtype `JETInterpreter`. The changes are kinda really big, and so maybe I will focus on coding in this PR and leave documentation and examples to another PR.
This is an alternative for #204, and will supersedes it. This PR setups `report_pass::ReportPass` interface, which controls overall `JETInterpreter`'s error report analysis and can be extensively configured by trait overloads; now users can implement their own report pass and set up new report logic, ignore existing reports, etc. By default, JET offers `BasicPass<:ReportPass` and `SoundPass<:ReportPass`, but the latter is still in very WIP. Also, the configuration support via TOML file would be really hard given this PR. I think we will move to Julia file based configuration support. This interface also suggests the possibility of pluggable analysis requested #169, by allowing users to subtype `JETInterpreter`. The changes are kinda really big, and so maybe I will focus on coding in this PR and leave documentation and examples to another PR.
This is an alternative for #204, and will supersedes it. This PR setups `report_pass::ReportPass` interface, which controls overall `JETInterpreter`'s error report analysis and can be extensively configured by trait overloads; now users can implement their own report pass and set up new report logic, ignore existing reports, etc. By default, JET offers `BasicPass<:ReportPass` and `SoundPass<:ReportPass`, but the latter is still in very WIP. Also, the configuration support via TOML file would be really hard given this PR. I think we will move to Julia file based configuration support. This interface also suggests the possibility of pluggable analysis requested #169, by allowing users to subtype `JETInterpreter`. The changes are kinda really big, and so maybe I will focus on coding in this PR and leave documentation and examples to another PR.
|
Closing this in a favor of #208 |
This is an alternative for #204, and will supersedes it. This PR setups both `ReportPass` and `AbstractAnalyzer` interfaces. The former allow us to extensibly customize JET's default analysis (error detection), and the latter enables us to implement arbitrary pluggable analysis. By using `ReportPass` interface, now users can set up new report construction logic, ignore existing reports, etc., by implementing a new report pass. By default, JET implements `BasicPass<:ReportPass` and `SoundPass<:ReportPass`, which I believe their names are enough descriptive, but the latter is still in very WIP. The `AbstractAnalyzer` interface allows more extensive customization, and enables pluggable analysis as requested #169. Now we can implement arbitrary new analyzer, which may implement its own abstract interpretation based analysis, while still utilizing JET's report cache logic and top-level analysis logic, etc. The example plugin analyzers are kept in `/examples` directory, and also included into the documentation. One limitation to notice is that we still can't implement our own lattice logic, and thus the `AbstractAnalyzer` interface can't analyze stuff that can't be expressed by the lattice implementation designed for type inference and optimization performed by Julia compiler. This should be addressed in upstream, especially as requested at <JuliaLang/julia#40992> --- The changes are kinda really big, and so I focused on coding in this PR and leave documentation update and more example implementations to another PR. Also now TOML based configuration won't fit given the overload-based customizations enabled by this PR, so we will move to Julia format based configuration support in the future. --- * fix #203, setup report passes, enable customized report strategies * fix #169, implement experimental pluggable analysis interface (#209) * fix #169, implement experimental pluggable analysis interface * example: find_unstable_api.jl * wip: include plugins documentation * setup `JETInterfaces`, which allows to use the pluggable analysis framework more easily * API docs * add simple tests for the pluggable-analysis framework
This PR set-ups
ignored_patternsinterface to ignore certain patternsof reports, which can be configured by users extensively.
ignored_patternsis supposed to be an iterator of predicate functionand if any of given
ignored_patternsmatches a report in question,the report will just be ignored (and nor cached).
The predicate function will be called before a report is actually
constructed for the possible cut-off of the computational cost to
construct the report. Thus its signature is:
(T::Type{<:InferenceErrorReport}, interp::JETInterpreter, sv::InferenceState, spec_args::Tuple), where:Tspecifies the kind of reportinterpgives the context of whole analysissv::InferenceStategives the local context of analysisspec_argswill be report-specific argumentsTo inject predicate checks, now each report is constructed via
@report!macro, which first checks if the report matches any of
ignored_patterns,and if not, constructs the report and pushes it to
JETInterpreterasthe previous
report!function did.This PR also defines
DEFAULT_IGNORED_PATTERNS, namelyignored_patternsapplied by default. Currently it consists of
ignore_corecompiler_undefglobal,which ignores undefined global names in
Core.Compiler, and it shouldhave some positive effects, like reduce false positive error reports
involved with
Base.return_typesand its family in general, improveanalysis performance for JET's self-profiling, etc.
The support of user-predicate functions specified via .JET configuration
file is somewhat tricky, but currently this PR uses RuntimeGeneratedFunctions.jl
and it seems to work. I'm not sure if
@nospecializenotations workscorrectly in
RuntimeGeneratedFunctions, so some insights or benchmarkson it will be very welcomed.