Check what a streamed sound holds by the library's own count (#378)
game-maker / gate (push) Successful in 4m8s
game-maker / suite (push) Successful in 16m22s

The e2e check that a streamed sound costs less than a decoded one
compared how much the renderer process grew. Alone, module 34 saw it
grow by 1 to 8 MB while streaming. After the 33 modules before it in
CI it grew by 25 to 66 MB, and suite went red (CI tasks 611, 614 and
617, the last with 66.7 MB streamed against 95.9 MB decoded).

- SoundLibrary.stats tells decodedBytes, the samples of every file
  decoded whole, and streaming.held, every head of a copy and what is
  sent ahead to the worklet.
- StreamFile.headBytes and StreamFeed.ahead give their share.
- The e2e check now asks the library: streamed it holds less than
  4 MB more than before and nothing decoded whole, decoded it holds
  more than 40 MB, the five minutes being 50 MB at 44.1 kHz.
- The growth of the renderer stays in the log of that check. The
  counter-proof that the renderer grows by more than 40 MB when the
  sound is decoded stays as it was.

Tests:
- Unit sound-library: the streaming test also checks the bytes held.
- e2e 34 (melektaus-atx): 136 checks. Streamed 0.76 MB more held and
  none decoded whole, decoded 50.5 MB. The renderer grew by 4 MB and
  49 MB.
- Gate (melektaus-atx): 288 files, 4416 tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-10-10 19:01:00 +02:00
1 parent d4a45c127b
commit 3f7eb03143
4 files changed
+53 -10

No files matched your search

+7 -1
View File
@@ -2079,10 +2079,16 @@ describe('a sound streamed (#349)', () => {
expect(wires).toEqual(['stream > gain', ...INTO_MASTER]);
expect(decodes).toHaveLength(0);
expect(library.stats()).toMatchObject({ decoded: 0, playing: 1, streaming: { playing: 1, heads: 2 } });
// Held: two heads of 2 s in stereo, and at most 4 s sent ahead to the worklet. Nothing decoded whole.
const head = 96000 * 2 * 4;
const playing = library.stats();
expect(playing.decodedBytes).toBe(0);
expect(playing.streaming.held).toBeGreaterThan(2 * head);
expect(playing.streaming.held).toBeLessThanOrEqual(2 * head + 192000 * 2 * 4);
library.stopVoice(voice);
clockTo();
expect(player().posted.at(-1)).toBe('stop');
expect(library.stats()).toMatchObject({ playing: 0, streaming: { playing: 0 } });
expect(library.stats()).toMatchObject({ playing: 0, streaming: { playing: 0, held: 2 * head } });
});
it('moves its pitch with a shifter of what it plays, as a bus does', async () => {