@wenathlan/saddle 1.8.18 → 2.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/Dockerfile +1339 -0
- package/README.md +33 -12
- package/alternatives.ts +1218 -0
- package/biome.json +153 -0
- package/boards.json +1517 -0
- package/compute.ts +3144 -0
- package/cores.json +1801 -0
- package/dist/acquisition.d.ts +359 -0
- package/dist/acquisition.d.ts.map +1 -0
- package/dist/acquisition.js +629 -0
- package/dist/acquisition.js.map +1 -0
- package/dist/alternatives.d.ts +509 -0
- package/dist/alternatives.d.ts.map +1 -0
- package/dist/alternatives.js +951 -0
- package/dist/alternatives.js.map +1 -0
- package/dist/automation.d.ts +426 -0
- package/dist/automation.d.ts.map +1 -0
- package/dist/automation.js +561 -0
- package/dist/automation.js.map +1 -0
- package/dist/browser.d.ts +562 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +1057 -0
- package/dist/browser.js.map +1 -0
- package/dist/capacitor.config.d.ts +13 -0
- package/dist/capacitor.config.d.ts.map +1 -0
- package/dist/capacitor.config.js +26 -0
- package/dist/capacitor.config.js.map +1 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +111 -0
- package/dist/cli.js.map +1 -0
- package/dist/communication.d.ts +192 -0
- package/dist/communication.d.ts.map +1 -0
- package/dist/communication.js +418 -0
- package/dist/communication.js.map +1 -0
- package/dist/compute.d.ts +1161 -0
- package/dist/compute.d.ts.map +1 -0
- package/dist/compute.js +2273 -0
- package/dist/compute.js.map +1 -0
- package/dist/distribution.d.ts +529 -0
- package/dist/distribution.d.ts.map +1 -0
- package/dist/distribution.js +811 -0
- package/dist/distribution.js.map +1 -0
- package/dist/execution.d.ts +530 -0
- package/dist/execution.d.ts.map +1 -0
- package/dist/execution.js +761 -0
- package/dist/execution.js.map +1 -0
- package/dist/format.d.ts +19 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +60 -0
- package/dist/format.js.map +1 -0
- package/dist/foundation.d.ts +176 -0
- package/dist/foundation.d.ts.map +1 -0
- package/dist/foundation.js +309 -0
- package/dist/foundation.js.map +1 -0
- package/dist/index.d.ts +733 -123
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1018 -123
- package/dist/index.js.map +1 -1
- package/dist/integration.d.ts +236 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +236 -0
- package/dist/integration.js.map +1 -0
- package/dist/intelligence.d.ts +94 -0
- package/dist/intelligence.d.ts.map +1 -0
- package/dist/intelligence.js +145 -0
- package/dist/intelligence.js.map +1 -0
- package/dist/{isolation/contracts.d.ts → isolation.d.ts} +12 -1
- package/dist/isolation.d.ts.map +1 -0
- package/dist/{isolation/contracts.js → isolation.js} +13 -1
- package/dist/isolation.js.map +1 -0
- package/dist/media.d.ts +344 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +986 -0
- package/dist/media.js.map +1 -0
- package/dist/modes.d.ts +359 -0
- package/dist/modes.d.ts.map +1 -0
- package/dist/modes.js +134 -0
- package/dist/modes.js.map +1 -0
- package/dist/{library/public.d.ts → operations.d.ts} +15 -1
- package/dist/operations.d.ts.map +1 -0
- package/dist/{library/public.js → operations.js} +18 -7
- package/dist/operations.js.map +1 -0
- package/dist/orchestrator.d.ts +1339 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +4308 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/performance.d.ts +416 -0
- package/dist/performance.d.ts.map +1 -0
- package/dist/performance.js +827 -0
- package/dist/performance.js.map +1 -0
- package/dist/quantum.d.ts +810 -0
- package/dist/quantum.d.ts.map +1 -0
- package/dist/quantum.js +2073 -0
- package/dist/quantum.js.map +1 -0
- package/dist/render.d.ts +381 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +1073 -0
- package/dist/render.js.map +1 -0
- package/dist/scheduler.d.ts +596 -0
- package/dist/scheduler.d.ts.map +1 -0
- package/dist/scheduler.js +1259 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/security.d.ts +501 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/security.js +1170 -0
- package/dist/security.js.map +1 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/{server/node.js → server.js} +16 -2
- package/dist/server.js.map +1 -0
- package/dist/tiers.d.ts +1002 -0
- package/dist/tiers.d.ts.map +1 -0
- package/dist/tiers.js +2165 -0
- package/dist/tiers.js.map +1 -0
- package/dist/virtual.d.ts +641 -0
- package/dist/virtual.d.ts.map +1 -0
- package/dist/virtual.js +1285 -0
- package/dist/virtual.js.map +1 -0
- package/dist/virtualcpu.d.ts +316 -0
- package/dist/virtualcpu.d.ts.map +1 -0
- package/dist/virtualcpu.js +1180 -0
- package/dist/virtualcpu.js.map +1 -0
- package/dist/virtualgpu.d.ts +345 -0
- package/dist/virtualgpu.d.ts.map +1 -0
- package/dist/virtualgpu.js +1000 -0
- package/dist/virtualgpu.js.map +1 -0
- package/dist/virtualization.d.ts +607 -0
- package/dist/virtualization.d.ts.map +1 -0
- package/dist/virtualization.js +1187 -0
- package/dist/virtualization.js.map +1 -0
- package/dist/virtualmemory.d.ts +818 -0
- package/dist/virtualmemory.d.ts.map +1 -0
- package/dist/virtualmemory.js +1796 -0
- package/dist/virtualmemory.js.map +1 -0
- package/dist/webscrape.d.ts +720 -0
- package/dist/webscrape.d.ts.map +1 -0
- package/dist/webscrape.js +2697 -0
- package/dist/webscrape.js.map +1 -0
- package/docker.config +769 -0
- package/docs/CONVERSA.txt +1523 -0
- package/docs/alternatives.md +499 -0
- package/docs/architecture-1.8.19.md +76 -0
- package/docs/architecture-1.8.19.mmd +33 -0
- package/docs/architecture-1.8.19.png +0 -0
- package/docs/architecture.md +355 -0
- package/docs/brancharchive-2026-08-18.md +18 -0
- package/docs/browser.md +7 -0
- package/docs/consolidation.md +70 -0
- package/docs/e2ugh-engine.md +528 -0
- package/{dist/examples/localjob.js → docs/example-localjob.ts} +3 -3
- package/{dist/examples/publicapi.js → docs/example-publicapi.ts} +2 -2
- package/docs/hardware.md +342 -0
- package/docs/optimization.md +126 -0
- package/docs/performance.md +499 -0
- package/docs/planning.1.8.18.md +94 -0
- package/docs/planning.1.8.19.md +49 -0
- package/docs/releasenotes-1.8.19.md +35 -0
- package/docs/research-1.8.19-virtual-browser.md +27 -0
- package/docs/security.md +454 -0
- package/docs/todo-1.8.18.md +12 -0
- package/docs/todo-1.8.19.md +241 -0
- package/docs/viability.md +777 -0
- package/docs/virtualization.md +335 -0
- package/docs/web-duplicatecleanup.md +9 -0
- package/docs/web-ideas.md +106 -0
- package/docs/workflowimprovements-2026-08-19.md +70 -0
- package/gpumonitor.cpp +1543 -0
- package/gpus.json +2408 -0
- package/index.ts +1478 -0
- package/media.ts +1337 -0
- package/mttg.config +1549 -0
- package/orchestrator.ts +5462 -0
- package/package.json +304 -56
- package/passage.config +1331 -0
- package/performance.ts +1049 -0
- package/processors.json +2217 -0
- package/qemu.config +1062 -0
- package/qemubridge.py +1340 -0
- package/quantum.ts +2393 -0
- package/render.ts +1325 -0
- package/scheduler.ts +1600 -0
- package/security.ts +1449 -0
- package/tiers.ts +2871 -0
- package/tsconfig.json +29 -0
- package/virtualcpu.ts +1273 -0
- package/virtualgpu.ts +1181 -0
- package/virtualhardware.c +1011 -0
- package/virtualhardware.json +739 -0
- package/virtualization.ts +1628 -0
- package/virtualizationcore.cpp +4635 -0
- package/virtualmemory.ts +2303 -0
- package/vm.config.json +1910 -0
- package/{extension → web/extension}/manifest.json +1 -1
- package/web/readme.md +382 -0
- package/web/tsconfig.json +25 -0
- package/dist/adapters/forge.d.ts +0 -17
- package/dist/adapters/forge.d.ts.map +0 -1
- package/dist/adapters/forge.js +0 -19
- package/dist/adapters/forge.js.map +0 -1
- package/dist/adapters/forgejo.d.ts +0 -49
- package/dist/adapters/forgejo.d.ts.map +0 -1
- package/dist/adapters/forgejo.js +0 -8
- package/dist/adapters/forgejo.js.map +0 -1
- package/dist/adapters/github.d.ts +0 -12
- package/dist/adapters/github.d.ts.map +0 -1
- package/dist/adapters/github.js +0 -20
- package/dist/adapters/github.js.map +0 -1
- package/dist/adapters/gitlab.d.ts +0 -17
- package/dist/adapters/gitlab.d.ts.map +0 -1
- package/dist/adapters/gitlab.js +0 -10
- package/dist/adapters/gitlab.js.map +0 -1
- package/dist/adapters/huggingface.d.ts +0 -17
- package/dist/adapters/huggingface.d.ts.map +0 -1
- package/dist/adapters/huggingface.js +0 -6
- package/dist/adapters/huggingface.js.map +0 -1
- package/dist/adapters/socket.d.ts +0 -11
- package/dist/adapters/socket.d.ts.map +0 -1
- package/dist/adapters/socket.js +0 -17
- package/dist/adapters/socket.js.map +0 -1
- package/dist/adapters/transport.d.ts +0 -7
- package/dist/adapters/transport.d.ts.map +0 -1
- package/dist/adapters/transport.js +0 -36
- package/dist/adapters/transport.js.map +0 -1
- package/dist/ai/chunk.d.ts +0 -2
- package/dist/ai/chunk.d.ts.map +0 -1
- package/dist/ai/chunk.js +0 -36
- package/dist/ai/chunk.js.map +0 -1
- package/dist/ai/llmstxt.d.ts +0 -6
- package/dist/ai/llmstxt.d.ts.map +0 -1
- package/dist/ai/llmstxt.js +0 -12
- package/dist/ai/llmstxt.js.map +0 -1
- package/dist/ai/provenance.d.ts +0 -22
- package/dist/ai/provenance.d.ts.map +0 -1
- package/dist/ai/provenance.js +0 -25
- package/dist/ai/provenance.js.map +0 -1
- package/dist/ai/rag.d.ts +0 -26
- package/dist/ai/rag.d.ts.map +0 -1
- package/dist/ai/rag.js +0 -22
- package/dist/ai/rag.js.map +0 -1
- package/dist/ai/tokens.d.ts +0 -15
- package/dist/ai/tokens.d.ts.map +0 -1
- package/dist/ai/tokens.js +0 -9
- package/dist/ai/tokens.js.map +0 -1
- package/dist/api/auth.d.ts +0 -16
- package/dist/api/auth.d.ts.map +0 -1
- package/dist/api/auth.js +0 -19
- package/dist/api/auth.js.map +0 -1
- package/dist/api/contracts.d.ts +0 -28
- package/dist/api/contracts.d.ts.map +0 -1
- package/dist/api/contracts.js +0 -14
- package/dist/api/contracts.js.map +0 -1
- package/dist/api/control.d.ts +0 -10
- package/dist/api/control.d.ts.map +0 -1
- package/dist/api/control.js +0 -35
- package/dist/api/control.js.map +0 -1
- package/dist/api/http.d.ts +0 -7
- package/dist/api/http.d.ts.map +0 -1
- package/dist/api/http.js +0 -12
- package/dist/api/http.js.map +0 -1
- package/dist/api/rate.d.ts +0 -28
- package/dist/api/rate.d.ts.map +0 -1
- package/dist/api/rate.js +0 -36
- package/dist/api/rate.js.map +0 -1
- package/dist/api/security.d.ts +0 -12
- package/dist/api/security.d.ts.map +0 -1
- package/dist/api/security.js +0 -56
- package/dist/api/security.js.map +0 -1
- package/dist/api/service.d.ts +0 -5
- package/dist/api/service.d.ts.map +0 -1
- package/dist/api/service.js +0 -70
- package/dist/api/service.js.map +0 -1
- package/dist/apps/registry.d.ts +0 -33
- package/dist/apps/registry.d.ts.map +0 -1
- package/dist/apps/registry.js +0 -24
- package/dist/apps/registry.js.map +0 -1
- package/dist/binary/archive.d.ts +0 -27
- package/dist/binary/archive.d.ts.map +0 -1
- package/dist/binary/archive.js +0 -46
- package/dist/binary/archive.js.map +0 -1
- package/dist/binary/build.d.ts +0 -29
- package/dist/binary/build.d.ts.map +0 -1
- package/dist/binary/build.js +0 -17
- package/dist/binary/build.js.map +0 -1
- package/dist/binary/transform.d.ts +0 -70
- package/dist/binary/transform.d.ts.map +0 -1
- package/dist/binary/transform.js +0 -105
- package/dist/binary/transform.js.map +0 -1
- package/dist/bot/adapter.d.ts +0 -5
- package/dist/bot/adapter.d.ts.map +0 -1
- package/dist/bot/adapter.js +0 -11
- package/dist/bot/adapter.js.map +0 -1
- package/dist/bot/bot.d.ts +0 -28
- package/dist/bot/bot.d.ts.map +0 -1
- package/dist/bot/bot.js +0 -52
- package/dist/bot/bot.js.map +0 -1
- package/dist/bot/commands.d.ts +0 -8
- package/dist/bot/commands.d.ts.map +0 -1
- package/dist/bot/commands.js +0 -19
- package/dist/bot/commands.js.map +0 -1
- package/dist/bot/permissions.d.ts +0 -13
- package/dist/bot/permissions.d.ts.map +0 -1
- package/dist/bot/permissions.js +0 -16
- package/dist/bot/permissions.js.map +0 -1
- package/dist/browser/actions.d.ts +0 -33
- package/dist/browser/actions.d.ts.map +0 -1
- package/dist/browser/actions.js +0 -44
- package/dist/browser/actions.js.map +0 -1
- package/dist/browser/agent.d.ts +0 -21
- package/dist/browser/agent.d.ts.map +0 -1
- package/dist/browser/agent.js +0 -13
- package/dist/browser/agent.js.map +0 -1
- package/dist/browser/context.d.ts +0 -43
- package/dist/browser/context.d.ts.map +0 -1
- package/dist/browser/context.js +0 -54
- package/dist/browser/context.js.map +0 -1
- package/dist/browser/fingerprint.d.ts +0 -4
- package/dist/browser/fingerprint.d.ts.map +0 -1
- package/dist/browser/fingerprint.js +0 -12
- package/dist/browser/fingerprint.js.map +0 -1
- package/dist/browser/index.d.ts +0 -11
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js +0 -11
- package/dist/browser/index.js.map +0 -1
- package/dist/browser/playwright.d.ts +0 -11
- package/dist/browser/playwright.d.ts.map +0 -1
- package/dist/browser/playwright.js +0 -24
- package/dist/browser/playwright.js.map +0 -1
- package/dist/browser/recorder.d.ts +0 -21
- package/dist/browser/recorder.d.ts.map +0 -1
- package/dist/browser/recorder.js +0 -58
- package/dist/browser/recorder.js.map +0 -1
- package/dist/browser/session.d.ts +0 -14
- package/dist/browser/session.d.ts.map +0 -1
- package/dist/browser/session.js +0 -21
- package/dist/browser/session.js.map +0 -1
- package/dist/browser/snapshot.d.ts +0 -69
- package/dist/browser/snapshot.d.ts.map +0 -1
- package/dist/browser/snapshot.js +0 -133
- package/dist/browser/snapshot.js.map +0 -1
- package/dist/captcha/contract.d.ts +0 -35
- package/dist/captcha/contract.d.ts.map +0 -1
- package/dist/captcha/contract.js +0 -17
- package/dist/captcha/contract.js.map +0 -1
- package/dist/captcha/evidence.d.ts +0 -10
- package/dist/captcha/evidence.d.ts.map +0 -1
- package/dist/captcha/evidence.js +0 -9
- package/dist/captcha/evidence.js.map +0 -1
- package/dist/captcha/guard.d.ts +0 -23
- package/dist/captcha/guard.d.ts.map +0 -1
- package/dist/captcha/guard.js +0 -12
- package/dist/captcha/guard.js.map +0 -1
- package/dist/cli/main.d.ts +0 -4
- package/dist/cli/main.d.ts.map +0 -1
- package/dist/cli/main.js +0 -46
- package/dist/cli/main.js.map +0 -1
- package/dist/core/errors.d.ts +0 -84
- package/dist/core/errors.d.ts.map +0 -1
- package/dist/core/errors.js +0 -54
- package/dist/core/errors.js.map +0 -1
- package/dist/core/events.d.ts +0 -9
- package/dist/core/events.d.ts.map +0 -1
- package/dist/core/events.js +0 -21
- package/dist/core/events.js.map +0 -1
- package/dist/core/hash.d.ts +0 -10
- package/dist/core/hash.d.ts.map +0 -1
- package/dist/core/hash.js +0 -82
- package/dist/core/hash.js.map +0 -1
- package/dist/core/ids.d.ts +0 -10
- package/dist/core/ids.d.ts.map +0 -1
- package/dist/core/ids.js +0 -15
- package/dist/core/ids.js.map +0 -1
- package/dist/delivery/manifest.d.ts +0 -35
- package/dist/delivery/manifest.d.ts.map +0 -1
- package/dist/delivery/manifest.js +0 -68
- package/dist/delivery/manifest.js.map +0 -1
- package/dist/deploy/index.d.ts +0 -6
- package/dist/deploy/index.d.ts.map +0 -1
- package/dist/deploy/index.js +0 -6
- package/dist/deploy/index.js.map +0 -1
- package/dist/dispatch/resumable.d.ts +0 -102
- package/dist/dispatch/resumable.d.ts.map +0 -1
- package/dist/dispatch/resumable.js +0 -64
- package/dist/dispatch/resumable.js.map +0 -1
- package/dist/dispatch/workflow.d.ts +0 -6
- package/dist/dispatch/workflow.d.ts.map +0 -1
- package/dist/dispatch/workflow.js +0 -37
- package/dist/dispatch/workflow.js.map +0 -1
- package/dist/domain/artifacts.d.ts +0 -12
- package/dist/domain/artifacts.d.ts.map +0 -1
- package/dist/domain/artifacts.js +0 -14
- package/dist/domain/artifacts.js.map +0 -1
- package/dist/domain/jobs.d.ts +0 -12
- package/dist/domain/jobs.d.ts.map +0 -1
- package/dist/domain/jobs.js +0 -20
- package/dist/domain/jobs.js.map +0 -1
- package/dist/domain/providers.d.ts +0 -10
- package/dist/domain/providers.d.ts.map +0 -1
- package/dist/domain/providers.js +0 -8
- package/dist/domain/providers.js.map +0 -1
- package/dist/domain/runtime.d.ts +0 -14
- package/dist/domain/runtime.d.ts.map +0 -1
- package/dist/domain/runtime.js +0 -10
- package/dist/domain/runtime.js.map +0 -1
- package/dist/domain/sessions.d.ts +0 -12
- package/dist/domain/sessions.d.ts.map +0 -1
- package/dist/domain/sessions.js +0 -57
- package/dist/domain/sessions.js.map +0 -1
- package/dist/examples/localjob.d.ts +0 -2
- package/dist/examples/localjob.d.ts.map +0 -1
- package/dist/examples/localjob.js.map +0 -1
- package/dist/examples/publicapi.d.ts +0 -2
- package/dist/examples/publicapi.d.ts.map +0 -1
- package/dist/examples/publicapi.js.map +0 -1
- package/dist/extension/build.d.ts +0 -9
- package/dist/extension/build.d.ts.map +0 -1
- package/dist/extension/build.js +0 -85
- package/dist/extension/build.js.map +0 -1
- package/dist/extension/content.d.ts +0 -6
- package/dist/extension/content.d.ts.map +0 -1
- package/dist/extension/content.js +0 -135
- package/dist/extension/content.js.map +0 -1
- package/dist/extension/index.d.ts +0 -7
- package/dist/extension/index.d.ts.map +0 -1
- package/dist/extension/index.js +0 -7
- package/dist/extension/index.js.map +0 -1
- package/dist/extension/pagebridge.d.ts +0 -6
- package/dist/extension/pagebridge.d.ts.map +0 -1
- package/dist/extension/pagebridge.js +0 -42
- package/dist/extension/pagebridge.js.map +0 -1
- package/dist/extension/permissions.d.ts +0 -26
- package/dist/extension/permissions.d.ts.map +0 -1
- package/dist/extension/permissions.js +0 -28
- package/dist/extension/permissions.js.map +0 -1
- package/dist/extension/popup.d.ts +0 -5
- package/dist/extension/popup.d.ts.map +0 -1
- package/dist/extension/popup.js +0 -26
- package/dist/extension/popup.js.map +0 -1
- package/dist/extension/protocol.d.ts +0 -58
- package/dist/extension/protocol.d.ts.map +0 -1
- package/dist/extension/protocol.js +0 -101
- package/dist/extension/protocol.js.map +0 -1
- package/dist/extension/serviceworker.d.ts +0 -25
- package/dist/extension/serviceworker.d.ts.map +0 -1
- package/dist/extension/serviceworker.js +0 -102
- package/dist/extension/serviceworker.js.map +0 -1
- package/dist/extension/worker.d.ts +0 -28
- package/dist/extension/worker.d.ts.map +0 -1
- package/dist/extension/worker.js +0 -22
- package/dist/extension/worker.js.map +0 -1
- package/dist/format/check.d.ts +0 -8
- package/dist/format/check.d.ts.map +0 -1
- package/dist/format/check.js +0 -38
- package/dist/format/check.js.map +0 -1
- package/dist/isolation/contracts.d.ts.map +0 -1
- package/dist/isolation/contracts.js.map +0 -1
- package/dist/library/public.d.ts.map +0 -1
- package/dist/library/public.js.map +0 -1
- package/dist/mcp/browser.d.ts +0 -9
- package/dist/mcp/browser.d.ts.map +0 -1
- package/dist/mcp/browser.js +0 -13
- package/dist/mcp/browser.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -35
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -40
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/transport.d.ts +0 -7
- package/dist/mcp/transport.d.ts.map +0 -1
- package/dist/mcp/transport.js +0 -17
- package/dist/mcp/transport.js.map +0 -1
- package/dist/memory/bridge.d.ts +0 -14
- package/dist/memory/bridge.d.ts.map +0 -1
- package/dist/memory/bridge.js +0 -16
- package/dist/memory/bridge.js.map +0 -1
- package/dist/memory/engine.d.ts +0 -38
- package/dist/memory/engine.d.ts.map +0 -1
- package/dist/memory/engine.js +0 -109
- package/dist/memory/engine.js.map +0 -1
- package/dist/memory/modes.d.ts +0 -43
- package/dist/memory/modes.d.ts.map +0 -1
- package/dist/memory/modes.js +0 -66
- package/dist/memory/modes.js.map +0 -1
- package/dist/memory/objects.d.ts +0 -21
- package/dist/memory/objects.d.ts.map +0 -1
- package/dist/memory/objects.js +0 -20
- package/dist/memory/objects.js.map +0 -1
- package/dist/memory/planner.d.ts +0 -66
- package/dist/memory/planner.d.ts.map +0 -1
- package/dist/memory/planner.js +0 -108
- package/dist/memory/planner.js.map +0 -1
- package/dist/memory/targets.d.ts +0 -78
- package/dist/memory/targets.d.ts.map +0 -1
- package/dist/memory/targets.js +0 -29
- package/dist/memory/targets.js.map +0 -1
- package/dist/memory/transforms.d.ts +0 -19
- package/dist/memory/transforms.d.ts.map +0 -1
- package/dist/memory/transforms.js +0 -14
- package/dist/memory/transforms.js.map +0 -1
- package/dist/modes/matrix.d.ts +0 -23
- package/dist/modes/matrix.d.ts.map +0 -1
- package/dist/modes/matrix.js +0 -18
- package/dist/modes/matrix.js.map +0 -1
- package/dist/modes/modes.d.ts +0 -33
- package/dist/modes/modes.d.ts.map +0 -1
- package/dist/modes/modes.js +0 -15
- package/dist/modes/modes.js.map +0 -1
- package/dist/modes/resolve.d.ts +0 -96
- package/dist/modes/resolve.d.ts.map +0 -1
- package/dist/modes/resolve.js +0 -48
- package/dist/modes/resolve.js.map +0 -1
- package/dist/observability/metrics.d.ts +0 -14
- package/dist/observability/metrics.d.ts.map +0 -1
- package/dist/observability/metrics.js +0 -18
- package/dist/observability/metrics.js.map +0 -1
- package/dist/packager/manifest.d.ts +0 -66
- package/dist/packager/manifest.d.ts.map +0 -1
- package/dist/packager/manifest.js +0 -94
- package/dist/packager/manifest.js.map +0 -1
- package/dist/packager/publish.d.ts +0 -51
- package/dist/packager/publish.d.ts.map +0 -1
- package/dist/packager/publish.js +0 -18
- package/dist/packager/publish.js.map +0 -1
- package/dist/packager/targetcli.d.ts +0 -7
- package/dist/packager/targetcli.d.ts.map +0 -1
- package/dist/packager/targetcli.js +0 -22
- package/dist/packager/targetcli.js.map +0 -1
- package/dist/persistence/adapter.d.ts +0 -5
- package/dist/persistence/adapter.d.ts.map +0 -1
- package/dist/persistence/adapter.js +0 -11
- package/dist/persistence/adapter.js.map +0 -1
- package/dist/persistence/drizzle.d.ts +0 -2
- package/dist/persistence/drizzle.d.ts.map +0 -1
- package/dist/persistence/drizzle.js +0 -12
- package/dist/persistence/drizzle.js.map +0 -1
- package/dist/persistence/memory.d.ts +0 -2
- package/dist/persistence/memory.d.ts.map +0 -1
- package/dist/persistence/memory.js +0 -27
- package/dist/persistence/memory.js.map +0 -1
- package/dist/persistence/migrations.d.ts +0 -19
- package/dist/persistence/migrations.d.ts.map +0 -1
- package/dist/persistence/migrations.js +0 -13
- package/dist/persistence/migrations.js.map +0 -1
- package/dist/persistence/prisma.d.ts +0 -2
- package/dist/persistence/prisma.d.ts.map +0 -1
- package/dist/persistence/prisma.js +0 -25
- package/dist/persistence/prisma.js.map +0 -1
- package/dist/persistence/schema.d.ts +0 -63
- package/dist/persistence/schema.d.ts.map +0 -1
- package/dist/persistence/schema.js +0 -28
- package/dist/persistence/schema.js.map +0 -1
- package/dist/persistence/sql.d.ts +0 -3
- package/dist/persistence/sql.d.ts.map +0 -1
- package/dist/persistence/sql.js +0 -37
- package/dist/persistence/sql.js.map +0 -1
- package/dist/protocol/blocks.d.ts +0 -10
- package/dist/protocol/blocks.d.ts.map +0 -1
- package/dist/protocol/blocks.js +0 -26
- package/dist/protocol/blocks.js.map +0 -1
- package/dist/protocol/json.d.ts +0 -6
- package/dist/protocol/json.d.ts.map +0 -1
- package/dist/protocol/json.js +0 -6
- package/dist/protocol/json.js.map +0 -1
- package/dist/protocol/ndjson.d.ts +0 -3
- package/dist/protocol/ndjson.d.ts.map +0 -1
- package/dist/protocol/ndjson.js +0 -20
- package/dist/protocol/ndjson.js.map +0 -1
- package/dist/protocol/sse.d.ts +0 -7
- package/dist/protocol/sse.d.ts.map +0 -1
- package/dist/protocol/sse.js +0 -25
- package/dist/protocol/sse.js.map +0 -1
- package/dist/proxy/pool.d.ts +0 -9
- package/dist/proxy/pool.d.ts.map +0 -1
- package/dist/proxy/pool.js +0 -27
- package/dist/proxy/pool.js.map +0 -1
- package/dist/queue/idempotency.d.ts +0 -10
- package/dist/queue/idempotency.d.ts.map +0 -1
- package/dist/queue/idempotency.js +0 -13
- package/dist/queue/idempotency.js.map +0 -1
- package/dist/queue/persistent.d.ts +0 -14
- package/dist/queue/persistent.d.ts.map +0 -1
- package/dist/queue/persistent.js +0 -66
- package/dist/queue/persistent.js.map +0 -1
- package/dist/queue/queue.d.ts +0 -7
- package/dist/queue/queue.d.ts.map +0 -1
- package/dist/queue/queue.js +0 -55
- package/dist/queue/queue.js.map +0 -1
- package/dist/queue/saga.d.ts +0 -5
- package/dist/queue/saga.d.ts.map +0 -1
- package/dist/queue/saga.js +0 -20
- package/dist/queue/saga.js.map +0 -1
- package/dist/release/assets.d.ts +0 -144
- package/dist/release/assets.d.ts.map +0 -1
- package/dist/release/assets.js +0 -157
- package/dist/release/assets.js.map +0 -1
- package/dist/release/evidence.d.ts +0 -92
- package/dist/release/evidence.d.ts.map +0 -1
- package/dist/release/evidence.js +0 -148
- package/dist/release/evidence.js.map +0 -1
- package/dist/release/verify.d.ts +0 -12
- package/dist/release/verify.d.ts.map +0 -1
- package/dist/release/verify.js +0 -112
- package/dist/release/verify.js.map +0 -1
- package/dist/runners/chain.d.ts +0 -125
- package/dist/runners/chain.d.ts.map +0 -1
- package/dist/runners/chain.js +0 -95
- package/dist/runners/chain.js.map +0 -1
- package/dist/runners/health.d.ts +0 -36
- package/dist/runners/health.d.ts.map +0 -1
- package/dist/runners/health.js +0 -26
- package/dist/runners/health.js.map +0 -1
- package/dist/runners/heartbeat.d.ts +0 -23
- package/dist/runners/heartbeat.d.ts.map +0 -1
- package/dist/runners/heartbeat.js +0 -29
- package/dist/runners/heartbeat.js.map +0 -1
- package/dist/runners/inprocess.d.ts +0 -17
- package/dist/runners/inprocess.d.ts.map +0 -1
- package/dist/runners/inprocess.js +0 -20
- package/dist/runners/inprocess.js.map +0 -1
- package/dist/runners/scheduler.d.ts +0 -5
- package/dist/runners/scheduler.d.ts.map +0 -1
- package/dist/runners/scheduler.js +0 -19
- package/dist/runners/scheduler.js.map +0 -1
- package/dist/runtime/abort.d.ts +0 -8
- package/dist/runtime/abort.d.ts.map +0 -1
- package/dist/runtime/abort.js +0 -13
- package/dist/runtime/abort.js.map +0 -1
- package/dist/runtime/compatibility.d.ts +0 -37
- package/dist/runtime/compatibility.d.ts.map +0 -1
- package/dist/runtime/compatibility.js +0 -10
- package/dist/runtime/compatibility.js.map +0 -1
- package/dist/runtime/detect.d.ts +0 -13
- package/dist/runtime/detect.d.ts.map +0 -1
- package/dist/runtime/detect.js +0 -18
- package/dist/runtime/detect.js.map +0 -1
- package/dist/runtime/engine.d.ts +0 -20
- package/dist/runtime/engine.d.ts.map +0 -1
- package/dist/runtime/engine.js +0 -61
- package/dist/runtime/engine.js.map +0 -1
- package/dist/runtime/retry.d.ts +0 -19
- package/dist/runtime/retry.d.ts.map +0 -1
- package/dist/runtime/retry.js +0 -54
- package/dist/runtime/retry.js.map +0 -1
- package/dist/runtime/worker.d.ts +0 -10
- package/dist/runtime/worker.d.ts.map +0 -1
- package/dist/runtime/worker.js +0 -25
- package/dist/runtime/worker.js.map +0 -1
- package/dist/scrape/cache.d.ts +0 -45
- package/dist/scrape/cache.d.ts.map +0 -1
- package/dist/scrape/cache.js +0 -45
- package/dist/scrape/cache.js.map +0 -1
- package/dist/scrape/crawl.d.ts +0 -47
- package/dist/scrape/crawl.d.ts.map +0 -1
- package/dist/scrape/crawl.js +0 -114
- package/dist/scrape/crawl.js.map +0 -1
- package/dist/scrape/extract.d.ts +0 -63
- package/dist/scrape/extract.d.ts.map +0 -1
- package/dist/scrape/extract.js +0 -47
- package/dist/scrape/extract.js.map +0 -1
- package/dist/scrape/normalize.d.ts +0 -52
- package/dist/scrape/normalize.d.ts.map +0 -1
- package/dist/scrape/normalize.js +0 -102
- package/dist/scrape/normalize.js.map +0 -1
- package/dist/scrape/robots.d.ts +0 -37
- package/dist/scrape/robots.d.ts.map +0 -1
- package/dist/scrape/robots.js +0 -71
- package/dist/scrape/robots.js.map +0 -1
- package/dist/scrape/schema.d.ts +0 -23
- package/dist/scrape/schema.d.ts.map +0 -1
- package/dist/scrape/schema.js +0 -92
- package/dist/scrape/schema.js.map +0 -1
- package/dist/scrape/scraper.d.ts +0 -6
- package/dist/scrape/scraper.d.ts.map +0 -1
- package/dist/scrape/scraper.js +0 -46
- package/dist/scrape/scraper.js.map +0 -1
- package/dist/scrape/semantic.d.ts +0 -25
- package/dist/scrape/semantic.d.ts.map +0 -1
- package/dist/scrape/semantic.js +0 -27
- package/dist/scrape/semantic.js.map +0 -1
- package/dist/server/node.d.ts +0 -7
- package/dist/server/node.d.ts.map +0 -1
- package/dist/server/node.js.map +0 -1
- package/dist/sessions/file.d.ts +0 -25
- package/dist/sessions/file.d.ts.map +0 -1
- package/dist/sessions/file.js +0 -13
- package/dist/sessions/file.js.map +0 -1
- package/dist/sessions/replay.d.ts +0 -9
- package/dist/sessions/replay.d.ts.map +0 -1
- package/dist/sessions/replay.js +0 -70
- package/dist/sessions/replay.js.map +0 -1
- package/dist/sessions/store.d.ts +0 -25
- package/dist/sessions/store.d.ts.map +0 -1
- package/dist/sessions/store.js +0 -13
- package/dist/sessions/store.js.map +0 -1
- package/dist/storage/adapter.d.ts +0 -5
- package/dist/storage/adapter.d.ts.map +0 -1
- package/dist/storage/adapter.js +0 -11
- package/dist/storage/adapter.js.map +0 -1
- package/dist/storage/cache.d.ts +0 -23
- package/dist/storage/cache.d.ts.map +0 -1
- package/dist/storage/cache.js +0 -79
- package/dist/storage/cache.js.map +0 -1
- package/dist/storage/checksum.d.ts +0 -3
- package/dist/storage/checksum.d.ts.map +0 -1
- package/dist/storage/checksum.js +0 -19
- package/dist/storage/checksum.js.map +0 -1
- package/dist/storage/chunked.d.ts +0 -21
- package/dist/storage/chunked.d.ts.map +0 -1
- package/dist/storage/chunked.js +0 -67
- package/dist/storage/chunked.js.map +0 -1
- package/dist/storage/content.d.ts +0 -24
- package/dist/storage/content.d.ts.map +0 -1
- package/dist/storage/content.js +0 -44
- package/dist/storage/content.js.map +0 -1
- package/dist/storage/filehosting.d.ts +0 -2
- package/dist/storage/filehosting.d.ts.map +0 -1
- package/dist/storage/filehosting.js +0 -24
- package/dist/storage/filehosting.js.map +0 -1
- package/dist/storage/githubcontents.d.ts +0 -2
- package/dist/storage/githubcontents.d.ts.map +0 -1
- package/dist/storage/githubcontents.js +0 -29
- package/dist/storage/githubcontents.js.map +0 -1
- package/dist/storage/index.d.ts +0 -12
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js +0 -12
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/local.d.ts +0 -2
- package/dist/storage/local.d.ts.map +0 -1
- package/dist/storage/local.js +0 -72
- package/dist/storage/local.js.map +0 -1
- package/dist/storage/memory.d.ts +0 -6
- package/dist/storage/memory.d.ts.map +0 -1
- package/dist/storage/memory.js +0 -36
- package/dist/storage/memory.js.map +0 -1
- package/dist/storage/pool.d.ts +0 -95
- package/dist/storage/pool.d.ts.map +0 -1
- package/dist/storage/pool.js +0 -202
- package/dist/storage/pool.js.map +0 -1
- package/dist/storage/s3compatible.d.ts +0 -3
- package/dist/storage/s3compatible.d.ts.map +0 -1
- package/dist/storage/s3compatible.js +0 -70
- package/dist/storage/s3compatible.js.map +0 -1
- package/dist/storage/sync.d.ts +0 -47
- package/dist/storage/sync.d.ts.map +0 -1
- package/dist/storage/sync.js +0 -75
- package/dist/storage/sync.js.map +0 -1
- package/dist/surfaces/adapters.d.ts +0 -97
- package/dist/surfaces/adapters.d.ts.map +0 -1
- package/dist/surfaces/adapters.js +0 -50
- package/dist/surfaces/adapters.js.map +0 -1
- package/dist/surfaces/controls.d.ts +0 -18
- package/dist/surfaces/controls.d.ts.map +0 -1
- package/dist/surfaces/controls.js +0 -45
- package/dist/surfaces/controls.js.map +0 -1
- package/dist/surfaces/manifest.d.ts +0 -68
- package/dist/surfaces/manifest.d.ts.map +0 -1
- package/dist/surfaces/manifest.js +0 -42
- package/dist/surfaces/manifest.js.map +0 -1
- package/dist/surfaces/n8n.d.ts +0 -25
- package/dist/surfaces/n8n.d.ts.map +0 -1
- package/dist/surfaces/n8n.js +0 -31
- package/dist/surfaces/n8n.js.map +0 -1
- package/dist/surfaces/operations.d.ts +0 -32
- package/dist/surfaces/operations.d.ts.map +0 -1
- package/dist/surfaces/operations.js +0 -53
- package/dist/surfaces/operations.js.map +0 -1
- package/dist/surfaces/requirements.d.ts +0 -29
- package/dist/surfaces/requirements.d.ts.map +0 -1
- package/dist/surfaces/requirements.js +0 -50
- package/dist/surfaces/requirements.js.map +0 -1
- package/dist/surfaces/targets.d.ts +0 -196
- package/dist/surfaces/targets.d.ts.map +0 -1
- package/dist/surfaces/targets.js +0 -27
- package/dist/surfaces/targets.js.map +0 -1
- package/dist/webhook/delivery.d.ts +0 -18
- package/dist/webhook/delivery.d.ts.map +0 -1
- package/dist/webhook/delivery.js +0 -36
- package/dist/webhook/delivery.js.map +0 -1
- package/dist/webhook/receiver.d.ts +0 -26
- package/dist/webhook/receiver.d.ts.map +0 -1
- package/dist/webhook/receiver.js +0 -24
- package/dist/webhook/receiver.js.map +0 -1
- package/dist/webhook/signature.d.ts +0 -3
- package/dist/webhook/signature.d.ts.map +0 -1
- package/dist/webhook/signature.js +0 -7
- package/dist/webhook/signature.js.map +0 -1
- package/dist/workflow/manifest.d.ts +0 -22
- package/dist/workflow/manifest.d.ts.map +0 -1
- package/dist/workflow/manifest.js +0 -21
- package/dist/workflow/manifest.js.map +0 -1
- package/dist/workflow/registry.d.ts +0 -7
- package/dist/workflow/registry.d.ts.map +0 -1
- package/dist/workflow/registry.js +0 -18
- package/dist/workflow/registry.js.map +0 -1
- package/dist/workflow/templates.d.ts +0 -6
- package/dist/workflow/templates.d.ts.map +0 -1
- package/dist/workflow/templates.js +0 -18
- package/dist/workflow/templates.js.map +0 -1
- package/dist/workflow/triggers.d.ts +0 -64
- package/dist/workflow/triggers.d.ts.map +0 -1
- package/dist/workflow/triggers.js +0 -99
- package/dist/workflow/triggers.js.map +0 -1
- /package/{extension/README.md → docs/extension.md} +0 -0
|
@@ -0,0 +1,1180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* virtualcpu - virtual processor bank and procfs generators.
|
|
3
|
+
*
|
|
4
|
+
* This module embeds the BEST_VIRTUAL_PROCESSORS bank with real, verified
|
|
5
|
+
* specifications of the strongest server, workstation and desktop processors
|
|
6
|
+
* available on 2026-08-22 (AMD EPYC 9965 Turin, Ryzen 9 9950X3D, Threadripper
|
|
7
|
+
* PRO 9995WX, Threadripper 7980X, Intel Core Ultra 9 285K, AMD EPYC 9955) and
|
|
8
|
+
* converts any of them into byte-accurate procfs texts: generateVirtualCpuinfo
|
|
9
|
+
* renders a complete /proc/cpuinfo payload with vendor identity, family,
|
|
10
|
+
* model, topology, cache sizes and the full Zen 5 flag set (avx512f, avx512bw,
|
|
11
|
+
* avx512cd, avx512dq, avx512vl, avx512_bf16, sha_ni and friends), while
|
|
12
|
+
* generateVirtualLscpu renders the util-linux summary with NUMA ranges and
|
|
13
|
+
* vulnerability lines. The module also owns the cpuRegistry, a fluent
|
|
14
|
+
* virtualcpubuilder, a processor factory, topology solving, capability
|
|
15
|
+
* scoring, the marchFlag/validateCpuCount helpers absorbed from the v2 stub
|
|
16
|
+
* and the boards() socket index.
|
|
17
|
+
*
|
|
18
|
+
* /proc/meminfo generation (generateVirtualMeminfo, meminfoptions and
|
|
19
|
+
* pagealign) moved to virtualmemory.ts in the v2 reorganization so every
|
|
20
|
+
* memory concern lives in one module.
|
|
21
|
+
*
|
|
22
|
+
* Data sources (verified 2026-08-22): amd.com product pages (EPYC 9965,
|
|
23
|
+
* EPYC 9955, Ryzen 9 9950X3D, Threadripper PRO 9995WX), intel.com ARK
|
|
24
|
+
* (Core Ultra 9 285K), techpowerup.com CPU database and the QEMU 11.1.0
|
|
25
|
+
* target/i386 CPU model table (EPYC-v5).
|
|
26
|
+
*
|
|
27
|
+
* Contexts (24): hardwareerror, vendorid, vendorprofile, ZEN5FLAGS,
|
|
28
|
+
* ARROWLAKEFLAGS, vendorprofiles, virtualcpuspec, BEST_VIRTUAL_PROCESSORS,
|
|
29
|
+
* cpuRegistry, solvetopology, generateVirtualCpuinfo, generateVirtualLscpu,
|
|
30
|
+
* virtualcpubuilder, createVirtualProcessor, validateCpuCount, marchFlag,
|
|
31
|
+
* boards, cpuscore, compareVirtualProcessors, listBestVirtualProcessors,
|
|
32
|
+
* serializeprovisionedcpu, modellease, stableModelId, virtualcpudemo.
|
|
33
|
+
*
|
|
34
|
+
* Patterns: registry (cpuRegistry), builder (virtualcpubuilder), factory
|
|
35
|
+
* (createVirtualProcessor), proxy-free disposable lease (modellease).
|
|
36
|
+
* Rules: lowercase identifiers, english jsdoc, third person, no emoji,
|
|
37
|
+
* try/catch catcher on every fallible path, node:* built-ins only, and no
|
|
38
|
+
* hardcoded localhost address anywhere.
|
|
39
|
+
*/
|
|
40
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
41
|
+
if (value !== null && value !== void 0) {
|
|
42
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
43
|
+
var dispose, inner;
|
|
44
|
+
if (async) {
|
|
45
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
46
|
+
dispose = value[Symbol.asyncDispose];
|
|
47
|
+
}
|
|
48
|
+
if (dispose === void 0) {
|
|
49
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
50
|
+
dispose = value[Symbol.dispose];
|
|
51
|
+
if (async) inner = dispose;
|
|
52
|
+
}
|
|
53
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
54
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
55
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
56
|
+
}
|
|
57
|
+
else if (async) {
|
|
58
|
+
env.stack.push({ async: true });
|
|
59
|
+
}
|
|
60
|
+
return value;
|
|
61
|
+
};
|
|
62
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
63
|
+
return function (env) {
|
|
64
|
+
function fail(e) {
|
|
65
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
66
|
+
env.hasError = true;
|
|
67
|
+
}
|
|
68
|
+
var r, s = 0;
|
|
69
|
+
function next() {
|
|
70
|
+
while (r = env.stack.pop()) {
|
|
71
|
+
try {
|
|
72
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
73
|
+
if (r.dispose) {
|
|
74
|
+
var result = r.dispose.call(r.value);
|
|
75
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
76
|
+
}
|
|
77
|
+
else s |= 1;
|
|
78
|
+
}
|
|
79
|
+
catch (e) {
|
|
80
|
+
fail(e);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
84
|
+
if (env.hasError) throw env.error;
|
|
85
|
+
}
|
|
86
|
+
return next();
|
|
87
|
+
};
|
|
88
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
89
|
+
var e = new Error(message);
|
|
90
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
91
|
+
});
|
|
92
|
+
import { createHash, randomInt } from 'node:crypto';
|
|
93
|
+
/* ------------------------------------------------------------------ */
|
|
94
|
+
/* Section 1: errors */
|
|
95
|
+
/* ------------------------------------------------------------------ */
|
|
96
|
+
/** Error thrown by every hardware subsystem with an optional cause chain. */
|
|
97
|
+
export class hardwareerror extends Error {
|
|
98
|
+
/** Machine readable subsystem tag. */
|
|
99
|
+
subsystem;
|
|
100
|
+
constructor(message, options) {
|
|
101
|
+
super(message, options);
|
|
102
|
+
this.name = 'hardwareerror';
|
|
103
|
+
this.subsystem = options?.subsystem ?? 'virtualcpu';
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Complete Zen 5 flag set as observed in production /proc/cpuinfo dumps of
|
|
108
|
+
* AMD Turin and Granite Ridge machines. Includes the full AVX-512 family
|
|
109
|
+
* (avx512f, avx512dq, avx512cd, avx512bw, avx512vl, avx512_bf16, avx512vbmi,
|
|
110
|
+
* avx512vbmi2, avx512ifma, avx512vnni, avx512vp2intersect, avx512vpopcntdq,
|
|
111
|
+
* avx512bitalg), the vector crypto extensions (sha_ni, gfni, vaes,
|
|
112
|
+
* vpclmulqdq) and the modern memory extensions (movdiri, movdir64b, fsrm,
|
|
113
|
+
* serialize, cldemote).
|
|
114
|
+
*/
|
|
115
|
+
export const ZEN5FLAGS = [
|
|
116
|
+
'fpu',
|
|
117
|
+
'vme',
|
|
118
|
+
'de',
|
|
119
|
+
'pse',
|
|
120
|
+
'tsc',
|
|
121
|
+
'msr',
|
|
122
|
+
'pae',
|
|
123
|
+
'mce',
|
|
124
|
+
'cx8',
|
|
125
|
+
'apic',
|
|
126
|
+
'sep',
|
|
127
|
+
'mtrr',
|
|
128
|
+
'pge',
|
|
129
|
+
'mca',
|
|
130
|
+
'cmov',
|
|
131
|
+
'pat',
|
|
132
|
+
'pse36',
|
|
133
|
+
'clflush',
|
|
134
|
+
'mmx',
|
|
135
|
+
'fxsr',
|
|
136
|
+
'sse',
|
|
137
|
+
'sse2',
|
|
138
|
+
'ht',
|
|
139
|
+
'syscall',
|
|
140
|
+
'nx',
|
|
141
|
+
'mmxext',
|
|
142
|
+
'fxsr_opt',
|
|
143
|
+
'pdpe1gb',
|
|
144
|
+
'rdtscp',
|
|
145
|
+
'lm',
|
|
146
|
+
'constant_tsc',
|
|
147
|
+
'rep_good',
|
|
148
|
+
'amd_lbr_v2',
|
|
149
|
+
'nopl',
|
|
150
|
+
'nonstop_tsc',
|
|
151
|
+
'cpuid',
|
|
152
|
+
'extd_apicid',
|
|
153
|
+
'aperfmperf',
|
|
154
|
+
'rapl',
|
|
155
|
+
'pni',
|
|
156
|
+
'pclmulqdq',
|
|
157
|
+
'monitor',
|
|
158
|
+
'ssse3',
|
|
159
|
+
'fma',
|
|
160
|
+
'cx16',
|
|
161
|
+
'sse4_1',
|
|
162
|
+
'sse4_2',
|
|
163
|
+
'x2apic',
|
|
164
|
+
'movbe',
|
|
165
|
+
'popcnt',
|
|
166
|
+
'aes',
|
|
167
|
+
'xsave',
|
|
168
|
+
'avx',
|
|
169
|
+
'f16c',
|
|
170
|
+
'rdrand',
|
|
171
|
+
'lahf_lm',
|
|
172
|
+
'cmp_legacy',
|
|
173
|
+
'svm',
|
|
174
|
+
'extapic',
|
|
175
|
+
'cr8_legacy',
|
|
176
|
+
'abm',
|
|
177
|
+
'sse4a',
|
|
178
|
+
'misalignsse',
|
|
179
|
+
'3dnowprefetch',
|
|
180
|
+
'osvw',
|
|
181
|
+
'ibs',
|
|
182
|
+
'skinit',
|
|
183
|
+
'wdt',
|
|
184
|
+
'tce',
|
|
185
|
+
'topoext',
|
|
186
|
+
'perfctr_core',
|
|
187
|
+
'perfctr_nb',
|
|
188
|
+
'bpext',
|
|
189
|
+
'perfctr_llc',
|
|
190
|
+
'mwaitx',
|
|
191
|
+
'cpb',
|
|
192
|
+
'cat_l3',
|
|
193
|
+
'cdp_l3',
|
|
194
|
+
'hw_pstate',
|
|
195
|
+
'ssbd',
|
|
196
|
+
'mba',
|
|
197
|
+
'perfmon_v2',
|
|
198
|
+
'ibrs',
|
|
199
|
+
'ibpb',
|
|
200
|
+
'stibp',
|
|
201
|
+
'vmmcall',
|
|
202
|
+
'fsgsbase',
|
|
203
|
+
'bmi1',
|
|
204
|
+
'avx2',
|
|
205
|
+
'smep',
|
|
206
|
+
'bmi2',
|
|
207
|
+
'erms',
|
|
208
|
+
'invpcid',
|
|
209
|
+
'cqm',
|
|
210
|
+
'rdt_a',
|
|
211
|
+
'avx512f',
|
|
212
|
+
'avx512dq',
|
|
213
|
+
'rdseed',
|
|
214
|
+
'adx',
|
|
215
|
+
'smap',
|
|
216
|
+
'clflushopt',
|
|
217
|
+
'clwb',
|
|
218
|
+
'avx512vl',
|
|
219
|
+
'avx512bw',
|
|
220
|
+
'avx512cd',
|
|
221
|
+
'avx512_bf16',
|
|
222
|
+
'avx512vbmi',
|
|
223
|
+
'avx512vbmi2',
|
|
224
|
+
'avx512ifma',
|
|
225
|
+
'avx512vp2intersect',
|
|
226
|
+
'sha_ni',
|
|
227
|
+
'gfni',
|
|
228
|
+
'vaes',
|
|
229
|
+
'vpclmulqdq',
|
|
230
|
+
'avx512vpopcntdq',
|
|
231
|
+
'avx512vnni',
|
|
232
|
+
'avx512bitalg',
|
|
233
|
+
'rdpid',
|
|
234
|
+
'movdiri',
|
|
235
|
+
'movdir64b',
|
|
236
|
+
'fsrm',
|
|
237
|
+
'cldemote',
|
|
238
|
+
'serialize',
|
|
239
|
+
'flush_l1d',
|
|
240
|
+
'arch_capabilities',
|
|
241
|
+
];
|
|
242
|
+
/**
|
|
243
|
+
* Arrow Lake flag set for the Core Ultra 9 285K. Arrow Lake ships AVX2 with
|
|
244
|
+
* AVX-VNNI and the SHA extensions but no AVX-512 execution units, and it
|
|
245
|
+
* reports no hyper-threading, so the ht flag is absent on purpose.
|
|
246
|
+
*/
|
|
247
|
+
export const ARROWLAKEFLAGS = [
|
|
248
|
+
'fpu',
|
|
249
|
+
'vme',
|
|
250
|
+
'de',
|
|
251
|
+
'pse',
|
|
252
|
+
'tsc',
|
|
253
|
+
'msr',
|
|
254
|
+
'pae',
|
|
255
|
+
'mce',
|
|
256
|
+
'cx8',
|
|
257
|
+
'apic',
|
|
258
|
+
'sep',
|
|
259
|
+
'mtrr',
|
|
260
|
+
'pge',
|
|
261
|
+
'mca',
|
|
262
|
+
'cmov',
|
|
263
|
+
'pat',
|
|
264
|
+
'pse36',
|
|
265
|
+
'clflush',
|
|
266
|
+
'mmx',
|
|
267
|
+
'fxsr',
|
|
268
|
+
'sse',
|
|
269
|
+
'sse2',
|
|
270
|
+
'syscall',
|
|
271
|
+
'nx',
|
|
272
|
+
'pdpe1gb',
|
|
273
|
+
'rdtscp',
|
|
274
|
+
'lm',
|
|
275
|
+
'constant_tsc',
|
|
276
|
+
'arch_perfmon',
|
|
277
|
+
'rep_good',
|
|
278
|
+
'nopl',
|
|
279
|
+
'xtopology',
|
|
280
|
+
'nonstop_tsc',
|
|
281
|
+
'cpuid',
|
|
282
|
+
'aperfmperf',
|
|
283
|
+
'tsc_known_freq',
|
|
284
|
+
'pni',
|
|
285
|
+
'pclmulqdq',
|
|
286
|
+
'monitor',
|
|
287
|
+
'ssse3',
|
|
288
|
+
'fma',
|
|
289
|
+
'cx16',
|
|
290
|
+
'sse4_1',
|
|
291
|
+
'sse4_2',
|
|
292
|
+
'x2apic',
|
|
293
|
+
'movbe',
|
|
294
|
+
'popcnt',
|
|
295
|
+
'aes',
|
|
296
|
+
'xsave',
|
|
297
|
+
'avx',
|
|
298
|
+
'f16c',
|
|
299
|
+
'rdrand',
|
|
300
|
+
'lahf_lm',
|
|
301
|
+
'abm',
|
|
302
|
+
'3dnowprefetch',
|
|
303
|
+
'cpuid_fault',
|
|
304
|
+
'epb',
|
|
305
|
+
'invpcid_single',
|
|
306
|
+
'ssbd',
|
|
307
|
+
'ibrs',
|
|
308
|
+
'ibpb',
|
|
309
|
+
'stibp',
|
|
310
|
+
'ibrs_enhanced',
|
|
311
|
+
'tpr_shadow',
|
|
312
|
+
'vnmi',
|
|
313
|
+
'flexpriority',
|
|
314
|
+
'ept',
|
|
315
|
+
'vpid',
|
|
316
|
+
'ept_ad',
|
|
317
|
+
'fsgsbase',
|
|
318
|
+
'tsc_adjust',
|
|
319
|
+
'bmi1',
|
|
320
|
+
'avx2',
|
|
321
|
+
'smep',
|
|
322
|
+
'bmi2',
|
|
323
|
+
'erms',
|
|
324
|
+
'invpcid',
|
|
325
|
+
'rdseed',
|
|
326
|
+
'adx',
|
|
327
|
+
'smap',
|
|
328
|
+
'clflushopt',
|
|
329
|
+
'clwb',
|
|
330
|
+
'sha_ni',
|
|
331
|
+
'xsaveopt',
|
|
332
|
+
'xsavec',
|
|
333
|
+
'xgetbv1',
|
|
334
|
+
'xsaves',
|
|
335
|
+
'split_lock_detect',
|
|
336
|
+
'user_shstk',
|
|
337
|
+
'avx_vnni',
|
|
338
|
+
'waitpkg',
|
|
339
|
+
'gfni',
|
|
340
|
+
'vaes',
|
|
341
|
+
'vpclmulqdq',
|
|
342
|
+
'rdpid',
|
|
343
|
+
'movdiri',
|
|
344
|
+
'movdir64b',
|
|
345
|
+
'fsrm',
|
|
346
|
+
'md_clear',
|
|
347
|
+
'serialize',
|
|
348
|
+
'tsxldtrk',
|
|
349
|
+
'la57',
|
|
350
|
+
'cldemote',
|
|
351
|
+
'arch_capabilities',
|
|
352
|
+
];
|
|
353
|
+
/** Vendor strategy table: identity strings and per-vendor cpuinfo details. */
|
|
354
|
+
export const vendorprofiles = {
|
|
355
|
+
amd: {
|
|
356
|
+
vendorid: 'AuthenticAMD',
|
|
357
|
+
flags: ZEN5FLAGS,
|
|
358
|
+
bugs: ['sysret_ss_attrs', 'spectre_v1', 'spectre_v2', 'spec_store_bypass', 'srso'],
|
|
359
|
+
tlbsize: '3584 2M/4M pages',
|
|
360
|
+
cpuidlevel: 16,
|
|
361
|
+
powermanagement: 'ts ttp tm hwpstate cpb eff_freq_ro [13] [14]',
|
|
362
|
+
},
|
|
363
|
+
intel: {
|
|
364
|
+
vendorid: 'GenuineIntel',
|
|
365
|
+
flags: ARROWLAKEFLAGS,
|
|
366
|
+
bugs: ['spectre_v1', 'spectre_v2', 'spec_store_bypass', 'swapgs', 'eibrs_pbrsb'],
|
|
367
|
+
tlbsize: null,
|
|
368
|
+
cpuidlevel: 32,
|
|
369
|
+
powermanagement: 'ts ttp tm hwpstate cpb eff_freq_ro [8] [9] [10] [11] [12] [13] [14]',
|
|
370
|
+
},
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* BEST_VIRTUAL_PROCESSORS: the bank of real, verified top-end processors
|
|
374
|
+
* embedded as immutable data. Every entry was cross-checked against vendor
|
|
375
|
+
* pages and the TechPowerUp database on 2026-08-22.
|
|
376
|
+
*/
|
|
377
|
+
export const BEST_VIRTUAL_PROCESSORS = [
|
|
378
|
+
{
|
|
379
|
+
model: 'AMD EPYC 9965',
|
|
380
|
+
displayname: 'AMD EPYC 9965 192-Core Processor',
|
|
381
|
+
vendor: 'amd',
|
|
382
|
+
cores: 192,
|
|
383
|
+
threads: 384,
|
|
384
|
+
baseclockmhz: 2250,
|
|
385
|
+
boostclockmhz: 3700,
|
|
386
|
+
allcoreclockmhz: 3350,
|
|
387
|
+
l3mb: 384,
|
|
388
|
+
l2mb: 192,
|
|
389
|
+
socket: 'SP5 (LGA6096)',
|
|
390
|
+
tdpwatts: 500,
|
|
391
|
+
maxtdpwatts: 500,
|
|
392
|
+
pcie: 'PCIe 5.0 x128',
|
|
393
|
+
maxmemorygb: 6144,
|
|
394
|
+
memorytype: 'DDR5-6400 ECC RDIMM',
|
|
395
|
+
memorychannels: 12,
|
|
396
|
+
microarch: 'Zen 5c (Turin)',
|
|
397
|
+
cpufamily: 25,
|
|
398
|
+
cpumodel: 17,
|
|
399
|
+
stepping: 2,
|
|
400
|
+
physicalline: '52 bits physical',
|
|
401
|
+
virtualline: '57 bits virtual',
|
|
402
|
+
launch: '2024-10-10',
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
model: 'AMD Ryzen 9 9950X3D',
|
|
406
|
+
displayname: 'AMD Ryzen 9 9950X3D 16-Core Processor',
|
|
407
|
+
vendor: 'amd',
|
|
408
|
+
cores: 16,
|
|
409
|
+
threads: 32,
|
|
410
|
+
baseclockmhz: 4300,
|
|
411
|
+
boostclockmhz: 5700,
|
|
412
|
+
allcoreclockmhz: 5400,
|
|
413
|
+
l3mb: 128,
|
|
414
|
+
l2mb: 16,
|
|
415
|
+
socket: 'AM5',
|
|
416
|
+
tdpwatts: 170,
|
|
417
|
+
maxtdpwatts: 200,
|
|
418
|
+
pcie: 'PCIe 5.0 x24',
|
|
419
|
+
maxmemorygb: 192,
|
|
420
|
+
memorytype: 'DDR5-5600',
|
|
421
|
+
memorychannels: 2,
|
|
422
|
+
microarch: 'Zen 5 X3D (3D V-Cache on one CCD, 144 MB total cache with L2)',
|
|
423
|
+
cpufamily: 25,
|
|
424
|
+
cpumodel: 17,
|
|
425
|
+
stepping: 2,
|
|
426
|
+
physicalline: '48 bits physical',
|
|
427
|
+
virtualline: '57 bits virtual',
|
|
428
|
+
launch: '2025-03-12',
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
model: 'AMD Threadripper PRO 9995WX',
|
|
432
|
+
displayname: 'AMD Ryzen Threadripper PRO 9995WX 96-Core Processor',
|
|
433
|
+
vendor: 'amd',
|
|
434
|
+
cores: 96,
|
|
435
|
+
threads: 192,
|
|
436
|
+
baseclockmhz: 2500,
|
|
437
|
+
boostclockmhz: 5400,
|
|
438
|
+
allcoreclockmhz: 4100,
|
|
439
|
+
l3mb: 384,
|
|
440
|
+
l2mb: 96,
|
|
441
|
+
socket: 'sTR5 (LGA4844)',
|
|
442
|
+
tdpwatts: 350,
|
|
443
|
+
maxtdpwatts: 350,
|
|
444
|
+
pcie: 'PCIe 5.0 x128',
|
|
445
|
+
maxmemorygb: 2048,
|
|
446
|
+
memorytype: 'DDR5-6400 ECC RDIMM',
|
|
447
|
+
memorychannels: 8,
|
|
448
|
+
microarch: 'Zen 5 (Shimada Peak, WRX90)',
|
|
449
|
+
cpufamily: 25,
|
|
450
|
+
cpumodel: 17,
|
|
451
|
+
stepping: 2,
|
|
452
|
+
physicalline: '52 bits physical',
|
|
453
|
+
virtualline: '57 bits virtual',
|
|
454
|
+
launch: '2025-07',
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
model: 'AMD Threadripper 7980X',
|
|
458
|
+
displayname: 'AMD Ryzen Threadripper 7980X 64-Core Processor',
|
|
459
|
+
vendor: 'amd',
|
|
460
|
+
cores: 64,
|
|
461
|
+
threads: 128,
|
|
462
|
+
baseclockmhz: 3200,
|
|
463
|
+
boostclockmhz: 5100,
|
|
464
|
+
allcoreclockmhz: 4400,
|
|
465
|
+
l3mb: 256,
|
|
466
|
+
l2mb: 64,
|
|
467
|
+
socket: 'sTR5',
|
|
468
|
+
tdpwatts: 350,
|
|
469
|
+
maxtdpwatts: 350,
|
|
470
|
+
pcie: 'PCIe 5.0 x48',
|
|
471
|
+
maxmemorygb: 1024,
|
|
472
|
+
memorytype: 'DDR5-6400',
|
|
473
|
+
memorychannels: 4,
|
|
474
|
+
microarch: 'Zen 5 (TRX50)',
|
|
475
|
+
cpufamily: 25,
|
|
476
|
+
cpumodel: 17,
|
|
477
|
+
stepping: 2,
|
|
478
|
+
physicalline: '52 bits physical',
|
|
479
|
+
virtualline: '57 bits virtual',
|
|
480
|
+
launch: '2023-10',
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
model: 'Intel Core Ultra 9 285K',
|
|
484
|
+
displayname: 'Intel(R) Core(TM) Ultra 9 285K',
|
|
485
|
+
vendor: 'intel',
|
|
486
|
+
cores: 24,
|
|
487
|
+
threads: 24,
|
|
488
|
+
baseclockmhz: 3700,
|
|
489
|
+
boostclockmhz: 5700,
|
|
490
|
+
allcoreclockmhz: 5400,
|
|
491
|
+
l3mb: 36,
|
|
492
|
+
l2mb: 36,
|
|
493
|
+
socket: 'LGA1851',
|
|
494
|
+
tdpwatts: 125,
|
|
495
|
+
maxtdpwatts: 250,
|
|
496
|
+
pcie: 'PCIe 5.0 x20 + PCIe 4.0 x4',
|
|
497
|
+
maxmemorygb: 192,
|
|
498
|
+
memorytype: 'DDR5-6400',
|
|
499
|
+
memorychannels: 2,
|
|
500
|
+
microarch: 'Arrow Lake (8 Performance + 16 Efficient cores, no hyper-threading)',
|
|
501
|
+
cpufamily: 6,
|
|
502
|
+
cpumodel: 191,
|
|
503
|
+
stepping: 2,
|
|
504
|
+
physicalline: '46 bits physical',
|
|
505
|
+
virtualline: '57 bits virtual',
|
|
506
|
+
launch: '2024-10-24',
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
model: 'AMD EPYC 9955',
|
|
510
|
+
displayname: 'AMD EPYC 9955 128-Core Processor',
|
|
511
|
+
vendor: 'amd',
|
|
512
|
+
cores: 128,
|
|
513
|
+
threads: 256,
|
|
514
|
+
baseclockmhz: 2600,
|
|
515
|
+
boostclockmhz: 3750,
|
|
516
|
+
allcoreclockmhz: 3450,
|
|
517
|
+
l3mb: 384,
|
|
518
|
+
l2mb: 128,
|
|
519
|
+
socket: 'SP5',
|
|
520
|
+
tdpwatts: 400,
|
|
521
|
+
maxtdpwatts: 400,
|
|
522
|
+
pcie: 'PCIe 5.0 x128',
|
|
523
|
+
maxmemorygb: 6144,
|
|
524
|
+
memorytype: 'DDR5-6400 ECC RDIMM',
|
|
525
|
+
memorychannels: 12,
|
|
526
|
+
microarch: 'Zen 5c (Turin dense)',
|
|
527
|
+
cpufamily: 25,
|
|
528
|
+
cpumodel: 17,
|
|
529
|
+
stepping: 2,
|
|
530
|
+
physicalline: '52 bits physical',
|
|
531
|
+
virtualline: '57 bits virtual',
|
|
532
|
+
launch: '2024-10-10',
|
|
533
|
+
},
|
|
534
|
+
];
|
|
535
|
+
/* ------------------------------------------------------------------ */
|
|
536
|
+
/* Section 4: cpuRegistry */
|
|
537
|
+
/* ------------------------------------------------------------------ */
|
|
538
|
+
/**
|
|
539
|
+
* Registry of every known virtual processor. Seeded from
|
|
540
|
+
* BEST_VIRTUAL_PROCESSORS and extensible at runtime through
|
|
541
|
+
* registerVirtualCpu; iteration order equals insertion order.
|
|
542
|
+
*/
|
|
543
|
+
export const cpuRegistry = new Map(BEST_VIRTUAL_PROCESSORS.map((spec) => [spec.model.toLowerCase(), spec]));
|
|
544
|
+
/** Normalizes a model string for case-insensitive registry lookups. */
|
|
545
|
+
export function normalizemodel(model) {
|
|
546
|
+
return model.trim().toLowerCase();
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Registers a custom processor spec in the cpuRegistry. Registration is
|
|
550
|
+
* rejected when the spec is malformed or duplicates an existing model.
|
|
551
|
+
*/
|
|
552
|
+
export function registerVirtualCpu(spec) {
|
|
553
|
+
try {
|
|
554
|
+
const key = normalizemodel(spec.model);
|
|
555
|
+
if (key.length === 0) {
|
|
556
|
+
throw new hardwareerror('model name must not be empty');
|
|
557
|
+
}
|
|
558
|
+
if (cpuRegistry.has(key)) {
|
|
559
|
+
throw new hardwareerror(`model ${spec.model} is already registered`);
|
|
560
|
+
}
|
|
561
|
+
cpuRegistry.set(key, spec);
|
|
562
|
+
return key;
|
|
563
|
+
}
|
|
564
|
+
catch (cause) {
|
|
565
|
+
if (cause instanceof hardwareerror) {
|
|
566
|
+
throw cause;
|
|
567
|
+
}
|
|
568
|
+
throw new hardwareerror('registerVirtualCpu failed', { cause: cause });
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Looks up a processor by exact (case-insensitive) model name.
|
|
573
|
+
*
|
|
574
|
+
* @param model Model name such as "AMD EPYC 9965".
|
|
575
|
+
*/
|
|
576
|
+
export function getVirtualCpu(model) {
|
|
577
|
+
const found = cpuRegistry.get(normalizemodel(model));
|
|
578
|
+
if (found === undefined) {
|
|
579
|
+
throw new hardwareerror(`unknown processor model "${model}"; known models: ${listVirtualCpus().join(', ')}`);
|
|
580
|
+
}
|
|
581
|
+
return found;
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Searches the registry by substring, returning every spec whose model name
|
|
585
|
+
* contains the fragment (case-insensitive). The const type parameter keeps
|
|
586
|
+
* literal fragment types intact for logging callers.
|
|
587
|
+
*/
|
|
588
|
+
export function findVirtualCpus(fragment) {
|
|
589
|
+
const needle = normalizemodel(fragment);
|
|
590
|
+
const results = [];
|
|
591
|
+
for (const spec of cpuRegistry.values()) {
|
|
592
|
+
if (normalizemodel(spec.model).includes(needle)) {
|
|
593
|
+
results.push(spec);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
return results;
|
|
597
|
+
}
|
|
598
|
+
/** Lists every registered model name in registry order. */
|
|
599
|
+
export function listVirtualCpus() {
|
|
600
|
+
return [...cpuRegistry.values()].map((spec) => spec.model);
|
|
601
|
+
}
|
|
602
|
+
/** Removes a custom model from the registry; returns true when it existed. */
|
|
603
|
+
export function removeVirtualCpu(model) {
|
|
604
|
+
return cpuRegistry.delete(normalizemodel(model));
|
|
605
|
+
}
|
|
606
|
+
/** Derives a stable, deterministic identifier for a model name via sha256. */
|
|
607
|
+
export function stableModelId(model) {
|
|
608
|
+
return createHash('sha256').update(`virtualengine:${model}`).digest('hex').slice(0, 12);
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Solves the package topology for a requested vCPU count against a spec.
|
|
612
|
+
* Symmetric multithreading parts round core counts up so partial
|
|
613
|
+
* configurations stay coherent, and heterogeneous parts (Arrow Lake)
|
|
614
|
+
* report one thread per core.
|
|
615
|
+
*/
|
|
616
|
+
export function solvetopology(spec, vcpus) {
|
|
617
|
+
try {
|
|
618
|
+
const threadspercore = Math.max(1, Math.round(spec.threads / spec.cores));
|
|
619
|
+
if (!Number.isInteger(vcpus) || vcpus < 1) {
|
|
620
|
+
throw new hardwareerror(`vcpus must be a positive integer, received ${vcpus}`);
|
|
621
|
+
}
|
|
622
|
+
if (vcpus > spec.threads) {
|
|
623
|
+
throw new hardwareerror(`model ${spec.model} exposes at most ${spec.threads} threads; ${vcpus} were requested`);
|
|
624
|
+
}
|
|
625
|
+
const coresonline = Math.ceil(vcpus / threadspercore);
|
|
626
|
+
return {
|
|
627
|
+
vcpus,
|
|
628
|
+
threadspercore,
|
|
629
|
+
coresonline,
|
|
630
|
+
siblings: vcpus,
|
|
631
|
+
sockets: 1,
|
|
632
|
+
fullypopulated: vcpus === spec.threads,
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
catch (cause) {
|
|
636
|
+
if (cause instanceof hardwareerror) {
|
|
637
|
+
throw cause;
|
|
638
|
+
}
|
|
639
|
+
throw new hardwareerror('solvetopology failed', { cause: cause });
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
/** Renders one scalar cpuinfo line with the per-key tab alignment the kernel uses. */
|
|
643
|
+
const keytabs = {
|
|
644
|
+
processor: '\t',
|
|
645
|
+
vendor_id: '\t',
|
|
646
|
+
'cpu family': '\t',
|
|
647
|
+
model: '\t\t',
|
|
648
|
+
'model name': '\t',
|
|
649
|
+
stepping: '\t',
|
|
650
|
+
microcode: '\t',
|
|
651
|
+
'cpu MHz': '\t\t',
|
|
652
|
+
'cache size': '\t',
|
|
653
|
+
'physical id': '\t',
|
|
654
|
+
siblings: '\t',
|
|
655
|
+
'core id': '\t\t',
|
|
656
|
+
'cpu cores': '\t',
|
|
657
|
+
apicid: '\t\t',
|
|
658
|
+
'initial apicid': '\t',
|
|
659
|
+
fpu: '\t\t',
|
|
660
|
+
fpu_exception: '\t',
|
|
661
|
+
'cpuid level': '\t',
|
|
662
|
+
wp: '\t\t',
|
|
663
|
+
flags: '\t\t',
|
|
664
|
+
bugs: '\t\t',
|
|
665
|
+
bogomips: '\t',
|
|
666
|
+
'TLB size': '\t',
|
|
667
|
+
'clflush size': '\t',
|
|
668
|
+
cache_alignment: '',
|
|
669
|
+
'address sizes': '\t',
|
|
670
|
+
'power management': '',
|
|
671
|
+
};
|
|
672
|
+
/** Renders one cpuinfo line exactly as procfs does: key, tabs, colon, value. */
|
|
673
|
+
function line(key, value) {
|
|
674
|
+
const tabs = keytabs[key] ?? '\t';
|
|
675
|
+
return `${key}${tabs}: ${value}`;
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Generates a complete, byte-realistic /proc/cpuinfo text for a registered
|
|
679
|
+
* processor model with an arbitrary vCPU count. Each logical processor block
|
|
680
|
+
* carries processor index, vendor_id (AuthenticAMD or GenuineIntel), cpu
|
|
681
|
+
* family, model, model name, stepping, microcode, cpu MHz with natural
|
|
682
|
+
* jitter, cache size, physical id, siblings, core id, cpu cores, apicid,
|
|
683
|
+
* initial apicid, fpu markers, cpuid level, wp, the full vendor flag set,
|
|
684
|
+
* known bug list, bogomips, TLB size, clflush size, cache alignment,
|
|
685
|
+
* address sizes and the power management hint line.
|
|
686
|
+
*
|
|
687
|
+
* @param model Processor model name present in the cpuRegistry.
|
|
688
|
+
* @param vcpus Number of logical processors to render (1 to model threads).
|
|
689
|
+
* @param options Optional family, model, stepping, microcode and flag tweaks.
|
|
690
|
+
*/
|
|
691
|
+
export function generateVirtualCpuinfo(model, vcpus, options) {
|
|
692
|
+
try {
|
|
693
|
+
const spec = getVirtualCpu(model);
|
|
694
|
+
const topology = solvetopology(spec, vcpus);
|
|
695
|
+
const profile = vendorprofiles[spec.vendor];
|
|
696
|
+
const family = options?.family ?? spec.cpufamily;
|
|
697
|
+
const modelnumber = options?.modelnumber ?? spec.cpumodel;
|
|
698
|
+
const stepping = options?.stepping ?? spec.stepping;
|
|
699
|
+
const microcode = options?.microcode ?? '0xffffffff';
|
|
700
|
+
const flags = [...profile.flags, ...(options?.extraflags ?? [])].join(' ');
|
|
701
|
+
const bugs = profile.bugs.join(' ');
|
|
702
|
+
const maxmhz = options?.maxmhz ?? spec.boostclockmhz;
|
|
703
|
+
const minmhz = options?.minmhz ?? spec.baseclockmhz;
|
|
704
|
+
const blocks = [];
|
|
705
|
+
for (let processor = 0; processor < topology.vcpus; processor += 1) {
|
|
706
|
+
const currentmhz = randomInt(Math.round(minmhz), Math.round(maxmhz + 1));
|
|
707
|
+
const bogomips = (spec.baseclockmhz * 2 + randomInt(-40, 41) / 100).toFixed(2);
|
|
708
|
+
const coreid = Math.floor(processor / topology.threadspercore);
|
|
709
|
+
const lines = [
|
|
710
|
+
line('processor', processor),
|
|
711
|
+
line('vendor_id', profile.vendorid),
|
|
712
|
+
line('cpu family', family),
|
|
713
|
+
line('model', modelnumber),
|
|
714
|
+
line('model name', spec.displayname),
|
|
715
|
+
line('stepping', stepping),
|
|
716
|
+
line('microcode', microcode),
|
|
717
|
+
line('cpu MHz', currentmhz.toFixed(3)),
|
|
718
|
+
line('cache size', `${spec.l3mb} MB`),
|
|
719
|
+
line('physical id', 0),
|
|
720
|
+
line('siblings', topology.siblings),
|
|
721
|
+
line('core id', coreid),
|
|
722
|
+
line('cpu cores', topology.coresonline),
|
|
723
|
+
line('apicid', processor),
|
|
724
|
+
line('initial apicid', processor),
|
|
725
|
+
line('fpu', 'yes'),
|
|
726
|
+
line('fpu_exception', 'yes'),
|
|
727
|
+
line('cpuid level', profile.cpuidlevel),
|
|
728
|
+
line('wp', 'yes'),
|
|
729
|
+
line('flags', flags),
|
|
730
|
+
line('bugs', bugs),
|
|
731
|
+
line('bogomips', bogomips),
|
|
732
|
+
];
|
|
733
|
+
if (profile.tlbsize !== null) {
|
|
734
|
+
lines.push(line('TLB size', profile.tlbsize));
|
|
735
|
+
}
|
|
736
|
+
lines.push(line('clflush size', 64), line('cache_alignment', 64), line('address sizes', `${spec.physicalline}, ${spec.virtualline}`), line('power management', profile.powermanagement));
|
|
737
|
+
blocks.push(lines.join('\n'));
|
|
738
|
+
}
|
|
739
|
+
return blocks.join('\n\n');
|
|
740
|
+
}
|
|
741
|
+
catch (cause) {
|
|
742
|
+
if (cause instanceof hardwareerror) {
|
|
743
|
+
throw cause;
|
|
744
|
+
}
|
|
745
|
+
throw new hardwareerror('generateVirtualCpuinfo failed', { cause: cause });
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
/* ------------------------------------------------------------------ */
|
|
749
|
+
/* Section 7: lscpu summary generation */
|
|
750
|
+
/* ------------------------------------------------------------------ */
|
|
751
|
+
/**
|
|
752
|
+
* Generates an lscpu-style summary block for a registered model, covering
|
|
753
|
+
* architecture, endianness, address sizes, vendor, family, model, per-core
|
|
754
|
+
* threading, socket topology, frequency range, caches and NUMA nodes. The
|
|
755
|
+
* text mirrors the column layout produced by util-linux lscpu on 2026
|
|
756
|
+
* distributions.
|
|
757
|
+
*/
|
|
758
|
+
export function generateVirtualLscpu(model, vcpus, numanodes = 1) {
|
|
759
|
+
try {
|
|
760
|
+
const spec = getVirtualCpu(model);
|
|
761
|
+
const topology = solvetopology(spec, vcpus);
|
|
762
|
+
const corespersocket = Math.ceil(topology.coresonline / numanodes) * numanodes;
|
|
763
|
+
const rows = [
|
|
764
|
+
['Architecture:', 'x86_64'],
|
|
765
|
+
['CPU op-mode(s):', '32-bit, 64-bit'],
|
|
766
|
+
['Byte Order:', 'Little Endian'],
|
|
767
|
+
['Address sizes:', `${spec.physicalline}, ${spec.virtualline}`],
|
|
768
|
+
['CPU(s):', String(topology.vcpus)],
|
|
769
|
+
['On-line CPU(s) list:', topology.vcpus === 1 ? '0' : `0-${topology.vcpus - 1}`],
|
|
770
|
+
['Vendor ID:', vendorprofiles[spec.vendor].vendorid],
|
|
771
|
+
['Model name:', spec.displayname],
|
|
772
|
+
['CPU family:', String(spec.cpufamily)],
|
|
773
|
+
['Model:', String(spec.cpumodel)],
|
|
774
|
+
['Thread(s) per core:', String(topology.threadspercore)],
|
|
775
|
+
['Core(s) per socket:', String(corespersocket)],
|
|
776
|
+
['Socket(s):', '1'],
|
|
777
|
+
['Stepping:', String(spec.stepping)],
|
|
778
|
+
['Frequency boost:', 'enabled'],
|
|
779
|
+
['CPU max MHz:', `${spec.boostclockmhz}.0000`],
|
|
780
|
+
['CPU min MHz:', `${(spec.baseclockmhz * 0.62).toFixed(4)}`],
|
|
781
|
+
['BogoMIPS:', `${(spec.baseclockmhz * 2).toFixed(2)}`],
|
|
782
|
+
[
|
|
783
|
+
'L1d cache:',
|
|
784
|
+
`${Math.round((spec.l2mb / spec.cores) * 1024)} KiB (${spec.cores} instances)`,
|
|
785
|
+
],
|
|
786
|
+
['L2 cache:', `${spec.l2mb} MiB (${spec.cores} instances)`],
|
|
787
|
+
['L3 cache:', `${spec.l3mb} MiB (${Math.max(1, Math.round(spec.cores / 8))} instances)`],
|
|
788
|
+
['NUMA node(s):', String(numanodes)],
|
|
789
|
+
];
|
|
790
|
+
const pernode = Math.ceil(topology.vcpus / numanodes);
|
|
791
|
+
for (let node = 0; node < numanodes; node += 1) {
|
|
792
|
+
const start = node * pernode;
|
|
793
|
+
const end = Math.min(start + pernode, topology.vcpus) - 1;
|
|
794
|
+
rows.push([`NUMA node${node} CPU(s):`, start === end ? String(start) : `${start}-${end}`]);
|
|
795
|
+
}
|
|
796
|
+
rows.push(['Vulnerability Itlb multihit:', 'Not affected']);
|
|
797
|
+
rows.push([
|
|
798
|
+
'Vulnerability L1tf:',
|
|
799
|
+
vendorprofiles[spec.vendor].bugs.includes('l1tf') ? 'Mitigation; VMX flush' : 'Not affected',
|
|
800
|
+
]);
|
|
801
|
+
rows.push(['Vulnerability Mds:', 'Not affected']);
|
|
802
|
+
rows.push(['Vulnerability Meltdown:', 'Not affected']);
|
|
803
|
+
rows.push([
|
|
804
|
+
'Vulnerability Spectre v1:',
|
|
805
|
+
'Mitigation; usercopy/swapgs barriers and __user pointer sanitization',
|
|
806
|
+
]);
|
|
807
|
+
rows.push([
|
|
808
|
+
'Vulnerability Spectre v2:',
|
|
809
|
+
spec.vendor === 'amd' ? 'Mitigation; Retpolines, IBPB' : 'Mitigation; Enhanced IBRS',
|
|
810
|
+
]);
|
|
811
|
+
return rows.map(([key, value]) => `${key.padEnd(28)}${value}`).join('\n');
|
|
812
|
+
}
|
|
813
|
+
catch (cause) {
|
|
814
|
+
if (cause instanceof hardwareerror) {
|
|
815
|
+
throw cause;
|
|
816
|
+
}
|
|
817
|
+
throw new hardwareerror('generateVirtualLscpu failed', { cause: cause });
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* Fluent builder for virtual processors. The builder starts empty, collects
|
|
822
|
+
* every field through chainable with* methods, validates the result and
|
|
823
|
+
* produces a provisionedcpu that bundles the spec, the solved topology and
|
|
824
|
+
* the generated cpuinfo and lscpu texts.
|
|
825
|
+
*/
|
|
826
|
+
export class virtualcpubuilder {
|
|
827
|
+
#spec;
|
|
828
|
+
#vcpus;
|
|
829
|
+
#numanodes;
|
|
830
|
+
constructor() {
|
|
831
|
+
this.#spec = {};
|
|
832
|
+
this.#vcpus = 1;
|
|
833
|
+
this.#numanodes = 1;
|
|
834
|
+
}
|
|
835
|
+
/** Sets the model name; when present in the registry it seeds defaults. */
|
|
836
|
+
withmodel(model) {
|
|
837
|
+
this.#spec.model = model;
|
|
838
|
+
const known = cpuRegistry.get(normalizemodel(model));
|
|
839
|
+
if (known !== undefined) {
|
|
840
|
+
this.#spec = { ...known };
|
|
841
|
+
}
|
|
842
|
+
return this;
|
|
843
|
+
}
|
|
844
|
+
/** Sets the number of online vCPUs. */
|
|
845
|
+
withvcpus(vcpus) {
|
|
846
|
+
this.#vcpus = vcpus;
|
|
847
|
+
return this;
|
|
848
|
+
}
|
|
849
|
+
/** Sets base, single-core boost and all-core boost clocks in MHz. */
|
|
850
|
+
withclocks(base, boost, allcore) {
|
|
851
|
+
this.#spec.baseclockmhz = base;
|
|
852
|
+
this.#spec.boostclockmhz = boost;
|
|
853
|
+
this.#spec.allcoreclockmhz = allcore;
|
|
854
|
+
return this;
|
|
855
|
+
}
|
|
856
|
+
/** Sets L3 and L2 cache sizes in MB. */
|
|
857
|
+
withcache(l3mb, l2mb) {
|
|
858
|
+
this.#spec.l3mb = l3mb;
|
|
859
|
+
this.#spec.l2mb = l2mb;
|
|
860
|
+
return this;
|
|
861
|
+
}
|
|
862
|
+
/** Sets package, socket, TDP and PCIe lanes. */
|
|
863
|
+
withpackage(socket, tdpwatts, maxtdpwatts, pcie) {
|
|
864
|
+
this.#spec.socket = socket;
|
|
865
|
+
this.#spec.tdpwatts = tdpwatts;
|
|
866
|
+
this.#spec.maxtdpwatts = maxtdpwatts;
|
|
867
|
+
this.#spec.pcie = pcie;
|
|
868
|
+
return this;
|
|
869
|
+
}
|
|
870
|
+
/** Sets maximum memory, memory type and channel count. */
|
|
871
|
+
withmemory(maxmemorygb, memorytype, memorychannels) {
|
|
872
|
+
this.#spec.maxmemorygb = maxmemorygb;
|
|
873
|
+
this.#spec.memorytype = memorytype;
|
|
874
|
+
this.#spec.memorychannels = memorychannels;
|
|
875
|
+
return this;
|
|
876
|
+
}
|
|
877
|
+
/** Sets core and thread counts plus the vendor identity. */
|
|
878
|
+
withtopology(cores, threads, vendor) {
|
|
879
|
+
this.#spec.cores = cores;
|
|
880
|
+
this.#spec.threads = threads;
|
|
881
|
+
this.#spec.vendor = vendor;
|
|
882
|
+
return this;
|
|
883
|
+
}
|
|
884
|
+
/** Sets CPUID family, model and stepping. */
|
|
885
|
+
withcpuid(cpufamily, cpumodel, stepping) {
|
|
886
|
+
this.#spec.cpufamily = cpufamily;
|
|
887
|
+
this.#spec.cpumodel = cpumodel;
|
|
888
|
+
this.#spec.stepping = stepping;
|
|
889
|
+
return this;
|
|
890
|
+
}
|
|
891
|
+
/** Sets the number of NUMA nodes advertised in lscpu output. */
|
|
892
|
+
withnumanodes(numanodes) {
|
|
893
|
+
this.#numanodes = Math.max(1, numanodes);
|
|
894
|
+
return this;
|
|
895
|
+
}
|
|
896
|
+
/** Validates the accumulated spec and produces the provisioned bundle. */
|
|
897
|
+
build() {
|
|
898
|
+
try {
|
|
899
|
+
const defaults = {
|
|
900
|
+
model: 'custom virtual processor',
|
|
901
|
+
displayname: 'custom virtual processor',
|
|
902
|
+
vendor: 'amd',
|
|
903
|
+
cores: 8,
|
|
904
|
+
threads: 16,
|
|
905
|
+
baseclockmhz: 3200,
|
|
906
|
+
boostclockmhz: 5200,
|
|
907
|
+
allcoreclockmhz: 4600,
|
|
908
|
+
l3mb: 64,
|
|
909
|
+
l2mb: 8,
|
|
910
|
+
socket: 'virtual',
|
|
911
|
+
tdpwatts: 120,
|
|
912
|
+
maxtdpwatts: 160,
|
|
913
|
+
pcie: 'PCIe 5.0 x16',
|
|
914
|
+
maxmemorygb: 128,
|
|
915
|
+
memorytype: 'DDR5-5600',
|
|
916
|
+
memorychannels: 2,
|
|
917
|
+
microarch: 'virtual',
|
|
918
|
+
cpufamily: 25,
|
|
919
|
+
cpumodel: 17,
|
|
920
|
+
stepping: 1,
|
|
921
|
+
physicalline: '48 bits physical',
|
|
922
|
+
virtualline: '57 bits virtual',
|
|
923
|
+
launch: '2026-08-22',
|
|
924
|
+
};
|
|
925
|
+
const spec = {
|
|
926
|
+
...defaults,
|
|
927
|
+
...this.#spec,
|
|
928
|
+
model: this.#spec.model ?? defaults.model,
|
|
929
|
+
};
|
|
930
|
+
if (!cpuRegistry.has(normalizemodel(spec.model))) {
|
|
931
|
+
registerVirtualCpu(spec);
|
|
932
|
+
}
|
|
933
|
+
const topology = solvetopology(spec, this.#vcpus);
|
|
934
|
+
return Object.freeze({
|
|
935
|
+
id: stableModelId(spec.model),
|
|
936
|
+
spec: Object.freeze(spec),
|
|
937
|
+
vcpus: topology.vcpus,
|
|
938
|
+
topology: Object.freeze(topology),
|
|
939
|
+
cpuinfotext: generateVirtualCpuinfo(spec.model, topology.vcpus),
|
|
940
|
+
lscputext: generateVirtualLscpu(spec.model, topology.vcpus, this.#numanodes),
|
|
941
|
+
createdat: Date.now(),
|
|
942
|
+
});
|
|
943
|
+
}
|
|
944
|
+
catch (cause) {
|
|
945
|
+
throw new hardwareerror('virtualcpubuilder.build failed', { cause: cause });
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* Factory that provisions a registered processor model for spoofing. The
|
|
951
|
+
* factory resolves the spec from the cpuRegistry, solves the topology for
|
|
952
|
+
* the requested vCPU count and bundles the generated cpuinfo and lscpu
|
|
953
|
+
* texts into a frozen provisionedcpu record.
|
|
954
|
+
*
|
|
955
|
+
* @param model Exact model name in the registry.
|
|
956
|
+
* @param vcpus Number of online vCPUs (1 to the model thread count).
|
|
957
|
+
*/
|
|
958
|
+
export function createVirtualProcessor(model, vcpus) {
|
|
959
|
+
try {
|
|
960
|
+
return new virtualcpubuilder().withmodel(model).withvcpus(vcpus).build();
|
|
961
|
+
}
|
|
962
|
+
catch (cause) {
|
|
963
|
+
if (cause instanceof hardwareerror) {
|
|
964
|
+
throw cause;
|
|
965
|
+
}
|
|
966
|
+
throw new hardwareerror('createVirtualProcessor failed', { cause: cause });
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
/* ------------------------------------------------------------------ */
|
|
970
|
+
/* Section 9: stub helpers absorbed in v2 (validateCpuCount, marchFlag) */
|
|
971
|
+
/* ------------------------------------------------------------------ */
|
|
972
|
+
/**
|
|
973
|
+
* Hard vCPU bounds of the virtualcpu module. The ceiling of 192 matches the
|
|
974
|
+
* strongest bank part (EPYC 9965, 192 cores) and the memory limits published
|
|
975
|
+
* by virtualmemory.ts.
|
|
976
|
+
*/
|
|
977
|
+
export const cpucountlimits = {
|
|
978
|
+
min: 1,
|
|
979
|
+
max: 192,
|
|
980
|
+
};
|
|
981
|
+
/**
|
|
982
|
+
* Validates a vCPU count against the 1 to 192 modularity range. The check is
|
|
983
|
+
* pure: it returns true when the count is an integer inside the bounds.
|
|
984
|
+
*/
|
|
985
|
+
export function validateCpuCount(n) {
|
|
986
|
+
try {
|
|
987
|
+
return Number.isInteger(n) && n >= cpucountlimits.min && n <= cpucountlimits.max;
|
|
988
|
+
}
|
|
989
|
+
catch {
|
|
990
|
+
return false;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
/**
|
|
994
|
+
* Reference gcc march tuning string for Zen 5 targets: znver4 codegen with
|
|
995
|
+
* native tuning, LTO, the AVX-512 foundation plus byte/word lanes and the
|
|
996
|
+
* 512-bit preferred vector width that matches ZEN5FLAGS. This is the only
|
|
997
|
+
* occurrence of the flag string in the whole pool, confirmed by grep on the
|
|
998
|
+
* 2026-08-22 merge pass.
|
|
999
|
+
*/
|
|
1000
|
+
export function marchFlag() {
|
|
1001
|
+
return '-march=znver4 -mtune=native -O3 -flto -mavx512f -mavx512bw -mprefer-vector-width=512';
|
|
1002
|
+
}
|
|
1003
|
+
/* ------------------------------------------------------------------ */
|
|
1004
|
+
/* Section 10: boards (socket index of the bank) */
|
|
1005
|
+
/* ------------------------------------------------------------------ */
|
|
1006
|
+
/**
|
|
1007
|
+
* Socket families advertised by the bank, in the order the v4 helper
|
|
1008
|
+
* documented them: SP5 LGA6096 (EPYC), TR5 (Threadripper) and AM5
|
|
1009
|
+
* (Ryzen). The helper derives the live list from the cpuRegistry so custom
|
|
1010
|
+
* registrations extend it automatically; the canonical trio is returned as
|
|
1011
|
+
* the fallback whenever the registry carries no socket data.
|
|
1012
|
+
*/
|
|
1013
|
+
export function boards() {
|
|
1014
|
+
try {
|
|
1015
|
+
const sockets = [];
|
|
1016
|
+
for (const spec of cpuRegistry.values()) {
|
|
1017
|
+
const socket = spec.socket.split(' ')[0];
|
|
1018
|
+
if (socket.length > 0 && !sockets.includes(socket)) {
|
|
1019
|
+
sockets.push(socket);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
if (sockets.length === 0) {
|
|
1023
|
+
return ['SP5', 'TR5', 'AM5'];
|
|
1024
|
+
}
|
|
1025
|
+
return sockets;
|
|
1026
|
+
}
|
|
1027
|
+
catch {
|
|
1028
|
+
return ['SP5', 'TR5', 'AM5'];
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
/* ------------------------------------------------------------------ */
|
|
1032
|
+
/* Section 11: capability scoring */
|
|
1033
|
+
/* ------------------------------------------------------------------ */
|
|
1034
|
+
/** Weights applied by cpuscore; larger specs always score higher. */
|
|
1035
|
+
export const cpuscoreweights = {
|
|
1036
|
+
core: 10,
|
|
1037
|
+
thread: 4,
|
|
1038
|
+
l3mb: 0.5,
|
|
1039
|
+
boostmhz: 1.5,
|
|
1040
|
+
memorychannels: 8,
|
|
1041
|
+
tdpwatts: 0.2,
|
|
1042
|
+
};
|
|
1043
|
+
/**
|
|
1044
|
+
* Computes a scalar capability score for a processor spec. The score blends
|
|
1045
|
+
* core count, thread count, L3 capacity, boost clock, memory channels and
|
|
1046
|
+
* sustainable power, which produces a stable ordering of the bank.
|
|
1047
|
+
*/
|
|
1048
|
+
export function cpuscore(spec) {
|
|
1049
|
+
const score = spec.cores * cpuscoreweights.core +
|
|
1050
|
+
spec.threads * cpuscoreweights.thread +
|
|
1051
|
+
spec.l3mb * cpuscoreweights.l3mb +
|
|
1052
|
+
spec.boostclockmhz * cpuscoreweights.boostmhz +
|
|
1053
|
+
spec.memorychannels * cpuscoreweights.memorychannels +
|
|
1054
|
+
spec.tdpwatts * cpuscoreweights.tdpwatts;
|
|
1055
|
+
return Number(score.toFixed(2));
|
|
1056
|
+
}
|
|
1057
|
+
/** Compares two specs by capability score, descending. */
|
|
1058
|
+
export function compareVirtualProcessors(a, b) {
|
|
1059
|
+
return cpuscore(b) - cpuscore(a);
|
|
1060
|
+
}
|
|
1061
|
+
/** Returns the bank sorted by capability score, strongest first. */
|
|
1062
|
+
export function listBestVirtualProcessors() {
|
|
1063
|
+
return [...cpuRegistry.values()].sort(compareVirtualProcessors);
|
|
1064
|
+
}
|
|
1065
|
+
/** Serializes a provisioned processor to a JSON-safe object. */
|
|
1066
|
+
export function serializeprovisionedcpu(provisioned) {
|
|
1067
|
+
try {
|
|
1068
|
+
return {
|
|
1069
|
+
id: provisioned.id,
|
|
1070
|
+
model: provisioned.spec.model,
|
|
1071
|
+
vendor: provisioned.spec.vendor,
|
|
1072
|
+
vcpus: provisioned.vcpus,
|
|
1073
|
+
coresonline: provisioned.topology.coresonline,
|
|
1074
|
+
threadspercore: provisioned.topology.threadspercore,
|
|
1075
|
+
score: cpuscore(provisioned.spec),
|
|
1076
|
+
createdat: provisioned.createdat,
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
catch (cause) {
|
|
1080
|
+
throw new hardwareerror('serializeprovisionedcpu failed', { cause: cause });
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
/* ------------------------------------------------------------------ */
|
|
1084
|
+
/* Section 12: disposable registry lease and demo */
|
|
1085
|
+
/* ------------------------------------------------------------------ */
|
|
1086
|
+
/**
|
|
1087
|
+
* Lease over a runtime-registered custom model. The lease removes the model
|
|
1088
|
+
* from the cpuRegistry when disposed through a `using` declaration, which
|
|
1089
|
+
* keeps speculative registrations from polluting the global bank.
|
|
1090
|
+
*/
|
|
1091
|
+
export class modellease {
|
|
1092
|
+
model;
|
|
1093
|
+
spec;
|
|
1094
|
+
#released;
|
|
1095
|
+
constructor(spec) {
|
|
1096
|
+
this.model = spec.model;
|
|
1097
|
+
this.spec = spec;
|
|
1098
|
+
this.#released = false;
|
|
1099
|
+
registerVirtualCpu(spec);
|
|
1100
|
+
}
|
|
1101
|
+
/** True while the leased model is still registered. */
|
|
1102
|
+
get active() {
|
|
1103
|
+
return !this.#released;
|
|
1104
|
+
}
|
|
1105
|
+
/** Releases the lease, removing the model from the registry. */
|
|
1106
|
+
release() {
|
|
1107
|
+
if (!this.#released) {
|
|
1108
|
+
removeVirtualCpu(this.model);
|
|
1109
|
+
this.#released = true;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
/** Synchronous disposer so leases compose with `using` declarations. */
|
|
1113
|
+
[Symbol.dispose]() {
|
|
1114
|
+
try {
|
|
1115
|
+
this.release();
|
|
1116
|
+
}
|
|
1117
|
+
catch {
|
|
1118
|
+
/* double release is a no-op by construction */
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* End-to-end demo of the virtualcpu pipeline: provisions the EPYC 9965 at a
|
|
1124
|
+
* random vCPU count, registers a leased custom model through a `using`
|
|
1125
|
+
* declaration and returns the serialized summary plus the first cpuinfo
|
|
1126
|
+
* block for eyeball verification.
|
|
1127
|
+
*/
|
|
1128
|
+
export function virtualcpudemo() {
|
|
1129
|
+
try {
|
|
1130
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
1131
|
+
try {
|
|
1132
|
+
const leased = __addDisposableResource(env_1, new modellease({
|
|
1133
|
+
model: 'virtual engineering sample',
|
|
1134
|
+
displayname: 'Virtual Engineering Sample 32-Core Processor',
|
|
1135
|
+
vendor: 'amd',
|
|
1136
|
+
cores: 32,
|
|
1137
|
+
threads: 64,
|
|
1138
|
+
baseclockmhz: 3000,
|
|
1139
|
+
boostclockmhz: 5000,
|
|
1140
|
+
allcoreclockmhz: 4300,
|
|
1141
|
+
l3mb: 128,
|
|
1142
|
+
l2mb: 32,
|
|
1143
|
+
socket: 'virtual',
|
|
1144
|
+
tdpwatts: 180,
|
|
1145
|
+
maxtdpwatts: 220,
|
|
1146
|
+
pcie: 'PCIe 5.0 x32',
|
|
1147
|
+
maxmemorygb: 512,
|
|
1148
|
+
memorytype: 'DDR5-5600',
|
|
1149
|
+
memorychannels: 4,
|
|
1150
|
+
microarch: 'virtual',
|
|
1151
|
+
cpufamily: 25,
|
|
1152
|
+
cpumodel: 17,
|
|
1153
|
+
stepping: 1,
|
|
1154
|
+
physicalline: '48 bits physical',
|
|
1155
|
+
virtualline: '57 bits virtual',
|
|
1156
|
+
launch: '2026-08-22',
|
|
1157
|
+
}), false);
|
|
1158
|
+
const vcpus = randomInt(8, 65);
|
|
1159
|
+
const provisioned = createVirtualProcessor('AMD EPYC 9965', vcpus);
|
|
1160
|
+
return {
|
|
1161
|
+
leasedmodel: leased.model,
|
|
1162
|
+
leasedactive: leased.active,
|
|
1163
|
+
summary: serializeprovisionedcpu(provisioned),
|
|
1164
|
+
march: marchFlag(),
|
|
1165
|
+
cpuinfohead: provisioned.cpuinfotext.split('\n').slice(0, 5).join('\n'),
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
catch (e_1) {
|
|
1169
|
+
env_1.error = e_1;
|
|
1170
|
+
env_1.hasError = true;
|
|
1171
|
+
}
|
|
1172
|
+
finally {
|
|
1173
|
+
__disposeResources(env_1);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
catch (cause) {
|
|
1177
|
+
throw new hardwareerror('virtualcpudemo failed', { cause: cause });
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
//# sourceMappingURL=virtualcpu.js.map
|