aboutsummaryrefslogtreecommitdiffstats
path: root/prog/heatmap_test.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.
* tools/syz-linter: check t.Logf/Errorf/Fatalf messagesDmitry Vyukov2024-04-171-4/+4
| | | | | Fix checking of Logf, it has string in 0-th arg. Add checking of t.Errorf/Fatalf.
* pkg/image: factor out from progDmitry Vyukov2022-12-221-1/+2
| | | | | | | Move image compression-related function to a separate package. In preperation for subsequent changes that make decompression more complex. Prog package is already large and complex. Also makes running compression tests/benchmarks much faster.
* pkg/testutil: move iterCount from prog packageDmitry Vyukov2022-12-221-1/+1
|
* prog: refactor HeatMapDmitry Vyukov2022-11-251-2/+2
| | | | | | 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).
* pkg/testutil: add RandSource helperDmitry Vyukov2022-11-231-1/+3
| | | | | The code to send rand source is dublicated in several packages. Move it to testutil package.
* prog: add a notion of a mutation "heatmap"Hrutvik Kanabar2022-11-211-0/+117
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.