Upgrade llama.cpp from b9957 to b9959 and expose build info#327
Merged
Conversation
Bump the pinned llama.cpp version. The b9957...b9959 range is a two-file diff — ggml/src/ggml-cpu/arch/arm/quants.c (wraps two ARM NEON vqtbl1q_u8() table-lookup calls in the ggml_vqtbl1q_u8() helper) and scripts/sync-ggml.last (metadata). Both are inside upstream-compiled ggml-cpu translation units (ARM-only); no patch-target file (common/arg.*, tools/server/*) and no OuteTTS generator anchor (tools/tts/tts.cpp unchanged) is touched, and none of the eight priority API headers changed. All eight patches (0001-0008) apply cleanly against a fresh b9959 checkout and the OuteTTS build-time extraction matched every anchor (generated from tts.cpp @ b9959). Verified locally: FetchContent clone of b9959 + fail-loud patch apply (markers confirmed in the fetched source) + TTS extraction + clean CMake configure; full build + ctest confirmed by the CI pipeline per platform. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfSEooCypb6V8TY9ibp3k7
Adds two complementary ways to read the llama.cpp version the library was
built against, so the Android app (and any consumer) can render a badge or
log line:
- B, pure-Java constant: value.LlamaCppVersion.LLAMA_CPP_VERSION = "b9959".
A compile-time mirror of GIT_TAG, readable without the native library
(before System.load, or in a pure-Java checkout) — ideal for a UI badge.
- A, authoritative getter: LlamaModel.getLlamaCppBuildInfo() returns the
build identifier actually linked into libjllama ("b9959-0badc06ab"),
read via JNI from llama.cpp's own build-info (build-info.h is already
included and llama-common already linked, so no new include/link). It
reports the genuine build number + resolved commit and cannot drift from
the binary, but requires the native library to be loaded.
Wiring: new private static native nativeLlamaCppBuildInfo() on LlamaModel
returning env->NewStringUTF(llama_build_info()) (pure-ASCII, so NewStringUTF
is safe); the JNI declaration is added to the committed jllama.h so the
symbol keeps C linkage (a plain `mvn compile` does not regenerate the
header — header gen lives only in the classifier profiles).
Tests: LlamaCppVersionTest pins the constant's shape (^b\d+$, bump-proof)
and non-instantiability; NativeLibraryLoadSmokeTest gains a lib-guarded
test that cross-checks the constant against the linked build-info and
fails the build if GIT_TAG and the constant drift apart.
Docs: the "Upgrading llama.cpp Version" checklist (CLAUDE.md) and the
runbook (docs/upgrade/llama-cpp-version-bump.md) now list LlamaCppVersion.java
as a fourth edit point so a future bump cannot forget it.
Verified locally: mvn compile (strict Error Prone/NullAway/Checker) green;
incremental native rebuild green; nm confirms the unmangled JNI symbol;
end-to-end probe prints CONSTANT=b9959 / NATIVE=b9959-0badc06ab;
LlamaCppVersionTest + NativeLibraryLoadSmokeTest 4/4 pass; javadoc:jar green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfSEooCypb6V8TY9ibp3k7
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
LlamaCppVersionJava class exposing the compile-time llama.cpp version constant (LLAMA_CPP_VERSION = "b9959") for use in version badges and startup logs without loading the native libraryLlamaModel.getLlamaCppBuildInfo()JNI getter that returns the linked native build identifier (e.g.,"b9959-0badc06ab") from llama.cpp's ownbuild-infoNativeLibraryLoadSmokeTest.nativeBuildInfoMatchesPinnedVersionConstant()test that cross-checks the compile-time constant against the linked binary, catching version-bump mistakes whereGIT_TAGandLLAMA_CPP_VERSIONdrift apartLlamaCppVersion.javafile in the upgrade checklistTest plan
LlamaCppVersionTestvalidates the constant is present and well-formed (^b\d+$)LlamaCppVersionTestverifies the class is not instantiable (private constructor)NativeLibraryLoadSmokeTest.nativeBuildInfoMatchesPinnedVersionConstant()confirms the linked build-info starts with the pinned tag, failing the build if they driftRelated issues / PRs
Refs the "Upgrading/Downgrading llama.cpp Version" checklist in CLAUDE.md
Checklist
CONTRIBUTING.mdandCODE_OF_CONDUCT.mdhttps://claude.ai/code/session_01LfSEooCypb6V8TY9ibp3k7