Port of the conversation block of generate.cpp as a device-independent policy
(ConversationManager over a SessionEngine): park_current with the RAM
admission rule, the live/checkpoint/parked resume choice, parked-image
validation and fallback, steering isolation, the root-pinned turn/periodic
checkpoint chain, STRATA_CKPT_REREAD, cancelled prompts and the end-of-request
live-state update, plus the PromptPlan bookkeeping hook.
Verified three ways: (1) a simulated device whose bytes are a pure function of
the token prefix proves that every resume path (live, checkpoint, parked live,
parked checkpoint, empty) leaves the device in exactly the state of a fresh
read of ids[..resume], across 16 random traffic seeds; (2) scenario tests for
A/B/A parking, rewritten tails, pinned root rotation, RAM/byte/slot pressure,
invalid and failing restores; (3) a differential test against 28 random +
4 scripted (#342 sub-agent) traces generated by the transliterated C++ policy
running over the real ConversationCache/eviction_victim/memory admission.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rust port of conversation_state.cpp and conversation_snapshot.cpp: geometry
and carve sizing with checked arithmetic, checkpoint save/validate/restore
(GDN recurrence, PLE window, QSA indexer tails and the spare pooled row),
per-layer K/V layout for fp16/INT8/Q4/hybrid K8V4/value-only/rotated formats,
streamed-residency and drafter-ring restore, incremental capture with
retained pages, and read-back verification.
Device access is abstracted behind StateMemory (regions + offsets), so the
identical control flow runs against host memory in tests and against CUDA
owners in production. conversation_snapshot_test and
conversation_validation_test are ported check for check (including the fault
injection), and golden fixtures from the compiled original sources pin sizes,
layout codes and payload hashes for 286 layer cases and 18 whole-session
A/B/A scenarios.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rust port of Strata's ConversationCache, ConversationBuffer,
conversation_memory (MemAvailable parse + admit rule) and conv_cache
eviction_victim (root-pinned LRU). The C++ unit tests are ported check for
check, plus differential tests against fixtures produced by compiling the
original headers (golden/gen.sh): random buffer growth/peak traces, eviction,
meminfo/admission grids and 24 long cache operation traces.
The cache is generic over the parked payload so the same policy serves host
snapshots and device-resident sessions.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fixes: native-cpu-expert Display bound, runtime imports/visibility/lifetimes, missing MTP_ORIGINAL_WINDOW export, MmqFormat match arms, stale test constructors. cargo check --target x86_64-unknown-linux-gnu only (no link, no GPU).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Snapshot of target/stra169-direct-port-integration/source-port (without target/), now the tracked base for the full Strata Rust port.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The output-less entry used to run all 48 layers before reporting
Unsupported(Output). Check it right after the layer plan, before the input
stage, so nothing is read or staged for a step that cannot publish. The ignored
pinned-artifact test keeps asserting the same error and unchanged session
state; it is renamed because layers no longer run. No CPU ModelBinding fixture
exists, so no new CPU case is possible for this entry.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- pump: a terminal synthesized because the backend channel ended is not a
completion proof; on client disconnect or oversize frame it closes model
admission and keeps the slot owned instead of clearing it.
- cancel: a request that finished between the active check and the backend call
is acknowledged idempotently instead of failing with cancel_uncertain.
- load/unload workers that panic end exactly their own unresolved operation as
indeterminate (LifecycleGuard is disarmed under the completion lock and only
acts on an operation still Accepted), never a later operation.
Accepted request identities are still never forgotten; the 256-identity
capacity refusal is unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The first KarPleScatter buffer is 64 MiB, larger than the 16 MiB spacing used
by two fixtures, so their ranges overlapped and the alias check refused before
the intended assertion. Space handles by 256 MiB, skip the +1 misalignment case
for byte-aligned slots and offset the overlap probe by an aligned step. The
assertions and production code are unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>