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++

batch pipeline: a pipelined slot is a cache again, so a request left alone goes back to the solo path (#857)

Niko1221fc8444367d83
diff --git a/src/program/generate.cpp b/src/program/generate.cpp
index 7ee59c928..6e7cee505 100644
--- a/src/program/generate.cpp
+++ b/src/program/generate.cpp
@@ -8388,7 +8388,10 @@ int main(int argc, char** argv) {
const double ms = std::chrono::duration<double, std::milli>(Clock::now() - sl.t0).count();
std::printf("BDONE %d %lld %s %.1f\n", gi * GS + t, (long long) sl.produced, fin, ms);
sl.active = false;
- sl.cached = false; // the pipeline's pad rows: a pipelined slot is not reused as a cache
+ // a pipelined slot is a cache again (#857: a request left alone in its slot goes back to the solo path with its
+ // drafts): its state is final once its last window has left the last stage. A later group window whose pad
+ // row writes this slot clears the flag (below, where the group starts), so a stale state is never reused
+ sl.cached = o.prompt_cache > 0 && !sl.img;
} else {
sl.x = y;
sl.p += 1;