Validation cases#

Every calculation must be validated against independent reference results: standards, published examples (CIGRE, IEEE, IEC), textbooks or documented hand calculations.

Cases are TOML files under benchmarks/<module>/, one or more [[case]] per file:

[[case]]
id = "units-003"                      # unique across the repository
title = "Pound-force to newton"
calculation = "units.convert"         # see `ohl validate --list`
reference = "NIST SP 811 (2008), Appendix B.8 — pound-force"
notes = "Optional assumptions"
max_seconds = 1.0                     # optional time limit (default 10 s)
inputs = { quantity = "force", value = "1 lbf", to = "N" }
expected.value = { value = 4.448222, rel_tol = 1e-6 }   # abs_tol and/or rel_tol

Run them with ohl validate (today 69 cases in 15 files). Run them locally before each push; the CI workflow (started by hand only) runs every case too and publishes the report. A case fails when an output is outside its tolerance, missing, when the calculation errors, or when it exceeds its time limit.

Engines expose calculations to the runner by implementing ohl_validation::Calculation.

View this page's source on GitHub