Skip to content
Snippets Groups Projects
Commit 94b544af authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

test all shard permutations in the CLI test (dragoon/komodo!14)

related to
- dragoon/komodo!13

## description
in dragoon/komodo!13, i noticed that decoding can be pretty sensitive to the order of the shards...
this is why i thought testing all possible permutations of the shards could be beneficial :thinking:

see the [run attached to this MR](https://gitlab.isae-supaero.fr/dragoon/komodo/-/jobs/11281#L1120) to see all the combinations of shards used in the tests, e.g. `[0, 2, 3]` means that shards `0`, `2` and `3` have been used and shards `1` and `4` have been "_lost_" 

## changelog
this MR
- adds an inline `math` module to `tests/cli.nu` which defines
  - `choose` which computes all the sets of $k$ choose $n$ in $[|0, ..., n - 1|]$
  - `perm` which computes all the permutations on $[|0, ..., n - 1|]$
  - see the inline `_test_choose` and `_test_perm` commands for concrete examples of their behaviours
- compute all the permutation of $k'$ choose $n$ shards, where $k'$ ranges from $k$ to $n$
- run the reconstruction test on all these cases
- moves the CLI example from `README.md` to `examples/cli.nu`

> **Note**  
> also removes the newline added to the stdout of `komodo` commands, so that the output is prettier, without spurious empty lines
parent 964b9847
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment