Skip to content

Fix the root unit definitions of the US hundredweight and the kilopond - #142

Merged
ronaldtse merged 1 commit into
mainfrom
fix/cwt-us-and-kilopond-root-units
Nov 12, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
fix/cwt-us-and-kilopond-root-units

Conversation

@suleman-uzair

Copy link
Copy Markdown
Member

Two units in units.yaml have a single root_units entry that gives them the wrong size, so any tool that resolves units through root_units gets them wrong.

US hundredweight (NISTu230). It is named "hundredweight (short, 100 lb)", but its root_units entry points to NISTu203, "hundredweight (long, 112 lb)", at power 1 with no prefix. The data therefore says 100 lb is the same as 112 lb.

Kilopond (NISTu73). One kilopond is one kilogram-force, 1000 gram-force. Its root_units entry points to NISTu196 (gram-force) at power 1 with no prefix, which makes 1 kp equal to 1 gf.

The change:

  • NISTu230 now points to NISTu201 (pound, avoirdupois) with prefix NISTp10_2 (hecto), so 1 cwt (US) is 100 lb.
  • NISTu73 keeps NISTu196 (gram-force) and gains prefix NISTp10_3 (kilo), so 1 kp is 1000 gf.

No identifiers, names, symbols or other units change. The diff is 7 added lines and 1 changed line.

We found both while comparing the Ruby and Rust UnitsML engines on the same data. A scan of every unit defined by a single root_units link found four. Two are correct (Da to u, Bi to abA), and these two are not.

One question for review: writing 100 lb as the pound with the hecto prefix is the smallest change that gives the right size, but it reads oddly. If you would rather express it another way, for example a factor-based conversion, we will change it.

Verification

  • bundle exec ruby validate_schemas.rb passes for all seven data files.
  • The Ruby, Rust, Python and WASM UnitsML consumers are being requalified against this data. We will add the results here before asking to merge.

NISTu230 "hundredweight (short, 100 lb)" was defined by a single
unprefixed root_units link to NISTu203 "hundredweight (long, 112 lb)",
which states 1 cwt (US) = 1 cwt (UK). It now links to NISTu201 (pound,
avoirdupois) with the hecto prefix NISTp10_2: 1 cwt (US) = 100 lb.

NISTu73 kilopond was defined by an unprefixed link to NISTu196
(gram-force), stating 1 kp = 1 gf. It now carries the kilo prefix
NISTp10_3, exactly as NISTu72 kilogram-force does: 1 kp = 1000 gf.

Both follow the existing prefixed root_units pattern (NISTu72 kgf,
NISTu123 mil, NISTu362 mbar). No identifiers, names, symbols or other
units change.
@suleman-uzair

Copy link
Copy Markdown
Member Author

@ronaldtse could you take a quick look at this when you have a moment? It corrects two unit definitions in units.yaml. At the moment the US hundredweight resolves to the UK hundredweight (100 lb treated as 112 lb), and the kilopond resolves to one gram-force instead of one thousand.

@ronaldtse

Copy link
Copy Markdown
Contributor

Thanks @suleman-uzair ! This looks correct.

@ronaldtse
ronaldtse merged commit 035665f into main Nov 12, 2026
5 checks passed
@ronaldtse
ronaldtse deleted the fix/cwt-us-and-kilopond-root-units branch November 12, 2026 06:15
ronaldtse pushed a commit to plurimath/plurimath-ts that referenced this pull request Nov 13, 2026
… units

The numeric WASM asset is rebuilt from plurimath-numeric d08503f, which
adds data-declared quantity kinds and flag-based primary quantities, and
bundles the UnitsDB candidate from unitsml/unitsdb#142 plus the local
gram-force commit bc089c0: cwt (US) = 100 lb, kp = 1000 gf, and
gf = 0.00980665 N. The wasm-bindgen glue is unchanged.

The six pinned vector files (417 wires) stay byte-identical. The two
register wires whose result changes with the corrected data are listed in
the new source profile, which pins each old expectation and supplies the
new one; the spec checks both. Do not merge before unitsml/unitsdb#142 is
approved and released and the pins are moved to that release.
ronaldtse pushed a commit to suleman-uzair/unitsdb-ts that referenced this pull request Nov 13, 2026
Candidate dataset from unitsml/unitsdb#142 (060b566 on main fcc9e41): NISTu230 cwt (US) = hecto-pound and NISTu73 kp = kilo-gram-force. The other 378 units and all other tables are byte-identical to the fcc9e41 projection. The data commit is untagged, so the release-tag provenance test fails until UnitsDB tags a release; do not merge before unitsml/unitsdb#142 is approved and released.
ronaldtse pushed a commit to suleman-uzair/unitsdb-ts that referenced this pull request Nov 13, 2026
Adds the gram-force correction (canonical_conversion to the newton, factor 0.00980665; self-reference removed) on top of 060b566. NISTu196, NISTu230 and NISTu73 differ from the fcc9e41 projection; all other records and tables are identical. The data commit is untagged, so the release-tag provenance test fails until UnitsDB tags a release; do not merge before unitsml/unitsdb#142 is approved and released.
ronaldtse pushed a commit to unitsml/unitsdb-ts that referenced this pull request Nov 13, 2026
Candidate dataset from unitsml/unitsdb#142 (060b566 on main fcc9e41): NISTu230 cwt (US) = hecto-pound and NISTu73 kp = kilo-gram-force. The other 378 units and all other tables are byte-identical to the fcc9e41 projection. The data commit is untagged, so the release-tag provenance test fails until UnitsDB tags a release; do not merge before unitsml/unitsdb#142 is approved and released.
ronaldtse pushed a commit to unitsml/unitsdb-ts that referenced this pull request Nov 13, 2026
Adds the gram-force correction (canonical_conversion to the newton, factor 0.00980665; self-reference removed) on top of 060b566. NISTu196, NISTu230 and NISTu73 differ from the fcc9e41 projection; all other records and tables are identical. The data commit is untagged, so the release-tag provenance test fails until UnitsDB tags a release; do not merge before unitsml/unitsdb#142 is approved and released.
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.

2 participants