Skip to documentation
SLOP

tiny.smg.EdgeFindingPlan

Reference tiny.smg EdgeFindingPlan

Defined in rules.

API (15)

Actions

Public operations.

Types and contracts

Public types and contracts.

Fields and members

Public fields and members.

No direct callersNo direct callsrulesEdgeFindingPlan
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: tools/smg/src/rules.zig:40

zig
pub const EdgeFindingPlan = struct {    pub const Limits = struct {        edges: usize,    };    pub const Capacity = struct {        edges: usize,        bytes: usize,        pub fn derive(limits: Limits) error{CapacityOverflow}!Capacity {            return .{                .edges = limits.edges,                .bytes = std.math.mul(                    usize,                    limits.edges,                    @sizeOf(model.Edge),                ) catch return error.CapacityOverflow,            };        }    };    pub const InitError = std.mem.Allocator.Error || error{CapacityOverflow};    pub const claim: alloc_phase.capacity.Declaration = .{        .source = .{            .id = "smg.edge_finding_plan",            .kind = .phase_static,            .limit_source = .caller,            .storage = .{                .covered = &.{                    .{                        .id = "exact_edge_finding_result",                        .lifetime = .transferred,                        .detail = "exact edge finding result",                    },                },                .excluded = &.{                    "borrowed graph nodes edges indexes and model strings",                    "parsed rule fields and finding message text",                    "rule aggregation rendering and terminal output",                },            },            .capacity = .{                .inputs = &.{                    alloc_phase.capacity.bindInput(Limits, "edges", "edges"),                },                .type_selectors = &.{                    alloc_phase.capacity.bindType(model.Edge, "edge"),                },                .nodes = &.{                    .{ .input = 0 },                    .{ .scale = .{ .node = 0, .coefficient = .{ .size_of_concrete_type = 0 } } },                },                .assertions = &.{.{                    .scope = .closure_total,                    .measure = .retained,                    .relation = .exact,                    .expression = 1,                }},            },            .overload = .{                .kind = .reject_before_seal,                .detail = "checked survey arithmetic and exact acquisition reject before fill",            },            .risks = .{                .transitive = .{                    .status = .witnessed,                    .detail = "sealed fill and in-place ordering call no allocator-backed child",                },                .foreign = .{                    .status = .excluded,                    .detail = "rule matching and result production perform no foreign effects",                },            },            .obligations = &.{                .{ .key = "smg_edge_finding_plan_capacity_capacity_model", .role = .capacity_model },                .{ .key = "smg_edge_finding_plan_capacity_overload", .role = .overload },                .{ .key = "smg_edge_finding_plan_oom", .role = .overload },                .{ .key = "smg_edge_finding_plan_sealed", .role = .transitive_risk },                .{ .key = "smg_edge_finding_plan_integration", .role = .foreign_risk },            },        },        .bindings = .{            .owner = @This(),            .seal = .{                .family = alloc_phase.capacity.selector(@This().activate),                .premise = .{                    .class = .checked_semantic_fact,                    .authority = .checker,                },            },            .teardown = .{                .family = alloc_phase.capacity.selector(@This().deinit),                .premise = .{                    .class = .checked_semantic_fact,                    .authority = .checker,                },            },        },    };    phase: alloc_phase.capacity.Phase,    capacity: Capacity,    edges: []model.Edge,    filled: usize = 0,    pub fn init(allocator: std.mem.Allocator, limits: Limits) InitError!EdgeFindingPlan {        const capacity = try Capacity.derive(limits);        return .{            .phase = .initialization,            .capacity = capacity,            .edges = try allocFindingEdges(allocator, capacity.edges),        };    }    pub fn activate(self: *EdgeFindingPlan) void {        std.debug.assert(self.phase == .initialization);        std.debug.assert(self.filled == 0);        self.phase = .steady;    }    pub fn append(self: *EdgeFindingPlan, edge: model.Edge) void {        std.debug.assert(self.phase == .steady);        std.debug.assert(self.filled < self.edges.len);        self.edges[self.filled] = edge;        self.filled += 1;    }    pub fn sort(self: *EdgeFindingPlan) void {        std.debug.assert(self.phase == .steady);        std.debug.assert(self.filled == self.edges.len);        view.sortEdges(self.edges);    }    pub fn transfer(self: *EdgeFindingPlan) []const model.Edge {        std.debug.assert(self.phase == .steady);        std.debug.assert(self.filled == self.edges.len);        const edges = self.edges;        self.phase = .teardown;        self.edges = @constCast((&[_]model.Edge{})[0..]);        self.filled = 0;        return edges;    }    pub fn deinit(self: *EdgeFindingPlan, allocator: std.mem.Allocator) void {        std.debug.assert(self.phase != .teardown);        self.phase = .teardown;        freeFindingEdges(allocator, self.edges);        self.* = undefined;    }};

Source: tools/smg/src/root.zig:117

zig
pub const EdgeFindingPlan = @import("rules.zig").EdgeFindingPlan;
Called byCallsNo direct callstest; no linktools.smg.src.rulestest: edge finding plan capacity matc...EdgeFindingPlan.Capacityderive
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsrulescheckDenyrulescheckNamespaceHandleImportstest; no linktools.smg.src.rulestest: edge finding plan fills exact s...test; no linktools.smg.src.rulestest: edge finding plan initializatio...EdgeFindingPlanactivate
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsrulescheckDenyrulescheckNamespaceHandleImportstest; no linktools.smg.src.rulestest: edge finding plan fills exact s...EdgeFindingPlanappend
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsrulescheckDenyprivate; no linktools.smg.src.rulescheckEdgeFindingPlanInitAllocationFai...rulescheckNamespaceHandleImportstest; no linktools.smg.src.rulestest: edge finding plan fills exact s...test; no linktools.smg.src.rulestest: edge finding plan initializatio...private; no linktools.smg.src.rulesfreeFindingEdgesEdgeFindingPlandeinit
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsrulescheckDenyprivate; no linktools.smg.src.rulescheckEdgeFindingPlanInitAllocationFai...rulescheckNamespaceHandleImportstest; no linktools.smg.src.rulestest: edge finding plan fills exact s...test; no linktools.smg.src.rulestest: edge finding plan initializatio...private; no linktools.smg.src.rulesallocFindingEdgesEdgeFindingPlaninit
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsrulescheckDenyrulescheckNamespaceHandleImportstest; no linktools.smg.src.rulestest: edge finding plan fills exact s...viewsortEdgesEdgeFindingPlansort
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsrulescheckDenyrulescheckNamespaceHandleImportsEdgeFindingPlantransfer
Static calls · unresolved targets: 0 · external targets: 0.

Audit

Definitions12
Public names24
Members7
Version26.7.0
Revisiondaab053ee433