[Engine] 0.1.73 (v0.2.25): --serve without --expert-profile segfaults in the adaptive tier on the first request (host_res is empty)
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- backend, performance
Research direction
Start in engine/src/program/generate.cpp at the reported adaptive-tier condition around line 15138, then read adapt() around line 15502 and the graph_hits/profile setup around line 11124. Reproduce with --expert-cache and no --expert-profile, then check the existing --expert-profile-save guard for the expected profile handling. Done when the same request no longer segfaults and the missing-profile case is handled with a clear message or by leaving adaptation off.
Written by the indexing model from the issue text.
Description
Version: Strata v0.2.25, engine 0.1.73-metal (the released binary; also a self-built one from the v0.2.25 tag)
Hardware: Mac Studio, Apple M5 Ultra, 96 GB unified memory, macOS 27
What happens
A hand-written run config that has --expert-cache N but no --expert-profile starts fine, then the engine dies with SIGSEGV on the first request (the server answers 503):
strata metal: crashed (signal 11 at address 0x0) - the call stack:
0 strata metal_crash + 64
1 libsystem_platform.dylib _sigtramp + 56
2 strata std::__thread_proxy<... main::$_341> + 104
Repro
The released engine with a Qwen3.8-Flash-Next IQ3_S pack, the usual arguments minus --expert-profile:
--pack <pack> --native <shard1> --ple-gguf <shard2> --expert-cache 64 --prefill auto --max-context 262144 --mmap-experts
Any chat request then crashes it. Adding --expert-profile terminal/data/expert-profile.bin (or --adapt-swaps 0) makes it run.
Cause
With a RelWithDebInfo build and the faulting pc from the signal context, the crash is in adapt() at engine/src/program/generate.cpp:15502 (v0.2.25):
const int32_t* r = host_res.data() + l * g.n_expert;
...
if (r[e] < 0) { // host_res is empty -> null read
host_resis only built whengraph_hitsis true, andgraph_hitsneeds!profile.empty()(line 11124).- The adaptive tier is switched on at line 15138 without looking at it:
if (o.adapt_every > 0 && o.adapt_swaps > 0 && !all_experts_resident && live_gpu_slots > 0) drive.d.usage.assign(...)
(all_experts_residentis false whenhost_resis empty). - So with no profile and a cache of at least one slot, the first adapt round reads a null table.
--expert-profile-save already checks for this case (drive.d.usage.empty() || host_res.empty() -> "needs ... --expert-profile"), the tier itself does not.
Suggested fix
Either && !host_res.empty() on line 15138 (the tier stays off, one log line saying it needs --expert-profile), or refuse the start with that message. setup never hits this because it always passes a profile (the neutral one for other shapes), so it only bites hand-written configs.
- Dominant language
- C++
- Stars
- 11.6k
- Forks
- 1k
- Avg merge
- 6d 2h
- Merged PRs (30d)
- 21
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Niko1221/Strata
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Niko1221/Strata#7746 · 2 comments · 1 reaction ·
Maintainers usually reply within 4 days
-
[Other] tune run --mode api --hold <size> renders the literal "None" into the worker command line, engine exits with code 2Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Niko1221/Strata#7719 · 2 comments ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Niko1221/Strata#7684 · 2 comments ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Niko1221/Strata#7670 · 3 comments ·
Maintainers usually reply within 4 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
eclipse-score/logging#531 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
azahar-emu/azahar#2944 ·
Maintainers usually reply within 1 day
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
conan-io/conan-center-index#31637 ·
Maintainers usually reply within 1 day