Skip to content

Make the test harnesses link again: backend registry and engine lib path - #791

Open
zaneni6 wants to merge 1 commit into
mainfrom
fix/test-harness-registry
Open

zaneni6 wants to merge 1 commit into
mainfrom
fix/test-harness-registry

Conversation

@zaneni6

@zaneni6 zaneni6 commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Most standalone test harnesses under src/test/ no longer link on main. This fixes the two causes that apply to all of them.

  • Backend registry. automodel.cpp builds engines through the backend registry, so a harness that compiles it also has to compile model_backend.cpp and define register_builtin_backends, as create_new_model.md says. Only the MiniCPM-V and rai harnesses did. The other 20 now do. Each registers the families of the engine libraries it already links, taken from builtin_backends.cpp. For example, qwen3_npu registers qwen3, qwen3-it, qwen3-tk and deepseek-r1-0528. Qwen3.5-Omni builds its engine itself, so its harness registers nothing.
  • Engine library path. Since the HRX split, the prebuilt engine libraries live in src/lib/xrt and src/lib/hrx, but add_npu_test still linked from src/lib. It now links from src/lib/xrt, since the harness CMake is XRT-only.

Also:

  • Whisper's Makefile drops automodel.cpp. Whisper never used it, and its CMake build already did without it.
  • The MiniCPM-V harness CMake gets the image sources, AVX-512 and ffmpeg setup that its Makefile already has, the same as the other vision harnesses.

Testing

Windows, MSVC, CMake path:

  • Results:
    • MiniCPM-V, gemma_npu, gemma_text_npu, gpt_oss_npu, hunyuan_npu, lfm2_npu, llama_npu, nanbeige_npu, phi4_npu, qwen2_npu, qwen2vl_npu, qwen3_5vl_npu, qwen3_6_moe_npu, qwen3_npu, qwen3vl_flash and qwen3vl_npu build and link.
    • gemma4_12b, gemma4e_flash, gemma4e_npu, qwen3_5_omni_npu, qwen3_8mtp_npu and whisper_npu still fail to link, for the reasons under "Not in this PR". None of them has registry errors left.
  • The MiniCPM-V harness runs all four turns on the NPU: a prompt, a prompt-cache follow-up, a thinking prompt and an image.
  • The Linux Makefiles are not tested.

Not in this PR

  • gemma4_12b and qwen3_5_omni_npu CMake don't link swresample or fftw, which their audio sources need.
  • qwen3_8mtp_npu CMake is missing its image sources.
  • gemma4e_* and whisper_npu link libfftw3-3.lib, which src/lib ships only as a .def and .dll.

#790 adds the chat library to the same harnesses. The two PRs merge without conflicts in either order.

🤖 Generated with Claude Code

automodel.cpp builds engines through the backend registry, so every harness
that compiles it has to compile model_backend.cpp and define
register_builtin_backends; only the MiniCPM-V and rai harnesses did. The
others now register the families of the engine libraries they link (none for
Qwen3.5-Omni, which builds its engine itself). Whisper's Makefile drops
automodel.cpp, which it never used; its CMake build already did without.

Also link the harnesses from lib/xrt, where the engine libs moved with the
HRX split, and give the MiniCPM-V harness the image sources its Makefile has.

Co-Authored-By: Claude <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant