To determine the phase, declare a variable in the static:
bool mutable m_bIsCompiling;
Set it to true at the beginning of @RESET. Set it to false at the end of GD. It will get set to false over and over but we don’t care. Remember, GD is called only during the reconstruction phase so the first time it’s called, we know that’s where we are. Easy.