By: Tom Sydney Kerckhove <syd@cs-syd.eu>
Add fine-grained mutation instrumentation exceptions
Introduces five granularities of exception, from coarsest to finest:
- Disable a mutation type globally via Nix: disabledMutations = ["Arith"]
- Disable all mutations on a module: {-# ANN module ("DisableMutations" :: String) #-}
- Disable specific mutation types on a module: {-# ANN module ("DisableMutations: Arith, BoolLit" :: String) #-}
- Disable all mutations on a function: {-# ANN f ("DisableMutations" :: String) #-}
- Disable specific mutation types on a function: {-# ANN f ("DisableMutation: Arith" :: String) #-}
String annotations require no import. The plugin reads them via GHC's
annotation infrastructure (tcg_ann_env / findAnns deserializeWithData).
Per-function filtering uses local on the ReaderT env inside instrumentBind.
Nix: addManifest, mutationCheck, and makeMutationReport all accept
disabledMutations, passed through as --disable-mutation= plugin opts.
Example modules ExceptionLib and FunctionExceptionLib demonstrate each
annotation form with accompanying tests.
| Time to Start | Worker time | Duration | Time to finish | |
| Config | 0s | 3s | 3s | 3s |
| Eval | 3s | 35s | 35s | 39s |
| Build | 7s | 47s | 22s | 29s |
| Test | - | - | - | - |
| Deploy | - | - | - | - |
| Suite | 0s | 1m26s | 39s | 39s |