Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: sync with internal Picus #66

Merged
merged 56 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
3b2ceb0
docker: use path context
sorawee Oct 21, 2023
c69f570
docker: bump Circom version to 2.1.6
sorawee Oct 21, 2023
707e145
docker: fix username and password
sorawee Oct 21, 2023
b792258
chore: ignore .venv dir
sorawee Oct 21, 2023
2e45021
logging: strip ANSI code
sorawee Oct 22, 2023
1f91e24
Add initial empty CHANGELOG.md
mkonstant Oct 25, 2023
a2c861b
Setup pre-release files
sorawee Oct 26, 2023
c466c18
Setup release files
sorawee Oct 26, 2023
980be53
changelog: remove changes that are not interesting to public
sorawee Oct 26, 2023
ec756aa
fix: fix the format of accounting logging
sorawee Oct 30, 2023
f297270
Create v1.0.1 release (#13)
NikosChondros Nov 1, 2023
759fdf5
logging: fix ansi code stripping
sorawee Nov 2, 2023
e2166fc
Create release v1.0.2 (#15)
shankarapailoor Nov 2, 2023
8d03ebb
logging: omit excessive logging
sorawee Nov 10, 2023
ce60c0a
cnst gen: always generate full xvec and yvec (#17)
sorawee Nov 10, 2023
9217434
chore: more refactoring for the framework (#18)
sorawee Nov 14, 2023
6c0b20f
chore: refactor constraints
sorawee Nov 14, 2023
c60952c
chore: refactor selector to use Racket class/object system (#20)
sorawee Nov 15, 2023
f626671
chore: refactor solver interfaces to use Racket class/object system (…
sorawee Nov 15, 2023
447236d
chore: refactored the inclusion of definitions related to the prime. …
sorawee Nov 17, 2023
eeb057a
chore: refactor subp-optimizers (#23)
sorawee Nov 20, 2023
b98b9a7
chore: refactor encoder
sorawee Nov 18, 2023
981dc9d
cvc5: use mainline cvc5 (#25)
sorawee Nov 21, 2023
7f44ecb
logging: log inferred known vars (#27)
sorawee Dec 1, 2023
3037d3e
test: remove redundant tests (#28)
sorawee Dec 4, 2023
214add1
feat: add a way to override solver's executable (#29)
sorawee Dec 11, 2023
a732cfd
feat: support JSON file output
sorawee Dec 23, 2023
0cb533e
readme: update cvc5 installation guide
sorawee Nov 21, 2023
440fab5
docker: add an image to build custom circom for modular Picus
sorawee Dec 26, 2023
1456011
docker: support cvc5-ff-range
sorawee Dec 29, 2023
10afdc7
ci: add a filename extension so that GHA workflow can be run
sorawee Jan 11, 2024
cc1155a
fix: make default log-level agree with README and fix discrepancies in
sorawee Dec 23, 2023
85196f3
refactor: make reader more modular in preparation for gnark support
sorawee Jan 28, 2024
b17fa30
feat: add gnark support
sorawee Jan 29, 2024
ff2bde0
bench: add gnark-plonky2-verifier benchmark (#37)
sorawee Jan 29, 2024
f8e9ab5
gnark: revamp the gnark support (#38)
sorawee Jan 31, 2024
e045cde
fix: correct the sr1cs constraints (#39)
sorawee Jan 31, 2024
a003a58
fix: update readme and command line help
sorawee Jan 31, 2024
2e265b4
ci: workflow reorganization (#41)
sorawee Feb 1, 2024
bf4a7c7
test: create a testing library (#42)
sorawee Feb 1, 2024
c3ace5b
feat: log inferred known variable count (#43)
sorawee Feb 1, 2024
d0f42ad
fix: avoid unnecessary bytes copy
sorawee Feb 4, 2024
cff473e
refactor: hoist range inference so that it's run only once
sorawee Feb 4, 2024
6a7c268
fix: fix performance issue in the inference
sorawee Feb 5, 2024
ed8e6da
ci: make adjustments to improve ci
sorawee Feb 5, 2024
4ed9455
ci: unify configuration tests
sorawee Feb 5, 2024
0768b48
ci: make main test extensible via reusable workflow
sorawee Feb 6, 2024
a535a24
fix: fix performance in basis2 lemma
sorawee Feb 9, 2024
1c304a6
core: change the variable representation
sorawee Feb 16, 2024
59ceea8
ci: add an ability to run only quick tests
sorawee Feb 19, 2024
97c386b
test: record more information on test failure
sorawee Feb 19, 2024
b7bdf1a
test: add a complete test suite (but do not run them on GHA)
sorawee Feb 5, 2024
d5ac6b2
gnark: infer num-wires from sr1cs
sorawee Feb 28, 2024
3e222f2
gnark: update the format to reflect changes in picus_gnark
sorawee Mar 8, 2024
22d454d
readme: update readme for public release and make Picus a Racket package
sorawee Mar 10, 2024
ace287f
release: make a new release
sorawee Mar 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/config-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Config test
description: Configuration test
inputs:
param:
description: Parameter for the run
required: true
exit:
description: Expected exit code (either 8 for safe or 9 for unsafe)
required: true
runs:
using: composite
steps:
- name: run picus with param ${{ inputs.param }}
run: |
set +e
racket ./picus.rkt ${{ inputs.param }} | tee result.out
code=$?
if [ $code -ne ${{ inputs.exit }} ]; then
echo "original exit code: $code"
exit 1
fi
shell: bash # this ensures that pipefail is set
- name: test expected result
run: |
grep "^${{ inputs.exit == '9' && 'The circuit is underconstrained' ||
(inputs.exit == '8' && 'The circuit is properly constrained' ||
'This should fail') }}$" ./result.out
shell: bash
28 changes: 28 additions & 0 deletions .github/workflows/docker-base-modular-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Docker Base Modular Image Push

on: workflow_dispatch

jobs:
build-base-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
token: ${{ secrets.RELEASE_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.SAAS_DOCKERHUB_USERNAME }}
password: ${{ secrets.SAAS_DOCKERHUB_TOKEN }}
- name: Build and push to DockerHub
uses: docker/build-push-action@v3
with:
context: .
push: true
file: resources/Dockerfile@base-modular
platforms: linux/amd64
tags: veridise/picus:base-modular
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
name: Docker Base Image
name: Docker Base Image Push

on: workflow_dispatch

jobs:
build-base-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
token: ${{ secrets.RELEASE_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.SAAS_DOCKERHUB_USERNAME }}
password: ${{ secrets.SAAS_DOCKERHUB_TOKEN }}
- name: Build and push to DockerHub
uses: docker/build-push-action@v3
with:
context: .
push: true
file: resources/Dockerfile@base
platforms: linux/amd64
Expand Down
97 changes: 8 additions & 89 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,100 +8,18 @@ on:
workflow_dispatch:

jobs:
configuration-test:
strategy:
matrix:
param:
- --solver cvc5 ./benchmarks/circomlib-cff5ab6/[email protected]
- --solver z3 ./benchmarks/circomlib-cff5ab6/[email protected]
- --solver cvc5 --opt-level 0 ./benchmarks/circomlib-cff5ab6/[email protected]
- --solver cvc5 --opt-level 2 --patch-circom ./benchmarks/circomlib-cff5ab6/[email protected]
runs-on: ubuntu-latest
container:
image: veridise/picus:git-latest
env:
PLTADDONDIR: /root/.local/share/racket/
steps:
- uses: actions/checkout@v1
- name: linking circom
run: ln -s /root/.cargo/bin/circom /usr/bin/circom
- name: compile circomlib
run: bash ./scripts/prepare-circomlib.sh
- name: run picus with param ${{ matrix.param }}
run: |
set +e
racket ./picus.rkt ${{ matrix.param }} | tee result.out
code=$?
if [ $code -ne 9 ]; then
echo "original exit code: $code"
exit 1
fi
shell: bash # this ensures that pipefail is set
- name: test expected result
run: |
grep "^The circuit is underconstrained$" ./result.out

wtns-test:
runs-on: ubuntu-latest
container:
image: veridise/picus:git-latest
env:
PLTADDONDIR: /root/.local/share/racket/
steps:
- uses: actions/checkout@v1
- name: linking circom
run: ln -s /root/.cargo/bin/circom /usr/bin/circom
- name: run picus
run: |
set +e
racket ./picus.rkt --wtns . ./benchmarks/circomlib-cff5ab6/[email protected]
code=$?
if [ $code -ne 9 ]; then
echo "original exit code: $code"
exit 1
fi
shell: bash # this ensures that pipefail is set
- name: test expected result
run: |
diff first-witness.wtns tests/data/first-witness.wtns.expect
diff second-witness.wtns tests/data/second-witness.wtns.expect

# run the full test with cvc5
main-test:
strategy:
matrix:
id: [0, 1, 2, 3]
runs-on: ubuntu-latest
container:
image: veridise/picus:git-latest
env:
PLTADDONDIR: /root/.local/share/racket/
steps:
- uses: actions/checkout@v1
- name: linking circom
run: ln -s /root/.cargo/bin/circom /usr/bin/circom
- name: run picus with cvc5, using v3
run: raco test ++args "--parallel ${{ matrix.id }} 4" ./tests/circomlib-test.rkt

misc-test:
runs-on: ubuntu-latest
container:
image: veridise/picus:git-latest
env:
PLTADDONDIR: /root/.local/share/racket/
steps:
- uses: actions/checkout@v1
- name: run tests
run: |
raco test ./tests/performance-test.rkt
raco test ./tests/framework-test.rkt

publish-docker:
needs: [wtns-test, configuration-test, main-test, misc-test]
name: "Publish Docker image to DockerHub"
if: github.event_name == 'push' && github.repository == 'Veridise/picus-private'
env:
IMAGE_TAG: git-latest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
token: ${{ secrets.RELEASE_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
Expand All @@ -112,6 +30,7 @@ jobs:
- name: Build and push to DockerHub
uses: docker/build-push-action@v3
with:
context: .
push: true
file: Dockerfile
platforms: linux/amd64
Expand Down
112 changes: 112 additions & 0 deletions .github/workflows/full-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Full test

on: [push, workflow_dispatch]

jobs:
configuration-test:
runs-on: ubuntu-latest
container:
image: veridise/picus:git-latest
env:
PLTADDONDIR: /root/.local/share/racket/
steps:
- uses: actions/checkout@v1
- name: linking circom
run: ln -s /root/.cargo/bin/circom /usr/bin/circom
- name: compile circomlib
run: bash ./scripts/prepare-circomlib.sh

- name: unsafe test cvc5 solver
uses: ./.github/workflows/config-test
with:
param: --solver cvc5 ./benchmarks/circomlib-cff5ab6/[email protected]
exit: 9
- name: unsafe test z3 solver
uses: ./.github/workflows/config-test
with:
param: --solver z3 ./benchmarks/circomlib-cff5ab6/[email protected]
exit: 9
- name: unsafe test circom format with opt-level 2
uses: ./.github/workflows/config-test
with:
param: --opt-level 2 ./benchmarks/circomlib-cff5ab6/[email protected]
exit: 9
- name: unsafe test r1cs format
uses: ./.github/workflows/config-test
with:
param: ./benchmarks/circomlib-cff5ab6/[email protected]
exit: 9
- name: unsafe test sr1cs format
uses: ./.github/workflows/config-test
with:
param: ./tests/sr1cs/unsafe.sr1cs
exit: 9

- name: safe test cvc5 solver
uses: ./.github/workflows/config-test
with:
param: --solver cvc5 ./benchmarks/circomlib-cff5ab6/[email protected]
exit: 8
- name: safe test z3 solver
uses: ./.github/workflows/config-test
with:
param: --solver z3 ./benchmarks/circomlib-cff5ab6/[email protected]
exit: 8
- name: safe test circom format with opt-level 2
uses: ./.github/workflows/config-test
with:
param: --opt-level 2 ./benchmarks/circomlib-cff5ab6/[email protected]
exit: 8
- name: safe test r1cs format
uses: ./.github/workflows/config-test
with:
param: ./benchmarks/circomlib-cff5ab6/[email protected]
exit: 8
- name: safe test sr1cs format
uses: ./.github/workflows/config-test
with:
param: ./tests/sr1cs/safe.sr1cs
exit: 8

- name: generate witness files
uses: ./.github/workflows/config-test
with:
param: --wtns . ./benchmarks/circomlib-cff5ab6/[email protected]
exit: 9
- name: test witness files
run: |
diff first-witness.wtns tests/data/first-witness.wtns.expect
diff second-witness.wtns tests/data/second-witness.wtns.expect

misc-test:
runs-on: ubuntu-latest
container:
image: veridise/picus:git-latest
env:
PLTADDONDIR: /root/.local/share/racket/
steps:
- uses: actions/checkout@v1
- name: run tests
run: |
raco test ./tests/performance-test.rkt
raco test ./tests/framework-test.rkt

main-test:
strategy:
fail-fast: false
matrix:
include:
- name: circomlib
num-runs: 3
jobs: '[0, 1, 2]'
path: ./tests/circomlib-test.rkt
- name: mixed
num-runs: 1
jobs: '[0]'
path: ./tests/mixed-test.rkt
uses: ./.github/workflows/main-test.yml
with:
name: ${{ matrix.name }}
num-runs: ${{ matrix.num-runs }}
jobs: ${{ matrix.jobs }}
path: ${{ matrix.path }}
42 changes: 42 additions & 0 deletions .github/workflows/main-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
workflow_call:
inputs:
name:
description: Name
required: true
type: string
num-runs:
description: Max number of runners
required: true
type: string
jobs:
description: Job array
required: true
type: string
path:
description: Path to file
required: true
type: string
jobs:
test:
strategy:
fail-fast: false
matrix:
id: ${{ fromJSON(inputs.jobs) }}
runs-on: ubuntu-latest
container:
image: veridise/picus:git-latest
env:
PLTADDONDIR: /root/.local/share/racket/
steps:
- uses: actions/checkout@v1
- name: linking circom
run: ln -s /root/.cargo/bin/circom /usr/bin/circom
- name: run picus with cvc5
run: raco test ++args "--parallel ${{ matrix.id }} ${{ inputs.num-runs }}" ${{ inputs.path }}
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: ${{ inputs.name }}-${{ github.sha }}
path: benchmarks/**/*.json
retention-days: 14
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.venv
benchmarks/**/*.patched.circom
benchmarks/**/*.json
benchmarks/**/*.sym
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## v1.0.2 - 2023-11-02
### Fixed
- Fixed ANSI codes not stripped away correctly

## v1.0.1 - 2023-11-01
### Fixed
- Fixed the format of accounting logging in the --json mode.

## v1.0.0 - 2023-10-26
### Changed
- Changed the supported Circom version from 2.0.7 to 2.1.6.
Loading