add support for incremental snapshots#103
Conversation
a5227b4 to
73d4e3d
Compare
73d4e3d to
17fb0e0
Compare
|
This is more for a discussion. If I understand correctly, what we do now is like this:
I wonder what would be the reason that we don't do like this in the
This way it would look more simple to manage. Is it because we don't want to discard the tmp snapshot too early? |
Yup, that's right.
I think this works if I also think |
2f3862a to
0444d65
Compare
a29f111 to
2548f1c
Compare
|
Implemented @tokatoka suggestion so that There is a memory leak which I'm investigating. I'm also going to come up with a benchmarking plan because in theory this should give better and quicker coverage than running without incremental snapshots. One TODO is incremental snapshots will be behind a flag so that it's not always enabled. Lastly, there is a commit here Crypt-iQ@1567d36 that can be used to increase the instruction limit when testing. |
2548f1c to
2ecef2d
Compare
…d_next Also change the scenarios to accept runners
…incremental snapshots The IncrementalSnapshotStage is configured to run with an incremental snapshot for a configurable number of iterations. The mutators have awareness of the snapshot position.
This should prevent some cache thrashing when inputs are evicted to disk.
2ecef2d to
10cad9c
Compare
|
The results from benchmarking incremental snapshots to master were underwhelming. I ran the two branches on a clean machine each with 6 cores for 2 hours with the instruction count increased 10x to 40960. I then parsed the stdout of each to create the below graphs. I also compared the coverage with a script similar to
The results in the run that produced the graph were pretty consistent across several different benchmarks where I varied:
In the vast majority of them, incremental snapshots had less coverage (typically in Going into this, I expected incremental snapshots to have less coverage overall, but "deeper" coverage in some areas. There are some "quirky" edges that are hit (e.g. being unable to fetch a value from the index in |

Posting mainly to get high-level feedback on the design before I continue any further.
Basically, an
IncrementalSnapshotStageis created that wraps the mutation stage and will insert anOperation::IncrementalSnapshotinto the program (not persisted to the corpus). Mutators are then aware not to mutate before the snapshot point. It then runs for 50 iterations with the incremental snapshot.It is pretty slow which is something I want to look into. I can clean things up a lot (i.e. not making it default to incremental snapshots). I think some more intelligent snapshot placement could be used as well (not placing the snapshot operation so early in the program, only placing it after certain messages / operations, etc.). Another thing that is wonky is that sometimes the input gets evicted to disk since we're using a
CachedOnDiskCorpus, which means occasionally we need to reload the input.