ChooseMany or Shuffle? Verifiable Sampling with D20DAO
Select three evaluation cases from twelve with D20DAO. Compare one pick, sampling without replacement and full shuffles, then define reproducible checks.
Specify three positions from twelve
An evaluation runner has twelve test cases and needs three different cases for its next review. Before requesting randomness, define what the result must contain: three distinct positions in the original list, each between zero and eleven. The requirement is more precise than asking for three random numbers.
D20DAO provides built-in mappings for one selection, several selections without replacement and a complete shuffled order. Choosing the operation first makes the expected output and the later review explicit. This guide uses the twelve-case example to compare those choices.
Choose one, choose several, or order everything
ChooseOne returns one zero-based index. It fits a request for a single case. ChooseMany returns a sequence of the requested number of distinct indices without replacement; for this review, its population is twelve and its count is three. Shuffle returns every index exactly once, giving a complete order for running all twelve cases.
Use ChooseMany for the selected cases and decide how their returned order will be used. Use Shuffle when the complete execution order is part of the requirement. Keep the selected operation in the recorded request rather than choosing whichever interpretation looks convenient after a result arrives.
Repeated single picks do not promise distinct positions
Three separate one-position selections can select the same position more than once. Removing duplicates afterward can leave fewer than three cases. Adding replacement draws introduces another selection policy that reviewers must understand.
For three distinct positions, express that requirement directly with ChooseMany. Replaying the same accepted word with the same mapping is deterministic; repeating that calculation does not create another draw. Treat the original result as the review sample, even when its contents seem uninteresting.
Distinct indices can still name the same case
The mapping selects positions, not meanings. If the list includes the same evaluation case at positions two and seven, selecting both positions still produces two appearances of that case. Decide whether versions, repeated fixtures or aliases count as separate evaluation units before fixing the list.
The agent API accepts either a population or item labels. Labels help display the result, but only their count enters the onchain mapping. A proof does not establish label uniqueness or the list's order. Keep stable case identifiers and the original ordered manifest in the application.
Fix the list and mapping before requesting
Record the evaluation version, ordered twelve-case list, selection count and rules for interpreting the returned order. Retain its exact manifest bytes and commitment. Bind that context through the supported seed interface when opening the request.
D20DAO's request input binds the mapping hash alongside its other request fields. A valid result therefore needs matching request context, not simply a plausible set of three numbers. The consumer must enforce its application association. For agent API calls, check the documented payment-to-request binding too; the API opens requests on Arc, while contract integrations are available on Arc and Robinhood Chain.
Keep the documented limits and original order
The current ChooseOne, ChooseMany and Shuffle mappings support populations from one through 256. ChooseMany requires a count from one through the population. Shuffle's mapping count equals its population; the HTTP operation accepts population or items rather than a separate sampling count. A larger corpus needs a separately designed sampling approach; do not assume independent chunks are equivalent to one global sample.
Save the returned sequence before sorting it for a report. A sorted display may help a reader find cases, but retain the original indices and explain which order controls execution. When replaying, use the SDK's exact mapping rather than replacing it with raw modulo or a custom shuffle.
Review the selection without overstating the evidence
Match the chain, coordinator, consumer, request ID and stored mapping to the evaluation record. Reproduce the indices from the accepted word, then resolve them against the committed list. Independently verify the underlying proof, canonical receipts and historical configuration as well.
A valid selection does not establish that the twelve cases cover every failure mode, that they were labeled correctly or that the evaluation runner executed them. Verifiable sampling records how cases were selected. Dataset quality, coverage targets and execution evidence remain responsibilities of the evaluation workflow.
Write the acceptance checks before the draw
For the twelve-case review, include these checks in the integration plan:
- ChooseMany returns exactly three indices, all in the range zero through eleven, with no repeated position.
- A full Shuffle contains all twelve positions exactly once, while ChooseOne returns one position.
- A duplicate case identifier in the input is detected or deliberately documented before requesting.
- The original result sequence and manifest remain available after display sorting or a page reload.
- The result belongs to the recorded request and is not replaced because another sample looks preferable.