ADR-0014: irtlib Checks the Model’s Domain, Not the Limits of Floating Point#
Status#
Accepted 2026-11-30
Context#
The ability estimators, the priors and the plots carried guards and tests for values at the limits
of double precision: discriminations of 1e154 to 1e300, normal priors with standard deviations of
1e-200 to 1e200, guessing parameters of 1e-200, difficulties 2,000 units from an ability, and
tolerances finer than SciPy’s brentq reaches in its 100 iterations. Each guard added a branch or a
fallback that only such values reach, and each probe found the next overflow further on: a review of
the weighted likelihood estimate found SciPy’s error from a discrimination of 2.68e154 and NaN
standard errors from 1.34e154, and proposed refusing discriminations above the cube root of the
largest float (measured 2026-11-29).
No calibration produces such values. The test suite turns every warning into an error, so NumPy’s overflow warning, the right message to a caller who passes them, failed the suite and was silenced.
Meanwhile the ability estimators accepted NaN and infinite item parameters: for a NaN parameter, maximum likelihood and MAP returned -6 for every examinee, with no error (measured 2026-11-28).
Decision#
Every function that takes a response matrix with its items, and the number-correct probabilities, checks that the items are a matrix of finite numbers and names the first item that is not; the item bank and response drawing check the same. Priors, grids and the calibrators check their own arguments. These checks define the domain: values that are meaningful for the model.
Within the domain, irtlib computes in the forms that keep realistic extremes exact: likelihoods and posteriors on the log scale, the probabilities of a correct and of an incorrect response each from its own side of the logistic, and the limits of ratios where a probability underflows. Their tests use the magnitudes where those extremes occur: long tests, slopes that run away in a calibration, logits in the hundreds.
irtlib has no guard, fallback or test for finite values far beyond any calibration’s, whose arithmetic leaves the range of a double: discriminations whose cube can pass the largest float, above about 5.6e102; logits \(a(\theta - b)\) beyond about ±1,400, where a standardized residual passes the largest float; asymptotes near the smallest doubles; normal priors with standard deviations near 1e-154 and below; and tolerances finer than a search reaches. There a result may be NaN or infinite, NumPy warns, SciPy may raise its own error, and an examinee’s estimate in a matrix may differ from its estimate alone.
The entry points set no limit on the size of a finite value.
Consequences#
A NaN or infinite parameter fails with an error that names the item wherever responses are scored against items.
The ability estimators’ guarantees hold within the domain, which their family’s page states.
Outside it, NumPy’s and SciPy’s warnings and errors are the signal. The test suite keeps turning warnings into errors: a warning within the domain points to a bug.
No search carries a branch that only values outside the domain reach, and a failure found there needs no fix.
Alternatives Considered#
Refuse finite values past the limits, such as discriminations above the cube root of the largest float: every estimator’s Raises section and the item bank’s rules would name a number no researcher uses, tested on both sides, and packages built on irtlib would inherit it.
Guard each overflow as it is found: an open-ended series of branches and tests for inputs nobody gives.
Let warnings pass in the test suite: warnings within the domain, which point to bugs, would pass too.