weirflow 0.1.0

GPU-first dataflow analysis primitives for Vyre and Santh compiler pipelines.
Documentation
use super::*;

#[test]
fn fixed_point_resident_batch_accounting_overflow_returns_typed_error() {
    let mut batch = FixedPointResidentBatch::new();
    batch.resident_dispatches = u64::MAX;

    let error = batch
        .record_resident_dispatch_io(1, 1)
        .expect_err("resident fixed-point accounting overflow must not panic or wrap");

    assert!(
            error.contains("dispatch counter overflowed u64")
                && error.contains("Fix: rotate the batch facade"),
            "resident fixed-point accounting overflow must identify the failed counter and operator action"
        );
    assert_eq!(batch.stats().resident_dispatches, u64::MAX);
}

#[test]
fn fixed_point_resident_batch_production_accounting_has_no_panic_path() {
    let facade_source = include_str!("../../fixed_point_resident_batch.rs");
    let methods_source = include_str!("../analysis_methods.rs");
    let forbidden = [
        concat!(".", "expect("),
        concat!("panic", "!("),
        concat!("unimplemented", "!("),
        concat!("todo", "!("),
    ];

    for needle in forbidden {
        assert!(
                !facade_source.contains(needle),
                "fixed-point resident batch facade production accounting must return typed errors instead of using {needle}"
            );
        assert!(
                !methods_source.contains(needle),
                "fixed-point resident batch analysis methods must return typed errors instead of using {needle}"
            );
    }
}