-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
p2p-governor: Change the PickScript to pick elements not offsets.
The previous representation of pick scripts used [Int], a list of offsets to pick. These are offsets within the set that the governor gives to us. This is nice in one sense, that it can be interpreted to make sense irrespecive of what set the governor gives us. The downside is that its shrinking behaviour is quite odd and hence poor. It is odd because the modulo behaviour means the choices are highly unstable, and that does not sit well with shrinking. So we switch to an alternative representation where the pick script has a set of elements that it wants to pick. We arrange to select this set as an arbitrary subset of the total set of elements, which are the peers in the graph in the mock environment. The advantage of this is that the shrinking behaviour is much clearer. The choices become stable as the other things are shrunk. The slight downside is that the sets we get to pick from are chosen by the governor at runtime, which can often be a small subset of the total peers available in the graph. But for the script we have to pick the subset up front. So to resolve this we need to pick quite large sets up front so that the intersection between the set we generated, and the set the governor asks us to pick from will frequently have a non-trivial intersection. So the approach we take is to generate random subsets that roughtly half the size of the total set.
- Loading branch information
Showing
3 changed files
with
70 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters