Ψ-W2-T2: collapse a capture whose channels are bit-identical to one lossless mono channel, index value measured off the landed file

This commit is contained in:
2026-08-01 21:46:55 -04:00
parent 09d64c9f46
commit 4fa3c1dd15
12 changed files with 312 additions and 11 deletions
+18
View File
@@ -573,8 +573,26 @@ static void testSeamFieldsAdditiveInvariant() {
CHECK(idx.query("id-z")->rootNote == 60); // move did not disturb seam fields
}
// A collapsed capture is a 1-channel entry, and the JSON is the only thing carrying
// that count across a project reload — the instrument's mono/stereo default reads it.
static void testMonoChannelCountRoundTrip() {
BankModel idx;
Sample s = fullSample("mono");
s.channelCount = 1;
CHECK(idx.add(s) == AddResult::Added);
const std::string json = idx.serialize();
CHECK(json.find("\"channelCount\":1") != std::string::npos);
auto back = BankModel::deserialize(json);
CHECK(back.has_value());
CHECK(back && back->query("id-mono") &&
back->query("id-mono")->channelCount == 1);
}
int main() {
testFullFieldRoundTrip();
testMonoChannelCountRoundTrip();
testSerializeGoldenLiteral();
testDedupByHash();
testTierFilterAndMove();