weirflow 0.1.0

GPU-first dataflow analysis primitives for Vyre and Santh compiler pipelines.
Documentation
//! DF-6  -  backward slicer.
//!
//! Given a sink node `s`, emit the minimal sub-graph that may
//! affect it. Reduces to **reverse** reachability on the merged
//! dependence graph: walk backward from the sink, union-in
//! every predecessor along data dependences (DF-2 reaching, DF-3
//! points-to, DF-5 callgraph) and control dependences
//! (`security::dominator_tree`).
//!
//! # Implementation
//!
//! Reverse-BFS is
//! [`csr_backward_traverse`] applied to the caller-supplied
//! `ProgramGraph`. The caller merges `reach`, `callgraph`, and
//! `dom` into a single CSR before dispatch (dense-OR of three CSRs
//!  -  a one-kernel fusion via `fuse_programs`). The
//!     `edge_kind_mask` channel already supports up to 32 independent
//!     edge kinds, so we admit **every** kind with `u32::MAX`  -  the
//!     slicer is intentionally maximal, and false-positives are
//!     filtered by the downstream rule.
//!
//! # Soundness
//!
//! [`MayOver`](super::Soundness::MayOver). Rules requiring zero-FP
//! pair this slicer with a sanitizer filter on each edge in the
//! returned slice.

#[cfg(any(test, feature = "cpu-parity"))]
mod oracle;
mod plan;
mod program;
#[cfg(test)]
mod tests;

pub(crate) const OP_ID: &str = "weir::slice";

crate::define_analysis_family! {
    family: SliceFamily,
    kind: crate::fixed_point_graph::FixedPointAnalysisKind::Slice,
    name: "slice_closure",
    program_builder: backward_slice,
    graph_prep: plan::prepare_slice_graph,
    graph_prep_scratch: plan::prepare_slice_graph_with_scratch,
    input_buffer: "fin",
    output_buffer: "fout",
    closure_prefix: slice_closure,
    resident_prefix: slice_closure_resident,
    word_capacity: "slice_closure",
    frontier_output: "slice frontier",
    resident_capacity: "slice_closure resident",
    resident_output: "slice frontier",
    visibility: pub,
}

#[cfg(any(test, feature = "cpu-parity"))]
#[allow(deprecated)]
pub(crate) use oracle::slice_closure_cpu;
pub use plan::{
    prepare_slice_graph, prepare_slice_graph_into, prepare_slice_graph_with_scratch,
    prepare_slice_plan, prepare_slice_plan_into,
};
#[allow(deprecated)]
pub use program::{backward_slice, backward_slice_with_shape, BackwardSlice};

#[cfg(test)]
use vyre::ir::Program;
#[cfg(test)]
use vyre_primitives::graph::program_graph::ProgramGraphShape;