8 Commits

Author SHA1 Message Date
Alex Ozdemir
4aa36e479f Decrease the size of Op and Sort. (#199) 2024-06-24 08:35:05 -07:00
Alex Ozdemir
2cdc019b86 Merge updates needed for SHA with lookups. (#196)
This is highly unoptimized, for now.
2024-06-19 13:09:43 -07:00
Alex Ozdemir
2bf4f8252a handle CStore in linearization pass (#190) 2024-05-24 13:28:21 -07:00
Alex Ozdemir
7a805323d0 Optimized transcript checking for covering ROMs (#178) 2023-11-14 18:20:39 -08:00
Alex Ozdemir
d7217e559e Optimize GC (#166)
Previously, a GC call would scan the HC table, identifying dead nodes.

Now, whenever a Node is destroyed, if it's ready to be GC'd, it gets added to a list. That list is used at GC time instead of the scan.

This substantially decreases the cost of running GC many times (as the Z# FE does).
2023-07-09 14:45:14 -07:00
Alex Ozdemir
706405fd4f Committed witnesses & randomness in Z# (& tests) (#154)
A basic implementation of committed witnesses & volatile RAM extraction in the Z# front-end.

The passes in question are still a bit brittle, so I left them behind a flag.
2023-03-15 16:28:19 -07:00
Alex Ozdemir
e4d19b358a Operator statistics (#144) 2023-01-29 19:39:02 -08:00
Alex Ozdemir
5f3d2b95fe Split hash-consing into its own crate & reimplement (#134)
I split the hash-consing implementation into its own crate and re-implemented it.

In the new implementation, the table is thread-local. Terms are not Send, but linear terms are.

Decreased used of atomics gives a non-trivial speed-up. I tested on Z#'s sha2 round function, with an exit after IR optimization:

Benchmark #1: ./circ-old third_party/ZoKrates/zokrates_stdlib/stdlib/hashes/sha256/shaRound.zok r1cs
  Time (mean ± σ):     236.2 ms ±  16.1 ms    [User: 223.3 ms, System: 12.4 ms]
  Range (min … max):   221.1 ms … 264.1 ms    11 runs

Benchmark #2: ./circ-new third_party/ZoKrates/zokrates_stdlib/stdlib/hashes/sha256/shaRound.zok r1cs
  Time (mean ± σ):     141.8 ms ±  13.1 ms    [User: 131.3 ms, System: 10.0 ms]
  Range (min … max):   125.4 ms … 160.4 ms    18 runs

Summary
  './circ-new third_party/ZoKrates/zokrates_stdlib/stdlib/hashes/sha256/shaRound.zok r1cs' ran
    1.67 ± 0.19 times faster than './circ-old third_party/ZoKrates/zokrates_stdlib/stdlib/hashes/sha256/shaRound.zok r1cs'
2023-01-17 02:17:58 -08:00