Skip to content

Releases

0.9.0

Choose a tag to compare

@github-actions github-actions released this 08 Nov 21:43

Changes since the last Release

chimera skips 0.8.0 to keep its version equal to llama.cpp's.

Added

  • serve binds POST /tts, upstream's new speech-generation route. Models without audio generation get 501.

Changed

  • Update llama.cpp to b12110 (v0.9.0, from b11669). common_control_vector_load now rejects direction tensors whose layer index exceeds the model's layer count.

  • Pin whisper.cpp to master f92e1e4 (from v1.9.4). b11960 inserted GGML_OP_TOP_K_MASK into enum ggml_op, and v1.9.5, the latest tag, predates it. whisper.cpp compiles against its own ggml headers but links llama.cpp's ggml, so every later op would run as the wrong op. This commit's ggml headers equal b12110's. manage.py now accepts a 40-character commit hash as a pin.

  • Update stable-diffusion.cpp to master-1067-b43ce4b (from master-929-3f8527a). generate_image now returns a result struct that sd.cpp frees itself. chimera previously freed sd.cpp's pixel buffers with its own std::free.

0.7.0

Choose a tag to compare

@github-actions github-actions released this 17 Oct 05:47

Changes since the last Release

Added

  • --moe-cache-mib N on gen, chat and serve gives the MoE experts kept on CPU a GPU cache of N MiB (upstream #29887, experimental). It needs a GPU backend. serve also gains --cpu-moe and --n-cpu-moe. The Python bindings expose the new fields. Upstream's --spec-draft-n-ubatch has no counterpart, since chimera has no speculative decoding.

  • serve --slot-save-path reads LLAMA_ARG_SLOT_SAVE_PATH when the flag is absent, as llama-server does.

  • make test covers the new upstream models when their GGUFs are in models/. d1-omni-600M and d1-3B on /v1/systemone; embeddinggemma-2 with its mmproj on --embeddings-mmproj, which previously needed CHIMERA_TEST_EMBED_VLM.

Changed

  • Update llama.cpp to b11669 (v0.7.0, from b11429). The chat API now returns the rendered prompt as template and user-input parts, and parses output from text plus tokens. Slot files may carry context-checkpoint and draft-state blocks; files saved by 0.6.0 still restore. At temperature 0 the sampler now selects greedily (#29797). Seeded temp-0 output can differ from 0.6.0.

  • serve listens on port 9931 by default, following llama-server (upstream #30159). Pass --port 8080 for the old port.

  • chat splits reasoning out of the reply by default. It uses deepseek, llama-server's default, when neither --reasoning nor --reasoning-format is given. <think> text streams in the think colour, is stored in the reasoning column under --persist, and stays out of the history sent back to the template. --reasoning none restores the 0.6.0 output. chat now drives upstream's common_chat_session per turn.

Fixed

  • chat and gen --mmproj no longer parse special tokens typed by the user. The rendered prompt was tokenized as one string with parse_special=true, so <|eot_id|> in a message became the end-of-turn token. When a user-input part contains special-token text, each part is now tokenized separately and only template parts parse specials. Other prompts tokenize as one string, as before: splitting at every part boundary changes tokens there on SPM vocabularies with add_space_prefix. serve is unchanged: upstream's server still tokenizes the joined prompt.

  • --reasoning-format had no effect on how chat parsed output. common_chat_parser_params(const common_chat_params &) does not copy parser, so the content-only fallback parser ran, and reasoning_content was never set.

  • serve pads tensor_buft_overrides as upstream's arg parser does. The list was empty, so llama_params_fit aborted with "did not provide buffer to set tensor_buft_overrides" and could not reduce --gpu-layers -1 when the model did not fit. A non-empty list also needs the null terminator, which --cpu-moe would otherwise trip in common_model_params_to_llama.

  • The gen --mmproj --image test skipped when models/ held only the Q5_K_M quant of gemma-4-E4B. It required Q4_K_M; it now accepts either.

0.6.0

Choose a tag to compare

@github-actions github-actions released this 07 Oct 03:18

Changes since the last Release

Changed

  • Update llama.cpp to b11429 (v0.6.0, from b11146). GET /v1/models entries gain an architecture object with input_modalities / output_modalities. LLAMA_STATE_SEQ_VERSION went from 3 to 4, so restoring a slot file saved with --slot-save-path before this update returns 400. Save it again.

Added

  • serve binds POST /v1/systemone, upstream's TypeSafe System One API for native decision models (laya, clef, openjev, lev, kev, nimble). It answers typed choice / score / noul questions with probabilities. Other models get 501, as upstream. make test covers Laya, Kev and lev when their GGUFs are in models/.

  • serve --embeddings-mmproj and --embeddings-pooling configure the --enable-embeddings model. The mmproj enables upstream's new {"content": [...]} input on /v1/embeddings, with image, audio and video parts. The pooling flag lets a generative VLM serve as the embedder: it has no pooling metadata, and /v1/embeddings rejects pooling none. Both flags require --enable-embeddings.

  • chimera gen --stats prints prompt and generated token counts, the wall-clock time of each phase, and the tokens/s of each to stderr after generating. The table layout matches cyllama's gen --stats, so rat.py and rwt.py parse one format. The generation rate excludes prompt time, as in chat's per-turn line; cyllama's single Tokens/second row is generated tokens over total time, so the two are not comparable and chimera names its rows Prompt tokens/second and Generation tokens/second instead. Timing uses std::chrono around the prompt decode and the sample loop rather than llama.cpp's perf counters, which new_llama_context turns off.

  • rat.py records every test run in a SQLite database shared with cyllama's and inferna's rwt.py. The default path is ~/config/runs/db.sqlite; $RUNS_DB overrides it and --no-record turns it off. Each run stores target, backend, version, the sha256 of the binary, git commit, host, wall time and exit code. Each case stores its status (pass, fail, timeout or skip) and seconds. A gen case also stores the numbers from gen --stats, when the binary has it (tokens/s per phase among them). Each image an sd case writes stores its size and sha256; the seed is fixed, so an unchanged hash means an identical image. Rows are written as each case ends, so an interrupted run keeps its finished cases. runs diff compares two runs case by case; rat.py report writes an HTML report and opens it in the browser. It opens with a version comparison: per backend and target, the newest version against the next one below it, with a regression verdict per case. rat.py run --version X records a baseline from an older release. See docs/dev/rat.md.

    rat.py runs                # recent runs of this project
    rat.py runs diff           # latest run vs the previous one with the same backend and target
    rat.py runs diff 12 15     # any two runs, across projects too

Fixed

  • Malformed or mistyped request JSON returns 400, not 500. json::parse throws common_json_error, a std::runtime_error, which the route wrapper mapped to 500. Upstream maps it to 400 as of b11429.

  • scripts/test_fixtures.py forwards options such as --no-color to test.py. It rejected them as unrecognized arguments, contrary to docs/dev/maintenance.md.

  • make deps re-clones a source tree left at a ref other than its pin. An existing build/<project> clone was reused as-is, so pulling a pin bump into a checkout that had already built the old one kept building the old ref; the pin-check static_asserts then failed on fields the old headers lack. A clone with edits outside scripts/patches/ is left in place and the build stops, naming the edited files.

0.5.0

Choose a tag to compare

@github-actions github-actions released this 02 Oct 10:17

Changes since the last Release

Added

  • Server::stop() and ServeOptions::handle_signals let a library caller own the process's signals. stop() ends a run() in progress from another thread; handle_signals = false stops command_serve installing SIGINT / SIGTERM handlers. Procedural callers pass a ServeStopper as command_serve's new second argument. A stop requested while the model loads takes effect when the load finishes; the same request through POST /v1/chimera/shutdown was previously lost, because the task loop resets its running flag when it starts. No CLI flag: the CLI always handles signals.

  • rat.py clean --keep-images / rat.py run --keep-images keep the PNGs the test-sd-* cases wrote to build/rat/out/ and remove the rest of that directory. --keep-output kept them only along with the scratch DBs and transcripts.

  • serve -a, --alias NAME[,NAME...] sets the model names /v1/models reports, matching llama-server. Without it the id is the -m argument as typed, so -m /home/... exposes the absolute path; this became the default with the llama.cpp b9741 update (previously the file name).

  • serve binds the rest of llama-server's single-model routes. New: GET /models, POST /completion, /completions, /embedding, /embeddings (llama.cpp's native formats, not OpenAI's), /responses, /chat/completions/input_tokens, /responses/input_tokens, /reranking, /v1/reranking and /audio/transcriptions. /tools and /cors-proxy return 403, as upstream does without --tools / --webui-mcp-proxy. Clients written against llama-server got 404 on these. Still unbound: router-mode /models* and POST /props. make bump-check and make test now fail when upstream adds a route that chimera neither binds nor lists in scripts/server_routes.py:UNBOUND.

Changed

  • Update stable-diffusion.cpp to master-929-3f8527a (from master-898-2bb7294). sd_tiling_params_t renamed tile_size_x/y and rel_size_x/y to _w/_h. tile_size is now in image pixels (default 256); it was latent cells (default 32). --vae-tile-size and the vae_tile_size request field were documented as pixels but sent latent cells, so --vae-tile-size 32 meant 256 px. They now mean pixels. Sizes below 4 latent cells (32 px for an 8x VAE) now fail the generation; upstream used to clamp them.

Fixed

  • command_serve / Server::run() remove their SIGINT and SIGTERM handlers on return. They stayed installed, pointing at a closure over the returned call's locals, so a later signal in a library caller ran it on a dead stack frame. The second-interrupt flag also stayed set: a second run() in the same process exited with status 1 on its first Ctrl-C. The caller's previous handlers are now restored and the flag is reset per call. The CLI was unaffected, since it exits when serve returns.

  • POST /v1/chimera/shutdown no longer crashes a library caller when the server stops inside its 150 ms delay. The delay ran on a detached thread that then used command_serve's locals; a SIGINT in that window let command_serve return first, and the thread segfaulted. The route now stops the task loop on the request thread, and command_serve waits the 150 ms itself.

  • serve's SIGINT / SIGTERM handler no longer takes a mutex. It stopped the task queue directly, which locks the queue's mutex; a signal delivered to the thread holding that mutex would deadlock. The handler now writes one byte to a pipe and a watcher thread stops the queue. The forced exit on a second interrupt uses _exit(1) in place of std::exit(1), so it no longer runs static destructors.

0.4.1

Choose a tag to compare

@github-actions github-actions released this 28 Sep 06:23

Changes since the last Release

Added

  • serve binds POST /v1/chat/completions/input_tokens and /v1/responses/input_tokens, the OpenAI-shape counterparts of /v1/messages/count_tokens.

Changed

  • Update llama.cpp to b11146 (v0.5.0) (from v0.4.1). Upstream's HTTP server now listens on a list of addresses. --host still takes one.

  • release.yml and release-gpu.yml accept a tagless workflow_dispatch. An empty tag builds the dispatched branch as chimera-dev-<sha7>-* artifacts and skips publish, so the workflows can be tested before tagging.

Fixed

  • The embedded web UI's Stop button now stops generation. The UI tags each chat stream with X-Conversation-Id, which makes upstream keep the generation running after client disconnect and cancel it only through DELETE /v1/stream. serve did not bind that route, so Stop got a 404 and generation ran to max_tokens. serve now binds GET/DELETE /v1/stream and POST /v1/streams/lookup. Tagged streams still survive disconnect by design, so a reloaded tab can reattach.

  • SIGTERM no longer hangs serve while a tagged stream is running. Shutdown finalized stream sessions without cancelling them. The request's HTTP worker then waited for results from the stopped task loop, and exit required a second signal. scripts/patches/llama.cpp-stream-cancel-on-shutdown.patch cancels them first; see scripts/patches/README.md.

0.3.1

Choose a tag to compare

@github-actions github-actions released this 21 Sep 09:05

Changes since the last Release

Changed

  • Update llama.cpp to v0.4.1 (from v0.4.0) and whisper.cpp to v1.9.4 (from v1.9.2); stable-diffusion.cpp unchanged. llama.cpp deleted tools/ui/embed.cpp, the generator for the ui.cpp/ui.h that server-http.cpp includes. make deps failed on the file copy even with the web UI off. chimera now stages upstream's scripts/ui-assets.cmake and tools/ui/ui.{h,cpp}.in and runs the script unmodified when CHIMERA_WEBUI_EMBED=ON. We reuse the script rather than write our own generator because the templates changed API too (llama_ui_use_gzip(), a fixed-size std::array from llama_ui_get_assets()). With embed OFF, CMake fills the templates with zero assets; the script would print a "no assets" warning on every build. Staged assets moved from src-aux/webui/ to src-aux/ui/tools/ui/dist/.

    Embedded assets are now gzip-compressed. The embedded UI adds about 3 MB to the binary, down from 7 MB. Requests without Accept-Encoding: gzip get 415 from upstream's handler. See docs/dev/webui.md § 11.

  • Pin linenoise to tag 2.1 (was the master branch), so fresh and local builds use the same commit. thirdparty/linenoise/ is now untracked; make deps writes it.

  • GPU CI and release jobs retry apt-get update. It exits 0 when a mirror fetch fails, so a transient outage surfaced later as a missing package. The jobs now pass --error-on=any, set Acquire::Retries "5", and retry up to 3 times with backoff.

0.3.0

Choose a tag to compare

@github-actions github-actions released this 11 Sep 07:38

Changes since the last Release

Changed

  • Update llama.cpp to v0.4.0 (from v0.3.0); whisper.cpp and stable-diffusion.cpp unchanged. Two upstream signature changes, both caught at compile time. llm_ffn_exps_block_regex(i) became llm_ffn_block_regex(i, ffn_regex) when upstream generalised the MoE offload helpers to cover dense FFN tensors too (--n-cpu-ffn); --n-cpu-moe now passes LLM_FFN_EXPS_REGEX explicitly. The sibling llm_add_n_cpu_ffn_overrides() was not adopted: it parks the pattern strings in a function-local static std::list that grows on every call, which is fine for a process that loads one model and wrong for a library whose load_* entrypoints can be called repeatedly; chimera already owns the storage in ModelExtras. mtmd_helper_bitmap_init_from_file() gained a fourth mtmd_helper_init_opt argument carrying the video decode parameters; the two call sites pass mtmd_helper_init_opt_default(), since --video-fps/--video-timestamp-ms/--ffmpeg-dir reach the decoder through mtmd_helper_video_init() on the explicit --video path, not through image loading.

    Runtime-visible without a code change: LLAMA_SESSION_VERSION 9 -> 10 and LLAMA_STATE_SEQ_VERSION 2 -> 3, so slot state written by an earlier chimera (--slot-save-path) is rejected on load. Not wrapped: llama_model_params::lazy_mode (on-demand tensor reads) and upstream's new --n-cpu-ffn.

Fixed

  • An embedding input longer than the context aborted the process. Embedder::embed() tokenized with add_special and handed the result straight to llama_decode, but the encoder path asserts GGML_ASSERT(cparams.n_ubatch >= n_tokens && "encoder requires n_ubatch >= n_tokens") -- an abort() inside llama.cpp, not a return code, so there was nothing downstream to turn into a clean exit. chimera embed on any text past the model's context died this way, and so did chimera index ingest at its default settings: the chunkers clamp chunk_tokens to Embedder::n_ctx(), which counts content tokens only, so add_special then adds the model's [CLS]/[SEP] on top and a full-width chunk arrives over the line. With bge-small-en -- whose 512-token training context is also the default chunk window -- that is the first full chunk of the first file, so ingesting a README with a default-configured collection never worked. -c/--ctx-size was no escape; n_ubatch is not derived from it. embed() now clamps to min(n_ctx, n_ubatch), the same clamp rather than fail policy the two guards in chimera_serve.cpp already applied on the server paths, and re-seats the trailing separator token after the resize -- cls and last pooling both read the ends of the sequence, so dropping it would change what those two pool over. The first truncation per Embedder warns on stderr; later ones are silent, since ingest drives thousands of chunks through one instance. The chunk_by_tokens docs claimed the opposite invariant ("chunks always fit through embed(text) without truncation") and have been corrected to describe the special-token headroom rather than promise it.

Added

  • scripts/rat.py ("run artifact tests"), a smoke-test runner for build artifacts. make test tests the tree you just built; nothing tested the binary CI produces, which is the one that gets released. rat.py checks it before release: --bin takes a bare executable (a downloaded CI artifact or a local build), --asset a local archive or URL, and rat.py install --cuda resolves a GitHub release (default /releases/latest), picks the asset from the backend plus the host -- --cuda on Linux is chimera-<version>-linux-x86_64-cuda.tar.gz -- and unpacks the binary into build/rat/; rat.py test test-all then drives that binary's CLI across embeddings, transcription, generation, the vector store and image generation, and run is install + test + clean in one command. Two things the suite knows that a hand-run CLI does not: --gpu-layers is not optional (chimera's llama-side subcommands default to 0, so a GPU release tested without it would pass every case while measuring nothing but the CPU path), and every case passes --db/--cache-db explicitly or points $CHIMERA_DB into its own output directory, so a smoke run never creates collections in the user's real store. Its entire footprint is one directory, build/rat/ (the binary, downloads/ for the archives it came from, out/ for everything a run produces; --build-dir, defaulting to the Makefile's BUILD_DIR) -- already gitignored, already what make clean sweeps -- except models/, which stays at the root shared with make test rather than re-downloading tens of GiB after every clean. Ported from cyllama's wheel tester, with the virtualenv machinery dropped -- a static binary has no interpreter to indirect through and no compile-time backend env to set -- and backend detection replaced by parsing chimera info's built:/loaded: lines, which also surfaces the case worth catching: a GPU build whose runtime brought up only CPU. A --bin without its exec bits is chmod +x'd before use, because a binary downloaded as a GitHub Actions artifact arrives zipped with its POSIX mode stripped. See docs/dev/rat.md.

  • scripts/case/*.sh are now cases in that suite. The twelve one-off shell scripts are gone; each survives as a rat.py test target, so they share one model registry, one timeout, one PASS/FAIL summary and one place that knows about --gpu-layers. The z_turbo*.sh scripts became test-sd-{1..3} -- te-on-cpu + vae-tiling, cpu-offload + vae-on-cpu, and cfg-1 + offload + flash-attn -- mirroring the three cases in cyllama's rwt.py so the two projects' results compare directly. All three fit an 8 GiB card; the all-on-GPU baseline (~9.4 GiB of weights) and the flash-attn-only variants were dropped, since the baseline OOMs there by construction. run --fast now runs test-sd-3 in place of the old test-sd-4. The two rag-chat-qwen3*.sh variants became test-rag-{1,2} -- which is what found the ingest abort above, since they run at chimera's default chunk window rather than one picked to avoid it.

0.2.16

Choose a tag to compare

@github-actions github-actions released this 31 Aug 06:03

Changes since the last Release

Fixed

  • chunk_by_sentences never terminated when the chunk window was too small to carry an overlap. After emitting a packed chunk the loop walks back from the packed range to find the smallest tail worth overlap_tokens, then restarts the next pack there. When only one sentence fits at a time -- the next one pushes the window over chunk_tokens -- that walk-back always lands on first, the sentence the chunk just started with, so the identical singleton was emitted forever while the output vector grew without bound. Two 6-token sentences with chunk_tokens = 10 and any positive overlap is the minimal reproduction. The guard now requires strict forward progress (back > first), dropping the overlap for that one chunk rather than looping; a window that cannot hold two sentences cannot carry an overlap between them either. Reachable remotely: POST /v1/vector_stores/:name/files chunks with the collection's stored window, so a collection created with a small chunk_tokens hung the request thread and exhausted memory.

  • The WAV parser sized an allocation from an unvalidated chunk header. parse_wav_stream read the 32-bit chunk_size off the wire and called pcm_bytes.resize(chunk_size) before checking that the declared bytes were present, so a ~50-byte multipart upload declaring a 4 GiB data chunk forced the allocation -- std::bad_alloc or the OOM killer, depending on the box, and on chimera serve that takes the whole server down rather than one request. The parser now measures the stream once up front and rejects any chunk claiming more than what remains, and a short read on data is an error rather than a silently zero-filled tail. Rejecting rather than clamping is deliberate: a truncated buffer of zeroes transcribes as plausible silence, which is a worse failure than a 4xx.

  • The text-only chat path prepended a second BOS. The comment above the call says chat templates emit <|begin_of_text|> themselves and that add_special must therefore be false -- the multimodal path two branches up passes false for exactly this reason -- but the text path passed true. chimera tokenize shows the result directly: a Llama-3 templated prompt came back with 128000 <|begin_of_text|> twice. Llama-3 reacts by emitting a stray <|start_header_id|>assistant<|end_header_id|> and losing track of the user turn. Now false, matching both the comment and the mtmd path.

  • RAG ingestion was neither atomic nor safely retryable. Each chunk was inserted in its own transaction, so a failed embed or insert partway through one request left the leading chunks committed while the caller saw an error -- and since nothing keys on source_uri, retrying the same file duplicated everything that had already landed. One file (CLI) / one request (HTTP) is now one transaction. insert_document moved from BEGIN/COMMIT to a savepoint so it nests inside the caller's rather than failing with "cannot start a transaction within a transaction", and the new chimera_vector_store::Transaction is an RAII savepoint that rolls back unless commit() ran.

  • Row iteration reported a failed query as a short result. search_semantic looped while (sqlite3_step(...) == SQLITE_ROW) and returned whatever it had collected, so SQLITE_BUSY, SQLITE_IOERR or SQLITE_CORRUPT mid-iteration surfaced as a valid partial answer -- and in a hybrid search, as the whole semantic leg silently vanishing. The sibling search_lexical_raw already checked its terminal status; that pattern is now applied to search_semantic, list (collections), list_chats, load_messages and list_tables. find (collection by name) had the same shape in a different guise: it treated every non-SQLITE_ROW status as "no such collection", so a database error was reported as a missing row; it now distinguishes SQLITE_DONE from a genuine failure.

  • Persisted media paths were interpolated into JSON rather than serialized. Interactive chat built media_json by concatenating paths between quote characters, so any path containing a quote, a backslash (i.e. every Windows path) or a control character produced a body no JSON reader accepts -- losing the metadata the column exists to carry. It now builds a nlohmann::json array and dumps it.

  • response_format values outside the documented set were silently accepted. Anything that was not text, srt, vtt or verbose_json fell through to the default {"text": ...} body with HTTP 200, so a client that typo'd srt had no way to notice. Unsupported values now return 400 naming the accepted set.

Added

  • Application-level request limits on the audio, image and RAG routes. The staged cpp-httplib already carries a 256 MB per-request payload cap (_patch_server_http_payload_cap), but that is a floor rather than a policy: 256 MB of WAV still decodes to gigabytes of float samples, and the expensive parameters -- image batch count, image dimensions -- are small numbers in a small body that no payload cap can bound. Each route now checks its own bound before committing memory or the model worker: audio upload size (CHIMERA_MAX_AUDIO_BYTES, 256 MB), image n (CHIMERA_MAX_IMAGE_BATCH, 16) and per-side dimensions (CHIMERA_MAX_IMAGE_DIM, 4096), and RAG document size (CHIMERA_MAX_RAG_TEXT_BYTES, 64 MB) plus chunk count (CHIMERA_MAX_RAG_CHUNKS, 100k -- chunk count follows the collection's window, not the request, so the byte cap does not bound it). All are -D-overridable at configure time and set far above any legitimate use; the point is that the pathological case fails fast with a 4xx instead of occupying the single-threaded sd or whisper worker indefinitely.

  • A startup warning when the server is reachable off-host with no --api-key. Upstream's middleware_validate_api_key gates every route except /health and the UI assets -- chimera's own routes included -- so POST /v1/chimera/shutdown and the /v1/chats history endpoints are protected whenever a key is configured. But it is opt-in, and with no key anyone who can reach the port can stop the process, or read prompts, reasoning and chat contents by walking /v1/chats/:id (ids are sequential rowids, authorized by existence alone). That is a defensible default on loopback and a bad surprise off it, so binding to a non-loopback address without a key now says so once on stderr instead of leaving it to the docs.

  • Regression tests for the three defects the suite could not have caught. An over-declared WAV data chunk and an unknown response_format are driven through POST /v1/audio/transcriptions (the server surviving the first is half the assertion); the chunker case ingests 6-token sentences into a collection with a 10-token window and a positive overlap, where the timeout is the assertion -- before the fix that ingest never returned.

0.2.15

Choose a tag to compare

@github-actions github-actions released this 30 Aug 21:06

Changes since the last Release

Fixed

  • -v did not reach stable-diffusion, leaving every sd run diagnosable only by its errors. sd_log_callback() hard-filtered at SD_LOG_WARN, and sd.cpp installs no printer of its own (log_printf() hands every level to the callback and returns), so chimera sd dropped the whole INFO/DEBUG tier no matter how it was invoked. That tier is where the lines that explain a low-VRAM failure live: Found N backend devices, total params memory size = ... (VRAM x, RAM y), and the model_manager prepared params backend buffer / staged compute params to CUDA0 / releasing compute params sequence. Without them an OOM from weights pinned to the compute backend -- sd's default, since SDBackendManager::params_backend() falls back to runtime_backend() when no --params-backend spec is given -- is indistinguishable from one caused by a placement flag that did not take effect, and the two have opposite fixes. The threshold is now settable (chimera_set_sd_log_verbose()), and -v drops it to SD_LOG_DEBUG. Warnings and errors are unaffected when the flag is absent.

Changed

  • Global flags now bind after the subcommand as well as before it. app.fallthrough(), so chimera sd -v ... works alongside chimera -v sd ...; previously the former exited with The following argument was not expected: -v. Subcommands bind their own options first, so fallthrough only catches what would otherwise have been an error.

0.2.12

Choose a tag to compare

@github-actions github-actions released this 06 Aug 06:18

Changes since the last Release

Fixed

  • Restore the SD path on shared-ggml builds: GGML_MAX_NAME had diverged across the link (heap corruption). Any chimera sd run against Z-Image Turbo aborted mid-sampling with glibc's corrupted double-linked list (or a SIGSEGV — the manifestation was nondeterministic). The cause was not sd.cpp, the model, or VRAM: GGML_MAX_NAME sizes char name[GGML_MAX_NAME] inside struct ggml_tensor, so it sets sizeof(ggml_tensor) (128 -> 400 bytes, 160 -> 432) and the offset of every field after name. chimera links only llama.cpp's ggml (CMakeLists.txt, all backends) while stable-diffusion.cpp and whisper.cpp contribute their own object code, so all of them must be compiled with the same value. None were: llama.cpp's ggml and chimera's own TUs were pinned at 128, whisper.cpp got nothing and defaulted to 64, and sd.cpp compiles itself at 160 (its CMakeLists.txt sets add_definitions(-DGGML_MAX_NAME=160); upstream moved it up from 128 at some point and chimera's hardcoded 128 was never updated). sd.cpp therefore wrote tensor->extra at offset 416 into 400-byte tensors ggml had allocated — 16 bytes past the end, into the adjacent chunk's heap metadata. The stale pins even cited sd.cpp's "CMakeLists.txt:233"; that line is now 315, which is the drift itself showing in the comment.

    Nothing caught it at build time because sd.cpp's own guard is static_assert(GGML_MAX_NAME >= 128) (src/core/ggml_extend.hpp) — a minimum, so 128 compiled clean. And nothing caught it at runtime until a malloc unrelated to the overflow happened to walk the damaged free list, which is why the backtrace pointed at innocent allocation sites (copy_data_to_backend_tensor, ggml_gallocr_reserve_n_impl) that moved as soon as allocation timing changed. The attribution shortcut for this class of bug: build/stable-diffusion.cpp/build/bin/sd-cli is built self-consistently at 160 and succeeds on configurations chimera crashes on — when upstream's own CLI is fine, suspect the shared-ggml link rather than upstream.

  • Apply GGML_MAX_NAME to the CUDA and HIP languages, not just C/C++. The above fix is incomplete without this and the crash survives it. CMAKE_C_FLAGS / CMAKE_CXX_FLAGS do not reach .cu files — CUDA and HIP are separate CMake languages with their own flag variables — so ggml-cuda in both llama.cpp and whisper.cpp stayed on the 64 default while ggml-base and ggml-cpu alongside it used the pinned value. The linked ggml disagreed with its own backend about sizeof(ggml_tensor). This predates the SD divergence: llama.cpp's ggml-cuda was at 64 against a ggml-base at 128 in prior releases too, independent of whether SD was in the link. sd.cpp's tree was never exposed because it uses add_definitions(), which applies to every language. GgmlBuilder.ggml_max_name_flags() now emits CMAKE_C_FLAGS, CMAKE_CXX_FLAGS, CMAKE_CUDA_FLAGS and CMAKE_HIP_FLAGS together, and both the llama.cpp and whisper.cpp builders consume it. The HIP leg is reasoned-correct but was not exercised on ROCm hardware.

  • Pin whisper.cpp's GGML_MAX_NAME at all. The whisper builder never passed the define, so every whisper TU compiled at the 64 default against a shared ggml built at 128 — the same class of mismatch as SD's, in the opposite direction (whisper read fields at lower offsets than reality rather than overrunning, which is why it degraded quietly instead of aborting). No whisper failure was ever observed and the whisper tests passed both before and after, so this is a latent defect closed rather than an observed one fixed.

  • Fetch stable-diffusion.cpp before reading GGML_MAX_NAME off it, instead of falling back. Only reproducible from a clean tree, which is why it survived the incremental builds the fix above was developed against. Builders clone lazily and run in list order — llama.cpp, whisper.cpp, then stable-diffusion.cpp — so on a fresh make reset build ggml_max_name() read SD's CMakeLists.txt before that tree existed on disk, silently took GGML_MAX_NAME_FALLBACK, and configured llama.cpp and whisper.cpp from a guess. That resolves to the right answer only while the fallback happens to equal SD's current value: the first time upstream moves it and SDCPP_VERSION is bumped, a reset build would give llama.cpp/whisper.cpp the stale fallback and SD the new value — reintroducing the exact ABI split this machinery exists to prevent, through the machinery meant to prevent it. ggml_max_name() now clones SD on demand when its CMakeLists.txt is absent (its own builder clones it moments later regardless, so the only cost is doing it earlier) and both fallback paths now log a warning naming the ABI-split consequence rather than returning quietly.

Changed

  • Derive GGML_MAX_NAME from stable-diffusion.cpp instead of pinning it in two places. The value belongs to upstream SD, which has moved it before and may again, and a stale copy fails silently at runtime rather than loudly at build time — so re-pinning 160 would only reset the same trap. StableDiffusionCppBuilder.ggml_max_name() parses GGML_MAX_NAME=<n> out of SD's own CMakeLists.txt, and chimera's top-level CMakeLists.txt does the same with file(STRINGS ...) for its own TUs. GGML_MAX_NAME_FALLBACK = 160 is a last resort only: the SD tree is fetched on demand so the value can be read from upstream (see above), leaving the fallback to cover an unreadable or unparseable checkout, and it warns when it fires. Configure now reports the resolved value (-- GGML_MAX_NAME: 160 (from stable-diffusion.cpp)), which makes a future divergence visible in the build log. Both parsers are inert when SD_USE_VENDORED_GGML=1, where each project keeps its own ggml and no agreement is required.

    To audit agreement across a build tree, every flags.make must report the same number:

    find build/{llama.cpp,whisper.cpp,stable-diffusion.cpp}/build build/src \
         -name flags.make | xargs grep -ho 'GGML_MAX_NAME=[0-9]*' | sort -u
    

Testing

  • Verified against the Z-Image Turbo case that exposed it, on CUDA and Vulkan. scripts/case/z_turbo.sh (Z-Image Turbo Q6_K + Qwen3-4B + --offload-to-cpu --diffusion-fa, 1024x512) went from a reproducible Aborted (core dumped) to exit 0 on both backends, and was run four times on each to rule out the nondeterminism that makes single passes meaningless for heap corruption. The three variants that also aborted before — --clip-on-cpu --vae-on-cpu, without --diffusion-fa, and at 512x512 — pass on both. make test is 68 pass / 0 fail / 7 skip on each, unchanged from before the fix, with the whisper lanes passing on the 64 -> 160 move. Because chimera silences sd.cpp's logging there is no backend banner to read, so GPU residency was confirmed by sampling nvidia-smi during a run rather than inferred: CUDA peaked at 6087 MiB / 56% util, Vulkan at 5889 MiB / 77%. The Vulkan leg was built from a clean make reset, which is what surfaced the lazy-clone ordering bug above; the CUDA leg was incremental.

  • GGML_MAX_NAME agreement is audited per target, and has exactly one legitimate exception. Every flags.make across llama.cpp, whisper.cpp, stable-diffusion.cpp and chimera reports 160 — 87 targets on the Vulkan build. The exception is vulkan-shaders-gen, present once per dep, which does not carry the define and correctly should not: it is a host tool that compiles GLSL to SPIR-V, and its source includes only standard library headers, no ggml.h and no ggml_tensor. Any other target missing the define is a real mismatch.

  • Not covered. ROCm/HIP and SYCL were not built. CMAKE_HIP_FLAGS is the structurally correct counterpart to CMAKE_CUDA_FLAGS — HIP is likewise a separate CMake language — but unlike Vulkan (whose backend is a single .cpp reached by CMAKE_CXX_FLAGS, so its coverage follows from the C++ path) that cannot be discharged by inspection and needs ROCm hardware to confirm. Separately, note that the 8 GB test card cannot run this model without --offload-to-cpu on either backend; that path fails cleanly with a 5638 MB allocation error, which is correct behaviour and unrelated to this bug.