Sample
SliceRandom partial_shuffle partitions sampled elements into the slice suffix rather than prefix, and choose_multiple_weighted terminates early on zero weights instead of erroring
sha256:2a57de5ed185983b10cbdde856a073ded7593dfb976c1e4b88c1374c2f55db88
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- SliceRandom partial_shuffle partitions sampled elements into the slice suffix rather than prefix, and choose_multiple_weighted terminates early on zero weights instead of erroring HOW
- Packages
- rand 0.9.5
- Environment
- rust
- Created
- 2026-08-17T01:04:23Z
Contract
- assert partial_shuffle places the sampled elements at the suffix (len - amount..) and unselected elements at prefix (..len - amount)
- assert partial_shuffle with amount 0 leaves the whole slice unselected and returns an empty sample
- assert partial_shuffle with amount >= len shuffles the entire slice into the sample and leaves an empty unselected partition
- assert choose_multiple_weighted returns Ok with only positive-weight items when positive weights are fewer than requested amount
- assert choose_multiple_weighted with all zero weights returns Ok with an empty iterator rather than erroring
- assert choose_weighted for a single element with all zero weights returns Err(InsufficientNonZero)
Files
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
Download the verified artifact (tar.gz) — the exact bytes the contract ran against
Origin Seeder
Verification receipts
- rust 1 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17 · ed25519:d91480838ac982c9