most-queue 2.9__tar.gz → 2.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. most_queue-2.11/PKG-INFO +635 -0
  2. most_queue-2.11/README.md +581 -0
  3. most_queue-2.11/most_queue/io/serving.py +258 -0
  4. most_queue-2.11/most_queue/random/feature_service.py +175 -0
  5. most_queue-2.11/most_queue/random/marked_arrivals.py +127 -0
  6. most_queue-2.11/most_queue/random/queue_selection.py +47 -0
  7. most_queue-2.11/most_queue/random/service_calibration.py +91 -0
  8. most_queue-2.11/most_queue/random/trace_resampling.py +145 -0
  9. {most_queue-2.9 → most_queue-2.11}/most_queue/random/utils/fit.py +20 -7
  10. most_queue-2.11/most_queue/sim/accumulating_priority.py +118 -0
  11. most_queue-2.11/most_queue/sim/admission_control.py +90 -0
  12. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/base.py +1 -0
  13. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/base_core.py +33 -0
  14. most_queue-2.11/most_queue/sim/bulk_map_finite.py +191 -0
  15. most_queue-2.11/most_queue/sim/decaying_value.py +188 -0
  16. most_queue-2.11/most_queue/sim/delay_dependent.py +115 -0
  17. most_queue-2.11/most_queue/sim/dynamic_batching.py +236 -0
  18. most_queue-2.11/most_queue/sim/edf.py +162 -0
  19. most_queue-2.11/most_queue/sim/heterogeneous_bulk_service.py +237 -0
  20. most_queue-2.11/most_queue/sim/imprecise.py +258 -0
  21. most_queue-2.11/most_queue/sim/inventory.py +687 -0
  22. most_queue-2.11/most_queue/sim/kv_cache_congestion.py +226 -0
  23. most_queue-2.11/most_queue/sim/kv_cache_stability.py +219 -0
  24. most_queue-2.11/most_queue/sim/load_balancing.py +98 -0
  25. most_queue-2.11/most_queue/sim/msj_checkpoint.py +273 -0
  26. most_queue-2.11/most_queue/sim/msj_general.py +535 -0
  27. most_queue-2.11/most_queue/sim/msj_lifecycle.py +355 -0
  28. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/negative.py +13 -16
  29. most_queue-2.11/most_queue/sim/networks/closed_network.py +147 -0
  30. most_queue-2.11/most_queue/sim/networks/fork_join_network.py +167 -0
  31. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/networks/network.py +12 -2
  32. most_queue-2.11/most_queue/sim/networks/tandem_blocking.py +142 -0
  33. most_queue-2.11/most_queue/sim/networks/time_varying_network.py +124 -0
  34. most_queue-2.11/most_queue/sim/polling.py +87 -0
  35. most_queue-2.11/most_queue/sim/prefill_decode.py +234 -0
  36. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/priority.py +35 -0
  37. most_queue-2.11/most_queue/sim/priority_heterogeneous.py +89 -0
  38. most_queue-2.11/most_queue/sim/priority_impatience.py +105 -0
  39. most_queue-2.11/most_queue/sim/reliability.py +413 -0
  40. most_queue-2.11/most_queue/sim/retrial_priority.py +104 -0
  41. most_queue-2.11/most_queue/sim/smdp_batching.py +170 -0
  42. most_queue-2.11/most_queue/sim/time_varying.py +69 -0
  43. most_queue-2.11/most_queue/sim/token_batching.py +181 -0
  44. most_queue-2.11/most_queue/sim/utils/acme_trace.py +204 -0
  45. most_queue-2.11/most_queue/sim/utils/llm_trace.py +101 -0
  46. most_queue-2.11/most_queue/sim/utils/msj_calendar.py +66 -0
  47. most_queue-2.11/most_queue/sim/utils/msj_capacity_calendar.py +104 -0
  48. most_queue-2.11/most_queue/sim/utils/msj_packing.py +98 -0
  49. most_queue-2.11/most_queue/sim/utils/residual_runtime.py +145 -0
  50. most_queue-2.11/most_queue/sim/utils/resource_envelope.py +135 -0
  51. most_queue-2.11/most_queue/sim/utils/runtime_prediction.py +239 -0
  52. most_queue-2.11/most_queue/sim/utils/workload_lifecycle.py +101 -0
  53. most_queue-2.11/most_queue/sim/utils/workload_trace.py +172 -0
  54. most_queue-2.11/most_queue/sim/value_scheduling.py +439 -0
  55. most_queue-2.11/most_queue/structs.py +665 -0
  56. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/__init__.py +2 -0
  57. most_queue-2.11/most_queue/theory/admission_control/__init__.py +14 -0
  58. most_queue-2.11/most_queue/theory/admission_control/mm1_deadline_admission.py +204 -0
  59. most_queue-2.11/most_queue/theory/batch/__init__.py +9 -0
  60. most_queue-2.11/most_queue/theory/batch/_idle_refill.py +240 -0
  61. most_queue-2.11/most_queue/theory/batch/_tagged_batch.py +203 -0
  62. most_queue-2.11/most_queue/theory/batch/_tagged_boundary.py +76 -0
  63. most_queue-2.11/most_queue/theory/batch/bulk_service.py +381 -0
  64. most_queue-2.11/most_queue/theory/batch/bulk_service_erlang.py +401 -0
  65. most_queue-2.11/most_queue/theory/batch/bulk_service_general.py +79 -0
  66. most_queue-2.11/most_queue/theory/batch/bulk_service_h2.py +546 -0
  67. most_queue-2.11/most_queue/theory/batch/bulk_service_multiserver.py +697 -0
  68. most_queue-2.11/most_queue/theory/batch/callback_batching.py +125 -0
  69. most_queue-2.11/most_queue/theory/batch/dynamic_batching.py +396 -0
  70. most_queue-2.11/most_queue/theory/batch/heterogeneous_bulk_service.py +369 -0
  71. most_queue-2.11/most_queue/theory/batch/map_ph_finite_buffer.py +695 -0
  72. most_queue-2.11/most_queue/theory/batch/smdp_batching.py +252 -0
  73. most_queue-2.11/most_queue/theory/batch/token_batching.py +321 -0
  74. most_queue-2.11/most_queue/theory/batch/token_service.py +276 -0
  75. most_queue-2.11/most_queue/theory/continuous_batching/__init__.py +42 -0
  76. most_queue-2.11/most_queue/theory/continuous_batching/core_aware_ttft.py +218 -0
  77. most_queue-2.11/most_queue/theory/continuous_batching/infinite_stage_aware_ttft.py +255 -0
  78. most_queue-2.11/most_queue/theory/continuous_batching/kv_cache_congestion.py +241 -0
  79. most_queue-2.11/most_queue/theory/continuous_batching/kv_cache_stability.py +151 -0
  80. most_queue-2.11/most_queue/theory/continuous_batching/occupancy_dependent.py +183 -0
  81. most_queue-2.11/most_queue/theory/continuous_batching/occupancy_dependent_h2.py +272 -0
  82. most_queue-2.11/most_queue/theory/continuous_batching/phase_aware_stability.py +261 -0
  83. most_queue-2.11/most_queue/theory/continuous_batching/phase_aware_ttft.py +157 -0
  84. most_queue-2.11/most_queue/theory/continuous_batching/prefill_decode.py +211 -0
  85. most_queue-2.11/most_queue/theory/continuous_batching/reduced_stage_aware_ttft.py +182 -0
  86. most_queue-2.11/most_queue/theory/continuous_batching/serving_calibration.py +147 -0
  87. most_queue-2.11/most_queue/theory/continuous_batching/stage_aware_ttft.py +245 -0
  88. most_queue-2.11/most_queue/theory/continuous_batching/transient_occupancy.py +204 -0
  89. most_queue-2.11/most_queue/theory/decaying_value/__init__.py +22 -0
  90. most_queue-2.11/most_queue/theory/decaying_value/service_rate_control.py +419 -0
  91. most_queue-2.11/most_queue/theory/delay_dependent/__init__.py +13 -0
  92. most_queue-2.11/most_queue/theory/delay_dependent/mmc_threshold_service.py +494 -0
  93. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/__init__.py +2 -0
  94. most_queue-2.11/most_queue/theory/fifo/_ps_sojourn.py +244 -0
  95. most_queue-2.11/most_queue/theory/fifo/gi_m2_state_dependent.py +307 -0
  96. most_queue-2.11/most_queue/theory/fifo/mg1_ps.py +300 -0
  97. most_queue-2.11/most_queue/theory/fifo/mgn_ps.py +140 -0
  98. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/mgn_takahasi.py +1 -1
  99. most_queue-2.11/most_queue/theory/fifo/mm1_threshold_rate.py +299 -0
  100. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fork_join/__init__.py +2 -0
  101. most_queue-2.11/most_queue/theory/fork_join/dag.py +135 -0
  102. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fork_join/split_join.py +46 -9
  103. most_queue-2.11/most_queue/theory/imprecise/__init__.py +26 -0
  104. most_queue-2.11/most_queue/theory/imprecise/offline.py +345 -0
  105. most_queue-2.11/most_queue/theory/inventory/__init__.py +26 -0
  106. most_queue-2.11/most_queue/theory/inventory/_wait_phase.py +431 -0
  107. most_queue-2.11/most_queue/theory/inventory/mm1_inventory.py +285 -0
  108. most_queue-2.11/most_queue/theory/inventory/mm1_inventory_erlang_replenishment.py +272 -0
  109. most_queue-2.11/most_queue/theory/inventory/mm2_heterogeneous_inventory.py +294 -0
  110. most_queue-2.11/most_queue/theory/inventory/mmc_heterogeneous_erlang_inventory.py +399 -0
  111. most_queue-2.11/most_queue/theory/inventory/mmc_heterogeneous_h2_inventory.py +394 -0
  112. most_queue-2.11/most_queue/theory/inventory/mmc_heterogeneous_inventory.py +348 -0
  113. most_queue-2.11/most_queue/theory/inventory/mmc_inventory.py +351 -0
  114. most_queue-2.11/most_queue/theory/load_balancing.py +99 -0
  115. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/msj/__init__.py +2 -1
  116. most_queue-2.11/most_queue/theory/msj/ph.py +285 -0
  117. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/negative/mgn_disaster.py +37 -58
  118. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/negative/mgn_rcs.py +36 -202
  119. most_queue-2.11/most_queue/theory/networks/__init__.py +34 -0
  120. most_queue-2.11/most_queue/theory/networks/bcmp_network.py +283 -0
  121. most_queue-2.11/most_queue/theory/networks/blocking.py +153 -0
  122. most_queue-2.11/most_queue/theory/networks/closed_network.py +270 -0
  123. most_queue-2.11/most_queue/theory/networks/fork_join_network.py +115 -0
  124. most_queue-2.11/most_queue/theory/networks/g_network.py +259 -0
  125. most_queue-2.11/most_queue/theory/networks/jackson_network.py +116 -0
  126. most_queue-2.11/most_queue/theory/networks/qna.py +185 -0
  127. most_queue-2.11/most_queue/theory/networks/time_varying_network.py +94 -0
  128. most_queue-2.11/most_queue/theory/networks/traffic.py +23 -0
  129. most_queue-2.11/most_queue/theory/polling.py +114 -0
  130. most_queue-2.11/most_queue/theory/priority/__init__.py +40 -0
  131. most_queue-2.11/most_queue/theory/priority/accumulating.py +108 -0
  132. most_queue-2.11/most_queue/theory/priority/impatience.py +140 -0
  133. most_queue-2.11/most_queue/theory/priority/map_ph_priority.py +235 -0
  134. most_queue-2.11/most_queue/theory/priority/preemptive/mg1_repeat.py +155 -0
  135. most_queue-2.11/most_queue/theory/priority/preemptive/mm2_heterogeneous.py +240 -0
  136. most_queue-2.11/most_queue/theory/priority/retrial_priority.py +132 -0
  137. most_queue-2.11/most_queue/theory/reliability/__init__.py +21 -0
  138. most_queue-2.11/most_queue/theory/reliability/machine_repair.py +104 -0
  139. most_queue-2.11/most_queue/theory/reliability/machine_repair_heterogeneous.py +150 -0
  140. most_queue-2.11/most_queue/theory/reliability/mm1_disaster_repair.py +102 -0
  141. most_queue-2.11/most_queue/theory/reliability/mm1_working_breakdowns.py +108 -0
  142. most_queue-2.11/most_queue/theory/reliability/mmc_breakdowns.py +119 -0
  143. most_queue-2.11/most_queue/theory/reliability/retrial_unreliable.py +110 -0
  144. most_queue-2.11/most_queue/theory/reliability/utils.py +47 -0
  145. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/srpt/utils/load_below.py +13 -34
  146. most_queue-2.11/most_queue/theory/time_varying.py +123 -0
  147. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/__init__.py +12 -0
  148. most_queue-2.11/most_queue/theory/utils/max_dist.py +432 -0
  149. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/restarts.py +90 -14
  150. most_queue-2.11/most_queue/theory/utils/sla.py +146 -0
  151. most_queue-2.11/most_queue/theory/utils/tail.py +46 -0
  152. most_queue-2.11/most_queue/theory/value_scheduling/__init__.py +25 -0
  153. most_queue-2.11/most_queue/theory/value_scheduling/offline.py +336 -0
  154. {most_queue-2.9 → most_queue-2.11}/pyproject.toml +18 -2
  155. most_queue-2.11/tests/fixtures/serving_measurements/flash_next/LICENSE +21 -0
  156. most_queue-2.11/tests/fixtures/serving_measurements/flash_next/README.md +13 -0
  157. most_queue-2.9/.gitignore +0 -203
  158. most_queue-2.9/PKG-INFO +0 -200
  159. most_queue-2.9/README.md +0 -159
  160. most_queue-2.9/docs/README.md +0 -120
  161. most_queue-2.9/docs/epics/README.md +0 -59
  162. most_queue-2.9/most_queue/structs.py +0 -210
  163. most_queue-2.9/most_queue/theory/batch/__init__.py +0 -7
  164. most_queue-2.9/most_queue/theory/batch/bulk_service.py +0 -138
  165. most_queue-2.9/most_queue/theory/fifo/mg1_ps.py +0 -119
  166. most_queue-2.9/most_queue/theory/networks/__init__.py +0 -13
  167. most_queue-2.9/most_queue/theory/priority/__init__.py +0 -19
  168. most_queue-2.9/most_queue/theory/utils/max_dist.py +0 -196
  169. {most_queue-2.9 → most_queue-2.11}/LICENSE +0 -0
  170. {most_queue-2.9 → most_queue-2.11}/most_queue/__init__.py +0 -0
  171. {most_queue-2.9 → most_queue-2.11}/most_queue/constants.py +0 -0
  172. {most_queue-2.9 → most_queue-2.11}/most_queue/io/__init__.py +0 -0
  173. {most_queue-2.9 → most_queue-2.11}/most_queue/io/plots.py +0 -0
  174. {most_queue-2.9 → most_queue-2.11}/most_queue/io/tables.py +0 -0
  175. {most_queue-2.9 → most_queue-2.11}/most_queue/misc/approx_cdf_make.py +0 -0
  176. {most_queue-2.9 → most_queue-2.11}/most_queue/misc/calc_v_pls.py +0 -0
  177. {most_queue-2.9 → most_queue-2.11}/most_queue/misc/compare_fj_calc.py +0 -0
  178. {most_queue-2.9 → most_queue-2.11}/most_queue/misc/flow_sum.py +0 -0
  179. {most_queue-2.9 → most_queue-2.11}/most_queue/misc/run_mgn_with_h2_delay_cold_warm.py +0 -0
  180. {most_queue-2.9 → most_queue-2.11}/most_queue/misc/tests/test_fj_delta.py +0 -0
  181. {most_queue-2.9 → most_queue-2.11}/most_queue/misc/tests/test_network_opt_approx.py +0 -0
  182. {most_queue-2.9 → most_queue-2.11}/most_queue/misc/tests/test_network_opt_plus.py +0 -0
  183. {most_queue-2.9 → most_queue-2.11}/most_queue/misc/vacations_paper_utils.py +0 -0
  184. {most_queue-2.9 → most_queue-2.11}/most_queue/random/__init__.py +0 -0
  185. {most_queue-2.9 → most_queue-2.11}/most_queue/random/distributions.py +0 -0
  186. {most_queue-2.9 → most_queue-2.11}/most_queue/random/distributions.yaml +0 -0
  187. {most_queue-2.9 → most_queue-2.11}/most_queue/random/map_fit.py +0 -0
  188. {most_queue-2.9 → most_queue-2.11}/most_queue/random/map_ph.py +0 -0
  189. {most_queue-2.9 → most_queue-2.11}/most_queue/random/utils/base.py +0 -0
  190. {most_queue-2.9 → most_queue-2.11}/most_queue/random/utils/create.py +0 -0
  191. {most_queue-2.9 → most_queue-2.11}/most_queue/random/utils/load.py +0 -0
  192. {most_queue-2.9 → most_queue-2.11}/most_queue/random/utils/params.py +0 -0
  193. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/__init__.py +0 -0
  194. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/aoi.py +0 -0
  195. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/batch.py +0 -0
  196. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/bmap.py +0 -0
  197. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/bulk_service.py +0 -0
  198. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/finite_source.py +0 -0
  199. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/flow_sum.py +0 -0
  200. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/fork_join.py +0 -0
  201. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/fork_join_delta.py +0 -0
  202. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/impatient.py +0 -0
  203. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/msj.py +0 -0
  204. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/networks/__init__.py +0 -0
  205. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/networks/base_network_sim.py +0 -0
  206. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/networks/negative_network.py +0 -0
  207. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/networks/priority_network.py +0 -0
  208. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/retrial.py +0 -0
  209. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/single_server_disciplines.py +0 -0
  210. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/size_based.py +0 -0
  211. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/unreliable.py +0 -0
  212. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/utils/__init__.py +0 -0
  213. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/utils/events.py +0 -0
  214. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/utils/phase.py +0 -0
  215. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/utils/predictor.py +0 -0
  216. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/utils/qs_queue.py +0 -0
  217. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/utils/queue_priority_size.py +0 -0
  218. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/utils/servers.py +0 -0
  219. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/utils/stats_update.py +0 -0
  220. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/utils/tasks.py +0 -0
  221. {most_queue-2.9 → most_queue-2.11}/most_queue/sim/vacations.py +0 -0
  222. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/aoi/__init__.py +0 -0
  223. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/aoi/calc.py +0 -0
  224. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/base_queue.py +0 -0
  225. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/batch/mm1.py +0 -0
  226. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/calc_params.py +0 -0
  227. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/closed/__init__.py +0 -0
  228. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/closed/engset.py +0 -0
  229. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/ek_d_n.py +0 -0
  230. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/erlang.py +0 -0
  231. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/gi_g_approx.py +0 -0
  232. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/gi_m_1.py +0 -0
  233. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/gi_m_n.py +0 -0
  234. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/gmc_takahasi.py +0 -0
  235. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/hkhk_takahasi.py +0 -0
  236. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/m_d_n.py +0 -0
  237. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/m_g_inf.py +0 -0
  238. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/mg1.py +0 -0
  239. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/mg1_lcfs_pr.py +0 -0
  240. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/mmnr.py +0 -0
  241. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fifo/takahasi_base.py +0 -0
  242. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/fork_join/m_m_n.py +0 -0
  243. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/impatience/__init__.py +0 -0
  244. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/impatience/mm1.py +0 -0
  245. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/impatience/mmn.py +0 -0
  246. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/matrix/__init__.py +0 -0
  247. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/matrix/bmap_m1.py +0 -0
  248. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/matrix/bmap_ph1.py +0 -0
  249. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/matrix/map_mmc.py +0 -0
  250. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/matrix/map_ph1.py +0 -0
  251. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/matrix/map_phc.py +0 -0
  252. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/matrix/qbd.py +0 -0
  253. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/msj/exact.py +0 -0
  254. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/msj/saturated.py +0 -0
  255. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/negative/__init__.py +0 -0
  256. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/negative/mg1_disasters.py +0 -0
  257. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/negative/mg1_rcs.py +0 -0
  258. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/negative/structs.py +0 -0
  259. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/networks/base_network_calc.py +0 -0
  260. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/networks/negative_network.py +0 -0
  261. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/networks/network_viewer.py +0 -0
  262. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/networks/open_network.py +0 -0
  263. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/networks/open_network_prty.py +0 -0
  264. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/networks/opt/__init__.py +0 -0
  265. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/networks/opt/transition.py +0 -0
  266. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/networks/opt/transition_approx.py +0 -0
  267. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/networks/opt/transition_plus.py +0 -0
  268. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/priority/mgn_invar_approx.py +0 -0
  269. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/priority/non_preemptive/__init__.py +0 -0
  270. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/priority/non_preemptive/mg1.py +0 -0
  271. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/priority/preemptive/__init__.py +0 -0
  272. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/priority/preemptive/m_ph_n_busy_approx.py +0 -0
  273. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/priority/preemptive/mg1.py +0 -0
  274. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/priority/preemptive/mm2_3cls_busy_approx.py +0 -0
  275. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/priority/preemptive/mmk_prty_exact.py +0 -0
  276. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/priority/preemptive/mmn_2cls_pr_busy_approx.py +0 -0
  277. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/priority/preemptive/mph_ph_k_2class.py +0 -0
  278. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/priority/preemptive/rdr_a.py +0 -0
  279. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/r_example.gexf +0 -0
  280. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/retrial/__init__.py +0 -0
  281. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/retrial/mg1.py +0 -0
  282. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/retrial/mm1.py +0 -0
  283. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/srpt/__init__.py +0 -0
  284. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/srpt/_base.py +0 -0
  285. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/srpt/degradation.py +0 -0
  286. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/srpt/mg1_fb.py +0 -0
  287. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/srpt/mg1_psjf.py +0 -0
  288. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/srpt/mg1_sjf.py +0 -0
  289. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/srpt/mg1_spjf.py +0 -0
  290. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/srpt/mg1_srpt.py +0 -0
  291. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/srpt/utils/__init__.py +0 -0
  292. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/srpt/utils/predictor.py +0 -0
  293. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/binom_probs.py +0 -0
  294. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/busy_periods.py +0 -0
  295. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/conditional.py +0 -0
  296. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/conv.py +0 -0
  297. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/derivative.py +0 -0
  298. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/diff5dots.py +0 -0
  299. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/flow_sum.py +0 -0
  300. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/moments.py +0 -0
  301. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/passage_time.py +0 -0
  302. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/q_poisson_arrival_calc.py +0 -0
  303. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/residual.py +0 -0
  304. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/student_stat.py +0 -0
  305. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/timing.py +0 -0
  306. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/transforms.py +0 -0
  307. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/utilization_approx.py +0 -0
  308. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/utils/validation.py +0 -0
  309. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/vacations/__init__.py +0 -0
  310. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/vacations/m_h2_h2warm.py +0 -0
  311. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/vacations/mg1_unreliable.py +0 -0
  312. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/vacations/mg1_vacations.py +0 -0
  313. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/vacations/mg1_warm_calc.py +0 -0
  314. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/vacations/mgn_with_h2_delay_cold_warm.py +0 -0
  315. {most_queue-2.9 → most_queue-2.11}/most_queue/theory/vacations/mmn_with_h2_cold_and_h2_warmup.py +0 -0
@@ -0,0 +1,635 @@
1
+ Metadata-Version: 2.5
2
+ Name: most_queue
3
+ Version: 2.11
4
+ Summary: Software package for calculation and simulation of queuing systems
5
+ Project-URL: Homepage, https://github.com/xabarov/most-queue
6
+ Project-URL: Documentation, https://github.com/xabarov/most-queue/blob/main/docs/README.md
7
+ Project-URL: Issues, https://github.com/xabarov/most-queue/issues
8
+ Project-URL: Changelog, https://github.com/xabarov/most-queue/blob/main/docs/releases/2.11.md
9
+ Author-email: Xabarov Roman <xabarov1985@gmail.com>
10
+ License: Copyright (c) 2018 The Python Packaging Authority
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Classifier: License :: OSI Approved :: MIT License
31
+ Classifier: Operating System :: OS Independent
32
+ Classifier: Programming Language :: Python :: 3
33
+ Classifier: Programming Language :: Python :: 3.10
34
+ Classifier: Programming Language :: Python :: 3.11
35
+ Classifier: Programming Language :: Python :: 3.12
36
+ Requires-Python: >=3.10
37
+ Requires-Dist: colorama
38
+ Requires-Dist: graphviz
39
+ Requires-Dist: matplotlib
40
+ Requires-Dist: networkx
41
+ Requires-Dist: numpy
42
+ Requires-Dist: pandas
43
+ Requires-Dist: pyyaml
44
+ Requires-Dist: scipy<2.0,>=1.13.0
45
+ Requires-Dist: tqdm
46
+ Provides-Extra: dev
47
+ Requires-Dist: black; extra == 'dev'
48
+ Requires-Dist: isort; extra == 'dev'
49
+ Requires-Dist: pylint; extra == 'dev'
50
+ Requires-Dist: pytest; extra == 'dev'
51
+ Requires-Dist: pytest-rerunfailures; extra == 'dev'
52
+ Requires-Dist: pytest-xdist; extra == 'dev'
53
+ Description-Content-Type: text/markdown
54
+
55
+ <div align="center">
56
+
57
+ # Most-Queue
58
+
59
+ **Queueing theory in Python: analytical and numerical methods, approximations, and discrete-event simulation — from M/M/1 to LLM serving, GPU job scheduling, and queueing networks.**
60
+
61
+ [🇷🇺 Русская версия](README.ru.md)
62
+
63
+ [![Tests](https://github.com/xabarov/most-queue/actions/workflows/tests.yml/badge.svg)](https://github.com/xabarov/most-queue/actions/workflows/tests.yml)
64
+ [![PyPI version](https://img.shields.io/pypi/v/most-queue)](https://pypi.org/project/most-queue/)
65
+ [![Python versions](https://img.shields.io/pypi/pyversions/most-queue)](https://pypi.org/project/most-queue/)
66
+ [![License](https://img.shields.io/pypi/l/most-queue)](https://github.com/xabarov/most-queue/blob/main/LICENSE)
67
+ [![Downloads](https://static.pepy.tech/badge/most-queue)](https://pepy.tech/project/most-queue)
68
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.21268402.svg)](https://doi.org/10.5281/zenodo.21268402)
69
+ [![GitHub commit activity](https://img.shields.io/github/commit-activity/m/xabarov/most-queue)](https://github.com/xabarov/most-queue/commits/main)
70
+
71
+ <img src="https://raw.githubusercontent.com/xabarov/most-queue/main/assets/most-queue-nano1.jpeg" alt="Most-Queue banner" width="720"/>
72
+
73
+ </div>
74
+
75
+ ## LLM serving: how long does a burst affect latency?
76
+
77
+ A traffic spike ends at 5 seconds. In this **synthetic** serving pool, the risk of
78
+ waiting over 0.5 seconds for an active slot stays above 5% until about 10.25 seconds
79
+ with four slots, or 6.35 seconds with eight. A stationary estimate at the new
80
+ arrival rate misses this recovery period.
81
+
82
+ <img src="https://raw.githubusercontent.com/xabarov/most-queue/main/docs/figures/llm_burst_recovery.png" alt="Transient queue-delay risk stays elevated after a traffic burst" width="720"/>
83
+
84
+ **[Run the example and inspect the model](docs/models/transient-occupancy.md)** —
85
+ no GPU required; produces a plot and JSON with explicit truncation bounds.
86
+ The metric is queue-to-slot delay; predicting GPU TTFT requires a model of
87
+ prefill/decode and measured service costs.
88
+
89
+ Also available: [token-level prefill/decode simulation](docs/models/prefill-decode.md),
90
+ [stage-aware mean TTFT](docs/models/stage-aware-ttft.md), and
91
+ [GPU job scheduling](docs/models/msj.md).
92
+
93
+ Have serving benchmark results? [Evaluate joint TTFT/TPOT SLOs and test a latency
94
+ model](docs/serving_measurements.md) with detailed vLLM/SGLang imports, public GPU
95
+ measurements and a held-out calibration report. The report retains failed model
96
+ validation as well as successful checks.
97
+
98
+ Bulk-service correction (2026-10-12): all-customer abandonment now includes
99
+ departures behind the tagged customer; the new `get_tagged_wait()` exposes local
100
+ truncation bounds and all-arrival SLA outcomes. H2 size-dependent waiting means
101
+ and earlier Inoue/cap comparisons are corrected. Stationary truncation remains
102
+ diagnostic, not certified. [Report and reproducible experiments](docs/research/bulk-sla-revision-2026.md).
103
+
104
+ [Article materials and setup on another computer](docs/статьи/README.md):
105
+ LaTeX sources, editable Word documents, PDFs, saved data and build instructions.
106
+
107
+ ## Why Most-Queue?
108
+
109
+ - **Analytical methods and simulation together.** Tests use known special cases and
110
+ discrete-event simulation to check calculations. Model pages explain assumptions,
111
+ approximations, and numerical limitations.
112
+ - **A broad model catalog**: size-based scheduling analytics
113
+ (SRPT, SJF, PSJF, SPJF with ML-style size predictions, FB/LAS), M/G/1 vacation models,
114
+ negative customers (RCS / disasters), unreliable servers, multi-server phase-type systems
115
+ solved by the Takahashi–Takami method (including CV < 1 via complex-fit H₂).
116
+ - **Moments, not just means**: waiting/sojourn time raw moments, state probabilities,
117
+ utilization — with a uniform `set_sources() / set_servers() / run()` API across all models.
118
+ - **Pure Python + NumPy/SciPy**, pip-installable, MIT license.
119
+
120
+ ## Installation
121
+
122
+ ```bash
123
+ pip install most-queue
124
+ ```
125
+
126
+ Requires Python ≥ 3.10. For network visualization you may also need the system `graphviz` package.
127
+
128
+ Examples and their data live in the source repository. For the serving examples,
129
+ use a checkout of version 2.11 or later:
130
+
131
+ ```bash
132
+ git clone https://github.com/xabarov/most-queue.git
133
+ cd most-queue
134
+ python -m pip install -e .
135
+ python -m examples.llm_burst_recovery
136
+ python -m examples.serving_measurements
137
+ ```
138
+
139
+ The command prints the output directory. See [Contributing](CONTRIBUTING.md) for
140
+ development dependencies and tests.
141
+
142
+ ## Quick start: theory vs simulation in 20 lines
143
+
144
+ ```python
145
+ from most_queue.theory.fifo.mmnr import MMnrCalc
146
+ from most_queue.sim.base import QsSim
147
+
148
+ # Analytical M/M/3 with a finite queue
149
+ calc = MMnrCalc(n=3, r=100)
150
+ calc.set_sources(l=2.0)
151
+ calc.set_servers(mu=1.0)
152
+ theory = calc.run()
153
+
154
+ # The same system, simulated
155
+ sim = QsSim(3)
156
+ sim.set_sources(2.0, "M")
157
+ sim.set_servers(1.0, "M")
158
+ experiment = sim.run(100_000)
159
+
160
+ print(f"Mean waiting time: theory {theory.w[0]:.3f} vs simulation {experiment.w[0]:.3f}")
161
+ # Mean waiting time: theory 0.444 vs simulation 0.448
162
+ ```
163
+
164
+ ## Showcase: who pays for the scheduling discipline?
165
+
166
+ Computed by the library's own calculators — conditional slowdown `E[T(x)]/x` by job size
167
+ for FCFS, PS, FB (blind) and SRPT (size-aware):
168
+
169
+ <img src="https://raw.githubusercontent.com/xabarov/most-queue/main/docs/figures/slowdown.png" alt="Slowdown by job size for FCFS/PS/FB/SRPT" width="720"/>
170
+
171
+ See the executable comparison of **9 disciplines** in
172
+ [`tutorials/disciplines_comparison.ipynb`](tutorials/disciplines_comparison.ipynb).
173
+
174
+ ## What's inside
175
+
176
+ | Family | Models | Method |
177
+ |---|---|---|
178
+ | Classic FIFO | M/M/c, M/M/c/r, Erlang B/C, M/G/1, GI/M/c, M/D/c, Eₖ/D/c, M/G/∞ | exact |
179
+ | Multi-server phase-type | M/H₂/c, H₂/M/c, H₂/H₂/c (CV < 1 via complex fit) | Takahashi–Takami |
180
+ | Size-based scheduling | M/G/1 SRPT, SJF, PSJF, SPJF (with size predictors + graceful-degradation curves), FB/LAS, PS, LCFS-PR | exact (Schrage–Miller, Mitzenmacher) |
181
+ | Priorities | M/G/1 PR/NP multi-class, M/G/c PR/NP, M/Ph/c PR; **RDR** M/M/k & M/PH/k multi-class (exact + RDR-A), per-class response variance; M/M/2 with **heterogeneous servers** (exact non-birth-death CTMC); **accumulating priority** (Kleinrock/APQ), priority Erlang-A (impatience), MMAP/PH/1 priorities (NP/PR/RS), retrial with a priority class, preemptive repeat | exact / RDR / CTMC / invariant approximation |
182
+ | [Multiserver-job (MSJ)](docs/models/msj.md) | FCFS with phase-type service; general-service FCFS/EASY/conservative, FirstFit, MSF and Quickswap; power-of-two ServerFilling, checkpoint/resume costs and optional useful-service protection | FCFS CTMC / saturated analysis; trace-driven simulation for scheduling policies |
183
+ | Load balancing (mean-field) | dispatching over a large pool — power-of-d / JSQ / JIQ / random | mean-field fixed point |
184
+ | Polling systems | one server touring Q queues with switchover — exhaustive / gated | pseudo-conservation law (Boxma–Groenevelt) |
185
+ | Non-stationary Mt/M/c | time-varying arrival rate λ(t) — blocking & waiting probability | PSA & MOL approximations |
186
+ | [Transient shared serving pool](docs/models/transient-occupancy.md) | piecewise Poisson bursts, occupancy-dependent completion, queue-delay tails | finite state projection with truncation bounds |
187
+ | Age of Information | M/M/1, M/G/1, preemptive-LCFS — average & peak AoI | closed-form + simulation |
188
+ | SLA / deadline-violation probability | `P(W > D)` and SLO quantile from raw moments — works on top of any model in this table; LLM-serving TTFT SLO example | H2/Gamma tail fit, M/M/1 exact anchor |
189
+ | Vacations & warm-up | M/G/1 multiple vacations, N-policy, warm-up/cooling/delay (M/Ph/c) | Fuhrmann–Cooper, Takahashi–Takami |
190
+ | Negative customers | M/G/1 and M/G/c with RCS or disasters | exact / Takahashi–Takami |
191
+ | Reliability | M/G/1 and M/M/c with breakdowns & repairs, machine repair problem (spares, R repairmen, 2 heterogeneous repairmen), working breakdowns, disasters with a repair phase, retrial with an unreliable server | Avi-Itzhak–Naor / exact CTMC / birth-death |
192
+ | Matrix-analytic (MAP/PH) | MAP/PH/1, M/PH/1, PH/PH/1, MAP/M/c, MAP/PH/c — correlated (bursty) arrivals, single- & multi-server; MMPP fitting | QBD, logarithmic reduction |
193
+ | [Unbounded dynamic batching](docs/models/dynamic-batching.md) | All-waiting dispatch; deterministic/exponential/Erlang/gamma/H2 batch durations, affine mean; independent simulator | numerical means with truncation diagnostics |
194
+ | [Variable-token batching](docs/models/token-batching.md) | Output length/max-token clipping; dynamic, fixed and gated elastic service with non-exponential durations; general service callbacks | numerical means; M/G/1 clipping means exact |
195
+ | [Mixed prefill/decode](docs/models/prefill-decode.md) | Three iteration costs, occupancy-dependent effective chunking, continuous boundary admission, independent token-level DES | exact surrogate occupancy; approximate mean TTFT/ITL |
196
+ | [SMDP batching control](docs/models/smdp-batching.md) | Wait-next-arrival / launch-size actions; deterministic time/energy; independent unbounded DES | finite overflow optimum, not infinite-queue optimality |
197
+ | [Heterogeneous bulk service](docs/models/heterogeneous-bulk-service.md) | Type-specific rates, thresholds and capacities; shared FCFS; exact PH W/V | exponential, batch-size-independent service only |
198
+ | [KV-cache congestion](docs/models/kv-cache-congestion.md) | Deterministic stage dynamics, LPF eviction/restart, finite spectrum and admission cap; independent integer FCFS | fluid linear stability is not open-queue recurrence |
199
+ | [KV-cache stability](docs/models/kv-cache-stability.md) | Joint prompt/output lengths, growing KV footprints, constant slots; independent maximal/free-swap simulation | necessary upper and conditional sufficient lower bounds, not an exact threshold |
200
+ | Batch Markovian arrivals | BMAP/M/1, BMAP/PH/1 — correlated batch traffic | level truncation |
201
+ | Retrial & abandonment | M/M/1 and M/G/1 retrial (orbit), Erlang-A (M/M/n+M) with staffing | exact / Falin–Templeton |
202
+ | GI/G approximations | GI/G/1, GI/G/m mean waiting time | Kingman, Krämer–Langenbach-Belz, Allen–Cunneen |
203
+ | Batch arrivals & bulk service | Mˣ/M/1 batch arrivals; M/M^[a,b]/1 bulk (batch) service — LLM inference batching, exact N/W moments and tail for any a≤b; general (Erlang- or H2-fitted, CV≤1 or CV≥1) batch-service time with auto-dispatch by CV and batch-size-dependent parameters; Markovian abandonment (MM1/Erlang/H2); `c` independent servers sharing one queue, incl. batch-size-dependent service | exact |
204
+ | Impatience & closed | M/M/1+M, Engset | exact |
205
+ | Delay-dependent service rates | M/M/c whose service rate switches at a threshold on the customer's own experienced delay (slowdown/speedup) — exact waiting-time distribution, density and mean | exact (mixture of matrix exponentials) |
206
+ | Busy-server-dependent service rate | GI/M/2 where a lone busy server works at a different rate than when both are busy (helped by the idle one, or slowed down) — exact state, arrival-observed and waiting-time distributions | exact (Bhat 1966) |
207
+ | Threshold-controlled service rate | M/M/1 whose rate switches at a threshold on the number in system — exact sojourn and waiting moments, not elementary because arrivals behind a customer change its own service rate | exact (Morrison 1989) |
208
+ | Imprecise computation | Mandatory + optional parts under deadlines: answer quality becomes the control variable, not timeliness or admission — exact offline optimum plus online policies scored against it | exact (LP / min-cost flow) |
209
+ | Value-based scheduling under overload | Which jobs are worth running when deadlines cannot all be met: 4 priority rules x 3 guarantee mechanisms (12 algorithms), Hit Value Ratio; exact clairvoyant optimum turns it into a true competitive ratio | DES + exact offline optimum (Horn's condition + MILP) |
210
+ | Service rate control with decaying value | Job value decays *during service*; the controller picks how fast to run, trading the cost of speed against the reward still collectable — exact optimal policy, plus monotonicity conditions checkable without computing it | exact DP (Master & Bambos 2015) |
211
+ | Bulk service, correlated input, finite buffer | MAP/PH^(a,b)/1/N: bursty non-renewal arrivals and real blocking; exact waiting- and sojourn-time distributions from a tagged-customer phase-type chain, with no transform to invert | exact (matrix-analytic) |
212
+ | Queueing-inventory | M/M/1, M/M/c, or c heterogeneous servers (identical, exponential, or per-server Erlang-/H2-fitted service) with stock-consuming service, general (s,S) replenishment (exponential or Erlang-fitted lead time), backordering or lost sales | exact QBD |
213
+ | EDF scheduling | Earliest-Deadline-First as the actual service discipline (not post-hoc SLA) | DES-exact, no closed form (open problem) |
214
+ | Deadline-aware admission control | Accept/reject at arrival based on own-deadline feasibility (not reordering), Exp(θ) deadline — LLM-serving SLO | exact convergent series (level-crossing functional equation) |
215
+ | Parallel service | Fork-Join, Split-Join; exact heavy-tailed (Pareto) max-of-n; heterogeneous branches, series-parallel task DAGs, (n,k)-join over heterogeneous/DAG branches | Markovian / order statistics / exact (Beta function) |
216
+ | Networks | open (decomposition, exact Jackson, QNA two-moment flows, MAP input), closed (exact MVA / Buzen / Schweitzer), multi-class BCMP, G-networks (Gelenbe, multi-class), tandems with blocking (finite buffers), fork-join stations, time-varying λ(t), priorities, negative customers, routing optimization | decomposition / product form / MVA |
217
+
218
+ Every model comes with a plain-language explanation and a diagram in the
219
+ [illustrated model catalog](docs/models.md).
220
+
221
+ ## Documentation & tutorials
222
+
223
+ - 📖 [Documentation](docs/README.md) — concepts, calculation and simulation guides (English; Russian versions available via in-page switchers)
224
+ - 🎓 [Jupyter tutorials](tutorials/README.md) — counter-intuitive queueing insights for engineers (the utilization trap, why variability dominates delay, multiserver jobs, Age of Information, …)
225
+ - 🗺 [Development roadmaps](docs/epics/README.md) & [trends surveys](docs/research/) — literature-driven gap analysis behind each epic, and what's next
226
+ - 🧪 [Tests](tests/) — every model validated against simulation; run with `pytest -m "not slow"`
227
+
228
+ ## Applications
229
+
230
+ Capacity planning for cloud services and data centers · call-center staffing ·
231
+ manufacturing lines · telecom traffic · healthcare resource planning ·
232
+ scheduling research (SRPT/LAS with ML size predictions).
233
+
234
+ ## Recent highlights
235
+
236
+ - **2026-10 — Finite-core infinite TTFT continuation (EPIC-097)**:
237
+ `CoreAwareTtftCalc` retains exterior excursions and tightens mean intervals.
238
+ Original48 cases pass; near-critical28/32 versus24/32 previously. The frozen
239
+ twofold total-state target fails (1/32); low-load auxiliary overhead is reported.
240
+ Floating means, no verified rounding or GPU/SLO claim.
241
+ [Derivation, ablations and fresh DES](docs/research/core-aware-continuation-validation-2026.md).
242
+
243
+ - **2026-10 — Phase-aware stability (EPIC-096)**: `PhaseAwareStabilityCalc`
244
+ checks every reachable saturated class with exact rational row drift;
245
+ `PhaseAwareTtftCalc` adds floating infinite mean bounds. 48/48 original cases
246
+ bounded, recovering all 3 prior refusals; critical cases remain unresolved.
247
+ [Proof, frozen grids and independent DES](docs/research/phase-aware-stability-validation-2026.md).
248
+
249
+ - **2026-10, current source tree — Infinite stage-aware TTFT (EPIC-095)**:
250
+ killed regenerative count kernel with analytic mean/truncation and waiting-tail
251
+ bounds, evaluated in floating point (not verified rounding).45/48 frozen cases
252
+ solved;3 sufficient-stability refusals retained. No GPU/SLO claim.
253
+ [Derivation and results](docs/research/infinite-stage-aware-ttft-validation-2026.md).
254
+
255
+ - **2026-10, current source tree — Exact iid TTFT state reduction (EPIC-094)**:
256
+ waiting-count integration and decoder symmetry preserve finite-loss means;
257
+ all48 previous cases agree, larger-law full-model budget refusals are reported.
258
+ Mixed-law cases use13x fewer states and run18–27x faster than the full solver.
259
+ This does not remove finite/infinite bias or support correlated marks.
260
+ [Method and evidence](docs/research/stage-aware-ttft-reduction-validation-2026.md).
261
+
262
+ - **2026-10, current source tree** — **Joint-mark replay and stage-aware TTFT (EPIC-092/093)**:
263
+ audited BurstGPT API cohorts with exact pair-permutation controls (no confirmed
264
+ rank reversal on the frozen pair); stage-resolved small-law semi-Markov mean
265
+ TTFT, exact B=1 PK and explicit finite-loss B>1 limits. Includes independent
266
+ token oracles and a 48-point grid; not a GPU benchmark or a scalable predictor.
267
+ [Replay results](docs/research/llm-mark-order-validation-2026.md) ·
268
+ [Calculator and limits](docs/models/stage-aware-ttft.md).
269
+
270
+ - **2026-10, current source tree** — **SMDP batching control (L6 / EPIC-089)**:
271
+ deterministic batch times/energies, finite overflow RVI, independent occupation
272
+ LP and unbounded FCFS DES. Tail drift is checked separately: a small overflow
273
+ contribution does not certify real-queue stability.
274
+ [Model and limits](docs/models/smdp-batching.md).
275
+ - **2026-10, current source tree** — **Heterogeneous bulk service (L8 / EPIC-091)**:
276
+ exact unbounded geometric/free-period decomposition, waiting/response PH,
277
+ moments/tails/LST, type flows and independent request-level DES.
278
+ Published diagonal priority discrepancies are recorded with physical CTMC
279
+ arbiters. [Model and limits](docs/models/heterogeneous-bulk-service.md).
280
+
281
+ - **2026-10, current source tree** — **KV-cache congestion (L5 / EPIC-088)**:
282
+ continuous eviction/restart trajectories, homogeneous cycles, finite-input
283
+ spectrum and rate caps; independent integer FCFS simulation with work/request
284
+ conservation. Includes rational and exact Schur checks, 48 spectra and 24
285
+ paired synthetic DES settings. [Model and limits](docs/models/kv-cache-congestion.md).
286
+
287
+ - **2026-10, current source tree** — **KV-cache stability (L4 / EPIC-087)**:
288
+ joint-length resource-area bounds, correlation-sensitive capacity and strict
289
+ replica estimates. Includes independent stage packing/flow checks and 36
290
+ synthetic configurations. Free swapping and constant slots are explicit
291
+ assumptions, not production GPU guarantees. [Model and limits](docs/models/kv-cache-stability.md).
292
+
293
+ - **2026-10, current source tree** — **Mixed prefill/decode (L3 / EPIC-086)**:
294
+ Ramani–Tantawi iteration costs, exact infinite-tail surrogate occupancy and
295
+ approximate TTFT/ITL, with a separate token-level simulator. Includes 96
296
+ published-cost predictions, 28 synthetic DES cases and explicit diagnostics
297
+ for nonphysical mean-field estimates. [Model and limits](docs/models/prefill-decode.md).
298
+
299
+ - **2026-10, current source tree** — **Variable-token batching (L2 / EPIC-085)**:
300
+ dynamic, fixed and gated elastic queues retain the randomness of output lengths;
301
+ clipping/utility search, early-release simulation, and general non-affine service
302
+ callbacks. Includes 36 reproducible configurations and independent checks of
303
+ the source paper's fixed-batch formula. [Model and limits](docs/models/token-batching.md).
304
+
305
+ - **2026-10, current source tree** — **Unbounded dynamic batching (L1 / EPIC-084)**:
306
+ numerical analysis of Inoue's model with deterministic, exponential, Erlang, gamma
307
+ and H2 batch durations; moment-aware truncation diagnostics, published latency bounds,
308
+ and an independent event simulator. Includes a reproducible 60-point comparison and
309
+ checks against closed forms and capped-batch CTMCs. Mean delays only, not analytic tails.
310
+ [Model and limits](docs/models/dynamic-batching.md).
311
+
312
+ - **2026-10, current source tree** — **Exact SLA tail for batch-service queues**:
313
+ `get_tail`/`get_cdf` give the exact (not moment-fitted, not an upper bound)
314
+ `P(W>D)` for GPU/LLM-style bounded-window batch service with phase-type
315
+ (Erlang/H2, any CV) processing time, via sparse matrix-exponential-action.
316
+ Quantified against Inoue (2021)'s closed-form mean-latency bound (a bounded
317
+ window can push true E[W] up to ~10x above it) and against the library's own
318
+ moment-fit SLA approximation (which overestimates deep-tail violation
319
+ probability by orders of magnitude). 19 new tests, DES-validated.
320
+ [Method](docs/research/batch-service-sla-exact-tail-2026.md), [results](docs/research/batch-service-sla-exact-tail-results-2026.md).
321
+ - **2026-10, current source tree** — **Bulk service with correlated arrivals and a finite
322
+ buffer: MAP/PH^(a,b)/1/N** (catching up with the literature, item R9; **this closes the whole
323
+ R1-R9 series**): the model of Banik, Chaudhry, Barik & Singh, JISPS 26 (2025) 585-630, whose own
324
+ title calls its procedures heuristic. Both that paper and its open-access Poisson predecessor
325
+ (Chaudhry et al., *Mathematics* 11(5):1142, 2023) reach the waiting time through a transform and
326
+ then invert it with a Pade approximation; the transform is exact, so the approximation lives
327
+ entirely in the inversion. This implementation never forms one: it follows a tagged customer
328
+ through an absorbing chain and reads the waiting time off as a phase-type distribution. A
329
+ compression keeps that chain at O(N*a) rather than O(N^2) -- the position falls by exactly b per
330
+ batch, and the count of customers *behind* the tagged one only ever matters up to a-1. The
331
+ published CDF tables reproduce to the six digits they are printed to; where they do not, each
332
+ disagreement gets an arbiter. The paper's second moment (2.093599) is 0.55% from the exact
333
+ 2.105153, which is Medhi's published value and which this library's independent infinite-buffer
334
+ solver confirms to seven digits -- their Pade fit is constrained to reproduce the mass and the
335
+ mean and nothing else. Separately: assuming PASTA under a MAP costs +45% on E(W), a modelling
336
+ error rather than an approximation. [Model](docs/models/bulk-map-finite.md).
337
+ - **2026-10, current source tree** — **Service rate control for jobs with decaying value**
338
+ (catching up with the literature, item R8; this closes the adjacent-communities sub-series):
339
+ implementation of Master N. & Bambos N., *Service rate control for jobs with decaying value*,
340
+ ACC 2015. The library's first model where the answer is a **control policy** rather than a
341
+ performance measure: a server works through a fixed batch, the head-of-line job loses value with
342
+ every slot it fails to complete and is thrown away once that value runs out, and the only lever
343
+ is how fast to run. The dynamic program collapses -- the optimal rate depends on the state
344
+ through a single scalar -- so it solves in O(B*V*|S|). All four panels of the paper's figure 1
345
+ and its three monotonicity theorems are reproduced as tests, including conditions that decide
346
+ how the policy behaves **without computing it**. Validated against a value iteration that does
347
+ not assume the state space is acyclic, against a slot-by-slot simulation, and against
348
+ hand-computed closed forms. Found along the way: a myopic rule can cost more than not adapting
349
+ at all (461.9 against 279.8 optimal, losing to a fixed rate at 291.4), because it drops the
350
+ look-ahead term that dominates the signal and grows with the backlog.
351
+ [Model](docs/models/decaying-value.md).
352
+ - **2026-10, current source tree** — **Value vs. deadline scheduling under overload** (catching
353
+ up with the literature, item R7): implementation of Buttazzo G.C., Spuri M. & Sensini F., *Value
354
+ vs. deadline scheduling in overload conditions*, RTSS 1995. Once the load passes one, EDF does
355
+ not merely lose optimality -- it collapses, serving the most urgent job while it and several
356
+ behind it are already doomed. Each job carries an importance value, banked in full only if it
357
+ meets its deadline. All twelve of the paper's algorithms (EDF/HVF/HDF/MIX priority x
358
+ plain/guaranteed/robust guarantee), its task-set generator, and all four of its published
359
+ observations reproduced as tests -- including the crossover where RHDF overtakes REDF past
360
+ nominal load 3. Added on top, and **not** in the paper: the exact clairvoyant optimum, via
361
+ Horn's feasibility condition turned into an integer program, which fixes the paper's
362
+ denominator and shows REDF banking 94% of the achievable value at nominal load 3 where its raw
363
+ Hit Value Ratio of 0.864 looks far more modest. Validated against exhaustive search whose
364
+ feasibility test is a preemptive-EDF run rather than Horn's condition, so the reference is
365
+ independent of the formulation under test. [Model](docs/models/value-scheduling.md).
366
+ - **2026-10, current source tree** — **Imprecise computation / controllable processing times**
367
+ (catching up with the literature, item R6; the first of the adjacent-community items):
368
+ implementation of Shih, Liu, Chung & Gillies 1989 and the algorithms of Shih, Liu & Chung 1991
369
+ and Shih & Liu 1995, as reviewed by Shioura, Shakhlevich & Strusevich, EJOR 2018. Under
370
+ overload a system can give up timeliness, admission, or **answer quality** -- and the third was
371
+ missing from this library. Each job has a mandatory part that must finish and an optional part
372
+ that may be truncated; the unexecuted remainder is its error. Exact offline optimum for the
373
+ total, maximum and lexicographic weighted error, with the schedule emitted and independently
374
+ re-checked, plus online policies scored against that optimum on the same jobs. Validated
375
+ against exhaustive search and against the min-cost-flow formulation the literature itself
376
+ states. [Model](docs/models/imprecise.md).
377
+ - **2026-10, current source tree** — **M/M/1 with a threshold-controlled service rate** (catching
378
+ up with the literature, item R5, and completing that sub-series): implementation of Morrison
379
+ J.A., *Sojourn and waiting times in a single-server system with state-dependent mean service
380
+ rate*, Queueing Systems 4:213-235, 1989. The server runs at a low rate until the backlog crosses
381
+ a threshold `K` and at a high rate above it. The queue length is an elementary birth-death
382
+ chain; the sojourn time is not, because the rate depends on the total in system **including
383
+ arrivals behind the tagged customer**, so its own service can speed up for reasons that affect
384
+ it in no other way -- which is exactly why Little's distributional law fails here. Exact sojourn
385
+ and waiting moments, conditional and unconditional. This also closes a limitation our own
386
+ EPIC-073 and EPIC-078 had stated explicitly. Validated against the M/M/1 reductions, the
387
+ published stationary distribution, Little's law, and an explicit matrix solve of the same
388
+ absorbing chain with no boundary condition at all.
389
+ [Model](docs/models/fifo.md#mm1-with-a-threshold-controlled-service-rate).
390
+ - **2026-10, current source tree** — **GI/M/2 with a busy-server-dependent service rate**
391
+ (catching up with the literature, item R4): implementation of Bhat U.N., *The queue GI/M/2 with
392
+ service rate depending on the number of busy servers*, AISM 18:211-221, 1966. Real servers are
393
+ not independent — a lone worker may be helped by an idle colleague or may slow down — and an
394
+ ordinary GI/M/2 cannot express that. Exact queue-length distribution, the (different)
395
+ arrival-observed distribution since PASTA does not hold for renewal input, and the full waiting
396
+ time. Two things not in the paper fall out of the derivation: the state dependence changes how
397
+ OFTEN a customer waits but not how long once it does (the decay rate `2mu(1-gamma)` never
398
+ mentions the lone-server rate), and stability is decided by the both-busy rate alone. Checked
399
+ against the paper's published table, the elementary birth-death chain at arbitrary rate ratio,
400
+ an exact CTMC, and simulation. [Model](docs/models/fifo.md#gim2-with-a-busy-server-dependent-service-rate).
401
+ - **2026-10, current source tree** — **Higher sojourn moments in M/G/1 processor sharing**
402
+ (catching up with the literature, item R3): implementation of Yashkov's recursion
403
+ ([arXiv:math/0512281](https://arxiv.org/abs/math/0512281), 2005), closing a gap this library's
404
+ own `MG1PSCalc` had been documenting. The mean conditional sojourn time `x/(1-rho)` is famously
405
+ insensitive to the service-time distribution; **nothing above it is**, so a capacity or SLO
406
+ decision taken on the mean alone carries no information about risk. Exact conditional moments,
407
+ variance and CV, unconditional moments, and `K` permanent jobs sharing the processor. Yashkov
408
+ concluded the exact expressions were impractical to compute and the literature answered with
409
+ bounds — that difficulty disappears for phase-type service, where the whole chain stays
410
+ phase-type and the moments come out of a few small matrix exponentials with no quadrature.
411
+ Validated against the insensitivity theorem (machine precision, through a recursion never told
412
+ it), an M/M/1-PS closed form, Yashkov's own small-job asymptotic, his equation (3.10) by
413
+ independent quadrature, and simulation. [Model](docs/models/size-based.md#m-g-1-ps-processor-sharing).
414
+ - **2026-10, current source tree** — **Delay-dependent service rates** (catching up with the
415
+ literature, item R2): implementation of D'Auria, Adan, Bekker & Kulkarni, *An M/M/c queue with
416
+ queueing-time dependent service rates*, EJOR 299(2):566-579, 2022 — the service rate a customer
417
+ gets depends on the delay **that customer** experienced, which is the empirically observed
418
+ "slowdown" effect in health care, call centres and retail. Exact waiting-time distribution,
419
+ density and mean, as a mixture of matrix exponentials. The model and solution are the authors';
420
+ ours is the implementation, validated against the Erlang-C reduction (`1e-16`), their own `c=1`
421
+ closed form (`3e-16`), their published `c=2` numbers (every printed digit) and independent
422
+ simulation. Two numerical properties of the method that the paper does not state are documented
423
+ and handled. [Model](docs/models/delay-dependent.md).
424
+ - **2026-10, current source tree** — **Occupancy-dependent continuous batching**: exact
425
+ waiting-time distribution (moments and tail, not just the mean) for the Markovian core
426
+ of LLM-serving "continuous batching" — up to `k` requests served concurrently with a
427
+ per-request rate that depends on current occupancy, capped by accelerator memory
428
+ (KV-cache). Occupancy is pinned at the cap whenever anyone waits, so `W` is an exact,
429
+ closed-form mixture of Erlang distributions — no sparse solve needed. Regresses exactly
430
+ to the classical `M/M/k/N` queue at a constant rate; DES-validated. A simple
431
+ approximation that ignores the occupancy dependence is shown to overstate
432
+ deadline-violation risk by 1-2 orders of magnitude at moderate occupancy and several
433
+ orders of magnitude at a large concurrency cap. [Model](docs/models/continuous-batching.md).
434
+ - **2026-10, current source tree** — **Idle-refill, impatience, and multiserver bulk-service**:
435
+ three further generalizations of the bounded-window batch-service model — exact W
436
+ moments/tail for any idle-refill race `a<=b` (not just `a=1`); Markovian abandonment
437
+ (`gamma`-rate reneging) for MM1/Erlang and H2-branching service, each via a dedicated
438
+ absorbing chain tracking surviving-ahead-count and new-arrivals-behind as explicit
439
+ state; and `c` independent servers sharing one FCFS queue, including batch-size-dependent
440
+ `mu` at `gamma==0` and abandonment at constant `mu`. All DES-validated independently of
441
+ the production code; dependent-`mu` combined with abandonment remains an explicit
442
+ reserve. See the [epic registry](docs/epics/README.md) for the full breakdown
443
+ (EPIC-067 through EPIC-072).
444
+ - **2026-10, current source tree** — **Availability-aware arrival history**:
445
+ removes a completed-prefix staleness artifact (prefix lag up to 8.2 days)
446
+ by building arrival-mark donor history from submit<cutoff over the already-
447
+ parsed completed+cancelled(+failed/timeout/node_failed) population, not
448
+ stalling at the first job unresolved at cutoff. Lag drops to minutes/hours
449
+ and the donor pool roughly doubles, but this is not a uniform accuracy win:
450
+ queue-error effects go in opposite directions on SDSC versus Kalos. 16 unit
451
+ tests, 792 schedules, byte-identical repeat, independent audit.
452
+ [Method](docs/availability_aware_arrivals.md), [results](docs/research/availability-aware-arrivals-results-2026-10.md).
453
+ - **2026-10, current source tree** — **MSJ capacity calendar**: opt-in
454
+ time-varying capacity (`CapacityCalendar`/`run_capacity_calendar`) over MSJ
455
+ replay, with automatic grandfathering, explicit infeasible/unresolved
456
+ outcomes bounded by the calendar's own horizon, and detected (not silently
457
+ absorbed) reservation/calendar mismatches. 23 unit tests, plus three
458
+ prescribed Helios scenarios (fixed/daily/isolated-VC pool) over one
459
+ prescribed window, byte-identical repeat and an independent check.
460
+ [Method](docs/msj_capacity_calendar.md), [results](docs/research/msj-capacity-calendar-results-2026-10.md).
461
+ - **2026-10, current source tree** — **Resource observability audit**:
462
+ six source schemas compared; all 3,362,981 Helios records audited with pinned
463
+ inputs, a byte-identical repeat and independent accounting checks. Daily VC
464
+ GPU counts support bounded capacity scenarios, not reconstructed hard quotas:
465
+ 17,459 GPU records start with a zero same-day VC count. No scheduler replay claimed.
466
+ [Method](docs/resource_observability.md), [results](docs/research/resource-observability-results-2026-10.md).
467
+ - **2026-10, current source tree** — **Joint marked arrivals**:
468
+ empirical gap/K/context/request tuples, circular blocks and matched shuffles,
469
+ with a common coarse S|K mechanism and fixed-arrival baseline. 1176 empty-start
470
+ replays and a byte-identical repeat show no consistent joint-generator gain;
471
+ resolved-prefix staleness and late workload-mix drift remain explicit limitations.
472
+ [Protocol/API](docs/joint_marked_arrivals.md), [results](docs/research/joint-marked-arrivals-results-2026-10.md).
473
+ - **2026-10, current source tree** — **Queue-aware service selection**:
474
+ 1500 replays with two early selection and two late evaluation blocks per source.
475
+ Queue-selected SDSC request bins improve point uncapped queue-loss versus CRPS selection,
476
+ but not versus fixed coarse; Kalos type candidates coincide on late service tapes.
477
+ Class coverage, timeout rates and policy regret remain separate checks.
478
+ [Protocol/API](docs/queue_aware_selection.md), [results](docs/research/queue-aware-selection-results-2026-10.md).
479
+ - **2026-10, current source tree** — **GPU resource envelopes**:
480
+ prescribed GPU-pool versus exclusive-node capacity sensitivity, with fixed
481
+ target IDs and explicit infeasible cells. Requested GPU work and reserved
482
+ GPU-equivalent work remain separate; no quota or placement estimation is claimed.
483
+ 1080 replays and a byte-identical repeat; observed p99 ties all six policies
484
+ in every feasible cell, so zero regret does not validate scheduler choice.
485
+ [Protocol/API](docs/gpu_resource_envelope.md), [results](docs/research/gpu-resource-envelope-results-2026-10.md).
486
+ - **2026-10, current source tree** — **Feature-conditional service**:
487
+ 450 paired replays with early-validation model selection. Requested-time ratios
488
+ reduce SDSC test CRPS by 46.69% and excess timeouts, but do not preserve p99
489
+ policy choice; retrospective Kalos type features degrade on the late holdout.
490
+ [Protocol/API](docs/feature_service.md), [results](docs/research/feature-service-results-2026-10.md).
491
+ - **2026-10, current source tree** — **Modern GPU-trace validation**:
492
+ hash-pinned Acme/Kalos ingestion recomputes execution from end-start; the
493
+ released `duration` includes waiting. 1224 replays with separate failed/cancelled
494
+ occupation and an identical full repeat. At nominal GPU-pool capacity all
495
+ observed target waits are zero, so tied policy choices do not validate a
496
+ scheduler. Service-model errors remain large. [Protocol/API](docs/modern_gpu_trace.md),
497
+ [results](docs/research/modern-gpu-trace-results-2026-10.md).
498
+ - **2026-10, current source tree** — **Initial state and terminal outcomes**:
499
+ opt-in MSJ replay with running/waiting carry-in, labelled cancelled occupation
500
+ and start-relative hard runtime budgets. Successful completion, cancellation
501
+ and timeout are accounted separately; shortened terminal latency is not treated
502
+ as successful service. The real-trace study keeps a fixed completed target cohort
503
+ and explicitly excludes cancellations with unobservable resource use.
504
+ In 1632 replays, adding observed cancelled occupation changed the best mean-delay
505
+ policy in one period; both service models missed the p99 winner in all four.
506
+ [Protocol/API](docs/real_trace_lifecycle.md),
507
+ [results](docs/research/real-trace-lifecycle-results-2026-10.md).
508
+ - **2026-10, current source tree** — **Temporal history and dependent service**:
509
+ four prespecified SDSC SP2 origins, seven workload variants and 1368 replays.
510
+ Recent coarse-group empirical history reduced aggregate mean-delay error
511
+ from 94.57% to 44.12%, but helped neither every period nor every finer model.
512
+ Rank blocks reproduced more serial correlation without a consistent delay
513
+ or p99-decision advantage. These are selected-cohort diagnostics, not causal
514
+ production guarantees. [Protocol](docs/real_trace_temporal.md),
515
+ [results](docs/research/real-trace-temporal-results-2026-10.md).
516
+ - **2026-10, current source tree** — **Real-trace service calibration**:
517
+ audited, hash-pinned SDSC SP2 ingestion; completed-history temporal holdout;
518
+ empirical, Exp, PH and lognormal service compared under six existing MSJ
519
+ disciplines. In 594 replays, all four models preserved the best mean-delay
520
+ choice but substantially underestimated delays in the first two blocks;
521
+ p99-based choices differed from observed-duration replay. This is a selected
522
+ historical completed-job cohort, not a production-cluster reconstruction.
523
+ [Protocol](docs/real_trace_calibration.md),
524
+ [results](docs/research/real-trace-calibration-results-2026-10.md).
525
+ - **2026-10, current source tree** — **MSJ beyond exponential service**:
526
+ small-system PH-FCFS analytics and common-trace experiments for backfilling
527
+ and prediction-free packing. Runtime forecasts support historical features,
528
+ resource-group calibration and age-aware Kaplan–Meier estimates from censored
529
+ history. MSFQ is one-or-all; ServerFilling is a separate power-of-two,
530
+ zero-cost preemptive-resume model. `MsjCheckpointSim` separately models
531
+ resource-holding checkpoint/resume phases and reports productive utilization.
532
+ Optional `min_service_time` protects each useful episode; protection can be
533
+ selected on independent historical replays, without test-set tuning.
534
+ In 832 paired sensitivity runs, overhead could erase the packing advantage;
535
+ the crossover depended on workload, not a universal cost threshold.
536
+ A further 1920-run protection study found gains over unprotected SF at high
537
+ overhead; zero protection was the historical choice at both lower cost levels.
538
+ [Methods and API](docs/models/msj.md), [packing results](docs/research/msj-packing-results-2026-10.md),
539
+ [checkpoint-cost results](docs/research/msj-checkpoint-results-2026-10.md),
540
+ [protected-service results](docs/research/msj-protected-service-results-2026-10.md),
541
+ [roadmap](docs/roadmaps/msj-ph-backfilling.md). Simulation comparisons are not
542
+ new analytical stability or SLO guarantees; PyPI releases may lag this tree.
543
+ - **2026-09** — **Realism wave, part 2: Erlang everywhere, batch-size-dependent params, exact
544
+ moments**: **queueing-inventory** replenishment lead time generalized from `Exp(θ)` to
545
+ **Erlang-fitted** (the phase dimension only applies where an order can be in transit — a first
546
+ for this phase-type family); the per-server heterogeneous model gained an **Erlang-fitted
547
+ (CV≤1) service** sibling to its H2 case, with a real outflow-splitting bug (departure vs.
548
+ mid-service phase-advance rates) caught via a deliberately non-degenerate regression check;
549
+ **bulk-service** batch-service parameters (Erlang and H2) can now depend on batch size (LLM/GPU
550
+ dynamic-batching realism), and the Erlang-fitted case gained **exact raw moments of W** (not
551
+ just the mean), extending EPIC-032's PASTA technique to the phase-augmented CTMC. See the
552
+ [epic registry](docs/epics/README.md) for the full breakdown (EPIC-040 through EPIC-043).
553
+ - **2026-09** — **Realism wave: heterogeneous branches, general service, admission control**:
554
+ **fork-join** generalized to heterogeneous branches, series-parallel task DAGs and (n,k)-join
555
+ (exact order-statistics moments, closed-form Pareto); **bulk-service** batch-service time
556
+ generalized from exponential to **Erlang** (CV≤1) and **H2** (CV≥1) phase-type fits, with exact
557
+ N/W moments and an auto-dispatcher picking the family by CV; exact **deadline-aware admission
558
+ control** (accept/reject at arrival based on own-deadline feasibility, Exp(θ) deadline — solved
559
+ via a level-crossing functional equation and truncated power-series moment extraction, after an
560
+ initial "obvious" shortcut was proven wrong); and **queueing-inventory** generalized to `c`
561
+ heterogeneous servers (state-splitting + stacked-boundary QBD) with, going one step further,
562
+ **per-server H2-fitted (non-exponential) service time** — each server can have its own realistic
563
+ service-time distribution instead of a single shared rate. See the
564
+ [epic registry](docs/epics/README.md) for the full breakdown (EPIC-030 through EPIC-039).
565
+ - **2026-09** — **Priorities, inventory & scheduling wave**: **M/M/2 priorities with
566
+ heterogeneous servers** (exact non-birth-death CTMC, canonicalized state construction);
567
+ **queueing-inventory** generalized to lost-sales, the full **(s,S)** reorder-point policy
568
+ (not just (0,S)), and **M/M/c** multi-server stock-sharing (exact QBD via a stacked
569
+ boundary superblock, reduces exactly to M/M/1 at c=1); and **EDF (Earliest Deadline First)**
570
+ as an actual service discipline rather than a post-hoc SLA metric — deliberately DES-only,
571
+ since exact finite-state EDF analysis turned out to be a genuinely open problem (four
572
+ candidate exact reductions were tried and numerically/analytically disproven; see
573
+ [`docs/research/edf-scheduling-2026.md`](docs/research/edf-scheduling-2026.md)).
574
+ - **2026-09** — **SLA & exact-extensions wave**: a horizontal **SLA/deadline-violation
575
+ probability** layer (`P(W > D)` and SLO quantiles from raw moments, on top of *any* calculator
576
+ in the table above — LLM-serving TTFT SLO example); exact **heavy-tailed (Pareto) fork-join**
577
+ (closed-form max-of-n via the Beta function, no approximation); **machine repair with two
578
+ heterogeneous repairmen** (Krishnamoorthi's non-birth-death CTMC technique); and the first
579
+ **queueing-inventory system** (M/M/1 with stock-consuming service, (0,S) replenishment,
580
+ backordering — an exact QBD, reusing the MAP/PH stack's solver). See the
581
+ [research](docs/research/) folder for the literature review behind each.
582
+ - **2026** — **Scale & dynamics wave**: **load balancing** in the mean-field limit
583
+ (power-of-d / JSQ / JIQ — the "power of two choices" behind modern dispatchers);
584
+ **polling systems** (one server touring Q queues with switchover, exhaustive/gated, the
585
+ Boxma–Groenevelt pseudo-conservation law); and **non-stationary Mt/M/c** with time-varying
586
+ load (PSA & MOL approximations for surging demand — call-center staffing, autoscaling).
587
+ Each with a paired simulator and tests. See the
588
+ [trends survey](docs/research/queueing-trends-2026.md).
589
+ - **2026 (v2.9)** — **Datacenter & multi-priority wave**: **RDR** for multi-server multi-class
590
+ preemptive priorities (M/M/k and M/PH/k, exact + RDR-A, per-class response-time variance);
591
+ the **multiserver-job** model (jobs holding several servers at once — FCFS response time and
592
+ saturated-system stability, the first open-source implementation); **Age of Information**
593
+ (average & peak AoI); **bulk-service** queues for LLM inference batching; and
594
+ **graceful-degradation curves** for prediction-based scheduling. See the
595
+ [trends survey](docs/research/queueing-trends-2026.md).
596
+ - **2026** — **Matrix-analytic MAP/PH stack**: PH distributions and MAPs
597
+ (`most_queue.random.map_ph`), a QBD solver with logarithmic reduction, and exact calculators
598
+ for MAP/PH/1, M/PH/1, PH/PH/1, **MAP/M/c**, **MAP/PH/c**, plus **BMAP/M/1** and **BMAP/PH/1**
599
+ for batch arrivals and **MMPP fitting** from data; MAP and PH sources in the simulator. Plus
600
+ retrial queues (orbit) and Erlang-A abandonment with a staffing helper.
601
+ See [`tutorials/map_ph_correlation.ipynb`](tutorials/map_ph_correlation.ipynb).
602
+ - **2026** — Wave of exact classics: Erlang B/C, M/G/∞, GI/G approximations, M/G/1 vacation
603
+ models (multiple vacations, N-policy), PS, LCFS-PR, FB/LAS, unreliable server — each with a
604
+ paired simulator and tests. Illustrated model catalog with generated diagrams.
605
+ - **2026** — Size-based scheduling analytics: SRPT / SJF / PSJF / SPJF with prediction models
606
+ (reproduces the Mitzenmacher–Shahout 2025 table in tests) + `SizeBasedQsSim`.
607
+ - **2026 (preprint)** — Multi-server queues with negative customers via Takahashi–Takami:
608
+ [preprint & reproduction code](works/negative_queues/).
609
+ - **2025 (paper)** — Multi-channel system with warm-up, cooling and cooling delay:
610
+ Lokhvitsky, Khabarov, Yakovlev, DOI [10.25791/aviakosmos.1.2025.1456](https://doi.org/10.25791/aviakosmos.1.2025.1456).
611
+
612
+ ## Contributing
613
+
614
+ Issues and pull requests are welcome! Open an [issue](https://github.com/xabarov/most-queue/issues)
615
+ for bugs or model requests. Development conventions: [docs/PROJECT.md](docs/PROJECT.md),
616
+ setup and first contributions: [CONTRIBUTING.md](CONTRIBUTING.md),
617
+ definition of done: [docs/DOD.md](docs/DOD.md).
618
+
619
+ ## Citation
620
+
621
+ If you use Most-Queue in research, please cite it (see [`CITATION.cff`](CITATION.cff)):
622
+
623
+ ```bibtex
624
+ @software{most_queue,
625
+ author = {Khabarov, Roman},
626
+ title = {Most-Queue: queueing theory calculations and simulation in Python},
627
+ url = {https://github.com/xabarov/most-queue},
628
+ doi = {10.5281/zenodo.21268402},
629
+ license = {MIT}
630
+ }
631
+ ```
632
+
633
+ ## License
634
+
635
+ [MIT](LICENSE) © Roman Khabarov