Repository navigation
Add typed accuracy, UnitsDB roundtrip and explicit power kind generations - #5
Merged
suleman-uzair merged 5 commits intoNov 19, 2026
Conversation
Add corpora/features/ruby-typed-quantity-accuracy/v1 with 29 rows whose
plurimath.evaluate.quantity/1 requests keep the class of each binding
value: {"decimal": s} for BigDecimal, {"rational": [n, d]} for Rational
and {"binary64": hex} for Float, while integers and String controls stay
plain Strings. Expected results come from Formula#evaluate_quantity with
the same typed values at plurimath-ruby 0a1df68 and unitsml-ruby de4f5b9.
The rows cover the six ruby-feature-additions/v1 accuracy rows (same ids
and results), five String-exact controls, three unused-binding controls,
nine decimal precision controls and six Float rounding rows. Each row also
records the Ruby request entry point's answer for the same request. Two
producer runs are byte-equal; a stdlib check script verifies seals, ids
and vectors.json. Earlier files are unchanged apart from a README addition.
Append seven rows to corpora/features/ruby-typed-quantity-accuracy/v1 so it covers every Ruby source probe behind the typed binding support: an unused decimal or Float binding beside a single-variable formula, the zero precision of BigDecimal 0.0, a result that re-enters the accuracy combination (0.01 m * 100.0 s gives limited_1), a decimal sum across a unit conversion, and two Float neighbours including the binary64 product 0.1 * 0.2. The producer ran again at plurimath-ruby 0a1df68 and unitsml-ruby de4f5b9 in two processes with byte-equal output. The first 29 rows are byte-identical; index.json seals, counts, ids and findings are updated.
Add corpora/features/unitsdb-schema-roundtrip/v1, the schema/provenance part of F02.roundtrips (WORK-PACKAGES.md:44). The producer loads UnitsDB with the unitsdb gem 2.2.15 under unitsml-ruby 2ec9583 and writes it back with to_yaml through Database.from_db, each collection class and each entity class, the calls the unitsdb-ruby specs make. Each result is compared with canon be_yaml_equivalent_to, with a class-exact structural diff, per field, and against the collection schema on input and output. Two profiles: the gem's bundled data and UnitsDB b0b4315 (tree c57eb0a). Each has 1 database row, 7 collection rows and 897 record rows; all pass. Each profile ran twice in separate processes and the payloads are byte-equal. scripts/unitsdb_schema_roundtrip.py checks seals, byte equality, vectors.json, the frozen id digest and the per-row outcomes. Earlier generations are unchanged apart from a README addition.
Add corpora/features/ruby-explicit-kind-power/v1 with 22 rows that record
what the explicit quantity-kind API of unitsml-ruby 2ec9583 does with the
unit kV*A. The rows cover construction with a caller-declared kind
(NISTq187 apparent power or NISTq20 power), convert_to("kW"), addition,
subtraction and equality of the two kinds with controls, and the untyped
kV * A product with its primary_kind.
Each row has one expected result per UnitsDB profile: the unitsdb gem
2.2.15 data and the merged UnitsDB #143 commit b0b4315. Each snapshot is
loaded read-only with Database.from_db. Both profiles give the same
results. Each profile ran twice in separate processes with byte-equal
output, and a stdlib check script verifies seals, ids and vectors.json.
The rows pin current API behaviour only; implicit typing of kV*A is not
covered. Earlier files are unchanged apart from a README addition.
suleman-uzair
marked this pull request as ready for review
November 13, 2026 09:36
Member
Author
|
@ronaldtse, this is ready from our side and CI is green. It adds three F40 generations: typed quantity accuracy (36 rows), UnitsDB schema roundtrip (1812 rows, run on both the 2.2.15 data and the data merged in unitsml/unitsdb#143) and explicit power kinds (22 rows). All are additive, and CI now runs their validators. Could you please review and merge it if it looks good? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds three new F40 feature generations beside the existing ones. Every earlier corpus file is unchanged, and the only edit to an existing file is a README addition.
Changes
corpora/features/ruby-typed-quantity-accuracy/v1: 36 rows. Eachplurimath.evaluate.quantity/1request keeps the class of its binding values (decimal,rational,binary64). Expected results come fromFormula#evaluate_quantityat plurimath-ruby 0a1df68 with unitsml-ruby de4f5b9.corpora/features/unitsdb-schema-roundtrip/v1: 1812 rows. These are the UnitsDBfrom_yaml(...).to_yamlroundtrips for the database, its collections and each record, run with the unitsdb-ruby spec matcher. There are two profiles: the unitsdb 2.2.15 data and UnitsDB b0b4315. Every check passes.corpora/features/ruby-explicit-kind-power/v1: 22 rows. They record what the existing explicit quantity-kind API does withkV*Aat unitsml-ruby 2ec9583. Implicit typing ofkV*Ais not covered.scripts/.validate.ymlnow runs all three, andci_tamper_selftest.pyproves that each one fails when its corpus is tampered with.Every producer ran twice in separate processes, and the two outputs are byte-equal.
Test plan
check_append_only.pypasses againstmainwith 19 files added and none rewritten, and the tamper self-test catches a tampered corpus for all eight validators.