Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .agents/docs/2026-10-24-project-template-checkpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Runnable project template checkpoint

The existing ggml-org.llamacpp identity is retained. Package b10069.3 follows the existing upstream b10069 plus one packaging revision; no existing release or index hash is rewritten.

The default cpu template uses the fully qualified self.name and self.version dependency. It initializes the actual CPU backend with no model download. With a local GGUF path it loads the model, creates a context, decodes and samples. Resource cleanup is explicit and scoped.

The template test uses the actual mcpp package renderer and verifies the emitted dependency before substituting the staged candidate source. It then compiles and runs the generated program. Both the no-argument flow and a pinned 19 MB GGUF inference flow passed locally on LLVM 23.1.3 (sampled token 471).

A fresh path consumer revealed missing generated build inputs that earlier install-time materialization had hidden. The four stable generated inputs are now checked in verbatim from generated_files, with tools/generate_build_files.py --check guarding drift. Feature-specific Metal/Vulkan generation still uses the build output. Current libc++ also exposed missing standard includes in upstream source; two scoped wrapper compile-flag rules provide cstdlib/cerrno without patching upstream.

mcpp is pinned to 2026.10.21.1. The root package built under LLVM 23.1.3 and all 116 existing unit/repository/build-helper checks passed with LLAMACPP_REQUIRE_BUILD_HELPER=1. Native CPU CI now additionally executes the real template with the existing checksummed model. No merge or release is performed by this checkpoint.

Native CI exposed an existing exact-version conflict: [email protected] requires [email protected] while this wrapper directly requested 2026.09.07. The direct pin is aligned to 2026.09.11 rather than linking or mangling two copies of a runtime with no module. Evidence: job 120654792434.

The native ARM64 job decoded correctly, but its old static-file-label check rejected the current engine-managed glibc loader. The check now inspects actual PT_INTERP and the loader-reported complete dependency closure: static remains accepted, dynamic is accepted only when loader and every resolved library belong to the declared isolated registry. Any system-library escape fails. This retains the no-host-runtime invariant and architecture check without changing the engine or skipping inference.

The next Vulkan CI passed compilation but strict mode exposed static adapter/header anchors shared between program and multiple DSOs. The actual provider defaults are fixed in index commit a4130c75a49c6e9df03690743467696ef81d3a19, and only the Vulkan CI job checks out that exact candidate index and routes compat through it. This tests the paired change without merging the index or weakening --strict.
8 changes: 8 additions & 0 deletions .agents/docs/2026-10-25-unified-mwrap-checkpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Unified mwrap first release

Package/module: `mcpplibs.mwrap.llamacpp`; upstream version: `b10069`.

This checkpoint migrates wrapper identity while retaining upstream API names and SDK sources.
Default README is English with a mandatory Chinese counterpart; original section order is preserved.
Validation and release evidence are recorded in the PR and the index ecosystem ledger.
No old release tag or source resource is rewritten.
44 changes: 32 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ permissions:
contents: read

env:
MCPP_VERSION: "2026.9.6.3"
MCPP_VERSION: "2026.10.24.1"
MCPP_RELEASE_BASE: https://github.com/mcpp-community/mcpp/releases/download
VULKAN_INDEX_COMMIT: "a4130c75a49c6e9df03690743467696ef81d3a19"

jobs:
unit-and-import:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Mwrap identity and bilingual README contract
run: python3 tools/check_mwrap_release.py

- uses: actions/setup-python@v5
with:
python-version: "3.12"
Expand Down Expand Up @@ -45,12 +49,15 @@ jobs:
- name: Cold CPU package build
run: |
rm -rf target
python3 tools/generate_build_files.py --check
mcpp --version | grep -F "${MCPP_VERSION}"
mcpp build --strict --no-cache
- name: Unit and repository checks
env:
LLAMACPP_REQUIRE_BUILD_HELPER: "1"
run: python3 -m unittest discover -s tests/unit -p 'test_*.py' -v
- name: Actual default project template
run: python3 tools/test_template.py --toolchain [email protected]
- name: Verify vendored upstream and generated API
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -146,6 +153,10 @@ jobs:
throw "CPU pass marker missing"
}

- name: Actual template GGUF decode
shell: bash
run: python3 tools/test_template.py --run-arg "$RUNNER_TEMP/stories15M.gguf"

linux-arm64:
runs-on: ubuntu-24.04-arm
steps:
Expand Down Expand Up @@ -191,16 +202,11 @@ jobs:
test_bin=$(find target -type f -path "*/bin/cpu_decode" -print -quit)
test -x "${helper}"
test -n "${test_bin}"
for binary in "${helper}" "${test_bin}"; do
file "${binary}" | tee /tmp/file.log
grep -F "ARM aarch64" /tmp/file.log
grep -F "statically linked" /tmp/file.log
if readelf -l "${binary}" | grep -q INTERP; then
echo "PT_INTERP present in ${binary}"
exit 1
fi
echo "PT_INTERP absent in ${binary}"
done
# Current mcpp may bind a dynamic managed glibc runtime.
# Validate PT_INTERP and every loaded path, rather than assuming
# the host helper and target must both have a static file label.
python3 tools/check_native_runtime.py --home "${MCPP_HOME}" \
--arch "ARM aarch64" "${helper}" "${test_bin}"

test -f compile_commands.json
grep -F "/arch/arm/quants.c" compile_commands.json
Expand Down Expand Up @@ -273,6 +279,20 @@ jobs:
MCPP_HOME: /tmp/llamacpp-vulkan-mcpp-home
steps:
- uses: actions/checkout@v4
- name: Checkout the candidate runtime adapter metadata
uses: actions/checkout@v4
with:
repository: mcpplibs/mcpp-index
ref: ${{ env.VULKAN_INDEX_COMMIT }}
path: .candidate-index
- name: Route Vulkan dependencies through the candidate index
run: |
python3 - <<'PY'
from pathlib import Path
import json
with Path("mcpp.toml").open("a", encoding="utf-8") as manifest:
manifest.write('\n[indices]\ncompat = { path = ' + json.dumps(Path(".candidate-index").resolve().as_posix()) + ' }\n')
PY
- uses: actions/setup-python@v5
with:
python-version: "3.12"
Expand Down Expand Up @@ -423,4 +443,4 @@ jobs:
# moved to upstream's checkpoint (mcpp-index#163).
tag=$(sed -n 's/^version *= *"\(.*\)"/\1/p' mcpp.toml | head -1)
echo "release contract for tag: $tag"
python3 tools/check_release.py --tag "$tag"
python3 tools/check_release.py --tag "mwrap-$tag"
86 changes: 26 additions & 60 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,87 +1,53 @@
name: release

name: Release
on:
push:
# The tag IS the package version, which is upstream's build number
# (`b10069`), optionally with a wrapper revision (`b10069.1`) — see
# docs/upstream-update-policy.md. `v*` was the third place the old
# semantic-version scheme was written down, and it silently did not fire.
tags: ["b[0-9]*"]

tags: ["mwrap-*"]
permissions:
contents: read

jobs:
verify:
runs-on: ubuntu-24.04
publish:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
actions: read
contents: read
outputs:
mapping: ${{ steps.contract.outputs.mapping }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Check tag, upstream version and bilingual entry pages
run: python3 tools/check_mwrap_release.py --tag "$GITHUB_REF_NAME"
- name: Run complete unit suite
run: python3 -m unittest discover -s tests/unit -p 'test_*.py' -v
- name: Verify immutable release contract
id: contract
env:
GITHUB_TOKEN: ${{ github.token }}
shell: bash
run: |
set -euo pipefail
mapping=$(python3 tools/check_release.py --tag "${GITHUB_REF_NAME}" | tail -n 1)
echo "${mapping}"
echo "mapping=${mapping}" >> "${GITHUB_OUTPUT}"
- name: Require latest successful CI run for the tag commit
- name: Verify immutable upstream release mapping
run: python3 tools/check_release.py --tag "$GITHUB_REF_NAME"
- name: Require latest successful source CI
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
set -euo pipefail
output="${RUNNER_TEMP}/ci-runs.json"
downloaded=0
for attempt in 1 2 3 4 5; do
if gh api \
"repos/${GITHUB_REPOSITORY}/actions/workflows/ci.yml/runs?head_sha=${GITHUB_SHA}&per_page=100" \
> "${output}"; then
downloaded=1
break
fi
if [[ "${attempt}" -lt 5 ]]; then sleep $((attempt * 2)); fi
done
if [[ "${downloaded}" -ne 1 ]]; then
echo "failed to query CI workflow runs after 5 attempts"
exit 1
fi
python3 tools/check_ci_run.py --runs "${output}" --sha "${GITHUB_SHA}"

publish:
needs: verify
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create release notes for the immutable tag archive
gh api "repos/${GITHUB_REPOSITORY}/actions/workflows/ci.yml/runs?head_sha=${GITHUB_SHA}&per_page=100" > "$RUNNER_TEMP/ci-runs.json"
python3 tools/check_ci_run.py --runs "$RUNNER_TEMP/ci-runs.json" --sha "$GITHUB_SHA"
- name: Build immutable source asset and publish
env:
GH_TOKEN: ${{ github.token }}
RELEASE_MAPPING: ${{ needs.verify.outputs.mapping }}
shell: bash
run: |
set -euo pipefail
if gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1; then
echo "release ${GITHUB_REF_NAME} already exists; refusing to mutate it"
exit 1
version="${GITHUB_REF_NAME#mwrap-}"
repo="${GITHUB_REPOSITORY#*/}"
asset="${repo}-${version}.tar.gz"
git archive --format=tar.gz --prefix="${repo}-${version}/" "$GITHUB_SHA" > "$RUNNER_TEMP/$asset"
(cd "$RUNNER_TEMP" && sha256sum "$asset" > "$asset.sha256")
if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
echo 'Release already exists; refusing to change immutable assets'; exit 1
fi
gh release create "${GITHUB_REF_NAME}" \
--verify-tag \
--title "llama.cpp-m ${GITHUB_REF_NAME#v}" \
--notes "${RELEASE_MAPPING}"
extra=()
if [[ "$version" == *-rc* ]]; then extra+=(--prerelease); fi
gh release create "$GITHUB_REF_NAME" "$RUNNER_TEMP/$asset" "$RUNNER_TEMP/$asset.sha256" \
--repo "$GITHUB_REPOSITORY" --verify-tag --title "$repo $version" \
--notes "Module wrapper for upstream $version. New mwrap package identities become installable after mcpp-index publication; see the bilingual README for the tested support scope." "${extra[@]}"
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
.mcpp/
.xlings/
.candidate-index/
target/
generated/
generated/*
!generated/ggml_cpp.cpp
!generated/ggml-cpu_cpp.cpp
!generated/ggml_metal_device_m.m
!generated/ggml_build_info.h
compile_commands.json
__pycache__/
*.pyc
Expand Down
1 change: 1 addition & 0 deletions .xlings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"workspace":{"xim:mcpp":"2026.10.24.1"}}
Loading
Loading