Skip to content

pia: fix sound id clarinet piccolo silently missing#179

Merged
webern merged 1 commit into
mainfrom
claude/blissful-newton-ngvkfw
Jun 16, 2026
Merged

pia: fix sound id clarinet piccolo silently missing#179
webern merged 1 commit into
mainfrom
claude/blissful-newton-ngvkfw

Conversation

@webern

@webern webern commented Jun 16, 2026

Copy link
Copy Markdown
Owner

$(cat <<'EOF'

Summary

  • api::SoundID::windReedClarinetPiccolo was missing from the enum in src/include/mx/api/SoundID.h
  • The corresponding row {core::SoundID::windReedClarinetPiccolo(), api::SoundID::windReedClarinetPiccolo} was absent from Converter::instrumentMap in Converter.cpp
  • As a result, any MusicXML file carrying instrument-sound wind.reed.clarinet.piccolo was silently read back as api::SoundID::unspecified (data loss on round-trip)

This is the "one-line table fix" for windReedClarinetPiccolo described in docs/ai/api-feature-audit.md §1a.

Changes

  • src/include/mx/api/SoundID.h: add windReedClarinetPiccolo between windReedClarinetEflat and windReedClarinetPiccoloAflat
  • src/private/mx/impl/Converter.cpp: add the matching row to instrumentMap
  • src/private/mxtest/impl/ConverterSoundIDTest.cpp: new test file with two cases (core→api and api→core) that were RED before the fix and GREEN after

Test plan

  • make fmt passes (clang-format clean)
  • make check passes
  • New tests windReedClarinetPiccolo_coreToApi_ConverterSoundID and windReedClarinetPiccolo_apiToCore_ConverterSoundID confirmed RED before fix, GREEN after
  • Full suite: ./build/api/mxtest — all 3914 assertions in 220 test cases pass

Add the missing windReedClarinetPiccolo enum value to api::SoundID and
the corresponding row in Converter::instrumentMap.  Without the map
entry, any MusicXML file carrying instrument-sound wind.reed.clarinet.piccolo
was silently read back as api::SoundID::unspecified (data loss).

Covered by two new Converter unit tests (core->api and api->core).
@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 30a4e0c4ab2fa0ff89242cd3a14c52da597cabd8.

@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 30a4e0c4ab2fa0ff89242cd3a14c52da597cabd8.

@webern webern changed the title Fix SoundID::windReedClarinetPiccolo silently mapping to unspecified pia: fix sound id clarinet piccolo silently missing Jun 16, 2026
@webern webern merged commit 425fcad into main Jun 16, 2026
7 checks passed
@webern webern deleted the claude/blissful-newton-ngvkfw branch June 16, 2026 20:15
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