Skip to content

package: ship llama-perplexity, and prove provenance before localizing - #563

Merged
bong-water-water-bong merged 1 commit into
mainfrom
1bit/package-ship-perplexity
Oct 25, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
1bit/package-ship-perplexity

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

The package stage cannot run on a release build after #556. Two independent blockers, both in scripts/package-linux.sh:

1. #556 requires a tool it never stages. pack_require_tools (line ~103) demands llama-server llama-bench llama-perplexity, but put only stages the first two, so every run dies with
missing from the package: hrx/llama/bin/llama-perplexity. The build does make it — cmake/hrx.cmake builds all
three — and #556's pack_localize gives it $ORIGIN RUNPATHs and libllama-perplexity-impl.so. Fix: stage it too.

2. The provenance check can never pass where it is. pack_require_provenance compares each staged file byte for
byte with $build/$rel, and it is called after pack_localize, which rewrites every RUNPATH with patchelf and
copies libomp.so in from TheRock. So it reports every ELF as differs from the build being packaged (and libomp as
not in the build). Fix: run it before pack_localize, where the staged files are still the build's own bytes.

Proved against the release build (engine e7d64b8, strixhalo): scripts/package-linux.sh <build> /tmp/out exits
0, hrx/llama/bin ships 27 files including llama-server, llama-bench, llama-perplexity and
libllama-perplexity-impl.so, the three sealed NPU sets are packed, and #556's own load check prints no
"cannot load" line. Before the change, the stage failed one line earlier on the missing tool.

python3 tools/copyright.py --check rc=0. Release-blocking for the v2026.43 candidate: the e7d64b8 tree is otherwise
green (hw-gate 20/20, 1bit.check both ways, vmtest + vmtest-release PASS, binary drop PASS), and only package needs to
re-run after this merges.

🤖 Generated with Claude Code

Two blockers in the package stage after #556, both fatal for the release build:

- #556's load check requires hrx/llama/bin/llama-perplexity, but `put` never staged it, so every package
  run died with "missing from the package". The build makes it (cmake/hrx.cmake builds llama-server,
  llama-bench and llama-perplexity) and #556's localization gives it $ORIGIN RUNPATHs and its
  libllama-perplexity-impl.so, so stage it like the other two tools.
- pack_require_provenance compares each staged file byte for byte with the same path under the build, and
  #556 called it after pack_localize - which rewrites every RUNPATH with patchelf and copies libomp.so in.
  Nothing can match after that, so the check failed on every file. Run it before pack_localize, where the
  staged copies are still the build's own bytes (and libomp.so is not there yet).

Proved on the release build (engine e7d64b8, strixhalo): scripts/package-linux.sh exits 0, hrx/llama/bin
ships 27 files with llama-server, llama-bench and llama-perplexity, the three sealed NPU sets, and no
"cannot load" line from #556's own check.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

556 - Partially compliant

Compliant requirements:

  • The implementation library for llama-perplexity is now built and included in the package
  • The stage refuses to ship programs whose NEEDED libraries do not resolve
  • The resolve check runs with plain ldd without LD_LIBRARY_PATH
  • The package no longer ships binaries that fail at first use

Non-compliant requirements:

  • None

Requires further human verification:

  • None
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incorrect Provenance Check Timing

The provenance check pack_require_provenance is moved before pack_localize to ensure that staged files are compared against the build tree before RUNPATHs are rewritten. This is necessary because pack_localize rewrites RUNPATHs and copies libomp.so from TheRock, which would cause the byte comparison to fail even for valid files.

# Everything staged has to come from the build being packaged. This compares bytes with the same path under the
# build, so it runs before pack_localize: localization rewrites every RUNPATH (and adds libomp.so, which the build
# does not have), after which nothing would match.
provenance_bad=$(pack_require_provenance "$stage" "$build" || true)
[ -z "$provenance_bad" ] || { echo "files that did not come from this build:"; echo "$provenance_bad"; exit 1; }
Missing Tool Staging

The put function call for hrx/llama/bin is updated to include llama-perplexity in addition to llama-server and llama-bench. This ensures that the llama-perplexity binary is staged and available for the provenance check and tool requirement verification.

put hrx/llama/bin llama-server llama-bench llama-perplexity

@bong-water-water-bong
bong-water-water-bong merged commit 2500bae into main Oct 25, 2026
8 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/package-ship-perplexity branch October 25, 2026 06:31
bong-water-water-bong pushed a commit that referenced this pull request Oct 25, 2026
… comment

Rebased onto main (0d0c846) and reviewed against the current packaging, image and release check
(#556, #563, #569):

- docs/releases.md conflicted on the pins table and the NPU paragraph: the branch put the private
  repositories' names back into a public file ("gpu-kernels (private, HIP)", "npu-kernels (private,
  signed)", "npu-runtime (private)"), which main had scrubbed. Resolved keeping main's wording
  ("private kernel add-on (HIP)", "private NPU kernel set (signed)", "private NPU runtime") and the
  new shape.
- scripts/weekly.sh package_checks: the set's manifest is now derived from `rel` once, instead of
  rebuilding the path with `${f%/npu/kernels/*}` plus `cut` (which can leave a double slash). Checked
  that the derived path resolves for <pkg>/npu/kernels/<set>/<id>/layer1.elf.
- os/mini/init.sh: comment wrapped.

Not marked ready: the package stage stages nothing against the pins in this tree (see the PR comment).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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