# Prompt KV sharing with batch-invariant arithmetic

**All four cells produced identical generated tokens under the selected batch-invariant mode.** Two independent stock executions, grouped pages and deduplicated pages each returned eight complete 256-token outputs. This is a separate arithmetic discriminator; it does not change the [earlier eight-cell study's long-context failures](kv-residency-observations.md).

The experiment used one A100 SXM4 40 GB and eight distinct top-layer adapters of Qwen3-4B. Its 4,097-token prompt was mechanically constructed from existing calibration windows. It was not a natural customer document, a heldout task-quality benchmark or eight unrelated base models.

| Comparison | Exact completed outputs |
| --- | ---: |
| Independent stock A versus stock B | 8 of 8 |
| Stock B versus grouped pages | 8 of 8 |
| Grouped versus deduplicated pages | 8 of 8 |

The released runtime's batch-invariant mode was selected before Torch/vLLM imports. Retained observations show SM80, enabled LoRA and shrink handling, the instantiated runner classes, and 36 loaded FlashAttention 2 layers with the mode enabled. These are configuration and loaded-class observations, not a per-kernel execution trace. The evidence distinguishes the 117 staged source pins from the smaller set of actual installed/loaded runtime observations.

## What the memory samples show

All four layouts had the same **2 GiB configured KV budget**. Stock A/B rounded this to 227 blocks of 9,437,184 bytes, allocating **2,142,240,768 bytes (2,043 MiB)** each. Grouped and deduplicated layouts allocated 8,192 blocks of 262,144 bytes: **2,147,483,648 bytes (2 GiB)** each. The recorded single backing allocations and tensor-view extents agree with this arithmetic. Their largest recorded live occupancies were **2,016 / 2,016 / 2,016 / 976 MiB**, respectively. The largest sampled counts of fully prefilled resident contexts were **3 / 3 / 3 / 8**. Samples were taken after engine steps and remaps; they are not continuous peaks or physical memory returned to CUDA.

All eight outputs completed in every cell, although the observed residency differed. The deduplicated cell retained 16 page-remap transactions and 15,680 compared pages, exact acknowledgements and table readbacks, stale-generation refusal, and zero final live references. These establish bounded mechanical behavior for this fixture. They do not establish a customer capacity increase, speedup, throughput per GPU-hour, or default-mode qualification. There was no full-memory stock/offload comparison or sustained customer arrival trace.

## Timings and scope

Full parent cell intervals include model loading, inference, validation and process/device cleanup. Nested phase intervals remain separately recorded and must not be added again. The supplier allocation duration and conditional quote are retained as separate accounting evidence, not a per-arm performance denominator or final invoice. The exact host and task key were released and the guard was terminal.

No criterion was relaxed after the run. The original eight-cell study remains rejected; the four-cell result supports only the explicitly selected arithmetic mode and synthetic workload. No new ranking or performance score is assigned.

## Original and derived evidence

The manifest reconstructs **295 files, 30,478,557 bytes**: all 96 original host files, 117 exact staged scientific Git blobs, selected allocation/runtime/cleanup and guard records, tasks, adapter exports and source-specific notices. A new supplement contributes 167 files; 128 originals are reused byte-for-byte from the existing immutable offline-study companion through exact origin/path/hash mappings. Reuse does not reinterpret the earlier study.

The original prepared task is archived. The ready task is a **pre-run deterministic derivation** joined to actual staging digests; the executed host task file was not archived. The manifest labels that distinction. Source archives and input ZIPs are containers, not additional experiments. Their selected contents and original container identities remain retained. No scientific source, pickle, tokenizer or tensor loader runs during reconstruction.

Download the [manifest](kv-batch-invariant-manifest.json), [bounded downloader](kv-batch-invariant-download.py) and [scalar recomputation](kv-batch-invariant-recompute.py):

```sh
python3 kv-batch-invariant-download.py --output batch-originals
python3 kv-batch-invariant-recompute.py --originals batch-originals
```

The downloader verifies both immutable inputs and all selected originals, bounds XZ memory/output, and rejects duplicate paths/keys, extra streams and trailing bytes. Recomputation joins original generated-token events to final outputs, all three comparisons, remap acknowledgements/readbacks, sampled memory, runtime-mode observations and original cleanup clocks. It refuses a result that relabels the earlier failure as qualified.

Qwen3, UltraChat and runtime notices remain alongside the original bytes. The inherited SciFact ZIP is not this study's prompt corpus; the [SciFact/BEIR attribution and distinct license notice](inference-calibration-observations.md) applies separately. Runtime source provenance retains the observed Torch revision and Transformers 5.20.2 license notices without claiming every installed source file equals an upstream Git blob.
