WRITE · TRACE · UNDERSTAND
Project: simulate bounded continuous batching with deadlines
Requests have unique string id and integer arrival>=0, deadline>arrival, prompt>=0, output>=1.
Read lesson: Project: simulate bounded continuous batching with deadlines →
Your experiment
Requests have unique string id and integer arrival>=0, deadline>arrival, prompt>=0, output>=1. Capacities are positive integers. Reserve prompt+full output tokens while active; oversized requests are rejected. At each integer tick cancel pending/active requests with deadline<=tick, admit FIFO by (arrival,id) up to slots and reserved capacity without skipping a waiting head, then generate one token for every active request. Completion time is tick+1, so finishing exactly at deadline is allowed. Jump to the next arrival when idle. Return completed time mapping, sorted cancelled/rejected IDs and per-tick events (tick,admitted,completed,cancelled,active after generation,reserved before generation). This is a deterministic scheduling simulation, not model inference or a throughput benchmark.
Python runs in your browser. Your draft stays on this device.
What to look for
Review reservations, FIFO blocking, deadline boundaries and cancellation. Real serving requires measured prefill/decode costs, paged memory, admission telemetry and model-specific benchmarks. Replay follows the main orchestration function; helper computations execute and are checked separately.
Watch your code work
Ready to experimentWrite a solution or load the worked answer, then choose Trace & check.
Step through arrays, variables and training curves produced by your own Python.
