Skip to content

Commit 856d953

Browse files
committed
feat: upgrade llama.cpp from b10878 to b10883
No project-source change, and no patch needed refreshing. The raw diff is 426 KiB -- 29 files, 2360 insertions, 2276 deletions -- which is well over the runbook's 100 KiB chunking threshold, so the decision to bump straight through is recorded rather than taken quietly. Restricting the diff to the paths this project compiles, links or includes (common/, include/, tools/server/, tools/mtmd/, ggml/include/, src/, the top-level CMakeLists.txt) leaves one file and one line: tools/server/tests/requirements.txt, a Python test-requirement pin that is neither compiled nor linked. The rest is ggml/src/ggml-vulkan/** (1804 lines in ggml-vulkan.cpp plus ~15 shaders), ggml/src/ggml-hexagon/**, tests/test-backend-ops.cpp and six Python version pins. Zero priority-8 headers moved. Same shape as the b10819..b10850 row: a headline number dominated by backends the project builds but never calls into. Every patch-target file is byte-unchanged in the range -- verified file by file, not inferred from the aggregate: common/arg.{cpp,h}, common/peg-parser.cpp, tools/server/server.cpp, tools/server/server-context.{cpp,h}, tools/server/server-models.cpp, src/llama-model.{cpp,h}, tests/CMakeLists.txt. Both standing drop-checks were still run against the pristine tag, because the fail-loud applier detects "does not apply" but never "upstream already fixed this": * 0001 -- common_params_parse_main appears 0 times in b10883:common/arg.h and the #ifdef _WIN32 argv = utf8.ptrs.data() override is still at common/arg.cpp:1282. Still required. * 0012 -- b10883:src/llama-model.cpp:1489 still normalises with a bare splits[i] /= split_sum; and carries no split_sum == 0 guard. Still required. Verified: fresh rm -rf build && cmake -B build -DBUILD_TESTING=ON through the real FetchContent path, configure clean, stamp written at head 91f6a6cf (= b10883) with all nine hashes; Release build clean; ctest 531/531; 40 Java_* exports; mvn -pl llama clean test -Dtest=NativeLibraryLoadSmokeTest 4/4, 0 skipped, including nativeBuildInfoMatchesPinnedVersionConstant; full mvn test 1759 tests, 0 failures, 0 errors. First bump whose flag contract is machine-checked instead of argued: JavaCliFlagContract re-derives the 138 flags the Java layer emits and re-runs them through common_params_parser_init(params, LLAMA_EXAMPLE_SERVER) at the new tag, so "arg.cpp is unchanged, therefore the registered option set is unchanged" is now something the build asserts rather than something a reviewer infers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AnNYn8W1xuVxVJtyL34GyH
1 parent 4467ba5 commit 856d953

5 files changed

Lines changed: 12 additions & 10 deletions

File tree

‎CLAUDE.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
Java bindings for [llama.cpp](https://github.com/ggerganov/llama.cpp) via JNI, providing a high-level API for LLM inference in Java. The Java layer communicates with a native C++ library through JNI.
88

9-
Current llama.cpp pinned version: **b10878**
9+
Current llama.cpp pinned version: **b10883**
1010

1111
## Upgrading CUDA Version
1212

@@ -502,7 +502,7 @@ needs no extra step here, `build-webui` re-reads the tag and rebuilds the matchi
502502
ships no UI):
503503
```bash
504504
# needs node/npm + network for the asset build; the embed step is plain cmake -P
505-
git clone --depth 1 --branch b10878 https://github.com/ggml-org/llama.cpp /tmp/lc
505+
git clone --depth 1 --branch b10883 https://github.com/ggml-org/llama.cpp /tmp/lc
506506
( cd /tmp/lc/tools/ui && npm ci && npm run build )
507507
mkdir -p webui-generated /tmp/ui-gen
508508
cmake -DUI_SOURCE_DIR=/tmp/lc/tools/ui -DUI_BINARY_DIR=/tmp/ui-gen \
@@ -542,7 +542,7 @@ cache lives in **Depot Cache** over sccache's **WebDAV** backend:
542542
- `SCCACHE_WEBDAV_TOKEN: ${{ secrets.DEPOT_TOKEN }}` — a Depot **organization** token, stored
543543
as the repo secret **`DEPOT_TOKEN`**.
544544

545-
Because `sccache` is **content-addressed** and llama.cpp is pinned (`GIT_TAG b10878`), the
545+
Because `sccache` is **content-addressed** and llama.cpp is pinned (`GIT_TAG b10883`), the
546546
~280 upstream object files are byte-identical every run, so a warm cache recompiles only the
547547
*changed* files. Depot's cache is **shared across all branches** (unlike GitHub's
548548
per-branch `actions/cache`), so every branch builds incrementally; a `b<nnnn>` version bump
@@ -1466,7 +1466,7 @@ ctest --test-dir build --output-on-failure -R "ResultsToJson"
14661466

14671467
#### Upstream source location (in CMake build tree)
14681468

1469-
llama.cpp is fetched via CMake FetchContent, pinned to `GIT_TAG b10878`.
1469+
llama.cpp is fetched via CMake FetchContent, pinned to `GIT_TAG b10883`.
14701470

14711471
**GoogleTest** is a separate `BUILD_TESTING`-only FetchContent (`GIT_TAG v1.17.0`), used solely
14721472
by the `jllama_test` C++ unit-test binary — not by the shipped library, and not coupled to the

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
**Build:**
1212
![Java 8+](https://img.shields.io/badge/Java-8%2B-informational)
1313
![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20macOS%20%7C%20Windows%20%7C%20Android-lightgrey)
14-
[![llama.cpp b10878](https://img.shields.io/badge/llama.cpp-%23b10878-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b10878)
14+
[![llama.cpp b10883](https://img.shields.io/badge/llama.cpp-%23b10883-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b10883)
1515
[![JPMS](https://img.shields.io/badge/JPMS-modular%20JAR-25A162)](https://openjdk.org/projects/jigsaw/)
1616
![JUnit](https://img.shields.io/badge/tested%20with-JUnit6-25A162)
1717
[![JSpecify](https://img.shields.io/badge/JSpecify-1.0.0%20%40NullMarked-25A162)](https://jspecify.dev)

‎docs/history/llama-cpp-breaking-changes.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,3 +702,5 @@ Used during `llama.cpp` version bumps: when upgrading, scan this file from the r
702702
| b10850–b10870 | patches + upstream verification | **The intersection was NOT empty, and `0012` was the patch at risk.** The range touches `src/llama-model.cpp` and `tests/CMakeLists.txt` — both files `patches/0012` modifies, one week after that patch landed — plus `common/arg.cpp` (`0001`) and `tools/server/server-context.cpp` (`0002`/`0003`/`0010`). So this bump could not be waved through on a disjoint file list. **The `0012`-specific check `CLAUDE.md` mandates was run by hand first**, because the fail-loud applier detects "does not apply" but never "upstream already fixed this": `git show b10870:src/llama-model.cpp | grep -A3 split_sum` still shows the bare `splits[i] /= split_sum` with **no zero-sum guard**, so upstream has not adopted the fix and the patch stays rather than being dropped. Upstream's own change to that file (#28160, resolving `LLAMA_LAZY_MODE_AUTO` to `OFF` on devices without mmap support) sits ~60 lines above the patched region and is unrelated. Then the applier was run for real: fresh `rm -rf llama/build && cmake -B build -DBUILD_TESTING=ON`, configure clean, stamp written at head `1945e092030f8668ff93382799502d01490e564d` (= `b10870`), **all nine hashes recorded**. |
703703
| b10870–b10878 | `common/arg.cpp` (**REMOVAL, and it reaches this project's public Java API**: the deprecated `--mlock`, `--mmap`, `--no-mmap`, `-dio`/`--direct-io`, `-ndio`/`--no-direct-io` options are deleted in favour of `-lm`/`--load-mode <auto\|none\|mmap\|mlock\|mmap+mlock\|dio>`; nothing was added — `--load-mode` already existed at b10870, so the whole deprecation window opened and closed inside a single 8-tag range), `include/llama.h` (`llama_sampler_chain_n` returns `int32_t` instead of `int` — **unreachable here**, no project TU calls it, and the two are the same type on every platform this builds for), `src/llama-model.{cpp,h}` (**additive only**: a new `LLM_TYPE_1B_A400M` enumerator for Granite3 MoE, far from `patches/0012`'s hunks), `tools/mtmd/mtmd-helper.cpp` (internal video frame-id propagation; **`mtmd-helper.h` is untouched**, so `mtmd_helper::gen_audio` and therefore `TextToSpeech` are unaffected), `src/llama-sampler.cpp`, `common/jinja/runtime.cpp`, `src/models/granite-moe.cpp`, and a ggml build-system change (`GGML_CUDA_FA_ALL_QUANTS` deprecated in favour of `GGML_CUDA_FA_QUANTS` — **not set anywhere in this repo**, so it cannot reach the CUDA/HIP jobs). 25 files, 336 insertions, 227 deletions, 50.3 KiB — under the runbook's 100 KiB chunking threshold, so bumped straight through. **The one row that needs project action is the first.** `ModelFlag.MLOCK` (`"--mlock"`) and `ModelFlag.NO_MMAP` (`"--no-mmap"`) are public constants emitted by `ModelParameters.enableMlock()` / `disableMmap()`, and `LlamaModel.loadModel(parameters.toArray())` hands that argv straight to `common_params_parse`, where an unknown option is a hard error rather than a warning — so both builder methods now produce a model load that fails. The other three removed options are not exposed here. **No test can catch this**: `ModelFlagTest` and `ModelParametersExtendedTest#testEnableMlock`/`#testDisableMmap` assert only the string mapping (`hasKey("--mlock")`), never that llama.cpp still accepts it, so they stay green while the flag is dead — the same "pins the mapping, not the contract" shape as the `getMetrics()` payload drift at b10408. Faithful replacement is `--mlock` → `--load-mode mlock` and `--no-mmap` → `--load-mode none`. **Resolved in the follow-up PR, and it did all three:** a new `args.LoadMode` enum + `ModelParameters.setLoadMode(LoadMode)` expose the replacement option properly; `enableMlock()` / `disableMmap()` are kept and `@Deprecated`, re-pointed to `LoadMode.MLOCK` / `LoadMode.NONE` — upstream's own deprecation-shim mapping, so behaviour is unchanged and no API is lost; and `ModelFlag.MLOCK` / `NO_MMAP` are removed from the enum, because leaving them would keep the broken argv reachable through `setFlag` (the same reasoning that already excluded `FLASH_ATTN`). The “no test can catch this” half was closed at the same time and generalised: `src/test/cpp/test_model_flags.cpp` drives every flag the Java layer can emit — the list generated at configure time from the Java sources by `cmake/extract-java-cli-flags.cmake` — through the real `common_params_parser_init(params, LLAMA_EXAMPLE_SERVER)` option table. Run against the pre-fix sources it named **seven** dead flags, not two: the long-dead `--dump-kv-cache` / `--hf-repo-v` / `--hf-file-v`, and `--grp-attn-n` / `--grp-attn-w`, which are *present* in `arg.cpp` at every pinned tag but `set_examples()`-scoped away from `LLAMA_EXAMPLE_SERVER` — a case a textual sweep of upstream sources is structurally blind to. |
704704
| b10870–b10878 | patches + upstream verification | **All nine patches still apply, and `0012` is still required.** The range touches two patch targets — `common/arg.cpp` (`0001`) and `src/llama-model.{cpp,h}` (`0012`) — so both were checked against the pristine tag rather than assumed. `0001`: `b10878:common/arg.cpp` still carries the `#ifdef _WIN32` count-guarded `argv = utf8.ptrs.data()` override, and `common_params_parse_main` appears **0 times** in `b10878:common/arg.h`, so upstream has still not adopted the fix. `0012`: `b10878:src/llama-model.cpp` still normalises with a bare `splits[i] /= split_sum;` and has **no `split_sum == 0` guard** of its own — the CLAUDE.md instruction to *drop rather than refresh* this patch does not fire, and its `llama-model` diff is only the new enumerator. Verified for real: fresh `cmake -S llama -B /tmp/b10878-build -DBUILD_TESTING=ON` through the real `FetchContent` path, configure clean, stamp written at head `4850c7727fa73bbe3098e10ee369fbc3467c445f` (= `b10878`) with **all nine hashes recorded**; full `cmake --build --config Release` clean; `ctest` **527/527**, including the four `LlamaModelSplits.*` cases that are the only place `0012`'s two extracted functions are linked in CI. `nm -D` on the fresh `libjllama.so` reports **40** `Java_*` exports. `mvn -pl llama clean test -Dtest=NativeLibraryLoadSmokeTest` **4/4, 0 skipped**, including `nativeBuildInfoMatchesPinnedVersionConstant` — the end-to-end proof that the four pin sites and the linked binary agree. Run with `clean`: `LLAMA_CPP_VERSION` is a compile-time constant javac inlines into the test class, and Maven's incremental compilation cannot see that dependency. |
705+
| b10878–b10883 | **Nothing on the review surface.** The raw diff is large — 29 files, 2360 insertions, 2276 deletions, **426 KiB, well over the runbook's 100 KiB chunking threshold** — and was bumped straight through anyway, for a reason that is recorded here rather than asserted: the byte count is entirely GPU backend internals and Python pins. Restricting `git diff --stat` to the paths this project actually compiles, links or includes (`common/`, `include/`, `tools/server/`, `tools/mtmd/`, `ggml/include/`, `src/`, the top-level `CMakeLists.txt`) leaves **one file, one line**: `tools/server/tests/requirements.txt`, a Python test-requirement pin that is neither compiled nor linked. The remainder is `ggml/src/ggml-vulkan/**` (1804 lines in `ggml-vulkan.cpp` plus ~15 shader files), `ggml/src/ggml-hexagon/**`, `tests/test-backend-ops.cpp`, and six `requirements*.txt` / `pyproject.toml` version pins. **Zero** priority-8 headers moved; `common/arg.h`, `common/chat.h`, `include/llama.h`, `tools/mtmd/mtmd-helper.h` are all byte-identical. This is the same shape as the b10819–b10850 row: a headline number dominated by backends the project builds but whose internals it never calls. The one thing the size *does* imply is CI cost — the Vulkan rewrite is upstream-compiled code the `vulkan-linux-*` and `vulkan-windows-*` classifier jobs must still build, so a compile break there would surface in those jobs rather than in any project source. |
706+
| b10878–b10883 | patches + upstream verification | **All nine patches apply, and not one needed refreshing — every patch-target file is byte-unchanged in the range.** Checked file by file rather than inferred from the aggregate: `common/arg.cpp`, `common/arg.h`, `common/peg-parser.cpp`, `tools/server/server.cpp`, `tools/server/server-context.{cpp,h}`, `tools/server/server-models.cpp`, `src/llama-model.{cpp,h}` and `tests/CMakeLists.txt` all report no diff between the two tags. The two standing drop-checks were still run against the pristine tag, because the fail-loud applier detects "does not apply" but never "upstream already fixed this": `0001` — `common_params_parse_main` appears **0 times** in `b10883:common/arg.h` and the `#ifdef _WIN32` `argv = utf8.ptrs.data()` override is still at `common/arg.cpp:1282`, so it stays; `0012` — `b10883:src/llama-model.cpp:1489` still normalises with a bare `splits[i] /= split_sum;` and has **no `split_sum == 0` guard**, so the CLAUDE.md instruction to *drop rather than refresh* does not fire. Verified for real: `rm -rf build && cmake -B build -DBUILD_TESTING=ON` through the real `FetchContent` path, configure clean, stamp written at head `91f6a6cf361385700bbe15981f0f39909df77498` (= `b10883`) with **all nine hashes recorded**; full `cmake --build --config Release` clean; `ctest` **531/531**. That total is 4 up from b10878 because this is the first bump after `test_model_flags.cpp` landed — and it is the first bump whose **flag contract** was machine-checked rather than reasoned about: `JavaCliFlagContract` re-derives the 138 flags the Java layer emits and re-runs them through `common_params_parser_init(params, LLAMA_EXAMPLE_SERVER)` at the new tag, so "`arg.cpp` is unchanged, therefore the registered option set is unchanged" is now an assertion the build makes, not an inference a reviewer makes. `nm -D` on the fresh `libjllama.so` reports **40** `Java_*` exports. `mvn -pl llama clean test -Dtest=NativeLibraryLoadSmokeTest` **4/4, 0 skipped**, including `nativeBuildInfoMatchesPinnedVersionConstant` — the end-to-end proof that the four pin sites and the linked binary agree (`clean` is required: javac inlines `LLAMA_CPP_VERSION` into the test class and Maven's incremental compile cannot see that dependency). Full `mvn test`: **1759 tests, 0 failures, 0 errors**. |

‎llama/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ set(LLAMA_BUILD_APP OFF CACHE BOOL "" FORCE)
173173
FetchContent_Declare(
174174
llama.cpp
175175
GIT_REPOSITORY https://github.com/ggerganov/llama.cpp.git
176-
GIT_TAG b10878
176+
GIT_TAG b10883
177177
PATCH_COMMAND ${CMAKE_COMMAND}
178178
-DPATCH_DIR=${CMAKE_CURRENT_SOURCE_DIR}/patches
179179
-DLLAMA_SRC=<SOURCE_DIR>

‎llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@
1010
* library was compiled against, exposed as a compile-time constant so callers can render a badge or
1111
* emit a startup log line without loading the native library.
1212
*
13-
* <p>{@link #LLAMA_CPP_VERSION} is a pure-Java string ({@code "b10878"}) that mirrors the
13+
* <p>{@link #LLAMA_CPP_VERSION} is a pure-Java string ({@code "b10883"}) that mirrors the
1414
* {@code GIT_TAG} in {@code llama/CMakeLists.txt}. It is available even when {@code libjllama} is
1515
* absent (pure-Java checkout, before {@code System.load}), which is what makes it suitable for a
1616
* lightweight version badge in Android or other UIs.</p>
1717
*
1818
* <p>For the <em>authoritative</em> value that is baked into the native binary — the build number
19-
* plus the resolved upstream commit, e.g. {@code "b10878-<commit>"} — call
19+
* plus the resolved upstream commit, e.g. {@code "b10883-<commit>"} — call
2020
* {@link net.ladenthin.llama.LlamaModel#getLlamaCppBuildInfo()} instead; that reads llama.cpp's own
2121
* {@code build-info} through JNI and therefore cannot drift from the compiled library (but requires
2222
* the native library to be loaded).</p>
2323
*/
2424
public final class LlamaCppVersion {
2525

2626
/**
27-
* The pinned llama.cpp release tag this library was built against, e.g. {@code "b10878"}.
27+
* The pinned llama.cpp release tag this library was built against, e.g. {@code "b10883"}.
2828
*
2929
* <p>Kept in lockstep with {@code GIT_TAG} in {@code llama/CMakeLists.txt} — see the
3030
* "Upgrading/Downgrading llama.cpp Version" checklist in {@code CLAUDE.md}. This is the
3131
* compile-time pin; use {@link net.ladenthin.llama.LlamaModel#getLlamaCppBuildInfo()} for the
3232
* value actually linked into the native binary.</p>
3333
*/
34-
public static final String LLAMA_CPP_VERSION = "b10878";
34+
public static final String LLAMA_CPP_VERSION = "b10883";
3535

3636
// Constants holder — not instantiable.
3737
private LlamaCppVersion() {}

0 commit comments

Comments
 (0)