Writes JIPT v1: eight-byte magic, little-endian u64 name/frame counts, length-prefixed UTF-8 names, then frames (duration, span count) and spans (zone, parent+1, start, end). Times are ns. Refuses invalid trees and files over 64 MiB. The caller owns the trace.
Signature
save_trace :: (trace: *Trace, path: string) -> bool