weirflow 0.1.0

GPU-first dataflow analysis primitives for Vyre and Santh compiler pipelines.
Documentation
use super::{ifds_reach_step, OP_ID};
use vyre_primitives::graph::program_graph::ProgramGraphShape;

inventory::submit! {
    vyre_harness::OpEntry::new(
        OP_ID,
        || ifds_reach_step(ProgramGraphShape::new(4, 3), "fin", "fout"),
        Some(|| {
            let to_bytes = crate::dispatch_decode::pack_u32;
            // Tiny supergraph: 0 is a source, 3 is a sink, edges
            // 0→1→2→3. One step propagates the frontier from 0 to 1.
            vec![vec![
                to_bytes(&[0, 0, 0, 0]),          // pg_nodes
                to_bytes(&[0, 1, 2, 3, 3]),       // pg_edge_offsets
                to_bytes(&[1, 2, 3]),             // pg_edge_targets
                to_bytes(&[1, 1, 1]),             // pg_edge_kind_mask
                to_bytes(&[0, 0, 0, 0]),          // pg_node_tags
                to_bytes(&[0b0001]),              // fin = {source at 0}
                to_bytes(&[0b0001]),              // fout accumulator seed
            ]]
        }),
        Some(|| {
            let to_bytes = crate::dispatch_decode::pack_u32;
            vec![vec![to_bytes(&[0b0011])]]
        }),
    )
}

inventory::submit! {
    vyre_harness::ConvergenceContract {
        op_id: OP_ID,
        max_iterations: 128,
    }
}

/// Marker type for the IFDS interprocedural dataflow primitive.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct Ifds;

impl crate::soundness::SoundnessTagged for Ifds {
    /// PHASE6_DATAFLOW CRITICAL: corrected from `Exact` to `MayOver`.
    /// The current implementation is a single forward-reach step over
    /// a caller-provided supergraph  -  it is sound (over-approximates)
    /// only when (a) the supergraph encodes call/return matching and
    /// (b) the host iterates to fixpoint with sanitizer gating after
    /// every step. Without those, this is reachability and may report
    /// non-realizable paths.
    fn soundness(&self) -> crate::soundness::Soundness {
        crate::soundness::Soundness::MayOver
    }
}