Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug]: CMake: four native-expert tests are registered only from the second configure (STRATA_NATIVE_EXPERTS is read before its option())

Open Beginner friendly
#2,027 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cmake, cpp

Research direction

In CMakeLists.txt, STRATA_NATIVE_EXPERTS is read near line 538 before its option() declaration near line 1210. Read the options section and the GPU test registration block, then configure once with CUDA and tests enabled and compare the registered test count. Move the option declaration before its first use; done means all four native expert tests are registered on the first configure.

Written by the indexing model from the issue text.

Description

What happened

In a GPU build, CMakeLists.txt reads STRATA_NATIVE_EXPERTS at line 538 (if(STRATA_BUILD_TESTS AND STRATA_NATIVE_EXPERTS), inside the if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) block from line 292) before option(STRATA_NATIVE_EXPERTS "Native (IQ) expert support through ggml-cpu" ON) defines it at line 1210 (v0.1.43, 7695859a). On a fresh build directory the variable is still unset at line 538, so that block registers nothing. The option() then writes it to the cache, and only the next configure registers the four tests: expert_layout_test, native_dense_ple_key_test, expert_cache_per_layer_test and expert_cache_segmented_test. A build directory configured once (as in CI or a first build) runs four tests fewer than one configured twice.

Steps (configure only, nothing built):

cmake -S . -B build -DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_TESTS=ON -DCMAKE_CUDA_ARCHITECTURES=120
ctest --test-dir build -N | tail -1      # Total Tests: 109
cmake -S . -B build
ctest --test-dir build -N | tail -1      # Total Tests: 113

(I also passed -DSTRATA_GGML_DIR pointing at a llama.cpp checkout and -DCMAKE_CUDA_COMPILER.) A CPU-only configure is not affected: it registers 39 tests both times, since the block is in the GPU section. v0.1.42 had it at lines 538 / 1199 (108 → 112) and v0.1.41 at 488 / 1131 (95 → 99); the four passed there once registered.

Suggested fix: move option(STRATA_NATIVE_EXPERTS ...) from line 1210 up to the other option()s (lines 14–101), so it is defined before line 538 reads it.

Not tested: HIP builds (the same block), other CMake versions.

Strata version, GPU, OS

v0.1.43 (7695859a) source, CMake 3.28.3, CUDA 13.3 · configure only, so the GPU does not matter (RTX 5080 + RTX 4060 Ti here) · Linux 7.0 (Ubuntu 24.04-based)

Engine log

Not applicable (configure time).

Measured and drafted with Claude Code.

Dominant language
C++
Stars
11.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Niko1221/Strata

All issues in Niko1221/Strata

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.