Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

generate: --spec on a native pack starts the speculative loop for a 1-token prompt (spec_pos -1 = unused, 0 is a real position)

Niko1221aece46db8900
diff --git a/src/program/generate.cpp b/src/program/generate.cpp
index 3cef8621c..482459957 100644
--- a/src/program/generate.cpp
+++ b/src/program/generate.cpp
@@ -15482,7 +15482,7 @@ int main(int argc, char** argv) {
// ---- plan v0.3 P5: the prompt's conditioning positions [0, n_prompt - 1) in batched chunks. The token loop
// then starts at the last prompt position, whose prediction is the first generated token.
int64_t pos_start = 0;
- int64_t spec_pos = 0; // plan v0.3 P6: where the speculative loop starts (0 = not used)
+ int64_t spec_pos = -1; // plan v0.3 P6: where the speculative loop starts (-1 = not used; 0 is a real position: a 1-token prompt on a native pack)
strata::prefill::Prefill prefill;
// #1595: not by default when the cache holds every expert (nothing to take)
strata::prefill::Prefill::arm_cpu_share(!multi_gpu && !o.no_pool,
@@ -15872,7 +15872,7 @@ int main(int argc, char** argv) {
// round emits (accepted drafts + 1) tokens. `commit` keeps the state of the tokens that were emitted.
const bool ended = o.stop_eos && !produced.empty() &&
std::find(o.eos_ids.begin(), o.eos_ids.end(), (int64_t) produced.back()) != o.eos_ids.end();
- if (spec_pos > 0 && (int64_t) produced.size() < o.max_new && !ended) {
+ if (spec_pos >= 0 && (int64_t) produced.size() < o.max_new && !ended) {
auto read_ids = [](const std::string& path, std::vector<int64_t>& ids) {
std::ifstream in(path);
std::string text((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>());