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: the session state is zeroed for every pack in CLI generate mode (#167 follow-up); no .pi/ ignore line

Niko1221c3242f095c18
diff --git a/.gitignore b/.gitignore
index 540d401a7..cb227e32a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,7 +20,6 @@ __pycache__/
*.nsys-rep
# Pi harness metadata (local session state, not project source)
-.pi/
*.sqlite
*.npz
*.occ1
diff --git a/src/program/generate.cpp b/src/program/generate.cpp
index 60fb76c7f..5d7894c71 100644
--- a/src/program/generate.cpp
+++ b/src/program/generate.cpp
@@ -1536,12 +1536,12 @@ int main(int argc, char** argv) {
// allocation and overflow/NaN after reuse, which surfaced as the whole layer stack saturating and every
// prompt decoding to the same token. `--serve` zeroes exactly this state when `resume == 0`; generate mode
// always starts from an empty sequence, so it must too.
- if (native_pack) {
- strata::core::session_zero(ss, g, nullptr, main_cs);
- if (cudaDeviceSynchronize() != cudaSuccess) {
- std::fprintf(stderr, "strata generate: zeroing the session state failed\n");
- return 1;
- }
+ // (#167) Every pack, not only a native one: a canonical pack whose prompt goes through the batched prompt path
+ // (--prefill) starts at position 0 without a put_input, so it never zeroed the state either.
+ strata::core::session_zero(ss, g, nullptr, main_cs);
+ if (cudaDeviceSynchronize() != cudaSuccess) {
+ std::fprintf(stderr, "strata generate: zeroing the session state failed\n");
+ return 1;
}
if (g.n_qsa_layers() > 0 && ss.qsa_states[0].kv_mode == 1)
std::fprintf(stderr, "strata generate: KV streaming: %lld of %lld cells per QSA layer in VRAM, the K/V in "