Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .claude/rules/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,16 @@ paths:
- Never use Result<> as a function argument.
- Never forward Result in enums if you can instead create a targeted error enum. It is always better to signal the specific issue, so it can be handled downstream.
- Always destructure structs in arguments if possible.

# Code Style

Imports/uses must not be mixed with other kinds of rust syntax.

Each file needs to follow this order:
1. `pub mod`/`mod` exports
2. vendor crate `use`
2. project crate `use`
3. local crate `use`
4. private function helpers
5. private struct helpers
6. single public export
11 changes: 11 additions & 0 deletions .claude/rules/subproject-llama-cpp-log-decoder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
paths:
- "llama-cpp-log-decoder/**"
---

# `llama-cpp-log-decoder` Standards

- The logging subsystem MUST NEVER panic, crash, or otherwise interrupt the program.
- Logs report issues; they must not cause them.
- No .unwrap(), .expect(), panic!(), or panic-prone indexing.
- No panic-prone slicing.
70 changes: 70 additions & 0 deletions .claude/skills/run-all-tests/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
name: run-all-tests
description: Runs every test suite in the workspace on the fastest available device. Use when the user asks to run the tests, run all the tests, run the full test suite, or check that everything still passes.
---

# Running all tests

Run every test suite in the workspace, picking the fastest compiled device backend for the host.

## Step 1: detect the device

Run this once at the start and echo the chosen device:

```bash
if [[ "$OSTYPE" == "darwin"* ]]; then
DEVICE=metal
elif command -v nvidia-smi >/dev/null 2>&1 && nvidia-smi >/dev/null 2>&1; then
DEVICE=cuda
else
DEVICE=cpu
fi
echo "Device: $DEVICE"
```

`$DEVICE` selects the backend feature for every suite in Step 2, including `test.unit`. Passing the same device through every target keeps the cmake hash stable, so llama.cpp is compiled once and reused across all suites.

## Step 2: run the suites

Sequentially, from the workspace root.

Copy this checklist and tick each item as the suite completes:

```
Test progress:
- [ ] make test.unit
- [ ] make test.qwen3.5_0.8B
- [ ] make test.qwen3.6_35b_a3b
- [ ] make test.glm4_7_flash
- [ ] make test.deepseek_r1_distill_llama_8b
```

Translate `$DEVICE` into the value the Makefile expects. `TEST_DEVICE` holds **only** the backend name (`cuda` / `metal` / `vulkan` / `rocm`), or empty for CPU since there is no `cpu` feature:

```bash
[ "$DEVICE" = "cpu" ] && FEAT= || FEAT="$DEVICE"
```

Then run exactly:

```bash
make test.unit TEST_DEVICE="$FEAT"
make test.qwen3.5_0.8B TEST_DEVICE="$FEAT"
make test.qwen3.6_35b_a3b TEST_DEVICE="$FEAT"
make test.glm4_7_flash TEST_DEVICE="$FEAT"
make test.deepseek_r1_distill_llama_8b TEST_DEVICE="$FEAT"
```

The Makefile's `$(if $(TEST_DEVICE),--features $(TEST_DEVICE),)` already skips the `--features` flag when `$FEAT` is empty, so the CPU path needs no further special-casing.

Do not run `make test.llms` or `make test`. Those bundle every LLM suite into one cargo invocation, which loses per-suite failure attribution and breaks the checklist above.

## Step 3: rules during the run

- **Serialize GPU suites.** When `$DEVICE` is `cuda` or `metal`, run test suites sequentially to avoid device contention.
- **Per-test 30 s budget.** Flag any individual test that exceeds 30 s wall-clock. That is a real bug — production or test — not flakiness.

## Step 4: report

After all suites finish, sum up the results in an actionable report.

101 changes: 6 additions & 95 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"llama-cpp-bindings-types",
"llama-cpp-bindings",
"llama-cpp-bindings-tests",
"llama-cpp-log-decoder",
]

[workspace.package]
Expand All @@ -28,14 +29,13 @@ llama-cpp-bindings = { path = "llama-cpp-bindings", version = "=0.6.0" }
llama-cpp-bindings-build = { path = "llama-cpp-bindings-build", version = "=0.6.0" }
llama-cpp-bindings-sys = { path = "llama-cpp-bindings-sys", version = "=0.6.0" }
llama-cpp-bindings-types = { path = "llama-cpp-bindings-types", version = "=0.6.0" }
llama-cpp-log-decoder = { path = "llama-cpp-log-decoder", version = "=0.6.0" }
llguidance = "=1.7.0"
log = "=0.4.29"
nom = "=8.0.0"
serde = { version = "=1.0.228", features = ["derive"] }
serde_json = "=1.0.149"
serial_test = "=3.4.0"
thiserror = "=2.0.18"
toktrie = "=1.7.0"
tracing = "=0.1.44"
tracing-core = "=0.1.36"
tracing-subscriber = { version = "=0.3.23", features = ["json"] }
walkdir = "=2.5.0"
Loading
Loading