Land community PR #34: sequence_vec benchmark + observe-path stack-safety regression test - #37
Merged
Merged
Conversation
…ssion test Rebased onto main after the July 2026 audit remediation (#36), which independently fixed the same stack overflow via an iterative trampoline in the interpreter (FG-19) and a stack-safe sequence_vec. This keeps the still-novel parts of the original PR: the criterion benchmark for large observe sequences, and a 100k-observe regression test exercising the sequence_vec + observe path (the existing FG-19 test covers sample+bind). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DEAKcbnLVP8iSXub2Pqor2
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.
Lands the still-applicable parts of #34 by @brendanashworth, rebased onto post-audit
main. Closes #34.Background
#34 (December 2025) correctly diagnosed and fixed a stack overflow:
runrecursed once per effectful node, and the oldsequence_vecbuilt a left-associatedziptower, so largeobservesequences blew the stack. The July 2026 audit independently confirmed the same defect (finding FG-19), and the remediation merged in #36 fixed it with an iterative trampoline inrunplus a continuation-threadedsequence_vec— which unfortunately left #34 in conflict withmain.What this PR keeps from #34
The parts that remain novel after #36, with @brendanashworth's commit authorship preserved:
benches/sequence_vec.rs— criterion benchmark for largeobservesequences throughsequence_vec(the benchmark that quantified the original fix at ~97% faster for n=1,000).run_handles_large_observe_sequence— 100k-observation regression test through thesequence_vec+observepath. The existing FG-19 test covers deepsample+bind; this covers the other interpretation path that Use a balanced tree of joined models #34 originally protected.Verification
cargo test --all-features): all lib tests + 164 doctests pass, including the new regression test (0.10s).cargo bench --bench sequence_vec --no-runcompiles clean withRUSTFLAGS=-Dwarnings.cargo clippy --all-targets --all-featuresandcargo fmt --checkclean.Thanks @brendanashworth for finding and fixing this before the audit did — the first community fix to fugue's interpreter core.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DEAKcbnLVP8iSXub2Pqor2