| name | numerical-test-design |
| description | Design focused tests for numerical algorithms, convergence behavior, analytic cases, and backend parity. |
Numerical Test Design
When to Use
Use when planning or reviewing tests for numerical algorithms, solvers, kernels, or scientific data transforms.
Checklist
- Include analytic or manufactured cases when possible.
- Test limiting cases, zero-size or small-size inputs, invalid inputs, and boundary conditions.
- Use deterministic seeds for stochastic algorithms.
- Test expected convergence rates where relevant.
- Justify tolerances from method order, conditioning, discretization error, or reference precision.
- Add regression tests for known examples or validation fixtures.
- Check CPU/GPU/backend parity where relevant.
- Keep tests small and reproducible.
Output Format
Return:
- Test objectives.
- Proposed test cases.
- Expected results and tolerances.
- Required fixtures or seeds.
- Gaps or follow-up validation.
Common Failure Modes
- Golden values are generated by the same implementation under test.
- Stochastic tests are flaky.
- Tests assert overly exact values for approximate methods.
- Convergence tests use too few resolutions.
- Backend parity tests ignore dtype or memory layout differences.