tools: port dust a source module minimizer#979
tools: port dust a source module minimizer#979chore-runner[bot] merged 58 commits intonim-works:develfrom
dust a source module minimizer#979Conversation
zerbina
left a comment
There was a problem hiding this comment.
I did a first pass and left some minor style suggestions.
also there is a bug when it comes to debugging types... sigh
added to to `tools` build in `koch`
Co-authored-by: Clyybber <darkmine956@gmail.com>
Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
2a5cb71 to
79b0995
Compare
the problem is that right now we generate more and more errors over time, so the minimization process diverges, rather than converging.
right now there is a bug in `semcall.semResolvedCall` where a `tyError` from a faux match doesn't have an error and is being wrapped I'm guessing this will require removing a bunch of unwrapping logic to fix, but not quite sure.
Wrapping nodes is no longer necesssary as they're reported immediately. This was resulting in attempting to wrap nodes that no longer contain errors but resulted in them.
|
Dust now works and successfully reduces the broken code in Another thing that will likely help a fair bit is a breadth first search and early elimination of the search space, but I'm not sure how to implement that (besides the breadth first) just yet. |
This was a misunderstanding of the issue and the fix isn't required (it'll actually likely cause issues).
dustdust a test case minimizer
|
Merge requested by: @saem Contents after the first section break of the PR description has been removed and preserved below:
|
|
/merge |
|
/merge |
|
sigh... I'm guessing it didn't run the leak sanitizer locally when I did ran the tools tests via |
|
I presently can't get a local reproduction, so while I wait to hear back from others about how I might do that I took a stab in the dark and enabled Reproduction steps I've tried:
|
|
/merge |
…c` or removed entirely
|
/merge |
Summary
Add a compiler error message minimizer executable to the compiler
distribution, called
dust. Given a compiler error message,dust $compiler_options $module_to_reducewill reduce said module'scode in place until a minimal module that generates the same error is
produced.
Details
dustis a new executable that ships with NimSkull, that minimizes amodule down to the smallest failing module. This is useful for those
submitting bugs, allowing for easy reduction in test cases size, or
those looking to reduce failing code to better understand it.
It can be run by calling
dust <file_to_minimize.nim>, it will thenreduce the file to the minimal failing case. This is an inplace edit --
so be sure to save a copy if you want to keep the original.
In addition to the introduction of
dust, a dedicatedtesteralsoexists meant to facilitate testing of the tool, it's a simple driver for
the
dustexecutable.Porting Details
dustwas originally written by @disruptek, this ported version has afew key differences:
always reducing with a like for like compiler
70x)
testerthat can be run via CI