kynjal-cli 4.0.0 → 4.0.2
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.
- package/dist/src/appliance/gguf-engine.d.ts +91 -0
- package/dist/src/appliance/gguf-engine.d.ts.map +1 -0
- package/dist/src/appliance/gguf-engine.js +286 -525
- package/dist/src/appliance/gguf-engine.js.map +1 -1
- package/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
- package/dist/src/appliance/ruvllm-bridge.d.ts.map +1 -0
- package/dist/src/appliance/ruvllm-bridge.js +203 -403
- package/dist/src/appliance/ruvllm-bridge.js.map +1 -1
- package/dist/src/appliance/rvfa-builder.d.ts +44 -0
- package/dist/src/appliance/rvfa-builder.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-builder.js +154 -208
- package/dist/src/appliance/rvfa-builder.js.map +1 -1
- package/dist/src/appliance/rvfa-distribution.d.ts +97 -0
- package/dist/src/appliance/rvfa-distribution.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-distribution.js +260 -423
- package/dist/src/appliance/rvfa-distribution.js.map +1 -1
- package/dist/src/appliance/rvfa-format.d.ts +111 -0
- package/dist/src/appliance/rvfa-format.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-format.js +128 -200
- package/dist/src/appliance/rvfa-format.js.map +1 -1
- package/dist/src/appliance/rvfa-runner.d.ts +69 -0
- package/dist/src/appliance/rvfa-runner.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-runner.js +168 -304
- package/dist/src/appliance/rvfa-runner.js.map +1 -1
- package/dist/src/appliance/rvfa-signing.d.ts +123 -0
- package/dist/src/appliance/rvfa-signing.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-signing.js +173 -295
- package/dist/src/appliance/rvfa-signing.js.map +1 -1
- package/dist/src/benchmarks/pretrain/index.d.ts +58 -0
- package/dist/src/benchmarks/pretrain/index.d.ts.map +1 -0
- package/dist/src/benchmarks/pretrain/index.js +331 -542
- package/dist/src/benchmarks/pretrain/index.js.map +1 -1
- package/dist/src/commands/agent.js +574 -697
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze.js +1218 -1548
- package/dist/src/commands/analyze.js.map +1 -1
- package/dist/src/commands/appliance-advanced.js +158 -267
- package/dist/src/commands/appliance-advanced.js.map +1 -1
- package/dist/src/commands/appliance.js +318 -493
- package/dist/src/commands/appliance.js.map +1 -1
- package/dist/src/commands/benchmark.js +372 -523
- package/dist/src/commands/benchmark.js.map +1 -1
- package/dist/src/commands/claims.js +274 -364
- package/dist/src/commands/claims.js.map +1 -1
- package/dist/src/commands/cleanup.js +113 -157
- package/dist/src/commands/cleanup.js.map +1 -1
- package/dist/src/commands/completions.js +477 -118
- package/dist/src/commands/completions.js.map +1 -1
- package/dist/src/commands/config.js +237 -303
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/daemon.js +487 -596
- package/dist/src/commands/daemon.js.map +1 -1
- package/dist/src/commands/deployment.js +194 -275
- package/dist/src/commands/deployment.js.map +1 -1
- package/dist/src/commands/doctor.js +504 -686
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/embeddings.js +1293 -1543
- package/dist/src/commands/embeddings.js.map +1 -1
- package/dist/src/commands/guidance.js +449 -596
- package/dist/src/commands/guidance.js.map +1 -1
- package/dist/src/commands/hive-mind.js +854 -938
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks.js +3112 -3519
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +115 -0
- package/dist/src/commands/index.d.ts.map +1 -0
- package/dist/src/commands/index.js +126 -308
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init.js +788 -940
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/issues.js +383 -558
- package/dist/src/commands/issues.js.map +1 -1
- package/dist/src/commands/mcp.js +493 -605
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory.js +833 -1026
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/migrate.js +282 -347
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/neural.js +1289 -1563
- package/dist/src/commands/neural.js.map +1 -1
- package/dist/src/commands/performance.js +497 -643
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/plugins.js +668 -841
- package/dist/src/commands/plugins.js.map +1 -1
- package/dist/src/commands/process.js +392 -447
- package/dist/src/commands/process.js.map +1 -1
- package/dist/src/commands/progress.js +162 -256
- package/dist/src/commands/progress.js.map +1 -1
- package/dist/src/commands/providers.js +150 -220
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/route.js +520 -665
- package/dist/src/commands/route.js.map +1 -1
- package/dist/src/commands/ruvector/backup.js +505 -651
- package/dist/src/commands/ruvector/backup.js.map +1 -1
- package/dist/src/commands/ruvector/benchmark.js +349 -401
- package/dist/src/commands/ruvector/benchmark.js.map +1 -1
- package/dist/src/commands/ruvector/import.js +224 -266
- package/dist/src/commands/ruvector/import.js.map +1 -1
- package/dist/src/commands/ruvector/index.js +37 -75
- package/dist/src/commands/ruvector/index.js.map +1 -1
- package/dist/src/commands/ruvector/init.js +336 -359
- package/dist/src/commands/ruvector/init.js.map +1 -1
- package/dist/src/commands/ruvector/migrate.js +335 -322
- package/dist/src/commands/ruvector/migrate.js.map +1 -1
- package/dist/src/commands/ruvector/optimize.js +375 -431
- package/dist/src/commands/ruvector/optimize.js.map +1 -1
- package/dist/src/commands/ruvector/setup.js +703 -117
- package/dist/src/commands/ruvector/setup.js.map +1 -1
- package/dist/src/commands/ruvector/status.js +364 -419
- package/dist/src/commands/ruvector/status.js.map +1 -1
- package/dist/src/commands/security.js +485 -608
- package/dist/src/commands/security.js.map +1 -1
- package/dist/src/commands/session.js +504 -626
- package/dist/src/commands/session.js.map +1 -1
- package/dist/src/commands/start.js +267 -364
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.js +380 -486
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.js +408 -488
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/commands/task.js +423 -538
- package/dist/src/commands/task.js.map +1 -1
- package/dist/src/commands/transfer-store.js +322 -412
- package/dist/src/commands/transfer-store.js.map +1 -1
- package/dist/src/commands/update.js +196 -291
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/workflow.js +386 -486
- package/dist/src/commands/workflow.js.map +1 -1
- package/dist/src/config-adapter.d.ts +15 -0
- package/dist/src/config-adapter.d.ts.map +1 -0
- package/dist/src/config-adapter.js +38 -39
- package/dist/src/config-adapter.js.map +1 -1
- package/dist/src/index.d.ts +77 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +309 -411
- package/dist/src/index.js.map +1 -1
- package/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
- package/dist/src/infrastructure/in-memory-repositories.d.ts.map +1 -0
- package/dist/src/infrastructure/in-memory-repositories.js +246 -507
- package/dist/src/infrastructure/in-memory-repositories.js.map +1 -1
- package/dist/src/init/claudemd-generator.d.ts +25 -0
- package/dist/src/init/claudemd-generator.d.ts.map +1 -0
- package/dist/src/init/claudemd-generator.js +368 -78
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts +41 -0
- package/dist/src/init/executor.d.ts.map +1 -0
- package/dist/src/init/executor.js +1307 -996
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.d.ts +60 -0
- package/dist/src/init/helpers-generator.d.ts.map +1 -0
- package/dist/src/init/helpers-generator.js +657 -12
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/index.d.ts +1 -1
- package/dist/src/init/index.d.ts.map +1 -1
- package/dist/src/init/index.js +1 -1
- package/dist/src/init/index.js.map +1 -1
- package/dist/src/init/mcp-generator.js +33 -37
- package/dist/src/init/mcp-generator.js.map +1 -1
- package/dist/src/init/settings-generator.js +76 -77
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.js +801 -3
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +1 -1
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +76 -59
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/mcp-client.d.ts +92 -0
- package/dist/src/mcp-client.d.ts.map +1 -0
- package/dist/src/mcp-client.js +81 -125
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts +161 -0
- package/dist/src/mcp-server.d.ts.map +1 -0
- package/dist/src/mcp-server.js +470 -757
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +391 -492
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/agentdb-tools.js +332 -533
- package/dist/src/mcp-tools/agentdb-tools.js.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.js +172 -236
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
- package/dist/src/mcp-tools/auto-install.d.ts +83 -0
- package/dist/src/mcp-tools/auto-install.d.ts.map +1 -0
- package/dist/src/mcp-tools/auto-install.js +80 -142
- package/dist/src/mcp-tools/auto-install.js.map +1 -1
- package/dist/src/mcp-tools/browser-tools.js +252 -375
- package/dist/src/mcp-tools/browser-tools.js.map +1 -1
- package/dist/src/mcp-tools/claims-tools.js +473 -565
- package/dist/src/mcp-tools/claims-tools.js.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +197 -272
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/coordination-tools.js +500 -572
- package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
- package/dist/src/mcp-tools/daa-tools.js +286 -364
- package/dist/src/mcp-tools/daa-tools.js.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +582 -693
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/mcp-tools/github-tools.js +260 -311
- package/dist/src/mcp-tools/github-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.js +573 -640
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +2215 -2648
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +350 -505
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/neural-tools.js +315 -412
- package/dist/src/mcp-tools/neural-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +420 -480
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/mcp-tools/progress-tools.js +204 -278
- package/dist/src/mcp-tools/progress-tools.js.map +1 -1
- package/dist/src/mcp-tools/ruvllm-tools.js +163 -279
- package/dist/src/mcp-tools/ruvllm-tools.js.map +1 -1
- package/dist/src/mcp-tools/security-tools.js +297 -429
- package/dist/src/mcp-tools/security-tools.js.map +1 -1
- package/dist/src/mcp-tools/session-tools.js +185 -234
- package/dist/src/mcp-tools/session-tools.js.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.js +207 -260
- package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
- package/dist/src/mcp-tools/system-tools.js +276 -325
- package/dist/src/mcp-tools/system-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.js +270 -336
- package/dist/src/mcp-tools/task-tools.js.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.js +148 -196
- package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
- package/dist/src/mcp-tools/transfer-tools.js +186 -333
- package/dist/src/mcp-tools/transfer-tools.js.map +1 -1
- package/dist/src/mcp-tools/types.d.ts +31 -0
- package/dist/src/mcp-tools/types.d.ts.map +1 -0
- package/dist/src/mcp-tools/wasm-agent-tools.js +133 -280
- package/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/workflow-tools.js +405 -450
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
- package/dist/src/memory/ewc-consolidation.d.ts +295 -0
- package/dist/src/memory/ewc-consolidation.d.ts.map +1 -0
- package/dist/src/memory/ewc-consolidation.js +190 -303
- package/dist/src/memory/ewc-consolidation.js.map +1 -1
- package/dist/src/memory/intelligence.d.ts +338 -0
- package/dist/src/memory/intelligence.d.ts.map +1 -0
- package/dist/src/memory/intelligence.js +569 -794
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.d.ts +407 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -0
- package/dist/src/memory/memory-bridge.js +1170 -1640
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/memory/memory-initializer.d.ts +412 -0
- package/dist/src/memory/memory-initializer.d.ts.map +1 -0
- package/dist/src/memory/memory-initializer.js +1836 -1851
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/memory/sona-optimizer.d.ts +227 -0
- package/dist/src/memory/sona-optimizer.d.ts.map +1 -0
- package/dist/src/memory/sona-optimizer.js +199 -329
- package/dist/src/memory/sona-optimizer.js.map +1 -1
- package/dist/src/output.d.ts +2 -2
- package/dist/src/output.d.ts.map +1 -1
- package/dist/src/output.js +242 -272
- package/dist/src/output.js.map +1 -1
- package/dist/src/parser.d.ts +51 -0
- package/dist/src/parser.d.ts.map +1 -0
- package/dist/src/parser.js +140 -187
- package/dist/src/parser.js.map +1 -1
- package/dist/src/plugins/manager.d.ts +133 -0
- package/dist/src/plugins/manager.d.ts.map +1 -0
- package/dist/src/plugins/manager.js +285 -521
- package/dist/src/plugins/manager.js.map +1 -1
- package/dist/src/plugins/store/discovery.d.ts +88 -0
- package/dist/src/plugins/store/discovery.d.ts.map +1 -0
- package/dist/src/plugins/store/discovery.js +271 -358
- package/dist/src/plugins/store/discovery.js.map +1 -1
- package/dist/src/plugins/store/index.d.ts +76 -0
- package/dist/src/plugins/store/index.d.ts.map +1 -0
- package/dist/src/plugins/store/index.js +48 -105
- package/dist/src/plugins/store/index.js.map +1 -1
- package/dist/src/plugins/store/search.d.ts +46 -0
- package/dist/src/plugins/store/search.d.ts.map +1 -0
- package/dist/src/plugins/store/search.js +69 -107
- package/dist/src/plugins/store/search.js.map +1 -1
- package/dist/src/plugins/store/types.d.ts +274 -0
- package/dist/src/plugins/store/types.d.ts.map +1 -0
- package/dist/src/plugins/tests/demo-plugin-store.js +113 -160
- package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -1
- package/dist/src/plugins/tests/standalone-test.js +172 -223
- package/dist/src/plugins/tests/standalone-test.js.map +1 -1
- package/dist/src/plugins/tests/test-plugin-store.js +190 -228
- package/dist/src/plugins/tests/test-plugin-store.js.map +1 -1
- package/dist/src/production/circuit-breaker.d.ts +101 -0
- package/dist/src/production/circuit-breaker.d.ts.map +1 -0
- package/dist/src/production/circuit-breaker.js +62 -126
- package/dist/src/production/circuit-breaker.js.map +1 -1
- package/dist/src/production/error-handler.d.ts +92 -0
- package/dist/src/production/error-handler.d.ts.map +1 -0
- package/dist/src/production/error-handler.js +86 -156
- package/dist/src/production/error-handler.js.map +1 -1
- package/dist/src/production/monitoring.d.ts +161 -0
- package/dist/src/production/monitoring.d.ts.map +1 -0
- package/dist/src/production/monitoring.js +139 -220
- package/dist/src/production/monitoring.js.map +1 -1
- package/dist/src/production/rate-limiter.d.ts +80 -0
- package/dist/src/production/rate-limiter.d.ts.map +1 -0
- package/dist/src/production/rate-limiter.js +74 -93
- package/dist/src/production/rate-limiter.js.map +1 -1
- package/dist/src/production/retry.d.ts +48 -0
- package/dist/src/production/retry.d.ts.map +1 -0
- package/dist/src/production/retry.js +75 -167
- package/dist/src/production/retry.js.map +1 -1
- package/dist/src/prompt.d.ts +44 -0
- package/dist/src/prompt.d.ts.map +1 -0
- package/dist/src/prompt.js +436 -560
- package/dist/src/prompt.js.map +1 -1
- package/dist/src/runtime/headless.d.ts +60 -0
- package/dist/src/runtime/headless.d.ts.map +1 -0
- package/dist/src/runtime/headless.js +197 -286
- package/dist/src/runtime/headless.js.map +1 -1
- package/dist/src/ruvector/agent-wasm.d.ts +182 -0
- package/dist/src/ruvector/agent-wasm.d.ts.map +1 -0
- package/dist/src/ruvector/agent-wasm.js +156 -351
- package/dist/src/ruvector/agent-wasm.js.map +1 -1
- package/dist/src/ruvector/ast-analyzer.d.ts +67 -0
- package/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/ast-analyzer.js +145 -232
- package/dist/src/ruvector/ast-analyzer.js.map +1 -1
- package/dist/src/ruvector/coverage-router.d.ts +160 -0
- package/dist/src/ruvector/coverage-router.d.ts.map +1 -0
- package/dist/src/ruvector/coverage-router.js +287 -419
- package/dist/src/ruvector/coverage-router.js.map +1 -1
- package/dist/src/ruvector/coverage-tools.js +56 -101
- package/dist/src/ruvector/coverage-tools.js.map +1 -1
- package/dist/src/ruvector/diff-classifier.d.ts +175 -0
- package/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
- package/dist/src/ruvector/diff-classifier.js +324 -451
- package/dist/src/ruvector/diff-classifier.js.map +1 -1
- package/dist/src/ruvector/enhanced-model-router.d.ts +146 -0
- package/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -0
- package/dist/src/ruvector/enhanced-model-router.js +260 -336
- package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
- package/dist/src/ruvector/flash-attention.d.ts +195 -0
- package/dist/src/ruvector/flash-attention.d.ts.map +1 -0
- package/dist/src/ruvector/flash-attention.js +223 -254
- package/dist/src/ruvector/flash-attention.js.map +1 -1
- package/dist/src/ruvector/graph-analyzer.d.ts +187 -0
- package/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/graph-analyzer.js +486 -680
- package/dist/src/ruvector/graph-analyzer.js.map +1 -1
- package/dist/src/ruvector/index.d.ts +40 -0
- package/dist/src/ruvector/index.d.ts.map +1 -0
- package/dist/src/ruvector/index.js +36 -106
- package/dist/src/ruvector/index.js.map +1 -1
- package/dist/src/ruvector/lora-adapter.d.ts +218 -0
- package/dist/src/ruvector/lora-adapter.d.ts.map +1 -0
- package/dist/src/ruvector/lora-adapter.js +155 -248
- package/dist/src/ruvector/lora-adapter.js.map +1 -1
- package/dist/src/ruvector/model-router.d.ts +220 -0
- package/dist/src/ruvector/model-router.d.ts.map +1 -0
- package/dist/src/ruvector/model-router.js +175 -248
- package/dist/src/ruvector/model-router.js.map +1 -1
- package/dist/src/ruvector/moe-router.d.ts +206 -0
- package/dist/src/ruvector/moe-router.d.ts.map +1 -0
- package/dist/src/ruvector/moe-router.js +228 -286
- package/dist/src/ruvector/moe-router.js.map +1 -1
- package/dist/src/ruvector/q-learning-router.d.ts +211 -0
- package/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
- package/dist/src/ruvector/q-learning-router.js +257 -338
- package/dist/src/ruvector/q-learning-router.js.map +1 -1
- package/dist/src/ruvector/ruvllm-wasm.d.ts +179 -0
- package/dist/src/ruvector/ruvllm-wasm.d.ts.map +1 -0
- package/dist/src/ruvector/ruvllm-wasm.js +270 -434
- package/dist/src/ruvector/ruvllm-wasm.js.map +1 -1
- package/dist/src/ruvector/semantic-router.d.ts +77 -0
- package/dist/src/ruvector/semantic-router.d.ts.map +1 -0
- package/dist/src/ruvector/semantic-router.js +60 -67
- package/dist/src/ruvector/semantic-router.js.map +1 -1
- package/dist/src/ruvector/vector-db.d.ts +69 -0
- package/dist/src/ruvector/vector-db.d.ts.map +1 -0
- package/dist/src/ruvector/vector-db.js +119 -205
- package/dist/src/ruvector/vector-db.js.map +1 -1
- package/dist/src/services/agentic-flow-bridge.d.ts +50 -0
- package/dist/src/services/agentic-flow-bridge.d.ts.map +1 -0
- package/dist/src/services/agentic-flow-bridge.js +32 -105
- package/dist/src/services/agentic-flow-bridge.js.map +1 -1
- package/dist/src/services/claim-service.d.ts +204 -0
- package/dist/src/services/claim-service.d.ts.map +1 -0
- package/dist/src/services/claim-service.js +615 -940
- package/dist/src/services/claim-service.js.map +1 -1
- package/dist/src/services/container-worker-pool.d.ts +197 -0
- package/dist/src/services/container-worker-pool.d.ts.map +1 -0
- package/dist/src/services/container-worker-pool.js +398 -666
- package/dist/src/services/container-worker-pool.js.map +1 -1
- package/dist/src/services/headless-worker-executor.d.ts +304 -0
- package/dist/src/services/headless-worker-executor.d.ts.map +1 -0
- package/dist/src/services/headless-worker-executor.js +441 -467
- package/dist/src/services/headless-worker-executor.js.map +1 -1
- package/dist/src/services/index.d.ts +4 -4
- package/dist/src/services/index.d.ts.map +1 -1
- package/dist/src/services/index.js +4 -4
- package/dist/src/services/index.js.map +1 -1
- package/dist/src/services/registry-api.d.ts +58 -0
- package/dist/src/services/registry-api.d.ts.map +1 -0
- package/dist/src/services/registry-api.js +92 -200
- package/dist/src/services/registry-api.js.map +1 -1
- package/dist/src/services/ruvector-training.d.ts +222 -0
- package/dist/src/services/ruvector-training.d.ts.map +1 -0
- package/dist/src/services/ruvector-training.js +257 -337
- package/dist/src/services/ruvector-training.js.map +1 -1
- package/dist/src/services/worker-daemon.d.ts +228 -0
- package/dist/src/services/worker-daemon.d.ts.map +1 -0
- package/dist/src/services/worker-daemon.js +591 -849
- package/dist/src/services/worker-daemon.js.map +1 -1
- package/dist/src/services/worker-queue.d.ts +194 -0
- package/dist/src/services/worker-queue.d.ts.map +1 -0
- package/dist/src/services/worker-queue.js +331 -548
- package/dist/src/services/worker-queue.js.map +1 -1
- package/dist/src/suggest.d.ts +53 -0
- package/dist/src/suggest.d.ts.map +1 -0
- package/dist/src/suggest.js +45 -55
- package/dist/src/suggest.js.map +1 -1
- package/dist/src/transfer/anonymization/index.js +29 -37
- package/dist/src/transfer/anonymization/index.js.map +1 -1
- package/dist/src/transfer/deploy-seraphine.js +128 -155
- package/dist/src/transfer/deploy-seraphine.js.map +1 -1
- package/dist/src/transfer/export.d.ts +25 -0
- package/dist/src/transfer/export.d.ts.map +1 -0
- package/dist/src/transfer/export.js +84 -142
- package/dist/src/transfer/export.js.map +1 -1
- package/dist/src/transfer/index.d.ts +1 -1
- package/dist/src/transfer/index.d.ts.map +1 -1
- package/dist/src/transfer/index.js +0 -2
- package/dist/src/transfer/index.js.map +1 -1
- package/dist/src/transfer/ipfs/client.d.ts +109 -0
- package/dist/src/transfer/ipfs/client.d.ts.map +1 -0
- package/dist/src/transfer/ipfs/client.js +187 -337
- package/dist/src/transfer/ipfs/client.js.map +1 -1
- package/dist/src/transfer/ipfs/upload.d.ts +95 -0
- package/dist/src/transfer/ipfs/upload.d.ts.map +1 -0
- package/dist/src/transfer/ipfs/upload.js +288 -434
- package/dist/src/transfer/ipfs/upload.js.map +1 -1
- package/dist/src/transfer/models/seraphine.d.ts +72 -0
- package/dist/src/transfer/models/seraphine.d.ts.map +1 -0
- package/dist/src/transfer/models/seraphine.js +55 -55
- package/dist/src/transfer/models/seraphine.js.map +1 -1
- package/dist/src/transfer/serialization/cfp.d.ts +49 -0
- package/dist/src/transfer/serialization/cfp.d.ts.map +1 -0
- package/dist/src/transfer/serialization/cfp.js +30 -31
- package/dist/src/transfer/serialization/cfp.js.map +1 -1
- package/dist/src/transfer/storage/gcs.d.ts +82 -0
- package/dist/src/transfer/storage/gcs.d.ts.map +1 -0
- package/dist/src/transfer/storage/gcs.js +165 -232
- package/dist/src/transfer/storage/gcs.js.map +1 -1
- package/dist/src/transfer/store/discovery.d.ts +84 -0
- package/dist/src/transfer/store/discovery.d.ts.map +1 -0
- package/dist/src/transfer/store/discovery.js +239 -349
- package/dist/src/transfer/store/discovery.js.map +1 -1
- package/dist/src/transfer/store/download.d.ts +70 -0
- package/dist/src/transfer/store/download.d.ts.map +1 -0
- package/dist/src/transfer/store/download.js +243 -365
- package/dist/src/transfer/store/download.js.map +1 -1
- package/dist/src/transfer/store/index.d.ts +84 -0
- package/dist/src/transfer/store/index.d.ts.map +1 -0
- package/dist/src/transfer/store/index.js +63 -130
- package/dist/src/transfer/store/index.js.map +1 -1
- package/dist/src/transfer/store/publish.d.ts +76 -0
- package/dist/src/transfer/store/publish.d.ts.map +1 -0
- package/dist/src/transfer/store/publish.js +184 -258
- package/dist/src/transfer/store/publish.js.map +1 -1
- package/dist/src/transfer/store/registry.js +50 -72
- package/dist/src/transfer/store/registry.js.map +1 -1
- package/dist/src/transfer/store/search.d.ts +54 -0
- package/dist/src/transfer/store/search.d.ts.map +1 -0
- package/dist/src/transfer/store/search.js +64 -96
- package/dist/src/transfer/store/search.js.map +1 -1
- package/dist/src/transfer/store/tests/standalone-test.js +174 -231
- package/dist/src/transfer/store/tests/standalone-test.js.map +1 -1
- package/dist/src/transfer/test-seraphine.js +95 -130
- package/dist/src/transfer/test-seraphine.js.map +1 -1
- package/dist/src/transfer/tests/test-store.js +194 -239
- package/dist/src/transfer/tests/test-store.js.map +1 -1
- package/dist/src/transfer/types.d.ts +245 -0
- package/dist/src/transfer/types.d.ts.map +1 -0
- package/dist/src/types.d.ts +198 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +26 -55
- package/dist/src/types.js.map +1 -1
- package/dist/src/update/checker.d.ts +34 -0
- package/dist/src/update/checker.d.ts.map +1 -0
- package/dist/src/update/checker.js +106 -183
- package/dist/src/update/checker.js.map +1 -1
- package/dist/src/update/executor.d.ts +32 -0
- package/dist/src/update/executor.d.ts.map +1 -0
- package/dist/src/update/executor.js +135 -198
- package/dist/src/update/executor.js.map +1 -1
- package/dist/src/update/index.d.ts +33 -0
- package/dist/src/update/index.d.ts.map +1 -0
- package/dist/src/update/index.js +38 -85
- package/dist/src/update/index.js.map +1 -1
- package/dist/src/update/rate-limiter.d.ts +20 -0
- package/dist/src/update/rate-limiter.d.ts.map +1 -0
- package/dist/src/update/rate-limiter.js +19 -31
- package/dist/src/update/rate-limiter.js.map +1 -1
- package/dist/src/update/validator.d.ts +17 -0
- package/dist/src/update/validator.d.ts.map +1 -0
- package/dist/src/update/validator.js +38 -64
- package/dist/src/update/validator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -11,604 +11,393 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @module v3/cli/benchmarks/pretrain
|
|
13
13
|
*/
|
|
14
|
-
var __assign = (this && this.__assign) || function () {
|
|
15
|
-
__assign = Object.assign || function(t) {
|
|
16
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
-
s = arguments[i];
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
return __assign.apply(this, arguments);
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
-
function step(op) {
|
|
39
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (_) try {
|
|
41
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
-
switch (op[0]) {
|
|
44
|
-
case 0: case 1: t = op; break;
|
|
45
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
-
default:
|
|
49
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
-
if (t[2]) _.ops.pop();
|
|
54
|
-
_.trys.pop(); continue;
|
|
55
|
-
}
|
|
56
|
-
op = body.call(thisArg, _);
|
|
57
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
62
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
63
|
-
if (ar || !(i in from)) {
|
|
64
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
65
|
-
ar[i] = from[i];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
69
|
-
};
|
|
70
14
|
import { performance } from 'node:perf_hooks';
|
|
71
15
|
// ============================================================================
|
|
72
16
|
// Utility Functions
|
|
73
17
|
// ============================================================================
|
|
74
18
|
function percentile(sorted, p) {
|
|
75
|
-
|
|
19
|
+
const idx = Math.ceil((p / 100) * sorted.length) - 1;
|
|
76
20
|
return sorted[Math.max(0, idx)];
|
|
77
21
|
}
|
|
78
22
|
function mean(arr) {
|
|
79
|
-
return arr.reduce(
|
|
23
|
+
return arr.reduce((a, b) => a + b, 0) / arr.length;
|
|
80
24
|
}
|
|
81
25
|
function stdDev(arr, avg) {
|
|
82
|
-
|
|
26
|
+
const squaredDiffs = arr.map(x => Math.pow(x - avg, 2));
|
|
83
27
|
return Math.sqrt(mean(squaredDiffs));
|
|
84
28
|
}
|
|
85
29
|
export function formatBenchmarkResult(result) {
|
|
86
|
-
|
|
87
|
-
|
|
30
|
+
const status = result.targetMet ? '\x1b[32m✓\x1b[0m' : '\x1b[31m✗\x1b[0m';
|
|
31
|
+
const target = result.targetMs ? ` (target: ${result.targetMs}ms)` : '';
|
|
88
32
|
return [
|
|
89
|
-
status
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
33
|
+
`${status} ${result.name}${target}`,
|
|
34
|
+
` Mean: ${result.meanMs.toFixed(4)}ms | Median: ${result.medianMs.toFixed(4)}ms`,
|
|
35
|
+
` p95: ${result.p95Ms.toFixed(4)}ms | p99: ${result.p99Ms.toFixed(4)}ms`,
|
|
36
|
+
` Min: ${result.minMs.toFixed(4)}ms | Max: ${result.maxMs.toFixed(4)}ms`,
|
|
37
|
+
` StdDev: ${result.stdDev.toFixed(4)}ms | Ops/s: ${result.opsPerSecond.toFixed(0)}`,
|
|
94
38
|
].join('\n');
|
|
95
39
|
}
|
|
96
40
|
// ============================================================================
|
|
97
41
|
// Core Benchmark Runner
|
|
98
42
|
// ============================================================================
|
|
99
|
-
export function runBenchmark(name, fn, config) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
_a.label = 7;
|
|
135
|
-
case 7:
|
|
136
|
-
i++;
|
|
137
|
-
return [3 /*break*/, 5];
|
|
138
|
-
case 8:
|
|
139
|
-
sorted = __spreadArray([], times, true).sort(function (a, b) { return a - b; });
|
|
140
|
-
avg = mean(times);
|
|
141
|
-
std = stdDev(times, avg);
|
|
142
|
-
return [2 /*return*/, {
|
|
143
|
-
name: name,
|
|
144
|
-
iterations: iterations,
|
|
145
|
-
meanMs: avg,
|
|
146
|
-
medianMs: percentile(sorted, 50),
|
|
147
|
-
p95Ms: percentile(sorted, 95),
|
|
148
|
-
p99Ms: percentile(sorted, 99),
|
|
149
|
-
minMs: sorted[0],
|
|
150
|
-
maxMs: sorted[sorted.length - 1],
|
|
151
|
-
stdDev: std,
|
|
152
|
-
opsPerSecond: 1000 / avg,
|
|
153
|
-
targetMet: targetMs ? avg <= targetMs : true,
|
|
154
|
-
targetMs: targetMs
|
|
155
|
-
}];
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
});
|
|
43
|
+
export async function runBenchmark(name, fn, config) {
|
|
44
|
+
const { iterations, warmupIterations, targetMs, verbose } = config;
|
|
45
|
+
const times = [];
|
|
46
|
+
// Warmup phase
|
|
47
|
+
if (verbose)
|
|
48
|
+
console.log(` Warming up ${name} (${warmupIterations} iterations)...`);
|
|
49
|
+
for (let i = 0; i < warmupIterations; i++) {
|
|
50
|
+
await fn();
|
|
51
|
+
}
|
|
52
|
+
// Measurement phase
|
|
53
|
+
if (verbose)
|
|
54
|
+
console.log(` Running ${name} (${iterations} iterations)...`);
|
|
55
|
+
for (let i = 0; i < iterations; i++) {
|
|
56
|
+
const start = performance.now();
|
|
57
|
+
await fn();
|
|
58
|
+
times.push(performance.now() - start);
|
|
59
|
+
}
|
|
60
|
+
// Calculate statistics
|
|
61
|
+
const sorted = [...times].sort((a, b) => a - b);
|
|
62
|
+
const avg = mean(times);
|
|
63
|
+
const std = stdDev(times, avg);
|
|
64
|
+
return {
|
|
65
|
+
name,
|
|
66
|
+
iterations,
|
|
67
|
+
meanMs: avg,
|
|
68
|
+
medianMs: percentile(sorted, 50),
|
|
69
|
+
p95Ms: percentile(sorted, 95),
|
|
70
|
+
p99Ms: percentile(sorted, 99),
|
|
71
|
+
minMs: sorted[0],
|
|
72
|
+
maxMs: sorted[sorted.length - 1],
|
|
73
|
+
stdDev: std,
|
|
74
|
+
opsPerSecond: 1000 / avg,
|
|
75
|
+
targetMet: targetMs ? avg <= targetMs : true,
|
|
76
|
+
targetMs,
|
|
77
|
+
};
|
|
159
78
|
}
|
|
160
79
|
// ============================================================================
|
|
161
80
|
// SONA Adaptation Benchmarks
|
|
162
81
|
// ============================================================================
|
|
163
|
-
export function benchmarkSONAAdaptation(config) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
return [2 /*return*/, runBenchmark('SONA Adaptation', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
188
|
-
return __generator(this, function (_a) {
|
|
189
|
-
switch (_a.label) {
|
|
190
|
-
case 0: return [4 /*yield*/, sonaAdapt(testSignals[signalIdx % testSignals.length])];
|
|
191
|
-
case 1:
|
|
192
|
-
_a.sent();
|
|
193
|
-
signalIdx++;
|
|
194
|
-
return [2 /*return*/];
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
}); }, __assign(__assign({}, config), { targetMs: config.targetMs || 0.05 }))];
|
|
198
|
-
});
|
|
199
|
-
});
|
|
82
|
+
export async function benchmarkSONAAdaptation(config) {
|
|
83
|
+
// Fallback implementation for SONA adaptation
|
|
84
|
+
const sonaAdapt = async (_signal) => {
|
|
85
|
+
// Simulate SONA adaptation with minimal computation
|
|
86
|
+
const start = performance.now();
|
|
87
|
+
// Simple computation to simulate adaptation
|
|
88
|
+
let sum = 0;
|
|
89
|
+
for (let i = 0; i < 100; i++) {
|
|
90
|
+
sum += Math.sin(i) * Math.cos(i);
|
|
91
|
+
}
|
|
92
|
+
const latency = performance.now() - start;
|
|
93
|
+
return { adapted: sum > -1000, latencyMs: latency };
|
|
94
|
+
};
|
|
95
|
+
const testSignals = [
|
|
96
|
+
{ type: 'observation', content: 'User requested feature implementation' },
|
|
97
|
+
{ type: 'action', content: 'Created new component file' },
|
|
98
|
+
{ type: 'result', content: 'Component successfully rendered' },
|
|
99
|
+
{ type: 'thought', content: 'Should add error handling' },
|
|
100
|
+
];
|
|
101
|
+
let signalIdx = 0;
|
|
102
|
+
return runBenchmark('SONA Adaptation', async () => {
|
|
103
|
+
await sonaAdapt(testSignals[signalIdx % testSignals.length]);
|
|
104
|
+
signalIdx++;
|
|
105
|
+
}, { ...config, targetMs: config.targetMs || 0.05 });
|
|
200
106
|
}
|
|
201
107
|
// ============================================================================
|
|
202
108
|
// Pattern Learning Benchmarks
|
|
203
109
|
// ============================================================================
|
|
204
|
-
export function benchmarkPatternLearning(config) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
stepIdx = 0;
|
|
227
|
-
return [2 /*return*/, runBenchmark('Pattern Learning (Record Step)', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
228
|
-
return __generator(this, function (_a) {
|
|
229
|
-
switch (_a.label) {
|
|
230
|
-
case 0: return [4 /*yield*/, recordStep(testSteps[stepIdx % testSteps.length])];
|
|
231
|
-
case 1:
|
|
232
|
-
_a.sent();
|
|
233
|
-
stepIdx++;
|
|
234
|
-
return [2 /*return*/];
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
}); }, __assign(__assign({}, config), { targetMs: config.targetMs || 0.1 }))];
|
|
238
|
-
});
|
|
239
|
-
});
|
|
110
|
+
export async function benchmarkPatternLearning(config) {
|
|
111
|
+
// Simulate pattern learning step recording
|
|
112
|
+
const recordStep = async (_step) => {
|
|
113
|
+
// Simulate recording - just a hash computation
|
|
114
|
+
let hash = 0;
|
|
115
|
+
const str = _step.content;
|
|
116
|
+
for (let i = 0; i < str.length; i++) {
|
|
117
|
+
hash = ((hash << 5) - hash + str.charCodeAt(i)) | 0;
|
|
118
|
+
}
|
|
119
|
+
return hash;
|
|
120
|
+
};
|
|
121
|
+
const testSteps = [
|
|
122
|
+
{ type: 'observation', content: 'Analyzing codebase structure' },
|
|
123
|
+
{ type: 'thought', content: 'Identified potential optimization' },
|
|
124
|
+
{ type: 'action', content: 'Refactored module imports' },
|
|
125
|
+
{ type: 'result', content: 'Build time reduced by 15%' },
|
|
126
|
+
];
|
|
127
|
+
let stepIdx = 0;
|
|
128
|
+
return runBenchmark('Pattern Learning (Record Step)', async () => {
|
|
129
|
+
await recordStep(testSteps[stepIdx % testSteps.length]);
|
|
130
|
+
stepIdx++;
|
|
131
|
+
}, { ...config, targetMs: config.targetMs || 0.1 });
|
|
240
132
|
}
|
|
241
133
|
// ============================================================================
|
|
242
134
|
// EWC++ Consolidation Benchmarks
|
|
243
135
|
// ============================================================================
|
|
244
|
-
export function benchmarkEWCConsolidation(config) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}); };
|
|
263
|
-
return [2 /*return*/, runBenchmark('EWC++ Consolidation', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
264
|
-
return __generator(this, function (_a) {
|
|
265
|
-
switch (_a.label) {
|
|
266
|
-
case 0: return [4 /*yield*/, consolidate()];
|
|
267
|
-
case 1:
|
|
268
|
-
_a.sent();
|
|
269
|
-
return [2 /*return*/];
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
}); }, __assign(__assign({}, config), { targetMs: config.targetMs || 5.0 }))];
|
|
273
|
-
});
|
|
274
|
-
});
|
|
136
|
+
export async function benchmarkEWCConsolidation(config) {
|
|
137
|
+
// Simulate EWC++ consolidation
|
|
138
|
+
const consolidate = async () => {
|
|
139
|
+
// Simulate consolidation computation
|
|
140
|
+
const patterns = 100;
|
|
141
|
+
let consolidated = 0;
|
|
142
|
+
for (let i = 0; i < patterns; i++) {
|
|
143
|
+
// Simulate Fisher information computation
|
|
144
|
+
const importance = Math.random();
|
|
145
|
+
if (importance > 0.3) {
|
|
146
|
+
consolidated++;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return { consolidated, preserved: patterns - consolidated };
|
|
150
|
+
};
|
|
151
|
+
return runBenchmark('EWC++ Consolidation', async () => {
|
|
152
|
+
await consolidate();
|
|
153
|
+
}, { ...config, targetMs: config.targetMs || 5.0 });
|
|
275
154
|
}
|
|
276
155
|
// ============================================================================
|
|
277
156
|
// Memory Retrieval Benchmarks
|
|
278
157
|
// ============================================================================
|
|
279
|
-
export function benchmarkMemoryRetrieval(config) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
return [2 /*return*/, runBenchmark('Memory Retrieval (HNSW Search)', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
313
|
-
return __generator(this, function (_a) {
|
|
314
|
-
switch (_a.label) {
|
|
315
|
-
case 0: return [4 /*yield*/, searchEntries({
|
|
316
|
-
query: testQueries[queryIdx % testQueries.length],
|
|
317
|
-
namespace: 'patterns',
|
|
318
|
-
limit: 10
|
|
319
|
-
})];
|
|
320
|
-
case 1:
|
|
321
|
-
_a.sent();
|
|
322
|
-
queryIdx++;
|
|
323
|
-
return [2 /*return*/];
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
|
-
}); }, __assign(__assign({}, config), { targetMs: config.targetMs || 10.0 }))];
|
|
158
|
+
export async function benchmarkMemoryRetrieval(config) {
|
|
159
|
+
// Simulate memory search
|
|
160
|
+
const searchEntries = async (_options) => {
|
|
161
|
+
// Simulate vector search with cosine similarity
|
|
162
|
+
const numVectors = 1000;
|
|
163
|
+
const dim = 384;
|
|
164
|
+
const queryVec = new Float32Array(dim).map(() => Math.random());
|
|
165
|
+
const results = [];
|
|
166
|
+
for (let i = 0; i < Math.min(numVectors, 100); i++) {
|
|
167
|
+
const vec = new Float32Array(dim).map(() => Math.random());
|
|
168
|
+
let dot = 0, normQ = 0, normV = 0;
|
|
169
|
+
for (let j = 0; j < dim; j++) {
|
|
170
|
+
dot += queryVec[j] * vec[j];
|
|
171
|
+
normQ += queryVec[j] * queryVec[j];
|
|
172
|
+
normV += vec[j] * vec[j];
|
|
173
|
+
}
|
|
174
|
+
results.push({ score: dot / (Math.sqrt(normQ) * Math.sqrt(normV)) });
|
|
175
|
+
}
|
|
176
|
+
return { results: results.slice(0, _options.limit || 10), searchTime: 1.0 };
|
|
177
|
+
};
|
|
178
|
+
const testQueries = [
|
|
179
|
+
'authentication patterns',
|
|
180
|
+
'error handling best practices',
|
|
181
|
+
'performance optimization techniques',
|
|
182
|
+
'testing strategies',
|
|
183
|
+
'security vulnerability fixes',
|
|
184
|
+
];
|
|
185
|
+
let queryIdx = 0;
|
|
186
|
+
return runBenchmark('Memory Retrieval (HNSW Search)', async () => {
|
|
187
|
+
await searchEntries({
|
|
188
|
+
query: testQueries[queryIdx % testQueries.length],
|
|
189
|
+
namespace: 'patterns',
|
|
190
|
+
limit: 10,
|
|
327
191
|
});
|
|
328
|
-
|
|
192
|
+
queryIdx++;
|
|
193
|
+
}, { ...config, targetMs: config.targetMs || 10.0 });
|
|
329
194
|
}
|
|
330
195
|
// ============================================================================
|
|
331
196
|
// Embedding Generation Benchmarks
|
|
332
197
|
// ============================================================================
|
|
333
|
-
export function benchmarkEmbeddingGeneration(config) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
textIdx = 0;
|
|
369
|
-
return [2 /*return*/, runBenchmark('Embedding Generation', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
370
|
-
return __generator(this, function (_a) {
|
|
371
|
-
switch (_a.label) {
|
|
372
|
-
case 0: return [4 /*yield*/, generateEmbedding(testTexts[textIdx % testTexts.length])];
|
|
373
|
-
case 1:
|
|
374
|
-
_a.sent();
|
|
375
|
-
textIdx++;
|
|
376
|
-
return [2 /*return*/];
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
}); }, __assign(__assign({}, config), { targetMs: config.targetMs || 5.0 }))];
|
|
380
|
-
});
|
|
381
|
-
});
|
|
198
|
+
export async function benchmarkEmbeddingGeneration(config) {
|
|
199
|
+
// Simulate embedding generation
|
|
200
|
+
const generateEmbedding = async (text) => {
|
|
201
|
+
const dim = 384;
|
|
202
|
+
const embedding = new Float32Array(dim);
|
|
203
|
+
for (let i = 0; i < dim; i++) {
|
|
204
|
+
let hash = 0;
|
|
205
|
+
for (let j = 0; j < text.length; j++) {
|
|
206
|
+
hash = ((hash << 5) - hash + text.charCodeAt(j) * (i + 1)) | 0;
|
|
207
|
+
}
|
|
208
|
+
embedding[i] = Math.sin(hash) * 0.5;
|
|
209
|
+
}
|
|
210
|
+
// Normalize
|
|
211
|
+
let norm = 0;
|
|
212
|
+
for (let i = 0; i < dim; i++) {
|
|
213
|
+
norm += embedding[i] * embedding[i];
|
|
214
|
+
}
|
|
215
|
+
norm = Math.sqrt(norm);
|
|
216
|
+
for (let i = 0; i < dim; i++) {
|
|
217
|
+
embedding[i] /= norm;
|
|
218
|
+
}
|
|
219
|
+
return embedding;
|
|
220
|
+
};
|
|
221
|
+
const testTexts = [
|
|
222
|
+
'Implement user authentication with JWT tokens',
|
|
223
|
+
'Fix memory leak in event handler cleanup',
|
|
224
|
+
'Add unit tests for payment processing module',
|
|
225
|
+
'Refactor database connection pooling',
|
|
226
|
+
'Optimize React component rendering performance',
|
|
227
|
+
];
|
|
228
|
+
let textIdx = 0;
|
|
229
|
+
return runBenchmark('Embedding Generation', async () => {
|
|
230
|
+
await generateEmbedding(testTexts[textIdx % testTexts.length]);
|
|
231
|
+
textIdx++;
|
|
232
|
+
}, { ...config, targetMs: config.targetMs || 5.0 });
|
|
382
233
|
}
|
|
383
234
|
// ============================================================================
|
|
384
235
|
// MoE Routing Benchmarks
|
|
385
236
|
// ============================================================================
|
|
386
|
-
export function benchmarkMoERouting(config) {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
'Review security of payment processing',
|
|
427
|
-
];
|
|
428
|
-
taskIdx = 0;
|
|
429
|
-
return [2 /*return*/, runBenchmark('MoE Expert Routing', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
430
|
-
return __generator(this, function (_a) {
|
|
431
|
-
switch (_a.label) {
|
|
432
|
-
case 0: return [4 /*yield*/, route(testTasks[taskIdx % testTasks.length])];
|
|
433
|
-
case 1:
|
|
434
|
-
_a.sent();
|
|
435
|
-
taskIdx++;
|
|
436
|
-
return [2 /*return*/];
|
|
437
|
-
}
|
|
438
|
-
});
|
|
439
|
-
}); }, __assign(__assign({}, config), { targetMs: config.targetMs || 1.0 }))];
|
|
440
|
-
});
|
|
441
|
-
});
|
|
237
|
+
export async function benchmarkMoERouting(config) {
|
|
238
|
+
// Simulate MoE routing
|
|
239
|
+
const experts = ['coder', 'tester', 'reviewer', 'architect', 'security'];
|
|
240
|
+
const route = async (task) => {
|
|
241
|
+
// Simple keyword-based routing simulation
|
|
242
|
+
const keywords = {
|
|
243
|
+
coder: ['implement', 'fix', 'code', 'function'],
|
|
244
|
+
tester: ['test', 'spec', 'coverage', 'unit'],
|
|
245
|
+
reviewer: ['review', 'quality', 'check'],
|
|
246
|
+
architect: ['design', 'architecture', 'pattern'],
|
|
247
|
+
security: ['security', 'auth', 'vulnerability'],
|
|
248
|
+
};
|
|
249
|
+
let bestExpert = 'coder';
|
|
250
|
+
let bestScore = 0;
|
|
251
|
+
for (const [expert, words] of Object.entries(keywords)) {
|
|
252
|
+
let score = 0;
|
|
253
|
+
for (const word of words) {
|
|
254
|
+
if (task.toLowerCase().includes(word)) {
|
|
255
|
+
score++;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (score > bestScore) {
|
|
259
|
+
bestScore = score;
|
|
260
|
+
bestExpert = expert;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return { expert: bestExpert, confidence: 0.7 + Math.random() * 0.25 };
|
|
264
|
+
};
|
|
265
|
+
const testTasks = [
|
|
266
|
+
'Fix authentication bug in login flow',
|
|
267
|
+
'Add new REST API endpoint for users',
|
|
268
|
+
'Write integration tests for checkout',
|
|
269
|
+
'Optimize database query performance',
|
|
270
|
+
'Review security of payment processing',
|
|
271
|
+
];
|
|
272
|
+
let taskIdx = 0;
|
|
273
|
+
return runBenchmark('MoE Expert Routing', async () => {
|
|
274
|
+
await route(testTasks[taskIdx % testTasks.length]);
|
|
275
|
+
taskIdx++;
|
|
276
|
+
}, { ...config, targetMs: config.targetMs || 1.0 });
|
|
442
277
|
}
|
|
443
278
|
// ============================================================================
|
|
444
279
|
// Batch Operations Benchmarks
|
|
445
280
|
// ============================================================================
|
|
446
|
-
export function benchmarkBatchCosine(config) {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
});
|
|
470
|
-
return [2 /*return*/, runBenchmark("Batch Cosine Similarity (" + numVectors + " vectors)", function () { return __awaiter(_this, void 0, void 0, function () {
|
|
471
|
-
return __generator(this, function (_a) {
|
|
472
|
-
batchCosineSim(query, vectors);
|
|
473
|
-
return [2 /*return*/];
|
|
474
|
-
});
|
|
475
|
-
}); }, __assign(__assign({}, config), { targetMs: config.targetMs || 2.0 }))];
|
|
476
|
-
});
|
|
477
|
-
});
|
|
281
|
+
export async function benchmarkBatchCosine(config) {
|
|
282
|
+
// Batch cosine similarity
|
|
283
|
+
const batchCosineSim = (query, vectors) => {
|
|
284
|
+
const results = new Float32Array(vectors.length);
|
|
285
|
+
for (let i = 0; i < vectors.length; i++) {
|
|
286
|
+
let dot = 0, normQ = 0, normV = 0;
|
|
287
|
+
for (let j = 0; j < query.length; j++) {
|
|
288
|
+
dot += query[j] * vectors[i][j];
|
|
289
|
+
normQ += query[j] * query[j];
|
|
290
|
+
normV += vectors[i][j] * vectors[i][j];
|
|
291
|
+
}
|
|
292
|
+
results[i] = dot / (Math.sqrt(normQ) * Math.sqrt(normV));
|
|
293
|
+
}
|
|
294
|
+
return results;
|
|
295
|
+
};
|
|
296
|
+
// Generate test vectors
|
|
297
|
+
const dim = 384;
|
|
298
|
+
const numVectors = 1000;
|
|
299
|
+
const query = new Float32Array(dim).map(() => Math.random());
|
|
300
|
+
const vectors = Array.from({ length: numVectors }, () => new Float32Array(dim).map(() => Math.random()));
|
|
301
|
+
return runBenchmark(`Batch Cosine Similarity (${numVectors} vectors)`, async () => {
|
|
302
|
+
batchCosineSim(query, vectors);
|
|
303
|
+
}, { ...config, targetMs: config.targetMs || 2.0 });
|
|
478
304
|
}
|
|
479
305
|
// ============================================================================
|
|
480
306
|
// Full Pre-Training Pipeline Benchmark
|
|
481
307
|
// ============================================================================
|
|
482
|
-
export function benchmarkPretrainPipeline(config) {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
return [2 /*return*/, runBenchmark('Pre-Training Pipeline (50 files)', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
515
|
-
return __generator(this, function (_a) {
|
|
516
|
-
switch (_a.label) {
|
|
517
|
-
case 0: return [4 /*yield*/, pipeline()];
|
|
518
|
-
case 1:
|
|
519
|
-
_a.sent();
|
|
520
|
-
return [2 /*return*/];
|
|
521
|
-
}
|
|
522
|
-
});
|
|
523
|
-
}); }, __assign(__assign({}, config), { targetMs: config.targetMs || 100.0 }))];
|
|
524
|
-
});
|
|
525
|
-
});
|
|
308
|
+
export async function benchmarkPretrainPipeline(config) {
|
|
309
|
+
// Simulate full pre-training pipeline
|
|
310
|
+
const pipeline = async () => {
|
|
311
|
+
// Step 1: Analyze repository structure (simulated)
|
|
312
|
+
const files = Array.from({ length: 50 }, (_, i) => ({
|
|
313
|
+
path: `src/module${i}/index.ts`,
|
|
314
|
+
content: `export function fn${i}() { return ${i}; }`,
|
|
315
|
+
}));
|
|
316
|
+
// Step 2: Generate embeddings for each file
|
|
317
|
+
const embeddings = [];
|
|
318
|
+
for (const file of files) {
|
|
319
|
+
const embedding = new Float32Array(384);
|
|
320
|
+
for (let i = 0; i < 384; i++) {
|
|
321
|
+
embedding[i] = Math.sin(file.path.charCodeAt(i % file.path.length) * (i + 1));
|
|
322
|
+
}
|
|
323
|
+
embeddings.push(embedding);
|
|
324
|
+
}
|
|
325
|
+
// Step 3: Build pattern index (simulated HNSW construction)
|
|
326
|
+
const index = new Map();
|
|
327
|
+
embeddings.forEach((emb, i) => index.set(i, emb));
|
|
328
|
+
// Step 4: Extract patterns
|
|
329
|
+
const patterns = files.slice(0, 10).map((f, i) => ({
|
|
330
|
+
id: `pattern-${i}`,
|
|
331
|
+
type: 'code-structure',
|
|
332
|
+
embedding: embeddings[i],
|
|
333
|
+
confidence: 0.85 + Math.random() * 0.1,
|
|
334
|
+
}));
|
|
335
|
+
return { files: files.length, patterns: patterns.length };
|
|
336
|
+
};
|
|
337
|
+
return runBenchmark('Pre-Training Pipeline (50 files)', async () => {
|
|
338
|
+
await pipeline();
|
|
339
|
+
}, { ...config, targetMs: config.targetMs || 100.0 });
|
|
526
340
|
}
|
|
527
341
|
// ============================================================================
|
|
528
342
|
// Full Benchmark Suite
|
|
529
343
|
// ============================================================================
|
|
530
|
-
export function runPretrainBenchmarkSuite(config) {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
console.log('\x1b[36m───────────────────────────────────────────────────────────────\x1b[0m');
|
|
588
|
-
passed = results.filter(function (r) { return r.targetMet; }).length;
|
|
589
|
-
total = results.length;
|
|
590
|
-
console.log(" Total benchmarks: " + total);
|
|
591
|
-
console.log(" Targets met: \u001B[" + (passed === total ? '32' : '33') + "m" + passed + "/" + total + "\u001B[0m");
|
|
592
|
-
console.log(" Total duration: " + (totalDuration / 1000).toFixed(2) + "s");
|
|
593
|
-
console.log('\x1b[1m\x1b[36m═══════════════════════════════════════════════════════════════\x1b[0m\n');
|
|
594
|
-
_b = {
|
|
595
|
-
name: 'pretrain-benchmark-suite',
|
|
596
|
-
results: results,
|
|
597
|
-
totalDurationMs: totalDuration,
|
|
598
|
-
timestamp: new Date().toISOString()
|
|
599
|
-
};
|
|
600
|
-
_c = {
|
|
601
|
-
nodeVersion: process.version,
|
|
602
|
-
platform: process.platform,
|
|
603
|
-
arch: process.arch
|
|
604
|
-
};
|
|
605
|
-
return [4 /*yield*/, import('node:os')];
|
|
606
|
-
case 7: return [2 /*return*/, (_b.environment = (_c.cpuCount = (_d.sent()).cpus().length,
|
|
607
|
-
_c),
|
|
608
|
-
_b)];
|
|
609
|
-
}
|
|
610
|
-
});
|
|
611
|
-
});
|
|
344
|
+
export async function runPretrainBenchmarkSuite(config = {}) {
|
|
345
|
+
const fullConfig = {
|
|
346
|
+
iterations: config.iterations || 100,
|
|
347
|
+
warmupIterations: config.warmupIterations || 10,
|
|
348
|
+
verbose: config.verbose ?? false,
|
|
349
|
+
};
|
|
350
|
+
console.log('\n\x1b[1m\x1b[36m═══════════════════════════════════════════════════════════════\x1b[0m');
|
|
351
|
+
console.log('\x1b[1m\x1b[36m Self-Learning Pre-Training Benchmark Suite\x1b[0m');
|
|
352
|
+
console.log('\x1b[1m\x1b[36m═══════════════════════════════════════════════════════════════\x1b[0m\n');
|
|
353
|
+
const startTime = performance.now();
|
|
354
|
+
const results = [];
|
|
355
|
+
// Run all benchmarks
|
|
356
|
+
const benchmarks = [
|
|
357
|
+
{ name: 'SONA', fn: () => benchmarkSONAAdaptation(fullConfig) },
|
|
358
|
+
{ name: 'Pattern Learning', fn: () => benchmarkPatternLearning(fullConfig) },
|
|
359
|
+
{ name: 'EWC++', fn: () => benchmarkEWCConsolidation({ ...fullConfig, iterations: 20 }) },
|
|
360
|
+
{ name: 'Memory Retrieval', fn: () => benchmarkMemoryRetrieval(fullConfig) },
|
|
361
|
+
{ name: 'Embedding Gen', fn: () => benchmarkEmbeddingGeneration(fullConfig) },
|
|
362
|
+
{ name: 'MoE Routing', fn: () => benchmarkMoERouting(fullConfig) },
|
|
363
|
+
{ name: 'Batch Cosine', fn: () => benchmarkBatchCosine(fullConfig) },
|
|
364
|
+
{ name: 'Pretrain Pipeline', fn: () => benchmarkPretrainPipeline({ ...fullConfig, iterations: 10 }) },
|
|
365
|
+
];
|
|
366
|
+
for (const benchmark of benchmarks) {
|
|
367
|
+
console.log(`\x1b[33m► Running ${benchmark.name} benchmark...\x1b[0m`);
|
|
368
|
+
try {
|
|
369
|
+
const result = await benchmark.fn();
|
|
370
|
+
results.push(result);
|
|
371
|
+
console.log(formatBenchmarkResult(result));
|
|
372
|
+
console.log();
|
|
373
|
+
}
|
|
374
|
+
catch (error) {
|
|
375
|
+
console.error(`\x1b[31m✗ ${benchmark.name} failed: ${error}\x1b[0m\n`);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
const totalDuration = performance.now() - startTime;
|
|
379
|
+
// Summary
|
|
380
|
+
console.log('\x1b[1m\x1b[36m═══════════════════════════════════════════════════════════════\x1b[0m');
|
|
381
|
+
console.log('\x1b[1m Summary\x1b[0m');
|
|
382
|
+
console.log('\x1b[36m───────────────────────────────────────────────────────────────\x1b[0m');
|
|
383
|
+
const passed = results.filter(r => r.targetMet).length;
|
|
384
|
+
const total = results.length;
|
|
385
|
+
console.log(` Total benchmarks: ${total}`);
|
|
386
|
+
console.log(` Targets met: \x1b[${passed === total ? '32' : '33'}m${passed}/${total}\x1b[0m`);
|
|
387
|
+
console.log(` Total duration: ${(totalDuration / 1000).toFixed(2)}s`);
|
|
388
|
+
console.log('\x1b[1m\x1b[36m═══════════════════════════════════════════════════════════════\x1b[0m\n');
|
|
389
|
+
return {
|
|
390
|
+
name: 'pretrain-benchmark-suite',
|
|
391
|
+
results,
|
|
392
|
+
totalDurationMs: totalDuration,
|
|
393
|
+
timestamp: new Date().toISOString(),
|
|
394
|
+
environment: {
|
|
395
|
+
nodeVersion: process.version,
|
|
396
|
+
platform: process.platform,
|
|
397
|
+
arch: process.arch,
|
|
398
|
+
cpuCount: (await import('node:os')).cpus().length,
|
|
399
|
+
},
|
|
400
|
+
};
|
|
612
401
|
}
|
|
613
402
|
// Export for CLI usage
|
|
614
403
|
export default runPretrainBenchmarkSuite;
|