File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -277,8 +277,11 @@ impl BitMachine {
277277 }
278278
279279 ' main_loop: loop {
280- // Make a copy of the input frame to give to the tracker.
280+ // Capture read and write frames before the node action, to give to the tracker.
281+ // The read frame cursor is where the node's input begins.
282+ // The write frame cursor is where the node's output begins.
281283 let input_frame = self . read . last ( ) . map ( Frame :: shallow_copy) ;
284+ let output_frame = self . write . last ( ) . map ( Frame :: shallow_copy) ;
282285 let mut jet_result = Ok ( ( ) ) ;
283286
284287 match ip. inner ( ) {
@@ -393,9 +396,8 @@ impl BitMachine {
393396 let output = match ( ip. inner ( ) , & jet_result) {
394397 ( node:: Inner :: Unit | node:: Inner :: Iden | node:: Inner :: Witness ( _) , _)
395398 | ( node:: Inner :: Jet ( _) , Ok ( _) ) => NodeOutput :: Success (
396- self . write
397- . last ( )
398- . map ( |r| r. as_bit_iter ( & self . data ) )
399+ output_frame
400+ . map ( |frame| frame. as_bit_iter_from_cursor ( & self . data ) )
399401 . unwrap_or ( crate :: BitIter :: from ( [ ] . iter ( ) . copied ( ) ) ) ,
400402 ) ,
401403 ( node:: Inner :: Jet ( _) , Err ( _) ) => NodeOutput :: JetFailed ,
You can’t perform that action at this time.
0 commit comments