egraphs-good / extraction-gym

benchmarking e-graph extraction
MIT License
27 stars 16 forks source link

Extra tests & better checking of extraction results. #25

Closed TrevorHansen closed 9 months ago

TrevorHansen commented 9 months ago

In creating the nicer ILP extractor (#16) I've had lots of annoying rare errors that have been hard to pin down. So I've made a fuzzer that randomly generates egraphs, then I run different extractors on those random egraphs.

Because the ILP extractors (ilp-cbc & faster-ilp-cbc) are optimal for DAG-extraction, the DAG-extractions from the other extractiors should never be cheaper on a given egraph. The effect of all this is that the extractors get tested on tens of millions of egraphs. It's found lots of problems with the extractors.

That's the back story.

Anyway, this PR contains some egraph that the fuzzer has generated, some that I've handcrafted to check extreme cases and better testing of extraction results.

These extra tests reveal problems with the faster-greedy-dag & global-greedy-dag extractors. Both of which fail on some instances.

The faster-greedy-dag returns extractions with cycles and the global-greedy-dag sometimes returns extractions with the wrong nodes selected (i.e. a node will be selected for the wrong class). I'll create cases for these.