Merge ps-w10-vst-channel: S18 VST3 channel isolation

This commit is contained in:
2026-07-27 00:20:53 -04:00
8 changed files with 199 additions and 36 deletions
+36
View File
@@ -74,6 +74,40 @@ static void testChannelDerivedIdentityStrings() {
}
}
static void testVstIdentityStringsForkByChannel() {
// S18: the VST3 instrument's on-disk name and display name fork from the SAME one channel
// bit as the extension's idents above. Stable values are BYTE-IDENTICAL to pre-S18 — any
// drift in the stable branch orphans a saved instance's on-disk reference / mislabels the
// FX browser. These are the accessors vst_entry.cpp's factory, the editor title, and the
// embed label all source; each branch is the assertion the OTHER config's build would fail.
if (isBeta()) {
CHECK(vstOutputName() == "reasampler_9000_beta");
CHECK(vstPluginName() == "ReaSampler 9000 beta");
} else {
CHECK(vstOutputName() == "reasampler_9000");
CHECK(vstPluginName() == "ReaSampler 9000");
}
// The on-disk name must match the CMake OUTPUT_NAME fork (REASAMPLER_VST_OUTPUT_NAME): a
// divergence between this accessor and the artifact name would ship a binary whose
// self-identification disagrees with its filename. (The CMake side is the authoritative
// artifact name; this pins the in-binary derivation to the same two literals.)
CHECK(vstOutputName() == (isBeta() ? "reasampler_9000_beta" : "reasampler_9000"));
}
static void testVstIdentityAndDataNamespaceShareOneChannel() {
// The S18 pairing invariant at the SEAM: the VST's plugin identity (its display/output
// names) and the DATA namespace its bridge reads (extStateNamespace(), what ext_keys
// delegates to) must resolve to the SAME channel — a beta-named plugin reading the stable
// namespace, or vice versa, is precisely the split the invariant forbids. Both forks fan
// out from the one isBeta() bit, so this assertion fails if EITHER fork regressed
// independently (a beta output name paired with the stable namespace trips the beta arm).
const bool identityIsBeta =
(vstPluginName() == "ReaSampler 9000 beta") && (vstOutputName() == "reasampler_9000_beta");
const bool dataIsBeta = (extStateNamespace() == "reasampler_beta");
CHECK(identityIsBeta == dataIsBeta); // identity and data agree on the channel
CHECK(identityIsBeta == isBeta()); // and both agree with the compiled bit
}
static void testChannelQualifiedIdAndNameComposition() {
// The two composition helpers the shells funnel through. A representative shipped id
// (CAPTURE_TRACK) and phrase must compose to the exact channel-qualified strings — this
@@ -205,6 +239,8 @@ int main() {
testVersionConstantRendersExactString();
testChannelDerivedRendering();
testChannelDerivedIdentityStrings();
testVstIdentityStringsForkByChannel();
testVstIdentityAndDataNamespaceShareOneChannel();
testChannelQualifiedIdAndNameComposition();
testStampClassifiesAsStampedOnOwnChannel();
testParseWellFormed();