Expand description
Canonical 5-buffer ProgramGraph ABI (CSR wire format, shared by every graph primitive). Canonical ProgramGraph ABI - the 5-buffer CSR bundle every graph primitive in Tier 2.5 consumes.
Downstream analyzers emit a ProgramGraph from their native ASTs. Every
vyre graph primitive takes exactly this buffer shape so a new
primitive is “here’s the transfer body,” not “redeclare the four
buffers you want.” One ABI makes the primitives composable -
csr_forward_traverse into bitset_fixpoint into reduce_count
with no glue.
§Wire shape
+----------------------------------------------------------+
| nodes: u32 buffer (count = node_count) |
| each word = NodeKind tag |
| edge_offsets: u32 buffer (count = node_count+1) |
| edge_offsets[i]..edge_offsets[i+1] |
| is the range into edge_targets for |
| outgoing edges of node `i` |
| edge_targets: u32 buffer (count = edge_count) |
| each word = destination node index |
| edge_kind_mask: u32 buffer (count = edge_count) |
| each word = bitmask over EdgeKind |
| node_tags: u32 buffer (count = node_count) |
| each word = bitmask over TagFamily |
+----------------------------------------------------------+Edge-kind masks let a single csr_forward_traverse restrict to
(say) just Assignment + CallArg edges by AND-ing against the
per-edge mask. Node tags let label_family_to_nodeset emit a
frontier bitset without touching the edges.
§Invariants
edge_offsets.len() == node_count + 1edge_targets.len() == edge_count == edge_offsets[node_count]edge_kind_mask.len() == edge_countnode_tags.len() == node_countnodes.len() == node_count- Every
edge_targets[i]must satisfy< node_countor the primitive raisesNode::Trap.
These invariants are checked by validate_program_graph at
registration / dispatch time and by the frozen wire format in
vyre-spec.
Structs§
- Program
Graph Shape - Statically-sized CSR dimensions baked into a primitive’s
BufferDeclcounts so the backend can allocate + layout-validate up front.
Enums§
- Graph
Validation Error - Error kinds surfaced by
validate_program_graph.
Constants§
- BINDING_
EDGE_ KIND_ MASK - Binding index for the per-edge kind mask.
- BINDING_
EDGE_ OFFSETS - Binding index for the CSR row-pointer array.
- BINDING_
EDGE_ TARGETS - Binding index for the CSR column array.
- BINDING_
NODES - Binding index for the node-kind array.
- BINDING_
NODE_ TAGS - Binding index for the per-node tag mask.
- BINDING_
PRIMITIVE_ START - First binding index a primitive is free to use for primitive- specific buffers (frontier bitsets, output arrays, scratch).
- NAME_
EDGE_ KIND_ MASK - Canonical name for
edge_kind_mask. - NAME_
EDGE_ OFFSETS - Canonical name for
edge_offsets. - NAME_
EDGE_ TARGETS - Canonical name for
edge_targets. - NAME_
NODES - Canonical buffer name constants - primitives refer to these so every graph-consuming Program shares a single ABI symbol set. Downstream analysis paths emit CSR blobs under the same names.
- NAME_
NODE_ TAGS - Canonical name for
node_tags.
Functions§
- validate_
program_ graph - Validate an in-memory
ProgramGraphagainst the wire invariants.