Expand description
Weir dataflow analysis crate.
This crate owns dataflow analyses and reusable fixed-point execution scaffolding. CPU functions in module internals are parity oracles only; the production surface builds Vyre programs for GPU dispatch.
§Example: dominators on a diamond CFG
use std::collections::{HashMap, HashSet};
use weir::ssa::{try_compute_dominators, Block, Cfg};
// CFG: 0 → {1, 2} → 3
let mut blocks = HashMap::new();
for (id, preds, succs) in [
(0u32, vec![], vec![1, 2]),
(1, vec![0], vec![3]),
(2, vec![0], vec![3]),
(3, vec![1, 2], vec![]),
] {
blocks.insert(id, Block { id, preds, succs, defs: HashSet::new(), uses: HashSet::new() });
}
let idoms = try_compute_dominators(&Cfg { entry: 0, blocks }).unwrap();
assert_eq!(idoms[&1], 0);
assert_eq!(idoms[&2], 0);
assert_eq!(idoms[&3], 0); // merge point is dominated by the diamond headRe-exports§
pub use soundness::DataflowEvidence;
Modules§
- analysis_
family - Unifying trait and generic drivers for Weir’s bitset fixed-point families.
- callgraph
- Call-graph construction with indirect resolution (DF-5).
- control_
dependence - Control-dependence query (does
bexecute on every path througha?). - cross_
language - Cross-language FFI reachability analysis.
- def_use
- Def-use chain queries over SSA form (DF-11).
- dispatch_
decode - Shared GPU dispatch ABI helpers for Weir via paths.
- dominators
- Dominator-tree construction and query (DF-1).
- escape
- Escape analysis: does a pointer leave its defining frame? (DF-8).
- escapes
- Escape-set query over points-to sets.
- fixed_
point_ batch - Batch fixed-point execution over multiple seed sets.
- fixed_
point_ execution_ plan - Scale-aware execution planning for fixed-point analyses.
- fixed_
point_ execution_ plan_ cache - LRU cache for reusable fixed-point execution plans.
- fixed_
point_ graph - Packed forward CSR graph buffers for fixed-point GPU wrappers.
- fixed_
point_ resident - Resident-GPU fixed-point closure drivers.
- fixed_
point_ resident_ batch - Batch resident fixed-point execution.
- fixed_
point_ resident_ cache - Cache for resident fixed-point graph and plan reuse.
- fixed_
point_ resident_ frontier - Reusable resident frontier scratch buffers.
- fixed_
point_ resident_ plan - Resident execution plan construction.
- fixed_
point_ scratch - Reusable host-side scratch for fixed-point graph preparation.
- graph_
layout - Shared graph-layout contracts for CSR normalization.
- ifds
- IFDS/IDE interprocedural dataflow framework (DF-4).
- ifds_
gpu - GPU-native IFDS/IDE driver (G3).
- ifds_
resident_ batch - Batch resident IFDS execution.
- ifds_
resident_ cache - Cache for resident IFDS graph reuse.
- ifds_
resident_ direct_ batch - Direct-resident IFDS batch facade.
- ifds_
resident_ direct_ prepare - Direct resident IFDS CSR preparation.
- ifds_
resident_ direct_ prepare_ scratch - Reusable host scratch for direct-resident IFDS CSR preparation.
- ifds_
vyre_ resident - Adapter from the common Vyre resident backend contract to Weir IFDS.
- live
- Live-variable analysis (DF-2 backward variant).
- live_at
- Liveness query: is variable
vlive at noden? - loop_
sum - Loop summarization with widening+narrowing (DF-10).
- may_
alias - May-alias query packed as a bitset.
- must_
init - Must-initialization analysis.
- points_
to - Andersen points-to analysis (DF-3).
- post_
dominates - Post-dominator tree query.
- range
- Interval range propagation (DF-7).
- range_
check - Interval bound check for VSA results.
- reachability_
witness - Witness extraction from IFDS reachability results.
- reaching
- Reaching definitions analysis (DF-2).
- reaching_
def - Reaching-definitions query packed as a bitset.
- reaching_
def_ summary - Compact reaching-definition summary queries.
- relation_
interchange - Relation import/export fixtures for IFDS and differential evidence.
- resident_
cache_ identity - scc_
query - Strongly-connected-component membership query.
- slice
- Backward program slicer (DF-6).
- soundness
- Soundness regime markers and evidence types.
- ssa
- SSA construction via Cytron’s algorithm (DF-1).
- summary
- Persistent procedure summaries (DF-9).
- test_
harness - Test harness for parity and conformance testing.
- traversal_
step - Forward and backward CFG traversal step builders.
- value_
set - Constant-value-set reachability query.
Macros§
- define_
analysis_ family - Define a complete analysis family: marker type,
AnalysisFamilyimpl, and allclosure_*/resident_*wrapper functions.
Structs§
- Dynamic
Primitive Soundness - Serializable soundness evidence for one primitive in a finding or release artifact.
- Dynamic
Soundness Violation - Mechanical rejection reason for an invalid dynamic soundness composition.
- Primitive
Soundness - Soundness evidence for one primitive in a composed pipeline.
- Soundness
Violation - Mechanical rejection reason for an invalid soundness composition.
Enums§
- Precision
Contract - Precision contract requested by a consumer pipeline.
- Soundness
- Soundness regime of a dataflow primitive.
Traits§
- Soundness
Tagged - Trait for types that carry a soundness marker.
Functions§
- validate_
dynamic_ pipeline - Validate a serializable primitive pipeline against a consumer precision contract, returning the composed soundness marker on success.
- validate_
dynamic_ primitive - Validate one serializable primitive against a consumer precision contract.
- validate_
pipeline - Validate that a primitive pipeline can satisfy a consumer precision contract, returning the composed soundness marker on success.
- validate_
primitive - Validate one primitive against a consumer precision contract.