35 Commits

Author SHA1 Message Date
Sorawee Porncharoenwase
0cbeedfe08 gnark: update the format to reflect changes in picus_gnark 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
e0b56b4919 test: add a complete test suite (but do not run them on GHA) 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
8b7e9211c1 test: record more information on test failure 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
5193fe4afd ci: add an ability to run only quick tests 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
d96a1e0e52 core: change the variable representation 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
8370390286 ci: make main test extensible via reusable workflow 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
154ee76357 ci: make adjustments to improve ci 2024-03-14 05:04:03 +07:00
sorawee
397deebf34 test: create a testing library (#42) 2024-03-14 05:04:03 +07:00
sorawee
f0026ede99 gnark: revamp the gnark support (#38)
See the changelog for details
2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
5220887790 feat: add gnark support 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
a35578f069 refactor: make reader more modular in preparation for gnark support 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
bfae7be963 feat: support JSON file output 2024-03-14 05:04:03 +07:00
sorawee
4ca32962a3 logging: log inferred known vars (#27)
* chore: clean up indentation

* logging: log inferred known vars
2024-03-14 05:04:03 +07:00
sorawee
e2c83319db feat: add a new exit code for unknown (#54) 2023-10-11 09:31:14 -05:00
Sorawee Porncharoenwase
4ee45bc00a feat: support wtns generation
The commit adds --wtns, which indicates the output directory for the
witness files. If not given, no witness file is generated.
The witness files are called `first-witness.wtns` and
`second-witness.wtns`.
2023-10-06 22:56:02 +07:00
sorawee
3a801645ba feat: switch Picus to use the SaaS framework (#47) 2023-10-03 10:44:26 -05:00
sorawee
0e008000ea feat: framework for SaaS (#45)
This commit adds a framework for logging and exiting in a way that
conforms to the SaaS requirement. Logging in particular could be
done in either the JSON mode or the text mode.
The main entry point to the framework is the `with-framework` function.

This commit does not yet switch Picus to use the framework.
That will be done in a separate commit.
See `framework-test.rkt` for tests of the framework.
2023-10-03 08:05:13 -05:00
sorawee
aa3ca122cf ci: parallelize tests on GHA (#42)
This commit adds a flag `--parallel <id> <num>` to the test script.
This divides the tests into <num> parts, and the script will
only run the <id>-th part.
2023-09-27 21:05:54 -05:00
sorawee
8432a9bfb6 Make --weak the default (#40)
We almost always only want the weak safety (checking that output signals
of the main component are deterministic), not strong safety
(checking that all signals are deterministic). However, currently the
strong safety mode is the default. This makes it cumbersome to invoke
Picus, since we need to indicate that we want the weak safety explicitly.

This commit inverts the behavior by removing the flag `--weak` and
adds the flag `--strong` (for strong safety), which is defaulted to false.
2023-09-27 20:22:33 -05:00
Sorawee Porncharoenwase
0da4653001 ci: additionally check that Picus terminates properly
This would have caught the mistake fixed in #38
2023-09-26 07:35:01 +07:00
Sorawee Porncharoenwase
eb2e8cda80 chore: adjust behavior of no verbose
Make --verbose 0 not output algorithm computation.
Also remove the leading "#" in the output
2023-09-26 06:53:47 +07:00
sorawee
2bf2874c1a feat: support patching properly (#36)
* feat: support patching properly

* ci: utilize the patching feature in Picus
2023-09-25 11:59:06 -05:00
sorawee
affb4cc3e8 ci: support timing out and optimization flag (#31)
Prior this commit, we cannot write tests expecting a timeout.
This commit adds the ability to do so.

Another major change is to support tests with optimization flag.
When Circom is given -O2, Circom files without public inputs
(which are all of our benchmarks) will fail to be compiled correctly.
This commit adds a heustistic to detect such situation,
and then "patch" the Circom file to add public inputs.
This is done by doing Circom compilation twice.
The first compilation allows us to read information from R1CS file,
which is then used for patching. The second compilation compiles
the patched file.
2023-09-07 18:57:22 -05:00
Sorawee Porncharoenwase
0013e5c0ce ci: improve the output
The markup ##[...] makes GHA groups outputs together, making it easy to
compare results across runs.
2023-08-31 08:28:21 -07:00
sorawee
7c53b26685 ci: fix mistakes from wrong compilation flag + add even more tests (#19)
PR #16 incorrectly concluded the expectation of some tests because I ran
them with different optimization flag. The commit fixes the issue and
add all other applicable tests in circomlib. These tests take less than
5 minutes to run in total, so that's not too long to run as a part of CI.
2023-08-30 11:15:39 -05:00
sorawee
718cb17847 ci: add even more tests (#16)
Since I will be modifying the algorithm, I want to run more tests to
make sure I don't break anything.
2023-08-29 12:28:58 -05:00
sorawee
98e7c737e9 fix: make constraint generation more efficient (#13)
* chore: remove dead code

* fix: make constraint generation more efficient

Prior to this commit, we use list as a data structure to keep inputs,
and then access them by indices, which is inefficient.
This commit fixes the problem by converting the list to vector
for vector indexing. On the performance benchmark, it reduces
the runnning time for constraint generation from 8 minutes to 1 second.
2023-08-28 18:39:35 -05:00
Sorawee Porncharoenwase
cefcb428db fix: make parser significantly more efficient
Prior this commit, `read-r1cs` copied bytes in the file over and over
again in a hot loop, causing the time complexity to be quadratic.
This commit switches to use index-based access in the hot loop instead,
resulting in a large performance improvement.
The benchmark file that accompanies this fix took 30 minutes to
successfully parse (according to @shankarapailoor).
This commit reduces the parsing time to 2 seconds.

It should be noted that not all bytes copying is avoided,
since bytes copying outside the hot loop, although not ideal,
does not really impact the performance.
2023-08-28 16:23:53 -07:00
Yanju Chen
088e4b8aa0 sync with latest research artifact 2023-08-16 16:56:02 -07:00
chyanju
6c94666d9b clean up 2022-09-11 10:18:20 -07:00
chyanju
9768423478 naive slicing 2022-08-09 15:00:09 -04:00
chyanju
0f4366d431 WIP: sort and add ecdsa benchmarks 2022-07-25 11:43:21 -04:00
chyanju
d3e6ebbe64 WIP: new range interface 2022-07-22 11:20:29 -04:00
chyanju
881b73ea3a WIP: clara's fix to uniqueness test 2022-07-18 11:26:26 -04:00
chyanju
c3396396bb WIP: refactored 2022-07-14 11:15:27 -04:00