Skip to content

Commit cc96254

Browse files
Merge pull request #209 from bernardladenthin/claude/inspiring-carson-D831V
Upgrade to JSpecify 1.0.0, add nullness checking, JPMS module descriptor
2 parents 982240c + 65894f6 commit cc96254

55 files changed

Lines changed: 1468 additions & 177 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,22 @@ jobs:
414414
name: jacoco-report
415415
path: target/site/jacoco/jacoco.xml
416416
if-no-files-found: ignore
417+
- name: Run PIT mutation tests
418+
run: mvn --batch-mode --no-transfer-progress test-compile org.pitest:pitest-maven:mutationCoverage -Dmaven.javadoc.skip=true
419+
- name: Extract PIT survivors
420+
if: always()
421+
run: |
422+
echo "=== PIT Survived Mutations ==="
423+
for html_file in $(find target/pit-reports -name "*.html" -type f 2>/dev/null | sort); do
424+
if grep -q "SURVIVED" "$html_file"; then
425+
echo "Found survivors in $html_file:"
426+
grep -B 2 -A 3 "SURVIVED" "$html_file"
427+
echo ""
428+
fi
429+
done
430+
- uses: actions/upload-artifact@v7
431+
if: always()
432+
with: { name: pit-reports, path: target/pit-reports/ }
417433
- name: Memory after tests
418434
if: always()
419435
run: free -h

.mvn/jvm.config

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
2+
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
3+
--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
4+
--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
5+
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
6+
--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
7+
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
8+
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
9+
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
10+
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED

.mvn/jvm.config.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2026 Bernard Ladenthin <bernard.ladenthin@gmail.com>
2+
3+
SPDX-License-Identifier: MIT

CLAUDE.md

Lines changed: 41 additions & 11 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ set(LLAMA_BUILD_APP OFF CACHE BOOL "" FORCE)
114114
FetchContent_Declare(
115115
llama.cpp
116116
GIT_REPOSITORY https://github.com/ggerganov/llama.cpp.git
117-
GIT_TAG b9442
117+
GIT_TAG b9495
118118
)
119119
FetchContent_MakeAvailable(llama.cpp)
120120

README.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
**Build:**
2-
![Java 11+](https://img.shields.io/badge/Java-11%2B-informational)
3-
![JUnit](https://img.shields.io/badge/tested%20with-JUnit4-yellow)
2+
![Java 8+](https://img.shields.io/badge/Java-8%2B-informational)
3+
![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20macOS%20%7C%20Windows%20%7C%20Android-lightgrey)
4+
[![JPMS](https://img.shields.io/badge/JPMS-modular%20JAR-25A162)](https://openjdk.org/projects/jigsaw/)
5+
![JUnit](https://img.shields.io/badge/tested%20with-JUnit6-25A162)
6+
[![JSpecify](https://img.shields.io/badge/JSpecify-1.0.0%20%40NullMarked-25A162)](https://jspecify.dev)
7+
[![NullAway](https://img.shields.io/badge/NullAway-strict%20JSpecify-25A162)](https://github.com/uber/NullAway)
8+
[![Checker Framework](https://img.shields.io/badge/Checker%20Framework-Nullness-25A162)](https://checkerframework.org)
9+
[![Error Prone](https://img.shields.io/badge/Error%20Prone-12%20patterns%20at%20ERROR-25A162)](https://errorprone.info)
10+
[![Maven Enforcer](https://img.shields.io/badge/Maven%20Enforcer-strict-25A162)](https://maven.apache.org/enforcer/)
411
[![jqwik](https://img.shields.io/badge/tested%20with-jqwik-1f6feb)](https://jqwik.net)
512
[![ArchUnit](https://img.shields.io/badge/tested%20with-ArchUnit-c71a36)](https://www.archunit.org)
613
[![SpotBugs](https://img.shields.io/badge/analyzed%20with-SpotBugs-3b5998)](https://spotbugs.github.io)
714
[![jcstress](https://img.shields.io/badge/tested%20with-jcstress-007396)](https://openjdk.org/projects/code-tools/jcstress/)
815
[![Lincheck](https://img.shields.io/badge/tested%20with-Lincheck-7F52FF)](https://github.com/JetBrains/lincheck)
916
[![vmlens](https://img.shields.io/badge/tested%20with-vmlens-ff6f00)](https://vmlens.com)
1017
[![JMH](https://img.shields.io/badge/benchmarked%20with-JMH-25A162)](https://openjdk.org/projects/code-tools/jmh/)
11-
[![llama.cpp b9442](https://img.shields.io/badge/llama.cpp-%23b9442-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b9442)
18+
[![llama.cpp b9495](https://img.shields.io/badge/llama.cpp-%23b9495-informational)](https://github.com/ggml-org/llama.cpp/releases/tag/b9495)
1219
[![Publish](https://github.com/bernardladenthin/java-llama.cpp/actions/workflows/publish.yml/badge.svg)](https://github.com/bernardladenthin/java-llama.cpp/actions/workflows/publish.yml)
1320
[![CodeQL](https://github.com/bernardladenthin/java-llama.cpp/actions/workflows/codeql.yml/badge.svg)](https://github.com/bernardladenthin/java-llama.cpp/actions/workflows/codeql.yml)
1421

1522
**Coverage:**
1623
[![Coverage Status](https://coveralls.io/repos/github/bernardladenthin/java-llama.cpp/badge.svg?branch=main)](https://coveralls.io/github/bernardladenthin/java-llama.cpp?branch=main)
1724
[![codecov](https://codecov.io/gh/bernardladenthin/java-llama.cpp/graph/badge.svg)](https://codecov.io/gh/bernardladenthin/java-llama.cpp)
1825
[![JaCoCo](https://img.shields.io/codecov/c/github/bernardladenthin/java-llama.cpp?label=JaCoCo&logo=java)](https://codecov.io/gh/bernardladenthin/java-llama.cpp)
19-
<!--
20-
PIT mutation testing is not configured for this repository.
21-
Do not add a PIT badge here unless PIT is wired into pom.xml + CI.
22-
-->
26+
[![PIT Mutation](https://img.shields.io/badge/PIT%20mutation-100%25%20(1%20class)-brightgreen)](https://github.com/bernardladenthin/java-llama.cpp/actions/workflows/publish.yml)
2327

2428
**Quality:**
2529
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=bernardladenthin_java-llama.cpp&metric=alert_status)](https://sonarcloud.io/dashboard?id=bernardladenthin_java-llama.cpp)
@@ -84,6 +88,8 @@ Inference of Meta's LLaMA model (and others) in pure C/C++.
8488
4. [Android](#importing-in-android)
8589
5. [Feature Ideas](#feature-ideas)
8690

91+
> ⚠️ **DO NOT UPGRADE jqwik past 1.9.3.** jqwik 1.10.0 added an anti-AI prompt-injection string to test stdout; the 1.10.1 user guide states the library "is not meant to be used by any 'AI' coding agents at all." 1.9.3 is the last pre-disclosure release and is the pinned version. See `CLAUDE.md` section "jqwik prompt-injection in test output" for the full context.
92+
8793
## Features
8894

8995
- Text completion (blocking and streaming) with full control over sampling parameters.
@@ -487,6 +493,10 @@ android {
487493
keep class net.ladenthin.llama.** { *; }
488494
```
489495

496+
## TODO
497+
498+
- **Expand PIT mutation-testing scope.** PIT is wired in `pom.xml` and runs on every CI build (in the `test-java-linux-x86_64` job) with `<mutationThreshold>100</mutationThreshold>`, but `<targetClasses>` is currently narrowed to a single class (`Pair`). The intent is to exercise the wiring and gate against regressions on that single class today; widen `<targetClasses>` incrementally as additional classes reach mutation-test parity. Final target: `<param>net.ladenthin.llama.*</param>` matching the streambuffer pattern.
499+
490500
## Feature Ideas
491501

492502
Forward-looking ideas being tracked for this fork:
@@ -523,6 +533,17 @@ The system's updated C++ runtime will be used instead, resolving the crash.
523533

524534
## Similar Projects / Usage
525535

536+
**Bindings / wrappers**
537+
526538
- [LLaMAndroid](https://github.com/Rattlyy/LLaMAndroid/tree/main/app) — Android app demonstrating usage of llama.cpp bindings.
527539
- [llama-stack-client-kotlin](https://github.com/ogx-ai/llama-stack-client-kotlin) — Kotlin client for the Llama Stack API.
528540
- [llama.cpp-android-tutorial](https://github.com/JackZeng0208/llama.cpp-android-tutorial) — Step-by-step tutorial for running llama.cpp on Android.
541+
- [llamacpp4j](https://github.com/sebicom/llamacpp4j) — alternative Java/JNI binding to llama.cpp (SWIG-generated facade); pre-GGUF, dormant since 2023 but historically the other Java JNI option.
542+
543+
**Pure-Java single-model inference (no JNI / no llama.cpp)** — Alfonso² Peterssen's `*.java` family of standalone, dependency-free Java inference runtimes, one per model architecture. Useful when JNI is unavailable (e.g. some sandboxes / GraalVM native-image scenarios) or when you want a single jar with no native side at all. Different design point from this project, which prioritises GGUF compatibility and llama.cpp performance via JNI.
544+
545+
- [llama3.java](https://github.com/mukel/llama3.java) — Llama 3 / 3.1 / 3.2 inference.
546+
- [gemma4.java](https://github.com/mukel/gemma4.java) — Gemma 4 (and earlier Gemma 2/3) inference.
547+
- [gptoss.java](https://github.com/mukel/gptoss.java) — GPT-OSS architecture inference.
548+
- [qwen35.java](https://github.com/mukel/qwen35.java) — Qwen 3.5 inference.
549+
- [nemotron3.java](https://github.com/mukel/nemotron3.java) — NVIDIA Nemotron-3 inference.

0 commit comments

Comments
 (0)