Our only crashing bug on iOS was due to backgrounding logic and ML. This logic has continued to haunt us and has been the subject of a number of related bugs that we caught before production.
This PR introduces a new class ActiveStateComputation that behaves similarly to a serial DispatchQueue but runs the computation iff the app is in the active state.
We can use this to protect our main loop ML, warmUp routines, and to enable running completion loop ML with hardware acceleration safely (currently we run completion loop ML on the CPU for safety).
Our only crashing bug on iOS was due to backgrounding logic and ML. This logic has continued to haunt us and has been the subject of a number of related bugs that we caught before production.
This PR introduces a new class
ActiveStateComputation
that behaves similarly to a serialDispatchQueue
but runs the computation iff the app is in the active state.We can use this to protect our main loop ML, warmUp routines, and to enable running completion loop ML with hardware acceleration safely (currently we run completion loop ML on the CPU for safety).