Files
Strata/include
Niko1221 652f5fbd35 generate: the elastic K/V grows from new VRAM when the expert cache cannot give it slots
With --kv-grow accepted at session init, the K/V pools hold physical memory only
for their first 16,384 cells. The start of the elastic K/V then switched growth
off completely when the expert cache could not give slots (no VMM range, no
residency table or expert source, or a cache top at or under its floor of 128
slots, as with --expert-cache 100). The pools stayed at their first cells, and a
longer prompt wrote past them: an illegal memory access.

Now the K/V grows whenever its pools are elastic. The cache gives it slots only
when it can; otherwise every grow takes new VRAM, as it already does when the
cache is at its floor, and the K/V is not trimmed back (there is no cache slot
to return). Nothing changes when the cache can give slots.

kv_grow_rules.hpp holds the decision and the grow target. Tests:
kv_grow_rules_test (CPU) and kv_grow_refused_test (GPU: elastic pools grown from
new VRAM to a 20,000-token prompt's cells and to the whole context, every mapped
cell writable).
2026-11-14 03:38:17 +01:00
..