Skip to content

Land community PR #34: sequence_vec benchmark + observe-path stack-safety regression test - #37

Merged
alexnodeland merged 1 commit into
mainfrom
pr34-rebased
Jul 13, 2026
Merged

Land community PR #34: sequence_vec benchmark + observe-path stack-safety regression test#37
alexnodeland merged 1 commit into
mainfrom
pr34-rebased

Conversation

@alexnodeland

Copy link
Copy Markdown
Owner

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: run recursed once per effectful node, and the old sequence_vec built a left-associated zip tower, so large observe sequences 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 in run plus a continuation-threaded sequence_vec — which unfortunately left #34 in conflict with main.

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 large observe sequences through sequence_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 the sequence_vec + observe path. The existing FG-19 test covers deep sample+bind; this covers the other interpretation path that Use a balanced tree of joined models #34 originally protected.

Verification

  • Full suite green locally (cargo test --all-features): all lib tests + 164 doctests pass, including the new regression test (0.10s).
  • cargo bench --bench sequence_vec --no-run compiles clean with RUSTFLAGS=-Dwarnings.
  • cargo clippy --all-targets --all-features and cargo fmt --check clean.

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

…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
Copilot AI review requested due to automatic review settings July 13, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@alexnodeland
alexnodeland merged commit 6b1f4c0 into main Jul 13, 2026
3 checks passed
@alexnodeland
alexnodeland deleted the pr34-rebased branch July 13, 2026 13:38
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.

3 participants