How do you approach debugging a complex issue in your code?
Implement a focused debugging utility that compares an actual execution trace with an expected trace and identifies the first differing snapshot. Return -1 when both traces match exactly.
Use find_first_trace_mismatch(actual, expected), where each trace is a list of comparable snapshots, and return the zero-based mismatch index.
def find_first_trace_mismatch(actual, expected):