kith-fw 1.0.0__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 (238) hide show
  1. kith_fw-1.0.0/.gitignore +38 -0
  2. kith_fw-1.0.0/CHANGELOG.md +108 -0
  3. kith_fw-1.0.0/CMakeLists.txt +154 -0
  4. kith_fw-1.0.0/CMakePresets.json +187 -0
  5. kith_fw-1.0.0/LICENSE +202 -0
  6. kith_fw-1.0.0/PKG-INFO +229 -0
  7. kith_fw-1.0.0/README.md +199 -0
  8. kith_fw-1.0.0/THIRD-PARTY-NOTICES.md +19 -0
  9. kith_fw-1.0.0/cmake/abi.cmake +65 -0
  10. kith_fw-1.0.0/cmake/checks.cmake +147 -0
  11. kith_fw-1.0.0/cmake/format.cmake +76 -0
  12. kith_fw-1.0.0/cmake/fpenv.cmake +32 -0
  13. kith_fw-1.0.0/cmake/framework.cmake +117 -0
  14. kith_fw-1.0.0/cmake/hardening.cmake +65 -0
  15. kith_fw-1.0.0/cmake/kith.pc.in +35 -0
  16. kith_fw-1.0.0/cmake/kithConfig.cmake.in +46 -0
  17. kith_fw-1.0.0/cmake/lib_aoi.cmake +48 -0
  18. kith_fw-1.0.0/cmake/lib_client.cmake +50 -0
  19. kith_fw-1.0.0/cmake/lib_config.cmake +41 -0
  20. kith_fw-1.0.0/cmake/lib_control.cmake +62 -0
  21. kith_fw-1.0.0/cmake/lib_coord.cmake +50 -0
  22. kith_fw-1.0.0/cmake/lib_db.cmake +52 -0
  23. kith_fw-1.0.0/cmake/lib_fabric.cmake +50 -0
  24. kith_fw-1.0.0/cmake/lib_gateway.cmake +74 -0
  25. kith_fw-1.0.0/cmake/lib_logger.cmake +60 -0
  26. kith_fw-1.0.0/cmake/lib_metrics.cmake +63 -0
  27. kith_fw-1.0.0/cmake/lib_net.cmake +71 -0
  28. kith_fw-1.0.0/cmake/lib_proto.cmake +64 -0
  29. kith_fw-1.0.0/cmake/lib_reactor.cmake +68 -0
  30. kith_fw-1.0.0/cmake/lib_server.cmake +82 -0
  31. kith_fw-1.0.0/cmake/lib_sim.cmake +60 -0
  32. kith_fw-1.0.0/cmake/lib_state.cmake +51 -0
  33. kith_fw-1.0.0/cmake/lib_util.cmake +54 -0
  34. kith_fw-1.0.0/cmake/lib_worker.cmake +66 -0
  35. kith_fw-1.0.0/cmake/sanitizers.cmake +76 -0
  36. kith_fw-1.0.0/cmake/visibility.cmake +21 -0
  37. kith_fw-1.0.0/cmake/warnings.cmake +34 -0
  38. kith_fw-1.0.0/docs/third-party/BSD-3-Clause.txt +29 -0
  39. kith_fw-1.0.0/docs/third-party/MIT.txt +20 -0
  40. kith_fw-1.0.0/docs/third-party/PostgreSQL.txt +23 -0
  41. kith_fw-1.0.0/hatch_build.py +330 -0
  42. kith_fw-1.0.0/include/kith/aoi/aoi.h +397 -0
  43. kith_fw-1.0.0/include/kith/api.h +35 -0
  44. kith_fw-1.0.0/include/kith/client/client.h +723 -0
  45. kith_fw-1.0.0/include/kith/config/config.h +244 -0
  46. kith_fw-1.0.0/include/kith/control/control.h +663 -0
  47. kith_fw-1.0.0/include/kith/coord/coord.h +734 -0
  48. kith_fw-1.0.0/include/kith/db/db.h +702 -0
  49. kith_fw-1.0.0/include/kith/fabric/fabric.h +536 -0
  50. kith_fw-1.0.0/include/kith/gateway/gateway.h +2386 -0
  51. kith_fw-1.0.0/include/kith/logger/logger.h +281 -0
  52. kith_fw-1.0.0/include/kith/metrics/metrics.h +290 -0
  53. kith_fw-1.0.0/include/kith/net/net.h +602 -0
  54. kith_fw-1.0.0/include/kith/proto/proto.h +414 -0
  55. kith_fw-1.0.0/include/kith/reactor/reactor.h +423 -0
  56. kith_fw-1.0.0/include/kith/server/server.h +686 -0
  57. kith_fw-1.0.0/include/kith/sim/sim.h +692 -0
  58. kith_fw-1.0.0/include/kith/state/state.h +386 -0
  59. kith_fw-1.0.0/include/kith/types.h +273 -0
  60. kith_fw-1.0.0/include/kith/util/rng.h +257 -0
  61. kith_fw-1.0.0/include/kith/util/tick_clock.h +185 -0
  62. kith_fw-1.0.0/include/kith/util/util.h +110 -0
  63. kith_fw-1.0.0/include/kith/util/wall_clock.h +41 -0
  64. kith_fw-1.0.0/include/kith/version.h +32 -0
  65. kith_fw-1.0.0/include/kith/worker/worker.h +414 -0
  66. kith_fw-1.0.0/pyproject.toml +337 -0
  67. kith_fw-1.0.0/python/kith/__init__.py +1636 -0
  68. kith_fw-1.0.0/python/kith/_agent/__init__.py +8 -0
  69. kith_fw-1.0.0/python/kith/_agent/ahc.py +2218 -0
  70. kith_fw-1.0.0/python/kith/_agent/server_control.py +276 -0
  71. kith_fw-1.0.0/python/kith/_bridge.py +626 -0
  72. kith_fw-1.0.0/python/kith/_generated/__init__.py +55 -0
  73. kith_fw-1.0.0/python/kith/_generated/aoi.py +156 -0
  74. kith_fw-1.0.0/python/kith/_generated/client.py +271 -0
  75. kith_fw-1.0.0/python/kith/_generated/config.py +100 -0
  76. kith_fw-1.0.0/python/kith/_generated/control.py +224 -0
  77. kith_fw-1.0.0/python/kith/_generated/coord.py +294 -0
  78. kith_fw-1.0.0/python/kith/_generated/db.py +171 -0
  79. kith_fw-1.0.0/python/kith/_generated/fabric.py +216 -0
  80. kith_fw-1.0.0/python/kith/_generated/gateway.py +679 -0
  81. kith_fw-1.0.0/python/kith/_generated/logger.py +99 -0
  82. kith_fw-1.0.0/python/kith/_generated/metrics.py +120 -0
  83. kith_fw-1.0.0/python/kith/_generated/net.py +149 -0
  84. kith_fw-1.0.0/python/kith/_generated/proto.py +140 -0
  85. kith_fw-1.0.0/python/kith/_generated/reactor.py +113 -0
  86. kith_fw-1.0.0/python/kith/_generated/server.py +144 -0
  87. kith_fw-1.0.0/python/kith/_generated/sim.py +318 -0
  88. kith_fw-1.0.0/python/kith/_generated/state.py +133 -0
  89. kith_fw-1.0.0/python/kith/_generated/types.py +71 -0
  90. kith_fw-1.0.0/python/kith/_generated/util.py +146 -0
  91. kith_fw-1.0.0/python/kith/_generated/version.py +23 -0
  92. kith_fw-1.0.0/python/kith/_generated/worker.py +105 -0
  93. kith_fw-1.0.0/python/kith/aoi.py +376 -0
  94. kith_fw-1.0.0/python/kith/config.py +355 -0
  95. kith_fw-1.0.0/python/kith/control.py +624 -0
  96. kith_fw-1.0.0/python/kith/coord.py +732 -0
  97. kith_fw-1.0.0/python/kith/db.py +778 -0
  98. kith_fw-1.0.0/python/kith/examples/__init__.py +7 -0
  99. kith_fw-1.0.0/python/kith/examples/visual/README.md +88 -0
  100. kith_fw-1.0.0/python/kith/examples/visual/__init__.py +9 -0
  101. kith_fw-1.0.0/python/kith/examples/visual/__main__.py +193 -0
  102. kith_fw-1.0.0/python/kith/examples/visual/_cohort.py +252 -0
  103. kith_fw-1.0.0/python/kith/examples/visual/_handlers.py +676 -0
  104. kith_fw-1.0.0/python/kith/examples/visual/_launch.py +152 -0
  105. kith_fw-1.0.0/python/kith/examples/visual/_net.py +189 -0
  106. kith_fw-1.0.0/python/kith/examples/visual/_protocol.py +374 -0
  107. kith_fw-1.0.0/python/kith/examples/visual/_store.py +568 -0
  108. kith_fw-1.0.0/python/kith/examples/visual/_world.py +35 -0
  109. kith_fw-1.0.0/python/kith/examples/visual/client.py +531 -0
  110. kith_fw-1.0.0/python/kith/examples/visual/drivers.py +479 -0
  111. kith_fw-1.0.0/python/kith/examples/visual/server.py +294 -0
  112. kith_fw-1.0.0/python/kith/exceptions.py +220 -0
  113. kith_fw-1.0.0/python/kith/fabric.py +610 -0
  114. kith_fw-1.0.0/python/kith/gateway.py +1595 -0
  115. kith_fw-1.0.0/python/kith/proto.py +364 -0
  116. kith_fw-1.0.0/python/kith/reactor.py +640 -0
  117. kith_fw-1.0.0/python/kith/sim.py +733 -0
  118. kith_fw-1.0.0/python/kith/worker.py +164 -0
  119. kith_fw-1.0.0/src/aoi/aoi.c +685 -0
  120. kith_fw-1.0.0/src/aoi/aoi_internal.h +126 -0
  121. kith_fw-1.0.0/src/aoi/kith_aoi.map +14 -0
  122. kith_fw-1.0.0/src/client/bootstrap.c +193 -0
  123. kith_fw-1.0.0/src/client/client.c +586 -0
  124. kith_fw-1.0.0/src/client/client_internal.h +187 -0
  125. kith_fw-1.0.0/src/client/kith_client.map +20 -0
  126. kith_fw-1.0.0/src/client/queue.c +206 -0
  127. kith_fw-1.0.0/src/config/config.c +534 -0
  128. kith_fw-1.0.0/src/config/kith_config.map +13 -0
  129. kith_fw-1.0.0/src/control/conn.c +662 -0
  130. kith_fw-1.0.0/src/control/control.c +622 -0
  131. kith_fw-1.0.0/src/control/control_internal.h +352 -0
  132. kith_fw-1.0.0/src/control/event_bus.c +120 -0
  133. kith_fw-1.0.0/src/control/handlers.c +161 -0
  134. kith_fw-1.0.0/src/control/http_parser.c +332 -0
  135. kith_fw-1.0.0/src/control/kith_control.map +18 -0
  136. kith_fw-1.0.0/src/control/router.c +191 -0
  137. kith_fw-1.0.0/src/coord/coord.c +1245 -0
  138. kith_fw-1.0.0/src/coord/coord_internal.h +202 -0
  139. kith_fw-1.0.0/src/coord/kith_coord.map +27 -0
  140. kith_fw-1.0.0/src/db/conn.c +549 -0
  141. kith_fw-1.0.0/src/db/db.c +932 -0
  142. kith_fw-1.0.0/src/db/db_internal.h +217 -0
  143. kith_fw-1.0.0/src/db/kith_db.map +21 -0
  144. kith_fw-1.0.0/src/fabric/fabric.c +1281 -0
  145. kith_fw-1.0.0/src/fabric/fabric_internal.h +161 -0
  146. kith_fw-1.0.0/src/fabric/kith_fabric.map +21 -0
  147. kith_fw-1.0.0/src/gateway/broadcast.c +250 -0
  148. kith_fw-1.0.0/src/gateway/broadcast.h +47 -0
  149. kith_fw-1.0.0/src/gateway/cache/cache.c +761 -0
  150. kith_fw-1.0.0/src/gateway/cache/cache.h +92 -0
  151. kith_fw-1.0.0/src/gateway/delivery/delivery.c +216 -0
  152. kith_fw-1.0.0/src/gateway/delivery/delivery.h +91 -0
  153. kith_fw-1.0.0/src/gateway/delivery/executor.c +233 -0
  154. kith_fw-1.0.0/src/gateway/delivery/executor.h +70 -0
  155. kith_fw-1.0.0/src/gateway/delivery/strategy.c +116 -0
  156. kith_fw-1.0.0/src/gateway/delivery/strategy.h +26 -0
  157. kith_fw-1.0.0/src/gateway/delivery/strategy_full.c +331 -0
  158. kith_fw-1.0.0/src/gateway/delivery/strategy_tiered.c +767 -0
  159. kith_fw-1.0.0/src/gateway/delivery/strategy_tiered.h +7 -0
  160. kith_fw-1.0.0/src/gateway/gateway.c +961 -0
  161. kith_fw-1.0.0/src/gateway/gateway_internal.h +1072 -0
  162. kith_fw-1.0.0/src/gateway/handler.c +357 -0
  163. kith_fw-1.0.0/src/gateway/kith_gateway.map +58 -0
  164. kith_fw-1.0.0/src/gateway/session/session.c +1059 -0
  165. kith_fw-1.0.0/src/gateway/session/session.h +76 -0
  166. kith_fw-1.0.0/src/gateway/view/view.c +1255 -0
  167. kith_fw-1.0.0/src/gateway/view/view.h +40 -0
  168. kith_fw-1.0.0/src/logger/kith_logger.map +11 -0
  169. kith_fw-1.0.0/src/logger/logger.c +407 -0
  170. kith_fw-1.0.0/src/logger/structured/structured.c +267 -0
  171. kith_fw-1.0.0/src/logger/structured/structured.h +30 -0
  172. kith_fw-1.0.0/src/metrics/kith_metrics.map +12 -0
  173. kith_fw-1.0.0/src/metrics/metrics.c +464 -0
  174. kith_fw-1.0.0/src/metrics/registry.h +57 -0
  175. kith_fw-1.0.0/src/metrics/render/otlp.c +364 -0
  176. kith_fw-1.0.0/src/metrics/render/otlp.h +18 -0
  177. kith_fw-1.0.0/src/metrics/render/prometheus.c +268 -0
  178. kith_fw-1.0.0/src/metrics/render/prometheus.h +12 -0
  179. kith_fw-1.0.0/src/metrics/render/render.h +90 -0
  180. kith_fw-1.0.0/src/net/conn.c +720 -0
  181. kith_fw-1.0.0/src/net/conn.h +94 -0
  182. kith_fw-1.0.0/src/net/frame.c +198 -0
  183. kith_fw-1.0.0/src/net/frame.h +64 -0
  184. kith_fw-1.0.0/src/net/kith_net.map +26 -0
  185. kith_fw-1.0.0/src/net/net.c +440 -0
  186. kith_fw-1.0.0/src/net/ringbuf.c +256 -0
  187. kith_fw-1.0.0/src/net/ringbuf.h +74 -0
  188. kith_fw-1.0.0/src/proto/kith_proto.map +15 -0
  189. kith_fw-1.0.0/src/proto/proto.c +535 -0
  190. kith_fw-1.0.0/src/reactor/kith_reactor.map +16 -0
  191. kith_fw-1.0.0/src/reactor/reactor.c +748 -0
  192. kith_fw-1.0.0/src/reactor/reactor_internal.h +146 -0
  193. kith_fw-1.0.0/src/reactor/reactor_uring.c +613 -0
  194. kith_fw-1.0.0/src/server/kith_server.map +22 -0
  195. kith_fw-1.0.0/src/server/server.c +416 -0
  196. kith_fw-1.0.0/src/server/server_internal.h +443 -0
  197. kith_fw-1.0.0/src/server/wire.c +353 -0
  198. kith_fw-1.0.0/src/server/wire.h +112 -0
  199. kith_fw-1.0.0/src/server/wiring.c +1656 -0
  200. kith_fw-1.0.0/src/sim/artifact_store.c +1136 -0
  201. kith_fw-1.0.0/src/sim/kith_sim.map +20 -0
  202. kith_fw-1.0.0/src/sim/model_registry.c +130 -0
  203. kith_fw-1.0.0/src/sim/models/free2d.c +149 -0
  204. kith_fw-1.0.0/src/sim/models/tile2d.c +367 -0
  205. kith_fw-1.0.0/src/sim/sim.c +494 -0
  206. kith_fw-1.0.0/src/sim/sim_internal.h +311 -0
  207. kith_fw-1.0.0/src/state/kith_state.map +11 -0
  208. kith_fw-1.0.0/src/state/state.c +681 -0
  209. kith_fw-1.0.0/src/state/state_internal.h +84 -0
  210. kith_fw-1.0.0/src/util/fpenv.c +8 -0
  211. kith_fw-1.0.0/src/util/kith_util.map +28 -0
  212. kith_fw-1.0.0/src/util/rng.c +242 -0
  213. kith_fw-1.0.0/src/util/tick_clock.c +157 -0
  214. kith_fw-1.0.0/src/util/util.c +48 -0
  215. kith_fw-1.0.0/src/util/wall_clock.c +14 -0
  216. kith_fw-1.0.0/src/util/wide_int.h +15 -0
  217. kith_fw-1.0.0/src/worker/bridge.c +153 -0
  218. kith_fw-1.0.0/src/worker/kith_worker.map +16 -0
  219. kith_fw-1.0.0/src/worker/worker.c +384 -0
  220. kith_fw-1.0.0/src/worker/worker_internal.h +87 -0
  221. kith_fw-1.0.0/tests/abi/aoi.abi +335 -0
  222. kith_fw-1.0.0/tests/abi/client.abi +623 -0
  223. kith_fw-1.0.0/tests/abi/config.abi +234 -0
  224. kith_fw-1.0.0/tests/abi/control.abi +613 -0
  225. kith_fw-1.0.0/tests/abi/coord.abi +653 -0
  226. kith_fw-1.0.0/tests/abi/db.abi +500 -0
  227. kith_fw-1.0.0/tests/abi/fabric.abi +580 -0
  228. kith_fw-1.0.0/tests/abi/gateway.abi +1635 -0
  229. kith_fw-1.0.0/tests/abi/logger.abi +281 -0
  230. kith_fw-1.0.0/tests/abi/metrics.abi +321 -0
  231. kith_fw-1.0.0/tests/abi/net.abi +571 -0
  232. kith_fw-1.0.0/tests/abi/proto.abi +314 -0
  233. kith_fw-1.0.0/tests/abi/reactor.abi +426 -0
  234. kith_fw-1.0.0/tests/abi/server.abi +805 -0
  235. kith_fw-1.0.0/tests/abi/sim.abi +715 -0
  236. kith_fw-1.0.0/tests/abi/state.abi +709 -0
  237. kith_fw-1.0.0/tests/abi/util.abi +317 -0
  238. kith_fw-1.0.0/tests/abi/worker.abi +402 -0
@@ -0,0 +1,38 @@
1
+ # Build directories (CMake + CLion presets)
2
+ build/
3
+ cmake-build-*/
4
+ */build/
5
+
6
+ # Generated compile database (regenerated by CMake)
7
+ compile_commands.json
8
+
9
+ # Python bytecode and virtualenvs
10
+ *.pyc
11
+ __pycache__/
12
+ .venv/
13
+ # Dedicated venv for the free-threaded interpreter stage of verify.sh.
14
+ .venv-ft/
15
+ .cache/
16
+
17
+ # Build artifacts (tracked in releases, not in the source tree)
18
+ *.so
19
+ *.a
20
+ *.dylib
21
+
22
+ # Editor/tag files
23
+ .tags
24
+ .idea/
25
+ .vscode/
26
+
27
+ # Secrets (never commit real env files; examples are tracked)
28
+ *.env
29
+ !*.env.example
30
+
31
+ # Local profiling artifacts (coverage + LLVM profile data)
32
+ .coverage
33
+ default.profraw
34
+ kith.profdata
35
+ profraw/
36
+
37
+ # ctest artifact directory (written when ctest runs from the source root)
38
+ Testing/
@@ -0,0 +1,108 @@
1
+ # Changelog
2
+
3
+ All notable changes to kith are documented in this file. The format is based
4
+ on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
5
+ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [1.0.0] - 2026-09-21
8
+
9
+ The first stable release of kith: a scalable server framework for real-time,
10
+ stateful multiplayer worlds. A C23 core owns the performance-critical systems
11
+ — transport, the io_uring reactor, spatial indexing, the world stream fabric,
12
+ and the simulation — and a Python layer hosts game logic, with C simulation
13
+ models as shared libraries plugging into the same ABI. The framework ships
14
+ one opinionated default runtime topology, the five-plane world stream fabric
15
+ (Sim, Fabric, Gateway, Coord, Control), built around interest management:
16
+ the world is divided into cells that publish state once, and gateways
17
+ subscribe to cells and compose a per-player view. Embedded and distributed
18
+ topologies run the same game code, the simulation is deterministic with
19
+ replay and hash-regression coverage, and guides for Python extension, C
20
+ simulation models, the wire protocol, operations, scaling, replay, and
21
+ agentic testing document the whole surface.
22
+
23
+ ### Scaling gates
24
+
25
+ Claims about scale are certified by two gate classes, with the certified
26
+ configuration part of the claim. The procedure lives in
27
+ `docs/guides/scaling_checklist.md`; the numbers here are the release
28
+ thresholds.
29
+
30
+ **dense-1000** (embedded, stress gate) — 1000 actors on one embedded server:
31
+ `session_ok >= 99%`, `selected_clients >= 95%`, `bootstrap_ms_p95 < 3000 ms`,
32
+ no crash or corruption. Delivery-fidelity metrics are reported, not
33
+ thresholded: the embedded single-cell pileup is the adversarial case, not
34
+ the topology the fidelity claim is made for.
35
+
36
+ **distributed-2000** (fidelity gate) — 2000 actors across two server
37
+ instances, per instance: `session_ok >= 99%`, `selected_clients >= 95%`,
38
+ `move_missing_ratio_certified < 10%`, `bootstrap_ms_p95 < 3000 ms`, no
39
+ continuity flicker. The certified move-missing reading is the
40
+ publisher-minted `update_seq` delta between self echoes; the event-count
41
+ metric is reported alongside it and floors under saturation.
42
+
43
+ The certified configuration: free-threaded CPython 3.14t (GIL disabled),
44
+ the native C movement-apply path, two delivery-executor workers, one load
45
+ driver per instance cohort, pinned cores per the recorded reference
46
+ envelope. The per-operation budgets and the per-instance capacity model
47
+ that records both apply-path regimes live in
48
+ `docs/architecture/performance_budgets.md`.
49
+
50
+ The release certification ran on the release tree under this configuration
51
+ on the recorded reference host, 2026-09-21: distributed-2000 twice
52
+ back-to-back, both passing every threshold per instance — session_ok
53
+ 100.00%, selected_clients 100.00% of 2000 eligible,
54
+ move_missing_ratio_certified 0.00%, no continuity flicker, bootstrap_ms_p95
55
+ 304 ms and 331 ms — and dense-1000 once, passing its stress gate
56
+ (session_ok 100.00%, selected_clients 100.00% of 996 eligible,
57
+ bootstrap_ms_p95 470 ms; its delivery-fidelity readings are the
58
+ reported-not-thresholded dense semantics described above).
59
+
60
+ ### Out-of-box visual example
61
+
62
+ The released wheel ships a runnable example alongside the library:
63
+ `kith.examples.visual` boots an embedded-topology world — a seamless plain,
64
+ ambient actors under the same momentum model the players use, cell-scoped
65
+ chat, a metrics route — with one command and no written code, and the
66
+ console entry point `kith-visual` lists and launches its scenarios (crowd,
67
+ density, churn, membership, reconnect, tick ladder, soak). The graphical
68
+ client renders the world through the certified harness client engine and
69
+ carries the measurement HUD — per-actor staleness, arrival jitter, input
70
+ echo, the snap-event log, and the live delivery counters; its window
71
+ renderer rides an opt-in extra, so the base install stays dependency-free.
72
+ The agentic client engine itself moved into the package under a private
73
+ home, re-exported at its existing tooling path, so the shipped example and
74
+ the certified harness drive one implementation.
75
+
76
+ ### Known residuals
77
+
78
+ Measured, sub-threshold, and named — statements of scope, not open defects:
79
+
80
+ - The single-driver load-driver configuration still shows occasional
81
+ sub-threshold delivery pauses at roughly half their measured amplitude
82
+ (one asyncio loop driving the full cohort delays the movement cadence).
83
+ The certified recipe runs one driver process per instance cohort, and
84
+ the certified runs read zero continuity flicker.
85
+ - The gateway delivery executor's batch-release pause is measured in gate
86
+ traces; the pause has no attributed trigger.
87
+ - Gate-run fidelity ledgers exist in two formats; numbers from the earlier
88
+ format are not directly comparable with later runs. The scaling guide's
89
+ measurement caveats carry the boundary.
90
+ - The distributed gate certifies horizontal scaling: one server process
91
+ per instance with per-instance loopback coordination buses. Cross-machine
92
+ coordination transport is not part of the certified claim; the
93
+ `KITH_COORD_BUS_TRANSPORT` enum's additive extension point is the seam
94
+ for it.
95
+ - On the Python movement-apply path, per-instance fidelity holds to roughly
96
+ 300 clients per instance before compose-budget deferrals breach the
97
+ missing-move bar; the native C apply path — the certified configuration —
98
+ reads 0.00% at 1000 per instance. The capacity model records both regimes
99
+ and what raises each.
100
+
101
+ ### Platform
102
+
103
+ kith is Linux-only. The reactor runs on io_uring; the build links
104
+ `liburing`, `libpq`, and `libhiredis`; release wheels bundle the framework's
105
+ own shared libraries and keep those three dynamically linked. Production
106
+ builds are expected to compile with the hardening flags the project ships
107
+ (full RELRO, stack protector, `-D_FORTIFY_SOURCE=3`, PIE, CFI where the
108
+ toolchain supports it).
@@ -0,0 +1,154 @@
1
+ cmake_minimum_required(VERSION 4.4)
2
+
3
+ # The project version is the single source of truth that flows to every
4
+ # consumer channel: the library SONAMEs (kith_apply_abi reads
5
+ # PROJECT_VERSION), the pkg-config .pc file (Version:), the CMake package
6
+ # version file (write_basic_package_version), and the find_package(kith
7
+ # VERSION ...) check a downstream project issues. It tracks the release
8
+ # target the release infrastructure in this cluster produces.
9
+ project(kith VERSION 1.0.0 LANGUAGES C)
10
+
11
+ set(CMAKE_C_STANDARD 23)
12
+ set(CMAKE_C_STANDARD_REQUIRED ON)
13
+ set(CMAKE_C_EXTENSIONS OFF)
14
+
15
+ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
16
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
17
+ set(CMAKE_C_VISIBILITY_PRESET hidden)
18
+
19
+ # GNUInstallDirs provides CMAKE_INSTALL_LIBDIR / INCLUDEDIR / etc. Used by
20
+ # the per-library install(TARGETS EXPORT kithTargets) calls in
21
+ # cmake/lib_*.cmake and by the find_package / pkg-config consumer block at
22
+ # the bottom of this file; included here so the lib_*.cmake fragments pick
23
+ # up the variables without each re-including it (the local re-includes are
24
+ # idempotent and document each fragment's dependency).
25
+ include(GNUInstallDirs)
26
+
27
+ # Framework-wide conventions: warnings, hardening, visibility, sanitizers,
28
+ # abi helpers, linker/LTO/reproducible-build settings.
29
+ # framework.cmake is the single source of truth and includes the rest.
30
+ include(cmake/framework.cmake)
31
+
32
+ # Per-module shared-library targets. Each lib_<module>.cmake fragment
33
+ # defines one layer-2 SHARED library and its install rules; framework.cmake
34
+ # supplies the kith_apply_abi helper they all use.
35
+ include(cmake/lib_util.cmake)
36
+ include(cmake/lib_config.cmake)
37
+ include(cmake/lib_logger.cmake)
38
+ include(cmake/lib_metrics.cmake)
39
+ include(cmake/lib_proto.cmake)
40
+ include(cmake/lib_net.cmake)
41
+ include(cmake/lib_reactor.cmake)
42
+ include(cmake/lib_worker.cmake)
43
+ include(cmake/lib_state.cmake)
44
+ include(cmake/lib_db.cmake)
45
+ include(cmake/lib_client.cmake)
46
+ include(cmake/lib_sim.cmake)
47
+ include(cmake/lib_fabric.cmake)
48
+ include(cmake/lib_aoi.cmake)
49
+ include(cmake/lib_gateway.cmake)
50
+ include(cmake/lib_coord.cmake)
51
+ # The control plane is an optional layer-2 library. When
52
+ # CONTROL_PLANE_ENABLED is OFF the library is not built and contributes
53
+ # zero code to the build (no source-level #ifdef guards; the library is
54
+ # simply absent from the build).
55
+ option(CONTROL_PLANE_ENABLED "Build the control plane library (HTTP/WS introspection)" ON)
56
+ if(CONTROL_PLANE_ENABLED)
57
+ include(cmake/lib_control.cmake)
58
+ endif()
59
+ # Composition root. The server is the single layer-3 library a game links
60
+ # against; it wires every plane library above and must be included after
61
+ # them (and after the optional control block) so their targets exist.
62
+ include(cmake/lib_server.cmake)
63
+
64
+
65
+ # Per-checker build targets (check-layout-consistency, check-clang-tidy, ...,
66
+ # check-all). Each runs the corresponding tools/*.py checker (or clang-tidy /
67
+ # clang-format) and fails the build on a violation. The format/verify split
68
+ # targets (`format`, the single fix entry point, plus the verify-only
69
+ # check-ruff-format / check-ruff / check-trivial-fixers targets that check-all
70
+ # depends on) come from the same dev toolchain: both fragments drive the
71
+ # tools/*.py checkers, the scripts/ helpers, and git ls-files, and both
72
+ # fail at use when one of their tools is missing. The full checkout ships
73
+ # tools/ and scripts/ together; a source distribution carries only the
74
+ # build inputs, so the fragments are included only when tools/ is present.
75
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tools")
76
+ include(cmake/checks.cmake)
77
+ include(cmake/format.cmake)
78
+ endif()
79
+
80
+ # C unit tests. enable_testing() must appear at the top level so ctest
81
+ # discovers tests registered by the tests/c subdirectory. The optional
82
+ # subtrees below exist only in a full checkout; a source distribution ships
83
+ # the build inputs alone, so each is composed only when its CMakeLists is
84
+ # present.
85
+ enable_testing()
86
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/c/CMakeLists.txt")
87
+ add_subdirectory(tests/c)
88
+ endif()
89
+
90
+ # libFuzzer targets. Built only when KITH_ENABLE_FUZZ is set (the fuzz
91
+ # preset); the subdirectory hard-fails on non-Clang compilers because
92
+ # libFuzzer ships with Clang alone.
93
+ if(KITH_ENABLE_FUZZ)
94
+ add_subdirectory(tests/fuzz)
95
+ endif()
96
+
97
+ # Examples. The C boots link against the composition root (kith_server) so
98
+ # the example executables exercise the public server surface end-to-end; the
99
+ # Python examples are plain modules run by pytest or `python -m`.
100
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/examples/CMakeLists.txt")
101
+ add_subdirectory(examples)
102
+ endif()
103
+
104
+ # Perf tooling: the C-native bench driver links the layer-2 sim + fabric
105
+ # libraries directly (no composition root; the bench measures the raw
106
+ # publish path, not the server wiring).
107
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tools/CMakeLists.txt")
108
+ add_subdirectory(tools)
109
+ endif()
110
+
111
+
112
+ # --- Downstream consumer story: find_package(kith) + pkg-config -----------
113
+ # Every layer-2 (and the layer-3 composition root) library above installed
114
+ # with `EXPORT kithTargets`; this block assembles that export set into a
115
+ # CMake package a downstream finds with `find_package(kith 1.0.0 REQUIRED)`,
116
+ # and a pkg-config .pc file a hand-written Makefile or autotools consumer
117
+ # queries with `pkg-config --cflags --libs kith`. The version flowing into
118
+ # both channels is PROJECT_VERSION (set above), so the SONAME, the pkg-config
119
+ # Version, the find_package version check, and the kith_apply_abi SOVERSION
120
+ # all read from one source.
121
+ include(GNUInstallDirs)
122
+ include(CMakePackageConfigHelpers)
123
+
124
+ install(EXPORT kithTargets
125
+ FILE kithTargets.cmake
126
+ NAMESPACE kith::
127
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/kith)
128
+
129
+ configure_package_config_file(
130
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/kithConfig.cmake.in
131
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/kithConfig.cmake
132
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/kith)
133
+
134
+ write_basic_package_version_file(
135
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/kithConfigVersion.cmake
136
+ VERSION ${PROJECT_VERSION}
137
+ COMPATIBILITY SameMajorVersion)
138
+
139
+ install(FILES
140
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/kithConfig.cmake
141
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/kithConfigVersion.cmake
142
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/kith)
143
+
144
+ # pkg-config .pc file. The template is processed with @-only substitution
145
+ # (the .pc format treats ${} as its own variable expansion), then installed
146
+ # to <prefix>/lib/pkgconfig/kith.pc where `pkg-config --modversion kith`
147
+ # finds it.
148
+ configure_file(
149
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/kith.pc.in
150
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/kith.pc
151
+ @ONLY)
152
+ install(FILES
153
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/kith.pc
154
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
@@ -0,0 +1,187 @@
1
+ {
2
+ "version": 6,
3
+ "cmakeMinimumRequired": {
4
+ "major": 4,
5
+ "minor": 4,
6
+ "patch": 0
7
+ },
8
+ "configurePresets": [
9
+ {
10
+ "name": "_base",
11
+ "hidden": true,
12
+ "description": "Shared defaults: Ninja generator, Clang as the development compiler. Concrete presets inherit and add their own binaryDir and cacheVariables.",
13
+ "generator": "Ninja",
14
+ "environment": {
15
+ "CC": "clang"
16
+ }
17
+ },
18
+ {
19
+ "name": "debug",
20
+ "displayName": "Debug (default development)",
21
+ "description": "Unoptimized build with full debug info. No LTO. _FORTIFY_SOURCE is disabled for this preset: fortification requires optimization and is inert here. All other hardening flags remain active. The preset used for day-to-day development and the default for ctest.",
22
+ "inherits": "_base",
23
+ "binaryDir": "${sourceDir}/build/debug",
24
+ "cacheVariables": {
25
+ "CMAKE_BUILD_TYPE": "Debug",
26
+ "KITH_ENABLE_FORTIFY": "OFF"
27
+ }
28
+ },
29
+ {
30
+ "name": "release",
31
+ "displayName": "Release (optimized + LTO)",
32
+ "description": "Optimized build with link-time optimization enabled. Used for CI, benchmarks, and release artifacts.",
33
+ "inherits": "_base",
34
+ "binaryDir": "${sourceDir}/build/release",
35
+ "cacheVariables": {
36
+ "CMAKE_BUILD_TYPE": "Release",
37
+ "CMAKE_INTERPROCEDURAL_OPTIMIZATION": "ON"
38
+ }
39
+ },
40
+ {
41
+ "name": "asan",
42
+ "displayName": "AddressSanitizer",
43
+ "description": "Debug build with AddressSanitizer. _FORTIFY_SOURCE is disabled for this preset by cmake/sanitizers.cmake; all other hardening flags remain active.",
44
+ "inherits": "_base",
45
+ "binaryDir": "${sourceDir}/build/asan",
46
+ "cacheVariables": {
47
+ "CMAKE_BUILD_TYPE": "Debug",
48
+ "KITH_ENABLE_ASAN": "ON"
49
+ }
50
+ },
51
+ {
52
+ "name": "asan-ubsan",
53
+ "displayName": "AddressSanitizer + UndefinedBehaviorSanitizer",
54
+ "description": "Debug build with AddressSanitizer and UndefinedBehaviorSanitizer. UBSan findings abort instead of printing and continuing (cmake/sanitizers.cmake), so ctest fails on the first report; leak detection runs as part of ASan on Linux. _FORTIFY_SOURCE is disabled for this preset; all other hardening flags remain active. The preset behind the weekly sanitizer workflow.",
55
+ "inherits": "_base",
56
+ "binaryDir": "${sourceDir}/build/asan-ubsan",
57
+ "cacheVariables": {
58
+ "CMAKE_BUILD_TYPE": "Debug",
59
+ "KITH_ENABLE_ASAN": "ON",
60
+ "KITH_ENABLE_UBSAN": "ON"
61
+ }
62
+ },
63
+ {
64
+ "name": "tsan",
65
+ "displayName": "ThreadSanitizer",
66
+ "description": "Debug build with ThreadSanitizer for data-race detection. _FORTIFY_SOURCE is disabled for this preset by cmake/sanitizers.cmake. The weekly sanitizer lane's tsan job drives the preset over the C test suite: reports collect a full census without halting, and the run exits nonzero through ThreadSanitizer's default exit code.",
67
+ "inherits": "_base",
68
+ "binaryDir": "${sourceDir}/build/tsan",
69
+ "cacheVariables": {
70
+ "CMAKE_BUILD_TYPE": "Debug",
71
+ "KITH_ENABLE_TSAN": "ON"
72
+ }
73
+ },
74
+ {
75
+ "name": "coverage",
76
+ "displayName": "Coverage",
77
+ "description": "Debug build with coverage instrumentation (lcov / llvm-cov). _FORTIFY_SOURCE is disabled for this preset: fortification requires optimization and is inert here. All other hardening flags remain active. Coverage is reported in CI but not gated.",
78
+ "inherits": "_base",
79
+ "binaryDir": "${sourceDir}/build/coverage",
80
+ "cacheVariables": {
81
+ "CMAKE_BUILD_TYPE": "Debug",
82
+ "KITH_ENABLE_COVERAGE": "ON",
83
+ "KITH_ENABLE_FORTIFY": "OFF"
84
+ }
85
+ },
86
+ {
87
+ "name": "fuzz",
88
+ "displayName": "libFuzzer (Clang)",
89
+ "description": "Debug build with libFuzzer instrumentation for protocol-decoder fuzzing. libFuzzer requires Clang, so the _base CC=clang is essential here. Runs AddressSanitizer alongside the fuzzer by default.",
90
+ "inherits": "_base",
91
+ "binaryDir": "${sourceDir}/build/fuzz",
92
+ "cacheVariables": {
93
+ "CMAKE_BUILD_TYPE": "Debug",
94
+ "KITH_ENABLE_FUZZ": "ON",
95
+ "KITH_ENABLE_ASAN": "ON"
96
+ }
97
+ }
98
+ ],
99
+ "buildPresets": [
100
+ {
101
+ "name": "debug",
102
+ "configurePreset": "debug"
103
+ },
104
+ {
105
+ "name": "release",
106
+ "configurePreset": "release"
107
+ },
108
+ {
109
+ "name": "asan",
110
+ "configurePreset": "asan"
111
+ },
112
+ {
113
+ "name": "asan-ubsan",
114
+ "configurePreset": "asan-ubsan"
115
+ },
116
+ {
117
+ "name": "tsan",
118
+ "configurePreset": "tsan"
119
+ },
120
+ {
121
+ "name": "coverage",
122
+ "configurePreset": "coverage"
123
+ },
124
+ {
125
+ "name": "fuzz",
126
+ "configurePreset": "fuzz"
127
+ }
128
+ ],
129
+ "testPresets": [
130
+ {
131
+ "name": "debug",
132
+ "configurePreset": "debug",
133
+ "output": {
134
+ "outputOnFailure": true
135
+ }
136
+ },
137
+ {
138
+ "name": "release",
139
+ "configurePreset": "release",
140
+ "output": {
141
+ "outputOnFailure": true
142
+ }
143
+ },
144
+ {
145
+ "name": "asan",
146
+ "configurePreset": "asan",
147
+ "output": {
148
+ "outputOnFailure": true
149
+ }
150
+ },
151
+ {
152
+ "name": "asan-ubsan",
153
+ "configurePreset": "asan-ubsan",
154
+ "environment": {
155
+ "ASAN_OPTIONS": "detect_leaks=1",
156
+ "UBSAN_OPTIONS": "print_stacktrace=1:halt_on_error=1"
157
+ },
158
+ "output": {
159
+ "outputOnFailure": true
160
+ }
161
+ },
162
+ {
163
+ "name": "tsan",
164
+ "configurePreset": "tsan",
165
+ "environment": {
166
+ "TSAN_OPTIONS": "second_deadlock_stack=1"
167
+ },
168
+ "output": {
169
+ "outputOnFailure": true
170
+ }
171
+ },
172
+ {
173
+ "name": "coverage",
174
+ "configurePreset": "coverage",
175
+ "output": {
176
+ "outputOnFailure": true
177
+ }
178
+ },
179
+ {
180
+ "name": "fuzz",
181
+ "configurePreset": "fuzz",
182
+ "output": {
183
+ "outputOnFailure": true
184
+ }
185
+ }
186
+ ]
187
+ }