]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] internal/fuzz: coarsen each coverage counter when taking a snapshot
authorJay Conrod <jayconrod@google.com>
Fri, 30 Jul 2021 22:55:31 +0000 (15:55 -0700)
committerJay Conrod <jayconrod@google.com>
Mon, 23 Aug 2021 20:58:28 +0000 (20:58 +0000)
commit7b6893d2d2f7ff22efdbc29c6729066be8857dfc
tree2d6d96c4b8964262a2fc7ee8d31dba5cb72354d6
parentf89b4c8d82c028d635eb8e685dd92dceb0027438
[dev.fuzz] internal/fuzz: coarsen each coverage counter when taking a snapshot

When taking a snapshot of coverage counters, round each counter down
to the nearest power of 2.

After coarsening, at most 1 bit per byte will be set. This lets the
coordinator use a coverage array as a mask that distinguish between
code that's executed many times for a given input and code that's
executed once or a few times. For example, if a byte in this array has
the value 12, it means the block has been executed at least 4 times
and at least 8 times with different inputs.

Also change the term "edge" to "bits" or just be more vague about how
coverage is represented.

Also add more code that may be "interesting" in test_fuzz_cache.

Change-Id: I67bf2adb298fb8efd7680b069a476c27e5fdbdae
Reviewed-on: https://go-review.googlesource.com/c/go/+/338829
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
src/internal/fuzz/coverage.go
src/internal/fuzz/fuzz.go
src/internal/fuzz/worker.go