Skip to content

[1/3] Preserve speech controls and CJK boundaries in long-form chunks - #26

Merged
plotarmordev merged 4 commits into
plotarmordev:mainfrom
krunkosaurus:contrib/protected-chunks
Oct 27, 2026
Merged

plotarmordev merged 4 commits into
plotarmordev:mainfrom
krunkosaurus:contrib/protected-chunks

Conversation

@krunkosaurus

@krunkosaurus krunkosaurus commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Description and motivation

Part 1 of 3 (merge order: this PR, #27 sampling, #28 dialogue): add CUDA NVFP4 patch 0001-protected-speech-chunks.patch, linked to native source PR #5. Closes #25.

Long-form requests keep complete paired directions, bracket cues and special tokens; CJK boundaries work without ASCII spaces. Only an indivisible protected span may exceed the character target, while prompt/segment/frame limits and original-slice ownership remain enforced. Full-model and Metal NVFP4 long-form support is not added.

Enable a checksummed CUDA patch series without moving any engine/weight pin. Independent adversarial agent review found that the existing builder could apply an unlisted patch: a new regression reproduced that failure, and exact manifest coverage now rejects unlisted, missing, duplicate and non-patch entries before checkout.

The Sogni-AI/drama3-mlx chunker is the behavioral reference. Native code is implemented independently.

Testing

  • Python recipe suite: 46 tests, 15 skipped, zero failures. Six build tests exercise actual local clone/git-am/checksum operations with a fake compiler and no network/model.
  • Selected real manifests exactly match 12 full, 1 CUDA and 3 Metal patches; all digests verify.
  • Exported CUDA patch applies from clean b1f4b9b4; resulting source tree equals reviewed native commit 3babff30.
  • Native CPU suite: 364 passed, four skipped. Goldens: 309/319 equal, ten known differences, zero unexpected.
  • Independent native property review: 1,680 combinations passed. Native lean: zero new findings. Applied source and non-patch recipe whitespace checks pass; mail patches retain their normal context-line whitespace.
  • Six existing socket-fixture read-before-join repairs were validated; production transport unchanged.
  • CUDA host compilation cannot complete on this Mac because the unchanged base uses O.DIRECT. Real CUDA build/device/model/listening gates remain unrun; this is a draft.

Performance or quality claim

None.

Checklist

  • One topic, checksummed ordered patches, source PR and patch index linked.
  • Regression tests fail before the fixes and pass after; adversarial findings resolved.
  • Clean patch application and exact source-tree comparison.
  • No weights, private voices, recordings or private machine paths published.
  • CUDA compiler/device and model/audio qualification.

Linux --weights nvfp4 now applies the checksummed series in
engine/nvfp4/patches/ (added in this PR), so list it with the other
Apache-2.0 patch directories and drop "applies no patches".
@plotarmordev

Copy link
Copy Markdown
Owner

Thank you for this, and for the careful write-up. I built the CUDA NVFP4 engine with this patch on Linux/CUDA 13 (GB10): 49/49 build steps, and zig build test passed with the server suite at 364 passed and 4 skipped, which matches your Mac numbers. I also checked that the exported patch reproduces TensorFold #5's tree exactly. One small thing I'll fix on my side: NOTICE still says Linux --weights nvfp4 applies no patches and lists only two patch directories. I'll run the device and listening checks on my GB10 before I take it out of draft.

plotarmordev added a commit that referenced this pull request Oct 25, 2026
gpu-checks: GPU check and D1-D4 diagnostic harness for PRs #26-#28
@plotarmordev

Copy link
Copy Markdown
Owner

I finished my own GPU checks for this stack on CUDA (full model and NVFP4, the merge base vs the #28 tip). For #26 everything I test passes:

  • Default requests produce byte-identical audio to the merge base (48/48 corpus rows, both weight sets), and streaming and the reference cache behave the same.
  • The long-form markup run gives valid segment cuts outside the protected spans.

One thing I saw is not from this PR: a long-form reply ends at the first segment that finishes on silence (the upstream if (r.reason != .stop) break; in speech_long.zig). The merge base does exactly the same on the same inputs, so I'll track that separately.

From my side this is ready. Whenever you're happy with it, please mark it ready for review and I'll merge the stack in order (#26, then #27, then #28). Thanks again!

@plotarmordev

Copy link
Copy Markdown
Owner

Hi @krunkosaurus, thanks again for this stack, and sorry for the wait.

#26 and #27 pass my review and my CUDA GPU checks. #28 passes too, apart from the one full-model question I left there (tagged two-speaker line running to the frame cap in 3 of 5 seeds); a quick view from you on that is all I need, and I won't hold the merge on Metal checks you can't run.

Could you mark #26, #27 and #28 ready for review? I'll merge them in order (#26, then #27, then #28) right away.

Small fixes I'm taking on myself, with credit to you:

If I don't hear back within 24 hours, I'll take them as they are and merge.

@plotarmordev
plotarmordev marked this pull request as ready for review October 27, 2026 09:01
@plotarmordev
plotarmordev merged commit e2746e3 into plotarmordev:main Oct 27, 2026
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.

Protect delivery markup in CUDA NVFP4 long-form chunking

2 participants