-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[TODO] nim-dustmite source code minimization tool for automated bug reduction #8276
Comments
IIRC @zielmicha had a tool that does this. |
I'm not too happy these tools as they tend to produce "too minimal" test cases that then get fixed but in the real, larger example the problem remains. Minimal test cases cause an "overfit". |
DustMite has, more or less, pluggable splitters: There is already support for reducing files in a second "syntax" (patch files). D mode should, to some extent, work with any curly-brace languages already though.
In our experience this happens very rarely (less than 1% of test cases). In any case, this mistake can be done by humans as well, who are not aware of the exact internal mechanics that cause the bug. What happens more commonly is that, along the way of reducing the intended bug, DustMite generates a test case that triggers a different bug with similar symptoms (e.g. a compiler segfault), and then gets sidetracked into reducing that bug. In such cases, a more strict test script (e.g. which checks the segfault stack trace) is the solution. https://github.com/CyberShadow/DustMite/wiki/Detecting-a-specific-segfault |
What is a "compiler ICE"? |
I added the Won't fix label, because that is how I understand the status quo. |
@timotheecour Feel free to submit one, it's not a bad idea, but we don't intent to work on one. |
internal compiler error; looks like nim doesn't use this terminology used in some other languages; I rephrasd it as just 'compiler error'
|
see recent project: disruptek/dust: DUST is Unattended Syntax Truncation |
I am obviously extremely biased, but at this point I would recommend implementing similar tools as an add-on to DustMite. I spent some time earlier this year working on some algorithmic improvements to DustMite which made it significantly faster than earlier versions. If implementing a Nim parser/lexer in D is undesirable and a Nim parser/lexer is already available as a Nim library that could be used for this purpose, then what we can do is make the Nim program produce an intermediary format with a pre-split reducible tree that DustMite can consume, and invoke DustMite with it. I'll be happy to help with the D/DustMite side if there's interest. CC @disruptek |
Sounds great; gimme a spec and I'll write the Nim side. Thank you! |
Alright! How does this look: https://github.com/CyberShadow/DustMite/wiki/JSON-archives The implementation is in the |
Sorry I missed this. Looks pretty easy; I will reach out in the repo if I have any trouble. Thanks again! Looking forward to seeing this thing work. 🙂 |
a more recent blog about dustmite: https://dlang.org/blog/2020/04/13/dustmite-the-general-purpose-data-reduction-tool/ + related discussion: https://forum.dlang.org/post/pruiwhotmlfselnplztf@forum.dlang.org |
As I was trying to reduce a compiler error that only triggers in my full project and is hard/tedious to minimize manually, it occurred to me we could try to develop a source code minimization tool to automate that.
in D, that tool exists, see https://github.com/CyberShadow/DustMite and docs https://github.com/CyberShadow/DustMite/wiki ; developped by @CyberShadow
It's used extensively by the community for investigating bugs; it's especially invaluable for those that trigger in your whole project but are hard to isolate to a minimal bug (which is the 1st step to solving it). I've used it myself a lot for great benefit.
It turns out dustmite is not super tied to D language (doesn't need to know about D's semantics) ; in fact it can reduce C++ code too as it only operates at much shallower level.
@CyberShadow any help / pointers in this thread would be most welcome!
links
The text was updated successfully, but these errors were encountered: