Skip to content
Snippets Groups Projects
  1. Nov 05, 2024
  2. Sep 23, 2024
    • STEVAN Antoine's avatar
      add examples and complete the documentation (!166) · 8be768bb
      STEVAN Antoine authored
      ## changelog
      - _semi\_avid_, _kzg_ and _aplonk_ examples have been added
      - the `fs` module has been hidden behind an `fs` feature
      - the `conversions` module has been properly hidden behind the `test` config feature
      - the documentation has been completed
      - some error messages have been improved
      
      > **Note**
      >
      > the documentation of aPlonK has been left as-is for now
      1.0-alpha
      8be768bb
  3. Aug 06, 2024
    • STEVAN Antoine's avatar
      refactor algebra module (dragoon/komodo!165) · 8c07220b
      STEVAN Antoine authored
      `algebra`, `field` and `linalg` were doing extremely similar things before...
      
      this MR merges them into a single module `algebra`
      - old `algebra` and `field` are at the root of the new `algebra`
      - old `linalg` is now `algebra::linalg`
      
      all references to these have been fixed in the rest of the codebase and the features have been tuned to work fine.
      8c07220b
    • STEVAN Antoine's avatar
      fix feature dependencies and imports (dragoon/komodo!164) · 15184312
      STEVAN Antoine authored
      in dragoon/komodo!162 and dragoon/komodo!163, i did only run `cargo ... --all-features` without checking the individual features...
      
      this MR adds some `cargo check --features ...` to the `Makefile` and makes sure the imports make sense when compiling a single feature.
      
      >  **Important**
      >
      > the other notable change here is that `kzg::commit` has been moved to `zk::ark_commit` and is re-exported from `kzg` as `kzg::commit`.
      15184312
    • STEVAN Antoine's avatar
      add aPlonK (dragoon/komodo!163) · 5782d4dc
      STEVAN Antoine authored
      this adds the aPlonK cryptographic method alongside Semi-AVID and KZG+.
      
      ## changelog
      - new feature `aplonk`:
        - the `algebra` module is compiled when either `kzg` or `aplonk` features are enabled
        - `algebra::scalar_product_polynomial` compiles only with `kzg`
        - the other `algebra::*` functions compile with `aplonk`
      - `u32_to_u8_vec` has been moved to new `conversions` module which compiles when either `kzg` or `aplonk` features are enabled
      - new `aplonk` module which compiles only when the `aplonk` feature is enabled
        - public structures
          - `Block`
          - `Commitment`
          - `SetupParams`
          - `VerifierKey`
        - public functions
          - `setup`
          - `commit`
          - `prove`
          - `verify`
        - internals
          - `ipa::Params`
          - `ipa::Proof`
          - `ipa::prove`
          - `ipa::verify`
          - `polynomial::compute_g`
          - `transcript::initialize`
          - `transcript::reset`
          - `transcript::hash`
      5782d4dc
    • STEVAN Antoine's avatar
      add KZG+ (dragoon/komodo!162) · 1d527542
      STEVAN Antoine authored
      this adds the KZG+ cryptographic method alongside Semi-AVID.
      
      ## changelog
      - the Makefile now uses `--all-features` to compile everything
      - a new module `algebra` has been added, with tests for all functions
        - `algebra::scalar_product_polynomial` computes a linear combination of polynomials $(P_i)$
        - `algebra::powers_of` computes $n$ successive powers of a number $r$
      - a new function `zk::trim` has been added from [`gitlab.isae-supaero.fr:a.stevan/poly-commit@19fc0d4a/src/kzg10/mod.rs#L513-L538`](https://gitlab.isae-supaero.fr/a.stevan/poly-commit/-/blob/19fc0d4ad2bcff7df030c952d09649918dba7ddb/src/kzg10/mod.rs#L513-L538)
      - a new feature `kzg` has been added, with an optional dependency on [`gitlab.isae-supaero.fr:a.stevan/poly-commit@19fc0d4a`](https://gitlab.isae-supaero.fr/a.stevan/poly-commit/-/tree/19fc0d4ad2bcff7df030c952d09649918dba7ddb)
      - a new module `kzg` has been added and exposes the following publicly
        - structures
            - `Block`
        - functions
          - `commit`
      ...
      1d527542
  4. Aug 01, 2024
    • STEVAN Antoine's avatar
      refactor repo architecture (dragoon/komodo!161) · 3608e95a
      STEVAN Antoine authored
      ## changelog
      - `src/main.rs` has been moved to a new crate: `bins/saclin` which stands for **S**emi-**A**VID **CLI** in **N**ushell
      - dependencies of `komodo` have been fixed
      - Nushell and Rust tests have been split in the Makefile: by default, only Rust tests will run locally and Nushell tests and examples can be run manually if desired. The CI will still run everything.
      - the README has been updated
      - test images have been moved to `assets/`
      - the majority of the old `./nu-utils/` module have been moved to internals of `./benchmarks/` and imports have been fixed
      - `cargo.nu` has been moved to `./bins/` and a new `./bins/README.md` mentions it
      - `./bins/saclin/` has been created and should be a self-contained Rust crate + Nushell module
      3608e95a
    • STEVAN Antoine's avatar
      isolate Semi-AVID (dragoon/komodo!160) · 0977677f
      STEVAN Antoine authored
      this is a refactor to prepare the addition of other cryptographic methods.
      
      ## changelog
      - moves Semi-AVID code from `lib.rs` to `semi_avid.rs`
      0977677f
  5. Jul 31, 2024
  6. Jul 12, 2024
    • STEVAN Antoine's avatar
      refactor the Nushell modules (dragoon/komodo!158) · dad69f2c
      STEVAN Antoine authored
      this MR is two-fold
      - it restructures the two main Nushell modules so that they are easier to read and use
      - it improves the "run" and "plot" modules for the benchmarks
      
      ## changelog
      - `.nushell/` is now renamed to `nu-utils/`
      - `benchmarks/` is now a valid Nushell module which exports a bunch of modules
        - `benchmarks linalg`: measure and plot linear algebra operations
        - `benchmarks setup`: measure and plot trusted setup building
        - `benchmarks commit`: measure and plot crafting commitments
        - `benchmarks recoding`: measure and plot the recoding of shards
        - `benchmarks fec`: measure and plot FEC operations, such as encoding and recoding, and allow combining these results with the pure recoding ones
      - the submodules of `benchmarks` typically have a `run` and a `plot` command, whith the exception of `benchmarks fec` which has a `run` module and multiple "plot" commands in `benchmarks fec plot`
      - the "run" commands will create a random temp file by default and ask for confirmation otherwise if the output file already exists, unless `--force` is used
      - snippetds in `benchmarks/README.md` have been updated
      dad69f2c
    • STEVAN Antoine's avatar
      fix colors and markers for elliptic curves in plots (dragoon/komodo!157) · 8853e01b
      STEVAN Antoine authored
      ## results
      ![setup](/uploads/1f3a383689d3c8fd5a3f1331deabdec0/setup.png)
      ![commit](/uploads/bcf3bfdd991725abb97cbe4f8890840b/commit.png)
      ![inverse](/uploads/35316c887c6b2347baa86c4db119f762/inverse.png)
      ![mul](/uploads/262c27e99d7f2b5c8fb45761607a8717/mul.png)
      ![transpose](/uploads/2378460cb687d0a9320a24a840ed2eef/transpose.png)
      8853e01b
  7. Jul 05, 2024
  8. Jun 07, 2024
    • STEVAN Antoine's avatar
      bump to 0.3.0 (dragoon/komodo!151) · 414c94fa
      STEVAN Antoine authored
      0.3.0
      414c94fa
    • STEVAN Antoine's avatar
    • STEVAN Antoine's avatar
    • STEVAN Antoine's avatar
      add "long full recoding" test (dragoon/komodo!147) · 447e4473
      STEVAN Antoine authored
      this will
      - recode for $\#steps \in [10, 20, 100]$
      - at $t = 0$, $k$ random shards among the $n$ encoded will be selected at random
      - at $t \geq 1$, all $k$ shards will be used to recode $k$ brand new shards
      - make sure the last set of $k$ shards recoded $\#steps$ together can decode the data
      
      ## example with $(k, n) = (3, 5)$ and $\#steps = 3$
      - $(s_i)_{1 \leq i \leq k}$ are the $k$ source shards
      - $(e_j)_{1 \leq j \leq n}$ are the $n$ encoded shards
      - $(m_i)_{1 \leq i \leq k}$ are the $k$ randomly selected shards
      - $(n_i)_{1 \leq i \leq k}$ are the shards after step $1$
      - $(o_i)_{1 \leq i \leq k}$ are the shards after step $2$
      - $(p_i)_{1 \leq i \leq k}$ are the shards after step $3$
      - the $(p_i)_{1 \leq i \leq k}$ will be used for decoding
      
      ```mermaid
      graph TD;
      
          s1 --> e1; s1 --> e2; s1 --> e3; s1 --> e4; s1 --> e5;
          s2 --> e1; s2 --> e2; s2 --> e3; s2 --> e4; s2 --> e5;
          s3 --> e1; s3 --> e2; s3 --> e3; s3 --> e4; s3 --> e5;
      
          e1 --> m1;
      ...
      447e4473
    • STEVAN Antoine's avatar
      working on FEC tests again (dragoon/komodo!146) · 0e229c28
      STEVAN Antoine authored
      - pass `n` to `try_all_decoding_combinations` and don't try to decode when shards have been recoded ($\#shards > n$) and there are no recoded shards in the $k$ combination under review ($\max(is) < n$)
      - pass `recoding_steps` and `should_not_be_decodable` as arguments to `end_to_end_with_recoding_template`
      - fix $n = 5$ => this leads to tests that run in less than 10sec again
      - add $(k, n) = (8, 10)$ => tests still run in less than 13sec
      - split recoding scenarii into "_simple_" and "_chain_"
      - show indices in a "_pretty_" format, i.e. showing indices greater than $n$ as `(n)`, `(n + 1)`, ...
      0e229c28
  9. Jun 06, 2024
    • STEVAN Antoine's avatar
      complete the FEC and "linear algebra" tests (dragoon/komodo!145) · 7b0eae24
      STEVAN Antoine authored
      - `komodo::linalg::Matrix::random` is tested
      - `komodo::linalg::Matrix::inverse` is tested on more matrix sizes, from $1$ to $20$ random matrices
      - `komodo::field` tests have been double-checked
      - pure "recoding" tests from `komodo::fec` have been double-checked
      - `end_to_end` and `end_to_end_with_recoding` now runs for $k \in [3, 5]$ and $\rho \in [\frac{1}{2}, \frac{1}{3}]$ with $n = \lfloor \frac{k}{\rho} \rfloor$
      - all "_$k$ among $n + t$_" combinations are tested with `try_all_decoding_combinations`, possibly with some removals in case recoding is involved with `is_inside`
      
      >  **Important**  
      > on my machine, `make test` goes from less than 8sec on latest `main` to around 40sec with this MR
      7b0eae24
    • STEVAN Antoine's avatar
      remove `rng` and `curves` from `bins/` (dragoon/komodo!144) · e55fc269
      STEVAN Antoine authored
      they have been moved to [dragoon/binaries](https://gitlab.isae-supaero.fr/dragoon/binaries).
      e55fc269
  10. Jun 05, 2024
  11. Jun 03, 2024
  12. May 31, 2024
    • STEVAN Antoine's avatar
      make `inbreeding watch` better and more robust (dragoon/komodo!136) · e841c66b
      STEVAN Antoine authored
      - early return when format is bad twice
      - refactor
      e841c66b
    • STEVAN Antoine's avatar
      add `inbreeding list` (dragoon/komodo!135) · 3f4c8ddb
      STEVAN Antoine authored
      wait for
      - !134 
      
      ## description
      assuming !134 has been merged, this MR allows to run something like
      ```bash
      inbreeding list | input list --fuzzy | inbreeding load $in | inbreeding plot
      ```
      which will fuzzy find the available experiments and then plot it after load 👌
      3f4c8ddb
    • STEVAN Antoine's avatar
      add information about experiment to `inbreeding load` (dragoon/komodo!134) · 142e673e
      STEVAN Antoine authored
      this can be used by `plot` without passing extra arguments, i.e. the pipeline becomes
      ```bash
      use bins/inbreeding
      
      let experiment = "..."
      ```
      ```bash
      inbreeding load $experiment | inbreeding plot
      ```
      instead of having to know the value of `k` and do
      ```bash
      inbreeding load $experiment | inbreeding plot --options { k: $k }
      ```
      142e673e
    • STEVAN Antoine's avatar
      branch out RNG when measuring (dragoon/komodo!130) · a3a5f2e2
      STEVAN Antoine authored
      - addresses #9 
      - needed !133 to work
      
      this MR simply adds `+ Clone` to `rng` and removes the `mut` from the `rng` of the `measure_inbreeding` function.
      
      running the same snippet of code from #9 yields the following two images with a schedule of $1$ and $5$ respectively
      
      ![000_1.1](/uploads/ace74e299c6d4374df713ab5004f3c1d/000_1.1.png)
      ![000_1.2](/uploads/c784f5b62c41004971fd3048f7b5babc/000_1.2.png)
      
      we see that all measurements on $t$ where $t = 0 \mod 5$ are the same in both images 🎉
      a3a5f2e2
  13. May 30, 2024
    • STEVAN Antoine's avatar
      fix experiment hash by not hashing _measurement schedule_ (dragoon/komodo!133) · 3b26bad1
      STEVAN Antoine authored
      related to
      - #9
      
      in order for the measurements not to influence the experiment, the seeds passed to the runs need to not include the _measurement schedule_ parameters!
      
      EDIT: in the end, it's more than that, we want to only include things related to the environment in its hash, nothing related to the measurements, i.e. we want to either
      - exclude `strategies`, `nb_scenarii`, `measurement_schedule`, `measurement_schedule_start`, `nb_measurements` and `max_t`
      - include `nb_bytes`, `k`, `n` and `environment`
      3b26bad1
    • STEVAN Antoine's avatar
      and `inbreeding watch` command (dragoon/komodo!131) · a58c650a
      STEVAN Antoine authored
      ## output sample
      let's say the current seed is `"b239e48345ac457b492cc164f58c010d07292c88e4791e607d91796baec7f334"` and the experiment has ID `fixed:0-single:3-5-50-10240`, and that we are watching both the creation of the first experiment and a few runs, e.g.
      - `002d8de28913efbf7dbd111b817ae901fee2d47882ba7aa76d293c2d95d9652c`
      - `015672b37c9cf1a6b475937987294f9a503a922ffbcfdfc5d18ef839fac91b8c`
      - `080a51a17ac43fcbdf08f77f3bc993983fef589bd9672f04382af4b16dd09b13`
      
      then the output would look like
      ```
      b239e48  fixed:0-single:3-5-50-10240            at 2024-05-30 15:24:12
      b239e48  fixed:0-single:3-5-50-10240  002d8de   at 2024-05-30 15:24:14
      b239e48  fixed:0-single:3-5-50-10240  015672b   at 2024-05-30 15:24:16
      b239e48  fixed:0-single:3-5-50-10240  080a51a   at 2024-05-30 15:24:18
      ```
      a58c650a
    • STEVAN Antoine's avatar
      remove all mentions to "naive" and "true" recoding (dragoon/komodo!132) · 71410d6f
      STEVAN Antoine authored
      we are switching
      - _naive recoding_ to _$(k, 1)$-re-encoding_
      - _true recoding_ to _$k$-recoding_
      71410d6f
    • STEVAN Antoine's avatar
      hash the whole experiment and remove timestamp (dragoon/komodo!129) · e38dcb17
      STEVAN Antoine authored
      this is to have a complete identifier for each run, which does not depend at all on the time at which the experiment runs.
      e38dcb17
    • STEVAN Antoine's avatar
      fix random item draw (dragoon/komodo!127) · e5311d6c
      STEVAN Antoine authored
      related to
      - !122
      
      ## description
      !122 introduced a `draw_unique_indices` function which uses a `HashSet` to accumulate unique indices in the range `0..<len`.
      however, a `HashSet` does not preserve the order of insertion when iterating over the elements of the set... which results in apparent randomness, even though the RNG seed is the same 😮 
      
      this MR switches back to using `shuffle` which used to work, even though a bit less performant 👌   
      it's basically a revert of !122, while keeping the refactoring into `random.rs`.
      
      ## measuring the performance
      i did run the same timing experiment from !122 but with `main` on `bb55005f` and the MR on `fix-shuffle`
      
      | env     | main                   | mr                      | improvement         |
      | ------- | ---------------------- | ----------------------- | ------------------- |
      | fixed:0 | 6sec 244ms 238µs 45ns | 8sec 734ms 929µs 328ns | -39.88783363238997  |
      | fixed:1 | 639ms 720µs 39ns      | 731ms 360µs 261ns      | -14.325051024390373 |
      
      we loose a bit
      e5311d6c