Repository navigation
Releases
0.9.0
Changes since the last Release
chimera skips 0.8.0 to keep its version equal to llama.cpp's.
Added
servebindsPOST /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_loadnow rejects direction tensors whose layer index exceeds the model's layer count. -
Pin whisper.cpp to master
f92e1e4(from v1.9.4). b11960 insertedGGML_OP_TOP_K_MASKintoenum 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.pynow accepts a 40-character commit hash as a pin. -
Update stable-diffusion.cpp to master-1067-b43ce4b (from master-929-3f8527a).
generate_imagenow returns a result struct that sd.cpp frees itself. chimera previously freed sd.cpp's pixel buffers with its ownstd::free.
0.7.0
Changes since the last Release
Added
-
--moe-cache-mib Nongen,chatandservegives the MoE experts kept on CPU a GPU cache of N MiB (upstream #29887, experimental). It needs a GPU backend.servealso gains--cpu-moeand--n-cpu-moe. The Python bindings expose the new fields. Upstream's--spec-draft-n-ubatchhas no counterpart, since chimera has no speculative decoding. -
serve --slot-save-pathreadsLLAMA_ARG_SLOT_SAVE_PATHwhen the flag is absent, asllama-serverdoes. -
make testcovers the new upstream models when their GGUFs are inmodels/. d1-omni-600M and d1-3B on/v1/systemone; embeddinggemma-2 with its mmproj on--embeddings-mmproj, which previously neededCHIMERA_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.
-
servelistens on port 9931 by default, followingllama-server(upstream #30159). Pass--port 8080for the old port. -
chatsplits reasoning out of the reply by default. It usesdeepseek,llama-server's default, when neither--reasoningnor--reasoning-formatis given.<think>text streams in the think colour, is stored in thereasoningcolumn under--persist, and stays out of the history sent back to the template.--reasoning nonerestores the 0.6.0 output.chatnow drives upstream'scommon_chat_sessionper turn.
Fixed
-
chatandgen --mmprojno longer parse special tokens typed by the user. The rendered prompt was tokenized as one string withparse_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 withadd_space_prefix.serveis unchanged: upstream's server still tokenizes the joined prompt. -
--reasoning-formathad no effect on howchatparsed output.common_chat_parser_params(const common_chat_params &)does not copyparser, so the content-only fallback parser ran, andreasoning_contentwas never set. -
servepadstensor_buft_overridesas upstream's arg parser does. The list was empty, sollama_params_fitaborted with "did not provide buffer to set tensor_buft_overrides" and could not reduce--gpu-layers -1when the model did not fit. A non-empty list also needs the null terminator, which--cpu-moewould otherwise trip incommon_model_params_to_llama. -
The
gen --mmproj --imagetest skipped whenmodels/held only theQ5_K_Mquant of gemma-4-E4B. It requiredQ4_K_M; it now accepts either.
0.6.0
Changes since the last Release
Changed
- Update llama.cpp to b11429 (v0.6.0, from b11146).
GET /v1/modelsentries gain anarchitectureobject withinput_modalities/output_modalities.LLAMA_STATE_SEQ_VERSIONwent from 3 to 4, so restoring a slot file saved with--slot-save-pathbefore this update returns 400. Save it again.
Added
-
servebindsPOST /v1/systemone, upstream's TypeSafe System One API for native decision models (laya, clef, openjev, lev, kev, nimble). It answers typedchoice/score/noulquestions with probabilities. Other models get 501, as upstream.make testcovers Laya, Kev and lev when their GGUFs are inmodels/. -
serve --embeddings-mmprojand--embeddings-poolingconfigure the--enable-embeddingsmodel. 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/embeddingsrejects poolingnone. Both flags require--enable-embeddings. -
chimera gen --statsprints 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'sgen --stats, sorat.pyandrwt.pyparse one format. The generation rate excludes prompt time, as inchat's per-turn line; cyllama's singleTokens/secondrow is generated tokens over total time, so the two are not comparable andchimeranames its rowsPrompt tokens/secondandGeneration tokens/secondinstead. Timing usesstd::chronoaround the prompt decode and the sample loop rather than llama.cpp's perf counters, whichnew_llama_contextturns off. -
rat.pyrecords everytestrun in a SQLite database shared with cyllama's and inferna'srwt.py. The default path is~/config/runs/db.sqlite;$RUNS_DBoverrides it and--no-recordturns 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 fromgen --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 diffcompares two runs case by case;rat.py reportwrites 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 Xrecords a baseline from an older release. Seedocs/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::parsethrowscommon_json_error, astd::runtime_error, which the route wrapper mapped to 500. Upstream maps it to 400 as of b11429. -
scripts/test_fixtures.pyforwards options such as--no-colortotest.py. It rejected them as unrecognized arguments, contrary todocs/dev/maintenance.md. -
make depsre-clones a source tree left at a ref other than its pin. An existingbuild/<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-checkstatic_asserts then failed on fields the old headers lack. A clone with edits outsidescripts/patches/is left in place and the build stops, naming the edited files.
0.5.0
Changes since the last Release
Added
-
Server::stop()andServeOptions::handle_signalslet a library caller own the process's signals.stop()ends arun()in progress from another thread;handle_signals = falsestopscommand_serveinstalling SIGINT / SIGTERM handlers. Procedural callers pass aServeStopperascommand_serve's new second argument. A stop requested while the model loads takes effect when the load finishes; the same request throughPOST /v1/chimera/shutdownwas 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-imageskeep the PNGs thetest-sd-*cases wrote tobuild/rat/out/and remove the rest of that directory.--keep-outputkept them only along with the scratch DBs and transcripts. -
serve -a, --alias NAME[,NAME...]sets the model names/v1/modelsreports, matchingllama-server. Without it the id is the-margument as typed, so-m /home/...exposes the absolute path; this became the default with the llama.cpp b9741 update (previously the file name). -
servebinds the rest ofllama-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/rerankingand/audio/transcriptions./toolsand/cors-proxyreturn 403, as upstream does without--tools/--webui-mcp-proxy. Clients written againstllama-servergot 404 on these. Still unbound: router-mode/models*andPOST /props.make bump-checkandmake testnow fail when upstream adds a route that chimera neither binds nor lists inscripts/server_routes.py:UNBOUND.
Changed
- Update stable-diffusion.cpp to master-929-3f8527a (from master-898-2bb7294).
sd_tiling_params_trenamedtile_size_x/yandrel_size_x/yto_w/_h.tile_sizeis now in image pixels (default 256); it was latent cells (default 32).--vae-tile-sizeand thevae_tile_sizerequest field were documented as pixels but sent latent cells, so--vae-tile-size 32meant 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 secondrun()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 whenservereturns. -
POST /v1/chimera/shutdownno longer crashes a library caller when the server stops inside its 150 ms delay. The delay ran on a detached thread that then usedcommand_serve's locals; a SIGINT in that window letcommand_servereturn first, and the thread segfaulted. The route now stops the task loop on the request thread, andcommand_servewaits 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 ofstd::exit(1), so it no longer runs static destructors.
0.4.1
Changes since the last Release
Added
servebindsPOST /v1/chat/completions/input_tokensand/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.
--hoststill takes one. -
release.ymlandrelease-gpu.ymlaccept a taglessworkflow_dispatch. An emptytagbuilds the dispatched branch aschimera-dev-<sha7>-*artifacts and skipspublish, 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 throughDELETE /v1/stream.servedid not bind that route, so Stop got a 404 and generation ran tomax_tokens.servenow bindsGET/DELETE /v1/streamandPOST /v1/streams/lookup. Tagged streams still survive disconnect by design, so a reloaded tab can reattach. -
SIGTERM no longer hangs
servewhile 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.patchcancels them first; seescripts/patches/README.md.
0.3.1
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 theui.cpp/ui.hthatserver-http.cppincludes.make depsfailed on the file copy even with the web UI off. chimera now stages upstream'sscripts/ui-assets.cmakeandtools/ui/ui.{h,cpp}.inand runs the script unmodified whenCHIMERA_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-sizestd::arrayfromllama_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 fromsrc-aux/webui/tosrc-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: gzipget 415 from upstream's handler. Seedocs/dev/webui.md§ 11. -
Pin linenoise to tag
2.1(was themasterbranch), so fresh and local builds use the same commit.thirdparty/linenoise/is now untracked;make depswrites 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, setAcquire::Retries "5", and retry up to 3 times with backoff.
0.3.0
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)becamellm_ffn_block_regex(i, ffn_regex)when upstream generalised the MoE offload helpers to cover dense FFN tensors too (--n-cpu-ffn);--n-cpu-moenow passesLLM_FFN_EXPS_REGEXexplicitly. The siblingllm_add_n_cpu_ffn_overrides()was not adopted: it parks the pattern strings in a function-localstatic std::listthat grows on every call, which is fine for a process that loads one model and wrong for a library whoseload_*entrypoints can be called repeatedly; chimera already owns the storage inModelExtras.mtmd_helper_bitmap_init_from_file()gained a fourthmtmd_helper_init_optargument carrying the video decode parameters; the two call sites passmtmd_helper_init_opt_default(), since--video-fps/--video-timestamp-ms/--ffmpeg-dirreach the decoder throughmtmd_helper_video_init()on the explicit--videopath, not through image loading.Runtime-visible without a code change:
LLAMA_SESSION_VERSION9 -> 10 andLLAMA_STATE_SEQ_VERSION2 -> 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 withadd_specialand handed the result straight tollama_decode, but the encoder path assertsGGML_ASSERT(cparams.n_ubatch >= n_tokens && "encoder requires n_ubatch >= n_tokens")-- anabort()inside llama.cpp, not a return code, so there was nothing downstream to turn into a clean exit.chimera embedon any text past the model's context died this way, and so didchimera index ingestat its default settings: the chunkers clampchunk_tokenstoEmbedder::n_ctx(), which counts content tokens only, soadd_specialthen adds the model's[CLS]/[SEP]on top and a full-width chunk arrives over the line. Withbge-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-sizewas no escape;n_ubatchis not derived from it.embed()now clamps tomin(n_ctx, n_ubatch), the same clamp rather than fail policy the two guards inchimera_serve.cppalready applied on the server paths, and re-seats the trailing separator token after the resize --clsandlastpooling both read the ends of the sequence, so dropping it would change what those two pool over. The first truncation perEmbedderwarns on stderr; later ones are silent, since ingest drives thousands of chunks through one instance. Thechunk_by_tokensdocs claimed the opposite invariant ("chunks always fit throughembed(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 testtests the tree you just built; nothing tested the binary CI produces, which is the one that gets released.rat.pychecks it before release:--bintakes a bare executable (a downloaded CI artifact or a local build),--asseta local archive or URL, andrat.py install --cudaresolves a GitHub release (default/releases/latest), picks the asset from the backend plus the host ----cudaon Linux ischimera-<version>-linux-x86_64-cuda.tar.gz-- and unpacks the binary intobuild/rat/;rat.py test test-allthen drives that binary's CLI across embeddings, transcription, generation, the vector store and image generation, andrunis install + test + clean in one command. Two things the suite knows that a hand-run CLI does not:--gpu-layersis 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-dbexplicitly or points$CHIMERA_DBinto 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'sBUILD_DIR) -- already gitignored, already whatmake cleansweeps -- exceptmodels/, which stays at the root shared withmake testrather 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 parsingchimera info'sbuilt:/loaded:lines, which also surfaces the case worth catching: a GPU build whose runtime brought up only CPU. A--binwithout its exec bits ischmod +x'd before use, because a binary downloaded as a GitHub Actions artifact arrives zipped with its POSIX mode stripped. Seedocs/dev/rat.md. -
scripts/case/*.share now cases in that suite. The twelve one-off shell scripts are gone; each survives as arat.pytest target, so they share one model registry, one timeout, one PASS/FAIL summary and one place that knows about--gpu-layers. Thez_turbo*.shscripts becametest-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'srwt.pyso 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 --fastnow runstest-sd-3in place of the oldtest-sd-4. The tworag-chat-qwen3*.shvariants becametest-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
Changes since the last Release
Fixed
-
chunk_by_sentencesnever 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 worthoverlap_tokens, then restarts the next pack there. When only one sentence fits at a time -- the next one pushes the window overchunk_tokens-- that walk-back always lands onfirst, 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 withchunk_tokens = 10and 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/fileschunks with the collection's stored window, so a collection created with a smallchunk_tokenshung the request thread and exhausted memory. -
The WAV parser sized an allocation from an unvalidated chunk header.
parse_wav_streamread the 32-bitchunk_sizeoff the wire and calledpcm_bytes.resize(chunk_size)before checking that the declared bytes were present, so a ~50-byte multipart upload declaring a 4 GiBdatachunk forced the allocation --std::bad_allocor the OOM killer, depending on the box, and onchimera servethat 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 ondatais 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 thatadd_specialmust therefore be false -- the multimodal path two branches up passesfalsefor exactly this reason -- but the text path passedtrue.chimera tokenizeshows the result directly: a Llama-3 templated prompt came back with128000 <|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. Nowfalse, 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_documentmoved fromBEGIN/COMMITto a savepoint so it nests inside the caller's rather than failing with "cannot start a transaction within a transaction", and the newchimera_vector_store::Transactionis an RAII savepoint that rolls back unlesscommit()ran. -
Row iteration reported a failed query as a short result.
search_semanticloopedwhile (sqlite3_step(...) == SQLITE_ROW)and returned whatever it had collected, soSQLITE_BUSY,SQLITE_IOERRorSQLITE_CORRUPTmid-iteration surfaced as a valid partial answer -- and in a hybrid search, as the whole semantic leg silently vanishing. The siblingsearch_lexical_rawalready checked its terminal status; that pattern is now applied tosearch_semantic,list(collections),list_chats,load_messagesandlist_tables.find(collection by name) had the same shape in a different guise: it treated every non-SQLITE_ROWstatus as "no such collection", so a database error was reported as a missing row; it now distinguishesSQLITE_DONEfrom a genuine failure. -
Persisted media paths were interpolated into JSON rather than serialized. Interactive chat built
media_jsonby 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 anlohmann::jsonarray and dumps it. -
response_formatvalues outside the documented set were silently accepted. Anything that was nottext,srt,vttorverbose_jsonfell through to the default{"text": ...}body with HTTP 200, so a client that typo'dsrthad 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), imagen(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'smiddleware_validate_api_keygates every route except/healthand the UI assets -- chimera's own routes included -- soPOST /v1/chimera/shutdownand the/v1/chatshistory 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
datachunk and an unknownresponse_formatare driven throughPOST /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
Changes since the last Release
Fixed
-vdid not reach stable-diffusion, leaving every sd run diagnosable only by its errors.sd_log_callback()hard-filtered atSD_LOG_WARN, and sd.cpp installs no printer of its own (log_printf()hands every level to the callback and returns), sochimera sddropped 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 themodel_managerprepared params backend buffer/staged compute params to CUDA0/releasing compute paramssequence. Without them an OOM from weights pinned to the compute backend -- sd's default, sinceSDBackendManager::params_backend()falls back toruntime_backend()when no--params-backendspec 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-vdrops it toSD_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(), sochimera sd -v ...works alongsidechimera -v sd ...; previously the former exited withThe 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
Changes since the last Release
Fixed
-
Restore the SD path on shared-ggml builds:
GGML_MAX_NAMEhad diverged across the link (heap corruption). Anychimera sdrun against Z-Image Turbo aborted mid-sampling with glibc'scorrupted double-linked list(or a SIGSEGV — the manifestation was nondeterministic). The cause was not sd.cpp, the model, or VRAM:GGML_MAX_NAMEsizeschar name[GGML_MAX_NAME]insidestruct ggml_tensor, so it setssizeof(ggml_tensor)(128 -> 400 bytes, 160 -> 432) and the offset of every field aftername. 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 (itsCMakeLists.txtsetsadd_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 wrotetensor->extraat 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 amallocunrelated 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-cliis 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_NAMEto 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_FLAGSdo not reach.cufiles — CUDA and HIP are separate CMake languages with their own flag variables — soggml-cudain both llama.cpp and whisper.cpp stayed on the 64 default whileggml-baseandggml-cpualongside it used the pinned value. The linked ggml disagreed with its own backend aboutsizeof(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 usesadd_definitions(), which applies to every language.GgmlBuilder.ggml_max_name_flags()now emitsCMAKE_C_FLAGS,CMAKE_CXX_FLAGS,CMAKE_CUDA_FLAGSandCMAKE_HIP_FLAGStogether, 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_NAMEat 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_NAMEoff 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 freshmake resetbuildggml_max_name()read SD'sCMakeLists.txtbefore that tree existed on disk, silently tookGGML_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 andSDCPP_VERSIONis 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 itsCMakeLists.txtis 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_NAMEfrom 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()parsesGGML_MAX_NAME=<n>out of SD's ownCMakeLists.txt, and chimera's top-levelCMakeLists.txtdoes the same withfile(STRINGS ...)for its own TUs.GGML_MAX_NAME_FALLBACK = 160is 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 whenSD_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.makemust 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 reproducibleAborted (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 testis 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 samplingnvidia-smiduring a run rather than inferred: CUDA peaked at 6087 MiB / 56% util, Vulkan at 5889 MiB / 77%. The Vulkan leg was built from a cleanmake reset, which is what surfaced the lazy-clone ordering bug above; the CUDA leg was incremental. -
GGML_MAX_NAMEagreement is audited per target, and has exactly one legitimate exception. Everyflags.makeacross llama.cpp, whisper.cpp, stable-diffusion.cpp and chimera reports 160 — 87 targets on the Vulkan build. The exception isvulkan-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, noggml.hand noggml_tensor. Any other target missing the define is a real mismatch. -
Not covered. ROCm/HIP and SYCL were not built.
CMAKE_HIP_FLAGSis the structurally correct counterpart toCMAKE_CUDA_FLAGS— HIP is likewise a separate CMake language — but unlike Vulkan (whose backend is a single.cppreached byCMAKE_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-cpuon either backend; that path fails cleanly with a 5638 MB allocation error, which is correct behaviour and unrelated to this bug.