Skip to content

Commit 41ac038

Browse files
committed
add an idea about range checks
1 parent d23f155 commit 41ac038

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

TODO.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ But we reduce proof size a lot using instead (TODO):
7979
- KoalaBear extension of degree 6: in order to use the (proven) Johnson bound in WHIR
8080
- current "packed PCS" is not optimal in the end: can lead to [16][4][2][2] (instead of [16][8])
8181

82+
83+
# Random ideas
84+
85+
- About range checks, that can currently be done in 3 cycles (see 2.5.3 of the zkVM pdf), in the instruction encoding of DEREF, if we replaced (1 - AUX) by a dedicated column,
86+
we could allow DEREFS that 'does not do anything with the resulting value', which is exactly what we want for range check: we only want to ensure that m[m[fp + x]] (resp m[(t-1) - m[fp + x]])
87+
is a valid memory access (i.e. the index is < M the memory size), but currently the DEREF instruction forces us to 'store' the result, in m[fp + i] (resp m[fp + k]).
88+
TLDR: adding a new encoding field for DEREF would save 2 memory cells / DEREF. If this can also increase perf in alternative scenario (other instructions for isntance),
89+
potentially we should consider it.
90+
8291
## Known leanISA compiler bugs:
8392

8493
### Non exhaustive conditions in inlined functions
@@ -102,3 +111,4 @@ fn doesnt_work(x) inline -> 1 {
102111
return 1; // will be compiled to `res = 1`; -> invalid (res = 0 and = 1 at the same time)
103112
}
104113
```
114+

0 commit comments

Comments
 (0)