1use super::OP_ID;
2use vyre::ir::Program;
3use vyre_primitives::graph::csr_backward_traverse::csr_backward_traverse;
4use vyre_primitives::graph::program_graph::ProgramGraphShape;
5
6#[must_use]
24pub fn backward_slice(shape: ProgramGraphShape, frontier_in: &str, frontier_out: &str) -> Program {
25 vyre_harness::region::tag_program(
26 OP_ID,
27 csr_backward_traverse(shape, frontier_in, frontier_out, u32::MAX),
28 )
29}
30
31#[deprecated(
34 since = "0.4.1",
35 note = "use `backward_slice(shape, frontier_in, frontier_out)` directly - the suffix is redundant since the 5-arg entry was removed"
36)]
37#[must_use]
38pub fn backward_slice_with_shape(
39 shape: ProgramGraphShape,
40 frontier_in: &str,
41 frontier_out: &str,
42) -> Program {
43 backward_slice(shape, frontier_in, frontier_out)
44}
45
46#[derive(Clone, Copy, Debug, PartialEq, Eq)]
48pub struct BackwardSlice;
49
50impl crate::soundness::SoundnessTagged for BackwardSlice {
51 fn soundness(&self) -> crate::soundness::Soundness {
52 crate::soundness::Soundness::MayOver
53 }
54}
55
56inventory::submit! {
57 vyre_harness::OpEntry::new(
58 OP_ID,
59 || backward_slice(ProgramGraphShape::new(4, 3), "frontier_in", "frontier_out"),
60 Some(|| {
61 let u32s = crate::dispatch_decode::pack_u32;
62 vec![vec![
63 u32s(&[0, 0, 0, 0]),
64 u32s(&[0, 1, 2, 3, 3]),
65 u32s(&[1, 3, 1]),
66 u32s(&[1, 1, 1]),
67 u32s(&[0, 0, 0, 0]),
68 u32s(&[0b0010]),
69 u32s(&[0]),
70 ]]
71 }),
72 Some(|| {
73 let u32s = crate::dispatch_decode::pack_u32;
74 vec![vec![u32s(&[0b0101])]]
75 }),
76 )
77}