You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Priority: P2 · not a release blocker. llamadart cannot forward runtime logs or quote load-failure reasons and names the missing file roles instead; diagnostics are weaker but behavior is correct. Schedule after the release (leehack/llamadart#778, leehack/llamadart#802).
sd_set_log_callback passes a const char* valid only during the call, and it may be invoked from worker threads. Dart can only receive it asynchronously (NativeCallable.listener), by which time the pointer is dangling, so the llamadart prototype could not forward runtime logs.
Add a small exported helper (for example sd_native_set_log_sink) that copies each line into an owned buffer before handing it to the callback, with a matching free function. Keep it outside upstream sources, add it to the export allowlist, and document ownership.
Another consumer of this: load diagnostics (leehack/llamadart#802). When new_sd_ctx fails, the reason exists only as [ERROR] log lines, for example VAE tensor 'first_stage_model.decoder.conv_in.bias' not in model metadata for an SD 3.5 GGUF passed as diffusion_model_path, or Conditioner model tensor 'text_encoders.llm...' not in model metadata for Z-Image without llm_path. llamadart cannot quote them, so it now names the missing file roles instead.
Some of these lines come from the model loader's worker threads (model_loader.cpp logs read failures inside its std::thread workers), so an isolate-local Dart callback would abort the process; NativeCallable.isolateGroupBound is experimental and crashed in a quick test on Dart 3.13.1. A copying sink that also keeps the last N ERROR lines retrievable after a failed new_sd_ctx (for example sd_native_take_error_log) would let llamadart put them in the exception.
Met by #17: a polled, copying log recorder (sd_dart_log_enable/read/dropped) plus sd_dart_last_error, shipped in v0.2.0-2 and in v0.3.0, adopted by llamadart in leehack/llamadart#971. It differs from the suggested callback sink but covers the same need without a cross-thread callback.
Activity
leehack commentedon Oct 1, 2026
Another consumer of this: load diagnostics (leehack/llamadart#802). When
new_sd_ctxfails, the reason exists only as[ERROR]log lines, for exampleVAE tensor 'first_stage_model.decoder.conv_in.bias' not in model metadatafor an SD 3.5 GGUF passed asdiffusion_model_path, orConditioner model tensor 'text_encoders.llm...' not in model metadatafor Z-Image withoutllm_path. llamadart cannot quote them, so it now names the missing file roles instead.Some of these lines come from the model loader's worker threads (
model_loader.cpplogs read failures inside itsstd::threadworkers), so an isolate-local Dart callback would abort the process;NativeCallable.isolateGroupBoundis experimental and crashed in a quick test on Dart 3.13.1. A copying sink that also keeps the last N ERROR lines retrievable after a failednew_sd_ctx(for examplesd_native_take_error_log) would let llamadart put them in the exception.Export GPU device memory and record log messages for the v0.2.0-2 reb…
feat: adopt stable-diffusion-native v0.2.0-2 with a Vulkan memory che…
leehack commentedon Oct 24, 2026
Met by #17: a polled, copying log recorder (sd_dart_log_enable/read/dropped) plus sd_dart_last_error, shipped in v0.2.0-2 and in v0.3.0, adopted by llamadart in leehack/llamadart#971. It differs from the suggested callback sink but covers the same need without a cross-thread callback.