A falsify-first root cause for a concurrent 4-bit decode crash: batch-composition KV-pool wipe trips a re-seed precondition
Ran Tao (Octoryn Research)
Abstract
Falsify-first root cause for a fatal trap that killed a single-resident 4-bit ~30B sparse-MoE decode daemon under concurrent decode on one Apple Silicon machine. An orchestration-free reproducer isolates the trigger: concurrent chat and interleaved chat-plus-embed crash, while embeddings-only and sequential traffic survive, refuting an "embeddings poison decode" guess. The mechanism is a batch-composition-change wipe of resident KV pools tripping a re-seed precondition no steady-state decode meets. Serializing GPU decode prevents it but gives no speedup; the per-stream fix is unimplemented.
A falsify-first root cause for a concurrent 4-bit decode crash: batch-composition KV-pool wipe trips a re-seed precondition
1. Contribution
Claimed. A code-level root cause, established falsify-first, for a fatal trap (a runtime precondition failure) that killed a single-resident 4-bit ~30B sparse mixture-of-experts (MoE) decode daemon when multiple decode streams ran concurrently. We contribute: (a) a minimal, orchestration-free reproducer (pure HTTP requests against the resident daemon, no agent stack) that isolates the trigger to the resident inference backend; (b) a four-cell reproduction matrix that localizes the crash to concurrent decode and refutes an initial "embeddings poison decode state" hypothesis; (c) the precise mechanism — resident key/value (KV) pools on the GPU matrix-multiply layer are keyed by stream identity and batch size and are wiped on any batch-composition change, after which re-seeding demands a full KV prefix that steady-state decode never carried; (d) a contained mitigation (a feature flag that serializes GPU decode) that makes multi-sub-agent orchestration safe.
NOT claimed. No parallel-decode speedup (the mitigation serializes GPU decode). No fix to the underlying pool design (a per-stream isolation rewrite is unimplemented). No behavior beyond a single machine. No reproduction across multiple machines, model families, or precisions. This is a single-machine diagnostic with a single observed reproduction per scenario; it is not a throughput benchmark.
2. Methods
| Item | Value |
|---|---|
| Model | ~30B-parameter sparse mixture-of-experts, 4-bit packed-int4 single-resident store |
| Engine | Internal Apple-Silicon 4-bit resident decode path |
| Hardware | Single Apple Silicon machine. Exact SKU/RAM/OS: not recorded in source |
| Build | Recent build carrying the root-cause analysis plus mitigation; an adjacent prior fix added execution serialization for a shared-KV-pool data race |
| Reproducer | Pure HTTP requests against the resident daemon, no orchestration/agent stack; fresh daemon per scenario; six concurrent streams |
| Capstone regression | Orchestration regression at low max concurrency |
| Oracle / parity | not applicable (crash diagnostic, not a parity run) |
| Precision | 4-bit (packed int4 resident) |
| Crash classification | Runtime precondition failure → fatal trap, faulting frames read from crash reports |
3. Results
Reproduction matrix (real 4-bit ~30B model, six concurrent streams, one observed run per scenario):
| Scenario | Verdict | Meaning |
|---|---|---|
| Sequential chat + embed | SURVIVED | a single in-flight stream is fine |
| Concurrent chat completions | CRASHED | concurrent decode is the trigger |
| Concurrent embeddings | SURVIVED | embeddings concurrency is safe |
| Interleaved chat + embed | CRASHED | crashes because chat (decode) is involved |
Two crash sites, one cause. Both the batched decode path and the single-stream decode path fail on a precondition with the same intent ("key history too short to seed"). One fires in the batched decode loop, the other in the single-stream cached-step path.
Root cause. The resident KV pools are persistent mutable state on the GPU matrix-multiply layer, keyed by stream identity (single-stream) and by batch size (batched slabs). They assume a stable in-flight stream set. The batch loop performs continuous batching (active, non-finished streams only), so the batch size changes as requests join and finish; a batch-size change wipes the slabs, resets the filled counter, and the seed loop then tries to re-seed every continuing stream up to its current position. Because decode-appended K/V lives only in the GPU pools — the host-side cache is merely a counter — steady-state decode carries only the incremental KV, not the full prefix, and the precondition fails. The single-stream precondition fires symmetrically when a stream migrates between the batched and single pool sets as the active count crosses one.
Why the existing lock did not help. The prior execution-serialization lock prevents a GPU data race but not the state collision: a batch-size change or path migration between locked calls still wipes a continuing stream's KV.
Mitigation (shipped, no engine hot-path code). A feature flag disables single-encoder batched decode, which forces request-granular serialization: the batch loop truncates each step to the oldest job until it finishes, so exactly one stream's pool is live at a time and no wipe collision occurs. Observed: the concurrent-chat scenario with the flag → SURVIVED; the orchestration capstone regression at low max concurrency → all checks PASS, daemon SURVIVED, with all governed sub-agents correct (a calculator action, a memory action, a denied send-email action, and a summarize action).
4. Ablations / negative controls
- Refuted hypothesis (recorded honestly). The initial hypothesis "embeddings poison decode state" is falsified by the matrix: concurrent embeddings SURVIVED while concurrent chat completions CRASHED. The trigger is concurrent decode, not embeddings.
- Lock-domain control. The prior execution-serialization fix does not prevent the crash, isolating the failure to shared-pool state composition rather than a GPU data race.
- Lockstep negative case. A prior constant-batch-size batched-serving benchmark never crashed because it ran all streams in lockstep at a fixed batch size, never triggering the batch-size-change re-seed — showing the crash is specifically a batch-composition-change phenomenon, not batching per se.
5. Threats to validity / limitations
- Single observed run per scenario; no variance, no repeat counts recorded. Evidence level is experimental, not reproduced. The matrix verdicts are crash/no-crash observations, not statistics.
- Hardware under-specified. Exact machine SKU, RAM, and OS version are not recorded in source.
- Single model, single precision. Only the one ~30B sparse-MoE 4-bit configuration was exercised; no claim for other families, precisions, or model sizes.
- Mitigation trades throughput for safety. The serialized-decode mode is concurrent submission with serialized GPU decode: no parallel-decode speedup, and micro-batch throughput is off in this mode. It is a per-deployment choice, not a default flip; the default keeps batched throughput for single-stream and lockstep-batch serving but remains unsafe under the agent-concurrency pattern.
- Root cause is unfixed. The real single-machine fix (per-stream KV/scratch isolation) is a change to the validated batched path and is not implemented; it would require re-validating batched throughput and per-stream byte-identical parity. A scale-out alternative (multi-resident data-parallel federation) is cross-machine only, since one machine cannot hold two copies of the model resident.
- Capstone scope. The PASS at low max concurrency demonstrates safety and correctness under the mitigation; it does not establish an upper concurrency bound or sustained-load durability.
6. Reproducibility
- Reproducer. Run the concurrency-decode reproducer against a fresh 4-bit ~30B resident daemon; observe the two concurrent-decode scenarios crash and the sequential and embeddings-only scenarios survive. Confirm the mitigation by enabling the serialized-decode flag and re-running the concurrent-chat scenario (→ SURVIVED) and the orchestration capstone regression at low max concurrency (→ all checks PASS).
- Environment. Machine SKU / RAM / OS / toolchain versions: not recorded in source.
Claim boundary
The author's explicit scope — what this work does and does not establish — carried over from the Octoryn Research publishing model.
Proves
- The crash trigger is concurrent decode, not embeddings: concurrent chat and interleaved chat-plus-embed crash, while concurrent embeddings and sequential traffic survive in a minimal orchestration-free reproducer.
- High-level cause: resident key/value pools keyed by stream identity and batch size are wiped on continuous-batching batch-composition changes; re-seeding then requires a full prefix that steady-state decode never carried, tripping a precondition.
- A contained mitigation that serializes GPU decode prevents the crash: the concurrent-chat scenario survived and an orchestration regression passed at low max concurrency with the daemon surviving.
Does not prove
- Any parallel-decode speedup; the mitigation serializes GPU decode and disables micro-batch throughput.
- A per-stream KV isolation fix, which is unimplemented and would require re-validation of batched throughput and per-stream parity.
- Statistical reliability: a single observed run per scenario, with no variance or repeat counts recorded.
- Behavior beyond a single machine, beyond the one ~30B sparse-MoE model, or at any precision other than 4-bit.
Applies when
- A single-resident 4-bit ~30B sparse mixture-of-experts decode daemon on one Apple Silicon machine.
- Multiple decode streams submitted concurrently so batch composition changes under continuous batching.
- A build with single-encoder batched decode enabled by default.
Does not apply when
- Sequential or single in-flight decode, or embeddings-only concurrency.
- Lockstep batched serving at a constant batch size, which never triggers the batch-change re-seed.
- Running with the serialized-decode mitigation engaged.
- Cross-machine multi-resident data-parallel deployments.
Authors
- Ran Tao — Investigation, Writing
Cite this
Citation
Tao, R., Octoryn Research. (2026). A falsify-first root cause for a concurrent 4-bit decode crash: batch-composition KV-pool wipe trips a re-seed precondition (RN-2026-0013). Octopus Research Institute.
BibTeX
@techreport{orirn20260013,
title = {A falsify-first root cause for a concurrent 4-bit decode crash: batch-composition KV-pool wipe trips a re-seed precondition},
author = {Tao, Ran and {Octoryn Research}},
institution = {Octopus Research Institute},
year = {2026},
note = {Permanent ID RN-2026-0013. Not peer reviewed.}
}Disclosures
- Funding
- Hardware and infrastructure provided by Octoryn / Octopus Core Pty Ltd.
- Conflicts of interest
- Octoryn ships commercial inference and governance tooling; findings are reported independently.
