Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
336 changes: 170 additions & 166 deletions data/corpus.xml

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions data/custom/segno_coda_roundtrip.3.0.features.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by `python3 -m audit files`. The element/attribute surface of the
sibling corpus file. Do not edit by hand; regenerate with the audit tool. -->
<feature-audit>
<audited>custom/segno_coda_roundtrip.3.0.xml</audited>
<audited-version>3.0</audited-version>
<features>
<feature>
<name>attributes</name>
</feature>
<feature>
<name>coda</name>
<attributes>
<attribute>color</attribute>
<attribute>default-x</attribute>
<attribute>default-y</attribute>
<attribute>font-family</attribute>
<attribute>font-size</attribute>
<attribute>font-style</attribute>
<attribute>font-weight</attribute>
<attribute>halign</attribute>
<attribute>relative-x</attribute>
<attribute>relative-y</attribute>
<attribute>valign</attribute>
</attributes>
</feature>
<feature>
<name>direction</name>
</feature>
<feature>
<name>direction-type</name>
</feature>
<feature>
<name>divisions</name>
</feature>
<feature>
<name>duration</name>
</feature>
<feature>
<name>measure</name>
<attributes>
<attribute>number</attribute>
</attributes>
</feature>
<feature>
<name>note</name>
</feature>
<feature>
<name>octave</name>
</feature>
<feature>
<name>part</name>
<attributes>
<attribute>id</attribute>
</attributes>
</feature>
<feature>
<name>part-list</name>
</feature>
<feature>
<name>part-name</name>
</feature>
<feature>
<name>pitch</name>
</feature>
<feature>
<name>score-part</name>
<attributes>
<attribute>id</attribute>
</attributes>
</feature>
<feature>
<name>score-partwise</name>
<attributes>
<attribute>version</attribute>
</attributes>
</feature>
<feature>
<name>segno</name>
<attributes>
<attribute>color</attribute>
<attribute>default-x</attribute>
<attribute>default-y</attribute>
<attribute>font-family</attribute>
<attribute>font-size</attribute>
<attribute>font-style</attribute>
<attribute>font-weight</attribute>
<attribute>halign</attribute>
<attribute>relative-x</attribute>
<attribute>relative-y</attribute>
<attribute>valign</attribute>
</attributes>
</feature>
<feature>
<name>staff</name>
</feature>
<feature>
<name>step</name>
</feature>
<feature>
<name>type</name>
</feature>
<feature>
<name>voice</name>
</feature>
</features>
</feature-audit>
36 changes: 36 additions & 0 deletions data/custom/segno_coda_roundtrip.3.0.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<score-partwise version="3.0">
<part-list>
<score-part id="P1">
<part-name>x</part-name>
</score-part>
</part-list>
<part id="P1">
<measure number="1">
<attributes>
<divisions>1</divisions>
</attributes>
<direction>
<direction-type>
<segno default-x="1.1" default-y="2.2" relative-x="3.3" relative-y="4.4" font-family="x" font-style="italic" font-size="5.5" font-weight="bold" color="#12345678" halign="center" valign="middle" />
</direction-type>
<staff>1</staff>
</direction>
<direction>
<direction-type>
<coda default-x="6.6" default-y="7.7" relative-x="8.8" relative-y="9.9" font-family="y" font-style="italic" font-size="11.1" font-weight="bold" color="#9ABCDEF0" halign="right" valign="bottom" />
</direction-type>
<staff>1</staff>
</direction>
<note>
<pitch>
<step>C</step>
<octave>4</octave>
</pitch>
<duration>1</duration>
<voice>1</voice>
<type>quarter</type>
</note>
</measure>
</part>
</score-partwise>
111 changes: 111 additions & 0 deletions data/custom/segno_coda_roundtrip.3.1.features.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by `python3 -m audit files`. The element/attribute surface of the
sibling corpus file. Do not edit by hand; regenerate with the audit tool. -->
<feature-audit>
<audited>custom/segno_coda_roundtrip.3.1.xml</audited>
<audited-version>3.0</audited-version>
<features>
<feature>
<name>attributes</name>
</feature>
<feature>
<name>coda</name>
<attributes>
<attribute>color</attribute>
<attribute>default-x</attribute>
<attribute>default-y</attribute>
<attribute>font-family</attribute>
<attribute>font-size</attribute>
<attribute>font-style</attribute>
<attribute>font-weight</attribute>
<attribute>halign</attribute>
<attribute>id</attribute>
<attribute>relative-x</attribute>
<attribute>relative-y</attribute>
<attribute>smufl</attribute>
<attribute>valign</attribute>
</attributes>
</feature>
<feature>
<name>direction</name>
</feature>
<feature>
<name>direction-type</name>
</feature>
<feature>
<name>divisions</name>
</feature>
<feature>
<name>duration</name>
</feature>
<feature>
<name>measure</name>
<attributes>
<attribute>number</attribute>
</attributes>
</feature>
<feature>
<name>note</name>
</feature>
<feature>
<name>octave</name>
</feature>
<feature>
<name>part</name>
<attributes>
<attribute>id</attribute>
</attributes>
</feature>
<feature>
<name>part-list</name>
</feature>
<feature>
<name>part-name</name>
</feature>
<feature>
<name>pitch</name>
</feature>
<feature>
<name>score-part</name>
<attributes>
<attribute>id</attribute>
</attributes>
</feature>
<feature>
<name>score-partwise</name>
<attributes>
<attribute>version</attribute>
</attributes>
</feature>
<feature>
<name>segno</name>
<attributes>
<attribute>color</attribute>
<attribute>default-x</attribute>
<attribute>default-y</attribute>
<attribute>font-family</attribute>
<attribute>font-size</attribute>
<attribute>font-style</attribute>
<attribute>font-weight</attribute>
<attribute>halign</attribute>
<attribute>id</attribute>
<attribute>relative-x</attribute>
<attribute>relative-y</attribute>
<attribute>smufl</attribute>
<attribute>valign</attribute>
</attributes>
</feature>
<feature>
<name>staff</name>
</feature>
<feature>
<name>step</name>
</feature>
<feature>
<name>type</name>
</feature>
<feature>
<name>voice</name>
</feature>
</features>
</feature-audit>
36 changes: 36 additions & 0 deletions data/custom/segno_coda_roundtrip.3.1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<score-partwise version="3.1">
<part-list>
<score-part id="P1">
<part-name>x</part-name>
</score-part>
</part-list>
<part id="P1">
<measure number="1">
<attributes>
<divisions>1</divisions>
</attributes>
<direction>
<direction-type>
<segno default-x="1.1" default-y="2.2" relative-x="3.3" relative-y="4.4" font-family="x" font-style="italic" font-size="5.5" font-weight="bold" color="#12345678" halign="center" valign="middle" id="id3" smufl="segno" />
</direction-type>
<staff>1</staff>
</direction>
<direction>
<direction-type>
<coda default-x="6.6" default-y="7.7" relative-x="8.8" relative-y="9.9" font-family="y" font-style="italic" font-size="11.1" font-weight="bold" color="#9ABCDEF0" halign="right" valign="bottom" id="id4" smufl="coda" />
</direction-type>
<staff>1</staff>
</direction>
<note>
<pitch>
<step>C</step>
<octave>4</octave>
</pitch>
<duration>1</duration>
<voice>1</voice>
<type>quarter</type>
</note>
</measure>
</part>
</score-partwise>
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down Expand Up @@ -51,8 +55,8 @@ class ApiLoadSurvivalTest : public mxtest::MxFileTest
}
};

MxFileTestGroup<ApiLoadSurvivalTest> instance{MX_COMPILE_MAX_FILE_SIZE_BYTES, // maxFileSizeBytes
"Api Load Survival Test", __FILE__, __LINE__};
MxFileTestGroup<ApiLoadSmokeTest> instance{MX_COMPILE_MAX_FILE_SIZE_BYTES, // maxFileSizeBytes
"Api Load Smoke Test", __FILE__, __LINE__};
} // namespace mxtest

#endif
6 changes: 6 additions & 0 deletions src/private/mxtest/api/roundtrip-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/private/mxtest/corert/CoreRoundtripTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
8 changes: 8 additions & 0 deletions src/private/mxtest/file/MxFileRepositoy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading