test: verify conversion arithmetic invariants - #154
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
luchobonatti
left a comment
There was a problem hiding this comment.
The proptests over checked_mul_div_floor are welcome and everything is green. My doubts are the Kani part: --features kani does not build, the harnesses sit inside mod test where cargo kani cannot see them, and they check a hand-written i128 formula rather than the helper. Was it run? Would you also fill in the PR template?
|
It was not run: Kani is not in the devshell and |
c199a19 to
5a607e6
Compare
5a607e6 to
7d7dae1
Compare
luchobonatti
left a comment
There was a problem hiding this comment.
Kani removed rather than patched, and the reasoning is better than my suggestion. The wind-down property now follows the real accumulator. 213 tests, clippy and fmt clean.
The wind-down property now follows the accumulator and earned - paid across rounds and claims. The Kani harnesses never ran and proved a hand-written formula; the helper's overflow path goes through the host's I256, which Kani cannot model.
7d7dae1 to
9d95e6c
Compare
Summary
Ref #79
Before the audit, the conversion arithmetic should be checked by more than the example tests written alongside it. Property tests run the real rounding helper over wide ranges and check the wind-down accumulator across rounds.
Changes
Deviations
I256, which Kani cannot model.Acceptance criteria
#79 has none by design; this covers the conversion-arithmetic candidate with property tests instead of Kani.
Test plan
Automated tests
nix develop -c cargo test -p async-vault— 213 passed.nix develop -c cargo clippy -p async-vault --all-targets -- -D warnings— clean.Manual verification
None.
Breaking changes
None.
Checklist
Screenshots
None.