I've painted myself into a corner with comptime and I'm seeking advice

Probably my last update. Again, thank you all for the input.

For the sake of time I did not create a whole serialization/deserialization schema for all my types. Maybe I’ll revisit that later, but just by setting some max values I could re-use all the existing code. For example:

// old implementation that was passed into makeZonMap
pub fn Zon() type {
    return struct {
        pub const Edge = struct {
            direction: Direction,
            line_code: [2]u8,
            line_length: f32,
            id: u32,
            line: LineSlice,
        };

        pub const Line = struct {
            lla: [3]f64,
            offset: f32,
            v: VertSlice,
        };

        pub const VertSlice = struct {
            start: u32 = 0,
            end: u32 = 0,
        };

        pub const LineSlice = struct {
            start: u32 = 0,
            end: u32 = 0,
        };

        pub const Data = struct {
            vs: [*]const [3]f64,
            vs_len: u32,

            lines: [*]const Line,
            lines_len: u32,

            edges: [*]const Edge,
            edges_len: u32,
        };

        data: *const Data = &empty_data,

        const empty_vs = [0][3]f64{};
        const empty_lines = [0]Line{};
        const empty_edges = [0]Edge{};
        const empty_data = Data {
            .vs = &empty_vs,
            .vs_len = 0,
            .lines = &empty_lines,
            .lines_len = 0,
            .edges = &empty_edges,
            .edges_len = 0,
        };

        const Self = @This();

        /// takes in the <tuple item>.@"1".zon from geodata.zon
        pub inline fn init(comptime zon: anytype) Self {
            comptime {
                var self = Self{};

                @setEvalBranchQuota(10000 * zon.edge_list.len);

                const num_edges: u32 = zon.edge_list.len;
                const num_lines: u32 = blk: {
                    var out: u32 = 0;
                    for(zon.edge_list) |edge| {
                        out += edge.line.len;
                    }
                    break :blk out;
                };
                const num_vs: u32 = blk: {
                    var out: u32 = 0;
                    for(zon.edge_list) |edge| {
                        for(edge.line) |segment| {
                            out += segment.v.len;
                        }
                    }
                    break :blk out;
                };

                var vs_buf: [num_vs][3]f64  = undefined;
                var vs_index = 0;
                var lines_buf: [num_lines]Line = undefined;
                var lines_index = 0;
                var edges_buf: [num_edges]Edge = undefined;
                var edges_index = 0;

                for(zon.edge_list) |edge| {
                    var new_line_list: LineSlice = undefined;
                    new_line_list.start = lines_index;
                    for(edge.line) |line| {
                        var new_vert_list: VertSlice = undefined;
                        new_vert_list.start = vs_index;
                        for(line.v) |v| {
                            vs_buf[vs_index] = v;
                            vs_index += 1;
                        }
                        new_vert_list.end = vs_index;

                        const new_line = Line {
                            .lla = line.lla,
                            .offset = line.offset,
                            .v = new_vert_list,
                        };

                        lines_buf[lines_index] = new_line;
                        lines_index += 1;
                    }
                    new_line_list.end = lines_index;

                    const new_edge = Edge {
                        .direction = Direction.fromLineCodeComptime(edge.line_code),
                        .line_code = edge.line_code,
                        .line_length = edge.line_length,
                        .line = new_line_list,
                        .id = edge.edgeId,
                    };

                    edges_buf[edges_index] = new_edge;
                    edges_index += 1;
                }

                const final_edges = edges_buf;
                const final_lines = lines_buf;
                const final_vs = vs_buf;

                self.data = &.{
                    .edges = &final_edges,
                    .edges_len = @intCast(num_edges),
                    .lines = &final_lines,
                    .lines_len = @intCast(num_lines),
                    .vs = &final_vs,
                    .vs_len = @intCast(num_vs),
                };

                return self;
            }
        }
...
/// current implementation, everything below this is pretty much the same
pub const Spline = extern struct {
    const MAX_VS = 70_000;
    const MAX_LINES = 9_000;
    const MAX_EDGES = 1_500;

    vs: [MAX_VS][3]f64,
    vs_len: u32,

    lines: [MAX_LINES]Line,
    lines_len: u32,

    edges: [MAX_EDGES]Edge,
    edges_len: u32,
...

EDIT: also I made the jump to 0.17.0 during this rework so this isn’t 1:1 but compile times have been noticeably faster so far! Like to an insane degree