Skip to content

Upgrade llama.cpp from b9957 to b9959 and expose build info#327

Merged
bernardladenthin merged 2 commits into
mainfrom
claude/update-b9959-s56dot
Jul 11, 2026
Merged

Upgrade llama.cpp from b9957 to b9959 and expose build info#327
bernardladenthin merged 2 commits into
mainfrom
claude/update-b9959-s56dot

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

  • Upgrade pinned llama.cpp version from b9957 to b9959 across CMakeLists.txt, README.md, and CLAUDE.md
  • Add new LlamaCppVersion Java 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 library
  • Add LlamaModel.getLlamaCppBuildInfo() JNI getter that returns the linked native build identifier (e.g., "b9959-0badc06ab") from llama.cpp's own build-info
  • Add NativeLibraryLoadSmokeTest.nativeBuildInfoMatchesPinnedVersionConstant() test that cross-checks the compile-time constant against the linked binary, catching version-bump mistakes where GIT_TAG and LLAMA_CPP_VERSION drift apart
  • Update version-bump documentation to include the new LlamaCppVersion.java file in the upgrade checklist

Test plan

  • LlamaCppVersionTest validates the constant is present and well-formed (^b\d+$)
  • LlamaCppVersionTest verifies the class is not instantiable (private constructor)
  • NativeLibraryLoadSmokeTest.nativeBuildInfoMatchesPinnedVersionConstant() confirms the linked build-info starts with the pinned tag, failing the build if they drift
  • CI is green on this branch

Related issues / PRs

Refs the "Upgrading/Downgrading llama.cpp Version" checklist in CLAUDE.md

Checklist

  • I have read CONTRIBUTING.md and CODE_OF_CONDUCT.md
  • My commits follow Conventional Commits
  • No security-sensitive changes

https://claude.ai/code/session_01LfSEooCypb6V8TY9ibp3k7

claude added 2 commits July 11, 2026 07:06
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
@bernardladenthin bernardladenthin merged commit 2797f96 into main Jul 11, 2026
9 of 14 checks passed
@bernardladenthin bernardladenthin deleted the claude/update-b9959-s56dot branch July 11, 2026 07:28
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants