Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions aggregator/src/aggregation/decoder/seq_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,8 +1094,9 @@ mod tests {
inst.instruction_idx as usize,
SequenceExecInfo::BackRef(r.clone()),
));
let matched_bytes = Vec::from(&outputs[r]);
outputs.extend(matched_bytes);
for ref_pos in r {
outputs.push(outputs[ref_pos]);
}
}
current_literal_pos = new_literal_pos;
}
Expand Down Expand Up @@ -1231,7 +1232,7 @@ mod tests {
AddressTableRow::mock_samples_full([
[1, 4, 1, 1, 4, 8],
[9, 1, 3, 6, 1, 4],
[3, 0, 4, 5, 6, 1],
[3, 0, 4, 5, 6, 1], // ref offset 3 while literal == 0
]),
);

Expand All @@ -1243,6 +1244,26 @@ mod tests {
mock_prover.verify().unwrap();
}

#[test]
fn seq_exec_rle_like() {
// no instructions, we only copy literals to output
let circuit = SeqExecMock::mock_generate(
Vec::from("abcdef".as_bytes()),
AddressTableRow::mock_samples_full([
[1, 4, 1, 1, 4, 8],
[9, 1, 3, 6, 1, 4],
[5, 0, 6, 2, 6, 1], // an RLE like inst, match len exceed match offset
]),
);

assert_eq!(circuit.outputs, Vec::from("abcddeabcbcbcbcf".as_bytes()));

let k = 12;
let mock_prover =
MockProver::<Fr>::run(k, &circuit, vec![]).expect("failed to run mock prover");
mock_prover.verify().unwrap();
}

#[test]
fn seq_exec_no_tail_cp() {
// no instructions, we only copy literals to output
Expand Down