Skip to content

Commit 9c187c9

Browse files
borisbatclaude
andcommitted
accelerate: put the offending value back in the out-of-range warning
Copilot review, #3580. env_int64_min's warning named the constraint but not the value that broke it, which is the one thing you need to fix a typo'd knob. This was a regression from this PR. The original printed the raw string: dasLLAMA: {name} `{raw}` is not an integer >= {min_v} — keeping {def_v} Delegating the parse to env_int64 dropped `{raw}` — and quietly dropped a second case with it: env_int64 falls back on unparseable input, so a typo'd DASLLAMA_ACCEL_MIN_NTOK stopped warning at all and silently did nothing. That is the exact failure mode this registry exists to prevent. Both restored with one branch: read the raw value first, then parse with a sentinel default one below the floor, so unparseable and out-of-range fall into the same check. An unset knob still returns the default in silence, which is the registry's documented contract. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 213da6b commit 9c187c9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

modules/dasLLAMA/dasllama/dasllama_math_accelerate.das

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,14 @@ def dasllama_accelerate_disable() {
223223
clear_float_batch_override()
224224
}
225225

226-
// env_int64 with a floor: out-of-range is worth a word, unlike a plain unset knob
226+
// env_int64 with a floor. A SET but bad value is worth a word either way — unparseable and
227+
// out-of-range both land below the floor via the sentinel default, so one branch covers both.
227228
def private env_int64_min(name : string; def_v : int64; min_v : int64) : int64 {
228-
let v = env_int64(name, def_v)
229+
let raw = env_str(name, "")
230+
return def_v if (empty(raw))
231+
let v = env_int64(name, min_v - 1l)
229232
if (v < min_v) {
230-
to_log(LOG_WARNING, "dasLLAMA: {name} must be an integer >= {min_v} — keeping {def_v}\n")
233+
to_log(LOG_WARNING, "dasLLAMA: {name} `{raw}` is not an integer >= {min_v} — keeping {def_v}\n")
231234
return def_v
232235
}
233236
return v

0 commit comments

Comments
 (0)