Skip to content

lm: phase 2 stops a sequence at 3000 audio codes, the 600 s the synth pipeline takes - #131

Open
timoncool wants to merge 1 commit into
ServeurpersoCom:masterfrom
timoncool:phase2-code-cap
Open

timoncool wants to merge 1 commit into
ServeurpersoCom:masterfrom
timoncool:phase2-code-cap

Conversation

@timoncool

@timoncool timoncool commented Nov 12, 2026 •

Copy link
Copy Markdown

max_tokens in run_phase2_batch is duration*5 + 100, and the first code comes from the prefill, so a request for 580 s or more could produce more than 3000 codes. ops_resolve_T then refused the whole track with "T=N exceeds silence_latent max 15000, skipping" (seen on ten installs of ACE-Step Studio).

A sequence now ends when it reaches 3000 codes (15000 latent frames, 600 s at 5 codes per second), in the prefill and in the decode loop, so the track renders at 600 s instead of failing. Shorter songs are unchanged.

Summary by CodeRabbit

  • Bug Fixes
    • Audio generation now stops individual sequences at the supported length limit, including during initial sampling and later decoding. This helps prevent sequences from exceeding the audio pipeline’s maximum capacity.

… pipeline takes

max_tokens is duration*5 + 100, and the first code comes from the prefill, so a
song asked for 580 s or more could get past 3000 codes; ops_resolve_T then
refused the whole track (T exceeds silence_latent max 15000). A sequence now
ends at 3000 codes and the track is rendered at 600 s.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Phase 2 now marks a sequence done when its audio-code count reaches 3,000. The limit applies after the initial sampled token and during subsequent decoding.

Changes: Phase 2 code limit

Layer / File(s) Summary
Define and apply the sequence limit
src/pipeline-lm.cpp
The code defines PHASE2_MAX_CODES as 3,000 and marks a sequence done when it reaches that count after the initial sample or during subsequent decoding. The comment relates the limit to the synth pipeline’s 15,000-frame limit at five frames per code.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Merge Risk: Minimal · up to e9976

Phase 2 now stops at 3,000 audio codes, which is 600 seconds. Requests that previously exceeded the limit and were rejected will now render at 600 seconds, and shorter songs are unchanged. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: phase 2 now stops a sequence at 3000 audio codes, which matches the 600 s limit of the synth pipeline. The raw summary confirms the change adds a PHASE2_MAX_CODES cap …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: phase 2 now stops a sequence at 3000 audio codes, which matches the 600 s limit of the synth pipeline. The raw summary confirms the change adds a PHASE2_MAX_CODES cap of 3,000 codes in src/pipeline-lm.cpp, applied both to the first sampled token and to subsequent decoding. The title is specific, concise, and accurately describes the primary change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: da1e9a0a-0966-4034-8a6e-07dddddb0ac0
Commits

Reviewing files that changed from the base of the PR and between 07abf07 and e997697.

Files selected for processing: 1

  • src/pipeline-lm.cpp

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

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.

1 participant