Commit Graph
475 Commits
Author SHA1 Message Date
Niko1221 86b1a4c50b rc0: merge f-0221-perf 2026-11-23 14:42:10 +01:00
Niko1221 958c488220 rc0: merge f-0221-prefix 2026-11-23 14:40:58 +01:00
Niko1221 8ee4f3a224 docs: Inkling thinking levels (numeric mapping, fields, budgets), inkling_thinking_budget
MODELS.md gets a section with the word-to-number table, how the level changes the
prompt, the response fields in the three API shapes, the budgets by level and the
never-empty rule. DETAILS.md gets the inkling_thinking_budget row and the effort
table note.
2026-11-23 13:52:43 +01:00
Niko1221 724bbbed72 engine: the Track 6A tiny-cache rules are opt-in (STRATA_TINY_CACHE=1) (#6782, #6799)
0.1.66 turned two rules on whenever the VRAM expert cache holds less than 15% of the
experts (every 12 GB card with a 3-bit file, and a 16 GB one with a bigger file): the default
--adapt-swaps is cut from 96 to 16, and the top quarter of the profile experts is pinned
against eviction. The rules were written on "a 96-swap default costs 14-26% on 8 and 12 GB
cards". Measured on an RTX 5080 (sm_120, 16 GB, Qwen3.8-Flash-Next IQ2_XS, the cache set to
3,000 slots = 12.2% of the experts, same cuda13 0.1.66 binary, one engine start per arm and
round, arms alternating, 5 rounds, greedy), decode against 0.1.65:
  rules on (0.1.66 default)          code -22%, chat -18%, 8K document -13%
  --adapt-swaps 96 given             -10%, -10%, -3%
  STRATA_CACHE_PIN_FRAC=0 + swaps 96 -5.5%, -6.4%, -4.4%
With a 7.6% cache (1,800 slots, 2 rounds so far): -25%, -18%, -18% with the rules on, -10%,
-8%, -5% with 96 swaps. So the 12 GB reports (#6799: 75 -> 52 tok/s on an RTX 3080 Ti,
#6782: RTX 5080) have a measured cause. Both rules now run only with STRATA_TINY_CACHE=1;
STRATA_CACHE_PIN_FRAC=<f> still pins by itself and an explicit --adapt-swaps always wins.
The remaining -5% to -8% with both rules off is not explained yet.

Unit test: low_vram_rules_test (the gate function). Registered in the settings register and
described in DETAILS.md. Numbers: phaseA-tests/rel0221/RESULTS-0221-PERF.md.
2026-11-23 13:36:39 +01:00
Niko1221 af9bf52f8c engine: the #4870 mid-coverage curve stays on for the CUDA build, off for HIP; STRATA_ADAPT_MID=1 / 0 forces it (#6791)
The measurement that follows the previous commit: on the z440's RTX A4000 (CUDA, sm_86, Qwen3.8-Flash-Next
IQ2_XS, 30% of the experts in VRAM, one engine start per arm and round, arms alternating, 3 rounds) the
curve (every 2, 192 swaps, decay 0.92) is faster than the old three values given explicitly: code +5.7%,
chat +6.7%, 8K document +9.0%. On the RX 7900 XT (HIP) it was slower in 10 of 13 cells (worst -7.8%).
So the default now follows the build: on for CUDA (as in 0.1.66), off for HIP (as in 0.1.65).
STRATA_ADAPT_MID=1 turns it on and STRATA_ADAPT_MID=0 off in either build; --adapt-every / --adapt-swaps /
--adapt-decay still win over all of it. The rule stays a pure header; the unit test checks both defaults
(also compiled with -DSTRATA_USE_HIP). Settings register and DETAILS.md updated.
2026-11-23 12:33:20 +01:00
Niko1221 ddac45d0da engine: the #4870 mid-coverage adaptive curve is opt-in (STRATA_ADAPT_MID=1) again (#6791)
0.1.66 started every engine whose VRAM expert cache holds 15% to 65% of the routed
experts with --adapt-every 2 --adapt-swaps 192 --adapt-decay 0.92 instead of 4 / 96 / 0.70,
claiming +8% hit rate and +10% decode. On an RX 7900 XT (gfx1100, Qwen3.8-Flash-Next
IQ2_XS, same card, one engine start per arm and round, arms alternating, greedy, 4-5 rounds)
the hit rate rises but the decode speed does not: against the same 0.1.66 binary with the old
three values given explicitly (which equals 0.1.65 in every cell) it is slower in 10 of 13
cells, worst at 15-25% coverage (the 24 GB card with a 3 MB-expert file of the report):
chat -7.8%, agent -7.8%, code -2.8% / -4.2%; at 32.5% 8K document -4.8%, code -3.6%; at
46.8% -0.2 to -2.0%. Faster in 3 cells (+2.8%, +0.4%, +0.3%).

The curve stays available with STRATA_ADAPT_MID=1; --adapt-every / --adapt-swaps /
--adapt-decay on the command line win over both. The rule is a pure header with a unit test
(adapt_coverage_rules_test); the three call sites in generate.cpp use it. Registered in the
settings register and in DETAILS.md. Numbers: phaseA-tests/rel0221/RESULTS-0221-PERF.md.
2026-11-23 11:46:00 +01:00
Niko1221 7bff4c47a5 serve: api_keys with per-key concurrency limits and reserved capacity (#5004)
From PR #5820 by @NoBirdWasHam.
2026-11-23 10:32:19 +01:00
Niko1221 be6f0c59b7 serve: let the vision section carry its own env for the image encoder
From PR #5897 by @Vop3p.
2026-11-23 10:24:10 +01:00
Niko1221 f5ab600d51 serve: /v1/models publishes the answer cap
From PR #6703 by @StrikeRougeAgent.
2026-11-23 10:24:10 +01:00
Niko1221 b2d4400666 docs: reproducible output: add the CPU prompt share and bring its table row up to date
From PR #5599 by @slyfox1186.
2026-11-23 10:24:08 +01:00
Niko1221 861e889f54 Merge branch 'f-0220-app-serve' into f-0220-int 2026-11-22 14:16:24 +01:00
Niko1221 49f28f17fd [TUI] resolve Del reset (#6519), Qwen file detection (#6518), port 8080 probing (#6475), strata connect/OpenCode v2 (#6512), and PRs #6387 #6395 #6451 2026-11-22 14:15:06 +01:00
Niko1221 534802c8dc engine: integrate #6406, #6529, #6550, #6523 and fix #6515, #6431, #6462, #6423, #6417, #6493, #6533, #6470 2026-11-22 13:23:13 +01:00
Niko1221 0f1738e611 engine: integrate #6547, #6548, #6538, #6465 (batched MTP, QSA stream batch, persistent spill, bounded swap) 2026-11-22 13:02:10 +01:00
Niko1221 8a38bc52b6 Merge f-fetch16: STRATA_ADAPT_FETCH=2 default on 12.x CUDA cards with 16 GiB or less
The settings register conflicted on line numbers only. It was taken from the rc,
STRATA_ADAPT_FETCH's status and note were carried from f-fetch16, then
settings_register.py and --docs were run over the merged tree (1125 names);
--check passes.
2026-11-19 20:50:36 +01:00
Niko1221 794c85df0a DETAILS.md: the STRATA_ADAPT_FETCH row now carries the default and its numbers
2x RTX 5060 Ti 16 GB (BW-9): decode +4 to +43% by kind, hit rate 54.4% to 62.0%, KL ratio 0.948
[0.830, 1.063]. RTX 5070 12 GB (IQ3_S, 28 GiB RAM budget, 3 paired rounds): the switch is not used
in the resident RAM mode, decode medians 0.966 to 1.054 of =0, hit rate 53.6% and 53.5%.
Register line numbers regenerated.
2026-11-19 20:40:39 +01:00
Niko1221 f705bf0a81 Merge f-bw-h (link-aware CPU prompt share limit) into the 0.2.17 release candidate
f-bw-h (a620ffb61, 595d40922) and f-bw-f (38e6a0506) both arm the CPU prefill
share on a layer split. One conflict, engine/src/program/generate.cpp, the
share arming block of the serve start-up, resolved to one rule:

- BW-H first: on a layer split the stages' stream floors are summed; where the
  link rule raises the limit above 3,072 (Prefill::arm_cpu_share_split) it arms
  the share by itself and sets the limit and the expert width. This is what arms
  a split of three or more cards, and it gives a two-card split with a slow link
  its larger limit.
- BW-F second: arm_cpu_share(share_pool, share_pool && share_layout &&
  share_has_work): one card, or exactly two CUDA cards (STRATA_SPLIT_CPU_SHARE=0,
  kSplitShareDefault), armed by default with the default limit. A two-card split
  of fast links therefore keeps the share armed, as BW-F measured it.
- set_card_expert_share takes pool.workers() (BW-H) in the one-card condition.
- BW-F's start-up line is kept.

docs/SETTINGS.md is generated (conflict only in its table): regenerated from the
register.
2026-11-19 19:48:39 +01:00
Niko1221 595d409226 CPU prompt share on a layer split: the link rule arms it from the stages' summed stream floors (cc 12.0 cards, STRATA_PREFILL_CPU_SHARE_AUTO=0 keeps it off)
The share is off on a layer split by default.  With explicit STRATA_PREFILL_CPU_SHARE=auto and the limit above the split's 8,192-token chunk, experts of up to 64 tokens, 2x RTX 5090 on one board (GPU0 PCIe 4.0 x2
3.6 GB/s first stage, GPU1 x8 14.1 GB/s, 32 pool workers, UD-Q4_K_XL, --layer-split auto, 3 rounds) the prompt takes 0.25-0.68 of the split's default time at 84 / 1,024 / 2,048 / 4,096 / 8,192 / 12,288 /
16,384 / 32,768 tokens (843 -> 327, 1,957 -> 829, 5,549 -> 1,395, 5,949 -> 2,345, 6,783 -> 4,599, 11,052 -> 5,999, 11,233 -> 7,578, 20,026 -> 13,125 ms), decode level; the share with the default limit 3,072 costs
3-4% from 4K up.

Prefill::arm_cpu_share_split(applies, floor_ms, pool_workers, all_cc120) (called before arm_cpu_share in the serve path when the engine runs a layer split): floor_ms is the sum over the stages of (pairs of the
stage's layers - its cache slots) x blob / its link; the share is armed by default only when share_rules::link_rule_floor raises the limit above 3,072 (here 3,556 ms -> 12,032 tokens, 64-token experts), so a
split of fast links keeps the share off as before.  With the rule (nothing set against STRATA_PREFILL_CPU_SHARE_AUTO=0): x0.38 / 0.41 / 0.25 / 0.38 / 0.63 / 0.52 / 0.64 / 0.62 of the default at the same
lengths, decode chat 129.2 -> 132.5, code 189.7 -> 203.9, agent 136.3 -> 138.2 tok/s.  Forced-token KL on the split against the FP16 prompt path (48 prompts, 12,288 positions, fixed share 0.5): exact 0.01119,
share with 8-token experts 0.980 [0.938, 1.024] of it, share with 64-token experts and limit 16,384 0.979 [0.907, 1.053].  Docs updated (DETAILS.md).
2026-11-19 19:23:55 +01:00
Niko1221 f85f9dd332 Merge f-eng-0163 (engine 0.1.63 head) into f-0217-int2: the 0.2.17 release candidate
Both halves come from main 58ee32277: the app side (f-0217-int2) and the engine
side (f-eng-0163, on f-bw-a). Four conflicts, all in the serve parser and one
doc table:

- terminal/serve/frontend.py, _track (#4923): the app lane and FIX-ENG fixed the
  same stray-backtick rule; the FIX-ENG form is kept (it also carries a span
  that is already open across lines), the same parity as the app lane's.
- terminal/serve/frontend.py, _quoted_think_end (#5605): the app lane's pair
  rule ("</think>" inside a pair of quotes) and FIX-ENG's closing-quote rule
  and #6218 backtick-span rule are all kept, in one function.
- terminal/serve/test_parser_track.py: the reference model follows the kept
  _track rule.
- terminal/serve/test_parser_stray_backtick.py: both lanes added a file of this
  name; the app lane's stays, FIX-ENG's is test_parser_stray_backtick_eng.py.
- docs/DETAILS.md, "On by default" table: FIX-SPEED's longer prefill-share row
  and its two new rows are kept; the STRATA_ROUTE_TAIL_SKIP row is not there
  any more (tail skip is off by default in 0.2.17, its own section below).
2026-11-19 18:42:38 +01:00
Niko1221 c619aebeb9 "Leave 20% for my work" starts the engine with the old RAM budget on the started copy only; the saved run config keeps setup's number, so the Terminal always reads the new one
Owner rule: the Terminal always uses the new number. The work-mode swap is no longer part of resourceSettings (what every write of the run config takes): it is
launchBudgetArgs(cfg, profile), applied by buildConfig to the config of the start being made, after the person's options are merged in. The saved args keep setup's
--resident-budget-gib (47 on 64 GB), args_written is unchanged, and ui_resource_baseline carries no budget bookkeeping (nothing is saved, so nothing is put back).
"Full performance" and a load with no preference leave args as they are. The same rules as before: the person's budget (user_args, an edit of args), a --ram-keep-gib, and a
STRATA_RAM_KEEP_GIB / STRATA_RESIDENT_HEADROOM_GIB in the env keep their value; no work number (a 0.2.16 config not yet moved, a budget asked of setup, unified memory) leaves the
budget alone; a config moved by strata_cli/ram_budget_move.py works as a new one.

Tests: app/host/tests/resource-rammode.test.mjs now loads through the host (a work load starts with 40, the file read afterwards has 47, performance 47, the person's value in both),
terminal/tools/test_setup_rammode.py: a Terminal start (engine_args) of the config the app saved gets 47. Docs (UNSLOTH_Q4.md, DETAILS.md) say the swap is not saved.
2026-11-19 17:48:56 +01:00
Niko1221 a620ffb619 CPU prompt share: the limit and the expert width follow the card's PCIe link (compute capability 12.0 default, STRATA_PREFILL_CPU_SHARE_AUTO=0 to get 3,072 / 8 back)
The default share took chunks up to 3,072 tokens and experts of at most 8 tokens, a setting measured on one 28 GB/s link.  A chunk from the limit up streams every expert the card does not hold in
one pass whose time F (bytes of the missing experts / the link) does not depend on the chunk length; the staged walk with the share grows with it, so the share pays up to a length T* that
grows with F.  RTX 5090 cards, UD-Q4_K_XL (8,056 of 24,576 experts on the card), 3 interleaved rounds, the share with 32-token experts against the default: T* 4.2K tokens at 53.6 GB/s (15 pool
workers), 8.8K at 28.3 GB/s (22), 14.0K at 14.1 GB/s (32), 19.7K (32-token experts) / 25K (64-token experts) at 3.6 GB/s; 8 pool workers 7.7K, 16 workers 8.5K (22: 8.8K).  At 53.6 GB/s the
default 3,072 beats streaming by 25-34% from 1,536 tokens and above ~4K staged equals streamed, so the rule never goes below 3,072.

share_rules.hpp link_rule(): limit = 3.4 x F (ms) tokens up to F = 3.67 s, +0.76 tokens per ms of F above it, between 3,072 and 20,480, scaled by (workers / 22)^0.15 for smaller pools; experts of
up to 32 tokens (64 from F = 3 s) where the limit is raised.  Prefill::set_card_expert_share takes the pool's workers; arm_cpu_share applies the rule to the default-armed share only (an explicit
STRATA_PREFILL_CPU_SHARE, STRATA_PREFILL_CPU_SHARE_MAX and STRATA_PREFILL_CPU_SHARE_NT keep their meaning) and prints one "CPU share rule:" line.  STRATA_PREFILL_CPU_SHARE_AUTO: unset = cc 12.0
discrete cards with the link probed, 1 = any CUDA card, any other value = off.  Settings register, docs, unit tests (share_rules_test) updated.
2026-11-19 17:28:01 +01:00
Niko1221 c8d70bbcdc RAM budget per mode: "Leave 20% for my work" keeps RAM less 24 GB, Full performance and the Terminal get RAM less 17 GB; 0.2.16 configs move once; the reading rounds up to the PC's size
Owner decisions 11-19. Setup writes both numbers in the run config: --resident-budget-gib in args is the new rule (47 on 64 GB), and "ui_budget_work_gib" is the old
rule (40) from the same function (resident_budget_gib(work=True)). The app's "Leave 20% for my work" swaps the second one into args and records what it replaced in the
resource baseline (setupBudget); "Full performance" runs with setup's number and puts it back after a work load. The app holds no copy of the rule. The key is left out when
setup was asked for a budget, when the config keeps one of the person's (user_args, an edit of args), and where the two rules agree (a unified-memory GPU, 24 in both; every
expert in RAM). A budget, --ram-keep-gib, STRATA_RAM_KEEP_GIB or STRATA_RESIDENT_HEADROOM_GIB of the person's wins in every mode.

A 0.2.16 config (setup's old number, args_written equal, no second number) moves once at the first command of the new Control (strata.py -> strata_cli/ram_budget_move.py,
setup.migrate_ram_budget): 40 -> 47 on 64 GB, 24 -> 31 on 48 GB, 8 -> 15 on 32 GB, with the old number as the work number. A number the person set, a unified-memory PC
and a layer split are not touched; the earlier file is kept as .bak, a second run changes nothing, and a config with nothing to move is not written.

The RAM reading is rounded up to the size the PC is sold with (16/24/32/48/64/96/128/192/256, then a multiple of 8) where it reads within 3% under it, only in the budget rule:
a 64 GB Windows PC (63.1) gets 47 like Linux, a PC with 60 GB gets 43.

Tests: terminal/tools/test_setup_rammode.py, app/host/tests/resource-rammode.test.mjs, goldens regenerated with the repo's generators, docs (UNSLOTH_Q4.md, DETAILS.md).
2026-11-19 16:51:47 +01:00
Niko1221 4a409b919b Serve: the first request's free-VRAM note is said only when the free memory fell since the start-up line or is under 512 MiB (item 17)
0.1.62 and before warned "only N MiB of VRAM free at the start of this request" at the first request of every start below 1 GiB (512 MiB off
Windows), also on a card the expert cache fills on purpose. The rule is now strata/core/vram_request_notice.hpp: say it below the safe figure
when the free memory is at least 64 MiB lower than the start-up line reported (generate.cpp keeps that figure in g_startup_vram_free_mib; the
request compares the same figure the start-up line prints) or is under 512 MiB; with no start-up figure the old rule stays. The text is the
owner-approved wording of TEXT-BATCH-0217 item 4 (Windows says "Windows", other systems "the driver"). Once per 128 MiB lower, as before.
Test: vram_request_notice_test (header-only, CPU). docs/DETAILS.md describes the new rule.
2026-11-19 16:24:56 +01:00
Niko1221 dc3ace6a0c Linux file tier: opt-in STRATA_EXPERTS_SEQ_READAHEAD marks the mapped expert files MADV_SEQUENTIAL (#5561)
From PR #5561 (njy1991; its commit 7c28d4e61), author kept. When the experts the GPU does not hold are much larger than the
file cache, the kernel can stop reading ahead on the mapping of experts.bin (or of the GGUF shards in place), and every page
fault of the prompt path's copies reads one 4 KiB page (up to 1.35 million major faults in one follow-up turn on the
reporter's PC). With STRATA_EXPERTS_SEQ_READAHEAD=1 (Linux, read once) FileExpertSource marks each mapped expert file
MADV_SEQUENTIAL right after mmap, so each fault reads the drive's read-ahead window, and logs one line per file. Only the
kernel's read-ahead changes, not the bytes read. OFF by default: unset, the function returns before it does anything.
The name is in the settings register (status research). Author's numbers (RX 6900 XT, Gyro-M 29.9 GiB experts.bin on
NVMe RAID0, cold cache, 2 runs without and 4 with): five follow-up turns 65.2 / 76.2 s down to 23.5 to 28.4 s, the
answers byte-identical. Not measured by us (it needs a PC whose file cache is much smaller than the experts); it stays off.
2026-11-19 16:19:25 +01:00
Niko1221 537b501254 file tier: a prefetch gate closed for low benefit keeps its periodic probe inside the 0.55 to 0.65 band (#4538, #4537)
From PR #4538 (cmdruid; its commit 48f6fd4f6, whose own author line is "Agent <agent@secondbrain>"; the PR login is
used as the author), author kept. gate_capacity() judged the read-ahead every 16 decode windows. A gate closed because
the read-ahead did not pay (gate_useless_) is meant to be probed again after 256 windows, but in the hysteresis band
the next decision applied the reopening threshold of a capacity closure (above the high watermark) and so cleared the
benefit reason: the gate stayed closed for good at a steady cache-room ratio between 0.55 and 0.65. A closure that
was for benefit now keeps its probe while the room stays at or above the low watermark; a real capacity drop still
cancels it and needs the high watermark to reopen. One expression, a paragraph in docs/DETAILS.md, and
tools/test_prefetch_gate.py, which compiles the real gate_capacity() from expert_source.cpp with synthetic inputs
(31 checks, no GPU); the PR reports 14 failing checks on the unpatched source. Its default source path now points at
engine/src/core. Before and after runs are in the gate table.
2026-11-19 16:19:22 +01:00
Niko1221 4e94b05592 SYCL start-up line: a CPU with AVX-512 VNNI but no VBMI no longer reads "no AVX-512" (#5481)
From PR #5481 (nekorobi-0; its commit 0946bbd77), author kept. On a CPU with AVX-512 VNNI and
no VBMI (Cascade Lake) the SYCL engine's start-up line said "this CPU has no AVX-512: the expert kernels run on AVX-2",
even with STRATA_VNNI_TIER=1 on. The line now says which case it is: no AVX512-VNNI at all; the VNNI tier off or not
available; or (with the tier on and no VBMI) "AVX-512 VNNI tier enabled (no VBMI)". The cpu_vnni_ok() header comment
names the DQ requirement and the switch, and docs/DETAILS.md gains the STRATA_VNNI_TIER row (off by default: those
rows round differently from the AVX-2 rows). Log text and docs only; no computation changes. The two new lines are in
the results file's text list.
2026-11-19 16:19:21 +01:00
Niko1221 29ca1fca37 Merge f-bw-e (BW-E: CPU prompt share, VNNI rows) into f-eng-0163 2026-11-19 16:18:53 +01:00
Niko1221 16c3fa0cd1 CPU prompt share: STRATA_PREFILL_CPU_SHARE_NT lets the CPU take experts of more than 8 tokens (opt-in); the AVX-512 rows start at 8 tokens
The share gave the CPU only the experts a chunk routes <= MAXT (8) tokens to, cheapest first, and only for chunks below 3,072 tokens.  STRATA_PREFILL_CPU_SHARE_NT=N (9-256) also lets it take
experts of up to N tokens; the pool runs such an expert as jobs of 8 tokens that share its weights (each token's row is the same bits whatever its job); the CPU rows of one layer are
capped at 16,384.  With STRATA_PREFILL_CPU_SHARE=auto and a chunk limit raised with STRATA_PREFILL_CPU_SHARE_MAX, one RTX 5090 on PCIe 4.0 x8 (14.1 GB/s), 32 pool workers on a Xeon 8352V,
UD-Q4_K_XL, 3 rounds: prompt of 1,024 / 2,048 / 4,096 / 8,192 / 12,000 tokens 1,292 -> 956 / 1,832 -> 1,392 / 4,272 -> 1,828 / 4,455 -> 3,244 / 4,694 -> 4,254 ms; from 16K up the stream-all path is
faster and the limit should stay below it.  Forced-token KL against the FP16 prompt path (48 prompts, 12,288 positions, share 0.5, N=64, limit 8,192): 0.01155 against 0.01096 without the share, ratio 1.054
[0.993, 1.120].  BASE-05 with a fixed share 0.5 (default switches): 27 of 27 identical to f-bw-a.  Default off: nothing changes unless the variable is set.

The AVX-512 rows (previous commit) now take groups of 8 tokens and more (STRATA_KQ512_MIN): at floors 3 and 4 a decode window's small groups ran 1-6% slower (bw4ab2 / bw4dec, 5 paired rounds,
decode kinds), at 8 level; with the wide share the rows take 10-14% off the prompt (1K 0.86, 2K 0.89, 4K 0.87, 6K 0.90 of the per-token dot's time).  Settings register and docs updated.
2026-11-19 15:17:11 +01:00
Niko1221 eacec1513f Docs: the conversation cache with more clients than slots, with a measurement on 2x Tesla P100 (#6010)
From PR #6010 (Keoian; its commit bae9ea652), author kept. Docs only. The row for --conversation-cache-mib and
--conversation-cache-slots gets a sentence: with more clients taking turns than slots, the oldest parked conversation
leaves and that client reads its whole prompt again when it returns, with a link to the measurement; and the history
table gets the measurement: eight agents (9.8K to 15.6K tokens each) taking turns, 18 requests, on 2x Tesla P100 with a
fork build of 0.1.57. With the defaults (4 parked conversations, 8192 MiB, 6 checkpoints) 196,234 tokens were read in 792
s with 19 evictions; with 16 slots, 16384 MiB and --prompt-cache 12, 105,080 tokens in 454 s with no eviction. One run
each; the numbers are the contributor's and were not re-run here.
Ported by hand: DETAILS.md was reorganised in 0.2.16 (the conflict is in the headings around the two places), so the two
additions are put on the head's rows. Text change: new docs text (see TEXT-PENDING in the results file).
2026-11-19 13:12:48 +01:00
Niko1221 7ffd66628e serve: the thinking budget is also read from thinking_token_budget and thinking_budget (#3340)
From PR #3340 (shizhx; its commit 2b3364653), author kept. pi's thinkingTokenBudgetField can name the budget
thinking_token_budget (vLLM), thinking_budget (Qwen) or thinking_budget_tokens (llama.cpp). The server read
reasoning_budget_tokens and, since 0.2.x, thinking_budget_tokens; a client that sent either of the other two names had
its budget silently ignored (the model thought to its full length). Service.reasoning_budget now reads the three names
after reasoning_budget_tokens, in that order, and a value that is not a whole number is the same 400 as before.
Redone by hand: the PR copied the alias onto the request in _post; the head already reads thinking_budget_tokens in
Service.reasoning_budget, so the two new names are added there instead (same behaviour on all three chat routes, no
change of the request body). docs/DETAILS.md: the one sentence in the setting's row names the three names (the PR's
paragraph sat in a part of the file that 0.2.16 rewrote).
The PR's four tests are kept (the alias names, the request's own budget wins, the order of the aliases, a bad alias is a
400); 3 fail on the old code and all pass with the change.
2026-11-19 13:12:41 +01:00
Niko1221 23d94d00ae serve: GET /v1/models/{model_id} (and /models/{model_id}) answers one model, 404 with model_not_found for another name (#5477, #5460)
From PR #5477 (DamirLukina88; its commit dd2a60c52), author kept. Visual Studio's bring-your-own-key check, and other
OpenAI clients, ask for one model by id; the server only knew the list and answered the single-model path with a
404 that was not in the OpenAI shape. The two paths now answer the model's own row (the loaded model, an alias row
with alias_of, or the image model), and an unknown name is a 404 with the OpenAI error fields (type
invalid_request_error, param model, code model_not_found). The key check is the same as for the list.
#3500 asks for the same endpoint (and also changes the docs and the lifecycle tests); this smaller PR is the one
taken, #3500 is not.
Applies on the 0.2.16 layout (serve/ -> terminal/serve/). The PR's two tests are kept
(test_model_retrieve_single_and_alias, test_model_retrieve_unknown_returns_404; both fail on the old code and pass
with the change). One line added in docs/DETAILS.md (the endpoint table).
2026-11-19 13:12:19 +01:00
Niko1221 fc0e7f7181 Docs: update.sh and SETUP.bat are gone since 0.2.16 (#6235); STRATA_PF_FUSED=0 and the moved run-config paths (#6251); HIP flags test (#6255)
SOURCE_INSTALL.md named update.sh (removed by the 0.2.16 layout move) and SETUP.bat as scripts of the repository, and the
Updating section told Linux users to run ./update.sh: now ./setup.sh --update, with the two replacements named, and a paragraph
that a run config naming a file by its old place in the checkout (data/expert-profile.bin, serve/server.py) fails at the next
restart and has to be pointed at terminal/data/... and terminal/serve/... (the restart loop reported on #6251).
The passages that said STRATA_PF_FUSED=0 "keeps MMQ" (DETAILS.md, RADEON_780M.md twice, STRIX_HALO.md, AMD_HIP.md) now say it
does in a build that has MMQ, and that the release builds of 0.2.16 and later have none: =0 there runs the prompt experts on the
native int8 kernels. All wording is in TEXT-PENDING of RESULTS-0217-GHLIST.md for the owner's word.
Also tests/terminal/test_gh_0217_hipflags.py: the three HIP builds name the chosen ROCm's include folder first (PR #6256).
2026-11-19 13:10:56 +01:00
Niko1221 44e5884ff1 Merge f-0217-ram64: the RAM budget rule leaves 17 GB free (0.2.17) 2026-11-19 12:55:46 +01:00
Niko1221 8780e9fdc3 Setup: the RAM budget rule leaves 17 GB free, not 24 (64 GB PC: --resident-budget-gib 47, was 40)
resident_budget_gib() now takes the RAM less UNSLOTH_BUDGET_LEFT_GB (17) less a streamed KV cache, at most all the experts, at least 8. Owner decision 11-19.
phaseA-tests/bw/RESULTS-BW-D.md, a real 64 GiB memory limit, UD-Q4_K_XL: budget 40 decode 57.7 tok/s and 97.7 GB read from the SSD in a 65K prompt; budget 47
decode 84.2 tok/s and 37.0 GB, and it ran on when an 8 GiB program started after the load; budget 52 was killed in that case.

Kept at 24 (UNSLOTH_RAM_LEFT_GB): a unified-memory GPU (its cache and the budget share the RAM; 17 was measured on discrete cards only, resident_budget_gib(uma=True))
and the layer split's RAM need (unsloth_split_need_gb). A budget the person saved (user_args or a hand edit of args) still wins on a setup re-run; one setup wrote moves.

Tests: the rule for 32 / 48 / 64 / 96 / 128 GB, the unified-memory and split cases, a re-run over a 0.2.16 config, the setup and snapshot goldens (regenerated),
the docs (UNSLOTH_Q4.md with BW-D's numbers, DETAILS.md, NVFP4.md) and the --resident-budget-gib help text.
2026-11-19 11:08:21 +01:00
Niko1221 f8502827de Docs: the route tail skip is off by default; how to turn it on; the KL and speed numbers (0.2.17)
DETAILS.md gets its own section (the row leaves the "On by default" table): default off in every mode, STRATA_ROUTE_TAIL_SKIP=7 turns it on
(app, Terminal --set, run config), the 0.2.16 "Automatic" case, and the RTX 5090 UD-Q4_K_XL table (KL against exact routing 0.01260 / 0.01331,
top-1 97.30% / 97.23%, decode x1.29 / x1.24). QUANTS.md, UNSLOTH_Q4.md, NVFP4.md and DOCKER.md say the same where they spoke of the old default.
2026-11-19 09:02:32 +01:00
Niko1221 7e674a9c66 GB10: STRATA_ATTN_DAILY and STRATA_GR_DOWN_TG (token pairs) on by default, measured on a DGX Spark
A/B on a rented GB10 (IQ3_S, all experts resident, DFlash2 drafter, fixed draft-cost table, fresh engine per start, interleaved, 3 paired rounds):
decode against the old default, chat / code / JSON / agent turn, STRATA_ATTN_DAILY +0.3 / +0.9 / +0.7 / +1.2 %, STRATA_GR_DOWN_TG +/-0 / +0.7 /
+1.1 / +0.9 % (JSON and agent 3 of 3 pairs for both); all seven bitwise switches of the 12.0 set together +1.7 % (5 rounds).  GU_SWIGLU, GR_UP75,
GR_UP_WIDE, SMALL_UNR, DF_PDL measured level or slower there and stay off, and so does the E15 load ordering, which only acts with STRATA_GR_V3
(another summation order, text changes, mixed speed).  Gates: identity of the first-token logits and the generated tokens, 6 of 6 prompts, with the
new defaults against the old; BASE-05 against the vastspark 0.1.62 baseline, 9 of 9 prompts identical.  Numbers: phaseA-tests/bw/RESULTS-BW-B.md.
2026-11-19 05:37:40 +01:00
Niko1221 4b647b0bf3 docs: the engine build does not fetch or use llama.cpp; the sentences that said so are gone
Checked first: engine/CMakeLists.txt, engine/cmake/, the SYCL, Metal and split projects and the picture reader's CMake files have no FetchContent,
ExternalProject, file(DOWNLOAD) or git clone; the engine's ggml is the tree vendored in engine/third_party/strata-ggml, and -DSTRATA_GGML_DIR is an
optional override. setup.py downloads no llama.cpp (get_llama_cpp() "Nothing is downloaded any more"; gguf-py is vendored in
engine/third_party/strata-gguf-py).
Removed or made true, nothing else added:
- AMD_HIP.md ("CMake fetches the pinned llama.cpp revision ..." and the -DSTRATA_GGML_DIR line and comment of the gfx906 container recipe), STRIX_HALO.md
  ("CMake fetches the revision it needs ..." -> "The engine build needs no llama.cpp checkout."), INTEL_ARC.md ("The build fetches ggml ..." and "it fetches
  llama.cpp's gguf-py helper from GitHub"), DGX_SPARK_LINUX.md ("the first run also fetches llama.cpp"), MAC.md ("and llama.cpp's ggml at the commit the PC
  build pins"), SAFETY.md ("a first model install also fetches llama.cpp's preparation scripts"), AMD_HIP_PERFORMANCE.md ("Use the repository-pinned llama.cpp
  dependency"), SPLIT_ENGINE.md (-DSTRATA_GGML_DIR=<llama.cpp checkout> in the split build);
- GYRO.md: the paragraph about the configure-time ggml overlay (cmake/strata_ggml_tq_overlay.cmake and engine/third_party/ggml-tq are not in the tree), and
  the build block no longer clones agentionai's llama.cpp fork or passes -DSTRATA_GGML_DIR (it starts with "The engine build needs no llama.cpp checkout.");
- DETAILS.md: the --flash-attn row of strata-vision (it describes ggml's AVX-512 fallback; the picture reader has no ggml and ignores the option);
- ORCA.md and UNSLOTH_Q4.md: "gguf-py from the pinned llama.cpp dependency" -> "The pack tools carry their own gguf-py; STRATA_GGUF_PY can point to another
  gguf-py directory".
Left: measured tables and history that name the llama.cpp fork or the old build (GYRO.md results, benchmark reports, release notes).
2026-11-17 17:24:08 +01:00
Niko1221 ba971b3ab0 docs: every command and path in the user-facing pages names the moved place (terminal/tools, terminal/serve, tools/packaging, app/, engine/sycl, docs/bench-results ...)
The pages a user follows still told them to run `python tools/iq_pack.py`, `.venv/bin/python -m serve.server`, `packaging/monitor_bundle.py`,
`docker/build.sh`, `tools\hip\build_windows.bat`, `bench.sh`, `Strata\tools\strata_mcp.py` and to read `src/...`, `sycl/...`, `apps/...`: places that no longer
exist. Found with tools/layout/checks/docs_paths.py (each old path existed before the move and has a new place on this tree) and fixed there, plus the
Windows-style and example paths its tokenizer does not read:
- scripts and tools: `tools/<python tool>` -> `terminal/tools/...`, `serve/...`, `strata_cli/...`, `strata_control/...`, `data/...`, `requirements*.txt`, `setup.py` and
  `strata.py` in a command -> `terminal/...`; `.venv/bin/...` -> `terminal/.venv/bin/...`; `python -m serve.server` -> `python terminal/serve/server.py`;
- repository tooling: `packaging/` -> `tools/packaging/`, `docker/` -> `tools/docker/`, `bench.sh` and `BENCH.bat` -> `tools/...`;
- engine and app sources named in the text: `src/`, `include/`, `metal/`, `sycl/`, `third_party/` -> `engine/...`, `apps/` -> `app/`;
- benchmark results: `bench/results` -> `docs/bench-results` (strata_bench.py writes there);
- the MCP server examples: `Strata\tools\strata_mcp.py` -> `Strata\terminal\tools\strata_mcp.py`.
Only commands and the paths in them changed. A file name in a sentence (`setup.py`, `strata.py`) and the sentences that describe an INSTALLED Strata's
layout (`strata_control/update_keys.json` inside every installed Strata) are left as they are, as are docs/ORCA_Q4_K_S.md (it tells the reader to build the
v0.2.15 tag), the benchmark reports and the history pages. No line was dropped: every command still exists.
2026-11-17 17:19:50 +01:00
Niko1221 4058aa782b Layout move for 0.2.16: the top level becomes app/, engine/, terminal/, docs/, tools/ and .github/
Made by tools/layout/move_0216.py (the commit before this one) on db8e0be9c, the final code head of 0.2.16:
- 75 git mv (renames, so `git log --follow` and blame keep working; packaging/acceptance_matrix.md shows as delete + add because its links
  changed too) and 3 removals: SETUP.bat, UPDATE.bat and update.sh (setup.py --update pulls the code now);
- 1,425 path edits in 307 files: root-relative paths in CI, Docker, .gitignore and the release scripts; Markdown links; Python and
  Node joins from a root that moved with its folder; explicit edits for code that computes a root or names a moved path; tables of
  repository paths inside tests.

engine/ holds what CMake builds (src, include, cmake, metal, sycl, spark, third_party, the C++ tests and benches). app/ is the desktop
app and its host (was apps/). terminal/ is the Terminal in the layout of the installed one (strata.py, setup.py, strata_cli,
strata_control, serve, bin, data, ref, crates, the Python tools and tests). docs/ has the documentation, docs/lang/ the translated
READMEs, docs/history and docs/bench-results. tools/ has the repository's own checks, packaging, docker, research and nix.
tests/core/test_tqp_ref.py is a pytest file and stays with the Python tests (terminal/tests/core/).
AGENTS.md, README.md, LICENSE, setup.sh and START-HERE.bat stay at the root.

No behaviour change: the same command lines, the same sources. For this head a replay of the script gave the same numbers and the path
scan (tools/layout/checks/path_scan.py) reports no hit; the suites and the builds run on this commit next.
2026-11-17 13:19:21 +01:00
Niko1221 2b6417bef6 docs: --conversation-cache-rewind-keep row (#5862); a comment in the park path says why a slot holding the conversation does not skip the park
docs/DETAILS.md gets the table row for the opt-in --conversation-cache-rewind-keep N, in the words the coordinator approved (no
measured figures; it names the one case where a request is parked as before).  The comment at the keep_branch line in
src/program/generate.cpp records what the removed slot park skip did on two cards (one token differed from the park as before), without
a pointer outside the repository.  No code changes.

Checks: the tree builds (CUDA, l620-20261117-0339-093b: strata built in 184 s, 4 warnings in generate.cpp, as before), settings_register.py
--check passes, py-serve 1762 passed, 0 failed (p2003-20261117-0339-44a3).
2026-11-17 04:34:49 +01:00
Niko1221 e05e6e0ccc serve: a reply with tools that ends in tool-call markup that is no call is written again once; strata_unread_tool_markup
A user's report of agent turns that stopped (499 turns, 63 sessions) had 43 replies that ended in tool-call markup the
server did not run: 30 named a tool the request did not declare, 13 were
cut before their end or did not read as a call. The agent took the text for an answer and stopped.

Now, for a request that declared tools (chat completions, messages and responses alike), the answer's text from a
`<tool_call>` (or a bare `<function=`) opener at a line start is held back until the reply goes on past the block (then
it is sent as written) or the model stops in it. At that natural stop the rest of the output is read as before; when
the reply ends in markup that is no call and no call came out, it is written again once inside the same request:
the prompt goes on with the reply, a short user-turn note (why the call was not run, the declared tools, the closest
declared name for an undeclared one) and an assistant turn without thinking. The new reply takes the held markup's
place; words written before it stay. Nothing runs under a guessed name: the strict parser reads the new reply as it
reads any other. One retry only, and only when at least 64 output tokens are left after the note (the note counts
against max_tokens, so the reply stays inside the context). Not for a JSON-form template or another model family.

- /metrics/prometheus: strata:tool_markup_retries_total; one log line per retry (reason, names, hint, held length).
- strata_unread_tool_markup {"reason": "cut_off" | "unreadable", "chars": n}: the reply the client got still ends
  in such markup and it is not in strata_rejected_tool_calls; at the same places as that list (chat: the last stream
  chunk / the body; messages: message_delta / the body). /v1/responses now carries both fields at the top level of
  the response object.
- Off: config "tool_markup_retry": false, or STRATA_TOOL_MARKUP_RETRY=0 (the server's own switch; the settings
  register lists only names the engine reads, so it is documented in docs/DETAILS.md's config table).

Test: serve/test_tool_markup_retry.py: the 43 stops' shapes rewritten with neutral text (the report holds private
paths and content), whole and per character: 42 held and written again (30 rejected with the expected hints, 7 cut
off, 5 unreadable), the 43rd (prose without markup) not; the server path with a scripted engine: an undeclared name
written again as a declared call, the hint in the note, one retry only then the text with the markers (stream and
not), the rollback switch, no room, no tools, the streamed markup never sent when the retry calls, messages and
responses markers.
Live (l620, the shared BASE-05 Qwen set; a system prompt that shows an `exec` tool the request does not declare,
only `read` declared; 12 requests per arm): retry off, 12 of 12 replies ended in `exec` markup; on, 12 retries, then
6 replies called `read`, 5 answered in text, 1 still ended in `exec` (sent as text, in the rejected list). An
ordinary request (pwsh declared): a pwsh call and no retry in both arms.
2026-11-16 22:55:48 +01:00
Niko1221 984ec59cda Merge f-1116-guib (6339bb094): #5303 pip removed from the Terminal bundle, Codex / Responses (multi-agent v2 items, client-side tool_search), #2343 pictures from MCP tools, Monitor GPU load wording (#5484), empty GPU cards say why (#5457), and fixes (see the branch's commits)
Conflicts:
- apps/host/src/locales/*.json (9): mechanical, both sides only add keys at the end (HEAD s9039-s9051, guib s9101): union.
- serve/server.py: mechanical, the same #2497 / PR #4307 fix came in twice (identical code, different comments): HEAD's kept.
- serve/web/app.js, decided by the coordinator 11-16: f-1116-tui's per-card power / PCIe block stays; guib's #5457 (fcfe18e55) "not available" plus st.gpu_note goes into the single-card branch of the power and PCIe metrics (phaseA-tests\int0216\int0216_resolve_appjs2.py). serve/test_web_*.py 78 passed.
2026-11-16 19:14:44 +01:00
Niko1221 4d12b5dc4b Merge f-1116-metal (55a6dc414): Mac (Metal) fixes of 11-16 (see the branch's commits) 2026-11-16 19:02:54 +01:00
Niko1221 41b820d081 Merge f-1116-amd (e46fd29a0): AMD fixes of 11-16 (see the branch's commits) 2026-11-16 19:02:34 +01:00
Niko1221 cda25b7c00 Merge f-1116-serve (dcde1156c): tool parsing, #6032 R1-R3 and follow-ups, #5924, streams (see the branch's commits)
Conflict: serve/frontend.py, mechanical: #2371 (anyOf / oneOf types) came in twice, as f-1116-eng a54f9dbbb and f-1116-serve 5e965ec57 (same patch-id d6512e1afdc5), and serve built #6032 R1-R4 and #5493 on it: both hunks take serve's side; the file = serve's plus f-1116-eng's tool_addition changes (#5952).
2026-11-16 19:02:08 +01:00
Niko1221 a45dc7bbe2 Merge f-1116-gui (cb5e504c8), second wave: the 0.2.16 translation pass of the GUI-1116 strings (8 languages + test), Diagnostics shows only unsettled failures, Tasks Run now with an app-loaded model, Monitor host readings fill the engine's gaps, {{model_name}} after a switch, HTTP tool server keys (docs)
Conflicts: apps/host/src/locales/fix-{de,es,fr,ja,ko,pt,ru,zh}.json, mechanical: the branch's new fx86 translation, without fxpr1-4 (the picture reader setting that f-0216-vision removed).
2026-11-16 19:01:02 +01:00
Niko1221 48a1e3faf6 Merge f-1116-tui (888c0db15), second wave: Control / Terminal fixes of 11-16 (see the branch's commits) 2026-11-16 19:00:36 +01:00
Niko1221 0f09a2eff4 docs: the Responses API table names Codex multi-agent v2's input items (#4210, #5244)
agent_message (a worker's task and its answer, as user messages; another server's encrypted payload is named as unreadable) and multi_agent_call(_output), as 3cb933d29 reads them. Wording approved by the coordinator.
2026-11-16 18:54:58 +01:00
Niko1221andVop3p 53d37e6f76 docs, bench: PcieAuto on gfx103x, the measurements (#4007, #5984)
The docs and results half of PR #5984 (Vop3p; its bench/results/2026-11-14-rdna2-pcie-auto folder,
the AMD_HIP.md section and the DETAILS.md row, as written), the results index regenerated, plus
the maintainers' row: RX 6700 XT (gfx1031) in a Linux container with a 2.8 GB/s link probe, the
new default against STRATA_PCIE_FRAC_DEFAULT=old, three interleaved pairs of 4,000-token prompts
and 128 tokens: start-up share 0.08, no refinement printed, tokens and first-token logits identical,
decode 19.41 against 19.44 tok/s median (-0.2%, 1 of 3 pairs faster), prompt level. On a slow link
the change does nothing and costs nothing measurable; 32K not run.

Co-authored-by: Vop3p <69450118+Vop3p@users.noreply.github.com>
2026-11-16 18:02:43 +01:00
Catalin a1c56f5447 [Engine] Metal: saturate the fp16 expert activations, the source of the #879 poison
Problem: a long prompt's request died with non-finite logits, and once it happened the conversation kept
failing. The poison appeared at a different layer each time, on a single token row, with no magnitude ramp
(every input was O(1)). The guard added earlier ends such a request, but nothing removed the cause.

Cause, measured with a per-layer instrument: the MoE expert activations (XS, the gathered input, and HS, the
gated intermediate) are fp16. A value outside fp16's range became inf, and the expert down-GEMM multiplies
those activations by quantized weights that are legitimately zero, so inf * 0 produced a canonical qNaN
(0x7fc00000) in the combined expert output of one token row. That NaN entered the residual through the MoE
half of the mixer, then every layer above, then the GDN scan state, then the logits. Because the GDN state
and conv history are part of the checkpoint and of the parked conversation, one bad value came back with
every later turn, which is what made it look permanent.

Changes:
- moe_mm.metal: hsat (saturating fp16 store) at every expert-activation store; mm_combine drops a non-finite
  weight or expert output instead of folding it in. Both only differ from the old result where that result
  was already non-finite, so finite answers are bit-identical.
- qsa.metal, qsa2.metal, qsa_prompt.metal: guard the four unguarded softmax divides. M starts at -INFINITY
  and an empty chunk writes -INFINITY too, so an empty row evaluates exp(-inf - -inf) and the divide wrote a
  qNaN into the prepared activations. Same signature, independent cause.
- window.cpp: no non-finite word may cross a chunk boundary - the GDN state and conv history are cleared at
  every prompt chunk start, on checkpoint restore and on checkpoint save. The chunk-start pass costs ~19 MB
  of host reads against ~14 s of prefill (0.005%).
- docs/DETAILS.md: record the cause and the fix.

Validation (passed): four consecutive deep probes of 104,748 cold prompt tokens, each with no non-finite
logits and nothing to clear; the previous build poisoned on about seven of eight such probes. Multi-turn
reuse (4,556 of 4,578 tokens reused, 1.2 s against 22 s cold) and conversation parking (8 parks, no
non-finite words) exercised on the same build.
Not run: CUDA/HIP/SYCL builds (every kernel touched is Metal-only) and the Terminal test suite.
2026-11-16 17:34:31 +01:00