This splits the trees into threads when evaluating them. It also has a mechanism to return early if only one of the two threads hits a NaN. Thus we should detect and return early for NaNs much quicker.
It does this by using a shared channel that the threads can post to. It has a spin lock on this shared channel.
TODO:
[ ] Find a way to kill a thread early if returning
[ ] Fix issue with unstable type return value.
[x] Check if Enzyme still works with this on.
Nope!
[ ] Disable this by default (as it is experimental), and have a flag for turning it on.
[ ] See if this is faster at all compared to regular evaluation.
This splits the trees into threads when evaluating them. It also has a mechanism to return early if only one of the two threads hits a NaN. Thus we should detect and return early for NaNs much quicker.
It does this by using a shared channel that the threads can post to. It has a spin lock on this shared channel.
TODO: