Skip to content

Commit e35b478

Browse files
authored
Remove next references in lookups / permutations (#2141)
Currently, when we run the Goldilocks RISC-V machine with `--linker-mode bus` results in: `Double application of "'" on: main_binary::operation_id` because of #2140. This PR hot-fixes it, so we can run benchmarks using the bus. Only adds 3 witness columns (1 in binary, 2 in shift).
1 parent 36c3c24 commit e35b478

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

std/machines/large_field/binary.asm

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,10 @@ machine Binary(byte_binary: ByteBinary) with
3535
B' = B * (1 - latch) + B_byte * FACTOR;
3636
C' = C * (1 - latch) + C_byte * FACTOR;
3737

38-
link => C_byte = byte_binary.run(operation_id', A_byte, B_byte);
38+
// TODO: Currently, the bus linker does not support next references in operations and links.
39+
// We add an extra witness column to make the Goldilocks RISC-V machine work for now.
40+
// This will be fixed with #2140.
41+
col witness operation_next;
42+
operation_id' = operation_next;
43+
link => C_byte = byte_binary.run(operation_next, A_byte, B_byte);
3944
}

std/machines/large_field/shift.asm

+7-1
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,11 @@ machine Shift(byte_shift: ByteShift) with
6767
unchanged_until(B, latch);
6868
C' = C * (1 - latch) + C_part;
6969

70-
link => C_part = byte_shift.run(operation_id', A_byte, B', FACTOR_ROW);
70+
// TODO: Currently, the bus linker does not support next references in operations and links.
71+
// We add an extra witness columns to make the Goldilocks RISC-V machine work for now.
72+
// This will be fixed with #2140.
73+
col witness operation_next, B_next;
74+
operation_id' = operation_next;
75+
B' = B_next;
76+
link => C_part = byte_shift.run(operation_next, A_byte, B_next, FACTOR_ROW);
7177
}

0 commit comments

Comments
 (0)