A failing randomize call has two symptoms: it returns 0, or it returns 1 with values the test did not want. Four root causes sit behind those symptoms, and each needs a different tool.
Symptom | Root cause | First tool |
|---|---|---|
Returns 0 | Hard contradiction: the active constraints plus state values have no solution | Binary search over constraint blocks |
Returns 1, field never changes | Silent skip: null handle, stuck rand_mode, or field never rand | Handle and mode audit |
Returns 1, values skewed | Wrong distribution: implication skew, eaten soft default, clipped range | Histogram over many calls |
Fails only on some seeds | Seed and stability problem, not a constraint problem | Seed capture and replay |
Lesson | What it covers | Path |
|---|---|---|
The four modes, the triage flowchart, and the solver refresher. | Required | |
Block binary search and the deletion filter that names the minimal core. | Required | |
Check-only pins, inline-with conflicts, solver dumps and the minimal repro. | Recommended | |
Histograms, implication counting, solve-before, and silent discards. | Recommended | |
Seed replay, the silent trio, loud wrappers, and the ten-step procedure. | Recommended |
Path: Required is the core first pass for this part, Recommended is for most learners, and Optional is reference, specialist depth or revision.
No. Reproduction is orthogonal to the other modes. Capture the seed, replay the exact test, seed, and build triple, and confirm a bit-identical failure before touching any constraint.