|
LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
|
Thank you for investing your time in contributing to the LLZK project!
Before getting involved, read our Code of Conduct to keep our community approachable and respectable.
In this guide you will get an overview of our overarching philosophy, as well as the contribution workflow; from opening an issue, creating a PR, reviewing, and merging the PR.
To keep the LLZK codebase maintainable and approachable, we follow these guiding principles for all contributions:
If you spot a problem, encounter a bug, or want to request a new feature, first search for an existing issue. Please contribute to an existing issue when possible instead of opening a duplicate.
If a related issue does not exist, open a new issue using the relevant issue form. A new issue must clearly describe and motivate the bug or feature, including its impact or use case, expected behavior, and enough detail for a maintainer to evaluate it.
New issues begin with the under review label. This means the proposal is still being evaluated or refined. A maintainer may ask for more information, narrow the scope, suggest an alternative, or decline the proposal. Do not submit a PR while an issue is still under review because it will be closed.
A maintainer will replace that label with approved when the issue is sufficiently motivated, appropriately scoped, and suitable for implementation. Approval does not assign the issue to a contributor or guarantee that a resulting PR will be merged.
External contributors should start by scanning our existing issues for one that interests them. Issues labeled approved are ready for implementation; issues also labeled good first issue are intended to be approachable for newcomers. You can narrow the search using labels as filters.
As a general rule, we do not assign issues. Before starting work, comment on the issue to share your intended approach and coordinate with other contributors. Every external contribution must resolve one or more existing issues, and those issues must be marked approved before implementation begins.
The scripts/generate-test-checks.py utility generates heuristic FileCheck directives from printed MLIR or LLZK IR. Use it to bootstrap checks, then review them against the behavior the test is intended to cover:
When --source is provided, every line matching --source_delim_regex begins a source segment; the default pattern is func @, which does not match LLZK's function.def spelling. Choose an anchored pattern that matches the actual source segments. For split-input tests, use the split boundaries or generate from a temporary file containing only the relevant input chunks. Use -i/--inplace only after checking the generated output. In-place mode requires --source, cannot be combined with --output, and refuses to modify a source whose supplied path or resolved target is in a dirty Git worktree, including untracked files. Use --allow-dirty only when updating generated directives in a dirty worktree is intentional. In-place output must contain one check block for each source segment; otherwise, the script exits without modifying the source. In-place mode writes the complete result to a temporary file beside the resolved source, copies its permission bits, and then replaces the resolved source file; a source symlink remains intact. In-place generation or replacement failures leave the source unchanged.
Run the utility's unit tests with python3 -m unittest scripts/generate-test-checks.py -v.
Source updates replace recognized FileCheck directives only for the selected prefix and preserve unrelated source text and comments. The generated checks are not authoritative: verify that they cover the relevant behavior, and retain complete transformed output for transformation tests.
LLZK tests should have // RUN: on the first line(s) followed by a blank line. Any necessary check lines shold follow the input IR. In a multi-test file each individual test should have a brief description before the test input and any necessary check lines after the input but before the next // ----- separator. Keep the generated indentation and SSA substitutions, with no blank lines or prose inside a check block. These layout adjustments must not omit any transformed output.
Commit the changes once you are happy with them. Remember that all code must pass a format check before it can be merged, so consider running clang format before pushing your commits. For more information, see the development workflow section.
When you are finished with the changes, create a pull request, also known as a PR. External PRs must link to the approved issue or issues they resolve.
Before submitting your PR, ensure you have:
Once you submit your PR, a maintainer will first review its linked issue(s). We may defer implementation review until every issue addressed by an external PR is marked approved. If the motivation or scope is unclear, we will continue that discussion on the issue before reviewing the implementation.
After the linked issues are approved, a maintainer will review the PR. We may ask questions or request additional information.
Congratulations! The LLZK team thanks you.
Once your PR is merged, your contributions will be publicly available in the LLZK-lib repository.