[GH-ISSUE #1919] Small defects in setup, serve, the engine and the build, still present on v0.1.42 #759

Closed
opened 2026-11-04 01:45:38 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @gputier on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1919

A read of v0.1.42 turned up the defects below. Each one was checked against the source, and the file:line references are v0.1.42 line numbers. None of them changes the normal output on a supported PC, and none is a calculation error. Items marked "read only" follow from the code, but I did not reproduce them on a GPU.

  • setup.py:1703 (also whole_shard at setup.py:1547), with tools/gguf_reader.py:66-72: expected_bytes() returns None when the tensor type is missing from BLOCK_GEOMETRY, or when the element count is not a block multiple. Both callers fall back to or 0. So a truncated shard whose last tensor has such a type passes check_shards as whole, and the engine fails later. Setup should stop and name the short shard. (read only)

  • tools/gguf_reader.py:117 (GGUF_META[t]), tools/gguf_reader.py:112-113 and :128: an unknown metadata value type raises KeyError, and a 64-bit string length makes fh.read() raise OverflowError. setup.py:1701 catches only (ValueError, struct.error), so setup prints a Python traceback instead of a message. Reproduced on a synthetic header: value type 99 gives "KeyError: 99", and a string length of 2**63 gives "OverflowError". Expected: "is not a whole GGUF shard" for every malformed header.

  • setup.py:3859-3864 (write_config), with the api_key written at setup.py:5727-5728: the run config holds the API key and is written with the default umask. The write path has no chmod 0600. Expected: mode 0600 on POSIX. (read only)

  • setup.py:3829 and setup.py:3847-3848 (data_folder): a folder whose data has already left is skipped (not has_data(folder)) before repoint_config runs on its configs. Its strata-*.json files keep the old model paths. Expected: the configs of every install that points into the moved folder get repointed. (read only)

  • setup.py:3756-3775 (move_into): there is no symlink check. For a symlink to a directory, src.is_dir() is true and iterdir() follows the link. The target's files are moved out and the link stays in place. Expected: a symlinked folder is left alone, neither merged nor emptied. (read only)

  • setup.py:3668-3671 (the low-RAM confirm_risk text): "A smaller size (Q2_0 or IQ2_XS) fits" and "choose Q2_0 or IQ2_XS" are printed for every family. But Q2_0 is offered only for family qwen (MODELS, setup.py:204). With --family swift, the advice names a model that setup does not offer for that family. Expected: the suggestion lists only the models of the chosen family.

  • tools/iq_pack.py:575 now writes native_experts.txt through a temporary file. setup.py:5531, however, treats the file's existence alone as "pack finished". A native_experts.txt left by a run before #172 is still accepted, so the pack is not rebuilt. Expected: the completeness check reads the content (or a size or hash) before skipping the build. (read only)

  • serve/server.py:843-844 (death_note): when no watchdog line is found, the cause is taken from the last log line starting with "strata" or "ERR". A progress line such as "strata trace: read N tokens" (src/program/generate.cpp:10776) can therefore be quoted as the cause of the exit. Expected: only an exit or error line is quoted. (read only)

  • docs/DETAILS.md:652-662: the endpoints table has no row for /settings. The route appears only in prose, at lines 871 and 891. Expected: a table row for GET and POST /settings, with the same API-key rule as the prose.

  • .gitignore:22: the comment "# Pi harness metadata (local session state, not project source)" is not followed by any pattern that matches Pi harness metadata. The patterns below it (*.sqlite, *.npz) do not match it. Expected: remove the comment, or move it above the patterns it describes.

  • src/program/generate.cpp:10787 and :10794 (prompt read failure in serve): cudaPeekAtLastError() reads the last CUDA error without clearing it. So an error that was already handled and is not sticky makes the engine call std::_Exit(1) instead of returning 1 (line 10787). When stop_req is set, a fault raised at the same time is reported as a cancellation (cancelled = true, line 10794) without checking the error. Expected: a sticky check with cudaGetLastError(), and the error checked in the stop branch too. (read only)

  • src/program/generate.cpp:7420-7424 with src/core/verify.cpp:495-501: serve with no expert cache (d_res == nullptr) fails in Verifier::init ("verify: needs the profile-filled VRAM expert tier ..."), and serve returns 1, so no server starts. The message suggests a smaller --max-context, --kv q4_0, --draft-vocab en, or images on the CPU. None of these lets the server start without a cache. Expected: either a serve path that works without the cache, or a refusal that names a setting that does work. (read only)

  • src/program/generate.cpp:12096-12108 (generate mode): with no residency table, the prompt path does not lend cache slots and keeps the automatic chunk, prefill_auto_max, which defaults to 8192 (generate.cpp:527). The fallback to 1024 for a card with no cache (generate.cpp:7035-7036, "#85") exists only in the serve path. Expected: the same 1024 fallback in generate mode. (read only)

  • src/core/device.cu:247 and :309 (device_info): the compute capability refusal (kMinCc = 75) runs only inside device_info(). Its only caller in the tree is src/core/device_main.cpp:66 (strata-device). The engine does not call device_info(), so in the engine a card below 7.5 is not refused by this check. Expected: the same refusal in the engine start path, or a comment saying the check is diagnostic only.

  • CMakeLists.txt:164: continue() for the values native, all and all-major skips the rest of the loop body. So the warning for sm_120 with CUDA below 13.0 (CMakeLists.txt:183-185) is never printed for those values. Read only: the warning was not seen with a real CUDA 12.8 toolkit. Expected: the warning runs for every value that resolves to sm_120.

  • CMakeLists.txt (whole file): the Python tests (serve/test_.py and tools/test_.py) are not registered with add_test, so ctest does not run them. The .github/ directory holds only the issue and pull request templates, with no workflow, so no CI runs them on a push either. Expected: the Python tests are registered in ctest, and a workflow runs ctest and the Python tests.

  • Missing tests: no test exercises repoint_config (setup.py:3777), _cpuid_avx2 (setup.py:713) or the need_cuda version gate (setup.py:3229). Expected: one test for each.

Originally created by @gputier on GitHub (Oct 11, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1919 A read of v0.1.42 turned up the defects below. Each one was checked against the source, and the file:line references are v0.1.42 line numbers. None of them changes the normal output on a supported PC, and none is a calculation error. Items marked "read only" follow from the code, but I did not reproduce them on a GPU. - setup.py:1703 (also whole_shard at setup.py:1547), with tools/gguf_reader.py:66-72: expected_bytes() returns None when the tensor type is missing from BLOCK_GEOMETRY, or when the element count is not a block multiple. Both callers fall back to `or 0`. So a truncated shard whose last tensor has such a type passes check_shards as whole, and the engine fails later. Setup should stop and name the short shard. (read only) - tools/gguf_reader.py:117 (GGUF_META[t]), tools/gguf_reader.py:112-113 and :128: an unknown metadata value type raises KeyError, and a 64-bit string length makes fh.read() raise OverflowError. setup.py:1701 catches only (ValueError, struct.error), so setup prints a Python traceback instead of a message. Reproduced on a synthetic header: value type 99 gives "KeyError: 99", and a string length of 2**63 gives "OverflowError". Expected: "is not a whole GGUF shard" for every malformed header. - setup.py:3859-3864 (write_config), with the api_key written at setup.py:5727-5728: the run config holds the API key and is written with the default umask. The write path has no chmod 0600. Expected: mode 0600 on POSIX. (read only) - setup.py:3829 and setup.py:3847-3848 (data_folder): a folder whose data has already left is skipped (`not has_data(folder)`) before repoint_config runs on its configs. Its strata-*.json files keep the old model paths. Expected: the configs of every install that points into the moved folder get repointed. (read only) - setup.py:3756-3775 (move_into): there is no symlink check. For a symlink to a directory, src.is_dir() is true and iterdir() follows the link. The target's files are moved out and the link stays in place. Expected: a symlinked folder is left alone, neither merged nor emptied. (read only) - setup.py:3668-3671 (the low-RAM confirm_risk text): "A smaller size (Q2_0 or IQ2_XS) fits" and "choose Q2_0 or IQ2_XS" are printed for every family. But Q2_0 is offered only for family qwen (MODELS, setup.py:204). With --family swift, the advice names a model that setup does not offer for that family. Expected: the suggestion lists only the models of the chosen family. - tools/iq_pack.py:575 now writes native_experts.txt through a temporary file. setup.py:5531, however, treats the file's existence alone as "pack finished". A native_experts.txt left by a run before #172 is still accepted, so the pack is not rebuilt. Expected: the completeness check reads the content (or a size or hash) before skipping the build. (read only) - serve/server.py:843-844 (death_note): when no watchdog line is found, the cause is taken from the last log line starting with "strata" or "ERR". A progress line such as "strata trace: read N tokens" (src/program/generate.cpp:10776) can therefore be quoted as the cause of the exit. Expected: only an exit or error line is quoted. (read only) - docs/DETAILS.md:652-662: the endpoints table has no row for /settings. The route appears only in prose, at lines 871 and 891. Expected: a table row for GET and POST /settings, with the same API-key rule as the prose. - .gitignore:22: the comment "# Pi harness metadata (local session state, not project source)" is not followed by any pattern that matches Pi harness metadata. The patterns below it (*.sqlite, *.npz) do not match it. Expected: remove the comment, or move it above the patterns it describes. - src/program/generate.cpp:10787 and :10794 (prompt read failure in serve): cudaPeekAtLastError() reads the last CUDA error without clearing it. So an error that was already handled and is not sticky makes the engine call std::_Exit(1) instead of returning 1 (line 10787). When stop_req is set, a fault raised at the same time is reported as a cancellation (cancelled = true, line 10794) without checking the error. Expected: a sticky check with cudaGetLastError(), and the error checked in the stop branch too. (read only) - src/program/generate.cpp:7420-7424 with src/core/verify.cpp:495-501: serve with no expert cache (d_res == nullptr) fails in Verifier::init ("verify: needs the profile-filled VRAM expert tier ..."), and serve returns 1, so no server starts. The message suggests a smaller --max-context, --kv q4_0, --draft-vocab en, or images on the CPU. None of these lets the server start without a cache. Expected: either a serve path that works without the cache, or a refusal that names a setting that does work. (read only) - src/program/generate.cpp:12096-12108 (generate mode): with no residency table, the prompt path does not lend cache slots and keeps the automatic chunk, prefill_auto_max, which defaults to 8192 (generate.cpp:527). The fallback to 1024 for a card with no cache (generate.cpp:7035-7036, "#85") exists only in the serve path. Expected: the same 1024 fallback in generate mode. (read only) - src/core/device.cu:247 and :309 (device_info): the compute capability refusal (kMinCc = 75) runs only inside device_info(). Its only caller in the tree is src/core/device_main.cpp:66 (strata-device). The engine does not call device_info(), so in the engine a card below 7.5 is not refused by this check. Expected: the same refusal in the engine start path, or a comment saying the check is diagnostic only. - CMakeLists.txt:164: `continue()` for the values native, all and all-major skips the rest of the loop body. So the warning for sm_120 with CUDA below 13.0 (CMakeLists.txt:183-185) is never printed for those values. Read only: the warning was not seen with a real CUDA 12.8 toolkit. Expected: the warning runs for every value that resolves to sm_120. - CMakeLists.txt (whole file): the Python tests (serve/test_*.py and tools/test_*.py) are not registered with add_test, so ctest does not run them. The .github/ directory holds only the issue and pull request templates, with no workflow, so no CI runs them on a push either. Expected: the Python tests are registered in ctest, and a workflow runs ctest and the Python tests. - Missing tests: no test exercises repoint_config (setup.py:3777), _cpuid_avx2 (setup.py:713) or the need_cuda version gate (setup.py:3229). Expected: one test for each.
Author
Owner

@gputier commented on GitHub (Oct 17, 2026):

Re-checked against v0.1.45. Every item is still present; none is fixed by a commit since v0.1.42. New line numbers below.

  • Short shard passes as whole: expected_bytes() unchanged (tools/gguf_reader.py:66-73, no diff since v0.1.42); or 0 still at setup.py:1710 (whole_shard) and setup.py:1978 (check_shards).
  • Malformed header gives a traceback: GGUF_META[t] at tools/gguf_reader.py:117 / :123, fh.read(n) at :113. check_shards still catches only (ValueError, struct.error) (setup.py:1976), whole_shard (OSError, ValueError, struct.error) (setup.py:1712). Re-run on a synthetic header with the v0.1.45 reader: value type 99 gives KeyError 99, a string length of 2**63 gives OverflowError, neither caught.
  • Run config with the API key, default umask: write_config (setup.py:4513-4518) has no chmod; the only chmod calls in setup.py are 0o755 (:3677, :5514). api_key set at setup.py:5894.
  • Configs not repointed: data_folder still skips a folder with not has_data(folder) (setup.py:4483) before repoint_config (setup.py:4501-4502).
  • Symlink in move_into: no symlink check (setup.py:4410-4428); src.is_dir() / src.iterdir() at :4422-4423 follow the link when the destination exists.
  • Low-RAM advice: "A smaller size (Q2_0 or IQ2_XS) fits" and "choose Q2_0 or IQ2_XS" still printed for every family (setup.py:4322, :4325, confirm_paging); Q2_0 is still "families": ("qwen",) (setup.py:246).
  • Pack completeness: setup.py:6806 still treats native_experts.txt existing as done.
  • death_note: the fallback still takes the last line starting with strata or ERR (serve/server.py:1030); strata trace: read ... is at src/program/generate.cpp:13409.
  • /settings missing from the endpoints table: docs/DETAILS.md:754-766; the route is only in prose at :1018 and :1038 (handled at serve/server.py:5440, :5550).
  • .gitignore:22: the "Pi harness metadata" comment is still above *.sqlite, *.npz, *.occ1, td.log. The only change since v0.1.42 is dist-hip/ at the end.
  • Prompt read failure in serve: cudaPeekAtLastError() at src/program/generate.cpp:13432; the stop branch sets cancelled = true without checking the CUDA error (:13439).
  • Serve without an expert cache: the up-front check refuses d_res == nullptr only with graph_hits (generate.cpp:7841-7842); otherwise ver.init fails (:8585, returns 1 at :8590) with the same message (src/core/verify.cpp:664-669), which still suggests --max-context, --kv q4_0, --draft-vocab en, images on the CPU.
  • Generate mode without a residency table: the 1024 fallback is still serve-only (generate.cpp:8135-8136, inside if (o.serve) from :7840). Generate mode sets the auto chunk only under d_res != nullptr (:14913, :14923-14924), else prefill_auto_max stays (8192 default, :616). Only the no-profile / no-borrow case is capped, at 2048, for both modes (:2945-2948, already in v0.1.42).
  • kMinCc: still only in device_info() (src/core/device.cu:312 / :315), whose only caller is src/core/device_main.cpp:66. Note that include/strata/core/device.hpp:59-61 calls it "the matching check at run time".
  • CMake: continue() for native / all / all-major at CMakeLists.txt:178-180, before the sm_120 + CUDA < 13.0 warning at :197-200.
  • Python tests: not in ctest (the only Python add_test is isa_guard_check, CMakeLists.txt:1945 / :1949); .github/ holds FUNDING.yml, ISSUE_TEMPLATE/, pull_request_template.md, no workflow.
  • Missing tests: repoint_config and _cpuid_avx2 still have no test (no match under tools/ or serve/). For the CUDA gate, to be precise: tools/test_setup_older_gpus.py:148-154 (already in v0.1.42) covers the CUDA 12 path (need12), and tools/test_setup_cuda_repo.py (new, fb7ee724) covers "no nvcc". Still untested: an sm_120 card with a 12.x toolkit on the default path, where need_cuda = (13, 0) (setup.py:3865, :3871).
<!-- gh-comment-id:6233817933 --> @gputier commented on GitHub (Oct 17, 2026): Re-checked against v0.1.45. Every item is still present; none is fixed by a commit since v0.1.42. New line numbers below. - Short shard passes as whole: `expected_bytes()` unchanged (`tools/gguf_reader.py:66-73`, no diff since v0.1.42); `or 0` still at `setup.py:1710` (`whole_shard`) and `setup.py:1978` (`check_shards`). - Malformed header gives a traceback: `GGUF_META[t]` at `tools/gguf_reader.py:117` / `:123`, `fh.read(n)` at `:113`. `check_shards` still catches only `(ValueError, struct.error)` (`setup.py:1976`), `whole_shard` `(OSError, ValueError, struct.error)` (`setup.py:1712`). Re-run on a synthetic header with the v0.1.45 reader: value type 99 gives `KeyError 99`, a string length of 2**63 gives `OverflowError`, neither caught. - Run config with the API key, default umask: `write_config` (`setup.py:4513-4518`) has no chmod; the only chmod calls in `setup.py` are 0o755 (`:3677`, `:5514`). `api_key` set at `setup.py:5894`. - Configs not repointed: `data_folder` still skips a folder with `not has_data(folder)` (`setup.py:4483`) before `repoint_config` (`setup.py:4501-4502`). - Symlink in `move_into`: no symlink check (`setup.py:4410-4428`); `src.is_dir()` / `src.iterdir()` at `:4422-4423` follow the link when the destination exists. - Low-RAM advice: "A smaller size (Q2_0 or IQ2_XS) fits" and "choose Q2_0 or IQ2_XS" still printed for every family (`setup.py:4322`, `:4325`, `confirm_paging`); Q2_0 is still `"families": ("qwen",)` (`setup.py:246`). - Pack completeness: `setup.py:6806` still treats `native_experts.txt` existing as done. - `death_note`: the fallback still takes the last line starting with `strata` or `ERR` (`serve/server.py:1030`); `strata trace: read ...` is at `src/program/generate.cpp:13409`. - `/settings` missing from the endpoints table: `docs/DETAILS.md:754-766`; the route is only in prose at `:1018` and `:1038` (handled at `serve/server.py:5440`, `:5550`). - `.gitignore:22`: the "Pi harness metadata" comment is still above `*.sqlite`, `*.npz`, `*.occ1`, `td.log`. The only change since v0.1.42 is `dist-hip/` at the end. - Prompt read failure in serve: `cudaPeekAtLastError()` at `src/program/generate.cpp:13432`; the stop branch sets `cancelled = true` without checking the CUDA error (`:13439`). - Serve without an expert cache: the up-front check refuses `d_res == nullptr` only with `graph_hits` (`generate.cpp:7841-7842`); otherwise `ver.init` fails (`:8585`, returns 1 at `:8590`) with the same message (`src/core/verify.cpp:664-669`), which still suggests `--max-context`, `--kv q4_0`, `--draft-vocab en`, images on the CPU. - Generate mode without a residency table: the 1024 fallback is still serve-only (`generate.cpp:8135-8136`, inside `if (o.serve)` from `:7840`). Generate mode sets the auto chunk only under `d_res != nullptr` (`:14913`, `:14923-14924`), else `prefill_auto_max` stays (8192 default, `:616`). Only the no-profile / no-borrow case is capped, at 2048, for both modes (`:2945-2948`, already in v0.1.42). - `kMinCc`: still only in `device_info()` (`src/core/device.cu:312` / `:315`), whose only caller is `src/core/device_main.cpp:66`. Note that `include/strata/core/device.hpp:59-61` calls it "the matching check at run time". - CMake: `continue()` for `native` / `all` / `all-major` at `CMakeLists.txt:178-180`, before the sm_120 + CUDA < 13.0 warning at `:197-200`. - Python tests: not in ctest (the only Python `add_test` is `isa_guard_check`, `CMakeLists.txt:1945` / `:1949`); `.github/` holds `FUNDING.yml`, `ISSUE_TEMPLATE/`, `pull_request_template.md`, no workflow. - Missing tests: `repoint_config` and `_cpuid_avx2` still have no test (no match under `tools/` or `serve/`). For the CUDA gate, to be precise: `tools/test_setup_older_gpus.py:148-154` (already in v0.1.42) covers the CUDA 12 path (`need12`), and `tools/test_setup_cuda_repo.py` (new, fb7ee724) covers "no nvcc". Still untested: an sm_120 card with a 12.x toolkit on the default path, where `need_cuda = (13, 0)` (`setup.py:3865`, `:3871`).
Author
Owner

@Niko1221 commented on GitHub (Oct 19, 2026):

Thanks for taking the time to report this.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.0-beta. 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:6270696570 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for taking the time to report this. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.0-beta. 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#759
No description provided.