fix: dataset layout data/<tier>/<seed>, mix tests, cli hardening

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas WintherandClaude Sonnet 5.5 committed 2026-10-30 02:52:50 +01:00
1 parent ca9f3bbb83
commit 32d96cadcc
4 files changed
+53 -5

No files matched your search

+20
View File
@@ -35,3 +35,23 @@ test("buildSong writes all artefacts; loadSongDir reads them; stems sum to mix;
await rm(root, { recursive: true, force: true });
}
}, 120_000);
test("multi-track t1b: stems on disk sum to mix.wav", async () => {
const root = await mkdtemp(join(tmpdir(), "stsheets-ds-"));
try {
const dir = await buildSong("t1b", 1, root);
expect(dir).toBe(join(root, "t1b", "1"));
const { song, mix, stems } = await loadSongDir(dir);
expect(song.tracks.length).toBeGreaterThan(1);
expect(stems.size).toBe(song.tracks.length);
let maxDiff = 0;
for (let c = 0; c < mix.channels.length; c++) for (let i = 0; i < mix.channels[c]!.length; i++) {
let s = 0;
for (const a of stems.values()) s += a.channels[c]![i] ?? 0;
maxDiff = Math.max(maxDiff, Math.abs(s - mix.channels[c]![i]!));
}
expect(maxDiff).toBeLessThan(2e-3);
} finally {
await rm(root, { recursive: true, force: true });
}
}, 120_000);