Skip to main content

Module graph_layout

Module graph_layout 

Source
Expand description

Shared graph-layout contracts for CSR normalization.

Normalize a raw CSR into a canonical layout:

use weir::graph_layout::{CsrGraph, NormalizedCsrGraph, CsrGraphNormalizationScratch};

let graph = CsrGraph::new(2, &[0, 1, 1], &[1], &[0xFFFF_FFFF]);
let normalized = graph.normalize("example").unwrap();
assert_eq!(normalized.node_count(), 2);
assert_eq!(normalized.edge_count(), 1);

Shared graph-layout contracts for Weir GPU analyses.

Dataflow analyses all consume the same forward CSR shape: node count, row offsets, edge targets, and edge-kind masks. This module centralizes validation and canonicalization so fixed-point, resident, IFDS, slicing, dominators, and range-oriented paths can converge on one layout contract instead of growing analysis-local CSR dialects.

Structs§

CsrGraph
Borrowed CSR graph view shared by Weir analyses.
CsrGraphNormalizationScratch
Caller-owned scratch for CSR graph normalization.
LinearDomain
Shared one-dimensional analysis domain.
NormalizedCsrGraph
Owned canonical CSR layout for cache keys, packed graph state, and reuse.

Functions§

stable_csr_layout_hash
Stable hash for canonical Weir CSR layouts.