Unit 10 of 13 · about 5 hours · implement

Reference fallback, versioned configuration and the test and protection suite

Build on Protection, clean reproduction and claim-to-artifact links. Serving fallback must also handle live request state, shared KV and terminal races, not just select a different function.

You'll be able to

  • Implement a selectable reference fallback with versioned effective configuration and compatible state.
  • Protect the contribution with unit, differential, randomized-state, integration and performance-regression checks.
  • Diagnose the first correctness or lifecycle divergence under a seeded fault.

Covers

Reference fallback and versioned configurationUnit, property, integration and regression testsCorrectness, quality and failure protection
1

Read

In this order, only the parts listed

0 of 3 done

  1. The reference, fault and rollback contractLLM Inference Systems Laboratory - Full Capstone

    Milestone A: full-prefix/reference equivalence; Milestone C: fallback and compatibility; Milestone D: first-cause timeline and divergence bisection; Correctness requirements; Failure-injection requirements

    Choose fault cases touching your contribution plus request cancellation, exhaustion and rollback. Simulate rank/network faults on CPU; do not expand the patch into all capstone mechanisms.

  2. Configuration ingestion and fallback boundaryNano-vLLM and Mini-SGLang as Engine Reconstruction Bridges

    nanovllm/config.py: Config declaration and post-initialization validation; compare nanovllm/engine/llm_engine.py: constructor keyword filtering; nanovllm/engine/model_runner.py: run_model eager/graph branch

  3. In-flight output and cleanup protectionNano-vLLM and Mini-SGLang as Engine Reconstruction Bridges

    overlap_loop, _process_last_data, _process_one_msg and _free_req_resources; compare normal execution with the terminal guard and abort branch

2

Focus on

  • Keep the unmodified reference selectable and record the effective configuration, not just requested options. Reject unknown settings in your contribution wrapper rather than silently accepting a misspelling.
  • Numerical closeness, greedy token agreement, stochastic distribution agreement and application quality are different contracts. Choose the appropriate independent reference and tolerances before timing.
  • Unit tests check the decision; randomized histories check state conservation; integration tests prove real-path behavior; regression tests protect quality, tails, memory and failure recovery.
  • A fallback switch must drain, migrate or invalidate incompatible state before reuse. Test cancellation, late output, cache pressure and restart through the same boundary.
Common mistakes · 3
  • Calling the contribution itself the oracle. Reusing its accounting logic can reproduce the same ownership bug in both paths.
  • Assuming a seed guarantees token-identical stochastic output across batching or backends. Check the declared distribution or quality contract instead.
  • Switching code while retaining incompatible KV or graph state. A successful flag change is not a successful rollback.
3

Try it yourself

Closed-book, before checking anything

Without copying engine logic, write an independent state oracle and generate CPU histories spanning admit, advance, cancel, fail, release and fallback. Inject a missing release and a duplicate terminal event and require the suite to fail. For numerical paths, compare against a full-prefix reference on your GPU with a fitting model; retain the first divergent request/token or state transition. Exercise contribution off, on and rollback through ordinary requests with the same versioned contract.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.Is greedy token equality implied by close logits?Answer

    No. Near a tie, a small numerical difference can change the argmax. Record numerical tolerance and any token-agreement requirement separately.

  2. 2.Why test the tests with seeded defects?Answer

    A passing suite may not exercise the protection boundary. A known missing release or duplicate completion proves the relevant check can fail.

  3. 3.When may fallback reuse existing cache state?Answer

    Only when identity, layout, numerical and ownership contracts remain compatible and in-flight consumers are safe. Otherwise drain, migrate or invalidate it.

You're done when

Off, on and rollback preserve the declared contract, seeded defects fail the protection suite, and fault traces reconcile request and cache ownership.

Only when you can do this without notes.

Leads to

Notes

Resources · 2 for this unit, 12 more in the section
  • Nano-vLLM and Mini-SGLang as Engine Reconstruction BridgesGeeeekExplorer and SGLang Project · required

    Reconstruct Nano-vLLM first, then compare Mini-SGLang cache, scheduler, overlap and model-runner boundaries. Move to vLLM or SGLang only when you can predict where the same responsibility lives.

  • LLM Inference Systems Laboratory - Full CapstoneRoadmap-Final · required

    Complete the architecture map, contribution, fallbacks, correctness and fault suite, raw benchmark package, negative result, capacity and cost plan, independent reproduction and design defense. This artifact supplies the track milestone.

Also in this section