Skip to content

release-check: find the NPU sets where os/v3 ships them, in both manifest schemes - #3292

Merged
bong-water-water-bong merged 1 commit into
mainfrom
release-check/npu-sets-in-payload
Nov 22, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
release-check/npu-sets-in-payload

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Part of #3287 (release-check rows 1 and 2 of 5).

Why: v2026.47 ships its NPU sets inside the payload (<engine dir>/npu/kernels, a real directory) with a signed manifest (manifest, npumanifest 2) and no layout.json. sealed and npu-kernels-beside-engine only looked for layout.json under /data/npu/kernels, so both failed on a boot whose NPU chat ran at ~98 tok/s.

Change:

  • npu_engine_dir / npu_set_dirs / npu_sets_root: the set root is the payload's npu/kernels when it holds sets, else /data/npu/kernels; a set is any directory with a manifest of either scheme (or the dev shape's layout.json).
  • sealed: the 1BPKCRYP rule only for format-1 sets (signed-manifest sets ship plain ELFs by design: integrity, not secrecy); the manifest check (seal_manifest_problems, both schemes) and the build-tree check for every set.
  • npu-kernels-beside-engine: PASS when the sets ship in the payload beside the engine; the symlink logic stays for /data layouts.
  • sealed-sig: SKIP with the reason when only signed-manifest sets exist (it used to PASS with "0 verified").
  • --self-test: three cases for the discovery (payload root wins, a signed-manifest set without layout.json is one set, fallback to /data).

Measured:

  • installed v2026.47 box: npu-kernels-beside-engine PASS (2 sets); sealed FAIL on 30 kernel build-tree entries that the Qwen3-0.6B set shipped with. That was a real leak; the release files were rebuilt without them and republished.
  • clean payload: both sets verify against their manifests, no build tree.
  • sh -n clean, --self-test rc 0.

🤖 Generated with Claude Code

…fest schemes (engine#3287)

v2026.47 ships its NPU sets INSIDE the payload (<engine dir>/npu/kernels, a real directory) and signs them
with a signed manifest (manifest, first line 'npumanifest 2') that carries no layout.json. sealed and
npu-kernels-beside-engine looked only at /data/npu/kernels for layout.json, so they failed on a boot whose
NPU chat passed at ~98 tok/s. Now: one helper finds the set root (in the payload beside the engine, else
/data/npu/kernels) and treats any directory with a manifest of either scheme as a set; sealed checks the
1BPKCRYP rule only for format-1 sets (signed-manifest sets ship plain ELFs by design) and keeps the
manifest and build-tree checks for both; npu-kernels-beside-engine passes when the sets ship in the
payload; sealed-sig skips, rather than passing over nothing, when only signed-manifest sets are present.

Measured: on the installed v2026.47 box npu-kernels-beside-engine PASSes (2 sets) and sealed now FAILs on
the 30 kernel build-tree entries the 0.6B set had shipped with (removed from the republished release); on
the clean payload both sets verify against their manifests and the root has no build tree. --self-test
gains three cases for the set discovery.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

3287 - Partially compliant

Compliant requirements:

  • Release tooling
  • Stale release-check rows: sealed and npu-kernels-beside-engine look for the older kernel-set layout and fail on a v2026.47 system whose NPU chat passes at about 98 tok/s. Teach both rows the signed-manifest sets that release: ship the signed-manifest NPU kernel sets, and keep the sealed ones working (engine#3237) #3278 ships.
  • npu-kernels-beside-engine: should pass when the sets ship in the payload beside the engine
  • sealed: should handle signed-manifest sets (with manifest, npumanifest 2) correctly, not only layout.json
  • sealed-sig: should skip when only signed-manifest sets exist (it used to PASS with "0 verified")

Non-compliant requirements:

  • (none)

Requires further human verification:

  • (none)
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incorrect set detection logic

The logic for detecting sets in npu_set_dirs may incorrectly identify directories as sets if they contain any file named layout.json, manifest, or manifest.json. This could lead to false positives if these files exist in subdirectories or are not actually part of a valid set structure. The check should ensure that the manifest files are at the root of a set directory.

find "$1" -mindepth 2 -maxdepth 2 -type f \( -name layout.json -o -name manifest -o -name manifest.json \) 2>/dev/null |
    sed 's|/[^/]*$||' | sort -u
Potential race condition in set root detection

The npu_sets_root function relies on the existence of a directory and its contents to determine the set root. If the directory structure changes between the check for existence and the check for set directories, it could lead to inconsistent behavior. This is particularly relevant in a multi-process environment or during system updates.

if [ -d "$_ed/npu/kernels" ] && [ ! -L "$_ed/npu/kernels" ] && [ -n "$(npu_set_dirs "$_ed/npu/kernels")" ]; then
    printf '%s\n' "$_ed/npu/kernels"
else
    printf '%s\n' "${NPU_SETS_DIR:-/data/npu/kernels}"
fi

@bong-water-water-bong
bong-water-water-bong enabled auto-merge (squash) November 22, 2026 07:36
@bong-water-water-bong
bong-water-water-bong merged commit bdaed32 into main Nov 22, 2026
11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the release-check/npu-sets-in-payload branch November 22, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant