c4-project / c4f

The C4 Concurrent C Fuzzer
MIT License
13 stars 1 forks source link

Add thread and action caps to fuzzer config #159

Closed MattWindsor91 closed 4 years ago

MattWindsor91 commented 4 years ago

It turns out that Litmus has a tendency to thrash almost-endlessly if given a number of threads equal to the number of logical cores in the target machine. As such, it would be useful to have a tunable cap on the number of threads generated, that is then respected by program.make.empty.

I've already been considering adding another tunable cap on the number of actions (it's hardcoded at the moment). As such, it makes sense to pool the implementation of both.

A sketch of syntax would look like this:

fuzz {
  # action weights go here
  set param cap.threads to 3
  set param cap.actions to 20
}

This is similar to (and complements) #134 but covers integer parameters rather than Boolean parameters.

MattWindsor91 commented 4 years ago

Done circa 9fd1415b0eee30711b4c3f859f14d9f8696da9fd.