fix: round-trip the caesura value#342
Merged
Merged
Conversation
A source that declares no <divisions> anywhere reads as ticksPerQuarter = 0 (LCM of an empty set). The writer then emitted divisions for the first measure of every part, and core::PositiveDivisions clamped the 0 to a bogus 1e-06. The writer now omits <divisions> when the score has no time resolution; an otherwise-empty <attributes> is no longer flushed. Pins the 41 corpus files this flips to PASS (212 total).
Adds ArpeggiateMarkData (number, unbroken, id) and NonArpeggiateMarkData (top/bottom placement, number, id) as MarkDataChoice alternatives and wires them through the reader and writer. The non-arpeggiate bracket end previously always wrote as type="top". Pins the 5 corpus files this flips to PASS (217 total).
MarkType::caesura now round-trips as the common empty <caesura/> form instead of acquiring a spurious 'normal' text value, and new caesuraNormal/Thick/Short/Curved/Single mark types carry the explicit MusicXML 3.1 values that were previously flattened to 'normal'. Pins the 3 corpus files this flips to PASS (220 total).
3 tasks
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.8% | 28514 / 36648 |
| Functions | 74.2% | 6352 / 8556 |
| Branches | 50.7% | 22680 / 44751 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 84.4% | 7225 / 8560 |
| Functions | 74.9% | 2512 / 3353 |
| Branches | 52.3% | 6293 / 12036 |
Core HTML report | API HTML report
Commit 6b443d240c86c99a6cae76b976f807cc71ba680c.
gen-quality
|
webern
added a commit
that referenced
this pull request
Jul 12, 2026
## Human Summary Looks like a bug fix where we purported to support the metronome parenthesis attribute, but dropped it. Simple fix. ## Summary `<metronome parentheses="yes">` lost its parentheses on an api round-trip. The api model already had the field — `TempoData::isParenthetical` — but it dangled: `MetronomeReader` never set it and `DirectionWriter` never emitted it. This wires both sides: the reader maps `core::Metronome::parentheses()` into the `Bool`, and the writer emits the attribute when the field is not `unspecified`. No api surface change. Stacked on #342 to keep the `roundtrip-baseline.txt` additions conflict-free; the 2 files this flips are pinned (220 -> 222). ## Testing - [x] New `roundTripParentheses` MetronomeApi test (fails before, passes after) - [x] Full mxtest suite passes (4951 assertions in 421 test cases) - [x] Discovery: 222 PASS, zero regressions; regression mode: 222/222 ## References - Closes #343 - Stacked on #342; part of #208 --- _Generated by [Claude Code](https://claude.ai/code/session_01TuPExUzFXLRG9ns3X199ej)_
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.
Human Summary
A quick glance and it looks like this is correctly following the pattern for adding
MarkDatafeatures.Summary
The
<caesura>articulation's optional text value (MusicXML 3.1+: normal, thick, short,curved, single) was dropped on read, and the writer always emitted
<caesura>normal</caesura>— so the common empty form<caesura/>gained a spurious valueand the other variants were flattened to normal.
mx::corealready models the empty form(
core::CaesuraValue::empty()); only the api impl dropped it.Following the tremoloSingle/fermata-variant precedent,
MarkType::caesuranow means thecommon empty form and new
caesuraNormal/caesuraThick/caesuraShort/caesuraCurved/
caesuraSingleenumerators carry the explicit values, wired throughArticulationsFunctions(read) andNotationsWriter(write).isMarkArticulationand thearticulations converter map cover the new enumerators.
Stacked on #340 to keep the
roundtrip-baseline.txtadditions conflict-free; the 3 files thisflips are pinned (217 -> 220).
Testing
CaesuraEmpty/CaesuraVariantsround-trip tests (CaesuraEmpty fails before, passes after)References