pub const MAX_DEPTH: u32 = 500;
The deepest nesting the recursive algorithms accept: safe on a 2 MiB thread stack even in debug builds (measured margin: about 1.5x).