Skip to documentation
SLOP

tiny.smg.NodeFindingPlan

Reference tiny.smg NodeFindingPlan

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 callsrulesNodeFindingPlan
Static calls · unresolved targets: unknown · external targets: unknown.

Source

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

zig
pub const NodeFindingPlan = struct {    pub const Limits = struct {        nodes: usize,    };    pub const Capacity = struct {        nodes: usize,        bytes: usize,        pub fn derive(limits: Limits) error{CapacityOverflow}!Capacity {            return .{                .nodes = limits.nodes,                .bytes = std.math.mul(                    usize,                    limits.nodes,                    @sizeOf([]const u8),                ) catch return error.CapacityOverflow,            };        }    };    pub const InitError = std.mem.Allocator.Error || error{CapacityOverflow};    pub const claim: alloc_phase.capacity.Declaration = .{        .source = .{            .id = "smg.node_finding_plan",            .kind = .phase_static,            .limit_source = .caller,            .storage = .{                .covered = &.{                    .{                        .id = "exact_node_finding_result",                        .lifetime = .transferred,                        .detail = "exact node finding result",                    },                },                .excluded = &.{                    "borrowed graph nodes indexes and model strings",                    "parsed rule fields and finding message text",                    "rule aggregation rendering and terminal output",                },            },            .capacity = .{                .inputs = &.{                    alloc_phase.capacity.bindInput(Limits, "nodes", "nodes"),                },                .type_selectors = &.{                    alloc_phase.capacity.bindType([]const u8, "const_u8"),                },                .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_node_finding_plan_capacity_capacity_model", .role = .capacity_model },                .{ .key = "smg_node_finding_plan_capacity_overload", .role = .overload },                .{ .key = "smg_node_finding_plan_oom", .role = .overload },                .{ .key = "smg_node_finding_plan_sealed", .role = .transitive_risk },                .{ .key = "smg_node_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,    nodes: [][]const u8,    filled: usize = 0,    pub fn init(allocator: std.mem.Allocator, limits: Limits) InitError!NodeFindingPlan {        const capacity = try Capacity.derive(limits);        return .{            .phase = .initialization,            .capacity = capacity,            .nodes = try allocFindingNodes(allocator, capacity.nodes),        };    }    pub fn activate(self: *NodeFindingPlan) void {        std.debug.assert(self.phase == .initialization);        std.debug.assert(self.filled == 0);        self.phase = .steady;    }    pub fn append(self: *NodeFindingPlan, node: []const u8) void {        std.debug.assert(self.phase == .steady);        std.debug.assert(self.filled < self.nodes.len);        self.nodes[self.filled] = node;        self.filled += 1;    }    pub fn sort(self: *NodeFindingPlan) void {        std.debug.assert(self.phase == .steady);        std.debug.assert(self.filled == self.nodes.len);        std.mem.sort([]const u8, self.nodes, {}, cmpString);    }    pub fn transfer(self: *NodeFindingPlan) []const []const u8 {        std.debug.assert(self.phase == .steady);        std.debug.assert(self.filled == self.nodes.len);        const nodes = self.nodes;        self.phase = .teardown;        self.nodes = @constCast((&[_][]const u8{})[0..]);        self.filled = 0;        return nodes;    }    pub fn deinit(self: *NodeFindingPlan, allocator: std.mem.Allocator) void {        std.debug.assert(self.phase != .teardown);        self.phase = .teardown;        freeFindingNodes(allocator, self.nodes);        self.* = undefined;    }};

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

zig
pub const NodeFindingPlan = @import("rules.zig").NodeFindingPlan;
Called byCallsNo direct callstest; no linktools.smg.src.rulestest: node finding plan capacity matc...NodeFindingPlan.Capacityderive
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsrules.CheckfileDirectoryCollisionstest; no linktools.smg.src.rulestest: node finding plan fills exact s...test; no linktools.smg.src.rulestest: node finding plan initializatio...NodeFindingPlanactivate
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsrules.CheckfileDirectoryCollisionstest; no linktools.smg.src.rulestest: node finding plan fills exact s...NodeFindingPlanappend
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsrules.CheckfileDirectoryCollisionsprivate; no linktools.smg.src.rulescheckNodeFindingPlanInitAllocationFai...test; no linktools.smg.src.rulestest: node finding plan fills exact s...test; no linktools.smg.src.rulestest: node finding plan initializatio...private; no linktools.smg.src.rulesfreeFindingNodesNodeFindingPlandeinit
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsrules.CheckfileDirectoryCollisionsprivate; no linktools.smg.src.rulescheckNodeFindingPlanInitAllocationFai...test; no linktools.smg.src.rulestest: node finding plan fills exact s...test; no linktools.smg.src.rulestest: node finding plan initializatio...private; no linktools.smg.src.rulesallocFindingNodesNodeFindingPlaninit
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsNo direct callsrules.CheckfileDirectoryCollisionstest; no linktools.smg.src.rulestest: node finding plan fills exact s...NodeFindingPlansort
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsrules.CheckfileDirectoryCollisionsNodeFindingPlantransfer
Static calls · unresolved targets: 0 · external targets: 0.

Audit

Definitions12
Public names24
Members7
Version26.7.0
Revisiondaab053ee433