Quick answer: Tracy profiler crashing or losing data on deeply recursive functions? Tracy’s per-thread zone stack has a depth cap — deep recursion blows it.

A pathfinder recurses 10000 deep on pathological maps. Tracy disconnects mid-frame.

Stack Depth Cap

Tracy stack is limited (default 1024 levels). Exceeding overflows and disconnects. Either limit recursion via iteration or skip ZoneScoped on the recursive function.

Skip Inner Frames

Add ZoneScoped only at the entry function; inner recursive calls run un-profiled. Total cost still visible at the outer scope.

Convert to Iteration

Iterative versions of pathfinding etc. have constant stack depth. Better for both Tracy and OS stack health.

Build Flag for Conditional Zones

Wrap inner zones in #ifndef DISABLE_DEEP_ZONES. Toggle off for runs that would overflow.

Verifying

Tracy captures complete frames even on worst-case recursive paths. No mid-frame disconnects.

“Tracy zone stack is capped. Limit zones in deep recursive functions or convert to iteration.”

For algorithms with unbounded depth, iterative implementations help both profiling and stack safety in the runtime.