Skip to content

[2/3] Add request sampling controls to all pinned Drama engines - #27

Merged
plotarmordev merged 5 commits into
plotarmordev:mainfrom
krunkosaurus:contrib/sampling-controls
Oct 27, 2026
Merged

plotarmordev merged 5 commits into
plotarmordev:mainfrom
krunkosaurus:contrib/sampling-controls

Conversation

@krunkosaurus

@krunkosaurus krunkosaurus commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Description and motivation

Part 2 of 3. Depends on #26; merge that first, then this PR, then #28. The incremental recipe change is 37a6832...cb20bda.

Expose per-request temperature, top_p, top_k and exact unsigned 64-bit seed in all three pinned engines without changing their pins or default settings. Add full-model patches 0013/0014, Metal NVFP4 patches 0004/0005, and CUDA NVFP4 patch 0002, each with exact checksum coverage. Source companions: modern #1277 and legacy CUDA #6.

Validation happens before engine submission. Tests inspect the actual sampler fields sent through whole/streamed requests, reference rebuilding, CFG and redraws. Explicit seeds retain all 64 bits; redraws add their take ordinal with wrapping arithmetic. Legacy long-form applies that policy separately to each segment. Documentation states the existing JSON-f64 underflow boundary and native sampler differences.

The public Sogni-AI/drama3-mlx API is the behavioral reference. Native Zig changes were implemented independently.

Testing

  • scripts/build-engine.sh reapplies the complete selected series from each clean pin: full-model 66/66 build steps and Metal NVFP4 73/73 build steps passed on macOS arm64 with Zig 0.17.0. Native server and selected voice tools compile. Applied trees exactly equal reviewed source commits 1c31b4d2 and 2af18fba.
  • CUDA exported series applies from clean b1f4b9b4; tree equals reviewed 22939c2a. Exact exported-tree CPU suite: 371/375 passed, four skipped.
  • Final exact-export server reruns: full-model 574/574 passed; Metal 745/748 passed, three skipped. The five-test JSON target was cached from its earlier passing run; all five build steps passed per profile.
  • Modern source regression suite: 742/745 server tests passed, three skipped; JSON target passed/cached. Four route tests fail before the implementation.
  • Recipe Python suite inherited from [1/3] Preserve speech controls and CJK boundaries in long-form chunks #26: 46 tests, 15 skipped, zero failures. All 21 selected patch files have valid digests and exact unique manifest coverage.
  • Independent adversarial agent source and final packaging reviews passed after fixing the parsed-f64 documentation boundary. No new native lean findings; applied-source and non-patch recipe whitespace checks pass.
  • Broader modern source checks encountered two unchanged macOS base failures: test-pull-host aborts with ISCONN, and tf-flashnext-run fails on SharedEvent/Event. Both reproduce on the untouched base; this is not a passing whole-upstream build claim.
  • CUDA host compilation on this Mac hits the unchanged base's O.DIRECT portability error. Real CUDA compilation, model/audio identity, device determinism, listening and qualification gates remain unrun. The local launcher memory admission floor was not met and was not overridden. This PR remains a draft.

During final CPU replays, two unchanged recall tests failed while the volume had about 3.3 GiB free, below their existing 4 GiB admission floor. Removing only task-created compiler caches restored 5.043 GiB; the identical commands passed with no source, environment or admission-guard change. Original failure receipts were retained.

Performance or quality claim

None. Equal settings do not promise equal audio across native backends.

Checklist

  • Ordered appended patches, checksums, patch index and source links updated.
  • Clean series application and real full-model/Metal recipe builds.
  • Deterministic regressions and independent adversarial agent review.
  • No weights, private voices, recordings or private machine paths published.
  • CUDA build/device and real-model/audio qualification.

Restore the "answers as upstream does without flags" rule for the
full-model patches and state the per-request temperature, top_p, top_k
and seed fields from this PR (0013/0014, CUDA 0002, Metal 0004/0005) as
the request-level exception: they need no launch flag, and requests
without them are unchanged.
@plotarmordev

Copy link
Copy Markdown
Owner

Thanks! The validation and the seed handling look right to me, and requests without the new fields keep exactly the old seeds and parameters. One non-blocking ask for TensorFold #6 (and so CUDA patch 0002): after this change Redraws.salt in zig/src/server/speech_redraw.zig no longer has any callers. Could you drop it and re-export 0002 with its new checksum? Separately, I've decided to keep these fields request-level with no launch flag, since requests without them behave exactly as before. I'll push a small README commit to your branch that lists them as a stated exception to the "answers as upstream does without flags" rule.

@plotarmordev

Copy link
Copy Markdown
Owner

My CUDA checks for #27 pass: seeds repeat byte for byte (including 2^53+1 and 2^64-1), out-of-range top_k is rejected with a 400, and requests without the new fields are byte-identical to the merge base on both weight sets.

From my side this is ready. Please mark it ready for review whenever you're happy, and I'll merge it right after #26. The small README and patch-subject touch-ups for #28 I mentioned earlier I'll add once this one is in.

@plotarmordev
plotarmordev marked this pull request as ready for review October 27, 2026 09:03
@plotarmordev
plotarmordev merged commit db6ba7d 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.

2 participants