Repository navigation
Make lib/stdlib/audio/README.md describe the API that exists - #574
Merged
Merged
Conversation
Contributor
Author
|
Updated: dropped the When I opened this, #573 was an open bug and recording it as a strict xfail was the right move. It is now fixed in #576, so keeping the xfail here would XPASS and fail the build the moment that lands. The real regression test ships with the fix, in One correction to this PR's description. It said:
That no longer holds once #576 lands. |
Every code block in this README failed to compile. Three sections named
functions that were never written:
gpu_process_buffer(input, effect_kernel) -> audio_gain_block(backend, buf, gain)
simd_gain_f32x8(samples, gain) -> audio_gain_interleaved_f32(...)
graph_new(); graph_add_oscillator(...) -> effect_chain_new(rate); effect_chain_*
The graph section described a node-and-edge API. What exists is a value:
each stage returns a new EffectChain, so the section is rewritten around
that rather than renamed onto it.
pattern_4 and euclidean_pattern were called with a trailing voice argument.
They take no such argument; pattern_4 always plays through bass and
pattern_8 through lead, and the comment in livecode.flow ("caller can modify
this pattern if needed") shows the parameter was intended and never added.
The README now says which voice each one uses.
Five blocks used `clock` without declaring it, and two used both `clock` and
`pos` at file scope with no enclosing function. A reader copying any of them
got the same errors CI now catches.
The GPU block is tagged ignore= rather than fixed: it links
runtime/audio_gpu_metal.m, which the doc example build does not compile. The
prose now gives the clang line, which it did not before.
unverified: 235 -> 224.
This turned up issue #573. lib/stdlib/audio/scales.flow returns fixed-size
arrays from every function, and `-> array<T, N>` lowers to a pointer into
the callee's dead frame, so all 25 such functions in the stdlib return
garbage. Added as a strict xfail in test_coverage_known_bugs.py so it
reports the moment it is fixed. The blocks here compile, which is all the
doc checker asserts; the one that also runs a scale function still prints
garbage until #573 is fixed.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The xfail asserted that -> array<T, N> stops returning stack memory. #576 makes that true, so keeping it here would XPASS and fail the build the moment that lands. The real regression test lives with the fix, in tests/integration/test_array_return.py, and reads the values back. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
#572 changed the key format and #574 changed which blocks pass, so the checked-in ledger conflicted. Regenerated rather than hand-merged. unverified: 235 -> 221 with both changes applied. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
godofecht
force-pushed
the
audio-readme-accuracy
branch
from
August 19, 2026 10:46
278f3b7 to
e577aba
Compare
Merged
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.
Every code block in this README failed to compile.
unverified: 235 -> 224.Three sections named functions that were never written
gpu_process_buffer(input, effect_kernel)audio_gain_block(backend, buf, gain),audio_convolution_block,audio_fft_blocksimd_gain_f32x8(samples, gain)audio_gain_interleaved_f32(data, frames, channels, gain)graph_new(),graph_add_oscillator,graph_add_filter,graph_connecteffect_chain_new(rate),effect_chain_set_gain_db,effect_chain_enable_lowpass,effect_chain_tickThe graph section described a node-and-edge API. What
graph.flowactually provides is a value: each stage returns a newEffectChain. The section is rewritten around that rather than renamed onto it, because a signal path reads as a sequence of assignments and that is worth showing.A parameter that was planned and never added
pattern_4andeuclidean_patternwere called with a trailing voice argument (, bass,, kick,, lead). They take no such argument.pattern_4always plays throughbassandpattern_8throughlead, and the comment inlivecode.flowsays why:The README now states which voice each sequencer uses.
Blocks that could not run as written
Five used
clockwithout declaring it. Two used bothclockandposat file scope with no enclosing function. A reader copying any of them hit the same errors CI now catches.One block stays unverified, with the reason written down
The GPU example is tagged
ignore=because it linksruntime/audio_gpu_metal.m, which the doc example build does not compile. The prose now gives the clang line needed to build it, which it did not before.What this turned up: issue #573
lib/stdlib/audio/scales.flowreturns a fixed-size array from every function, and-> array<T, N>lowers to a pointer into the callee's dead frame:All 25 functions in
lib/stdlib/returningarray<T, N>return garbage, silently. Filed as #573 with the repro, and added here as a strict xfail intest_coverage_known_bugs.pyso it reports the moment it is fixed.Worth being precise about what this PR claims: these blocks now compile, which is all the doc checker asserts. The one that also calls a scale function still prints garbage at runtime until #573 is fixed.
Verification
pytest tests/check_doc_examples.py --check-ledgercheck_doc_links.pyEach block was also run, not only compiled: 12 of 14 run clean, one is the
ignore=GPU block, one is a fragment the harness wraps.