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.
- CsrGraph
Normalization Scratch - Caller-owned scratch for CSR graph normalization.
- Linear
Domain - Shared one-dimensional analysis domain.
- Normalized
CsrGraph - Owned canonical CSR layout for cache keys, packed graph state, and reuse.
Functions§
- stable_
csr_ layout_ hash - Stable hash for canonical Weir CSR layouts.