Skip to content

Test every precision-templated routine in double - #56

Merged
plancherb1 merged 6 commits into
mainfrom
tests/double-coverage
Dec 3, 2026
Merged

plancherb1 merged 6 commits into
mainfrom
tests/double-coverage

Conversation

@plancherb1

@plancherb1 plancherb1 commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

What changes

Tests of precision-templated routines now run in float and in double. The suite grows from 5,257 to 9,102 tests.

  • Each test driver takes a leading --f64 switch (glass_test_pop_f64 in test/cuda/helpers.cuh) that selects run<double>; the Python side passes dtype through run_op (DTYPES, f32exact in test/conftest.py).
  • For most tests the operand files stay float32 and the driver widens them exactly. The double reference is computed in float64 from those same values.
  • copy, swap, transpose and iamax also run on native float64 operands whose values all round to 1.0 in float (--f64x, below_float). A mover must return them exactly, and iamax must find a maximum that ties in float and is not at index 0.
  • No library source changes. No existing test was removed, skipped or loosened.

What the gate shows

.github/scripts/precision_coverage.py is a static inventory per function. It requires, for every documented function whose signature uses the precision type, a call that is compiled in double: one that names double, or one inside a driver template reachable from a real <double> instantiation. It reads 408 of 408, with 7 exempt. It runs in CI and in release.sh.

  • The gate does not judge tolerances or references, and it counts functions, not test cases. The receipt records which cases ran.
  • .github/scripts/test_precision_coverage.py holds the negative controls. Changing the L1 driver's run<double> to run<float> drops every credit. Other cases cover a template never instantiated on double, macro-generated callees, a macro redefined after #undef, and a deduced launcher.

Tolerances

Tolerances and references are set per operation. Most double results are held to 1e-10 to 1e-12 relative. The looser bounds are PCG (1e-9 relative plus a residual check), unpivoted LDLT (1e-9) and the Lie and geometry routines (1e-6 by default). docs/source/user_guide/concepts/testing_oracles.rst states the rule.

Float-only routines

Seven glass::nvidia::block:: routines have float bodies only (potrs, getrf_no_pivot, getrs_no_pivot, gesv_no_pivot, geqrf, gels, gemm_batched). They are listed with that reason under double_exempt in test/api-coverage-policy.json.

Evidence

  • Desktop receipt: all eight shards run fresh at 18cb7ab, 9,102 passed, verified locally with verify_desktop.sh.
  • API overload manifest current, 669 of 669; 22 of 22 obligations with the receipt.
  • Strict docs build passes.

Not covered

  • The two Jetson lane receipts predate this change and do not include the new tests until the devices are rerun. When the Xavier lane is rerun, test/expected_skips_sm72.txt needs the new vendor test IDs.
  • The native-double fixture covers copy, swap, transpose and iamax. laswp, the strided movers and the block load and store are tested in double on float32 operands only.
  • No mutation was run against the library to watch the native-double tests fail; each test asserts that its operands collapse in float.

🤖 Generated with Claude Code

@plancherb1
plancherb1 merged commit 371404c into main Dec 3, 2026
21 checks passed
@plancherb1
plancherb1 deleted the tests/double-coverage branch December 3, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant