From c357b4fc577892d2a56dd8781baa22bd14555358 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Aug 2026 08:52:31 +0000 Subject: [PATCH 1/2] Upgrade llama.cpp from b10319 to b10322 Internal GPU-backend tweaks (ggml-metal, ggml-sycl) plus a new WebUI chat-form @-mention picker feature (dominates the diff, no C++ surface). No project-source change. Configure-only verification (patches reapply clean); full build deferred to the b10327 final target. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01QyzMNtQf878jjtLc6KCxVv --- CLAUDE.md | 8 ++++---- README.md | 2 +- docs/history/llama-cpp-breaking-changes.md | 2 ++ llama/CMakeLists.txt | 2 +- .../java/net/ladenthin/llama/value/LlamaCppVersion.java | 8 ++++---- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 63180378..76c3a703 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co 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. -Current llama.cpp pinned version: **b10319** +Current llama.cpp pinned version: **b10322** ## Upgrading CUDA Version @@ -429,7 +429,7 @@ needs no extra step here, `build-webui` re-reads the tag and rebuilds the matchi ships no UI): ```bash # needs node/npm + network; embed.cpp is plain C++17 (no npm) -git clone --depth 1 --branch b10319 https://github.com/ggml-org/llama.cpp /tmp/lc +git clone --depth 1 --branch b10322 https://github.com/ggml-org/llama.cpp /tmp/lc ( cd /tmp/lc/tools/ui && npm ci && npm run build \ && ( cd dist && find . -type f -not -path './_gzip/*' \ | while read -r f; do mkdir -p "_gzip/$(dirname "$f")"; gzip -9 -c "$f" > "_gzip/$f"; done ) \ @@ -469,7 +469,7 @@ cache lives in **Depot Cache** over sccache's **WebDAV** backend: - `SCCACHE_WEBDAV_TOKEN: ${{ secrets.DEPOT_TOKEN }}` — a Depot **organization** token, stored as the repo secret **`DEPOT_TOKEN`**. -Because `sccache` is **content-addressed** and llama.cpp is pinned (`GIT_TAG b10319`), the +Because `sccache` is **content-addressed** and llama.cpp is pinned (`GIT_TAG b10322`), the ~280 upstream object files are byte-identical every run, so a warm cache recompiles only the *changed* files. Depot's cache is **shared across all branches** (unlike GitHub's per-branch `actions/cache`), so every branch builds incrementally; a `b` version bump @@ -1278,7 +1278,7 @@ ctest --test-dir build --output-on-failure -R "ResultsToJson" #### Upstream source location (in CMake build tree) -llama.cpp is fetched via CMake FetchContent, pinned to `GIT_TAG b10319`. +llama.cpp is fetched via CMake FetchContent, pinned to `GIT_TAG b10322`. **GoogleTest** is a separate `BUILD_TESTING`-only FetchContent (`GIT_TAG v1.17.0`), used solely by the `jllama_test` C++ unit-test binary — not by the shipped library, and not coupled to the diff --git a/README.md b/README.md index 8a2d7de2..644e3d75 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ **Build:** ![Java 8+](https://img.shields.io/badge/Java-8%2B-informational) ![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20macOS%20%7C%20Windows%20%7C%20Android-lightgrey) -[![llama.cpp b10319](https://img.shields.io/badge/llama.cpp-%23b10319-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b10319) +[![llama.cpp b10322](https://img.shields.io/badge/llama.cpp-%23b10322-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b10322) [![JPMS](https://img.shields.io/badge/JPMS-modular%20JAR-25A162)](https://openjdk.org/projects/jigsaw/) ![JUnit](https://img.shields.io/badge/tested%20with-JUnit6-25A162) [![JSpecify](https://img.shields.io/badge/JSpecify-1.0.0%20%40NullMarked-25A162)](https://jspecify.dev) diff --git a/docs/history/llama-cpp-breaking-changes.md b/docs/history/llama-cpp-breaking-changes.md index fe7a8142..5c4ba15e 100644 --- a/docs/history/llama-cpp-breaking-changes.md +++ b/docs/history/llama-cpp-breaking-changes.md @@ -579,3 +579,5 @@ Used during `llama.cpp` version bumps: when upgrading, scan this file from the r | b10313–b10318 | upstream verification (sandbox) | Remaining **6** patches re-verified against a clean b10318 checkout (ggml/llama.cpp commit `4cf5cab6`): fail-loud `PATCH_COMMAND` clean. **Configure-only verification per this step's process** (full build deferred to the b10319 final target). | | b10318–b10319 | `tools/mtmd/{clip-model.h,clip.cpp,mtmd-image.cpp}` (**vision-encoder (clip) image-token-limit preprocessing tweak — new `clip_hparams::set_limit_image_tokens()`**) | **No project-source change (final step of this b10310→b10319 follow-up walk).** Internal to the `clip` vision-encoder preprocessing path; not included directly by any project source file and unrelated to the Qwen3-TTS pipeline (`tts_engine.cpp` uses `mtmd_helper::gen_audio`/`mtmd_helper_bitmap_init_from_file`, not `clip`/`mtmd-image.cpp` directly). Zero diff under `common/`, `include/`, `tools/mtmd/mtmd.h`, `tools/mtmd/mtmd-helper.h`, `tools/server/*.h`, `tools/server/*.cpp`, `CMakeLists.txt`, `vendor/sheredom/subprocess.h`. | | b10318–b10319 | upstream verification (sandbox, final target) | Remaining **6** patches re-verified against a clean b10319 checkout (ggml/llama.cpp commit `4cb22cd5`): fail-loud `PATCH_COMMAND` clean. **Full local verification (mandatory for the final target):** fresh configure + full `cmake --build` (`libjllama.so` + `jllama_test` compile and link, `-O3`, no undefined references) + `ctest` **482/482 passing**. Closes the b10310→b10319 follow-up walk (3 steps: b10310→b10313→b10318→b10319). | +| b10319–b10322 | `ggml/src/{ggml-metal/ggml-metal-ops.cpp,ggml-sycl/ssm_conv.cpp}` (**GPU backend internals**), `tools/ui/**` (**new chat-form @-mention picker feature, dominates the diff**) | **No project-source change.** Zero diff under `common/`, `include/`, `tools/mtmd/mtmd.h`, `tools/mtmd/mtmd-helper.h`, `tools/server/*.h`, `tools/server/*.cpp`, `CMakeLists.txt`, `vendor/sheredom/subprocess.h`. Only 3 commits; the bulk of the diff (1854/403 lines) is a new WebUI mention-picker feature (`ChatFormMentionPicker.svelte` + supporting hooks/utils), no C++ surface. | +| b10319–b10322 | upstream verification (sandbox) | Remaining **6** patches re-verified against a clean b10322 checkout (ggml/llama.cpp commit `f8e30266`): fail-loud `PATCH_COMMAND` clean. **Configure-only verification per this step's process** (full build deferred to the b10327 final target). | diff --git a/llama/CMakeLists.txt b/llama/CMakeLists.txt index b5050fa2..d35e7f89 100644 --- a/llama/CMakeLists.txt +++ b/llama/CMakeLists.txt @@ -173,7 +173,7 @@ set(LLAMA_BUILD_APP OFF CACHE BOOL "" FORCE) FetchContent_Declare( llama.cpp GIT_REPOSITORY https://github.com/ggerganov/llama.cpp.git - GIT_TAG b10319 + GIT_TAG b10322 PATCH_COMMAND ${CMAKE_COMMAND} -DPATCH_DIR=${CMAKE_CURRENT_SOURCE_DIR}/patches -DLLAMA_SRC= diff --git a/llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java b/llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java index ff841256..138e17f3 100644 --- a/llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java +++ b/llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java @@ -10,13 +10,13 @@ * library was compiled against, exposed as a compile-time constant so callers can render a badge or * emit a startup log line without loading the native library. * - *

{@link #LLAMA_CPP_VERSION} is a pure-Java string ({@code "b10319"}) that mirrors the + *

{@link #LLAMA_CPP_VERSION} is a pure-Java string ({@code "b10322"}) that mirrors the * {@code GIT_TAG} in {@code llama/CMakeLists.txt}. It is available even when {@code libjllama} is * absent (pure-Java checkout, before {@code System.load}), which is what makes it suitable for a * lightweight version badge in Android or other UIs.

* *

For the authoritative value that is baked into the native binary — the build number - * plus the resolved upstream commit, e.g. {@code "b10319-"} — call + * plus the resolved upstream commit, e.g. {@code "b10322-"} — call * {@link net.ladenthin.llama.LlamaModel#getLlamaCppBuildInfo()} instead; that reads llama.cpp's own * {@code build-info} through JNI and therefore cannot drift from the compiled library (but requires * the native library to be loaded).

@@ -24,14 +24,14 @@ public final class LlamaCppVersion { /** - * The pinned llama.cpp release tag this library was built against, e.g. {@code "b10319"}. + * The pinned llama.cpp release tag this library was built against, e.g. {@code "b10322"}. * *

Kept in lockstep with {@code GIT_TAG} in {@code llama/CMakeLists.txt} — see the * "Upgrading/Downgrading llama.cpp Version" checklist in {@code CLAUDE.md}. This is the * compile-time pin; use {@link net.ladenthin.llama.LlamaModel#getLlamaCppBuildInfo()} for the * value actually linked into the native binary.

*/ - public static final String LLAMA_CPP_VERSION = "b10319"; + public static final String LLAMA_CPP_VERSION = "b10322"; // Constants holder — not instantiable. private LlamaCppVersion() {} From 722ff6bdef6e7053334ac2652d1552b289832068 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Aug 2026 08:58:39 +0000 Subject: [PATCH 2/2] Upgrade llama.cpp from b10322 to b10327 (final target) Closes the b10319->b10327 walk (2 steps) on this new branch, following on from the b10310->b10319 work merged as PR #381. This last step's diff is dominated by a large WebUI contenteditable chat-form rewrite (4950 lines); the one TTS-adjacent change (tools/tts/tts.cpp's reference-tool timing/logging tweak) uses an out-param that already existed on mtmd_helper::gen_audio::get_output before this range (tools/mtmd/mtmd-helper.h has zero diff across the whole range) - tts_engine.cpp's call is unaffected. Full local verification (mandatory for the final target): fresh configure + full cmake --build (libjllama.so + jllama_test compile and link, -O3, no undefined references) + ctest 482/482 passing. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01QyzMNtQf878jjtLc6KCxVv --- CLAUDE.md | 8 ++++---- README.md | 2 +- docs/history/llama-cpp-breaking-changes.md | 2 ++ llama/CMakeLists.txt | 2 +- .../java/net/ladenthin/llama/value/LlamaCppVersion.java | 8 ++++---- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 76c3a703..187f21bd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co 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. -Current llama.cpp pinned version: **b10322** +Current llama.cpp pinned version: **b10327** ## Upgrading CUDA Version @@ -429,7 +429,7 @@ needs no extra step here, `build-webui` re-reads the tag and rebuilds the matchi ships no UI): ```bash # needs node/npm + network; embed.cpp is plain C++17 (no npm) -git clone --depth 1 --branch b10322 https://github.com/ggml-org/llama.cpp /tmp/lc +git clone --depth 1 --branch b10327 https://github.com/ggml-org/llama.cpp /tmp/lc ( cd /tmp/lc/tools/ui && npm ci && npm run build \ && ( cd dist && find . -type f -not -path './_gzip/*' \ | while read -r f; do mkdir -p "_gzip/$(dirname "$f")"; gzip -9 -c "$f" > "_gzip/$f"; done ) \ @@ -469,7 +469,7 @@ cache lives in **Depot Cache** over sccache's **WebDAV** backend: - `SCCACHE_WEBDAV_TOKEN: ${{ secrets.DEPOT_TOKEN }}` — a Depot **organization** token, stored as the repo secret **`DEPOT_TOKEN`**. -Because `sccache` is **content-addressed** and llama.cpp is pinned (`GIT_TAG b10322`), the +Because `sccache` is **content-addressed** and llama.cpp is pinned (`GIT_TAG b10327`), the ~280 upstream object files are byte-identical every run, so a warm cache recompiles only the *changed* files. Depot's cache is **shared across all branches** (unlike GitHub's per-branch `actions/cache`), so every branch builds incrementally; a `b` version bump @@ -1278,7 +1278,7 @@ ctest --test-dir build --output-on-failure -R "ResultsToJson" #### Upstream source location (in CMake build tree) -llama.cpp is fetched via CMake FetchContent, pinned to `GIT_TAG b10322`. +llama.cpp is fetched via CMake FetchContent, pinned to `GIT_TAG b10327`. **GoogleTest** is a separate `BUILD_TESTING`-only FetchContent (`GIT_TAG v1.17.0`), used solely by the `jllama_test` C++ unit-test binary — not by the shipped library, and not coupled to the diff --git a/README.md b/README.md index 644e3d75..3083e362 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ **Build:** ![Java 8+](https://img.shields.io/badge/Java-8%2B-informational) ![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20macOS%20%7C%20Windows%20%7C%20Android-lightgrey) -[![llama.cpp b10322](https://img.shields.io/badge/llama.cpp-%23b10322-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b10322) +[![llama.cpp b10327](https://img.shields.io/badge/llama.cpp-%23b10327-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b10327) [![JPMS](https://img.shields.io/badge/JPMS-modular%20JAR-25A162)](https://openjdk.org/projects/jigsaw/) ![JUnit](https://img.shields.io/badge/tested%20with-JUnit6-25A162) [![JSpecify](https://img.shields.io/badge/JSpecify-1.0.0%20%40NullMarked-25A162)](https://jspecify.dev) diff --git a/docs/history/llama-cpp-breaking-changes.md b/docs/history/llama-cpp-breaking-changes.md index 5c4ba15e..b13bdced 100644 --- a/docs/history/llama-cpp-breaking-changes.md +++ b/docs/history/llama-cpp-breaking-changes.md @@ -581,3 +581,5 @@ Used during `llama.cpp` version bumps: when upgrading, scan this file from the r | b10318–b10319 | upstream verification (sandbox, final target) | Remaining **6** patches re-verified against a clean b10319 checkout (ggml/llama.cpp commit `4cb22cd5`): fail-loud `PATCH_COMMAND` clean. **Full local verification (mandatory for the final target):** fresh configure + full `cmake --build` (`libjllama.so` + `jllama_test` compile and link, `-O3`, no undefined references) + `ctest` **482/482 passing**. Closes the b10310→b10319 follow-up walk (3 steps: b10310→b10313→b10318→b10319). | | b10319–b10322 | `ggml/src/{ggml-metal/ggml-metal-ops.cpp,ggml-sycl/ssm_conv.cpp}` (**GPU backend internals**), `tools/ui/**` (**new chat-form @-mention picker feature, dominates the diff**) | **No project-source change.** Zero diff under `common/`, `include/`, `tools/mtmd/mtmd.h`, `tools/mtmd/mtmd-helper.h`, `tools/server/*.h`, `tools/server/*.cpp`, `CMakeLists.txt`, `vendor/sheredom/subprocess.h`. Only 3 commits; the bulk of the diff (1854/403 lines) is a new WebUI mention-picker feature (`ChatFormMentionPicker.svelte` + supporting hooks/utils), no C++ surface. | | b10319–b10322 | upstream verification (sandbox) | Remaining **6** patches re-verified against a clean b10322 checkout (ggml/llama.cpp commit `f8e30266`): fail-loud `PATCH_COMMAND` clean. **Configure-only verification per this step's process** (full build deferred to the b10327 final target). | +| b10322–b10327 | `tools/tts/tts.cpp` (**reference-tool timing/logging tweak — now also reports vocoder time via `get_output`'s existing optional `out_n_samples` param**), `ggml/src/ggml-cuda/cpy.cu` (**GPU backend internal**), `tools/ui/**` (**large contenteditable chat-form rewrite, dominates the diff at 4950 lines**) | **No project-source change (final step of this b10319→b10327 walk).** `tools/mtmd/mtmd-helper.h` has **zero diff** across this whole range — confirmed via a direct diff of just that file. `mtmd_helper::gen_audio::get_output`'s 4th parameter (`int64_t * out_n_samples = nullptr`) already existed before this range; `tools/tts/tts.cpp` merely started passing it (for better timing logs), it did not become newly required. `tts_engine.cpp`'s existing 3-arg `gen.get_output(&sample_rate, &data, &data_len)` call stays valid unchanged. Zero diff under `common/`, `include/`, `tools/mtmd/mtmd.h`, `tools/server/*.h`, `tools/server/*.cpp`, `CMakeLists.txt`, `vendor/sheredom/subprocess.h`. | +| b10322–b10327 | upstream verification (sandbox, final target) | Remaining **6** patches re-verified against a clean b10327 checkout (ggml/llama.cpp commit `69bf6437`): fail-loud `PATCH_COMMAND` clean. **Full local verification (mandatory for the final target):** fresh configure + full `cmake --build` (`libjllama.so` + `jllama_test` compile and link, `-O3`, no undefined references) + `ctest` **482/482 passing**. Closes the b10319→b10327 walk (2 steps: b10319→b10322→b10327), on a new branch (`claude/java-llama-cpp-b10327`) following on from the b10310→b10319 walk merged as PR #381. | diff --git a/llama/CMakeLists.txt b/llama/CMakeLists.txt index d35e7f89..4dca8b35 100644 --- a/llama/CMakeLists.txt +++ b/llama/CMakeLists.txt @@ -173,7 +173,7 @@ set(LLAMA_BUILD_APP OFF CACHE BOOL "" FORCE) FetchContent_Declare( llama.cpp GIT_REPOSITORY https://github.com/ggerganov/llama.cpp.git - GIT_TAG b10322 + GIT_TAG b10327 PATCH_COMMAND ${CMAKE_COMMAND} -DPATCH_DIR=${CMAKE_CURRENT_SOURCE_DIR}/patches -DLLAMA_SRC= diff --git a/llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java b/llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java index 138e17f3..d3fd05c6 100644 --- a/llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java +++ b/llama/src/main/java/net/ladenthin/llama/value/LlamaCppVersion.java @@ -10,13 +10,13 @@ * library was compiled against, exposed as a compile-time constant so callers can render a badge or * emit a startup log line without loading the native library. * - *

{@link #LLAMA_CPP_VERSION} is a pure-Java string ({@code "b10322"}) that mirrors the + *

{@link #LLAMA_CPP_VERSION} is a pure-Java string ({@code "b10327"}) that mirrors the * {@code GIT_TAG} in {@code llama/CMakeLists.txt}. It is available even when {@code libjllama} is * absent (pure-Java checkout, before {@code System.load}), which is what makes it suitable for a * lightweight version badge in Android or other UIs.

* *

For the authoritative value that is baked into the native binary — the build number - * plus the resolved upstream commit, e.g. {@code "b10322-"} — call + * plus the resolved upstream commit, e.g. {@code "b10327-"} — call * {@link net.ladenthin.llama.LlamaModel#getLlamaCppBuildInfo()} instead; that reads llama.cpp's own * {@code build-info} through JNI and therefore cannot drift from the compiled library (but requires * the native library to be loaded).

@@ -24,14 +24,14 @@ public final class LlamaCppVersion { /** - * The pinned llama.cpp release tag this library was built against, e.g. {@code "b10322"}. + * The pinned llama.cpp release tag this library was built against, e.g. {@code "b10327"}. * *

Kept in lockstep with {@code GIT_TAG} in {@code llama/CMakeLists.txt} — see the * "Upgrading/Downgrading llama.cpp Version" checklist in {@code CLAUDE.md}. This is the * compile-time pin; use {@link net.ladenthin.llama.LlamaModel#getLlamaCppBuildInfo()} for the * value actually linked into the native binary.

*/ - public static final String LLAMA_CPP_VERSION = "b10322"; + public static final String LLAMA_CPP_VERSION = "b10327"; // Constants holder — not instantiable. private LlamaCppVersion() {}