Commit ed5a82a
committed
test(loader): add model-free native-load smoke + document the procedure
Adds NativeLibraryLoadSmokeTest: forces LlamaModel.<clinit> (System.load ->
JNI_OnLoad), which FindClass-es every JNI-referenced Java class, with no GGUF
model required. It guards the two load-time failure modes that shipped on this
branch and were invisible to a local `mvn test` (model-gated tests self-skip
before the lib loads) and to the pure-Java unit tests:
- wrong native-resource path in LlamaLoader (lib not found), and
- a stale FindClass FQN in jllama.cpp after a Java package move (lib loads
but JNI_OnLoad throws NoClassDefFoundError).
The test self-skips when libjllama is not on the classpath (pure-Java checkout,
no CMake build), so a build-less `mvn test` stays green; CI's test-java-* jobs
and any local build run it for real. Presence is checked against the canonical
/net/ladenthin/llama/<os>/<arch>/ layout directly (not via
LlamaLoader.getNativeResourcePath()) so a regression there cannot silently skip
the guard — instead the load itself fails the assertion.
Verified locally both ways: lib present -> Tests run: 1 (loads, JNI_OnLoad OK);
lib moved aside -> Skipped: 1, BUILD SUCCESS.
CLAUDE.md: documents the model-free load-verification recipe under
"Restricted-network environments" (build the lib via FetchContent — GitHub is
reachable even when huggingface.co is not — then run the smoke test), and the
rule to update jllama.cpp FindClass/signature FQNs + keep
LlamaLoader.NATIVE_RESOURCE_BASE anchored when moving a JNI-referenced class.1 parent e26e1ea commit ed5a82a
2 files changed
Lines changed: 105 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
306 | 349 | | |
307 | 350 | | |
308 | 351 | | |
| |||
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
0 commit comments