Commit Graph
5 Commits
Author SHA1 Message Date
Pavlo RatushnyiandClaude Sonnet 5.5 700e921ae9 feat(sampler): host-side serve-loop sampling for MTP (window staging, coupled draft history, acceptance) with a whole-loop toy-model oracle
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:57:50 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 3ca559cebc feat(serving): serve non-greedy requests through the Original sampler chain
backend-api carries SamplingOptions; backend.rs plans each request with the
validated SamplingParams instead of refusing temperature != 0; the output stage
bypasses the compact argmax for an armed request and draws with the bit-exact
host reference (counter = fed-token position, penalty history = prompt+generated).
MTP with sampling is refused explicitly. Desktop RPC only bounds temperature.
Docs: docs/sampler-reference.md (verified vs open).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 14:55:55 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 4d1594f71c fix(sampler): audit the Original-literal host sampler port against the C++ oracle
- SamplerParams moves to original_sampler_params.rs (pure) and is checked byte for
  byte against the Original struct (size, alignment, offsets, padding) and defaults.
- validate() no longer rejects top_p == 0 (the Original accepts it).
- Draft cell -1 (draft_first at position 0, counter 0) is accepted by
  coupled_draft_counter and OriginalSampler::sample_coupled.
- set_subset keeps the first index and ignores out-of-range ids like setup_coupled.
- Runtime penalty_rows / coupled helpers are compared with the Original header fixture;
  run_port_host_tests.sh runs these pure tests on macOS.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 14:55:55 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c7862fb1c1 test(sampler-ref): more full-vocabulary oracle cases
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 14:42:51 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 45bad22b88 feat(sampler-ref): CPU reference of the Original sampler chain with host-oracle fixtures
New pure-Rust crate leleka-sampler-ref: Philox draw, penalties -> top_k ->
top_p -> min_p -> temperature -> inverse-CDF pick, greedy argmax, coupled-draft
counter/ring math, penalty_rows, exact-match acceptance, and the request-level
SamplingParams validation with the Original's GEN defaults and wire keys.

Golden fixtures come from compiling the Original's sampler_parity.cpp host
reference (included unmodified) and sampler/coupled_draft headers with clang++
(-ffp-contract=off), plus the verbatim StrataEngine.sampling_keys lifted from
server.py. No GPU, no speed or quality claim.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 14:42:51 +02:00