Skip to content

bench: engine load tools, a worklet over-budget counter, and an instruction gate - #389

Merged
mishan merged 1 commit into
masterfrom
loadbench
Oct 7, 2026
Merged

mishan merged 1 commit into
masterfrom
loadbench

Conversation

@mishan

@mishan mishan commented Oct 6, 2026

Copy link
Copy Markdown
Owner

The worklet times every process() call against the quantum it rendered
(Date.now, the only clock in its scope: 1 ms steps, so `over budget' is
a reading of 3 ms or more at 48 kHz) and posts the count over budget,
the slowest call and a histogram by whole milliseconds with each tape,
plus whether the clock is too coarse to trust. host.js's synth.quanta()
keeps the totals and the last ~2.7 s apart; the jam numbers panel shows
both. A tape from an older worklet without the fields is delivered
uncounted.

bench.mjs plays each piece the way the page does -- samples, default
patches for empty channels, seed 1 for pieces with none -- so every
shipped piece is timed, and says which channels were timed as silence.
--json writes one document: per piece and chord p50/p99/p99.9/max per
quantum against the budget, failures as entries, and the build timed
(its path and wasm hash) beside the script's commit. --only and
--seconds are checked; a run that times nothing fails.

dspbench gains -j (JSON), -l and -r (window length and rate), the
chord's every window timed (nearest-rank p99 over how many windows),
and -s/-h in milliseconds, so play loads compare across window lengths.

worklettime.mjs plays pieces on the solo page in a real AudioContext
and reports over-budget calls per minute, the slowest call, p99 and the
audio clock against the wall clock; a page error fails the piece.

instrcount: dspbench on four instruments under cachegrind, against a
baseline keyed by compiler, flags, LTO, glibc and Valgrind, failing
over x1.10 or under x0.98 so a speedup is recorded with --update in the
commit that made it. CI's toolchain is committed; a desktop's counts
live in its build. CI pins the linux job to ubuntu-24.04 so an image
change is a commit that records new counts, and prints the margin.

…uction gate

The worklet times every process() call against the quantum it rendered
(Date.now, the only clock in its scope: 1 ms steps, so `over budget' is
a reading of 3 ms or more at 48 kHz) and posts the count over budget,
the slowest call and a histogram by whole milliseconds with each tape,
plus whether the clock is too coarse to trust. host.js's synth.quanta()
keeps the totals and the last ~2.7 s apart; the jam numbers panel shows
both. A tape from an older worklet without the fields is delivered
uncounted.

bench.mjs plays each piece the way the page does -- samples, default
patches for empty channels, seed 1 for pieces with none -- so every
shipped piece is timed, and says which channels were timed as silence.
--json writes one document: per piece and chord p50/p99/p99.9/max per
quantum against the budget, failures as entries, and the build timed
(its path and wasm hash) beside the script's commit. --only and
--seconds are checked; a run that times nothing fails.

dspbench gains -j (JSON), -l and -r (window length and rate), the
chord's every window timed (nearest-rank p99 over how many windows),
and -s/-h in milliseconds, so play loads compare across window lengths.

worklettime.mjs plays pieces on the solo page in a real AudioContext
and reports over-budget calls per minute, the slowest call, p99 and the
audio clock against the wall clock; a page error fails the piece.

instrcount: dspbench on four instruments under cachegrind, against a
baseline keyed by compiler, flags, LTO, glibc and Valgrind, failing
over x1.10 or under x0.98 so a speedup is recorded with --update in the
commit that made it. CI's toolchain is committed; a desktop's counts
live in its build. CI pins the linux job to ubuntu-24.04 so an image
change is a commit that records new counts, and prints the margin.
@mishan
mishan merged commit 560a317 into master Oct 7, 2026
18 checks passed
@mishan
mishan deleted the loadbench branch October 7, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant