From 96f0307aa0e89290cb394a7ceb6150c55972fa7b Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Mon, 2 Nov 2026 01:06:15 +0100 Subject: [PATCH] --draft dflash2 without the MTP layer: refuse a missing draft vocabulary file instead of running the drafter's head over the whole vocabulary --- src/program/generate.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/program/generate.cpp b/src/program/generate.cpp index 36b8c2e6cd..763f207d6a 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -5245,6 +5245,13 @@ int main(int argc, char** argv) { return 2; } df2_vocab_file = o.mtp_draft_vocab.empty() ? o.mtp + "/draft_vocab.bin" : o.mtp_draft_vocab; + { // without the vocabulary subset the DFlash2 would run its head over all of the target's rows (+0.7 ms a round measured on Metal) without a word + std::error_code vec; + if (!std::filesystem::exists(df2_vocab_file, vec)) { + std::fprintf(stderr, "strata generate: --draft dflash2: the draft vocabulary %s does not exist (--mtp DIR needs DIR/draft_vocab.bin, or --mtp-draft-vocab FILE); the drafter would run its head over the whole vocabulary\n", df2_vocab_file.c_str()); + return 2; + } + } o.mtp.clear(); df2_solo = true; }