fix: part-group round-trip fidelity, and a classifier category for supported-element drops#224
Merged
Merged
Conversation
mx::api modeled part-group but mx::impl lost data on round-trip: the writer
never emitted group-abbreviation (it was read into PartGroupData and then
dropped), fabricated a constant <group-barline>yes</group-barline> on every
group, and left displayName/displayAbbreviation dead. The round-trip
classifier contradicted api.features.xml, which called this support=full.
- Model group-barline as api::GroupBarline {unspecified,yes,no,mensurstrich};
read and write it, and stop fabricating a constant yes.
- Write group-abbreviation from PartGroupData.abbreviation.
- Wire displayName/displayAbbreviation to group-name-display /
group-abbreviation-display as best-effort text, via a shared
NameDisplayFunctions helper extracted from PartReader/PartWriter.
- Correct api.features.xml: part-group full -> partial, documenting the real
gaps (group-time, editorial, dropped formatting).
group-time and editorial (footnote/level) stay unmodeled by design.
Progresses #219
Each synthetic file wrapped its single score-part in two <part-group type="start"> with no matching stop -- schema-valid but semantically invalid, since the start/stop pairing constraint is beyond what XSD can express. mx::api correctly drops an unmatched start (it models a complete start..stop span), so part-group was the single most-dropped element on api round-trip (373 files) even though every real-world file round-trips it. Change the trailing start to a stop so each group is well-formed. Files stay schema-valid (validated per version) and exercise the same element/attribute surface (audit sidecars and corpus.xml unchanged). The api round-trip now reports part-group dropped in zero files (was 373). Progresses #219
gen-quality
|
The round-trip classifier put every file that dropped a support=full/partial element into "unknown": category B only fires when every dropped class is support=none, so any file mixing a supported drop with unsupported ones (nearly all of them) fell through. On the corpus that buried the #219 signal -- 759 of 828 files were "unknown". Add category G: a dropped class the audit marks full/partial is either an impl round-trip bug or an api.features.xml overstatement, both actionable. G is evaluated after B/C/D/E (a precise enum/attribute finding still wins) and lists the dropped supported classes as blocking_features. On the corpus this moves 575 files out of "unknown" (now 183) and ranks the real offenders: staff (280), lyric (117), text (115), voice (96), measure-numbering (88). Progresses #219
gen-quality
|
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.9% | 28539 / 36624 |
| Functions | 74.4% | 6360 / 8550 |
| Branches | 50.7% | 22672 / 44725 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 72.5% | 5397 / 7449 |
| Functions | 60.3% | 1828 / 3033 |
| Branches | 43.3% | 4511 / 10415 |
Core HTML report | API HTML report
Commit 8fb0dca255d0b86191c869cd8364ca6a50a2b971.
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.
Summary
Progresses #219 in two parts: fix part-group round-trip, and make the round-trip classifier surface the dropped-supported-element signal #219 is about (instead of burying it in
unknown).part-group round-trip (mx::api / mx::impl)
#219 flagged part-group as the most-dropped
support=fullelement on api round-trip (373 files). It was two problems:Misleading corpus signal. All 373 drops were synthetic files with an unmatched
<part-group type="start">(no stop) -- schema-valid but semantically invalid, a start/stop pairing constraint XSD cannot express.mx::apicorrectly drops an unmatched start (it models a complete start..stop span), and zero real-world files drop part-group. Fixed by making the synthetic part-groups well-formed (trailingstart->stop, 386 files; schema-valid per version, audit surface unchanged).Overstated support. Even well-formed groups lost data on write:
group-abbreviationread but never written,group-barlinefabricated as a constantyes,displayName/displayAbbreviationdead. Now: modelgroup-barline(api::GroupBarline), writegroup-abbreviation, wire the display names togroup-name-display/group-abbreviation-displayvia a sharedNameDisplayFunctionshelper.api.features.xmlcorrectedfull->partial;group-time/editorial stay unmodeled by design.classifier (audit/classify.py)
The classifier put every file dropping a
support=full/partialelement intounknown-- category B only fires when every dropped class issupport=none, so any file mixing a supported drop with unsupported ones (nearly all) fell through. That buried #219's premise: 759 of 828 files wereunknown. Added category G (supported-element drop): an actionable impl-bug-or-audit-overstatement signal, evaluated after B/C/D/E (a precise enum/attribute finding still wins) and listing the dropped supported classes asblocking_features. On the corpus this moves 575 files out ofunknown(-> 183) and ranks the real offenders: staff (280), lyric (117), text (115), voice (96), measure-numbering (88).Testing
partGroupRoundTriptest: red before the part-group fix, green aftermx::core)make test-audit: 13 cases incl. 2 new category-G testsunknown759 -> 183make checkand the api-roundtrip regression gate passNo corpus files become green (each still drops
footnote/level/staff), so the pinned baseline is unchanged; the targeted test is the demonstration.References