diff --git a/AGENTS.md b/AGENTS.md index c97defa6..aa426a1b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -100,10 +100,10 @@ What you need to know right now is that `gen/cpp` is where our MusicXML types ar ## Quality gates -Run `make fmt` for a stable version of clang format. -Run `make check` to see if you will pass in CI -Run `make test-core-dev` to run the `corert` tests, especially if you are working in `mx/core`. -Run `make test` to run all the tests. (Slow and heavy on the local machine) +Run `make fmt` to format. `make check` is the clang-format gate **only** — it builds and tests nothing. +Run `make test-core-dev` for corert (especially `mx/core` work); `make test` for everything (slow). +Adding/removing a `data/` file: bump the pinned count in `CoreRoundtripTest.cpp`, run `make audit` (regenerates `corpus.xml` + `*.features.xml`), confirm round-trip via `make test-core-dev`. +`ApiLoadSmokeTest` proves a file imports without crashing, not that the data is correct; the read→write→read gate (`make test-api-roundtrip` / `roundtrip-baseline.txt`) is the correctness check — pin a fixture there to defend a feature. Look at what will run in CI `.github/workflows/ci.yaml` and anticipate issues there when coding locally. diff --git a/data/corpus.xml b/data/corpus.xml index eaf20179..26fe6372 100644 --- a/data/corpus.xml +++ b/data/corpus.xml @@ -4,21 +4,23 @@ usage (descending). Do not edit by hand; regenerate with the tool. --> - + - + - + - + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -28,9 +30,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/accent.3.0.xml @@ -424,12 +424,14 @@ synthetic/work-title.3.0.xml - + - + - + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -439,9 +441,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/accent.3.0.xml @@ -835,9 +835,11 @@ synthetic/work-title.3.0.xml - - + + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -847,9 +849,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/accent.3.0.xml @@ -1243,7 +1243,7 @@ synthetic/work-title.3.0.xml - + @@ -1257,8 +1257,10 @@ - + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -1268,9 +1270,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/accent.3.0.xml @@ -1664,12 +1664,14 @@ synthetic/work-title.3.0.xml - + - + - + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -1679,9 +1681,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/accent.3.0.xml @@ -2075,12 +2075,14 @@ synthetic/work-title.3.0.xml - + - + - + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -2090,9 +2092,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/accent.3.0.xml @@ -2486,9 +2486,11 @@ synthetic/work-title.3.0.xml - - + + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -2498,9 +2500,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/cancel.location.3.0.xml @@ -2514,9 +2514,11 @@ synthetic/suffix.3.0.xml - - + + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -2526,9 +2528,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/beat-repeat.3.0.xml @@ -2569,9 +2569,11 @@ synthetic/transpose.3.1.xml - - + + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -2581,9 +2583,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/cancel.location.3.0.xml @@ -2591,7 +2591,7 @@ synthetic/key-accidental.smufl.3.1.xml - + @@ -2615,8 +2615,10 @@ - + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -2626,9 +2628,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/accent.3.0.xml @@ -2851,6 +2851,31 @@ synthetic/work-title.3.0.xml + + + + + + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml + custom/systems-and-pages.xml + custom/transposition.musicxml + foundsuite/12 Horn Duets.xml + foundsuite/ARBEAU Belle qui tiens ma vie.xml + foundsuite/Adagio and Fugue in C minor, K.546.xml + foundsuite/An Chloe.xml + foundsuite/Berlioz_Le_Corsaire.xml + foundsuite/Black Note Study Op 10 no 5.xml + foundsuite/Deutscher Tanz D.820.1.xml + + + + synthetic/cancel.location.3.0.xml + synthetic/key-accidental.3.0.xml + synthetic/key-accidental.smufl.3.1.xml + + @@ -2939,31 +2964,6 @@ synthetic/part-clef.4.0.xml - - - - - - custom/musescore-slur-start-stop.musicxml - custom/systems-and-pages.xml - custom/transposition.musicxml - foundsuite/12 Horn Duets.xml - foundsuite/ARBEAU Belle qui tiens ma vie.xml - foundsuite/Adagio and Fugue in C minor, K.546.xml - foundsuite/An Chloe.xml - foundsuite/Berlioz_Le_Corsaire.xml - foundsuite/Black Note Study Op 10 no 5.xml - foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - - - - synthetic/cancel.location.3.0.xml - synthetic/key-accidental.3.0.xml - synthetic/key-accidental.smufl.3.1.xml - - @@ -3067,9 +3067,11 @@ synthetic/time.3.1.xml - - + + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -3079,9 +3081,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/accent.3.0.xml @@ -3304,9 +3304,11 @@ synthetic/work-title.3.0.xml - - + + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -3316,9 +3318,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/accent.3.0.xml @@ -3541,9 +3541,11 @@ synthetic/work-title.3.0.xml - - + + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -3553,9 +3555,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/accent.3.0.xml @@ -3778,9 +3778,11 @@ synthetic/work-title.3.0.xml - - + + custom/musescore-slur-start-stop.musicxml + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml custom/systems-and-pages.xml custom/transposition.musicxml foundsuite/12 Horn Duets.xml @@ -3790,9 +3792,7 @@ foundsuite/Berlioz_Le_Corsaire.xml foundsuite/Black Note Study Op 10 no 5.xml foundsuite/Deutscher Tanz D.820.1.xml - foundsuite/Invention 1.xml - foundsuite/Invention 2.xml - + synthetic/accent.3.0.xml @@ -4849,14 +4849,16 @@ synthetic/dot.3.0.xml - + - + + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml foundsuite/12 Horn Duets.xml foundsuite/Adagio and Fugue in C minor, K.546.xml foundsuite/An Chloe.xml @@ -4867,9 +4869,7 @@ foundsuite/Moments Musicaux Op16 No4.xml foundsuite/PepAiraSco.xml foundsuite/PezR44Sco.xml - foundsuite/Rimsky-Korsakov Op11 No4.xml - foundsuite/RonCLunSco.xml - + synthetic/accordion-registration.3.0.xml @@ -4965,11 +4965,13 @@ synthetic/words.3.1.xml - + - + + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml foundsuite/12 Horn Duets.xml foundsuite/Adagio and Fugue in C minor, K.546.xml foundsuite/An Chloe.xml @@ -4980,9 +4982,7 @@ foundsuite/Moments Musicaux Op16 No4.xml foundsuite/PepAiraSco.xml foundsuite/PezR44Sco.xml - foundsuite/Rimsky-Korsakov Op11 No4.xml - foundsuite/RonCLunSco.xml - + synthetic/accordion-registration.3.0.xml @@ -5775,8 +5775,10 @@ synthetic/word-font.3.0.xml - - + + + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml foundsuite/ARBEAU Belle qui tiens ma vie.xml foundsuite/An Chloe.xml foundsuite/Black Note Study Op 10 no 5.xml @@ -5787,9 +5789,7 @@ foundsuite/Invention_10.xml foundsuite/Invention_11.xml foundsuite/Invention_12.xml - foundsuite/Invention_13.xml - foundsuite/Invention_14.xml - + synthetic/accent.3.0.xml @@ -10341,6 +10341,34 @@ + + + + + + + + + + + + + + + + + + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml + lysuite/ly21f_Chord_ElementInBetween.xml + lysuite/ly31a_Directions.xml + musuite/testDalSegno.xml + + + synthetic/segno.3.0.xml + synthetic/segno.3.1.xml + + ksuite/k007a_Notations_Dynamics.xml @@ -10453,6 +10481,33 @@ synthetic/accidental-text.3.1.xml + + + + + + + + + + + + + + + + + + custom/segno_coda_roundtrip.3.0.xml + custom/segno_coda_roundtrip.3.1.xml + lysuite/ly31a_Directions.xml + musuite/testDCalCoda.xml + + + synthetic/coda.3.0.xml + synthetic/coda.3.1.xml + + mjbsuite/krz_v40.xml @@ -11156,32 +11211,6 @@ - - - - - - - - - - - - - - - - - - lysuite/ly21f_Chord_ElementInBetween.xml - lysuite/ly31a_Directions.xml - musuite/testDalSegno.xml - - - synthetic/segno.3.0.xml - synthetic/segno.3.1.xml - - @@ -11257,31 +11286,6 @@ synthetic/accordion-registration.3.1.xml - - - - - - - - - - - - - - - - - - lysuite/ly31a_Directions.xml - musuite/testDCalCoda.xml - - - synthetic/coda.3.0.xml - synthetic/coda.3.1.xml - - diff --git a/data/custom/segno_coda_roundtrip.3.0.features.xml b/data/custom/segno_coda_roundtrip.3.0.features.xml new file mode 100644 index 00000000..6f53e1dd --- /dev/null +++ b/data/custom/segno_coda_roundtrip.3.0.features.xml @@ -0,0 +1,107 @@ + + + + custom/segno_coda_roundtrip.3.0.xml + 3.0 + + + attributes + + + coda + + color + default-x + default-y + font-family + font-size + font-style + font-weight + halign + relative-x + relative-y + valign + + + + direction + + + direction-type + + + divisions + + + duration + + + measure + + number + + + + note + + + octave + + + part + + id + + + + part-list + + + part-name + + + pitch + + + score-part + + id + + + + score-partwise + + version + + + + segno + + color + default-x + default-y + font-family + font-size + font-style + font-weight + halign + relative-x + relative-y + valign + + + + staff + + + step + + + type + + + voice + + + diff --git a/data/custom/segno_coda_roundtrip.3.0.xml b/data/custom/segno_coda_roundtrip.3.0.xml new file mode 100644 index 00000000..96e8b888 --- /dev/null +++ b/data/custom/segno_coda_roundtrip.3.0.xml @@ -0,0 +1,36 @@ + + + + + x + + + + + + 1 + + + + + + 1 + + + + + + 1 + + + + C + 4 + + 1 + 1 + quarter + + + + diff --git a/data/custom/segno_coda_roundtrip.3.1.features.xml b/data/custom/segno_coda_roundtrip.3.1.features.xml new file mode 100644 index 00000000..0f8e9325 --- /dev/null +++ b/data/custom/segno_coda_roundtrip.3.1.features.xml @@ -0,0 +1,111 @@ + + + + custom/segno_coda_roundtrip.3.1.xml + 3.0 + + + attributes + + + coda + + color + default-x + default-y + font-family + font-size + font-style + font-weight + halign + id + relative-x + relative-y + smufl + valign + + + + direction + + + direction-type + + + divisions + + + duration + + + measure + + number + + + + note + + + octave + + + part + + id + + + + part-list + + + part-name + + + pitch + + + score-part + + id + + + + score-partwise + + version + + + + segno + + color + default-x + default-y + font-family + font-size + font-style + font-weight + halign + id + relative-x + relative-y + smufl + valign + + + + staff + + + step + + + type + + + voice + + + diff --git a/data/custom/segno_coda_roundtrip.3.1.xml b/data/custom/segno_coda_roundtrip.3.1.xml new file mode 100644 index 00000000..53c8a0ce --- /dev/null +++ b/data/custom/segno_coda_roundtrip.3.1.xml @@ -0,0 +1,36 @@ + + + + + x + + + + + + 1 + + + + + + 1 + + + + + + 1 + + + + C + 4 + + 1 + 1 + quarter + + + + diff --git a/src/private/mxtest/api/ApiLoadSurvivalTest.cpp b/src/private/mxtest/api/ApiLoadSmokeTest.cpp similarity index 68% rename from src/private/mxtest/api/ApiLoadSurvivalTest.cpp rename to src/private/mxtest/api/ApiLoadSmokeTest.cpp index 7d3fcee3..feba0bf3 100644 --- a/src/private/mxtest/api/ApiLoadSurvivalTest.cpp +++ b/src/private/mxtest/api/ApiLoadSmokeTest.cpp @@ -12,11 +12,15 @@ namespace mxtest { -class ApiLoadSurvivalTest : public mxtest::MxFileTest +// Smoke test: proves each registered file imports and produces at least one part +// (createFromFile -> getData succeeds with a non-empty ScoreData::parts), NOT that the +// data is correct -- dropped or mistranslated elements still pass. Fidelity is the +// round-trip gate (roundtrip-baseline.txt). +class ApiLoadSmokeTest : public mxtest::MxFileTest { public: - ApiLoadSurvivalTest(mxtest::MxFile inTestFile, std::string inTestName, std::string inTestCppFileName, - int inTestCppFileLineNumber) + ApiLoadSmokeTest(mxtest::MxFile inTestFile, std::string inTestName, std::string inTestCppFileName, + int inTestCppFileLineNumber) : mxtest::MxFileTest(inTestFile, inTestName, inTestCppFileName, inTestCppFileLineNumber) { } @@ -51,8 +55,8 @@ class ApiLoadSurvivalTest : public mxtest::MxFileTest } }; -MxFileTestGroup instance{MX_COMPILE_MAX_FILE_SIZE_BYTES, // maxFileSizeBytes - "Api Load Survival Test", __FILE__, __LINE__}; +MxFileTestGroup instance{MX_COMPILE_MAX_FILE_SIZE_BYTES, // maxFileSizeBytes + "Api Load Smoke Test", __FILE__, __LINE__}; } // namespace mxtest #endif diff --git a/src/private/mxtest/api/roundtrip-baseline.txt b/src/private/mxtest/api/roundtrip-baseline.txt index 176f4138..79f2ad25 100644 --- a/src/private/mxtest/api/roundtrip-baseline.txt +++ b/src/private/mxtest/api/roundtrip-baseline.txt @@ -59,3 +59,9 @@ lysuite/ly46f_IncompleteMeasures.xml lysuite/ly71a_Chordnames.xml lysuite/ly72a_TransposingInstruments.xml lysuite/ly72b_TransposingInstruments_Full.xml + +# Dedicated segno/coda api read->write->read fixtures (#204): a minimal score that +# isolates the segno/coda surface (3.0 base attributes; 3.1 adds id + smufl) and +# round-trips losslessly. +custom/segno_coda_roundtrip.3.0.xml +custom/segno_coda_roundtrip.3.1.xml diff --git a/src/private/mxtest/corert/CoreRoundtripTest.cpp b/src/private/mxtest/corert/CoreRoundtripTest.cpp index ce3040a6..f673e30b 100644 --- a/src/private/mxtest/corert/CoreRoundtripTest.cpp +++ b/src/private/mxtest/corert/CoreRoundtripTest.cpp @@ -127,12 +127,12 @@ const CoreRoundtripRegistrar g_coreRoundtripRegistrar; } // namespace -// Pinned counts: 829 eligible files, none skipped. Count drift is a failure +// Pinned counts: 831 eligible files, none skipped. Count drift is a failure // even with zero individual fails, so a corpus or version-gate change is a // conscious decision, not silent decay. Registered last (registration is // discovery order; "zz" keeps it last alphabetically for shuffled runs too). TEST_CASE("zz-corert-pinned-counts", "[core-roundtrip]") { - CHECK(mxtest::corert::discoverInputFiles().size() == 829); + CHECK(mxtest::corert::discoverInputFiles().size() == 831); CHECK(g_skippedCount == 0); } diff --git a/src/private/mxtest/file/MxFileRepositoy.cpp b/src/private/mxtest/file/MxFileRepositoy.cpp index 5792bdd1..56187ca1 100644 --- a/src/private/mxtest/file/MxFileRepositoy.cpp +++ b/src/private/mxtest/file/MxFileRepositoy.cpp @@ -464,8 +464,16 @@ void MxFileRepository::initializeNameSubdirectoryMap() myNameSubdirectoryMap.emplace("musescore-slur-start-stop.musicxml", "custom"); myNameSubdirectoryMap.emplace("systems-and-pages.xml", "custom"); myNameSubdirectoryMap.emplace("transposition.musicxml", "custom"); + myNameSubdirectoryMap.emplace("segno_coda_roundtrip.3.0.xml", "custom"); + myNameSubdirectoryMap.emplace("segno_coda_roundtrip.3.1.xml", "custom"); // mxl myNameSubdirectoryMap.emplace("Dichterliebe01.mxl", "mxl"); + + // synthetic (audit-generated single-feature fixtures) + myNameSubdirectoryMap.emplace("segno.3.0.xml", "synthetic"); + myNameSubdirectoryMap.emplace("segno.3.1.xml", "synthetic"); + myNameSubdirectoryMap.emplace("coda.3.0.xml", "synthetic"); + myNameSubdirectoryMap.emplace("coda.3.1.xml", "synthetic"); } } // namespace mxtest