The ZoKrates front-end now represents ZoK arrays as IR arrays, and ZoK structures as (type-tagged) IR tuples.
During this change, I discovered that IR support for eliminating tuples and arrays was not complete.
Thus the change list is:
The ZoK front-end uses IR arrays and tuples
Improve IR passes for array and tuple elimination
Enforce cargo fmt in CI
Bugfix: handle ZoK accessors in L-values in the correct order
Bugfix: add array evaluation to the IR
This PR does not:
implement an array flattening pass
implement permutation-based memory-checking
Benefits:
The ZoK->R1CS compiler is now ~5.88x faster (as defined by the time it takes to run the tests in master's scripts/zokrates_test.zsh script: this goes from 8.59s to 1.46s)
For benchmarks with multi-dimensional arrays, the ZoK->R1CS compiler can now compile them with reasonable speed. Before it it would time out on even tiny examples.
The ZoK->R1CS compiler will be able to benefit from future memory-checking improvements
IR support for arrays and tuples is complete now, making those parts of the IR more accessible to future front-ends.
alex-ozdemir added 21 commits 11 days ago
This PR makes compilation deterministic (by switching to fxhash) and improves the CLI.
Technically, the std-based hash tables cannot be guaranteed to have the deterministic iteration order that we need, regardless of what hash you use, so I've added some micro-tests for the property that we need. I'm not optimistic about getting better guarantees from std, but I'll try.
The CLI has also changed.
* OPA-by-ILP benchmark example
* Reverted unverified push to master branch
* Added conversion gates and integrated ABY lowering with SharingMap
Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
* Updated parameter passing for ABY test cases
-Uses `dict` instead of `list` to pass arguments into ABY tests
-Using `dict` allows for referencing between parameter name and value regardless of parameter order
Lowering layer from CirC IR to ABY
- Lowers IR to ABY C++
- Writes translated code into ABY submodule and update CMake files
- tests using Python to run ABY executables
Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>