Merge f-028-defaults2: route prior off by default, tool_call_recovery on

This commit is contained in:
Niko1221 committed 2026-10-29 15:10:41 +01:00
commit 95563ff292
21 files changed
+154 -101

No files matched your search

+4 -3
View File
@@ -32,7 +32,8 @@ export const ENV_FLAG=/^(?:STRATA|DS4)_[A-Z0-9_]+$/;
* The speed features of 0.2.7 that have a switch in Expert settings. A switch has a default ('on' or 'off'); outside it, it writes exactly the
* environment entries `env` into the model's settings file ("env"); back in its default it removes them, so a default launch carries none of them.
* "Faster long prompts" (Qwen KVA) is OFF by default (owner decision, 26 October): STRATA_KVA=1 turns it on, and an earlier test build's STRATA_KVA=0 reads as off.
* The other two are on by default. The names are the engine switch contract (phaseA-tests/notes-027-plan.md); strata_control/speed_switches.py says the
* "Faster answers on 12 GB NVIDIA cards" (residency-biased routing) is OFF by default since 0.2.8 (owner decision, 29 October; #4402): STRATA_ROUTE_PRIOR=1.5
* turns it on, and the STRATA_ROUTE_PRIOR=0 that 0.2.7's Off wrote is the default state now. The other two are on by default. The names are the engine switch contract (phaseA-tests/notes-027-plan.md); strata_control/speed_switches.py says the
* same for the Terminal (tests/terminal/test_speed_switches.py compares the two).
*/
export const SPEED_SWITCHES=[
@@ -40,8 +41,8 @@ export const SPEED_SWITCHES=[
hint:'Reads very long prompts faster by approximating part of the work. Off by default: answers about long documents can miss or mix up details.',
default:'off',env:{STRATA_KVA:'1'}},
{id:'faster_12gb_nvidia',label:'Faster answers on 12 GB NVIDIA cards',group:'Speed',
hint:'Prefers the parts of the model already on the graphics card, which makes answers much faster on 12 GB cards. Turn off if answers look worse than before.',
default:'on',env:{STRATA_ROUTE_PRIOR:'0'}},
hint:'Prefers the parts of the model already on the graphics card, which makes answers faster on 12 GB cards. Off by default: in long agent sessions it can repeat itself and give weaker results. Turn on if you mostly chat and want the speed.',
default:'off',env:{STRATA_ROUTE_PRIOR:'1.5'}},
{id:'faster_radeon_9000',label:'Faster answers on Radeon RX 9000 / AI PRO R9700',group:'Speed',
hint:'Shares the work between the graphics card and the processor in a way that makes answers faster on these cards. Turn off to go back to the previous setting, which is slower.',
default:'on',env:{STRATA_PCIE_FRAC_DEFAULT:'old'}},
+1 -1
View File
@@ -81,5 +81,5 @@
"fx80": "Braucht etwa {0} GB freien Speicherplatz. Was nicht in den Speicher passt, wird von Ihrer SSD gelesen.",
"fx81": "{0} RAM + VRAM, dazu etwa {1} GB Speicherplatz",
"fx82": "Schnellere Antworten auf NVIDIA-Karten mit 12 GB",
"fx83": "Bevorzugt die Teile des Modells, die schon auf der Grafikkarte liegen. Das macht Antworten auf Karten mit 12 GB deutlich schneller. Schalten Sie die Option aus, wenn die Antworten schlechter aussehen als vorher."
"fx83": "Bevorzugt die Teile des Modells, die schon auf der Grafikkarte liegen. Das macht Antworten auf Karten mit 12 GB schneller. Standardmäßig aus: In langen Agent-Sitzungen kann sich das Modell wiederholen und schwächere Ergebnisse liefern. Schalten Sie die Option ein, wenn Sie vor allem chatten und die Geschwindigkeit wollen."
}
+1 -1
View File
@@ -81,5 +81,5 @@
"fx80": "Needs about {0} GB of free disk space. What does not fit in memory is read from your SSD.",
"fx81": "{0} RAM + VRAM, plus about {1} GB of disk",
"fx82": "Faster answers on 12 GB NVIDIA cards",
"fx83": "Prefers the parts of the model already on the graphics card, which makes answers much faster on 12 GB cards. Turn off if answers look worse than before."
"fx83": "Prefers the parts of the model already on the graphics card, which makes answers faster on 12 GB cards. Off by default: in long agent sessions it can repeat itself and give weaker results. Turn on if you mostly chat and want the speed."
}
+1 -1
View File
@@ -81,5 +81,5 @@
"fx80": "Necesita unos {0} GB de espacio libre en disco. Lo que no cabe en memoria se lee de tu SSD.",
"fx81": "{0} de RAM + VRAM, más unos {1} GB de disco",
"fx82": "Respuestas más rápidas en tarjetas NVIDIA de 12 GB",
"fx83": "Prefiere las partes del modelo que ya están en la tarjeta gráfica, lo que hace las respuestas mucho más rápidas en tarjetas de 12 GB. Desactívalo si las respuestas parecen peores que antes."
"fx83": "Prefiere las partes del modelo que ya están en la tarjeta gráfica, lo que hace las respuestas más rápidas en tarjetas de 12 GB. Desactivado por defecto: en sesiones largas de agente puede repetirse y dar resultados más débiles. Actívalo si sobre todo chateas y quieres la velocidad."
}
+1 -1
View File
@@ -81,5 +81,5 @@
"fx80": "Il faut environ {0} Go d’espace disque libre. Ce qui ne tient pas en mémoire est lu depuis votre SSD.",
"fx81": "{0} de RAM + VRAM, plus environ {1} Go de disque",
"fx82": "Réponses plus rapides sur les cartes NVIDIA de 12 Go",
"fx83": "Privilégie les parties du modèle déjà présentes sur la carte graphique, ce qui accélère nettement les réponses sur les cartes de 12 Go. Désactivez-le si les réponses semblent moins bonnes qu’avant."
"fx83": "Privilégie les parties du modèle déjà présentes sur la carte graphique, ce qui accélère les réponses sur les cartes de 12 Go. Désactivé par défaut : dans de longues sessions d’agent, le modèle peut se répéter et donner de moins bons résultats. Activez-le si vous discutez surtout et voulez la vitesse."
}
+1 -1
View File
@@ -81,5 +81,5 @@
"fx80": "約 {0} GB の空きディスク容量が必要です。メモリに入らない分は SSD から読み込みます。",
"fx81": "RAM + VRAM {0}、ほかにディスク約 {1} GB",
"fx82": "12 GB の NVIDIA カードでの高速な応答",
"fx83": "グラフィックスカード上にすでにあるモデルの部分を優先して使うため、12 GB のカードで応答がとても速くなります。以前より回答が悪くなったと感じたらオフにしてください。"
"fx83": "グラフィックスカード上にすでにあるモデルの部分を優先して使うため、12 GB のカードで応答が速くなります。初期設定ではオフです。長いエージェント作業では、同じ内容を繰り返したり、結果が弱くなったりすることがあります。主にチャットで使い、速度が欲しい場合はオンにしてください。"
}
+1 -1
View File
@@ -81,5 +81,5 @@
"fx80": "약 {0}GB의 여유 디스크 공간이 필요합니다. 메모리에 들어가지 않는 부분은 SSD에서 읽습니다.",
"fx81": "RAM + VRAM {0}, 디스크 약 {1}GB 추가",
"fx82": "12GB NVIDIA 카드에서 더 빠른 응답",
"fx83": "이미 그래픽 카드에 올라와 있는 모델 부분을 우선 사용해 12GB 카드에서 응답이 훨씬 빨라집니다. 답변이 이전보다 나빠 보이면 끄세요."
"fx83": "이미 그래픽 카드에 올라와 있는 모델 부분을 우선 사용해 12GB 카드에서 응답이 더 빨라집니다. 기본값은 꺼짐입니다. 긴 에이전트 세션에서는 같은 말을 반복하거나 결과가 나빠질 수 있습니다. 주로 대화에 쓰고 속도를 원하면 켜세요."
}
+1 -1
View File
@@ -81,5 +81,5 @@
"fx80": "Precisa de cerca de {0} GB de espaço livre em disco. O que não cabe na memória é lido do seu SSD.",
"fx81": "{0} de RAM + VRAM, mais cerca de {1} GB de disco",
"fx82": "Respostas mais rápidas em placas NVIDIA de 12 GB",
"fx83": "Prefere as partes do modelo que já estão na placa de vídeo, o que deixa as respostas bem mais rápidas em placas de 12 GB. Desative se as respostas parecerem piores do que antes."
"fx83": "Prefere as partes do modelo que já estão na placa de vídeo, o que deixa as respostas mais rápidas em placas de 12 GB. Desativado por padrão: em sessões longas de agente ele pode se repetir e dar resultados mais fracos. Ative se você usa principalmente o chat e quer a velocidade."
}
+1 -1
View File
@@ -81,5 +81,5 @@
"fx80": "Нужно около {0} ГБ свободного места на диске. То, что не помещается в память, читается с вашего SSD.",
"fx81": "{0} RAM + VRAM, плюс около {1} ГБ на диске",
"fx82": "Более быстрые ответы на видеокартах NVIDIA с 12 ГБ",
"fx83": "Отдаёт предпочтение частям модели, которые уже находятся на видеокарте, поэтому ответы на картах с 12 ГБ становятся намного быстрее. Отключите, если ответы стали выглядеть хуже, чем раньше."
"fx83": "Отдаёт предпочтение частям модели, которые уже находятся на видеокарте, поэтому ответы на картах с 12 ГБ становятся быстрее. По умолчанию выключено: в длинных сессиях агента модель может повторяться и давать более слабые результаты. Включите, если вы в основном общаетесь в чате и хотите скорость."
}
+1 -1
View File
@@ -81,5 +81,5 @@
"fx80": "大约需要 {0} GB 可用磁盘空间。内存放不下的部分会从你的 SSD 读取。",
"fx81": "{0} 内存 + 显存,另需约 {1} GB 磁盘空间",
"fx82": "12 GB NVIDIA 显卡上更快的回答",
"fx83": "优先使用已经在显卡上的模型部分,使 12 GB 显卡上的回答快很多。如果回答看起来比以前差,请关闭。"
"fx83": "优先使用已经在显卡上的模型部分,使 12 GB 显卡上的回答更快。默认关闭:在长时间的智能体会话中,它可能重复内容并给出较弱的结果。如果你主要用来聊天并想要速度,请开启。"
}
+22 -10
View File
@@ -13,19 +13,19 @@ import { nativeFixture } from './helpers/native-fixture.mjs';
const read = rel => readFileSync(fileURLToPath(new URL(rel, import.meta.url)), 'utf8').replace(/\r\n/g, '\n');
const ENV = { // what each switch writes outside its default
faster_long_prompts: { STRATA_KVA: '1' },
faster_12gb_nvidia: { STRATA_ROUTE_PRIOR: '0' },
faster_12gb_nvidia: { STRATA_ROUTE_PRIOR: '1.5' },
faster_radeon_9000: { STRATA_PCIE_FRAC_DEFAULT: 'old' },
deepseek_speedups: { DS4_DEFAULTS: '026', DS4_FAST_ATTN: '0', DS4_ATTN_SLAB: '0', DS4_COPY_PIN: '0', DS4_COPY_HUGETLB: '0', DS4_STORE_SPARE: '0', DS4_STORE_PUT: '0' },
};
const SIX = ['DS4_FAST_ATTN', 'DS4_ATTN_SLAB', 'DS4_COPY_PIN', 'DS4_COPY_HUGETLB', 'DS4_STORE_SPARE', 'DS4_STORE_PUT'];
const DEFAULT = { faster_long_prompts: 'off', faster_12gb_nvidia: 'on', faster_radeon_9000: 'on', deepseek_speedups: 'on' };
const DEFAULT = { faster_long_prompts: 'off', faster_12gb_nvidia: 'off', faster_radeon_9000: 'on', deepseek_speedups: 'on' };
const RTX3060 = { index: 0, name: 'NVIDIA GeForce RTX 3060', vendor: 'nvidia', arch: '86', vram_gb: 12 };
const R9700 = { index: 0, name: 'AMD Radeon AI PRO R9700', vendor: 'amd', arch: 'gfx1201', vram_gb: 32 };
const RX7900 = { index: 0, name: 'AMD Radeon RX 7900 XTX', vendor: 'amd', arch: 'gfx1100', vram_gb: 24 };
const RTX = { index: 0, name: 'NVIDIA GeForce RTX 4090', vendor: 'nvidia', arch: '89', vram_gb: 24 };
const STRIX = { index: 0, name: 'AMD Radeon 8060S', vendor: 'amd', arch: 'gfx1151', vram_gb: 96, uma: true };
test('there are exactly four switches in the app (the Terminal has one more); each writes the engine names of the contract and has its default (KVA off, the others on)', () => {
test('there are exactly four switches in the app (the Terminal has one more); each writes the engine names of the contract and has its default (KVA and the 12 GB routing off, the other two on)', () => {
assert.deepEqual(SPEED_SWITCHES.map(s => s.id), Object.keys(ENV));
for (const sw of SPEED_SWITCHES) {
assert.deepEqual(sw.env, ENV[sw.id], sw.id);
@@ -38,7 +38,7 @@ test('the Terminal\'s Qwen "0.2.6 behaviour" switch is not in the app', () => {
assert.ok(!Object.values(SPEED_SWITCHES.flatMap(s => Object.keys(s.env))).includes('STRATA_DEFAULTS'));
});
test('Faster answers on 12 GB NVIDIA cards: only for Qwen on a discrete CUDA card of 13 GiB or less; Off writes STRATA_ROUTE_PRIOR=0', () => {
test('Faster answers on 12 GB NVIDIA cards: only for Qwen on a discrete CUDA card of 13 GiB or less; off by default since 0.2.8 (#4402), On writes STRATA_ROUTE_PRIOR=1.5', () => {
const ids = context => speedSwitchRows({}, context).map(r => r.id);
assert.deepEqual(ids({ backend: 'cuda', gpus: [RTX3060] }), ['faster_long_prompts', 'faster_12gb_nvidia']);
assert.deepEqual(ids({ backend: 'cuda', gpus: [{ ...RTX3060, vram_gb: 13 }] }), ['faster_long_prompts', 'faster_12gb_nvidia'], '13 GiB counts');
@@ -55,12 +55,24 @@ test('Faster answers on 12 GB NVIDIA cards: only for Qwen on a discrete CUDA car
assert.deepEqual(ids({ backend: 'sycl', gpus: [RTX3060] }), [], 'not a CUDA build');
assert.deepEqual(ids({ backend: 'cuda', gpus: [RTX3060], arch: 'qwen35moe' }), [], 'Qwen3.6-35B-A3B: the routing needs 512 experts');
assert.deepEqual(ids({ deepseek: true, backend: 'cuda', gpus: [RTX3060] }), ['deepseek_speedups']);
const off = setSpeedSwitch({ PATH: '/bin' }, 'faster_12gb_nvidia', false);
assert.deepEqual(off, { PATH: '/bin', STRATA_ROUTE_PRIOR: '0' });
assert.equal(speedSwitchIsOn(off, 'faster_12gb_nvidia'), false);
assert.equal(speedSwitchIsOn({}, 'faster_12gb_nvidia'), true);
assert.deepEqual(setSpeedSwitch(off, 'faster_12gb_nvidia', true), { PATH: '/bin' });
assert.equal(speedSwitchIsOn({ STRATA_ROUTE_PRIOR: '2.0' }, 'faster_12gb_nvidia'), true, 'any other value is the user\'s own and reads as the default');
// a default launch carries nothing: the engine then runs as 0.2.6 did (STRATA_ROUTE_PRIOR unset = 0)
assert.equal(speedSwitchIsOn({}, 'faster_12gb_nvidia'), false);
assert.equal(speedSwitchRows({}, { backend: 'cuda', gpus: [RTX3060] }).find(r => r.id === 'faster_12gb_nvidia').on, false);
assert.deepEqual(setSpeedSwitch({ PATH: '/bin' }, 'faster_12gb_nvidia', false), { PATH: '/bin' }, 'Off is the default: it writes nothing');
// the explicit opt-in the row writes
const on = setSpeedSwitch({ PATH: '/bin' }, 'faster_12gb_nvidia', true);
assert.deepEqual(on, { PATH: '/bin', STRATA_ROUTE_PRIOR: '1.5' });
assert.equal(speedSwitchIsOn(on, 'faster_12gb_nvidia'), true);
assert.deepEqual(setSpeedSwitch(on, 'faster_12gb_nvidia', false), { PATH: '/bin' }, 'back to Off removes the entry');
// the 0.2.7 "Off" wrote STRATA_ROUTE_PRIOR=0: that file is in the default state now, and On replaces it with 1.5
assert.equal(speedSwitchIsOn({ STRATA_ROUTE_PRIOR: '0' }, 'faster_12gb_nvidia'), false);
assert.deepEqual(setSpeedSwitch({ STRATA_ROUTE_PRIOR: '0' }, 'faster_12gb_nvidia', true), { STRATA_ROUTE_PRIOR: '1.5' });
assert.deepEqual(setSpeedSwitch({ STRATA_ROUTE_PRIOR: '0' }, 'faster_12gb_nvidia', false), {}, 'and Off clears it');
// the words say both sides
const hint = SPEED_SWITCHES.find(s => s.id === 'faster_12gb_nvidia').hint;
assert.match(hint, /faster on 12 GB cards/);
assert.match(hint, /Off by default/);
assert.match(hint, /long agent sessions it can repeat itself/);
});
test('DeepSeek speed-ups Off writes DS4_DEFAULTS=026 and the six; On removes all seven; the six alone (an earlier test build) still read as Off', () => {
+4 -4
View File
@@ -472,7 +472,7 @@ applies at the next start. Network, key, MCP and program keys are not editable t
| `repeat_stop_tokens` | `256` | A reply that repeats one token this many times in a row ends as `"length"`. `0` turns it off. |
| `effort_position` | `"start"` | `"end"` puts a `low` or `medium` effort in a short system turn right before the answer, so a request that only changes the effort reuses the conversation cache. How well the model follows a level in that place is not measured. |
| `anthropic_thinking` | as the template | `"on_request"` renders a `/v1/messages` request that asks for no thinking without thinking, as Anthropic does. Claude Code's short helper calls need it. |
| `tool_call_recovery` | off | Also reads a declared tool's call written as `<parameter=NAME>`, as JSON inside `<tool_call>`, as a `<function=NAME>` block without `<tool_call>`, or as a second call inside one `<tool_call>`. On 1,462 agent turns 98.3% read as intended with it and 92.9% without. |
| `tool_call_recovery` | on (since 0.2.8; off in 0.2.7 and before) | Also reads a declared tool's call written as `<parameter=NAME>`, as JSON inside `<tool_call>`, as a `<function=NAME>` block without `<tool_call>`, or as a second call inside one `<tool_call>`. On 1,462 agent turns 98.3% read as intended with it and 92.9% without; the 49 specimens of the test corpus read the same with it on or off. Only a declared tool's call is ever recovered; anything else stays text. `"tool_call_recovery": false` turns it off. |
| `env_to_user` | off | Moves opencode's `<env>` block (working directory, date) to the first user message so the system turn is the same for every session and the disk prefix cache restores it. |
| `return_progress` | off | Per request `"return_progress": true` adds llama.cpp's `prompt_progress` (`total`, `cache`, `processed`, `time_ms`) to the stream, one update per `--prefill` chunk. A prompt shorter than one chunk sends nothing. |
| `prevent_sleep` | off | Windows only: keeps the PC awake while a request runs or waits (`SetThreadExecutionState`). On Linux and macOS one startup line says it does nothing. |
@@ -1019,7 +1019,7 @@ them on your own card.
| `STRATA_PREFILL_EQUAL=1` | CUDA | A prompt segment is read in chunks of equal size, not full chunks and a short last one. Changes rounding. | |
| `STRATA_OWNED_PRICE=exact` | CUDA | The cache sizing prices the prompt path's own buffers by their real allocation. | |
| `STRATA_IQ_MT_MIN=1`, `STRATA_IQ3S_MT1=1` | CPU | See [Draft layer](#draft-layer) (reproducible output; the second gives IQ3_S the multi-token kernel for one token on Alder Lake and later without AVX-512). | |
| `STRATA_ROUTE_PRIOR`, `STRATA_ROUTE_RESIDENT`, `STRATA_ROUTE_RESIDENT_MTP` | CUDA | Routing changes that add speed and also add KL. | Not recommended, except that 0.2.7 turns `STRATA_ROUTE_PRIOR=1.5` on by itself on a discrete NVIDIA card of 13 GiB or less (the owner approved the quality trade for 12 GB cards; the first 0.2.7 candidates used 2.0, see the 12 GB default in the release notes for why it is 1.5); `STRATA_ROUTE_PRIOR=0` turns it off and an explicit value wins. It is never a default on a Radeon, an integrated GPU or a bigger card. The 1.5 default was checked on an RTX 3060 12 GB (IQ3_XXS) with 80 tasks: no copy or code errors seen; agent loops may finish slightly less often, within the run-to-run spread (out of 10 agent tasks 4.5 passed on average over 4 runs at 1.5, against 5.6 over 7 runs with the prior off, where the off runs alone ranged from 4 to 6). Speed against off: story +15%, code +37%. Off: the Expert-settings row "Faster answers on 12 GB NVIDIA cards" or `STRATA_ROUTE_PRIOR=0`. |
| `STRATA_ROUTE_PRIOR`, `STRATA_ROUTE_RESIDENT`, `STRATA_ROUTE_RESIDENT_MTP` | CUDA | Routing changes that add speed and also add KL. | Off by default. `STRATA_ROUTE_PRIOR=1.5` makes the router prefer experts that are already on the card; it is the one worth trying, on a discrete NVIDIA card of 13 GiB or less (an RTX 3060 12 GB, IQ3_XXS: story +15%, code +37% decode against off). It is an opt-in because it can repeat itself and give weaker results in long agent sessions (#4402; our own check on that card: out of 10 agent tasks 4.5 passed on average over 4 runs at 1.5, against 5.6 over 7 runs with the prior off, where the off runs alone ranged from 4 to 6; a stronger setting, 2.0, showed copy and code defects). Recommended for a 12 GB card used mostly for chat and short answers, not for long agent runs. 0.2.7 turned 1.5 on by itself on those cards and 0.2.8 took that back (owner decision of 2026-10-29): with nothing set, the engine routes exactly as 0.2.6 did (the same as `STRATA_ROUTE_PRIOR=0` and as `STRATA_DEFAULTS=026`). Turn it on: the Expert-settings row "Faster answers on 12 GB NVIDIA cards" (it writes `STRATA_ROUTE_PRIOR=1.5`; shown only for a discrete NVIDIA card of 13 GiB or less), `strata launch --set STRATA_ROUTE_PRIOR=1.5`, or the variable itself. Any value you set wins on every card; it is never on by itself. |
| `STRATA_HOST_CORE=last\|sibling` (or `--host-core`) | Windows | `last` puts the host thread on the last physical core, away from the core that gets the GPU's interrupts. `sibling` keeps it on the first core's other hardware thread, so the workers keep every core. The default `first` leaves a hybrid CPU as it is. | One layer-split box went from a ±6% swing to steady and 8% faster. |
| `--pool-affinity measure` | Hybrid CPUs, native packs | Times the `all` and `p-cores` layouts at start (about a second) and takes the faster. The measurement is taken once; where the E-cores' speed changes while the engine runs, `--pool-affinity p-cores` is the steady choice. | |
| `STRATA_KEEP_EMPTY_TURNS=1`, `STRATA_TOPK_STREAM=0` | | See [TROUBLESHOOTING.md](TROUBLESHOOTING.md). | |
@@ -1222,7 +1222,7 @@ On 12.0 cards (sm_120) these also apply:
prompt time and start-up time, which is why smaller PCs keep the SSD reads.
A prompt chunk above 8192 (`--prefill auto:16384` or `auto:32768`) is not bit-exact on CUDA, so the default stays 8192 on
NVIDIA. It is exact on gfx12, where 16384 is the default. `STRATA_ROUTE_PRIOR` raises KL, so below 0.2.7 it was opt-in; 0.2.7 sets 1.5 by itself only on a discrete NVIDIA card of 13 GiB or less. An 80-task check of 1.5 on an RTX 3060 saw no copy or code errors; agent loops may finish slightly less often, within the run-to-run spread; story +15%, code +37%.
NVIDIA. It is exact on gfx12, where 16384 is the default. `STRATA_ROUTE_PRIOR` raises KL and is an opt-in again in 0.2.8 (0.2.7 set 1.5 by itself on a discrete NVIDIA card of 13 GiB or less, and the owner took that back on 2026-10-29 because of repetition loops and weaker results in long agent sessions, #4402). `STRATA_ROUTE_PRIOR=1.5` on an RTX 3060 12 GB: story +15%, code +37%, 80 tasks with no copy or code errors, but 4.5 of 10 agent tasks against 5.6 with it off.
---
@@ -1446,7 +1446,7 @@ with `--batch 2` at 262,144 context saw 538 MiB at the free line become 395 MiB
| not stated | RTX 5070 Ti Laptop, Swift 1.5 IQ3_XXS, a new opencode session in a second folder | `env_to_user`: first request 14,073 tokens with 13,693 from the cache, 1.1 s, against 14,753 read, 11.9 s |
| 0.1.40.2 | Tesla P100 | A question after a long document re-reads up to 16K tokens (55 s at 262K) without `strata_prefix` |
| not stated | Codex CLI 0.160.0, Q2_0, RTX 5070 | First prompt 9,443 tokens in 10 s; later tool-loop turns reused about 96% from the cache and read the new part in 1-2 s. Compaction after an 85,000-token conversation reused 84,895 of 84,997 tokens with `codex_compaction_cache` and 41 of 80,683 without |
| not stated | Signalnine/q27's drift corpus, 1,462 agent turns (Qwen3.8 under Claude Code) | `tool_call_recovery`: 98.3% read as intended, 92.9% without |
| not stated | Signalnine/q27's drift corpus, 1,462 agent turns (Qwen3.8 under Claude Code) | `tool_call_recovery`: 98.3% read as intended, 92.9% without (on by default from 0.2.8) |
| not stated | RTX 3080, RVN IQ3_S config, 8-turn chat replay on a 16K-token system prompt | NaN guard on and off: byte-identical answers in 3 pairs; cost 4.8 us of GPU time a window (7.8 us at most), 0.009% of decode time |
### Context beyond 262K (contributors' runs, RTX 5080, IQ3_S, native path, PR #84)
+3 -1
View File
@@ -1,10 +1,12 @@
// include/strata/core/defaults_026.hpp - STRATA_DEFAULTS=026: the master switch of the Qwen engine's 0.2.7 defaults.
//
// Every default the Qwen engine (`strata`) changed since v0.2.6 goes back to what v0.2.6 did when STRATA_DEFAULTS=026 is in the
// environment (the app's "off" for its speed switches sends it): the residency-biased routing (STRATA_ROUTE_PRIOR), the wide
// environment (the app's "off" for its speed switches sends it): the wide
// hyper-connection up read (STRATA_GR_UP_WIDE), the stream-split hyper-connection read (STRATA_GR_V3), the int8 prompt attention
// (STRATA_PROMPT_ATTN_IMMA), the four gfx12 decode switches of the arch table, the PLE residency policy (STRATA_PLE_AUTO_RAM), and the
// gfx12 decode miss split of 0.15 (back to 0.55). KVA is off by default in 0.2.7 and stays whatever STRATA_KVA says.
// The residency-biased routing (STRATA_ROUTE_PRIOR) was in this set in 0.2.7; it is off by default again (owner, 2026-10-29), so the master switch
// has nothing to take back there, and route_prior_default() answers 0 with the switch on or off.
// An explicit per-feature variable (STRATA_ROUTE_PRIOR=2, STRATA_GR_V3=1, STRATA_PLE_AUTO_RAM=1, ...) or flag (--pcie-frac, --ple-io)
// still wins over the master switch. Each rule is a pure function that takes the answer of qwen_defaults_026() as its `v026`
// argument, so a test can check both settings without touching the environment (src/core/arch_defaults_test.cpp,
+14 -8
View File
@@ -49,16 +49,22 @@ inline bool sm120_default(int major, int minor) { return is_sm120(major, minor)
// `total_bytes`: the card's memory (cudaDeviceProp::totalGlobalMem); `integrated`: a GPU that shares the PC's memory.
constexpr double kSmallCardGiB = 13.0; // "a 12 GB card": 12 GB cards report 11.6 - 12.0 GiB, 16 GB ones 15.6 - 16.0
/// The residency-bias bonus a discrete CUDA card of 13 GiB or less gets when the user set nothing: THE one place the value lives. 1.5 since the
/// owner decision of 2026-10-26 (it was 2.0 in the first 0.2.7 candidates): on the RTX 3060 12 GB with IQ3_XXS the copy and code check found real
/// defects at 2.0 and none in 19 tasks at 1.5 or 1.0, and 1.5 keeps the speed (story +15%, code +37% against off). A longer 61-task check of
/// 0 / 1.5 / 2.0 is still running; if it shows defects at 1.5 this falls back to 1.0.
/// The residency-bias bonus the user can ask for on a discrete CUDA card of 13 GiB or less (STRATA_ROUTE_PRIOR=1.5; the app's Expert-settings row
/// "Faster answers on 12 GB NVIDIA cards" writes it): THE one place the value lives. 1.5 since the owner decision of 2026-10-26 (2.0 had real defects in
/// the copy and code check on the RTX 3060 12 GB with IQ3_XXS; none in 19 tasks at 1.5 or 1.0). Speed against off: story +15%, code +37%.
/// It was the default on those cards in 0.2.7 only. Owner decision of 2026-10-29: OFF by default again (#4402: repetition loops and weaker results in long
/// agent sessions; our own 0.2.7 agent check passed 4.5 of 10 tasks with it on against 5.6 with it off). It stays an opt-in.
constexpr float kRoutePriorSmallCard = 1.5f;
/// STRATA_ROUTE_PRIOR when the user set nothing: kRoutePriorSmallCard (residency-biased routing, changes which experts run; owner-approved for 12 GB
/// cards) on a discrete CUDA card of 13 GiB or less, 0 everywhere else. Measured on an RTX 3060 12 GB only.
inline float route_prior_default(bool hip, bool integrated, double total_bytes, bool v026 = false) {
return !v026 && !hip && !integrated && total_bytes > 0.0 && total_bytes / 1073741824.0 <= kSmallCardGiB ? kRoutePriorSmallCard : 0.0f;
/// STRATA_ROUTE_PRIOR when the user set nothing: 0 on every card (residency-biased routing changes which experts run, so it is only on when asked for:
/// STRATA_ROUTE_PRIOR=1.5, or the Expert-settings row). The same answer as v0.2.6 and as 0.2.7 with STRATA_ROUTE_PRIOR=0 or STRATA_DEFAULTS=026.
/// The arguments are kept so a caller and the table test (arch_defaults_test) still ask the same question per card; none of them changes the answer.
inline float route_prior_default(bool /*hip*/, bool /*integrated*/, double /*total_bytes*/, bool /*v026*/ = false) { return 0.0f; }
/// The lambda the engine uses given the text of STRATA_ROUTE_PRIOR (nullptr = unset): any set value is the user's own and wins on every card
/// (atof; "0" and text that reads as 0 are off; "1.5" is what the Expert-settings row writes), unset is route_prior_default (0).
inline float route_prior_resolve(const char* env, bool hip, bool integrated, double total_bytes, bool v026 = false) {
return env != nullptr ? (float) std::atof(env) : route_prior_default(hip, integrated, total_bytes, v026);
}
/// STRATA_GR_V3 (the stream-split hyper-connection read, another summation order) when the user set nothing: ON for a discrete compute capability
+1 -1
View File
@@ -989,7 +989,7 @@ class OutputParser:
self.rescued = 0 # calls delivered from the reasoning
self.refused = 0 # declared calls kept as reasoning text (quoted, or the turn was cut)
self.fence, self.line, self.ticks = "", "", 0
# recover (opt-in, the config's "tool_call_recovery"): a declared tool's call written next to the template's
# recover (on in the server since 0.2.8, off for a bare OutputParser; the config's "tool_call_recovery": false turns it off): a declared tool's call written next to the template's
# form is the call - `<parameter=NAME>` as the opener, JSON inside <tool_call>, a bare <function=NAME> at the
# start of a line outside code, or a second call in the same <tool_call> (which otherwise merges into one).
self.recover = recover
+11 -5
View File
@@ -4041,7 +4041,7 @@ class Service:
self.reasoning_budget_tokens = 0 # #123: the config's default thinking budget (0: none)
self.repeat_stop_tokens = REPEAT_STOP_TOKENS # #606: one token this many times in a row ends a reply (0: off)
self.anthropic_think_unasked = True # #278: "anthropic_thinking": "on_request" -> False
self.tool_call_recovery = False # opt-in: tool calls in forms next to the template's
self.tool_call_recovery = True # default on (0.2.8): tool calls in forms next to the template's; config "tool_call_recovery": false turns it off
self.images = None # serve/images.py's ImageGen when the config has "images"
self.restore_after_load = None # a session file an image job saved before it unloaded
self.stop_ids = set(tokenizer.encode(IM_END, parse_special=True) +
@@ -8633,6 +8633,15 @@ def _component_exe(reference: str, cfg: dict) -> str:
raise SystemExit(e.exit_code) from None
def tool_call_recovery_setting(cfg: dict) -> bool:
"""The config's "tool_call_recovery" (see OutputParser's recover): ON when the config does not name it (since 0.2.8; 0.2.7 and before: off),
"tool_call_recovery": false turns it off. Anything but true or false stops the start."""
recovery = cfg.get("tool_call_recovery", True)
if not isinstance(recovery, bool):
raise SystemExit(f"[strata] config \"tool_call_recovery\" must be true or false, not {recovery!r}")
return recovery
def main(argv=None, *, lifecycle_event=None, interrupt_exit_code: int = 0) -> int:
try: # files made by a run as administrator still belong to the user
from strata_control import private_files as _pf
@@ -9097,10 +9106,7 @@ def main(argv=None, *, lifecycle_event=None, interrupt_exit_code: int = 0) -> in
if mode not in ("model", "on_request"):
raise SystemExit(f"[strata] config anthropic_thinking must be \"model\" or \"on_request\", not {mode!r}")
svc.anthropic_think_unasked = mode == "model"
recovery = cfg.get("tool_call_recovery", False) # opt-in: see OutputParser's recover
if not isinstance(recovery, bool):
raise SystemExit(f"[strata] config \"tool_call_recovery\" must be true or false, not {recovery!r}")
svc.tool_call_recovery = recovery
svc.tool_call_recovery = tool_call_recovery_setting(cfg)
etu = cfg.get("env_to_user", False) # opt-in: see frontend._env_to_user
if not isinstance(etu, bool):
raise SystemExit(f"[strata] config \"env_to_user\" must be true or false, not {etu!r}")
+24 -1
View File
@@ -1126,7 +1126,7 @@ class ToolCallTagInProse(unittest.TestCase):
class ToolCallRecovery(unittest.TestCase):
"""Opt-in ("tool_call_recovery": true): the model sometimes writes a call in a form next to the template's. These
"""On by default in the server since 0.2.8 (config "tool_call_recovery": false turns it off): the model sometimes writes a call in a form next to the template's. These
shapes are from a corpus of 1,462 agent turns (Qwen3.8 under Claude Code, signalnine/q27): with the switch on, a
declared tool's call in one of them is the call; anything else stays content, verbatim."""
SCHEMA = ToolCallTerminators.SCHEMA
@@ -1255,6 +1255,29 @@ class ToolCallRecoverySwitch(unittest.TestCase):
self.assertEqual(self.run_reply(False), [])
self.assertEqual(self.run_reply(True), [ToolCallRecovery.CALL])
def test_on_by_default_and_the_config_turns_it_off(self):
"""0.2.8: a server that is told nothing reads these calls; "tool_call_recovery": false is the off switch."""
from serve.server import tool_call_recovery_setting
tok = ByteTokenizer()
svc = Service(MockEngine(tok, "x", max_context=CTX), tok, ChatTemplate(ROOT / "serve/chat_template.jinja"))
self.assertIs(svc.tool_call_recovery, True)
self.assertIs(tool_call_recovery_setting({}), True)
self.assertIs(tool_call_recovery_setting({"model": "x"}), True)
self.assertIs(tool_call_recovery_setting({"tool_call_recovery": True}), True)
self.assertIs(tool_call_recovery_setting({"tool_call_recovery": False}), False)
for bad in ("false", 0, 1, None, "off"):
with self.assertRaises(SystemExit):
tool_call_recovery_setting({"tool_call_recovery": bad})
def test_a_fresh_service_reads_the_call_without_being_told(self):
tok = ByteTokenizer()
script = "</think>\n\n<function=write>\n" + ToolCallRecovery.PARAMS
svc = Service(MockEngine(tok, script, max_context=CTX), tok, ChatTemplate(ROOT / "serve/chat_template.jinja"))
with contextlib.redirect_stdout(io.StringIO()):
evs = [x for kind, x in svc.run(tok.encode("hi"), True, ToolCallRecovery.SCHEMA, 3000, {},
threading.Event()) if kind == "event"]
self.assertEqual([e.call.arguments for e in evs if e.kind == "tool_call"], [ToolCallRecovery.CALL])
class UnfinishedToolCall(unittest.TestCase):
"""#211: a call the output ends inside is not reported as a whole one - its streamed JSON is not closed and the
+29 -15
View File
@@ -293,10 +293,12 @@ int main() {
using namespace strata;
CHECK(is_026_token("026") && is_026_token("0.2.6") && is_026_token("v0.2.6"));
CHECK(!is_026_token(nullptr) && !is_026_token("") && !is_026_token("0") && !is_026_token("027"));
// residency-biased routing: 0 under 026 on the card that gets 1.5 otherwise
CHECK(route_prior_default(false, false, 12.0 * GiB, false) == 1.5f);
// residency-biased routing: 0 with the master switch on or off (0.2.8: off by default on every card, 026 or not)
CHECK(route_prior_default(false, false, 12.0 * GiB, false) == 0.0f);
CHECK(route_prior_default(false, false, 12.0 * GiB, true) == 0.0f);
CHECK(route_prior_default(false, false, 8.0 * GiB, true) == 0.0f);
// an explicit STRATA_ROUTE_PRIOR=1.5 wins over 026 as well
CHECK(route_prior_resolve("1.5", false, false, 12.0 * GiB, true) == 1.5f);
// the wide HC up read: on for a 12.0 card on CUDA, off under 026, off in HIP, off on sm_86 / sm_121
CHECK(gr_up_wide_default(false, 12, 0));
CHECK(!gr_up_wide_default(false, 12, 0, true));
@@ -358,19 +360,31 @@ int main() {
{
const double GiB = 1073741824.0;
using namespace strata;
// residency-biased routing: 1.5 on a discrete CUDA card of 13 GiB or less, nothing else
CHECK(route_prior_default(false, false, 11.9 * GiB) == 1.5f); // RTX 3060 / 5070 12 GB
CHECK(route_prior_default(false, false, 12.0 * GiB) == 1.5f);
CHECK(route_prior_default(false, false, 8.0 * GiB) == 1.5f); // an 8 GB card
CHECK(route_prior_default(false, false, 13.0 * GiB) == 1.5f); // the boundary is inclusive
CHECK(route_prior_default(false, false, 12.0 * GiB) == strata::kRoutePriorSmallCard); // the one place the value lives (1.5 by the owner decision of 2026-10-26; 2.0 before)
CHECK(route_prior_default(false, false, 13.5 * GiB) == 0.0f);
CHECK(route_prior_default(false, false, 15.7 * GiB) == 0.0f); // 16 GB card: z440's A4000, P100
CHECK(route_prior_default(false, false, 72.0 * GiB) == 0.0f); // RTX PRO 5000
CHECK(route_prior_default(true, false, 12.0 * GiB) == 0.0f); // a HIP build: a 12 GB RX 6700 XT / 7700 XT
CHECK(route_prior_default(true, true, 12.0 * GiB) == 0.0f); // Strix Halo with a small carve-out
CHECK(route_prior_default(false, true, 8.0 * GiB) == 0.0f); // an integrated GPU on CUDA (Jetson-like)
CHECK(route_prior_default(false, false, 0.0) == 0.0f); // unknown memory
// residency-biased routing (owner decision of 2026-10-29, #4402): OFF by default on every card, the 0.2.6 / STRATA_ROUTE_PRIOR=0 answer.
// 0.2.7 gave 1.5 to a discrete CUDA card of 13 GiB or less; the same cards are listed so the table says where the default went.
const double cards[] = {0.0, 4.0 * GiB, 8.0 * GiB, 11.9 * GiB, 12.0 * GiB, 13.0 * GiB, 13.5 * GiB, 15.7 * GiB, 24.0 * GiB, 31.4 * GiB, 48.0 * GiB, 72.0 * GiB};
for (const double bytes : cards)
for (const bool hip : {false, true})
for (const bool integrated : {false, true})
for (const bool v026 : {false, true}) {
CHECK(route_prior_default(hip, integrated, bytes, v026) == 0.0f);
CHECK(route_prior_resolve(nullptr, hip, integrated, bytes, v026) == 0.0f); // nothing set: off, = STRATA_ROUTE_PRIOR=0
CHECK(route_prior_resolve(nullptr, hip, integrated, bytes, v026) == route_prior_resolve("0", hip, integrated, bytes, v026));
}
CHECK(route_prior_default(false, false, 11.9 * GiB) == 0.0f); // RTX 3060 / 5070 12 GB: was 1.5 in 0.2.7
CHECK(route_prior_default(false, false, 13.0 * GiB) == 0.0f); // the old boundary
// the explicit opt-in still works: any set value wins on every card (the Expert-settings row writes 1.5)
CHECK(strata::kRoutePriorSmallCard == 1.5f); // the one place the opt-in value lives
CHECK(route_prior_resolve("1.5", false, false, 12.0 * GiB) == 1.5f);
CHECK(route_prior_resolve("1.5", false, false, 12.0 * GiB) == strata::kRoutePriorSmallCard);
CHECK(route_prior_resolve("1.5", false, false, 8.0 * GiB, true) == 1.5f); // also under STRATA_DEFAULTS=026
CHECK(route_prior_resolve("1.5", false, false, 72.0 * GiB) == 1.5f); // and on a card the 0.2.7 default never touched
CHECK(route_prior_resolve("1.5", true, false, 12.0 * GiB) == 1.5f); // the variable is the user's own on any build
CHECK(route_prior_resolve("2.0", false, false, 12.0 * GiB) == 2.0f);
CHECK(route_prior_resolve("0.5", false, false, 12.0 * GiB) == 0.5f);
CHECK(route_prior_resolve("0", false, false, 12.0 * GiB) == 0.0f);
CHECK(route_prior_resolve("", false, false, 12.0 * GiB) == 0.0f); // set but empty reads as 0, as atof always did here
CHECK(route_prior_resolve("off", false, false, 12.0 * GiB) == 0.0f);
// the stream-split hyper-connection read: a discrete 12.0 card above 13 GiB (RTX PRO 5000 72 GB, RTX 5090 32 GB), nothing else
CHECK(gr_v3_default(false, 12, 0, false, 72.0 * GiB));
CHECK(gr_v3_default(false, 12, 0, false, 31.4 * GiB)); // RTX 5090
+10 -33
View File
@@ -268,32 +268,15 @@ inline int g_side_mixer() {
#endif
}
// STRATA_ROUTE_PRIOR=lambda: residency-biased routing (the top-10 picked again with a logit bonus for the resident
// experts; route_prior.cu). Unset: 1.5 (strata::kRoutePriorSmallCard, sm120_series.hpp; it was 2.0 until the owner decision of
// 2026-10-26: defects in the copy and code check at 2.0, none in 19 tasks at 1.5) on a DISCRETE NVIDIA card of 13 GiB or less
// (CUDA builds only), 0 elsewhere.
// Measured on an RTX 3060 12 GB only (IQ3_XXS, 5 interleaved pairs at 2.0: +37.6% / +35.2% decode; at 1.5 story +15%, code +37%); the owner approved the
// quality trade for 12 GB cards (it changes which experts run). Not a default in a HIP build (a 12 GB Radeon, or a
// Strix Halo whose reported VRAM is a small carve-out of unified memory: unmeasured there) and not on an integrated GPU.
// STRATA_ROUTE_PRIOR=0 turns it off, any other value wins everywhere. The default is read from the device properties
// (no allocation, no stream work), and Verifier::init asks once per card, so the first ask is never inside a graph capture.
// experts; route_prior.cu). OFF unless asked for (STRATA_ROUTE_PRIOR=1.5, strata::kRoutePriorSmallCard in sm120_series.hpp, is the value the
// app's Expert-settings row writes): 0.2.7 turned 1.5 on by itself on a discrete NVIDIA card of 13 GiB or less, and the owner took that default
// back on 2026-10-29 (#4402: repetition loops and weaker results in long agent sessions). With nothing set this is 0.2.6's behaviour, exactly.
// Measured on an RTX 3060 12 GB only (IQ3_XXS; at 1.5 story +15%, code +37% decode against off). Any value in the variable wins on every card.
// The value is read once.
inline float g_route_prior() {
static const char* const env_s = std::getenv("STRATA_ROUTE_PRIOR");
static const float env = env_s ? (float) std::atof(env_s) : 0.0f;
if (env_s != nullptr) return env;
#if defined(STRATA_USE_HIP) || defined(STRATA_GPU_METAL)
return 0.0f;
#else
static float per_dev[64]; // 0 unknown, else prior + 1
int dev = 0;
if (cudaGetDevice(&dev) != cudaSuccess || dev < 0 || dev >= 64) { cudaGetLastError(); return 0.0f; }
if (per_dev[dev] == 0.0f) {
cudaDeviceProp p;
const bool ok = cudaGetDeviceProperties(&p, dev) == cudaSuccess;
if (!ok) cudaGetLastError();
per_dev[dev] = 1.0f + (ok ? strata::route_prior_default(false, p.integrated != 0, (double) p.totalGlobalMem, strata::qwen_defaults_026()) : 0.0f);
}
return per_dev[dev] - 1.0f;
#endif
static const float lambda = strata::route_prior_resolve(env_s, false, false, 0.0);
return lambda;
}
inline bool g_qfuse() { static const bool on = [] { const char* v = std::getenv("STRATA_QFUSE"); return v != nullptr && std::atoi(v) != 0; }(); return on; }
#define VDBG(...) do { if (g_dbg) { std::fprintf(stderr, "verify dbg: " __VA_ARGS__); std::fflush(stderr); } } while (0)
@@ -803,12 +786,6 @@ bool Verifier::init(const WeightTable& wt, const ModelGeometry& g, SessionState&
release_gpu_fn().store(&release_live_verifiers);
cudaGetDevice(&device_); // a layer split's stage on another GPU: its streams, graphs and buffers live there
rr_stats_ = route_resident_cfg().stats_on(device_); // STRATA_ROUTE_RESIDENT: this GPU's counters, outside graph capture
{ // once per card, here: record_window (graph capture) only reads the cached value
const float rp = g_route_prior();
if (rp > 0.0f && std::getenv("STRATA_ROUTE_PRIOR") == nullptr)
std::fprintf(stderr, "strata verify: residency-biased routing is on by default on this card (STRATA_ROUTE_PRIOR=%.1f: a card of 13 GiB "
"or less; it changes which experts run; STRATA_ROUTE_PRIOR=0 turns it off)\n", (double) rp);
}
strata::kernels::fused_gr_check(); // once per card: which bitwise-equal hyper-connection read runs there
strata::kernels::fused_gr_persist_init(); // opt-in STRATA_HC_PERSIST=1 (HIP)
wt_ = &wt;
@@ -2107,9 +2084,9 @@ bool Verifier::record_window(int T, cudaStream_t cs, std::string& err) {
if (!moe_route(wt, g, l, K, mb, mixed_ + t * N, cs, err, nullptr)) return false;
}
// STRATA_ROUTE_PRIOR=lambda (changes the output): the top-10 picked again with a logit bonus for the resident
// experts; the weights stay the router's (route_prior.cu). The default is g_route_prior() above: 1.5 on a
// discrete CUDA card of 13 GiB or less, off elsewhere (measured on an RTX 3060 12 GB at 2.0: story +37.6%, code +35.2%;
// on an RTX PRO 5000 72 GB -1.9% / -0.5%, on 2x RTX A4000 -4.2% / +11.0%, hence not a default on bigger cards).
// experts; the weights stay the router's (route_prior.cu). g_route_prior() above: off unless STRATA_ROUTE_PRIOR is set
// (measured on an RTX 3060 12 GB at 2.0: story +37.6%, code +35.2%; on an RTX PRO 5000 72 GB -1.9% / -0.5%, on 2x RTX A4000
// -4.2% / +11.0%, so it only helps a card that streams most experts).
const float route_prior = g_route_prior();
if (route_prior > 0.0f && NE == 512 && K == 10 && hits_.d_res != nullptr)
route_prior_top10(logits_ + tb * NE, hits_.d_res + l * g.n_expert, route_prior, ids_ + tb * K, w_ + tb * K, n, cs);
+4 -2
View File
@@ -7,6 +7,8 @@ reads that file and fails when the two disagree, so the Terminal and the app can
- "Faster long prompts" (Qwen KVA) is OFF by default (owner decision, 26 October): ``STRATA_KVA=1`` turns it on. A file that holds ``STRATA_KVA=0`` (the
off switch of an earlier 0.2.7 test build) reads as off, which is what it is now.
- "Faster answers on 12 GB NVIDIA cards" (residency-biased routing) is OFF by default since 0.2.8 (owner decision, 29 October; #4402: it can repeat itself
and give weaker results in long agent sessions): ``STRATA_ROUTE_PRIOR=1.5`` turns it on. The ``STRATA_ROUTE_PRIOR=0`` that 0.2.7's Off wrote is the default state now.
- "Faster answers on Radeon RX 9000 / AI PRO R9700" and "DeepSeek speed-ups" are ON by default; turning them off writes their entries.
The Terminal shows the switches as rows of its Advanced table (strata_cli/launch/params.py), only where they apply: ``strata launch --set STRATA_KVA=1``
@@ -37,8 +39,8 @@ SWITCHES: tuple[Switch, ...] = (
"Reads very long prompts faster by approximating part of the work. Off by default: answers about long documents can miss or mix up details.",
(("STRATA_KVA", "1"),), "qwen-gpu", default="off"),
Switch("faster_12gb_nvidia", "Faster answers on 12 GB NVIDIA cards",
"Prefers the parts of the model already on the graphics card, which makes answers much faster on 12 GB cards. Turn off if answers look worse than before.",
(("STRATA_ROUTE_PRIOR", "0"),), "qwen-cuda-12gb"),
"Prefers the parts of the model already on the graphics card, which makes answers faster on 12 GB cards. Off by default: in long agent sessions it can repeat itself and give weaker results. Turn on if you mostly chat and want the speed.",
(("STRATA_ROUTE_PRIOR", "1.5"),), "qwen-cuda-12gb", default="off"),
Switch("faster_radeon_9000", "Faster answers on Radeon RX 9000 / AI PRO R9700",
"Shares the work between the graphics card and the processor in a way that makes answers faster on these cards. "
"Turn off to go back to the previous setting, which is slower.",
+19 -9
View File
@@ -21,13 +21,13 @@ ROOT = Path(__file__).resolve().parents[2]
ENV = { # what each switch writes outside its default
"faster_long_prompts": {"STRATA_KVA": "1"},
"faster_12gb_nvidia": {"STRATA_ROUTE_PRIOR": "0"},
"faster_12gb_nvidia": {"STRATA_ROUTE_PRIOR": "1.5"},
"faster_radeon_9000": {"STRATA_PCIE_FRAC_DEFAULT": "old"},
"deepseek_speedups": {"DS4_DEFAULTS": "026", "DS4_FAST_ATTN": "0", "DS4_ATTN_SLAB": "0", "DS4_COPY_PIN": "0", "DS4_COPY_HUGETLB": "0",
"DS4_STORE_SPARE": "0", "DS4_STORE_PUT": "0"},
"qwen_defaults_026": {"STRATA_DEFAULTS": "026"}, # the Terminal's troubleshooting switch: not in the app
}
DEFAULT = {"faster_long_prompts": "off", "faster_12gb_nvidia": "on", "faster_radeon_9000": "on", "deepseek_speedups": "on", "qwen_defaults_026": "off"}
DEFAULT = {"faster_long_prompts": "off", "faster_12gb_nvidia": "off", "faster_radeon_9000": "on", "deepseek_speedups": "on", "qwen_defaults_026": "off"}
SIX = ("DS4_FAST_ATTN", "DS4_ATTN_SLAB", "DS4_COPY_PIN", "DS4_COPY_HUGETLB", "DS4_STORE_SPARE", "DS4_STORE_PUT")
RTX3060 = {"name": "NVIDIA GeForce RTX 3060", "vendor": "nvidia", "arch": "86", "vram_gb": 12.0}
RTX4070S = {"name": "NVIDIA GeForce RTX 4070 SUPER", "vendor": "nvidia", "arch": "89", "vram_gb": 12.0}
@@ -94,14 +94,24 @@ class Contract(unittest.TestCase):
self.assertEqual(ids(QWEN, [{"name": "GeForce RTX 3060", "vram_gb": 12.0}]), ["faster_long_prompts", "faster_12gb_nvidia"], "no vendor reported: the name decides")
self.assertEqual(ids(QWEN, [{"name": "Mystery card", "vram_gb": 12.0}]), ["faster_long_prompts"])
def test_the_12gb_switch_off_writes_route_prior_zero_and_on_removes_it(self):
def test_the_12gb_switch_is_off_by_default_and_on_writes_route_prior_1_5(self):
# 0.2.8 (owner, 2026-10-29, #4402): off by default; a default launch carries nothing, so the engine runs as 0.2.6 did
env = {"PATH": "/bin"}
off = W.set_switch(env, "faster_12gb_nvidia", False)
self.assertEqual(off, {"PATH": "/bin", "STRATA_ROUTE_PRIOR": "0"})
self.assertFalse(W.is_on(off, "faster_12gb_nvidia"))
self.assertTrue(W.is_on({}, "faster_12gb_nvidia"))
self.assertEqual(W.set_switch(off, "faster_12gb_nvidia", True), env)
self.assertTrue(W.is_on({"STRATA_ROUTE_PRIOR": "2.0"}, "faster_12gb_nvidia"), "any other value is the user's own and reads as the default")
self.assertFalse(W.is_on({}, "faster_12gb_nvidia"))
self.assertEqual(W.set_switch(env, "faster_12gb_nvidia", False), env, "Off is the default: it writes nothing")
on = W.set_switch(env, "faster_12gb_nvidia", True)
self.assertEqual(on, {"PATH": "/bin", "STRATA_ROUTE_PRIOR": "1.5"})
self.assertTrue(W.is_on(on, "faster_12gb_nvidia"))
self.assertEqual(W.set_switch(on, "faster_12gb_nvidia", False), env, "back to Off removes the entry")
# the 0.2.7 Off wrote STRATA_ROUTE_PRIOR=0: that file is in the default state now, and On replaces it with 1.5
self.assertFalse(W.is_on({"STRATA_ROUTE_PRIOR": "0"}, "faster_12gb_nvidia"))
self.assertEqual(W.set_switch({"STRATA_ROUTE_PRIOR": "0"}, "faster_12gb_nvidia", True), {"STRATA_ROUTE_PRIOR": "1.5"})
self.assertEqual(W.set_switch({"STRATA_ROUTE_PRIOR": "0"}, "faster_12gb_nvidia", False), {})
sw = W.BY_ID["faster_12gb_nvidia"]
self.assertEqual(sw.default, "off")
self.assertIn("faster on 12 GB cards", sw.effect)
self.assertIn("Off by default", sw.effect)
self.assertIn("long agent sessions it can repeat itself", sw.effect)
def test_deepseek_off_writes_the_master_switch_and_the_six_and_on_removes_all_seven(self):
env = {"DS4_ASYNC_T": "4"}