The disappearing function (stalled exception?)

I have the following snippet in this repo

    │   print("iou: entering")
    │   if (
    │   │   first[X_MIN] > second[X_MAX]
    │   │   or second[X_MIN] > first[X_MAX]
    │   │   or first[Y_MIN] > second[Y_MAX]
    │   │   or second[Y_MIN] > first[Y_MAX]
    │   ):
    │   │   print("iou: non overlap, returning 0")
    │   │   return 0
    │   │
.....
    │
    │   print("iou: overlap ", result)
    │   return result

When I run magic run test I see the function entering, it doesn’t seem to return but then the test completes. The function is mostly doing numerical computations but there is an if.

nms: calling iou
nms: calling iou
nms: calling iou
nms: calling iou
iou: entering
iou: entering
iou: entering
iou: entering
test: after call, on the cpu HostBuffer([1, 1, 1, 1])

How do I get the exceptions? I assume my code has a bug leading to an exception.

Thanks a lot!

Marius

After more exploration, changing the iou function to return a hardcoded constant (1.0) allows the calling function to complete its execution.

nms: calling iou

iou: entering

nms: iou returned overlap 1.0

nms: discarding box 1

Returning the actual computation does not show the additional logging (exception?).