umath 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08d9ab00cfb3d1bc0a8f568050b91d6057f9e2d3d45b5c7f1f2baba48812e922'
4
- data.tar.gz: 3d638a8baa6611aca92e2d6af604bf6bb72312b4a262b917f1e52e9ac7244b6e
3
+ metadata.gz: 80682dbaf5fc218e1b77590fe3b595e4ad8f47d99ed9406b0bf5246c30eff3d4
4
+ data.tar.gz: 275a6ecc118656a6d591108f449177a4fcd9924ee8197ea71254b7c7d4801d44
5
5
  SHA512:
6
- metadata.gz: d7befc1e43621e62b0f97cee6d70550972d53679d71f53e62e730d1ebe8e7c824974d08a0425fb3d7e11c7f93960f5308fb29055201a9281c30a05d8f143effc
7
- data.tar.gz: 04734ac386de96a63d2e6502102e0c12566151ae840972c420006b9dd9a8ec2f34805ee0c51b0723415c5608e735f15afcec952a5dba8783bacb51218d6f3c50
6
+ metadata.gz: 4dc7e99b95a51c55fb34c484a890657783754a1912033e0a07f8433139bef2e4281d8c20590498d65c625a5307e94ce61976c47322c97d9506ce310689bf78d9
7
+ data.tar.gz: 9f31e298dbc3918bb53fa20cdaa305beee0029c3bc8993102663dab463828a529da35a45bdc36e695c6b2455c7313e88f63c4ead991810fbc7a3a80cb0a8f1bf
data/README.adoc CHANGED
@@ -24,7 +24,7 @@ Add it to your `Gemfile`:
24
24
 
25
25
  [source,ruby]
26
26
  ----
27
- gem "umath", "~> 0.1.0"
27
+ gem "umath", "~> 0.2.0"
28
28
  ----
29
29
 
30
30
  Umath needs Ruby 3.2 or later. Its runtime dependencies are
@@ -135,8 +135,9 @@ The UnicodeMath cases of
135
135
  https://github.com/plurimath/plurimath-testsuite[plurimath-testsuite] are
136
136
  kept there as numbered, immutable generations.
137
137
  `spec/fixtures/testsuite-pin.yml` names the exact commit, generation and
138
- digest this gem is tested against, and CI replays every raw-tree row of that
139
- generation on both engines. CI also compares the parse tree with the one the
138
+ digest this gem is tested against, and CI replays every raw-tree and
139
+ typed-model row of that generation on both engines, including the rows for
140
+ the 675 external UnicodeMath inputs of the testsuite's fixtures. CI also compares the parse tree with the one the
140
141
  pinned Plurimath commit produces for every UnicodeMath case of the testsuite.
141
142
  See link:docs/testsuite-pin.adoc[the testsuite pin].
142
143
 
@@ -11,10 +11,10 @@ generations, named in `spec/fixtures/testsuite-pin.yml`:
11
11
  ----
12
12
  schema: plurimath-stage/pin/1
13
13
  repository: https://github.com/plurimath/plurimath-testsuite
14
- commit: 85c7be8fd56f0cc64b4869e74716acc4f0dbe746
14
+ commit: 6138a102589093cdb3587334ff312ece5f17e428
15
15
  language: unicode
16
- generation: 4
17
- snapshot_digest: sha256:cc02870fb6ee5a46c64271733b716f00469d0af46847851ad3db9249ad2571ed
16
+ generation: 5
17
+ snapshot_digest: sha256:282fb3eead874618dda3229320a3a5d061434ea3766c8c95c641e07d49444b10
18
18
  ----
19
19
 
20
20
  Generation 2 keeps every case of generation 1 (the legacy corpus, produced by
@@ -23,14 +23,29 @@ cases, rejections included, written by `scripts/stage_cases.rb` at umath
23
23
  1929f69.
24
24
 
25
25
  Generation 3 keeps every payload of generation 2 byte for byte and adds
26
- typed-model rows beside the raw-tree rows. The replay still compares the
27
- raw-tree rows only.
26
+ typed-model rows beside the raw-tree rows.
28
27
 
29
28
  Generation 4 keeps every payload of generation 3 byte for byte except the
30
29
  five raw-tree payloads, which `scripts/stage_cases.rb` rewrote after the gem
31
30
  was renamed to umath: their header comment and description name umath and
32
31
  `Umath::RawParser`. No row changed.
33
32
 
33
+ Generation 5 keeps every payload of generation 4 byte for byte and adds a
34
+ raw-tree row (`unicode-external-NNN.raw`) and a typed-model row
35
+ (`unicode-external-NNN.model`) for each of the 675 external UnicodeMath
36
+ inputs of the testsuite's `fixtures/unicode-expectations.yaml`, in the
37
+ `raw-external-*` and `model-external-*` payloads: 33 payloads and 1566 rows
38
+ in all. The inputs are the fixture's, without the leading `0` or `1` that
39
+ marks inline or display math; three inputs occur twice in the fixture and
40
+ keep both of their ids. The expected values were computed by
41
+ `scripts/stage_cases.rb` at umath c7587f0 (the 0.2.0 version bump), with
42
+ the Ruby and the native engine agreeing on every row; 7 inputs of each
43
+ boundary are refusals, the fixture's parse-error cases. The upstream MathML
44
+ of these inputs stays in the fixture as reference and is not compared here.
45
+ The fixture's inputs come from the MIT-licensed UnicodeMathML test data
46
+ (copyright 2019 Noah Doersing); the testsuite records the source and the
47
+ licence in its provenance and in `LICENSES/UnicodeMathML-MIT.txt`.
48
+
34
49
  == What CI checks
35
50
 
36
51
  The `corpus` workflow checks out the testsuite at the pinned commit and then:
@@ -46,26 +61,42 @@ The `corpus` workflow checks out the testsuite at the pinned commit and then:
46
61
  `scripts/replay_corpus.rb` fail on a small generated testsuite;
47
62
  . runs `scripts/replay_corpus.rb --testsuite`, which repeats the pin checks
48
63
  and then parses every row of every raw-tree payload of the generation with
49
- `Umath::RawParser.parse` on the Ruby and the native engine. Each
64
+ `Umath::RawParser.parse` and every row of every typed-model payload with
65
+ `Umath.parse`, on the Ruby and the native engine. For a raw-tree row each
50
66
  engine's result, the preprocessed text and the tree in the legacy grammar's
51
67
  shape or the refusal and its byte offset, must equal the row's expected
52
68
  value in the canonical form of the testsuite's
53
- `docs/tree-parity-contract.adoc`.
69
+ `docs/tree-parity-contract.adoc`; for a typed-model row the built
70
+ `Umath::Model::Document` in tagged form, or the refusal, must. The
71
+ typed-model rows of generation 3 were written before the gem was renamed
72
+ and tag their nodes `Unicodemath::Model::...`; the replay reads that
73
+ prefix as `Umath::Model::` and changes nothing else (20 rows of generation
74
+ 5, counted in the report). It writes
75
+ the ids of the rows it ran to a file (1494 for generation 5: 747 raw-tree
76
+ and 747 typed-model);
77
+ . runs the testsuite's `scripts/validate-unicode-external.rb` on that file,
78
+ which fails unless every external row of the generation (675 `.raw` and
79
+ 675 `.model`) is listed exactly once, and checks that the same file with
80
+ one id removed fails it.
54
81
 
55
82
  To run the replay locally:
56
83
 
57
84
  [source,sh]
58
85
  ----
59
86
  git clone https://github.com/plurimath/plurimath-testsuite tmp/testsuite
60
- git -C tmp/testsuite checkout 85c7be8fd56f0cc64b4869e74716acc4f0dbe746
61
- bundle exec ruby scripts/replay_corpus.rb --testsuite tmp/testsuite --report tmp/replay.json
87
+ git -C tmp/testsuite checkout 6138a102589093cdb3587334ff312ece5f17e428
88
+ bundle exec ruby scripts/replay_corpus.rb --testsuite tmp/testsuite \
89
+ --report tmp/replay.json --executed-ids tmp/executed-ids.txt
90
+ ruby tmp/testsuite/scripts/validate-unicode-external.rb tmp/testsuite \
91
+ --generation 5 --executed tmp/executed-ids.txt
62
92
  ----
63
93
 
64
94
  The `replay` workflow checks out the testsuite at the same commit and fails if
65
95
  its commit and the pin's differ. The `stage-cases` workflow writes the
66
96
  generation after the latest one of its source commit, so it still reads
67
97
  generation 1 at b4520d8; it also checks out the pinned commit and requires the
68
- payloads it writes to equal the pinned generation 4's byte for byte.
98
+ payloads it writes to equal generation 4's at the pinned commit byte for
99
+ byte (generation 5 keeps them unchanged).
69
100
  The same workflow also writes a typed-model generation (`scripts/stage_cases.rb
70
101
  --boundary typed-model`) from the latest generation at 5e32851: every payload
71
102
  copied byte for byte plus a `model-<group>.yaml` payload of typed models from
@@ -85,6 +116,24 @@ repository, and requires the raw tree and the typed model built by
85
116
  divergences. The legacy corpus itself is not changed by this gem: generation 1
86
117
  stays as it was imported.
87
118
 
119
+ == Coverage of UTN 28
120
+
121
+ `scripts/utn28_coverage.rb` reads the typed-model rows of the pinned
122
+ generation. The 675 external rows are declared in `docs/utn28-coverage.yml`
123
+ under `unmapped_payloads`: they are replayed, but which UTN 28 constructs each
124
+ one exercises is not recorded, so they change no construct's status.
125
+
126
+ == The release and the pin
127
+
128
+ The pin states what this repository's code reproduces, not what a released
129
+ gem does. The `lib/` files of umath 0.2.0 on RubyGems are those of c7587f0,
130
+ the commit at which `scripts/stage_cases.rb` produced the expected values of
131
+ the 675 external rows, so the 0.2.0 parser is the one generation 5 was
132
+ written from. A commit after 0.2.0
133
+ is checked against the pin by CI, but it reaches gem users only in a later
134
+ release; until then a fix that exists only in Git is not in the published
135
+ gem. umath 0.1.0 predates generation 5 and is not tested against it.
136
+
88
137
  == Moving the pin
89
138
 
90
139
  Commit, generation and digest change together, in one change, and only to a
@@ -248,7 +248,9 @@ raises `Umath::NestingTooDeep`.
248
248
  * `spec/model/` checks construction of the model and its shape.
249
249
  * `spec/corpus/replay_corpus_spec.rb` and `spec/stage_cases/` replay the
250
250
  stage corpus generation pinned in `spec/fixtures/testsuite-pin.yml`
251
- (plurimath-testsuite `stages/unicode/`, generation 4, 72 cases).
251
+ (plurimath-testsuite `stages/unicode/`, generation 5: the 72 legacy
252
+ cases and the 675 external inputs, each as a raw-tree and a typed-model
253
+ row).
252
254
  * The oracle specs compare the raw tree with captures of the Plurimath
253
255
  parser.
254
256
 
@@ -267,7 +269,7 @@ says what the corpus shows.
267
269
  // BEGIN GENERATED utn28-summary
268
270
  The table lists 82 constructs of UTN 28 version 3.2 with the rows that
269
271
  exercise them, out of the 32 rows of `corpora/model/representative.yml` and
270
- the 72 typed-model rows of plurimath-testsuite generation 4. Of the 82
272
+ the 747 typed-model rows of plurimath-testsuite generation 5. Of the 82
271
273
  constructs, 25 are covered, 1 is refused and 56 are untested.
272
274
 
273
275
  Covered means that every row listed for the construct parses to the model
@@ -280,8 +282,13 @@ Of the rows, 51 give incomplete input, such as a trailing `/` or an unclosed
280
282
  bracket, and umath refuses them. They are listed with their construct and do
281
283
  not change its status. The rows `model-decimal-arabic`, `model-comment`,
282
284
  `model-u-escape`, `empty-input`, `empty-label-only` and
283
- `unicode-whitespace-only.model` belong to no UTN 28 construct. Sections 1,
284
- 4.2-4.4, 4.7-4.9, 5, 6 and 7 define no notation and are left out.
285
+ `unicode-whitespace-only.model` belong to no UTN 28 construct. The 675 rows
286
+ of the testsuite payloads `model-external-*` are not mapped to constructs:
287
+ they are the typed models of the 675 external UnicodeMath inputs of
288
+ plurimath-testsuite `fixtures/unicode-expectations.yaml`, which the `corpus`
289
+ workflow replays on both engines; which UTN 28 constructs each one exercises
290
+ is not recorded yet, so they decide no status here. Sections 1, 4.2-4.4,
291
+ 4.7-4.9, 5, 6 and 7 define no notation and are left out.
285
292
  // END GENERATED utn28-summary
286
293
 
287
294
  // BEGIN GENERATED utn28-coverage
data/lib/umath/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Umath
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umath
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-11-14 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: lutaml-model
@@ -94,6 +95,7 @@ metadata:
94
95
  source_code_uri: https://github.com/plurimath/umath
95
96
  changelog_uri: https://github.com/plurimath/umath/blob/main/CHANGELOG.md
96
97
  rubygems_mfa_required: 'true'
98
+ post_install_message:
97
99
  rdoc_options: []
98
100
  require_paths:
99
101
  - lib
@@ -108,7 +110,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
110
  - !ruby/object:Gem::Version
109
111
  version: '0'
110
112
  requirements: []
111
- rubygems_version: 4.0.23
113
+ rubygems_version: 3.5.22
114
+ signing_key:
112
115
  specification_version: 4
113
116
  summary: UnicodeMath parser by Plurimath.
114
117
  test_files: []