Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Validation

This section is where the docs earn trust. The table records Property | Tolerance | Measured | Anchor: the bounded property, the comparison policy, what is measured, and the tests that enforce the claim. It includes the FD-vs-AD gradient audit (principle 1), discrete spatial contracts, quantity transforms, provenance-card integrity, and convergence checks for the numerical methods. Each row states the bounded claim its cited tests enforce; absence from this table is not evidence of validation.

Read the rows with the corresponding explanations: gradient contracts in Writing AD-safe scientific numerics, discrete and exact neighbor contracts in Spatial indexing and neighbor contracts, implemented quantity semantics in Quantities, units, and dimensional boundaries, and source-backed registry pages in Provenance cards.

Validation anchors

PropertyToleranceMeasuredAnchor
Constants match their recorded CGS valuesExact or documented floating tolerance per constantUnit tests compare exported constants and derived valuestests/unit/test_constants.py
Unit-system conversions round-trip through CGSFloating tolerance in the unit testsMass, length, time, velocity, and G conversionstests/unit/test_units.py
Astrometry and coordinate transforms preserve the documented ICRS-to-Galactic convention and round tripsExact reference identities and focused floating tolerancesParallax, proper-motion conversion, Cartesian/spherical transforms, and the adopted Galactic rotationtests/unit/test_astrometry.py, tests/unit/test_coords.py
Coordinate gradients state explicit contracts at smooth and singular coordinate locationsContract-specific AD/FD agreement, finite blocked results, or expected zerosPublic astrometry and coordinate cases at ordinary points, poles, origins, and coincident geometriestests/validation/test_coords_grad_audit.py
The implemented quantity layer preserves explicit dimension, unit, parser, serialization, basis, constant, equivalency, and math contractsExact rational equality, CGS scale parity, structured errors, and focused floating tolerancesQuantity PyTree arithmetic, unit parsing/formatting, registry lookup, constants provenance, opt-in equivalencies, and dimension-aware math; this does not claim ecosystem adoptiontests/unit/test_quantity_dimensions.py, tests/unit/test_quantity_units.py, tests/unit/test_quantity_parser.py, tests/unit/test_quantity_serialization.py, tests/unit/test_quantity_bases.py, tests/unit/test_quantity_constants.py, tests/unit/test_quantity_equivalencies.py, tests/unit/test_quantity_math.py, tests/unit/test_quantity_arithmetic.py, tests/unit/test_quantity_registry.py
Quantity values survive representative JAX transformsExact or close transform outputsjit, vmap, and grad through quantity construction, conversion, where, reductions, and math wrapperstests/validation/test_quantity_jax_transforms.py, tests/validation/test_quantity_math_gradients.py
enable_high_precision() configures JAX x64 before array creationExact config statejax_enable_x64=True and highest matmul precisiontests/unit/test_jaxconfig.py
AD-safe numerical primitives avoid NaN gradients on guarded pathsTest-specific finite/close checksRoot-finding, interpolation, sampling, quadrature, and safe mathtests/unit/test_numerics.py, tests/validation/test_grad_checks.py
Root bracketing and monotone inverse tables expose explicit value/gradient contractsExact synthetic roots, fixed trace masks, explicit exhaustion/missing-bracket flags, and FD-vs-AD checks only where claimedSafeguarded IQI/secant/midpoint proposals, no post-convergence evaluations, JIT/VMAP values, physical-cost lax.map, and documented value-first AD policytests/unit/test_bracketed_root.py, tests/unit/test_numerics.py, tests/validation/test_bracketed_root_algorithms.py
Certified implicit scalar roots expose an implicit function theorem (IFT) derivative only behind explicit assumptions and runtime evidenceAnalytic and central-FD gradient agreement; fail-closed NaN value/gradient on rejected certificatesLinear, positive quadratic, exponential, rejected uniqueness, zero slope, and no-while JAXPR checkstests/unit/test_implicit_root.py, tests/validation/test_implicit_root_gradients.py, docs/validation/implicit-root-gradients.json
Safeguarded scalar root costs are recorded by function evaluations as well as bounded warm timingsExact schema/units; no hardware-dependent speed thresholdBisection versus safeguarded-hybrid evaluations, executed iterations, absolute/relative residuals, and warm scalar wall time on five analytic casesscripts/benchmark_rootfinding.py, docs/validation/rootfinding-performance.json, tests/unit/test_benchmark_rootfinding_script.py
Public finite-difference diagnostics report AD-vs-FD agreement with tolerance metadataExact analytic comparisons and custom-JVP mismatch detectionCentral gradients, Jacobians, directional derivatives, structured pass/fail reportstests/integration/test_grad_audit.py
Cubic interpolation preserves its boundary and smoothness contractsExact synthetic identities, SciPy natural-spline parity, and FD-vs-AD checksCubic Hermite recovery, natural cubic spline coefficients/evaluation, clamped boundaries, PCHIP turning-point slopes, monotone bounds, PyTree/JAX transformstests/unit/test_interpolation_shape_preserving.py, tests/validation/test_grad_checks.py
Regular-grid interpolation recovers affine tables and differentiates inside grid cellsExact synthetic identities, executable documentation, and FD-vs-AD checksBilinear/trilinear affine recovery, arbitrary trailing payload axes, whole-payload fill, eager axis/reject validation, clamp/fill/reject policies, JAX transformstests/unit/test_regular_grid.py, tests/integration/test_regular_grid_docs.py, tests/validation/test_grad_checks.py
Grid and stratified sampling helpers preserve explicit construction contractsExact grid identities, conservation checks, and FD-vs-AD checks where smoothLog/geometric grids, bin centers, conservative rebin totals, one-sample-per-stratum uniformstests/unit/test_grids.py, tests/unit/test_sampling.py, tests/validation/test_grad_checks.py
Structured 1D mesh helpers preserve finite-volume geometry and conservation contractsExact geometry/stencil identities, conservation checks, and FD-vs-AD checks for remap valuesUniform edges, cell centers/widths/volumes, face geometry, neighbor stencils, divergence, face averaging, conservative remaptests/unit/test_meshes.py, tests/validation/test_grad_checks.py
Random stream and resampling helpers preserve deterministic key, validation, and shape contractsExact fixed-key behavior, invalid eager-input rejection, uniform zero-total fallback, exact residual integer counts, executable documentation, and JIT shape checksKey streams, folded-in streams, seed manifests, systematic/stratified/residual resamplingtests/unit/test_random.py, tests/integration/test_random_docs.py
B-spline basis, evaluation, calculus helpers, fitting, and tensor designs preserve local-basis invariantsExact synthetic identities and FD-vs-AD checksPartition of unity, nonnegativity, local support, Bernstein cubic, degree-1 parity with interp1d, de Boor parity, analytic derivatives, antiderivative/integral checks, roughness penalties, quantile knots, tensor-product designs, least-squares recovery, PyTree/JAX transformstests/unit/test_splines.py, tests/validation/test_grad_checks.py
Fixed-node quadrature and cumulative Simpson preserve their exactness contractsExact polynomial/moment identities and FD-vs-AD checksGauss-Legendre, Gauss-Laguerre, Gauss-Hermite, Clenshaw-Curtis, Hermite coefficients, cumulative Simpson panel sumstests/unit/test_quadrature.py, tests/unit/test_numerics.py, tests/validation/test_grad_checks.py
Dense linear algebra helpers expose stable contracts for small fits and diagnosticsExact synthetic identities, invalid eager-input rejection, executable documentation, and FD-vs-AD checks away from rank/cutoff boundariesWeighted least squares, finite weights, positive covariance normalization, covariance/correlation guards, QR/SVD solves, and positive-definite jitter searchtests/unit/test_linear_algebra.py, tests/integration/test_linear_algebra_docs.py, tests/validation/test_grad_checks.py
Autodiff product helpers match explicit dense derivatives and independent finite-difference checksDense-Jacobian/Hessian parity and finite-difference gradient-direction checksJVP, VJP, HVP, Jacobian-vector, vector-Jacobian, Gauss-Newton, and empirical Fisher-style productstests/unit/test_autodiff.py, tests/validation/test_grad_checks.py
Distribution kernels preserve normalization, monotone CDFs, inverse-CDF round trips, and smooth interior gradientsNumerical integration tolerances, exact round trips within floating tolerance, analytic alpha=-1 limits, and central-FD-vs-AD checks through the removable singularityNormal, lognormal, finite power law (including normalization/logpdf/CDF/PPF through alpha=-1), and truncated normal helperstests/unit/test_distributions.py, tests/validation/test_grad_checks.py
Geometry helpers preserve rotation, quaternion, and rigid-transform identitiesExact identity/round-trip checks and FD-vs-AD checks away from degenerate angles/vectorsNormalization, angular distance, axis-angle rotations, quaternions, rigid transforms, inverse and composition helperstests/unit/test_geometry.py, tests/validation/test_grad_checks.py
Optimization helpers expose differentiable objective diagnostics without owning an optimizer stackExact robust-loss identities, Armijo descent checks, and FD-vs-AD checks away from nonsmooth kinksSquared/Huber/pseudo-Huber losses, weighted objective summaries, fixed-iteration Armijo backtracking, convergence diagnosticstests/unit/test_optimization.py, tests/validation/test_grad_checks.py
Fixed-step ODE helpers preserve analytic toy-system behavior and scan-compatible AD pathsAnalytic growth/decay tolerances, bounded harmonic-oscillator energy drift, and FD-vs-AD checksEuler, midpoint/RK2, RK4, fixed-step dispatch, velocity-Verlettests/unit/test_ode.py, tests/validation/test_grad_checks.py
Linear operators preserve matrix algebra while remaining PyTreesDense parity for matvec/rmatvec/to_dense and FD-vs-AD checks through operator leavesDense, diagonal, scaled, sum, product, transpose, and block-diagonal operatorstests/unit/test_operators.py, tests/validation/test_grad_checks.py
Special-function kernels keep unit and normalization contracts explicitDirect formula parity, limiting-case checks, recurrence identities, and FD-vs-AD checksCGS Planck functions and log kernels, normalized log weights, Legendre/Chebyshev/Laguerre basestests/unit/test_special.py, tests/validation/test_grad_checks.py
Numerical-method trust reports render deterministic evidence summariesExact JSON ordering and Markdown table checksEvidence dataclasses, JSON/Markdown renderers, default numerics trust report coveragetests/unit/test_provenance.py
Runtime provenance manifests render deterministic evidence recordsExact schema, sorted JSON/Markdown checks, and missing-file behaviorArtifact hashes, environment snapshots, method manifests, JSON and Markdown rendererstests/unit/test_runtime_provenance.py
The provenance-card registry resolves source symbols and assertion-bearing validation node IDs and renders fresh reference pagesExact schema, symbol resolution, pytest collection, and byte-for-byte generated-page equalityApproved card families, unique card IDs, importable code references, collectable validation tests, assertion-bearing test bodies, and deterministic MyST outputtests/validation/provenance_cards/test_registry.py::test_validation_references_collect_and_assert_behavior, tests/validation/provenance_cards/test_registry.py::test_generated_pages_equal_fresh_rendering
FD-vs-AD audits classify gradient contracts conservativelyExisting audit tolerancesSmooth, known-zero, blocked, surrogate, and validation-only casestests/integration/test_grad_audit.py
Spatial candidate gathering and exact fixed-radius pairs preserve their distinct recall, symmetry, cutoff, capacity, and overflow contractsExact set containment or brute-force equality for small clouds; explicit overflow flagsRegular, boundary, clustered, cutoff-straddling, and undersized-capacity cases; Morton dense allocation is restricted to supported power-of-two gridstests/unit/test_spatial.py, tests/unit/test_spatial_grid_contract.py
Generic spectral types preserve coordinate, point/bin sampling, physical semantic, provenance, conversion, resampling, and structured status contractsExact identities and focused floating tolerancesWavelength/frequency and density transforms, point and conservative-bin remapping, fail-closed coveragetests/unit/test_spectra_types.py, tests/unit/test_spectra_transforms.py, tests/unit/test_spectra_resampling.py
Prepared spectral stencils evaluate only inside host-selected complete cells or approved simplicesExact affine/geometric fixtures, fixed shapes, and AD-vs-FD agreementLinear and positive-log interpolation, jit, vmap, status arrays, and local derivativestests/unit/test_spectra_stencils.py
Source-specific atmosphere adapters convert every vertex to canonical surface F_lambda before parameter interpolationAnalytic conversion fixtures and strict product identityNewEra 1e3, BOSZ per-angstrom 10, Sonora 1e-6, TLUSTY 4 pi H_nu plus density-coordinate conversiontests/unit/test_atmospheres_newera_backend.py, tests/unit/test_atmospheres_bosz.py, tests/unit/test_atmospheres_sonora.py, tests/unit/test_atmospheres_tlusty.py
Atmosphere interpolation policies are selected from deterministic real-artifact holdouts without invented thresholdsStrict primary-metric win and no secondary regressionPositive-log accepted for NewEra; linear accepted for representative BOSZ/OSTAR; Sonora and BSTAR remain POLICY_NOT_VALIDATEDtests/unit/test_spectral_validation.py, tests/validation/test_atmosphere_holdouts.py, docs/validation/atmosphere-interpolation.json
Exact-product registry routing fails closed on unratified or unavailable scienceExact synthetic and real status codesProduct-scoped coverage, validated artifacts, POLICY_NOT_VALIDATED for Sonora/BSTAR, no compatibility aliasestests/unit/test_atmospheres_library.py, tests/validation/test_atmospheres_spectra.py
Atmosphere coverage reports are deterministicExact Markdown/JSON orderingSynthetic catalog rows summarized into stable coverage tablestests/unit/test_atmospheres_coverage.py, tests/unit/test_report_atmosphere_coverage_script.py
Sonora and TLUSTY converters preserve raw semantic columns and archive provenanceSynthetic zip/tar readback with float32 storage checksSonora wavelength/W/m2/m; TLUSTY frequency/H_nu; source archives are not deletedtests/unit/test_sonora_conversion_script.py, tests/unit/test_tlusty_conversion_script.py
Local processed atmosphere artifacts match measured coverageExact local counts and finite sampled fluxSonora 1440 valid spectra + 4 skipped resource forks; TLUSTY 981/551/690 spectra with raw archives preserved and ragged-grid Zarr subgroupstests/validation/test_atmospheres_local_artifacts.py
Cross-library overlap validation is diagnostic, not a strict model-equality claimShape/domain/finite checks and normalized SED difference onlySynthetic overlapping and non-overlapping spectratests/unit/test_atmospheres_overlap.py
Real prepared spectra are I/O-free after preparation and pass transform/performance gatesFinite 64-bin values, fixed shapes, AD-vs-FD tolerance, recorded timings without a fabricated performance ceilingSupported NewEra/BOSZ/OSTAR paths, evidence-gated Sonora/BSTAR paths, jit, vmap, local gradient, host preparation, first JIT, cached and batched evaluationtests/validation/test_atmospheres_spectra.py, tests/unit/test_benchmark_spectra_script.py, machine envelope, human report

Local evidence commands

Use the focused commands below when changing one subsystem:

uv run pytest tests/integration/test_grad_audit.py
uv run pytest tests/integration/test_grad_audit.py tests/unit/test_spatial.py
uv run pytest tests/unit/test_quantity_*.py tests/validation/test_quantity_*.py
uv run pytest tests/unit/test_spectra_*.py tests/unit/test_atmospheres_*.py
uv run pytest tests/unit/test_interpolation_shape_preserving.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_regular_grid.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_grids.py tests/unit/test_sampling.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_meshes.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_random.py
uv run pytest tests/unit/test_splines.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_quadrature.py tests/unit/test_numerics.py tests/validation/test_grad_checks.py
uv run --no-sync pytest tests/unit/test_numerics.py tests/validation/test_grad_checks.py
uv run --no-sync python scripts/benchmark_rootfinding.py --check
uv run --no-sync python scripts/benchmark_implicit_root.py --check
uv run --no-sync pytest tests/unit/test_implicit_root.py tests/validation/test_implicit_root_gradients.py
uv run pytest tests/unit/test_linear_algebra.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_autodiff.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_distributions.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_geometry.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_optimization.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_ode.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_operators.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_special.py tests/validation/test_grad_checks.py
uv run pytest tests/unit/test_provenance.py
uv run pytest tests/unit/test_runtime_provenance.py
uv run --extra data pytest tests/unit/test_atmospheres*.py tests/unit/test_*conversion_script.py
uv run --extra data pytest tests/validation/test_atmospheres_local_artifacts.py
uv run pytest tests/validation/test_atmospheres_spectra.py

Use the broader gate before publishing or handing a branch to downstream packages:

uv run pytest
uv run ruff check src tests
uv run mypy src

The validation table is intentionally compact. Detailed numerical derivations belong in Writing AD-safe scientific numerics; this page records the executable anchors.

The generated Scientific contract registry registry connects selected public claims to these evidence classes. An unclassified callable remains unverified rather than inheriting support from its module.