aboutsummaryrefslogtreecommitdiffstats
path: root/prog/heatmap.go
Commit message (Collapse)AuthorAgeFilesLines
* all: use min/max functionsDmitry Vyukov2025-01-171-4/+1
| | | | They are shorter, more readable, and don't require temp vars.
* prog: adjust number of image mutationsDmitry Vyukov2022-11-251-2/+11
| | | | | | | | Also adjust number of mutations per image. We do one per 128K of interesting data. But we have no single seed that has so much interesting data. Here is the amount of interesting data in seeds: https://gist.github.com/dvyukov/566b20364610d80e5d0534524546c3f0 Reduce this cuhnk size to 4K.
* prog: refactor HeatMapDmitry Vyukov2022-11-251-11/+15
| | | | | | Provide NumMutations method instead of Size. It allows HeatMap to choose number of mutations better (e.g. for completely empty/flat images w/o interesting data).
* prog: add a notion of a mutation "heatmap"Hrutvik Kanabar2022-11-211-0/+135
In this context, a heatmap is a flexible mechanism to choose where to mutate some collection of bytes with some underlying probability distribution, which could be dependent on the bytes themselves. This commit defines the interface for heatmaps, implements a generic one, and adds a test for it. The expected usage of the heatmap inferface is: - Caller selects heatmap type based on program type (or other logic), and calls the appropriate `MakeXYZHeatmap`. Currently there is only one, but over time we will add more with differing probability distributions. - Caller queries the heatmap using `hm.ChooseLocation(r)` for random input `r`. The generic heatmap is based on the current compression for disk images. It avoids mutating within long runs of constant bytes by viewing the file as a series of 64-byte chunks, and ignoring chunks which consist of a single repeated byte.