utahplt / FloatTrackerExamples

Examples for the FloatTracker.jl repository
MIT License
1 stars 1 forks source link

Injector: ignore specific functions #8

Closed bennn closed 1 year ago

bennn commented 1 year ago

In #5 , one of the random injections wound up in a function that (I claim) is protected against NaNs.

Even if my claim is wrong, it'd be helpful to ignore that function and let random NaNs appear in other places.

(For now there is a workaround: target specific functions one at a time. That might be better overall.)


The current injector supports only opt-in functions & libraries:

## Injector Fields

 - `active::Boolean` inject only if true

 - `ninject::Int` maximum number of NaNs to inject; gets decremented every time
   a NaN gets injected

 - `odds::Int` inject a NaN with 1:odds probability—higher value → rarer to
   inject

 - `functions::Array{FunctionRef}` if given, only inject NaNs when within these
   functions; default is to not discriminate on functions

 - `libraries::Array{String}` if given, only inject NaNs when within this library.

 - `record::String` if given, record injection invents in a way that can be
   replayed later with the `replay` argument.

 - `replay::String` if given, ignore all previous directives and use this file
   for injection replay.

`functions` and `libraries` work together as a union: i.e. the set of possible NaN
injection points is a union of the places matched by `functions` and `libraries`.
bennn commented 1 year ago

whoops, belongs in FloatTracker.jl