Publish voice duplex architecture latency training and evaluation research
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { queueSteps, benchmarks } from "./model.js";
|
||||
|
||||
test("faster processing leaves no waiting queue", () => {
|
||||
const steps = queueSteps(160, 80);
|
||||
assert.equal(steps[0].arrival, 160);
|
||||
assert.equal(steps[0].end, 240);
|
||||
assert.ok(steps.every((step) => step.wait === 0));
|
||||
});
|
||||
test("equal processing and media intervals leave zero ideal headroom", () => {
|
||||
assert.ok(queueSteps(160, 160).every((step) => step.wait === 0));
|
||||
});
|
||||
test("overload adds sixty milliseconds per subsequent input block", () => {
|
||||
const steps = queueSteps(160, 220);
|
||||
assert.equal(steps[0].wait, 0);
|
||||
assert.equal(steps[7].wait, 420);
|
||||
assert.equal(steps[7].end, 1920);
|
||||
});
|
||||
test("invalid media times fail explicitly", () => {
|
||||
assert.throws(() => queueSteps(0, 80), RangeError);
|
||||
assert.throws(() => queueSteps(160, Number.NaN), RangeError);
|
||||
});
|
||||
test("benchmark ordering and source values are preserved", () => {
|
||||
assert.deepEqual(
|
||||
benchmarks.map((model) => model.answer),
|
||||
[10.12, 8.4, 6.89, 4.25],
|
||||
);
|
||||
assert.ok(benchmarks.every((model) => model.first <= model.answer));
|
||||
});
|
||||
Reference in New Issue
Block a user