use super::OP_ID;
use vyre::ir::Program;
use vyre_primitives::graph::csr_backward_traverse::csr_backward_traverse;
use vyre_primitives::graph::program_graph::ProgramGraphShape;
#[must_use]
pub fn backward_slice(shape: ProgramGraphShape, frontier_in: &str, frontier_out: &str) -> Program {
vyre_harness::region::tag_program(
OP_ID,
csr_backward_traverse(shape, frontier_in, frontier_out, u32::MAX),
)
}
#[deprecated(
since = "0.4.1",
note = "use `backward_slice(shape, frontier_in, frontier_out)` directly - the suffix is redundant since the 5-arg entry was removed"
)]
#[must_use]
pub fn backward_slice_with_shape(
shape: ProgramGraphShape,
frontier_in: &str,
frontier_out: &str,
) -> Program {
backward_slice(shape, frontier_in, frontier_out)
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct BackwardSlice;
impl crate::soundness::SoundnessTagged for BackwardSlice {
fn soundness(&self) -> crate::soundness::Soundness {
crate::soundness::Soundness::MayOver
}
}
inventory::submit! {
vyre_harness::OpEntry::new(
OP_ID,
|| backward_slice(ProgramGraphShape::new(4, 3), "frontier_in", "frontier_out"),
Some(|| {
let u32s = crate::dispatch_decode::pack_u32;
vec![vec![
u32s(&[0, 0, 0, 0]),
u32s(&[0, 1, 2, 3, 3]),
u32s(&[1, 3, 1]),
u32s(&[1, 1, 1]),
u32s(&[0, 0, 0, 0]),
u32s(&[0b0010]),
u32s(&[0]),
]]
}),
Some(|| {
let u32s = crate::dispatch_decode::pack_u32;
vec![vec![u32s(&[0b0101])]]
}),
)
}