Check what a streamed sound holds by the library's own count (#378)
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:
1 parent
d4a45c127b
commit
3f7eb03143
4 files changed
+53
-10
No files matched your search
+24
-7
@@ -3518,7 +3518,8 @@ export async function sound(t) {
|
||||
JSON.stringify({ long, copies, streamed }),
|
||||
);
|
||||
|
||||
const decodedBefore = (await stats()).decoded;
|
||||
const statsBefore = await stats();
|
||||
const decodedBefore = statsBefore.decoded;
|
||||
const restStreamed = await restingMb();
|
||||
const renderersBefore = renderers();
|
||||
await play();
|
||||
@@ -3533,6 +3534,7 @@ export async function sound(t) {
|
||||
// After a garbage collection as at rest: play mode makes garbage of its own (#378, CI task 614).
|
||||
const playingStreamed = await restingMb();
|
||||
const renderersPlaying = renderers();
|
||||
const heldStreamed = await stats();
|
||||
await t.clickToolbar('pause');
|
||||
await sleep(500);
|
||||
const paused = { clock: await json('__gm.sound.clock()'), state: await json('__gm.sound.clockState()') };
|
||||
@@ -3582,13 +3584,28 @@ export async function sound(t) {
|
||||
(await json("__gm.streams.copies('sn-long')"))?.sound === null,
|
||||
JSON.stringify({ restDecoded, playingDecoded, decodedNow }),
|
||||
);
|
||||
// What play mode makes itself is in both, so it is the difference that tells (#378, CI task 614).
|
||||
const grownStreamed = playingStreamed - restStreamed;
|
||||
const grownDecoded = playingDecoded - restDecoded;
|
||||
// What the sound library holds of it, counted by the library: streamed at most 4 s sent ahead on top
|
||||
// of what it held before (its head among the heads of every copy), decoded all five minutes: 50 MB
|
||||
// at 44.1 kHz.
|
||||
// Not the growth of the renderer: after the modules before this one it grew by 25 to 66 MB while
|
||||
// streaming, alone by 1 to 8 (#378, CI tasks 611 to 617). That growth stays in the log.
|
||||
const mb = (bytes) => bytes / 2 ** 20;
|
||||
const kept = {
|
||||
before: mb(statsBefore.streaming.held),
|
||||
streamed: mb(heldStreamed.streaming.held - statsBefore.streaming.held),
|
||||
streamedWhole: mb(heldStreamed.decodedBytes - statsBefore.decodedBytes),
|
||||
decodedWhole: mb((decodedNow?.decodedBytes ?? 0) - statsBefore.decodedBytes),
|
||||
};
|
||||
check(
|
||||
'streamed, the renderer grows by at least 30 MB less than decoded',
|
||||
grownStreamed + 30 < grownDecoded,
|
||||
JSON.stringify({ grownStreamed, grownDecoded, renderersBefore, renderersPlaying }),
|
||||
'streamed, the page holds a few seconds of its samples and none decoded whole, decoded all five minutes',
|
||||
kept.streamed > 0 && kept.streamed < 4 && kept.streamedWhole === 0 && kept.decodedWhole > 40,
|
||||
JSON.stringify({
|
||||
kept,
|
||||
grownStreamed: playingStreamed - restStreamed,
|
||||
grownDecoded: playingDecoded - restDecoded,
|
||||
renderersBefore,
|
||||
renderersPlaying,
|
||||
}),
|
||||
);
|
||||
|
||||
// The Sound tab points a long sound at the switch, and says once it streams.
|
||||
|
||||
Reference in new issue
Block a user