Skip to content

test all shard permutations in the CLI test

STEVAN Antoine requested to merge more-cli-test-completion into main

related to

description

in !13 (merged), 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 🤔

see the run attached to this MR 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

Edited by STEVAN Antoine

Merge request reports