Cross-language conformance suite for UnitsML: the frozen render and conversion corpora replayed by every unitsml runtime (Ruby, TypeScript).
89 inputs drawn from unitsml-ruby’s conv specs
(spec/unitsml/conv/{xml,asciimath,…}_spec.rb), frozen from
unitsml-ruby 0.6.11:
-
expected-renders.json— per input:norm_text,asciimath, and the UnitsMLxmldocument. Two rows are frozen asruby_error(the pre-existing unitsml-ruby mmlNoMethodErroronkcal_IT); replays skip them and they must flip torenderrows when upstream is fixed. -
XML comparison is semantic — entities decoded, whitespace between tags collapsed, attribute quoting unified — mirroring the upstream conv specs'
be_xml_equivalent_tocontract.
25 conversion vectors from unitsml-ruby#92 (Conversions execution,
unitsml-ruby PRs #98/#99/#100), frozen from the unitsml-ruby
implementation:
-
expected-conversions.json— five case kinds:-
convert— aQuantity#convert_tohop (canonical path, or through caller-supplieddefinitionsgiven as UnitsMLFloat64ConversionFromXML with their lookup key), expected value as an exact decimal string. -
difference— the same for a difference of two quantities (20 degC − 15 degC → 5 K): conversion must skip the affine addends. -
definition—Conversion::Definitionexecution: forwardy = d + (b/c)(x + a)and inversex = (c/b)(y − d) − ain exact rational arithmetic, theexactflag, and verbatim lexical decimal preservation. -
resolve—initialUnitresolution: document-local fragments before the register, register fragments, and reference URIs. -
error— typed refusals: affine definitions at power ≠ 1, definition-vs-canonical disagreement, unresolvableinitialUnit, andSpecialConversionFrom/WSDLConversionFrom.
-
-
All numeric values are exact decimal strings; replays parse them as Rationals and compare exactly.
98 parse vectors for pma (dialect P, "plurimath ascii", specified by
plurimath docs/pma.adoc), frozen from plurimath/amath
corpora/pma/{accepted,refused}.yml at amath commit 3cbf3f8d0c78
(file checksums recorded in the corpus):
-
expected-parses.json— two case kinds:-
accept(38) — the input parses.termis the typed model’s bound data with the source texts as written;modelis the resolved typed model as{node, fields}(set fields in declaration order, nil fields left out), with quantity assertions such asunit(J::energy)resolved to unitsdb quantity ids (q:energy). -
refuse(60) — the input is refused withcategoryand the position asbyte_offset(UTF-8 bytes) andchar_offset(code points). Version 1 refuses every form the specification leaves open.
-
-
versionstamps the amath version, the pma grammar artifact checksum, and the vector set version. -
Every row was checked on both amath engines (Ruby and native) before it was written; they agree on every row.
-
There are no render vectors yet: amath parses pma and does not render it. == corpora/features
Source-pinned feature vectors (F40). index.json holds the seals,
the per-family status, the comparison rules and the git blob ids of the
preserved render/conversion vectors above.
-
unitsml-quantities.json: 39 cases executed on unitsml-ruby92b0f3481cd90e8a7b50ba9bd729363bec150a21(0.6.14) with unitsdb gem 2.2.13 (data seal inproducer_source). The kinds are exact conversions (value asn/dplus a terminating decimal where one exists), dimensions (dimension_id,dimension_vector, scale),kV*Ain the watt class, a difference, and typed refusals matched byerror_class.source_semantics_findingslists observed behaviour that is recorded but not endorsed. -
gum-mcm-profiles.json: 13 adaptive-MCM profiles (2 H1 plus 11 extended) from plurimath8916961a69dc1f586e915790c4fb052b910efa86, GHA run 42904830789. Eachresultis verbatim: probability, seeds, final generator state and stop metadata. Per-caseevidence_gapsmark what the producer did not supply: raw and rounded H2 profiles, published reference values and last-digit gaps. -
archive/gha-42904830789/: the two producer artifacts, byte for byte.
Families with no exact-head evidence (series/group statistics,
conformity, GUM adequacy/normality refusals, the plurimath kV·A
evaluator path) are listed as missing evidence in index.json. They
are not inferred. python scripts/check_feature_corpus.py checks the
seals, counts, verbatim archive agreement and refusal typing.
A conforming runtime parses each input (Unitsml.parse semantics, the
unitsml(…) wrapper and extras included) and asserts:
-
norm_textequality, -
AsciiMath render equality,
-
semantic XML equality of the UnitsML document.
unitsml-ruby replays via CORPUS_DIR=… bundle exec rspec
spec/unitsml/render_corpus_spec.rb; unitsml-ts via
CORPUS_DIR=… npm run replay. Both CI pipelines check this repository
out and enforce it.
The conversion corpus replays as CONVERSION_CORPUS_DIR=… bundle exec
rspec spec/unitsml/conversion_corpus_spec.rb (unitsml-ruby) and
CONVERSION_CORPUS_DIR=… npm run replay:conversions (unitsml-ts), the
same checkouts enforced by CI.
74 plurimath 0.11.17 evaluator rows (H.2 raw paired data, raw-input and
rounded-summary first-approach outputs, the second output approach, H.4/H.5
grouped statistics, series, JCGM 106 conformity, coverage factors, decimal
output, MCM coverage adequacy and typed refusals) plus one unitsml 0.6.14
v*i kV*A to kW row. archive/ holds the producer payloads byte-for-byte;
vectors.json splits each row into input and expected without computing
anything. The H.2 published last digit is recorded as unresolved, and no
named power class is asserted from the kW conversion. index.json lists
seals, requested coverage and the coverage that is still missing.
Check: python scripts/host_evaluator_vectors.py check (re-verifies seals
and rebuilds both JSON files from archive/, requiring byte equality).
388 evaluator request/response wires (numeric, quantity and GUM schemas)
that the native engines are checked against. archive/ keeps the source
wire list and every plurimath-rs fixture it was built from byte-for-byte,
plus Ruby reference re-runs, the scripts and the gem locks used for them.
vectors.json lists each wire with its family, schema, exact or
approximate precision, seeds, outcome, error code and acceptance status.
acceptance.json gives the evidence for each family.
Acceptance: the 204 numeric wires are byte-equal to a Ruby re-run, and the
149 GUM wires agree with Ruby re-runs or with the sealed Ruby results they
were projected from. 3 quantity wires agree with a Ruby probe. The 32
quantity-register wires are partial: no Ruby caller-register evaluator
exists, and exact fraction checks cover 16 of them. The H.2 published last
digit and a named power class stay unresolved, as in host-evaluator/v1.
Check: python scripts/evaluator_reference_vectors.py check (re-verifies
seals and rebuilds vectors.json from archive/, requiring byte equality).
13 Ruby-generated rows for two families the F40 coverage matrix found
missing. Six rows cover the accuracy classes (exact, limited_float,
limited_<n>, and the least precise operand winning). Seven rows check
that a UnitsML unit string survives a parse round trip, using the strings
from unitsml-ruby’s composite spec. The same producer script ran at two
Ruby heads and the outputs are byte-equal; index.json records both heads.
Check: python scripts/ruby_feature_additions.py check.
251 Ruby-generated rows for three F40 families that had no Ruby reference.
Quantity kinds: every ordered pair of the 11 UnitsDB quantities with
dimension NISTd15, added with declared kinds. Pairs inside the energy
equivalence class are allowed and all other pairs are refused; 3 more rows
cover a kind with the wrong dimension, an unknown kind and an untyped
operand. Primary quantity: the 95 units with several quantity references,
each with the primary taken from the primary flag under three reference
orders. Caller register: the 32 register requests from
evaluator-reference/v1, run through unitsml-ruby’s validated register.
The producer ran at unitsml-ruby 2337a12, the first head with these
features, in two separate processes, and the outputs are byte-equal.
index.json lists the five register cases where the native wires differ,
with the reason for each.
Check: python scripts/ruby_unitsml_features.py check.
36 Ruby-generated rows that pin the class of each quantity binding value.
A BigDecimal binding is limited to its precision, a Float binding is
limited_float, and a Rational or a plain String binding is exact. Each row
has a plurimath.evaluate.quantity/1 request that keeps the class in the
binding value: {"decimal": "2.5"}, {"rational": ["5", "2"]} or
{"binary64": "4004000000000000"}; integers and String controls stay plain
Strings. The expected result is what Formula#evaluate_quantity returns for
the same typed values.
The rows cover the six accuracy rows of ruby-feature-additions/v1 (same
ids, same results), String controls with the same digits, unused bindings,
decimal precision and Float rounding, plus seven rows added to cover the
Ruby source probes behind the Rust typed binding support. Each row also records what the Ruby
request entry point answers for the same request at the producer head.
The producer ran at plurimath-ruby 0a1df68 with unitsml-ruby de4f5b9 in
two separate processes, and the outputs are byte-equal.
Check: python scripts/ruby_typed_quantity_accuracy.py check.
Ruby-generated schema and provenance roundtrip results for every UnitsDB
collection and record. The producer loads each snapshot with the unitsdb
gem 2.2.15 (under unitsml-ruby 2ec9583) and writes it back with to_yaml,
the same calls the unitsdb-ruby specs make: Database.from_db(dir), each
collection class from_yaml(raw) and each entity class per record. Every
result is compared with canon’s be_yaml_equivalent_to, which is the
unitsdb-ruby contract, and also field by field with value classes, and the
collection schema is evaluated on input and output. Any mismatch fails the
row.
There are two profiles: the data bundled in the unitsdb 2.2.15 gem, and UnitsDB b0b4315 (the merged #143 data). Each has 897 records in seven collections, and every check passes in both. The producer ran twice per profile in separate processes, and the outputs are byte-equal.
Check: python scripts/unitsdb_schema_roundtrip.py check.
22 Ruby-generated rows that pin what the existing explicit quantity-kind API
of unitsml-ruby 2ec9583 does with the unit kV*A: construction with a
caller-declared kind (NISTq187 apparent power or NISTq20 power),
convert_to("kW"), typed addition, subtraction and equality of the two kinds,
and the untyped kV * A product with its primary_kind. Each row has one
expected result per UnitsDB profile: the published unitsdb gem 2.2.15 data and
the merged UnitsDB #143 commit b0b4315. Each snapshot is loaded read-only with
Database.from_db. The two profiles give the same results.
These rows record current API behaviour only. Whether kV*A should be typed
automatically, or whether convert_to should refuse a kind that differs from
the target unit’s primary kind, is an open policy question for the data owner
and is not covered here.
Check: python scripts/ruby_explicit_kind_power.py check.