Skip to content

impl: fix accidental sharp sharp silently missing#178

Merged
webern merged 1 commit into
mainfrom
claude/nifty-euler-ah6i9j
Jun 16, 2026
Merged

impl: fix accidental sharp sharp silently missing#178
webern merged 1 commit into
mainfrom
claude/nifty-euler-ah6i9j

Conversation

@webern

@webern webern commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • accidentalMap in Converter.cpp was missing the entry for core::AccidentalValue::sharpSharp() / api::Accidental::sharpSharp.
  • A MusicXML file containing <accidental>sharp-sharp</accidental> would silently lose the accidental on read (falling back to Accidental::none), and write it back as natural on round-trip — visible data loss.
  • The fix is a single row added to the map, matching the pattern of every other entry.
  • A regression test (SharpSharp_PitchData) round-trips a note with Accidental::sharpSharp through the full serialize→deserialize path and asserts the value is preserved.

Test plan

  • SharpSharp_PitchData fails before the fix, passes after
  • All PitchData tests pass (*_PitchData: 37 assertions in 8 test cases)
  • Full test suite passes (3917 assertions in 219 test cases)
  • make check (fmt-check) passes

…er.cpp

The accidentalMap in Converter.cpp was missing an entry for
core::AccidentalValue::sharpSharp / api::Accidental::sharpSharp. As a result,
<accidental>sharp-sharp</accidental> was silently lost on read (falling back to
Accidental::none) and written back as natural on round-trip.

Adds the missing one-row entry and a regression test that verifies sharpSharp
survives an api round-trip through XML.
@github-actions

Copy link
Copy Markdown

gen-quality gen/

gen-quality: 84.5 / 100   (floor 84.5, +0.0)

  structure     86.5  x0.50   [fn 90.5 / file 82.6]
  cyclomatic    88.4  x0.25
  cognitive     76.6  x0.25

  409 functions across 31 files, 7702 lines (largest file 1044)
  max cc 56  max cognitive 44  max fn loc 152

Worst offenders (top 5 per axis; full lists in score.json):
  cyclomatic gen/xsd/analyze.py:311     report                             56
  cyclomatic gen/plates/build.py:956    _validate_config_against_ir        35
  cyclomatic gen/press/context.py:145   plate_context                      34
  cyclomatic gen/__main__.py:46         _ir                                23
  cyclomatic gen/tests/test_ir.py:102   _check_references                  20
  cognitive  gen/xsd/analyze.py:311     report                             44
  cognitive  gen/ir/resolve.py:119      flat_elements                      40
  cognitive  gen/tests/test_ir.py:102   _check_references                  38
  cognitive  gen/press/context.py:145   plate_context                      37
  cognitive  gen/xsd/analyze.py:207     _sccs                              37
  size       gen/xsd/analyze.py:311     report                             152
  size       gen/press/context.py:145   plate_context                      96
  size       gen/plates/build.py:533    _value_plate                       89
  size       gen/plates/build.py:956    _validate_config_against_ir        89
  size       gen/ir/resolve.py:119      flat_elements                      78

Commit 90f319be19810ddf0902e5e856e8fb17c199ce94.

@github-actions

Copy link
Copy Markdown

Coverage report

Core-dev coverage src/private/mx/core/

Metric Coverage Covered / Total
Lines 77.9% 28539 / 36619
Functions 74.4% 6360 / 8547
Branches 50.7% 22672 / 44725

API coverage src/private/mx/{api,impl,utility}/

Metric Coverage Covered / Total
Lines 68.7% 4735 / 6896
Functions 54.8% 1475 / 2692
Branches 40.3% 3850 / 9558

Core HTML report | API HTML report

Commit 90f319be19810ddf0902e5e856e8fb17c199ce94.

@webern webern changed the title Fix AccidentalValue::sharpSharp silent data loss in Converter.cpp impl: fix accidental sharp sharp silently missing Jun 16, 2026
@webern webern merged commit 722c768 into main Jun 16, 2026
7 checks passed
@webern webern deleted the claude/nifty-euler-ah6i9j branch June 16, 2026 20:20
webern added a commit that referenced this pull request Jun 16, 2026
## Summary

The `api-feature-audit` doc now doubles as a tracker. Added a Tracker
table mapping every audited
item to its GitHub issue or PR, plus a pointer near the top to the
parent tracker issue.

The three section-1a enum bugs are marked done against their fix PRs
(#177, #178, #179). The
remaining 16 items now have issues (#181-#196), all linked as sub-issues
of #159, which was rewritten
into a parent tracker with live checkboxes.

## References

- Progresses #159
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.

1 participant