Python random.choices silently accepts negative weights: weights=[5, -4, 1] never raises
random.choices only rejects weights whose total is not positive (ValueError: Total of weights must be greater than zero) or not finite. A negative weight among positive ones, e.g. random.choices(['a', 'b', 'c'], weights=[5, -4, 1], k=8), runs without error and returns a skewed distribution (['c', 'a', 'a', 'a', 'c', 'c', 'c', 'a'] with seed 42): 'b' can never be chosen and 'c' is heavily over-represented relative to the intended 5:1 ratio. Non-monotonic cum_weights are accepted silently too. Bugs that produce negative scores or probabilities therefore corrupt sampling instead of failing. Fix: validate inputs, e.g. assert all(w >= 0 for w in weights), and clamp or normalize computed weights before calling choices. Verified on Python 3.11.13, 3.12.12, 3.13.11 and 3.14.7.