weirflow 0.1.0

GPU-first dataflow analysis primitives for Vyre and Santh compiler pipelines.
Documentation
//! Fuzz-style randomized gates for Weir bitset reference oracles.
//!
//! Op id: `weir::tests::df::fuzz::bitset_oracles`. Soundness:
//! `Exact`. The harness stresses arbitrary length mismatches and
//! adversarial word patterns across the pure word-wise AND oracle family.

use proptest::prelude::*;

fn expect_word_and(left: &[u32], right: &[u32]) -> Vec<u32> {
    left.iter()
        .zip(right.iter())
        .map(|(left, right)| *left & *right)
        .collect()
}

proptest! {
    #![proptest_config(ProptestConfig::with_cases(2048))]

    #[test]
    fn fuzz_must_init_matches_word_and(
        left in proptest::collection::vec(any::<u32>(), 0..128),
        right in proptest::collection::vec(any::<u32>(), 0..128),
    ) {
        prop_assert_eq!(weir::oracle::bitset::must_init(&left, &right), expect_word_and(&left, &right));
    }

    #[test]
    fn fuzz_live_at_matches_word_and(
        left in proptest::collection::vec(any::<u32>(), 0..128),
        right in proptest::collection::vec(any::<u32>(), 0..128),
    ) {
        prop_assert_eq!(weir::oracle::bitset::live_at(&left, &right), expect_word_and(&left, &right));
    }

    #[test]
    fn fuzz_post_dominates_matches_word_and(
        left in proptest::collection::vec(any::<u32>(), 0..128),
        right in proptest::collection::vec(any::<u32>(), 0..128),
    ) {
        prop_assert_eq!(weir::oracle::bitset::post_dominates(&left, &right), expect_word_and(&left, &right));
    }

    #[test]
    fn fuzz_scc_query_matches_word_and(
        left in proptest::collection::vec(any::<u32>(), 0..128),
        right in proptest::collection::vec(any::<u32>(), 0..128),
    ) {
        prop_assert_eq!(weir::oracle::bitset::scc_query(&left, &right), expect_word_and(&left, &right));
    }
}