weirflow 0.1.0

GPU-first dataflow analysis primitives for Vyre and Santh compiler pipelines.
Documentation
//! Reusable host scratch for direct-resident IFDS CSR preparation.

/// Host-side buffers reused while packing direct-resident IFDS CSR inputs.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DirectResidentIfdsPrepareScratch {
    /// Intra edge procedure ids.
    pub intra_proc: Vec<u32>,
    /// Intra edge source block ids.
    pub intra_src_block: Vec<u32>,
    /// Intra edge destination block ids.
    pub intra_dst_block: Vec<u32>,
    /// Inter edge source procedure ids.
    pub inter_src_proc: Vec<u32>,
    /// Inter edge source block ids.
    pub inter_src_block: Vec<u32>,
    /// Inter edge destination procedure ids.
    pub inter_dst_proc: Vec<u32>,
    /// Inter edge destination block ids.
    pub inter_dst_block: Vec<u32>,
    /// GEN procedure ids.
    pub gen_proc: Vec<u32>,
    /// GEN block ids.
    pub gen_block: Vec<u32>,
    /// GEN fact ids.
    pub gen_fact: Vec<u32>,
    /// KILL procedure ids.
    pub kill_proc: Vec<u32>,
    /// KILL block ids.
    pub kill_block: Vec<u32>,
    /// KILL fact ids.
    pub kill_fact: Vec<u32>,
    /// Packed byte staging for all CSR-builder inputs.
    pub input_bytes: Vec<Vec<u8>>,
    /// Packed zero staging for generated resident CSR buffers.
    pub generated_zero_bytes: Vec<Vec<u8>>,
}

impl DirectResidentIfdsPrepareScratch {
    /// Clear all logical data while retaining capacities for the next prepare.
    pub fn clear_for_prepare(&mut self) {
        self.intra_proc.clear();
        self.intra_src_block.clear();
        self.intra_dst_block.clear();
        self.inter_src_proc.clear();
        self.inter_src_block.clear();
        self.inter_dst_proc.clear();
        self.inter_dst_block.clear();
        self.gen_proc.clear();
        self.gen_block.clear();
        self.gen_fact.clear();
        self.kill_proc.clear();
        self.kill_block.clear();
        self.kill_fact.clear();
        for bytes in &mut self.input_bytes {
            bytes.clear();
        }
        for bytes in &mut self.generated_zero_bytes {
            bytes.clear();
        }
    }
}