Repository navigation
release check: add npu-idle-evict - no row read Lemonade auto_evict, so a pre-fix image idle NPU was never checked (engine#3437) - #3467
Conversation
…, so a pre-fix image's idle NPU was never checked (engine#3437) engine#3437: on 23 Nov a Qwen3-0.6B-NPU-1bit loaded from the web UI at 21:50Z held the NPU until an unload-all at 23:44Z (~1 h 54 min). Lemonade ships idle eviction OFF: src/cpp/server/eviction_engine.cpp:84-91 skips a model unless its recipe options carry auto_evict: true (is_boolean at :87, so a string "true" is ignored), and src/cpp/resources/defaults.json:11 has "auto_evict": false, so evict_idle_timeout (300 s, :93) is never consulted. #3438 (77ab44b) shipped the image half: /usr/local/bin/1bit-npu-idle-evict writes {"auto_evict": true, "evict_idle_timeout": 600} under Lemonade's canonical ids for every onebit NPU model, and 10lemonade:164-165 runs it before lemond. Nothing read that file, so the wave could only be caught by a person noticing the NPU stayed busy. - npu_idle_evict_verdict (release-check.sh:1244) reads the catalogue (+ user_models.json) and /data/lemonade/config/recipe_options.json - or the /var/lib/lemonade fallback - the way lemond does. Its NPU test and canonical-id resolution are the boot step's own, kept identical on purpose, and the self-test also drives the real 1bit-npu-idle-evict and asserts it leaves exactly what the row passes, so the row and the boot step cannot drift into two definitions. PASS: every NPU model has auto_evict true, each model's effective timeout printed. FAIL: no entry / false / non-boolean / a non-object entry / a missing, unreadable or non-JSON file. SKIP: no catalogue, or a catalogue with no onebit NPU model. A timeout that is not a positive integer is not a FAIL - with auto_evict on, Lemonade falls back to 300 s and the model is still evicted - but the effective value is printed, so a 24 h one is visible. - the row (release-check.sh:2305) runs where the boot step exists, /opt/1bit-package (the v3 appliance, board or VM); no hardware needed. The os/mini artifact SKIPs with the gap named (it starts lemond from os/mini/init.sh and has no such step), so a green os/mini VM does not read as "checked". - --self-test +19 (15 check arms, 4 named assertions): the 23 Nov box's own shape (the user entry only, no NPU entry) FAILs and names both NPU models; the helper's output on the same catalogue PASSes; a person-set 1200 s is reported, not failed; auto_evict false, the string "true", a non-object entry, a missing file, non-JSON and an array FAIL; an un-migrated bare key and Lemonade's 300 s default PASS; a GPU onebit model and the Windows-only ryzenai-llm entry are not demanded; a user model with onebit_backend npu is required and its missing entry FAILs. Evidence -------- Control. The box (1bit-os) runs the pre-fix v2026.49-rc1 image: /etc/init.d/10lemonade is the 23 Nov 17:56 cut, 0 references to npu-idle-evict, and /usr/local/bin/1bit-npu-idle-evict is absent. Its catalogue (/opt/1bit-package/bin/resources/server_models.json, sha256 42d7e805a05a3239fd49daaf6b55d7634860565dc5861e822983960ffae9022b) is the rc1 cut on disk here, and its live recipe_options.json is the 23 Nov shape: $ ssh strixhalo cat /data/lemonade/config/recipe_options.json { "user.Qwen3.8-27B-ThinkingCoder": { "ctx_size": 0, "llamacpp_args": "--temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.00 ..." } } # no entry for either NPU model $ . verdict.sh; npu_idle_evict_verdict <catalogue> '' <that file> FAIL 2 of 2 NPU model(s) would not be evicted when idle (.../pre-fix/recipe_options.json): builtin.Qwen3-0.6B-NPU-1bit (no entry); builtin.Qwen3-4B-NPU-1bit (no entry) - Lemonade's eviction_engine.cpp:84-91 skips a model unless a per-model auto_evict is true The row block itself, verbatim from this tree, run on that box (LEMDIR=/opt/1bit-package, CATALOG = the box's own catalogue; reads two files, no Lemonade call and no device): $ ssh strixhalo 'bash -s' < row-block.sh FAIL npu-idle-evict : 2 of 2 NPU model(s) would not be evicted when idle (/data/lemonade/config/recipe_options.json): builtin.Qwen3-0.6B-NPU-1bit (no entry); builtin.Qwen3-4B-NPU-1bit (no entry) - Lemonade's eviction_engine.cpp:84-91 skips a model unless a per-model auto_evict is true and with LEMDIR=/opt/lemonade (the os/mini artifact): SKIP npu-idle-evict : not the v3 appliance (no /opt/1bit-package here): os/mini starts lemond from os/mini/init.sh, which does not set NPU idle eviction - engine#3437's fix is os/v3/puppy's 10lemonade After. On a copy of that same config, the shipped boot step (77ab44b's helper, unchanged in this tree): $ sh os/v3/puppy/embed/usr/local/bin/1bit-npu-idle-evict <catalogue> <copy>/config 2 NPU model(s) evict after 600 s idle: set for builtin.Qwen3-0.6B-NPU-1bit, builtin.Qwen3-4B-NPU-1bit $ npu_idle_evict_verdict <catalogue> '' <copy>/config/recipe_options.json PASS 2 NPU model(s) evict when idle: builtin.Qwen3-0.6B-NPU-1bit (600 s), builtin.Qwen3-4B-NPU-1bit (600 s) The user entry is unchanged (value-for-value; the helper re-serialises the file) and no entry is removed. Self-test: 266 ok / 0 FAIL under bash, dash (/bin/sh) and busybox sh; origin/main (1bb4632) 247 ok / 0, so +19. ctest: release_check_selftest, release_check_row, npu_idle_evict - all Passed (1.57 s, no device, no build). Gate: scripts/pre-pr-checks.sh --tree-only --base origin/main -> all 16 check(s) green, 2 skipped, 0 could not be told (the 2 skips are the gpu-kernels rows, no checkout here). Not verified: a boot of a v2026.49+ image carrying #3438 (the PASS branch above is the helper's output plus the verdict, and the self-test; no image with the fix has been booted), and no hardware eviction was observed - that is issue #3437's closure criterion, not this row's.
…o, and draft the freeze RFC (engine#3448) Security review (cl-flm lane, 24 Nov). Issue #3448 has two halves. The rollback half is fixed by #3454 (69bb03f): --latest reads the release identity from inside the verified image and refuses anything that is not the tag asked for and strictly newer. The freeze half is open, and it is a release-trust decision (CONTRIBUTING.md: anything touching security is an RFC), so this commit does NOT invent a fix for it: it stops the tool from claiming the freshness it cannot prove, and puts the decision on record. Rebased onto origin/main a95beca (after #3465/#3466/#3467); the line references below are that tree's. The mechanism, as it stands (os/v3/puppy/embed/usr/local/bin/1bit-update): - update_pick decides which release is the channel's newest and whether it is newer than the running one, from GitHub's release list (:257-302). That list is not signed; the first signature is checked at :453-455, after the "is it newer" decision, and the early exit says "up to date" without checking any signature (:430-438). So a release host that keeps serving the current release also keeps the machine answering "up to date" (freeze). What changed: - update_pick prints ahead=yes when the RUNNING release is newer than the channel's newest (a final against its own -rcs, or a channel that has not caught up), which used to be folded into newer=no (:291-295). - update_check and update_latest answer that case "up to date: running X is newer than the CHANNEL's newest Y" and print one note that the answer is the unsigned release list's word, so a host that hides a newer release is not detectable (:328-336, :430-438). A plain "up to date" line is kept for the same-tag case, so the console, the notice and the board rows keep reading it. - docs/update-trust.md (new): what the signature covers today (tools/release_sign.py), the exact order --latest decides in with file:line, what #3454 closed and what it leaves open, the freeze threat model (adversaries, in/out of scope, P1-P3), and the draft RFC body: options A (signed, expiring latest per channel reusing release_sign.py), B (TUF-style metadata), C (signed tag -> commit), D (tag+channel in the signed SHA256SUMS), E (accept the risk), each with its trust assumptions and cost, the test plan and the NOTICE impact, and the open owner questions. - docs/os-v3.md, "In-system updates": a paragraph after the trust order saying what the order does not prove - freeze, with the release-list/commit/rollback facts - and pointing at the draft. - tests/update_check_test.sh: two arms (the ahead wording, the note), and the existing "a final release sorts after its own release candidates" arm now asserts the ahead wording, which is what the tool says there now. os/mini/release-check.sh --self-test gains that same output as a PASS fixture, so the update-check row still recognises the answer on the board. What remains open, and is the RFC's first question: is a compromised release host (freeze) in the threat model? If yes, option A is the recommendation; if no, record that in docs/os-v3.md and close #3448. No code in this commit closes it - the honest wording says exactly that. Evidence: - Control (new test, PRE-FIX updater from origin/main a95beca): c=~/.cache/scratch-3448/control; mkdir -p $c/tests $c/os/v3/puppy/embed/usr/local/bin git show origin/main:os/v3/puppy/embed/usr/local/bin/1bit-update > $c/os/v3/puppy/embed/usr/local/bin/1bit-update cp tests/update_check_test.sh $c/tests/ (cd $c && sh tests/update_check_test.sh) FAIL a final release sorts after its own release candidates (v2026.49 > v2026.49-rc1) FAIL a running release newer than the channel's newest is said as ahead, not as a flat 'up to date' FAIL the up-to-date answer names the unsigned release list it rests on, and what that cannot detect update_check_test: FAIL - Branch: sh tests/update_check_test.sh -> "update_check_test: ok" (12 arms). - Sanity: the same control tree with origin/main's own test and updater -> "update_check_test: ok" (only the arms this change adds or re-words differ). - ctest --test-dir build -R 'update|release_check_selftest|release_sign' --output-on-failure --timeout 600: "100% tests passed, 0 tests failed out of 12" (update_e2e_loop skipped: needs root/loop, unchanged). - scripts/pre-pr-checks.sh --tree-only --base origin/main: "pre-pr-checks: all 15 check(s) green, 3 skipped, 0 could not be told, 2 open-PR row(s) not run (--tree-only)"; skips: submodule_pin (0 submodules initialised), hip_f16_audit and kernel_id_selftest (no gpu-kernels tree). Refs #3448.
…o, and draft the freeze RFC (engine#3448) (#3474) Security review (cl-flm lane, 24 Nov). Issue #3448 has two halves. The rollback half is fixed by #3454 (69bb03f): --latest reads the release identity from inside the verified image and refuses anything that is not the tag asked for and strictly newer. The freeze half is open, and it is a release-trust decision (CONTRIBUTING.md: anything touching security is an RFC), so this commit does NOT invent a fix for it: it stops the tool from claiming the freshness it cannot prove, and puts the decision on record. Rebased onto origin/main a95beca (after #3465/#3466/#3467); the line references below are that tree's. The mechanism, as it stands (os/v3/puppy/embed/usr/local/bin/1bit-update): - update_pick decides which release is the channel's newest and whether it is newer than the running one, from GitHub's release list (:257-302). That list is not signed; the first signature is checked at :453-455, after the "is it newer" decision, and the early exit says "up to date" without checking any signature (:430-438). So a release host that keeps serving the current release also keeps the machine answering "up to date" (freeze). What changed: - update_pick prints ahead=yes when the RUNNING release is newer than the channel's newest (a final against its own -rcs, or a channel that has not caught up), which used to be folded into newer=no (:291-295). - update_check and update_latest answer that case "up to date: running X is newer than the CHANNEL's newest Y" and print one note that the answer is the unsigned release list's word, so a host that hides a newer release is not detectable (:328-336, :430-438). A plain "up to date" line is kept for the same-tag case, so the console, the notice and the board rows keep reading it. - docs/update-trust.md (new): what the signature covers today (tools/release_sign.py), the exact order --latest decides in with file:line, what #3454 closed and what it leaves open, the freeze threat model (adversaries, in/out of scope, P1-P3), and the draft RFC body: options A (signed, expiring latest per channel reusing release_sign.py), B (TUF-style metadata), C (signed tag -> commit), D (tag+channel in the signed SHA256SUMS), E (accept the risk), each with its trust assumptions and cost, the test plan and the NOTICE impact, and the open owner questions. - docs/os-v3.md, "In-system updates": a paragraph after the trust order saying what the order does not prove - freeze, with the release-list/commit/rollback facts - and pointing at the draft. - tests/update_check_test.sh: two arms (the ahead wording, the note), and the existing "a final release sorts after its own release candidates" arm now asserts the ahead wording, which is what the tool says there now. os/mini/release-check.sh --self-test gains that same output as a PASS fixture, so the update-check row still recognises the answer on the board. What remains open, and is the RFC's first question: is a compromised release host (freeze) in the threat model? If yes, option A is the recommendation; if no, record that in docs/os-v3.md and close #3448. No code in this commit closes it - the honest wording says exactly that. Evidence: - Control (new test, PRE-FIX updater from origin/main a95beca): c=~/.cache/scratch-3448/control; mkdir -p $c/tests $c/os/v3/puppy/embed/usr/local/bin git show origin/main:os/v3/puppy/embed/usr/local/bin/1bit-update > $c/os/v3/puppy/embed/usr/local/bin/1bit-update cp tests/update_check_test.sh $c/tests/ (cd $c && sh tests/update_check_test.sh) FAIL a final release sorts after its own release candidates (v2026.49 > v2026.49-rc1) FAIL a running release newer than the channel's newest is said as ahead, not as a flat 'up to date' FAIL the up-to-date answer names the unsigned release list it rests on, and what that cannot detect update_check_test: FAIL - Branch: sh tests/update_check_test.sh -> "update_check_test: ok" (12 arms). - Sanity: the same control tree with origin/main's own test and updater -> "update_check_test: ok" (only the arms this change adds or re-words differ). - ctest --test-dir build -R 'update|release_check_selftest|release_sign' --output-on-failure --timeout 600: "100% tests passed, 0 tests failed out of 12" (update_e2e_loop skipped: needs root/loop, unchanged). - scripts/pre-pr-checks.sh --tree-only --base origin/main: "pre-pr-checks: all 15 check(s) green, 3 skipped, 0 could not be told, 2 open-PR row(s) not run (--tree-only)"; skips: submodule_pin (0 submodules initialised), hip_f16_audit and kernel_id_selftest (no gpu-kernels tree). Refs #3448. Co-authored-by: bong-water-water-bong <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Adds the release-check row engine#3437 proposed for the image half that #3438 (
77ab44b4) already ships: nothing read the file the boot step writes, so an image whose Lemonade leaves idle eviction off could go out unnoticed.Refs #3437, not Closes: this row does not close the issue. Its closure criterion is an idle NPU model evicted on a booted v2026.49+ image, and no image carrying #3438 has been booted here (see Not verified).
The bug the row is for
On 23 Nov a
Qwen3-0.6B-NPU-1bitloaded from the web UI at 21:50Z held the NPU until an unload-all at 23:44Z (~1 h 54 min). Lemonade ships idle eviction off:src/cpp/server/eviction_engine.cpp:84-91skips a model unless its recipe options carryauto_evict: true(anis_boolean()test at:87, so a string"true"is ignored), andsrc/cpp/resources/defaults.json:11has"auto_evict": false— soevict_idle_timeout(300 s,:93) is never consulted.#3438's fix is in the image:
/usr/local/bin/1bit-npu-idle-evictwrites{"auto_evict": true, "evict_idle_timeout": 600}under Lemonade's canonical ids for every onebit NPU model, and10lemonade:164-165runs it before lemond. Nothing read that file, so the next regression in it would only be caught by a person noticing the NPU stayed busy.Change — one file,
os/mini/release-check.shnpu_idle_evict_verdict(:1244) reads the catalogue (+user_models.json) and/data/lemonade/config/recipe_options.json— or the/var/lib/lemonadefallback — the way lemond does. Its NPU test and canonical-id resolution are the boot step's own, kept identical on purpose; the self-test also drives the real1bit-npu-idle-evictand asserts it leaves exactly what the row passes, so the row and the boot step cannot drift into two definitions.auto_evict: true, each model's effective timeout printed.auto_evicton, Lemonade falls back to 300 s and the model is still evicted — but the effective value is printed, so a 24 h one is visible./opt/1bit-package(the v3 appliance, board or VM); no hardware needed. The os/mini artifact SKIPs with the gap named (it starts lemond fromos/mini/init.shand has no such step), so a green os/mini VM does not read as "checked".--self-test+19 (15 check arms, 4 named assertions): the 23 Nov box's own shape (the user entry only, no NPU entry) FAILs and names both NPU models; the helper's output on the same catalogue PASSes; a person-set 1200 s is reported, not failed;auto_evictfalse, the string"true", a non-object entry, a missing file, non-JSON and an array FAIL; an un-migrated bare key and Lemonade's 300 s default PASS; a GPU onebit model and the Windows-onlyryzenai-llmentry are not demanded; a user model withonebit_backend: npuis required and its missing entry FAILs.Control
The box (
1bit-os) still runs the pre-fix v2026.49-rc1 image:/etc/init.d/10lemonadeis the 23 Nov 17:56 cut, 0 references tonpu-idle-evict, and/usr/local/bin/1bit-npu-idle-evictis absent. Its catalogue (/opt/1bit-package/bin/resources/server_models.json, sha25642d7e805a05a3239fd49daaf6b55d7634860565dc5861e822983960ffae9022b) is the rc1 cut on disk here, and its live config is the 23 Nov shape:Before — the row block from this tree, verbatim, on that box (reads two files; no Lemonade call, no device):
and with
LEMDIR=/opt/lemonade(the os/mini artifact):After — on a copy of that same config, the shipped boot step (#3438's helper, unchanged in this tree):
The user entry is unchanged (value-for-value; the helper re-serialises the file) and no entry is removed.
Self-test: 266 ok / 0 FAIL under
bash,dash(/bin/sh) andbusybox sh;origin/main(1bb46320) is 247 ok / 0, so +19.Gate
The 2 skips are
hip_f16_auditandkernel_id_selftest, with their own environment reason (no gpu-kernels checkout here).--tree-onlyis also green (16/0/0, the two open-PR rows not run by that mode).Not verified
Review risk
/opt/1bit-package, so PR CI (ctestrelease_check_row=--self-test) never runs it against an image: this is a release/board-time catch, as intended, not a PR-time one.auto_evict: true; a differentevict_idle_timeoutis reported, not failed (a person may set it; any positive value still evicts). The shipped 600 s is pinned in the self-test by driving the real helper.auto_evictor deleted an NPU entry via the options API, the row can FAIL although the model does evict (or will be set at the next boot); the FAIL text says which case it is.Refs #3437