def depth.go
import bend-blas-lapack@0.0.0.1/mat.bend as Matimport Base
26# the depth of the smallest power-of-two block holding count floats
27def depth.go(fuel: Nat, +n: U32, +d: Nat, +cap: U32) -> Nat:
28 match fuel:
29 case 0n:
30 d
31 case 1n+p:
32 Bool.pick(Nat, U32.is_lt(cap, n), depth.go(p, n, 1n+d, (cap * 2 : U32)), d)