Skip to content

Commit

Permalink
feat(kyber/fstar): add README for diff workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
W95Psp committed Jan 31, 2024
1 parent a57b45e commit 1340b87
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions proofs/fstar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Extraction directories
The `extraction` directory is generated automatically by hax from the
Rust code. The `extraction-edited` and `extraction-secret-independent`
are hand-edited snapshots of `extraction` at some point in time.

The edits (1) on the one hand between `extraction` and
`extraction-edited` and (2) on the other hand between
`extraction-edited` and `extraction-secret-independent` are tracked
via diff files.

Whenever the rust code changes, the extracted F* code in `extraction`
changes as well. The CI then apply the diff files: if the patch
process fails or if the resulting patched F* doesn't typecheck, the CI
fails.

The bash script `./patches.sh` takes care of the diffs:
- `./patches.sh create` creates patches out of the `extraction*` folders;
- `./patches.sh apply` drops the `extraction-edited` and
`extraction-secret-independent` folders and re-create them out of
the `extraction-edited.patch` and
`extraction-secret-independent.patch` files.

# Workflow
Ideally:
- since `extraction` is a projection from the Rust code via the hax
toolchain, we should not commit it in the repository;
- since `extraction-edited` and `extraction-secret-independent` are
created via the diff files, we should not commit them either in the
repository.

Currently, we do check those 3 folders in. Thus, when we change
anything in the F* proofs, we should always make sure we keep the diff
files and those folder in a coherent state.

In other words, this means that the last commit of each PR should be
about regeneration of diff files, using the command `./patches.sh create`.

0 comments on commit 1340b87

Please sign in to comment.