Skip to content

server: preserve controls and CJK boundaries in long-form speech - #5

Draft
krunkosaurus wants to merge 1 commit into
plotarmordev:drama-nvfp4from
krunkosaurus:drama-nvfp4/protected-chunks
Draft

krunkosaurus wants to merge 1 commit into
plotarmordev:drama-nvfp4from
krunkosaurus:drama-nvfp4/protected-chunks

Conversation

@krunkosaurus

@krunkosaurus krunkosaurus commented Oct 25, 2026 •

Copy link
Copy Markdown

What this changes

Long-form speech currently splits paired directions and bracket cues across synthesis requests. For example, a 20-character target cuts <whisper>One. Two. Three.</whisper> into unmatched pieces. This patch preserves complete special tokens, balanced brackets and nested simple tags; it also recognizes CJK sentence/clause punctuation and prevents paragraph markers inside controls from forcing cuts.

Segments remain slices of the normalized input, preserving redraw offsets and join gaps. Only an indivisible control may exceed the character target; prompt, segment and frame limits still apply. This changes the CUDA NVFP4 long-form route on drama-nvfp4. Tracks recipe issue 25.

The behavioral reference is Sogni-AI/drama3-mlx chunking. Implementation and regressions extend native TensorFold independently; no Fish-derived Python implementation is copied.

Receipt

Base b1f4b9b4830c9bd43bf7c432cffe7dea21313537; Zig 0.17.0, macOS arm64. CPU tests use synthetic code/PCM fixtures.

  • Original protected-span regression fails before the change and passes after.
  • zig build test-server-cpu: 364 passed, 4 skipped, 0 failed.
  • zig build test-golden -Dcpu=apple_m1: 309/319 equal, 10 known differences, 0 unexpected.
  • Standalone splitter 23/23; joins 29/29. Independent adversarial property test: 1,680 mixtures/character targets passed.
  • Formatting/diff checks pass; lean comparison has 1,219 inherited findings and zero new findings.
  • Review exposed six existing join-before-drain test ordering defects across five fixtures on macOS. Focused unchanged streaming tests failed 2/7; reading before joining passes 7/7. These test-only repairs let the suite finish; production socket handling is unchanged.
  • CUDA host compilation is blocked on this Mac by the unchanged std.c.O.DIRECT use, reproduced against the exact base.

Draft qualification limit: no CUDA device/model inference, audio identity, acoustic listening or performance qualification was run. No quality/speed claim. The local full-model launcher admission floor was not met; its guard was not overridden.

Integration

This is the first legacy source contribution in a short chunking → sampling → dialogue-speakers stack. The protected special-token boundary is a prerequisite for the later dialogue hard-cut case. Independent review found no remaining native blocker; the recipe checksum-coverage finding is corrected in the recipe companion.

  • Existing native long-form route and original slice ownership preserved.
  • Regression proof, independent adversarial agent review and CPU receipt.
  • No weights, private voices, recordings or device arithmetic changes.
  • Device/model and listening qualification.

Pinned-engine packaging and user documentation: drama-tensorfold companion PR.

Keep complete special tokens, bracketed cues and nested paired tags intact across sentence, clause, space and code-point splitting. Protect topic-shift preprocessing and recognize CJK boundaries without changing prompt or frame ceilings.

Exercise exact whole and streamed prompt segments, oversized spans, malformed controls and redraws. Drain inherited socket fixtures before joining so CPU validation completes on macOS.

Refs: plotarmordev/drama-tensorfold#25
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