@wenathlan/saddle 2.0.153 → 2.0.155

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 (307) hide show
  1. package/Dockerfile +139 -55
  2. package/README.md +58 -59
  3. package/browser.ts +482 -0
  4. package/cli.ts +274 -0
  5. package/distribution.ts +731 -0
  6. package/docker.config +29 -8
  7. package/docs/artifactavailability.md +2 -2
  8. package/docs/browser.md +18 -1
  9. package/docs/{containerplatforms.2.1.0.md → containerplatforms210.md} +1 -1
  10. package/docs/{documentmap.1.8.12.md → documentmap1812.md} +1 -1
  11. package/docs/extension.md +13 -2
  12. package/docs/libraryapi.md +1 -1
  13. package/docs/{ninety.modalities.md → ninetymodalities.md} +87 -4
  14. package/docs/{planning.ninety.md → planningninety.md} +6 -6
  15. package/docs/{releasenotes.1.8.13.md → releasenotes1813.md} +2 -2
  16. package/docs/{releasenotes.1.8.14.md → releasenotes1814.md} +1 -1
  17. package/docs/{repo.synthesis.1.8.16.md → reposynthesis1816.md} +1 -1
  18. package/docs/todo.md +2 -2
  19. package/docs/{todo.1.8.15.md → todo1815.md} +1 -1
  20. package/docs/{todo.1.8.16.md → todo1816.md} +5 -5
  21. package/execution.ts +677 -0
  22. package/foundation.ts +314 -0
  23. package/index.ts +35 -27
  24. package/isolation.ts +84 -0
  25. package/modes.ts +170 -0
  26. package/mttg.config +1 -1
  27. package/orchestrator.ts +49 -15
  28. package/package.json +90 -75
  29. package/qemu.config +2 -2
  30. package/sandbox.ts +2094 -0
  31. package/scheduler.ts +1 -1
  32. package/server.ts +52 -0
  33. package/tsconfig.json +11 -12
  34. package/virtual.ts +1105 -0
  35. package/virtualgpu.ts +1 -1
  36. package/virtualization.ts +1 -1
  37. package/workloadlaw.ts +293 -0
  38. package/dist/App.d.ts +0 -5
  39. package/dist/App.js +0 -52
  40. package/dist/Sol/Sol.d.ts +0 -3
  41. package/dist/Sol/Sol.js +0 -46
  42. package/dist/Sol/agentbrowser/agentbrowser.d.ts +0 -9
  43. package/dist/Sol/agentbrowser/agentbrowser.js +0 -121
  44. package/dist/Sol/architecture/architecture.d.ts +0 -9
  45. package/dist/Sol/architecture/architecture.js +0 -93
  46. package/dist/Sol/compute/compute.d.ts +0 -9
  47. package/dist/Sol/compute/compute.js +0 -22
  48. package/dist/Sol/console/console.d.ts +0 -15
  49. package/dist/Sol/console/console.js +0 -292
  50. package/dist/Sol/dashboard/dashboard.d.ts +0 -10
  51. package/dist/Sol/dashboard/dashboard.js +0 -181
  52. package/dist/Sol/docs/docs.d.ts +0 -9
  53. package/dist/Sol/docs/docs.js +0 -28
  54. package/dist/Sol/home/home.d.ts +0 -35
  55. package/dist/Sol/home/home.js +0 -239
  56. package/dist/Sol/integrations/integrations.d.ts +0 -9
  57. package/dist/Sol/integrations/integrations.js +0 -83
  58. package/dist/Sol/intro/intro.d.ts +0 -7
  59. package/dist/Sol/intro/intro.js +0 -102
  60. package/dist/Sol/login/login.d.ts +0 -16
  61. package/dist/Sol/login/login.js +0 -49
  62. package/dist/Sol/notfound/notfound.d.ts +0 -9
  63. package/dist/Sol/notfound/notfound.js +0 -15
  64. package/dist/Sol/onboarding/onboarding.d.ts +0 -25
  65. package/dist/Sol/onboarding/onboarding.js +0 -60
  66. package/dist/Sol/playground/playground.d.ts +0 -9
  67. package/dist/Sol/playground/playground.js +0 -127
  68. package/dist/Sol/register/register.d.ts +0 -16
  69. package/dist/Sol/register/register.js +0 -193
  70. package/dist/Sol/shell/Shell.d.ts +0 -124
  71. package/dist/Sol/shell/Shell.js +0 -335
  72. package/dist/Sol/wingets/ComputeBootladder.d.ts +0 -6
  73. package/dist/Sol/wingets/ComputeBootladder.js +0 -71
  74. package/dist/Sol/wingets/ComputeModalitycatalog.d.ts +0 -7
  75. package/dist/Sol/wingets/ComputeModalitycatalog.js +0 -71
  76. package/dist/Sol/wingets/ConsoleApibadge.d.ts +0 -7
  77. package/dist/Sol/wingets/ConsoleApibadge.js +0 -5
  78. package/dist/Sol/wingets/ConsoleEdgelaw.d.ts +0 -6
  79. package/dist/Sol/wingets/ConsoleEdgelaw.js +0 -36
  80. package/dist/Sol/wingets/ConsoleEventstimeline.d.ts +0 -19
  81. package/dist/Sol/wingets/ConsoleEventstimeline.js +0 -12
  82. package/dist/Sol/wingets/ConsoleSnapshotcontrols.d.ts +0 -8
  83. package/dist/Sol/wingets/ConsoleSnapshotcontrols.js +0 -8
  84. package/dist/Sol/wingets/ConsoleSpecpanel.d.ts +0 -21
  85. package/dist/Sol/wingets/ConsoleSpecpanel.js +0 -75
  86. package/dist/Sol/wingets/ConsoleTerminal.d.ts +0 -22
  87. package/dist/Sol/wingets/ConsoleTerminal.js +0 -77
  88. package/dist/Sol/wingets/DashboardAccountpanel.d.ts +0 -18
  89. package/dist/Sol/wingets/DashboardAccountpanel.js +0 -65
  90. package/dist/Sol/wingets/DashboardAdminpanel.d.ts +0 -6
  91. package/dist/Sol/wingets/DashboardAdminpanel.js +0 -90
  92. package/dist/Sol/wingets/DashboardAuditlog.d.ts +0 -8
  93. package/dist/Sol/wingets/DashboardAuditlog.js +0 -50
  94. package/dist/Sol/wingets/DashboardCreatesandboxform.d.ts +0 -10
  95. package/dist/Sol/wingets/DashboardCreatesandboxform.js +0 -71
  96. package/dist/Sol/wingets/DashboardEventstimeline.d.ts +0 -8
  97. package/dist/Sol/wingets/DashboardEventstimeline.js +0 -83
  98. package/dist/Sol/wingets/DashboardGlobalsandboxestable.d.ts +0 -8
  99. package/dist/Sol/wingets/DashboardGlobalsandboxestable.js +0 -57
  100. package/dist/Sol/wingets/DashboardMeshnodestable.d.ts +0 -8
  101. package/dist/Sol/wingets/DashboardMeshnodestable.js +0 -103
  102. package/dist/Sol/wingets/DashboardSandboxlist.d.ts +0 -10
  103. package/dist/Sol/wingets/DashboardSandboxlist.js +0 -163
  104. package/dist/Sol/wingets/DashboardUserstable.d.ts +0 -8
  105. package/dist/Sol/wingets/DashboardUserstable.js +0 -78
  106. package/dist/Sol/wingets/HomeEntrygate.d.ts +0 -23
  107. package/dist/Sol/wingets/HomeEntrygate.js +0 -73
  108. package/dist/Sol/wingets/HomeMetricstrip.d.ts +0 -9
  109. package/dist/Sol/wingets/HomeMetricstrip.js +0 -4
  110. package/dist/Sol/wingets/HomeRuntimediagram.d.ts +0 -1
  111. package/dist/Sol/wingets/HomeRuntimediagram.js +0 -22
  112. package/dist/Sol/wingets/LoginForm.d.ts +0 -19
  113. package/dist/Sol/wingets/LoginForm.js +0 -141
  114. package/dist/Sol/wingets/RegisterPasswordconfirm.d.ts +0 -13
  115. package/dist/Sol/wingets/RegisterPasswordconfirm.js +0 -16
  116. package/dist/Sol/wingets/RegisterPasswordmeter.d.ts +0 -19
  117. package/dist/Sol/wingets/RegisterPasswordmeter.js +0 -65
  118. package/dist/Sol/wingets/RegisterUsernamerules.d.ts +0 -11
  119. package/dist/Sol/wingets/RegisterUsernamerules.js +0 -16
  120. package/dist/Sol/wingets/index.d.ts +0 -39
  121. package/dist/Sol/wingets/index.js +0 -39
  122. package/dist/alternatives.d.ts +0 -508
  123. package/dist/alternatives.js +0 -950
  124. package/dist/api.d.ts +0 -154
  125. package/dist/api.js +0 -174
  126. package/dist/auth.d.ts +0 -268
  127. package/dist/auth.js +0 -476
  128. package/dist/automation.d.ts +0 -425
  129. package/dist/automation.js +0 -566
  130. package/dist/browser.d.ts +0 -561
  131. package/dist/browser.js +0 -1058
  132. package/dist/capacitor.config.d.ts +0 -45
  133. package/dist/capacitor.config.js +0 -48
  134. package/dist/catalog.d.ts +0 -43
  135. package/dist/catalog.js +0 -44
  136. package/dist/cli.d.ts +0 -16
  137. package/dist/cli.js +0 -168
  138. package/dist/communication.d.ts +0 -181
  139. package/dist/communication.js +0 -376
  140. package/dist/compute.d.ts +0 -1160
  141. package/dist/compute.js +0 -2272
  142. package/dist/dashboardlib.d.ts +0 -58
  143. package/dist/dashboardlib.js +0 -161
  144. package/dist/db.d.ts +0 -569
  145. package/dist/db.js +0 -1080
  146. package/dist/distribution.d.ts +0 -528
  147. package/dist/distribution.js +0 -810
  148. package/dist/drizzle.config.d.ts +0 -20
  149. package/dist/drizzle.config.js +0 -18
  150. package/dist/edgelandes.d.ts +0 -70
  151. package/dist/edgelandes.host.d.ts +0 -26
  152. package/dist/edgelandes.host.js +0 -1089
  153. package/dist/edgelandes.inproc.d.ts +0 -27
  154. package/dist/edgelandes.inproc.js +0 -952
  155. package/dist/edgelandes.js +0 -1133
  156. package/dist/edgelandes.ninety.d.ts +0 -31
  157. package/dist/edgelandes.ninety.js +0 -174
  158. package/dist/edgelandes.virtual.d.ts +0 -25
  159. package/dist/edgelandes.virtual.js +0 -629
  160. package/dist/edgeplane.d.ts +0 -114
  161. package/dist/edgeplane.js +0 -305
  162. package/dist/examplelocaljob.d.ts +0 -1
  163. package/dist/examplelocaljob.js +0 -14
  164. package/dist/execution.d.ts +0 -529
  165. package/dist/execution.js +0 -760
  166. package/dist/family.d.ts +0 -16
  167. package/dist/family.js +0 -42
  168. package/dist/familyurl.d.ts +0 -21
  169. package/dist/familyurl.js +0 -24
  170. package/dist/format.d.ts +0 -18
  171. package/dist/format.js +0 -59
  172. package/dist/foundation.d.ts +0 -172
  173. package/dist/foundation.js +0 -312
  174. package/dist/index.d.ts +0 -735
  175. package/dist/index.js +0 -1020
  176. package/dist/integration.d.ts +0 -235
  177. package/dist/integration.js +0 -228
  178. package/dist/intelligence.d.ts +0 -93
  179. package/dist/intelligence.js +0 -144
  180. package/dist/isolation.d.ts +0 -128
  181. package/dist/isolation.js +0 -95
  182. package/dist/labels.d.ts +0 -665
  183. package/dist/labels.js +0 -751
  184. package/dist/localauth.d.ts +0 -127
  185. package/dist/localauth.js +0 -413
  186. package/dist/media.d.ts +0 -343
  187. package/dist/media.js +0 -985
  188. package/dist/mesh.d.ts +0 -177
  189. package/dist/mesh.js +0 -468
  190. package/dist/modalityregistry.d.ts +0 -109
  191. package/dist/modalityregistry.js +0 -1386
  192. package/dist/modes.d.ts +0 -358
  193. package/dist/modes.js +0 -133
  194. package/dist/onboardingstate.d.ts +0 -79
  195. package/dist/onboardingstate.js +0 -282
  196. package/dist/orchestrator.d.ts +0 -1338
  197. package/dist/orchestrator.js +0 -4310
  198. package/dist/packager/targetcli.js +0 -4
  199. package/dist/paths.d.ts +0 -2
  200. package/dist/paths.js +0 -14
  201. package/dist/performance.d.ts +0 -415
  202. package/dist/performance.js +0 -826
  203. package/dist/quantum.d.ts +0 -809
  204. package/dist/quantum.js +0 -2072
  205. package/dist/render.d.ts +0 -380
  206. package/dist/render.js +0 -1072
  207. package/dist/runall.d.ts +0 -2
  208. package/dist/runall.js +0 -39
  209. package/dist/runtimeprobe.d.ts +0 -4
  210. package/dist/runtimeprobe.js +0 -8
  211. package/dist/sandbox.d.ts +0 -355
  212. package/dist/sandbox.js +0 -1721
  213. package/dist/sandboxenvprofile.d.ts +0 -29
  214. package/dist/sandboxenvprofile.js +0 -89
  215. package/dist/sandboxprofile.d.ts +0 -137
  216. package/dist/sandboxprofile.js +0 -241
  217. package/dist/sandboxqueue.d.ts +0 -108
  218. package/dist/sandboxqueue.js +0 -201
  219. package/dist/sandboxquota.d.ts +0 -121
  220. package/dist/sandboxquota.js +0 -236
  221. package/dist/scheduler.d.ts +0 -595
  222. package/dist/scheduler.js +0 -1258
  223. package/dist/scriptlanes.d.ts +0 -182
  224. package/dist/scriptlanes.js +0 -660
  225. package/dist/scripts.buildengine.d.ts +0 -1
  226. package/dist/scripts.buildengine.js +0 -39
  227. package/dist/scripts.securitygate.d.ts +0 -1
  228. package/dist/scripts.securitygate.js +0 -68
  229. package/dist/scripts.validateflatnative.d.ts +0 -1
  230. package/dist/scripts.validateflatnative.js +0 -72
  231. package/dist/security.d.ts +0 -500
  232. package/dist/security.js +0 -1169
  233. package/dist/seedcatalog.d.ts +0 -13
  234. package/dist/seedcatalog.js +0 -46
  235. package/dist/server.d.ts +0 -20
  236. package/dist/server.js +0 -53
  237. package/dist/speccatalog.d.ts +0 -31
  238. package/dist/speccatalog.js +0 -163
  239. package/dist/tiers.d.ts +0 -1001
  240. package/dist/tiers.js +0 -2169
  241. package/dist/utils.d.ts +0 -2
  242. package/dist/utils.js +0 -5
  243. package/dist/vaulthandoff.d.ts +0 -141
  244. package/dist/vaulthandoff.js +0 -444
  245. package/dist/virtual.d.ts +0 -640
  246. package/dist/virtual.js +0 -1284
  247. package/dist/virtualcpu.d.ts +0 -315
  248. package/dist/virtualcpu.js +0 -1180
  249. package/dist/virtualgpu.d.ts +0 -344
  250. package/dist/virtualgpu.js +0 -1000
  251. package/dist/virtualization.d.ts +0 -606
  252. package/dist/virtualization.js +0 -1186
  253. package/dist/virtualmemory.d.ts +0 -817
  254. package/dist/virtualmemory.js +0 -1795
  255. package/dist/vite.config.d.ts +0 -3
  256. package/dist/vite.config.js +0 -43
  257. package/dist/vitest.config.d.ts +0 -2
  258. package/dist/vitest.config.js +0 -25
  259. package/dist/webserver.d.ts +0 -166
  260. package/dist/webserver.js +0 -2226
  261. package/dist/workloadlaw.d.ts +0 -133
  262. package/dist/workloadlaw.js +0 -193
  263. package/manifest.json +0 -20
  264. package/media.ts +0 -1337
  265. /package/docs/{architecture.1.8.19.md → architecture1819.md} +0 -0
  266. /package/docs/{architecture.1.8.19.mmd → architecture1819.mmd} +0 -0
  267. /package/docs/{artifactresearch.1.8.9.md → artifactresearch189.md} +0 -0
  268. /package/docs/{batches.1816.to.1820.md → batches1816to1820.md} +0 -0
  269. /package/docs/{brancharchive.2026.08.18.md → brancharchive20260818.md} +0 -0
  270. /package/docs/{containerplatforms.1.8.17.md → containerplatforms1817.md} +0 -0
  271. /package/docs/{e2ugh.engine.md → e2ughengine.md} +0 -0
  272. /package/docs/{flatbuildresearch.1.8.11.md → flatbuildresearch1811.md} +0 -0
  273. /package/docs/{licenseaudit.1.8.12.md → licenseaudit1812.md} +0 -0
  274. /package/docs/{mobileconversionresearch.1.8.10.md → mobileconversionresearch1810.md} +0 -0
  275. /package/docs/{nativeidentityresearch.1.8.11.md → nativeidentityresearch1811.md} +0 -0
  276. /package/docs/{native.wrappers.md → nativewrappers.md} +0 -0
  277. /package/docs/{planning.1.8.18.md → planning1818.md} +0 -0
  278. /package/docs/{planning.1.8.19.md → planning1819.md} +0 -0
  279. /package/docs/{planning.engine.md → planningengine.md} +0 -0
  280. /package/docs/{releasenotes.1.8.12.md → releasenotes1812.md} +0 -0
  281. /package/docs/{releasenotes.1.8.15.md → releasenotes1815.md} +0 -0
  282. /package/docs/{releasenotes.1.8.16.md → releasenotes1816.md} +0 -0
  283. /package/docs/{releasenotes.1.8.17.md → releasenotes1817.md} +0 -0
  284. /package/docs/{releasenotes.1.8.18.md → releasenotes1818.md} +0 -0
  285. /package/docs/{releasenotes.1.8.19.md → releasenotes1819.md} +0 -0
  286. /package/docs/{reorganization.1.8.8.md → reorganization188.md} +0 -0
  287. /package/docs/{reorganization.1.8.9.md → reorganization189.md} +0 -0
  288. /package/docs/{repo.analysis.1.8.21.json → repoanalysis1821.json} +0 -0
  289. /package/docs/{repo.candidates.1.8.21.jsonl → repocandidates1821.jsonl} +0 -0
  290. /package/docs/{repo.research.1.8.16.md → reporesearch1816.md} +0 -0
  291. /package/docs/{repo.research.1.8.21.md → reporesearch1821.md} +0 -0
  292. /package/docs/{repo.selected.1.8.21.json → reposelected1821.json} +0 -0
  293. /package/docs/{repo.synthesis.1.8.21.md → reposynthesis1821.md} +0 -0
  294. /package/docs/{research.1.8.18.isolation.md → research1818isolation.md} +0 -0
  295. /package/docs/{research.1.8.19.virtual.browser.md → research1819virtualbrowser.md} +0 -0
  296. /package/docs/{scanningresearch.1.8.11.md → scanningresearch1811.md} +0 -0
  297. /package/docs/{securityaudit.1.8.7.md → securityaudit187.md} +0 -0
  298. /package/docs/{securityreferences.1.8.11.md → securityreferences1811.md} +0 -0
  299. /package/docs/{securityresearch.1.8.11.md → securityresearch1811.md} +0 -0
  300. /package/docs/{signingresearch.1.8.12.md → signingresearch1812.md} +0 -0
  301. /package/docs/{tauri.glib.risk.1.8.11.md → tauriglibrisk1811.md} +0 -0
  302. /package/docs/{todo.1.8.18.md → todo1818.md} +0 -0
  303. /package/docs/{todo.1.8.19.md → todo1819.md} +0 -0
  304. /package/docs/{toolchainresearch.1.8.9.md → toolchainresearch189.md} +0 -0
  305. /package/docs/{web.duplicatecleanup.md → webduplicatecleanup.md} +0 -0
  306. /package/docs/{web.ideas.md → webideas.md} +0 -0
  307. /package/docs/{workflowimprovements.2026.08.19.md → workflowimprovements20260819.md} +0 -0
@@ -1,4 +0,0 @@
1
- // generated by scripts.buildengine.ts - the thin CLI wrapper that
2
- // activates the target manifest CLI absorbed into distribution.ts
3
- // (Section 7); its CLI main runs when argv[1] ends with targetcli.js.
4
- import "../distribution.js";
package/dist/paths.d.ts DELETED
@@ -1,2 +0,0 @@
1
- /** Builds a public URL without depending on a trailing slash in Vite's base value. */
2
- export declare function assetpath(relativepath: string): string;
package/dist/paths.js DELETED
@@ -1,14 +0,0 @@
1
- /** Resolves public asset paths for root hosting and repository subpath hosting. */
2
- const rawbaseurl = import.meta.env.BASE_URL || '/';
3
- // A relative base ("./") must survive as the relative prefix — folding it into
4
- // a domain-absolute path ("/./") would resolve against the host root and miss
5
- // the application subpath on static hosting.
6
- const baseurl = rawbaseurl === './'
7
- ? './'
8
- : rawbaseurl === '/'
9
- ? '/'
10
- : `/${rawbaseurl.replace(/^\/+|\/+$/g, '')}/`;
11
- /** Builds a public URL without depending on a trailing slash in Vite's base value. */
12
- export function assetpath(relativepath) {
13
- return `${baseurl}${relativepath.replace(/^\/+/, '')}`;
14
- }
@@ -1,415 +0,0 @@
1
- /**
2
- * performance.ts - Virtual Hardware Engine v5
3
- *
4
- * Seven composable optimization layers plus a measurement harness: percentile
5
- * metrics (p50/p95/p99), regression detection and profile mode. Every layer
6
- * emits a concrete patch (environment variables, process arguments, docker
7
- * flags, planned kernel writes) so the same code drives local runs, CI jobs
8
- * and documentation.
9
- *
10
- * Layer index:
11
- * 1. cpu - AVX-512 vector width, LP thread saturation, OMP presets
12
- * 2. gpu - Rusticl OpenCL 3.1 virtual identity, lavapipe Vulkan 1.4, LP_PERF flags
13
- * 3. memory - unlimited swap, 2g shm, overcommit, KSM, 1G huge pages, tmpfs cache
14
- * 4. microvm - Firecracker warm pool (3-5ms restores, 150 VMs/s, <5 MiB per VM)
15
- * 5. tcg - QEMU 11.1 MTTCG, thread=multi, tb-size 1024, EPYC-v5, nitro accel
16
- * 6. build - buildx gha cache (103s to 25s measured), multi-stage, LLVM -O3
17
- * 7. network - keepalive, connection pooling, TAP pre-setup
18
- *
19
- * Related contexts covered by this file (25):
20
- * LLVMpipe, Gallivm, AVX-512, MR !17813, LP_MAX_THREADS, MR 31551, OpenMP,
21
- * Rusticl, OpenCL 3.1, RUSTICL_DEVICE_TYPE, lavapipe, Vulkan 1.4, LP_PERF,
22
- * Docker memory-swap, ShmSize, vm.overcommit_memory, KSM, huge pages, tmpfs,
23
- * Firecracker snapshots, QEMU MTTCG, buildx type=gha, LLVM -O3 -flto, undici
24
- * keepalive, TAP/tun devices.
25
- *
26
- * Module rules: no emoji, JSDoc in English, third-person voice, lowercase
27
- * identifiers, `using`/`satisfies`/`#private` modern TypeScript, node:* imports
28
- * first, try/catch on every fallible path, no hardcoded localhost endpoints.
29
- */
30
- import { EventEmitter } from 'node:events';
31
- /** Hardware facts a layer tunes against. */
32
- export interface LayerTarget {
33
- readonly cpus: number;
34
- readonly memoryGb: number;
35
- readonly gpus: number;
36
- readonly headless: boolean;
37
- }
38
- /** Concrete output of applying one layer to one target. */
39
- export interface LayerPatch {
40
- readonly layer: PerformanceLayerId;
41
- readonly env: Readonly<Record<string, string>>;
42
- readonly args: readonly string[];
43
- readonly dockerArgs: readonly string[];
44
- readonly kernelWrites: readonly {
45
- path: string;
46
- content: string;
47
- }[];
48
- readonly mounts: readonly string[];
49
- readonly notes: readonly string[];
50
- }
51
- /**
52
- * Identifies one of the seven tuning layers (cpu, gpu, memory, microvm,
53
- * tcg, build, network) addressed by the performance engine.
54
- */
55
- export type PerformanceLayerId = 'cpu' | 'gpu' | 'memory' | 'microvm' | 'tcg' | 'build' | 'network';
56
- /**
57
- * Contract every tuning layer implements: an id, a human title, the file
58
- * contexts the layer contributes to and the apply() that turns one target
59
- * into a concrete patch.
60
- */
61
- export interface PerformanceLayer {
62
- readonly id: PerformanceLayerId;
63
- readonly title: string;
64
- readonly contexts: readonly string[];
65
- apply(target: LayerTarget): LayerPatch;
66
- }
67
- /** Picks an ephemeral port for local listeners; never a hardcoded endpoint. */
68
- export declare function randomPort(): number;
69
- /** OMP thread presets the engine validates against (up to the 192c EPYC 9965). */
70
- export declare const ompPresets: readonly [1, 2, 4, 8, 16, 32, 64, 96, 128, 192];
71
- /**
72
- * Picks the largest OMP preset that does not exceed the available CPUs.
73
- * Presets exist so benchmark grids compare identical thread counts across
74
- * hosts (1, 2, 4, 8, 16, 32, 64, 96, 128, 192).
75
- */
76
- export declare function pickOmpThreads(cpus: number): number;
77
- /**
78
- * LLVMpipe rasterization threads: `LP_NUM_THREADS=0` selects every core
79
- * automatically, capped by the compile-time ceiling LP_MAX_THREADS=32 that
80
- * Mesa carries since MR 31551.
81
- */
82
- export declare function llvmpipeThreads(cpus: number): {
83
- envValue: string;
84
- effective: number;
85
- };
86
- /**
87
- * Layer 1/7 - CPU.
88
- * AVX-512 reaches LLVMpipe through Gallivm (MR !17813) with runtime CPU
89
- * detection; forcing LP_NATIVE_VECTOR_WIDTH=512 keeps the JIT on 512-bit
90
- * vectors for the whole process lifetime. MESA_NO_ERROR removes per-draw
91
- * error checks that pure-software rasterization does not need.
92
- */
93
- export declare class CpuLayer implements PerformanceLayer {
94
- #private;
95
- readonly id: 'cpu';
96
- readonly title = "CPU vector width and thread saturation";
97
- readonly contexts: string[];
98
- /** Docs note 128-bit JIT is occasionally faster; this switch supports A/B runs. */
99
- setVectorWidth(width: 128 | 256 | 512): this;
100
- apply(target: LayerTarget): LayerPatch;
101
- }
102
- /** Tuning profile switch for the LP_PERF no-op flags of LLVMpipe. */
103
- export type LlvmpipePerfProfile = 'balanced' | 'benchmark' | 'no-depth' | 'no-tex';
104
- /**
105
- * Layer 2/7 - GPU.
106
- * Presents the software rasterizer as a real GPU: Rusticl reports
107
- * CL_DEVICE_TYPE_GPU with OpenCL 3.1 (the Mesa 26.2 level), lavapipe serves
108
- * Vulkan 1.4, and the Vulkan loader selects the lavapipe ICD through
109
- * VK_DRIVER_FILES (VK_ICD_FILENAMES is deprecated in 2026 loaders).
110
- */
111
- export declare class GpuLayer implements PerformanceLayer {
112
- #private;
113
- readonly id: 'gpu';
114
- readonly title = "Rusticl GPU virtual identity and lavapipe Vulkan 1.4";
115
- readonly contexts: string[];
116
- setProfile(profile: LlvmpipePerfProfile): this;
117
- setIcdPath(path: string): this;
118
- apply(target: LayerTarget): LayerPatch;
119
- }
120
- /**
121
- * Plans the vm.overcommit_memory=2 (never overcommit) setting together with
122
- * the commit floor the engine reserves for guest memory backends.
123
- */
124
- export declare function planOvercommit(reserveGb: number): {
125
- path: string;
126
- content: string;
127
- rationale: string;
128
- };
129
- /** Plans Kernel Samepage Merging: deduplicates identical guest pages (N:N sandboxes share one kernel image). */
130
- export declare function planKsm(pagesToScan?: number, sleepMs?: number): {
131
- writes: {
132
- path: string;
133
- content: string;
134
- }[];
135
- expectedSaving: string;
136
- };
137
- /** Plans 1 GiB huge page reservations backing QEMU guest memory. */
138
- export declare function planHugePages1g(guestGb: number): {
139
- writes: {
140
- path: string;
141
- content: string;
142
- }[];
143
- bootArgs: string[];
144
- };
145
- /** Plans the 20G tmpfs that backs the Mesa shader cache in hot loops. */
146
- export declare function planShaderTmpfs(sizeGb?: number): {
147
- mounts: string[];
148
- env: Record<string, string>;
149
- };
150
- /**
151
- * Layer 3/7 - memory.
152
- * Docker runs with unlimited swap (--memory-swap -1) and 2g of shared memory
153
- * so PyTorch DataLoaders never bus-error; the kernel side enables strict
154
- * overcommit accounting, KSM dedup and 1 GiB huge pages, while a 20G tmpfs
155
- * keeps the shader cache entirely in RAM (tmpfs is up to 4x faster than
156
- * overlayfs on small files).
157
- */
158
- export declare class MemoryLayer implements PerformanceLayer {
159
- #private;
160
- readonly id: 'memory';
161
- readonly title = "unlimited swap, 2g shm, overcommit, KSM, huge pages, tmpfs cache";
162
- readonly contexts: string[];
163
- setShmSize(size: string): this;
164
- apply(target: LayerTarget): LayerPatch;
165
- }
166
- /**
167
- * Layer 4/7 - microVM.
168
- * Keeps Firecracker microVMs pre-restored from snapshots: acquiring a sandbox
169
- * costs one restore (3-5ms with File backend, ~1ms more with Uffd), each VM
170
- * stays under 5 MiB of overhead, and a host sustains roughly 150 microVM
171
- * creations per second. The pool refills in the background so bursts never
172
- * hit the cold path.
173
- */
174
- export declare class FirecrackerWarmPool extends EventEmitter implements PerformanceLayer, Disposable {
175
- #private;
176
- readonly id: 'microvm';
177
- readonly title = "Firecracker warm pool (3-5ms restores, 150 VMs/s, <5 MiB per VM)";
178
- readonly contexts: string[];
179
- readonly targetSize: number;
180
- constructor(targetSize?: number, restoreMs?: number);
181
- get warmCount(): number;
182
- get restoreMs(): number;
183
- /** Fills the pool up to the target size; returns the number added. */
184
- refill(): number;
185
- /**
186
- * Acquires a warm VM or synthesizes a cold one when the pool is empty.
187
- * Cold boots cost ~125ms; warm restores cost the modeled restore time.
188
- */
189
- acquire(): {
190
- vmId: string;
191
- apiPort: number;
192
- bootMs: number;
193
- };
194
- /** Sustained creation capacity of one host and the per-VM overhead. */
195
- capacity(): {
196
- vmsPerSec: number;
197
- memoryPerVmMib: number;
198
- };
199
- apply(target: LayerTarget): LayerPatch;
200
- [Symbol.dispose](): void;
201
- }
202
- /**
203
- * Shape of the options accepted by buildQemuTcgArgs: vcpus, memoryMb and
204
- * the optional machine/cpuModel/tbSizeMiB/kernel/initrd/append overrides.
205
- */
206
- export interface TcgOptions {
207
- readonly vcpus: number;
208
- readonly memoryMb: number;
209
- readonly machine?: 'microvm' | 'q35';
210
- readonly cpuModel?: string;
211
- readonly tbSizeMiB?: number;
212
- readonly kernel?: string;
213
- readonly initrd?: string;
214
- readonly append?: string;
215
- }
216
- /**
217
- * Builds the QEMU 11.1 command line for software virtualization.
218
- * MTTCG (`thread=multi`) binds one host thread per vCPU (the default when
219
- * host and guest are both x86_64), tb-size caches translation blocks and
220
- * EPYC-v5 is the newest AMD server model in target/i386/cpu.c.
221
- */
222
- export declare function buildQemuTcgArgs(opts: TcgOptions): string[];
223
- /**
224
- * Layer 5/7 - TCG.
225
- * Used where KVM is unavailable (GitHub-hosted runners expose no /dev/kvm):
226
- * MTTCG keeps a 1:1 vCPU-to-host-thread mapping, the translation block cache
227
- * is sized at 1024 MiB for compile-heavy guests, and the microvm machine
228
- * with a direct -kernel boot trims device enumeration to a minimum. QEMU
229
- * 11.1 also ships the nitro accelerator for AWS enclave-shaped guests.
230
- */
231
- export declare class TcgLayer implements PerformanceLayer {
232
- #private;
233
- readonly id: 'tcg';
234
- readonly title = "QEMU 11.1 MTTCG, tb-size 1024, EPYC-v5, nitro accel";
235
- readonly contexts: string[];
236
- setTbSizeMiB(mib: number): this;
237
- setMachine(machine: 'microvm' | 'q35'): this;
238
- apply(target: LayerTarget): LayerPatch;
239
- }
240
- /** buildx cache configuration: measured 103s cold down to 25s warm on gha. */
241
- export declare function buildxCacheConfig(scope: string): {
242
- cacheFrom: string;
243
- cacheTo: string;
244
- measured: {
245
- coldSec: number;
246
- warmSec: number;
247
- };
248
- };
249
- /** LLVM maximum-optimization flags for native components (software GPU shims, overlay hooks). */
250
- export declare function llvmNativeCflags(march?: string): {
251
- cflags: string;
252
- cxxflags: string;
253
- ldflags: string;
254
- };
255
- /** Plans a multi-stage Dockerfile stage graph with cache-mount annotations. */
256
- export declare function planMultiStage(stages: readonly string[]): {
257
- dockerfile: string[];
258
- cacheMounts: readonly string[];
259
- };
260
- /**
261
- * Layer 6/7 - build.
262
- * The build layer moves compile time out of the critical path: buildx gha
263
- * caching took the engine image from 103s cold to 25s warm, multi-stage
264
- * builds keep the final image at runtime-only layers, and native components
265
- * compile with LLVM -O3 -march=native -flto against the host ISA.
266
- */
267
- export declare class BuildLayer implements PerformanceLayer {
268
- #private;
269
- readonly id: 'build';
270
- readonly title = "buildx gha cache (103s to 25s), multi-stage, LLVM -O3 -march=native -flto";
271
- readonly contexts: string[];
272
- setScope(scope: string): this;
273
- apply(target: LayerTarget): LayerPatch;
274
- }
275
- /** undici-style connection pool tuning for the engine control plane. */
276
- export declare function poolingConfig(cores: number): {
277
- keepAliveTimeoutMs: number;
278
- keepAliveMaxTimeoutMs: number;
279
- connectionsPerOrigin: number;
280
- pipelining: number;
281
- };
282
- /** Plans TAP device pre-setup so VM boot does not pay interface creation cost. */
283
- export declare function planTapPreSetup(tapName: string): {
284
- commands: string[];
285
- savedBootMs: number;
286
- };
287
- /**
288
- * Layer 7 of 7 - network.
289
- * The control plane keeps HTTP connections alive and pooled (undici Agent
290
- * semantics: keepAliveTimeout 4s, per-origin connection floors scaled to
291
- * cores), and TAP devices are created before the VM starts so the boot path
292
- * skips interface setup entirely.
293
- */
294
- export declare class NetworkLayer implements PerformanceLayer {
295
- #private;
296
- readonly id: 'network';
297
- readonly title = "keepalive, connection pooling, TAP pre-setup";
298
- readonly contexts: string[];
299
- setTapName(name: string): this;
300
- apply(target: LayerTarget): LayerPatch;
301
- }
302
- /**
303
- * Composes the seven layers into one target-specific profile. The stack is
304
- * the single entry point the engine uses to configure a run: it merges
305
- * environment variables, collects process arguments, docker flags, kernel
306
- * writes and mounts, and renders a human-readable report.
307
- */
308
- export declare class PerformanceStack {
309
- #private;
310
- add(layer: PerformanceLayer): this;
311
- applyAll(target: LayerTarget): LayerPatch[];
312
- /** Merges every patch environment into a single flat record. */
313
- composeEnv(patches: readonly LayerPatch[]): Record<string, string>;
314
- /** Markdown report of what each layer would do for the given target. */
315
- report(target: LayerTarget): string;
316
- }
317
- /** Stack with all seven layers in canonical order. */
318
- export declare function createDefaultStack(): PerformanceStack;
319
- /**
320
- * Outcome of one benchmark: raw samples plus p50/p95/p99, mean, min, max
321
- * and stdev, all in milliseconds with three decimal places.
322
- */
323
- export interface BenchmarkResult {
324
- readonly name: string;
325
- readonly iterations: number;
326
- readonly samplesMs: readonly number[];
327
- readonly p50: number;
328
- readonly p95: number;
329
- readonly p99: number;
330
- readonly mean: number;
331
- readonly min: number;
332
- readonly max: number;
333
- readonly stdev: number;
334
- }
335
- /** Computes p50/p95/p99 from an already collected sample set. */
336
- export declare function percentiles(samples: readonly number[]): {
337
- p50: number;
338
- p95: number;
339
- p99: number;
340
- };
341
- /**
342
- * Benchmark harness with warmup, outlier-free percentile reporting and a
343
- * post-run GC hint. Each iteration is timed with performance.now().
344
- */
345
- export declare class BenchmarkHarness {
346
- #private;
347
- run(name: string, fn: (iteration: number) => void | Promise<void>, opts?: {
348
- iterations?: number;
349
- warmup?: number;
350
- }): Promise<BenchmarkResult>;
351
- summarize(name: string, samplesMs: readonly number[]): BenchmarkResult;
352
- result(name: string): BenchmarkResult | undefined;
353
- get names(): string[];
354
- }
355
- /** Regression verdict scale: ok (within threshold), warn (under 2x), fail (beyond). */
356
- export type RegressionVerdict = 'ok' | 'warn' | 'fail';
357
- /**
358
- * Per-metric comparison produced by RegressionDetector.compare: verdict
359
- * plus one check row per percentile with baseline, current and delta %.
360
- */
361
- export interface RegressionReport {
362
- readonly verdict: RegressionVerdict;
363
- readonly checks: readonly {
364
- metric: 'p50' | 'p95' | 'p99' | 'mean';
365
- baseline: number;
366
- current: number;
367
- deltaPct: number;
368
- }[];
369
- }
370
- /**
371
- * Regression detector: compares a current benchmark against a stored
372
- * baseline and flags any percentile that degraded beyond the threshold
373
- * (default 10%). Verdicts: ok (all within threshold), warn (regressed but
374
- * under twice the threshold), fail (at least one metric beyond 2x).
375
- */
376
- export declare class RegressionDetector {
377
- readonly thresholdPct: number;
378
- constructor(thresholdPct?: number);
379
- compare(baseline: BenchmarkResult, current: BenchmarkResult): RegressionReport;
380
- }
381
- /** One measured profile phase: name, duration in ms and mark count. */
382
- export interface ProfilePhase {
383
- readonly name: string;
384
- readonly durationMs: number;
385
- readonly marks: number;
386
- }
387
- /**
388
- * Profile mode: wraps named phases with performance.mark/measure pairs and
389
- * accumulates a phase timeline. The report is plain text so CI logs stay
390
- * grep-friendly.
391
- */
392
- export declare class ProfileMode {
393
- #private;
394
- setEnabled(enabled: boolean): this;
395
- phase<T>(name: string, fn: () => Promise<T> | T): Promise<T>;
396
- report(): string;
397
- get phases(): readonly ProfilePhase[];
398
- }
399
- /**
400
- * Convenience wrapper: profiles a benchmark scenario across the seven-layer
401
- * stack, detects regressions against an optional baseline and returns both
402
- * the patch profile and the measurement in one call.
403
- */
404
- export declare function profileScenario(opts: {
405
- name: string;
406
- target: LayerTarget;
407
- fn: (iteration: number) => void | Promise<void>;
408
- baseline?: BenchmarkResult;
409
- iterations?: number;
410
- }): Promise<{
411
- patches: readonly LayerPatch[];
412
- env: Record<string, string>;
413
- result: BenchmarkResult;
414
- regression: RegressionReport | null;
415
- }>;