bug: replace runtime string concatenation with spdlog format in WASI-NN MLX plugin
Summary
Two files in the WASI-NN MLX plugin use runtime string concatenation (+ and std::to_string()) in spdlog::error() calls instead of the project-standard format string placeholders and sv string view literal suffix.
Current State
In plugins/wasi_nn/MLX/mlx/pooling.cpp (lines 70-74) and plugins/wasi_nn/MLX/model/whisper_transcribe.cpp (lines 100-101), spdlog::error() constructs error messages via std::string concatenation with std::to_string(), without using format placeholders or the sv suffix.
Expected State
Per WasmEdge coding guidelines:
"Use the sv suffix for string literals in spdlog calls; the codebase applies it consistently, and a missing suffix is treated as a bug to fix."
Log statements should use spdlog format string placeholders ({}) with arguments passed directly, and string literals should use the sv suffix.
Reproduction steps
- Inspect
plugins/wasi_nn/MLX/mlx/pooling.cppat lines 70-74. - Inspect
plugins/wasi_nn/MLX/model/whisper_transcribe.cppat lines 100-101. - Observe
std::to_string()and+string concatenation used insidespdlog::error(...)calls instead of format string placeholders ({}) with thesvsuffix.
Any logs you want to share for showing the specific issue
// plugins/wasi_nn/MLX/mlx/pooling.cpp:70-74 spdlog::error( "To extract sliding windows at least 1 spatial dimension (3 total) is " "needed but the input only has " + std::to_string(X.ndim()) + " dimensions.");
// plugins/wasi_nn/MLX/model/whisper_transcribe.cpp:100-101 spdlog::error("Unsupported number of mel filters: " + std::to_string(NMels));
Components
Plugins
WasmEdge Version or Commit you used
081f5b89 (master)
Operating system information
macOS / All
Hardware Architecture
arm64 / All
Appendix
I would love to work on this and submit a PR to resolve it.
Source: WasmEdge/WasmEdge