From ea313a35c5cb0419b93b9ccc98dcb2f92b304277 Mon Sep 17 00:00:00 2001 From: Shaw Date: Tue, 19 May 2026 00:09:18 -0700 Subject: [PATCH 1/3] fix(kokoro): silence -Wunused-parameter on output_pad in conv-transpose1d The output_pad arg affects T_out (computed by caller) but doesn't change the per-element accumulation, so the body legitimately doesn't reference it. Keep the parameter as part of the PyTorch convention and explicit-void the unused-param warning that fails -Werror builds on 3rd-party / android / vulkan CI lanes. --- tools/kokoro/include/kokoro-layers.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/kokoro/include/kokoro-layers.h b/tools/kokoro/include/kokoro-layers.h index a5147cff9..52212bca4 100644 --- a/tools/kokoro/include/kokoro-layers.h +++ b/tools/kokoro/include/kokoro-layers.h @@ -147,6 +147,9 @@ inline void convtranspose1d_forward( const float * W, const float * b, int Cout, int K, int stride, int pad, int output_pad, float * y, int T_out) { + // output_pad affects T_out (computed by caller) but does not change + // the per-element formula here. + (void)output_pad; // Zero output, then add contributions. std::memset(y, 0, sizeof(float) * (size_t)Cout * (size_t)T_out); if (b) { @@ -179,6 +182,9 @@ inline void convtranspose1d_depthwise_forward( const float * W, const float * b, int K, int stride, int pad, int output_pad, float * y, int T_out) { + // output_pad affects T_out (computed by caller) but does not change + // the per-element formula here. + (void)output_pad; std::memset(y, 0, sizeof(float) * (size_t)C * (size_t)T_out); for (int c = 0; c < C; ++c) { const float * xi = x + (size_t)c * T; From d115c6264aec016fb18758b2f7b577a4604262df Mon Sep 17 00:00:00 2001 From: Shaw Date: Tue, 19 May 2026 00:15:04 -0700 Subject: [PATCH 2/3] fix(android): gate omnivoice-dac-parity build on ggml-cpu target The parity harness calls ggml_backend_cpu_init() and ggml_backend_cpu_set_n_threads() directly. On Android NDK cross-compile the ggml-cpu CMake target is not defined, so the executable was being built with an unresolved link to ggml-cpu, producing: ld.lld: error: undefined symbol: ggml_backend_cpu_init ld.lld: error: undefined symbol: ggml_backend_cpu_set_n_threads Move the entire add_executable + add_test under `if(TARGET ggml-cpu)` so the test is silently skipped on backends without a CPU target, matching how tools/kokoro/CMakeLists.txt already gates kokoro_lib's ggml-cpu link. --- tools/omnivoice/CMakeLists.txt | 37 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/tools/omnivoice/CMakeLists.txt b/tools/omnivoice/CMakeLists.txt index 8ccfed072..8645698f8 100644 --- a/tools/omnivoice/CMakeLists.txt +++ b/tools/omnivoice/CMakeLists.txt @@ -244,25 +244,24 @@ target_link_libraries(omnivoice-test-abi-c PRIVATE omnivoice_lib) # dac_conv_t1d's ggml_conv_transpose_1d migration (elizaOS/eliza#7660). # The default run uses deterministic synthetic DAC block shapes; pass # `--gguf ` to exercise real conv_t1 weights. -add_executable(omnivoice-dac-parity tests/dac-parity.cpp) -target_compile_features(omnivoice-dac-parity PRIVATE cxx_std_17) -target_include_directories(omnivoice-dac-parity PRIVATE - ${CMAKE_SOURCE_DIR}/ggml/include - ${CMAKE_SOURCE_DIR}/ggml/src) -# Link ggml-cpu / ggml-base only when those CMake targets actually exist. -# On some cross-compile configurations (Android NDK in particular) the -# ggml-cpu target may not be defined, and naming it unconditionally in -# target_link_libraries makes CMake fall back to a literal `-lggml-cpu` -# link flag against a phantom library. Guard the link the same way -# tools/kokoro/CMakeLists.txt does for kokoro_lib. -target_link_libraries(omnivoice-dac-parity PRIVATE ggml) -if(TARGET ggml-base) - target_link_libraries(omnivoice-dac-parity PRIVATE ggml-base) -endif() +# +# The parity harness calls ggml_backend_cpu_init / ggml_backend_cpu_set_n_threads +# directly, so it can only be built when the ggml-cpu CMake target is present. +# On some cross-compile configurations (Android NDK in particular) the ggml-cpu +# target is not defined, and the executable would fail to link. Gate the whole +# target on ggml-cpu availability so those builds skip it cleanly. if(TARGET ggml-cpu) - target_link_libraries(omnivoice-dac-parity PRIVATE ggml-cpu) -endif() + add_executable(omnivoice-dac-parity tests/dac-parity.cpp) + target_compile_features(omnivoice-dac-parity PRIVATE cxx_std_17) + target_include_directories(omnivoice-dac-parity PRIVATE + ${CMAKE_SOURCE_DIR}/ggml/include + ${CMAKE_SOURCE_DIR}/ggml/src) + target_link_libraries(omnivoice-dac-parity PRIVATE ggml ggml-cpu) + if(TARGET ggml-base) + target_link_libraries(omnivoice-dac-parity PRIVATE ggml-base) + endif() -if(BUILD_TESTING) - add_test(NAME omnivoice-dac-parity COMMAND omnivoice-dac-parity --no-real) + if(BUILD_TESTING) + add_test(NAME omnivoice-dac-parity COMMAND omnivoice-dac-parity --no-real) + endif() endif() From 1e1876404babbdacda6ced1c93d9fbb80b8c4fd0 Mon Sep 17 00:00:00 2001 From: Shaw Date: Tue, 19 May 2026 00:16:58 -0700 Subject: [PATCH 3/3] test(gguf): pad bad-name to exceed GGML_MAX_NAME under any compile value tools/omnivoice/CMakeLists.txt bumps GGML_MAX_NAME to 128 PUBLIC on ggml + llama so audio tokenizer tensor names load correctly. That propagates to test-gguf.cpp, where the hand-crafted long-name test case had a hardcoded ~88-char string. Under GGML_MAX_NAME=128 the string was shorter than the limit, the BAD_NAME_SIZE branch failed to actually generate an oversize name, and the in-test sanity assert fired: GGML_ASSERT(name.length() >= GGML_MAX_NAME) failed Append the long suffix in a loop until name strictly exceeds GGML_MAX_NAME, so the oversize-name failure path is always exercised regardless of the GGML_MAX_NAME value the test is compiled with. --- tests/test-gguf.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test-gguf.cpp b/tests/test-gguf.cpp index ed3070dc4..93856e673 100644 --- a/tests/test-gguf.cpp +++ b/tests/test-gguf.cpp @@ -347,7 +347,13 @@ static FILE * get_handcrafted_file(const unsigned int seed, const enum handcraft name += "_" + std::to_string(i); } if (hft == HANDCRAFTED_TENSORS_BAD_NAME_SIZE) { - name += "_with_a_very_long_name_which_is_longer_than_what_is_allowed_for_ggml_tensors"; + // Pad past GGML_MAX_NAME (default 64, can be raised at build time + // — omnivoice bumps it to 128). Keep growing until we're strictly + // over the limit so the "bad name size" branch actually exercises + // the oversize-name failure path under any GGML_MAX_NAME. + while (name.length() < (size_t) GGML_MAX_NAME) { + name += "_with_a_very_long_name_which_is_longer_than_what_is_allowed_for_ggml_tensors"; + } GGML_ASSERT(name.length() >= GGML_MAX_NAME); } {