38 Commits

Author SHA1 Message Date
Sorawee Porncharoenwase
138b151d3a release: make a new release 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
8370390286 ci: make main test extensible via reusable workflow 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
9e5547f765 ci: unify configuration tests 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
c05025a3e6 ci: workflow reorganization (#41) 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
5233b9564e ci: add a filename extension so that GHA workflow can be run 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
1027ba095c docker: add an image to build custom circom for modular Picus 2024-03-14 05:04:03 +07:00
sorawee
d88a659052 cvc5: use mainline cvc5 (#25) 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
1bb80a054e docker: fix username and password 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
17e24e47d9 docker: use path context 2024-03-14 05:04:03 +07:00
Sorawee Porncharoenwase
c18ff46080 ci: only build Docker in the private repo 2023-10-19 21:34:29 +07:00
Sorawee Porncharoenwase
976a14d122 ci: only run amd64 for now
CoCoA wasn't successfully compiled on arm64 for some reasons.
See
https://github.com/Veridise/Picus/actions/runs/6483965862/job/17606717211#step:4:15460.
So we disable arm64 target for now.
2023-10-12 02:16:17 +07:00
sorawee
e2c83319db feat: add a new exit code for unknown (#54) 2023-10-11 09:31:14 -05:00
sorawee
2fbe7bb823 ci: add a workflow to build the base image (#55) 2023-10-11 09:01:58 -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
cb8d3578b5 ci: also build a linux/arm64 image (#51) 2023-10-06 10:39:34 -05: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
9c8310c375 ci: unify configuration tests (#43)
Refactor the ad-hoc tests in GHA to reduce code duplication and makes
the tests easier to extend.
2023-09-28 12:07:32 -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
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 Porncharoenwase
6bc51990c9 feat: support processing circom file directly
This commit adds a capability to process circom files directly
via the `--circom` flag. This is done by creating a
temporary directory to store the compiled r1cs file.
The temporary directory is cleaned up on exit when Picus exits normally.
However, when Picus crashes or when it is interrupted,
the temporary directory will not be cleaned, giving the user an
opportunity to inspect files.
2023-09-16 02:40:49 +07: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
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 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
Sorawee Porncharoenwase
16bec3fbcb chore: rename picus-dpvl-uniqueness.rkt to picus.rkt 2023-08-26 09:33:32 -07:00
sorawee
5d70478aef ci: run ci on pull_request and add basic tests (#8)
- Prior this commit, every job depends on `publish-docker`, which is only
  run on push. Therefore, all jobs are skipped. This commit fixes the
  issue by removing the dependency.

  - `publish-docker` is now also run as the last step, only when all tests passed.

  - All subsequent jobs are now run on veridise/picus:git-latest,
    so that we do not need to push first.

- The tests are slightly more sophisticated. Previously, it only ensures
  that there's no error. Now, we also check against expected
  output (underconstrained or not).

- Switch to use Racket and Rosette that are already installed in the
  image. It turns out that we need to set the environment variable
  `PLTADDONDIR` for this to work, because $HOME is overriden in containers
  in GHA (https://github.com/actions/runner/issues/863).

- Remove a job that only compiles circomlib.
  There's no point to do that.
2023-08-23 13:23:29 -05:00
Yanju Chen
2f46e3e174 Update docker-image.yml 2023-08-16 17:36:02 -07:00
Yanju Chen
367cdc8a89 Update docker-image.yml 2023-08-16 17:30:05 -07:00
Yanju Chen
44ea29ab89 update test workflow 2023-08-16 17:05:51 -07:00
chyanju
3bd71a585f finalize github actions 2022-10-09 14:19:52 -07:00
chyanju
c382bfe4d8 added more github actions and small fix 2022-10-08 13:21:29 -07:00
chyanju
cad8747ab6 init github actions 2022-10-08 13:12:50 -07:00