diff options
| author | Hrutvik Kanabar <hrutvik@google.com> | 2022-10-21 15:48:05 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-11-21 11:06:14 +0100 |
| commit | 7954d07c228dd9ce63b7ebd13239b4d1f2c35233 (patch) | |
| tree | 6ec3684c45217c6f4ae7f3a7ba42e222a9012865 /pkg/csource | |
| parent | c49ccaee639efae8b8249272a79e700e2c1954c6 (diff) | |
prog: add a notion of a mutation "heatmap"
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.
Diffstat (limited to 'pkg/csource')
0 files changed, 0 insertions, 0 deletions
