diff --git a/engine/src/program/generate.cpp b/engine/src/program/generate.cpp index 5df0e8472a..cf14bfb606 100644 --- a/engine/src/program/generate.cpp +++ b/engine/src/program/generate.cpp @@ -5227,6 +5227,13 @@ int main(int argc, char** argv) { o.lookup_max_t = fix.lookup_max_t; } } + // --loop-adapter: the batched GDN commit is off (each extra pass replays its own states), so a window cannot be wider than + // kVerifyMaxT rows: the 12-token lookup default is clamped instead of ending the engine on the first request. + if (!o.loop_adapter.empty() && o.lookup_max_t > (int) strata::kernels::kVerifyMaxT) { + std::fprintf(stderr, "strata generate: --loop-adapter: --lookup-max-t %d is clamped to %d (no batched GDN commit under the loop)\n", + o.lookup_max_t, (int) strata::kernels::kVerifyMaxT); + o.lookup_max_t = (int) strata::kernels::kVerifyMaxT; + } if (o.lookup_max_t > 0 && o.suffix_draft > 0 && o.spec >= 2) { if (o.mtp_max_t == 0) o.mtp_max_t = o.spec; o.spec = std::max(o.spec, std::min(o.lookup_max_t, strata::kernels::kVerifyLongT));