Building Our First Inference Engine
Assemble tokeniser, backend, sampler, loop and record into one engine with a stable interface, check each replaceable part against a reference, and measure the baseline.
The first engine in this chapter had a defect that a single-request determinism test could not detect. For request seed \(s\) and generation step \(k\), it seeded a fresh random-number generator with \(s+k\). Two distinct request-step pairs can therefore initialise exactly the same generator: seed 2 at step 0 and seed 1 at step 1 both use the integer 2. Across 100 consecutive request seeds and 32 steps apiece, the 3,200 request-step pairs collapsed to just 131 distinct seed values. On a controlled sequence of identical logits, the sampled choices for seed 2 were an exact one-step-shifted copy of those for seed 1 at all 31 overlapping steps.
Nothing crashed. Each request was reproducible, its sampled output looked plausible, and a test that ran the same request twice passed. The defect appeared only when the relationship between request seeds was examined. That is the relevant failure mode for a service that assigns consecutive or otherwise predictable seeds to separate requests. This experiment establishes deterministic seed aliasing; it does not by itself measure real-world user traffic, statistical independence or output quality.
This chapter uses that defect to motivate a first inference engine: a composition of parts with contracts that can be tested independently and together. The engine should be inspectable, should retain evidence about what produced a result, and should supply a reference against which replacements can be evaluated. Those are design goals, not automatic guarantees. A reproducible wrong answer remains wrong, and agreement between two implementations on a small corpus remains limited evidence.
Where this sits
What Is Inference? to Autoregressive Generation developed the request record, artefact identity, token selection, a hand-written GPT-2 forward pass and a generation loop with stopping and text decoding. This chapter connects those pieces into Inference Lab engine version 0 and closes Part I. The result is a concrete executable boundary between a request and a model, not merely a collection of examples.
Version 0 deliberately uses full-prefix recomputation: no KV cache, batching or concurrent scheduling. The reported benchmarks use a single CPU thread, although the real-model backend accepts a device argument that has not been qualified here. The objective is a testable baseline, not a production-ready server. Later changes should be compared on the same workloads, with explicit numerical or behavioural acceptance criteria, and with uncertainty in the timings reported rather than hidden.
For the wider Pi series, the useful boundary is the request/result contract. An agent or retrieval system need not know how the backend computes logits, but it does need to know which model and decoding policy ran, how termination occurred, and what the engine actually returned. Version 0 exposes that boundary locally. It does not yet provide a network API, end-to-end request replay, cancellation or a streaming transport.
Parts and contracts
The implementation is assembled from five parts. The contracts below describe the public interfaces in examples/ch06/lab_engine.py; they should not be read as claiming stronger validation or provenance than the code currently supplies.
| Part | Implemented contract | Responsibility |
|---|---|---|
| Request | Request(prompt, max_new_tokens, sampling, stop_strings, use_eos) |
Holds inputs and checks selected invariants at construction |
| Backend | encode(text), decode(ids), next_logits(ids), eos_token_id, manifest() |
Tokenisation, model execution and reported identity |
| Sampler | select(logits, config, step) -> int |
Greedy or seeded token selection, separate from the forward pass |
| Loop | Autoregressive Generation’s generate(...) |
Repeated scoring, token choice, EOS/stop-string handling and step measurements |
| Result | text, generated_ids, stop_reason, usage, timing, steps, provenance |
Captures the output and the subset of execution context currently recorded |
Two sampler implementations (ListSampler and TorchSampler) and three backends (TableBackend, LibraryBackend, OracleBackend) make these boundaries replaceable in the examples.
Boundaries reduce the number of components that must change together, but they do not eliminate cross-component obligations. A backend replacement can change tokenizer ids, EOS semantics, numerical precision or the supported context length; a sampler can depend on the shape and finite values of its logits; and a loop can change which output text is visible. A successful swap must preserve or explicitly renegotiate those contracts, not merely satisfy method names.
The request is validated when it is constructed
Request is a frozen dataclass with a __post_init__ check. The implementation rejects non-positive max_new_tokens, rejects non-positive temperature for non-greedy sampling, rejects top_k < 1, rejects top_p outside \((0,1]\), and rejects empty stop strings. This is a useful shift from discovering some failures halfway through a request to discovering them at construction. It is not yet comprehensive input validation: Python annotations are not enforced at runtime; booleans, non-finite numbers and wrong types are not systematically rejected; top_k is not checked against a backend’s vocabulary; and sampler parameters are not range-checked when greedy=True. The claim that an invalid request cannot exist would therefore be too strong.
The selection policy is Tokens, Embeddings and Probability’s SamplingConfig (greedy, temperature, top_k, top_p, seed). In this engine, greedy=True bypasses stochastic selection, so a zero temperature is not divided by anything in that branch. It is clearer to treat greedy as a separate named policy rather than as the literal value \(T=0\) in the temperature formula. A publication-grade request validator should also define how mutually irrelevant or contradictory fields are handled and reject invalid numeric types and values before a backend is called.
The backend hides everything model-specific
The backend boundary is deliberately small: encode text into ids, decode ids into text, and supply last-position logits for a prefix. Three implementations are provided:
TableBackendwraps the seeded transition-table demonstration from What Is Inference?. It has no learned GPT-2 parameters and is useful for fast, controlled tests; its manifest is intentionally minimal.LibraryBackendloads a Hugging Face causal language model and computes logits with its library implementation. The experiments here used the pinned GPT-2 snapshot on CPU.OracleBackenduses the same architecture and parameter values but computes logits through The Transformer as a Computation’s hand-written GPT-2 forward pass, still using PyTorch tensor operations. It is an independent composition of operations, not an independent mathematical proof or independently sourced model.
The manifest is not identical across backends. The toy backend reports only its backend name, seed, vocabulary size and simulated status. For the library backend, the code records its implementation/version string, model identifier, resolved snapshot directory, reported dtype, parameter device, SHA-256 values for five selected files, and a digest of parameter tensors. The oracle overrides the backend and implementation labels. manifest_sha256 is SHA-256 of a canonical JSON serialisation of that manifest. This is useful as a compact comparison key, but it does not cover every artefact file, implementation source, runtime setting or execution dependency; the code also labels dtype as float32 rather than inspecting it dynamically. A self-computed hash is not an attestation of origin, and matching parameter digests do not establish tokenizer compatibility or buffer identity.
The library and oracle backends answer two different comparison questions. First, do they select the same generated ids on specified prompts? In the recorded experiment, four prompts each produced 32 identical greedy tokens through the common engine. Second, do the records claim the same execution path? They do not: the parameter digests agreed, while their manifest hashes differed because the backend and implementation fields differed. That is the intended result. It is evidence for agreement over these four trajectories, not a measurement of all logits, all prompts, every hardware configuration or arbitrary decoding settings.
A difference in manifest hashes is informative only because we know which fields entered the hash. Two implementations can have different hashes while producing identical outputs; they can also have identical hashes if the implementation changed in a way the manifest omitted. The Transformer as a Computation’s numerical comparison of logits supplies complementary evidence to Chapter 6’s generated-token comparison. Neither removes the need to test near-ties, longer contexts, stochastic selection and future runtime variants. The manifest should eventually include a versioned implementation identity and a complete enough model/tokenizer record to distinguish materially different executions.
Two samplers, one of them trusted
Tokens, Embeddings and Probability supplied a readable Python-list sampler. That implementation is a useful behavioural reference for token selection, but sorting and renormalising 50,257 entries in Python makes it unsuitable as a performance target. Version 0 therefore also provides TorchSampler, whose operations are vectorised with PyTorch. A second implementation is valuable only when it is checked on the same logits, configuration, seed and step; speed alone would not justify replacing the reference.
The recorded differential experiment compares the selected token ids for five sampling configurations and ten seeds per logit row. The configurations cover greedy decoding, unfiltered sampling, temperature with top-k, temperature with top-p, and temperature with both filters. The recorded counts are:
| Logits | Rows | Configurations | Seeds | Comparisons | Mismatches |
|---|---|---|---|---|---|
| Random, vocabulary 5,000 | 40 | 5 | 10 | 2,000 | 0 |
| Real GPT-2, vocabulary 50,257 | 24 | 5 | 10 | 1,200 | 0 |
Agreement required consistent tie ordering, use of float64 in the tensor sampler, identical derived random seeds and a common cumulative-probability draw rule. The recorded experiment covered 40 random rows × 5 configurations × 10 seeds and 24 GPT-2 rows × 5 configurations × 10 seeds. The comparison helper passed step 0 to both samplers on every row; it did not sweep the full per-step seed derivation across a complete generated trajectory. Moreover, the same code family defines both implementations, so shared mistakes remain possible.
The 3,200 observed choices matched exactly. This is a valuable regression result, not a proof of equivalent distributions or general numerical equivalence. Near-equal logits, exact ties after filtering, non-finite inputs, an empty candidate set and cumulative sums near the random threshold deserve explicit edge-case tests. Numerical differences can alter one sampled token and thereby change the entire autoregressive continuation; later benchmarks must report such divergences rather than silently treating all output differences as model changes.
The seed defect, in detail
The code replaces seed + step with derive_seed(seed, step): SHA-256 of the text representation of the pair, truncated to a 64-bit integer and used to initialise Python’s pseudorandom generator for that step. This removes the specific additive aliasing pattern for the tested pairs. It does not mathematically guarantee distinct seeds for every possible pair: a 64-bit digest can collide. Nor does it establish statistically independent streams or uniqueness across different requests that are given the same original seed. The controlled comparison holds logits fixed at [2.0, 1.0, 0.5, 0.1] so that any shifted output pattern is attributable to the seeding scheme rather than changing model scores.
| Scheme | Distinct derived seed values among 3,200 tested pairs | Shifted-choice matches, 31 comparisons |
|---|---|---|
Additive seed + step |
131 | 31 / 31 |
| SHA-256-derived 64-bit seed | 3,200 | 16 / 31 |
The second row reports observed uniqueness in a finite test set, not guaranteed collision-freedom or independence.
For identical logits, two independently sampled choices would match with probability \(\sum_i p_i^2 \approx 0.399\). The hash-derived scheme agreed at 16 of 31 shifted positions (about 52 per cent), a result not obviously inconsistent with that benchmark probability. But the 31 comparisons are few, the draws are deterministic functions of related inputs, and output-match frequency is a weak diagnostic for a random-number generator. The defensible finding is narrower: the new scheme breaks the demonstrated, exact shifted-copy defect and has no collisions among these 3,200 tested derived seeds.
The previous single-request checks asked whether identical inputs reproduce identical outputs. Both schemes satisfy that property. The regression checks now assert that selected pairs do not alias and that the old shifted-copy counterexample is no longer reproduced. For a serving runtime, the stronger design task is to specify request-level random-state ownership: what happens when callers reuse a seed, how unique per-request streams are derived, whether concurrent scheduling changes draws, and whether a persistent generator or one generator per step is intended. This chapter tests only a small part of that contract.
The lesson is not that hashing a seed makes randomness safe. It is that tests must target the undesired relationship between executions, not only reproducibility inside each execution. A deterministic engine can be exactly reproducible and still contain a deterministic cross-request defect.
What the engine returns
The Result dataclass carries generated text and ids, a termination reason, usage counters, a timing breakdown, per-step records and provenance. The structure below is the current output schema, rather than a promise that it captures every input needed for faithful replay:
Result(
text, generated_ids, stop_reason,
usage = {prompt_tokens, completion_tokens, positions_processed},
timing = {total_seconds, forward_seconds, select_seconds, other_seconds},
steps = [...per-step records...],
provenance = {backend, manifest_sha256, manifest, sampler, sampling, loop},
)
Three aspects of this schema are worth examining separately: work accounting, the timing boundary and the completeness of provenance.
Usage distinguishes output from work. completion_tokens counts entries in generated_ids, whereas positions_processed is the sum of the full-prefix lengths sent to the backend. For a 17-token prompt and 32 generation steps, those are 32 and 1,040 respectively. The result does not currently spell out that an EOS token can be counted in generated_ids while being withheld from emitted text, or that a stop string can be removed from text after its token ids have already been generated. A request record should keep the token and text accounting conventions explicit.
Timing is an internally consistent partition, not the entire lifetime of a request. Engine.generate starts its wall-clock timer after prompt encoding, then subtracts the accumulated forward_seconds and select_seconds from that wall interval to obtain other_seconds. The three values therefore sum by construction, and the test checks that identity. Tokenisation and any subsequent construction of the Result and provenance record fall outside this reported total_seconds. The remainder is not solely engine logic; it also contains decoding, stop matching, loop bookkeeping and call overhead. These boundaries must be documented before results are compared with end-to-end service timings.
Provenance is a partial execution record. It includes the manifest and hash, backend and sampler names, the sampling configuration, and a description of the no-cache loop. It does not currently include the original prompt or encoded prompt ids, stop_strings, use_eos, a code hash, all tokenizer/config files, or a record of every execution environment setting. Those inputs can change the result. Consequently, an isolated Result is not yet sufficient for complete replay, and the manifest hash should be treated as a comparison aid rather than proof of identity or integrity. Recording a canonical request alongside the result is a concrete next step.
Where a step’s time goes
The overhead probe runs 32-token generations on GPT-2 with each sampler and two policies: greedy selection and temperature \(0.8\), top-k \(40\), top-p \(0.9\). It reports median forward and selection times across steps, while the selection-share column is calculated from sums of step timings. Those aggregates answer different questions and must not be recomputed by simply dividing the printed medians. Each table cell is one generation trajectory, not a replicated performance comparison.
| Sampler | Rule | Median forward | Median selection | Selection share of step |
|---|---|---|---|---|
| List | greedy | 100.9 ms | 3.4 ms | 3.4% |
| List | T=0.8, k=40, p=0.9 | 107.4 ms | 47.7 ms | 32.5% |
| Torch | greedy | 103.5 ms | 3.5 ms | 3.2% |
| Torch | T=0.8, k=40, p=0.9 | 99.5 ms | 5.2 ms | 5.1% |
For this measured 32-token trajectory, the Python-list sampler’s selection operations accounted for 32.5 per cent of the sum of forward and selection time with temperature, top-k and top-p enabled; the tensor sampler accounted for 5.1 per cent under the same policy. Greedy selection was much cheaper in both. This revises What Is Inference?’s greedy-only impression that token selection is negligible. The stronger conclusion is about configuration dependence: filtering and sampling 50,257 logits has a material cost in the reference implementation. The recorded text prefixes agree under the matched policies, but the overhead report does not itself prove complete sequence equality.
The list sampler remains useful as a transparent reference. The tensor sampler is a candidate optimisation, with agreement evidence from the differential corpus and indicative performance evidence from one run per cell. As model execution becomes faster, the relative importance of token selection may increase—but the size of that effect depends on the model, vocabulary, device, logits transfer and implementation. The next benchmark should randomise run order, repeat each configuration and report distributions rather than single-trajectory percentages.
The baseline
The following measurements are a noisy CPU baseline, not a leaderboard: GPT-2 small, the 17-token prompt used in Autoregressive Generation, Claude, Caching and API-Level Optimization greedy outputs, the tensor sampler, one warm-up request excluded and three timed requests per backend. Time is the engine’s internal generation interval, excluding initial model loading and prompt tokenisation as described above.
| Backend | Runs (s) | Median | Tokens/s | ms per token |
|---|---|---|---|---|
| Library | 3.94, 4.12, 4.64 | 4.12 s | 7.8 | 129 |
| Oracle | 4.98, 7.07, 7.36 | 7.07 s | 4.5 | 221 |
For each completed 32-step run, the naive engine processed 1,040 token positions while the prefix contained only 48 distinct positions by the final step’s accounting convention—a 21.7× recomputation ratio (1,040 / 48). That figure is a work-count model, not a measured KV-cache speedup. Both backends produced identical generated ids across their three repeated runs, but this says nothing about the quality of those ids.
Three timings per backend do not establish a stable ranking. In this session the library median was 4.12 seconds and the oracle median was 7.07 seconds, but the oracle’s observations ranged from 4.98 to 7.36 seconds and its earlier equivalence runs were sometimes comparable to the library. The difference could contain environmental noise, allocation effects and implementation differences; the experiment did not isolate their contributions. Preserve the raw samples, rerun with controlled warm-up and execution conditions, and state the workload and timing boundary. For now the baseline supports only an approximate scale of several seconds for 32 uncached tokens on this CPU, not a defensible performance winner.
What the engine does not do
This list is the scope boundary for version 0 and the acceptance backlog for later chapters.
- No KV cache. The backend recomputes the prefix at every step (Key-Value Caching).
- No batching or concurrent request scheduling. Only one generation is handled per call (Continuous Batching, Request Scheduling and Admission Control and Concurrent Requests and Streaming).
- No GPU qualification. The measured configuration is CPU-only; accepting a
deviceargument does not constitute GPU validation (Matrix Multiplication and GPU Execution onward). - No exposed streaming callback or transport in
Engine.generate. Autoregressive Generation’s underlying loop has anon_texthook, but this engine does not forward one, and no network stream is implemented (Concurrent Requests and Streaming). - No request cancellation, timeout policy, or back-pressure. External interruption is not part of the engine contract (Reliability, Cancellation and Recovery).
- No per-request peak-memory measurement. Usage reports tokens and recomputed positions, not allocator or device memory.
- No full request replay record. Prompt ids, EOS and stop-string policy, and some execution details are absent from
Result. - No complete artefact/compatibility qualification. Selected file hashes and a parameter digest are reported, but tokenizer/weight pairing and implementation identity are not fully enforced.
- No comprehensive request or numeric edge-case validation. The frozen dataclass prevents assignment to fields after construction, not malformed values inside them.
What the numbers do not show
- One GPT-2 snapshot and one measured CPU environment. Model and hardware changes may alter both runtime and numerical behaviour.
- One main prompt, limited repetitions. The baseline consists of three requests per backend; overhead cells are single trajectories. No ranking is justified.
- Finite differential corpus. The samplers agreed on 3,200 chosen tokens across tested logits and configurations; sequence-level and boundary-case equivalence were not established.
- Backend comparison is greedy and narrow. Four prompts and 32 tokens each do not establish identity of distributions or kernels.
- Seed uniqueness is finite. No collisions were observed among 3,200 hash-derived 64-bit values; independence, collision-freedom and uniqueness when caller seeds repeat are not established.
- Measurement boundary excludes encoding and reporting. The reported
total_secondsis not request-arrival-to-response latency. - Manifest and request completeness remain open. File hashes do not establish provenance, and the recorded result cannot independently replay every input.
- No quality or robustness evaluation. Equivalent token choices may reproduce the same errors, and numerical approximation can sometimes be acceptable under explicit tolerances.
Inference Lab increment
Version 0 exposes a small local programming interface; this is a Python demonstration, not a stable network or production API:
engine = Engine(backend, sampler)
result = engine.generate(Request(prompt, max_new_tokens=32, sampling=SamplingConfig(...)))
The executable baseline composes the earlier book components, but assembly is not completion. What Is Inference? contributed timing and stage separation; From Training to Execution, partial artefact identification; Tokens, Embeddings and Probability, deterministic selection rules; The Transformer as a Computation, a GPT-2 forward-pass reference; and Autoregressive Generation, stopping and decoding logic that still needs additional edge-case hardening. For subsequent work, use an explicit acceptance ladder: (1) the candidate satisfies interface and request-validation tests, (2) it matches the reference on relevant deterministic and numerical cases within stated tolerances, (3) it passes streaming, stop, EOS and provenance regressions, and (4) only then is performance measured against a reproducible baseline. Approximate computation such as quantisation may legitimately change logits or even token choices; such changes need separate accuracy and behavioural criteria, not an automatic declaration that a different model was loaded.
What you should now be able to do
- Sketch the five engine boundaries and explain the assumptions exchanged between the tokenizer, backend, sampler and loop.
- Describe which
Requestfields the implementation actually validates, and construct an untested malformed request that it currently accepts. - Explain why seeded reproducibility is different from cross-request seed uniqueness and from statistical independence.
- Compare reference and candidate samplers on matched logits and explain what 3,200 successful choices cannot establish.
- Distinguish parameter identity, manifest identity, implementation identity and observed output agreement.
- Reconcile generated-token counts with visible output when EOS or a stop string ends the request.
- Describe the exact interval timed by
Engine.generate, including what is excluded from its reported total. - State an honest CPU baseline with its sample count, warm-up procedure, uncertainty and unmeasured production behaviour.
Key terms
- Engine: the component that coordinates request validation, backend execution, selection and result construction.
- Backend: the model/tokenizer adapter exposing ids-to-logits execution and a partial manifest.
- Manifest: a canonical, hashable record of selected artefact and implementation fields; not an attestation of source.
- Provenance: recorded context about an execution, useful only to the extent that relevant inputs and software are captured.
- Differential test: evaluating candidate and reference on matched inputs and comparing observable behaviour.
- Oracle: a slower, inspectable reference whose own correctness and coverage must also be assessed.
- Seed aliasing: distinct logical random draws being initialised from the same derived seed.
- Derived seed: a deterministic transformation of a base seed and step, which may reduce collisions without guaranteeing independence.
- Baseline: a measured implementation/workload pair with a documented environment and measurement boundary.
- Positions processed: total token positions presented to a backend across generation steps; not itself a latency measurement.
- Replay record: enough canonical request, artefact, policy and environment data to attempt to reproduce a prior execution.
Reader exercises
- Reintroduce
seed + stepand reproduce the 31-for-31 shifted-copy result. Then check what happens if two requests deliberately use the same base seed under the hash-derived scheme. Specify the request-identity policy needed for unique streams. - Add negative tests for
max_new_tokens=True,temperature=float("nan"), wrongstop_stringstypes andtop_klarger than the vocabulary. Decide which layer should reject each case and at what point. - Add canonical prompt text or prompt ids,
stop_stringsanduse_eosto the result’s replay metadata. Prove that modifying one of these fields changes the replay identifier while preserving separate implementation and artefact identities. - Run the samplers on exact ties, near-ties, repeated
stepvalues, non-finite scores and top-p thresholds at cumulative-mass boundaries. Which failures should be rejected versus compared within tolerance? - Configure two backends with different numerical dtypes. Compare logits as well as greedy ids on several prompts, and explicitly report the first divergence instead of assuming different logits mean a different artefact.
- Check EOS and a stop string that begins before an EOS event. Verify that
text,generated_ids,completion_tokensand any streaming callback have coherent termination semantics. - Time encoding, generation, provenance construction and JSON serialisation separately, then compare their sum with an end-to-end wall-clock timer around the whole call.
- Run the baseline at least ten times in randomised backend order, once on a quiet machine and once under load. Report raw timings, median, spread, processor thread count and warm-up policy.
- Implement a backend that supports several requests in one batch. Describe which parts of the current
next_logits(ids)contract andpositions_processedaccounting need revision before the results are comparable.
References
- Yu et al., Orca: A Distributed Serving System for Transformer-Based Generative Models (OSDI 2022) — shows why autoregressive requests need iteration-level scheduling and why scheduling is distinct from the per-token model computation. Version 0 implements neither scheduling nor selective batching.
- Kwon et al., Efficient Memory Management for Large Language Model Serving with PagedAttention (SOSP 2023) — explains why KV-cache memory management determines batch capacity and serving throughput, a capability deliberately absent here.
- Zheng et al., SGLang: Efficient Execution of Structured Language Model Programs (NeurIPS 2024) — motivates the separation between application-level generation programs and a runtime with reusable state and structured output mechanisms.
- deepseek-ai/DeepInfer, repository at pinned commit
774ce244— implementation context, not a peer-reviewed research paper. Its supported models and hardware must be established from the pinned version before claiming comparability.
These references motivate the architecture and later improvement programme; they do not validate this chapter’s seed experiment, sampler comparison or CPU timings, which come from the repository’s own recorded runs.
Evidence in this chapter
| Claim | Evidence classification |
|---|---|
| Separating model execution, request scheduling and memory management is useful in serving systems | Established background; Orca, PagedAttention and SGLang |
Additive seed + step produced 131 distinct seed integers among 3,200 pairs and 31/31 shifted choices |
Book result; arithmetic and controlled sampling |
Hashed (seed, step) produced 3,200 distinct 64-bit values in this tested set and 16/31 shifted matches |
Book result; finite observation, not independence proof |
ListSampler and TorchSampler chose the same token in 3,200 recorded comparisons |
Book result; matched logits, five policies, ten seeds, step 0 |
| Library and oracle generated the same 32 greedy ids on four prompts | Book result; agreement on sampled trajectories, not complete equivalence |
| Library and oracle have equal parameter digests but different manifest hashes | Book result; manifest fields are intentionally different |
| List selection was 32.5% and tensor selection 5.1% of step forward-plus-selection time under the filtered policy | Book result; one generation per table cell |
| Library median baseline 4.12 s for 32 uncached tokens | Book result; three noisy CPU runs, internal generation-time boundary |
| Engine timings cover the full request including tokenisation and provenance | Not implemented; the timer begins after encoding |
| Result contains every input needed for complete replay | Not implemented; request and environment fields are missing |
| Seed derivation guarantees independent random streams for different requests | Not established, and repeated base seeds reproduce the same stream |
| A particular backend is faster, a particular sampler improves output quality, or GPU/production behaviour transfers | Not established or not measured |
| Stop-string/EOS streaming semantics are correct for all chunkings and terminations | Not established; additional regression coverage required |