Skip to content

Command coverage

Command coverage

How much of TeX and LaTeX the engine knows, counted command by command. It sits next to the page-fidelity score (Σ|page deviation| against a reference engine) because the two answer different questions: the score says how close a rendered document is, this page says how many of the commands a document can call are handled at all, and how many of those are held to the reference.

Measured on engine v0.307.0 (commit 6a8ec838, with go-tex/math v0.63.0), on 2026-11-30, over a corpus of 21 956 papers; the usage weights below are taken from the 154 papers of the fidelity list.

The states

The states are cumulative: every conformant command is also tested, every tested command is also accepted, so each column counts the commands that reach at least that state. absent = commands − accepted.

StateDefinition
acceptedA one-line probe, run in-process through the engine in strict mode, does not make the engine report the name as an undefined control sequence (tried in text mode, then inside $…$). The engine recognised the name; whether it then does the right thing is not asked.
testedAccepted, and the name is written as a control sequence in a Go string literal of a Test function of the engine tree.
conformantTested, and the test function carries a gotex:reference <source> marker (its assertion is held to a value taken from the reference engine), or the name appears in a test .tex file with a .tectonic.* witness beside it (15 parity fixtures). Prose that says “tectonic” does not count.
absentThe probe reports the name as undefined.

Caveats, all of them real:

  • tested is an upper bound. The name is written as input, not proven executed: a test may define its own macro of that name, or never feed the string to the engine.
  • conformant is low today, and it measures the marking as much as the engine. At v0.307.0 only 41 test functions carry the gotex:reference marker, so most conformant commands come from the 15 parity fixtures. The figure will rise as engine tests are marked, without the engine changing. The marker is per function: it does not check that the assertion is about that very name.
  • accepted is a probe result, not a mention. A name that the engine tree merely writes down but the probe finds undefined is absent.

The scopes

  • TeX primitives: the names of tex.web (TeX82) and of the engine table of tectonic (e-TeX, pdfTeX and XeTeX additions), probed in a plain document.
  • latex.ltx kernel: the names the LaTeX kernel defines, probed in an article.
  • Package user commands: the commands without @ in the name that the .sty of each of the 20 most-loaded packages of the corpus defines itself, probed with that package loaded. The package scope now counts only the names a package defines itself: a name the latex.ltx kernel already defines stays in the kernel scope, and the names of a file the package merely loads are not read.

Raw count

ScopeCommandsAcceptedTestedConformantAbsent
TeX primitives50028921928211
latex.ltx kernel1952819506431133
Package user commands81931318226506

Weighted by corpus usage

A command weighs the number of papers that use it (as a control sequence, outside comments); in a package scope only the papers that load the package count. Each figure is the share of the scope’s total weight.

ScopeTotal weightAcceptedTestedConformantAbsent
TeX primitives687691.7%83.0%16.7%8.3%
latex.ltx kernel1936893.5%73.7%14.8%6.5%
Package user commands405491.2%78.3%29.1%8.8%

Reading: weighted by use, the engine already accepts about 93% of what the corpus calls, yet fewer than half of the kernel’s names (819 of 1952) are accepted, because most of the kernel is rarely or never used. Only 15% (kernel) to 29% (packages) of that use is held to a value from the reference engine. Raising conformant is the lever, and it takes gotex:reference assertions, not more probes. Per-package figures (for example hyperref, amsmath, natbib) are in the tool’s JSON output.

Other limits of the instrument: package commands come from the single .sty only (tikz contributes none); helper macros spelled without @ count as user commands; a probe error naming a different undefined control sequence is counted accepted and kept as a note; symbol-named primitives are never “tested”. No probe timed out or panicked.

How it is re-measured

With measure coverage from the go-tex/measure harness, version v0.2.0, which links the engine at the version in its go.mod and refuses a checkout that is not at that pinned commit. It writes the tables above as Markdown and JSON, with the engine commit recorded. The figures on this page are those of the run named above and are not updated by the build.