[GH-ISSUE #4044] [Engine] STRATA_ARENA_MMAP creates experts.bin rejected by low-RAM startup #1747

Closed
opened 2026-11-04 01:53:43 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Jackmeson1 on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4044

Area

[Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source?

Source (START-HERE.bat, setup.sh or a build)

What happened

On a fresh native Q2_0 pack made by tools/iq_pack.py, with no experts.bin, --mmap-experts started successfully. The --resident-experts command also started, but warned that available memory could not be determined and fell back to --mmap-experts. A start with STRATA_ARENA_MMAP=1 then wrote the pack's experts.bin, and a second start with the variable mapped it successfully. Subsequent starts without the variable, using either --mmap-experts or --resident-experts, exited with code 1:

strata generate: FileExpertSource: /content/Strata-data/packs/q2_0_native/experts.bin is 33975244800 B but the loaded expert layout requires 33973862400 B - this is not the pack this geometry came from

docs/DETAILS.md:246-251 documents creation and reuse of experts.bin by STRATA_ARENA_MMAP=1 and says, "Without the variable nothing changes." It does not explicitly describe switching back after the file has been created. Separately, docs/DETAILS.md:262-265 documents that native Q2_0 packs made by tools/iq_pack.py can use mapped experts directly from the GGUF files when experts.bin is absent. In this run, the engine-created file prevented the previously successful low-RAM commands from starting. The diagnostic attributed the mismatch to the wrong pack, although the engine had created the file from this pack.

From the code at 7dd5cf18: the arena writer writes the expert bytes and then a zero-filled padding blob to experts.bin (src/core/expert_source.cpp:5941-5950). On Linux, FileExpertSource accepts only a file of exactly the layout size (src/core/expert_source.cpp:1496-1505). The file is 1,382,400 B longer than the layout.

Expected: creating experts.bin through the documented mapped-arena option should leave this native pack usable with its other documented startup options, or the documentation should explain the incompatibility and provide recovery steps.

Smallest steps or command that reproduce it

Prerequisites: Bash on Linux, a built engine from commit 7dd5cf18, the two named GGUF shards, the canonical Q2_0 base pack, the MTP files, and the repository's expert profile. The build and existing model files are those used in #4035; the paths below are from my run. The base pack's manifest must still reference an accessible source shard. Use a fresh native-pack output directory. These commands condense the recorded script, which removed that output directory before packing and wrapped each engine start in timeout 900. Each successful start reads QUIT from stdin after initialization; no generation request is sent.

cd /content/Strata
ENGINE=/content/Strata/build/strata
PACK=/content/Strata-data/packs/q2_0
GGUF1=/content/Strata-data/models/Q2_0/Qwen3.8-Flash-Next-GSQ-RCO-Q2_0-00001-of-00002.gguf
GGUF2=/content/Strata-data/models/Q2_0/Qwen3.8-Flash-Next-GSQ-RCO-Q2_0-00002-of-00002.gguf
NP=/content/Strata-data/packs/q2_0_native
unset STRATA_ARENA_MMAP
if [ -e "$NP" ] || [ -L "$NP" ]; then
    printf '%s\n' 'Choose a new NP path; this reproduction requires a fresh output directory.' >&2
    exit 1
fi

python3 tools/iq_pack.py --gguf "$GGUF1" --base "$PACK" --out "$NP" || exit 1
test ! -e "$NP/experts.bin" || exit 1

NATIVE=(--pack "$NP" --native "$GGUF1" --ple-gguf "$GGUF2" --expert-profile /content/Strata/data/expert-profile.bin
        --mtp /content/Strata-data/mtp/rt --spec 4 --spec-min-p 0.5 --max-context 4096 --kv int8 --ple-io ram
        --prefill 512 --expert-cache 12000 --adapt-swaps 0 --pcie-frac 0)

printf 'QUIT\n' | "$ENGINE" --serve "${NATIVE[@]}" --mmap-experts       # control: starts, no experts.bin yet
printf 'QUIT\n' | "$ENGINE" --serve "${NATIVE[@]}" --resident-experts   # control: starts; this run warned and fell back to mmap
printf 'QUIT\n' | STRATA_ARENA_MMAP=1 "$ENGINE" --serve "${NATIVE[@]}"   # writes experts.bin
printf 'QUIT\n' | STRATA_ARENA_MMAP=1 "$ENGINE" --serve "${NATIVE[@]}"   # maps it
printf 'QUIT\n' | "$ENGINE" --serve "${NATIVE[@]}" --mmap-experts       # exit 1, FileExpertSource size error
printf 'QUIT\n' | "$ENGINE" --serve "${NATIVE[@]}" --resident-experts   # exit 1, the same error
printf 'QUIT\n' | "$ENGINE" --serve "${NATIVE[@]}"                      # starts

Run the sequence without set -e (saved as a script and run with bash): the two expected failures must not prevent the final control from running. The fresh-directory and environment guards above make the intended starting state explicit; they were not literal commands in the recorded script.

Before the writer start, the output filesystem must report at least 36,122,728,448 bytes available: the 33,975,244,800-byte file plus 2 GiB. Otherwise the engine skips creating it (src/core/expert_source.cpp:5933-5940).

Reproduction status

Reproduced locally

Strata version

Commit 7dd5cf18e68c639a8773e096c5c79f971ea2a9f5, engine 0.1.49.2

Graphics card, memory and system

NVIDIA RTX PRO 6000 Blackwell Server Edition 97,887 MiB · 176 GiB RAM · Ubuntu 24.04.4 LTS (Linux 6.6.122+, Google Colab), driver 580.82.07, CUDA 13.0.88, GCC 13.3.0, Python 3.13.16, AMD EPYC 9B45 (48 logical CPUs)

Model, size and settings

Qwen3.8-Flash-Next GSQ-RCO Q2_0, native pack from tools/iq_pack.py (default options) · 4096 context · INT8 KV · flags above

Logs

My run, 2026-10-25 (exit code, then the matching log lines):

=== c1_mmap_before: (no env) /content/Strata/build/strata --serve <native args> --mmap-experts
exit=0
strata generate: session is up (engine 0.1.49.2)
ls: cannot access '/content/Strata-data/packs/q2_0_native/experts.bin': No such file or directory
=== c2_resident_before: (no env) /content/Strata/build/strata --serve <native args> --resident-experts
exit=0
strata generate: session is up (engine 0.1.49.2)
=== a1_arena_mmap_write: STRATA_ARENA_MMAP=1 /content/Strata/build/strata --serve <native args> 
exit=0
strata generate: STRATA_ARENA_MMAP: wrote /content/Strata-data/packs/q2_0_native/experts.bin (the next start maps it)
strata generate: session is up (engine 0.1.49.2)
-rw-r--r-- 1 root root 33975244800 Oct 25 01:03 /content/Strata-data/packs/q2_0_native/experts.bin
=== a2_arena_mmap_map: STRATA_ARENA_MMAP=1 /content/Strata/build/strata --serve <native args> 
exit=0
strata generate: expert arena: mapped read-only from /content/Strata-data/packs/q2_0_native/experts.bin (STRATA_ARENA_MMAP: not locked, not pinned)
strata generate: session is up (engine 0.1.49.2)
=== t1_mmap_after: (no env) /content/Strata/build/strata --serve <native args> --mmap-experts
exit=1
strata generate: FileExpertSource: /content/Strata-data/packs/q2_0_native/experts.bin is 33975244800 B but the loaded expert layout requires 33973862400 B - this is not the pack this geometry came from
=== t2_resident_after: (no env) /content/Strata/build/strata --serve <native args> --resident-experts
exit=1
strata generate: FileExpertSource: /content/Strata-data/packs/q2_0_native/experts.bin is 33975244800 B but the loaded expert layout requires 33973862400 B - this is not the pack this geometry came from
=== t3_default_after: (no env) /content/Strata/build/strata --serve <native args> 
exit=0
strata generate: session is up (engine 0.1.49.2)

The --resident-experts control fell back to --mmap-experts because both resident-memory attempts could not determine available memory. After experts.bin existed, the same command failed in FileExpertSource::open, before resident allocation or fallback was attempted. This run does not demonstrate successful active resident operation.

tests/core/file_expert_source_test.cpp:88 checks that files one byte shorter or longer than the payload are refused, so oversized-file rejection itself is intended; it does not exercise the file the arena writer produces.

Not checked: generation, successful active resident operation, whether deleting experts.bin restores startup, a native pack made with iq_pack.py --experts-bin, the transition on canonical packs, or Windows and other backends.

Originally created by @Jackmeson1 on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4044 ### Area [Engine] (speed, kernels, models, the server and API) ### Desktop app, Terminal or source? Source (START-HERE.bat, setup.sh or a build) ### What happened On a fresh native Q2_0 pack made by `tools/iq_pack.py`, with no `experts.bin`, `--mmap-experts` started successfully. The `--resident-experts` command also started, but warned that available memory could not be determined and fell back to `--mmap-experts`. A start with `STRATA_ARENA_MMAP=1` then wrote the pack's `experts.bin`, and a second start with the variable mapped it successfully. Subsequent starts without the variable, using either `--mmap-experts` or `--resident-experts`, exited with code 1: ```text strata generate: FileExpertSource: /content/Strata-data/packs/q2_0_native/experts.bin is 33975244800 B but the loaded expert layout requires 33973862400 B - this is not the pack this geometry came from ``` `docs/DETAILS.md:246-251` documents creation and reuse of `experts.bin` by `STRATA_ARENA_MMAP=1` and says, "Without the variable nothing changes." It does not explicitly describe switching back after the file has been created. Separately, `docs/DETAILS.md:262-265` documents that native Q2_0 packs made by `tools/iq_pack.py` can use mapped experts directly from the GGUF files when `experts.bin` is absent. In this run, the engine-created file prevented the previously successful low-RAM commands from starting. The diagnostic attributed the mismatch to the wrong pack, although the engine had created the file from this pack. From the code at `7dd5cf18`: the arena writer writes the expert bytes and then a zero-filled padding blob to `experts.bin` (`src/core/expert_source.cpp:5941-5950`). On Linux, `FileExpertSource` accepts only a file of exactly the layout size (`src/core/expert_source.cpp:1496-1505`). The file is 1,382,400 B longer than the layout. Expected: creating `experts.bin` through the documented mapped-arena option should leave this native pack usable with its other documented startup options, or the documentation should explain the incompatibility and provide recovery steps. ### Smallest steps or command that reproduce it Prerequisites: Bash on Linux, a built engine from commit `7dd5cf18`, the two named GGUF shards, the canonical Q2_0 base pack, the MTP files, and the repository's expert profile. The build and existing model files are those used in #4035; the paths below are from my run. The base pack's manifest must still reference an accessible source shard. Use a fresh native-pack output directory. These commands condense the recorded script, which removed that output directory before packing and wrapped each engine start in `timeout 900`. Each successful start reads `QUIT` from stdin after initialization; no generation request is sent. ```bash cd /content/Strata ENGINE=/content/Strata/build/strata PACK=/content/Strata-data/packs/q2_0 GGUF1=/content/Strata-data/models/Q2_0/Qwen3.8-Flash-Next-GSQ-RCO-Q2_0-00001-of-00002.gguf GGUF2=/content/Strata-data/models/Q2_0/Qwen3.8-Flash-Next-GSQ-RCO-Q2_0-00002-of-00002.gguf NP=/content/Strata-data/packs/q2_0_native unset STRATA_ARENA_MMAP if [ -e "$NP" ] || [ -L "$NP" ]; then printf '%s\n' 'Choose a new NP path; this reproduction requires a fresh output directory.' >&2 exit 1 fi python3 tools/iq_pack.py --gguf "$GGUF1" --base "$PACK" --out "$NP" || exit 1 test ! -e "$NP/experts.bin" || exit 1 NATIVE=(--pack "$NP" --native "$GGUF1" --ple-gguf "$GGUF2" --expert-profile /content/Strata/data/expert-profile.bin --mtp /content/Strata-data/mtp/rt --spec 4 --spec-min-p 0.5 --max-context 4096 --kv int8 --ple-io ram --prefill 512 --expert-cache 12000 --adapt-swaps 0 --pcie-frac 0) printf 'QUIT\n' | "$ENGINE" --serve "${NATIVE[@]}" --mmap-experts # control: starts, no experts.bin yet printf 'QUIT\n' | "$ENGINE" --serve "${NATIVE[@]}" --resident-experts # control: starts; this run warned and fell back to mmap printf 'QUIT\n' | STRATA_ARENA_MMAP=1 "$ENGINE" --serve "${NATIVE[@]}" # writes experts.bin printf 'QUIT\n' | STRATA_ARENA_MMAP=1 "$ENGINE" --serve "${NATIVE[@]}" # maps it printf 'QUIT\n' | "$ENGINE" --serve "${NATIVE[@]}" --mmap-experts # exit 1, FileExpertSource size error printf 'QUIT\n' | "$ENGINE" --serve "${NATIVE[@]}" --resident-experts # exit 1, the same error printf 'QUIT\n' | "$ENGINE" --serve "${NATIVE[@]}" # starts ``` Run the sequence without `set -e` (saved as a script and run with `bash`): the two expected failures must not prevent the final control from running. The fresh-directory and environment guards above make the intended starting state explicit; they were not literal commands in the recorded script. Before the writer start, the output filesystem must report at least 36,122,728,448 bytes available: the 33,975,244,800-byte file plus 2 GiB. Otherwise the engine skips creating it (`src/core/expert_source.cpp:5933-5940`). ### Reproduction status Reproduced locally ### Strata version Commit `7dd5cf18e68c639a8773e096c5c79f971ea2a9f5`, engine `0.1.49.2` ### Graphics card, memory and system NVIDIA RTX PRO 6000 Blackwell Server Edition 97,887 MiB · 176 GiB RAM · Ubuntu 24.04.4 LTS (Linux 6.6.122+, Google Colab), driver 580.82.07, CUDA 13.0.88, GCC 13.3.0, Python 3.13.16, AMD EPYC 9B45 (48 logical CPUs) ### Model, size and settings Qwen3.8-Flash-Next GSQ-RCO Q2_0, native pack from `tools/iq_pack.py` (default options) · 4096 context · INT8 KV · flags above ### Logs My run, 2026-10-25 (exit code, then the matching log lines): ```text === c1_mmap_before: (no env) /content/Strata/build/strata --serve <native args> --mmap-experts exit=0 strata generate: session is up (engine 0.1.49.2) ls: cannot access '/content/Strata-data/packs/q2_0_native/experts.bin': No such file or directory === c2_resident_before: (no env) /content/Strata/build/strata --serve <native args> --resident-experts exit=0 strata generate: session is up (engine 0.1.49.2) === a1_arena_mmap_write: STRATA_ARENA_MMAP=1 /content/Strata/build/strata --serve <native args> exit=0 strata generate: STRATA_ARENA_MMAP: wrote /content/Strata-data/packs/q2_0_native/experts.bin (the next start maps it) strata generate: session is up (engine 0.1.49.2) -rw-r--r-- 1 root root 33975244800 Oct 25 01:03 /content/Strata-data/packs/q2_0_native/experts.bin === a2_arena_mmap_map: STRATA_ARENA_MMAP=1 /content/Strata/build/strata --serve <native args> exit=0 strata generate: expert arena: mapped read-only from /content/Strata-data/packs/q2_0_native/experts.bin (STRATA_ARENA_MMAP: not locked, not pinned) strata generate: session is up (engine 0.1.49.2) === t1_mmap_after: (no env) /content/Strata/build/strata --serve <native args> --mmap-experts exit=1 strata generate: FileExpertSource: /content/Strata-data/packs/q2_0_native/experts.bin is 33975244800 B but the loaded expert layout requires 33973862400 B - this is not the pack this geometry came from === t2_resident_after: (no env) /content/Strata/build/strata --serve <native args> --resident-experts exit=1 strata generate: FileExpertSource: /content/Strata-data/packs/q2_0_native/experts.bin is 33975244800 B but the loaded expert layout requires 33973862400 B - this is not the pack this geometry came from === t3_default_after: (no env) /content/Strata/build/strata --serve <native args> exit=0 strata generate: session is up (engine 0.1.49.2) ``` The `--resident-experts` control fell back to `--mmap-experts` because both resident-memory attempts could not determine available memory. After `experts.bin` existed, the same command failed in `FileExpertSource::open`, before resident allocation or fallback was attempted. This run does not demonstrate successful active resident operation. `tests/core/file_expert_source_test.cpp:88` checks that files one byte shorter or longer than the payload are refused, so oversized-file rejection itself is intended; it does not exercise the file the arena writer produces. Not checked: generation, successful active resident operation, whether deleting `experts.bin` restores startup, a native pack made with `iq_pack.py --experts-bin`, the transition on canonical packs, or Windows and other backends.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6659888302 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1747
No description provided.