Repository navigation
Conversation
For reviewing a speed-up: renders every model with a base and a candidate tools/render binary and prints EXACT, NEAR or DIFFERENT per model, with the first differing sample. NEAR means an error-to-signal ratio below -100 dB and no sample off by more than 1e-4, so one wrong sample in a long render is DIFFERENT; so is a NaN. - The test signal is generated at each model's own sample rate (48 kHz when a model declares none; a .wav impulse response at its file's rate), and its length is odd, so the last block of any power-of-two size is short. - Renders shorter than the input are DIFFERENT even when they agree. - Exits 0 if no model differs, 1 if one does, 2 if a render fails. - render writes output channel 0 only, so only that channel is compared. Standard library only; --self-test checks the comparison itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
tools/compare_renders.py, for reviewing a speed-up: does the faster build still produce the same audio, model by model?It renders every model (default
example_models/*.nam;.wavimpulse responses work too) with both binaries and prints, per model:It exits 0 if no model differs, 1 if one does, and 2 if a render fails.
--- title: Reviewing a speed-up --- flowchart TD accTitle: Reviewing a speed-up accDescr: Build the base and the candidate, run compare_renders.py on both render binaries, then read the speed numbers only if every model is exact or near. n_build["build base and candidate"] --> n_cmp["compare_renders.py base cand"] --> n_q{"every model<br/>EXACT or NEAR?"} n_q -- yes --> n_speed["look at the speed numbers"] n_q -- no --> n_ask["which model, which sample?"]The test signal is generated at each model's own sample rate, with an odd length so the last block is always short. It is a sweep, noise, silence and a full-scale square. Standard library only, so there is nothing to install.
--self-testchecks the comparison itself: EXACT, NEAR and DIFFERENT thresholds, one wrong sample, a NaN, and truncated renders.renderwrites output channel 0 only, so only that channel is compared. Comparing an-O3build with an-Ofastbuild ofmain: two models are EXACT, the rest are NEAR (worst -119 dB, largest sample difference 1.8e-5).