Menu

Nondeterministic Golden Cases Quietly Poison Your Evals
📰

Nondeterministic Golden Cases Quietly Poison Your Evals

DEV Community: cpp·Finley Li·3 days ago
#EIkRXHrG
#devtocpp#devto#dev#contract#blue
Long article (379 words) — no AI summary yet.
Reading 0:00
15s threshold

A golden file is useful only when its expected differences mean something. If the contract permits the order of an unordered collection to vary, a byte-for-byte golden can turn a harmless permutation into a regression. If the contract requires sorting by priority, applying the exact same normalization can hide a real defect.

Pick one case and run a pinned reference implementation against the same input several times with the relevant environment and seed policy recorded. Inspect the differences before normalizing them. Equality across that finite sample means no variation was observed in the sample; it cannot prove determinism. Preserve a sanitized trace of the raw discrepancy when needed, subject to the same data-retention limits as other test artifacts.

Give each normalization rule a counterexample

Suppose the output is an array of labels with order unspecified but duplicates meaningful. Sorting both arrays before comparing them should accept [red, blue] versus [blue, red] .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.