Repository navigation
Tag three rejection demos, and make the ledger say what each one proves - #572
Merged
Merged
Conversation
Three blocks exist to show the compiler refusing a program: a type mismatch
in ROADMAP.md, an assignment to an immutable binding in the book, and a span
outliving its storage. None were tagged, so each counted as a failure.
Tagging alone was not enough. The ledger recorded the standalone parse error
rather than the rejection the block demonstrates, so a reader saw
Top-level 'let' at line 1 must be 'let mut'
which is the harness failing to wrap a fragment, not the compiler rejecting
anything. It now records the first failure that reached meaning:
Cannot assign to immutable variable 'total' (use 'let mut')
span outlives borrowed storage `local` at line 3, column 5
The second is the exact string docs/language/spans.md quotes as the expected
output, so that claim is now checked rather than asserted.
Two byte-identical blocks in one file shared a ledger row, because the key is
the path plus a hash of the code. That is why the report counted 232
unverified against 231 ledger entries. Keys now carry an occurrence suffix,
which stays stable when a block moves; line numbers would not.
CONTRIBUTING.md described no convention for any of this. The four info-string
words are now documented where someone writing a doc example will find them.
unverified: 235 -> 232.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
godofecht
added a commit
that referenced
this pull request
Aug 19, 2026
#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
added a commit
that referenced
this pull request
Aug 19, 2026
* Make lib/stdlib/audio/README.md describe the API that exists
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]>
* Drop the #573 xfail: PR #576 fixes the bug rather than recording it
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]>
* Regenerate the example ledger after rebasing onto the occurrence keys
#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]>
---------
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
godofecht
added a commit
that referenced
this pull request
Aug 19, 2026
) (#600) PR #572 did this for expect-error blocks. Ordinary unverified ones still kept the first failure, and standalone runs before the wrappers, so a statement fragment was recorded as Top-level 'let' at line 1 must be 'let mut' which is the harness failing to wrap a fragment, not the compiler saying anything about the program. Where a later rung reached the type checker, that is what the ledger now carries. 74 of the 221 entries move from a superficial parse error to the real reason: parse 173 -> 99 types 29 -> 103 clang 19 -> 19 The counts are unchanged; only the diagnosis is. That matters because the ledger is the worklist for driving the remaining blocks to zero, and half of it was describing the harness rather than the example. Closes #588 Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Continues the doc-example work.
unverified: 235 -> 232.Three blocks that exist to be rejected
ROADMAP.md:441— "This should ERROR, not warn"docs/book/02-values-and-types.md:57— "The following program is rejected"docs/language/spans.md:165— "A span may not outlive its storage"None were tagged, so each counted as a failure.
Tagging alone was not enough
The ledger recorded the standalone parse error rather than the rejection the block demonstrates. A reader saw:
which is the harness failing to wrap a fragment, not the compiler rejecting anything.
verify()now keeps the first failure that reached meaning and records that instead:The second is the exact string
docs/language/spans.mdquotes as the expected output. That claim is now checked against the compiler rather than asserted.A ledger row that covered two blocks
The report counted 232 unverified against 231 ledger entries. The key is the path plus a hash of the code, so two byte-identical blocks in one file collided —
VISION.mdandlib/stdlib/audio/README.mdeach repeat a block verbatim. Keys now carry an occurrence suffix. It counts occurrences rather than using the line number, which would churn every time anything above the block is edited.779 blocks now produce 779 distinct keys, and the two counts agree.
The convention was undocumented
expect-error,ignore=,preamble=andno-harnessappeared only insidescripts/. A contributor writing a doc example had no way to know they exist.CONTRIBUTING.mdnow documents all four, plus the two facts that are not obvious: a block does not need amain, and an unknown info-string word fails loudly rather than silently verifying as ordinary code.Verification
pytest tests/check_doc_examples.py --check-ledgercheck_doc_links.pyTwo new tests cover the occurrence key: that identical blocks get distinct keys, and that a block which moves keeps its key.