From 87e2633afe10854212ccb2efc3993b8240fcb43a Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Sun, 25 Oct 2026 12:49:15 +0100 Subject: [PATCH 1/2] engine/strata: bring the Strata subtree to upstream 41cf05a0 (engine 0.1.50) with the local patches re-applied Documented tree replacement (the history has no git-subtree metadata): 3-way merge of the old subtree (570201a:engine/strata) against upstream 41cf05a06a25dd29103b7b27a2279a3f60c21876 (2026-10-25), merge base = the old pin d9ab8435 (tree-identical to upstream 5b734e42; d9ab8435 is not an ancestor of upstream main). Local patches re-applied by hand where they conflicted (15 files): STRATA_CUDA_STATIC profile, experimental KAR experts and KAR PLE arms, keyless V-only arm (now beside upstream's K8V4 hybrid KV and fused norm+rope). Details, conflict table and left-out files are in docs/upstream.md. Left out (weights, captures, logs, media): new bench/results (2022 files), binary media and app assets (61), docs/work/evidence (24), *.bin / *.gguf data files, and the 7 files the first import already left out. scripts/build-cpu.sh: build the 11 CPU tests upstream registered since the old pin (they ran as "Not Run"). Checked: build-cpu.sh 16/16 ctest in WSL; sm_86 CUDA objects of the patched files compile, also with the KAR macros on. No GPU run, no quality gate. Co-Authored-By: Claude Sonnet 5.5 --- engine/strata/.gitattributes | 18 + .../.github/ISSUE_TEMPLATE/benchmark.yml | 26 + .../.github/ISSUE_TEMPLATE/bug_report.yml | 101 + .../strata/.github/ISSUE_TEMPLATE/config.yml | 5 + .../ISSUE_TEMPLATE/feature_request.yml | 41 + .../.github/ISSUE_TEMPLATE/question.yml | 45 + .../strata/.github/pull_request_template.md | 30 + engine/strata/.github/scripts/item-check.js | 218 + .../strata/.github/scripts/item-check.test.js | 192 + engine/strata/.github/scripts/reset-bot.js | 164 + .../.github/workflows/docker-images.yml | 114 + engine/strata/.github/workflows/intake.yml | 58 + .../strata/.github/workflows/metal-build.yml | 51 + engine/strata/.github/workflows/reopen.yml | 38 + .../strata/.github/workflows/scripts-test.yml | 21 + .../workflows/terminal-minimal-server.yml | 65 + .../workflows/terminal-portable-monitor.yml | 115 + .../strata/.github/workflows/title-area.yml | 28 + engine/strata/.gitignore | 34 + engine/strata/AGENTS.md | 104 +- engine/strata/BENCH.bat | 19 + engine/strata/CMakeLists.txt | 1456 +- engine/strata/CONTRIBUTING.md | 122 + engine/strata/Dockerfile | 197 +- engine/strata/README.de.md | 188 + engine/strata/README.es.md | 188 + engine/strata/README.fr.md | 188 + engine/strata/README.ja.md | 188 + engine/strata/README.md | 295 +- engine/strata/README.pt-BR.md | 188 + engine/strata/README.zh-CN.md | 188 + engine/strata/SECURITY.md | 95 + engine/strata/START-HERE.bat | 13 + engine/strata/UPDATE.bat | 82 + engine/strata/apps/desktop/package-lock.json | 232 + engine/strata/apps/desktop/package.json | 20 + .../apps/desktop/scripts/app-close-matrix.py | 361 + .../strata/apps/desktop/scripts/cards-e2e.mjs | 110 + .../apps/desktop/scripts/fetch-node.ps1 | 72 + .../strata/apps/desktop/scripts/fetch-node.sh | 103 + .../apps/desktop/scripts/first-run-ui.mjs | 121 + .../apps/desktop/scripts/flatten-pnpm.mjs | 133 + .../apps/desktop/scripts/harness-prune.mjs | 79 + .../apps/desktop/scripts/installed-flow.mjs | 310 + .../desktop/scripts/installer-mockups.mjs | 73 + .../apps/desktop/scripts/local-gguf-e2e.mjs | 126 + .../strata/apps/desktop/scripts/make-dmg.sh | 59 + .../apps/desktop/scripts/make-icons.mjs | 78 + .../desktop/scripts/make-installer-images.mjs | 66 + .../desktop/scripts/make-tester-readme.sh | 85 + .../strata/apps/desktop/scripts/pics-e2e.mjs | 200 + .../apps/desktop/scripts/repack-appimage.sh | 68 + .../apps/desktop/scripts/stage-control.py | 202 + .../apps/desktop/scripts/stage-harness.mjs | 176 + .../strata/apps/desktop/scripts/ui-flows.mjs | 721 + .../apps/desktop/scripts/vision-e2e.mjs | 121 + .../strata/apps/desktop/src-tauri/.gitignore | 2 + .../strata/apps/desktop/src-tauri/Cargo.lock | 5458 +++++++ .../strata/apps/desktop/src-tauri/Cargo.toml | 30 + engine/strata/apps/desktop/src-tauri/build.rs | 3 + .../apps/desktop/src-tauri/entitlements.plist | 15 + .../src-tauri/gen/schemas/acl-manifests.json | 1 + .../src-tauri/gen/schemas/capabilities.json | 1 + .../src-tauri/gen/schemas/desktop-schema.json | 2636 ++++ .../src-tauri/gen/schemas/macOS-schema.json | 2636 ++++ .../android/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../android/values/ic_launcher_background.xml | 4 + .../apps/desktop/src-tauri/nsis/installer.nsi | 1113 ++ .../src-tauri/resources/control/.gitignore | 3 + .../resources/engine-bundle/.gitignore | 2 + .../src-tauri/resources/node/.gitignore | 6 + .../apps/desktop/src-tauri/src/desktoplog.rs | 600 + .../strata/apps/desktop/src-tauri/src/main.rs | 1338 ++ .../apps/desktop/src-tauri/src/supervisor.rs | 497 + .../apps/desktop/src-tauri/src/updater.rs | 278 + .../apps/desktop/src-tauri/tauri.conf.json | 76 + .../desktop/src-tauri/tauri.release.conf.json | 5 + .../desktop/src-tauri/tauri.tester.conf.json | 7 + .../desktop/src-tauri/tauri.update.conf.json | 7 + .../desktop/tester/README-amd-rx7900.txt.in | 98 + .../desktop/tester/README-amd-rx9070.txt.in | 94 + .../apps/desktop/tester/README-linux.txt.in | 72 + .../apps/desktop/tester/README-mac.txt.in | 39 + .../desktop/tester/common-gatekeeper-mac.txt | 27 + .../desktop/tester/common-troubleshoot.txt | 42 + engine/strata/apps/host/.gitignore | 8 + engine/strata/apps/host/README.md | 12 + .../apps/host/audit-fixes/FINDING-STATUS.md | 183 + .../strata/apps/host/audit-fixes/PROGRESS.md | 202 + .../strata/apps/host/audit-fixes/PROMPTS.md | 35 + engine/strata/apps/host/audit-fixes/README.md | 71 + engine/strata/apps/host/audit-fixes/REVIEW.md | 47 + .../apps/host/audit-fixes/apply-chat.py | 32 + .../apps/host/audit-fixes/apply-engine.py | 52 + .../apps/host/audit-fixes/apply-finishing.py | 31 + .../apps/host/audit-fixes/apply-model.py | 98 + .../apps/host/audit-fixes/apply-screens.py | 45 + .../apps/host/audit-fixes/apply-shared.py | 88 + .../audit-fixes/baseline-preview-state.json | 120 + .../apps/host/audit-fixes/changed-files.txt | 54 + .../audit-fixes/designs/Engine v3.dc.html | 842 + .../host/audit-fixes/designs/Model.dc.html | 384 + .../apps/host/audit-fixes/finding-status.json | 1949 +++ .../apps/host/audit-fixes/findings.json | 1241 ++ .../apps/host/audit-fixes/review-fixture.json | 1 + .../strata/apps/host/audit-fixes/summary.json | 1 + .../audit-fixes/tasks/T01-one-model-name.md | 72 + .../audit-fixes/tasks/T02-overlay-layering.md | 55 + .../audit-fixes/tasks/T03-control-states.md | 55 + .../audit-fixes/tasks/T04-error-notice.md | 67 + .../audit-fixes/tasks/T05-live-numbers.md | 57 + .../audit-fixes/tasks/T06-response-hover.md | 43 + .../audit-fixes/tasks/T07-hide-unbuilt.md | 49 + .../audit-fixes/tasks/T08-nav-engine-model.md | 45 + .../host/audit-fixes/tasks/T09-model-page.md | 77 + .../host/audit-fixes/tasks/T10-engine-page.md | 77 + .../apps/host/audit-fixes/tasks/T11-chat.md | 105 + .../host/audit-fixes/tasks/T12-time-skip.md | 50 + .../host/audit-fixes/tasks/T13-serving.md | 75 + .../host/audit-fixes/tasks/T14-monitor.md | 43 + .../audit-fixes/tasks/T15-skills-tasks.md | 60 + .../audit-fixes/tasks/T16-settings-setup.md | 54 + .../host/audit-fixes/tasks/T17-navigation.md | 51 + .../audit-fixes/tasks/T18-preview-panel.md | 52 + .../host/audit-fixes/tasks/T19-dark-mode.md | 47 + .../apps/host/audit-fixes/write-review.py | 121 + .../apps/host/docs/README-historical.md | 162 + .../host/docs/annotations-19-2026-10-09.md | 33 + .../host/docs/annotations-32-2026-10-09.md | 86 + .../docs/annotations-followup-2026-10-09.md | 30 + .../apps/host/docs/chat-shell-2026-10-06.md | 31 + .../docs/design-improvements-2026-10-05.md | 1017 ++ .../apps/host/docs/design-system-notes.md | 297 + engine/strata/apps/host/docs/dsh-recon.md | 378 + .../engine-models-onboarding-2026-10-05.md | 115 + .../apps/host/docs/interaction-guidelines.md | 256 + .../apps/host/docs/native-engine-handover.md | 112 + .../01-gamer-debate.md | 26 + .../01-gamer-vote.json | 99 + .../persona-review-2026-10-05/01-gamer.md | 47 + .../02-mac-debate.md | 29 + .../02-mac-vote.json | 100 + .../docs/persona-review-2026-10-05/02-mac.md | 34 + .../03-teacher-debate.md | 33 + .../03-teacher-vote.json | 37 + .../persona-review-2026-10-05/03-teacher.md | 50 + .../04-newcomer-debate.md | 30 + .../04-newcomer-vote.json | 102 + .../persona-review-2026-10-05/04-newcomer.md | 51 + .../05-tinkerer-debate.md | 33 + .../05-tinkerer-vote.json | 37 + .../persona-review-2026-10-05/05-tinkerer.md | 157 + .../06-parallel-debate.md | 27 + .../06-parallel-vote.json | 37 + .../persona-review-2026-10-05/06-parallel.md | 48 + .../07-research-debate.md | 33 + .../07-research-vote.json | 36 + .../persona-review-2026-10-05/07-research.md | 145 + .../08-office-debate.md | 29 + .../08-office-vote.json | 36 + .../persona-review-2026-10-05/08-office.md | 47 + .../docs/persona-review-2026-10-05/ballot.md | 58 + .../decision-report.md | 190 + .../implementation-verification.md | 98 + .../persona-review-2026-10-05/vote-tally.json | 203 + engine/strata/apps/host/docs/plans/01-chat.md | 143 + .../strata/apps/host/docs/plans/02-models.md | 287 + .../apps/host/docs/plans/03-engine-tuning.md | 89 + .../strata/apps/host/docs/plans/04-monitor.md | 94 + .../strata/apps/host/docs/plans/05-serving.md | 87 + .../apps/host/docs/plans/06-workspace.md | 82 + .../strata/apps/host/docs/plans/07-skills.md | 80 + .../apps/host/docs/plans/08-settings.md | 157 + .../apps/host/docs/plans/09-first-run.md | 92 + .../host/docs/plans/09-multiple-models.md | 68 + .../strata/apps/host/docs/plans/10-sidebar.md | 99 + .../host/docs/plans/11-command-palette.md | 83 + .../apps/host/docs/plans/12-context-rail.md | 92 + .../apps/host/docs/plans/13-overlays.md | 118 + .../strata/apps/host/docs/plans/14-states.md | 90 + .../strata/apps/host/docs/plans/15-motion.md | 100 + .../apps/host/docs/plans/16-accessibility.md | 101 + .../host/docs/plans/17-local-model-import.md | 72 + .../docs/plans/18-native-feature-parity.md | 20 + .../apps/host/docs/plans/INDEX-CHECKLIST.md | 267 + engine/strata/apps/host/docs/plans/README.md | 67 + .../apps/host/docs/ui-followup-2026-10-06.md | 46 + .../host/docs/user-feedback-2026-10-05.md | 64 + .../host/docs/user-feedback-2026-10-06.md | 74 + engine/strata/apps/host/index.html | 34 + engine/strata/apps/host/package-lock.json | 2197 +++ engine/strata/apps/host/package.json | 50 + .../host/public/brand/source-manifest.json | 114 + .../host/public/brand/strata-lockup-dark.svg | 6 + .../host/public/brand/strata-lockup-light.svg | 6 + .../host/public/brand/strata-mark-dark.svg | 3 + .../host/public/brand/strata-mark-light.svg | 3 + .../examples/fieldnotes-cover-revision.svg | 11 + .../examples/fieldnotes-cover-timeskip.svg | 12 + .../host/public/examples/fieldnotes-cover.svg | 1 + .../apps/host/public/examples/fieldnotes.html | 1 + .../apps/host/public/examples/note-card.ts | 25 + .../host/public/examples/project-brief.md | 35 + .../host/public/examples/release-plan.csv | 7 + engine/strata/apps/host/public/favicon.svg | 6 + .../strata/apps/host/public/icons/sprite.svg | 283 + .../strata/apps/host/public/site.webmanifest | 22 + .../apps/host/scripts/agent-flow-s4b.mjs | 161 + .../strata/apps/host/scripts/agent-flow.mjs | 156 + .../strata/apps/host/scripts/agent-http.mjs | 223 + .../strata/apps/host/scripts/agent2-flow.mjs | 180 + .../apps/host/scripts/agent2-tools-flow.mjs | 196 + .../strata/apps/host/scripts/agent3-http.mjs | 130 + .../apps/host/scripts/append-localization.mjs | 15 + .../apps/host/scripts/approval-flow.mjs | 85 + .../host/scripts/assets/make-chat-media.py | 39 + engine/strata/apps/host/scripts/audit-ui.mjs | 373 + .../strata/apps/host/scripts/context-e2e.mjs | 182 + engine/strata/apps/host/scripts/contrast.mjs | 403 + engine/strata/apps/host/scripts/dev.mjs | 66 + engine/strata/apps/host/scripts/flow.mjs | 1794 +++ engine/strata/apps/host/scripts/flows.mjs | 55 + .../host/scripts/localization-catalog.mjs | 34 + .../strata/apps/host/scripts/localize-ui.mjs | 27 + engine/strata/apps/host/scripts/luminance.mjs | 202 + .../apps/host/scripts/make-fix-locales.py | 385 + .../apps/host/scripts/make-tune-locales.py | 225 + engine/strata/apps/host/scripts/measure.mjs | 126 + .../apps/host/scripts/mode-flow-s4b.mjs | 49 + engine/strata/apps/host/scripts/motion.mjs | 294 + .../strata/apps/host/scripts/motionbudget.mjs | 207 + .../strata/apps/host/scripts/pictures-ui.mjs | 100 + .../apps/host/scripts/prepare-brand-assets.py | 199 + .../strata/apps/host/scripts/preview-ui.mjs | 26 + engine/strata/apps/host/scripts/qa2-flows.mjs | 215 + engine/strata/apps/host/scripts/shoot.mjs | 55 + .../strata/apps/host/scripts/skills-shot.mjs | 27 + .../strata/apps/host/scripts/slow-proxy.mjs | 23 + .../apps/host/scripts/sync-design-kit.mjs | 87 + .../apps/host/scripts/task-flow-s4b.mjs | 39 + engine/strata/apps/host/scripts/test.mjs | 16 + .../strata/apps/host/scripts/tools-shots.mjs | 81 + engine/strata/apps/host/scripts/ui-drive.mjs | 26 + .../strata/apps/host/server/acquisition.mjs | 31 + .../strata/apps/host/server/agent/README.md | 160 + .../apps/host/server/agent/agent-bridge.mjs | 1369 ++ engine/strata/apps/host/server/agent/ask.mjs | 125 + .../apps/host/server/agent/browser-probe.mjs | 61 + .../apps/host/server/agent/children.mjs | 187 + .../apps/host/server/agent/context-budget.mjs | 162 + .../apps/host/server/agent/context-fit.mjs | 102 + .../host/server/agent/custom-command-run.mjs | 103 + .../host/server/agent/custom-tools-mcp.mjs | 63 + .../apps/host/server/agent/deliverables.mjs | 201 + .../host/server/agent/engine-progress.mjs | 11 + .../apps/host/server/agent/engine-speed.mjs | 41 + .../strata/apps/host/server/agent/events.mjs | 469 + .../apps/host/server/agent/gateway-client.mjs | 147 + .../host/server/agent/harness-runtime.mjs | 160 + .../apps/host/server/agent/llm-shape.mjs | 118 + .../apps/host/server/agent/model-routes.mjs | 151 + engine/strata/apps/host/server/agent/plan.mjs | 278 + .../server/agent/plugins/strata-context.mjs | 159 + .../host/server/agent/plugins/strata-gate.mjs | 295 + .../server/agent/plugins/strata-models.mjs | 85 + .../server/agent/plugins/strata-search.mjs | 25 + .../strata/apps/host/server/agent/preset.mjs | 99 + .../strata/apps/host/server/agent/profile.mjs | 357 + .../apps/host/server/agent/skills-used.mjs | 43 + .../strata/apps/host/server/agent/status.mjs | 160 + .../apps/host/server/agent/task-run.mjs | 42 + .../apps/host/server/agent/tools-catalog.mjs | 31 + .../apps/host/server/agent/tools-settings.mjs | 218 + .../apps/host/server/agent/turn-guard.mjs | 105 + engine/strata/apps/host/server/api-paths.mjs | 12 + engine/strata/apps/host/server/app-ui.mjs | 108 + .../strata/apps/host/server/app-updater.mjs | 43 + .../strata/apps/host/server/app-version.mjs | 25 + engine/strata/apps/host/server/artifacts.mjs | 31 + .../apps/host/server/bundled-engine.mjs | 288 + engine/strata/apps/host/server/catalog.mjs | 118 + engine/strata/apps/host/server/chat-files.mjs | 188 + .../strata/apps/host/server/chat-images.mjs | 1 + .../strata/apps/host/server/chat-uploads.mjs | 125 + engine/strata/apps/host/server/cloudflare.mjs | 101 + .../apps/host/server/cloudflared-find.mjs | 193 + .../apps/host/server/cloudflared-install.mjs | 94 + .../apps/host/server/control-runtime.mjs | 310 + .../strata/apps/host/server/device-probes.mjs | 112 + .../apps/host/server/engine-install.mjs | 200 + .../strata/apps/host/server/engine-step.mjs | 102 + .../apps/host/server/engine-version.mjs | 35 + engine/strata/apps/host/server/engine.mjs | 316 + .../strata/apps/host/server/external-env.mjs | 71 + .../strata/apps/host/server/folder-dialog.mjs | 200 + engine/strata/apps/host/server/fonts.mjs | 23 + engine/strata/apps/host/server/gguf.mjs | 43 + engine/strata/apps/host/server/gpu-roles.mjs | 52 + engine/strata/apps/host/server/hardware.mjs | 322 + .../apps/host/server/host-bootstrap.cjs | 23 + .../apps/host/server/image-catalog.json | 40 + .../strata/apps/host/server/image-models.mjs | 149 + engine/strata/apps/host/server/index.mjs | 2260 +++ engine/strata/apps/host/server/inference.mjs | 537 + .../strata/apps/host/server/local-models.mjs | 57 + .../strata/apps/host/server/local-share.mjs | 31 + engine/strata/apps/host/server/mcp-names.mjs | 10 + .../strata/apps/host/server/missing-files.mjs | 30 + .../host/server/model-directory-default.mjs | 20 + .../strata/apps/host/server/model-files.mjs | 27 + .../strata/apps/host/server/model-folder.mjs | 112 + .../strata/apps/host/server/model-names.mjs | 8 + .../apps/host/server/model-providers.mjs | 226 + engine/strata/apps/host/server/models.mjs | 356 + .../apps/host/server/monitor-dashboard.mjs | 30 + engine/strata/apps/host/server/monitor.mjs | 382 + .../apps/host/server/native-autotune.mjs | 141 + .../apps/host/server/native-control.mjs | 536 + .../strata/apps/host/server/native-drop.mjs | 48 + .../apps/host/server/native-gateway.mjs | 18 + .../apps/host/server/native-parallel.mjs | 153 + .../apps/host/server/native-resources.mjs | 142 + .../apps/host/server/native-settings.mjs | 79 + .../apps/host/server/native-user-args.mjs | 47 + .../strata/apps/host/server/native-vision.mjs | 10 + .../strata/apps/host/server/no-model-text.mjs | 3 + .../apps/host/server/open-text-file.mjs | 38 + engine/strata/apps/host/server/oversize.mjs | 30 + .../apps/host/server/platform-paths.mjs | 48 + engine/strata/apps/host/server/ports.mjs | 30 + .../apps/host/server/powershell-utf8.mjs | 9 + .../strata/apps/host/server/private-file.mjs | 26 + .../apps/host/server/python-resolver.mjs | 62 + .../apps/host/server/real-model-catalog.mjs | 143 + .../strata/apps/host/server/request-queue.mjs | 34 + .../apps/host/server/run-config-check.mjs | 140 + .../apps/host/server/runtime-models.mjs | 151 + engine/strata/apps/host/server/serving.mjs | 169 + engine/strata/apps/host/server/setup.mjs | 6 + .../strata/apps/host/server/skill-edits.mjs | 14 + .../strata/apps/host/server/skill-files.mjs | 74 + .../apps/host/server/skill-selection.mjs | 11 + engine/strata/apps/host/server/snapshot.mjs | 29 + .../strata/apps/host/server/storage-check.mjs | 13 + engine/strata/apps/host/server/store.mjs | 176 + engine/strata/apps/host/server/supervisor.mjs | 416 + engine/strata/apps/host/server/system-ca.mjs | 24 + .../apps/host/server/system-telemetry.mjs | 104 + .../strata/apps/host/server/task-report.mjs | 51 + engine/strata/apps/host/server/tasks.mjs | 75 + .../strata/apps/host/server/timeskip-fork.mjs | 332 + .../apps/host/server/timeskip-revise.mjs | 58 + engine/strata/apps/host/server/timeskip.mjs | 509 + .../apps/host/server/update-messages.mjs | 66 + engine/strata/apps/host/server/updates.mjs | 122 + engine/strata/apps/host/server/util.mjs | 107 + .../strata/apps/host/server/vision-probe.mjs | 79 + .../apps/host/server/web-search-bing.mjs | 68 + .../apps/host/server/web-search-ddg.mjs | 264 + .../apps/host/server/web-search-keyed.mjs | 66 + .../strata/apps/host/server/windows-gpu.mjs | 90 + .../strata/apps/host/server/windows-poll.mjs | 45 + engine/strata/apps/host/src/app/App.tsx | 204 + .../apps/host/src/app/CommandPalette.tsx | 172 + .../strata/apps/host/src/app/ContextPanel.tsx | 51 + .../apps/host/src/app/SamplingDrawer.tsx | 80 + engine/strata/apps/host/src/app/Shortcuts.tsx | 46 + engine/strata/apps/host/src/app/Sidebar.tsx | 194 + engine/strata/apps/host/src/app/TaskTree.tsx | 85 + .../apps/host/src/assets/icons/README.md | 21 + .../apps/host/src/assets/icons/engine.svg | 9 + .../host/src/assets/icons/family-qwen.svg | 6 + .../apps/host/src/assets/icons/model-file.svg | 9 + .../apps/host/src/assets/icons/models.svg | 9 + .../apps/host/src/assets/icons/skills.svg | 4 + .../apps/host/src/components/ArtifactCard.tsx | 46 + .../host/src/components/ArtifactPanel.tsx | 156 + .../apps/host/src/components/AutoTune.tsx | 15 + .../strata/apps/host/src/components/Brand.tsx | 24 + .../apps/host/src/components/ChatMedia.tsx | 21 + .../host/src/components/ChatModelPicker.tsx | 112 + .../apps/host/src/components/ChatPhotos.tsx | 26 + .../apps/host/src/components/ChatToolbar.tsx | 47 + .../host/src/components/CloudflareDialog.tsx | 102 + .../host/src/components/ComposerControls.tsx | 195 + .../apps/host/src/components/ContextRing.tsx | 8 + .../apps/host/src/components/DecimalInput.tsx | 28 + .../apps/host/src/components/Deliverables.tsx | 91 + .../host/src/components/DictationControl.tsx | 118 + .../host/src/components/DownloadParts.tsx | 17 + .../apps/host/src/components/DropZone.tsx | 46 + .../host/src/components/EngineExperience.tsx | 225 + .../host/src/components/EngineFirstRun.tsx | 173 + .../host/src/components/EngineWarning.tsx | 13 + .../apps/host/src/components/FamilySwitch.tsx | 30 + .../apps/host/src/components/FloatingMenu.tsx | 40 + .../apps/host/src/components/FolderChip.tsx | 28 + .../host/src/components/FolderPathDialog.tsx | 21 + .../apps/host/src/components/FontChoice.tsx | 24 + .../apps/host/src/components/GoalBar.tsx | 52 + .../apps/host/src/components/GpuRoles.tsx | 136 + .../apps/host/src/components/GuidedSetup.tsx | 280 + .../host/src/components/LifecycleNotice.tsx | 11 + .../host/src/components/LocalModelImport.tsx | 101 + .../src/components/ManagedModelLibrary.tsx | 100 + .../apps/host/src/components/Markdown.tsx | 146 + .../apps/host/src/components/MathView.tsx | 43 + .../src/components/ModelsFolderDialog.tsx | 273 + .../apps/host/src/components/NativeDelete.tsx | 45 + .../host/src/components/NativeLocalModel.tsx | 98 + .../host/src/components/NativeMcpEditor.tsx | 43 + .../apps/host/src/components/NativeModels.tsx | 245 + .../host/src/components/NativeMonitor.tsx | 55 + .../host/src/components/NativeOperations.tsx | 126 + .../host/src/components/NativePresets.tsx | 34 + .../host/src/components/NativeSettings.tsx | 133 + .../src/components/NativeSettingsFile.tsx | 43 + .../apps/host/src/components/NativeTune.tsx | 106 + .../host/src/components/NativeTuneBadge.tsx | 37 + .../strata/apps/host/src/components/Num.tsx | 29 + .../host/src/components/OnboardingArt.tsx | 86 + .../src/components/OnboardingCheckbox.tsx | 9 + .../host/src/components/OnboardingMemory.tsx | 39 + .../src/components/OnboardingResources.tsx | 26 + .../apps/host/src/components/PcFitCard.tsx | 28 + .../apps/host/src/components/PdfPreview.tsx | 75 + .../apps/host/src/components/PlanCard.tsx | 100 + .../apps/host/src/components/Popover.tsx | 41 + .../host/src/components/PreviewControls.tsx | 10 + .../src/components/PreviewResizeHandle.tsx | 34 + .../apps/host/src/components/PrivacyNotes.tsx | 17 + .../apps/host/src/components/QuitStrata.tsx | 29 + .../host/src/components/ReasoningBlock.tsx | 26 + .../host/src/components/RunExpertEditor.tsx | 81 + .../host/src/components/RunImageModel.tsx | 40 + .../apps/host/src/components/RunPreview.tsx | 38 + .../host/src/components/RunningModels.tsx | 45 + .../host/src/components/SettingsModels.tsx | 159 + .../host/src/components/SettingsStorage.tsx | 120 + .../host/src/components/SettingsTools.tsx | 195 + .../host/src/components/SettingsUpdates.tsx | 105 + .../host/src/components/SnapshotDialog.tsx | 45 + .../apps/host/src/components/StatusLine.tsx | 32 + .../apps/host/src/components/SubagentRow.tsx | 27 + .../apps/host/src/components/SyntaxCode.tsx | 7 + .../apps/host/src/components/TablePreview.tsx | 46 + .../apps/host/src/components/TaskBoard.tsx | 202 + .../apps/host/src/components/TaskDetail.tsx | 45 + .../apps/host/src/components/TaskEditor.tsx | 64 + .../host/src/components/TelemetryPopover.tsx | 57 + .../host/src/components/TimeSkipCompare.tsx | 113 + .../host/src/components/TimeSkipPanel.tsx | 199 + .../host/src/components/TimeSkipWorking.tsx | 71 + .../apps/host/src/components/TuneRunView.tsx | 96 + .../host/src/components/UsageDashboard.tsx | 80 + .../host/src/components/VersionLadder.tsx | 42 + .../src/components/VersionMemoryTooltip.tsx | 33 + .../host/src/components/VersionPicker.tsx | 88 + .../apps/host/src/components/charts.tsx | 153 + .../apps/host/src/components/layout.tsx | 45 + engine/strata/apps/host/src/components/ui.tsx | 537 + engine/strata/apps/host/src/lib/agents.ts | 27 + .../strata/apps/host/src/lib/answer-text.ts | 33 + engine/strata/apps/host/src/lib/app-mode.ts | 25 + .../strata/apps/host/src/lib/app-version.ts | 9 + engine/strata/apps/host/src/lib/artifacts.ts | 29 + engine/strata/apps/host/src/lib/ask.ts | 64 + engine/strata/apps/host/src/lib/board.ts | 234 + .../apps/host/src/lib/chat-attach-file.ts | 11 + .../strata/apps/host/src/lib/chat-folder.ts | 49 + .../strata/apps/host/src/lib/chat-metrics.ts | 42 + .../strata/apps/host/src/lib/chat-photos.ts | 20 + .../strata/apps/host/src/lib/chat-showcase.ts | 20 + engine/strata/apps/host/src/lib/client.ts | 124 + engine/strata/apps/host/src/lib/clipboard.ts | 35 + engine/strata/apps/host/src/lib/commands.ts | 98 + engine/strata/apps/host/src/lib/config.ts | 95 + .../strata/apps/host/src/lib/connect-urls.ts | 18 + .../apps/host/src/lib/context-recovery.ts | 32 + engine/strata/apps/host/src/lib/decimal.ts | 9 + .../apps/host/src/lib/deepseek-speed.ts | 30 + .../strata/apps/host/src/lib/deliverables.ts | 129 + engine/strata/apps/host/src/lib/dictation.ts | 53 + .../strata/apps/host/src/lib/download-eta.ts | 75 + engine/strata/apps/host/src/lib/drafting.ts | 10 + .../strata/apps/host/src/lib/engine-setup.ts | 19 + engine/strata/apps/host/src/lib/experience.ts | 168 + engine/strata/apps/host/src/lib/features.ts | 2 + engine/strata/apps/host/src/lib/focus.ts | 150 + .../strata/apps/host/src/lib/folder-pick.ts | 50 + engine/strata/apps/host/src/lib/format.ts | 133 + engine/strata/apps/host/src/lib/fuzzy.ts | 110 + engine/strata/apps/host/src/lib/goal.ts | 67 + engine/strata/apps/host/src/lib/gpu-roles.ts | 277 + .../apps/host/src/lib/hardware-summary.ts | 11 + engine/strata/apps/host/src/lib/i18n.ts | 70 + engine/strata/apps/host/src/lib/kept-state.ts | 23 + engine/strata/apps/host/src/lib/lifecycle.ts | 16 + .../strata/apps/host/src/lib/live-status.ts | 89 + .../strata/apps/host/src/lib/loop-runner.ts | 142 + engine/strata/apps/host/src/lib/loop.ts | 172 + .../apps/host/src/lib/markdown-images.ts | 32 + engine/strata/apps/host/src/lib/math.ts | 130 + engine/strata/apps/host/src/lib/mcp-names.ts | 5 + .../strata/apps/host/src/lib/model-icons.ts | 5 + .../strata/apps/host/src/lib/model-picker.ts | 30 + .../apps/host/src/lib/model-versions.ts | 22 + .../strata/apps/host/src/lib/monitor-chart.ts | 16 + .../apps/host/src/lib/monitor-hardware.ts | 31 + .../apps/host/src/lib/monitor-summary.ts | 16 + .../apps/host/src/lib/native-catalog.ts | 23 + .../strata/apps/host/src/lib/native-drop.ts | 34 + engine/strata/apps/host/src/lib/native-fit.ts | 117 + .../host/src/lib/native-job-diagnostics.ts | 22 + .../apps/host/src/lib/native-monitor.ts | 60 + .../strata/apps/host/src/lib/native-names.ts | 31 + .../host/src/lib/native-settings-response.ts | 15 + .../strata/apps/host/src/lib/native-tune.ts | 81 + engine/strata/apps/host/src/lib/native.ts | 79 + engine/strata/apps/host/src/lib/no-model.ts | 17 + .../strata/apps/host/src/lib/number-field.ts | 21 + .../apps/host/src/lib/onboarding-download.ts | 21 + .../strata/apps/host/src/lib/pasted-files.ts | 19 + engine/strata/apps/host/src/lib/pictures.ts | 30 + .../strata/apps/host/src/lib/plain-errors.ts | 65 + engine/strata/apps/host/src/lib/plan.ts | 156 + .../apps/host/src/lib/preview-layout.ts | 10 + .../strata/apps/host/src/lib/preview-tabs.ts | 6 + engine/strata/apps/host/src/lib/reasoning.ts | 18 + .../strata/apps/host/src/lib/recent-chats.ts | 17 + engine/strata/apps/host/src/lib/responsive.ts | 23 + engine/strata/apps/host/src/lib/router.ts | 178 + .../apps/host/src/lib/run-config-issues.ts | 32 + engine/strata/apps/host/src/lib/run-memory.ts | 53 + .../strata/apps/host/src/lib/run-profiles.ts | 67 + .../apps/host/src/lib/runtime-models.ts | 29 + .../strata/apps/host/src/lib/serving-state.ts | 6 + .../strata/apps/host/src/lib/session-log.ts | 14 + .../apps/host/src/lib/session-persist.ts | 110 + .../strata/apps/host/src/lib/session-title.ts | 6 + .../apps/host/src/lib/session-workspace.ts | 8 + .../apps/host/src/lib/shortcut-bindings.ts | 19 + engine/strata/apps/host/src/lib/snapshot.ts | 29 + engine/strata/apps/host/src/lib/store.ts | 1996 +++ engine/strata/apps/host/src/lib/syntax.ts | 38 + .../strata/apps/host/src/lib/task-handover.ts | 70 + engine/strata/apps/host/src/lib/tasks.ts | 2 + .../apps/host/src/lib/time-skip-activity.ts | 35 + .../apps/host/src/lib/time-skip-compare.ts | 138 + engine/strata/apps/host/src/lib/time-skip.ts | 290 + .../strata/apps/host/src/lib/tune-outcome.ts | 62 + engine/strata/apps/host/src/lib/tune-phase.ts | 23 + .../strata/apps/host/src/lib/tune-values.ts | 19 + .../apps/host/src/lib/tuning-controls.ts | 16 + engine/strata/apps/host/src/lib/tween.ts | 8 + engine/strata/apps/host/src/lib/types.ts | 511 + .../strata/apps/host/src/lib/update-cache.ts | 32 + .../strata/apps/host/src/lib/update-check.ts | 42 + .../apps/host/src/lib/usage-dashboard.ts | 45 + engine/strata/apps/host/src/lib/use-board.ts | 65 + engine/strata/apps/host/src/locales/de.json | 3530 +++++ engine/strata/apps/host/src/locales/en.json | 3530 +++++ engine/strata/apps/host/src/locales/es.json | 3530 +++++ .../strata/apps/host/src/locales/fix-de.json | 71 + .../strata/apps/host/src/locales/fix-en.json | 71 + .../strata/apps/host/src/locales/fix-es.json | 71 + .../strata/apps/host/src/locales/fix-ja.json | 71 + .../strata/apps/host/src/locales/fix-ko.json | 71 + .../strata/apps/host/src/locales/fix-pt.json | 71 + .../strata/apps/host/src/locales/fix-ru.json | 71 + .../strata/apps/host/src/locales/fix-zh.json | 71 + engine/strata/apps/host/src/locales/ja.json | 3530 +++++ engine/strata/apps/host/src/locales/ko.json | 3530 +++++ engine/strata/apps/host/src/locales/pt.json | 3530 +++++ engine/strata/apps/host/src/locales/ru.json | 3530 +++++ .../apps/host/src/locales/tools-de.json | 6 + .../apps/host/src/locales/tools-en.json | 6 + .../apps/host/src/locales/tools-es.json | 6 + .../apps/host/src/locales/tools-ja.json | 6 + .../apps/host/src/locales/tools-ko.json | 6 + .../apps/host/src/locales/tools-pt.json | 6 + .../apps/host/src/locales/tools-ru.json | 6 + .../apps/host/src/locales/tools-zh.json | 6 + .../strata/apps/host/src/locales/tune-de.json | 45 + .../strata/apps/host/src/locales/tune-en.json | 45 + .../strata/apps/host/src/locales/tune-es.json | 45 + .../strata/apps/host/src/locales/tune-ja.json | 45 + .../strata/apps/host/src/locales/tune-ko.json | 45 + .../strata/apps/host/src/locales/tune-pt.json | 45 + .../strata/apps/host/src/locales/tune-ru.json | 45 + .../strata/apps/host/src/locales/tune-zh.json | 45 + engine/strata/apps/host/src/locales/zh.json | 3530 +++++ engine/strata/apps/host/src/main.tsx | 30 + engine/strata/apps/host/src/screens/Chat.tsx | 721 + .../strata/apps/host/src/screens/ModelRun.tsx | 496 + .../strata/apps/host/src/screens/Models.tsx | 67 + .../strata/apps/host/src/screens/Monitor.tsx | 197 + .../strata/apps/host/src/screens/Serving.tsx | 117 + .../strata/apps/host/src/screens/Settings.tsx | 72 + engine/strata/apps/host/src/screens/Setup.tsx | 20 + .../strata/apps/host/src/screens/Skills.tsx | 91 + engine/strata/apps/host/src/screens/Tasks.tsx | 96 + .../strata/apps/host/src/screens/Tuning.tsx | 234 + .../apps/host/src/styles/annotation-fixes.css | 773 + engine/strata/apps/host/src/styles/app.css | 7524 +++++++++ engine/strata/apps/host/src/styles/board.css | 73 + .../strata/apps/host/src/styles/gpu-roles.css | 50 + .../apps/host/src/styles/kit/components.css | 128 + .../apps/host/src/styles/kit/tokens.css | 88 + .../strata/apps/host/src/styles/model-run.css | 328 + .../strata/apps/host/src/styles/monitor.css | 91 + .../apps/host/src/styles/onboarding.css | 257 + .../strata/apps/host/src/styles/time-skip.css | 177 + .../apps/host/tests/agent-bridge.test.mjs | 299 + .../apps/host/tests/agent-children.test.mjs | 284 + .../apps/host/tests/agent-compaction.test.mjs | 51 + .../apps/host/tests/agent-context.test.mjs | 286 + .../host/tests/agent-deliverables.test.mjs | 123 + .../apps/host/tests/agent-events.test.mjs | 178 + .../apps/host/tests/agent-host.test.mjs | 253 + .../apps/host/tests/agent-modes.test.mjs | 243 + .../apps/host/tests/agent-plan-run.test.mjs | 158 + .../apps/host/tests/agent-plan.test.mjs | 109 + .../apps/host/tests/agent-shape.test.mjs | 142 + .../apps/host/tests/agent-skills.test.mjs | 90 + .../apps/host/tests/agent-status.test.mjs | 224 + .../host/tests/agent-subagent-models.test.mjs | 128 + .../apps/host/tests/agent-tasks.test.mjs | 116 + .../host/tests/agent-tools-settings.test.mjs | 413 + .../apps/host/tests/agent-tools.test.mjs | 286 + .../apps/host/tests/agent-turn-guard.test.mjs | 154 + .../apps/host/tests/agent-updates.test.mjs | 33 + .../apps/host/tests/agent-watchdog.test.mjs | 44 + .../apps/host/tests/annotations-32.test.mjs | 110 + .../apps/host/tests/answer-speed.test.mjs | 123 + .../apps/host/tests/answer-text.test.mjs | 43 + engine/strata/apps/host/tests/app-ui.test.mjs | 140 + .../apps/host/tests/app-version.test.mjs | 30 + engine/strata/apps/host/tests/ask.test.mjs | 53 + .../apps/host/tests/audit-fixes.test.mjs | 46 + engine/strata/apps/host/tests/board.test.mjs | 249 + .../apps/host/tests/bundled-engine.test.mjs | 292 + .../apps/host/tests/card-labels.test.mjs | 40 + .../apps/host/tests/chat-attach-file.test.mjs | 22 + .../host/tests/chat-files-preview.test.mjs | 36 + .../apps/host/tests/chat-files.test.mjs | 96 + .../host/tests/chat-image-context.test.mjs | 9 + .../apps/host/tests/chat-shell.test.mjs | 55 + .../apps/host/tests/chat-shortcuts.test.mjs | 34 + .../apps/host/tests/chat-speed.test.mjs | 43 + .../apps/host/tests/chat-uploads.test.mjs | 51 + .../apps/host/tests/clipboard-copy.test.mjs | 30 + .../apps/host/tests/cloudflared-find.test.mjs | 159 + .../host/tests/component-updates.test.mjs | 452 + .../apps/host/tests/connect-urls.test.mjs | 51 + .../apps/host/tests/connector-setup.test.mjs | 50 + .../apps/host/tests/context-ui.test.mjs | 119 + .../strata/apps/host/tests/cors-help.test.mjs | 23 + .../host/tests/custom-command-tools.test.mjs | 144 + .../apps/host/tests/deepseek-speed.test.mjs | 38 + .../host/tests/developer-previews.test.mjs | 35 + .../strata/apps/host/tests/dictation.test.mjs | 46 + .../apps/host/tests/download-eta.test.mjs | 39 + .../apps/host/tests/draft-layer.test.mjs | 113 + .../strata/apps/host/tests/drafting.test.mjs | 123 + .../apps/host/tests/engine-progress.test.mjs | 23 + .../apps/host/tests/engine-step.test.mjs | 94 + .../apps/host/tests/engine-version.test.mjs | 61 + .../apps/host/tests/experience.test.mjs | 72 + .../apps/host/tests/external-env.test.mjs | 116 + .../host/tests/feedback-controls.test.mjs | 20 + .../host/tests/fixtures/bing-results.html | 7 + .../apps/host/tests/fixtures/mock-two-gpu.mjs | 22 + .../apps/host/tests/fixtures/monitor-host.mjs | 93 + .../host/tests/fixtures/native-ui-host.mjs | 24 + .../host/tests/fixtures/onboarding-export.js | 50 + .../tests/fixtures/onboarding-ui-host.mjs | 127 + .../apps/host/tests/fixtures/tune-ui-host.mjs | 66 + .../tests/fixtures/ui-preview-native.json | 333 + .../apps/host/tests/folder-dialog.test.mjs | 178 + .../apps/host/tests/followup-ui.test.mjs | 77 + .../apps/host/tests/functional-fixes.test.mjs | 155 + .../apps/host/tests/gate-fail-closed.test.mjs | 36 + .../strata/apps/host/tests/gpu-roles.test.mjs | 74 + .../tests/guided-setup-empty-catalog.test.mjs | 84 + .../apps/host/tests/harness-staging.test.mjs | 48 + .../apps/host/tests/helpers/acquire-spy.mjs | 77 + .../host/tests/helpers/assert-private.mjs | 14 + .../apps/host/tests/helpers/hardware.mjs | 9 + .../host/tests/helpers/isolate-profile.mjs | 19 + .../apps/host/tests/helpers/local-gguf.mjs | 13 + .../apps/host/tests/helpers/mini-mcp.mjs | 18 + .../host/tests/helpers/native-fixture.mjs | 42 + .../host/tests/helpers/offline-preload.mjs | 20 + .../apps/host/tests/helpers/react-stub.mjs | 5 + .../host/tests/helpers/scripted-worker.mjs | 277 + .../apps/host/tests/host-lifecycle.test.mjs | 97 + .../apps/host/tests/host-ports.test.mjs | 42 + .../apps/host/tests/image-models.test.mjs | 83 + .../apps/host/tests/inference-line.test.mjs | 21 + .../apps/host/tests/keyless-share.test.mjs | 41 + .../host/tests/language-preferences.test.mjs | 23 + .../host/tests/languages-and-catalog.test.mjs | 57 + .../strata/apps/host/tests/live-chat.test.mjs | 68 + .../apps/host/tests/local-models.test.mjs | 82 + .../apps/host/tests/locale-gaps.test.mjs | 65 + .../strata/apps/host/tests/loop-stop.test.mjs | 199 + .../apps/host/tests/markdown-images.test.mjs | 77 + .../host/tests/markdown-soft-breaks.test.mjs | 34 + engine/strata/apps/host/tests/math.test.mjs | 74 + .../strata/apps/host/tests/mcp-rows.test.mjs | 92 + .../strata/apps/host/tests/mock-model-api.mjs | 47 + .../tests/model-directory-default.test.mjs | 113 + .../apps/host/tests/model-directory.test.mjs | 96 + .../apps/host/tests/model-folder.test.mjs | 135 + .../apps/host/tests/model-picker.test.mjs | 44 + .../apps/host/tests/model-providers.test.mjs | 99 + .../strata/apps/host/tests/model-run.test.mjs | 75 + .../apps/host/tests/model-storage.test.mjs | 37 + .../tests/models-directory-fallback.test.mjs | 33 + .../apps/host/tests/models-folder.test.mjs | 223 + .../host/tests/models-list-refused.test.mjs | 31 + .../host/tests/monitor-dashboard.test.mjs | 106 + .../host/tests/monitor-host-sensors.test.mjs | 31 + .../apps/host/tests/native-autotune.test.mjs | 158 + .../apps/host/tests/native-chat.test.mjs | 12 + .../apps/host/tests/native-control.test.mjs | 45 + .../apps/host/tests/native-fb5.test.mjs | 14 + .../apps/host/tests/native-fit.test.mjs | 97 + .../apps/host/tests/native-gateway.test.mjs | 29 + .../host/tests/native-gpu-choice.test.mjs | 117 + .../apps/host/tests/native-gpu-roles.test.mjs | 95 + .../tests/native-job-diagnostics.test.mjs | 34 + .../tests/native-monitor-projection.test.mjs | 29 + .../host/tests/native-onboarding.test.mjs | 175 + .../host/tests/native-settings-file.test.mjs | 56 + .../tests/native-settings-response.test.mjs | 15 + .../apps/host/tests/native-settings.test.mjs | 23 + .../apps/host/tests/native-settled.test.mjs | 21 + .../host/tests/native-two-models.test.mjs | 72 + .../apps/host/tests/no-acquire.test.mjs | 112 + .../apps/host/tests/no-model-chat.test.mjs | 63 + .../apps/host/tests/offline-start.test.mjs | 71 + .../host/tests/onboarding-download.test.mjs | 32 + .../host/tests/onboarding-memory.test.mjs | 18 + .../host/tests/openrouter-reasoning.test.mjs | 77 + .../strata/apps/host/tests/oversize.test.mjs | 65 + .../apps/host/tests/packaged-control.test.mjs | 606 + .../apps/host/tests/parallel-default.test.mjs | 180 + .../apps/host/tests/pictures-status.test.mjs | 52 + .../apps/host/tests/plain-errors.test.mjs | 109 + .../apps/host/tests/platform-paths.test.mjs | 59 + .../apps/host/tests/powershell-utf8.test.mjs | 26 + .../apps/host/tests/python-resolver.test.mjs | 62 + .../apps/host/tests/qa1-downloads.test.mjs | 175 + .../apps/host/tests/qa1-storage.test.mjs | 61 + .../apps/host/tests/recent-chats.test.mjs | 47 + .../apps/host/tests/reliability.test.mjs | 118 + .../apps/host/tests/request-flow.test.mjs | 134 + .../apps/host/tests/resource-ram.test.mjs | 117 + .../tests/router-view-transition.test.mjs | 50 + .../apps/host/tests/run-config-check.test.mjs | 124 + .../apps/host/tests/runtime-api.test.mjs | 48 + .../apps/host/tests/runtime-models.test.mjs | 100 + .../host/tests/serving-key-optional.test.mjs | 23 + .../apps/host/tests/session-persist.test.mjs | 118 + .../host/tests/session-workspace.test.mjs | 17 + .../apps/host/tests/settings-overlay.test.mjs | 50 + .../apps/host/tests/simplification.test.mjs | 57 + .../apps/host/tests/size-label.test.mjs | 17 + .../apps/host/tests/skills-used.test.mjs | 85 + .../apps/host/tests/slash-commands.test.mjs | 70 + .../host/tests/split-qa2-dialogs.test.mjs | 23 + .../apps/host/tests/split-qa2-drop.test.mjs | 84 + .../apps/host/tests/split-qa2-fields.test.mjs | 75 + .../apps/host/tests/split-qa2-skills.test.mjs | 62 + .../host/tests/split-qa2b-export.test.mjs | 17 + .../host/tests/split-qa2c-export.test.mjs | 29 + .../host/tests/split-qa2c-linux-drop.test.mjs | 29 + .../tests/staging-scripts-syntax.test.mjs | 44 + .../apps/host/tests/stream-framing.test.mjs | 172 + .../apps/host/tests/stream-speed.test.mjs | 40 + .../strata/apps/host/tests/system-ca.test.mjs | 42 + .../apps/host/tests/system-fonts.test.mjs | 18 + .../apps/host/tests/task-handover.test.mjs | 68 + .../host/tests/tasks-and-sharing.test.mjs | 39 + .../apps/host/tests/thinking-direct.test.mjs | 21 + .../host/tests/time-skip-compare.test.mjs | 82 + .../strata/apps/host/tests/time-skip.test.mjs | 79 + .../tests/timeskip-compare-server.test.mjs | 81 + .../apps/host/tests/timeskip-fork.test.mjs | 122 + .../apps/host/tests/timeskip-real.test.mjs | 159 + .../strata/apps/host/tests/tool-rows.test.mjs | 23 + .../apps/host/tests/tools-locales.test.mjs | 42 + .../tests/tune-and-timeskip-routes.test.mjs | 200 + .../apps/host/tests/tune-locales.test.mjs | 45 + .../apps/host/tests/tune-outcome.test.mjs | 63 + .../apps/host/tests/tune-phase.test.mjs | 24 + .../apps/host/tests/typed-and-pasted.test.mjs | 24 + .../apps/host/tests/ui-fixture-host.mjs | 63 + .../strata/apps/host/tests/ui4-fixes.test.mjs | 62 + .../strata/apps/host/tests/ui5-live.test.mjs | 57 + .../strata/apps/host/tests/ui5-plan.test.mjs | 70 + .../apps/host/tests/ui6-deliverables.test.mjs | 61 + .../strata/apps/host/tests/ui6-fork.test.mjs | 52 + .../apps/host/tests/update-cache.test.mjs | 63 + .../strata/apps/host/tests/updates.test.mjs | 41 + .../strata/apps/host/tests/user-args.test.mjs | 177 + .../apps/host/tests/vision-probe.test.mjs | 66 + .../strata/apps/host/tests/web-ask.test.mjs | 273 + .../apps/host/tests/web-offline.test.mjs | 48 + .../apps/host/tests/web-search.test.mjs | 178 + .../tests/webkitgtk-view-transitions.test.mjs | 25 + .../host/tests/windows-disk-reader.test.mjs | 43 + .../apps/host/tests/windows-gpu.test.mjs | 47 + .../apps/host/tests/workspaces.test.mjs | 74 + engine/strata/apps/host/tsconfig.json | 22 + engine/strata/apps/host/vite.config.ts | 41 + engine/strata/bench.sh | 13 + engine/strata/bench/bench_vs_llama.py | 281 + engine/strata/bench/gdn_chunk_bench.cpp | 143 + .../bench/gfx906_qsa_query_swizzle_probe.cpp | 284 + .../bench/micro/cuda_callback_affinity.cpp | 67 + engine/strata/bench/micro/fusions_parity.cu | 424 + engine/strata/bench/profile_corpus.json | 47 + .../bench/prompts/standard-v1/MANIFEST.sha256 | 35 + .../bench/prompts/standard-v1/build.json | 206 + .../requests/concurrency-r1-c1.json | 23 + .../requests/concurrency-r1-c2.json | 23 + .../requests/concurrency-r1-c3.json | 23 + .../requests/concurrency-r1-c4.json | 23 + .../requests/concurrency-r2-c1.json | 23 + .../requests/concurrency-r2-c2.json | 23 + .../requests/concurrency-r2-c3.json | 23 + .../requests/concurrency-r2-c4.json | 23 + .../requests/concurrency-r3-c1.json | 23 + .../requests/concurrency-r3-c2.json | 23 + .../requests/concurrency-r3-c3.json | 23 + .../requests/concurrency-r3-c4.json | 23 + .../requests/performance-prompt-16k-r1.json | 23 + .../requests/performance-prompt-16k-r2.json | 23 + .../requests/performance-prompt-16k-r3.json | 23 + .../requests/performance-prompt-4k-r1.json | 23 + .../requests/performance-prompt-4k-r2.json | 23 + .../requests/performance-prompt-4k-r3.json | 23 + .../requests/performance-short-r1.json | 23 + .../requests/performance-short-r2.json | 23 + .../requests/performance-short-r3.json | 23 + .../standard-v1/requests/sanity-I1.json | 29 + .../standard-v1/requests/sanity-I2.json | 31 + .../standard-v1/requests/sanity-I3.json | 29 + .../standard-v1/requests/sanity-I4.json | 26 + .../standard-v1/requests/sanity-R1.json | 26 + .../standard-v1/requests/sanity-R2.json | 26 + .../standard-v1/requests/sanity-R3.json | 26 + .../standard-v1/requests/sanity-R4.json | 29 + .../standard-v1/requests/sanity-T1.json | 49 + .../standard-v1/requests/sanity-T2.json | 54 + .../standard-v1/requests/sanity-T3.json | 59 + .../standard-v1/requests/sanity-T4.json | 54 + .../prompts/standard-v1/requests/warmup.json | 23 + .../bench/qsa_prompt_attn_sm70_bench.cpp | 198 + .../benchmark.py | 6 +- .../test_gfx906_qsa_query_swizzle_guard.py | 130 + engine/strata/bin/strata | 133 + engine/strata/bin/strata.cmd | 52 + engine/strata/bin/strata.ps1 | 57 + .../strata/cmake/ggml_tq_overlay_test.cmake | 71 + engine/strata/cmake/hip_backend.cmake | 42 +- engine/strata/cmake/strata-utf8.manifest | 8 + .../strata/cmake/strata_ggml_tq_overlay.cmake | 156 + engine/strata/conftest.py | 15 + .../strata/data/dsv41/profile-2.00.bin.sha256 | 1 + .../strata/data/dsv41/profile-2.25.bin.sha256 | 1 + engine/strata/data/gguf_fingerprints.json | 562 + engine/strata/data/quant_quality/v1/agent.txt | 113 + engine/strata/data/quant_quality/v1/code.txt | 125 + engine/strata/data/quant_quality/v1/docs.txt | 49 + .../strata/data/quant_quality/v1/english.txt | 17 + .../data/quant_quality/v1/multilingual.txt | 116 + .../strata/data/quant_quality/v1/set.ids.json | 1 + engine/strata/docker-entrypoint.sh | 65 - engine/strata/docker/Dockerfile | 134 + engine/strata/docker/build.sh | 108 + engine/strata/docker/compose/.env.example | 12 + engine/strata/docker/compose/MAC.md | 9 + .../docker/compose/docker-compose.amd.yml | 38 + .../docker/compose/docker-compose.intel.yml | 35 + .../docker/compose/docker-compose.nvidia.yml | 41 + engine/strata/docker/entrypoint.sh | 302 + engine/strata/docker/fetch-engines.py | 148 + engine/strata/docker/healthcheck.sh | 18 + engine/strata/docker/publish.sh | 92 + engine/strata/docker/smoke-test.sh | 108 + engine/strata/docker/strata-wrapper.sh | 10 + engine/strata/docs/A770_SPEED_SPEC.md | 761 + engine/strata/docs/AI_REFERENCE.md | 131 + engine/strata/docs/AI_SETUP.md | 306 +- engine/strata/docs/AMD_HIP.md | 951 +- engine/strata/docs/BATCHED_DMA.md | 114 + engine/strata/docs/BATCHING.md | 564 + engine/strata/docs/BENCHMARK_PROTOCOL.md | 528 + engine/strata/docs/CLOSING.md | 78 + engine/strata/docs/COMMUNITY_BENCHMARKS.md | 125 + engine/strata/docs/DEEPSEEK41.md | 147 + engine/strata/docs/DETAILS.md | 1793 ++- .../docs/DEVELOPER_INTEGRATION_HANDOFF.md | 262 + engine/strata/docs/DISJOINT_EXPERT_CACHE.md | 59 + engine/strata/docs/DOCKER.md | 359 + engine/strata/docs/EXCHANGE_ROTATION.md | 206 + engine/strata/docs/EXPERTDEC.md | 107 + engine/strata/docs/GYRO.md | 377 + engine/strata/docs/IMAGES.md | 115 + engine/strata/docs/INSTALL.md | 267 +- engine/strata/docs/INTEL.md | 512 + engine/strata/docs/INTEL_ARC.md | 178 + engine/strata/docs/INTEL_INT8_EXPERTS.md | 89 + engine/strata/docs/KV_PREFETCH.md | 57 + engine/strata/docs/LLAMA_SWAP.md | 86 + engine/strata/docs/LOGIT_BIAS.md | 76 + engine/strata/docs/MAC.md | 320 + engine/strata/docs/MANAGEMENT_PROTOCOL.md | 59 + engine/strata/docs/MCP_SERVER.md | 23 +- engine/strata/docs/MEDIA_KIT.md | 62 + engine/strata/docs/MESSAGE_BOUNDARY_CACHE.md | 66 + engine/strata/docs/MMVQ_IL_TABLE.md | 36 + engine/strata/docs/MODELS.md | 435 +- engine/strata/docs/MULTI_GPU.md | 370 +- engine/strata/docs/NVFP4.md | 296 + engine/strata/docs/NVIDIA_V100.md | 115 + engine/strata/docs/OLDER_GPUS.md | 290 + engine/strata/docs/ORCA.md | 90 +- engine/strata/docs/ORCA_Q4_K_S.md | 2 +- engine/strata/docs/PREFILL_HEAD_ALIAS.md | 170 + engine/strata/docs/PROMPT_CACHE_TAIL.md | 33 + engine/strata/docs/QSAROWS.md | 70 + engine/strata/docs/QUANTS.md | 178 + engine/strata/docs/QWEN36.md | 252 + engine/strata/docs/RADEON_780M.md | 143 + engine/strata/docs/README.md | 76 + engine/strata/docs/RESEARCH_RUNS.md | 60 + engine/strata/docs/SAFETY.md | 204 + engine/strata/docs/SECOND_GPU.md | 185 +- engine/strata/docs/SOURCE_INSTALL.md | 179 + engine/strata/docs/STRIX_HALO.md | 237 + engine/strata/docs/TERMINAL.md | 277 + .../docs/TERMINAL_IMPLEMENTATION_STATUS.md | 53 + engine/strata/docs/TERMINAL_LAUNCH.md | 231 + engine/strata/docs/TERMINAL_QUALIFICATION.md | 82 + engine/strata/docs/TERMINAL_QUICKSTART.md | 100 + .../strata/docs/TERMINAL_TELEMETRY_FIELDS.md | 49 + engine/strata/docs/TEST_REQUESTS.md | 22 + engine/strata/docs/TROUBLESHOOTING.md | 170 +- engine/strata/docs/UNSLOTH_Q4.md | 335 +- engine/strata/docs/UNSLOTH_Q6.md | 119 + engine/strata/docs/VRAM_ELASTIC.md | 131 + .../benchmarks/2026-10-01-gfx1100-0.1.31.json | 298 + .../windows-zen2-gfx1030-workers.md | 86 + .../docs/monitoring/grafana-strata.json | 1033 ++ engine/strata/docs/monitoring/prometheus.yml | 12 + .../docs/monitoring/servicemonitor.yaml | 21 + engine/strata/docs/release-notes-0.2.0.md | 99 + engine/strata/docs/release-notes-0.2.1.md | 102 + engine/strata/docs/release-notes-0.2.2.md | 73 + engine/strata/docs/release-notes-0.2.3.1.md | 23 + engine/strata/docs/release-notes-0.2.3.md | 55 + engine/strata/docs/release-notes-0.2.4.1.md | 21 + engine/strata/docs/release-notes-0.2.4.2.md | 34 + engine/strata/docs/release-notes-0.2.4.md | 93 + .../launch-monitor-connect-hermes.txt | 39 + .../launch-monitor-connect-opencode.txt | 39 + .../launch-monitor-overview.txt | 39 + .../terminal-previews/launch-monitor-quit.txt | 27 + .../launch-overview-ascii.txt | 26 + .../terminal-previews/launch-run-progress.txt | 36 + .../docs/terminal-previews/launch-start.txt | 36 + .../terminal-previews/launch-step1-model.txt | 36 + .../terminal-previews/launch-step2-folder.txt | 36 + .../launch-step3-context.txt | 36 + .../launch-step4-pictures.txt | 36 + .../launch-step5-parallel.txt | 36 + .../terminal-previews/launch-step6-tuning.txt | 36 + .../launch-step7-advanced.txt | 36 + .../terminal-previews/launch-step8-access.txt | 37 + .../terminal-previews/launch-step9-save.txt | 36 + .../launch-twocards-start.txt | 36 + .../launch-twocards-step2-cards.txt | 36 + .../strata/docs/work/ACCEPTANCE-EVIDENCE.md | 114 + .../strata/docs/work/IMPLEMENTATION_STATUS.md | 1260 ++ .../strata/docs/work/PHASE-A-RETURN-PACKET.md | 84 + engine/strata/docs/work/QUALIFICATION-KIT.md | 359 + engine/strata/flake.lock | 27 + engine/strata/flake.nix | 49 + .../include/strata/artifact/dequant.hpp | 16 + .../include/strata/artifact/gguf_reader.hpp | 293 +- .../include/strata/artifact/model_family.hpp | 65 + .../strata/core/adapt_async_default.hpp | 121 + .../include/strata/core/arch_defaults.hpp | 56 + .../strata/include/strata/core/batch_rows.hpp | 30 + .../include/strata/core/batch_telemetry.hpp | 110 + .../strata/core/conversation_buffer.hpp | 19 +- .../strata/core/conversation_cache.hpp | 254 +- .../include/strata/core/conversation_file.hpp | 243 + .../strata/core/conversation_memory.hpp | 74 +- .../strata/core/conversation_snapshot.hpp | 63 + .../include/strata/core/coupled_draft.hpp | 20 +- engine/strata/include/strata/core/device.hpp | 8 + engine/strata/include/strata/core/dflash2.hpp | 141 + .../strata/include/strata/core/dma_batch.hpp | 125 + .../strata/include/strata/core/draft_cap.hpp | 21 + .../include/strata/core/exchange_storage.hpp | 207 + .../include/strata/core/expert_cache.hpp | 126 +- .../include/strata/core/expert_source.hpp | 727 +- .../include/strata/core/family_layout.hpp | 285 + .../include/strata/core/foresight_swap.hpp | 107 + .../strata/include/strata/core/geometry.hpp | 79 + .../strata/core/gfx12_platform_defaults.hpp | 18 + .../include/strata/core/host_graph_launch.hpp | 64 + engine/strata/include/strata/core/layer.hpp | 40 +- engine/strata/include/strata/core/layout.hpp | 55 +- .../strata/include/strata/core/logit_bias.hpp | 39 + engine/strata/include/strata/core/mtp.hpp | 128 +- .../include/strata/core/native_dense.hpp | 31 +- .../include/strata/core/native_head.hpp | 4 + .../include/strata/core/nv_defaults.hpp | 40 + .../include/strata/core/peer_experts.hpp | 108 + .../strata/include/strata/core/pin_budget.hpp | 221 + engine/strata/include/strata/core/pinned.hpp | 77 +- .../include/strata/core/pinned_ring.hpp | 182 + .../strata/include/strata/core/progress.hpp | 11 + .../include/strata/core/remote_expert_opt.hpp | 53 + .../include/strata/core/remote_experts.hpp | 95 +- engine/strata/include/strata/core/session.hpp | 3 +- .../strata/core/session_save_reclaim.hpp | 55 + .../include/strata/core/sm120_series.hpp | 43 + .../include/strata/core/sm75_series.hpp | 46 + .../strata/include/strata/core/spec_prob.hpp | 160 + engine/strata/include/strata/core/tc_sm75.hpp | 25 + .../strata/include/strata/core/uma_cache.hpp | 34 + engine/strata/include/strata/core/verify.hpp | 396 +- engine/strata/include/strata/core/vmm.hpp | 76 + engine/strata/include/strata/core/weights.hpp | 17 + engine/strata/include/strata/dsv41/exl3.hpp | 187 + .../strata/include/strata/dsv41/exl3_cpu.hpp | 69 + .../strata/include/strata/dsv41/hip_extra.h | 50 + .../strata/include/strata/dsv41/hip_or_cuda.h | 45 + .../strata/include/strata/dsv41/moe_win.hpp | 33 + .../strata/include/strata/dsv41/sampler.hpp | 94 + .../include/strata/hip_compat/cublas_v2.h | 44 + .../include/strata/hip_compat/cuda_runtime.h | 34 + .../include/strata/hip_compat/intrinsics.hpp | 35 +- .../strata/hip_compat/math_constants.h | 4 + .../include/strata/kernels/bf16_gemv.hpp | 18 + .../include/strata/kernels/cpu/expert.hpp | 28 + .../strata/kernels/cpu/expert_layout.hpp | 39 +- .../include/strata/kernels/cpu/hadamard.hpp | 51 + .../include/strata/kernels/cpu/iq_avx1.hpp | 37 + .../include/strata/kernels/cpu/iq_avx2.hpp | 35 +- .../include/strata/kernels/cpu/iq_avx512.hpp | 10 + .../include/strata/kernels/cpu/kq_avx1.hpp | 18 + .../strata/kernels/cpu/native_expert.hpp | 21 +- .../include/strata/kernels/cpu/numa_pool.hpp | 152 + .../include/strata/kernels/cpu/nvfp4_avx2.hpp | 26 + .../strata/kernels/cpu/nvfp4_avx512.hpp | 28 + .../include/strata/kernels/cpu/pool.hpp | 154 +- .../include/strata/kernels/cpu/pool_plan.hpp | 351 + .../include/strata/kernels/cpu/tq_cpu.hpp | 95 + engine/strata/include/strata/kernels/cvec.hpp | 4 + .../include/strata/kernels/dequant_bf16.hpp | 9 + .../strata/include/strata/kernels/dflash2.hpp | 98 + engine/strata/include/strata/kernels/dp4a.hpp | 27 +- .../include/strata/kernels/elementwise.hpp | 40 +- .../include/strata/kernels/fuse_decode.hpp | 16 + .../include/strata/kernels/fused_gdn.hpp | 6 + .../include/strata/kernels/fused_gr.hpp | 33 +- .../include/strata/kernels/gfx_arch.hpp | 38 + engine/strata/include/strata/kernels/gr.hpp | 10 + .../include/strata/kernels/iq_kernels.hpp | 73 +- .../strata/include/strata/kernels/kv_q4.hpp | 4 + .../strata/include/strata/kernels/kv_q8.hpp | 5 + .../include/strata/kernels/kv_stream.hpp | 29 +- .../strata/include/strata/kernels/mrope.hpp | 3 + .../include/strata/kernels/native_gr_norm.hpp | 3 + .../strata/kernels/native_gr_postops.hpp | 11 + .../include/strata/kernels/native_mmvq.hpp | 58 + .../include/strata/kernels/native_moe.hpp | 16 + .../strata/kernels/native_ple_postops.hpp | 7 + .../include/strata/kernels/native_qsa.hpp | 5 + .../strata/kernels/native_qsa_indexer.hpp | 23 + .../include/strata/kernels/native_rope.hpp | 11 + .../include/strata/kernels/native_router.hpp | 8 + .../strata/include/strata/kernels/ngram.hpp | 50 +- engine/strata/include/strata/kernels/pdl.hpp | 100 + engine/strata/include/strata/kernels/ple.hpp | 9 + .../include/strata/kernels/q8_1_finite.hpp | 33 + .../strata/kernels/qsa_decode_attn.hpp | 37 + .../strata/kernels/qsa_prompt_attn.hpp | 23 +- .../include/strata/kernels/qsa_select.hpp | 39 +- .../include/strata/kernels/quantize_act.hpp | 32 + .../strata/kernels/quantize_act_dev.cuh | 113 + .../include/strata/kernels/route_prior.hpp | 15 + .../strata/include/strata/kernels/s_gemv.hpp | 17 + .../include/strata/kernels/s_rowdev.cuh | 176 + .../strata/include/strata/kernels/sampler.hpp | 24 + .../include/strata/kernels/shared_expert.hpp | 8 +- .../strata/include/strata/kernels/swiglu.cuh | 42 + .../include/strata/kernels/verify_kernels.hpp | 108 +- .../include/strata/platform/aux_cpus.hpp | 426 + .../strata/platform/hip_compat/cublas_v2.h | 26 + .../strata/platform/hip_compat/cuda_fp16.h | 2 + .../strata/platform/hip_compat/cuda_runtime.h | 2 + .../platform/hip_compat/math_constants.h | 4 + .../strata/platform/hip_compat/strata_hip.h | 309 + .../include/strata/platform/host_limits.hpp | 58 + .../strata/include/strata/platform/memory.hpp | 62 + .../include/strata/platform/thread_name.hpp | 42 + .../include/strata/prefill/gdn_chunk.hpp | 78 + engine/strata/include/strata/prefill/gemm.hpp | 74 +- .../strata/include/strata/prefill/kernels.hpp | 70 +- .../include/strata/prefill/mmq_kq_abi.hpp | 30 + .../include/strata/prefill/moe_fused.hpp | 66 + .../include/strata/prefill/moe_fused_iq.hpp | 42 + .../strata/include/strata/prefill/moe_mmq.hpp | 100 +- .../strata/include/strata/prefill/prefill.hpp | 175 +- .../include/strata/prefill/share_rules.hpp | 62 + .../include/strata/prefill/warm_policy.hpp | 30 + .../strata/include/strata/prefill/xmx_moe.hpp | 20 + .../include/strata/program/batch_groups.hpp | 74 + .../include/strata/program/batch_read.hpp | 87 + .../include/strata/program/conv_cache.hpp | 59 + .../include/strata/program/draft_kv_plan.hpp | 44 + .../strata/program/message_boundary.hpp | 20 + .../include/strata/program/prefill_plan.hpp | 176 + .../include/strata/program/split_ring.hpp | 36 + .../include/strata/program/split_rules.hpp | 167 + .../strata/include/strata/qwen35/engine.hpp | 13 + .../include/strata/spec/draft_policy.hpp | 51 +- .../include/strata/spec/draft_source.hpp | 62 + .../strata/include/strata/spec/spec_start.hpp | 20 + .../include/strata/spec/suffix_drafter.hpp | 6 + engine/strata/integrations/harness/.gitignore | 2 + engine/strata/integrations/harness/_bridge.py | 167 + .../strata/integrations/harness/bridge_e2e.py | 313 + .../integrations/harness/bridge_tests.py | 289 + .../harness/profile/cordis.patch.yml | 66 + .../integrations/harness/profile/package.json | 13 + .../profile/scripted-worker.cordis.patch.yml | 20 + .../integrations/harness/revise_once.py | 191 + .../integrations/harness/tool_flow_e2e.py | 802 + engine/strata/metal/CMakeLists.txt | 124 + .../strata/metal/include/metal_compat/cpuid.h | 6 + .../metal/include/metal_compat/cuda_runtime.h | 143 + .../metal/include/metal_compat/immintrin.h | 5 + .../metal/include/metal_compat/linux/mman.h | 12 + .../strata/metal/include/strata/gpu/metal.hpp | 44 + .../metal/include/strata/gpu/runtime.hpp | 126 + engine/strata/metal/kernels/alu_bench.metal | 181 + engine/strata/metal/kernels/dense_mm.metal | 69 + engine/strata/metal/kernels/gdn.metal | 170 + engine/strata/metal/kernels/gdn_prompt.metal | 485 + engine/strata/metal/kernels/gemv.metal | 264 + engine/strata/metal/kernels/glue.metal | 63 + engine/strata/metal/kernels/gr.metal | 179 + engine/strata/metal/kernels/gr2.metal | 341 + engine/strata/metal/kernels/gridbar.metal | 54 + engine/strata/metal/kernels/mm_bench.metal | 85 + engine/strata/metal/kernels/mma.metal | 216 + engine/strata/metal/kernels/moe.metal | 339 + engine/strata/metal/kernels/moe_mm.metal | 1091 ++ engine/strata/metal/kernels/prompt.metal | 177 + engine/strata/metal/kernels/qsa.metal | 384 + engine/strata/metal/kernels/qsa2.metal | 289 + engine/strata/metal/kernels/qsa_prompt.metal | 348 + engine/strata/metal/kernels/quant.metal | 694 + engine/strata/metal/kernels/router.metal | 104 + engine/strata/metal/kernels/rt_bench.metal | 67 + engine/strata/metal/kernels/sample.metal | 59 + engine/strata/metal/kernels/units.metal | 321 + engine/strata/metal/kernels/wrap_probe.metal | 12 + engine/strata/metal/probe/mkfile.c | 23 + engine/strata/metal/probe/mtl_doorbell.cpp | 115 + engine/strata/metal/probe/mtl_probe.cpp | 268 + engine/strata/metal/setup_mac.py | 566 + engine/strata/metal/src/engine/arena_budget.h | 177 + engine/strata/metal/src/engine/iq_host.cpp | 98 + engine/strata/metal/src/engine/missing.cpp | 80 + engine/strata/metal/src/engine/mmvq_host.cpp | 66 + engine/strata/metal/src/engine/msl/mtp.metal | 68 + .../metal/src/engine/msl/mtp_chain.metal | 92 + engine/strata/metal/src/engine/msl/ple.metal | 91 + .../strata/metal/src/engine/prompt_chain.inc | 427 + engine/strata/metal/src/engine/setup_host.cpp | 160 + engine/strata/metal/src/engine/stream.cpp | 824 + engine/strata/metal/src/engine/stream.h | 132 + engine/strata/metal/src/engine/stubs.cpp | 368 + engine/strata/metal/src/engine/stubs_0145.cpp | 151 + engine/strata/metal/src/engine/stubs_023.cpp | 15 + engine/strata/metal/src/engine/stubs_025.cpp | 19 + engine/strata/metal/src/engine/stubs_144.cpp | 64 + engine/strata/metal/src/engine/stubs_gyro.cpp | 25 + engine/strata/metal/src/engine/window.cpp | 2750 ++++ engine/strata/metal/src/gguf_lite.cpp | 117 + engine/strata/metal/src/gguf_lite.h | 37 + engine/strata/metal/src/gpu/runtime.cpp | 640 + engine/strata/metal/src/mtl_rt.h | 134 + engine/strata/metal/src/mtl_rt.mm | 430 + engine/strata/metal/src/ref_quant.cpp | 473 + engine/strata/metal/src/ref_quant.h | 47 + engine/strata/metal/src/resource_path.h | 56 + engine/strata/metal/tests/alu_bench.cpp | 39 + .../strata/metal/tests/arena_budget_test.cpp | 135 + engine/strata/metal/tests/coop_layout.cpp | 32 + engine/strata/metal/tests/coop_probe.h | 36 + engine/strata/metal/tests/dense_mm_parity.cpp | 139 + engine/strata/metal/tests/expert_parity.cpp | 669 + engine/strata/metal/tests/fuse_parity.cpp | 160 + engine/strata/metal/tests/gdn_parity.cpp | 213 + .../strata/metal/tests/gdn_prompt_parity.cpp | 175 + engine/strata/metal/tests/gemv_parity.cpp | 333 + engine/strata/metal/tests/gr2_parity.cpp | 246 + engine/strata/metal/tests/gr_parity.cpp | 208 + engine/strata/metal/tests/gridbar_bench.cpp | 66 + engine/strata/metal/tests/gyro_parity.sh | 39 + engine/strata/metal/tests/mm_bench.cpp | 116 + engine/strata/metal/tests/mma_parity.cpp | 178 + engine/strata/metal/tests/moe_mm_parity.cpp | 241 + engine/strata/metal/tests/pair_parity.cpp | 118 + engine/strata/metal/tests/prompt_chain.cpp | 555 + engine/strata/metal/tests/prompt_parity.cpp | 222 + engine/strata/metal/tests/qsa_parity.cpp | 308 + .../strata/metal/tests/qsa_prompt_parity.cpp | 160 + engine/strata/metal/tests/ref_dump.cpp | 30 + engine/strata/metal/tests/route_parity.cpp | 90 + engine/strata/metal/tests/rt_bench.cpp | 238 + engine/strata/metal/tests/runtime_hello.cpp | 162 + engine/strata/metal/tests/sample_parity.cpp | 61 + engine/strata/metal/tests/serve_probe.py | 66 + engine/strata/metal/tests/token_chain.cpp | 661 + engine/strata/metal/tests/wrap_split_test.cpp | 95 + engine/strata/metal/tools/chat_tokens.py | 23 + engine/strata/metal/tools/check_ref.py | 34 + engine/strata/metal/tools/gen_stubs.py | 184 + engine/strata/metal/tools/gen_tq_lut.py | 50 + engine/strata/metal/tools/gguf_list.cpp | 25 + engine/strata/metal/tools/metal_repack.py | 243 + engine/strata/metal/tools/stream_experts.py | 102 + engine/strata/packaging/ENGINE-COMPONENT.md | 159 + engine/strata/packaging/README.md | 157 + engine/strata/packaging/UPDATES.md | 206 + engine/strata/packaging/acceptance_matrix.py | 514 + engine/strata/packaging/binary_deps.py | 246 + engine/strata/packaging/build_cuda_linux.sh | 67 + engine/strata/packaging/build_dsv41_cuda.sh | 37 + .../strata/packaging/build_dsv41_windows.bat | 32 + engine/strata/packaging/build_hip_gfx1103.sh | 41 + engine/strata/packaging/build_hip_linux.sh | 123 + engine/strata/packaging/build_sycl_linux.sh | 74 + engine/strata/packaging/build_vision_mac.sh | 38 + .../strata/packaging/build_vision_windows.bat | 69 + engine/strata/packaging/collect_libs.py | 183 + engine/strata/packaging/feed_tool.py | 376 + engine/strata/packaging/install.ps1 | 157 + engine/strata/packaging/install.sh | 131 + engine/strata/packaging/lock_wheels.py | 157 + .../locks/runtime-darwin-arm64-cp312.txt | 50 + .../locks/runtime-linux-x86_64-cp312.txt | 50 + .../locks/runtime-windows-x86_64-cp312.txt | 52 + engine/strata/packaging/mac/README.md | 91 + .../packaging/mac/entitlements-node.plist | 32 + .../strata/packaging/mac/sign-and-notarize.sh | 704 + engine/strata/packaging/make_local_feed.py | 109 + engine/strata/packaging/monitor_bundle.py | 396 + engine/strata/packaging/package_engine.py | 363 + engine/strata/packaging/package_terminal.py | 559 + engine/strata/packaging/smoke_terminal.py | 247 + engine/strata/packaging/stage_tuning.py | 62 + engine/strata/requirements-build.txt | 3 + engine/strata/requirements-monitor.txt | 2 + engine/strata/requirements-nvfp4-local.txt | 10 + engine/strata/requirements.txt | 8 +- engine/strata/serve/cache_drop.py | 70 + engine/strata/serve/cpu_affinity.py | 68 + engine/strata/serve/dsml.py | 256 + .../fixtures/deepseek41/chat_template.jinja | 291 + .../serve/fixtures/deepseek41/golden.json | 965 ++ engine/strata/serve/fixtures/fake_sd_cli.py | 57 + .../serve/fixtures/rcall_specimens.json | 375 + engine/strata/serve/frontend.py | 1131 +- engine/strata/serve/images.py | 468 + engine/strata/serve/keepawake.py | 94 + engine/strata/serve/launch_identity.py | 22 + engine/strata/serve/lifeline.py | 320 + engine/strata/serve/loader_diag.py | 105 + engine/strata/serve/logit_bias.py | 113 + engine/strata/serve/mcp.py | 9 +- engine/strata/serve/owner_guard.py | 70 + engine/strata/serve/prometheus.py | 160 + engine/strata/serve/ready.py | 46 + engine/strata/serve/replicas.py | 424 + engine/strata/serve/responses.py | 686 + engine/strata/serve/runconfig.py | 191 + engine/strata/serve/server.py | 6802 +++++++- engine/strata/serve/session_save_retry.py | 84 + engine/strata/serve/structured.py | 79 +- engine/strata/serve/telemetry.py | 310 +- engine/strata/serve/test_admit_order.py | 119 + engine/strata/serve/test_answer_speed.py | 39 + .../strata/serve/test_anthropic_base_url.py | 94 + engine/strata/serve/test_cache_drop.py | 39 + engine/strata/serve/test_chunked_body.py | 154 + engine/strata/serve/test_context_overflow.py | 134 + engine/strata/serve/test_control_cancel.py | 50 + engine/strata/serve/test_detok.py | 30 + engine/strata/serve/test_draft_layer.py | 51 + engine/strata/serve/test_dsv41.py | 765 + engine/strata/serve/test_effort_paths.py | 194 + engine/strata/serve/test_env_to_user.py | 66 + engine/strata/serve/test_exif_orientation.py | 47 + engine/strata/serve/test_family_name.py | 31 + engine/strata/serve/test_fatal_recovery.py | 116 + engine/strata/serve/test_frontend.py | 342 + engine/strata/serve/test_gpu_roles_server.py | 63 + engine/strata/serve/test_images.py | 342 + engine/strata/serve/test_keepawake.py | 102 + engine/strata/serve/test_lifecycle.py | 36 + engine/strata/serve/test_lifeline.py | 168 + engine/strata/serve/test_logit_bias.py | 143 + engine/strata/serve/test_mcp.py | 5 +- .../strata/serve/test_model_card_sampling.py | 108 + engine/strata/serve/test_monitor.py | 67 + .../strata/serve/test_native_tool_parser.py | 150 + engine/strata/serve/test_parallel.py | 812 + engine/strata/serve/test_parallel_yield.py | 384 + engine/strata/serve/test_parser_call_scan.py | 61 + engine/strata/serve/test_parser_hold.py | 60 + engine/strata/serve/test_parser_track.py | 126 + engine/strata/serve/test_pool_cores.py | 41 + engine/strata/serve/test_prometheus.py | 181 + engine/strata/serve/test_prompt_encoder.py | 163 + engine/strata/serve/test_q36_config.py | 48 + engine/strata/serve/test_queue_keepalive.py | 77 + engine/strata/serve/test_quiet_cancel.py | 226 + engine/strata/serve/test_ready_timeout.py | 143 + .../serve/test_reasoning_loop_recovery.py | 225 + engine/strata/serve/test_reasoning_rescue.py | 287 + engine/strata/serve/test_reasoning_tools.py | 189 + engine/strata/serve/test_replicas.py | 313 + .../strata/serve/test_request_accounting.py | 225 + engine/strata/serve/test_request_hardening.py | 176 + engine/strata/serve/test_responses.py | 781 + engine/strata/serve/test_restart_waiters.py | 213 + engine/strata/serve/test_runconfig.py | 165 + engine/strata/serve/test_security.py | 367 + engine/strata/serve/test_server.py | 4409 +++++- .../strata/serve/test_session_save_retry.py | 192 + engine/strata/serve/test_slot_alloc.py | 108 + engine/strata/serve/test_slots.py | 449 + engine/strata/serve/test_structured.py | 49 +- .../strata/serve/test_tool_call_envelope.py | 130 + .../strata/serve/test_tool_call_unclosed.py | 94 + engine/strata/serve/test_tool_name_space.py | 46 + engine/strata/serve/test_vision_busy.py | 52 + engine/strata/serve/test_vision_elastic.py | 123 + .../strata/serve/test_vision_start_error.py | 78 + .../strata/serve/test_vision_token_limit.py | 71 + engine/strata/serve/test_vision_tool_image.py | 75 + engine/strata/serve/test_vision_workdir.py | 46 + engine/strata/serve/test_vram.py | 136 + engine/strata/serve/test_web_api_key.py | 99 + engine/strata/serve/test_web_sampling.py | 77 + engine/strata/serve/test_winjob.py | 15 + engine/strata/serve/web/app.css | 39 +- engine/strata/serve/web/app.js | 203 +- engine/strata/serve/web/favicon.svg | 9 + engine/strata/serve/web/index.html | 48 +- engine/strata/serve/web/monitor.html | 1 + engine/strata/serve/winjob.py | 34 +- engine/strata/setup.py | 7686 ++++++++- engine/strata/setup.sh | 51 +- .../strata/src/artifact/gguf_reader_test.cpp | 40 +- .../src/core/adapt_async_default_test.cpp | 135 + engine/strata/src/core/arch_defaults.cpp | 153 + engine/strata/src/core/arch_defaults_test.cpp | 211 + .../strata/src/core/batch_telemetry_test.cpp | 50 + .../src/core/conversation_cache_test.cpp | 349 + engine/strata/src/core/conversation_copy.hpp | 121 + engine/strata/src/core/conversation_file.cpp | 1256 ++ .../src/core/conversation_file_test.cpp | 775 + .../strata/src/core/conversation_memory.cpp | 265 +- .../src/core/conversation_memory_test.cpp | 12 +- .../strata/src/core/conversation_snapshot.cpp | 120 +- .../src/core/conversation_snapshot_test.cpp | 126 + .../core/conversation_split_failure_test.cpp | 62 + engine/strata/src/core/conversation_state.cpp | 202 +- .../src/core/conversation_validation_test.cpp | 10 + engine/strata/src/core/device.cu | 141 +- engine/strata/src/core/dflash2.cpp | 559 + engine/strata/src/core/dflash2_attn_bench.cpp | 60 + engine/strata/src/core/dflash2_bw_bench.cu | 41 + engine/strata/src/core/dflash2_gemm_bench.cpp | 62 + .../strata/src/core/dflash2_launch_bench.cu | 68 + engine/strata/src/core/dflash2_parity.cpp | 95 + .../strata/src/core/dflash2_small_bench.cpp | 82 + engine/strata/src/core/draft_cap_test.cpp | 21 + engine/strata/src/core/expert_cache.cpp | 445 +- engine/strata/src/core/expert_source.cpp | 4339 ++++- engine/strata/src/core/layer.cpp | 393 +- engine/strata/src/core/logit_bias_test.cpp | 21 + engine/strata/src/core/mtp.cpp | 1324 +- engine/strata/src/core/native_dense.cpp | 374 +- engine/strata/src/core/native_head.cpp | 26 +- engine/strata/src/core/nv_defaults.cpp | 94 + engine/strata/src/core/peer_experts.cpp | 391 + engine/strata/src/core/pin_budget_test.cpp | 77 + engine/strata/src/core/pinned.cu | 469 +- engine/strata/src/core/remote_expert_opt.cu | 201 + engine/strata/src/core/remote_experts.cpp | 211 +- engine/strata/src/core/session.cpp | 48 +- .../src/core/session_save_reclaim_test.cpp | 115 + engine/strata/src/core/spec_prob_test.cpp | 368 + engine/strata/src/core/uma_cache_test.cpp | 32 + engine/strata/src/core/verify.cpp | 3660 ++++- engine/strata/src/core/vmm.cpp | 317 + engine/strata/src/core/weights.cpp | 125 +- engine/strata/src/dsv41/ds4_attn_split.cuh | 206 + engine/strata/src/dsv41/ds4_engram_io.hpp | 275 + engine/strata/src/dsv41/ds4_experts_rule.hpp | 62 + engine/strata/src/dsv41/ds4_gg_cpu.cpp | 296 + engine/strata/src/dsv41/ds4_gguf.cu | 1528 ++ engine/strata/src/dsv41/ds4_gguf.cuh | 81 + engine/strata/src/dsv41/ds4_gguf_cpu.cpp | 418 + engine/strata/src/dsv41/ds4_gguf_cpu.hpp | 101 + engine/strata/src/dsv41/ds4_iq.cu | 1514 ++ engine/strata/src/dsv41/ds4_iq.cuh | 137 + engine/strata/src/dsv41/ds4_iq1m_codes.inc | 515 + engine/strata/src/dsv41/ds4_iq_cpu.cpp | 782 + engine/strata/src/dsv41/ds4_iq_hip.inc | 326 + engine/strata/src/dsv41/ds4_iq_hip_r.inc | 210 + engine/strata/src/dsv41/ds4_iq_hip_s.inc | 162 + engine/strata/src/dsv41/ds4_kernels.cu | 2232 +++ engine/strata/src/dsv41/ds4_kernels.cuh | 311 + engine/strata/src/dsv41/ds4_main.cpp | 1516 ++ engine/strata/src/dsv41/ds4_model.cu | 9418 +++++++++++ engine/strata/src/dsv41/ds4_model.hpp | 199 + engine/strata/src/dsv41/ds4_mx_kern.inc | 251 + engine/strata/src/dsv41/ds4_numerics.cuh | 65 + engine/strata/src/dsv41/ds4_os.hpp | 561 + engine/strata/src/dsv41/ds4_packinfo.cpp | 273 + engine/strata/src/dsv41/ds4_packinfo.hpp | 13 + engine/strata/src/dsv41/ds4_pick_rule.hpp | 29 + engine/strata/src/dsv41/ds4_pool.hpp | 237 + engine/strata/src/dsv41/ds4_q6k.cuh | 30 + engine/strata/src/dsv41/ds4_slotmeta.hpp | 98 + engine/strata/src/dsv41/ds4_store.hpp | 545 + engine/strata/src/dsv41/ds4_tq.cu | 539 + engine/strata/src/dsv41/ds4_tq_cpu.cpp | 136 + engine/strata/src/dsv41/ds4_tqw.cuh | 138 + engine/strata/src/dsv41/ds4_vision.cu | 519 + engine/strata/src/dsv41/ds4_vision.cuh | 79 + engine/strata/src/dsv41/vendor/exl3.cu | 1745 ++ engine/strata/src/dsv41/vendor/exl3_cpu.cpp | 1281 ++ engine/strata/src/dsv41/vendor/exl3_legacy.cu | 967 ++ engine/strata/src/dsv41/vendor/moe_win.cu | 57 + engine/strata/src/dsv41/vendor/sampler.cu | 581 + engine/strata/src/kernels/b6_mmvq_bench.cpp | 218 + .../strata/src/kernels/batch_rows_parity.cpp | 274 + engine/strata/src/kernels/cpu/expert.cpp | 60 +- .../strata/src/kernels/cpu/expert_layout.cpp | 308 +- .../src/kernels/cpu/expert_multi_test.cpp | 33 +- engine/strata/src/kernels/cpu/hadamard.cpp | 110 + .../src/kernels/cpu/iq512_gather_parity.cpp | 76 + engine/strata/src/kernels/cpu/iq_avx1.cpp | 511 + .../strata/src/kernels/cpu/iq_avx1_parity.cpp | 291 + engine/strata/src/kernels/cpu/iq_avx2.cpp | 656 +- .../strata/src/kernels/cpu/iq_avx2_parity.cpp | 577 + .../strata/src/kernels/cpu/iq_avx2_rows.inl | 659 + engine/strata/src/kernels/cpu/iq_avx512.cpp | 359 +- engine/strata/src/kernels/cpu/kq_avx1.cpp | 71 + engine/strata/src/kernels/cpu/kq_avx2.cpp | 86 +- .../strata/src/kernels/cpu/kq_cpu_bench.cpp | 174 + .../strata/src/kernels/cpu/native_expert.cpp | 385 +- .../src/kernels/cpu/native_hadamard_test.cpp | 311 + .../strata/src/kernels/cpu/numa_pool_test.cpp | 146 + engine/strata/src/kernels/cpu/nvfp4_avx2.cpp | 199 + .../strata/src/kernels/cpu/nvfp4_avx512.cpp | 200 + .../src/kernels/cpu/nvfp4_avx512_parity.cpp | 357 + engine/strata/src/kernels/cpu/pool.cpp | 900 +- .../src/kernels/cpu/pool_affinity_linux.hpp | 87 + .../kernels/cpu/pool_affinity_linux_test.cpp | 290 + .../src/kernels/cpu/pool_affinity_test.cpp | 173 + .../src/kernels/cpu/pool_affinity_win.hpp | 64 + .../src/kernels/cpu/pool_cores_test.cpp | 123 + .../strata/src/kernels/cpu/pool_plan_test.cpp | 279 + .../src/kernels/cpu/pool_tasks_test.cpp | 373 + engine/strata/src/kernels/cpu/q2_avx1.cpp | 294 + engine/strata/src/kernels/cpu/q2_avx2.cpp | 205 +- .../strata/src/kernels/cpu/q2_avx2_rows.inl | 67 + .../src/kernels/cpu/q2_bitplane_parity.cpp | 102 + .../src/kernels/cpu/q8k_quant_parity.cpp | 148 + .../src/kernels/cpu/router_dot_parity.cpp | 70 + engine/strata/src/kernels/cpu/tq_avx2.cpp | 89 + engine/strata/src/kernels/cpu/tq_avx512.cpp | 97 + engine/strata/src/kernels/cpu/tq_computed.hpp | 33 + engine/strata/src/kernels/cpu/tq_cpu.cpp | 234 + .../strata/src/kernels/cpu/tq_cpu_parity.cpp | 565 + engine/strata/src/kernels/cpu/tq_states.hpp | 88 + engine/strata/src/kernels/cuda/bf16_gemv.cu | 48 + engine/strata/src/kernels/cuda/cvec.cu | 8 + .../strata/src/kernels/cuda/dequant_bf16.cu | 205 +- engine/strata/src/kernels/cuda/dflash2.cu | 794 + engine/strata/src/kernels/cuda/elementwise.cu | 140 +- engine/strata/src/kernels/cuda/fused_gdn.cu | 44 +- engine/strata/src/kernels/cuda/fused_gr.cu | 2203 ++- engine/strata/src/kernels/cuda/gr.cu | 156 +- engine/strata/src/kernels/cuda/iq_kernels.cu | 4481 +++++- engine/strata/src/kernels/cuda/kv_q4.cu | 32 +- engine/strata/src/kernels/cuda/kv_q8.cu | 108 +- engine/strata/src/kernels/cuda/kv_stream.cu | 24 +- engine/strata/src/kernels/cuda/native_bf16.cu | 239 +- engine/strata/src/kernels/cuda/native_gdn.cu | 2 + .../strata/src/kernels/cuda/native_gr_norm.cu | 17 +- .../src/kernels/cuda/native_gr_postops.cu | 52 +- engine/strata/src/kernels/cuda/native_mmvq.cu | 1839 ++- engine/strata/src/kernels/cuda/native_moe.cu | 159 +- .../src/kernels/cuda/native_ple_postops.cu | 70 + engine/strata/src/kernels/cuda/native_qsa.cu | 40 + .../src/kernels/cuda/native_qsa_indexer.cu | 201 +- .../src/kernels/cuda/native_qsa_score.cu | 3 + engine/strata/src/kernels/cuda/native_rope.cu | 104 +- .../strata/src/kernels/cuda/native_router.cu | 204 +- engine/strata/src/kernels/cuda/ple.cu | 26 +- engine/strata/src/kernels/cuda/q8_1_il.cuh | 99 + engine/strata/src/kernels/cuda/q8_sm60.cuh | 148 + .../src/kernels/cuda/qsa_decode_attn.cu | 1077 +- .../src/kernels/cuda/qsa_prompt_attn.cu | 1664 +- .../kernels/cuda/qsa_scores_gfx1100_test.cu | 32 + engine/strata/src/kernels/cuda/qsa_select.cu | 1897 ++- .../strata/src/kernels/cuda/quantize_act.cu | 319 +- engine/strata/src/kernels/cuda/route_prior.cu | 79 + .../strata/src/kernels/cuda/router_top10.cu | 96 + engine/strata/src/kernels/cuda/s26_tsum.cuh | 71 + .../src/kernels/cuda/s2_expert_grouped.cu | 124 +- engine/strata/src/kernels/cuda/s_gemv_pair.cu | 136 + engine/strata/src/kernels/cuda/sampler.cu | 504 +- .../strata/src/kernels/cuda/shared_expert.cu | 243 +- engine/strata/src/kernels/cuda/tq_lut_i8.cuh | 137 + .../strata/src/kernels/cuda/verify_kernels.cu | 1326 +- .../src/kernels/decode_cluster_parity.cpp | 424 + .../strata/src/kernels/dequant_bf16_test.cpp | 1 + .../src/kernels/dequant_wide_parity.cpp | 145 + engine/strata/src/kernels/expdec_bench.cpp | 480 + engine/strata/src/kernels/fused_gr_bench.cpp | 272 + .../strata/src/kernels/gdn_chunk_parity.cpp | 281 + engine/strata/src/kernels/gdn_parity.cpp | 194 + engine/strata/src/kernels/gr_multi_parity.cpp | 143 + engine/strata/src/kernels/gr_parity.cpp | 55 + .../strata/src/kernels/hc_persist_parity.cpp | 151 + engine/strata/src/kernels/iq_multi_parity.cpp | 95 +- .../strata/src/kernels/kv_hybrid_parity.cpp | 14 +- engine/strata/src/kernels/kv_q8_parity.cpp | 51 +- engine/strata/src/kernels/kv_steps_parity.cpp | 135 + .../strata/src/kernels/kv_stream_parity.cpp | 24 +- .../strata/src/kernels/kv_window_parity.cpp | 331 + .../strata/src/kernels/mmvf_rows_parity.cpp | 76 + engine/strata/src/kernels/mmvq_il_parity.cpp | 311 + .../strata/src/kernels/mmvq_multi_parity.cpp | 12 + .../src/kernels/native_expert_bench.cpp | 177 + .../src/kernels/native_expert_parity.cpp | 316 +- .../src/kernels/native_grouped_parity.cpp | 369 + .../src/kernels/native_multi_parity.cpp | 191 + engine/strata/src/kernels/ngram.cpp | 329 +- .../strata/src/kernels/nvfp4_decode_bench.cpp | 156 + .../src/kernels/nvfp4_expert_gpu_parity.cpp | 107 + engine/strata/src/kernels/pdl_parity.cpp | 306 + engine/strata/src/kernels/pf_wmma_parity.cpp | 160 + engine/strata/src/kernels/ple_fp8_parity.cpp | 3 +- engine/strata/src/kernels/ple_parity.cpp | 6 + engine/strata/src/kernels/ple_q5_parity.cpp | 75 +- engine/strata/src/kernels/q8_gemv_bench.cpp | 109 + .../src/kernels/qsa_merge_daily_parity.cpp | 418 + engine/strata/src/kernels/qsa_parity.cpp | 81 + .../src/kernels/qsa_prompt_attn_parity.cpp | 176 +- engine/strata/src/kernels/qsa_rows_bench.cpp | 353 + .../src/kernels/qsa_scores_gfx1100_parity.cpp | 185 + .../strata/src/kernels/qsa_scores_parity.cpp | 120 + .../strata/src/kernels/qsa_select_bench.cpp | 49 +- .../strata/src/kernels/qsa_slots_parity.cpp | 225 + .../src/kernels/qsa_topk_active_parity.cpp | 97 + engine/strata/src/kernels/qsa_topk_parity.cpp | 139 + .../src/kernels/resident_plan_parity.cpp | 151 + engine/strata/src/kernels/rope_parity.cpp | 78 + .../src/kernels/route_resident_parity.cu | 255 + .../src/kernels/route_window_parity.cpp | 75 + .../strata/src/kernels/router_chain_bench.cpp | 175 + engine/strata/src/kernels/sampler_parity.cpp | 151 +- .../strata/src/kernels/spec_verify_parity.cpp | 247 + engine/strata/src/kernels/tq_pascal_bench.cpp | 306 + .../src/kernels/verify_batch_parity.cpp | 173 + engine/strata/src/kernels/verify_parity.cpp | 127 + engine/strata/src/ngram/ple_reader.cpp | 3 +- engine/strata/src/ngram/ple_reader_test.cpp | 385 +- engine/strata/src/platform/direct_file.cpp | 10 +- engine/strata/src/platform/memory.cpp | 122 + engine/strata/src/platform/memory_test.cpp | 91 +- engine/strata/src/prefill/gdn_chunk.cu | 636 + engine/strata/src/prefill/gdn_rec_parity.cu | 1383 ++ engine/strata/src/prefill/gemm.cu | 951 +- engine/strata/src/prefill/gemm_bf16_parity.cu | 155 + engine/strata/src/prefill/gemm_f32_parity.cu | 129 + engine/strata/src/prefill/ggml_cuda_host.cu | 27 +- engine/strata/src/prefill/gr_upmix_parity.cu | 237 + .../strata/src/prefill/hipblaslt_tuning.hpp | 14 +- engine/strata/src/prefill/kernels.cu | 2190 ++- .../strata/src/prefill/mmq_expert_bench.cpp | 128 + engine/strata/src/prefill/mmq_kq_lib.cu | 60 + engine/strata/src/prefill/mmq_kq_loader.cpp | 124 + .../strata/src/prefill/mmq_nvfp4_parity.cpp | 350 + engine/strata/src/prefill/mmq_nvfp4_w4a4.cu | 53 + engine/strata/src/prefill/mmq_nvfp4_w4a8.cu | 24 + .../strata/src/prefill/mmq_resident_sort.hpp | 81 + .../strata/src/prefill/mmq_tab_instance.cu.in | 8 + engine/strata/src/prefill/moe_f16_common.cuh | 250 + engine/strata/src/prefill/moe_f16_kq.cu | 334 + engine/strata/src/prefill/moe_f16_kq.hpp | 30 + engine/strata/src/prefill/moe_fused.cu | 751 + engine/strata/src/prefill/moe_fused_iq.cu | 1544 ++ engine/strata/src/prefill/moe_mmq.cu | 488 +- engine/strata/src/prefill/moe_mmq_tab.cuh | 552 + engine/strata/src/prefill/moe_mmq_tab.hpp | 30 + engine/strata/src/prefill/prefill.cpp | 4031 ++++- engine/strata/src/prefill/rocblas_tuning.hpp | 129 + .../strata/src/prefill/warm_policy_test.cpp | 31 + engine/strata/src/prefill/wmma_gemm.cu | 742 + engine/strata/src/prefill/wmma_gemm.h | 55 + .../strata/src/program/batch_groups_test.cpp | 131 + engine/strata/src/program/conv_cache_test.cpp | 70 + .../strata/src/program/draft_kv_plan_test.cpp | 62 + engine/strata/src/program/generate.cpp | 11654 +++++++++++++- .../src/program/message_boundary_test.cpp | 33 + engine/strata/src/program/split_ring_test.cpp | 84 + engine/strata/src/qwen35/q36_engine.cu | 3979 +++++ engine/strata/src/qwen35/q36_kernels.cuh | 399 + engine/strata/src/qwen35/q36_main.cpp | 5 + engine/strata/src/qwen35/q36ref.cu | 832 + engine/strata/src/spec/draft_policy.cpp | 194 +- engine/strata/src/spec/draft_policy_test.cpp | 56 + engine/strata/src/spec/draft_source.cpp | 36 + engine/strata/src/spec/spec_start_test.cpp | 22 + engine/strata/src/spec/suffix_drafter.cpp | 10 + .../strata/src/spec/suffix_drafter_test.cpp | 65 + engine/strata/strata.py | 43 + engine/strata/strata_cli/__init__.py | 29 + engine/strata/strata_cli/bench.py | 1308 ++ engine/strata/strata_cli/bench_facts.py | 519 + engine/strata/strata_cli/bench_standard.py | 1265 ++ engine/strata/strata_cli/cli.py | 2248 +++ engine/strata/strata_cli/client.py | 531 + engine/strata/strata_cli/connections.py | 303 + engine/strata/strata_cli/consoleinfo.py | 184 + engine/strata/strata_cli/dashboard.py | 915 ++ engine/strata/strata_cli/detail_dashboard.py | 592 + engine/strata/strata_cli/drafting_cmd.py | 99 + engine/strata/strata_cli/handover.py | 187 + engine/strata/strata_cli/launch/__init__.py | 1 + engine/strata/strata_cli/launch/access.py | 457 + engine/strata/strata_cli/launch/adopt.py | 126 + engine/strata/strata_cli/launch/app.py | 475 + engine/strata/strata_cli/launch/catalog.py | 518 + engine/strata/strata_cli/launch/check.py | 155 + engine/strata/strata_cli/launch/cmd.py | 983 ++ engine/strata/strata_cli/launch/harness.py | 324 + engine/strata/strata_cli/launch/library.py | 67 + engine/strata/strata_cli/launch/modelstate.py | 193 + .../strata/strata_cli/launch/monitor_ext.py | 339 + engine/strata/strata_cli/launch/params.py | 265 + engine/strata/strata_cli/launch/runner.py | 2365 +++ engine/strata/strata_cli/launch/screens.py | 1776 +++ engine/strata/strata_cli/launch/settings.py | 338 + engine/strata/strata_cli/launch/store.py | 150 + engine/strata/strata_cli/launch/widgets.py | 231 + engine/strata/strata_cli/logs.py | 151 + engine/strata/strata_cli/monitor.py | 560 + engine/strata/strata_cli/monitor_commands.py | 248 + engine/strata/strata_cli/nav.py | 90 + engine/strata/strata_cli/overview.py | 446 + engine/strata/strata_cli/render.py | 744 + engine/strata/strata_cli/tune_commands.py | 447 + engine/strata/strata_cli/update_cmd.py | 273 + engine/strata/strata_control/__init__.py | 1 + engine/strata/strata_control/acquisition.py | 84 + engine/strata/strata_control/atomic.py | 42 + engine/strata/strata_control/autotune.py | 955 ++ engine/strata/strata_control/benchmarking.py | 414 + engine/strata/strata_control/calibration.py | 749 + .../strata/strata_control/calibration_jobs.py | 404 + engine/strata/strata_control/components.py | 688 + engine/strata/strata_control/discovery.py | 415 + engine/strata/strata_control/doctor.py | 273 + engine/strata/strata_control/draft_layer.py | 56 + engine/strata/strata_control/drafting.py | 290 + .../strata/strata_control/drafting_fetch.py | 102 + engine/strata/strata_control/dsv41_engine.py | 266 + engine/strata/strata_control/dsv41_fit.py | 389 + engine/strata/strata_control/dsv41_sets.py | 71 + .../strata/strata_control/engine_component.py | 1005 ++ engine/strata/strata_control/feed.py | 458 + engine/strata/strata_control/folders.py | 104 + .../strata/strata_control/gguf_preflight.py | 194 + engine/strata/strata_control/gpu_fit.py | 258 + engine/strata/strata_control/gpu_roles.py | 473 + .../strata/strata_control/hipblaslt_tuning.py | 253 + engine/strata/strata_control/journal.py | 440 + engine/strata/strata_control/longpath.py | 118 + engine/strata/strata_control/loopback.py | 28 + engine/strata/strata_control/mac_fit.py | 206 + engine/strata/strata_control/management.py | 615 + engine/strata/strata_control/models.py | 864 + engine/strata/strata_control/models_move.py | 573 + engine/strata/strata_control/offline.py | 191 + .../strata/strata_control/owner_transport.py | 182 + engine/strata/strata_control/paths.py | 21 + engine/strata/strata_control/posix_owner.py | 100 + engine/strata/strata_control/preset_marks.py | 107 + engine/strata/strata_control/presets.py | 526 + engine/strata/strata_control/private_files.py | 576 + engine/strata/strata_control/procs.py | 396 + engine/strata/strata_control/profiles.py | 388 + .../strata/strata_control/progress_words.py | 121 + engine/strata/strata_control/readiness.py | 143 + engine/strata/strata_control/recipes.py | 439 + engine/strata/strata_control/runtime.py | 1390 ++ engine/strata/strata_control/signing.py | 330 + engine/strata/strata_control/targets.py | 53 + engine/strata/strata_control/time_skip.py | 731 + engine/strata/strata_control/tls.py | 88 + engine/strata/strata_control/transfer.py | 308 + engine/strata/strata_control/tune_api.py | 294 + engine/strata/strata_control/tune_apply.py | 401 + engine/strata/strata_control/tune_engine.py | 612 + engine/strata/strata_control/tune_history.py | 247 + engine/strata/strata_control/tune_knobs.py | 507 + engine/strata/strata_control/tune_machine.py | 313 + engine/strata/strata_control/tune_session.py | 522 + engine/strata/strata_control/tuning.py | 811 + engine/strata/strata_control/update_keys.json | 11 + engine/strata/strata_control/updater.py | 1415 ++ engine/strata/strata_control/user_args.py | 134 + engine/strata/strata_control/vision_reader.py | 160 + engine/strata/strata_control/vram_fit.py | 160 + engine/strata/strata_control/winproc.py | 143 + engine/strata/sycl/.gitignore | 4 + engine/strata/sycl/CMakeLists.txt | 440 + engine/strata/sycl/include/dpct/LICENSE.TXT | 236 + engine/strata/sycl/include/dpct/atomic.hpp | 868 + .../sycl/include/dpct/bindless_images.hpp | 2061 +++ .../sycl/include/dpct/blas_gemm_utils.hpp | 896 ++ .../strata/sycl/include/dpct/blas_utils.hpp | 2599 +++ engine/strata/sycl/include/dpct/ccl_utils.hpp | 266 + .../sycl/include/dpct/codepin/codepin.hpp | 383 + .../dpct/codepin/serialization/basic.hpp | 501 + .../sycl/include/dpct/compat_service.hpp | 122 + .../dpct/detail/blas_gemm_utils_detail.hpp | 426 + .../include/dpct/detail/blas_utils_detail.hpp | 649 + .../include/dpct/detail/ccl_utils_detail.hpp | 37 + .../include/dpct/detail/dnnl_utils_detail.hpp | 98 + .../dpct/detail/group_utils_detail.hpp | 236 + .../dpct/detail/lapack_utils_detail.hpp | 625 + .../dpct/detail/lib_common_utils_detail.hpp | 149 + .../sycl/include/dpct/detail/math_detail.hpp | 262 + .../include/dpct/detail/memory_detail.hpp | 986 ++ .../include/dpct/detail/rng_utils_detail.hpp | 382 + .../dpct/detail/sparse_utils_detail.hpp | 585 + engine/strata/sycl/include/dpct/device.hpp | 1010 ++ .../strata/sycl/include/dpct/dnnl_utils.hpp | 4854 ++++++ engine/strata/sycl/include/dpct/dpct.hpp | 104 + .../sycl/include/dpct/dpl_extras/algorithm.h | 2562 +++ .../dpct/dpl_extras/dpcpp_extensions.h | 422 + .../sycl/include/dpct/dpl_extras/functional.h | 486 + .../dpct/dpl_extras/iterator_adaptor.h | 54 + .../sycl/include/dpct/dpl_extras/iterators.h | 347 + .../sycl/include/dpct/dpl_extras/memory.h | 976 ++ .../sycl/include/dpct/dpl_extras/numeric.h | 32 + .../sycl/include/dpct/dpl_extras/vector.h | 990 ++ engine/strata/sycl/include/dpct/dpl_utils.hpp | 33 + engine/strata/sycl/include/dpct/fft_utils.hpp | 1249 ++ engine/strata/sycl/include/dpct/graph.hpp | 195 + .../strata/sycl/include/dpct/group_utils.hpp | 1566 ++ engine/strata/sycl/include/dpct/image.hpp | 1075 ++ engine/strata/sycl/include/dpct/kernel.hpp | 632 + .../strata/sycl/include/dpct/lapack_utils.hpp | 1286 ++ .../sycl/include/dpct/lib_common_utils.hpp | 121 + engine/strata/sycl/include/dpct/math.hpp | 2807 ++++ engine/strata/sycl/include/dpct/memory.hpp | 872 + engine/strata/sycl/include/dpct/rng_utils.hpp | 276 + .../strata/sycl/include/dpct/shmem_utils.hpp | 56 + .../strata/sycl/include/dpct/sparse_utils.hpp | 1838 +++ engine/strata/sycl/include/dpct/util.hpp | 1358 ++ engine/strata/sycl/include/dpct/ze_utils.hpp | 85 + .../strata/sycl/include/strata/copy_queue.hpp | 27 + .../include/strata/core/coupled_draft.hpp | 93 + .../sycl/include/strata/core/dma_batch.hpp | 182 + .../include/strata/core/exchange_storage.hpp | 115 + .../include/strata/core/expert_source.hpp | 779 + .../strata/core/gguf_expert_source.hpp | 81 + .../strata/sycl/include/strata/core/graph.hpp | 118 + .../strata/sycl/include/strata/core/mtp.hpp | 294 + .../sycl/include/strata/core/on_device.hpp | 38 + .../sycl/include/strata/core/peer_experts.hpp | 108 + .../include/strata/core/remote_experts.hpp | 88 + .../sycl/include/strata/core/session.hpp | 442 + .../sycl/include/strata/core/verify.hpp | 478 + .../sycl/include/strata/kernels/bf16_bits.hpp | 64 + .../sycl/include/strata/kernels/dp4a.hpp | 55 + .../sycl/include/strata/kernels/f16_bits.hpp | 107 + .../strata/kernels/iq_dequant_expert.hpp | 11 + .../sycl/include/strata/kernels/mrope.hpp | 83 + .../include/strata/kernels/native_mmvq.hpp | 152 + .../include/strata/kernels/native_router.hpp | 21 + .../include/strata/kernels/q8_1_finite.hpp | 41 + .../strata/kernels/qsa_prompt_attn_xmx.hpp | 11 + .../strata/kernels/resident_plan_mirror.hpp | 15 + .../sycl/include/strata/kernels/rope.hpp | 67 + .../include/strata/kernels/rope_scaling.hpp | 196 + .../sycl/include/strata/kernels/sampler.hpp | 87 + .../include/strata/kernels/tq_lut_i8_sycl.hpp | 10 + .../sycl/include/strata/kernels/xmx_gemm.hpp | 11 + .../sycl/include/strata/prefill/esimd_moe.hpp | 82 + .../sycl/include/strata/prefill/gdn_xe.hpp | 104 + .../sycl/include/strata/sycl_doorbell.hpp | 154 + .../strata/sycl/include/strata/sycl_math.hpp | 27 + .../strata/sycl/include/strata/sycl_queue.hpp | 290 + engine/strata/sycl/probe/alias_scan.cpp | 38 + engine/strata/sycl/probe/arena_rw.cpp | 63 + engine/strata/sycl/probe/doorbell_store.cpp | 43 + engine/strata/sycl/probe/fp64_cost.cpp | 105 + engine/strata/sycl/probe/gemm_launch.cpp | 60 + engine/strata/sycl/probe/gemm_vary.cpp | 47 + engine/strata/sycl/probe/launch_cost.cpp | 45 + engine/strata/sycl/probe/payload_pairs.cpp | 61 + engine/strata/sycl/probe/router_fast.cpp | 71 + engine/strata/sycl/serve/server_intel.py | 333 + engine/strata/sycl/serve/strata-sycl.sh | 48 + engine/strata/sycl/serve/web/switcher.css | 7 + engine/strata/sycl/serve/web/switcher.js | 60 + engine/strata/sycl/serve/xe_telemetry.py | 117 + engine/strata/sycl/setup_intel.py | 562 + .../strata/sycl/src/core/concurrent_main.cpp | 272 + .../sycl/src/core/conversation_snapshot.cpp | 324 + .../src/core/conversation_snapshot_test.cpp | 432 + .../sycl/src/core/conversation_state.cpp | 395 + engine/strata/sycl/src/core/copy_queue.cpp | 142 + engine/strata/sycl/src/core/device.dp.cpp | 485 + engine/strata/sycl/src/core/expert_cache.cpp | 1059 ++ engine/strata/sycl/src/core/expert_source.cpp | 3647 +++++ .../sycl/src/core/gguf_expert_source.cpp | 239 + engine/strata/sycl/src/core/graph.cpp | 249 + engine/strata/sycl/src/core/layer.cpp | 1741 ++ engine/strata/sycl/src/core/mtp.cpp | 1985 +++ engine/strata/sycl/src/core/native_dense.cpp | 421 + engine/strata/sycl/src/core/native_head.cpp | 295 + engine/strata/sycl/src/core/overlap_main.cpp | 239 + engine/strata/sycl/src/core/peer_experts.cpp | 41 + engine/strata/sycl/src/core/pinned.dp.cpp | 901 ++ .../sycl/src/core/remote_expert_opt_stub.cpp | 38 + .../strata/sycl/src/core/remote_experts.cpp | 482 + engine/strata/sycl/src/core/session.cpp | 1449 ++ engine/strata/sycl/src/core/verify.cpp | 3990 +++++ engine/strata/sycl/src/core/vmm.cpp | 27 + engine/strata/sycl/src/core/weights.cpp | 534 + .../sycl/src/kernels/bf16_gemv_parity.cpp | 191 + .../sycl/src/kernels/cuda/bf16_gemv.dp.cpp | 251 + .../strata/sycl/src/kernels/cuda/cvec.dp.cpp | 310 + .../sycl/src/kernels/cuda/dequant_bf16.dp.cpp | 330 + .../sycl/src/kernels/cuda/dequant_s2.dp.cpp | 72 + .../sycl/src/kernels/cuda/elementwise.dp.cpp | 982 ++ .../sycl/src/kernels/cuda/fused_gdn.dp.cpp | 340 + .../sycl/src/kernels/cuda/fused_gr.dp.cpp | 2396 +++ .../strata/sycl/src/kernels/cuda/gdn.dp.cpp | 401 + engine/strata/sycl/src/kernels/cuda/gr.dp.cpp | 810 + .../sycl/src/kernels/cuda/iq_kernels.dp.cpp | 6118 +++++++ .../strata/sycl/src/kernels/cuda/kv_q4.dp.cpp | 366 + .../strata/sycl/src/kernels/cuda/kv_q8.dp.cpp | 255 + .../sycl/src/kernels/cuda/kv_stream.dp.cpp | 502 + .../sycl/src/kernels/cuda/native_bf16.dp.cpp | 944 ++ .../src/kernels/cuda/native_flash_attn.dp.cpp | 382 + .../sycl/src/kernels/cuda/native_gdn.dp.cpp | 169 + .../kernels/cuda/native_gdn_preprocess.dp.cpp | 358 + .../src/kernels/cuda/native_gr_norm.dp.cpp | 172 + .../src/kernels/cuda/native_gr_postops.dp.cpp | 267 + .../sycl/src/kernels/cuda/native_mmvq.dp.cpp | 4090 +++++ .../sycl/src/kernels/cuda/native_moe.dp.cpp | 366 + .../kernels/cuda/native_ple_postops.dp.cpp | 518 + .../sycl/src/kernels/cuda/native_qsa.dp.cpp | 288 + .../kernels/cuda/native_qsa_indexer.dp.cpp | 593 + .../src/kernels/cuda/native_qsa_score.dp.cpp | 332 + .../sycl/src/kernels/cuda/native_rope.dp.cpp | 421 + .../src/kernels/cuda/native_router.dp.cpp | 312 + .../strata/sycl/src/kernels/cuda/ple.dp.cpp | 710 + .../strata/sycl/src/kernels/cuda/qsa.dp.cpp | 1277 ++ .../src/kernels/cuda/qsa_decode_attn.dp.cpp | 964 ++ .../src/kernels/cuda/qsa_prompt_attn.dp.cpp | 2056 +++ .../kernels/cuda/qsa_prompt_attn_xmx.dp.cpp | 388 + .../sycl/src/kernels/cuda/qsa_select.dp.cpp | 2096 +++ .../sycl/src/kernels/cuda/quantize_act.dp.cpp | 474 + .../strata/sycl/src/kernels/cuda/rope.dp.cpp | 165 + .../sycl/src/kernels/cuda/router_top10.dp.cpp | 801 + .../sycl/src/kernels/cuda/s26_tsum.dp.hpp | 80 + .../src/kernels/cuda/s2_expert_grouped.dp.cpp | 1879 +++ .../sycl/src/kernels/cuda/s2_gemv.dp.cpp | 85 + .../sycl/src/kernels/cuda/s2_gemv_fast.dp.cpp | 250 + .../sycl/src/kernels/cuda/s2_gemv_q8.dp.cpp | 141 + .../src/kernels/cuda/s2_gemv_quads.dp.cpp | 138 + .../sycl/src/kernels/cuda/s_gemv.dp.cpp | 1015 ++ .../sycl/src/kernels/cuda/sampler.dp.cpp | 1777 +++ .../src/kernels/cuda/shared_expert.dp.cpp | 703 + .../src/kernels/cuda/verify_kernels.dp.cpp | 2593 +++ .../strata/sycl/src/kernels/cvec_parity.cpp | 242 + .../strata/sycl/src/kernels/dense_bench.cpp | 105 + .../strata/sycl/src/kernels/dequant_bench.cpp | 76 + .../sycl/src/kernels/dequant_bf16_test.cpp | 117 + .../sycl/src/kernels/dequant_s2_parity.cpp | 165 + .../sycl/src/kernels/elementwise_parity.cpp | 717 + .../sycl/src/kernels/esimd_dpas_probe.cpp | 68 + .../sycl/src/kernels/esimd_i8_bench.cpp | 204 + .../src/kernels/esimd_iq3s_decode_bench.cpp | 168 + .../sycl/src/kernels/esimd_moe_mode_test.cpp | 30 + .../sycl/src/kernels/esimd_moe_parity.cpp | 284 + .../sycl/src/kernels/fused_gr_bench.cpp | 193 + engine/strata/sycl/src/kernels/gdn_parity.cpp | 946 ++ engine/strata/sycl/src/kernels/gr_bench.cpp | 59 + .../sycl/src/kernels/gr_multi_parity.cpp | 177 + engine/strata/sycl/src/kernels/gr_parity.cpp | 1285 ++ .../sycl/src/kernels/iq2xs_host_tables.inc | 138 + .../sycl/src/kernels/iq_multi_parity.cpp | 682 + engine/strata/sycl/src/kernels/iq_parity.cpp | 153 + .../sycl/src/kernels/kv_hybrid_parity.cpp | 482 + .../strata/sycl/src/kernels/kv_q4_parity.cpp | 429 + .../strata/sycl/src/kernels/kv_q8_parity.cpp | 230 + .../sycl/src/kernels/kv_steps_parity.cpp | 179 + .../sycl/src/kernels/kv_stream_parity.cpp | 356 + engine/strata/sycl/src/kernels/mmvq_bench.cpp | 98 + .../sycl/src/kernels/mmvq_multi_parity.cpp | 319 + .../strata/sycl/src/kernels/mmvq_sg_bench.cpp | 56 + .../sycl/src/kernels/native_expert_bench.cpp | 171 + .../sycl/src/kernels/native_expert_parity.cpp | 300 + .../src/kernels/native_grouped_parity.cpp | 711 + .../sycl/src/kernels/native_multi_parity.cpp | 198 + engine/strata/sycl/src/kernels/ple_parity.cpp | 1569 ++ .../sycl/src/kernels/q5_projection_parity.cpp | 86 + .../sycl/src/kernels/q6k_align_bench.cpp | 59 + engine/strata/sycl/src/kernels/qsa_parity.cpp | 1731 ++ .../src/kernels/qsa_prompt_attn_parity.cpp | 392 + .../sycl/src/kernels/qsa_select_bench.cpp | 234 + .../src/kernels/qsa_topk_active_parity.cpp | 127 + .../sycl/src/kernels/qsa_topk_parity.cpp | 218 + .../sycl/src/kernels/quantize_act_parity.cpp | 450 + .../sycl/src/kernels/resident_plan_parity.cpp | 227 + .../strata/sycl/src/kernels/rope_parity.cpp | 769 + .../sycl/src/kernels/route_window_parity.cpp | 151 + .../sycl/src/kernels/router_top10_parity.cpp | 186 + .../src/kernels/s2_expert_grouped_parity.cpp | 790 + .../sycl/src/kernels/s2_gemv_parity.cpp | 205 + .../sycl/src/kernels/s2_gemv_q8_parity.cpp | 236 + .../strata/sycl/src/kernels/s_gemv_parity.cpp | 754 + .../sycl/src/kernels/s_gemv_q8k_parity.cpp | 500 + .../sycl/src/kernels/sampler_parity.cpp | 1453 ++ .../sycl/src/kernels/shared_expert_parity.cpp | 740 + .../sycl/src/kernels/tq_sycl_parity.cpp | 444 + .../strata/sycl/src/kernels/verify_parity.cpp | 148 + .../sycl/src/kernels/xmx_gemm_bench.cpp | 93 + .../sycl/src/kernels/xmx_group_parity.cpp | 124 + .../sycl/src/kernels/xmx_int8_bench.cpp | 226 + engine/strata/sycl/src/ngram/ple_reader.cpp | 570 + .../strata/sycl/src/platform/direct_file.cpp | 369 + .../strata/sycl/src/prefill/esimd_moe.dp.cpp | 1051 ++ engine/strata/sycl/src/prefill/gemm.dp.cpp | 1018 ++ .../sycl/src/prefill/gemm_bf16_parity.dp.cpp | 221 + .../sycl/src/prefill/ggml_cuda_host.dp.cpp | 104 + engine/strata/sycl/src/prefill/iq_tables.inc | 377 + engine/strata/sycl/src/prefill/kernels.dp.cpp | 3122 ++++ .../strata/sycl/src/prefill/moe_fused.dp.cpp | 1162 ++ .../sycl/src/prefill/moe_fused_iq.dp.cpp | 1469 ++ .../sycl/src/prefill/moe_fused_stub.cpp | 37 + engine/strata/sycl/src/prefill/moe_mmq.dp.cpp | 320 + engine/strata/sycl/src/prefill/prefill.cpp | 5088 ++++++ engine/strata/sycl/src/prefill/xmx_moe.dp.cpp | 198 + engine/strata/sycl/src/program/generate.cpp | 13141 ++++++++++++++++ engine/strata/sycl/third_party/ggml/LICENSE | 21 + .../sycl/third_party/ggml/ggml-common.h | 2193 +++ engine/strata/sycl/tools/Dockerfile | 9 + engine/strata/sycl/tools/Dockerfile.unitrace | 8 + engine/strata/sycl/tools/build.sh | 49 + .../sycl/tools/data/prompt_deadlock_2744.tok | 1 + engine/strata/sycl/tools/fixups.py | 390 + engine/strata/sycl/tools/get-cuda-headers.sh | 28 + engine/strata/sycl/tools/gpustat.py | 182 + engine/strata/sycl/tools/gpustat.service | 10 + engine/strata/sycl/tools/merge_upstream.py | 37 + engine/strata/sycl/tools/migrate.sh | 49 + engine/strata/sycl/tools/normalize.sh | 26 + .../strata/sycl/tools/test_prompt_deadlock.sh | 26 + engine/strata/tests/core/batch_rows_test.cpp | 78 + .../strata/tests/core/dequant_q5_1_test.cpp | 40 + engine/strata/tests/core/dma_batch_parity.cu | 107 + .../tests/core/exchange_storage_test.cpp | 229 + .../core/expert_cache_segmented_test.cpp | 101 + .../core/expert_cache_slot_guard_test.cpp | 117 + .../strata/tests/core/expert_layout_test.cpp | 11 + .../tests/core/expert_profile_save_test.cpp | 80 + .../core/expert_profile_version_test.cpp | 73 + .../tests/core/file_expert_source_test.cpp | 722 +- engine/strata/tests/core/gguf_fixture.hpp | 43 +- .../strata/tests/core/gguf_geometry_test.cpp | 283 + .../tests/core/host_graph_launch_test.cu | 82 + .../strata/tests/core/memory_guard_test.cpp | 354 + .../strata/tests/core/model_family_test.cpp | 292 + .../tests/core/split_lend_complement_test.cpp | 219 + engine/strata/tests/core/vmm_test.cpp | 71 + engine/strata/tests/cuda/pa_bench.cpp | 110 + .../tests/cuda/prefill_fused_iq_test.cpp | 719 + .../tests/cuda/prefill_fused_moe_test.cpp | 420 + .../tests/cuda/prefill_mmq_kquant_test.cpp | 12 +- .../tests/cuda/prefill_mmq_scatter_test.cpp | 150 + .../strata/tests/cuda/prefill_mmq_tab_test.cu | 625 + .../strata/tests/data/gpu_roles_vectors.json | 73 + .../strata/tests/desktop/test_app_version.py | 34 + .../tests/desktop/test_control_install.py | 489 + .../strata/tests/desktop/test_fetch_node.py | 56 + .../strata/tests/desktop/test_nsis_layout.py | 113 + .../tests/desktop/test_tester_readme.py | 74 + engine/strata/tests/dsv41/ds4_cpu_bench.cpp | 107 + engine/strata/tests/dsv41/ds4_gguf_test.cu | 1618 ++ engine/strata/tests/dsv41/ds4_mx_bench.cpp | 383 + .../strata/tests/dsv41/experts_rule_test.cpp | 112 + engine/strata/tests/dsv41/gg_dot_bench.cpp | 314 + engine/strata/tests/dsv41/iq_expert_test.cpp | 610 + engine/strata/tests/dsv41/pick_rule_test.cpp | 38 + engine/strata/tests/dsv41/slot_test.cpp | 153 + engine/strata/tests/dsv41/store_test.cpp | 112 + engine/strata/tests/dsv41/tq_expert_test.cpp | 288 + engine/strata/tests/dsv41/tqw_hip_test.cpp | 137 + engine/strata/tests/hip/gdn_chunked.cpp | 235 + engine/strata/tests/hip/gdn_rec_head.cpp | 126 + .../strata/tests/hip/gemm_f16_io_parity.cpp | 112 + engine/strata/tests/hip/intrinsics.cpp | 30 +- engine/strata/tests/hip/prefill_gemm.cpp | 130 + .../tests/hip/prefill_gr_write_bench.cpp | 84 + .../tests/hip/prefill_hcd_exact_parity.cpp | 102 + .../strata/tests/hip/prefill_mmq_parity.cpp | 88 +- .../strata/tests/hip/prefill_rocblas_gemm.cpp | 206 + .../tests/hip/prefill_wmma_gemm_parity.cpp | 449 + engine/strata/tests/hip/q2_zero.cpp | 50 + .../strata/tests/platform/aux_cpus_test.cpp | 217 + .../tests/platform/host_limits_test.cpp | 34 + .../strata/tests/prefill/share_rules_test.cpp | 56 + .../tuning_header_arch_family_test.cpp | 107 + .../strata/tests/program/batch_read_test.cpp | 85 + .../tests/program/prefill_plan_test.cpp | 128 + .../strata/tests/program/split_rules_test.cpp | 145 + .../tests/sycl/test_setup_intel_prefill.py | 52 + .../terminal/data/windows_package_paths.json | 51 + .../strata/tests/terminal/launch_previews.py | 153 + .../strata/tests/terminal/launch_support.py | 70 + .../strata/tests/terminal/lifecycle_matrix.py | 808 + .../strata/tests/terminal/ssh_disconnect.py | 86 + .../tests/terminal/test_app_isolation.py | 72 + .../terminal/test_app_prerelease_version.py | 36 + .../tests/terminal/test_archive_gaps.py | 150 + engine/strata/tests/terminal/test_bench.py | 725 + .../tests/terminal/test_bench_standard.py | 1179 ++ .../tests/terminal/test_bundle_imports.py | 101 + .../tests/terminal/test_bundle_tools_paths.py | 94 + .../strata/tests/terminal/test_calibration.py | 723 + .../tests/terminal/test_cloudflared_find.py | 146 + .../tests/terminal/test_component_start.py | 246 + .../strata/tests/terminal/test_connections.py | 328 + .../tests/terminal/test_cpu_topology.py | 61 + .../tests/terminal/test_data_dir_choice.py | 214 + .../strata/tests/terminal/test_discovery.py | 320 + .../strata/tests/terminal/test_disk_space.py | 66 + .../tests/terminal/test_docker_fetch.py | 86 + .../tests/terminal/test_docker_files.py | 206 + .../tests/terminal/test_download_integrity.py | 443 + engine/strata/tests/terminal/test_drafting.py | 488 + engine/strata/tests/terminal/test_drain.py | 67 + .../tests/terminal/test_dsv41_engine.py | 203 + .../terminal/test_dsv41_import_preview.py | 94 + .../test_dsv41_own_files_and_mmproj.py | 141 + .../tests/terminal/test_dsv41_tui_items.py | 305 + .../strata/tests/terminal/test_dsv41_tune.py | 92 + .../tests/terminal/test_dsv41_upgrade.py | 177 + .../tests/terminal/test_engine_component.py | 463 + .../strata/tests/terminal/test_engine_deps.py | 148 + .../tests/terminal/test_engine_manifest.py | 371 + .../tests/terminal/test_engine_smoke.py | 64 + .../strata/tests/terminal/test_file_in_use.py | 54 + .../strata/tests/terminal/test_flow2_022.py | 413 + .../tests/terminal/test_folders_home.py | 34 + .../tests/terminal/test_gfx_selection.py | 95 + engine/strata/tests/terminal/test_gpu_fit.py | 164 + .../strata/tests/terminal/test_gpu_roles.py | 127 + engine/strata/tests/terminal/test_handover.py | 173 + .../tests/terminal/test_hipblaslt_tuning.py | 376 + .../tests/terminal/test_import_projector.py | 107 + .../terminal/test_install_engine_file.py | 86 + .../terminal/test_install_scripts_env.py | 97 + .../strata/tests/terminal/test_issues_022.py | 461 + engine/strata/tests/terminal/test_launch.py | 1334 ++ .../tests/terminal/test_launch_dsv41.py | 180 + .../terminal/test_launch_engine_first.py | 281 + .../tests/terminal/test_launch_identity.py | 54 + .../tests/terminal/test_launch_install.py | 195 + .../tests/terminal/test_launch_monitor.py | 203 + .../tests/terminal/test_launch_old_gpus.py | 56 + .../tests/terminal/test_launch_speed.py | 302 + .../strata/tests/terminal/test_launch_tui.py | 968 ++ .../tests/terminal/test_launch_tui_walk.py | 355 + .../tests/terminal/test_lifecycle_matrix.py | 36 + .../strata/tests/terminal/test_loader_diag.py | 68 + engine/strata/tests/terminal/test_logs.py | 158 + engine/strata/tests/terminal/test_longpath.py | 174 + engine/strata/tests/terminal/test_loopback.py | 47 + .../strata/tests/terminal/test_make_guard.py | 179 + .../strata/tests/terminal/test_migration.py | 207 + .../tests/terminal/test_mixed_vendors.py | 149 + .../tests/terminal/test_model_id_dot.py | 28 + engine/strata/tests/terminal/test_models.py | 332 + .../strata/tests/terminal/test_models_move.py | 400 + .../tests/terminal/test_monitor_bundle.py | 489 + .../tests/terminal/test_monitor_classic.py | 232 + .../tests/terminal/test_no_acquisition.py | 360 + engine/strata/tests/terminal/test_overview.py | 182 + .../strata/tests/terminal/test_own_files.py | 334 + .../tests/terminal/test_owner_transport.py | 245 + .../tests/terminal/test_pack_gguf_engram.py | 60 + .../tests/terminal/test_packaging_pins.py | 124 + .../terminal/test_picture_reader_package.py | 94 + .../strata/tests/terminal/test_posix_owner.py | 88 + .../tests/terminal/test_private_files.py | 182 + engine/strata/tests/terminal/test_procs.py | 142 + engine/strata/tests/terminal/test_profiles.py | 448 + .../tests/terminal/test_progress_words.py | 157 + .../tests/terminal/test_read_small_retry.py | 51 + engine/strata/tests/terminal/test_ready.py | 69 + engine/strata/tests/terminal/test_recipes.py | 353 + .../tests/terminal/test_release_config.py | 63 + .../tests/terminal/test_release_keys.py | 49 + .../tests/terminal/test_release_matrix.py | 191 + .../tests/terminal/test_round8_fixes.py | 338 + engine/strata/tests/terminal/test_runtime.py | 1323 ++ .../terminal/test_setup_failure_words.py | 92 + .../terminal/test_shared_models_folder.py | 91 + .../strata/tests/terminal/test_size_label.py | 23 + .../strata/tests/terminal/test_state_paths.py | 47 + .../tests/terminal/test_sycl_package.py | 127 + engine/strata/tests/terminal/test_terminal.py | 1647 ++ .../tests/terminal/test_terminal_commit.py | 63 + .../tests/terminal/test_terminal_polish.py | 57 + .../strata/tests/terminal/test_tls_trust.py | 114 + .../tests/terminal/test_tui2_023_install.py | 87 + .../tests/terminal/test_tui2_023_messages.py | 70 + .../terminal/test_tui2_023_old_launcher.py | 56 + .../tests/terminal/test_tui2_023_plan.py | 100 + .../tests/terminal/test_tui2_023_shards.py | 31 + .../tests/terminal/test_tui2_023_versions.py | 79 + engine/strata/tests/terminal/test_tui3.py | 296 + .../strata/tests/terminal/test_tui_stress.py | 151 + .../tests/terminal/test_tui_stress_launch.py | 221 + .../tests/terminal/test_tui_stress_screens.py | 224 + .../tests/terminal/test_tuiqa_browser.py | 88 + .../tests/terminal/test_tuiqa_connect_cli.py | 117 + .../tests/terminal/test_tuiqa_launch.py | 218 + .../tests/terminal/test_tuiqa_monitor.py | 311 + .../tests/terminal/test_tuiqa_version.py | 65 + .../tests/terminal/test_tuiqa_wizard.py | 231 + .../strata/tests/terminal/test_update_feed.py | 429 + .../tests/terminal/test_update_feed_memory.py | 45 + .../tests/terminal/test_update_rules_022.py | 155 + engine/strata/tests/terminal/test_updater.py | 803 + .../tests/terminal/test_vision_gguf_meta.py | 32 + .../tests/terminal/test_visual_detail.py | 117 + engine/strata/tests/terminal/test_vram_fit.py | 152 + .../strata/tests/terminal/update_fixture.py | 152 + engine/strata/tests/time_skip/.gitignore | 2 + .../tests/time_skip/test_apply_attempt.py | 50 + engine/strata/tests/time_skip/test_atomic.py | 62 + .../strata/tests/time_skip/test_time_skip.py | 421 + engine/strata/tests/tuning/stub_engine.py | 52 + engine/strata/tests/tuning/stub_session.py | 92 + engine/strata/tests/tuning/test_autotune.py | 472 + engine/strata/tests/tuning/test_components.py | 499 + engine/strata/tests/tuning/test_offline.py | 193 + .../tests/tuning/test_preset_persistence.py | 130 + engine/strata/tests/tuning/test_presets.py | 182 + engine/strata/tests/tuning/test_session.py | 132 + engine/strata/tests/tuning/test_tune_api.py | 253 + engine/strata/tests/tuning/test_tune_apply.py | 361 + .../strata/tests/tuning/test_tune_engine.py | 304 + .../strata/tests/tuning/test_tune_history.py | 255 + engine/strata/tests/tuning/test_tuning.py | 463 + .../third_party/ggml-tq/tq-mmq-tiles.cuh | 67 + engine/strata/third_party/ggml-tq/tq.cuh | 108 + .../strata/third_party/ggml/ggml-common-tq.h | 299 + .../strata/third_party/project-maya/LICENSE | 22 + .../strata/third_party/project-maya/NOTICE.md | 15 + engine/strata/tools/_paths.py | 28 +- engine/strata/tools/ab_engine.py | 139 + engine/strata/tools/agent_turns_bench.py | 216 + .../strata/tools/batch_groups_cache_test.py | 88 + engine/strata/tools/batch_interleave_test.py | 334 + engine/strata/tools/batch_test.py | 183 + engine/strata/tools/bench_eviction.py | 405 + engine/strata/tools/build_standard_corpus.py | 262 + engine/strata/tools/calibrate.py | 336 +- engine/strata/tools/cancel_park_test.py | 91 + engine/strata/tools/check_isa_guard.py | 225 + engine/strata/tools/collect_profile_traces.py | 92 + .../tools/conversation_restore_speed.py | 182 + engine/strata/tools/dflash2/README.md | 30 + engine/strata/tools/dflash2/analyze2.py | 73 + engine/strata/tools/dflash2/dflash2_ref.py | 201 + engine/strata/tools/dflash2/final_tables.py | 61 + engine/strata/tools/dflash2/mk_parity_case.py | 88 + engine/strata/tools/dflash2/mk_prompts.py | 40 + engine/strata/tools/dflash2/orch.py | 67 + engine/strata/tools/dflash2/q8test.py | 60 + engine/strata/tools/dflash2/run_all2.py | 53 + engine/strata/tools/dflash2/run_eval.py | 70 + engine/strata/tools/dflash2/run_one.ps1 | 50 + engine/strata/tools/dflash2/test_port.py | 45 + engine/strata/tools/dflash2_pack.py | 164 + engine/strata/tools/draft_vocab.py | 52 +- engine/strata/tools/dsv41/build_hip_linux.sh | 28 + engine/strata/tools/dsv41/bytecheck.sh | 68 + engine/strata/tools/dsv41/compare.py | 62 + engine/strata/tools/dsv41/dense_requant.py | 104 + .../strata/tools/dsv41/download-3.5bpw.json | 239 + engine/strata/tools/dsv41/download.json | 231 + engine/strata/tools/dsv41/download_gguf.json | 337 + engine/strata/tools/dsv41/drafter_pack.py | 218 + engine/strata/tools/dsv41/dspark_ref.py | 389 + engine/strata/tools/dsv41/dumpcmp.py | 186 + engine/strata/tools/dsv41/dumpscan.py | 44 + engine/strata/tools/dsv41/dumpscan_y.py | 50 + engine/strata/tools/dsv41/engram_fold.py | 195 + engine/strata/tools/dsv41/engram_hash.py | 144 + .../strata/tools/dsv41/engram_iq4nl_bench.py | 623 + engine/strata/tools/dsv41/ista_intake.py | 318 + engine/strata/tools/dsv41/make_imatrix.py | 30 + engine/strata/tools/dsv41/mkimg.py | 40 + engine/strata/tools/dsv41/mkprompts.py | 48 + engine/strata/tools/dsv41/pack_gguf.py | 914 ++ .../tools/dsv41/recipe_maya_s_test.json | 13 + engine/strata/tools/dsv41/ref.py | 424 + engine/strata/tools/dsv41/ref_gguf.py | 303 + engine/strata/tools/dsv41/requant_gguf.py | 468 + engine/strata/tools/dsv41/serve_prompts.py | 86 + engine/strata/tools/dsv41/slot_keep_test.py | 475 + engine/strata/tools/dsv41/smoke.py | 104 + engine/strata/tools/dsv41/st.py | 66 + engine/strata/tools/dsv41/test_prompt_skip.py | 56 + engine/strata/tools/dsv41/tok.py | 38 + engine/strata/tools/dsv41/tq_convert.py | 157 + engine/strata/tools/dsv41/tune.py | 182 + engine/strata/tools/dsv41/vision_pack.py | 210 + .../strata/tools/dsv41/win/build_hip_win.bat | 45 + .../strata/tools/dsv41/win/build_umaprobe.bat | 12 + engine/strata/tools/dsv41/win/cachesim.py | 358 + engine/strata/tools/dsv41/win/h100sim.py | 132 + engine/strata/tools/dsv41/win/hwbench.cu | 143 + engine/strata/tools/dsv41/win/predsim.py | 107 + engine/strata/tools/dsv41/win/umaprobe.cpp | 324 + engine/strata/tools/dsv41_lab/attn_split.cuh | 202 + engine/strata/tools/dsv41_lab/build.sh | 16 + engine/strata/tools/dsv41_lab/code_sqnr.cpp | 34 + .../strata/tools/dsv41_lab/computed_codes.hpp | 84 + engine/strata/tools/dsv41_lab/ds4_lab.cu | 392 + engine/strata/tools/dsv41_lab/hip/README.md | 38 + .../tools/dsv41_lab/hip/tqk_gemv_wmma.hip.cpp | 117 + .../tools/dsv41_lab/hip/wmma_probe.hip.cpp | 40 + engine/strata/tools/dsv41_lab/tqk_gemv.cuh | 236 + engine/strata/tools/dsv41_lab/tqk_gemv3.cuh | 118 + engine/strata/tools/dsv41_lab/tqk_gemv_c.cuh | 109 + engine/strata/tools/dsv41_lab/tqk_lab.cu | 294 + engine/strata/tools/dsv41_lab/tqk_repack.hpp | 50 + engine/strata/tools/dsv41_lab/wmma_emu.hpp | 168 + .../strata/tools/dsv41_lab/wmma_emu_test.cpp | 64 + engine/strata/tools/early_close_test.py | 47 + engine/strata/tools/embd_bf16_pack.py | 68 +- engine/strata/tools/gguf_reader.py | 4 + engine/strata/tools/h2d_bench.cu | 82 + engine/strata/tools/harness_reuse_probe.py | 85 + engine/strata/tools/hf_pin_fetch.py | 55 + engine/strata/tools/hip/build_windows.bat | 42 +- engine/strata/tools/hip/dll_closure.py | 117 + .../hip/gfx1030-rocblas-5.6.0.8d1ae90e.txt | 117 + .../tools/hip/gfx1100-hipblaslt-100202.txt | 28 + .../tools/hip/gfx1100-hipblaslt-100401.txt | 45 + .../tools/hip/gfx1100-hipblaslt-100500.txt | 34 + .../tools/hip/gfx1103-hipblaslt-100401.txt | 145 + .../tools/hip/gfx1150-hipblaslt-100401.txt | 146 + .../tools/hip/gfx1150-hipblaslt-100500.txt | 143 + .../tools/hip/gfx1151-hipblaslt-100400.txt | 92 + .../tools/hip/gfx1151-hipblaslt-100401.txt | 92 + .../tools/hip/gfx1151-hipblaslt-100500.txt | 34 + .../tools/hip/gfx1200-hipblaslt-100202.txt | 69 + .../tools/hip/gfx1201-hipblaslt-100202.txt | 26 + engine/strata/tools/hip/package_windows.py | 57 +- engine/strata/tools/hip/tune_rocblas.cpp | 281 + engine/strata/tools/idle_gpu_ab.py | 376 + engine/strata/tools/image/install.py | 101 + engine/strata/tools/image/qimage.py | 203 + .../strata/tools/image/sdcpp_native/apply.py | 75 + .../tools/image/sdcpp_native/qi21-native.cu | 679 + .../sdcpp_native/qwen_image_2_1_native.hpp | 601 + engine/strata/tools/iq_pack.py | 200 +- .../tools/logit_bias_english_example.py | 81 + engine/strata/tools/logit_bias_http_probe.py | 91 + engine/strata/tools/make_profile.py | 67 +- engine/strata/tools/make_profile_mix.py | 62 + engine/strata/tools/minimal_cli_smoke.py | 129 + engine/strata/tools/minimal_server_smoke.py | 76 + engine/strata/tools/monitor_soak.py | 309 + engine/strata/tools/mtp_fetch.py | 239 +- engine/strata/tools/nvfp4_convert.py | 128 + engine/strata/tools/nvfp4_local_pack.py | 686 + engine/strata/tools/nvfp4_verify.py | 121 + engine/strata/tools/nvfp4_verify_gguf.py | 161 + engine/strata/tools/parking_test.py | 89 + engine/strata/tools/piped_read_join_bench.py | 226 + .../tools/portable_monitor_pty_smoke.py | 127 + engine/strata/tools/portable_monitor_smoke.py | 255 + engine/strata/tools/q8_dense_gguf.py | 168 + engine/strata/tools/q8_sm60_check.cu | 108 + engine/strata/tools/quant_bound.py | 59 + engine/strata/tools/quant_formats.py | 154 + engine/strata/tools/quant_quality.py | 380 + engine/strata/tools/quantscope.py | 395 + engine/strata/tools/qwen35/compare_dumps.py | 67 + engine/strata/tools/qwen35/kl.py | 106 + .../strata/tools/qwen35/make_big_picture.py | 27 + engine/strata/tools/qwen35/parity.py | 112 + engine/strata/tools/qwen35/parity_prompts.ids | 10 + .../strata/tools/qwen35/parity_prompts.json | 12 + .../strata/tools/qwen35/pictures/big1024.png | Bin 0 -> 47955 bytes .../strata/tools/qwen35/pictures/code4217.png | Bin 0 -> 9774 bytes .../strata/tools/qwen35/pictures/shapes.png | Bin 0 -> 7153 bytes engine/strata/tools/qwen35/q36_batch_gate.py | 115 + engine/strata/tools/qwen35/q36_cmp_gate.py | 13 + engine/strata/tools/qwen35/q36_harness.py | 143 + .../tools/qwen35/q36_interleave_probe.py | 79 + engine/strata/tools/qwen35/q36_lgcmp.py | 13 + engine/strata/tools/qwen35/q36_llama_dump.cpp | 157 + engine/strata/tools/qwen35/q36_mtmd_dump.cpp | 138 + .../tools/qwen35/q36_multilingual_prompts.py | 35 + engine/strata/tools/qwen35/q36_par_bench.py | 103 + engine/strata/tools/qwen35/q36_proto_edge.py | 112 + .../strata/tools/qwen35/q36_serve_handoff.py | 46 + engine/strata/tools/qwen35/q36_serve_par.py | 65 + engine/strata/tools/qwen35/q36_solo_gate.py | 26 + engine/strata/tools/qwen35/q36_venc.py | 18 + engine/strata/tools/qwen35/q36_vision_cmp.py | 146 + .../strata/tools/qwen35/q36_vision_proto.py | 94 + .../strata/tools/qwen35/q36_vision_serve.py | 20 + .../strata/tools/qwen35/q36_vram_refusal.py | 71 + engine/strata/tools/replay_cache_policy.py | 141 + engine/strata/tools/research_run.py | 144 + engine/strata/tools/serve_load.py | 160 + engine/strata/tools/session_pressure_test.py | 101 + engine/strata/tools/sm60_dp4a_check.cu | 95 + engine/strata/tools/split_mtp_batch_parity.py | 81 + engine/strata/tools/stop_resend_test.py | 100 + engine/strata/tools/strata_bench.py | 1041 ++ engine/strata/tools/strata_inspect.py | 186 + engine/strata/tools/strata_mcp.py | 1191 +- engine/strata/tools/strata_pack.py | 33 +- engine/strata/tools/strata_tokenizer.py | 234 +- engine/strata/tools/test_bench_eviction.py | 165 + engine/strata/tools/test_bench_host.py | 39 + engine/strata/tools/test_calibrate.py | 239 +- engine/strata/tools/test_check_isa_guard.py | 66 + .../tools/test_conversation_restore_speed.py | 34 + engine/strata/tools/test_cyrillic_paths.py | 54 + engine/strata/tools/test_dflash2_pack.py | 148 + engine/strata/tools/test_dll_closure.py | 155 + engine/strata/tools/test_docker_entrypoint.py | 275 + engine/strata/tools/test_draft_vocab.py | 47 + engine/strata/tools/test_effort_end_args.py | 82 + .../strata/tools/test_gfx906_build_files.py | 38 + engine/strata/tools/test_gguf_paths.py | 39 + engine/strata/tools/test_iq_pack.py | 212 +- engine/strata/tools/test_make_profile.py | 104 + engine/strata/tools/test_make_profile_mix.py | 53 + engine/strata/tools/test_mtp_fetch.py | 183 + engine/strata/tools/test_nvfp4_local_pack.py | 111 + engine/strata/tools/test_picture_defaults.py | 100 + engine/strata/tools/test_pool_plan.py | 111 + engine/strata/tools/test_qimage.py | 202 + engine/strata/tools/test_research_run.py | 89 + engine/strata/tools/test_setup_amd.py | 383 +- engine/strata/tools/test_setup_bench_tips.py | 100 + engine/strata/tools/test_setup_choices.py | 481 +- .../strata/tools/test_setup_compute_mode.py | 36 + engine/strata/tools/test_setup_config.py | 289 + engine/strata/tools/test_setup_configs.py | 63 + engine/strata/tools/test_setup_cuda_repo.py | 115 + engine/strata/tools/test_setup_dl_fix.py | 131 + engine/strata/tools/test_setup_download.py | 560 + engine/strata/tools/test_setup_draft_vocab.py | 102 +- engine/strata/tools/test_setup_dsv41.py | 699 + engine/strata/tools/test_setup_engine_hash.py | 390 + engine/strata/tools/test_setup_engine_keep.py | 105 + engine/strata/tools/test_setup_feed_engine.py | 83 + engine/strata/tools/test_setup_find_tool.py | 65 + engine/strata/tools/test_setup_golden.json | 574 +- engine/strata/tools/test_setup_golden.py | 21 +- engine/strata/tools/test_setup_gpu_fit.py | 97 + engine/strata/tools/test_setup_gyro.py | 122 + engine/strata/tools/test_setup_hotfix_tag.py | 54 + engine/strata/tools/test_setup_hybrid.py | 126 + .../strata/tools/test_setup_llama_archive.py | 173 + engine/strata/tools/test_setup_lowram.py | 18 + engine/strata/tools/test_setup_mac.py | 419 + engine/strata/tools/test_setup_menu.py | 233 + engine/strata/tools/test_setup_model_pins.py | 266 + engine/strata/tools/test_setup_modelscope.py | 157 + engine/strata/tools/test_setup_nvfp4.py | 293 + engine/strata/tools/test_setup_oldcpu.py | 95 + engine/strata/tools/test_setup_older_gpus.py | 301 + engine/strata/tools/test_setup_ownfiles.py | 114 + engine/strata/tools/test_setup_page_file.py | 158 + engine/strata/tools/test_setup_parallel.py | 53 + engine/strata/tools/test_setup_pcie.py | 44 + engine/strata/tools/test_setup_pins.py | 227 +- engine/strata/tools/test_setup_qwen36.py | 341 + engine/strata/tools/test_setup_remote_opt.py | 98 + engine/strata/tools/test_setup_rerun_size.py | 104 + engine/strata/tools/test_setup_risk.py | 121 +- .../strata/tools/test_setup_rocm_indexes.json | 1159 ++ engine/strata/tools/test_setup_rocm_pins.py | 168 + engine/strata/tools/test_setup_shard_check.py | 54 + engine/strata/tools/test_setup_small_card.py | 131 + engine/strata/tools/test_setup_stale_stamp.py | 153 + engine/strata/tools/test_setup_stall_note.py | 34 + .../strata/tools/test_setup_start_gpus_amd.py | 40 + engine/strata/tools/test_setup_strix_halo.py | 561 + engine/strata/tools/test_setup_sycl.py | 321 + engine/strata/tools/test_setup_unsloth.py | 609 +- engine/strata/tools/test_setup_update.py | 157 + engine/strata/tools/test_setup_update_gpu.py | 53 + engine/strata/tools/test_shards.py | 99 +- engine/strata/tools/test_source_nul_bytes.py | 55 + engine/strata/tools/test_strata_bench.py | 344 + engine/strata/tools/test_strata_inspect.py | 71 + engine/strata/tools/test_strata_mcp.py | 514 +- engine/strata/tools/test_strata_tokenizer.py | 395 + engine/strata/tools/test_sycl_build_guard.py | 74 + .../tools/test_tokenizer_plain_spans.py | 97 + engine/strata/tools/test_user_args.py | 192 + engine/strata/tools/test_vision_reader.py | 277 + engine/strata/tools/test_windows_amd_gpu.py | 98 + engine/strata/tools/tqenc.py | 275 + engine/strata/tools/trellis/README.md | 38 + engine/strata/tools/trellis/blockldl.py | 73 + engine/strata/tools/trellis/build.sh | 29 + engine/strata/tools/trellis/build_swap.py | 224 + engine/strata/tools/trellis/fetch_orig.py | 67 + .../tools/trellis/gyro_column_profile.py | 70 + .../tools/trellis/gyro_error_profile.py | 92 + engine/strata/tools/trellis/gyro_reencode.py | 107 + .../strata/tools/trellis/gyro_vs_original.py | 107 + engine/strata/tools/trellis/hf_slice.py | 94 + engine/strata/tools/trellis/make_corpus.py | 178 + engine/strata/tools/trellis/merge_dumps.py | 32 + engine/strata/tools/trellis/pilot.py | 228 + engine/strata/tools/trellis/pilot_summary.py | 42 + .../strata/tools/trellis/proxy_diag_error.py | 101 + engine/strata/tools/trellis/proxy_ldl.py | 98 + engine/strata/tools/trellis/run_parts.py | 94 + engine/strata/tools/trellis/sanity_greedy.py | 76 + engine/strata/tools/trellis/swap_compare.py | 96 + engine/strata/tools/trellis/test_blockldl.py | 44 + engine/strata/tools/trellis/test_tqenc_py.py | 52 + engine/strata/tools/trellis/tqenc.cpp | 601 + engine/strata/tools/trellis/tqenc.hpp | 106 + engine/strata/tools/trellis/tqenc_hip.cpp | 565 + .../strata/tools/trellis/tqenc_hip_test.cpp | 117 + engine/strata/tools/trellis/tqenc_test.cpp | 564 + engine/strata/tools/vision/CMakeLists.txt | 107 +- engine/strata/tools/vision/gguf_meta.h | 156 + engine/strata/tools/vision/gguf_meta_test.cpp | 110 + engine/strata/tools/vision/gpu_arch.h | 33 + engine/strata/tools/vision/gpu_arch_test.cpp | 24 + .../strata/tools/vision/strata-utf8.manifest | 8 + engine/strata/tools/vision/strata_vision.cpp | 156 +- .../tools/windows/enable_large_pages.ps1 | 89 + engine/strata/update.sh | 64 + scripts/build-cpu.sh | 7 +- 2498 files changed, 641871 insertions(+), 7323 deletions(-) create mode 100644 engine/strata/.github/ISSUE_TEMPLATE/benchmark.yml create mode 100644 engine/strata/.github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 engine/strata/.github/ISSUE_TEMPLATE/config.yml create mode 100644 engine/strata/.github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 engine/strata/.github/ISSUE_TEMPLATE/question.yml create mode 100644 engine/strata/.github/pull_request_template.md create mode 100644 engine/strata/.github/scripts/item-check.js create mode 100644 engine/strata/.github/scripts/item-check.test.js create mode 100644 engine/strata/.github/scripts/reset-bot.js create mode 100644 engine/strata/.github/workflows/docker-images.yml create mode 100644 engine/strata/.github/workflows/intake.yml create mode 100644 engine/strata/.github/workflows/metal-build.yml create mode 100644 engine/strata/.github/workflows/reopen.yml create mode 100644 engine/strata/.github/workflows/scripts-test.yml create mode 100644 engine/strata/.github/workflows/terminal-minimal-server.yml create mode 100644 engine/strata/.github/workflows/terminal-portable-monitor.yml create mode 100644 engine/strata/.github/workflows/title-area.yml create mode 100644 engine/strata/BENCH.bat create mode 100644 engine/strata/CONTRIBUTING.md create mode 100644 engine/strata/README.de.md create mode 100644 engine/strata/README.es.md create mode 100644 engine/strata/README.fr.md create mode 100644 engine/strata/README.ja.md create mode 100644 engine/strata/README.pt-BR.md create mode 100644 engine/strata/README.zh-CN.md create mode 100644 engine/strata/SECURITY.md create mode 100644 engine/strata/UPDATE.bat create mode 100644 engine/strata/apps/desktop/package-lock.json create mode 100644 engine/strata/apps/desktop/package.json create mode 100644 engine/strata/apps/desktop/scripts/app-close-matrix.py create mode 100644 engine/strata/apps/desktop/scripts/cards-e2e.mjs create mode 100644 engine/strata/apps/desktop/scripts/fetch-node.ps1 create mode 100755 engine/strata/apps/desktop/scripts/fetch-node.sh create mode 100644 engine/strata/apps/desktop/scripts/first-run-ui.mjs create mode 100644 engine/strata/apps/desktop/scripts/flatten-pnpm.mjs create mode 100644 engine/strata/apps/desktop/scripts/harness-prune.mjs create mode 100644 engine/strata/apps/desktop/scripts/installed-flow.mjs create mode 100644 engine/strata/apps/desktop/scripts/installer-mockups.mjs create mode 100644 engine/strata/apps/desktop/scripts/local-gguf-e2e.mjs create mode 100755 engine/strata/apps/desktop/scripts/make-dmg.sh create mode 100644 engine/strata/apps/desktop/scripts/make-icons.mjs create mode 100644 engine/strata/apps/desktop/scripts/make-installer-images.mjs create mode 100644 engine/strata/apps/desktop/scripts/make-tester-readme.sh create mode 100644 engine/strata/apps/desktop/scripts/pics-e2e.mjs create mode 100755 engine/strata/apps/desktop/scripts/repack-appimage.sh create mode 100644 engine/strata/apps/desktop/scripts/stage-control.py create mode 100644 engine/strata/apps/desktop/scripts/stage-harness.mjs create mode 100644 engine/strata/apps/desktop/scripts/ui-flows.mjs create mode 100644 engine/strata/apps/desktop/scripts/vision-e2e.mjs create mode 100644 engine/strata/apps/desktop/src-tauri/.gitignore create mode 100644 engine/strata/apps/desktop/src-tauri/Cargo.lock create mode 100644 engine/strata/apps/desktop/src-tauri/Cargo.toml create mode 100644 engine/strata/apps/desktop/src-tauri/build.rs create mode 100644 engine/strata/apps/desktop/src-tauri/entitlements.plist create mode 100644 engine/strata/apps/desktop/src-tauri/gen/schemas/acl-manifests.json create mode 100644 engine/strata/apps/desktop/src-tauri/gen/schemas/capabilities.json create mode 100644 engine/strata/apps/desktop/src-tauri/gen/schemas/desktop-schema.json create mode 100644 engine/strata/apps/desktop/src-tauri/gen/schemas/macOS-schema.json create mode 100644 engine/strata/apps/desktop/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 engine/strata/apps/desktop/src-tauri/icons/android/values/ic_launcher_background.xml create mode 100644 engine/strata/apps/desktop/src-tauri/nsis/installer.nsi create mode 100644 engine/strata/apps/desktop/src-tauri/resources/control/.gitignore create mode 100644 engine/strata/apps/desktop/src-tauri/resources/engine-bundle/.gitignore create mode 100644 engine/strata/apps/desktop/src-tauri/resources/node/.gitignore create mode 100644 engine/strata/apps/desktop/src-tauri/src/desktoplog.rs create mode 100644 engine/strata/apps/desktop/src-tauri/src/main.rs create mode 100644 engine/strata/apps/desktop/src-tauri/src/supervisor.rs create mode 100644 engine/strata/apps/desktop/src-tauri/src/updater.rs create mode 100644 engine/strata/apps/desktop/src-tauri/tauri.conf.json create mode 100644 engine/strata/apps/desktop/src-tauri/tauri.release.conf.json create mode 100644 engine/strata/apps/desktop/src-tauri/tauri.tester.conf.json create mode 100644 engine/strata/apps/desktop/src-tauri/tauri.update.conf.json create mode 100644 engine/strata/apps/desktop/tester/README-amd-rx7900.txt.in create mode 100644 engine/strata/apps/desktop/tester/README-amd-rx9070.txt.in create mode 100644 engine/strata/apps/desktop/tester/README-linux.txt.in create mode 100644 engine/strata/apps/desktop/tester/README-mac.txt.in create mode 100644 engine/strata/apps/desktop/tester/common-gatekeeper-mac.txt create mode 100644 engine/strata/apps/desktop/tester/common-troubleshoot.txt create mode 100644 engine/strata/apps/host/.gitignore create mode 100644 engine/strata/apps/host/README.md create mode 100644 engine/strata/apps/host/audit-fixes/FINDING-STATUS.md create mode 100644 engine/strata/apps/host/audit-fixes/PROGRESS.md create mode 100644 engine/strata/apps/host/audit-fixes/PROMPTS.md create mode 100644 engine/strata/apps/host/audit-fixes/README.md create mode 100644 engine/strata/apps/host/audit-fixes/REVIEW.md create mode 100644 engine/strata/apps/host/audit-fixes/apply-chat.py create mode 100644 engine/strata/apps/host/audit-fixes/apply-engine.py create mode 100644 engine/strata/apps/host/audit-fixes/apply-finishing.py create mode 100644 engine/strata/apps/host/audit-fixes/apply-model.py create mode 100644 engine/strata/apps/host/audit-fixes/apply-screens.py create mode 100644 engine/strata/apps/host/audit-fixes/apply-shared.py create mode 100644 engine/strata/apps/host/audit-fixes/baseline-preview-state.json create mode 100644 engine/strata/apps/host/audit-fixes/changed-files.txt create mode 100644 engine/strata/apps/host/audit-fixes/designs/Engine v3.dc.html create mode 100644 engine/strata/apps/host/audit-fixes/designs/Model.dc.html create mode 100644 engine/strata/apps/host/audit-fixes/finding-status.json create mode 100644 engine/strata/apps/host/audit-fixes/findings.json create mode 100644 engine/strata/apps/host/audit-fixes/review-fixture.json create mode 100644 engine/strata/apps/host/audit-fixes/summary.json create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T01-one-model-name.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T02-overlay-layering.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T03-control-states.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T04-error-notice.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T05-live-numbers.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T06-response-hover.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T07-hide-unbuilt.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T08-nav-engine-model.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T09-model-page.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T10-engine-page.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T11-chat.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T12-time-skip.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T13-serving.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T14-monitor.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T15-skills-tasks.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T16-settings-setup.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T17-navigation.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T18-preview-panel.md create mode 100644 engine/strata/apps/host/audit-fixes/tasks/T19-dark-mode.md create mode 100644 engine/strata/apps/host/audit-fixes/write-review.py create mode 100644 engine/strata/apps/host/docs/README-historical.md create mode 100644 engine/strata/apps/host/docs/annotations-19-2026-10-09.md create mode 100644 engine/strata/apps/host/docs/annotations-32-2026-10-09.md create mode 100644 engine/strata/apps/host/docs/annotations-followup-2026-10-09.md create mode 100644 engine/strata/apps/host/docs/chat-shell-2026-10-06.md create mode 100644 engine/strata/apps/host/docs/design-improvements-2026-10-05.md create mode 100644 engine/strata/apps/host/docs/design-system-notes.md create mode 100644 engine/strata/apps/host/docs/dsh-recon.md create mode 100644 engine/strata/apps/host/docs/engine-models-onboarding-2026-10-05.md create mode 100644 engine/strata/apps/host/docs/interaction-guidelines.md create mode 100644 engine/strata/apps/host/docs/native-engine-handover.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/01-gamer-debate.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/01-gamer-vote.json create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/01-gamer.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/02-mac-debate.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/02-mac-vote.json create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/02-mac.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/03-teacher-debate.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/03-teacher-vote.json create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/03-teacher.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/04-newcomer-debate.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/04-newcomer-vote.json create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/04-newcomer.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/05-tinkerer-debate.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/05-tinkerer-vote.json create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/05-tinkerer.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/06-parallel-debate.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/06-parallel-vote.json create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/06-parallel.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/07-research-debate.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/07-research-vote.json create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/07-research.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/08-office-debate.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/08-office-vote.json create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/08-office.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/ballot.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/decision-report.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/implementation-verification.md create mode 100644 engine/strata/apps/host/docs/persona-review-2026-10-05/vote-tally.json create mode 100644 engine/strata/apps/host/docs/plans/01-chat.md create mode 100644 engine/strata/apps/host/docs/plans/02-models.md create mode 100644 engine/strata/apps/host/docs/plans/03-engine-tuning.md create mode 100644 engine/strata/apps/host/docs/plans/04-monitor.md create mode 100644 engine/strata/apps/host/docs/plans/05-serving.md create mode 100644 engine/strata/apps/host/docs/plans/06-workspace.md create mode 100644 engine/strata/apps/host/docs/plans/07-skills.md create mode 100644 engine/strata/apps/host/docs/plans/08-settings.md create mode 100644 engine/strata/apps/host/docs/plans/09-first-run.md create mode 100644 engine/strata/apps/host/docs/plans/09-multiple-models.md create mode 100644 engine/strata/apps/host/docs/plans/10-sidebar.md create mode 100644 engine/strata/apps/host/docs/plans/11-command-palette.md create mode 100644 engine/strata/apps/host/docs/plans/12-context-rail.md create mode 100644 engine/strata/apps/host/docs/plans/13-overlays.md create mode 100644 engine/strata/apps/host/docs/plans/14-states.md create mode 100644 engine/strata/apps/host/docs/plans/15-motion.md create mode 100644 engine/strata/apps/host/docs/plans/16-accessibility.md create mode 100644 engine/strata/apps/host/docs/plans/17-local-model-import.md create mode 100644 engine/strata/apps/host/docs/plans/18-native-feature-parity.md create mode 100644 engine/strata/apps/host/docs/plans/INDEX-CHECKLIST.md create mode 100644 engine/strata/apps/host/docs/plans/README.md create mode 100644 engine/strata/apps/host/docs/ui-followup-2026-10-06.md create mode 100644 engine/strata/apps/host/docs/user-feedback-2026-10-05.md create mode 100644 engine/strata/apps/host/docs/user-feedback-2026-10-06.md create mode 100644 engine/strata/apps/host/index.html create mode 100644 engine/strata/apps/host/package-lock.json create mode 100644 engine/strata/apps/host/package.json create mode 100644 engine/strata/apps/host/public/brand/source-manifest.json create mode 100644 engine/strata/apps/host/public/brand/strata-lockup-dark.svg create mode 100644 engine/strata/apps/host/public/brand/strata-lockup-light.svg create mode 100644 engine/strata/apps/host/public/brand/strata-mark-dark.svg create mode 100644 engine/strata/apps/host/public/brand/strata-mark-light.svg create mode 100644 engine/strata/apps/host/public/examples/fieldnotes-cover-revision.svg create mode 100644 engine/strata/apps/host/public/examples/fieldnotes-cover-timeskip.svg create mode 100644 engine/strata/apps/host/public/examples/fieldnotes-cover.svg create mode 100644 engine/strata/apps/host/public/examples/fieldnotes.html create mode 100644 engine/strata/apps/host/public/examples/note-card.ts create mode 100644 engine/strata/apps/host/public/examples/project-brief.md create mode 100644 engine/strata/apps/host/public/examples/release-plan.csv create mode 100644 engine/strata/apps/host/public/favicon.svg create mode 100644 engine/strata/apps/host/public/icons/sprite.svg create mode 100644 engine/strata/apps/host/public/site.webmanifest create mode 100644 engine/strata/apps/host/scripts/agent-flow-s4b.mjs create mode 100644 engine/strata/apps/host/scripts/agent-flow.mjs create mode 100644 engine/strata/apps/host/scripts/agent-http.mjs create mode 100644 engine/strata/apps/host/scripts/agent2-flow.mjs create mode 100644 engine/strata/apps/host/scripts/agent2-tools-flow.mjs create mode 100644 engine/strata/apps/host/scripts/agent3-http.mjs create mode 100644 engine/strata/apps/host/scripts/append-localization.mjs create mode 100644 engine/strata/apps/host/scripts/approval-flow.mjs create mode 100644 engine/strata/apps/host/scripts/assets/make-chat-media.py create mode 100644 engine/strata/apps/host/scripts/audit-ui.mjs create mode 100644 engine/strata/apps/host/scripts/context-e2e.mjs create mode 100644 engine/strata/apps/host/scripts/contrast.mjs create mode 100644 engine/strata/apps/host/scripts/dev.mjs create mode 100644 engine/strata/apps/host/scripts/flow.mjs create mode 100644 engine/strata/apps/host/scripts/flows.mjs create mode 100644 engine/strata/apps/host/scripts/localization-catalog.mjs create mode 100644 engine/strata/apps/host/scripts/localize-ui.mjs create mode 100644 engine/strata/apps/host/scripts/luminance.mjs create mode 100644 engine/strata/apps/host/scripts/make-fix-locales.py create mode 100644 engine/strata/apps/host/scripts/make-tune-locales.py create mode 100644 engine/strata/apps/host/scripts/measure.mjs create mode 100644 engine/strata/apps/host/scripts/mode-flow-s4b.mjs create mode 100644 engine/strata/apps/host/scripts/motion.mjs create mode 100644 engine/strata/apps/host/scripts/motionbudget.mjs create mode 100644 engine/strata/apps/host/scripts/pictures-ui.mjs create mode 100644 engine/strata/apps/host/scripts/prepare-brand-assets.py create mode 100644 engine/strata/apps/host/scripts/preview-ui.mjs create mode 100644 engine/strata/apps/host/scripts/qa2-flows.mjs create mode 100644 engine/strata/apps/host/scripts/shoot.mjs create mode 100644 engine/strata/apps/host/scripts/skills-shot.mjs create mode 100644 engine/strata/apps/host/scripts/slow-proxy.mjs create mode 100644 engine/strata/apps/host/scripts/sync-design-kit.mjs create mode 100644 engine/strata/apps/host/scripts/task-flow-s4b.mjs create mode 100644 engine/strata/apps/host/scripts/test.mjs create mode 100644 engine/strata/apps/host/scripts/tools-shots.mjs create mode 100644 engine/strata/apps/host/scripts/ui-drive.mjs create mode 100644 engine/strata/apps/host/server/acquisition.mjs create mode 100644 engine/strata/apps/host/server/agent/README.md create mode 100644 engine/strata/apps/host/server/agent/agent-bridge.mjs create mode 100644 engine/strata/apps/host/server/agent/ask.mjs create mode 100644 engine/strata/apps/host/server/agent/browser-probe.mjs create mode 100644 engine/strata/apps/host/server/agent/children.mjs create mode 100644 engine/strata/apps/host/server/agent/context-budget.mjs create mode 100644 engine/strata/apps/host/server/agent/context-fit.mjs create mode 100644 engine/strata/apps/host/server/agent/custom-command-run.mjs create mode 100644 engine/strata/apps/host/server/agent/custom-tools-mcp.mjs create mode 100644 engine/strata/apps/host/server/agent/deliverables.mjs create mode 100644 engine/strata/apps/host/server/agent/engine-progress.mjs create mode 100644 engine/strata/apps/host/server/agent/engine-speed.mjs create mode 100644 engine/strata/apps/host/server/agent/events.mjs create mode 100644 engine/strata/apps/host/server/agent/gateway-client.mjs create mode 100644 engine/strata/apps/host/server/agent/harness-runtime.mjs create mode 100644 engine/strata/apps/host/server/agent/llm-shape.mjs create mode 100644 engine/strata/apps/host/server/agent/model-routes.mjs create mode 100644 engine/strata/apps/host/server/agent/plan.mjs create mode 100644 engine/strata/apps/host/server/agent/plugins/strata-context.mjs create mode 100644 engine/strata/apps/host/server/agent/plugins/strata-gate.mjs create mode 100644 engine/strata/apps/host/server/agent/plugins/strata-models.mjs create mode 100644 engine/strata/apps/host/server/agent/plugins/strata-search.mjs create mode 100644 engine/strata/apps/host/server/agent/preset.mjs create mode 100644 engine/strata/apps/host/server/agent/profile.mjs create mode 100644 engine/strata/apps/host/server/agent/skills-used.mjs create mode 100644 engine/strata/apps/host/server/agent/status.mjs create mode 100644 engine/strata/apps/host/server/agent/task-run.mjs create mode 100644 engine/strata/apps/host/server/agent/tools-catalog.mjs create mode 100644 engine/strata/apps/host/server/agent/tools-settings.mjs create mode 100644 engine/strata/apps/host/server/agent/turn-guard.mjs create mode 100644 engine/strata/apps/host/server/api-paths.mjs create mode 100644 engine/strata/apps/host/server/app-ui.mjs create mode 100644 engine/strata/apps/host/server/app-updater.mjs create mode 100644 engine/strata/apps/host/server/app-version.mjs create mode 100644 engine/strata/apps/host/server/artifacts.mjs create mode 100644 engine/strata/apps/host/server/bundled-engine.mjs create mode 100644 engine/strata/apps/host/server/catalog.mjs create mode 100644 engine/strata/apps/host/server/chat-files.mjs create mode 100644 engine/strata/apps/host/server/chat-images.mjs create mode 100644 engine/strata/apps/host/server/chat-uploads.mjs create mode 100644 engine/strata/apps/host/server/cloudflare.mjs create mode 100644 engine/strata/apps/host/server/cloudflared-find.mjs create mode 100644 engine/strata/apps/host/server/cloudflared-install.mjs create mode 100644 engine/strata/apps/host/server/control-runtime.mjs create mode 100644 engine/strata/apps/host/server/device-probes.mjs create mode 100644 engine/strata/apps/host/server/engine-install.mjs create mode 100644 engine/strata/apps/host/server/engine-step.mjs create mode 100644 engine/strata/apps/host/server/engine-version.mjs create mode 100644 engine/strata/apps/host/server/engine.mjs create mode 100644 engine/strata/apps/host/server/external-env.mjs create mode 100644 engine/strata/apps/host/server/folder-dialog.mjs create mode 100644 engine/strata/apps/host/server/fonts.mjs create mode 100644 engine/strata/apps/host/server/gguf.mjs create mode 100644 engine/strata/apps/host/server/gpu-roles.mjs create mode 100644 engine/strata/apps/host/server/hardware.mjs create mode 100644 engine/strata/apps/host/server/host-bootstrap.cjs create mode 100644 engine/strata/apps/host/server/image-catalog.json create mode 100644 engine/strata/apps/host/server/image-models.mjs create mode 100644 engine/strata/apps/host/server/index.mjs create mode 100644 engine/strata/apps/host/server/inference.mjs create mode 100644 engine/strata/apps/host/server/local-models.mjs create mode 100644 engine/strata/apps/host/server/local-share.mjs create mode 100644 engine/strata/apps/host/server/mcp-names.mjs create mode 100644 engine/strata/apps/host/server/missing-files.mjs create mode 100644 engine/strata/apps/host/server/model-directory-default.mjs create mode 100644 engine/strata/apps/host/server/model-files.mjs create mode 100644 engine/strata/apps/host/server/model-folder.mjs create mode 100644 engine/strata/apps/host/server/model-names.mjs create mode 100644 engine/strata/apps/host/server/model-providers.mjs create mode 100644 engine/strata/apps/host/server/models.mjs create mode 100644 engine/strata/apps/host/server/monitor-dashboard.mjs create mode 100644 engine/strata/apps/host/server/monitor.mjs create mode 100644 engine/strata/apps/host/server/native-autotune.mjs create mode 100644 engine/strata/apps/host/server/native-control.mjs create mode 100644 engine/strata/apps/host/server/native-drop.mjs create mode 100644 engine/strata/apps/host/server/native-gateway.mjs create mode 100644 engine/strata/apps/host/server/native-parallel.mjs create mode 100644 engine/strata/apps/host/server/native-resources.mjs create mode 100644 engine/strata/apps/host/server/native-settings.mjs create mode 100644 engine/strata/apps/host/server/native-user-args.mjs create mode 100644 engine/strata/apps/host/server/native-vision.mjs create mode 100644 engine/strata/apps/host/server/no-model-text.mjs create mode 100644 engine/strata/apps/host/server/open-text-file.mjs create mode 100644 engine/strata/apps/host/server/oversize.mjs create mode 100644 engine/strata/apps/host/server/platform-paths.mjs create mode 100644 engine/strata/apps/host/server/ports.mjs create mode 100644 engine/strata/apps/host/server/powershell-utf8.mjs create mode 100644 engine/strata/apps/host/server/private-file.mjs create mode 100644 engine/strata/apps/host/server/python-resolver.mjs create mode 100644 engine/strata/apps/host/server/real-model-catalog.mjs create mode 100644 engine/strata/apps/host/server/request-queue.mjs create mode 100644 engine/strata/apps/host/server/run-config-check.mjs create mode 100644 engine/strata/apps/host/server/runtime-models.mjs create mode 100644 engine/strata/apps/host/server/serving.mjs create mode 100644 engine/strata/apps/host/server/setup.mjs create mode 100644 engine/strata/apps/host/server/skill-edits.mjs create mode 100644 engine/strata/apps/host/server/skill-files.mjs create mode 100644 engine/strata/apps/host/server/skill-selection.mjs create mode 100644 engine/strata/apps/host/server/snapshot.mjs create mode 100644 engine/strata/apps/host/server/storage-check.mjs create mode 100644 engine/strata/apps/host/server/store.mjs create mode 100644 engine/strata/apps/host/server/supervisor.mjs create mode 100644 engine/strata/apps/host/server/system-ca.mjs create mode 100644 engine/strata/apps/host/server/system-telemetry.mjs create mode 100644 engine/strata/apps/host/server/task-report.mjs create mode 100644 engine/strata/apps/host/server/tasks.mjs create mode 100644 engine/strata/apps/host/server/timeskip-fork.mjs create mode 100644 engine/strata/apps/host/server/timeskip-revise.mjs create mode 100644 engine/strata/apps/host/server/timeskip.mjs create mode 100644 engine/strata/apps/host/server/update-messages.mjs create mode 100644 engine/strata/apps/host/server/updates.mjs create mode 100644 engine/strata/apps/host/server/util.mjs create mode 100644 engine/strata/apps/host/server/vision-probe.mjs create mode 100644 engine/strata/apps/host/server/web-search-bing.mjs create mode 100644 engine/strata/apps/host/server/web-search-ddg.mjs create mode 100644 engine/strata/apps/host/server/web-search-keyed.mjs create mode 100644 engine/strata/apps/host/server/windows-gpu.mjs create mode 100644 engine/strata/apps/host/server/windows-poll.mjs create mode 100644 engine/strata/apps/host/src/app/App.tsx create mode 100644 engine/strata/apps/host/src/app/CommandPalette.tsx create mode 100644 engine/strata/apps/host/src/app/ContextPanel.tsx create mode 100644 engine/strata/apps/host/src/app/SamplingDrawer.tsx create mode 100644 engine/strata/apps/host/src/app/Shortcuts.tsx create mode 100644 engine/strata/apps/host/src/app/Sidebar.tsx create mode 100644 engine/strata/apps/host/src/app/TaskTree.tsx create mode 100644 engine/strata/apps/host/src/assets/icons/README.md create mode 100644 engine/strata/apps/host/src/assets/icons/engine.svg create mode 100644 engine/strata/apps/host/src/assets/icons/family-qwen.svg create mode 100644 engine/strata/apps/host/src/assets/icons/model-file.svg create mode 100644 engine/strata/apps/host/src/assets/icons/models.svg create mode 100644 engine/strata/apps/host/src/assets/icons/skills.svg create mode 100644 engine/strata/apps/host/src/components/ArtifactCard.tsx create mode 100644 engine/strata/apps/host/src/components/ArtifactPanel.tsx create mode 100644 engine/strata/apps/host/src/components/AutoTune.tsx create mode 100644 engine/strata/apps/host/src/components/Brand.tsx create mode 100644 engine/strata/apps/host/src/components/ChatMedia.tsx create mode 100644 engine/strata/apps/host/src/components/ChatModelPicker.tsx create mode 100644 engine/strata/apps/host/src/components/ChatPhotos.tsx create mode 100644 engine/strata/apps/host/src/components/ChatToolbar.tsx create mode 100644 engine/strata/apps/host/src/components/CloudflareDialog.tsx create mode 100644 engine/strata/apps/host/src/components/ComposerControls.tsx create mode 100644 engine/strata/apps/host/src/components/ContextRing.tsx create mode 100644 engine/strata/apps/host/src/components/DecimalInput.tsx create mode 100644 engine/strata/apps/host/src/components/Deliverables.tsx create mode 100644 engine/strata/apps/host/src/components/DictationControl.tsx create mode 100644 engine/strata/apps/host/src/components/DownloadParts.tsx create mode 100644 engine/strata/apps/host/src/components/DropZone.tsx create mode 100644 engine/strata/apps/host/src/components/EngineExperience.tsx create mode 100644 engine/strata/apps/host/src/components/EngineFirstRun.tsx create mode 100644 engine/strata/apps/host/src/components/EngineWarning.tsx create mode 100644 engine/strata/apps/host/src/components/FamilySwitch.tsx create mode 100644 engine/strata/apps/host/src/components/FloatingMenu.tsx create mode 100644 engine/strata/apps/host/src/components/FolderChip.tsx create mode 100644 engine/strata/apps/host/src/components/FolderPathDialog.tsx create mode 100644 engine/strata/apps/host/src/components/FontChoice.tsx create mode 100644 engine/strata/apps/host/src/components/GoalBar.tsx create mode 100644 engine/strata/apps/host/src/components/GpuRoles.tsx create mode 100644 engine/strata/apps/host/src/components/GuidedSetup.tsx create mode 100644 engine/strata/apps/host/src/components/LifecycleNotice.tsx create mode 100644 engine/strata/apps/host/src/components/LocalModelImport.tsx create mode 100644 engine/strata/apps/host/src/components/ManagedModelLibrary.tsx create mode 100644 engine/strata/apps/host/src/components/Markdown.tsx create mode 100644 engine/strata/apps/host/src/components/MathView.tsx create mode 100644 engine/strata/apps/host/src/components/ModelsFolderDialog.tsx create mode 100644 engine/strata/apps/host/src/components/NativeDelete.tsx create mode 100644 engine/strata/apps/host/src/components/NativeLocalModel.tsx create mode 100644 engine/strata/apps/host/src/components/NativeMcpEditor.tsx create mode 100644 engine/strata/apps/host/src/components/NativeModels.tsx create mode 100644 engine/strata/apps/host/src/components/NativeMonitor.tsx create mode 100644 engine/strata/apps/host/src/components/NativeOperations.tsx create mode 100644 engine/strata/apps/host/src/components/NativePresets.tsx create mode 100644 engine/strata/apps/host/src/components/NativeSettings.tsx create mode 100644 engine/strata/apps/host/src/components/NativeSettingsFile.tsx create mode 100644 engine/strata/apps/host/src/components/NativeTune.tsx create mode 100644 engine/strata/apps/host/src/components/NativeTuneBadge.tsx create mode 100644 engine/strata/apps/host/src/components/Num.tsx create mode 100644 engine/strata/apps/host/src/components/OnboardingArt.tsx create mode 100644 engine/strata/apps/host/src/components/OnboardingCheckbox.tsx create mode 100644 engine/strata/apps/host/src/components/OnboardingMemory.tsx create mode 100644 engine/strata/apps/host/src/components/OnboardingResources.tsx create mode 100644 engine/strata/apps/host/src/components/PcFitCard.tsx create mode 100644 engine/strata/apps/host/src/components/PdfPreview.tsx create mode 100644 engine/strata/apps/host/src/components/PlanCard.tsx create mode 100644 engine/strata/apps/host/src/components/Popover.tsx create mode 100644 engine/strata/apps/host/src/components/PreviewControls.tsx create mode 100644 engine/strata/apps/host/src/components/PreviewResizeHandle.tsx create mode 100644 engine/strata/apps/host/src/components/PrivacyNotes.tsx create mode 100644 engine/strata/apps/host/src/components/QuitStrata.tsx create mode 100644 engine/strata/apps/host/src/components/ReasoningBlock.tsx create mode 100644 engine/strata/apps/host/src/components/RunExpertEditor.tsx create mode 100644 engine/strata/apps/host/src/components/RunImageModel.tsx create mode 100644 engine/strata/apps/host/src/components/RunPreview.tsx create mode 100644 engine/strata/apps/host/src/components/RunningModels.tsx create mode 100644 engine/strata/apps/host/src/components/SettingsModels.tsx create mode 100644 engine/strata/apps/host/src/components/SettingsStorage.tsx create mode 100644 engine/strata/apps/host/src/components/SettingsTools.tsx create mode 100644 engine/strata/apps/host/src/components/SettingsUpdates.tsx create mode 100644 engine/strata/apps/host/src/components/SnapshotDialog.tsx create mode 100644 engine/strata/apps/host/src/components/StatusLine.tsx create mode 100644 engine/strata/apps/host/src/components/SubagentRow.tsx create mode 100644 engine/strata/apps/host/src/components/SyntaxCode.tsx create mode 100644 engine/strata/apps/host/src/components/TablePreview.tsx create mode 100644 engine/strata/apps/host/src/components/TaskBoard.tsx create mode 100644 engine/strata/apps/host/src/components/TaskDetail.tsx create mode 100644 engine/strata/apps/host/src/components/TaskEditor.tsx create mode 100644 engine/strata/apps/host/src/components/TelemetryPopover.tsx create mode 100644 engine/strata/apps/host/src/components/TimeSkipCompare.tsx create mode 100644 engine/strata/apps/host/src/components/TimeSkipPanel.tsx create mode 100644 engine/strata/apps/host/src/components/TimeSkipWorking.tsx create mode 100644 engine/strata/apps/host/src/components/TuneRunView.tsx create mode 100644 engine/strata/apps/host/src/components/UsageDashboard.tsx create mode 100644 engine/strata/apps/host/src/components/VersionLadder.tsx create mode 100644 engine/strata/apps/host/src/components/VersionMemoryTooltip.tsx create mode 100644 engine/strata/apps/host/src/components/VersionPicker.tsx create mode 100644 engine/strata/apps/host/src/components/charts.tsx create mode 100644 engine/strata/apps/host/src/components/layout.tsx create mode 100644 engine/strata/apps/host/src/components/ui.tsx create mode 100644 engine/strata/apps/host/src/lib/agents.ts create mode 100644 engine/strata/apps/host/src/lib/answer-text.ts create mode 100644 engine/strata/apps/host/src/lib/app-mode.ts create mode 100644 engine/strata/apps/host/src/lib/app-version.ts create mode 100644 engine/strata/apps/host/src/lib/artifacts.ts create mode 100644 engine/strata/apps/host/src/lib/ask.ts create mode 100644 engine/strata/apps/host/src/lib/board.ts create mode 100644 engine/strata/apps/host/src/lib/chat-attach-file.ts create mode 100644 engine/strata/apps/host/src/lib/chat-folder.ts create mode 100644 engine/strata/apps/host/src/lib/chat-metrics.ts create mode 100644 engine/strata/apps/host/src/lib/chat-photos.ts create mode 100644 engine/strata/apps/host/src/lib/chat-showcase.ts create mode 100644 engine/strata/apps/host/src/lib/client.ts create mode 100644 engine/strata/apps/host/src/lib/clipboard.ts create mode 100644 engine/strata/apps/host/src/lib/commands.ts create mode 100644 engine/strata/apps/host/src/lib/config.ts create mode 100644 engine/strata/apps/host/src/lib/connect-urls.ts create mode 100644 engine/strata/apps/host/src/lib/context-recovery.ts create mode 100644 engine/strata/apps/host/src/lib/decimal.ts create mode 100644 engine/strata/apps/host/src/lib/deepseek-speed.ts create mode 100644 engine/strata/apps/host/src/lib/deliverables.ts create mode 100644 engine/strata/apps/host/src/lib/dictation.ts create mode 100644 engine/strata/apps/host/src/lib/download-eta.ts create mode 100644 engine/strata/apps/host/src/lib/drafting.ts create mode 100644 engine/strata/apps/host/src/lib/engine-setup.ts create mode 100644 engine/strata/apps/host/src/lib/experience.ts create mode 100644 engine/strata/apps/host/src/lib/features.ts create mode 100644 engine/strata/apps/host/src/lib/focus.ts create mode 100644 engine/strata/apps/host/src/lib/folder-pick.ts create mode 100644 engine/strata/apps/host/src/lib/format.ts create mode 100644 engine/strata/apps/host/src/lib/fuzzy.ts create mode 100644 engine/strata/apps/host/src/lib/goal.ts create mode 100644 engine/strata/apps/host/src/lib/gpu-roles.ts create mode 100644 engine/strata/apps/host/src/lib/hardware-summary.ts create mode 100644 engine/strata/apps/host/src/lib/i18n.ts create mode 100644 engine/strata/apps/host/src/lib/kept-state.ts create mode 100644 engine/strata/apps/host/src/lib/lifecycle.ts create mode 100644 engine/strata/apps/host/src/lib/live-status.ts create mode 100644 engine/strata/apps/host/src/lib/loop-runner.ts create mode 100644 engine/strata/apps/host/src/lib/loop.ts create mode 100644 engine/strata/apps/host/src/lib/markdown-images.ts create mode 100644 engine/strata/apps/host/src/lib/math.ts create mode 100644 engine/strata/apps/host/src/lib/mcp-names.ts create mode 100644 engine/strata/apps/host/src/lib/model-icons.ts create mode 100644 engine/strata/apps/host/src/lib/model-picker.ts create mode 100644 engine/strata/apps/host/src/lib/model-versions.ts create mode 100644 engine/strata/apps/host/src/lib/monitor-chart.ts create mode 100644 engine/strata/apps/host/src/lib/monitor-hardware.ts create mode 100644 engine/strata/apps/host/src/lib/monitor-summary.ts create mode 100644 engine/strata/apps/host/src/lib/native-catalog.ts create mode 100644 engine/strata/apps/host/src/lib/native-drop.ts create mode 100644 engine/strata/apps/host/src/lib/native-fit.ts create mode 100644 engine/strata/apps/host/src/lib/native-job-diagnostics.ts create mode 100644 engine/strata/apps/host/src/lib/native-monitor.ts create mode 100644 engine/strata/apps/host/src/lib/native-names.ts create mode 100644 engine/strata/apps/host/src/lib/native-settings-response.ts create mode 100644 engine/strata/apps/host/src/lib/native-tune.ts create mode 100644 engine/strata/apps/host/src/lib/native.ts create mode 100644 engine/strata/apps/host/src/lib/no-model.ts create mode 100644 engine/strata/apps/host/src/lib/number-field.ts create mode 100644 engine/strata/apps/host/src/lib/onboarding-download.ts create mode 100644 engine/strata/apps/host/src/lib/pasted-files.ts create mode 100644 engine/strata/apps/host/src/lib/pictures.ts create mode 100644 engine/strata/apps/host/src/lib/plain-errors.ts create mode 100644 engine/strata/apps/host/src/lib/plan.ts create mode 100644 engine/strata/apps/host/src/lib/preview-layout.ts create mode 100644 engine/strata/apps/host/src/lib/preview-tabs.ts create mode 100644 engine/strata/apps/host/src/lib/reasoning.ts create mode 100644 engine/strata/apps/host/src/lib/recent-chats.ts create mode 100644 engine/strata/apps/host/src/lib/responsive.ts create mode 100644 engine/strata/apps/host/src/lib/router.ts create mode 100644 engine/strata/apps/host/src/lib/run-config-issues.ts create mode 100644 engine/strata/apps/host/src/lib/run-memory.ts create mode 100644 engine/strata/apps/host/src/lib/run-profiles.ts create mode 100644 engine/strata/apps/host/src/lib/runtime-models.ts create mode 100644 engine/strata/apps/host/src/lib/serving-state.ts create mode 100644 engine/strata/apps/host/src/lib/session-log.ts create mode 100644 engine/strata/apps/host/src/lib/session-persist.ts create mode 100644 engine/strata/apps/host/src/lib/session-title.ts create mode 100644 engine/strata/apps/host/src/lib/session-workspace.ts create mode 100644 engine/strata/apps/host/src/lib/shortcut-bindings.ts create mode 100644 engine/strata/apps/host/src/lib/snapshot.ts create mode 100644 engine/strata/apps/host/src/lib/store.ts create mode 100644 engine/strata/apps/host/src/lib/syntax.ts create mode 100644 engine/strata/apps/host/src/lib/task-handover.ts create mode 100644 engine/strata/apps/host/src/lib/tasks.ts create mode 100644 engine/strata/apps/host/src/lib/time-skip-activity.ts create mode 100644 engine/strata/apps/host/src/lib/time-skip-compare.ts create mode 100644 engine/strata/apps/host/src/lib/time-skip.ts create mode 100644 engine/strata/apps/host/src/lib/tune-outcome.ts create mode 100644 engine/strata/apps/host/src/lib/tune-phase.ts create mode 100644 engine/strata/apps/host/src/lib/tune-values.ts create mode 100644 engine/strata/apps/host/src/lib/tuning-controls.ts create mode 100644 engine/strata/apps/host/src/lib/tween.ts create mode 100644 engine/strata/apps/host/src/lib/types.ts create mode 100644 engine/strata/apps/host/src/lib/update-cache.ts create mode 100644 engine/strata/apps/host/src/lib/update-check.ts create mode 100644 engine/strata/apps/host/src/lib/usage-dashboard.ts create mode 100644 engine/strata/apps/host/src/lib/use-board.ts create mode 100644 engine/strata/apps/host/src/locales/de.json create mode 100644 engine/strata/apps/host/src/locales/en.json create mode 100644 engine/strata/apps/host/src/locales/es.json create mode 100644 engine/strata/apps/host/src/locales/fix-de.json create mode 100644 engine/strata/apps/host/src/locales/fix-en.json create mode 100644 engine/strata/apps/host/src/locales/fix-es.json create mode 100644 engine/strata/apps/host/src/locales/fix-ja.json create mode 100644 engine/strata/apps/host/src/locales/fix-ko.json create mode 100644 engine/strata/apps/host/src/locales/fix-pt.json create mode 100644 engine/strata/apps/host/src/locales/fix-ru.json create mode 100644 engine/strata/apps/host/src/locales/fix-zh.json create mode 100644 engine/strata/apps/host/src/locales/ja.json create mode 100644 engine/strata/apps/host/src/locales/ko.json create mode 100644 engine/strata/apps/host/src/locales/pt.json create mode 100644 engine/strata/apps/host/src/locales/ru.json create mode 100644 engine/strata/apps/host/src/locales/tools-de.json create mode 100644 engine/strata/apps/host/src/locales/tools-en.json create mode 100644 engine/strata/apps/host/src/locales/tools-es.json create mode 100644 engine/strata/apps/host/src/locales/tools-ja.json create mode 100644 engine/strata/apps/host/src/locales/tools-ko.json create mode 100644 engine/strata/apps/host/src/locales/tools-pt.json create mode 100644 engine/strata/apps/host/src/locales/tools-ru.json create mode 100644 engine/strata/apps/host/src/locales/tools-zh.json create mode 100644 engine/strata/apps/host/src/locales/tune-de.json create mode 100644 engine/strata/apps/host/src/locales/tune-en.json create mode 100644 engine/strata/apps/host/src/locales/tune-es.json create mode 100644 engine/strata/apps/host/src/locales/tune-ja.json create mode 100644 engine/strata/apps/host/src/locales/tune-ko.json create mode 100644 engine/strata/apps/host/src/locales/tune-pt.json create mode 100644 engine/strata/apps/host/src/locales/tune-ru.json create mode 100644 engine/strata/apps/host/src/locales/tune-zh.json create mode 100644 engine/strata/apps/host/src/locales/zh.json create mode 100644 engine/strata/apps/host/src/main.tsx create mode 100644 engine/strata/apps/host/src/screens/Chat.tsx create mode 100644 engine/strata/apps/host/src/screens/ModelRun.tsx create mode 100644 engine/strata/apps/host/src/screens/Models.tsx create mode 100644 engine/strata/apps/host/src/screens/Monitor.tsx create mode 100644 engine/strata/apps/host/src/screens/Serving.tsx create mode 100644 engine/strata/apps/host/src/screens/Settings.tsx create mode 100644 engine/strata/apps/host/src/screens/Setup.tsx create mode 100644 engine/strata/apps/host/src/screens/Skills.tsx create mode 100644 engine/strata/apps/host/src/screens/Tasks.tsx create mode 100644 engine/strata/apps/host/src/screens/Tuning.tsx create mode 100644 engine/strata/apps/host/src/styles/annotation-fixes.css create mode 100644 engine/strata/apps/host/src/styles/app.css create mode 100644 engine/strata/apps/host/src/styles/board.css create mode 100644 engine/strata/apps/host/src/styles/gpu-roles.css create mode 100644 engine/strata/apps/host/src/styles/kit/components.css create mode 100644 engine/strata/apps/host/src/styles/kit/tokens.css create mode 100644 engine/strata/apps/host/src/styles/model-run.css create mode 100644 engine/strata/apps/host/src/styles/monitor.css create mode 100644 engine/strata/apps/host/src/styles/onboarding.css create mode 100644 engine/strata/apps/host/src/styles/time-skip.css create mode 100644 engine/strata/apps/host/tests/agent-bridge.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-children.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-compaction.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-context.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-deliverables.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-events.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-host.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-modes.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-plan-run.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-plan.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-shape.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-skills.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-status.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-subagent-models.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-tasks.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-tools-settings.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-tools.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-turn-guard.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-updates.test.mjs create mode 100644 engine/strata/apps/host/tests/agent-watchdog.test.mjs create mode 100644 engine/strata/apps/host/tests/annotations-32.test.mjs create mode 100644 engine/strata/apps/host/tests/answer-speed.test.mjs create mode 100644 engine/strata/apps/host/tests/answer-text.test.mjs create mode 100644 engine/strata/apps/host/tests/app-ui.test.mjs create mode 100644 engine/strata/apps/host/tests/app-version.test.mjs create mode 100644 engine/strata/apps/host/tests/ask.test.mjs create mode 100644 engine/strata/apps/host/tests/audit-fixes.test.mjs create mode 100644 engine/strata/apps/host/tests/board.test.mjs create mode 100644 engine/strata/apps/host/tests/bundled-engine.test.mjs create mode 100644 engine/strata/apps/host/tests/card-labels.test.mjs create mode 100644 engine/strata/apps/host/tests/chat-attach-file.test.mjs create mode 100644 engine/strata/apps/host/tests/chat-files-preview.test.mjs create mode 100644 engine/strata/apps/host/tests/chat-files.test.mjs create mode 100644 engine/strata/apps/host/tests/chat-image-context.test.mjs create mode 100644 engine/strata/apps/host/tests/chat-shell.test.mjs create mode 100644 engine/strata/apps/host/tests/chat-shortcuts.test.mjs create mode 100644 engine/strata/apps/host/tests/chat-speed.test.mjs create mode 100644 engine/strata/apps/host/tests/chat-uploads.test.mjs create mode 100644 engine/strata/apps/host/tests/clipboard-copy.test.mjs create mode 100644 engine/strata/apps/host/tests/cloudflared-find.test.mjs create mode 100644 engine/strata/apps/host/tests/component-updates.test.mjs create mode 100644 engine/strata/apps/host/tests/connect-urls.test.mjs create mode 100644 engine/strata/apps/host/tests/connector-setup.test.mjs create mode 100644 engine/strata/apps/host/tests/context-ui.test.mjs create mode 100644 engine/strata/apps/host/tests/cors-help.test.mjs create mode 100644 engine/strata/apps/host/tests/custom-command-tools.test.mjs create mode 100644 engine/strata/apps/host/tests/deepseek-speed.test.mjs create mode 100644 engine/strata/apps/host/tests/developer-previews.test.mjs create mode 100644 engine/strata/apps/host/tests/dictation.test.mjs create mode 100644 engine/strata/apps/host/tests/download-eta.test.mjs create mode 100644 engine/strata/apps/host/tests/draft-layer.test.mjs create mode 100644 engine/strata/apps/host/tests/drafting.test.mjs create mode 100644 engine/strata/apps/host/tests/engine-progress.test.mjs create mode 100644 engine/strata/apps/host/tests/engine-step.test.mjs create mode 100644 engine/strata/apps/host/tests/engine-version.test.mjs create mode 100644 engine/strata/apps/host/tests/experience.test.mjs create mode 100644 engine/strata/apps/host/tests/external-env.test.mjs create mode 100644 engine/strata/apps/host/tests/feedback-controls.test.mjs create mode 100644 engine/strata/apps/host/tests/fixtures/bing-results.html create mode 100644 engine/strata/apps/host/tests/fixtures/mock-two-gpu.mjs create mode 100644 engine/strata/apps/host/tests/fixtures/monitor-host.mjs create mode 100644 engine/strata/apps/host/tests/fixtures/native-ui-host.mjs create mode 100644 engine/strata/apps/host/tests/fixtures/onboarding-export.js create mode 100644 engine/strata/apps/host/tests/fixtures/onboarding-ui-host.mjs create mode 100644 engine/strata/apps/host/tests/fixtures/tune-ui-host.mjs create mode 100644 engine/strata/apps/host/tests/fixtures/ui-preview-native.json create mode 100644 engine/strata/apps/host/tests/folder-dialog.test.mjs create mode 100644 engine/strata/apps/host/tests/followup-ui.test.mjs create mode 100644 engine/strata/apps/host/tests/functional-fixes.test.mjs create mode 100644 engine/strata/apps/host/tests/gate-fail-closed.test.mjs create mode 100644 engine/strata/apps/host/tests/gpu-roles.test.mjs create mode 100644 engine/strata/apps/host/tests/guided-setup-empty-catalog.test.mjs create mode 100644 engine/strata/apps/host/tests/harness-staging.test.mjs create mode 100644 engine/strata/apps/host/tests/helpers/acquire-spy.mjs create mode 100644 engine/strata/apps/host/tests/helpers/assert-private.mjs create mode 100644 engine/strata/apps/host/tests/helpers/hardware.mjs create mode 100644 engine/strata/apps/host/tests/helpers/isolate-profile.mjs create mode 100644 engine/strata/apps/host/tests/helpers/local-gguf.mjs create mode 100644 engine/strata/apps/host/tests/helpers/mini-mcp.mjs create mode 100644 engine/strata/apps/host/tests/helpers/native-fixture.mjs create mode 100644 engine/strata/apps/host/tests/helpers/offline-preload.mjs create mode 100644 engine/strata/apps/host/tests/helpers/react-stub.mjs create mode 100644 engine/strata/apps/host/tests/helpers/scripted-worker.mjs create mode 100644 engine/strata/apps/host/tests/host-lifecycle.test.mjs create mode 100644 engine/strata/apps/host/tests/host-ports.test.mjs create mode 100644 engine/strata/apps/host/tests/image-models.test.mjs create mode 100644 engine/strata/apps/host/tests/inference-line.test.mjs create mode 100644 engine/strata/apps/host/tests/keyless-share.test.mjs create mode 100644 engine/strata/apps/host/tests/language-preferences.test.mjs create mode 100644 engine/strata/apps/host/tests/languages-and-catalog.test.mjs create mode 100644 engine/strata/apps/host/tests/live-chat.test.mjs create mode 100644 engine/strata/apps/host/tests/local-models.test.mjs create mode 100644 engine/strata/apps/host/tests/locale-gaps.test.mjs create mode 100644 engine/strata/apps/host/tests/loop-stop.test.mjs create mode 100644 engine/strata/apps/host/tests/markdown-images.test.mjs create mode 100644 engine/strata/apps/host/tests/markdown-soft-breaks.test.mjs create mode 100644 engine/strata/apps/host/tests/math.test.mjs create mode 100644 engine/strata/apps/host/tests/mcp-rows.test.mjs create mode 100644 engine/strata/apps/host/tests/mock-model-api.mjs create mode 100644 engine/strata/apps/host/tests/model-directory-default.test.mjs create mode 100644 engine/strata/apps/host/tests/model-directory.test.mjs create mode 100644 engine/strata/apps/host/tests/model-folder.test.mjs create mode 100644 engine/strata/apps/host/tests/model-picker.test.mjs create mode 100644 engine/strata/apps/host/tests/model-providers.test.mjs create mode 100644 engine/strata/apps/host/tests/model-run.test.mjs create mode 100644 engine/strata/apps/host/tests/model-storage.test.mjs create mode 100644 engine/strata/apps/host/tests/models-directory-fallback.test.mjs create mode 100644 engine/strata/apps/host/tests/models-folder.test.mjs create mode 100644 engine/strata/apps/host/tests/models-list-refused.test.mjs create mode 100644 engine/strata/apps/host/tests/monitor-dashboard.test.mjs create mode 100644 engine/strata/apps/host/tests/monitor-host-sensors.test.mjs create mode 100644 engine/strata/apps/host/tests/native-autotune.test.mjs create mode 100644 engine/strata/apps/host/tests/native-chat.test.mjs create mode 100644 engine/strata/apps/host/tests/native-control.test.mjs create mode 100644 engine/strata/apps/host/tests/native-fb5.test.mjs create mode 100644 engine/strata/apps/host/tests/native-fit.test.mjs create mode 100644 engine/strata/apps/host/tests/native-gateway.test.mjs create mode 100644 engine/strata/apps/host/tests/native-gpu-choice.test.mjs create mode 100644 engine/strata/apps/host/tests/native-gpu-roles.test.mjs create mode 100644 engine/strata/apps/host/tests/native-job-diagnostics.test.mjs create mode 100644 engine/strata/apps/host/tests/native-monitor-projection.test.mjs create mode 100644 engine/strata/apps/host/tests/native-onboarding.test.mjs create mode 100644 engine/strata/apps/host/tests/native-settings-file.test.mjs create mode 100644 engine/strata/apps/host/tests/native-settings-response.test.mjs create mode 100644 engine/strata/apps/host/tests/native-settings.test.mjs create mode 100644 engine/strata/apps/host/tests/native-settled.test.mjs create mode 100644 engine/strata/apps/host/tests/native-two-models.test.mjs create mode 100644 engine/strata/apps/host/tests/no-acquire.test.mjs create mode 100644 engine/strata/apps/host/tests/no-model-chat.test.mjs create mode 100644 engine/strata/apps/host/tests/offline-start.test.mjs create mode 100644 engine/strata/apps/host/tests/onboarding-download.test.mjs create mode 100644 engine/strata/apps/host/tests/onboarding-memory.test.mjs create mode 100644 engine/strata/apps/host/tests/openrouter-reasoning.test.mjs create mode 100644 engine/strata/apps/host/tests/oversize.test.mjs create mode 100644 engine/strata/apps/host/tests/packaged-control.test.mjs create mode 100644 engine/strata/apps/host/tests/parallel-default.test.mjs create mode 100644 engine/strata/apps/host/tests/pictures-status.test.mjs create mode 100644 engine/strata/apps/host/tests/plain-errors.test.mjs create mode 100644 engine/strata/apps/host/tests/platform-paths.test.mjs create mode 100644 engine/strata/apps/host/tests/powershell-utf8.test.mjs create mode 100644 engine/strata/apps/host/tests/python-resolver.test.mjs create mode 100644 engine/strata/apps/host/tests/qa1-downloads.test.mjs create mode 100644 engine/strata/apps/host/tests/qa1-storage.test.mjs create mode 100644 engine/strata/apps/host/tests/recent-chats.test.mjs create mode 100644 engine/strata/apps/host/tests/reliability.test.mjs create mode 100644 engine/strata/apps/host/tests/request-flow.test.mjs create mode 100644 engine/strata/apps/host/tests/resource-ram.test.mjs create mode 100644 engine/strata/apps/host/tests/router-view-transition.test.mjs create mode 100644 engine/strata/apps/host/tests/run-config-check.test.mjs create mode 100644 engine/strata/apps/host/tests/runtime-api.test.mjs create mode 100644 engine/strata/apps/host/tests/runtime-models.test.mjs create mode 100644 engine/strata/apps/host/tests/serving-key-optional.test.mjs create mode 100644 engine/strata/apps/host/tests/session-persist.test.mjs create mode 100644 engine/strata/apps/host/tests/session-workspace.test.mjs create mode 100644 engine/strata/apps/host/tests/settings-overlay.test.mjs create mode 100644 engine/strata/apps/host/tests/simplification.test.mjs create mode 100644 engine/strata/apps/host/tests/size-label.test.mjs create mode 100644 engine/strata/apps/host/tests/skills-used.test.mjs create mode 100644 engine/strata/apps/host/tests/slash-commands.test.mjs create mode 100644 engine/strata/apps/host/tests/split-qa2-dialogs.test.mjs create mode 100644 engine/strata/apps/host/tests/split-qa2-drop.test.mjs create mode 100644 engine/strata/apps/host/tests/split-qa2-fields.test.mjs create mode 100644 engine/strata/apps/host/tests/split-qa2-skills.test.mjs create mode 100644 engine/strata/apps/host/tests/split-qa2b-export.test.mjs create mode 100644 engine/strata/apps/host/tests/split-qa2c-export.test.mjs create mode 100644 engine/strata/apps/host/tests/split-qa2c-linux-drop.test.mjs create mode 100644 engine/strata/apps/host/tests/staging-scripts-syntax.test.mjs create mode 100644 engine/strata/apps/host/tests/stream-framing.test.mjs create mode 100644 engine/strata/apps/host/tests/stream-speed.test.mjs create mode 100644 engine/strata/apps/host/tests/system-ca.test.mjs create mode 100644 engine/strata/apps/host/tests/system-fonts.test.mjs create mode 100644 engine/strata/apps/host/tests/task-handover.test.mjs create mode 100644 engine/strata/apps/host/tests/tasks-and-sharing.test.mjs create mode 100644 engine/strata/apps/host/tests/thinking-direct.test.mjs create mode 100644 engine/strata/apps/host/tests/time-skip-compare.test.mjs create mode 100644 engine/strata/apps/host/tests/time-skip.test.mjs create mode 100644 engine/strata/apps/host/tests/timeskip-compare-server.test.mjs create mode 100644 engine/strata/apps/host/tests/timeskip-fork.test.mjs create mode 100644 engine/strata/apps/host/tests/timeskip-real.test.mjs create mode 100644 engine/strata/apps/host/tests/tool-rows.test.mjs create mode 100644 engine/strata/apps/host/tests/tools-locales.test.mjs create mode 100644 engine/strata/apps/host/tests/tune-and-timeskip-routes.test.mjs create mode 100644 engine/strata/apps/host/tests/tune-locales.test.mjs create mode 100644 engine/strata/apps/host/tests/tune-outcome.test.mjs create mode 100644 engine/strata/apps/host/tests/tune-phase.test.mjs create mode 100644 engine/strata/apps/host/tests/typed-and-pasted.test.mjs create mode 100644 engine/strata/apps/host/tests/ui-fixture-host.mjs create mode 100644 engine/strata/apps/host/tests/ui4-fixes.test.mjs create mode 100644 engine/strata/apps/host/tests/ui5-live.test.mjs create mode 100644 engine/strata/apps/host/tests/ui5-plan.test.mjs create mode 100644 engine/strata/apps/host/tests/ui6-deliverables.test.mjs create mode 100644 engine/strata/apps/host/tests/ui6-fork.test.mjs create mode 100644 engine/strata/apps/host/tests/update-cache.test.mjs create mode 100644 engine/strata/apps/host/tests/updates.test.mjs create mode 100644 engine/strata/apps/host/tests/user-args.test.mjs create mode 100644 engine/strata/apps/host/tests/vision-probe.test.mjs create mode 100644 engine/strata/apps/host/tests/web-ask.test.mjs create mode 100644 engine/strata/apps/host/tests/web-offline.test.mjs create mode 100644 engine/strata/apps/host/tests/web-search.test.mjs create mode 100644 engine/strata/apps/host/tests/webkitgtk-view-transitions.test.mjs create mode 100644 engine/strata/apps/host/tests/windows-disk-reader.test.mjs create mode 100644 engine/strata/apps/host/tests/windows-gpu.test.mjs create mode 100644 engine/strata/apps/host/tests/workspaces.test.mjs create mode 100644 engine/strata/apps/host/tsconfig.json create mode 100644 engine/strata/apps/host/vite.config.ts create mode 100755 engine/strata/bench.sh create mode 100644 engine/strata/bench/bench_vs_llama.py create mode 100644 engine/strata/bench/gdn_chunk_bench.cpp create mode 100644 engine/strata/bench/gfx906_qsa_query_swizzle_probe.cpp create mode 100644 engine/strata/bench/micro/cuda_callback_affinity.cpp create mode 100644 engine/strata/bench/micro/fusions_parity.cu create mode 100644 engine/strata/bench/profile_corpus.json create mode 100644 engine/strata/bench/prompts/standard-v1/MANIFEST.sha256 create mode 100644 engine/strata/bench/prompts/standard-v1/build.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/concurrency-r1-c1.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/concurrency-r1-c2.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/concurrency-r1-c3.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/concurrency-r1-c4.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/concurrency-r2-c1.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/concurrency-r2-c2.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/concurrency-r2-c3.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/concurrency-r2-c4.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/concurrency-r3-c1.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/concurrency-r3-c2.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/concurrency-r3-c3.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/concurrency-r3-c4.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/performance-prompt-16k-r1.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/performance-prompt-16k-r2.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/performance-prompt-16k-r3.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/performance-prompt-4k-r1.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/performance-prompt-4k-r2.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/performance-prompt-4k-r3.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/performance-short-r1.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/performance-short-r2.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/performance-short-r3.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/sanity-I1.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/sanity-I2.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/sanity-I3.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/sanity-I4.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/sanity-R1.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/sanity-R2.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/sanity-R3.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/sanity-R4.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/sanity-T1.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/sanity-T2.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/sanity-T3.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/sanity-T4.json create mode 100644 engine/strata/bench/prompts/standard-v1/requests/warmup.json create mode 100644 engine/strata/bench/qsa_prompt_attn_sm70_bench.cpp create mode 100644 engine/strata/bench/test_gfx906_qsa_query_swizzle_guard.py create mode 100755 engine/strata/bin/strata create mode 100644 engine/strata/bin/strata.cmd create mode 100644 engine/strata/bin/strata.ps1 create mode 100644 engine/strata/cmake/ggml_tq_overlay_test.cmake create mode 100644 engine/strata/cmake/strata-utf8.manifest create mode 100644 engine/strata/cmake/strata_ggml_tq_overlay.cmake create mode 100644 engine/strata/conftest.py create mode 100644 engine/strata/data/dsv41/profile-2.00.bin.sha256 create mode 100644 engine/strata/data/dsv41/profile-2.25.bin.sha256 create mode 100644 engine/strata/data/gguf_fingerprints.json create mode 100644 engine/strata/data/quant_quality/v1/agent.txt create mode 100644 engine/strata/data/quant_quality/v1/code.txt create mode 100644 engine/strata/data/quant_quality/v1/docs.txt create mode 100644 engine/strata/data/quant_quality/v1/english.txt create mode 100644 engine/strata/data/quant_quality/v1/multilingual.txt create mode 100644 engine/strata/data/quant_quality/v1/set.ids.json delete mode 100644 engine/strata/docker-entrypoint.sh create mode 100644 engine/strata/docker/Dockerfile create mode 100755 engine/strata/docker/build.sh create mode 100644 engine/strata/docker/compose/.env.example create mode 100644 engine/strata/docker/compose/MAC.md create mode 100644 engine/strata/docker/compose/docker-compose.amd.yml create mode 100644 engine/strata/docker/compose/docker-compose.intel.yml create mode 100644 engine/strata/docker/compose/docker-compose.nvidia.yml create mode 100755 engine/strata/docker/entrypoint.sh create mode 100644 engine/strata/docker/fetch-engines.py create mode 100755 engine/strata/docker/healthcheck.sh create mode 100755 engine/strata/docker/publish.sh create mode 100755 engine/strata/docker/smoke-test.sh create mode 100755 engine/strata/docker/strata-wrapper.sh create mode 100644 engine/strata/docs/A770_SPEED_SPEC.md create mode 100644 engine/strata/docs/AI_REFERENCE.md create mode 100644 engine/strata/docs/BATCHED_DMA.md create mode 100644 engine/strata/docs/BATCHING.md create mode 100644 engine/strata/docs/BENCHMARK_PROTOCOL.md create mode 100644 engine/strata/docs/CLOSING.md create mode 100644 engine/strata/docs/DEEPSEEK41.md create mode 100644 engine/strata/docs/DEVELOPER_INTEGRATION_HANDOFF.md create mode 100644 engine/strata/docs/DISJOINT_EXPERT_CACHE.md create mode 100644 engine/strata/docs/DOCKER.md create mode 100644 engine/strata/docs/EXCHANGE_ROTATION.md create mode 100644 engine/strata/docs/EXPERTDEC.md create mode 100644 engine/strata/docs/GYRO.md create mode 100644 engine/strata/docs/IMAGES.md create mode 100644 engine/strata/docs/INTEL.md create mode 100644 engine/strata/docs/INTEL_ARC.md create mode 100644 engine/strata/docs/INTEL_INT8_EXPERTS.md create mode 100644 engine/strata/docs/KV_PREFETCH.md create mode 100644 engine/strata/docs/LLAMA_SWAP.md create mode 100644 engine/strata/docs/LOGIT_BIAS.md create mode 100644 engine/strata/docs/MAC.md create mode 100644 engine/strata/docs/MANAGEMENT_PROTOCOL.md create mode 100644 engine/strata/docs/MEDIA_KIT.md create mode 100644 engine/strata/docs/MESSAGE_BOUNDARY_CACHE.md create mode 100644 engine/strata/docs/MMVQ_IL_TABLE.md create mode 100644 engine/strata/docs/NVFP4.md create mode 100644 engine/strata/docs/NVIDIA_V100.md create mode 100644 engine/strata/docs/OLDER_GPUS.md create mode 100644 engine/strata/docs/PREFILL_HEAD_ALIAS.md create mode 100644 engine/strata/docs/PROMPT_CACHE_TAIL.md create mode 100644 engine/strata/docs/QSAROWS.md create mode 100644 engine/strata/docs/QUANTS.md create mode 100644 engine/strata/docs/QWEN36.md create mode 100644 engine/strata/docs/RADEON_780M.md create mode 100644 engine/strata/docs/README.md create mode 100644 engine/strata/docs/RESEARCH_RUNS.md create mode 100644 engine/strata/docs/SAFETY.md create mode 100644 engine/strata/docs/SOURCE_INSTALL.md create mode 100644 engine/strata/docs/STRIX_HALO.md create mode 100644 engine/strata/docs/TERMINAL.md create mode 100644 engine/strata/docs/TERMINAL_IMPLEMENTATION_STATUS.md create mode 100644 engine/strata/docs/TERMINAL_LAUNCH.md create mode 100644 engine/strata/docs/TERMINAL_QUALIFICATION.md create mode 100644 engine/strata/docs/TERMINAL_QUICKSTART.md create mode 100644 engine/strata/docs/TERMINAL_TELEMETRY_FIELDS.md create mode 100644 engine/strata/docs/TEST_REQUESTS.md create mode 100644 engine/strata/docs/UNSLOTH_Q6.md create mode 100644 engine/strata/docs/VRAM_ELASTIC.md create mode 100644 engine/strata/docs/benchmarks/2026-10-01-gfx1100-0.1.31.json create mode 100644 engine/strata/docs/benchmarks/windows-zen2-gfx1030-workers.md create mode 100644 engine/strata/docs/monitoring/grafana-strata.json create mode 100644 engine/strata/docs/monitoring/prometheus.yml create mode 100644 engine/strata/docs/monitoring/servicemonitor.yaml create mode 100644 engine/strata/docs/release-notes-0.2.0.md create mode 100644 engine/strata/docs/release-notes-0.2.1.md create mode 100644 engine/strata/docs/release-notes-0.2.2.md create mode 100644 engine/strata/docs/release-notes-0.2.3.1.md create mode 100644 engine/strata/docs/release-notes-0.2.3.md create mode 100644 engine/strata/docs/release-notes-0.2.4.1.md create mode 100644 engine/strata/docs/release-notes-0.2.4.2.md create mode 100644 engine/strata/docs/release-notes-0.2.4.md create mode 100644 engine/strata/docs/terminal-previews/launch-monitor-connect-hermes.txt create mode 100644 engine/strata/docs/terminal-previews/launch-monitor-connect-opencode.txt create mode 100644 engine/strata/docs/terminal-previews/launch-monitor-overview.txt create mode 100644 engine/strata/docs/terminal-previews/launch-monitor-quit.txt create mode 100644 engine/strata/docs/terminal-previews/launch-overview-ascii.txt create mode 100644 engine/strata/docs/terminal-previews/launch-run-progress.txt create mode 100644 engine/strata/docs/terminal-previews/launch-start.txt create mode 100644 engine/strata/docs/terminal-previews/launch-step1-model.txt create mode 100644 engine/strata/docs/terminal-previews/launch-step2-folder.txt create mode 100644 engine/strata/docs/terminal-previews/launch-step3-context.txt create mode 100644 engine/strata/docs/terminal-previews/launch-step4-pictures.txt create mode 100644 engine/strata/docs/terminal-previews/launch-step5-parallel.txt create mode 100644 engine/strata/docs/terminal-previews/launch-step6-tuning.txt create mode 100644 engine/strata/docs/terminal-previews/launch-step7-advanced.txt create mode 100644 engine/strata/docs/terminal-previews/launch-step8-access.txt create mode 100644 engine/strata/docs/terminal-previews/launch-step9-save.txt create mode 100644 engine/strata/docs/terminal-previews/launch-twocards-start.txt create mode 100644 engine/strata/docs/terminal-previews/launch-twocards-step2-cards.txt create mode 100644 engine/strata/docs/work/ACCEPTANCE-EVIDENCE.md create mode 100644 engine/strata/docs/work/IMPLEMENTATION_STATUS.md create mode 100644 engine/strata/docs/work/PHASE-A-RETURN-PACKET.md create mode 100644 engine/strata/docs/work/QUALIFICATION-KIT.md create mode 100644 engine/strata/flake.lock create mode 100644 engine/strata/flake.nix create mode 100644 engine/strata/include/strata/artifact/model_family.hpp create mode 100644 engine/strata/include/strata/core/adapt_async_default.hpp create mode 100644 engine/strata/include/strata/core/arch_defaults.hpp create mode 100644 engine/strata/include/strata/core/batch_rows.hpp create mode 100644 engine/strata/include/strata/core/batch_telemetry.hpp create mode 100644 engine/strata/include/strata/core/conversation_file.hpp create mode 100644 engine/strata/include/strata/core/dflash2.hpp create mode 100644 engine/strata/include/strata/core/dma_batch.hpp create mode 100644 engine/strata/include/strata/core/draft_cap.hpp create mode 100644 engine/strata/include/strata/core/exchange_storage.hpp create mode 100644 engine/strata/include/strata/core/family_layout.hpp create mode 100644 engine/strata/include/strata/core/foresight_swap.hpp create mode 100644 engine/strata/include/strata/core/geometry.hpp create mode 100644 engine/strata/include/strata/core/gfx12_platform_defaults.hpp create mode 100644 engine/strata/include/strata/core/host_graph_launch.hpp create mode 100644 engine/strata/include/strata/core/logit_bias.hpp create mode 100644 engine/strata/include/strata/core/nv_defaults.hpp create mode 100644 engine/strata/include/strata/core/peer_experts.hpp create mode 100644 engine/strata/include/strata/core/pin_budget.hpp create mode 100644 engine/strata/include/strata/core/pinned_ring.hpp create mode 100644 engine/strata/include/strata/core/remote_expert_opt.hpp create mode 100644 engine/strata/include/strata/core/session_save_reclaim.hpp create mode 100644 engine/strata/include/strata/core/sm120_series.hpp create mode 100644 engine/strata/include/strata/core/sm75_series.hpp create mode 100644 engine/strata/include/strata/core/spec_prob.hpp create mode 100644 engine/strata/include/strata/core/tc_sm75.hpp create mode 100644 engine/strata/include/strata/core/uma_cache.hpp create mode 100644 engine/strata/include/strata/core/vmm.hpp create mode 100644 engine/strata/include/strata/dsv41/exl3.hpp create mode 100644 engine/strata/include/strata/dsv41/exl3_cpu.hpp create mode 100644 engine/strata/include/strata/dsv41/hip_extra.h create mode 100644 engine/strata/include/strata/dsv41/hip_or_cuda.h create mode 100644 engine/strata/include/strata/dsv41/moe_win.hpp create mode 100644 engine/strata/include/strata/dsv41/sampler.hpp create mode 100644 engine/strata/include/strata/hip_compat/math_constants.h create mode 100644 engine/strata/include/strata/kernels/cpu/hadamard.hpp create mode 100644 engine/strata/include/strata/kernels/cpu/iq_avx1.hpp create mode 100644 engine/strata/include/strata/kernels/cpu/kq_avx1.hpp create mode 100644 engine/strata/include/strata/kernels/cpu/numa_pool.hpp create mode 100644 engine/strata/include/strata/kernels/cpu/nvfp4_avx2.hpp create mode 100644 engine/strata/include/strata/kernels/cpu/nvfp4_avx512.hpp create mode 100644 engine/strata/include/strata/kernels/cpu/pool_plan.hpp create mode 100644 engine/strata/include/strata/kernels/cpu/tq_cpu.hpp create mode 100644 engine/strata/include/strata/kernels/dflash2.hpp create mode 100644 engine/strata/include/strata/kernels/fuse_decode.hpp create mode 100644 engine/strata/include/strata/kernels/gfx_arch.hpp create mode 100644 engine/strata/include/strata/kernels/pdl.hpp create mode 100644 engine/strata/include/strata/kernels/q8_1_finite.hpp create mode 100644 engine/strata/include/strata/kernels/quantize_act_dev.cuh create mode 100644 engine/strata/include/strata/kernels/route_prior.hpp create mode 100644 engine/strata/include/strata/kernels/s_rowdev.cuh create mode 100644 engine/strata/include/strata/kernels/swiglu.cuh create mode 100644 engine/strata/include/strata/platform/aux_cpus.hpp create mode 100644 engine/strata/include/strata/platform/hip_compat/cublas_v2.h create mode 100644 engine/strata/include/strata/platform/hip_compat/cuda_fp16.h create mode 100644 engine/strata/include/strata/platform/hip_compat/cuda_runtime.h create mode 100644 engine/strata/include/strata/platform/hip_compat/math_constants.h create mode 100644 engine/strata/include/strata/platform/hip_compat/strata_hip.h create mode 100644 engine/strata/include/strata/platform/host_limits.hpp create mode 100644 engine/strata/include/strata/platform/thread_name.hpp create mode 100644 engine/strata/include/strata/prefill/gdn_chunk.hpp create mode 100644 engine/strata/include/strata/prefill/mmq_kq_abi.hpp create mode 100644 engine/strata/include/strata/prefill/moe_fused.hpp create mode 100644 engine/strata/include/strata/prefill/moe_fused_iq.hpp create mode 100644 engine/strata/include/strata/prefill/share_rules.hpp create mode 100644 engine/strata/include/strata/prefill/warm_policy.hpp create mode 100644 engine/strata/include/strata/prefill/xmx_moe.hpp create mode 100644 engine/strata/include/strata/program/batch_groups.hpp create mode 100644 engine/strata/include/strata/program/batch_read.hpp create mode 100644 engine/strata/include/strata/program/draft_kv_plan.hpp create mode 100644 engine/strata/include/strata/program/message_boundary.hpp create mode 100644 engine/strata/include/strata/program/prefill_plan.hpp create mode 100644 engine/strata/include/strata/program/split_ring.hpp create mode 100644 engine/strata/include/strata/program/split_rules.hpp create mode 100644 engine/strata/include/strata/qwen35/engine.hpp create mode 100644 engine/strata/include/strata/spec/draft_source.hpp create mode 100644 engine/strata/include/strata/spec/spec_start.hpp create mode 100644 engine/strata/integrations/harness/.gitignore create mode 100644 engine/strata/integrations/harness/_bridge.py create mode 100644 engine/strata/integrations/harness/bridge_e2e.py create mode 100644 engine/strata/integrations/harness/bridge_tests.py create mode 100644 engine/strata/integrations/harness/profile/cordis.patch.yml create mode 100644 engine/strata/integrations/harness/profile/package.json create mode 100644 engine/strata/integrations/harness/profile/scripted-worker.cordis.patch.yml create mode 100644 engine/strata/integrations/harness/revise_once.py create mode 100644 engine/strata/integrations/harness/tool_flow_e2e.py create mode 100644 engine/strata/metal/CMakeLists.txt create mode 100644 engine/strata/metal/include/metal_compat/cpuid.h create mode 100644 engine/strata/metal/include/metal_compat/cuda_runtime.h create mode 100644 engine/strata/metal/include/metal_compat/immintrin.h create mode 100644 engine/strata/metal/include/metal_compat/linux/mman.h create mode 100644 engine/strata/metal/include/strata/gpu/metal.hpp create mode 100644 engine/strata/metal/include/strata/gpu/runtime.hpp create mode 100644 engine/strata/metal/kernels/alu_bench.metal create mode 100644 engine/strata/metal/kernels/dense_mm.metal create mode 100644 engine/strata/metal/kernels/gdn.metal create mode 100644 engine/strata/metal/kernels/gdn_prompt.metal create mode 100644 engine/strata/metal/kernels/gemv.metal create mode 100644 engine/strata/metal/kernels/glue.metal create mode 100644 engine/strata/metal/kernels/gr.metal create mode 100644 engine/strata/metal/kernels/gr2.metal create mode 100644 engine/strata/metal/kernels/gridbar.metal create mode 100644 engine/strata/metal/kernels/mm_bench.metal create mode 100644 engine/strata/metal/kernels/mma.metal create mode 100644 engine/strata/metal/kernels/moe.metal create mode 100644 engine/strata/metal/kernels/moe_mm.metal create mode 100644 engine/strata/metal/kernels/prompt.metal create mode 100644 engine/strata/metal/kernels/qsa.metal create mode 100644 engine/strata/metal/kernels/qsa2.metal create mode 100644 engine/strata/metal/kernels/qsa_prompt.metal create mode 100644 engine/strata/metal/kernels/quant.metal create mode 100644 engine/strata/metal/kernels/router.metal create mode 100644 engine/strata/metal/kernels/rt_bench.metal create mode 100644 engine/strata/metal/kernels/sample.metal create mode 100644 engine/strata/metal/kernels/units.metal create mode 100644 engine/strata/metal/kernels/wrap_probe.metal create mode 100644 engine/strata/metal/probe/mkfile.c create mode 100644 engine/strata/metal/probe/mtl_doorbell.cpp create mode 100644 engine/strata/metal/probe/mtl_probe.cpp create mode 100644 engine/strata/metal/setup_mac.py create mode 100644 engine/strata/metal/src/engine/arena_budget.h create mode 100644 engine/strata/metal/src/engine/iq_host.cpp create mode 100644 engine/strata/metal/src/engine/missing.cpp create mode 100644 engine/strata/metal/src/engine/mmvq_host.cpp create mode 100644 engine/strata/metal/src/engine/msl/mtp.metal create mode 100644 engine/strata/metal/src/engine/msl/mtp_chain.metal create mode 100644 engine/strata/metal/src/engine/msl/ple.metal create mode 100644 engine/strata/metal/src/engine/prompt_chain.inc create mode 100644 engine/strata/metal/src/engine/setup_host.cpp create mode 100644 engine/strata/metal/src/engine/stream.cpp create mode 100644 engine/strata/metal/src/engine/stream.h create mode 100644 engine/strata/metal/src/engine/stubs.cpp create mode 100644 engine/strata/metal/src/engine/stubs_0145.cpp create mode 100644 engine/strata/metal/src/engine/stubs_023.cpp create mode 100644 engine/strata/metal/src/engine/stubs_025.cpp create mode 100644 engine/strata/metal/src/engine/stubs_144.cpp create mode 100644 engine/strata/metal/src/engine/stubs_gyro.cpp create mode 100644 engine/strata/metal/src/engine/window.cpp create mode 100644 engine/strata/metal/src/gguf_lite.cpp create mode 100644 engine/strata/metal/src/gguf_lite.h create mode 100644 engine/strata/metal/src/gpu/runtime.cpp create mode 100644 engine/strata/metal/src/mtl_rt.h create mode 100644 engine/strata/metal/src/mtl_rt.mm create mode 100644 engine/strata/metal/src/ref_quant.cpp create mode 100644 engine/strata/metal/src/ref_quant.h create mode 100644 engine/strata/metal/src/resource_path.h create mode 100644 engine/strata/metal/tests/alu_bench.cpp create mode 100644 engine/strata/metal/tests/arena_budget_test.cpp create mode 100644 engine/strata/metal/tests/coop_layout.cpp create mode 100644 engine/strata/metal/tests/coop_probe.h create mode 100644 engine/strata/metal/tests/dense_mm_parity.cpp create mode 100644 engine/strata/metal/tests/expert_parity.cpp create mode 100644 engine/strata/metal/tests/fuse_parity.cpp create mode 100644 engine/strata/metal/tests/gdn_parity.cpp create mode 100644 engine/strata/metal/tests/gdn_prompt_parity.cpp create mode 100644 engine/strata/metal/tests/gemv_parity.cpp create mode 100644 engine/strata/metal/tests/gr2_parity.cpp create mode 100644 engine/strata/metal/tests/gr_parity.cpp create mode 100644 engine/strata/metal/tests/gridbar_bench.cpp create mode 100644 engine/strata/metal/tests/gyro_parity.sh create mode 100644 engine/strata/metal/tests/mm_bench.cpp create mode 100644 engine/strata/metal/tests/mma_parity.cpp create mode 100644 engine/strata/metal/tests/moe_mm_parity.cpp create mode 100644 engine/strata/metal/tests/pair_parity.cpp create mode 100644 engine/strata/metal/tests/prompt_chain.cpp create mode 100644 engine/strata/metal/tests/prompt_parity.cpp create mode 100644 engine/strata/metal/tests/qsa_parity.cpp create mode 100644 engine/strata/metal/tests/qsa_prompt_parity.cpp create mode 100644 engine/strata/metal/tests/ref_dump.cpp create mode 100644 engine/strata/metal/tests/route_parity.cpp create mode 100644 engine/strata/metal/tests/rt_bench.cpp create mode 100644 engine/strata/metal/tests/runtime_hello.cpp create mode 100644 engine/strata/metal/tests/sample_parity.cpp create mode 100644 engine/strata/metal/tests/serve_probe.py create mode 100644 engine/strata/metal/tests/token_chain.cpp create mode 100644 engine/strata/metal/tests/wrap_split_test.cpp create mode 100644 engine/strata/metal/tools/chat_tokens.py create mode 100644 engine/strata/metal/tools/check_ref.py create mode 100644 engine/strata/metal/tools/gen_stubs.py create mode 100644 engine/strata/metal/tools/gen_tq_lut.py create mode 100644 engine/strata/metal/tools/gguf_list.cpp create mode 100644 engine/strata/metal/tools/metal_repack.py create mode 100644 engine/strata/metal/tools/stream_experts.py create mode 100644 engine/strata/packaging/ENGINE-COMPONENT.md create mode 100644 engine/strata/packaging/README.md create mode 100644 engine/strata/packaging/UPDATES.md create mode 100644 engine/strata/packaging/acceptance_matrix.py create mode 100644 engine/strata/packaging/binary_deps.py create mode 100644 engine/strata/packaging/build_cuda_linux.sh create mode 100644 engine/strata/packaging/build_dsv41_cuda.sh create mode 100644 engine/strata/packaging/build_dsv41_windows.bat create mode 100644 engine/strata/packaging/build_hip_gfx1103.sh create mode 100644 engine/strata/packaging/build_hip_linux.sh create mode 100644 engine/strata/packaging/build_sycl_linux.sh create mode 100755 engine/strata/packaging/build_vision_mac.sh create mode 100644 engine/strata/packaging/build_vision_windows.bat create mode 100644 engine/strata/packaging/collect_libs.py create mode 100644 engine/strata/packaging/feed_tool.py create mode 100644 engine/strata/packaging/install.ps1 create mode 100644 engine/strata/packaging/install.sh create mode 100644 engine/strata/packaging/lock_wheels.py create mode 100644 engine/strata/packaging/locks/runtime-darwin-arm64-cp312.txt create mode 100644 engine/strata/packaging/locks/runtime-linux-x86_64-cp312.txt create mode 100644 engine/strata/packaging/locks/runtime-windows-x86_64-cp312.txt create mode 100644 engine/strata/packaging/mac/README.md create mode 100644 engine/strata/packaging/mac/entitlements-node.plist create mode 100755 engine/strata/packaging/mac/sign-and-notarize.sh create mode 100644 engine/strata/packaging/make_local_feed.py create mode 100644 engine/strata/packaging/monitor_bundle.py create mode 100644 engine/strata/packaging/package_engine.py create mode 100644 engine/strata/packaging/package_terminal.py create mode 100644 engine/strata/packaging/smoke_terminal.py create mode 100644 engine/strata/packaging/stage_tuning.py create mode 100644 engine/strata/requirements-build.txt create mode 100644 engine/strata/requirements-monitor.txt create mode 100644 engine/strata/requirements-nvfp4-local.txt create mode 100644 engine/strata/serve/cache_drop.py create mode 100644 engine/strata/serve/cpu_affinity.py create mode 100644 engine/strata/serve/dsml.py create mode 100644 engine/strata/serve/fixtures/deepseek41/chat_template.jinja create mode 100644 engine/strata/serve/fixtures/deepseek41/golden.json create mode 100644 engine/strata/serve/fixtures/fake_sd_cli.py create mode 100644 engine/strata/serve/fixtures/rcall_specimens.json create mode 100644 engine/strata/serve/images.py create mode 100644 engine/strata/serve/keepawake.py create mode 100644 engine/strata/serve/launch_identity.py create mode 100644 engine/strata/serve/lifeline.py create mode 100644 engine/strata/serve/loader_diag.py create mode 100644 engine/strata/serve/logit_bias.py create mode 100644 engine/strata/serve/owner_guard.py create mode 100644 engine/strata/serve/prometheus.py create mode 100644 engine/strata/serve/ready.py create mode 100644 engine/strata/serve/replicas.py create mode 100644 engine/strata/serve/responses.py create mode 100644 engine/strata/serve/runconfig.py create mode 100644 engine/strata/serve/session_save_retry.py create mode 100644 engine/strata/serve/test_admit_order.py create mode 100644 engine/strata/serve/test_answer_speed.py create mode 100644 engine/strata/serve/test_anthropic_base_url.py create mode 100644 engine/strata/serve/test_cache_drop.py create mode 100644 engine/strata/serve/test_chunked_body.py create mode 100644 engine/strata/serve/test_context_overflow.py create mode 100644 engine/strata/serve/test_control_cancel.py create mode 100644 engine/strata/serve/test_draft_layer.py create mode 100644 engine/strata/serve/test_dsv41.py create mode 100644 engine/strata/serve/test_effort_paths.py create mode 100644 engine/strata/serve/test_env_to_user.py create mode 100644 engine/strata/serve/test_exif_orientation.py create mode 100644 engine/strata/serve/test_family_name.py create mode 100644 engine/strata/serve/test_fatal_recovery.py create mode 100644 engine/strata/serve/test_frontend.py create mode 100644 engine/strata/serve/test_gpu_roles_server.py create mode 100644 engine/strata/serve/test_images.py create mode 100644 engine/strata/serve/test_keepawake.py create mode 100644 engine/strata/serve/test_lifeline.py create mode 100644 engine/strata/serve/test_logit_bias.py create mode 100644 engine/strata/serve/test_model_card_sampling.py create mode 100644 engine/strata/serve/test_native_tool_parser.py create mode 100644 engine/strata/serve/test_parallel.py create mode 100644 engine/strata/serve/test_parallel_yield.py create mode 100644 engine/strata/serve/test_parser_call_scan.py create mode 100644 engine/strata/serve/test_parser_hold.py create mode 100644 engine/strata/serve/test_parser_track.py create mode 100644 engine/strata/serve/test_pool_cores.py create mode 100644 engine/strata/serve/test_prometheus.py create mode 100644 engine/strata/serve/test_prompt_encoder.py create mode 100644 engine/strata/serve/test_q36_config.py create mode 100644 engine/strata/serve/test_queue_keepalive.py create mode 100644 engine/strata/serve/test_quiet_cancel.py create mode 100644 engine/strata/serve/test_ready_timeout.py create mode 100644 engine/strata/serve/test_reasoning_loop_recovery.py create mode 100644 engine/strata/serve/test_reasoning_rescue.py create mode 100644 engine/strata/serve/test_reasoning_tools.py create mode 100644 engine/strata/serve/test_replicas.py create mode 100644 engine/strata/serve/test_request_accounting.py create mode 100644 engine/strata/serve/test_request_hardening.py create mode 100644 engine/strata/serve/test_responses.py create mode 100644 engine/strata/serve/test_restart_waiters.py create mode 100644 engine/strata/serve/test_runconfig.py create mode 100644 engine/strata/serve/test_security.py create mode 100644 engine/strata/serve/test_session_save_retry.py create mode 100644 engine/strata/serve/test_slot_alloc.py create mode 100644 engine/strata/serve/test_slots.py create mode 100644 engine/strata/serve/test_tool_call_envelope.py create mode 100644 engine/strata/serve/test_tool_call_unclosed.py create mode 100644 engine/strata/serve/test_tool_name_space.py create mode 100644 engine/strata/serve/test_vision_busy.py create mode 100644 engine/strata/serve/test_vision_elastic.py create mode 100644 engine/strata/serve/test_vision_start_error.py create mode 100644 engine/strata/serve/test_vision_token_limit.py create mode 100644 engine/strata/serve/test_vision_tool_image.py create mode 100644 engine/strata/serve/test_vision_workdir.py create mode 100644 engine/strata/serve/test_vram.py create mode 100644 engine/strata/serve/test_web_api_key.py create mode 100644 engine/strata/serve/test_web_sampling.py create mode 100644 engine/strata/serve/web/favicon.svg mode change 100644 => 100755 engine/strata/setup.sh create mode 100644 engine/strata/src/core/adapt_async_default_test.cpp create mode 100644 engine/strata/src/core/arch_defaults.cpp create mode 100644 engine/strata/src/core/arch_defaults_test.cpp create mode 100644 engine/strata/src/core/batch_telemetry_test.cpp create mode 100644 engine/strata/src/core/conversation_copy.hpp create mode 100644 engine/strata/src/core/conversation_file.cpp create mode 100644 engine/strata/src/core/conversation_file_test.cpp create mode 100644 engine/strata/src/core/conversation_split_failure_test.cpp create mode 100644 engine/strata/src/core/dflash2.cpp create mode 100644 engine/strata/src/core/dflash2_attn_bench.cpp create mode 100644 engine/strata/src/core/dflash2_bw_bench.cu create mode 100644 engine/strata/src/core/dflash2_gemm_bench.cpp create mode 100644 engine/strata/src/core/dflash2_launch_bench.cu create mode 100644 engine/strata/src/core/dflash2_parity.cpp create mode 100644 engine/strata/src/core/dflash2_small_bench.cpp create mode 100644 engine/strata/src/core/draft_cap_test.cpp create mode 100644 engine/strata/src/core/logit_bias_test.cpp create mode 100644 engine/strata/src/core/nv_defaults.cpp create mode 100644 engine/strata/src/core/peer_experts.cpp create mode 100644 engine/strata/src/core/pin_budget_test.cpp create mode 100644 engine/strata/src/core/remote_expert_opt.cu create mode 100644 engine/strata/src/core/session_save_reclaim_test.cpp create mode 100644 engine/strata/src/core/spec_prob_test.cpp create mode 100644 engine/strata/src/core/uma_cache_test.cpp create mode 100644 engine/strata/src/core/vmm.cpp create mode 100644 engine/strata/src/dsv41/ds4_attn_split.cuh create mode 100644 engine/strata/src/dsv41/ds4_engram_io.hpp create mode 100644 engine/strata/src/dsv41/ds4_experts_rule.hpp create mode 100644 engine/strata/src/dsv41/ds4_gg_cpu.cpp create mode 100644 engine/strata/src/dsv41/ds4_gguf.cu create mode 100644 engine/strata/src/dsv41/ds4_gguf.cuh create mode 100644 engine/strata/src/dsv41/ds4_gguf_cpu.cpp create mode 100644 engine/strata/src/dsv41/ds4_gguf_cpu.hpp create mode 100644 engine/strata/src/dsv41/ds4_iq.cu create mode 100644 engine/strata/src/dsv41/ds4_iq.cuh create mode 100644 engine/strata/src/dsv41/ds4_iq1m_codes.inc create mode 100644 engine/strata/src/dsv41/ds4_iq_cpu.cpp create mode 100644 engine/strata/src/dsv41/ds4_iq_hip.inc create mode 100644 engine/strata/src/dsv41/ds4_iq_hip_r.inc create mode 100644 engine/strata/src/dsv41/ds4_iq_hip_s.inc create mode 100644 engine/strata/src/dsv41/ds4_kernels.cu create mode 100644 engine/strata/src/dsv41/ds4_kernels.cuh create mode 100644 engine/strata/src/dsv41/ds4_main.cpp create mode 100644 engine/strata/src/dsv41/ds4_model.cu create mode 100644 engine/strata/src/dsv41/ds4_model.hpp create mode 100644 engine/strata/src/dsv41/ds4_mx_kern.inc create mode 100644 engine/strata/src/dsv41/ds4_numerics.cuh create mode 100644 engine/strata/src/dsv41/ds4_os.hpp create mode 100644 engine/strata/src/dsv41/ds4_packinfo.cpp create mode 100644 engine/strata/src/dsv41/ds4_packinfo.hpp create mode 100644 engine/strata/src/dsv41/ds4_pick_rule.hpp create mode 100644 engine/strata/src/dsv41/ds4_pool.hpp create mode 100644 engine/strata/src/dsv41/ds4_q6k.cuh create mode 100644 engine/strata/src/dsv41/ds4_slotmeta.hpp create mode 100644 engine/strata/src/dsv41/ds4_store.hpp create mode 100644 engine/strata/src/dsv41/ds4_tq.cu create mode 100644 engine/strata/src/dsv41/ds4_tq_cpu.cpp create mode 100644 engine/strata/src/dsv41/ds4_tqw.cuh create mode 100644 engine/strata/src/dsv41/ds4_vision.cu create mode 100644 engine/strata/src/dsv41/ds4_vision.cuh create mode 100644 engine/strata/src/dsv41/vendor/exl3.cu create mode 100644 engine/strata/src/dsv41/vendor/exl3_cpu.cpp create mode 100644 engine/strata/src/dsv41/vendor/exl3_legacy.cu create mode 100644 engine/strata/src/dsv41/vendor/moe_win.cu create mode 100644 engine/strata/src/dsv41/vendor/sampler.cu create mode 100644 engine/strata/src/kernels/b6_mmvq_bench.cpp create mode 100644 engine/strata/src/kernels/batch_rows_parity.cpp create mode 100644 engine/strata/src/kernels/cpu/hadamard.cpp create mode 100644 engine/strata/src/kernels/cpu/iq512_gather_parity.cpp create mode 100644 engine/strata/src/kernels/cpu/iq_avx1.cpp create mode 100644 engine/strata/src/kernels/cpu/iq_avx1_parity.cpp create mode 100644 engine/strata/src/kernels/cpu/iq_avx2_parity.cpp create mode 100644 engine/strata/src/kernels/cpu/iq_avx2_rows.inl create mode 100644 engine/strata/src/kernels/cpu/kq_avx1.cpp create mode 100644 engine/strata/src/kernels/cpu/kq_cpu_bench.cpp create mode 100644 engine/strata/src/kernels/cpu/native_hadamard_test.cpp create mode 100644 engine/strata/src/kernels/cpu/numa_pool_test.cpp create mode 100644 engine/strata/src/kernels/cpu/nvfp4_avx2.cpp create mode 100644 engine/strata/src/kernels/cpu/nvfp4_avx512.cpp create mode 100644 engine/strata/src/kernels/cpu/nvfp4_avx512_parity.cpp create mode 100644 engine/strata/src/kernels/cpu/pool_affinity_linux.hpp create mode 100644 engine/strata/src/kernels/cpu/pool_affinity_linux_test.cpp create mode 100644 engine/strata/src/kernels/cpu/pool_affinity_test.cpp create mode 100644 engine/strata/src/kernels/cpu/pool_affinity_win.hpp create mode 100644 engine/strata/src/kernels/cpu/pool_cores_test.cpp create mode 100644 engine/strata/src/kernels/cpu/pool_plan_test.cpp create mode 100644 engine/strata/src/kernels/cpu/pool_tasks_test.cpp create mode 100644 engine/strata/src/kernels/cpu/q2_avx1.cpp create mode 100644 engine/strata/src/kernels/cpu/q2_avx2_rows.inl create mode 100644 engine/strata/src/kernels/cpu/q2_bitplane_parity.cpp create mode 100644 engine/strata/src/kernels/cpu/q8k_quant_parity.cpp create mode 100644 engine/strata/src/kernels/cpu/router_dot_parity.cpp create mode 100644 engine/strata/src/kernels/cpu/tq_avx2.cpp create mode 100644 engine/strata/src/kernels/cpu/tq_avx512.cpp create mode 100644 engine/strata/src/kernels/cpu/tq_computed.hpp create mode 100644 engine/strata/src/kernels/cpu/tq_cpu.cpp create mode 100644 engine/strata/src/kernels/cpu/tq_cpu_parity.cpp create mode 100644 engine/strata/src/kernels/cpu/tq_states.hpp create mode 100644 engine/strata/src/kernels/cuda/dflash2.cu create mode 100644 engine/strata/src/kernels/cuda/q8_1_il.cuh create mode 100644 engine/strata/src/kernels/cuda/q8_sm60.cuh create mode 100644 engine/strata/src/kernels/cuda/qsa_scores_gfx1100_test.cu create mode 100644 engine/strata/src/kernels/cuda/route_prior.cu create mode 100644 engine/strata/src/kernels/cuda/s26_tsum.cuh create mode 100644 engine/strata/src/kernels/cuda/s_gemv_pair.cu create mode 100644 engine/strata/src/kernels/cuda/tq_lut_i8.cuh create mode 100644 engine/strata/src/kernels/decode_cluster_parity.cpp create mode 100644 engine/strata/src/kernels/dequant_wide_parity.cpp create mode 100644 engine/strata/src/kernels/expdec_bench.cpp create mode 100644 engine/strata/src/kernels/fused_gr_bench.cpp create mode 100644 engine/strata/src/kernels/gdn_chunk_parity.cpp create mode 100644 engine/strata/src/kernels/gr_multi_parity.cpp create mode 100644 engine/strata/src/kernels/hc_persist_parity.cpp create mode 100644 engine/strata/src/kernels/kv_steps_parity.cpp create mode 100644 engine/strata/src/kernels/kv_window_parity.cpp create mode 100644 engine/strata/src/kernels/mmvf_rows_parity.cpp create mode 100644 engine/strata/src/kernels/mmvq_il_parity.cpp create mode 100644 engine/strata/src/kernels/native_expert_bench.cpp create mode 100644 engine/strata/src/kernels/native_grouped_parity.cpp create mode 100644 engine/strata/src/kernels/native_multi_parity.cpp create mode 100644 engine/strata/src/kernels/nvfp4_decode_bench.cpp create mode 100644 engine/strata/src/kernels/nvfp4_expert_gpu_parity.cpp create mode 100644 engine/strata/src/kernels/pdl_parity.cpp create mode 100644 engine/strata/src/kernels/pf_wmma_parity.cpp create mode 100644 engine/strata/src/kernels/q8_gemv_bench.cpp create mode 100644 engine/strata/src/kernels/qsa_merge_daily_parity.cpp create mode 100644 engine/strata/src/kernels/qsa_rows_bench.cpp create mode 100644 engine/strata/src/kernels/qsa_scores_gfx1100_parity.cpp create mode 100644 engine/strata/src/kernels/qsa_scores_parity.cpp create mode 100644 engine/strata/src/kernels/qsa_slots_parity.cpp create mode 100644 engine/strata/src/kernels/qsa_topk_active_parity.cpp create mode 100644 engine/strata/src/kernels/qsa_topk_parity.cpp create mode 100644 engine/strata/src/kernels/resident_plan_parity.cpp create mode 100644 engine/strata/src/kernels/route_resident_parity.cu create mode 100644 engine/strata/src/kernels/route_window_parity.cpp create mode 100644 engine/strata/src/kernels/router_chain_bench.cpp create mode 100644 engine/strata/src/kernels/spec_verify_parity.cpp create mode 100644 engine/strata/src/kernels/tq_pascal_bench.cpp create mode 100644 engine/strata/src/kernels/verify_batch_parity.cpp create mode 100644 engine/strata/src/kernels/verify_parity.cpp create mode 100644 engine/strata/src/prefill/gdn_chunk.cu create mode 100644 engine/strata/src/prefill/gdn_rec_parity.cu create mode 100644 engine/strata/src/prefill/gemm_bf16_parity.cu create mode 100644 engine/strata/src/prefill/gemm_f32_parity.cu create mode 100644 engine/strata/src/prefill/gr_upmix_parity.cu create mode 100644 engine/strata/src/prefill/mmq_expert_bench.cpp create mode 100644 engine/strata/src/prefill/mmq_kq_lib.cu create mode 100644 engine/strata/src/prefill/mmq_kq_loader.cpp create mode 100644 engine/strata/src/prefill/mmq_nvfp4_parity.cpp create mode 100644 engine/strata/src/prefill/mmq_nvfp4_w4a4.cu create mode 100644 engine/strata/src/prefill/mmq_nvfp4_w4a8.cu create mode 100644 engine/strata/src/prefill/mmq_resident_sort.hpp create mode 100644 engine/strata/src/prefill/mmq_tab_instance.cu.in create mode 100644 engine/strata/src/prefill/moe_f16_common.cuh create mode 100644 engine/strata/src/prefill/moe_f16_kq.cu create mode 100644 engine/strata/src/prefill/moe_f16_kq.hpp create mode 100644 engine/strata/src/prefill/moe_fused.cu create mode 100644 engine/strata/src/prefill/moe_fused_iq.cu create mode 100644 engine/strata/src/prefill/moe_mmq_tab.cuh create mode 100644 engine/strata/src/prefill/moe_mmq_tab.hpp create mode 100644 engine/strata/src/prefill/rocblas_tuning.hpp create mode 100644 engine/strata/src/prefill/warm_policy_test.cpp create mode 100644 engine/strata/src/prefill/wmma_gemm.cu create mode 100644 engine/strata/src/prefill/wmma_gemm.h create mode 100644 engine/strata/src/program/batch_groups_test.cpp create mode 100644 engine/strata/src/program/draft_kv_plan_test.cpp create mode 100644 engine/strata/src/program/message_boundary_test.cpp create mode 100644 engine/strata/src/program/split_ring_test.cpp create mode 100644 engine/strata/src/qwen35/q36_engine.cu create mode 100644 engine/strata/src/qwen35/q36_kernels.cuh create mode 100644 engine/strata/src/qwen35/q36_main.cpp create mode 100644 engine/strata/src/qwen35/q36ref.cu create mode 100644 engine/strata/src/spec/draft_source.cpp create mode 100644 engine/strata/src/spec/spec_start_test.cpp create mode 100644 engine/strata/strata.py create mode 100644 engine/strata/strata_cli/__init__.py create mode 100644 engine/strata/strata_cli/bench.py create mode 100644 engine/strata/strata_cli/bench_facts.py create mode 100644 engine/strata/strata_cli/bench_standard.py create mode 100644 engine/strata/strata_cli/cli.py create mode 100644 engine/strata/strata_cli/client.py create mode 100644 engine/strata/strata_cli/connections.py create mode 100644 engine/strata/strata_cli/consoleinfo.py create mode 100644 engine/strata/strata_cli/dashboard.py create mode 100644 engine/strata/strata_cli/detail_dashboard.py create mode 100644 engine/strata/strata_cli/drafting_cmd.py create mode 100644 engine/strata/strata_cli/handover.py create mode 100644 engine/strata/strata_cli/launch/__init__.py create mode 100644 engine/strata/strata_cli/launch/access.py create mode 100644 engine/strata/strata_cli/launch/adopt.py create mode 100644 engine/strata/strata_cli/launch/app.py create mode 100644 engine/strata/strata_cli/launch/catalog.py create mode 100644 engine/strata/strata_cli/launch/check.py create mode 100644 engine/strata/strata_cli/launch/cmd.py create mode 100644 engine/strata/strata_cli/launch/harness.py create mode 100644 engine/strata/strata_cli/launch/library.py create mode 100644 engine/strata/strata_cli/launch/modelstate.py create mode 100644 engine/strata/strata_cli/launch/monitor_ext.py create mode 100644 engine/strata/strata_cli/launch/params.py create mode 100644 engine/strata/strata_cli/launch/runner.py create mode 100644 engine/strata/strata_cli/launch/screens.py create mode 100644 engine/strata/strata_cli/launch/settings.py create mode 100644 engine/strata/strata_cli/launch/store.py create mode 100644 engine/strata/strata_cli/launch/widgets.py create mode 100644 engine/strata/strata_cli/logs.py create mode 100644 engine/strata/strata_cli/monitor.py create mode 100644 engine/strata/strata_cli/monitor_commands.py create mode 100644 engine/strata/strata_cli/nav.py create mode 100644 engine/strata/strata_cli/overview.py create mode 100644 engine/strata/strata_cli/render.py create mode 100644 engine/strata/strata_cli/tune_commands.py create mode 100644 engine/strata/strata_cli/update_cmd.py create mode 100644 engine/strata/strata_control/__init__.py create mode 100644 engine/strata/strata_control/acquisition.py create mode 100644 engine/strata/strata_control/atomic.py create mode 100644 engine/strata/strata_control/autotune.py create mode 100644 engine/strata/strata_control/benchmarking.py create mode 100644 engine/strata/strata_control/calibration.py create mode 100644 engine/strata/strata_control/calibration_jobs.py create mode 100644 engine/strata/strata_control/components.py create mode 100644 engine/strata/strata_control/discovery.py create mode 100644 engine/strata/strata_control/doctor.py create mode 100644 engine/strata/strata_control/draft_layer.py create mode 100644 engine/strata/strata_control/drafting.py create mode 100644 engine/strata/strata_control/drafting_fetch.py create mode 100644 engine/strata/strata_control/dsv41_engine.py create mode 100644 engine/strata/strata_control/dsv41_fit.py create mode 100644 engine/strata/strata_control/dsv41_sets.py create mode 100644 engine/strata/strata_control/engine_component.py create mode 100644 engine/strata/strata_control/feed.py create mode 100644 engine/strata/strata_control/folders.py create mode 100644 engine/strata/strata_control/gguf_preflight.py create mode 100644 engine/strata/strata_control/gpu_fit.py create mode 100644 engine/strata/strata_control/gpu_roles.py create mode 100644 engine/strata/strata_control/hipblaslt_tuning.py create mode 100644 engine/strata/strata_control/journal.py create mode 100644 engine/strata/strata_control/longpath.py create mode 100644 engine/strata/strata_control/loopback.py create mode 100644 engine/strata/strata_control/mac_fit.py create mode 100644 engine/strata/strata_control/management.py create mode 100644 engine/strata/strata_control/models.py create mode 100644 engine/strata/strata_control/models_move.py create mode 100644 engine/strata/strata_control/offline.py create mode 100644 engine/strata/strata_control/owner_transport.py create mode 100644 engine/strata/strata_control/paths.py create mode 100644 engine/strata/strata_control/posix_owner.py create mode 100644 engine/strata/strata_control/preset_marks.py create mode 100644 engine/strata/strata_control/presets.py create mode 100644 engine/strata/strata_control/private_files.py create mode 100644 engine/strata/strata_control/procs.py create mode 100644 engine/strata/strata_control/profiles.py create mode 100644 engine/strata/strata_control/progress_words.py create mode 100644 engine/strata/strata_control/readiness.py create mode 100644 engine/strata/strata_control/recipes.py create mode 100644 engine/strata/strata_control/runtime.py create mode 100644 engine/strata/strata_control/signing.py create mode 100644 engine/strata/strata_control/targets.py create mode 100644 engine/strata/strata_control/time_skip.py create mode 100644 engine/strata/strata_control/tls.py create mode 100644 engine/strata/strata_control/transfer.py create mode 100644 engine/strata/strata_control/tune_api.py create mode 100644 engine/strata/strata_control/tune_apply.py create mode 100644 engine/strata/strata_control/tune_engine.py create mode 100644 engine/strata/strata_control/tune_history.py create mode 100644 engine/strata/strata_control/tune_knobs.py create mode 100644 engine/strata/strata_control/tune_machine.py create mode 100644 engine/strata/strata_control/tune_session.py create mode 100644 engine/strata/strata_control/tuning.py create mode 100644 engine/strata/strata_control/update_keys.json create mode 100644 engine/strata/strata_control/updater.py create mode 100644 engine/strata/strata_control/user_args.py create mode 100644 engine/strata/strata_control/vision_reader.py create mode 100644 engine/strata/strata_control/vram_fit.py create mode 100644 engine/strata/strata_control/winproc.py create mode 100644 engine/strata/sycl/.gitignore create mode 100644 engine/strata/sycl/CMakeLists.txt create mode 100644 engine/strata/sycl/include/dpct/LICENSE.TXT create mode 100644 engine/strata/sycl/include/dpct/atomic.hpp create mode 100644 engine/strata/sycl/include/dpct/bindless_images.hpp create mode 100644 engine/strata/sycl/include/dpct/blas_gemm_utils.hpp create mode 100644 engine/strata/sycl/include/dpct/blas_utils.hpp create mode 100644 engine/strata/sycl/include/dpct/ccl_utils.hpp create mode 100644 engine/strata/sycl/include/dpct/codepin/codepin.hpp create mode 100644 engine/strata/sycl/include/dpct/codepin/serialization/basic.hpp create mode 100644 engine/strata/sycl/include/dpct/compat_service.hpp create mode 100644 engine/strata/sycl/include/dpct/detail/blas_gemm_utils_detail.hpp create mode 100644 engine/strata/sycl/include/dpct/detail/blas_utils_detail.hpp create mode 100644 engine/strata/sycl/include/dpct/detail/ccl_utils_detail.hpp create mode 100644 engine/strata/sycl/include/dpct/detail/dnnl_utils_detail.hpp create mode 100644 engine/strata/sycl/include/dpct/detail/group_utils_detail.hpp create mode 100644 engine/strata/sycl/include/dpct/detail/lapack_utils_detail.hpp create mode 100644 engine/strata/sycl/include/dpct/detail/lib_common_utils_detail.hpp create mode 100644 engine/strata/sycl/include/dpct/detail/math_detail.hpp create mode 100644 engine/strata/sycl/include/dpct/detail/memory_detail.hpp create mode 100644 engine/strata/sycl/include/dpct/detail/rng_utils_detail.hpp create mode 100644 engine/strata/sycl/include/dpct/detail/sparse_utils_detail.hpp create mode 100644 engine/strata/sycl/include/dpct/device.hpp create mode 100644 engine/strata/sycl/include/dpct/dnnl_utils.hpp create mode 100644 engine/strata/sycl/include/dpct/dpct.hpp create mode 100644 engine/strata/sycl/include/dpct/dpl_extras/algorithm.h create mode 100644 engine/strata/sycl/include/dpct/dpl_extras/dpcpp_extensions.h create mode 100644 engine/strata/sycl/include/dpct/dpl_extras/functional.h create mode 100644 engine/strata/sycl/include/dpct/dpl_extras/iterator_adaptor.h create mode 100644 engine/strata/sycl/include/dpct/dpl_extras/iterators.h create mode 100644 engine/strata/sycl/include/dpct/dpl_extras/memory.h create mode 100644 engine/strata/sycl/include/dpct/dpl_extras/numeric.h create mode 100644 engine/strata/sycl/include/dpct/dpl_extras/vector.h create mode 100644 engine/strata/sycl/include/dpct/dpl_utils.hpp create mode 100644 engine/strata/sycl/include/dpct/fft_utils.hpp create mode 100644 engine/strata/sycl/include/dpct/graph.hpp create mode 100644 engine/strata/sycl/include/dpct/group_utils.hpp create mode 100644 engine/strata/sycl/include/dpct/image.hpp create mode 100644 engine/strata/sycl/include/dpct/kernel.hpp create mode 100644 engine/strata/sycl/include/dpct/lapack_utils.hpp create mode 100644 engine/strata/sycl/include/dpct/lib_common_utils.hpp create mode 100644 engine/strata/sycl/include/dpct/math.hpp create mode 100644 engine/strata/sycl/include/dpct/memory.hpp create mode 100644 engine/strata/sycl/include/dpct/rng_utils.hpp create mode 100644 engine/strata/sycl/include/dpct/shmem_utils.hpp create mode 100644 engine/strata/sycl/include/dpct/sparse_utils.hpp create mode 100644 engine/strata/sycl/include/dpct/util.hpp create mode 100644 engine/strata/sycl/include/dpct/ze_utils.hpp create mode 100644 engine/strata/sycl/include/strata/copy_queue.hpp create mode 100644 engine/strata/sycl/include/strata/core/coupled_draft.hpp create mode 100644 engine/strata/sycl/include/strata/core/dma_batch.hpp create mode 100644 engine/strata/sycl/include/strata/core/exchange_storage.hpp create mode 100644 engine/strata/sycl/include/strata/core/expert_source.hpp create mode 100644 engine/strata/sycl/include/strata/core/gguf_expert_source.hpp create mode 100644 engine/strata/sycl/include/strata/core/graph.hpp create mode 100644 engine/strata/sycl/include/strata/core/mtp.hpp create mode 100644 engine/strata/sycl/include/strata/core/on_device.hpp create mode 100644 engine/strata/sycl/include/strata/core/peer_experts.hpp create mode 100644 engine/strata/sycl/include/strata/core/remote_experts.hpp create mode 100644 engine/strata/sycl/include/strata/core/session.hpp create mode 100644 engine/strata/sycl/include/strata/core/verify.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/bf16_bits.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/dp4a.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/f16_bits.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/iq_dequant_expert.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/mrope.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/native_mmvq.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/native_router.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/q8_1_finite.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/qsa_prompt_attn_xmx.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/resident_plan_mirror.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/rope.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/rope_scaling.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/sampler.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/tq_lut_i8_sycl.hpp create mode 100644 engine/strata/sycl/include/strata/kernels/xmx_gemm.hpp create mode 100644 engine/strata/sycl/include/strata/prefill/esimd_moe.hpp create mode 100644 engine/strata/sycl/include/strata/prefill/gdn_xe.hpp create mode 100644 engine/strata/sycl/include/strata/sycl_doorbell.hpp create mode 100644 engine/strata/sycl/include/strata/sycl_math.hpp create mode 100644 engine/strata/sycl/include/strata/sycl_queue.hpp create mode 100644 engine/strata/sycl/probe/alias_scan.cpp create mode 100644 engine/strata/sycl/probe/arena_rw.cpp create mode 100644 engine/strata/sycl/probe/doorbell_store.cpp create mode 100644 engine/strata/sycl/probe/fp64_cost.cpp create mode 100644 engine/strata/sycl/probe/gemm_launch.cpp create mode 100644 engine/strata/sycl/probe/gemm_vary.cpp create mode 100644 engine/strata/sycl/probe/launch_cost.cpp create mode 100644 engine/strata/sycl/probe/payload_pairs.cpp create mode 100644 engine/strata/sycl/probe/router_fast.cpp create mode 100644 engine/strata/sycl/serve/server_intel.py create mode 100755 engine/strata/sycl/serve/strata-sycl.sh create mode 100644 engine/strata/sycl/serve/web/switcher.css create mode 100644 engine/strata/sycl/serve/web/switcher.js create mode 100644 engine/strata/sycl/serve/xe_telemetry.py create mode 100644 engine/strata/sycl/setup_intel.py create mode 100644 engine/strata/sycl/src/core/concurrent_main.cpp create mode 100644 engine/strata/sycl/src/core/conversation_snapshot.cpp create mode 100644 engine/strata/sycl/src/core/conversation_snapshot_test.cpp create mode 100644 engine/strata/sycl/src/core/conversation_state.cpp create mode 100644 engine/strata/sycl/src/core/copy_queue.cpp create mode 100644 engine/strata/sycl/src/core/device.dp.cpp create mode 100644 engine/strata/sycl/src/core/expert_cache.cpp create mode 100644 engine/strata/sycl/src/core/expert_source.cpp create mode 100644 engine/strata/sycl/src/core/gguf_expert_source.cpp create mode 100644 engine/strata/sycl/src/core/graph.cpp create mode 100644 engine/strata/sycl/src/core/layer.cpp create mode 100644 engine/strata/sycl/src/core/mtp.cpp create mode 100644 engine/strata/sycl/src/core/native_dense.cpp create mode 100644 engine/strata/sycl/src/core/native_head.cpp create mode 100644 engine/strata/sycl/src/core/overlap_main.cpp create mode 100644 engine/strata/sycl/src/core/peer_experts.cpp create mode 100644 engine/strata/sycl/src/core/pinned.dp.cpp create mode 100644 engine/strata/sycl/src/core/remote_expert_opt_stub.cpp create mode 100644 engine/strata/sycl/src/core/remote_experts.cpp create mode 100644 engine/strata/sycl/src/core/session.cpp create mode 100644 engine/strata/sycl/src/core/verify.cpp create mode 100644 engine/strata/sycl/src/core/vmm.cpp create mode 100644 engine/strata/sycl/src/core/weights.cpp create mode 100644 engine/strata/sycl/src/kernels/bf16_gemv_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/bf16_gemv.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/cvec.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/dequant_bf16.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/dequant_s2.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/elementwise.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/fused_gdn.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/fused_gr.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/gdn.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/gr.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/iq_kernels.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/kv_q4.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/kv_q8.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/kv_stream.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_bf16.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_flash_attn.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_gdn.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_gdn_preprocess.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_gr_norm.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_gr_postops.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_mmvq.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_moe.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_ple_postops.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_qsa.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_qsa_indexer.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_qsa_score.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_rope.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/native_router.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/ple.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/qsa.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/qsa_decode_attn.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/qsa_prompt_attn.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/qsa_prompt_attn_xmx.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/qsa_select.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/quantize_act.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/rope.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/router_top10.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/s26_tsum.dp.hpp create mode 100644 engine/strata/sycl/src/kernels/cuda/s2_expert_grouped.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/s2_gemv.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/s2_gemv_fast.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/s2_gemv_q8.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/s2_gemv_quads.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/s_gemv.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/sampler.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/shared_expert.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cuda/verify_kernels.dp.cpp create mode 100644 engine/strata/sycl/src/kernels/cvec_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/dense_bench.cpp create mode 100644 engine/strata/sycl/src/kernels/dequant_bench.cpp create mode 100644 engine/strata/sycl/src/kernels/dequant_bf16_test.cpp create mode 100644 engine/strata/sycl/src/kernels/dequant_s2_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/elementwise_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/esimd_dpas_probe.cpp create mode 100644 engine/strata/sycl/src/kernels/esimd_i8_bench.cpp create mode 100644 engine/strata/sycl/src/kernels/esimd_iq3s_decode_bench.cpp create mode 100644 engine/strata/sycl/src/kernels/esimd_moe_mode_test.cpp create mode 100644 engine/strata/sycl/src/kernels/esimd_moe_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/fused_gr_bench.cpp create mode 100644 engine/strata/sycl/src/kernels/gdn_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/gr_bench.cpp create mode 100644 engine/strata/sycl/src/kernels/gr_multi_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/gr_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/iq2xs_host_tables.inc create mode 100644 engine/strata/sycl/src/kernels/iq_multi_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/iq_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/kv_hybrid_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/kv_q4_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/kv_q8_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/kv_steps_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/kv_stream_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/mmvq_bench.cpp create mode 100644 engine/strata/sycl/src/kernels/mmvq_multi_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/mmvq_sg_bench.cpp create mode 100644 engine/strata/sycl/src/kernels/native_expert_bench.cpp create mode 100644 engine/strata/sycl/src/kernels/native_expert_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/native_grouped_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/native_multi_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/ple_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/q5_projection_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/q6k_align_bench.cpp create mode 100644 engine/strata/sycl/src/kernels/qsa_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/qsa_prompt_attn_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/qsa_select_bench.cpp create mode 100644 engine/strata/sycl/src/kernels/qsa_topk_active_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/qsa_topk_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/quantize_act_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/resident_plan_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/rope_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/route_window_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/router_top10_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/s2_expert_grouped_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/s2_gemv_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/s2_gemv_q8_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/s_gemv_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/s_gemv_q8k_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/sampler_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/shared_expert_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/tq_sycl_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/verify_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/xmx_gemm_bench.cpp create mode 100644 engine/strata/sycl/src/kernels/xmx_group_parity.cpp create mode 100644 engine/strata/sycl/src/kernels/xmx_int8_bench.cpp create mode 100644 engine/strata/sycl/src/ngram/ple_reader.cpp create mode 100644 engine/strata/sycl/src/platform/direct_file.cpp create mode 100644 engine/strata/sycl/src/prefill/esimd_moe.dp.cpp create mode 100644 engine/strata/sycl/src/prefill/gemm.dp.cpp create mode 100644 engine/strata/sycl/src/prefill/gemm_bf16_parity.dp.cpp create mode 100644 engine/strata/sycl/src/prefill/ggml_cuda_host.dp.cpp create mode 100644 engine/strata/sycl/src/prefill/iq_tables.inc create mode 100644 engine/strata/sycl/src/prefill/kernels.dp.cpp create mode 100644 engine/strata/sycl/src/prefill/moe_fused.dp.cpp create mode 100644 engine/strata/sycl/src/prefill/moe_fused_iq.dp.cpp create mode 100644 engine/strata/sycl/src/prefill/moe_fused_stub.cpp create mode 100644 engine/strata/sycl/src/prefill/moe_mmq.dp.cpp create mode 100644 engine/strata/sycl/src/prefill/prefill.cpp create mode 100644 engine/strata/sycl/src/prefill/xmx_moe.dp.cpp create mode 100644 engine/strata/sycl/src/program/generate.cpp create mode 100644 engine/strata/sycl/third_party/ggml/LICENSE create mode 100644 engine/strata/sycl/third_party/ggml/ggml-common.h create mode 100644 engine/strata/sycl/tools/Dockerfile create mode 100644 engine/strata/sycl/tools/Dockerfile.unitrace create mode 100755 engine/strata/sycl/tools/build.sh create mode 100644 engine/strata/sycl/tools/data/prompt_deadlock_2744.tok create mode 100644 engine/strata/sycl/tools/fixups.py create mode 100755 engine/strata/sycl/tools/get-cuda-headers.sh create mode 100644 engine/strata/sycl/tools/gpustat.py create mode 100644 engine/strata/sycl/tools/gpustat.service create mode 100644 engine/strata/sycl/tools/merge_upstream.py create mode 100755 engine/strata/sycl/tools/migrate.sh create mode 100755 engine/strata/sycl/tools/normalize.sh create mode 100644 engine/strata/sycl/tools/test_prompt_deadlock.sh create mode 100644 engine/strata/tests/core/batch_rows_test.cpp create mode 100644 engine/strata/tests/core/dequant_q5_1_test.cpp create mode 100644 engine/strata/tests/core/dma_batch_parity.cu create mode 100644 engine/strata/tests/core/exchange_storage_test.cpp create mode 100644 engine/strata/tests/core/expert_cache_segmented_test.cpp create mode 100644 engine/strata/tests/core/expert_cache_slot_guard_test.cpp create mode 100644 engine/strata/tests/core/expert_profile_save_test.cpp create mode 100644 engine/strata/tests/core/expert_profile_version_test.cpp create mode 100644 engine/strata/tests/core/gguf_geometry_test.cpp create mode 100644 engine/strata/tests/core/host_graph_launch_test.cu create mode 100644 engine/strata/tests/core/memory_guard_test.cpp create mode 100644 engine/strata/tests/core/model_family_test.cpp create mode 100644 engine/strata/tests/core/split_lend_complement_test.cpp create mode 100644 engine/strata/tests/core/vmm_test.cpp create mode 100644 engine/strata/tests/cuda/pa_bench.cpp create mode 100644 engine/strata/tests/cuda/prefill_fused_iq_test.cpp create mode 100644 engine/strata/tests/cuda/prefill_fused_moe_test.cpp create mode 100644 engine/strata/tests/cuda/prefill_mmq_scatter_test.cpp create mode 100644 engine/strata/tests/cuda/prefill_mmq_tab_test.cu create mode 100644 engine/strata/tests/data/gpu_roles_vectors.json create mode 100644 engine/strata/tests/desktop/test_app_version.py create mode 100644 engine/strata/tests/desktop/test_control_install.py create mode 100644 engine/strata/tests/desktop/test_fetch_node.py create mode 100644 engine/strata/tests/desktop/test_nsis_layout.py create mode 100644 engine/strata/tests/desktop/test_tester_readme.py create mode 100644 engine/strata/tests/dsv41/ds4_cpu_bench.cpp create mode 100644 engine/strata/tests/dsv41/ds4_gguf_test.cu create mode 100644 engine/strata/tests/dsv41/ds4_mx_bench.cpp create mode 100644 engine/strata/tests/dsv41/experts_rule_test.cpp create mode 100644 engine/strata/tests/dsv41/gg_dot_bench.cpp create mode 100644 engine/strata/tests/dsv41/iq_expert_test.cpp create mode 100644 engine/strata/tests/dsv41/pick_rule_test.cpp create mode 100644 engine/strata/tests/dsv41/slot_test.cpp create mode 100644 engine/strata/tests/dsv41/store_test.cpp create mode 100644 engine/strata/tests/dsv41/tq_expert_test.cpp create mode 100644 engine/strata/tests/dsv41/tqw_hip_test.cpp create mode 100644 engine/strata/tests/hip/gdn_chunked.cpp create mode 100644 engine/strata/tests/hip/gdn_rec_head.cpp create mode 100644 engine/strata/tests/hip/gemm_f16_io_parity.cpp create mode 100644 engine/strata/tests/hip/prefill_gemm.cpp create mode 100644 engine/strata/tests/hip/prefill_gr_write_bench.cpp create mode 100644 engine/strata/tests/hip/prefill_hcd_exact_parity.cpp create mode 100644 engine/strata/tests/hip/prefill_rocblas_gemm.cpp create mode 100644 engine/strata/tests/hip/prefill_wmma_gemm_parity.cpp create mode 100644 engine/strata/tests/hip/q2_zero.cpp create mode 100644 engine/strata/tests/platform/aux_cpus_test.cpp create mode 100644 engine/strata/tests/platform/host_limits_test.cpp create mode 100644 engine/strata/tests/prefill/share_rules_test.cpp create mode 100644 engine/strata/tests/prefill/tuning_header_arch_family_test.cpp create mode 100644 engine/strata/tests/program/batch_read_test.cpp create mode 100644 engine/strata/tests/program/prefill_plan_test.cpp create mode 100644 engine/strata/tests/program/split_rules_test.cpp create mode 100644 engine/strata/tests/sycl/test_setup_intel_prefill.py create mode 100644 engine/strata/tests/terminal/data/windows_package_paths.json create mode 100644 engine/strata/tests/terminal/launch_previews.py create mode 100644 engine/strata/tests/terminal/launch_support.py create mode 100644 engine/strata/tests/terminal/lifecycle_matrix.py create mode 100644 engine/strata/tests/terminal/ssh_disconnect.py create mode 100644 engine/strata/tests/terminal/test_app_isolation.py create mode 100644 engine/strata/tests/terminal/test_app_prerelease_version.py create mode 100644 engine/strata/tests/terminal/test_archive_gaps.py create mode 100644 engine/strata/tests/terminal/test_bench.py create mode 100644 engine/strata/tests/terminal/test_bench_standard.py create mode 100644 engine/strata/tests/terminal/test_bundle_imports.py create mode 100644 engine/strata/tests/terminal/test_bundle_tools_paths.py create mode 100644 engine/strata/tests/terminal/test_calibration.py create mode 100644 engine/strata/tests/terminal/test_cloudflared_find.py create mode 100644 engine/strata/tests/terminal/test_component_start.py create mode 100644 engine/strata/tests/terminal/test_connections.py create mode 100644 engine/strata/tests/terminal/test_cpu_topology.py create mode 100644 engine/strata/tests/terminal/test_data_dir_choice.py create mode 100644 engine/strata/tests/terminal/test_discovery.py create mode 100644 engine/strata/tests/terminal/test_disk_space.py create mode 100644 engine/strata/tests/terminal/test_docker_fetch.py create mode 100644 engine/strata/tests/terminal/test_docker_files.py create mode 100644 engine/strata/tests/terminal/test_download_integrity.py create mode 100644 engine/strata/tests/terminal/test_drafting.py create mode 100644 engine/strata/tests/terminal/test_drain.py create mode 100644 engine/strata/tests/terminal/test_dsv41_engine.py create mode 100644 engine/strata/tests/terminal/test_dsv41_import_preview.py create mode 100644 engine/strata/tests/terminal/test_dsv41_own_files_and_mmproj.py create mode 100644 engine/strata/tests/terminal/test_dsv41_tui_items.py create mode 100644 engine/strata/tests/terminal/test_dsv41_tune.py create mode 100644 engine/strata/tests/terminal/test_dsv41_upgrade.py create mode 100644 engine/strata/tests/terminal/test_engine_component.py create mode 100644 engine/strata/tests/terminal/test_engine_deps.py create mode 100644 engine/strata/tests/terminal/test_engine_manifest.py create mode 100644 engine/strata/tests/terminal/test_engine_smoke.py create mode 100644 engine/strata/tests/terminal/test_file_in_use.py create mode 100644 engine/strata/tests/terminal/test_flow2_022.py create mode 100644 engine/strata/tests/terminal/test_folders_home.py create mode 100644 engine/strata/tests/terminal/test_gfx_selection.py create mode 100644 engine/strata/tests/terminal/test_gpu_fit.py create mode 100644 engine/strata/tests/terminal/test_gpu_roles.py create mode 100644 engine/strata/tests/terminal/test_handover.py create mode 100644 engine/strata/tests/terminal/test_hipblaslt_tuning.py create mode 100644 engine/strata/tests/terminal/test_import_projector.py create mode 100644 engine/strata/tests/terminal/test_install_engine_file.py create mode 100644 engine/strata/tests/terminal/test_install_scripts_env.py create mode 100644 engine/strata/tests/terminal/test_issues_022.py create mode 100644 engine/strata/tests/terminal/test_launch.py create mode 100644 engine/strata/tests/terminal/test_launch_dsv41.py create mode 100644 engine/strata/tests/terminal/test_launch_engine_first.py create mode 100644 engine/strata/tests/terminal/test_launch_identity.py create mode 100644 engine/strata/tests/terminal/test_launch_install.py create mode 100644 engine/strata/tests/terminal/test_launch_monitor.py create mode 100644 engine/strata/tests/terminal/test_launch_old_gpus.py create mode 100644 engine/strata/tests/terminal/test_launch_speed.py create mode 100644 engine/strata/tests/terminal/test_launch_tui.py create mode 100644 engine/strata/tests/terminal/test_launch_tui_walk.py create mode 100644 engine/strata/tests/terminal/test_lifecycle_matrix.py create mode 100644 engine/strata/tests/terminal/test_loader_diag.py create mode 100644 engine/strata/tests/terminal/test_logs.py create mode 100644 engine/strata/tests/terminal/test_longpath.py create mode 100644 engine/strata/tests/terminal/test_loopback.py create mode 100644 engine/strata/tests/terminal/test_make_guard.py create mode 100644 engine/strata/tests/terminal/test_migration.py create mode 100644 engine/strata/tests/terminal/test_mixed_vendors.py create mode 100644 engine/strata/tests/terminal/test_model_id_dot.py create mode 100644 engine/strata/tests/terminal/test_models.py create mode 100644 engine/strata/tests/terminal/test_models_move.py create mode 100644 engine/strata/tests/terminal/test_monitor_bundle.py create mode 100644 engine/strata/tests/terminal/test_monitor_classic.py create mode 100644 engine/strata/tests/terminal/test_no_acquisition.py create mode 100644 engine/strata/tests/terminal/test_overview.py create mode 100644 engine/strata/tests/terminal/test_own_files.py create mode 100644 engine/strata/tests/terminal/test_owner_transport.py create mode 100644 engine/strata/tests/terminal/test_pack_gguf_engram.py create mode 100644 engine/strata/tests/terminal/test_packaging_pins.py create mode 100644 engine/strata/tests/terminal/test_picture_reader_package.py create mode 100644 engine/strata/tests/terminal/test_posix_owner.py create mode 100644 engine/strata/tests/terminal/test_private_files.py create mode 100644 engine/strata/tests/terminal/test_procs.py create mode 100644 engine/strata/tests/terminal/test_profiles.py create mode 100644 engine/strata/tests/terminal/test_progress_words.py create mode 100644 engine/strata/tests/terminal/test_read_small_retry.py create mode 100644 engine/strata/tests/terminal/test_ready.py create mode 100644 engine/strata/tests/terminal/test_recipes.py create mode 100644 engine/strata/tests/terminal/test_release_config.py create mode 100644 engine/strata/tests/terminal/test_release_keys.py create mode 100644 engine/strata/tests/terminal/test_release_matrix.py create mode 100644 engine/strata/tests/terminal/test_round8_fixes.py create mode 100644 engine/strata/tests/terminal/test_runtime.py create mode 100644 engine/strata/tests/terminal/test_setup_failure_words.py create mode 100644 engine/strata/tests/terminal/test_shared_models_folder.py create mode 100644 engine/strata/tests/terminal/test_size_label.py create mode 100644 engine/strata/tests/terminal/test_state_paths.py create mode 100644 engine/strata/tests/terminal/test_sycl_package.py create mode 100644 engine/strata/tests/terminal/test_terminal.py create mode 100644 engine/strata/tests/terminal/test_terminal_commit.py create mode 100644 engine/strata/tests/terminal/test_terminal_polish.py create mode 100644 engine/strata/tests/terminal/test_tls_trust.py create mode 100644 engine/strata/tests/terminal/test_tui2_023_install.py create mode 100644 engine/strata/tests/terminal/test_tui2_023_messages.py create mode 100644 engine/strata/tests/terminal/test_tui2_023_old_launcher.py create mode 100644 engine/strata/tests/terminal/test_tui2_023_plan.py create mode 100644 engine/strata/tests/terminal/test_tui2_023_shards.py create mode 100644 engine/strata/tests/terminal/test_tui2_023_versions.py create mode 100644 engine/strata/tests/terminal/test_tui3.py create mode 100644 engine/strata/tests/terminal/test_tui_stress.py create mode 100644 engine/strata/tests/terminal/test_tui_stress_launch.py create mode 100644 engine/strata/tests/terminal/test_tui_stress_screens.py create mode 100644 engine/strata/tests/terminal/test_tuiqa_browser.py create mode 100644 engine/strata/tests/terminal/test_tuiqa_connect_cli.py create mode 100644 engine/strata/tests/terminal/test_tuiqa_launch.py create mode 100644 engine/strata/tests/terminal/test_tuiqa_monitor.py create mode 100644 engine/strata/tests/terminal/test_tuiqa_version.py create mode 100644 engine/strata/tests/terminal/test_tuiqa_wizard.py create mode 100644 engine/strata/tests/terminal/test_update_feed.py create mode 100644 engine/strata/tests/terminal/test_update_feed_memory.py create mode 100644 engine/strata/tests/terminal/test_update_rules_022.py create mode 100644 engine/strata/tests/terminal/test_updater.py create mode 100644 engine/strata/tests/terminal/test_vision_gguf_meta.py create mode 100644 engine/strata/tests/terminal/test_visual_detail.py create mode 100644 engine/strata/tests/terminal/test_vram_fit.py create mode 100644 engine/strata/tests/terminal/update_fixture.py create mode 100644 engine/strata/tests/time_skip/.gitignore create mode 100644 engine/strata/tests/time_skip/test_apply_attempt.py create mode 100644 engine/strata/tests/time_skip/test_atomic.py create mode 100644 engine/strata/tests/time_skip/test_time_skip.py create mode 100644 engine/strata/tests/tuning/stub_engine.py create mode 100644 engine/strata/tests/tuning/stub_session.py create mode 100644 engine/strata/tests/tuning/test_autotune.py create mode 100644 engine/strata/tests/tuning/test_components.py create mode 100644 engine/strata/tests/tuning/test_offline.py create mode 100644 engine/strata/tests/tuning/test_preset_persistence.py create mode 100644 engine/strata/tests/tuning/test_presets.py create mode 100644 engine/strata/tests/tuning/test_session.py create mode 100644 engine/strata/tests/tuning/test_tune_api.py create mode 100644 engine/strata/tests/tuning/test_tune_apply.py create mode 100644 engine/strata/tests/tuning/test_tune_engine.py create mode 100644 engine/strata/tests/tuning/test_tune_history.py create mode 100644 engine/strata/tests/tuning/test_tuning.py create mode 100644 engine/strata/third_party/ggml-tq/tq-mmq-tiles.cuh create mode 100644 engine/strata/third_party/ggml-tq/tq.cuh create mode 100644 engine/strata/third_party/ggml/ggml-common-tq.h create mode 100644 engine/strata/third_party/project-maya/LICENSE create mode 100644 engine/strata/third_party/project-maya/NOTICE.md create mode 100644 engine/strata/tools/ab_engine.py create mode 100644 engine/strata/tools/agent_turns_bench.py create mode 100644 engine/strata/tools/batch_groups_cache_test.py create mode 100644 engine/strata/tools/batch_interleave_test.py create mode 100644 engine/strata/tools/batch_test.py create mode 100644 engine/strata/tools/bench_eviction.py create mode 100644 engine/strata/tools/build_standard_corpus.py create mode 100644 engine/strata/tools/cancel_park_test.py create mode 100644 engine/strata/tools/check_isa_guard.py create mode 100644 engine/strata/tools/collect_profile_traces.py create mode 100644 engine/strata/tools/conversation_restore_speed.py create mode 100644 engine/strata/tools/dflash2/README.md create mode 100644 engine/strata/tools/dflash2/analyze2.py create mode 100644 engine/strata/tools/dflash2/dflash2_ref.py create mode 100644 engine/strata/tools/dflash2/final_tables.py create mode 100644 engine/strata/tools/dflash2/mk_parity_case.py create mode 100644 engine/strata/tools/dflash2/mk_prompts.py create mode 100644 engine/strata/tools/dflash2/orch.py create mode 100644 engine/strata/tools/dflash2/q8test.py create mode 100644 engine/strata/tools/dflash2/run_all2.py create mode 100644 engine/strata/tools/dflash2/run_eval.py create mode 100644 engine/strata/tools/dflash2/run_one.ps1 create mode 100644 engine/strata/tools/dflash2/test_port.py create mode 100644 engine/strata/tools/dflash2_pack.py create mode 100644 engine/strata/tools/dsv41/build_hip_linux.sh create mode 100644 engine/strata/tools/dsv41/bytecheck.sh create mode 100644 engine/strata/tools/dsv41/compare.py create mode 100644 engine/strata/tools/dsv41/dense_requant.py create mode 100644 engine/strata/tools/dsv41/download-3.5bpw.json create mode 100644 engine/strata/tools/dsv41/download.json create mode 100644 engine/strata/tools/dsv41/download_gguf.json create mode 100644 engine/strata/tools/dsv41/drafter_pack.py create mode 100644 engine/strata/tools/dsv41/dspark_ref.py create mode 100644 engine/strata/tools/dsv41/dumpcmp.py create mode 100644 engine/strata/tools/dsv41/dumpscan.py create mode 100644 engine/strata/tools/dsv41/dumpscan_y.py create mode 100644 engine/strata/tools/dsv41/engram_fold.py create mode 100644 engine/strata/tools/dsv41/engram_hash.py create mode 100644 engine/strata/tools/dsv41/engram_iq4nl_bench.py create mode 100644 engine/strata/tools/dsv41/ista_intake.py create mode 100644 engine/strata/tools/dsv41/make_imatrix.py create mode 100644 engine/strata/tools/dsv41/mkimg.py create mode 100644 engine/strata/tools/dsv41/mkprompts.py create mode 100644 engine/strata/tools/dsv41/pack_gguf.py create mode 100644 engine/strata/tools/dsv41/recipe_maya_s_test.json create mode 100644 engine/strata/tools/dsv41/ref.py create mode 100644 engine/strata/tools/dsv41/ref_gguf.py create mode 100644 engine/strata/tools/dsv41/requant_gguf.py create mode 100644 engine/strata/tools/dsv41/serve_prompts.py create mode 100644 engine/strata/tools/dsv41/slot_keep_test.py create mode 100644 engine/strata/tools/dsv41/smoke.py create mode 100644 engine/strata/tools/dsv41/st.py create mode 100644 engine/strata/tools/dsv41/test_prompt_skip.py create mode 100644 engine/strata/tools/dsv41/tok.py create mode 100644 engine/strata/tools/dsv41/tq_convert.py create mode 100644 engine/strata/tools/dsv41/tune.py create mode 100644 engine/strata/tools/dsv41/vision_pack.py create mode 100644 engine/strata/tools/dsv41/win/build_hip_win.bat create mode 100644 engine/strata/tools/dsv41/win/build_umaprobe.bat create mode 100644 engine/strata/tools/dsv41/win/cachesim.py create mode 100644 engine/strata/tools/dsv41/win/h100sim.py create mode 100644 engine/strata/tools/dsv41/win/hwbench.cu create mode 100644 engine/strata/tools/dsv41/win/predsim.py create mode 100644 engine/strata/tools/dsv41/win/umaprobe.cpp create mode 100644 engine/strata/tools/dsv41_lab/attn_split.cuh create mode 100644 engine/strata/tools/dsv41_lab/build.sh create mode 100644 engine/strata/tools/dsv41_lab/code_sqnr.cpp create mode 100644 engine/strata/tools/dsv41_lab/computed_codes.hpp create mode 100644 engine/strata/tools/dsv41_lab/ds4_lab.cu create mode 100644 engine/strata/tools/dsv41_lab/hip/README.md create mode 100644 engine/strata/tools/dsv41_lab/hip/tqk_gemv_wmma.hip.cpp create mode 100644 engine/strata/tools/dsv41_lab/hip/wmma_probe.hip.cpp create mode 100644 engine/strata/tools/dsv41_lab/tqk_gemv.cuh create mode 100644 engine/strata/tools/dsv41_lab/tqk_gemv3.cuh create mode 100644 engine/strata/tools/dsv41_lab/tqk_gemv_c.cuh create mode 100644 engine/strata/tools/dsv41_lab/tqk_lab.cu create mode 100644 engine/strata/tools/dsv41_lab/tqk_repack.hpp create mode 100644 engine/strata/tools/dsv41_lab/wmma_emu.hpp create mode 100644 engine/strata/tools/dsv41_lab/wmma_emu_test.cpp create mode 100644 engine/strata/tools/early_close_test.py create mode 100644 engine/strata/tools/h2d_bench.cu create mode 100644 engine/strata/tools/harness_reuse_probe.py create mode 100644 engine/strata/tools/hf_pin_fetch.py create mode 100644 engine/strata/tools/hip/dll_closure.py create mode 100644 engine/strata/tools/hip/gfx1030-rocblas-5.6.0.8d1ae90e.txt create mode 100644 engine/strata/tools/hip/gfx1100-hipblaslt-100202.txt create mode 100644 engine/strata/tools/hip/gfx1100-hipblaslt-100401.txt create mode 100644 engine/strata/tools/hip/gfx1100-hipblaslt-100500.txt create mode 100644 engine/strata/tools/hip/gfx1103-hipblaslt-100401.txt create mode 100644 engine/strata/tools/hip/gfx1150-hipblaslt-100401.txt create mode 100644 engine/strata/tools/hip/gfx1150-hipblaslt-100500.txt create mode 100644 engine/strata/tools/hip/gfx1151-hipblaslt-100400.txt create mode 100644 engine/strata/tools/hip/gfx1151-hipblaslt-100401.txt create mode 100644 engine/strata/tools/hip/gfx1151-hipblaslt-100500.txt create mode 100644 engine/strata/tools/hip/gfx1200-hipblaslt-100202.txt create mode 100644 engine/strata/tools/hip/gfx1201-hipblaslt-100202.txt create mode 100644 engine/strata/tools/hip/tune_rocblas.cpp create mode 100644 engine/strata/tools/idle_gpu_ab.py create mode 100644 engine/strata/tools/image/install.py create mode 100644 engine/strata/tools/image/qimage.py create mode 100644 engine/strata/tools/image/sdcpp_native/apply.py create mode 100644 engine/strata/tools/image/sdcpp_native/qi21-native.cu create mode 100644 engine/strata/tools/image/sdcpp_native/qwen_image_2_1_native.hpp create mode 100644 engine/strata/tools/logit_bias_english_example.py create mode 100644 engine/strata/tools/logit_bias_http_probe.py create mode 100644 engine/strata/tools/make_profile_mix.py create mode 100644 engine/strata/tools/minimal_cli_smoke.py create mode 100644 engine/strata/tools/minimal_server_smoke.py create mode 100644 engine/strata/tools/monitor_soak.py create mode 100644 engine/strata/tools/nvfp4_convert.py create mode 100644 engine/strata/tools/nvfp4_local_pack.py create mode 100644 engine/strata/tools/nvfp4_verify.py create mode 100644 engine/strata/tools/nvfp4_verify_gguf.py create mode 100644 engine/strata/tools/parking_test.py create mode 100644 engine/strata/tools/piped_read_join_bench.py create mode 100644 engine/strata/tools/portable_monitor_pty_smoke.py create mode 100644 engine/strata/tools/portable_monitor_smoke.py create mode 100644 engine/strata/tools/q8_dense_gguf.py create mode 100644 engine/strata/tools/q8_sm60_check.cu create mode 100644 engine/strata/tools/quant_bound.py create mode 100644 engine/strata/tools/quant_formats.py create mode 100644 engine/strata/tools/quant_quality.py create mode 100644 engine/strata/tools/quantscope.py create mode 100644 engine/strata/tools/qwen35/compare_dumps.py create mode 100644 engine/strata/tools/qwen35/kl.py create mode 100644 engine/strata/tools/qwen35/make_big_picture.py create mode 100644 engine/strata/tools/qwen35/parity.py create mode 100644 engine/strata/tools/qwen35/parity_prompts.ids create mode 100644 engine/strata/tools/qwen35/parity_prompts.json create mode 100644 engine/strata/tools/qwen35/pictures/big1024.png create mode 100644 engine/strata/tools/qwen35/pictures/code4217.png create mode 100644 engine/strata/tools/qwen35/pictures/shapes.png create mode 100644 engine/strata/tools/qwen35/q36_batch_gate.py create mode 100644 engine/strata/tools/qwen35/q36_cmp_gate.py create mode 100644 engine/strata/tools/qwen35/q36_harness.py create mode 100644 engine/strata/tools/qwen35/q36_interleave_probe.py create mode 100644 engine/strata/tools/qwen35/q36_lgcmp.py create mode 100644 engine/strata/tools/qwen35/q36_llama_dump.cpp create mode 100644 engine/strata/tools/qwen35/q36_mtmd_dump.cpp create mode 100644 engine/strata/tools/qwen35/q36_multilingual_prompts.py create mode 100644 engine/strata/tools/qwen35/q36_par_bench.py create mode 100644 engine/strata/tools/qwen35/q36_proto_edge.py create mode 100644 engine/strata/tools/qwen35/q36_serve_handoff.py create mode 100644 engine/strata/tools/qwen35/q36_serve_par.py create mode 100644 engine/strata/tools/qwen35/q36_solo_gate.py create mode 100644 engine/strata/tools/qwen35/q36_venc.py create mode 100644 engine/strata/tools/qwen35/q36_vision_cmp.py create mode 100644 engine/strata/tools/qwen35/q36_vision_proto.py create mode 100644 engine/strata/tools/qwen35/q36_vision_serve.py create mode 100644 engine/strata/tools/qwen35/q36_vram_refusal.py create mode 100644 engine/strata/tools/replay_cache_policy.py create mode 100644 engine/strata/tools/research_run.py create mode 100644 engine/strata/tools/serve_load.py create mode 100644 engine/strata/tools/session_pressure_test.py create mode 100644 engine/strata/tools/sm60_dp4a_check.cu create mode 100755 engine/strata/tools/split_mtp_batch_parity.py create mode 100644 engine/strata/tools/stop_resend_test.py create mode 100644 engine/strata/tools/strata_bench.py create mode 100644 engine/strata/tools/strata_inspect.py create mode 100644 engine/strata/tools/test_bench_eviction.py create mode 100644 engine/strata/tools/test_bench_host.py create mode 100644 engine/strata/tools/test_check_isa_guard.py create mode 100644 engine/strata/tools/test_conversation_restore_speed.py create mode 100644 engine/strata/tools/test_cyrillic_paths.py create mode 100644 engine/strata/tools/test_dflash2_pack.py create mode 100644 engine/strata/tools/test_dll_closure.py create mode 100644 engine/strata/tools/test_docker_entrypoint.py create mode 100644 engine/strata/tools/test_draft_vocab.py create mode 100644 engine/strata/tools/test_effort_end_args.py create mode 100644 engine/strata/tools/test_gfx906_build_files.py create mode 100644 engine/strata/tools/test_gguf_paths.py create mode 100644 engine/strata/tools/test_make_profile.py create mode 100644 engine/strata/tools/test_make_profile_mix.py create mode 100644 engine/strata/tools/test_nvfp4_local_pack.py create mode 100644 engine/strata/tools/test_picture_defaults.py create mode 100644 engine/strata/tools/test_pool_plan.py create mode 100644 engine/strata/tools/test_qimage.py create mode 100644 engine/strata/tools/test_research_run.py create mode 100644 engine/strata/tools/test_setup_bench_tips.py create mode 100644 engine/strata/tools/test_setup_compute_mode.py create mode 100644 engine/strata/tools/test_setup_config.py create mode 100644 engine/strata/tools/test_setup_configs.py create mode 100644 engine/strata/tools/test_setup_cuda_repo.py create mode 100644 engine/strata/tools/test_setup_dl_fix.py create mode 100644 engine/strata/tools/test_setup_download.py create mode 100644 engine/strata/tools/test_setup_dsv41.py create mode 100644 engine/strata/tools/test_setup_engine_hash.py create mode 100644 engine/strata/tools/test_setup_engine_keep.py create mode 100644 engine/strata/tools/test_setup_feed_engine.py create mode 100644 engine/strata/tools/test_setup_find_tool.py create mode 100644 engine/strata/tools/test_setup_gpu_fit.py create mode 100644 engine/strata/tools/test_setup_gyro.py create mode 100644 engine/strata/tools/test_setup_hotfix_tag.py create mode 100644 engine/strata/tools/test_setup_hybrid.py create mode 100644 engine/strata/tools/test_setup_llama_archive.py create mode 100644 engine/strata/tools/test_setup_mac.py create mode 100644 engine/strata/tools/test_setup_menu.py create mode 100644 engine/strata/tools/test_setup_model_pins.py create mode 100644 engine/strata/tools/test_setup_modelscope.py create mode 100644 engine/strata/tools/test_setup_nvfp4.py create mode 100644 engine/strata/tools/test_setup_oldcpu.py create mode 100644 engine/strata/tools/test_setup_older_gpus.py create mode 100644 engine/strata/tools/test_setup_ownfiles.py create mode 100644 engine/strata/tools/test_setup_page_file.py create mode 100644 engine/strata/tools/test_setup_parallel.py create mode 100644 engine/strata/tools/test_setup_pcie.py create mode 100644 engine/strata/tools/test_setup_qwen36.py create mode 100644 engine/strata/tools/test_setup_remote_opt.py create mode 100644 engine/strata/tools/test_setup_rerun_size.py create mode 100644 engine/strata/tools/test_setup_rocm_indexes.json create mode 100644 engine/strata/tools/test_setup_rocm_pins.py create mode 100644 engine/strata/tools/test_setup_shard_check.py create mode 100644 engine/strata/tools/test_setup_small_card.py create mode 100644 engine/strata/tools/test_setup_stale_stamp.py create mode 100644 engine/strata/tools/test_setup_stall_note.py create mode 100644 engine/strata/tools/test_setup_start_gpus_amd.py create mode 100644 engine/strata/tools/test_setup_strix_halo.py create mode 100644 engine/strata/tools/test_setup_sycl.py create mode 100644 engine/strata/tools/test_setup_update.py create mode 100644 engine/strata/tools/test_setup_update_gpu.py create mode 100644 engine/strata/tools/test_source_nul_bytes.py create mode 100644 engine/strata/tools/test_strata_bench.py create mode 100644 engine/strata/tools/test_strata_inspect.py create mode 100644 engine/strata/tools/test_strata_tokenizer.py create mode 100644 engine/strata/tools/test_sycl_build_guard.py create mode 100644 engine/strata/tools/test_tokenizer_plain_spans.py create mode 100644 engine/strata/tools/test_user_args.py create mode 100644 engine/strata/tools/test_vision_reader.py create mode 100644 engine/strata/tools/test_windows_amd_gpu.py create mode 100644 engine/strata/tools/tqenc.py create mode 100644 engine/strata/tools/trellis/README.md create mode 100644 engine/strata/tools/trellis/blockldl.py create mode 100644 engine/strata/tools/trellis/build.sh create mode 100644 engine/strata/tools/trellis/build_swap.py create mode 100644 engine/strata/tools/trellis/fetch_orig.py create mode 100644 engine/strata/tools/trellis/gyro_column_profile.py create mode 100644 engine/strata/tools/trellis/gyro_error_profile.py create mode 100644 engine/strata/tools/trellis/gyro_reencode.py create mode 100644 engine/strata/tools/trellis/gyro_vs_original.py create mode 100644 engine/strata/tools/trellis/hf_slice.py create mode 100644 engine/strata/tools/trellis/make_corpus.py create mode 100644 engine/strata/tools/trellis/merge_dumps.py create mode 100644 engine/strata/tools/trellis/pilot.py create mode 100644 engine/strata/tools/trellis/pilot_summary.py create mode 100644 engine/strata/tools/trellis/proxy_diag_error.py create mode 100644 engine/strata/tools/trellis/proxy_ldl.py create mode 100644 engine/strata/tools/trellis/run_parts.py create mode 100644 engine/strata/tools/trellis/sanity_greedy.py create mode 100644 engine/strata/tools/trellis/swap_compare.py create mode 100644 engine/strata/tools/trellis/test_blockldl.py create mode 100644 engine/strata/tools/trellis/test_tqenc_py.py create mode 100644 engine/strata/tools/trellis/tqenc.cpp create mode 100644 engine/strata/tools/trellis/tqenc.hpp create mode 100644 engine/strata/tools/trellis/tqenc_hip.cpp create mode 100644 engine/strata/tools/trellis/tqenc_hip_test.cpp create mode 100644 engine/strata/tools/trellis/tqenc_test.cpp create mode 100644 engine/strata/tools/vision/gguf_meta.h create mode 100644 engine/strata/tools/vision/gguf_meta_test.cpp create mode 100644 engine/strata/tools/vision/gpu_arch.h create mode 100644 engine/strata/tools/vision/gpu_arch_test.cpp create mode 100644 engine/strata/tools/vision/strata-utf8.manifest create mode 100644 engine/strata/tools/windows/enable_large_pages.ps1 create mode 100755 engine/strata/update.sh diff --git a/engine/strata/.gitattributes b/engine/strata/.gitattributes index 466d97e8..e9e15ba7 100644 --- a/engine/strata/.gitattributes +++ b/engine/strata/.gitattributes @@ -4,6 +4,24 @@ bench/prompts/** -text # launchers keep their platform line endings wherever the repository is cloned *.sh text eol=lf *.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf +bin/strata text eol=lf # copies of real packs' native_experts.txt, parsed byte for byte by tests/core/expert_layout_test.cpp tests/data/native_experts/** -text + +# the quant yardstick's text set: tokenized byte for byte (set.ids.json), never convert its line endings +data/quant_quality/** -text + +# the license text is shipped and checked as LF text on every checkout +LICENSE text eol=lf + +# container scripts run in Linux: always LF +docker/*.sh text eol=lf +Dockerfile text eol=lf +docker/Dockerfile text eol=lf +docker/compose/* text eol=lf + +# Apple tools (codesign, plutil) read these: LF only, wherever the repository is cloned +*.plist text eol=lf diff --git a/engine/strata/.github/ISSUE_TEMPLATE/benchmark.yml b/engine/strata/.github/ISSUE_TEMPLATE/benchmark.yml new file mode 100644 index 00000000..2d2514b7 --- /dev/null +++ b/engine/strata/.github/ISSUE_TEMPLATE/benchmark.yml @@ -0,0 +1,26 @@ +name: Benchmark +description: Share measurements from your machine, or report a problem with the benchmark tools +title: "[Benchmark] " +labels: ["benchmark"] +body: + - type: markdown + value: | + The title must start with **[Benchmark]**. Keep it, and add the GPU and model after it. + + To share a full report, follow the [community benchmark guide](https://github.com/Niko1221/Strata/blob/main/docs/COMMUNITY_BENCHMARKS.md) and open a results-only pull request. The standard protocol is a [draft](https://github.com/Niko1221/Strata/blob/main/docs/BENCHMARK_PROTOCOL.md); existing tools do not implement it yet. Include poor results and failed requests. + - type: textarea + id: what + attributes: + label: What did you measure, or what went wrong + description: Hardware (GPU and VRAM, CPU, RAM, OS), Strata version, model and quantization, the exact command, and the numbers. Paste the report or link the pull request. + validations: + required: true + - type: dropdown + id: reproduction-status + attributes: + label: Reproduction status + options: + - Measured locally + - Unconfirmed (I did not run it) + validations: + required: true diff --git a/engine/strata/.github/ISSUE_TEMPLATE/bug_report.yml b/engine/strata/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..77692fbe --- /dev/null +++ b/engine/strata/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,101 @@ +name: Bug report +description: Something in Strata doesn't work as documented +title: "[Area] " +labels: ["bug"] +body: + - type: markdown + value: | + Thanks for the report. Please read [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md) first. + + Search the [open and closed issues](https://github.com/Niko1221/Strata/issues?q=is%3Aissue) first: this may already be tracked, and new evidence belongs in that thread. + + Write only what you saw. Do not guess at steps, errors, hardware or severity. + + **The title must start with its area:** [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. Choose the same one below. + - type: dropdown + id: area + attributes: + label: Area + description: Start the issue title with the same area in square brackets, for example "[Engine] decode stops after 2 minutes". Pick Other if none fits. + options: + - "[Engine] (speed, kernels, models, the server and API)" + - "[GUI] (the desktop app)" + - "[TUI] (the Terminal: strata launch, connect, monitor)" + - "[Benchmark] (measurements and reports)" + - "[Docs] (documentation)" + - "[Other] (anything else, including setup and installation)" + validations: + required: true + - type: dropdown + id: how + attributes: + label: Desktop app, Terminal or source? + options: + - Desktop app (Windows, Linux or Mac) + - Terminal (the `strata` command) + - Source (START-HERE.bat, setup.sh or a build) + - Docker + - Other + validations: + required: true + - type: textarea + id: what + attributes: + label: What happened + description: What you did, what you got, and what you expected instead. Paste the exact error text if there is one. + validations: + required: true + - type: textarea + id: reproduce + attributes: + label: Smallest steps or command that reproduce it + description: The shortest list of steps that shows the problem. If you cannot make it happen again, say so here. + validations: + required: false + - type: dropdown + id: reproduction-status + attributes: + label: Reproduction status + options: + - Reproduced locally + - Unconfirmed static analysis (I read code or ran a scanner; I did not see it fail) + validations: + required: true + - type: input + id: version + attributes: + label: Strata version + description: "In the app: Settings > About. In the Terminal: `strata --version`. From source: the About tab of the web page, or `engine` in `GET /v1/status`, or the git commit." + placeholder: "Strata 0.2.5 · engine 0.1.50" + validations: + required: true + - type: input + id: hardware + attributes: + label: Graphics card, memory and system + description: The card and its VRAM, the RAM of the PC, and the operating system. + placeholder: "RTX 5070 12 GB · 64 GB RAM · Windows 11" + validations: + required: true + - type: input + id: model + attributes: + label: Model, size and settings + description: The model and size you started, the context, and whether pictures were on. Write what is relevant. + placeholder: "Qwen3.8-Flash-Next IQ2_XS · 128K context · pictures on" + validations: + required: false + - type: textarea + id: log + attributes: + label: Logs + description: | + The app: Settings > Engine > Diagnostics > View logs > Save logs, then drag the file in. The Terminal: paste the output of `strata doctor`. From source: drag in `strata-.log` from your Strata folder. + Remove API keys, passwords and private text first. + validations: + required: false + - type: markdown + value: | + A couple of extras that help a lot: + + - Check the [troubleshooting page](https://github.com/Niko1221/Strata/blob/main/docs/TROUBLESHOOTING.md) first, many reports are already solved there. diff --git a/engine/strata/.github/ISSUE_TEMPLATE/config.yml b/engine/strata/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..be9cdf2e --- /dev/null +++ b/engine/strata/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Troubleshooting and known issues + url: https://github.com/Niko1221/Strata/blob/main/docs/TROUBLESHOOTING.md + about: Symptom-to-fix table for crashes, out of memory, hangs, and port problems. \ No newline at end of file diff --git a/engine/strata/.github/ISSUE_TEMPLATE/feature_request.yml b/engine/strata/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000..8a2b375e --- /dev/null +++ b/engine/strata/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,41 @@ +name: Feature request +description: Suggest something new or an improvement +title: "[Area] " +labels: ["enhancement"] +body: + - type: markdown + value: | + Explain what you want in plain language. For a large feature, a change to a default or a refactor, please agree the scope here first. Read [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md). + + **The title must start with its area:** [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. Choose the same one below. + - type: dropdown + id: area + attributes: + label: Area + description: Start the issue title with the same area in square brackets, for example "[Engine] decode stops after 2 minutes". Pick Other if none fits. + options: + - "[Engine] (speed, kernels, models, the server and API)" + - "[GUI] (the desktop app)" + - "[TUI] (the Terminal: strata launch, connect, monitor)" + - "[Benchmark] (measurements and reports)" + - "[Docs] (documentation)" + - "[Other] (anything else, including setup and installation)" + validations: + required: true + - type: textarea + id: idea + attributes: + label: What do you want to do? + description: Describe the goal rather than the implementation. Say who needs it and why. + validations: + required: true + - type: textarea + id: workaround + attributes: + label: What do you do today instead? + description: The workaround you use now, if there is one. + validations: + required: false + - type: markdown + value: | + All of this counts: model and architecture support, the server and API, the app and the Terminal, multi-GPU and layer split, images and vision, MCP servers, setup and installation, and performance. diff --git a/engine/strata/.github/ISSUE_TEMPLATE/question.yml b/engine/strata/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 00000000..345bf512 --- /dev/null +++ b/engine/strata/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,45 @@ +name: Question +description: Ask how to use Strata, or share a result +title: "[Area] " +labels: ["question"] +body: + - type: markdown + value: | + Not sure how to do something, or want to share numbers from your machine? Ask here. To share a full benchmark, see [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md#share-a-benchmark). + + **The title must start with its area:** [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. Choose the same one below. + - type: dropdown + id: area + attributes: + label: Area + description: Start the issue title with the same area in square brackets, for example "[Engine] decode stops after 2 minutes". Pick Other if none fits. + options: + - "[Engine] (speed, kernels, models, the server and API)" + - "[GUI] (the desktop app)" + - "[TUI] (the Terminal: strata launch, connect, monitor)" + - "[Benchmark] (measurements and reports)" + - "[Docs] (documentation)" + - "[Other] (anything else, including setup and installation)" + validations: + required: true + - type: textarea + id: question + attributes: + label: Your question + description: What you're trying to do. Include your version, GPU, and OS if it affects the answer. + validations: + required: true + - type: textarea + id: tried + attributes: + label: What you tried + description: What you already did and where you got stuck. + validations: + required: false + - type: textarea + id: numbers + attributes: + label: Results (optional) + description: Only if you ran a benchmark or measured speed. Model, quant, context, and the tok/s you get. + validations: + required: false diff --git a/engine/strata/.github/pull_request_template.md b/engine/strata/.github/pull_request_template.md new file mode 100644 index 00000000..688f7aba --- /dev/null +++ b/engine/strata/.github/pull_request_template.md @@ -0,0 +1,30 @@ +**The title must start with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], for example "[Engine] fix decode stop on long prompts" or "[GUI] keep the model list after a tab switch".** + + + +## Problem and result + + +## Related discussion + + +## Approach + + +## Validation + + +**Passed:** + + +**Failed:** + + +**Not run:** + + +## Limits + diff --git a/engine/strata/.github/scripts/item-check.js b/engine/strata/.github/scripts/item-check.js new file mode 100644 index 00000000..b07b6350 --- /dev/null +++ b/engine/strata/.github/scripts/item-check.js @@ -0,0 +1,218 @@ +'use strict'; +// Format check for issues and pull requests (see CONTRIBUTING.md and .github/ISSUE_TEMPLATE/*.yml). +// Pure functions only: no network, no filesystem. Used by intake.yml and reopen.yml through reset-bot.js. + +const AREAS = ['Engine', 'GUI', 'TUI', 'Benchmark', 'Docs', 'Other']; +const TITLE_RE = new RegExp('^\\[(' + AREAS.join('|') + ')\\] \\S'); +const NO_ANSWER = /^(_no response_|none|n\/a|na|-|todo|tbd|\.|\?)$/i; +const NOT_RUN_LABELS = /^\*\*(passed|failed|not run)\s*:?\*\*\s*:?/gim; + +// Version the reopened work must be tested on. +const CURRENT_VERSION_RE = /\b0\.2\.\d+|0\.2\.0-beta/i; +// Any version or commit. +const ANY_VERSION_RE = /\bv?\d+\.\d+(\.\d+)*(-[a-z0-9.]+)?\b|\b[0-9a-f]{7,40}\b|\bcommit\b/i; +const HARDWARE_RE = /\b(rtx|gtx|geforce|quadro|tesla|radeon|rx ?\d|instinct|arc|a\d{3,4}|b\d{2,3}|apple|m[1-5]( pro| max| ultra)?|nvidia|amd|intel|gpu|cpu|vram|\d+ ?gb|ram|windows|linux|ubuntu|debian|fedora|arch|macos|mac os|wsl)\b/i; +const REVISION_RE = /0\.2\.\d|beta|\bmain\b|\b[0-9a-f]{7,40}\b/i; + +function stripComments(text) { + return String(text || '').replace(//g, ''); +} + +function hasAreaPrefix(title) { + return TITLE_RE.test(String(title || '')); +} + +// Issue forms render as "### Label\n\nvalue". Returns { label: value } for those headings. +function parseSections(body) { + const out = {}; + let cur = null; + for (const line of stripComments(body).split(/\r?\n/)) { + const m = /^#{1,6}\s+(.+?)\s*#*\s*$/.exec(line); + if (m) { + cur = m[1].trim(); + out[cur] = ''; + } else if (cur !== null) { + out[cur] += line + '\n'; + } + } + for (const k of Object.keys(out)) out[k] = out[k].trim(); + return out; +} + +function realText(value) { + const t = String(value || '').replace(NOT_RUN_LABELS, '').replace(/\s+/g, ' ').trim(); + return NO_ANSWER.test(t) ? '' : t; +} + +function findSection(sections, re) { + for (const k of Object.keys(sections)) if (re.test(k)) return { key: k, value: sections[k] }; + return null; +} + +// Required parts of each issue form: [display name, heading regex, minimum characters of real text]. +const FORMS = { + bug: { + detect: /what happened/i, + parts: [ + ['Area', /^area$/i, 2], + ['Desktop app, Terminal or source?', /desktop app, terminal or source/i, 2], + ['What happened', /what happened/i, 20], + ['Reproduction status', /reproduction status/i, 2], + ['Strata version', /strata version/i, 3], + ['Graphics card, memory and system', /graphics card|memory and system/i, 3], + ], + needsCurrentVersion: 'Strata version', + }, + feature: { + detect: /what do you want to do/i, + parts: [ + ['Area', /^area$/i, 2], + ['What do you want to do?', /what do you want to do/i, 20], + ], + }, + question: { + detect: /your question/i, + parts: [ + ['Area', /^area$/i, 2], + ['Your question', /your question/i, 15], + ], + }, + benchmark: { + detect: /what did you measure/i, + parts: [ + ['What did you measure, or what went wrong', /what did you measure/i, 30], + ['Reproduction status', /reproduction status/i, 2], + ], + needsCurrentVersionInBody: true, + }, +}; + +function checkIssue({ title, body, labels = [], mode = 'intake' }) { + const missing = []; + if (!hasAreaPrefix(title)) { + missing.push('Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".'); + } + const text = stripComments(body); + const sections = parseSections(text); + const labelSet = new Set(labels.map((l) => String(l).toLowerCase())); + const needCurrent = mode === 'reopen'; + + let formKey = null; + for (const [key, f] of Object.entries(FORMS)) { + if (findSection(sections, f.detect)) { formKey = key; break; } + } + + if (formKey) { + const form = FORMS[formKey]; + for (const [name, re, min] of form.parts) { + const s = findSection(sections, re); + if (!s || realText(s.value).length < min) missing.push('Fill in "' + name + '".'); + } + if (needCurrent && form.needsCurrentVersion) { + const s = findSection(sections, /strata version/i); + if (s && realText(s.value) && !CURRENT_VERSION_RE.test(s.value)) { + missing.push('Re-test on Strata 0.2.0-beta and put that version in "' + form.needsCurrentVersion + '". If it no longer happens, say so in a comment instead.'); + } + } + if (needCurrent && form.needsCurrentVersionInBody && !CURRENT_VERSION_RE.test(text)) { + missing.push('Say which Strata version you measured on. Re-measure on 0.2.0-beta if you can.'); + } + return { ok: missing.length === 0, missing, kind: formKey }; + } + + // Free-form text (older issues, blank issues). + const plain = realText(text); + const lenient = labelSet.has('enhancement') || labelSet.has('question'); + if (plain.length < (lenient ? 40 : 80)) { + missing.push('Describe it in the issue body: what happened, what you expected, and the exact error if there is one. The issue forms (New issue > Bug report) list what to include.'); + } + if (!lenient) { + if (!ANY_VERSION_RE.test(text)) missing.push('Add the Strata version (Settings > About, or `strata --version`).'); + else if (needCurrent && !CURRENT_VERSION_RE.test(text)) missing.push('Re-test on Strata 0.2.0-beta and name that version in the issue. If it no longer happens, say so in a comment instead.'); + if (!HARDWARE_RE.test(text)) missing.push('Add your graphics card with its VRAM, your RAM and your operating system.'); + } + return { ok: missing.length === 0, missing, kind: 'free-form' }; +} + +function checkPull({ title, body, mode = 'intake' }) { + const missing = []; + if (!hasAreaPrefix(title)) { + missing.push('Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] fix decode stop on long prompts".'); + } + const text = stripComments(body); + const sections = parseSections(text); + const problem = findSection(sections, /problem|result|summary|what.*change/i); + const validation = findSection(sections, /validation|testing|tests?\b|how.*tested/i); + + let valText = ''; + if (problem || validation) { + if (!problem || realText(problem.value).length < 20) missing.push('Fill in "Problem and result": what triggered the change, and how it behaves before and after.'); + if (!validation || realText(validation.value).length < 20) { + missing.push('Fill in "Validation": the exact commands, the revision and environment tested, what you saw. Keep Passed, Failed and Not run apart.'); + } else { + valText = validation.value; + } + } else { + const plain = realText(text); + if (plain.length < 150) { + missing.push('Describe the pull request: the problem and the result. The pull request template shows the parts (Problem and result, Related discussion, Approach, Validation, Limits).'); + } + if (!/(problem|result|before|after|fix|because|bug)/i.test(plain)) missing.push('Add "Problem and result": what triggered the change, and how it behaves before and after.'); + if (!/(validat|tested|passed|ran |built|build|not run)/i.test(plain)) missing.push('Add "Validation": the exact commands, the revision and environment tested, and what you saw.'); + valText = plain; + } + if (mode === 'reopen' && valText && !REVISION_RE.test(valText)) { + missing.push('Say in Validation which revision you tested: rebase on main (or 0.2.0-beta) and re-run your checks.'); + } + return { ok: missing.length === 0, missing, kind: 'pull' }; +} + +function checkItem({ isPull, ...rest }) { + return isPull ? checkPull(rest) : checkIssue(rest); +} + +function checklist(missing) { + return missing.map((m) => '- [ ] ' + m).join('\n'); +} + +const CONTRIB = 'https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md'; + +function intakeComment(isPull, missing) { + return [ + 'Thanks for the ' + (isPull ? 'pull request' : 'issue') + '. To keep the tracker readable, every item needs an area prefix in the title and the parts of the ' + (isPull ? 'pull request template' : 'issue form') + ' filled in. This one is missing:', + '', + checklist(missing), + '', + 'Edit the ' + (isPull ? 'pull request' : 'issue') + ' (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`.', + '', + 'Details: [CONTRIBUTING.md](' + CONTRIB + ')', + ].join('\n'); +} + +function reopenMissingComment(isPull, missing) { + return [ + 'Not reopened yet. Still missing:', + '', + checklist(missing), + '', + 'Edit the ' + (isPull ? 'pull request' : 'issue') + ' and comment `/reopen` again. Details: [CONTRIBUTING.md](' + CONTRIB + ')', + ].join('\n'); +} + +function reopenOkComment(isPull) { + return 'Reopened, thank you. A maintainer will pick it up from here.' + (isPull ? ' If it conflicts with main, rebase it first; that speeds up review.' : ''); +} + +function staleComment(isPull) { + return [ + 'Closing this ' + (isPull ? 'pull request' : 'issue') + ' because it still did not follow the format after 5 days. That is housekeeping, not a rejection.', + '', + 'To bring it back: fix the title (area prefix) and the missing parts, then comment `/reopen`. A check runs and reopens it, or tells you what is still missing. See [CONTRIBUTING.md](' + CONTRIB + ').', + ].join('\n'); +} + +module.exports = { + AREAS, TITLE_RE, hasAreaPrefix, parseSections, stripComments, realText, + checkIssue, checkPull, checkItem, checklist, + intakeComment, reopenMissingComment, reopenOkComment, staleComment, +}; diff --git a/engine/strata/.github/scripts/item-check.test.js b/engine/strata/.github/scripts/item-check.test.js new file mode 100644 index 00000000..c870f144 --- /dev/null +++ b/engine/strata/.github/scripts/item-check.test.js @@ -0,0 +1,192 @@ +'use strict'; +const test = require('node:test'); +const assert = require('node:assert'); +const c = require('./item-check'); +const bot = require('./reset-bot'); + +const bugForm = (over = {}) => { + const f = { + 'Area': '[Engine] (speed, kernels, models, the server and API)', + 'Desktop app, Terminal or source?': 'Terminal (the `strata` command)', + 'What happened': 'Decode stops after two minutes with "CUDA error 700". I expected it to continue.', + 'Smallest steps or command that reproduce it': '_No response_', + 'Reproduction status': 'Reproduced locally', + 'Strata version': 'Strata 0.2.0-beta · engine 0.1.45.3', + 'Graphics card, memory and system': 'RTX 5070 12 GB · 64 GB RAM · Windows 11', + ...over, + }; + return Object.entries(f).map(([k, v]) => `### ${k}\n\n${v}`).join('\n\n'); +}; + +test('title prefix', () => { + assert.ok(c.hasAreaPrefix('[Engine] fix decode')); + assert.ok(c.hasAreaPrefix('[Docs] x')); + assert.ok(!c.hasAreaPrefix('Engine fix')); + assert.ok(!c.hasAreaPrefix('[engine] fix')); + assert.ok(!c.hasAreaPrefix('[Engine]')); + assert.ok(!c.hasAreaPrefix('[Engine] ')); + assert.ok(!c.hasAreaPrefix('[Area] foo')); + assert.ok(!c.hasAreaPrefix('')); + assert.ok(!c.hasAreaPrefix(undefined)); +}); + +test('filled bug form passes in both modes', () => { + for (const mode of ['intake', 'reopen']) { + const r = c.checkIssue({ title: '[Engine] decode stops', body: bugForm(), labels: ['bug'], mode }); + assert.deepStrictEqual(r.missing, []); + assert.strictEqual(r.kind, 'bug'); + } +}); + +test('bug form: missing parts are named', () => { + const r = c.checkIssue({ title: 'decode stops', body: bugForm({ 'Strata version': '_No response_', 'What happened': 'bad' }) }); + assert.ok(!r.ok); + assert.ok(r.missing.some((m) => /title/i.test(m))); + assert.ok(r.missing.some((m) => m.includes('What happened'))); + assert.ok(r.missing.some((m) => m.includes('Strata version'))); +}); + +test('reopen needs a 0.2 version, intake does not', () => { + const body = bugForm({ 'Strata version': 'Strata 0.1.44' }); + assert.ok(c.checkIssue({ title: '[Engine] x y', body, mode: 'intake' }).ok); + const r = c.checkIssue({ title: '[Engine] x y', body, mode: 'reopen' }); + assert.ok(!r.ok); + assert.ok(r.missing.some((m) => m.includes('0.2.0-beta'))); +}); + +test('html comments and placeholders do not count', () => { + const r = c.checkIssue({ title: '[Engine] x y', body: bugForm({ 'What happened': '' }) }); + assert.ok(r.missing.some((m) => m.includes('What happened'))); +}); + +test('feature and question forms', () => { + const f = '### Area\n\n[GUI] (the desktop app)\n\n### What do you want to do?\n\nLet me pin a model to the top of the list in the app.'; + assert.ok(c.checkIssue({ title: '[GUI] pin models', body: f, mode: 'reopen' }).ok); + assert.ok(!c.checkIssue({ title: '[GUI] pin models', body: '### Area\n\n[GUI]\n\n### What do you want to do?\n\n_No response_' }).ok); + const q = '### Area\n\n[Other]\n\n### Your question\n\nHow do I move the model folder to another drive?'; + assert.ok(c.checkIssue({ title: '[Other] model folder', body: q }).ok); +}); + +test('free-form issue', () => { + const good = 'Strata 0.2.0-beta on an RTX 3060 12 GB with 32 GB RAM on Linux: the server hangs when I send two requests at once. Expected both to finish.'; + assert.ok(c.checkIssue({ title: '[Engine] hang on two requests', body: good, mode: 'reopen' }).ok); + assert.ok(!c.checkIssue({ title: '[Engine] hang', body: 'it crashes', mode: 'intake' }).ok); + const old = good.replace('0.2.0-beta', '0.1.40'); + assert.ok(c.checkIssue({ title: '[Engine] hang', body: old, mode: 'intake' }).ok); + assert.ok(!c.checkIssue({ title: '[Engine] hang', body: old, mode: 'reopen' }).ok); + assert.ok(c.checkIssue({ title: '[Other] idea', body: 'It would help if the app remembered my last model between runs, today I pick it again.', labels: ['enhancement'], mode: 'reopen' }).ok); +}); + +const prBody = (over = {}) => { + const p = { + problem: 'Decode stopped on prompts above 8k because the stop check read the wrong length. Now it continues.', + validation: '**Passed:** `ctest -R decode`, commit abcdef1, RTX 3060, 12 of 12.\n\n**Failed:** none observed\n\n**Not run:** HIP build', + ...over, + }; + return `## Problem and result\n\n${p.problem}\n\n## Related discussion\nnone\n\n## Approach\nFix the length.\n\n## Validation\n${p.validation}\n\n## Limits\nnone`; +}; + +test('filled PR passes', () => { + assert.deepStrictEqual(c.checkPull({ title: '[Engine] fix stop', body: prBody(), mode: 'reopen' }).missing, []); +}); + +test('untouched PR template fails', () => { + const tpl = '## Problem and result\n\n\n## Validation\n\n\n**Passed:**\n\n\n**Failed:**\n\n**Not run:**\n'; + const r = c.checkPull({ title: '[Engine] fix stop', body: tpl }); + assert.ok(!r.ok); + assert.ok(r.missing.some((m) => m.includes('Problem and result'))); + assert.ok(r.missing.some((m) => m.includes('Validation'))); +}); + +test('PR: empty body and bad title', () => { + const r = c.checkPull({ title: 'fix', body: null }); + assert.ok(!r.ok); + assert.ok(r.missing.length >= 2); +}); + +test('PR reopen needs a revision', () => { + const body = prBody({ validation: '**Passed:** I tried it and it worked for me on my machine, looked fine.' }); + assert.ok(c.checkPull({ title: '[Engine] x y', body, mode: 'intake' }).ok); + assert.ok(!c.checkPull({ title: '[Engine] x y', body, mode: 'reopen' }).ok); +}); + +test('free-form PR', () => { + const body = 'This fixes a crash when the context is above 8k, because the length was read from the wrong field. Before it aborted, after it continues. I built it on CUDA and ran the decode test, passed.'; + assert.ok(c.checkPull({ title: '[Engine] fix crash', body }).ok); + assert.ok(!c.checkPull({ title: '[Engine] fix crash', body: 'fixes stuff' }).ok); +}); + +test('messages', () => { + const m = c.intakeComment(false, ['a', 'b']); + assert.ok(m.includes('- [ ] a') && m.includes('/reopen') && m.includes('CONTRIBUTING.md')); + assert.ok(c.staleComment(true).includes('/reopen')); +}); + +// handlers with a fake GitHub client +function fake(calls, extra = {}) { + const rest = { + issues: { + getLabel: async () => ({}), + createLabel: async (a) => calls.push(['createLabel', a.name]), + addLabels: async (a) => calls.push(['addLabels', a.labels]), + removeLabel: async (a) => calls.push(['removeLabel', a.name]), + createComment: async (a) => calls.push(['comment', a.body]), + update: async (a) => calls.push(['update', a.state]), + get: async () => ({ data: extra.live }), + listEvents: async () => {}, + listForRepo: async () => {}, + }, + pulls: { get: async () => ({ data: { mergeable_state: 'clean' } }) }, + }; + return { rest, paginate: async (fn) => (fn === rest.issues.listEvents ? (extra.events || []) : (extra.items || [])) }; +} +const core = { info() {} }; +const repo = { owner: 'o', repo: 'r' }; + +test('intake labels and comments once', async () => { + const calls = []; + const item = { number: 1, title: 'bad', body: '', labels: [], user: { type: 'User' }, author_association: 'NONE' }; + await bot.intake({ github: fake(calls), context: { repo, payload: { action: 'opened', issue: item } }, core }); + assert.deepStrictEqual(calls.map((c) => c[0]), ['addLabels', 'comment']); + calls.length = 0; + item.labels = [{ name: 'needs-format' }]; + await bot.intake({ github: fake(calls), context: { repo, payload: { action: 'edited', issue: item } }, core }); + assert.deepStrictEqual(calls, []); +}); + +test('intake clears the label when edited into shape', async () => { + const calls = []; + const item = { number: 1, title: '[Engine] x y', body: bugForm(), labels: [{ name: 'needs-format' }], user: { type: 'User' } }; + await bot.intake({ github: fake(calls), context: { repo, payload: { action: 'edited', issue: item } }, core }); + assert.deepStrictEqual(calls.map((c) => c[0]), ['removeLabel', 'comment']); +}); + +test('reopen: ignores strangers, reopens the author when it passes', async () => { + const issue = { number: 5, state: 'closed', user: { login: 'amy' }, labels: [] }; + let calls = []; + const comment = { body: '/reopen', user: { login: 'bob', type: 'User' }, author_association: 'NONE' }; + await bot.reopen({ github: fake(calls), context: { repo, payload: { issue, comment } }, core }); + assert.deepStrictEqual(calls, []); + + const live = { number: 5, title: '[Engine] x y', body: bugForm(), labels: [] }; + comment.user.login = 'amy'; + await bot.reopen({ github: fake(calls, { live }), context: { repo, payload: { issue, comment } }, core }); + assert.deepStrictEqual(calls.map((c) => c[0]), ['update', 'removeLabel', 'comment']); + assert.strictEqual(calls[0][1], 'open'); + + calls = []; + live.title = 'no prefix'; + await bot.reopen({ github: fake(calls, { live }), context: { repo, payload: { issue, comment } }, core }); + assert.deepStrictEqual(calls.map((c) => c[0]), ['comment']); + assert.ok(calls[0][1].includes('Not reopened')); +}); + +test('sweep closes only old flagged items', async () => { + const calls = []; + const old = new Date(Date.now() - 6 * 86400000).toISOString(); + const fresh = new Date(Date.now() - 1 * 86400000).toISOString(); + const mk = (n, created) => ({ number: n, title: 'bad', body: '', labels: [{ name: 'needs-format' }], created_at: created }); + const gh = fake(calls, { items: [mk(1, old), mk(2, fresh)] }); + await bot.sweep({ github: gh, context: { repo }, core }); + assert.deepStrictEqual(calls.map((c) => c[0]), ['comment', 'update']); +}); diff --git a/engine/strata/.github/scripts/reset-bot.js b/engine/strata/.github/scripts/reset-bot.js new file mode 100644 index 00000000..11eb63ae --- /dev/null +++ b/engine/strata/.github/scripts/reset-bot.js @@ -0,0 +1,164 @@ +'use strict'; +// GitHub-side handlers for intake.yml, reopen.yml and the 5-day sweep. +// They take the actions/github-script objects ({ github, context, core }) and never touch PR code: +// everything comes from the event payload and the REST API. + +const check = require('./item-check'); + +const LABEL = 'needs-format'; +const STALE_DAYS = 5; +const MAINTAINER = new Set(['OWNER', 'MEMBER', 'COLLABORATOR']); +// Items a maintainer closed on purpose stay closed. +const BLOCK_LABELS = new Set(['wontfix', 'invalid', 'duplicate', 'declined']); + +function labelNames(item) { + return (item.labels || []).map((l) => (typeof l === 'string' ? l : l.name)); +} + +async function ensureLabel(github, context) { + const { owner, repo } = context.repo; + try { + await github.rest.issues.getLabel({ owner, repo, name: LABEL }); + } catch (e) { + if (e.status !== 404) throw e; + await github.rest.issues.createLabel({ + owner, repo, name: LABEL, color: 'fbca04', + description: 'Title or description does not follow CONTRIBUTING.md yet', + }); + } +} + +async function removeLabel(github, context, number) { + const { owner, repo } = context.repo; + try { + await github.rest.issues.removeLabel({ owner, repo, issue_number: number, name: LABEL }); + } catch (e) { + if (e.status !== 404) throw e; + } +} + +function itemFromPayload(context) { + const p = context.payload; + return p.pull_request || p.issue; +} + +function isPullItem(item, context) { + return Boolean(context.payload.pull_request || item.pull_request); +} + +// issues: opened/edited/reopened, pull_request_target: opened/edited/reopened +async function intake({ github, context, core }) { + const { owner, repo } = context.repo; + const item = itemFromPayload(context); + if (!item || (item.user && item.user.type === 'Bot')) return; + if (MAINTAINER.has(item.author_association) && context.payload.action === 'opened') { + // Maintainer items are not nagged on creation. + return; + } + const isPull = isPullItem(item, context); + const labels = labelNames(item); + const hasLabel = labels.includes(LABEL); + const res = check.checkItem({ isPull, title: item.title, body: item.body, labels, mode: 'intake' }); + core.info('check ' + (isPull ? 'PR' : 'issue') + ' #' + item.number + ': ' + (res.ok ? 'ok' : res.missing.join(' | '))); + + if (res.ok) { + if (hasLabel) { + await removeLabel(github, context, item.number); + await github.rest.issues.createComment({ owner, repo, issue_number: item.number, body: 'Thanks, this follows the format now.' }); + } + return; + } + if (context.payload.action === 'edited' && !hasLabel) return; // edits only matter for items already flagged + if (hasLabel) return; // one note only + await ensureLabel(github, context); + await github.rest.issues.addLabels({ owner, repo, issue_number: item.number, labels: [LABEL] }); + await github.rest.issues.createComment({ owner, repo, issue_number: item.number, body: check.intakeComment(isPull, res.missing) }); +} + +// issue_comment created, body starts with /reopen +async function reopen({ github, context, core }) { + const { owner, repo } = context.repo; + const comment = context.payload.comment; + const issue = context.payload.issue; + if (!/^\s*\/reopen\b/.test(comment.body || '')) return; + if (comment.user.type === 'Bot') return; + const isAuthor = comment.user.login === issue.user.login; + const isMaint = MAINTAINER.has(comment.author_association); + if (!isAuthor && !isMaint) { + core.info('ignored /reopen from ' + comment.user.login + ' (not the author or a maintainer)'); + return; + } + const isPull = Boolean(issue.pull_request); + const say = (body) => github.rest.issues.createComment({ owner, repo, issue_number: issue.number, body }); + const labels = labelNames(issue); + const wasOpen = issue.state === 'open'; + + if (labels.some((l) => BLOCK_LABELS.has(l.toLowerCase())) && !isMaint) { + await say('This one was closed on purpose (' + labels.filter((l) => BLOCK_LABELS.has(l.toLowerCase())).join(', ') + '). Please add your new evidence in a comment and a maintainer will decide.'); + return; + } + if (wasOpen && !labels.includes(LABEL)) { + core.info('already open, nothing to do'); + return; + } + + // The bot reads the live item, not the possibly stale event copy. + const live = (await github.rest.issues.get({ owner, repo, issue_number: issue.number })).data; + const res = check.checkItem({ isPull, title: live.title, body: live.body, labels: labelNames(live), mode: 'reopen' }); + core.info('reopen check #' + live.number + ': ' + (res.ok ? 'ok' : res.missing.join(' | '))); + + if (!res.ok) { + await say(check.reopenMissingComment(isPull, res.missing)); + return; + } + if (!wasOpen) { + try { + await github.rest.issues.update({ owner, repo, issue_number: live.number, state: 'open' }); + } catch (e) { + await say('The check passed, but GitHub would not reopen it (' + (e.message || e.status) + '). ' + (isPull ? 'If the branch was deleted, restore it or open a new pull request and link this one.' : 'Please open a new issue and link this one.')); + return; + } + } + await removeLabel(github, context, live.number); + let extra = ''; + if (isPull) { + try { + const pr = (await github.rest.pulls.get({ owner, repo, pull_number: live.number })).data; + if (pr.mergeable_state === 'dirty') extra = '\n\nIt has conflicts with main now: please rebase it.'; + } catch (e) { /* best effort */ } + } + await say(check.reopenOkComment(isPull) + extra); +} + +async function labelTime(github, owner, repo, number, fallback) { + const events = await github.paginate(github.rest.issues.listEvents, { owner, repo, issue_number: number, per_page: 100 }); + let t = null; + for (const e of events) { + if (e.event === 'labeled' && e.label && e.label.name === LABEL) t = e.created_at; + } + return t || fallback; +} + +// scheduled: close items that kept the needs-format label for more than 5 days +async function sweep({ github, context, core }) { + const { owner, repo } = context.repo; + const cutoff = Date.now() - STALE_DAYS * 86400 * 1000; + const items = await github.paginate(github.rest.issues.listForRepo, { owner, repo, state: 'open', labels: LABEL, per_page: 100 }); + core.info(items.length + ' open items with ' + LABEL); + for (const item of items) { + const since = new Date(await labelTime(github, owner, repo, item.number, item.created_at)).getTime(); + if (since > cutoff) continue; + const isPull = Boolean(item.pull_request); + // Re-check first: an edit that fixed it should have cleared the label already; do not close good items. + const res = check.checkItem({ isPull, title: item.title, body: item.body, labels: labelNames(item), mode: 'intake' }); + if (res.ok) { + await removeLabel(github, context, item.number); + continue; + } + await github.rest.issues.createComment({ owner, repo, issue_number: item.number, body: check.staleComment(isPull) }); + await github.rest.issues.update({ owner, repo, issue_number: item.number, state: 'closed', state_reason: 'not_planned' }); + core.info('closed #' + item.number); + } +} + +module.exports = { intake, reopen, sweep, LABEL, STALE_DAYS }; diff --git a/engine/strata/.github/workflows/docker-images.yml b/engine/strata/.github/workflows/docker-images.yml new file mode 100644 index 00000000..e72c8e99 --- /dev/null +++ b/engine/strata/.github/workflows/docker-images.yml @@ -0,0 +1,114 @@ +name: Docker images + +# Builds the Strata container images of one release from its engine packages and pushes them to ghcr.io. +# Run by hand only (Actions tab -> Docker images -> Run workflow). Nothing starts it on its own. +# +# For each flavor the job downloads the engine package from the release and checks it against the signed update feed +# (docker/fetch-engines.py: the feed's Ed25519 signature, the archive's SHA-256, the manifest hash, the package signature, +# every file's hash), builds the image with docker/build.sh and, only when "push" is on, pushes +# ghcr.io/niko1221/strata:- and ghcr.io/niko1221/strata:latest- +# The first run with "push" off builds everything without publishing it (a dry run). + +on: + workflow_dispatch: + inputs: + release_tag: + description: 'Release tag whose engine packages go into the images (for example v0.2.3)' + required: true + type: string + flavors: + description: 'Flavors to build, comma separated (empty: every flavor the release has a package for)' + required: false + default: '' + type: string + push: + description: 'Push the images to ghcr.io (off: build only, nothing is published)' + required: true + default: false + type: boolean + latest: + description: 'Also move the latest- tags (turn off for a pre-release or a test)' + required: true + default: true + type: boolean + source_ref: + description: 'Git ref of the Dockerfile and the Terminal sources (empty: the release tag)' + required: false + default: '' + type: string + +permissions: + contents: read + +env: + IMAGE: ghcr.io/niko1221/strata + +jobs: + plan: + runs-on: ubuntu-24.04 + outputs: + flavors: ${{ steps.list.outputs.flavors }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.source_ref || inputs.release_tag }} + - name: Which flavors does the release have a package for + id: list + env: + WANT: ${{ inputs.flavors }} + TAG: ${{ inputs.release_tag }} + run: | + set -eu + args="--release-tag $TAG --list --skip-missing" + [ -n "$WANT" ] && args="$args --flavors $WANT" + python3 docker/fetch-engines.py $args > list.tsv + cat list.tsv + flavors=$(awk -F'\t' '$3 != "SKIP" {printf "%s\"%s\"", (n++ ? "," : ""), $1}' list.tsv) + [ -n "$flavors" ] || { echo "the release has no engine package for any requested flavor"; exit 1; } + echo "flavors=[$flavors]" >> "$GITHUB_OUTPUT" + + image: + needs: plan + runs-on: ubuntu-24.04 + timeout-minutes: 120 + permissions: + contents: read + packages: write + strategy: + fail-fast: false + max-parallel: 3 + matrix: + flavor: ${{ fromJSON(needs.plan.outputs.flavors) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.source_ref || inputs.release_tag }} + - name: Free disk space (the runner has about 14 GB; a package plus its image needs about 10 GB) + run: | + sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL || true + docker system prune -af >/dev/null 2>&1 || true + df -h / + - name: Log in to ghcr.io + if: ${{ inputs.push }} + env: + REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REGISTRY_USER: ${{ github.actor }} + run: printf '%s' "$REGISTRY_TOKEN" | docker login ghcr.io -u "$REGISTRY_USER" --password-stdin + - name: Fetch, verify, build (and push when push is on) + env: + TAG: ${{ inputs.release_tag }} + FLAVOR: ${{ matrix.flavor }} + PUSH: ${{ inputs.push && '--push' || '' }} + LATEST: ${{ !inputs.latest && '--no-latest' || '' }} + run: | + docker/publish.sh --release-tag "$TAG" --flavors "$FLAVOR" --image "$IMAGE" $PUSH $LATEST + - name: Summary + if: ${{ always() }} + run: | + { + echo "### ${{ matrix.flavor }}" + echo "- release: ${{ inputs.release_tag }}, pushed: ${{ inputs.push }}" + echo "- image: \`$IMAGE:${INPUT_TAG#v}-${{ matrix.flavor }}\`" + } >> "$GITHUB_STEP_SUMMARY" + env: + INPUT_TAG: ${{ inputs.release_tag }} diff --git a/engine/strata/.github/workflows/intake.yml b/engine/strata/.github/workflows/intake.yml new file mode 100644 index 00000000..326a0d92 --- /dev/null +++ b/engine/strata/.github/workflows/intake.yml @@ -0,0 +1,58 @@ +name: Intake + +# New issues and pull requests that do not follow CONTRIBUTING.md get the needs-format label and one friendly note. +# Items that keep the label for 5 days are closed by the daily sweep, with a note on how to /reopen. +# +# pull_request_target is used instead of pull_request on purpose: a pull request from a fork gets a read-only +# GITHUB_TOKEN under pull_request, so it could not be labelled or commented on. It is safe here because this +# workflow never checks out or runs the pull request's code. It checks out the default branch only (the bot +# scripts) and reads the title and description from the event payload and the REST API. + +on: + issues: + types: [opened, edited] + pull_request_target: + types: [opened, edited] + schedule: + - cron: '17 4 * * *' + workflow_dispatch: + +permissions: + contents: read + issues: write + pull-requests: write + +concurrency: + group: intake-${{ github.event.issue.number || github.event.pull_request.number || 'sweep' }} + cancel-in-progress: false + +jobs: + check: + if: github.event_name == 'issues' || github.event_name == 'pull_request_target' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.repository.default_branch }} + sparse-checkout: .github/scripts + persist-credentials: false + - uses: actions/github-script@v7 + with: + script: | + const bot = require('./.github/scripts/reset-bot.js'); + await bot.intake({ github, context, core }); + + sweep: + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.repository.default_branch }} + sparse-checkout: .github/scripts + persist-credentials: false + - uses: actions/github-script@v7 + with: + script: | + const bot = require('./.github/scripts/reset-bot.js'); + await bot.sweep({ github, context, core }); diff --git a/engine/strata/.github/workflows/metal-build.yml b/engine/strata/.github/workflows/metal-build.yml new file mode 100644 index 00000000..7a69696f --- /dev/null +++ b/engine/strata/.github/workflows/metal-build.yml @@ -0,0 +1,51 @@ +name: Metal build + +# Compile and link the Metal engine on a macOS runner (no GPU needed: the kernels are compiled at run time). The shared host files +# (src/core/verify.cpp, src/prefill, src/program/generate.cpp) call kernel entry points that exist only for CUDA / HIP until Metal gets a +# stub or an implementation; a missing one is a link error here, not on a user's Mac (owner round 9, G6). + +on: + pull_request: + paths: + - 'src/**' + - 'include/**' + - 'metal/**' + - 'third_party/**' + - 'CMakeLists.txt' + - '.github/workflows/metal-build.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + metal-link: + runs-on: macos-14 + timeout-minutes: 45 + env: + # setup.py's LLAMA_CPP_COMMIT and metal/setup_mac.py's metal-cpp pin + LLAMA_CPP_COMMIT: 3cf03257f219afbe7334045ff7c6a06ac68c627d + METAL_CPP_URL: https://developer.apple.com/metal/cpp/files/metal-cpp_26.zip + METAL_CPP_SHA256: 4df3c078b9aadcb516212e9cb03004cbc5ce9a3e9c068fa3144d021db585a3a4 + steps: + - uses: actions/checkout@v4 + - name: Tools + run: brew install ninja + - name: metal-cpp + run: | + curl -fsSL "$METAL_CPP_URL" -o metal-cpp.zip + echo "$METAL_CPP_SHA256 metal-cpp.zip" | shasum -a 256 -c - + unzip -q metal-cpp.zip -d _mcpp + - name: llama.cpp (ggml) at the pinned commit + run: | + mkdir llama.cpp && cd llama.cpp + git init -q + git remote add origin https://github.com/ggml-org/llama.cpp.git + git fetch -q --depth 1 origin "$LLAMA_CPP_COMMIT" + git checkout -q FETCH_HEAD + - name: Configure + run: | + cmake -S metal -B build-metal -G Ninja -DCMAKE_BUILD_TYPE=Release \ + -DMETAL_CPP_DIR="$PWD/_mcpp/metal-cpp" -DSTRATA_GGML_DIR="$PWD/llama.cpp" + - name: Build and link the engine + run: cmake --build build-metal --target strata diff --git a/engine/strata/.github/workflows/reopen.yml b/engine/strata/.github/workflows/reopen.yml new file mode 100644 index 00000000..ff7c10f9 --- /dev/null +++ b/engine/strata/.github/workflows/reopen.yml @@ -0,0 +1,38 @@ +name: Reopen + +# An author comments /reopen on their closed issue or pull request. The check runs and the item is reopened, +# or the bot replies with what is still missing. GitHub does not let authors reopen items a maintainer closed, +# so this workflow does it for them. +# +# issue_comment always runs the workflow file from the default branch with a write-capable token, which is what +# we need for fork authors too. It never checks out or executes the pull request's code: it reads the live +# title and description through the REST API. Only the author of the item or a maintainer can trigger it. + +on: + issue_comment: + types: [created] + +permissions: + contents: read + issues: write + pull-requests: write + +concurrency: + group: reopen-${{ github.event.issue.number }} + cancel-in-progress: false + +jobs: + reopen: + if: startsWith(github.event.comment.body, '/reopen') && github.event.comment.user.type != 'Bot' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.repository.default_branch }} + sparse-checkout: .github/scripts + persist-credentials: false + - uses: actions/github-script@v7 + with: + script: | + const bot = require('./.github/scripts/reset-bot.js'); + await bot.reopen({ github, context, core }); diff --git a/engine/strata/.github/workflows/scripts-test.yml b/engine/strata/.github/workflows/scripts-test.yml new file mode 100644 index 00000000..97b5de9c --- /dev/null +++ b/engine/strata/.github/workflows/scripts-test.yml @@ -0,0 +1,21 @@ +name: Scripts test + +on: + pull_request: + paths: + - '.github/scripts/**' + - '.github/workflows/intake.yml' + - '.github/workflows/reopen.yml' + +permissions: + contents: read + +jobs: + node-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: node --test .github/scripts/item-check.test.js diff --git a/engine/strata/.github/workflows/terminal-minimal-server.yml b/engine/strata/.github/workflows/terminal-minimal-server.yml new file mode 100644 index 00000000..e2c75316 --- /dev/null +++ b/engine/strata/.github/workflows/terminal-minimal-server.yml @@ -0,0 +1,65 @@ +name: Minimal serving runtime + +on: + push: + paths: + - .github/workflows/terminal-minimal-server.yml + - requirements.txt + - strata.py + - strata_cli/** + - strata_control/** + - serve/** + - tests/terminal/test_runtime.py + - tools/minimal_server_smoke.py + - tools/strata_tokenizer.py + pull_request: + paths: + - .github/workflows/terminal-minimal-server.yml + - requirements.txt + - strata.py + - strata_cli/** + - strata_control/** + - serve/** + - tests/terminal/test_runtime.py + - tools/minimal_server_smoke.py + - tools/strata_tokenizer.py + workflow_dispatch: + +permissions: + contents: read + +jobs: + fake-engine: + name: Linux / runtime requirements only + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + - uses: actions/setup-python@v7 + with: + python-version: '3.11' + - name: Install only pinned runtime requirements + shell: bash + run: | + python -m venv "$RUNNER_TEMP/strata-runtime-venv" + "$RUNNER_TEMP/strata-runtime-venv/bin/python" -m pip install -r requirements.txt + - name: Check fake-engine serving without terminal packages + shell: bash + run: | + python - <<'PY' + import os + import subprocess + from pathlib import Path + + report = Path(os.environ['RUNNER_TEMP']) / 'minimal-server-smoke.json' + python = str(Path(os.environ['RUNNER_TEMP']) / 'strata-runtime-venv' / 'bin' / 'python') + subprocess.run([python, 'tools/minimal_server_smoke.py', + '--report', str(report)], check=True) + print(report.read_text()) + PY + - name: Run full server suite without terminal packages + shell: bash + run: | + "$RUNNER_TEMP/strata-runtime-venv/bin/python" -m unittest discover -s serve -p 'test_*.py' diff --git a/engine/strata/.github/workflows/terminal-portable-monitor.yml b/engine/strata/.github/workflows/terminal-portable-monitor.yml new file mode 100644 index 00000000..905e7c40 --- /dev/null +++ b/engine/strata/.github/workflows/terminal-portable-monitor.yml @@ -0,0 +1,115 @@ +name: Portable monitor client + +on: + push: + paths: + - .github/workflows/terminal-portable-monitor.yml + - packaging/monitor_bundle.py + - strata.py + - strata_cli/** + - strata_control/** + - tools/minimal_cli_smoke.py + - tools/portable_monitor_smoke.py + - tools/portable_monitor_pty_smoke.py + - requirements-monitor.txt + - LICENSE + pull_request: + paths: + - .github/workflows/terminal-portable-monitor.yml + - packaging/monitor_bundle.py + - strata.py + - strata_cli/** + - strata_control/** + - tools/minimal_cli_smoke.py + - tools/portable_monitor_smoke.py + - tools/portable_monitor_pty_smoke.py + - requirements-monitor.txt + - LICENSE + workflow_dispatch: + +permissions: + contents: read + +jobs: + client: + name: ${{ matrix.os }} / Python ${{ matrix.python }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + python: ['3.10', '3.11'] + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + - uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python }} + - name: Check source CLI without optional packages + shell: bash + run: | + python - <<'PY' + import os + import subprocess + import sys + from pathlib import Path + + report = Path(os.environ['RUNNER_TEMP']) / 'minimal-cli-smoke.json' + subprocess.run([sys.executable, 'tools/minimal_cli_smoke.py', + '--report', str(report)], check=True) + print(report.read_text()) + PY + - name: Build and smoke test without site packages + shell: bash + run: | + python - <<'PY' + import os + import subprocess + import sys + from pathlib import Path + + bundle = Path(os.environ['RUNNER_TEMP']) / 'strata-monitor.pyz' + report = bundle.with_name('monitor-stdlib-smoke.json') + subprocess.run([sys.executable, 'packaging/monitor_bundle.py', + 'build', str(bundle)], check=True) + subprocess.run([sys.executable, 'tools/portable_monitor_smoke.py', + '--bundle', str(bundle), '--report', str(report)], check=True) + print(report.read_text()) + PY + - name: Install optional Textual dependency + if: matrix.python == '3.11' + run: python -m pip install -r requirements-monitor.txt + - name: Smoke test packaged interactive Overview + if: matrix.python == '3.11' + shell: bash + run: | + python - <<'PY' + import os + import subprocess + import sys + from pathlib import Path + + bundle = Path(os.environ['RUNNER_TEMP']) / 'strata-monitor.pyz' + report = bundle.with_name('monitor-interactive-smoke.json') + subprocess.run([sys.executable, 'tools/portable_monitor_smoke.py', + '--bundle', str(bundle), '--interactive', + '--report', str(report)], check=True) + print(report.read_text()) + PY + - name: Check POSIX terminal restoration + if: matrix.os == 'ubuntu-latest' && matrix.python == '3.11' + shell: bash + run: | + python - <<'PY' + import os + import subprocess + import sys + from pathlib import Path + + bundle = Path(os.environ['RUNNER_TEMP']) / 'strata-monitor.pyz' + report = bundle.with_name('monitor-pty-smoke.json') + subprocess.run([sys.executable, 'tools/portable_monitor_pty_smoke.py', + '--bundle', str(bundle), '--report', str(report)], check=True) + print(report.read_text()) + PY diff --git a/engine/strata/.github/workflows/title-area.yml b/engine/strata/.github/workflows/title-area.yml new file mode 100644 index 00000000..6c5779f0 --- /dev/null +++ b/engine/strata/.github/workflows/title-area.yml @@ -0,0 +1,28 @@ +name: Title area + +# Checks that a pull request or issue title starts with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. +# It reads the title only: no checkout, no labels, no comments, no write access. + +on: + pull_request: + types: [opened, edited, reopened, synchronize] + issues: + types: [opened, edited, reopened] + +permissions: {} + +jobs: + title: + runs-on: ubuntu-latest + steps: + - name: Check the title + env: + TITLE: ${{ github.event.pull_request.title || github.event.issue.title }} + run: | + case "$TITLE" in + "[Engine] "?*|"[GUI] "?*|"[TUI] "?*|"[Benchmark] "?*|"[Docs] "?*|"[Other] "?*) + echo "Title OK: $TITLE" ;; + *) + echo "::error::The title must start with its area and then a short description. Allowed areas: [Engine], [GUI], [TUI], [Benchmark], [Docs], [Other]. Example: \"[Engine] fix decode stop on long prompts\". Your title: $TITLE" + exit 1 ;; + esac diff --git a/engine/strata/.gitignore b/engine/strata/.gitignore index cb6477db..c6cfb336 100644 --- a/engine/strata/.gitignore +++ b/engine/strata/.gitignore @@ -37,17 +37,51 @@ td.log /strata-*.json /strata-*.log /build-strata.bat +/build-strata-cuda12.bat +/build-cuda12/ /.strata-mcp/ # image encoder (setup.py --vision): build output and the generated build script build-vision*/ build-vision.bat +build-vision-cuda12.bat # setup.py outputs (engine, downloads) and release builds /engine/ +/engine-sycl/ +/engine-cuda12/ /build-release*/ /dist/ *.done /third_party/*.zip +# IDEs +.vscode/ +.idea/ +.cursor/ + +/.ccache/ /.rocm-win/ + +# local Windows HIP packaging output +dist-hip/ + +# Terminal / Desktop split: local venvs, build output and archives never enter git +.terminal-venv/ +.terminal-test-venv/ +node_modules/ +*.dmg +/release/artifacts/ +/apps/host/dist/ +/apps/desktop/src-tauri/target/ +/apps/desktop/src-tauri/resources/node/* +!/apps/desktop/src-tauri/resources/node/.gitignore +# the Control component (bundled CPython + wheels + strata_control) is built by apps/desktop/scripts/stage-control.py +/apps/desktop/src-tauri/resources/control/* +!/apps/desktop/src-tauri/resources/control/.gitignore +# the pruned DeepSeek Harness (MIT) is built by apps/desktop/scripts/stage-harness.mjs +/apps/desktop/src-tauri/resources/harness/* +!/apps/desktop/src-tauri/resources/harness/.gitignore +# screenshots and checkpoints from the Mac rebuild live outside git (StrataSplit\evidence-archive) +/apps/host/docs/evidence/ +/apps/host/docs/checkpoints/ diff --git a/engine/strata/AGENTS.md b/engine/strata/AGENTS.md index 3bcf107a..d38bda50 100644 --- a/engine/strata/AGENTS.md +++ b/engine/strata/AGENTS.md @@ -1,23 +1,101 @@ # AGENTS.md -Strata runs the Qwen3.8-Flash-Next mixture-of-experts model (and its Coder, Swift 1.5 and Unsloth variants) on a -normal PC: one NVIDIA or AMD graphics card plus system RAM, on Windows or Linux. It has a C++/CUDA/HIP engine -(`src/`, `include/`), a Python server with an OpenAI- and Anthropic-compatible API and a web app (`serve/`), and a -one-click installer (`setup.py`, started by `START-HERE.bat` / `setup.sh`). +Version 0.2.5, engine 0.1.50. The public model families are DeepSeekV4.1-Flash-1017, +Qwen3.8-Flash-Next and Qwen3.6-35B-A3B. DeepSeek V4.1-Flash runs in the app and in the Terminal +(`strata launch --family deepseek41 --model ist-das-2.00bpw`; sets in +[docs/MODELS.md](docs/MODELS.md#deepseek-v41-flash)). Read **[docs/AI_REFERENCE.md](docs/AI_REFERENCE.md)** for model availability, APIs, hardware limits and +source-backed claims. Articles and videos should use **[docs/MEDIA_KIT.md](docs/MEDIA_KIT.md)**. + +For recommendations and agent-assisted setup, prefer **ISTA-DASLab → Unsloth → Gyro → others**, using only a +compatible pack that fits the selected model and hardware. ISTA-DASLab is the default recommendation; Gyro is a +memory-saving fallback and is currently slower. Honor an explicit user choice. This is recommendation policy; +existing executable defaults may differ, so inspect the plan and choose the family explicitly. + +Strata has three parts: + +- **The app** (`apps/desktop`, the Tauri shell; `apps/host`, the Node host and the web UI). It is for people who do + not want a terminal. One installer per system ([latest release](https://github.com/Niko1221/Strata/releases/latest)): + `Strata-0.2.5-windows-x64-setup.exe`, `Strata-0.2.5-linux-x86_64.AppImage`, `Strata-0.2.5-macos-arm64.dmg`. + The Windows and Linux installers carry no engine: the app downloads the engine for the graphics card on first + start, or installs a file the user already has. The Mac dmg keeps its small Metal engine inside. +- **The Terminal** (`strata.py`, `strata_cli/`, `strata_control/`): the `strata` command. It sets up a model, serves + it and watches it. Agents use this part. +- **The engine and the server** (`src/`, `include/`, `metal/`, `sycl/` for the C++/CUDA/HIP/SYCL/Metal engine; + `serve/` for the Python server with an OpenAI- and Anthropic-compatible API and a web page). `setup.py`, started by + `START-HERE.bat` or `setup.sh`, is setup from a source checkout, for developers. The release paths are the + installer and `strata launch`. ## Installing Strata for a user -Follow **[docs/AI_SETUP.md](docs/AI_SETUP.md)**: check the PC, pick the model by RAM, run setup non-interactively, -start and verify the server, and connect the user's apps. Never expose the server beyond `127.0.0.1` without -`--api-key`. As an alternative to shell commands, Strata's MCP server ([docs/MCP_SERVER.md](docs/MCP_SERVER.md)) -offers the same steps as tools. +Follow **[docs/AI_SETUP.md](docs/AI_SETUP.md)**. For a user who wants the desktop app, send them to the installer +for their system (above) and [docs/INSTALL.md](docs/INSTALL.md). For an agent that has a shell, use the Terminal; the +short version is: + +1. Install the Terminal. It needs no administrator rights. + + ```sh + curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh # Linux, Mac + irm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex # Windows PowerShell + ``` + + On Windows, open a new terminal afterwards so that `strata` is on the PATH. +2. Check what would happen. Nothing is changed: + + ```sh + strata launch --plan --family qwen --model q2_0 + ``` + +3. Set up and serve without questions. It downloads the engine for the card and the model (tens of GB), starts the + server, prints the addresses and returns. The server keeps running. + + ```sh + strata launch --family qwen --model q2_0 --yes --no-tui + ``` + + Useful flags (all of them: `strata launch --help`): `--family`, `--model-path` (files the user already has), + `--data-dir`, `--context 32k|64k|128k`, `--vision off|on|gpu|cpu`, `--parallel N`, `--gpu 0,1`, + `--access local|lan|cloudflare|tailscale`, `--port`, `--api-key-env NAME`, `--new-key`, `--save-preset NAME`, + `--speed faster|full` (DeepSeek), `--output json`. `strata launch --status` shows what is serving, `strata launch --stop` stops it, and + `strata launch --show-key` prints the API key. +4. Connect the user's apps: `strata connect` lists them, `strata connect --check` sends one prompt and one tool + call the way that app does. + +Keep the server on `127.0.0.1` unless the user asks for more. Beyond it an API key is recommended: `--access lan` makes one for you, and `--no-api-key` serves without one (a warning, never a refusal; on a public tunnel the warning is stronger). Source setup (`START-HERE.bat`, `setup.sh`) is the fallback for a developer or for a system with no release package; it is +documented in [docs/SOURCE_INSTALL.md](docs/SOURCE_INSTALL.md). Those wrappers exist in a source checkout, not in the +released app. Do not tell an app user to find a `.bat` file. +Source setup does not make an unsupported model or backend compatible. Strata's MCP server ([docs/MCP_SERVER.md](docs/MCP_SERVER.md)) offers the same steps as tools. ## Working on the code - How the engine works, every measured number, the API and all settings: [docs/DETAILS.md](docs/DETAILS.md) and the [paper](docs/paper/Strata-Paper.pdf). -- AMD (HIP) build and validation: [docs/AMD_HIP.md](docs/AMD_HIP.md); multi-GPU: [docs/MULTI_GPU.md](docs/MULTI_GPU.md). -- Setup's own tests run without a GPU or downloads: `python tools/test_setup_.py` (for example - `tools/test_setup_amd.py`, `tools/test_setup_choices.py`). -- Keep the docs' style: plain words, measured numbers with what they were measured on, no claims without a - measurement. +- The Terminal: [docs/TERMINAL.md](docs/TERMINAL.md) and [docs/TERMINAL_LAUNCH.md](docs/TERMINAL_LAUNCH.md). The app, + the packages and the update feed: [packaging/README.md](packaging/README.md) and [packaging/UPDATES.md](packaging/UPDATES.md). +- AMD (HIP) build and validation: [docs/AMD_HIP.md](docs/AMD_HIP.md); multi-GPU: [docs/MULTI_GPU.md](docs/MULTI_GPU.md); + Mac (Metal): [docs/MAC.md](docs/MAC.md). +- Tests: the Terminal and Control tests are in `tests/terminal` (`python -m pytest tests/terminal`). The app's UI + tests run with `npm test` in `apps/host`. Setup's own tests run without a GPU or downloads: + `python tools/test_setup_.py` (for example `tools/test_setup_amd.py`, `tools/test_setup_choices.py`). +- Keep the docs' style: plain words, short sentences, written for non-technical users first. Give measured numbers + with what they were measured on. Make no claim without a measurement. + +## Contributing a change or report + +The rules are in **[CONTRIBUTING.md](CONTRIBUTING.md)**. Read it before you open an issue or a pull request, and +follow it whether a person or an agent writes the text. The short version: + +- Start every issue and pull request title with its area: `[Engine]`, `[GUI]`, `[TUI]`, `[Benchmark]`, `[Docs]` or + `[Other]`, for example `[Engine] fix …`. A check on GitHub fails a pull request whose title has no area. +- Search the open and closed issues and pull requests first, and add to a thread that already covers your point. +- Agree the scope in an issue before a large feature, a refactor or a change to a default. +- One problem per pull request. Lead with the problem and the result, then the approach, then the validation + (passed, failed and not run, kept apart) and the limits. +- A new feature is opt-in, and the default path stays byte-identical to the last release. Say how you checked. +- Build every backend a file touches (CUDA, HIP, SYCL) before asking for review. +- Change a default only where you measured it faster, and show the numbers with what they were measured on. +- Never submit measurements, logs or reproduction steps you did not produce. Mark a finding from reading code as + unconfirmed static analysis. +- A report from hardware the maintainers do not have is welcome. Follow + [docs/COMMUNITY_BENCHMARKS.md](docs/COMMUNITY_BENCHMARKS.md), compare against a same-day run of the build you are + testing, and say what you did not test. +- Open test requests and the hardware that is wanted are listed in [docs/TEST_REQUESTS.md](docs/TEST_REQUESTS.md). diff --git a/engine/strata/BENCH.bat b/engine/strata/BENCH.bat new file mode 100644 index 00000000..f54bc90d --- /dev/null +++ b/engine/strata/BENCH.bat @@ -0,0 +1,19 @@ +@echo off +rem Benchmark this Strata install the way it is used and write a report you can share (docs/COMMUNITY_BENCHMARKS.md). +rem It starts the model with your settings (or uses the one already running), takes about 10 minutes and changes nothing. +rem Options: --clients 4 (several requests at once), --long (a 32K prompt), --compare . +rem This is the quick speed check. The standard benchmark (docs/BENCHMARK_PROTOCOL.md), whose results other people can compare with, is `strata bench run`. +setlocal +title Strata - benchmark +cd /d "%~dp0" +if not exist ".venv\Scripts\python.exe" ( + echo Strata is not set up here yet: run START-HERE.bat first. + pause + exit /b 1 +) +echo Quick speed check. For results other people can compare with (the standard benchmark, a few minutes), run: .venv\Scripts\python.exe strata.py bench run +echo. +".venv\Scripts\python.exe" tools\strata_bench.py %* +set "RC=%ERRORLEVEL%" +pause +exit /b %RC% diff --git a/engine/strata/CMakeLists.txt b/engine/strata/CMakeLists.txt index 4d9f2ca1..ef1a1aec 100644 --- a/engine/strata/CMakeLists.txt +++ b/engine/strata/CMakeLists.txt @@ -1,4 +1,4 @@ -# Strata Engine - top-level build (P1.S1). +# Strata Engine - top-level build (P1.S1). # # Targets (phase-1 §P1.S1): `strata_artifact` (no CUDA dependency), `tests`. `strata_plan` and the C++ # `strata-pack` are added when their sources exist - a target with no sources would make the build graph @@ -8,7 +8,18 @@ # below refuses anything older: silently building for a pre-Ampere arch would produce a binary that runs # and is wrong about its own performance, which is the worst of both outcomes. cmake_minimum_required(VERSION 3.24) -project(strata VERSION 0.1.35 LANGUAGES CXX) +project(strata VERSION 0.1.50 LANGUAGES CXX) +# EXPERIMENTAL: the Intel Arc engine, the SYCL port in sycl/ (PR #423; icpx + oneMKL, docs/INTEL_ARC.md). It is its +# own project that takes the unported sources from src/; with this on, nothing below is configured. +option(STRATA_ENABLE_SYCL "EXPERIMENTAL: build the Intel Arc (SYCL) engine from sycl/ - docs/INTEL_ARC.md" OFF) +if(STRATA_ENABLE_SYCL) + if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) + message(FATAL_ERROR "STRATA_ENABLE_SYCL is a separate backend; leave STRATA_ENABLE_CUDA and STRATA_ENABLE_HIP off") + endif() + message(WARNING "STRATA_ENABLE_SYCL: the Intel Arc engine is experimental (community port, docs/INTEL_ARC.md)") + add_subdirectory(sycl) + return() +endif() add_compile_definitions(STRATA_VERSION="${PROJECT_VERSION}") # issue #31: release builds keep a PDB beside the exe (not shipped in it), so a minidump from a stalled engine can # be read back to the exact source line @@ -21,10 +32,33 @@ endif() # instead of this machine's (Strata's own AVX-512 kernels are per-file and chosen at run time either way), and # the MSVC runtime linked in, so no Visual C++ redistributable is needed. option(STRATA_PORTABLE "build for other PCs: AVX2 baseline, static MSVC runtime" OFF) +# EXPERIMENTAL, opt-in: an engine for CPUs without AVX2 (#394, #595, #623), compiled on that PC. ggml-cpu, which then +# computes every CPU expert row, is built for this floor instead of AVX2 or the build host: "avx" (Sandy/Ivy Bridge: +# AVX, no FMA/F16C/AVX2) or "none" (SSE4.2 + POPCNT: Nehalem/Westmere). Strata's own AVX2/AVX-512 kernels stay in the +# binary behind their CPU checks; the router lookahead gets an AVX1 kernel. Empty (the default) changes nothing. +set(STRATA_ISA_FLOOR "" CACHE STRING "experimental older-CPU build: empty (default, AVX2 floor), avx, or none (SSE4.2)") +set_property(CACHE STRATA_ISA_FLOOR PROPERTY STRINGS "" avx none) +if(NOT STRATA_ISA_FLOOR STREQUAL "" AND NOT STRATA_ISA_FLOOR STREQUAL "avx" AND NOT STRATA_ISA_FLOOR STREQUAL "none") + message(FATAL_ERROR "STRATA_ISA_FLOOR must be empty, avx or none (got '${STRATA_ISA_FLOOR}')") +endif() +if(STRATA_ISA_FLOOR AND STRATA_PORTABLE) + message(FATAL_ERROR "STRATA_ISA_FLOOR (an older-CPU build) and STRATA_PORTABLE (the AVX2 release build) exclude each other") +endif() if(STRATA_PORTABLE AND MSVC) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded") endif() +# #3202: Windows hands a program its command line in the system's ANSI code page (cp1251 / cp866 on a Russian Windows, cp1252 on an +# English one), but the engine reads every path as UTF-8 (the run configs and the server write UTF-8). A model folder with +# Cyrillic letters arrived as other bytes, or as "?" where the page has no such letter, and the model did not open. This manifest +# makes the process's ANSI code page UTF-8 (Windows 10 1903 and newer; older Windows ignores it and nothing changes), so the +# command line, fopen and std::ifstream all take UTF-8. +function(strata_utf8_manifest target) + if(MSVC) + target_sources(${target} PRIVATE ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/cmake/strata-utf8.manifest) + endif() +endfunction() + set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -33,10 +67,22 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) endif() option(STRATA_ENABLE_CUDA "Build the CUDA targets (Phase 2+)" OFF) -option(STRATA_ENABLE_HIP "Build the HIP targets for wave32 AMD GPUs (gfx1100, gfx1201; gfx1030 unvalidated)" OFF) +# AMD gfx906 (MI50, wave64): the same .cu sources compiled as HIP through the gfx906 compat layer. The CUDA runtime and +# cuBLAS names are mapped by the headers in include/strata/platform/hip_compat/, which go first on the include path, +# and CUDA::cudart / CUDA::cublas become aliases of HIP's targets, so every CUDA target below stays as it is. This is +# separate from STRATA_ENABLE_HIP (the wave32 RDNA backend): with it on, STRATA_ENABLE_CUDA is on and +# STRATA_ENABLE_HIP stays off, so every "CUDA" branch of the tree is the one taken. +option(STRATA_HIP_GFX906 "Build the CUDA targets for AMD gfx906 through HIP (wave64 compat layer)" OFF) +if(STRATA_HIP_GFX906) + if(STRATA_ENABLE_HIP) + message(FATAL_ERROR "STRATA_HIP_GFX906 and STRATA_ENABLE_HIP are separate backends; enable only one") + endif() + set(STRATA_ENABLE_CUDA ON CACHE BOOL "" FORCE) +endif() +option(STRATA_ENABLE_HIP "Build the HIP targets for wave32 AMD GPUs (gfx1100, gfx1201; gfx1012/gfx1030 unvalidated)" OFF) option(STRATA_CUDA_STATIC "Linux GNU engine: static CUDA toolkit and C++ runtimes (host glibc and NVIDIA driver required)" OFF) if(STRATA_CUDA_STATIC) - if(NOT STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP OR NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" + if(NOT STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP OR STRATA_HIP_GFX906 OR NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" OR NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU") message(FATAL_ERROR "STRATA_CUDA_STATIC requires Linux, GNU C++, and STRATA_ENABLE_CUDA=ON (HIP disabled)") endif() @@ -44,15 +90,35 @@ if(STRATA_CUDA_STATIC) set(CMAKE_CUDA_RUNTIME_LIBRARY Static) endif() option(STRATA_PREFILL_MMQ "Build the optional GGML MMQ prefill path for HIP" OFF) -# CUDA: MMQ prompt kernels for Q4_K / Q5_K / Q5_1 (Unsloth's UD-Q4_K_XL experts). Off by default: the engine loads -# every kernel when it starts (CUDA_MODULE_LOADING=EAGER), so these took ~5 MB of VRAM - 1-3 expert slots - from every -# model, and the UD-Q4_K_XL prompt is SSD-bound with or without them (docs/UNSLOTH_Q4.md) -option(STRATA_MMQ_KQUANTS "Build the CUDA MMQ prompt kernels for Q4_K / Q5_K / Q5_1 experts" OFF) +# MMQ prompt kernels for Q4_K / Q5_K / Q5_1 / Q6_K (Unsloth's UD-Q4/Q5/Q6_K_XL experts; on HIP also the dense GGUF +# projections, STRATA_DENSE_MMQ). On by default since MODEL-UPDATE Phase 1: on CUDA they are their own library +# (strata_kq, loaded only for a model with these formats: the engine loads every kernel of its own binary at start, +# CUDA_MODULE_LOADING=EAGER, and these took ~3.8 MB of VRAM - 3 IQ3_XXS expert slots on a P100 - from every model); on +# HIP a code object loads on first use, so they cost other models nothing there (R9700: the same slots). Used at run +# time with STRATA_MMQ_KQ=1 (opt-in: it changes the prompt's rounding against the FP16 path). +option(STRATA_MMQ_TQ_OVERLAY "Gyro trellis MMQ prompt kernels on an upstream llama.cpp: an overlay of its ggml-cuda headers written at configure time (cmake/strata_ggml_tq_overlay.cmake)" ON) +option(STRATA_MMQ_KQUANTS "Build the MMQ prompt kernels for Q4_K / Q5_K / Q5_1 / Q6_K: the experts of Unsloth's K-quant files, and on HIP the dense GGUF projections (STRATA_DENSE_MMQ)" ON) +# Q6_K gate/up in the grouped expert kernels (Unsloth's UD-Q6_K_XL, and layer 2 of UD-Q5_K_XL; docs/QUANTS.md). On by +# default since MODEL-UPDATE Phase 1: one more instance per grouped kernel in iq_kernels.cu, +19 KB of sm_60 code, +# measured to leave every expert-cache slot count as it was (P100, R9700). -DSTRATA_Q6K_EXPERTS=OFF drops it. +option(STRATA_Q6K_EXPERTS "Build the Q6_K gate/up grouped expert kernels (UD-Q6_K_XL, UD-Q5_K_XL)" ON) +if(STRATA_Q6K_EXPERTS) + add_compile_definitions(STRATA_Q6K_EXPERTS=1) +endif() option(STRATA_ORCA_Q4KS_MMQ "Build the GGML Q5_0 MMQ instance for OrcaRouter Q4_K_S" OFF) +# CUDA: the pointer-table MMQ behind STRATA_MMQ_DIRECT=1 (the prompt path's MMQ reads resident experts in their cache +# slots through a Strata-side copy of llama.cpp's MMQ scheduler, src/prefill/moe_mmq_tab.cuh). Off by default, like +# the K-quant options above: the engine loads every kernel when it starts (CUDA_MODULE_LOADING=EAGER), and these nine +# instances (+15 MB of binary) take 36-38 MiB of VRAM per GPU on sm_86 - expert slots every model would lose, with +# STRATA_MMQ_DIRECT unset too. They also add ~70% of the upstream MMQ instances' compile time per CUDA arch (175 s +# of CPU for the nine at sm_86 alone). Off, the build's device code is byte for byte the one without this feature. CUDA +# only (not HIP, not gfx906); switched off at configure time when the llama.cpp tree's mmq.cuh is not one the copy +# was verified against. +option(STRATA_MMQ_TAB "Build the pointer-table prompt MMQ for STRATA_MMQ_DIRECT=1 (CUDA; ~37 MiB VRAM per GPU)" OFF) if(STRATA_PREFILL_MMQ AND NOT STRATA_ENABLE_HIP) message(FATAL_ERROR "STRATA_PREFILL_MMQ requires STRATA_ENABLE_HIP=ON") endif() -if(STRATA_ENABLE_CUDA AND STRATA_ENABLE_HIP) +if(STRATA_ENABLE_CUDA AND STRATA_ENABLE_HIP AND NOT STRATA_HIP_GFX906) message(FATAL_ERROR "STRATA_ENABLE_CUDA and STRATA_ENABLE_HIP are separate backends; enable only one") endif() if(STRATA_ENABLE_HIP) @@ -66,18 +132,57 @@ endif() option(STRATA_BUILD_TESTS "Build the test suite" ${_strata_tests_default}) option(STRATA_BUILD_CONVERSATION_TESTS "Build standalone conversation cache tests" OFF) option(STRATA_WERROR "Treat compiler warnings as errors" OFF) +# #2027: defined here, before the GPU section reads it to register the native-expert tests (it was defined at the +# native-experts section far below, so a first configure registered four tests fewer than the second) +option(STRATA_NATIVE_EXPERTS "Native (IQ) expert support through ggml-cpu" ON) if(STRATA_BUILD_CONVERSATION_TESTS) enable_testing() add_executable(conversation_cache_test src/core/conversation_cache_test.cpp) target_include_directories(conversation_cache_test PRIVATE include) add_test(NAME conversation_cache_test COMMAND conversation_cache_test) + add_executable(conversation_split_failure_test src/core/conversation_split_failure_test.cpp) + target_include_directories(conversation_split_failure_test PRIVATE include) + add_test(NAME conversation_split_failure_test COMMAND conversation_split_failure_test) add_executable(conversation_memory_test src/core/conversation_memory_test.cpp src/core/conversation_memory.cpp) target_include_directories(conversation_memory_test PRIVATE include) add_test(NAME conversation_memory_test COMMAND conversation_memory_test) + add_executable(conversation_file_test src/core/conversation_file_test.cpp src/core/conversation_file.cpp) + target_include_directories(conversation_file_test PRIVATE include) + add_test(NAME conversation_file_test COMMAND conversation_file_test) + add_executable(session_save_reclaim_test src/core/session_save_reclaim_test.cpp src/core/conversation_file.cpp) + target_include_directories(session_save_reclaim_test PRIVATE include) + add_test(NAME session_save_reclaim_test COMMAND session_save_reclaim_test) endif() -if(STRATA_ENABLE_CUDA) +if(STRATA_HIP_GFX906) + if(NOT DEFINED CMAKE_HIP_ARCHITECTURES) + set(CMAKE_HIP_ARCHITECTURES gfx906 CACHE STRING "HIP architectures" FORCE) + endif() + enable_language(HIP) + find_package(hip REQUIRED) + find_package(hipblas REQUIRED) + add_library(CUDA::cudart INTERFACE IMPORTED) + target_link_libraries(CUDA::cudart INTERFACE hip::host) + target_compile_definitions(CUDA::cudart INTERFACE STRATA_HIP_GFX906=1 __HIP_PLATFORM_AMD__=1) + target_include_directories(CUDA::cudart BEFORE INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include/strata/platform/hip_compat) + add_library(CUDA::cublas INTERFACE IMPORTED) + target_link_libraries(CUDA::cublas INTERFACE roc::hipblas CUDA::cudart) + set(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/include/strata/platform/hip_compat) + include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/strata/platform/hip_compat) + add_compile_definitions(STRATA_HIP_GFX906=1) + message(STATUS "Strata: HIP (gfx906 compat) enabled, arch ${CMAKE_HIP_ARCHITECTURES}") + set(_strata_gpu_runtime_target CUDA::cudart) + set(_strata_gpu_blas_target CUDA::cublas) + set(_strata_gpu_include_directories ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) +elseif(STRATA_ENABLE_CUDA) + # #585: CMake links CUDA code with the STATIC runtime by default, and the targets below also link CUDA::cudart (the + # DLL's import library). MSVC with a CUDA 12.x toolkit - the experimental Pascal/Volta build - then fails with + # LNK1169 (every cudart symbol defined twice); GNU ld lets it pass. That build links the shared runtime alone. The + # ready-made engine (CUDA 13, no STRATA_EXPERIMENTAL_SM60) is unchanged; -DCMAKE_CUDA_RUNTIME_LIBRARY overrides. + if(MSVC AND STRATA_EXPERIMENTAL_SM60 AND NOT DEFINED CMAKE_CUDA_RUNTIME_LIBRARY) + set(CMAKE_CUDA_RUNTIME_LIBRARY Shared) + endif() enable_language(CUDA) # `enable_language(CUDA)` gives the .cu compile rules but NOT the imported targets, so `CUDA::cudart` has to # be brought in explicitly for the host-side tests that call cudaMalloc themselves. @@ -116,6 +221,11 @@ if(STRATA_ENABLE_CUDA) "CUDA 12.8 crashed on long prompts on these cards (issues #220, #224). Use CUDA 13.0 or newer.") endif() endforeach() + if(STRATA_EXPERIMENTAL_SM60) + # every target sees it: the Pascal / Volta code paths (the Volta prompt attention, PR #600) are compiled into this + # build only, so the ready-made engine (sm_75+) keeps exactly the code it had + add_compile_definitions(STRATA_EXPERIMENTAL_SM60=1) + endif() message(STATUS "Strata: CUDA enabled, arch ${CMAKE_CUDA_ARCHITECTURES}") set(_strata_gpu_runtime_target CUDA::cudart) set(_strata_gpu_blas_target CUDA::cublas) @@ -132,7 +242,7 @@ if(STRATA_ENABLE_CUDA) set(_strata_gpu_include_directories ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) elseif(STRATA_ENABLE_HIP) set(_strata_gpu_runtime_target strata_hip_runtime) - set(_strata_gpu_blas_target roc::hipblas) + set(_strata_gpu_blas_target ${STRATA_HIP_BLAS_TARGETS}) set(_strata_gpu_include_directories ${STRATA_HIP_COMPAT_INCLUDE_DIR}) endif() @@ -175,6 +285,12 @@ target_link_libraries(strata-dequant PRIVATE strata_artifact) # this file is now nothing but the CLI entry point, and its inherited guard spells that as a "selftest" target_compile_definitions(strata-dequant PRIVATE STRATA_DEQUANT_SELFTEST) if(STRATA_BUILD_TESTS) + add_executable(batch_telemetry_test src/core/batch_telemetry_test.cpp) + target_include_directories(batch_telemetry_test PRIVATE include) + add_test(NAME batch_telemetry_test COMMAND batch_telemetry_test) + add_executable(logit_bias_test src/core/logit_bias_test.cpp) + target_include_directories(logit_bias_test PRIVATE include) + add_test(NAME logit_bias_test COMMAND logit_bias_test) # the reader refuses a duplicate tensor name at open, naming it (a synthetic GGUF: no model, no GPU) add_executable(gguf_reader_test src/artifact/gguf_reader_test.cpp) target_link_libraries(gguf_reader_test PRIVATE strata_artifact) @@ -183,6 +299,44 @@ if(STRATA_BUILD_TESTS) add_executable(gguf_split_test tests/core/gguf_split_test.cpp) target_link_libraries(gguf_split_test PRIVATE strata_artifact) add_test(NAME gguf_split_test COMMAND gguf_split_test) + # the model families (qwen4exp, qwen35moe): the guards, the geometry from metadata, the layout tables (synthetic) + add_executable(model_family_test tests/core/model_family_test.cpp) + target_link_libraries(model_family_test PRIVATE strata_artifact) + add_test(NAME model_family_test COMMAND model_family_test) + # how --batch cuts a prompt read into pieces (a layer split with no slot decoding must still reach a BYIELD) + add_executable(batch_read_test tests/program/batch_read_test.cpp) + target_include_directories(batch_read_test PRIVATE include) + add_test(NAME batch_read_test COMMAND batch_read_test) + # the model's geometry from its metadata, and the check against the kernels' compiled shape (synthetic) + add_executable(gguf_geometry_test tests/core/gguf_geometry_test.cpp) + target_link_libraries(gguf_geometry_test PRIVATE strata_artifact) + add_test(NAME gguf_geometry_test COMMAND gguf_geometry_test) + + # the hipBLASLt tuning header's architecture gate: RDNA4 siblings share solution IDs, RDNA3 siblings share + # theirs, cross-family pairs and version mismatches stay rejected (synthetic tables: no model, no GPU) + add_executable(tuning_header_arch_family_test tests/prefill/tuning_header_arch_family_test.cpp) + target_include_directories(tuning_header_arch_family_test PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/prefill") + add_test(NAME tuning_header_arch_family_test COMMAND tuning_header_arch_family_test) + + # the auto layer split's minimum stage size (#1616): header-only rule, no GPU + add_executable(split_rules_test tests/program/split_rules_test.cpp) + target_include_directories(split_rules_test PRIVATE include) + add_test(NAME split_rules_test COMMAND split_rules_test) + + # the prompt planner's host-memory model (#2824): header-only, no GPU + add_executable(prefill_plan_test tests/program/prefill_plan_test.cpp) + target_include_directories(prefill_plan_test PRIVATE include) + add_test(NAME prefill_plan_test COMMAND prefill_plan_test) + + # the default CPU prefill share is not armed when every expert is resident (#1595): header-only rule, no GPU + add_executable(share_rules_test tests/prefill/share_rules_test.cpp) + target_include_directories(share_rules_test PRIVATE include) + add_test(NAME share_rules_test COMMAND share_rules_test) + + # the Windows HIP auto prefill chunk cap (#1630) and the commit-limit verdict (#1607): header-only, no GPU + add_executable(host_limits_test tests/platform/host_limits_test.cpp) + target_include_directories(host_limits_test PRIVATE include) + add_test(NAME host_limits_test COMMAND host_limits_test) endif() # ---- strata_plan ---------------------------------------------------------- @@ -201,6 +355,8 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) add_library(strata_core STATIC src/core/device.cu src/core/pinned.cu src/platform/memory.cpp src/core/graph.cpp src/core/weights.cpp src/core/layout.cpp) target_include_directories(strata_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) + # the DFlash2 drafter (src/core/dflash2.cpp, src/kernels/cuda/dflash2.cu) exists in the CUDA and HIP builds; the Metal and SYCL builds compile without it + target_compile_definitions(strata_core PUBLIC STRATA_HAVE_DFLASH2=1) if(STRATA_ENABLE_CUDA AND STRATA_EXPERIMENTAL_SM60) # the runtime device check (src/core/device.cu) admits the cards this build was made for (#236) target_compile_definitions(strata_core PRIVATE STRATA_EXPERIMENTAL_SM60=1) @@ -241,6 +397,7 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) # reference is the whole point - a kernel checked against another copy of itself proves nothing. add_library(strata_kernels STATIC src/kernels/cuda/dequant_s2.cu src/kernels/cuda/s2_gemv.cu src/kernels/cuda/s_gemv.cu + src/kernels/cuda/s_gemv_pair.cu src/kernels/cuda/s2_gemv_quads.cu src/kernels/cuda/s2_gemv_fast.cu src/kernels/cuda/router_top10.cu @@ -262,6 +419,7 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) src/kernels/cuda/native_gdn.cu src/kernels/cuda/native_gr_postops.cu src/kernels/cuda/native_router.cu + src/kernels/cuda/route_prior.cu src/kernels/cuda/native_gdn_preprocess.cu src/kernels/cuda/native_qsa.cu src/kernels/cuda/native_rope.cu @@ -282,6 +440,7 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) src/kernels/cuda/dequant_bf16.cu src/kernels/cuda/qsa_select.cu src/kernels/cuda/verify_kernels.cu + src/kernels/cuda/dflash2.cu src/kernels/cuda/iq_kernels.cu src/kernels/ngram.cpp src/ngram/ple_reader.cpp @@ -316,6 +475,21 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) add_executable(strata_next_kar_ple_probe "${STRATA_NEXT_KAR_DIR}/src/kar_ple_cpu_probe.cpp") target_link_libraries(strata_next_kar_ple_probe PRIVATE strata_kernels) endif() + # Exact gfx1100 prompt scorer (PR1825 method port): optional standalone test, + # also available where the published source omits tests/. + option(STRATA_PARITY_GFX1100_QSA_SCORES "Build the exact gfx1100 QSA score/ID check" OFF) + if(STRATA_ENABLE_HIP AND (STRATA_BUILD_TESTS OR STRATA_PARITY_GFX1100_QSA_SCORES)) + set_source_files_properties(src/kernels/cuda/qsa_scores_gfx1100_test.cu + src/kernels/qsa_scores_gfx1100_parity.cpp PROPERTIES LANGUAGE HIP) + add_executable(qsa_scores_gfx1100_parity src/kernels/qsa_scores_gfx1100_parity.cpp + src/kernels/cuda/qsa_scores_gfx1100_test.cu) + target_include_directories(qsa_scores_gfx1100_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(qsa_scores_gfx1100_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + enable_testing() + add_test(NAME qsa_scores_gfx1100_parity COMMAND qsa_scores_gfx1100_parity --full) + set_tests_properties(qsa_scores_gfx1100_parity PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 180 + ENVIRONMENT "STRATA_SCORES_THREAD=1;STRATA_SCORES_THREAD_TRACE=1") + endif() # perf-review D-1: the tensor-core prompt attention vs the FP32 kernel and FP64 (GPU, synthetic, no model); with # the tests, or alone with -DSTRATA_PARITY_PROMPT_ATTN=ON. CUDA only: HIP compiles the tensor-core kernel out. if((STRATA_BUILD_TESTS OR STRATA_PARITY_PROMPT_ATTN) AND STRATA_ENABLE_CUDA) @@ -323,6 +497,56 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_include_directories(qsa_prompt_attn_parity PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) target_link_libraries(qsa_prompt_attn_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) endif() + # PR #600: the Volta (sm_70) prompt attention's latency pipeline against the FP32 kernel it replaces. Only in the + # experimental sm_60/sm_70 build, where prompt_attn_v70_kernel is compiled in. + if(STRATA_BUILD_TESTS AND STRATA_ENABLE_CUDA AND STRATA_EXPERIMENTAL_SM60) + add_executable(qsa_prompt_attn_sm70_bench bench/qsa_prompt_attn_sm70_bench.cpp) + target_include_directories(qsa_prompt_attn_sm70_bench PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) + target_link_libraries(qsa_prompt_attn_sm70_bench PRIVATE strata_kernels CUDA::cudart) + endif() + # #512: the top-k's active-block bound (Turing's dispatch, forced on any card by STRATA_TOPK_ACTIVE_ANY) against + # the capacity rule, selected ids bitwise + if(STRATA_BUILD_TESTS AND STRATA_ENABLE_CUDA) + add_executable(qsa_topk_active_parity src/kernels/qsa_topk_active_parity.cpp) + target_include_directories(qsa_topk_active_parity PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) + target_link_libraries(qsa_topk_active_parity PRIVATE strata_kernels CUDA::cudart) + add_test(NAME qsa_topk_active_parity COMMAND qsa_topk_active_parity) + set_tests_properties(qsa_topk_active_parity PROPERTIES SKIP_RETURN_CODE 77) + # STRATA_QSA_SLOTS: a batch window's scores, top-k and attention as one launch over rows of different slots + # against one call per row, bitwise (synthetic, no model) + add_executable(qsa_slots_parity src/kernels/qsa_slots_parity.cpp) + target_include_directories(qsa_slots_parity PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) + target_link_libraries(qsa_slots_parity PRIVATE strata_kernels CUDA::cudart) + add_test(NAME qsa_slots_parity COMMAND qsa_slots_parity) + add_test(NAME qsa_slots_parity_lanecell COMMAND qsa_slots_parity) + set_tests_properties(qsa_slots_parity qsa_slots_parity_lanecell PROPERTIES SKIP_RETURN_CODE 77) + set_tests_properties(qsa_slots_parity_lanecell PROPERTIES ENVIRONMENT "STRATA_ATTN_LANECELL=1") + # fork: the Daily's decode attention (STRATA_ATTN_DAILY=1: PR #540's chunk kernel on every card and the bounded + # merge) against upstream's kernels, bitwise; the production entries checked with the variable off and on + add_executable(qsa_merge_daily_parity src/kernels/qsa_merge_daily_parity.cpp) + target_include_directories(qsa_merge_daily_parity PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) + target_link_libraries(qsa_merge_daily_parity PRIVATE strata_kernels CUDA::cudart) + add_test(NAME qsa_merge_daily_parity_default COMMAND qsa_merge_daily_parity) + add_test(NAME qsa_merge_daily_parity_daily COMMAND qsa_merge_daily_parity) + set_tests_properties(qsa_merge_daily_parity_default PROPERTIES ENVIRONMENT "STRATA_ATTN_DAILY=0" + SKIP_RETURN_CODE 77) + set_tests_properties(qsa_merge_daily_parity_daily PROPERTIES ENVIRONMENT "STRATA_ATTN_DAILY=1" + SKIP_RETURN_CODE 77) + # the prompt path's block scores on the thread-per-head kernel (Turing) against the warp kernel, bitwise + add_executable(qsa_scores_parity src/kernels/qsa_scores_parity.cpp) + target_include_directories(qsa_scores_parity PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) + target_link_libraries(qsa_scores_parity PRIVATE strata_kernels CUDA::cudart) + add_test(NAME qsa_scores_parity COMMAND qsa_scores_parity) + set_tests_properties(qsa_scores_parity PROPERTIES SKIP_RETURN_CODE 77 ENVIRONMENT "STRATA_SCORES_THREAD=1") + endif() + # QSAROWS (docs/QSAROWS.md): what the T rows of a verification window cost in a QSA layer's decode kernels at a long + # context (block scores, top-k, attention over each row's selection, indexer append), row by row; GPU, synthetic, no + # model. Not in the default build: `cmake --build --target qsa_rows_bench`. + if(STRATA_ENABLE_CUDA) + add_executable(qsa_rows_bench EXCLUDE_FROM_ALL src/kernels/qsa_rows_bench.cpp) + target_include_directories(qsa_rows_bench PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) + target_link_libraries(qsa_rows_bench PRIVATE strata_kernels CUDA::cudart) + endif() # the QSA selection (block scores on the warp kernel and the tensor-core one, top-k): a GPU bench with a # scorer-vs-scorer comparison and an FP64 accuracy gate (synthetic, no model); the ctest runs a 32K context under a # 262144-cell capacity (the top-k dispatch follows the capacity) and exits non-zero on a failed gate @@ -331,6 +555,24 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) set_source_files_properties(src/kernels/qsa_select_bench.cpp PROPERTIES LANGUAGE HIP) target_link_libraries(qsa_select_bench PRIVATE strata_kernels strata_hip_runtime) add_test(NAME qsa_select_bench COMMAND qsa_select_bench 32768 256 3 262144) + # the FP32 tiled scorer (STRATA_SELECT_SIMT=1) on HIP: FP64 gate and selections against the warp kernel at 131K + add_test(NAME qsa_select_bench_fp32_tiled COMMAND qsa_select_bench 131072 256 3 262144) + set_tests_properties(qsa_select_bench_fp32_tiled PROPERTIES ENVIRONMENT "STRATA_SELECT_SIMT=1") + endif() + # the same on CUDA: the tensor-core scorer (sm_80+) or the FP32 tiled one (below sm_80, and forced on any card by + # STRATA_QSA_WARP=1 in the second test) against the warp kernel and FP64, at 32K and 131K + if(STRATA_BUILD_TESTS AND STRATA_ENABLE_CUDA) + add_executable(qsa_select_bench src/kernels/qsa_select_bench.cpp) + target_include_directories(qsa_select_bench PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) + target_link_libraries(qsa_select_bench PRIVATE strata_kernels CUDA::cudart) + add_test(NAME qsa_select_bench COMMAND qsa_select_bench 32768 256 3 262144) + add_test(NAME qsa_select_bench_fp32_tiled COMMAND qsa_select_bench 131072 256 3 262144) + set_tests_properties(qsa_select_bench_fp32_tiled PROPERTIES ENVIRONMENT "STRATA_QSA_WARP=1;STRATA_SELECT_SIMT=1") + endif() + if(STRATA_BUILD_TESTS AND STRATA_ENABLE_CUDA) # the prompt attention on a recorded selection (STRATA_QSA_DUMP) + add_executable(pa_bench tests/cuda/pa_bench.cpp) + target_include_directories(pa_bench PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) + target_link_libraries(pa_bench PRIVATE strata_kernels CUDA::cudart) endif() # plan v0.3 P6: llama.cpp's block layouts and codebook grids for the i-quant formats (MIT, third_party/ggml) target_include_directories(strata_kernels PRIVATE third_party/ggml) @@ -349,7 +591,7 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) src/kernels/cuda/native_flash_attn.cu src/kernels/cuda/native_qsa_indexer.cu src/kernels/cuda/native_qsa_score.cu - PROPERTIES COMPILE_OPTIONS "--use_fast_math") + PROPERTIES COMPILE_OPTIONS "$,,--use_fast_math>") elseif(STRATA_ENABLE_HIP) # Keep Q8_K's multiply and magic-bias rounding as separate FP32 operations on HIP; contraction to an # FMA changes tie results. The embedding gather also relies on separately rounded operations. @@ -388,10 +630,36 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) # library is the honest shape of the dependency graph: core knows about devices and weights, kernels know # about arithmetic, and this one knows the ORDER the arithmetic happens in. add_library(strata_engine STATIC src/core/keyless.cpp src/core/layer.cpp src/core/session.cpp src/core/expert_source.cpp src/core/remote_experts.cpp - src/core/expert_cache.cpp src/core/native_head.cpp src/core/native_dense.cpp src/core/verify.cpp src/core/mtp.cpp - src/core/conversation_snapshot.cpp src/core/conversation_state.cpp src/core/conversation_memory.cpp) + src/core/remote_expert_opt.cu + src/core/expert_cache.cpp src/core/native_head.cpp src/core/native_dense.cpp src/core/verify.cpp src/core/mtp.cpp src/core/dflash2.cpp + src/core/conversation_snapshot.cpp src/core/conversation_state.cpp src/core/conversation_memory.cpp src/core/peer_experts.cpp + src/core/arch_defaults.cpp src/core/nv_defaults.cpp src/core/vmm.cpp src/core/conversation_file.cpp) target_include_directories(strata_engine PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) target_link_libraries(strata_engine PUBLIC strata_core strata_kernels strata_kernels_cpu ${_strata_gpu_runtime_target}) + if(STRATA_BUILD_TESTS AND STRATA_ENABLE_CUDA AND NOT STRATA_HIP_GFX906) + add_executable(host_graph_launch_test tests/core/host_graph_launch_test.cu) + target_include_directories(host_graph_launch_test PRIVATE include) + target_link_libraries(host_graph_launch_test PRIVATE CUDA::cudart Threads::Threads) + add_test(NAME host_graph_launch_test COMMAND host_graph_launch_test) + set_tests_properties(host_graph_launch_test PROPERTIES TIMEOUT 30) + endif() + if(STRATA_BUILD_TESTS AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/core/exchange_storage_test.cpp") + add_executable(exchange_storage_test tests/core/exchange_storage_test.cpp) + target_include_directories(exchange_storage_test PRIVATE include) + target_link_libraries(exchange_storage_test PRIVATE Threads::Threads) + add_test(NAME exchange_storage_test COMMAND exchange_storage_test) + set_tests_properties(exchange_storage_test PROPERTIES TIMEOUT 60) + endif() + + # available_host_bytes(): MemAvailable, cgroup limits and the operator's --memory-limit-mib cap on fixture directories + # - no GPU, no CUDA + if(STRATA_BUILD_TESTS AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/core/memory_guard_test.cpp") + add_executable(memory_guard_test tests/core/memory_guard_test.cpp src/core/conversation_memory.cpp) + target_include_directories(memory_guard_test PRIVATE include) + add_test(NAME memory_guard_test COMMAND memory_guard_test) + set_tests_properties(memory_guard_test PROPERTIES TIMEOUT 60) + endif() + option(STRATA_NEXT_EXPERIMENTAL_KAR_EXPERTS "Build the opt-in KAR native decode cache-miss arm" OFF) if(STRATA_NEXT_EXPERIMENTAL_KAR_EXPERTS) if(NOT STRATA_ENABLE_CUDA OR NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") @@ -422,6 +690,41 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_link_libraries(file_expert_source_test PRIVATE strata_engine) add_test(NAME file_expert_source_test COMMAND file_expert_source_test) set_tests_properties(file_expert_source_test PROPERTIES TIMEOUT 60) + add_executable(vmm_test tests/core/vmm_test.cpp) + target_link_libraries(vmm_test PRIVATE strata_engine) + add_test(NAME vmm_test COMMAND vmm_test) + set_tests_properties(vmm_test PROPERTIES TIMEOUT 60) + # The resident RAM mode with a layer split: the copy keeps each stage's lend region, and the experts the + # prompt path borrows are served from RAM (the file source reads none of them). The device calls are + # wrapped - conversation_transfer_test's pattern - and `pin = false` keeps the copy pageable, so this + # runs on a CPU-only PC. + if(NOT STRATA_ENABLE_HIP AND UNIX AND NOT APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + add_executable(split_lend_complement_test tests/core/split_lend_complement_test.cpp) + target_link_libraries(split_lend_complement_test PRIVATE strata_engine) + target_link_options(split_lend_complement_test PRIVATE + -Wl,--wrap=cudaMalloc -Wl,--wrap=cudaFree -Wl,--wrap=cudaMemset -Wl,--wrap=cudaMemcpy + -Wl,--wrap=cudaMemcpyAsync -Wl,--wrap=cudaStreamSynchronize -Wl,--wrap=cudaDeviceSynchronize + -Wl,--wrap=cudaGetLastError -Wl,--wrap=cudaGetDevice -Wl,--wrap=cudaSetDevice + -Wl,--wrap=cudaMemGetInfo -Wl,--wrap=cudaHostAlloc -Wl,--wrap=cudaFreeHost) + add_test(NAME split_lend_complement_test COMMAND split_lend_complement_test) + set_tests_properties(split_lend_complement_test PROPERTIES ENVIRONMENT "CUDA_VISIBLE_DEVICES=-1" TIMEOUT 120) + endif() + endif() + # #477: the learned expert profile (--expert-profile-save): its order and make_profile.py's file format (CPU only) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/core/expert_profile_save_test.cpp") + enable_testing() + add_executable(expert_profile_save_test tests/core/expert_profile_save_test.cpp) + target_link_libraries(expert_profile_save_test PRIVATE strata_engine) + add_test(NAME expert_profile_save_test COMMAND expert_profile_save_test) + set_tests_properties(expert_profile_save_test PROPERTIES TIMEOUT 60) + endif() + # the profile header's version is enforced: a version other than 1 is refused by its number (CPU only) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/core/expert_profile_version_test.cpp") + enable_testing() + add_executable(expert_profile_version_test tests/core/expert_profile_version_test.cpp) + target_link_libraries(expert_profile_version_test PRIVATE strata_engine) + add_test(NAME expert_profile_version_test COMMAND expert_profile_version_test) + set_tests_properties(expert_profile_version_test PROPERTIES TIMEOUT 60) endif() if(STRATA_BUILD_TESTS AND STRATA_NATIVE_EXPERTS) # native_experts.txt v2-v4 (the real packs' copies and the per-role shard column) and the arena filled from @@ -440,6 +743,16 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_link_libraries(expert_cache_per_layer_test PRIVATE strata_engine) add_test(NAME expert_cache_per_layer_test COMMAND expert_cache_per_layer_test) set_tests_properties(expert_cache_per_layer_test PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60) + add_executable(expert_cache_segmented_test tests/core/expert_cache_segmented_test.cpp) + target_link_libraries(expert_cache_segmented_test PRIVATE strata_engine) + add_test(NAME expert_cache_segmented_test COMMAND expert_cache_segmented_test) + set_tests_properties(expert_cache_segmented_test PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60) + # STRATA_MMQ_DIRECT: slot_guard / slot_room / slot_tail on the uniform and the sized cache, and the default + # (no guard) sized layout unchanged + add_executable(expert_cache_slot_guard_test tests/core/expert_cache_slot_guard_test.cpp) + target_link_libraries(expert_cache_slot_guard_test PRIVATE strata_engine) + add_test(NAME expert_cache_slot_guard_test COMMAND expert_cache_slot_guard_test) + set_tests_properties(expert_cache_slot_guard_test PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 60) endif() if(STRATA_BUILD_CONVERSATION_TESTS) add_executable(keyless_stream_parity src/kernels/kv_stream_parity.cpp) @@ -458,7 +771,9 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) add_executable(conversation_transfer_test src/core/conversation_validation_test.cpp) target_compile_definitions(conversation_transfer_test PRIVATE CONVERSATION_TEST_TRANSFERS) target_link_options(conversation_transfer_test PRIVATE - -Wl,--wrap=cudaMemcpy -Wl,--wrap=cudaDeviceSynchronize -Wl,--wrap=cudaGetLastError) + -Wl,--wrap=cudaMemcpy -Wl,--wrap=cudaMemcpyAsync -Wl,--wrap=cudaStreamSynchronize + -Wl,--wrap=cudaGetDevice -Wl,--wrap=cudaStreamCreateWithFlags + -Wl,--wrap=cudaDeviceSynchronize -Wl,--wrap=cudaGetLastError) target_link_libraries(conversation_transfer_test PRIVATE strata_engine) add_test(NAME conversation_transfer_test COMMAND conversation_transfer_test) set_tests_properties(conversation_transfer_test PROPERTIES ENVIRONMENT "CUDA_VISIBLE_DEVICES=-1" TIMEOUT 120) @@ -470,8 +785,17 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) # against llama.cpp on the SAME ids and a tokenizer on one side of that comparison is a second variable. # plan v0.3 P5: batched prompt processing (tensor-core GEMMs through cuBLAS). add_library(strata_prefill STATIC src/prefill/gemm.cu src/prefill/kernels.cu src/prefill/prefill.cpp) + if(STRATA_ENABLE_HIP) + # #313: the RDNA3 WMMA GEMMs include hip_runtime.h: AMD builds only (a CUDA build never sees this file) + target_sources(strata_prefill PRIVATE src/prefill/wmma_gemm.cu) + endif() target_include_directories(strata_prefill PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories}) target_link_libraries(strata_prefill PUBLIC strata_engine ${_strata_gpu_blas_target} ${_strata_gpu_runtime_target}) + if(STRATA_ENABLE_CUDA) + # v100/gdn-chunk: the chunked Volta GDN prompt recurrence. The dispatch (src/prefill/kernels.cu) is + # Volta-only (cc 7.0) and gated on STRATA_EXPERIMENTAL_SM60; the path itself stays opt-in (STRATA_GDN_CHUNK). + target_sources(strata_prefill PRIVATE src/prefill/gdn_chunk.cu) + endif() if(STRATA_ENABLE_HIP AND STRATA_HIPBLASLT_AVAILABLE) target_compile_definitions(strata_prefill PRIVATE STRATA_HIPBLASLT_AVAILABLE=1) target_link_libraries(strata_prefill PRIVATE roc::hipblaslt) @@ -479,18 +803,201 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) add_executable(tune_hipblaslt tools/hip/tune_hipblaslt.cpp) target_link_libraries(tune_hipblaslt PRIVATE hip::host roc::hipblas roc::hipblaslt) endif() + if(STRATA_ENABLE_HIP AND STRATA_ROCBLAS_AVAILABLE) + # the prompt path's rocBLAS solution table (STRATA_ROCBLAS_TUNING; tools/hip/tune_rocblas makes one) + target_compile_definitions(strata_prefill PRIVATE STRATA_ROCBLAS_AVAILABLE=1) + target_link_libraries(strata_prefill PRIVATE roc::rocblas) + + add_executable(tune_rocblas tools/hip/tune_rocblas.cpp) + target_link_libraries(tune_rocblas PRIVATE hip::host roc::rocblas) + endif() + + # DFlash2 drafter tools (not built by default: cmake --build --target dflash2_parity dflash2_gemm_bench dflash2_attn_bench): the drafter against + # the torch port on a synthetic case (needs the pack and a case file, tools/dflash2/mk_parity_case.py), and the timing of its Q8 GEMM and attention + add_executable(dflash2_parity EXCLUDE_FROM_ALL src/core/dflash2_parity.cpp) + target_include_directories(dflash2_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(dflash2_parity PRIVATE strata_engine strata_kernels ${_strata_gpu_runtime_target}) + add_executable(dflash2_gemm_bench EXCLUDE_FROM_ALL src/core/dflash2_gemm_bench.cpp) + target_include_directories(dflash2_gemm_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(dflash2_gemm_bench PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_executable(dflash2_launch_bench EXCLUDE_FROM_ALL src/core/dflash2_launch_bench.cu) + target_include_directories(dflash2_launch_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(dflash2_launch_bench PRIVATE ${_strata_gpu_runtime_target}) + add_executable(dflash2_bw_bench EXCLUDE_FROM_ALL src/core/dflash2_bw_bench.cu) + target_include_directories(dflash2_bw_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(dflash2_bw_bench PRIVATE ${_strata_gpu_runtime_target}) + add_executable(dflash2_small_bench EXCLUDE_FROM_ALL src/core/dflash2_small_bench.cpp) + target_include_directories(dflash2_small_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(dflash2_small_bench PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_executable(dflash2_attn_bench EXCLUDE_FROM_ALL src/core/dflash2_attn_bench.cpp) + target_include_directories(dflash2_attn_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(dflash2_attn_bench PRIVATE strata_kernels ${_strata_gpu_runtime_target}) add_executable(strata src/program/generate.cpp) + strata_utf8_manifest(strata) target_include_directories(strata PRIVATE ${_strata_gpu_include_directories}) target_link_libraries(strata PRIVATE strata_engine strata_prefill strata_spec ${_strata_gpu_runtime_target}) if(STRATA_CUDA_STATIC) target_link_options(strata PRIVATE -static-libstdc++ -static-libgcc) set_target_properties(strata PROPERTIES SKIP_BUILD_RPATH TRUE INSTALL_RPATH "") endif() + if(WIN32 AND STRATA_ENABLE_HIP) + # 0.2.1.2: the ROCm math libraries live in \rocm\bin, which is on PATH only when the launcher starts the engine; load them on first + # use (main() adds that folder to the DLL search first) so `strata.exe --version` works from the package folder. amdhip64_7.dll and the + # C++ runtime sit beside the exe (tools/hip/package_windows.py) and stay normal imports. + target_link_libraries(strata PRIVATE delayimp) + target_link_options(strata PRIVATE "LINKER:/DELAYLOAD:hipblas.dll" "LINKER:/DELAYLOAD:libhipblaslt.dll" "LINKER:/DELAYLOAD:rocblas.dll") + endif() + + # NEW-MODELS-PLAN.md T1: Qwen3.6-35B-A3B's reference path (one GPU, the model resident, plain kernels), checked + # against llama.cpp by tools/qwen35/; the engine itself does not run the family yet + add_executable(strata-q36ref src/qwen35/q36ref.cu) + target_include_directories(strata-q36ref PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories}) + target_link_libraries(strata-q36ref PRIVATE strata_kernels strata_warnings ${_strata_gpu_runtime_target}) + # the engine path for the same family (serve protocol, prompt chunks, decode graph): src/qwen35/q36_engine.cu, a + # library that `strata` switches to for a qwen35moe model (the family switch at the top of its main) and that + # strata-q36 wraps on its own. Not on gfx906 (#3172, #3271): it calls cuBLAS entry points the wave64 compat layer does + # not map (cublasSgemm, cublasGemmStridedBatchedEx) and its kernels assume 32-lane warps; main() guards every use with + # STRATA_HAVE_QWEN35, so a gfx906 build links and runs the Qwen3.8 family, and `strata --families` says so + if(NOT STRATA_HIP_GFX906) + add_library(strata_qwen35 STATIC src/qwen35/q36_engine.cu) + target_include_directories(strata_qwen35 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(strata_qwen35 PRIVATE strata_prefill strata_kernels strata_warnings ${_strata_gpu_runtime_target}) + if(STRATA_NATIVE_EXPERTS) + # the hybrid mode (experts that do not all fit in VRAM): the CPU expert pool on ggml-cpu's arithmetic + target_link_libraries(strata_qwen35 PRIVATE strata_kernels_cpu) + target_compile_definitions(strata_qwen35 PRIVATE STRATA_Q36_CPU_POOL=1) + endif() + add_executable(strata-q36 src/qwen35/q36_main.cpp) + strata_utf8_manifest(strata-q36) + target_link_libraries(strata-q36 PRIVATE strata_qwen35 ${_strata_gpu_runtime_target}) + target_link_libraries(strata PRIVATE strata_qwen35) + target_compile_definitions(strata PRIVATE STRATA_HAVE_QWEN35=1) + endif() + + # DeepSeek-V4.1-Flash: the third engine path (src/dsv41, from Project Maya's maya-ds4, MIT, third_party/project-maya). + # Its own executable for now (strata-dsv41); a family switch in `strata` comes after first light. OFF by default: it + # changes no existing target (the vendored kernels live in strata::dsv41k, so no symbol is shared with strata_kernels). + option(STRATA_BUILD_DSV41 "Build the DeepSeek-V4.1 engine path (strata-dsv41)" OFF) + if(STRATA_BUILD_DSV41 AND NOT STRATA_HIP_GFX906) + add_library(strata_dsv41_kernels STATIC src/dsv41/vendor/exl3.cu src/dsv41/vendor/sampler.cu src/dsv41/vendor/moe_win.cu + src/dsv41/vendor/exl3_cpu.cpp) + if(NOT STRATA_ENABLE_HIP) # (the pre-sm_80 NVIDIA decode kernels exl3.cu dispatches to) + target_sources(strata_dsv41_kernels PRIVATE src/dsv41/vendor/exl3_legacy.cu) + endif() + target_include_directories(strata_dsv41_kernels PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories}) + target_link_libraries(strata_dsv41_kernels PUBLIC ${_strata_gpu_runtime_target}) + add_executable(strata-dsv41 src/dsv41/ds4_main.cpp src/dsv41/ds4_model.cu src/dsv41/ds4_kernels.cu src/dsv41/ds4_vision.cu + src/dsv41/ds4_gguf.cu src/dsv41/ds4_gguf_cpu.cpp src/dsv41/ds4_iq.cu src/dsv41/ds4_iq_cpu.cpp + src/dsv41/ds4_tq.cu src/dsv41/ds4_tq_cpu.cpp src/dsv41/ds4_gg_cpu.cpp src/dsv41/ds4_packinfo.cpp) + # the commit the binary was built from, readable with --version (set -DSTRATA_BUILD_ID=... for a tree without .git) + if(NOT STRATA_BUILD_ID AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/BUILD_ID) # (a git archive has no .git: the packer writes the commit here) + file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/BUILD_ID STRATA_BUILD_ID LIMIT_COUNT 1) + endif() + if(NOT STRATA_BUILD_ID) + execute_process(COMMAND git -C ${CMAKE_CURRENT_SOURCE_DIR} rev-parse --short=9 HEAD OUTPUT_VARIABLE STRATA_BUILD_ID + OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) + endif() + if(NOT STRATA_BUILD_ID) + set(STRATA_BUILD_ID unknown) + endif() + set_source_files_properties(src/dsv41/ds4_main.cpp PROPERTIES COMPILE_DEFINITIONS "DS4_BUILD_ID=\"${STRATA_BUILD_ID}\"") + target_include_directories(strata-dsv41 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories} + ${CMAKE_CURRENT_SOURCE_DIR}/third_party/ggml) + target_link_libraries(strata-dsv41 PRIVATE strata_dsv41_kernels ${_strata_gpu_runtime_target} ${_strata_gpu_blas_target}) + find_package(Threads REQUIRED) + target_link_libraries(strata-dsv41 PRIVATE Threads::Threads) + if(WIN32 AND STRATA_ENABLE_HIP) # cudaMemGetInfo is the DXGI-budgeted hip_compat::mem_get_info (src/core/device.cu): on a Strix Halo the + # carve-out is not all the GPU may use, and the engine sizes its expert tiers by what the budget says is free + target_link_libraries(strata-dsv41 PRIVATE strata_core) + endif() + if(STRATA_NATIVE_EXPERTS) # Strata's CPU trellis kernels (tq_cpu.hpp) for the trellis experts on the CPU lane + target_link_libraries(strata-dsv41 PRIVATE strata_kernels_cpu) + target_compile_definitions(strata-dsv41 PRIVATE STRATA_DSV41_TQ_CPU=1) + endif() + if(STRATA_NATIVE_EXPERTS) + # the CPU lane's ggml-type rows: ggml-cpu's dots against Strata's AVX2 i-quant rows (bits and GB/s); no GPU, no model + add_executable(ds4_gg_bench tests/dsv41/gg_dot_bench.cpp src/dsv41/ds4_gg_cpu.cpp) + target_include_directories(ds4_gg_bench PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src/dsv41 + ${CMAKE_CURRENT_SOURCE_DIR}/third_party/ggml) + target_link_libraries(ds4_gg_bench PRIVATE strata_kernels_cpu Threads::Threads) + target_compile_definitions(ds4_gg_bench PRIVATE STRATA_DSV41_TQ_CPU=1) + endif() + if(STRATA_NATIVE_EXPERTS) + # the trellis experts (device kernels ds4_tq.cu, CPU lane ds4_tq_cpu.cpp) against a double reference; needs a GPU, no model + # both test .cpp files launch kernels, so they compile as HIP on the AMD backend and as CUDA on the NVIDIA one + if(STRATA_ENABLE_HIP) + set(_ds4_test_lang HIP) + elseif(STRATA_ENABLE_CUDA) + set(_ds4_test_lang CUDA) + else() + set(_ds4_test_lang CXX) + endif() + set_source_files_properties(tests/dsv41/tq_expert_test.cpp PROPERTIES LANGUAGE ${_ds4_test_lang}) + add_executable(ds4_tq_test tests/dsv41/tq_expert_test.cpp src/dsv41/ds4_tq.cu src/dsv41/ds4_iq.cu src/dsv41/ds4_tq_cpu.cpp + src/dsv41/ds4_iq_cpu.cpp src/dsv41/ds4_gg_cpu.cpp tools/trellis/tqenc.cpp) + target_include_directories(ds4_tq_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories} + ${CMAKE_CURRENT_SOURCE_DIR}/third_party/ggml ${CMAKE_CURRENT_SOURCE_DIR}/src/kernels/cpu) + target_link_libraries(ds4_tq_test PRIVATE strata_kernels_cpu ${_strata_gpu_runtime_target} Threads::Threads) + target_compile_definitions(ds4_tq_test PRIVATE STRATA_DSV41_TQ_CPU=1) + # the same with the plain-FMA tile instead of the gfx12 WMMA one (what CUDA and gfx11 builds run) + add_executable(ds4_tq_test_portable tests/dsv41/tq_expert_test.cpp src/dsv41/ds4_tq.cu src/dsv41/ds4_iq.cu src/dsv41/ds4_tq_cpu.cpp + src/dsv41/ds4_iq_cpu.cpp src/dsv41/ds4_gg_cpu.cpp tools/trellis/tqenc.cpp) + target_include_directories(ds4_tq_test_portable PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories} + ${CMAKE_CURRENT_SOURCE_DIR}/third_party/ggml ${CMAKE_CURRENT_SOURCE_DIR}/src/kernels/cpu) + target_link_libraries(ds4_tq_test_portable PRIVATE strata_kernels_cpu ${_strata_gpu_runtime_target} Threads::Threads) + target_compile_definitions(ds4_tq_test_portable PRIVATE STRATA_DSV41_TQ_CPU=1 DS4_TQ_PORTABLE=1) + if(STRATA_ENABLE_HIP) + target_compile_options(ds4_tq_test_portable PRIVATE "$<$:SHELL:-include ${CMAKE_CURRENT_SOURCE_DIR}/include/strata/dsv41/hip_extra.h>") + endif() + if(STRATA_ENABLE_HIP) + target_compile_options(ds4_tq_test PRIVATE "$<$:SHELL:-include ${CMAKE_CURRENT_SOURCE_DIR}/include/strata/dsv41/hip_extra.h>") + endif() + # the i-quant experts (ds4_iq.cu) against ggml's own decode of the same blocks + a double reference, device and CPU + # lane, for every type the device takes: the gate a new type (IQ2_XS ..) has to pass before the engine uses it + set_source_files_properties(tests/dsv41/iq_expert_test.cpp PROPERTIES LANGUAGE ${_ds4_test_lang}) + add_executable(ds4_iq_test tests/dsv41/iq_expert_test.cpp src/dsv41/ds4_iq.cu src/dsv41/ds4_iq_cpu.cpp + src/dsv41/ds4_gg_cpu.cpp src/dsv41/ds4_tq.cu src/dsv41/ds4_tq_cpu.cpp) + target_include_directories(ds4_iq_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories} + ${CMAKE_CURRENT_SOURCE_DIR}/third_party/ggml ${CMAKE_CURRENT_SOURCE_DIR}/src/kernels/cpu) + target_link_libraries(ds4_iq_test PRIVATE strata_kernels_cpu ${_strata_gpu_runtime_target} Threads::Threads) + target_compile_definitions(ds4_iq_test PRIVATE STRATA_DSV41_TQ_CPU=1) + if(STRATA_ENABLE_HIP) + target_compile_options(ds4_iq_test PRIVATE "$<$:SHELL:-include ${CMAKE_CURRENT_SOURCE_DIR}/include/strata/dsv41/hip_extra.h>") + endif() + # the kept conversations' .meta file and prefix matching (ds4_slotmeta.hpp): no GPU, no model + add_executable(ds4_slot_test tests/dsv41/slot_test.cpp) + target_include_directories(ds4_slot_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/dsv41) + target_compile_features(ds4_slot_test PRIVATE cxx_std_17) + add_executable(ds4_experts_rule_test tests/dsv41/experts_rule_test.cpp) + target_include_directories(ds4_experts_rule_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/dsv41) + target_compile_features(ds4_experts_rule_test PRIVATE cxx_std_17) + add_executable(ds4_pick_rule_test tests/dsv41/pick_rule_test.cpp) + target_include_directories(ds4_pick_rule_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/dsv41) + target_compile_features(ds4_pick_rule_test PRIVATE cxx_std_17) + endif() + if(STRATA_ENABLE_HIP) + foreach(_t strata_dsv41_kernels strata-dsv41) + target_compile_options(${_t} PRIVATE "$<$:SHELL:-include ${CMAKE_CURRENT_SOURCE_DIR}/include/strata/dsv41/hip_extra.h>") + endforeach() + endif() + endif() if(STRATA_ENABLE_HIP) enable_testing() set(_strata_hip_tests) + add_executable(hip_prefill_gemm tests/hip/prefill_gemm.cpp) + target_link_libraries(hip_prefill_gemm PRIVATE strata_prefill strata_hip_runtime) + add_test(NAME hip_prefill_gemm COMMAND hip_prefill_gemm) + list(APPEND _strata_hip_tests hip_prefill_gemm) + add_executable(hip_gemm_f16_io_parity tests/hip/gemm_f16_io_parity.cpp) + target_link_libraries(hip_gemm_f16_io_parity PRIVATE strata_prefill strata_hip_runtime) + add_test(NAME hip_gemm_f16_io_parity COMMAND hip_gemm_f16_io_parity) + list(APPEND _strata_hip_tests hip_gemm_f16_io_parity) + add_executable(hip_q2_zero tests/hip/q2_zero.cpp) + target_link_libraries(hip_q2_zero PRIVATE strata_kernels strata_hip_runtime) + add_test(NAME hip_q2_zero COMMAND hip_q2_zero) + list(APPEND _strata_hip_tests hip_q2_zero) add_executable(hip_expert_cache_staging tests/hip/expert_cache_staging.cpp) target_link_libraries(hip_expert_cache_staging PRIVATE strata_engine) add_test(NAME hip_expert_cache_staging COMMAND hip_expert_cache_staging) @@ -528,6 +1035,33 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) add_test(NAME hip_prefill_native_batch COMMAND hip_prefill_native_batch) list(APPEND _strata_hip_tests hip_prefill_native_batch) endif() + # Aurora: the prompt GDN recurrence's per-head kernel against the column-split + norm kernels, bitwise + add_executable(hip_gdn_rec_head tests/hip/gdn_rec_head.cpp) + target_link_libraries(hip_gdn_rec_head PRIVATE strata_prefill strata_hip_runtime) + add_test(NAME hip_gdn_rec_head COMMAND hip_gdn_rec_head) + list(APPEND _strata_hip_tests hip_gdn_rec_head) + add_executable(hip_gdn_chunked tests/hip/gdn_chunked.cpp) + target_link_libraries(hip_gdn_chunked PRIVATE strata_prefill strata_hip_runtime) + add_test(NAME hip_gdn_chunked COMMAND hip_gdn_chunked) + add_test(NAME hip_gdn_chunked_off COMMAND hip_gdn_chunked --off) + add_test(NAME hip_gdn_chunked_default COMMAND hip_gdn_chunked --default) + list(APPEND _strata_hip_tests hip_gdn_chunked hip_gdn_chunked_off hip_gdn_chunked_default) + # #313: the RDNA3 / RDNA3.5 WMMA dense GEMMs (opt-in STRATA_WMMA_GEMM=1) against a reference + add_executable(hip_prefill_wmma_gemm_parity tests/hip/prefill_wmma_gemm_parity.cpp) + target_include_directories(hip_prefill_wmma_gemm_parity PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/prefill") + target_link_libraries(hip_prefill_wmma_gemm_parity PRIVATE strata_prefill strata_hip_runtime) + add_test(NAME hip_prefill_wmma_gemm_parity COMMAND hip_prefill_wmma_gemm_parity) + set_tests_properties(hip_prefill_wmma_gemm_parity PROPERTIES SKIP_RETURN_CODE 77) # no matrix cores: skipped + list(APPEND _strata_hip_tests hip_prefill_wmma_gemm_parity) + # S (STRATA_HCD_EXACT): the exact HC down kernel against hipBLASLt solution 1176 / 1177 (needs STRATA_HIPBLASLT_TUNING; exit 77 else) + add_executable(hip_prefill_hcd_exact_parity tests/hip/prefill_hcd_exact_parity.cpp) + target_link_libraries(hip_prefill_hcd_exact_parity PRIVATE strata_prefill strata_hip_runtime) + add_test(NAME hip_prefill_hcd_exact_parity COMMAND hip_prefill_hcd_exact_parity) + set_tests_properties(hip_prefill_hcd_exact_parity PROPERTIES SKIP_RETURN_CODE 77) + list(APPEND _strata_hip_tests hip_prefill_hcd_exact_parity) + # the HC write-back kernel timed at the prompt path's shapes with an output checksum (not a ctest; STRATA_GRW_V picks a variant) + add_executable(hip_prefill_gr_write_bench tests/hip/prefill_gr_write_bench.cpp) + target_link_libraries(hip_prefill_gr_write_bench PRIVATE strata_prefill strata_hip_runtime) # S6: the AMD fast router against the portable kernel, bitwise add_executable(hip_router_fast tests/hip/router_fast.cpp) target_link_libraries(hip_router_fast PRIVATE strata_kernels strata_hip_runtime) @@ -547,6 +1081,15 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) set_tests_properties(hip_prefill_hipblaslt_gemm PROPERTIES TIMEOUT 120 SKIP_RETURN_CODE 77) list(APPEND _strata_hip_tests hip_prefill_hipblaslt_gemm) endif() + if(STRATA_ROCBLAS_AVAILABLE) + # the rocBLAS solution table of the FP16-out prompt GEMMs (gfx103x): opt-in, skips without STRATA_ROCBLAS_TUNING + add_executable(hip_prefill_rocblas_gemm tests/hip/prefill_rocblas_gemm.cpp) + target_include_directories(hip_prefill_rocblas_gemm PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/prefill") + target_link_libraries(hip_prefill_rocblas_gemm PRIVATE strata_prefill strata_hip_runtime roc::rocblas roc::hipblas) + add_test(NAME hip_prefill_rocblas_gemm COMMAND hip_prefill_rocblas_gemm) + set_tests_properties(hip_prefill_rocblas_gemm PROPERTIES TIMEOUT 120 SKIP_RETURN_CODE 77) + list(APPEND _strata_hip_tests hip_prefill_rocblas_gemm) + endif() if(_strata_hip_tests) set_tests_properties(${_strata_hip_tests} PROPERTIES TIMEOUT 60) endif() @@ -556,6 +1099,9 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) if(TARGET hip_prefill_hipblaslt_gemm) set_tests_properties(hip_prefill_hipblaslt_gemm PROPERTIES TIMEOUT 120 SKIP_RETURN_CODE 77) endif() + if(TARGET hip_prefill_rocblas_gemm) + set_tests_properties(hip_prefill_rocblas_gemm PROPERTIES TIMEOUT 120 SKIP_RETURN_CODE 77) + endif() endif() add_executable(dequant_s2_parity src/kernels/dequant_s2_parity.cpp) @@ -624,6 +1170,34 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_include_directories(mmvq_multi_parity PRIVATE ${_strata_gpu_include_directories}) target_link_libraries(mmvq_multi_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) add_test(NAME mmvq_multi_parity COMMAND mmvq_multi_parity) + if(STRATA_HIP_GFX906) # the CUDA layout, where the negative control has power (the wave64 one is exact at every T) + add_test(NAME mmvq_multi_parity_cuda_layout COMMAND mmvq_multi_parity) + set_tests_properties(mmvq_multi_parity_cuda_layout PROPERTIES ENVIRONMENT "STRATA_MMVQ_WAVE=0") + endif() + endif() + if(STRATA_ENABLE_CUDA) + # fork F4: the 2-4 column dense projections from the interleaved q8_1 copy, bitwise vs native_mmvq (GPU, synthetic) + add_executable(mmvq_il_parity src/kernels/mmvq_il_parity.cpp) + target_include_directories(mmvq_il_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(mmvq_il_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME mmvq_il_parity COMMAND mmvq_il_parity) + # the wide dequant kernels (a thread per 8 values; sm_61's default), bitwise vs the per-group ones (GPU, synthetic, + # no model; --bench adds old/new timings) + add_executable(dequant_wide_parity src/kernels/dequant_wide_parity.cpp) + target_include_directories(dequant_wide_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(dequant_wide_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME dequant_wide_parity COMMAND dequant_wide_parity) + endif() + # programmatic dependent launch (pdl.hpp) in a captured verify-shaped chain: bitwise vs ordinary launches over + # replays with poisoned buffers, and only kernel-to-kernel programmatic edges (GPU, synthetic, no model; the edges + # are only made on sm_90+, elsewhere it checks that there are none). NVIDIA only: PDL is a CUDA feature. + if(STRATA_ENABLE_CUDA AND NOT STRATA_HIP_GFX906) + add_executable(pdl_parity src/kernels/pdl_parity.cpp) + target_include_directories(pdl_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(pdl_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME pdl_parity COMMAND pdl_parity) + # PDL is opt-in (STRATA_DF_PDL); the test checks the opted-in path, whose PDL capture forces programmatic launches + set_tests_properties(pdl_parity PROPERTIES ENVIRONMENT "STRATA_DF_PDL=1") endif() # the IQ kernels that decode a weight part once for every column/entry, bitwise vs the per-column ones # (GPU, synthetic, no model; --bench adds old/new timings) @@ -631,11 +1205,107 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_include_directories(iq_multi_parity PRIVATE ${_strata_gpu_include_directories}) target_link_libraries(iq_multi_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) add_test(NAME iq_multi_parity COMMAND iq_multi_parity) + # the Gyro trellis decode kernels (TQ2_T / TQK6 / TQK7) on synthetic blocks: decode-once vs per-column bitwise, output + # checksums to compare two builds byte for byte, --bench for timings (GPU, no model) + add_executable(tq_pascal_bench src/kernels/tq_pascal_bench.cpp) + target_include_directories(tq_pascal_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(tq_pascal_bench PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME tq_pascal_bench COMMAND tq_pascal_bench) + set_tests_properties(iq_multi_parity PROPERTIES ENVIRONMENT "STRATA_KQ_SPLIT=1") # the Q4_K / Q5_K / Q8_0 Split path against the old kernels + # the same Split path on the other routes it can meet: the generic multi kernels (no V2K) and the fused gate/up + SwiGLU kernel, and the sub-16-row + # gate/up route switched off (a K-quant row has 160 dots, not the 80 the sub-16 rows assume: STRATA_KQ_SPLIT=1 must stay bitwise on all of them) + add_test(NAME iq_multi_parity_kq_nov2k COMMAND iq_multi_parity) + set_tests_properties(iq_multi_parity_kq_nov2k PROPERTIES ENVIRONMENT "STRATA_KQ_SPLIT=1;STRATA_EXPERT_V2K=0") + add_test(NAME iq_multi_parity_kq_swiglu COMMAND iq_multi_parity) + set_tests_properties(iq_multi_parity_kq_swiglu PROPERTIES ENVIRONMENT "STRATA_KQ_SPLIT=1;STRATA_GU_SWIGLU=1") + add_test(NAME iq_multi_parity_kq_nosub16 COMMAND iq_multi_parity) + set_tests_properties(iq_multi_parity_kq_nosub16 PROPERTIES ENVIRONMENT "STRATA_KQ_SPLIT=1;STRATA_NO_SUB16_GU=1") + # the prompt path's DeltaNet recurrence: gdn_rec_kh_kernel against gdn_rec_cols_pipe_kernel, bitwise (GPU, + # synthetic, no model; --bench adds timings). NVIDIA only: cp.async and the CUDA occupancy API (not on gfx906) + if(STRATA_ENABLE_CUDA AND NOT STRATA_HIP_GFX906) + # Independent pinned expert uploads: byte parity and stream/event ordering. + add_executable(dma_batch_parity tests/core/dma_batch_parity.cu) + target_include_directories(dma_batch_parity PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) + target_link_libraries(dma_batch_parity PRIVATE ${_strata_gpu_runtime_target}) + add_test(NAME dma_batch_parity COMMAND dma_batch_parity) + set_tests_properties(dma_batch_parity PROPERTIES TIMEOUT 120) + if(WIN32) + add_test(NAME dma_batch_registered_parity COMMAND dma_batch_parity --registered) + set_tests_properties(dma_batch_registered_parity PROPERTIES TIMEOUT 120) + endif() + add_executable(gdn_rec_parity src/prefill/gdn_rec_parity.cu) + target_link_libraries(gdn_rec_parity PRIVATE ${_strata_gpu_runtime_target}) + add_test(NAME gdn_rec_parity COMMAND gdn_rec_parity) + # the prompt path's BF16 products against cuBLAS's own BF16 GEMM, within fp32 rounding (sm_7x runs them on the + # FP16 tensor cores; GPU, synthetic, no model; --bench adds timings) + add_executable(gemm_bf16_parity src/prefill/gemm_bf16_parity.cu) + target_link_libraries(gemm_bf16_parity PRIVATE strata_prefill ) + add_test(NAME gemm_bf16_parity COMMAND gemm_bf16_parity) + # Pascal, opt-in STRATA_DENSE_F32=1: the dense projections' FP16 GEMMs as cublasSgemm on FP32 copies, bitwise vs + # the cuBLAS FP16 call over a sweep of chunk sizes (GPU, synthetic, no model; --full sweeps every size, --bench + # adds timings). Not a ctest: whether the two agree is a property of the cuBLAS build, which this checks. + add_executable(gemm_f32_parity src/prefill/gemm_f32_parity.cu) + target_link_libraries(gemm_f32_parity PRIVATE strata_prefill ) + # the hyper-connection read's fused up projection + mix (gr_upmix, STRATA_HC_UPMIX) against cuBLAS + gr_mix_r, + # bitwise where cuBLAS sums K in the same order, else within FP32 rounding and as close to FP64 (GPU, synthetic, + # no model; --bench adds timings) + add_executable(gr_upmix_parity src/prefill/gr_upmix_parity.cu) + target_link_libraries(gr_upmix_parity PRIVATE strata_prefill ) + add_test(NAME gr_upmix_parity COMMAND gr_upmix_parity) + set_tests_properties(gr_upmix_parity PROPERTIES SKIP_RETURN_CODE 77) + endif() + # native_expert_grouped's group stride and fused SwiGLU + q8_1, bitwise vs the launches before them (GPU, synthetic, + # no model; --bench adds v1/new timings of a window's 48 calls in a graph) + add_executable(native_grouped_parity src/kernels/native_grouped_parity.cpp) + target_include_directories(native_grouped_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(native_grouped_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME native_grouped_parity COMMAND native_grouped_parity) + add_executable(mmvf_rows_parity src/kernels/mmvf_rows_parity.cpp) + target_include_directories(mmvf_rows_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(mmvf_rows_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME mmvf_rows_parity COMMAND mmvf_rows_parity) + set_tests_properties(mmvf_rows_parity PROPERTIES ENVIRONMENT "STRATA_MMVF_ROWS=1" TIMEOUT 120) + if(STRATA_HIP_GFX906) + add_test(NAME native_grouped_fused_parity COMMAND native_grouped_parity) + set_tests_properties(native_grouped_fused_parity PROPERTIES + ENVIRONMENT "STRATA_HIP_SWIGLU_FUSED=1;STRATA_EXP_MODE=7" TIMEOUT 120) + add_executable(gfx906_gdn_rec_head tests/hip/gdn_rec_head.cpp) + target_include_directories(gfx906_gdn_rec_head PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(gfx906_gdn_rec_head PRIVATE strata_prefill ${_strata_gpu_runtime_target}) + add_test(NAME gfx906_gdn_rec_head COMMAND gfx906_gdn_rec_head) + set_tests_properties(gfx906_gdn_rec_head PROPERTIES TIMEOUT 120) + endif() + if(STRATA_ENABLE_CUDA) + # the Volta prompt experts (gemm_iq_f16_grouped, STRATA_PF_WMMA) against a double reference; skipped below sm_70 + add_executable(pf_wmma_parity src/kernels/pf_wmma_parity.cpp) + target_include_directories(pf_wmma_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(pf_wmma_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME pf_wmma_parity COMMAND pf_wmma_parity) + set_tests_properties(pf_wmma_parity PROPERTIES SKIP_RETURN_CODE 77) + endif() add_executable(shared_expert_parity src/kernels/shared_expert_parity.cpp) target_include_directories(shared_expert_parity PRIVATE ${_strata_gpu_include_directories}) target_link_libraries(shared_expert_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) add_test(NAME shared_expert_parity COMMAND shared_expert_parity --selftest) - + # the split / batched verify-window kernels (from eddoursul's fork), bitwise vs the kernels they replace; CUDA only + if(STRATA_ENABLE_CUDA) + add_executable(verify_parity src/kernels/verify_parity.cpp) + target_include_directories(verify_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(verify_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME verify_parity COMMAND verify_parity --selftest) + endif() + add_executable(fused_gr_bench src/kernels/fused_gr_bench.cpp) + target_include_directories(fused_gr_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(fused_gr_bench PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_executable(router_chain_bench src/kernels/router_chain_bench.cpp) + target_include_directories(router_chain_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(router_chain_bench PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + # B6: the dense projections' time per verify row at the model's shapes, default vs STRATA_B6_MMVQ_ROWS, bitwise + if(STRATA_ENABLE_CUDA) + add_executable(b6_mmvq_bench src/kernels/b6_mmvq_bench.cpp) + target_include_directories(b6_mmvq_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(b6_mmvq_bench PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + endif() add_executable(gr_parity src/kernels/gr_parity.cpp) target_include_directories(gr_parity PRIVATE ${_strata_gpu_include_directories}) target_link_libraries(gr_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) @@ -646,6 +1316,22 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_link_libraries(gdn_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) add_test(NAME gdn_parity COMMAND gdn_parity --selftest) + # v100/gdn-chunk: the chunked GDN prompt recurrence vs the token recurrence and a host reference (GPU, + # synthetic, no model). The chunked path changes the summation order - FP32-level, not bit-exact - so the + # test asserts measured error bounds, and --selftest pins them. + if(STRATA_BUILD_TESTS AND STRATA_ENABLE_CUDA) + add_executable(gdn_chunk_parity src/kernels/gdn_chunk_parity.cpp) + target_include_directories(gdn_chunk_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(gdn_chunk_parity PRIVATE strata_prefill ${_strata_gpu_runtime_target}) + add_test(NAME gdn_chunk_parity COMMAND gdn_chunk_parity --selftest) + set_tests_properties(gdn_chunk_parity PROPERTIES SKIP_RETURN_CODE 77) + + # v100/gdn-chunk: the micro benchmark (CUDA events, real GDN shapes): chunked vs recurrent prompt path. + add_executable(gdn_chunk_bench bench/gdn_chunk_bench.cpp) + target_include_directories(gdn_chunk_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(gdn_chunk_bench PRIVATE strata_prefill ${_strata_gpu_runtime_target}) + endif() + add_executable(s2_gemv_q8_parity src/kernels/s2_gemv_q8_parity.cpp) target_include_directories(s2_gemv_q8_parity PRIVATE ${_strata_gpu_include_directories}) target_link_libraries(s2_gemv_q8_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) @@ -656,11 +1342,25 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_link_libraries(sampler_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) add_test(NAME sampler_parity COMMAND sampler_parity --selftest) set_tests_properties(sampler_parity PROPERTIES ENVIRONMENT "STRATA_OLD_SAMPLER=0;STRATA_SAMPLER_ONE_BLOCK=0") + # the GPU verifier of probabilistic draft acceptance against the host reference (STRATA_SPEC_PROB) + add_executable(spec_verify_parity src/kernels/spec_verify_parity.cpp) + target_include_directories(spec_verify_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(spec_verify_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME spec_verify_parity COMMAND spec_verify_parity) + set_tests_properties(spec_verify_parity PROPERTIES ENVIRONMENT "STRATA_OLD_SAMPLER=0;STRATA_SAMPLER_ONE_BLOCK=0") # the same fixtures on the other two sampled paths: the one-block kernel and the 0.1.20 kernel add_test(NAME sampler_parity_one_block COMMAND sampler_parity --selftest) set_tests_properties(sampler_parity_one_block PROPERTIES ENVIRONMENT "STRATA_OLD_SAMPLER=0;STRATA_SAMPLER_ONE_BLOCK=1") add_test(NAME sampler_parity_old COMMAND sampler_parity --selftest) set_tests_properties(sampler_parity_old PROPERTIES ENVIRONMENT "STRATA_OLD_SAMPLER=1;STRATA_SAMPLER_ONE_BLOCK=0") + # S19: the decode QSA top-k and the greedy argmax on thread-block clusters (sm_90+) vs the one-CTA kernels, bitwise, + # captured in a graph too (GPU, synthetic, no model; skips below sm_90); --bench: per-call times + if(STRATA_ENABLE_CUDA) + add_executable(decode_cluster_parity src/kernels/decode_cluster_parity.cpp) + target_include_directories(decode_cluster_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(decode_cluster_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME decode_cluster_parity COMMAND decode_cluster_parity --selftest) + endif() add_executable(rope_parity src/kernels/rope_parity.cpp) target_include_directories(rope_parity PRIVATE ${_strata_gpu_include_directories}) @@ -672,10 +1372,57 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_link_libraries(quantize_act_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) add_test(NAME quantize_act_parity COMMAND quantize_act_parity --selftest) + # the verify window's routing in one multi-column BF16 projection + one top-k, bitwise the per-token calls + add_executable(route_window_parity src/kernels/route_window_parity.cpp) + target_include_directories(route_window_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(route_window_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME route_window_parity COMMAND route_window_parity) + + # STRATA_ROUTE_RESIDENT's swap: the warp-per-token kernel against a scalar reference of the same semantics, + # bitwise on the ids, the weights and the four counters (GPU, synthetic, no model) + add_executable(route_resident_parity src/kernels/route_resident_parity.cu) + target_include_directories(route_resident_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(route_resident_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME route_resident_parity COMMAND route_resident_parity) + set_tests_properties(route_resident_parity PROPERTIES TIMEOUT 120) + add_executable(router_top10_parity src/kernels/router_top10_parity.cpp) target_include_directories(router_top10_parity PRIVATE ${_strata_gpu_include_directories}) target_link_libraries(router_top10_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) add_test(NAME router_top10_parity COMMAND router_top10_parity --selftest) + # #783 PR-c: the multi-token router and the k = 10 float4 combine, bitwise against the single-token contracts + add_executable(native_multi_parity src/kernels/native_multi_parity.cpp) + target_include_directories(native_multi_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(native_multi_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME native_multi_parity COMMAND native_multi_parity) + # #783 PR-d: the batched K/V append (INT8, Q4_0, the hybrid fold) against the per-cell appends, memcmp + add_executable(kv_steps_parity src/kernels/kv_steps_parity.cpp) + target_include_directories(kv_steps_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(kv_steps_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME kv_steps_parity COMMAND kv_steps_parity) + # #783 PR-e: the device-built expert plan (parallel grouping + prefix scan) against a host replay of its contract + add_executable(resident_plan_parity src/kernels/resident_plan_parity.cpp) + target_include_directories(resident_plan_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(resident_plan_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME resident_plan_parity COMMAND resident_plan_parity) + # #783 PR-g: the multi-token hyper-connection read/write (exact-T projections under them) against the single-token calls + add_executable(gr_multi_parity src/kernels/gr_multi_parity.cpp) + target_include_directories(gr_multi_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(gr_multi_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME gr_multi_parity COMMAND gr_multi_parity) + # STRATA_HC_PERSIST=1: the persistent hyper-connection read against the default multi read (bounded, two runs bitwise), + # and with the variable unset it never runs (a skip where the card cannot hold its 80 blocks, and on CUDA) + add_executable(hc_persist_parity src/kernels/hc_persist_parity.cpp) + target_include_directories(hc_persist_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(hc_persist_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME hc_persist_parity COMMAND hc_persist_parity) + add_test(NAME hc_persist_default_off COMMAND hc_persist_parity --off) + if(STRATA_HIP_GFX906) + # the S6 router (STRATA_HIP_ROUTER_FAST=1 on gfx906) against the portable kernel, bitwise, on wave64 + add_executable(hip_router_fast tests/hip/router_fast.cpp) + target_include_directories(hip_router_fast PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(hip_router_fast PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + endif() add_executable(s_gemv_parity src/kernels/s_gemv_parity.cpp) target_include_directories(s_gemv_parity PRIVATE ${_strata_gpu_include_directories}) @@ -692,6 +1439,16 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_link_libraries(bf16_gemv_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) add_test(NAME bf16_gemv_parity COMMAND bf16_gemv_parity --selftest) + # the V100 fusion work: every fused kernel against its unfused pipeline, bitwise, and the before/after + # CUDA-event timings at decode shapes (`--bench`). It is a .cu because it carries the unfused reference + # kernels it compares against. + if(STRATA_BUILD_TESTS AND STRATA_ENABLE_CUDA) + add_executable(fusions_parity bench/micro/fusions_parity.cu) + target_include_directories(fusions_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(fusions_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME fusions_parity COMMAND fusions_parity) + endif() + add_executable(s_gemv_q8k_parity src/kernels/s_gemv_q8k_parity.cpp) target_include_directories(s_gemv_q8k_parity PRIVATE ${_strata_gpu_include_directories}) target_link_libraries(s_gemv_q8k_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) @@ -702,6 +1459,16 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_link_libraries(qsa_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) add_test(NAME qsa_parity COMMAND qsa_parity --selftest) + # the QSA top-k the engine dispatches against the original kernel: identical ids on both sides of the register + # kernel's reach, with tied and with equal scores (synthetic, no model) + add_executable(qsa_topk_parity src/kernels/qsa_topk_parity.cpp) + target_include_directories(qsa_topk_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(qsa_topk_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME qsa_topk_parity COMMAND qsa_topk_parity --selftest) + # the register kernel from the smallest prompt batch (the line gfx1151 moves to 4096 blocks): same ids at every case + add_test(NAME qsa_topk_parity_reg_always COMMAND qsa_topk_parity --selftest) + set_tests_properties(qsa_topk_parity_reg_always PROPERTIES ENVIRONMENT "STRATA_TOPK_REG_MIN_BLOCKS=0") + # ---- P2.S4: the PLE n-gram hash, the IQ4_NL table read, and the PLE block ---- # `ngram.cpp` is host-only but lives in `strata_kernels` because `ple.cu` shares its geometry constants, and # splitting them across two libraries would only add a layer. @@ -731,6 +1498,13 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_link_libraries(kv_stream_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) add_test(NAME kv_stream_parity COMMAND kv_stream_parity) + # #2403: the verify window's KV calls on a streamed layer and on a ring (steps appends with the host copy, batched + # resolve + attention, plain launches and graph replays), q4_0 / int8 / K8V4 (GPU, synthetic, no model). + add_executable(kv_window_parity src/kernels/kv_window_parity.cpp) + target_include_directories(kv_window_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(kv_window_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME kv_window_parity COMMAND kv_window_parity) + # PR #120: the hybrid K8V4 KV (INT8 K + rotated Q4_0 V) vs host references (GPU, synthetic, no model). add_executable(kv_hybrid_parity src/kernels/kv_hybrid_parity.cpp) target_include_directories(kv_hybrid_parity PRIVATE ${_strata_gpu_include_directories}) @@ -741,6 +1515,17 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_include_directories(kv_q4_parity PRIVATE ${_strata_gpu_include_directories}) target_link_libraries(kv_q4_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) add_test(NAME kv_q4_parity COMMAND kv_q4_parity) + # the verify window's one-launch forms (hyper-connection write, PLE post-ops with the commit's + # history snapshots) vs the per-token launches they replace, bitwise (GPU, synthetic, no model) + add_executable(verify_batch_parity src/kernels/verify_batch_parity.cpp) + target_include_directories(verify_batch_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(verify_batch_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME verify_batch_parity COMMAND verify_batch_parity) + # #2234: the batch window's one-launch-for-all-rows kernels vs the per-row launches, bitwise (GPU, synthetic) + add_executable(batch_rows_parity src/kernels/batch_rows_parity.cpp) + target_include_directories(batch_rows_parity PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(batch_rows_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + add_test(NAME batch_rows_parity COMMAND batch_rows_parity) add_executable(cvec_parity src/kernels/cvec_parity.cpp) target_include_directories(cvec_parity PRIVATE ${_strata_gpu_include_directories}) target_link_libraries(cvec_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target}) @@ -766,6 +1551,11 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) target_link_libraries(platform_memory_test PRIVATE strata_core ${_strata_gpu_runtime_target}) add_test(NAME platform_memory_test COMMAND platform_memory_test) + # The pinned-memory headroom (pin_budget.hpp) against a simulated ceiling; skips without a GPU. + add_executable(pin_budget_test src/core/pin_budget_test.cpp) + target_link_libraries(pin_budget_test PRIVATE strata_core ${_strata_gpu_runtime_target}) + add_test(NAME pin_budget_test COMMAND pin_budget_test) + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") add_executable(pinned_shared_test src/core/pinned_shared_test.cpp) target_link_libraries(pinned_shared_test PRIVATE strata_core ${_strata_gpu_runtime_target}) @@ -828,9 +1618,19 @@ endif() # worse opt-out. `cpu_require_expert_support()` therefore refuses at startup on a CPU without the # features, and the fallback exists for tests, exactly as P2.S3 specifies. # Plan v0.3 P6: speculation components that need no GPU. -add_library(strata_spec STATIC src/spec/suffix_drafter.cpp src/spec/controller.cpp src/spec/draft_policy.cpp) +add_library(strata_spec STATIC src/spec/suffix_drafter.cpp src/spec/controller.cpp src/spec/draft_policy.cpp + src/spec/draft_source.cpp) target_include_directories(strata_spec PUBLIC include) if(STRATA_BUILD_TESTS) + add_executable(arch_defaults_test src/core/arch_defaults_test.cpp src/core/arch_defaults.cpp) + target_include_directories(arch_defaults_test PRIVATE include) + add_test(NAME arch_defaults_test COMMAND arch_defaults_test) + add_executable(adapt_async_default_test src/core/adapt_async_default_test.cpp) + target_include_directories(adapt_async_default_test PRIVATE include) + add_test(NAME adapt_async_default_test COMMAND adapt_async_default_test) + add_executable(uma_cache_test src/core/uma_cache_test.cpp) + target_include_directories(uma_cache_test PRIVATE include) + add_test(NAME uma_cache_test COMMAND uma_cache_test) add_executable(suffix_drafter_test src/spec/suffix_drafter_test.cpp) target_link_libraries(suffix_drafter_test PRIVATE strata_spec) add_test(NAME suffix_drafter_test COMMAND suffix_drafter_test) @@ -840,24 +1640,54 @@ if(STRATA_BUILD_TESTS) add_executable(draft_policy_test src/spec/draft_policy_test.cpp) target_link_libraries(draft_policy_test PRIVATE strata_spec) add_test(NAME draft_policy_test COMMAND draft_policy_test) + add_executable(spec_start_test src/spec/spec_start_test.cpp) + target_include_directories(spec_start_test PRIVATE include) + add_test(NAME spec_start_test COMMAND spec_start_test) endif() if(STRATA_BUILD_TESTS OR STRATA_BUILD_CONVERSATION_TESTS) + add_executable(message_boundary_test src/program/message_boundary_test.cpp) + target_include_directories(message_boundary_test PRIVATE include) + add_test(NAME message_boundary_test COMMAND message_boundary_test) + # a layer split's ring override and the lend slots sized with it: the RAM copy must keep every borrowed slot (CPU) + add_executable(split_ring_test src/program/split_ring_test.cpp) + target_include_directories(split_ring_test PRIVATE include) + add_test(NAME split_ring_test COMMAND split_ring_test) # the serve loop's conversation-cache retention policy (header-only, no library to link) add_executable(conv_cache_test src/program/conv_cache_test.cpp) target_include_directories(conv_cache_test PRIVATE include) add_test(NAME conv_cache_test COMMAND conv_cache_test) + # which path computes the draft layer's prompt K/V, and STRATA_SPLIT_MTP_BATCH's parsing (header-only, CPU) + add_executable(draft_kv_plan_test src/program/draft_kv_plan_test.cpp) + target_include_directories(draft_kv_plan_test PRIVATE include) + add_test(NAME draft_kv_plan_test COMMAND draft_kv_plan_test) # coupled draft sampling's counter and penalty-ring arithmetic (header-only, CPU) add_executable(coupled_draft_test src/core/coupled_draft_test.cpp) target_include_directories(coupled_draft_test PRIVATE include) add_test(NAME coupled_draft_test COMMAND coupled_draft_test) + # probabilistic draft acceptance (STRATA_SPEC_PROB): rejection sampling preserves p - chi-square over 2M trials per case (CPU) + add_executable(spec_prob_test src/core/spec_prob_test.cpp) + target_include_directories(spec_prob_test PRIVATE include) + add_test(NAME spec_prob_test COMMAND spec_prob_test) + # the per-card window cap of --draft dflash2 (header-only, CPU) + add_executable(draft_cap_test src/core/draft_cap_test.cpp) + target_include_directories(draft_cap_test PRIVATE include) + add_test(NAME draft_cap_test COMMAND draft_cap_test) # the f32 -> bf16 rounding against ggml's, NaN included, over every f32 bit pattern (header-only, CPU) add_executable(bf16_bits_test src/kernels/bf16_bits_test.cpp) target_include_directories(bf16_bits_test PRIVATE include) add_test(NAME bf16_bits_test COMMAND bf16_bits_test) + # the batch window's row layout (a slot's group of proposed rows, the layer split's hand-off capacity; header-only, CPU) + add_executable(batch_rows_test tests/core/batch_rows_test.cpp) + target_include_directories(batch_rows_test PRIVATE include) + add_test(NAME batch_rows_test COMMAND batch_rows_test) + # how many pipelined slot groups --batch runs with: the 0.1.41 default, and --batch-mtp keeping it serial (header-only, CPU) + add_executable(batch_groups_test src/program/batch_groups_test.cpp) + target_include_directories(batch_groups_test PRIVATE include) + add_test(NAME batch_groups_test COMMAND batch_groups_test) endif() add_library(strata_kernels_cpu STATIC src/kernels/cpu/expert.cpp src/kernels/cpu/pool.cpp - src/kernels/cpu/expert_layout.cpp src/kernels/cpu/q2_avx2.cpp) + src/kernels/cpu/expert_layout.cpp src/kernels/cpu/q2_avx2.cpp src/kernels/cpu/hadamard.cpp) target_include_directories(strata_kernels_cpu PUBLIC include) # Plan v0.3 P6: only the kernel files get the AVX-512 / AVX2 flags; the pool and the probe run on any x86-64, # and the engine picks the kernels at run time (cpu_avx512_ok). @@ -870,6 +1700,34 @@ else() PROPERTIES COMPILE_OPTIONS "-mavx512f;-mavx512bw;-mavx512vl;-mavx512dq;-mavx512vnni;-mavx512vbmi;-mf16c;-mfma") set_source_files_properties(src/kernels/cpu/q2_avx2.cpp PROPERTIES COMPILE_OPTIONS "-mavx2;-mfma;-mf16c") endif() +# AVX-VNNI (Alder Lake, Sapphire Rapids and later): the AVX-2 expert kernels' vpdpwssd / vpdpbusd copies (q2_avx2.cpp, +# iq_avx2.cpp; *_rows.inl), taken at run time where cpu_avxvnni_ok(). GCC and Clang compile only those functions with +# target("avxvnni") - never -mavxvnni on a file, which would let the compiler use it anywhere - and MSVC takes the +# intrinsics under /arch:AVX2. A compiler without them (GCC < 11, Clang < 12) builds the files without the copies. +include(CheckCXXSourceCompiles) +if(MSVC) + set(CMAKE_REQUIRED_FLAGS "/arch:AVX2") +else() + set(CMAKE_REQUIRED_FLAGS "-mavx2 -mfma -mf16c") +endif() +check_cxx_source_compiles([=[ +#include +#if defined(__GNUC__) || defined(__clang__) +__attribute__((target("avxvnni"))) +#endif +static __m256i dots(__m256i a, __m256i b) { return _mm256_dpbusd_avx_epi32(_mm256_dpwssd_avx_epi32(a, a, b), a, b); } +int main() { + volatile int x = 1; + return _mm256_extract_epi32(dots(_mm256_set1_epi32(x), _mm256_set1_epi32(x)), 0) == 0; +} +]=] STRATA_HAVE_AVXVNNI_INTRINSICS) +unset(CMAKE_REQUIRED_FLAGS) +if(STRATA_HAVE_AVXVNNI_INTRINSICS) + set(_strata_avxvnni STRATA_AVXVNNI=1) +else() + set(_strata_avxvnni STRATA_AVXVNNI=0) +endif() +set_property(SOURCE src/kernels/cpu/q2_avx2.cpp APPEND PROPERTY COMPILE_DEFINITIONS ${_strata_avxvnni}) find_package(Threads REQUIRED) target_link_libraries(strata_kernels_cpu PUBLIC Threads::Threads) @@ -878,7 +1736,6 @@ target_link_libraries(strata_kernels_cpu PUBLIC Threads::Threads) # The CPU computes a native expert with ggml-cpu's own dot products (`ggml_get_type_traits_cpu`), so an IQ # weight means exactly what it means in llama.cpp. ggml is built static from a llama.cpp checkout: a local one # with -DSTRATA_GGML_DIR=..., otherwise the pinned upstream commit (third_party/ggml/VERSION.txt). -option(STRATA_NATIVE_EXPERTS "Native (IQ) expert support through ggml-cpu" ON) set(STRATA_GGML_DIR "" CACHE PATH "llama.cpp checkout to take ggml from (empty: fetch the pinned commit)") if(STRATA_PREFILL_MMQ AND NOT STRATA_NATIVE_EXPERTS) message(FATAL_ERROR "STRATA_PREFILL_MMQ requires STRATA_NATIVE_EXPERTS=ON for GGML sources") @@ -900,6 +1757,29 @@ if(STRATA_NATIVE_EXPERTS) foreach(_f GGML_AVX GGML_AVX2 GGML_FMA GGML_F16C GGML_BMI2) set(${_f} ON CACHE BOOL "" FORCE) endforeach() + # The DeepSeek engine (STRATA_BUILD_DSV41) builds ggml-cpu with BMI2 OFF: ggml's IQ1_S / IQ1_M dots use _pdep_u64 with it, and AMD + # Zen 1/2 run PDEP in microcode (EPYC 7452, IQ1_M one-token dot 1.8 GB/s against 32 GB/s without it; IQ1_S 2.3 against 37). The + # results are bit-identical either way (ds4_gg_bench --dump, types 19 and 29, 1-16 tokens). Other engines keep BMI2 until their + # next rebuild is looked at: no Qwen package changes with this commit. + if(STRATA_BUILD_DSV41) + set(GGML_BMI2 OFF CACHE BOOL "" FORCE) + endif() + elseif(STRATA_ISA_FLOOR) + # the experimental older-CPU build (STRATA_ISA_FLOOR above): one ggml-cpu for the floor, ggml's "sandybridge" + # feature set (SSE4.2 + AVX) or SSE4.2 alone - not the build host's, which may be newer than the PC it runs on. + # From the Strata_Dirigo fork (rwkeyes). ggml's defaults turn the rest on when GGML_NATIVE is off: all off here. + set(GGML_NATIVE OFF CACHE BOOL "" FORCE) + set(GGML_CPU_ALL_VARIANTS OFF CACHE BOOL "" FORCE) + set(GGML_SSE42 ON CACHE BOOL "" FORCE) + if(STRATA_ISA_FLOOR STREQUAL "avx") + set(GGML_AVX ON CACHE BOOL "" FORCE) + else() + set(GGML_AVX OFF CACHE BOOL "" FORCE) + endif() + foreach(_f GGML_AVX2 GGML_FMA GGML_F16C GGML_BMI2 GGML_AVX_VNNI GGML_AVX512 GGML_AVX512_VBMI GGML_AVX512_VNNI + GGML_AVX512_BF16 GGML_AMX_TILE GGML_AMX_INT8 GGML_AMX_BF16) + set(${_f} OFF CACHE BOOL "" FORCE) + endforeach() else() set(GGML_NATIVE ON CACHE BOOL "" FORCE) endif() @@ -920,21 +1800,135 @@ if(STRATA_NATIVE_EXPERTS) # part of strata_kernels_cpu (the pool calls these and they call its CPU probe: one library, so GNU ld's # one-pass static linking has no cycle to resolve) target_sources(strata_kernels_cpu PRIVATE src/kernels/cpu/native_expert.cpp src/kernels/cpu/iq_avx512.cpp - src/kernels/cpu/iq_avx2.cpp src/kernels/cpu/kq_avx2.cpp) + src/kernels/cpu/iq_avx2.cpp src/kernels/cpu/kq_avx2.cpp + src/kernels/cpu/kq_avx1.cpp src/kernels/cpu/q2_avx1.cpp src/kernels/cpu/iq_avx1.cpp + src/kernels/cpu/nvfp4_avx512.cpp src/kernels/cpu/nvfp4_avx2.cpp + src/kernels/cpu/tq_cpu.cpp src/kernels/cpu/tq_avx2.cpp src/kernels/cpu/tq_avx512.cpp) target_include_directories(strata_kernels_cpu PRIVATE third_party/ggml) if(MSVC) - set_source_files_properties(src/kernels/cpu/iq_avx512.cpp PROPERTIES COMPILE_OPTIONS "/arch:AVX512") + set_source_files_properties(src/kernels/cpu/iq_avx512.cpp src/kernels/cpu/nvfp4_avx512.cpp + PROPERTIES COMPILE_OPTIONS "/arch:AVX512") set_source_files_properties(src/kernels/cpu/iq_avx2.cpp PROPERTIES COMPILE_OPTIONS "/arch:AVX2") set_source_files_properties(src/kernels/cpu/kq_avx2.cpp PROPERTIES COMPILE_OPTIONS "/arch:AVX2") + set_source_files_properties(src/kernels/cpu/nvfp4_avx2.cpp PROPERTIES COMPILE_OPTIONS "/arch:AVX2") + set_source_files_properties(src/kernels/cpu/tq_avx2.cpp PROPERTIES COMPILE_OPTIONS "/arch:AVX2") + set_source_files_properties(src/kernels/cpu/tq_avx512.cpp PROPERTIES COMPILE_OPTIONS "/arch:AVX512") + # the router lookahead's AVX1 dot (older CPUs; called behind cpu_avx1_ok): no FMA, no 256-bit integer ops + set_source_files_properties(src/kernels/cpu/kq_avx1.cpp PROPERTIES COMPILE_OPTIONS "/arch:AVX") + # the older CPUs' Q2_0 rows and activation quantizer (q2_avx1.cpp, issue #1699): 128-bit integer lanes, + # no FMA/F16C, its own #error guard; called only behind cpu_avx1_ok() && !cpu_avx2_ok() + set_source_files_properties(src/kernels/cpu/q2_avx1.cpp PROPERTIES COMPILE_OPTIONS "/arch:AVX") + # the older CPUs' i-quant expert rows (iq_avx1.hpp): 128-bit SSSE3/SSE2 integer, SSE2 float, no FMA/F16C + set_source_files_properties(src/kernels/cpu/iq_avx1.cpp PROPERTIES COMPILE_OPTIONS "/arch:AVX") else() - set_source_files_properties(src/kernels/cpu/iq_avx512.cpp PROPERTIES COMPILE_OPTIONS - "-mavx512f;-mavx512bw;-mavx512vl;-mavx512dq;-mavx512vnni;-mavx512vbmi;-mf16c;-mfma") + set_source_files_properties(src/kernels/cpu/iq_avx512.cpp src/kernels/cpu/nvfp4_avx512.cpp PROPERTIES COMPILE_OPTIONS + "-mavx512f;-mavx512bw;-mavx512vl;-mavx512dq;-mavx512vnni;-mavx512vbmi;-mavx512vpopcntdq;-mbmi2;-mf16c;-mfma") set_source_files_properties(src/kernels/cpu/iq_avx2.cpp PROPERTIES COMPILE_OPTIONS "-mavx2;-mfma;-mf16c") set_source_files_properties(src/kernels/cpu/kq_avx2.cpp PROPERTIES COMPILE_OPTIONS "-mavx2;-mfma;-mf16c") + set_source_files_properties(src/kernels/cpu/nvfp4_avx2.cpp PROPERTIES COMPILE_OPTIONS "-mavx2;-mfma;-mf16c") + # the trellis kernels: AVX2 + FMA, and AVX-512 F/BW/VL/VBMI/VNNI (exactly what cpu_avx512_ok() checks) + set_source_files_properties(src/kernels/cpu/tq_avx2.cpp PROPERTIES COMPILE_OPTIONS "-mavx2;-mfma;-mf16c") + set_source_files_properties(src/kernels/cpu/tq_avx512.cpp PROPERTIES COMPILE_OPTIONS + "-mavx512f;-mavx512bw;-mavx512vl;-mavx512vnni;-mavx512vbmi;-mavx2;-mfma;-mf16c") + set_source_files_properties(src/kernels/cpu/kq_avx1.cpp PROPERTIES COMPILE_OPTIONS "-mavx") + # the older CPUs' Q2_0 rows and activation quantizer (q2_avx1.cpp, issue #1699): SSE4.2 + AVX with + # AVX2/FMA/F16C explicitly off, so a -march=native build host cannot leak AVX2 code into the file that + # runs on a Sandy Bridge Xeon + set_source_files_properties(src/kernels/cpu/q2_avx1.cpp PROPERTIES COMPILE_OPTIONS + "-msse4.2;-mavx;-mno-avx2;-mno-fma;-mno-f16c") + # the older CPUs' i-quant expert rows (iq_avx1.hpp): SSE4.2 + AVX with AVX2/FMA/F16C explicitly off, so a + # -march=native build host cannot leak AVX2 code into the file that runs on a Sandy Bridge Xeon + set_source_files_properties(src/kernels/cpu/iq_avx1.cpp PROPERTIES COMPILE_OPTIONS + "-msse4.2;-mavx;-mno-avx2;-mno-fma;-mno-f16c") + endif() + set_property(SOURCE src/kernels/cpu/iq_avx2.cpp APPEND PROPERTY COMPILE_DEFINITIONS ${_strata_avxvnni}) + if(STRATA_ISA_FLOOR STREQUAL "avx") + target_compile_definitions(strata_kernels_cpu PRIVATE STRATA_ISA_FLOOR_AVX=1) + elseif(STRATA_ISA_FLOOR STREQUAL "none") + target_compile_definitions(strata_kernels_cpu PRIVATE STRATA_ISA_FLOOR_NONE=1) endif() target_link_libraries(strata_kernels_cpu PUBLIC ggml-cpu ggml-base) target_compile_definitions(strata_kernels_cpu PUBLIC STRATA_NATIVE_EXPERTS=1) + if(STRATA_BUILD_TESTS) + # the Q5_1 block dequantizer (a Q5_1 PLE table) against ggml's, synthetic blocks: no model, no GPU + add_executable(dequant_q5_1_test tests/core/dequant_q5_1_test.cpp) + target_link_libraries(dequant_q5_1_test PRIVATE strata_artifact ggml-base) + add_test(NAME dequant_q5_1_test COMMAND dequant_q5_1_test) + endif() + # the router lookahead's dot on each rung this CPU has (AVX2, the older CPUs' AVX1) against a double reference + add_executable(router_dot_parity src/kernels/cpu/router_dot_parity.cpp) + target_link_libraries(router_dot_parity PRIVATE strata_kernels_cpu) + if(STRATA_BUILD_TESTS) + add_executable(pool_tasks_test src/kernels/cpu/pool_tasks_test.cpp) + target_link_libraries(pool_tasks_test PRIVATE strata_kernels_cpu) + add_test(NAME pool_tasks_test COMMAND pool_tasks_test) + set_tests_properties(pool_tasks_test PROPERTIES TIMEOUT 180) + add_test(NAME router_dot_parity COMMAND router_dot_parity) + add_test(NAME router_dot_parity_avx COMMAND ${CMAKE_COMMAND} -E env STRATA_FORCE_ISA=avx $) + endif() + # the AVX-2 expert kernels' variants (iq_avx2.cpp, q2_avx2.cpp) bit for bit against each other at 1..8 tokens and + # against ggml-cpu's dot, on random blocks; --bench: ms per expert on one thread, the weights streamed from DRAM + add_executable(iq_avx2_parity src/kernels/cpu/iq_avx2_parity.cpp) + target_link_libraries(iq_avx2_parity PRIVATE strata_kernels_cpu) + # the 512-bit i-quant rows against ggml-cpu's dot: the exact rows bit for bit at 1-4 tokens, the engine's multi-token rows to float + # rounding, with the grid lookups as scalar loads and as gathers (SKIP without AVX-512) + add_executable(iq512_gather_parity src/kernels/cpu/iq512_gather_parity.cpp) + target_link_libraries(iq512_gather_parity PRIVATE strata_kernels_cpu) + if(STRATA_BUILD_TESTS) + add_test(NAME iq512_gather_parity_scalar COMMAND ${CMAKE_COMMAND} -E env STRATA_IQ_GATHER=0 $) + add_test(NAME iq512_gather_parity_gather COMMAND ${CMAKE_COMMAND} -E env STRATA_IQ_GATHER=1 $) + endif() + # MODEL-UPDATE: the pool's expert rows per format on T threads against the RAM bandwidth (a benchmark, no test) + add_executable(kq_cpu_bench src/kernels/cpu/kq_cpu_bench.cpp) + target_link_libraries(kq_cpu_bench PRIVATE strata_kernels_cpu) + if(STRATA_BUILD_TESTS) + add_test(NAME iq_avx2_parity COMMAND iq_avx2_parity) + add_test(NAME iq_avx2_parity_iq3s_mt1 COMMAND ${CMAKE_COMMAND} -E env STRATA_IQ3S_MT1=1 $) + endif() + # the older CPUs' AVX1 expert rows (iq_avx1.cpp) against ggml-cpu's dots and against their own one-token + # rows at every width; --bench: ms per expert, the weights streamed from DRAM. Runs on any AVX CPU: + # on an AVX2 machine it checks the older-CPU path as an AVX-only machine would run it. + add_executable(iq_avx1_parity src/kernels/cpu/iq_avx1_parity.cpp) + target_link_libraries(iq_avx1_parity PRIVATE strata_kernels_cpu) + if(STRATA_BUILD_TESTS) + add_test(NAME iq_avx1_parity COMMAND iq_avx1_parity) + endif() + # the AVX-2 Q8_K activation quantizer against ggml's, byte for byte (--bench: its time) + add_executable(q8k_quant_parity src/kernels/cpu/q8k_quant_parity.cpp) + target_link_libraries(q8k_quant_parity PRIVATE strata_kernels_cpu) + if(STRATA_BUILD_TESTS) + add_test(NAME q8k_quant_parity COMMAND q8k_quant_parity) + add_test(NAME q8k_quant_parity_avx COMMAND ${CMAKE_COMMAND} -E env STRATA_FORCE_ISA=avx $) + endif() set(_strata_mmq_types q2_0 iq2_xxs iq2_xs iq2_s iq3_xxs iq3_s iq4_nl iq4_xs q8_0) + # APR: the agention llama.cpp fork has MMQ instances for its trellis expert types (f62fdead0); any other ggml + # tree leaves them to the FP16 prompt path + if(STRATA_GGML_DIR AND EXISTS "${STRATA_GGML_DIR}/ggml/src/ggml-cuda/template-instances/mmq-instance-tqk6.cu") + list(APPEND _strata_mmq_types tq2_t tqk6 tqk7) + set(_strata_mmq_tq ON) + elseif(STRATA_MMQ_TQ_OVERLAY AND (STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP)) + # an upstream llama.cpp: the trellis MMQ instances come from an overlay of the pinned ggml-cuda headers written at + # configure time (cmake/strata_ggml_tq_overlay.cmake); off with a message if the llama.cpp tree is not the pinned one + if(STRATA_GGML_DIR) + set(_strata_tq_llama "${STRATA_GGML_DIR}") + else() + set(_strata_tq_llama "${strata_llamacpp_SOURCE_DIR}") + endif() + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/strata_ggml_tq_overlay.cmake) + set(_strata_tq_overlay_dir "${CMAKE_BINARY_DIR}/ggml-tq-overlay") + strata_ggml_tq_overlay("${_strata_tq_llama}" "${_strata_tq_overlay_dir}") + if(STRATA_TQ_OVERLAY_OK) + configure_file(third_party/ggml/ggml-common-tq.h "${_strata_tq_overlay_dir}/ggml-common-tq.h" COPYONLY) + configure_file(src/kernels/cuda/tq_lut_i8.cuh "${_strata_tq_overlay_dir}/tq_lut_i8.cuh" COPYONLY) + set(_strata_mmq_tq ON) + set(_strata_mmq_tq_overlay ON) + message(STATUS "trellis MMQ (Gyro prompts): overlay on the pinned ggml-cuda in ${_strata_tq_overlay_dir}") + if(STRATA_BUILD_TESTS) + add_test(NAME ggml_tq_overlay COMMAND ${CMAKE_COMMAND} -DLLAMA=${_strata_tq_llama} + -DOUT=${CMAKE_BINARY_DIR}/ggml-tq-overlay-test -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ggml_tq_overlay_test.cmake) + endif() + endif() + endif() # #296: OrcaRouter Q4_K_S's Q5_0 experts (Q4_K and Q5_1 come with STRATA_MMQ_KQUANTS on CUDA, S5's branch) if(STRATA_ORCA_Q4KS_MMQ) list(APPEND _strata_mmq_types q5_0) @@ -949,39 +1943,189 @@ if(STRATA_NATIVE_EXPERTS) set(_strata_gg ${strata_llamacpp_SOURCE_DIR}/ggml) endif() set(_strata_mmq ${_strata_gg}/src/ggml-cuda) - add_library(strata_mmq STATIC src/prefill/moe_mmq.cu src/prefill/ggml_cuda_host.cu ${_strata_mmq}/quantize.cu) + set(_strata_quantize_cu ${_strata_mmq}/quantize.cu) # the overlay's copy when the trellis overlay is on: it includes mmq.cuh + if(_strata_mmq_tq_overlay) + set(_strata_quantize_cu ${_strata_tq_overlay_dir}/quantize.cu) + endif() + # #136: the Q2_0 pack's prompt experts on Strata's own int8 kernels (moe_fused.cu, opt-in STRATA_PF_FUSED=1; CUDA + # only: the HIP branch below keeps MMQ, and an sm_75 device or an sm_75-only build reports them unavailable) + add_library(strata_mmq STATIC src/prefill/moe_mmq.cu src/prefill/moe_fused.cu src/prefill/moe_fused_iq.cu + src/prefill/mmq_nvfp4_w4a8.cu + src/prefill/ggml_cuda_host.cu ${_strata_quantize_cu}) # q8_0: the drafter's matrices (E-9); STRATA_ORCA_Q4KS_MMQ adds q5_0 (#296, in _strata_mmq_types), and - # STRATA_MMQ_KQUANTS q4_k q5_k q5_1, the experts of Unsloth's UD-Q4_K_XL (docs/UNSLOTH_Q4.md; the dispatch - # follows eddoursul/Strata 7706c1b) + # STRATA_MMQ_KQUANTS q4_k q5_k q5_1 q6_k, the experts of Unsloth's UD-Q4/Q5/Q6_K_XL (docs/QUANTS.md; the dispatch + # follows eddoursul/Strata 7706c1b). MODEL-UPDATE Phase 1: on CUDA they are a library of their own, strata_kq + # (below), loaded only for a model with these experts: the engine loads every kernel of its own binary at start + # (CUDA_MODULE_LOADING=EAGER), and these four took ~3.8 MB of VRAM (3 expert slots of IQ3_XXS on a P100) from every + # model. gfx906 (HIP: code objects load on first use) keeps them in strata_mmq. set(_strata_mmq_cuda_types ${_strata_mmq_types}) - if(STRATA_MMQ_KQUANTS) - list(APPEND _strata_mmq_cuda_types q4_k q5_k q5_1) + set(_strata_kq_types q4_k q5_k q5_1 q6_k) + set(_strata_kq_dso OFF) + if(STRATA_MMQ_KQUANTS AND STRATA_HIP_GFX906) + list(APPEND _strata_mmq_cuda_types ${_strata_kq_types}) + elseif(STRATA_MMQ_KQUANTS) + set(_strata_kq_dso ON) endif() foreach(_t IN LISTS _strata_mmq_cuda_types) target_sources(strata_mmq PRIVATE ${_strata_mmq}/template-instances/mmq-instance-${_t}.cu) endforeach() + if(_strata_mmq_tq_overlay) + foreach(_t tq2_t tqk6 tqk7) + target_sources(strata_mmq PRIVATE ${_strata_tq_overlay_dir}/template-instances/mmq-instance-${_t}.cu) + endforeach() + # first on the include path: the patched mmq.cuh / ggml.h shadow the pinned ones for this target only + target_include_directories(strata_mmq BEFORE PRIVATE ${_strata_tq_overlay_dir} ${_strata_tq_overlay_dir}/include) + endif() + # NVFP4: W4A8 (default) in mmq_nvfp4_w4a8.cu with the plain architectures; the opt-in W4A4 needs RTX 50's FP4 MMA, + # which exists only in the arch-specific target, so its one unit alone is built with 12x -> 12xa (the default + # binary is unchanged and runs on sm_121; a card without that image falls back to W4A8 at run time) + set(_strata_w4a4_archs ${CMAKE_CUDA_ARCHITECTURES}) + # (two steps: CMake before 3.29 rejects a \2 whose optional group did not match, "120" alone) + list(TRANSFORM _strata_w4a4_archs REPLACE "^(12[0-9])$" "\\1a") + list(TRANSFORM _strata_w4a4_archs REPLACE "^(12[0-9])-(real|virtual)$" "\\1a-\\2") + add_library(strata_mmq_w4a4 STATIC src/prefill/mmq_nvfp4_w4a4.cu) + set_target_properties(strata_mmq_w4a4 PROPERTIES CUDA_ARCHITECTURES "${_strata_w4a4_archs}") + target_include_directories(strata_mmq_w4a4 PRIVATE ${_strata_gg}/include ${_strata_gg}/src ${_strata_mmq}) + target_compile_options(strata_mmq_w4a4 PRIVATE $<$:--extended-lambda -use_fast_math>) + if(MSVC) + target_compile_options(strata_mmq_w4a4 PRIVATE $<$:-Xcompiler=/bigobj>) + endif() + target_link_libraries(strata_mmq_w4a4 PUBLIC ggml-base ${_strata_gpu_runtime_target}) + target_link_libraries(strata_mmq PRIVATE strata_mmq_w4a4) + # STRATA_MMQ_TAB: the pointer-table copy of MMQ's scheduler mirrors mmq.cuh from mul_mat_q_process_tile through + # mul_mat_q_case (struct mmq_args included). A fingerprint of that text instead of a compile probe: nothing is + # compiled at configure time, and a llama.cpp tree with another scheduler turns the feature off instead of + # failing the build. _strata_mmq_tab_known: the hashes moe_mmq_tab.cuh was verified against (3cf03257, the + # fetched pin; the vendored third_party/llama.cpp tree has the same mmq.cuh). + set(_strata_mmq_tab_on OFF) + if(STRATA_MMQ_TAB AND NOT STRATA_HIP_GFX906) # gfx906 compiles no .cu from here (its HIP glob): no tab at all + set(_strata_mmq_tab_known 36e4dc716c504470ec09cc0852d29a6ac5eace257f6e5e72db3805ca4f043eb0) + set(_strata_mmq_tab_hash "") + if(EXISTS ${_strata_mmq}/mmq.cuh) + file(READ ${_strata_mmq}/mmq.cuh _strata_mmq_src) + string(REPLACE "\r\n" "\n" _strata_mmq_src "${_strata_mmq_src}") + string(FIND "${_strata_mmq_src}" "static __device__ __forceinline__ void mul_mat_q_process_tile" _strata_tab_a) + string(FIND "${_strata_mmq_src}" "#define DECL_MMQ_CASE" _strata_tab_b) + if(_strata_tab_a GREATER -1 AND _strata_tab_b GREATER _strata_tab_a) + math(EXPR _strata_tab_len "${_strata_tab_b} - ${_strata_tab_a}") + string(SUBSTRING "${_strata_mmq_src}" ${_strata_tab_a} ${_strata_tab_len} _strata_tab_region) + string(SHA256 _strata_mmq_tab_hash "${_strata_tab_region}") + endif() + unset(_strata_mmq_src) + unset(_strata_tab_region) + endif() + if(_strata_mmq_tab_hash AND _strata_mmq_tab_hash IN_LIST _strata_mmq_tab_known) + set(_strata_mmq_tab_on ON) + else() + message(STATUS "STRATA_MMQ_TAB off: mmq.cuh differs from the mirrored scheduler (${_strata_mmq_tab_hash})") + endif() + endif() + if(_strata_mmq_tab_on) + set(_strata_tab_cuh ${CMAKE_CURRENT_SOURCE_DIR}/src/prefill/moe_mmq_tab.cuh) + # the native packs' nine types, the ones prefill_mmq_tab_test checks bit for bit; the optional Q5_0 / K-quant + # instances (STRATA_ORCA_Q4KS_MMQ, STRATA_MMQ_KQUANTS) get no pointer table and keep the gather + set(_strata_mmq_tab_types q2_0 iq2_xxs iq2_xs iq2_s iq3_xxs iq3_s iq4_nl iq4_xs q8_0) + foreach(_t IN LISTS _strata_mmq_tab_types) + string(TOUPPER ${_t} _strata_tab_T) + configure_file(src/prefill/mmq_tab_instance.cu.in ${CMAKE_BINARY_DIR}/mmq_tab/mmq-tab-${_t}.cu @ONLY) + target_sources(strata_mmq PRIVATE ${CMAKE_BINARY_DIR}/mmq_tab/mmq-tab-${_t}.cu) + endforeach() + target_compile_definitions(strata_mmq PRIVATE STRATA_MMQ_TAB=1) + message(STATUS "STRATA_MMQ_TAB on: pointer-table MMQ for ${_strata_mmq_tab_types}") + endif() target_include_directories(strata_mmq PRIVATE ${_strata_gg}/include ${_strata_gg}/src ${_strata_mmq} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) target_compile_options(strata_mmq PRIVATE $<$:--extended-lambda -use_fast_math>) if(MSVC) target_compile_options(strata_mmq PRIVATE $<$:-Xcompiler=/bigobj>) endif() + # GGML's CUDA error reporting calls cuGetErrorString from the driver API. target_link_libraries(strata_mmq PUBLIC ggml-base ${_strata_gpu_runtime_target}) + if(TARGET CUDA::cuda_driver) # not in the HIP (gfx906) build, whose CUDA::cudart is a stand-in + target_link_libraries(strata_mmq PUBLIC CUDA::cuda_driver) + endif() if(STRATA_MMQ_KQUANTS) target_compile_definitions(strata_mmq PRIVATE STRATA_MMQ_KQUANTS=1) endif() + if(_strata_kq_dso) + # strata_kq: the K-quant MMQ instances with their own copy of ggml_cuda_host.cu's symbols and the static CUDA + # runtime, next to the engine (libstrata_kq.so / strata_kq.dll); moe_mmq.cu opens it when a model asks for one + # of these formats (STRATA_MMQ_KQ=1). Without the file the engine runs them on the FP16 prompt path, as before. + target_compile_definitions(strata_mmq PRIVATE STRATA_KQ_DSO=1) + target_sources(strata_mmq PRIVATE src/prefill/mmq_kq_loader.cpp) + if(NOT WIN32) + target_link_libraries(strata_mmq PUBLIC ${CMAKE_DL_LIBS}) + endif() + add_library(strata_kq SHARED src/prefill/mmq_kq_lib.cu src/prefill/ggml_cuda_host.cu) + foreach(_t IN LISTS _strata_kq_types) + target_sources(strata_kq PRIVATE ${_strata_mmq}/template-instances/mmq-instance-${_t}.cu) + endforeach() + target_include_directories(strata_kq PRIVATE ${_strata_gg}/include ${_strata_gg}/src ${_strata_mmq} + ${CMAKE_CURRENT_SOURCE_DIR}/include) + target_compile_options(strata_kq PRIVATE $<$:--extended-lambda -use_fast_math>) + if(MSVC) + target_compile_options(strata_kq PRIVATE $<$:-Xcompiler=/bigobj>) + endif() + set_target_properties(strata_kq PROPERTIES CUDA_RUNTIME_LIBRARY Static POSITION_INDEPENDENT_CODE ON + CXX_VISIBILITY_PRESET hidden CUDA_VISIBILITY_PRESET hidden) + # ggml-base is static: position-independent so a shared library can hold it (the same code otherwise) + set_target_properties(ggml-base PROPERTIES POSITION_INDEPENDENT_CODE ON) + target_link_libraries(strata_kq PRIVATE ggml-base) + if(TARGET CUDA::cuda_driver) + target_link_libraries(strata_kq PRIVATE CUDA::cuda_driver) + endif() + add_dependencies(strata_mmq strata_kq) + endif() if(STRATA_ORCA_Q4KS_MMQ) target_compile_definitions(strata_mmq PRIVATE STRATA_ORCA_Q4KS_MMQ=1) endif() + if(_strata_mmq_tq) + target_compile_definitions(strata_mmq PRIVATE STRATA_MMQ_TQ=1) + endif() target_link_libraries(strata_prefill PUBLIC strata_mmq) - target_compile_definitions(strata_prefill PUBLIC STRATA_PREFILL_MMQ=1) + target_compile_definitions(strata_prefill PUBLIC STRATA_PREFILL_MMQ=1 STRATA_PREFILL_FUSED=1) + if(STRATA_BUILD_TESTS) + # #136: the fused int8 experts against a double-precision reference and the MMQ path (exit 77 below sm_80) + add_executable(prefill_fused_moe_test tests/cuda/prefill_fused_moe_test.cpp) + target_link_libraries(prefill_fused_moe_test PRIVATE strata_mmq ggml-base ${_strata_gpu_runtime_target}) + add_test(NAME prefill_fused_moe_test COMMAND prefill_fused_moe_test) + set_tests_properties(prefill_fused_moe_test PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 300) + # #136: the same for the native packs' formats (IQ2_XXS IQ2_XS IQ2_S IQ3_XXS IQ3_S IQ4_XS, down Q2_0 IQ4_NL) + add_executable(prefill_fused_iq_test tests/cuda/prefill_fused_iq_test.cpp) + target_link_libraries(prefill_fused_iq_test PRIVATE strata_mmq ggml-base ${_strata_gpu_runtime_target}) + add_test(NAME prefill_fused_iq_test COMMAND prefill_fused_iq_test) + set_tests_properties(prefill_fused_iq_test PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 600) + # the MoE input quantized per token and scattered to its rows (mmq::quantize_scatter) against the per-row + # gather: the same q8_1 bytes for every MMQ layout (--bench: both at 2K, 8K and 32K tokens) + add_executable(prefill_mmq_scatter_test tests/cuda/prefill_mmq_scatter_test.cpp) + target_link_libraries(prefill_mmq_scatter_test PRIVATE strata_mmq ggml-base ${_strata_gpu_runtime_target}) + add_test(NAME prefill_mmq_scatter_test COMMAND prefill_mmq_scatter_test) + set_tests_properties(prefill_mmq_scatter_test PROPERTIES TIMEOUT 120) + endif() + if(STRATA_BUILD_TESTS AND _strata_mmq_tab_on) + # STRATA_MMQ_DIRECT: the pointer-table MMQ bit for bit against the gathered MMQ (exit 77 below sm_80) + add_executable(prefill_mmq_tab_test tests/cuda/prefill_mmq_tab_test.cu) + target_link_libraries(prefill_mmq_tab_test PRIVATE strata_mmq ggml-base ${_strata_gpu_runtime_target}) + add_test(NAME prefill_mmq_tab_test COMMAND prefill_mmq_tab_test) + set_tests_properties(prefill_mmq_tab_test PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 600) + endif() if(STRATA_BUILD_TESTS AND STRATA_MMQ_KQUANTS) # the UD-Q4_K_XL expert formats through MMQ against ggml's dequantized weights (synthetic, a few seconds) add_executable(prefill_mmq_kquant_test tests/cuda/prefill_mmq_kquant_test.cpp) target_link_libraries(prefill_mmq_kquant_test PRIVATE strata_mmq ggml-base ${_strata_gpu_runtime_target}) add_test(NAME prefill_mmq_kquant_test COMMAND prefill_mmq_kquant_test) - set_tests_properties(prefill_mmq_kquant_test PROPERTIES TIMEOUT 120) + # the K-quant MMQ is opt-in at run time (STRATA_MMQ_KQ=1), and on CUDA it is strata_kq next to the test + set_tests_properties(prefill_mmq_kquant_test PROPERTIES TIMEOUT 120 ENVIRONMENT STRATA_MMQ_KQ=1) endif() + # the NVFP4 expert products (w4a8 / w4a4, STRATA_PREFILL_NVFP4) against a double-precision reference + add_executable(mmq_nvfp4_parity src/prefill/mmq_nvfp4_parity.cpp) + target_link_libraries(mmq_nvfp4_parity PRIVATE strata_mmq ggml-base CUDA::cudart) + if(NOT MSVC) # its FP16 rounding helper uses the F16C intrinsics (GCC/Clang need the target flag) + target_compile_options(mmq_nvfp4_parity PRIVATE $<$:-mf16c>) + endif() + # the routed-expert products (MMQ) timed at the prompt path's shapes (16 experts a launch) + add_executable(mmq_expert_bench src/prefill/mmq_expert_bench.cpp) + target_link_libraries(mmq_expert_bench PRIVATE strata_mmq ggml-base CUDA::cudart) elseif(STRATA_PREFILL_MMQ) # Compile only the pinned GGML MMQ and activation-quantizer sources used by prefill. This uses # common.cuh's native HIP path without enabling a second GGML HIP backend. @@ -991,28 +2135,74 @@ if(STRATA_NATIVE_EXPERTS) set(_strata_gg "${strata_llamacpp_SOURCE_DIR}/ggml") endif() set(_strata_mmq "${_strata_gg}/src/ggml-cuda") + set(_strata_quantize_cu "${_strata_mmq}/quantize.cu") # the overlay's copy when the trellis overlay is on: it includes mmq.cuh + if(_strata_mmq_tq_overlay) + set(_strata_quantize_cu "${_strata_tq_overlay_dir}/quantize.cu") + endif() if(NOT EXISTS "${_strata_mmq}/common.cuh" OR NOT EXISTS "${_strata_mmq}/quantize.cu") message(FATAL_ERROR "The selected GGML source is missing the ggml-cuda MMQ sources: ${_strata_mmq}") endif() + # Aurora: moe_fused.cu's gfx11 and moe_fused_iq.cu's gfx11 / gfx12 WMMA kernels for the prompt experts (opt-in STRATA_PF_FUSED=1) set(_strata_mmq_sources src/prefill/moe_mmq.cu + src/prefill/moe_fused.cu + src/prefill/moe_fused_iq.cu + src/prefill/moe_f16_kq.cu src/prefill/ggml_cuda_host.cu - "${_strata_mmq}/quantize.cu") + "${_strata_quantize_cu}") + if(STRATA_MMQ_KQUANTS) + # the same K-quant instances as the CUDA branch: on HIP they serve the dense GGUF projections + # of Gemm::native (STRATA_DENSE_MMQ=1), the mixed-quant packs' attention/PLE tensors + list(APPEND _strata_mmq_types q4_k q5_k q5_1 q6_k) + endif() foreach(_t IN LISTS _strata_mmq_types) list(APPEND _strata_mmq_sources "${_strata_mmq}/template-instances/mmq-instance-${_t}.cu") endforeach() + if(_strata_mmq_tq_overlay) + foreach(_t tq2_t tqk6 tqk7) + list(APPEND _strata_mmq_sources "${_strata_tq_overlay_dir}/template-instances/mmq-instance-${_t}.cu") + endforeach() + endif() set_source_files_properties(${_strata_mmq_sources} PROPERTIES LANGUAGE HIP) + # moe_fused.cu is Strata's own CUDA-shaped source: it takes the HIP compat headers, ggml's MMQ sources do not + set_source_files_properties(src/prefill/moe_fused.cu src/prefill/moe_fused_iq.cu src/prefill/moe_f16_kq.cu + PROPERTIES INCLUDE_DIRECTORIES "${STRATA_HIP_COMPAT_INCLUDE_DIR}") add_library(strata_mmq STATIC ${_strata_mmq_sources}) target_include_directories(strata_mmq PRIVATE "${_strata_gg}/include" "${_strata_gg}/src" "${_strata_mmq}" PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) + if(_strata_mmq_tq_overlay) + target_include_directories(strata_mmq BEFORE PRIVATE ${_strata_tq_overlay_dir} ${_strata_tq_overlay_dir}/include) + endif() target_compile_definitions(strata_mmq PRIVATE GGML_USE_HIP=1) + if(STRATA_MMQ_KQUANTS) + target_compile_definitions(strata_mmq PRIVATE STRATA_MMQ_KQUANTS=1) + endif() if(STRATA_ORCA_Q4KS_MMQ) target_compile_definitions(strata_mmq PRIVATE STRATA_ORCA_Q4KS_MMQ=1) endif() + if(_strata_mmq_tq) + target_compile_definitions(strata_mmq PRIVATE STRATA_MMQ_TQ=1) + endif() target_link_libraries(strata_mmq PUBLIC ggml-base hip::host roc::hipblas) target_link_libraries(strata_prefill PUBLIC strata_mmq) - target_compile_definitions(strata_prefill PUBLIC STRATA_PREFILL_MMQ=1) + target_compile_definitions(strata_prefill PUBLIC STRATA_PREFILL_MMQ=1 STRATA_PREFILL_FUSED=1) + # Aurora: the gfx11 fused experts against the FP64 reference and MMQ (tests/cuda's test; exit 77 off gfx11) + add_executable(hip_prefill_fused_moe tests/cuda/prefill_fused_moe_test.cpp) + target_include_directories(hip_prefill_fused_moe PRIVATE "${_strata_gg}/include") + target_link_libraries(hip_prefill_fused_moe PRIVATE strata_mmq ggml-base strata_hip_runtime) + add_test(NAME hip_prefill_fused_moe COMMAND hip_prefill_fused_moe) + set_tests_properties(hip_prefill_fused_moe PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 300) + list(APPEND _strata_hip_tests hip_prefill_fused_moe) + add_executable(hip_prefill_fused_iq tests/cuda/prefill_fused_iq_test.cpp) + target_include_directories(hip_prefill_fused_iq PRIVATE "${_strata_gg}/include") + target_link_libraries(hip_prefill_fused_iq PRIVATE strata_mmq ggml-base strata_hip_runtime) + add_test(NAME hip_prefill_fused_iq COMMAND hip_prefill_fused_iq) + set_tests_properties(hip_prefill_fused_iq PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 600) + # the same binary on F16 weights (gfx11: the covered formats take moe_f16_kq.cu / native_f16_kernel; elsewhere it is the default run again) + add_test(NAME hip_prefill_fused_iq_f16 COMMAND hip_prefill_fused_iq) + set_tests_properties(hip_prefill_fused_iq_f16 PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 600 ENVIRONMENT "STRATA_PF_F16=1;STRATA_PF_F16_KQ=1") + list(APPEND _strata_hip_tests hip_prefill_fused_iq) # Numerical diagnostic: synthetic layouts by default, optional first-expert IQ3_XXS/IQ4_NL check with a pack. add_executable(hip_prefill_mmq_parity tests/hip/prefill_mmq_parity.cpp) @@ -1027,24 +2217,73 @@ if(STRATA_NATIVE_EXPERTS) add_executable(hip_ple_iq4 tests/hip/ple_iq4.cpp) target_link_libraries(hip_ple_iq4 PRIVATE strata_kernels strata_hip_runtime ggml-base) endif() + # the NVFP4 AVX-512 and AVX2 rows vs ggml-cpu's vec_dot, and their speed (CPU only; optional arg: a pack's experts.bin) + add_executable(nvfp4_avx512_parity src/kernels/cpu/nvfp4_avx512_parity.cpp) + target_link_libraries(nvfp4_avx512_parity PRIVATE strata_kernels_cpu) + add_test(NAME nvfp4_cpu_parity COMMAND nvfp4_avx512_parity) # random blocks; the AVX2 rows bit-equal to ggml's + set_tests_properties(nvfp4_cpu_parity PROPERTIES TIMEOUT 120) + if(STRATA_ENABLE_CUDA) # the NVFP4 decode kernels vs ggml's reference + add_executable(nvfp4_expert_gpu_parity src/kernels/nvfp4_expert_gpu_parity.cpp) + target_link_libraries(nvfp4_expert_gpu_parity PRIVATE strata_kernels ggml-base CUDA::cudart) + # the decode experts' weight bandwidth on random blobs of a format pair, and an output hash (bit-for-bit checks) + add_executable(nvfp4_decode_bench src/kernels/nvfp4_decode_bench.cpp) + target_link_libraries(nvfp4_decode_bench PRIVATE strata_kernels CUDA::cudart) + endif() if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP) add_executable(native_expert_parity src/kernels/native_expert_parity.cpp) target_include_directories(native_expert_parity PRIVATE ${_strata_gpu_include_directories}) - target_link_libraries(native_expert_parity PRIVATE strata_kernels strata_kernels_cpu strata_artifact ${_strata_gpu_runtime_target}) + # strata_engine: the --load-check mode runs the engine's start-up checks (NativeDense, check_experts_gguf) + target_link_libraries(native_expert_parity PRIVATE strata_engine strata_kernels strata_kernels_cpu strata_artifact ${_strata_gpu_runtime_target}) + add_executable(native_expert_bench src/kernels/native_expert_bench.cpp) + target_include_directories(native_expert_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(native_expert_bench PRIVATE strata_kernels strata_kernels_cpu strata_artifact ${_strata_gpu_runtime_target}) + # MODEL-UPDATE: the dense Q8_0 GEMVs at the engine's shapes against the memory bandwidth (a benchmark, no test) + add_executable(q8_gemv_bench src/kernels/q8_gemv_bench.cpp) + target_include_directories(q8_gemv_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(q8_gemv_bench PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + if(STRATA_ENABLE_CUDA) + # EXPDEC (docs/EXPERTDEC.md): the grouped experts' default kernels against STRATA_EXPDEC=1 at T = 1..4, bit for bit + # and in microseconds, on synthetic blobs read cold from DRAM + add_executable(expdec_bench EXCLUDE_FROM_ALL src/kernels/expdec_bench.cpp) + target_include_directories(expdec_bench PRIVATE ${_strata_gpu_include_directories}) + target_link_libraries(expdec_bench PRIVATE strata_kernels ${_strata_gpu_runtime_target}) + endif() if(STRATA_BUILD_TESTS AND STRATA_ENABLE_CUDA) # Unsloth UD-Q4_K_XL's three expert pairs (and Q8_0 alone, its embedding) on synthetic ggml-quantized weights - # at 2560/640: GPU and CPU experts against the float reference, GPU dequantizers against to_float - foreach(_pair q4_K/q5_1 q4_K/q8_0 q5_K/q8_0 q8_0/q8_0) + # at 2560/640: GPU and CPU experts against the float reference, GPU dequantizers against to_float. + # q4_K/q5_0 and q5_0/q8_0: a plain llama-quantize "_M" tier GGUF (not Unsloth's dynamic method) commonly + # puts Q5_0 on down-projections (sometimes gate/up too) where this model's native_experts.txt had no GPU + # kernel for it before; q5_0/q5_0 (both roles Q5_0) is left out of this list since stacking the same + # lower-precision format on both roles pushes the GPU path over this test's 3% threshold (quantization + # noise, not a kernel bug -- see the PR). + # q4_0/q4_0 and q4_0/q4_1: a plain llama-quantize Q4_0 file (bartowski's Qwen3.8-Flash-Next-Q4_0: gate/up Q4_0, + # down Q4_0 on 42 layers and Q4_1 on 6) + # q6_K/q8_0: Unsloth UD-Q6_K_XL gate/up Q6_K with Q8_0 down (docs/UNSLOTH_Q6.md). Layer 2 is q8_0/q8_0, already listed. + set(_strata_parity_pairs q4_K/q5_1 q4_K/q8_0 q5_K/q8_0 q8_0/q8_0 q4_K/q5_0 q5_0/q8_0 q4_0/q4_0 q4_0/q4_1) + if(STRATA_Q6K_EXPERTS) + list(APPEND _strata_parity_pairs q6_K/q8_0) + else() # a pair without GPU kernels (Q6_K gate/up) is refused by native_expert_supported, not run + add_test(NAME native_expert_parity_refuses_q6_K COMMAND native_expert_parity --synthetic q6_K/q8_0) + set_tests_properties(native_expert_parity_refuses_q6_K PROPERTIES WILL_FAIL TRUE) + endif() + foreach(_pair ${_strata_parity_pairs}) string(REPLACE "/" "_" _name "${_pair}") add_test(NAME native_expert_parity_${_name} COMMAND native_expert_parity --synthetic ${_pair}) set_tests_properties(native_expert_parity_${_name} PROPERTIES TIMEOUT 120) endforeach() add_test(NAME native_expert_parity_q5_1_min COMMAND native_expert_parity --q5_1-min) + # APR: the trellis expert types and the Hadamard activation rotation, when ggml comes from the agention fork + # (the only tree with these types; marked by its ggml-cuda/tq.cuh) + if(STRATA_GGML_DIR AND EXISTS "${STRATA_GGML_DIR}/ggml/src/ggml-cuda/tq.cuh") + foreach(_pair tqk6/tqk7 tq2_t/tq2_t) + string(REPLACE "/" "_" _name "${_pair}") + add_test(NAME native_expert_parity_${_name} COMMAND native_expert_parity --synthetic ${_pair}) + add_test(NAME native_expert_parity_hadamard_${_name} COMMAND native_expert_parity --synthetic-hadamard ${_pair}) + set_tests_properties(native_expert_parity_${_name} native_expert_parity_hadamard_${_name} PROPERTIES TIMEOUT 300) + endforeach() + endif() # #290: the BF16 token embedding (--embd-gguf) gathered and dequantized bit for bit add_test(NAME native_expert_parity_bf16_embd COMMAND native_expert_parity --bf16-embd) - # a pair without GPU kernels (Q6_K gate/up) is refused by native_expert_supported, not run - add_test(NAME native_expert_parity_refuses_q6_K COMMAND native_expert_parity --synthetic q6_K/q8_0) - set_tests_properties(native_expert_parity_refuses_q6_K PROPERTIES WILL_FAIL TRUE) endif() endif() # #296's real-weight checks (OrcaRouter Q4_K_S files; docs/ORCA_Q4_K_S.md) - test programs, not part of a release @@ -1066,6 +2305,15 @@ if(STRATA_ENABLE_CUDA AND STRATA_BUILD_TESTS AND EXISTS "${CMAKE_CURRENT_SOURCE_ endif() if(STRATA_BUILD_TESTS) + if(WIN32) + add_executable(pool_affinity_test src/kernels/cpu/pool_affinity_test.cpp) + target_link_libraries(pool_affinity_test PRIVATE strata_kernels_cpu) + add_test(NAME pool_affinity_test COMMAND pool_affinity_test) + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + add_executable(pool_affinity_test src/kernels/cpu/pool_affinity_linux_test.cpp) + target_link_libraries(pool_affinity_test PRIVATE strata_kernels_cpu) + add_test(NAME pool_affinity_test COMMAND pool_affinity_test) + endif() # Plan v0.3 P6: one expert applied to several tokens, bitwise vs the single-token kernel (synthetic, CPU only). # plan v0.3 P5: the device dequantizers vs the artifact's CPU dequantizers on the real shards (not a ctest: needs # the 38 GB model; run it by hand or from tools/gpu_session.py) @@ -1077,6 +2325,31 @@ if(STRATA_BUILD_TESTS) add_executable(expert_multi_test src/kernels/cpu/expert_multi_test.cpp) target_link_libraries(expert_multi_test PRIVATE strata_kernels_cpu) add_test(NAME expert_multi_test COMMAND expert_multi_test) + set_tests_properties(expert_multi_test PROPERTIES SKIP_RETURN_CODE 77) # no AVX-512: skipped + + # PR #706: the opt-in AVX-2 Q2_0 bit-plane kernel (STRATA_Q2_BITPLANE=1) against the legacy one, bitwise alone/window + if(STRATA_BUILD_TESTS AND CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64|x86_64|x64|X86") + add_executable(q2_bitplane_parity src/kernels/cpu/q2_bitplane_parity.cpp) + target_link_libraries(q2_bitplane_parity PRIVATE strata_kernels_cpu) + add_test(NAME q2_bitplane_parity COMMAND q2_bitplane_parity) + set_tests_properties(q2_bitplane_parity PROPERTIES ENVIRONMENT "STRATA_Q2_BITPLANE=1") + endif() + + if(STRATA_NATIVE_EXPERTS) + # APR port: a Hadamard-folded trellis expert (TQ2_T / TQK6 / TQK7) on the CPU path vs llama.cpp's graph for the + # same weights (synthetic; needs STRATA_GGML_DIR = a ggml with the trellis types, else it reports and fails) + add_executable(native_hadamard_test src/kernels/cpu/native_hadamard_test.cpp) + target_link_libraries(native_hadamard_test PRIVATE strata_kernels_cpu strata_artifact) + add_test(NAME native_hadamard_test COMMAND native_hadamard_test) + set_tests_properties(native_hadamard_test PROPERTIES TIMEOUT 300 SKIP_RETURN_CODE 77) + # the CPU trellis kernels (tq_cpu.hpp): AVX2 / AVX-512 vs the scalar kernel bit for bit, vs ggml-cpu's vec_dot + # and to_float, plain and with the Hadamard rotation; `tq_cpu_parity --bench` is the micro-benchmark + add_executable(tq_cpu_parity src/kernels/cpu/tq_cpu_parity.cpp) + target_link_libraries(tq_cpu_parity PRIVATE strata_kernels_cpu) + add_test(NAME tq_cpu_parity COMMAND tq_cpu_parity) + add_test(NAME tq_cpu_parity_avx2 COMMAND ${CMAKE_COMMAND} -E env STRATA_FORCE_AVX2=1 $) + set_tests_properties(tq_cpu_parity tq_cpu_parity_avx2 PROPERTIES TIMEOUT 300 SKIP_RETURN_CODE 77) + endif() add_executable(expert_parity src/kernels/cpu/expert_parity.cpp) target_link_libraries(expert_parity PRIVATE strata_kernels_cpu) @@ -1088,17 +2361,74 @@ if(STRATA_BUILD_TESTS) add_executable(pool_test src/kernels/cpu/pool_test.cpp) target_link_libraries(pool_test PRIVATE strata_kernels_cpu) add_test(NAME pool_test COMMAND pool_test --selftest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + # where the workers are placed (one per physical core by default) and --pool-cores (real pools, no model) + add_executable(pool_cores_test src/kernels/cpu/pool_cores_test.cpp) + target_link_libraries(pool_cores_test PRIVATE strata_kernels_cpu) + add_test(NAME pool_cores_test COMMAND pool_cores_test) + # the default CPU expert worker count on mock CPUs (8c/16t, 16c/32t, 64c/128t, 2-socket 128c/256t, ...) + add_executable(pool_plan_test src/kernels/cpu/pool_plan_test.cpp) + target_include_directories(pool_plan_test PRIVATE include) + add_test(NAME pool_plan_test COMMAND pool_plan_test) + # 0.2.2: when the pool splits per NUMA node by itself (a fake sysfs node folder, mock cores; STRATA_NUMA_POOL=0, one node = unchanged) + add_executable(numa_pool_test src/kernels/cpu/numa_pool_test.cpp) + target_include_directories(numa_pool_test PRIVATE include) + target_compile_features(numa_pool_test PRIVATE cxx_std_17) + add_test(NAME numa_pool_test COMMAND numa_pool_test) + # #3204: when the HIP start-up warm-up of hipBLAS may run (pure policy, no GPU) + add_executable(warm_policy_test src/prefill/warm_policy_test.cpp) + target_include_directories(warm_policy_test PRIVATE include) + add_test(NAME warm_policy_test COMMAND warm_policy_test) # issue #29: tiny batches with sleeping workers, as on a big-VRAM card; a hang fails it add_executable(pool_stress src/kernels/cpu/pool_stress.cpp) target_link_libraries(pool_stress PRIVATE strata_kernels_cpu) add_test(NAME pool_stress COMMAND pool_stress 20) + # #795: nothing an AVX2-only CPU can reach may hold AVX-512 / AVX-VNNI-class instructions. (1) the linked test binary + # (every CPU kernel file plus ggml-cpu; on Linux, the kernel library) is disassembled and any function with such instructions must be a kernel of + # a wide-ISA file, not a weak / COMDAT copy and not a probe or helper that every CPU runs; (2) with -DSTRATA_SDE= + # (Intel SDE) the CPU tests run on an emulated AVX2-only Haswell and on an Alder Lake (AVX-VNNI, no AVX-512): SDE stops + # at the first instruction the chip does not have. + if(TARGET iq_avx2_parity) + find_package(Python3 QUIET COMPONENTS Interpreter) + if(Python3_Interpreter_FOUND) + if(MSVC) + target_link_options(iq_avx2_parity PRIVATE /MAP) + add_test(NAME isa_guard_check COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/check_isa_guard.py + $ --map $/iq_avx2_parity.map) + else() + # the library, not the binary: a Linux source build compiles ggml-cpu for the build machine on purpose + add_test(NAME isa_guard_check COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/check_isa_guard.py + $) + endif() + set_tests_properties(isa_guard_check PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 600) + endif() + endif() + set(STRATA_SDE "" CACHE FILEPATH "Intel SDE (sde / sde64): also run the CPU tests on an emulated AVX2-only and an AVX-VNNI-only CPU") + if(STRATA_SDE AND TARGET iq_avx2_parity) + foreach(_chip hsw adl) + foreach(_t iq_avx2_parity q8k_quant_parity router_dot_parity pool_tasks_test q2_bitplane_parity) + if(TARGET ${_t}) + add_test(NAME sde_${_chip}_${_t} COMMAND ${STRATA_SDE} -${_chip} -- $) + set_tests_properties(sde_${_chip}_${_t} PROPERTIES TIMEOUT 900) + endif() + endforeach() + if(TARGET q2_bitplane_parity) + set_tests_properties(sde_${_chip}_q2_bitplane_parity PROPERTIES ENVIRONMENT "STRATA_Q2_BITPLANE=1") + endif() + endforeach() + endif() + if(UNIX AND NOT APPLE) add_executable(direct_file_async_test tests/platform/direct_file_async.cpp src/platform/direct_file.cpp) target_include_directories(direct_file_async_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) target_link_libraries(direct_file_async_test PRIVATE Threads::Threads) add_test(NAME direct_file_async_test COMMAND direct_file_async_test) endif() + # --aux-cpus: the CPU-set derivation (pure) and the placement of live threads; header-only, no GPU + add_executable(aux_cpus_test tests/platform/aux_cpus_test.cpp) + target_include_directories(aux_cpus_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) + target_link_libraries(aux_cpus_test PRIVATE Threads::Threads) + add_test(NAME aux_cpus_test COMMAND aux_cpus_test) endif() if(STRATA_BUILD_TESTS) @@ -1108,3 +2438,53 @@ if(STRATA_BUILD_TESTS) add_subdirectory(tests) endif() endif() + +# ---- HIP gfx906: every CUDA source of the tree (and the ggml-cuda MMQ sources) is compiled as HIP ---- +if(STRATA_HIP_GFX906) + file(GLOB_RECURSE _strata_cu CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cu ${CMAKE_CURRENT_SOURCE_DIR}/bench/micro/*.cu + ${CMAKE_CURRENT_SOURCE_DIR}/tools/vision/*.cu) + if(_strata_mmq) + file(GLOB _strata_mmq_cu ${_strata_mmq}/*.cu ${_strata_mmq}/template-instances/*.cu) + list(APPEND _strata_cu ${_strata_mmq_cu}) + target_compile_definitions(strata_mmq PRIVATE GGML_USE_HIP) + # #3172: strata_mmq_w4a4 is built from llama.cpp's headers too; without GGML_USE_HIP its common.cuh took the CUDA vendor header + # (cuda.h, cuda_bf16.h: not found). Here it only reports that W4A4 (RTX 50's FP4 MMA) is not available. + if(TARGET strata_mmq_w4a4) + target_compile_definitions(strata_mmq_w4a4 PRIVATE GGML_USE_HIP) + endif() + # #3271: three more link errors of a 0.1.44+ gfx906 build, all sources that strata_mmq lists but the glob above never saw: + # the trellis overlay's quantize.cu and instances (they are generated into the build tree, so the glob missed them: CMake drops a + # .cu source whose language is not enabled) and moe_f16_kq.cu, which moe_fused_iq.cu calls (a stub here: no gfx11 device code, so + # f16kq::covers() answers false and the int8 kernels run, as on every other card) + if(_strata_mmq_tq_overlay) + set(_strata_tq_hip ${_strata_tq_overlay_dir}/quantize.cu) + foreach(_t tq2_t tqk6 tqk7) + list(APPEND _strata_tq_hip ${_strata_tq_overlay_dir}/template-instances/mmq-instance-${_t}.cu) + endforeach() + list(APPEND _strata_cu ${_strata_tq_hip}) + endif() + target_sources(strata_mmq PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/prefill/moe_f16_kq.cu) + endif() + set_source_files_properties(${_strata_cu} PROPERTIES LANGUAGE HIP) +endif() + +if(STRATA_HIP_GFX906) + add_executable(gfx906_qsa_query_swizzle_probe bench/gfx906_qsa_query_swizzle_probe.cpp) + target_link_libraries(gfx906_qsa_query_swizzle_probe PRIVATE strata_kernels ${_strata_gpu_runtime_target}) +endif() + +# ---- DeepSeek-V4.1 on a box with no GPU toolkit ------------------------------------------------ +# The whole DSV41 block above lives inside if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP), so with neither backend on +# -DSTRATA_BUILD_DSV41=ON was silently unused and the host-side benchmark could not be built at all (found on p1004, +# 2026-10-23: the CPU lane is exactly what a box without a usable GPU needs to measure). This branch builds the one target +# that has no device code, so the CPU-lane A/B runs anywhere. +if(STRATA_BUILD_DSV41 AND NOT STRATA_ENABLE_CUDA AND NOT STRATA_ENABLE_HIP AND NOT STRATA_HIP_GFX906) + message(STATUS "STRATA_BUILD_DSV41: no GPU backend, building the host-side benchmark only (ds4_gg_bench)") + if(STRATA_NATIVE_EXPERTS) + add_executable(ds4_gg_bench tests/dsv41/gg_dot_bench.cpp src/dsv41/ds4_gg_cpu.cpp) + target_include_directories(ds4_gg_bench PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src/dsv41 + ${CMAKE_CURRENT_SOURCE_DIR}/third_party/ggml) + target_link_libraries(ds4_gg_bench PRIVATE strata_kernels_cpu Threads::Threads) + target_compile_definitions(ds4_gg_bench PRIVATE STRATA_DSV41_TQ_CPU=1) + endif() +endif() diff --git a/engine/strata/CONTRIBUTING.md b/engine/strata/CONTRIBUTING.md new file mode 100644 index 00000000..4efd7dd6 --- /dev/null +++ b/engine/strata/CONTRIBUTING.md @@ -0,0 +1,122 @@ +# Contributing to Strata + +**AI assistance is welcome. The contributor is responsible for understanding the change and supplying real evidence.** + +These rules apply to issues, pull requests, benchmark reports, and the agents helping prepare them. +You should be able to explain every changed line and answer review questions about it. + +## Before starting + +1. Search [issues](https://github.com/Niko1221/Strata/issues) and + [pull requests](https://github.com/Niko1221/Strata/pulls), including closed discussions. Add new evidence to an + existing thread when it covers your problem. +2. Read [AGENTS.md](AGENTS.md) and the documentation for the component you want to change. +3. Get maintainer agreement on scope before substantial features, refactors, architecture changes, or changes to + defaults. Describe the user problem, proposed behavior, and tradeoffs in an issue first. Agreement on scope + does not guarantee a merge. Focused fixes and benchmark reports can go straight to a PR. +4. Keep one problem per PR. Update that PR after feedback; do not open competing attempts for the same change. + +Do not resubmit a declined proposal under a different title or through another agent. If new evidence changes +the situation, bring it to the original discussion and let a maintainer decide whether to reopen it. + +## Report a problem people can investigate + +Use the matching [issue form](https://github.com/Niko1221/Strata/issues/new/choose). A bug report should include: + +- The smallest steps or command that reproduce the problem, and the expected and actual behavior. +- Strata version or commit, OS, GPU and VRAM, and relevant model, quantization, and configuration. +- The exact error and relevant logs, with credentials and private content removed. +- Whether you reproduced it yourself. Label a finding based only on reading code or a scanner as + **unconfirmed static analysis**, and explain the suspected path without presenting it as an observed failure. + +Do not invent reproduction steps, errors, affected hardware, or severity. If you cannot reproduce something, +say what you inspected and what would verify the hypothesis. Feature requests should explain a concrete user +need and the current workaround. Questions should say what you tried and where you got stuck. + +Example structure, with placeholders to replace with actual observations: + +```text +Problem: +Environment: +Reproduce: +Expected: +Actual: +Evidence: +Reproduction status: +``` + +## Titles + +Every issue and pull request title starts with its area in square brackets, then a short description: `[Engine]`, `[GUI]`, `[TUI]`, +`[Benchmark]`, `[Docs]` or `[Other]`. For example `[Engine] fix decode stop on long prompts` or `[GUI] keep the model list after a tab +switch`. The issue forms ask for the area and a check on the title fails when the prefix is missing. + +## Prepare a focused pull request + +Lead with the problem and resulting behavior. Explain why the approach is needed, the important limits, and +any compatibility effects. Link the issue and scope agreement when applicable. A file-by-file narration or +an AI-generated summary of the diff is not a substitute for this explanation. + +- Keep unrelated formatting, cleanup, dependency changes, and speculative abstractions out of the PR. +- Add documentation where it changes what a user or developer needs to know. Avoid repeated summaries, + speculative roadmaps, and generated documentation with no actionable information. +- Preserve existing behavior outside the intended change. New features are opt-in; follow the default-path + and performance requirements in [AGENTS.md](AGENTS.md). +- Read the complete diff, including generated files, before submitting. Remove debugging output, secrets, + private paths, and accidental files. +- Prefer a small relevant regression check over tests that only restate the implementation. Documentation-only + changes need link, example, and consistency checks; they do not require GPU builds. + +## Show the validation you actually performed + +List exact commands, the revision and environment tested, and observed outcomes. Keep **passed**, **failed**, +and **not run** separate. Include relevant output or a log attachment. A command you suggest running is not +evidence that it passed; a CI run on a different revision is not validation of the submitted code. + +Build every backend a code change touches, including CUDA, HIP, and SYCL where applicable, before requesting +review. For changes that need hardware execution, report that execution separately from compilation. A mock, +static check, or successful build does not establish hardware correctness. If you lack a required environment, +keep the PR as a draft, identify the missing checks, and ask for targeted help in the same thread. Do not claim +compatibility you have not tested. + +Performance claims need before/after runs on the same hardware and workload, with every changed setting +identified. Preserve the individual runs, failures, and variability. Follow the +[community measurement guide](docs/COMMUNITY_BENCHMARKS.md); standard submissions will use the +[benchmark protocol](docs/BENCHMARK_PROTOCOL.md) once it is activated. One fast run does not justify changing a +default or claiming a speedup for other machines. + +Example PR body; placeholders are not test results: + +```text +Problem and result: +Related discussion: +Approach: +Validation: + Passed: + Failed: + Not run: +Limits: +``` + +## Rules for AI-assisted work + +Use agents to help investigate, implement, and explain work that you can review. Before submitting, verify +their claims against the source, actual command output, or a cited primary reference. + +Never submit fabricated measurements, invented test results, fake logs, or copied claims you have not checked. +Do not turn a repository scan into a batch of speculative issues or PRs. Consolidate related findings, establish +their effect, and submit the useful evidence. Do not present an agent's confidence or another model's approval +as validation. Keep review replies concise and address the requested change or evidence directly. + +Maintainers may request a smaller change, return a PR to draft, or close a submission that lacks evidence, +duplicates existing work, or ignores agreed scope. A smaller, understandable contribution with honest limits +is easier to review and maintain. + +## Share a benchmark + +A results-only PR should contain the human report, raw measurements, sanitized configuration, and supporting +logs. Keep it separate from engine changes and include poor results and failed requests. + +The [current community benchmark guide](docs/COMMUNITY_BENCHMARKS.md) remains available for measurements made +with today's tools. The [new protocol](docs/BENCHMARK_PROTOCOL.md) defines the draft standard and future approval +workflow. Its draft status must remain visible: existing reports are not automatically standard or approved. diff --git a/engine/strata/Dockerfile b/engine/strata/Dockerfile index 6b62dae0..82f096cf 100644 --- a/engine/strata/Dockerfile +++ b/engine/strata/Dockerfile @@ -1,115 +1,110 @@ -# syntax=docker/dockerfile:1 +# Strata, built FROM SOURCE (NVIDIA CUDA 13). The engine is compiled here, packaged as an engine component package and then +# installed into the same runtime image as the ready-made ones (docker/Dockerfile): same Terminal, same entrypoint, same /data volume. # -# Strata: Qwen3.8-Flash-Next on NVIDIA GPUs (RTX 30/40/50, 12+ GB VRAM; two or -# three cards can share one model, 8 GB each - docs/MULTI_GPU.md). +# Most people want the ready-made images instead (nothing compiled): docs/DOCKER.md. # -# The engine is compiled during docker build, so the first container start only -# downloads the model (~70 GB) and starts the server. docker build has no GPU, -# so the CUDA architectures are fixed here instead of read from nvidia-smi: the -# engine is a fat binary with a cubin per listed arch, and the runtime picks the -# one matching your card. Narrow CUDA_ARCHITECTURES to your card for a faster -# build; a card outside the set needs a rebuild with its own arch. +# docker build -t strata:src . # RTX 20/30/40/50 (compiles for each, ~25 min) +# docker build -t strata:src --build-arg CUDA_ARCHITECTURES=86 . # one card only (faster); 86 = RTX 30, 89 = RTX 40, 120 = RTX 50 +# docker build -t strata:src-cuda12 --build-arg CUDA_IMAGE=nvidia/cuda:12.9.1-devel-ubuntu24.04 \ +# --build-arg CUDA_ARCHITECTURES="60;61;70;75;80;86;89" --build-arg BUILD_VISION=0 . # GTX 10 / P100 / V100 (driver 575+) +# docker run --rm --gpus all -p 127.0.0.1:8080:8080 --ulimit memlock=-1 --shm-size 2g --stop-timeout 120 \ +# -v strata-data:/data -e MODEL=IQ3_XXS -e API_KEY=change-me-please-123 strata:src # -# Build: -# docker build -t strata . -# docker build -t strata --build-arg CUDA_ARCHITECTURES=89 . # RTX 40 only +# docker build has no GPU, so the CUDA architectures are given here instead of read from nvidia-smi. The engine is a fat binary with +# a machine-code part per listed architecture (plus PTX for the newest, which later cards can JIT), and the runtime picks the one +# matching your card. Narrow CUDA_ARCHITECTURES to your card for a faster build. Native code for the CPU that builds the image is NOT +# used (STRATA_PORTABLE=ON), so the image runs on any x86-64 CPU with AVX2. # -# Run (host needs an NVIDIA driver >= 580 and nvidia-container-toolkit): -# docker run --rm --gpus all \ -# -p 8080:8080 \ -# --ulimit memlock=-1 \ -# -v strata-data:/data \ -# -e MODEL=IQ2_XS \ -# strata -# -# Setup choices are env vars, read by docker-entrypoint.sh: FAMILY, MODEL, CONTEXT, -# VISION (no | yes | cpu), KV (int8 | q4_0 | k8v4), GPU (one card) or GPUS ("0,2" -# or "all", with LAYER_SPLIT), LOW_RAM (auto | on | off), HOST, PORT, API_KEY. -# -# Only the model files, the prepared pack, the MTP layer and the install config -# live in the /data volume; the engine is part of the image. Strata loads 32-62 GB -# into RAM, so a capped container needs -e LOW_RAM=on: setup.py reads the RAM from -# /proc/meminfo, which here is the host's total, not the container's limit. Add an -# API key before exposing the port to a network: -e API_KEY=. Pass -# -e REINSTALL=1 to change the model settings later. -# -# --gpus all on a host with two usable cards: setup takes both (the layer split is -# its recommended default). Pin one card with -e GPU=0, or name them with -# -e GPUS=0,2. A volume set up for one card switches to the pair on its first start -# on a two-card host unless GPU or GPUS pins it. LOW_RAM=on runs on one card. +# Plain legacy-builder features only (no heredocs, no --mount). AMD (HIP) and Intel (SYCL) source builds: docs/AMD_HIP.md, docs/INTEL.md. -FROM nvidia/cuda:13.0.0-devel-ubuntu24.04 - -# STRATA_EXECV=1: setup.py replaces itself with the server, so the server is PID 1 -# and docker stop's SIGTERM reaches it (see setup.start). Normal Linux starts, which -# don't set it, keep spawning the server as a child. -ENV DEBIAN_FRONTEND=noninteractive PYTHONUNBUFFERED=1 LANG=C.UTF-8 STRATA_EXECV=1 +ARG CUDA_IMAGE=nvidia/cuda:13.0.0-devel-ubuntu24.04 +ARG RUNTIME_BASE=ubuntu:24.04 +# ---- 1. compile the engine and make its component package +FROM ${CUDA_IMAGE} AS engine-build +ENV DEBIAN_FRONTEND=noninteractive PYTHONUNBUFFERED=1 PATH=/venv/bin:$PATH RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential ca-certificates curl git libatomic1 libgomp1 \ - python3 python3-pip python3-venv unzip \ + build-essential ca-certificates git libgomp1 libatomic1 python3 python3-pip python3-venv unzip \ && rm -rf /var/lib/apt/lists/* - -WORKDIR /opt/strata +WORKDIR /src COPY . . - -# RTX 20 (75), RTX 30 (86), RTX 40 (89), RTX 50 (120), plus 80 for A-series. CMakeLists -# refuses anything below 75. BUILD_VISION=0 skips the image encoder build. -ARG CUDA_ARCHITECTURES=75;80;86;89;120 +ARG CUDA_ARCHITECTURES="75;80;86;89;120" ARG BUILD_VISION=1 +ARG ENGINE_VERSION= +RUN python3 -m venv /venv && /venv/bin/pip install --no-cache-dir -r requirements.txt -r requirements-build.txt +# llama.cpp at the pinned commit (ggml for the engine, mtmd for pictures), exactly as setup.py fetches it +RUN /venv/bin/python -c "import setup; print(setup.get_llama_cpp())" +RUN set -e; \ + real=""; for a in $(echo "$CUDA_ARCHITECTURES" | tr ';,' ' '); do real="$real;${a}-real"; done; real=${real#;}; \ + last=$(echo "$CUDA_ARCHITECTURES" | tr ';,' ' ' | awk '{print $NF}'); \ + sm60=OFF; for a in $(echo "$CUDA_ARCHITECTURES" | tr ';,' ' '); do if [ "$a" -lt 75 ]; then sm60=ON; fi; done; \ + /venv/bin/cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_TESTS=OFF \ + -DSTRATA_EXPERIMENTAL_SM60=$sm60 \ + -DSTRATA_NATIVE_EXPERTS=ON -DSTRATA_PORTABLE=ON -DSTRATA_Q6K_EXPERTS=ON -DSTRATA_MMQ_KQUANTS=ON \ + "-DCMAKE_CUDA_ARCHITECTURES=${real};${last}-virtual" -DSTRATA_GGML_DIR=/src/third_party/llama.cpp; \ + /venv/bin/cmake --build build --target strata strata_kq -j "$(nproc)"; \ + if [ "$BUILD_VISION" = "1" ]; then \ + /venv/bin/cmake -G Ninja -S tools/vision -B build-vision -DCMAKE_BUILD_TYPE=Release -DLLAMA_DIR=/src/third_party/llama.cpp \ + -DSTRATA_VISION_CUDA=ON -DSTRATA_PORTABLE=ON -DGGML_CUDA_NCCL=OFF "-DCMAKE_CUDA_ARCHITECTURES=${real};${last}-virtual"; \ + /venv/bin/cmake --build build-vision --target strata-vision -j "$(nproc)"; \ + fi +RUN set -e; \ + mkdir -p /stage /engine; \ + cp build/strata /stage/; \ + [ -f build/libstrata_kq.so ] && cp build/libstrata_kq.so /stage/ || true; \ + [ -f build-vision/bin/strata-vision ] && cp build-vision/bin/strata-vision /stage/ || true; \ + ver="${ENGINE_VERSION:-$(sed -n 's/^[[:space:]]*project([^)]*VERSION[[:space:]]*\([0-9][0-9.]*\).*/\1/p' CMakeLists.txt | head -1)}"; \ + cudafull=$(nvcc --version | sed -n 's/.*release \([0-9][0-9]*\.[0-9][0-9]*\).*/\1/p' | head -1); cudamajor=${cudafull%%.*}; \ + if [ "$cudamajor" = 13 ]; then mindriver=580.65; else mindriver=575.51; fi; \ + vision_archs=""; [ -f /stage/strata-vision ] && vision_archs=", \"vision_archs\": \"$CUDA_ARCHITECTURES\""; \ + echo "{\"version\": \"$ver\", \"source\": \"docker build\", \"archs\": \"$CUDA_ARCHITECTURES\", \"cuda\": \"$cudafull\", \"portable\": true${vision_archs}}" > /stage/BUILD.json; \ + python3 packaging/collect_libs.py --binary build/strata --search /usr/local/cuda/lib64 --out /stage --also 'libcublasLt.so*'; \ + archs=""; for a in $(echo "$CUDA_ARCHITECTURES" | tr ';,' ' '); do archs="$archs --arch sm_$a"; done; \ + last=$(echo "$CUDA_ARCHITECTURES" | tr ';,' ' ' | awk '{print $NF}'); \ + python3 packaging/package_engine.py --src /stage --backend cuda --version "$ver" --out /engine $archs --arch "compute_$last" \ + --min-driver nvidia=$mindriver --variant cuda$cudamajor --platform linux-x86_64 --build-id "docker-source-${ver}-cuda${cudafull}" --include SYSTEM-LIBS.txt --include 'libstrata_kq*' \ + --include strata-vision; \ + for d in /engine/*/; do python3 packaging/package_engine.py --verify "$d"; python3 packaging/binary_deps.py "$d"; done -RUN python3 -m venv .venv \ - && .venv/bin/pip install --no-cache-dir --upgrade pip \ - && .venv/bin/pip install --no-cache-dir -r requirements.txt \ - && chmod +x setup.sh docker-entrypoint.sh - -# llama.cpp at the pinned commit, then the engine and the image encoder, built -# exactly the way setup.py builds them. BUILD.json is what setup.py reads to -# decide whether an engine is current: source=local with a matching src hash -# means the first start reuses it instead of recompiling. -RUN .venv/bin/python - <<'PYEOF' -import json, os, pathlib, shutil -import setup - -llama = setup.get_llama_cpp() -nvcc, _ = setup.find_nvcc() -arch = os.environ.get("CUDA_ARCHITECTURES", "75;80;86;89;120").strip().strip('"').replace(",", ";") -vision = "gpu" if os.environ.get("BUILD_VISION", "1") == "1" else "none" - -setup.cmake_build(setup.ROOT, setup.ROOT / "build", "strata", - ["-DSTRATA_ENABLE_CUDA=ON", "-DSTRATA_BUILD_TESTS=OFF", - f"-DCMAKE_CUDA_ARCHITECTURES={arch}", f"-DCMAKE_CUDA_COMPILER={nvcc}", - f"-DSTRATA_GGML_DIR={llama}"], None, "build-strata.bat") -if vision != "none": - setup.cmake_build(setup.ROOT / "tools" / "vision", setup.ROOT / "build-vision", "strata-vision", - [f"-DLLAMA_DIR={llama}", "-DSTRATA_VISION_CUDA=ON", - f"-DCMAKE_CUDA_ARCHITECTURES={arch}", f"-DCMAKE_CUDA_COMPILER={nvcc}"], None, "build-vision.bat") - -eng = setup.ROOT / "engine" -eng.mkdir(exist_ok=True) -shutil.copy2(setup.ROOT / "build" / setup.EXE, eng / setup.EXE) -if vision != "none": - shutil.copy2(setup.ROOT / "build-vision" / "bin" / setup.VEXE, eng / setup.VEXE) -bindir = pathlib.Path(nvcc).parent -meta = {"source": "local", "version": setup.source_version(), - "archs": [int(a.split("-")[0]) for a in arch.split(";") if a.split("-")[0].isdigit()], "vision": vision, - "cuda_dirs": [str(d) for d in (bindir, bindir / "x64", bindir.parent / "lib64") if d.is_dir()], - "src": setup.source_hash(setup.ENGINE_SOURCES), - "vision_src": setup.source_hash(setup.VISION_SOURCES) if vision != "none" else None} -(eng / "BUILD.json").write_text(json.dumps(meta, indent=1)) -PYEOF - -# the cmake trees are build-time only; the engine itself is what the container needs -RUN rm -rf build build-vision +# ---- 2. the Terminal (the release archive, built here) +FROM ${RUNTIME_BASE} AS terminal +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y --no-install-recommends python3 ca-certificates git && rm -rf /var/lib/apt/lists/* +COPY . /src/ +RUN python3 /src/packaging/package_terminal.py --out /out --cache /cache \ + && mkdir -p /opt/strata \ + && tar -xzf /out/strata-terminal-*-linux-x86_64.tar.gz -C /opt/strata \ + && mv /opt/strata/strata-terminal-* /opt/strata/terminal \ + && /opt/strata/terminal/bin/strata --version +# llama.cpp at the commit setup.py pins: fetched here, so the first start does not depend on GitHub. Only gguf-py (the model preparation +# tools) and the file setup.py looks for (ggml/CMakeLists.txt) are kept: 170 MB become a few +RUN cd /opt/strata/terminal && STRATA_CONTROL_INSTALL=1 STRATA_INSTALL_DIR=/opt/strata/seed PYTHONNOUSERSITE=1 \ + /opt/strata/terminal/python/bin/python3 -c "import setup; print(setup.get_llama_cpp())" \ + && rm -rf /opt/strata/seed/third_party/*.zip* \ + && cd /opt/strata/seed/third_party/llama.cpp \ + && find . -mindepth 1 -maxdepth 1 ! -name gguf-py ! -name ggml ! -name 'LICENSE*' -exec rm -rf {} + \ + && find ggml -mindepth 1 -depth ! -type d ! -name CMakeLists.txt -delete && find ggml -mindepth 1 -type d -empty -delete \ + && du -sh /opt/strata/seed +# ---- 3. the runtime image (the same as docker/Dockerfile's, FLAVOR=cuda) +FROM ${RUNTIME_BASE} +ARG STRATA_VERSION=dev +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y --no-install-recommends tini ca-certificates libgomp1 libatomic1 libnuma1 zlib1g \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/* +COPY --from=terminal /opt/strata/terminal /opt/strata/terminal +COPY --from=terminal /opt/strata/seed /opt/strata/seed +COPY --from=engine-build /engine/ /opt/strata/components/engine/ +COPY docker/entrypoint.sh docker/healthcheck.sh /opt/strata/ +COPY docker/strata-wrapper.sh /usr/local/bin/strata +RUN chmod 0755 /opt/strata/entrypoint.sh /opt/strata/healthcheck.sh /usr/local/bin/strata +ENV STRATA_COMPONENTS_DIR=/opt/strata/components STRATA_INSTALL_DIR=/data/install XDG_STATE_HOME=/data/state \ + XDG_CONFIG_HOME=/data/config HOME=/data/home PORT=8080 LANG=C.UTF-8 PYTHONUNBUFFERED=1 PYTHONNOUSERSITE=1 STRATA_IN_DOCKER=1 \ + NVIDIA_VISIBLE_DEVICES=all NVIDIA_DRIVER_CAPABILITIES=compute,utility VOLUME ["/data"] EXPOSE 8080 - -# /health is answered before the API key gate, so it works with or without one. -# The port only opens after the model loads (1-3 minutes, longer on a first run), -# so the start period is generous: a too short one marks a still-loading container -# unhealthy and a restart policy would kill it mid-download. -HEALTHCHECK --interval=30s --timeout=5s --start-period=600s --retries=3 \ - CMD curl -fs "http://127.0.0.1:${PORT:-8080}/health" || exit 1 - -ENTRYPOINT ["./docker-entrypoint.sh"] +LABEL org.opencontainers.image.title="Strata" com.strata.flavor="cuda" com.strata.build="from-source" org.opencontainers.image.version="${STRATA_VERSION}" +HEALTHCHECK --interval=30s --timeout=8s --start-period=2h --retries=3 CMD ["/opt/strata/healthcheck.sh"] +STOPSIGNAL SIGTERM +ENTRYPOINT ["/usr/bin/tini", "--", "/opt/strata/entrypoint.sh"] +CMD ["run"] diff --git a/engine/strata/README.de.md b/engine/strata/README.de.md new file mode 100644 index 00000000..070c03f3 --- /dev/null +++ b/engine/strata/README.de.md @@ -0,0 +1,188 @@ +

+ + + Strata + +

+ +

Leistungsstarke KI auf deinem eigenen Computer.

+

Chatten, programmieren und mit Bildern arbeiten, lokal.

+ +

+ Modelle · Installation · + Hardware · Tools · + Hilfe · Unterstützen +

+ +

+ Strata herunterladen + MIT-Lizenz + Strata auf Buy Me a Coffee unterstützen +

+ +

English · 简体中文 · 日本語 · Deutsch · Français · Español · Português

+ +**Kostenlos, Open Source und ganz in deiner Hand.** Nutze Strata auf dem Desktop oder mit deinen liebsten Coding-Tools. Kein Konto nötig. + +## Modelle + +Wir empfehlen **zuerst ISTA-DASLab**, danach **Unsloth** und andere Anbieter, soweit ein passendes Modell in deinen Speicher passt. + +
+  Qwen3.8-Flash-Next + +| Anbieter | Auswahl | +| --- | --- | +| **ISTA-DASLab · empfohlen** | Q2\_0, IQ2\_XS, IQ3\_XXS, IQ3\_S. [Coder: IQ1\_M](docs/MODELS.md#coder) zum Programmieren. | +| **Unsloth** | UD-IQ4\_XS, UD-Q4\_K\_XL, UD-Q5\_K\_XL, UD-Q6\_K\_XL, Q8\_0 | +| **Gyro · agentionai** | [Gyro-S, Gyro-M](https://huggingface.co/agentionai/Qwen3.8-Flash-Next-Gyro-GGUF). Geringerer Speicherbedarf, aber langsamer. | +| **Weitere Optionen** | [Swift 1.5](docs/MODELS.md#swift-15), [NVFP4](docs/NVFP4.md), [OrcaRouter](docs/ORCA.md) | + +[Größen, Speicherbedarf und Kompatibilität vergleichen](docs/MODELS.md). + +
+ +
+  Qwen3.6-35B-A3B + +**Unsloth:** UD-Q4_K_XL, UD-Q6_K_XL, Q8_0. Das sind die derzeit dokumentierten Pakete für dieses Modell. + +[Modellanleitung und Kompatibilität](docs/QWEN36.md). + +
+ +
+  DeepSeekV4.1-Flash-1017 + +In der **Desktop-App** und im **Terminal**. Was nicht in den Arbeitsspeicher passt, wird von deiner SSD gelesen. Darum brauchst du viel freien Speicherplatz. + +| Set (IST-DAS) | Download | Freier Speicherplatz nötig | +| --- | ---: | ---: | +| 1.75 bpw | 239 GB | etwa 245 GB | +| 2.00 bpw | 257 GB | etwa 265 GB | +| 2.25 bpw | 274 GB | etwa 280 GB | + +Läuft auf NVIDIA RTX 30, 40 und 50 (Windows und Linux) und auf AMD Radeon AI PRO R9700 (Linux). Das Setup lädt die Dateien und die DeepSeek-Engine herunter und startet dann das Modell. + +```sh +strata launch --family deepseek41 --model ist-das-2.00bpw --plan +``` + +Gemessen mit dem 2.00-bpw-Set auf Strata 0.2.5. „Ausgabe“ ist das Tempo der Antwort, „Prompt“ zeigt, wie schnell Strata deine Eingabe liest. + +| Hardware | Ausgabe | Prompt | +| --- | ---: | ---: | +| RTX 5070 12 GB, 64 GB RAM | 4 bis 6 Token/s | etwa 110 Token/s (4K) | +| RTX 3060 12 GB, 46 GB RAM | 9 bis 11 Token/s | etwa 155 Token/s (4K) | +| 1x Radeon AI PRO R9700, 251 GB RAM | 21 bis 25 Token/s | 320 bis 360 Token/s (8K) | +| 4x Radeon AI PRO R9700 | 74 bis 77 Token/s | 400 bis 450 Token/s (8K) | + +[Speicher, Festplatte und Details](docs/DEEPSEEK41.md) · [Versionshinweise](https://github.com/Niko1221/Strata/releases) + +
+ + + +Unsicher, was passt? [Wähle ein Modell für deinen Computer](docs/MODELS.md#pick-by-memory). + +## Installation + + + +### Desktop-App + +**[Strata für Windows, Linux oder Mac herunterladen →](https://github.com/Niko1221/Strata/releases/latest)** + +Installiere die App, wähle ein Modell und leg mit dem Chat los. Es gibt einen Installer pro System. Beim ersten Start lädt die App die Engine für deine Grafikkarte herunter. [Hilfe zum Installer](docs/INSTALL.md#the-app). + +Dateien: `Strata-0.2.5-windows-x64-setup.exe` · `Strata-0.2.5-linux-x86_64.AppImage` · `Strata-0.2.5-macos-arm64.dmg` + +

+ Strata-Desktop-App mit Chat und Live-Codevorschau nebeneinander +
Chat, Dateien und Live-Vorschau in einem Fenster. +

+ + + +### Terminal-App + +Lieber im Terminal? Installiere Strata und starte dann **`strata launch`**. + +
+Installationsbefehle + +**Linux / Mac** + +```sh +curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh +``` + +**Windows PowerShell** + +```powershell +irm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex +``` + +Öffne unter Windows danach ein neues Terminal. Dann: + +```sh +strata launch +``` + +Folge den Anweisungen, um ein Modell herunterzuladen und zu starten. [Terminal-Anleitung](docs/TERMINAL_LAUNCH.md). + +
+ +

+ Strata-Terminal-App mit Modellaktivität, Tempo, Speicher und letzten Anfragen +
Behalte Modell und Hardware im Blick, während es läuft. +

+ + + +[Aus dem Quellcode bauen](docs/SOURCE_INSTALL.md) · [Docker](docs/DOCKER.md) · [Vollständige Installationsanleitung](docs/INSTALL.md) + + + +## Hardware + +| Unterstützte Hardware | Anleitung | +| --- | --- | +| **NVIDIA GeForce RTX 20 / 30 / 40 / 50** | [NVIDIA-Setup](docs/INSTALL.md#what-you-need) | +| **AMD Radeon RX 7700 / 7800 / 7900, RX 9060 / 9070, AI PRO R9700** | [AMD-Setup](docs/AMD_HIP.md) | +| **AMD Radeon RX 6800 / 6900 · experimentell** | [RX-6000-Setup](docs/AMD_HIP.md#rdna2-gfx1030) | +| **Intel Arc · Linux** | [Intel-Setup](docs/INTEL_ARC.md) | +| **Apple Silicon · M1 oder neuer** | [Mac-Setup](docs/MAC.md) | +| **AMD Ryzen AI Max · Strix Halo** | [Strix-Halo-Setup](docs/STRIX_HALO.md) | + + + +## Tools + +**Claude Code · Codex CLI · OpenCode · oh-my-pi · pi.dev · Hermes Agent · OpenClaw**, und weitere über die OpenAI- und Anthropic-kompatiblen APIs. + +Führe **`strata connect`** aus, um die Einrichtung für dein Tool zu sehen. [Verbindungsanleitung](docs/TERMINAL_LAUNCH.md#connect-your-apps-strata-connect). + + + + + + +## Hilfe + +[Alle Anleitungen](docs) · [Fehlerbehebung](docs/TROUBLESHOOTING.md) · [Fehler melden](https://github.com/Niko1221/Strata/issues/new/choose) · +[Benchmarks](docs/COMMUNITY_BENCHMARKS.md) · [So funktioniert es](docs/HOW_IT_WORKS.md) · [Mitmachen](CONTRIBUTING.md) + +## Strata unterstützen + +**Hilf mit, lokale KI für alle offen zu halten.** Ein Kaffee hilft, Entwicklung und Tests auf mehr Hardware zu finanzieren. + +Buy Me a Coffee: Strata unterstützen + +[MIT-Lizenz](LICENSE) · [Danksagung und Modelllizenzen](docs/HOW_IT_WORKS.md#credits) · [Datenschutz](docs/SAFETY.md) + + + +Für KI-Tools und automatische Leser: technische Referenz · Setup-Anleitung. + +**Sponsoring, Hardware-Partnerschaften oder Zusammenarbeit:** [niko.veit@outlook.com](mailto:niko.veit@outlook.com). diff --git a/engine/strata/README.es.md b/engine/strata/README.es.md new file mode 100644 index 00000000..e9efd723 --- /dev/null +++ b/engine/strata/README.es.md @@ -0,0 +1,188 @@ +

+ + + Strata + +

+ +

IA potente en tu propio ordenador.

+

Chatea, programa y trabaja con imágenes, en local.

+ +

+ Modelos · Instalación · + Hardware · Herramientas · + Ayuda · Apoyar +

+ +

+ Descargar Strata + Licencia MIT + Apoya Strata en Buy Me a Coffee +

+ +

English · 简体中文 · 日本語 · Deutsch · Français · Español · Português

+ +**Gratis, de código abierto y tuyo para ejecutar.** Usa Strata en tu escritorio o con tus herramientas de programación favoritas. No necesitas cuenta. + +## Modelos + +Recomendamos **primero ISTA-DASLab**, después **Unsloth** y otros proveedores, siempre que haya un modelo compatible que quepa en tu memoria. + +
+  Qwen3.8-Flash-Next + +| Proveedor | Opciones | +| --- | --- | +| **ISTA-DASLab · recomendado** | Q2\_0, IQ2\_XS, IQ3\_XXS, IQ3\_S. [Coder: IQ1\_M](docs/MODELS.md#coder) para programar. | +| **Unsloth** | UD-IQ4\_XS, UD-Q4\_K\_XL, UD-Q5\_K\_XL, UD-Q6\_K\_XL, Q8\_0 | +| **Gyro · agentionai** | [Gyro-S, Gyro-M](https://huggingface.co/agentionai/Qwen3.8-Flash-Next-Gyro-GGUF). Usa menos memoria, pero es más lento. | +| **Otras opciones** | [Swift 1.5](docs/MODELS.md#swift-15), [NVFP4](docs/NVFP4.md), [OrcaRouter](docs/ORCA.md) | + +[Compara tamaños, necesidades de memoria y compatibilidad](docs/MODELS.md). + +
+ +
+  Qwen3.6-35B-A3B + +**Unsloth:** UD-Q4_K_XL, UD-Q6_K_XL, Q8_0. Son los paquetes documentados actualmente para este modelo. + +[Guía del modelo y compatibilidad](docs/QWEN36.md). + +
+ +
+  DeepSeekV4.1-Flash-1017 + +En la **aplicación de escritorio** y en el **Terminal**. Lo que no cabe en la memoria se lee desde tu SSD, así que hace falta mucho espacio libre en disco. + +| Conjunto (IST-DAS) | Descarga | Espacio libre necesario | +| --- | ---: | ---: | +| 1.75 bpw | 239 GB | unos 245 GB | +| 2.00 bpw | 257 GB | unos 265 GB | +| 2.25 bpw | 274 GB | unos 280 GB | + +Funciona en NVIDIA RTX 30, 40 y 50 (Windows y Linux) y en AMD Radeon AI PRO R9700 (Linux). La instalación descarga los archivos y el motor de DeepSeek, y después inicia el modelo. + +```sh +strata launch --family deepseek41 --model ist-das-2.00bpw --plan +``` + +Medido con el conjunto de 2.00 bpw en Strata 0.2.5. «Salida» es la velocidad de la respuesta; «Prompt» es la rapidez con la que Strata lee tu texto. + +| Hardware | Salida | Prompt | +| --- | ---: | ---: | +| RTX 5070 12 GB, 64 GB de RAM | 4 a 6 tokens/s | unos 110 tokens/s (4K) | +| RTX 3060 12 GB, 46 GB de RAM | 9 a 11 tokens/s | unos 155 tokens/s (4K) | +| 1x Radeon AI PRO R9700, 251 GB de RAM | 21 a 25 tokens/s | 320 a 360 tokens/s (8K) | +| 4x Radeon AI PRO R9700 | 74 a 77 tokens/s | 400 a 450 tokens/s (8K) | + +[Memoria, disco y detalles](docs/DEEPSEEK41.md) · [Notas de la versión](https://github.com/Niko1221/Strata/releases) + +
+ + + +¿No sabes qué cabe? [Elige un modelo para tu ordenador](docs/MODELS.md#pick-by-memory). + +## Instalación + + + +### Aplicación de escritorio + +**[Descargar Strata para Windows, Linux o Mac →](https://github.com/Niko1221/Strata/releases/latest)** + +Instala la aplicación, elige un modelo y empieza a chatear. Hay un instalador por sistema. En el primer arranque, la aplicación descarga el motor para tu tarjeta gráfica. [Ayuda con el instalador](docs/INSTALL.md#the-app). + +Archivos: `Strata-0.2.5-windows-x64-setup.exe` · `Strata-0.2.5-linux-x86_64.AppImage` · `Strata-0.2.5-macos-arm64.dmg` + +

+ Aplicación de escritorio de Strata con un chat y una vista previa del código en vivo, una junto a otra +
Chat, archivos y vista previa en vivo en una sola ventana. +

+ + + +### Aplicación de Terminal + +¿Prefieres la terminal? Instala Strata y ejecuta **`strata launch`**. + +
+Comandos de instalación + +**Linux / Mac** + +```sh +curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh +``` + +**Windows PowerShell** + +```powershell +irm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex +``` + +En Windows, abre una terminal nueva después. Luego: + +```sh +strata launch +``` + +Sigue las indicaciones para descargar e iniciar un modelo. [Guía del Terminal](docs/TERMINAL_LAUNCH.md). + +
+ +

+ Aplicación de Terminal de Strata con la actividad del modelo, la velocidad, la memoria y las peticiones recientes +
Observa tu modelo y tu hardware mientras se ejecuta. +

+ + + +[Compilar desde el código fuente](docs/SOURCE_INSTALL.md) · [Docker](docs/DOCKER.md) · [Guía de instalación completa](docs/INSTALL.md) + + + +## Hardware + +| Hardware compatible | Guía | +| --- | --- | +| **NVIDIA GeForce RTX 20 / 30 / 40 / 50** | [Instalación en NVIDIA](docs/INSTALL.md#what-you-need) | +| **AMD Radeon RX 7700 / 7800 / 7900, RX 9060 / 9070, AI PRO R9700** | [Instalación en AMD](docs/AMD_HIP.md) | +| **AMD Radeon RX 6800 / 6900 · experimental** | [Instalación en RX 6000](docs/AMD_HIP.md#rdna2-gfx1030) | +| **Intel Arc · Linux** | [Instalación en Intel](docs/INTEL_ARC.md) | +| **Apple Silicon · M1 o posterior** | [Instalación en Mac](docs/MAC.md) | +| **AMD Ryzen AI Max · Strix Halo** | [Instalación en Strix Halo](docs/STRIX_HALO.md) | + + + +## Herramientas + +**Claude Code · Codex CLI · OpenCode · oh-my-pi · pi.dev · Hermes Agent · OpenClaw**, y más, mediante las API compatibles con OpenAI y Anthropic. + +Ejecuta **`strata connect`** para ver las instrucciones de tu herramienta. [Guía de conexión](docs/TERMINAL_LAUNCH.md#connect-your-apps-strata-connect). + + + + + + +## Ayuda + +[Todas las guías](docs) · [Solución de problemas](docs/TROUBLESHOOTING.md) · [Informar de un error](https://github.com/Niko1221/Strata/issues/new/choose) · +[Benchmarks](docs/COMMUNITY_BENCHMARKS.md) · [Cómo funciona](docs/HOW_IT_WORKS.md) · [Contribuir](CONTRIBUTING.md) + +## Apoya Strata + +**Ayuda a mantener la IA local abierta a todos.** Un café ayuda a financiar el desarrollo y las pruebas en más hardware. + +Buy Me a Coffee: apoya Strata + +[Licencia MIT](LICENSE) · [Créditos y licencias de los modelos](docs/HOW_IT_WORKS.md#credits) · [Privacidad](docs/SAFETY.md) + + + +Para herramientas de IA y lectores automáticos: referencia técnica · instrucciones de instalación. + +**Patrocinios, alianzas de hardware o colaboraciones:** [niko.veit@outlook.com](mailto:niko.veit@outlook.com). diff --git a/engine/strata/README.fr.md b/engine/strata/README.fr.md new file mode 100644 index 00000000..eb4e6723 --- /dev/null +++ b/engine/strata/README.fr.md @@ -0,0 +1,188 @@ +

+ + + Strata + +

+ +

Une IA puissante sur votre propre ordinateur.

+

Discutez, programmez et travaillez avec des images, en local.

+ +

+ Modèles · Installation · + Matériel · Outils · + Aide · Soutenir +

+ +

+ Télécharger Strata + Licence MIT + Soutenir Strata sur Buy Me a Coffee +

+ +

English · 简体中文 · 日本語 · Deutsch · Français · Español · Português

+ +**Gratuit, open source, et à vous de l'exécuter.** Utilisez Strata sur votre bureau ou avec vos outils de programmation préférés. Aucun compte nécessaire. + +## Modèles + +Nous recommandons **d'abord ISTA-DASLab**, puis **Unsloth** et d'autres fournisseurs, lorsqu'un modèle compatible tient en mémoire. + +
+  Qwen3.8-Flash-Next + +| Fournisseur | Choix | +| --- | --- | +| **ISTA-DASLab · recommandé** | Q2\_0, IQ2\_XS, IQ3\_XXS, IQ3\_S. [Coder : IQ1\_M](docs/MODELS.md#coder) pour programmer. | +| **Unsloth** | UD-IQ4\_XS, UD-Q4\_K\_XL, UD-Q5\_K\_XL, UD-Q6\_K\_XL, Q8\_0 | +| **Gyro · agentionai** | [Gyro-S, Gyro-M](https://huggingface.co/agentionai/Qwen3.8-Flash-Next-Gyro-GGUF). Utilise moins de mémoire, mais plus lent. | +| **Autres options** | [Swift 1.5](docs/MODELS.md#swift-15), [NVFP4](docs/NVFP4.md), [OrcaRouter](docs/ORCA.md) | + +[Comparer les tailles, la mémoire nécessaire et la compatibilité](docs/MODELS.md). + +
+ +
+  Qwen3.6-35B-A3B + +**Unsloth:** UD-Q4_K_XL, UD-Q6_K_XL, Q8_0. Ce sont les paquets actuellement documentés pour ce modèle. + +[Guide du modèle et compatibilité](docs/QWEN36.md). + +
+ +
+  DeepSeekV4.1-Flash-1017 + +Dans l'**application de bureau** et dans le **Terminal**. Ce qui ne tient pas en mémoire est lu depuis votre SSD : il faut donc beaucoup d'espace disque libre. + +| Jeu (IST-DAS) | Téléchargement | Espace disque libre nécessaire | +| --- | ---: | ---: | +| 1.75 bpw | 239 GB | environ 245 GB | +| 2.00 bpw | 257 GB | environ 265 GB | +| 2.25 bpw | 274 GB | environ 280 GB | + +Fonctionne sur les NVIDIA RTX 30, 40 et 50 (Windows et Linux) et sur l'AMD Radeon AI PRO R9700 (Linux). L'installation télécharge les fichiers et le moteur DeepSeek, puis démarre le modèle. + +```sh +strata launch --family deepseek41 --model ist-das-2.00bpw --plan +``` + +Mesuré avec le jeu 2.00 bpw sur Strata 0.2.5. « Sortie » est la vitesse de la réponse, « Prompt » la vitesse à laquelle Strata lit votre texte. + +| Matériel | Sortie | Prompt | +| --- | ---: | ---: | +| RTX 5070 12 GB, 64 GB de RAM | 4 à 6 tokens/s | environ 110 tokens/s (4K) | +| RTX 3060 12 GB, 46 GB de RAM | 9 à 11 tokens/s | environ 155 tokens/s (4K) | +| 1x Radeon AI PRO R9700, 251 GB de RAM | 21 à 25 tokens/s | 320 à 360 tokens/s (8K) | +| 4x Radeon AI PRO R9700 | 74 à 77 tokens/s | 400 à 450 tokens/s (8K) | + +[Mémoire, disque et détails](docs/DEEPSEEK41.md) · [Notes de version](https://github.com/Niko1221/Strata/releases) + +
+ + + +Vous ne savez pas ce qui tient ? [Choisir un modèle pour votre ordinateur](docs/MODELS.md#pick-by-memory). + +## Installation + + + +### Application de bureau + +**[Télécharger Strata pour Windows, Linux ou Mac →](https://github.com/Niko1221/Strata/releases/latest)** + +Installez l'application, choisissez un modèle et commencez à discuter. Il y a un seul installateur par système. Au premier lancement, l'application télécharge le moteur de votre carte graphique. [Aide pour l'installateur](docs/INSTALL.md#the-app). + +Fichiers: `Strata-0.2.5-windows-x64-setup.exe` · `Strata-0.2.5-linux-x86_64.AppImage` · `Strata-0.2.5-macos-arm64.dmg` + +

+ Application de bureau Strata avec une discussion et un aperçu du code en direct côte à côte +
Discussion, fichiers et aperçu en direct dans une seule fenêtre. +

+ + + +### Application Terminal + +Vous préférez le terminal ? Installez Strata, puis lancez **`strata launch`**. + +
+Commandes d'installation + +**Linux / Mac** + +```sh +curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh +``` + +**Windows PowerShell** + +```powershell +irm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex +``` + +Sous Windows, ouvrez ensuite un nouveau terminal. Puis : + +```sh +strata launch +``` + +Suivez les invites pour télécharger et démarrer un modèle. [Guide du Terminal](docs/TERMINAL_LAUNCH.md). + +
+ +

+ Application Terminal de Strata affichant l'activité du modèle, la vitesse, la mémoire et les requêtes récentes +
Suivez votre modèle et votre matériel pendant qu'il tourne. +

+ + + +[Compiler depuis les sources](docs/SOURCE_INSTALL.md) · [Docker](docs/DOCKER.md) · [Guide d'installation complet](docs/INSTALL.md) + + + +## Matériel + +| Matériel pris en charge | Guide | +| --- | --- | +| **NVIDIA GeForce RTX 20 / 30 / 40 / 50** | [Installation NVIDIA](docs/INSTALL.md#what-you-need) | +| **AMD Radeon RX 7700 / 7800 / 7900, RX 9060 / 9070, AI PRO R9700** | [Installation AMD](docs/AMD_HIP.md) | +| **AMD Radeon RX 6800 / 6900 · expérimental** | [Installation RX 6000](docs/AMD_HIP.md#rdna2-gfx1030) | +| **Intel Arc · Linux** | [Installation Intel](docs/INTEL_ARC.md) | +| **Apple Silicon · M1 ou plus récent** | [Installation sur Mac](docs/MAC.md) | +| **AMD Ryzen AI Max · Strix Halo** | [Installation Strix Halo](docs/STRIX_HALO.md) | + + + +## Outils + +**Claude Code · Codex CLI · OpenCode · oh-my-pi · pi.dev · Hermes Agent · OpenClaw**, et d'autres via les API compatibles OpenAI et Anthropic. + +Lancez **`strata connect`** pour voir la configuration de votre outil. [Guide de connexion](docs/TERMINAL_LAUNCH.md#connect-your-apps-strata-connect). + + + + + + +## Aide + +[Tous les guides](docs) · [Dépannage](docs/TROUBLESHOOTING.md) · [Signaler un bogue](https://github.com/Niko1221/Strata/issues/new/choose) · +[Benchmarks](docs/COMMUNITY_BENCHMARKS.md) · [Comment ça marche](docs/HOW_IT_WORKS.md) · [Contribuer](CONTRIBUTING.md) + +## Soutenir Strata + +**Aidez à garder l'IA locale ouverte à tous.** Un café aide à financer le développement et les tests sur davantage de matériel. + +Buy Me a Coffee : soutenir Strata + +[Licence MIT](LICENSE) · [Crédits et licences des modèles](docs/HOW_IT_WORKS.md#credits) · [Confidentialité](docs/SAFETY.md) + + + +Pour les outils d'IA et les lecteurs automatiques : référence technique · instructions d'installation. + +**Parrainages, partenariats matériel ou collaborations :** [niko.veit@outlook.com](mailto:niko.veit@outlook.com). diff --git a/engine/strata/README.ja.md b/engine/strata/README.ja.md new file mode 100644 index 00000000..4a180076 --- /dev/null +++ b/engine/strata/README.ja.md @@ -0,0 +1,188 @@ +

+ + + Strata + +

+ +

あなた自身のパソコンで、高性能な AI を。

+

チャット、コーディング、画像の処理を、すべてローカルで。

+ +

+ モデル · インストール · + ハードウェア · ツール · + ヘルプ · 支援 +

+ +

+ Strata をダウンロード + MIT ライセンス + Buy Me a Coffee で Strata を支援する +

+ +

English · 简体中文 · 日本語 · Deutsch · Français · Español · Português

+ +**無料でオープンソース。自分の環境で動かせます。** デスクトップで、またはお好みのコーディングツールと一緒に Strata を使えます。アカウントは不要です。 + +## モデル + +まず **ISTA-DASLab** をおすすめします。次に **Unsloth** などの提供元です。メモリに収まる互換モデルがある場合に選べます。 + +
+  Qwen3.8-Flash-Next + +| 提供元 | 選択肢 | +| --- | --- | +| **ISTA-DASLab · おすすめ** | Q2\_0, IQ2\_XS, IQ3\_XXS, IQ3\_S。[Coder: IQ1\_M](docs/MODELS.md#coder)(コーディング向け)。 | +| **Unsloth** | UD-IQ4\_XS, UD-Q4\_K\_XL, UD-Q5\_K\_XL, UD-Q6\_K\_XL, Q8\_0 | +| **Gyro · agentionai** | [Gyro-S, Gyro-M](https://huggingface.co/agentionai/Qwen3.8-Flash-Next-Gyro-GGUF)。メモリ使用量は少ないですが、動作は遅くなります。 | +| **その他の選択肢** | [Swift 1.5](docs/MODELS.md#swift-15), [NVFP4](docs/NVFP4.md), [OrcaRouter](docs/ORCA.md) | + +[サイズ、必要なメモリ、互換性を比べる](docs/MODELS.md)。 + +
+ +
+  Qwen3.6-35B-A3B + +**Unsloth:** UD-Q4_K_XL, UD-Q6_K_XL, Q8_0。現在、このモデルで文書化されているパックです。 + +[モデルガイドと互換性](docs/QWEN36.md)。 + +
+ +
+  DeepSeekV4.1-Flash-1017 + +**デスクトップアプリ**と**ターミナル**で使えます。メモリに収まらない分は SSD から読み込むため、空きディスク容量がたくさん必要です。 + +| セット(IST-DAS) | ダウンロード | 必要な空き容量 | +| --- | ---: | ---: | +| 1.75 bpw | 239 GB | 約245 GB | +| 2.00 bpw | 257 GB | 約265 GB | +| 2.25 bpw | 274 GB | 約280 GB | + +NVIDIA RTX 30・40・50 シリーズ(Windows と Linux)と、AMD Radeon AI PRO R9700(Linux)で動きます。セットアップがファイルと DeepSeek エンジンをダウンロードし、モデルを起動します。 + +```sh +strata launch --family deepseek41 --model ist-das-2.00bpw --plan +``` + +Strata 0.2.5 で 2.00 bpw のセットを使って測定しました。「出力」は回答の速さ、「プロンプト」は Strata が入力を読み込む速さです。 + +| ハードウェア | 出力 | プロンプト | +| --- | ---: | ---: | +| RTX 5070 12 GB, 64 GB RAM | 4〜6 トークン/秒 | 約 110 トークン/秒 (4K) | +| RTX 3060 12 GB, 46 GB RAM | 9〜11 トークン/秒 | 約 155 トークン/秒 (4K) | +| 1x Radeon AI PRO R9700, 251 GB RAM | 21〜25 トークン/秒 | 320〜360 トークン/秒 (8K) | +| 4x Radeon AI PRO R9700 | 74〜77 トークン/秒 | 400〜450 トークン/秒 (8K) | + +[メモリ、ディスク、詳細](docs/DEEPSEEK41.md) · [リリースノート](https://github.com/Niko1221/Strata/releases) + +
+ + + +どれが動くかわからない場合は、[お使いのパソコンに合うモデルを選ぶ](docs/MODELS.md#pick-by-memory)。 + +## インストール + + + +### デスクトップアプリ + +**[Windows、Linux、Mac 用の Strata をダウンロード →](https://github.com/Niko1221/Strata/releases/latest)** + +アプリをインストールし、モデルを選んで、チャットを始めましょう。インストーラーはシステムごとに1つです。初回起動時に、アプリがお使いのグラフィックスカード用のエンジンをダウンロードします。[インストーラーのヘルプ](docs/INSTALL.md#the-app)。 + +ファイル: `Strata-0.2.5-windows-x64-setup.exe` · `Strata-0.2.5-linux-x86_64.AppImage` · `Strata-0.2.5-macos-arm64.dmg` + +

+ チャットとライブのコードプレビューを並べて表示した Strata デスクトップアプリ +
チャット、ファイル、ライブプレビューを1つのウィンドウで。 +

+ + + +### ターミナルアプリ + +ターミナルのほうが好みですか? Strata をインストールして、**`strata launch`** を実行します。 + +
+インストールコマンド + +**Linux / Mac** + +```sh +curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh +``` + +**Windows PowerShell** + +```powershell +irm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex +``` + +Windows では、インストール後に新しいターミナルを開きます。そのあと: + +```sh +strata launch +``` + +画面の案内に従って、モデルをダウンロードして起動します。[ターミナルガイド](docs/TERMINAL_LAUNCH.md)。 + +
+ +

+ モデルの動作、速度、メモリ、最近のリクエストを表示する Strata ターミナルアプリ +
動作中のモデルとハードウェアの状態を確認できます。 +

+ + + +[ソースからビルド](docs/SOURCE_INSTALL.md) · [Docker](docs/DOCKER.md) · [インストールガイド(全文)](docs/INSTALL.md) + + + +## ハードウェア + +| 対応ハードウェア | ガイド | +| --- | --- | +| **NVIDIA GeForce RTX 20 / 30 / 40 / 50 シリーズ** | [NVIDIA のセットアップ](docs/INSTALL.md#what-you-need) | +| **AMD Radeon RX 7700 / 7800 / 7900、RX 9060 / 9070、AI PRO R9700** | [AMD のセットアップ](docs/AMD_HIP.md) | +| **AMD Radeon RX 6800 / 6900 · 試験的** | [RX 6000 のセットアップ](docs/AMD_HIP.md#rdna2-gfx1030) | +| **Intel Arc · Linux** | [Intel のセットアップ](docs/INTEL_ARC.md) | +| **Apple Silicon · M1 以降** | [Mac のセットアップ](docs/MAC.md) | +| **AMD Ryzen AI Max · Strix Halo** | [Strix Halo のセットアップ](docs/STRIX_HALO.md) | + + + +## ツール + +**Claude Code · Codex CLI · OpenCode · oh-my-pi · pi.dev · Hermes Agent · OpenClaw**。OpenAI 互換と Anthropic 互換の API を通じて、ほかのツールも使えます。 + +**`strata connect`** を実行すると、お使いのツールの設定方法が表示されます。[接続ガイド](docs/TERMINAL_LAUNCH.md#connect-your-apps-strata-connect)。 + + + + + + +## ヘルプ + +[すべてのガイド](docs) · [トラブルシューティング](docs/TROUBLESHOOTING.md) · [不具合を報告](https://github.com/Niko1221/Strata/issues/new/choose) · +[ベンチマーク](docs/COMMUNITY_BENCHMARKS.md) · [仕組み](docs/HOW_IT_WORKS.md) · [貢献する](CONTRIBUTING.md) + +## Strata を支援する + +**ローカル AI をみんなに開かれたものに。** コーヒー1杯が、開発と、より多くのハードウェアでのテストの支えになります。 + +Buy Me a Coffee: Strata を支援する + +[MIT ライセンス](LICENSE) · [クレジットとモデルのライセンス](docs/HOW_IT_WORKS.md#credits) · [プライバシー](docs/SAFETY.md) + + + +AI ツールと自動リーダー向け: 技術リファレンス · セットアップ手順 + +**スポンサー、ハードウェア提携、共同開発のご相談:** [niko.veit@outlook.com](mailto:niko.veit@outlook.com). diff --git a/engine/strata/README.md b/engine/strata/README.md index 10812dcb..0c9be0d1 100644 --- a/engine/strata/README.md +++ b/engine/strata/README.md @@ -1,184 +1,191 @@ -

Strata

+

+ + + Strata + +

-

Run a 125-billion-parameter AI model on your own gaming PC
-NVIDIA or AMD graphics card (12 GB or more) · Windows or Linux · free and open source

+

Run powerful AI on your own computer.

+

Chat, code and work with images, locally.

-

A voxel pagoda garden that Strata's model wrote, running in the browser
-A voxel pagoda garden, 1 shot prompt running on an RTX 5070 with Strata (IQ3_S, 128K context) · -full video (49 s)

+

+ Models · Install · + Hardware · Tools · + Help · Support +

-Strata runs **[Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next)** - a large, smart AI model that -normally needs a server - on a normal PC. It chats, writes code, reads pictures and works with your apps and coding -agents, and nothing leaves your PC. +

+ Download Strata + MIT license + Support Strata on Buy Me a Coffee +

-## How fast is it? +

English · 简体中文 · 日本語 · Deutsch · Français · Español · Português

-Measured on two ordinary gaming PCs. "Writes answers" is how fast the reply appears in a short chat; "reads your -prompt" is how fast it takes in what you send (a 32K-token document, code or chat history). A token is about ¾ of a -word, so 60 tokens per second is faster than you can read. +**Free, open source, and yours to run.** Use Strata on your desktop or with your favorite coding tools. No account needed. - - - -
NVIDIA: RTX 5070 (12 GB), Ryzen 5 7600, 64 GB RAMAMD: RX 9070 XT (16 GB), Ryzen 9 3900X, 47 GB RAM
+## Models -| Size | Writes answers | Reads your prompt | -| --- | ---: | ---: | -| **Q2_0** | 93 tokens/s | 2,170 tokens/s | -| **IQ2_XS** | 79 tokens/s | 2,090 tokens/s | -| **IQ3_XXS** | 62 tokens/s | 1,750 tokens/s | -| **IQ3_S** | 53 tokens/s | 1,620 tokens/s | -| **Coder** | 55 tokens/s | 2,180 tokens/s | +We recommend **ISTA-DASLab first**, then **Unsloth** and other providers, where a compatible model fits. - +
+  Qwen3.8-Flash-Next -| Size | Writes answers | Reads your prompt | -| --- | ---: | ---: | -| **Q2_0** | 60 tokens/s | 1,160 tokens/s | -| **IQ2_XS** | 52 tokens/s | 1,110 tokens/s | -| **Coder** | 44 tokens/s | 1,420 tokens/s | - -
- -A card with more VRAM is faster: an RTX 3090 (24 GB) should write roughly 100-140 tokens per second. Long chats, -other cards: [speed of each model](docs/MODELS.md#how-fast-is-each-size), [community results](docs/COMMUNITY_BENCHMARKS.md). - -

Buy Me A Coffee
-Strata is free. If it runs well on your PC, a coffee keeps the work on it going.

- -## What you need - -| | | +| Provider | Choices | | --- | --- | -| **Graphics card** | **NVIDIA** GeForce RTX 20, 30, 40 or 50 series, or **AMD** Radeon RX 7900 XT / XTX, RX 7800 XT / 7700 XT, RX 9060 XT, RX 9070 / 9070 XT, Radeon AI PRO R9700 or RX 6800 / 6900 series - with **12 GB of VRAM or more** | -| **RAM** | 32 GB or more - how much decides [which model](#which-model-should-i-pick) fits; 64 GB runs every size | -| **Disk** | about 80 GB free, on an SSD if you can (the first start is much faster) | -| **System** | Windows 10 / 11 or Linux, and a current graphics driver from NVIDIA or AMD | +| **ISTA-DASLab · recommended** | Q2\_0, IQ2\_XS, IQ3\_XXS, IQ3\_S. [Coder: IQ1\_M](docs/MODELS.md#coder) for coding. | +| **Unsloth** | UD-IQ4\_XS, UD-Q4\_K\_XL, UD-Q5\_K\_XL, UD-Q6\_K\_XL, Q8\_0 | +| **Gyro · agentionai** | [Gyro-S, Gyro-M](https://huggingface.co/agentionai/Qwen3.8-Flash-Next-Gyro-GGUF). Lower memory use but slower. | +| **Other options** | [Swift 1.5](docs/MODELS.md#swift-15), [NVFP4](docs/NVFP4.md), [OrcaRouter](docs/ORCA.md) | -Everything else is installed for you. Two or three cards can share the model ([multi-GPU](docs/MULTI_GPU.md)). -The full list: [docs/INSTALL.md](docs/INSTALL.md#what-you-need). +[Compare sizes, memory needs and compatibility](docs/MODELS.md). + + + +
+  Qwen3.6-35B-A3B + +**Unsloth:** UD-Q4_K_XL, UD-Q6_K_XL, Q8_0. These are the currently documented packs for this model. + +[Model guide and compatibility](docs/QWEN36.md). + +
+ +
+  DeepSeekV4.1-Flash-1017 + +In the **desktop app** and the **Terminal**. What does not fit in memory is read from your SSD, so it needs a lot of free +disk space. + +| Set (IST-DAS) | Download | Free disk needed | +| --- | ---: | ---: | +| 1.75 bpw | 239 GB | about 245 GB | +| 2.00 bpw | 257 GB | about 265 GB | +| 2.25 bpw | 274 GB | about 280 GB | + +Runs on NVIDIA RTX 30, 40 and 50 series (Windows and Linux) and AMD Radeon AI PRO R9700 (Linux). Setup downloads the +files and the DeepSeek engine, then starts the model. + +```sh +strata launch --family deepseek41 --model ist-das-2.00bpw --plan +``` + +Measured with the 2.00 bpw set on Strata 0.2.5. Output is the speed of the answer, prompt is how fast Strata reads your input. + +| Hardware | Output | Prompt | +| --- | ---: | ---: | +| RTX 5070 12 GB, 64 GB RAM | 4 to 6 tokens/s | about 110 tokens/s (4K) | +| RTX 3060 12 GB, 46 GB RAM | 9 to 11 tokens/s | about 155 tokens/s (4K) | +| 1x Radeon AI PRO R9700, 251 GB RAM | 21 to 25 tokens/s | 320 to 360 tokens/s (8K) | +| 4x Radeon AI PRO R9700 | 74 to 77 tokens/s | 400 to 450 tokens/s (8K) | + +[Memory, disk and details](docs/DEEPSEEK41.md) · [Release notes](https://github.com/Niko1221/Strata/releases) + +
+ + + +Not sure what fits? [Choose a model for your computer](docs/MODELS.md#pick-by-memory). ## Install -### Let your AI set it up + -Use an AI coding assistant (Claude Code, Cursor, Codex, GitHub Copilot, ...)? Paste this into it: +### Desktop app -```text -Set up Strata on this PC for me: https://github.com/Niko1221/Strata - follow docs/AI_SETUP.md in that repository. +**[Download Strata for Windows, Linux or Mac →](https://github.com/Niko1221/Strata/releases/latest)** + +Install the app, choose a model, and start chatting. There is one installer for each system. On first start the app +downloads the engine for your graphics card. [Help with the installer](docs/INSTALL.md#the-app). + +Files: `Strata-0.2.5-windows-x64-setup.exe` · `Strata-0.2.5-linux-x86_64.AppImage` · `Strata-0.2.5-macos-arm64.dmg` + +

+ Strata desktop app with a chat and live code preview side by side +
Chat, files and a live preview in one window. +

+ + + +### Terminal app + +Prefer the terminal? Install Strata, then run **`strata launch`**. + +
+Install commands + +**Linux / Mac** + +```sh +curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh ``` -It checks your graphics card, RAM and disk, picks the model that fits, installs it, starts it and tells you how to -connect your apps. AI tools can also install, start and stop Strata themselves through its -[MCP server](docs/MCP_SERVER.md). +**Windows PowerShell** -### Or do it yourself +```powershell +irm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex +``` -[Download Strata](https://github.com/Niko1221/Strata/archive/refs/heads/main.zip) and unzip it (or `git clone` it). -**Windows:** double-click **`START-HERE.bat`**. **Linux:** run **`./setup.sh`** in the Strata folder. +On Windows, open a new terminal afterwards. Then: -The same steps for NVIDIA and AMD: the installer finds your card and sets up the right engine for it. It asks which -model, which size, how much context (how much text it keeps in mind) and whether it should read pictures - press -Enter each time for the recommended answer. Then it downloads the model (~70 GB; you can stop and it continues where -it left off) and starts it. Your browser opens the Strata app at `http://127.0.0.1:8080`. +```sh +strata launch +``` -> **While the model starts, your PC can be slow or stop responding for 1-3 minutes** (longest the first time): Strata -> loads 35-55 GB into your RAM and locks part of it for the graphics card. That's normal - wait, and don't close the -> window. The window tells you what it is doing. +Follow the prompts to download and start a model. [Terminal guide](docs/TERMINAL_LAUNCH.md). -**Next time**, run `START-HERE.bat` (or `./setup.sh`) again: it starts right away, nothing is downloaded twice. Close -its window to stop the model. Updating, Docker, several cards, where the files go and every option: -[docs/INSTALL.md](docs/INSTALL.md). +
-## Which model should I pick? +

+ Strata terminal app showing model activity, speed, memory and recent requests +
Watch your model and hardware while it runs. +

-The installer recommends one for your RAM. The same model comes in sizes that are compressed more or less: smaller -is faster, larger is a bit smarter. + -| Your RAM | Take | Why | -| --- | --- | --- | -| **32 GB** | **Coder** | it fits 32 GB, and it is made for code (with a 24 GB card, Q2_0 and IQ2_XS run too) | -| **48 GB** | **IQ2_XS** (or Q2_0, the fastest) | the larger sizes do not fit | -| **64 GB** | **IQ2_XS** (recommended), or IQ3_XXS / IQ3_S | every size fits; IQ3_S is the best, and the slowest | -| **96 GB or more** | **IQ3_S**, or Unsloth's 4-bit (experimental) | room for the largest sizes with everything else open | +[Build from source](docs/SOURCE_INSTALL.md) · [Docker](docs/DOCKER.md) · [Full install guide](docs/INSTALL.md) -- **[Coder](docs/MODELS.md#coder)** - a coding version with half of the experts removed: 91% of the full model's - SWE-bench Verified score (by its authors), fits 32 GB of RAM. Weaker outside code, including Chinese and other - CJK text (#438): for those, take Q2_0, IQ2_XS or IQ3_S, which keep every expert. -- **[Swift 1.5](docs/MODELS.md#swift-15)** - a fine-tune that thinks much shorter before it answers, so you get the - answer sooner, at about the same quality. -- **[Unsloth UD-Q4_K_XL](docs/MODELS.md#unsloth-ud-q4_k_xl-experimental)** (experimental) - the closest to the full - model, but most of it is read from the SSD while it answers: 7-8.5 tokens/s on a 64 GB PC. -- **[OrcaRouter's Uncensored IQ3_XXS](docs/MODELS.md#orcarouter-uncensored-iq3_xxs)** - a manual setup, not in the - installer's menu. + -Sizes, downloads and what fits where: [docs/MODELS.md](docs/MODELS.md). You can add another model later with -`SETUP.bat` (Linux: `./setup.sh --setup`). +## Hardware -## Using it +| Supported hardware | Guide | +| --- | --- | +| **NVIDIA GeForce RTX 20 / 30 / 40 / 50 series** | [NVIDIA setup](docs/INSTALL.md#what-you-need) | +| **AMD Radeon RX 7700 / 7800 / 7900, RX 9060 / 9070, AI PRO R9700** | [AMD setup](docs/AMD_HIP.md) | +| **AMD Radeon RX 6800 / 6900 · experimental** | [RX 6000 setup](docs/AMD_HIP.md#rdna2-gfx1030) | +| **Intel Arc · Linux** | [Intel setup](docs/INTEL_ARC.md) | +| **Apple Silicon · M1 or newer** | [Mac setup](docs/MAC.md) | +| **AMD Ryzen AI Max · Strix Halo** | [Strix Halo setup](docs/STRIX_HALO.md) | -

The Strata app's Monitor tab next to a coding agent
-The Strata app's Monitor (left) while a coding agent writes the pagoda garden from the video (right)

+ -- **In the browser:** `http://127.0.0.1:8080` - **Chat**, a live **Monitor** of the model and your GPU/CPU/RAM, and - **About** with the settings and addresses. -- **Your apps and coding agents:** add an "OpenAI-compatible" provider with base URL **`http://127.0.0.1:8080/v1`**, - any API key and any model name. Apps that use Anthropic's API: `http://127.0.0.1:8080/v1/messages` (Claude Code: - `ANTHROPIC_BASE_URL=http://127.0.0.1:8080`). -- **Thinking:** choose **off, low, medium or high** in the chat menu or your app's "reasoning effort". Off is - fastest; high is best for hard questions. -- **Pictures:** say yes to "Images?" in setup, then click **Picture** in the chat, or attach them in your app - (AMD cards: on Linux through the processor, not on Windows yet). -- **From your phone or another PC:** `START-HERE.bat --setup --host 0.0.0.0 --api-key ` - always with a key. -- **Good to know:** it answers one request at a time. The first message of a chat is read in full (about 1 minute - per 30,000 tokens); follow-ups start in seconds. +## Tools -More: [where your chats are stored](docs/INSTALL.md#where-things-are-stored), [the API](docs/DETAILS.md#using-it). +**Claude Code · Codex CLI · OpenCode · oh-my-pi · pi.dev · Hermes Agent · OpenClaw**, and more through the OpenAI- and Anthropic-compatible APIs. -## Something went wrong? +Run **`strata connect`** to see setup instructions for your tool. [Connection guide](docs/TERMINAL_LAUNCH.md#connect-your-apps-strata-connect). -- **My PC froze the first time Strata started.** Normal while it loads the model: wait, don't close the window. - Still frozen after 10 minutes? Restart the PC, close other programs and try again, or pick a smaller size. -- **It stopped while downloading or installing.** Run `START-HERE.bat` (or `./setup.sh`) again: it continues where - it stopped. -- **It's very slow and the disk light keeps blinking, or "the engine stopped unexpectedly".** Not enough free RAM: - close other programs (browsers use a lot), or pick a smaller size (Q2_0 or IQ2_XS). -- **It says port 8080 is already in use.** Strata is already running - look for its window. + + + + -More problems and their fixes: [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md). Still stuck? Open an -[issue](https://github.com/Niko1221/Strata/issues) and attach `strata-.log` from the Strata folder. +## Help -## How does it work? - -Models like this one normally run on servers with hundreds of gigabytes of graphics memory. Your graphics card has -12-24 GB. Strata makes it fit by **sharing the work across your whole PC** - like a kitchen, where the things you use -all the time stay on the counter and the rest waits in the pantry. - -

The model's 24,576 experts: the busiest on the graphics card, all of them in RAM, a lookup table on the SSD

- -- **The model is a team of 24,576 small specialists ("experts"),** and each word needs only 10 of them. -- **Your graphics card** keeps the few thousand experts that are asked most often; **your RAM** holds all of them, - and **your processor** works on the rest at the same time. **Your SSD** holds a big lookup table. - -

A small helper guesses the next words; the big model checks them all at once and keeps the right ones

- -- **Guess, then check:** a small helper guesses the next few words and the big model checks them all at once, so - you get the same answer, 1.6-1.8x sooner. -- **Long texts are read in big pieces** (up to 8,192 tokens at a time): over 1,000 tokens per second. - -The longer explanation: [docs/HOW_IT_WORKS.md](docs/HOW_IT_WORKS.md). Every part and its numbers: [the -details](docs/DETAILS.md#how-it-works) and the [paper](docs/paper/Strata-Paper.pdf). - -## Credits and license - -The model is [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next) by the Qwen team, compressed by -[ISTA-DASLab](https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF), UkisAI (Swift 1.5) and Unsloth; -Strata is built with parts of [llama.cpp / ggml](https://github.com/ggml-org/llama.cpp). All credits: -[docs/HOW_IT_WORKS.md](docs/HOW_IT_WORKS.md#credits). Strata is open source under the [MIT License](LICENSE); a few -parts and every model carry their own licenses ([which ones](docs/HOW_IT_WORKS.md#license)). +[All guides](docs) · [Troubleshooting](docs/TROUBLESHOOTING.md) · [Report a bug](https://github.com/Niko1221/Strata/issues/new/choose) · +[Benchmarks](docs/COMMUNITY_BENCHMARKS.md) · [How it works](docs/HOW_IT_WORKS.md) · [Contribute](CONTRIBUTING.md) ## Support Strata -Strata is free and open source. If it is useful to you, you can support its development: +**Help keep local AI open to everyone.** A coffee helps fund development and testing on more hardware. -

Buy Me A Coffee

+Buy Me a Coffee: support Strata + +[MIT license](LICENSE) · [Credits and model licenses](docs/HOW_IT_WORKS.md#credits) · [Privacy](docs/SAFETY.md) + + + +For AI tools and automated readers: technical reference · setup instructions. + +**Sponsorships, hardware partnerships or collaborations:** [niko.veit@outlook.com](mailto:niko.veit@outlook.com). diff --git a/engine/strata/README.pt-BR.md b/engine/strata/README.pt-BR.md new file mode 100644 index 00000000..f268b29a --- /dev/null +++ b/engine/strata/README.pt-BR.md @@ -0,0 +1,188 @@ +

+ + + Strata + +

+ +

IA poderosa no seu próprio computador.

+

Converse, programe e trabalhe com imagens, localmente.

+ +

+ Modelos · Instalação · + Hardware · Ferramentas · + Ajuda · Apoiar +

+ +

+ Baixar o Strata + Licença MIT + Apoie o Strata no Buy Me a Coffee +

+ +

English · 简体中文 · 日本語 · Deutsch · Français · Español · Português

+ +**Gratuito, de código aberto e seu para executar.** Use o Strata no desktop ou com suas ferramentas de programação favoritas. Não precisa de conta. + +## Modelos + +Recomendamos **primeiro a ISTA-DASLab**, depois a **Unsloth** e outros provedores, quando um modelo compatível cabe na memória. + +
+  Qwen3.8-Flash-Next + +| Provedor | Opções | +| --- | --- | +| **ISTA-DASLab · recomendado** | Q2\_0, IQ2\_XS, IQ3\_XXS, IQ3\_S. [Coder: IQ1\_M](docs/MODELS.md#coder) para programar. | +| **Unsloth** | UD-IQ4\_XS, UD-Q4\_K\_XL, UD-Q5\_K\_XL, UD-Q6\_K\_XL, Q8\_0 | +| **Gyro · agentionai** | [Gyro-S, Gyro-M](https://huggingface.co/agentionai/Qwen3.8-Flash-Next-Gyro-GGUF). Usa menos memória, mas é mais lento. | +| **Outras opções** | [Swift 1.5](docs/MODELS.md#swift-15), [NVFP4](docs/NVFP4.md), [OrcaRouter](docs/ORCA.md) | + +[Compare tamanhos, necessidades de memória e compatibilidade](docs/MODELS.md). + +
+ +
+  Qwen3.6-35B-A3B + +**Unsloth:** UD-Q4_K_XL, UD-Q6_K_XL, Q8_0. Esses são os pacotes documentados atualmente para este modelo. + +[Guia do modelo e compatibilidade](docs/QWEN36.md). + +
+ +
+  DeepSeekV4.1-Flash-1017 + +No **aplicativo de desktop** e no **Terminal**. O que não cabe na memória é lido do seu SSD, por isso é preciso muito espaço livre em disco. + +| Conjunto (IST-DAS) | Download | Espaço livre necessário | +| --- | ---: | ---: | +| 1.75 bpw | 239 GB | cerca de 245 GB | +| 2.00 bpw | 257 GB | cerca de 265 GB | +| 2.25 bpw | 274 GB | cerca de 280 GB | + +Roda em NVIDIA RTX 30, 40 e 50 (Windows e Linux) e em AMD Radeon AI PRO R9700 (Linux). A instalação baixa os arquivos e o motor do DeepSeek e depois inicia o modelo. + +```sh +strata launch --family deepseek41 --model ist-das-2.00bpw --plan +``` + +Medido com o conjunto de 2.00 bpw no Strata 0.2.5. “Saída” é a velocidade da resposta; “Prompt” é a rapidez com que o Strata lê o seu texto. + +| Hardware | Saída | Prompt | +| --- | ---: | ---: | +| RTX 5070 12 GB, 64 GB de RAM | 4 a 6 tokens/s | cerca de 110 tokens/s (4K) | +| RTX 3060 12 GB, 46 GB de RAM | 9 a 11 tokens/s | cerca de 155 tokens/s (4K) | +| 1x Radeon AI PRO R9700, 251 GB de RAM | 21 a 25 tokens/s | 320 a 360 tokens/s (8K) | +| 4x Radeon AI PRO R9700 | 74 a 77 tokens/s | 400 a 450 tokens/s (8K) | + +[Memória, disco e detalhes](docs/DEEPSEEK41.md) · [Notas da versão](https://github.com/Niko1221/Strata/releases) + +
+ + + +Não sabe o que cabe? [Escolha um modelo para o seu computador](docs/MODELS.md#pick-by-memory). + +## Instalação + + + +### Aplicativo de desktop + +**[Baixar o Strata para Windows, Linux ou Mac →](https://github.com/Niko1221/Strata/releases/latest)** + +Instale o aplicativo, escolha um modelo e comece a conversar. Há um instalador por sistema. Na primeira vez que abre, o aplicativo baixa o motor da sua placa de vídeo. [Ajuda com o instalador](docs/INSTALL.md#the-app). + +Arquivos: `Strata-0.2.5-windows-x64-setup.exe` · `Strata-0.2.5-linux-x86_64.AppImage` · `Strata-0.2.5-macos-arm64.dmg` + +

+ Aplicativo de desktop do Strata com um chat e uma prévia do código ao vivo lado a lado +
Chat, arquivos e prévia ao vivo em uma só janela. +

+ + + +### Aplicativo de Terminal + +Prefere o terminal? Instale o Strata e execute **`strata launch`**. + +
+Comandos de instalação + +**Linux / Mac** + +```sh +curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh +``` + +**Windows PowerShell** + +```powershell +irm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex +``` + +No Windows, abra um novo terminal depois. Em seguida: + +```sh +strata launch +``` + +Siga as instruções para baixar e iniciar um modelo. [Guia do Terminal](docs/TERMINAL_LAUNCH.md). + +
+ +

+ Aplicativo de Terminal do Strata mostrando a atividade do modelo, a velocidade, a memória e as solicitações recentes +
Acompanhe seu modelo e seu hardware enquanto ele roda. +

+ + + +[Compilar a partir do código-fonte](docs/SOURCE_INSTALL.md) · [Docker](docs/DOCKER.md) · [Guia de instalação completo](docs/INSTALL.md) + + + +## Hardware + +| Hardware compatível | Guia | +| --- | --- | +| **NVIDIA GeForce RTX 20 / 30 / 40 / 50** | [Instalação para NVIDIA](docs/INSTALL.md#what-you-need) | +| **AMD Radeon RX 7700 / 7800 / 7900, RX 9060 / 9070, AI PRO R9700** | [Instalação para AMD](docs/AMD_HIP.md) | +| **AMD Radeon RX 6800 / 6900 · experimental** | [Instalação para RX 6000](docs/AMD_HIP.md#rdna2-gfx1030) | +| **Intel Arc · Linux** | [Instalação para Intel](docs/INTEL_ARC.md) | +| **Apple Silicon · M1 ou mais novo** | [Instalação para Mac](docs/MAC.md) | +| **AMD Ryzen AI Max · Strix Halo** | [Instalação para Strix Halo](docs/STRIX_HALO.md) | + + + +## Ferramentas + +**Claude Code · Codex CLI · OpenCode · oh-my-pi · pi.dev · Hermes Agent · OpenClaw**, e outras, pelas APIs compatíveis com OpenAI e Anthropic. + +Execute **`strata connect`** para ver as instruções da sua ferramenta. [Guia de conexão](docs/TERMINAL_LAUNCH.md#connect-your-apps-strata-connect). + + + + + + +## Ajuda + +[Todos os guias](docs) · [Solução de problemas](docs/TROUBLESHOOTING.md) · [Relatar um bug](https://github.com/Niko1221/Strata/issues/new/choose) · +[Benchmarks](docs/COMMUNITY_BENCHMARKS.md) · [Como funciona](docs/HOW_IT_WORKS.md) · [Contribuir](CONTRIBUTING.md) + +## Apoie o Strata + +**Ajude a manter a IA local aberta para todos.** Um café ajuda a financiar o desenvolvimento e os testes em mais hardware. + +Buy Me a Coffee: apoie o Strata + +[Licença MIT](LICENSE) · [Créditos e licenças dos modelos](docs/HOW_IT_WORKS.md#credits) · [Privacidade](docs/SAFETY.md) + + + +Para ferramentas de IA e leitores automáticos: referência técnica · instruções de instalação. + +**Patrocínios, parcerias de hardware ou colaborações:** [niko.veit@outlook.com](mailto:niko.veit@outlook.com). diff --git a/engine/strata/README.zh-CN.md b/engine/strata/README.zh-CN.md new file mode 100644 index 00000000..43abda7b --- /dev/null +++ b/engine/strata/README.zh-CN.md @@ -0,0 +1,188 @@ +

+ + + Strata + +

+ +

在你自己的电脑上运行强大的 AI。

+

本地聊天、写代码、处理图片。

+ +

+ 模型 · 安装 · + 硬件 · 工具 · + 帮助 · 支持 +

+ +

+ 下载 Strata + MIT 许可证 + 在 Buy Me a Coffee 上支持 Strata +

+ +

English · 简体中文 · 日本語 · Deutsch · Français · Español · Português

+ +**免费、开源,由你自己运行。** 在桌面上使用 Strata,或搭配你喜欢的编程工具。无需账号。 + +## 模型 + +我们**首先推荐 ISTA-DASLab**,其次是 **Unsloth** 和其他提供方,前提是有内存放得下的兼容模型。 + +
+  Qwen3.8-Flash-Next + +| 提供方 | 可选项 | +| --- | --- | +| **ISTA-DASLab · 推荐** | Q2\_0, IQ2\_XS, IQ3\_XXS, IQ3\_S。[Coder:IQ1\_M](docs/MODELS.md#coder),适合写代码。 | +| **Unsloth** | UD-IQ4\_XS, UD-Q4\_K\_XL, UD-Q5\_K\_XL, UD-Q6\_K\_XL, Q8\_0 | +| **Gyro · agentionai** | [Gyro-S, Gyro-M](https://huggingface.co/agentionai/Qwen3.8-Flash-Next-Gyro-GGUF)。占用内存更少,但速度更慢。 | +| **其他选项** | [Swift 1.5](docs/MODELS.md#swift-15), [NVFP4](docs/NVFP4.md), [OrcaRouter](docs/ORCA.md) | + +[比较大小、内存需求和兼容性](docs/MODELS.md)。 + +
+ +
+  Qwen3.6-35B-A3B + +**Unsloth:** UD-Q4_K_XL, UD-Q6_K_XL, Q8_0。这些是目前文档中收录的该模型的版本。 + +[模型指南和兼容性](docs/QWEN36.md)。 + +
+ +
+  DeepSeekV4.1-Flash-1017 + +可在**桌面应用**和**终端**中使用。内存放不下的部分会从 SSD 读取,所以需要大量空闲磁盘空间。 + +| 版本(IST-DAS) | 下载大小 | 所需空闲磁盘 | +| --- | ---: | ---: | +| 1.75 bpw | 239 GB | 约245 GB | +| 2.00 bpw | 257 GB | 约265 GB | +| 2.25 bpw | 274 GB | 约280 GB | + +支持 NVIDIA RTX 30、40 和 50 系列(Windows 和 Linux),以及 AMD Radeon AI PRO R9700(Linux)。安装程序会下载模型文件和 DeepSeek 引擎,然后启动模型。 + +```sh +strata launch --family deepseek41 --model ist-das-2.00bpw --plan +``` + +以下为 Strata 0.2.5 上 2.00 bpw 版本的实测结果。“输出”是回答的速度,“提示词”是 Strata 读取你输入内容的速度。 + +| 硬件 | 输出 | 提示词 | +| --- | ---: | ---: | +| RTX 5070 12 GB, 64 GB 内存 | 4 到 6 tokens/s | 约 110 tokens/s(4K) | +| RTX 3060 12 GB, 46 GB 内存 | 9 到 11 tokens/s | 约 155 tokens/s(4K) | +| 1x Radeon AI PRO R9700, 251 GB 内存 | 21 到 25 tokens/s | 320 到 360 tokens/s (8K) | +| 4x Radeon AI PRO R9700 | 74 到 77 tokens/s | 400 到 450 tokens/s (8K) | + +[内存、磁盘和详细信息](docs/DEEPSEEK41.md) · [发行说明](https://github.com/Niko1221/Strata/releases) + +
+ + + +不确定哪个放得下?[为你的电脑选择模型](docs/MODELS.md#pick-by-memory)。 + +## 安装 + + + +### 桌面应用 + +**[下载适用于 Windows、Linux 或 Mac 的 Strata →](https://github.com/Niko1221/Strata/releases/latest)** + +安装应用,选择模型,就可以开始聊天。每个系统只有一个安装程序。首次启动时,应用会下载适合你显卡的引擎。[安装程序帮助](docs/INSTALL.md#the-app)。 + +文件: `Strata-0.2.5-windows-x64-setup.exe` · `Strata-0.2.5-linux-x86_64.AppImage` · `Strata-0.2.5-macos-arm64.dmg` + +

+ Strata 桌面应用,聊天和实时代码预览并排显示 +
聊天、文件和实时预览都在一个窗口里。 +

+ + + +### 终端应用 + +更喜欢终端?安装 Strata,然后运行 **`strata launch`**。 + +
+安装命令 + +**Linux / Mac** + +```sh +curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh +``` + +**Windows PowerShell** + +```powershell +irm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex +``` + +在 Windows 上,安装后请打开一个新的终端。然后运行: + +```sh +strata launch +``` + +按提示下载并启动模型。[终端指南](docs/TERMINAL_LAUNCH.md)。 + +
+ +

+ Strata 终端应用,显示模型活动、速度、内存和最近的请求 +
模型运行时,随时查看模型和硬件状态。 +

+ + + +[从源码构建](docs/SOURCE_INSTALL.md) · [Docker](docs/DOCKER.md) · [完整安装指南](docs/INSTALL.md) + + + +## 硬件 + +| 支持的硬件 | 指南 | +| --- | --- | +| **NVIDIA GeForce RTX 20 / 30 / 40 / 50 系列** | [NVIDIA 安装](docs/INSTALL.md#what-you-need) | +| **AMD Radeon RX 7700 / 7800 / 7900、RX 9060 / 9070、AI PRO R9700** | [AMD 安装](docs/AMD_HIP.md) | +| **AMD Radeon RX 6800 / 6900 · 实验性** | [RX 6000 安装](docs/AMD_HIP.md#rdna2-gfx1030) | +| **Intel Arc · Linux** | [Intel 安装](docs/INTEL_ARC.md) | +| **Apple Silicon · M1 或更新** | [Mac 安装](docs/MAC.md) | +| **AMD Ryzen AI Max · Strix Halo** | [Strix Halo 安装](docs/STRIX_HALO.md) | + + + +## 工具 + +**Claude Code · Codex CLI · OpenCode · oh-my-pi · pi.dev · Hermes Agent · OpenClaw**,也可以通过兼容 OpenAI 和 Anthropic 的 API 使用更多工具。 + +运行 **`strata connect`**,查看你所用工具的设置方法。[连接指南](docs/TERMINAL_LAUNCH.md#connect-your-apps-strata-connect)。 + + + + + + +## 帮助 + +[全部指南](docs) · [故障排查](docs/TROUBLESHOOTING.md) · [报告问题](https://github.com/Niko1221/Strata/issues/new/choose) · +[基准测试](docs/COMMUNITY_BENCHMARKS.md) · [工作原理](docs/HOW_IT_WORKS.md) · [参与贡献](CONTRIBUTING.md) + +## 支持 Strata + +**帮助本地 AI 保持开放。** 一杯咖啡能帮助我们在更多硬件上开发和测试。 + +Buy Me a Coffee:支持 Strata + +[MIT 许可证](LICENSE) · [致谢和模型许可证](docs/HOW_IT_WORKS.md#credits) · [隐私](docs/SAFETY.md) + + + +面向 AI 工具和自动阅读器: 技术参考 · 安装说明 + +**赞助、硬件合作或其他合作:** [niko.veit@outlook.com](mailto:niko.veit@outlook.com). diff --git a/engine/strata/SECURITY.md b/engine/strata/SECURITY.md new file mode 100644 index 00000000..8bd61c84 --- /dev/null +++ b/engine/strata/SECURITY.md @@ -0,0 +1,95 @@ +# Security + +## Reporting a vulnerability + +Please report anything that should not be public until it is fixed **privately**, through GitHub's private +vulnerability reporting: the repository's **Security** tab, **Report a vulnerability** +([direct link](https://github.com/Niko1221/Strata/security/advisories/new)). Say what you found, how to reproduce it +(the request, the config keys involved, the Strata version), and what an attacker gains. We answer there, fix it in +a release, and credit you in the advisory unless you ask us not to. + +Ordinary hardening ideas and findings that are safe to discuss in public are welcome as an +[issue](https://github.com/Niko1221/Strata/issues) (#544 collects audit findings) or as a pull request, which we +review like our own code. + +Supported: the latest release. Fixes go into the next release, not into older ones. + +## What the server exposes + +Strata runs a model on your PC and serves it over HTTP (`serve/server.py`). Out of the box it is reachable from +this PC only. The details and every setting are in [docs/DETAILS.md](docs/DETAILS.md) ("From other devices", +"Host names", "Web pages without an API key", "Tools from MCP servers"). + +- **Where it listens.** `127.0.0.1` by default. `--host 0.0.0.0` (or `"host"` in `strata-.json`) opens it to + your network, and the server then warns when no API key is set. +- **API key.** `"api_key"` in the run config (or `STRATA_API_KEY`) is required on `/v1/*` and on every endpoint + that shows the model's state, requests or answers (`/status`, `/metrics`, `/settings`, `/mcp`, `/props`, `/slots`, + `/api/requests`, `/config`) and on every `POST`. It is compared in constant time. Set one before you open the + server to your network or put a tunnel in front of it. +- **Host check (DNS rebinding, 0.1.38).** Without an API key the server answers only requests whose `Host` is a name + it knows (`localhost`, an IP address, the address it listens on and, when it listens beyond this PC, this PC's + name). Others get 403. `"allowed_hosts"` adds names; with an API key the key decides. +- **Origin check (0.1.38).** Without an API key, a browser `POST` to `/v1/*` from another web site's page (it carries + an `Origin` header) gets 403 unless that origin is Strata's own page, `localhost`, an allowed host, or listed in + `"trusted_origins"` / `"cors_origins"`. Changing settings (`/settings`, and `/config`: the few run config keys the + page's Model settings may change - never the network, key, MCP or program keys), `/load` and `/unload` and the + MCP tools are accepted only as JSON from Strata's own page (or `"trusted_origins"`), so a page elsewhere cannot + change settings or run tools. +- **CORS** is off unless `"cors_origins"` lists origins, and then only for `/v1/*`. +- **MCP tools** are opt-in: only the servers you put in the run config, only for requests from Strata's own page + that ask for them. They run with your user's rights, and the model decides when to call them. +- **The request monitor** (`/api-monitor`, which keeps the last prompts and answers in memory) is off unless + `"api_monitor": true` is set. Apart from it, the server keeps in its process memory the text and tokens of its + last few prompts, whatever `"api_monitor"` says, to encode the next turn faster; no endpoint shows them, and they + are gone when the server stops. + +## The desktop app and the Terminal + +Strata comes in three parts that share one engine: the **desktop app**, the **Terminal** (`strata`) and the **engine** that runs +the model. The section above is about the engine's HTTP server. This is what the other two add. + +- **The app's host listens on this PC only.** The app serves its page from a local host process on `127.0.0.1` (port 8791 unless + changed). A request to its `/api/` endpoints that carries a browser `Origin` from any other site gets 403. The app shell holds a + random secret (32 characters or more, compared in constant time) that is needed to quit the host or tell it which window is open, + and the host gives its own helper processes a second random secret. By default the models the app starts are served on this PC only. +- **Sharing is a separate, key-protected listener.** "Share with other devices" (and the Cloudflare tunnel) will not start until an + API key is set. It opens a different listener that answers only `/v1/models`, `/v1/chat/completions` and `/v1/messages`, never the + app's page or its host endpoints. +- **App and Terminal talk through an owner channel.** One owner process per installation starts and ends the engine, and a second + client (the Terminal) attaches to it. On macOS and Linux that is a private Unix socket in a folder only you can open. On Windows it + is a TCP listener on `127.0.0.1` that answers only requests carrying a 256-bit token kept in an owner-only folder. That is a weaker + guarantee than a socket other users cannot open: on Windows the token is what protects it, as with any loopback service that has a + token (`strata_control/owner_transport.py`). The bridge between the app shell and the host (used for the app update) is also loopback and protected by a token. +- **Starting a model and serving never download anything.** Downloads and updates are one explicit step: `strata update`, or "Update + engine" and "Update Strata" in the app's Settings. Models and saved tuning are never replaced by an update. +- **Updates come from a signed feed.** The release publishes `strata-feed.json` and `strata-feed.json.sig` (Ed25519). An installed + Strata checks the signature against the public key it carries (`strata_control/update_keys.json`), refuses a feed older than the last + one it accepted (a replayed old feed) or expired, and checks every engine package against its SHA-256, its signed manifest and the + card in your PC before it test-starts it and switches to it. Any failure keeps the engine you had. The app installer itself is signed + with a separate key (Tauri's minisign key) that the app and the Terminal both check. The private keys are kept offline by the owner. + See [packaging/UPDATES.md](packaging/UPDATES.md). + +### How far to trust `curl | sh` and `irm | iex` + +The Terminal installs with one line: + +```sh +curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh +irm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex +``` + +Piping a script into a shell runs whatever the server sends, so it deserves the same care as running any downloaded program. +What the script does is short and written at its top: it fetches the Terminal archive named in the release's `install-manifest.txt`, +checks its SHA-256, unpacks it into your home folder (no administrator rights, nothing outside your home), checks the release's signed feed +with the Terminal it just unpacked and removes it again if that fails, and puts `strata` on your PATH. + +Those checks have a limit. The checksum comes from the same release as the archive, and the public key that checks the feed arrives inside +that archive, so for the first install all trust rests on HTTPS and on the `Niko1221/Strata` GitHub release itself. The checks catch a +damaged or half-finished download and a feed that was not signed by the release key; they do not protect you if the release has been replaced +by someone who controls it. Later updates are checked against the key already on your PC, which is a stronger position. + +If that is not enough: save the script (`curl -fsSLO https://github.com/Niko1221/Strata/releases/latest/download/install.sh`), read it, and +run it from the file; or install the desktop app or build from source instead and check the code you build. + +Strata has not had an outside security audit yet. +What Strata downloads, when it uses the internet, what stays on your PC and how downloads are checked is written up in [docs/SAFETY.md](docs/SAFETY.md). diff --git a/engine/strata/START-HERE.bat b/engine/strata/START-HERE.bat index dfb92feb..5f255c07 100644 --- a/engine/strata/START-HERE.bat +++ b/engine/strata/START-HERE.bat @@ -2,8 +2,13 @@ rem Strata for Windows: the first run installs everything and starts the model; later runs just start it. rem Needs only an NVIDIA or AMD graphics driver. Python is installed for your user account if it is missing (no admin needed). setlocal +rem Python reads and writes text as UTF-8, not in the Windows code page (cp1251, cp866, ...): a folder or user name with Cyrillic or other letters stays intact (#3202). +set "PYTHONUTF8=1" title Strata cd /d "%~dp0" +rem A bundled Python runtime (the python\ folder of the terminal archive) is used when it is there: nothing to find, +rem install or download. SETUP.bat and UPDATE.bat run this file, so they use it too. +if exist "python\python.exe" goto bundled if exist ".venv\Scripts\python.exe" goto run call :findpy @@ -36,6 +41,14 @@ echo Could not create the Python environment in .venv pause exit /b 1 +:bundled +set "PYTHONNOUSERSITE=1" +set "PYTHONHOME=" +set "PYTHONPATH=" +"python\python.exe" setup.py %* +if errorlevel 1 pause +exit /b + :run ".venv\Scripts\python.exe" setup.py %* if errorlevel 1 pause diff --git a/engine/strata/UPDATE.bat b/engine/strata/UPDATE.bat new file mode 100644 index 00000000..c0fd78a1 --- /dev/null +++ b/engine/strata/UPDATE.bat @@ -0,0 +1,82 @@ +@echo off +rem Update Strata without starting the model (#475): the newest code (git pull, when this folder is a git clone), then +rem what START-HERE.bat does before a start - the engine (a new one when this version needs it), the Python packages, +rem each installed model's settings and draft subset. The model files are not touched. Start the model later with +rem START-HERE.bat. Options are passed on to setup.py. The bundled Python (python\ beside this file) is used when +rem there is one: START-HERE.bat, which this file runs, picks it. +setlocal +title Strata - update +cd /d "%~dp0" +rem All of it in one block: cmd reads a .bat file while it runs it, and the git pull can change this very file. +( + if exist ".git" ( + where git >nul 2>nul || ( + echo This folder is a git clone, but git is not on PATH: install Git for Windows ^(winget install Git.Git^) + echo or run "git pull" here yourself, then run UPDATE.bat again. + pause + exit /b 1 + ) + echo Getting the newest Strata ^(git pull^) ... + git pull --ff-only + if errorlevel 1 ( + rem The history was rewritten on 2026-10-06, see #1276: a clone from before has no commit in common with origin/main. + set "REWR=" + git merge-base HEAD origin/main >nul 2>nul + if errorlevel 1 set "REWR=1" + git rev-parse --is-shallow-repository 2>nul | findstr /x true >nul && set "REWR=" + if defined REWR ( + echo. + echo This clone is on the repository's old history ^(cleaned up on 2026-10-06^): it has no commit in common + echo with origin/main, so it cannot be updated by git pull. + set "DIRTY=" + for /f "delims=" %%i in ('git status --porcelain --untracked-files^=no') do set "DIRTY=1" + if defined DIRTY ( + echo You have local changes to tracked files here, so nothing was touched. To move to the new history + echo yourself ^(your untracked files, models and settings stay where they are^): + echo git branch pre-cleanup-backup + echo git stash push + echo git checkout -B main origin/main + echo then run UPDATE.bat again. + pause + exit /b 1 + ) + set "BK=pre-cleanup-backup" + git rev-parse --verify -q refs/heads/pre-cleanup-backup >nul 2>nul && set "BK=pre-cleanup-backup-%RANDOM%" + set "BR=main" + for /f "delims=" %%i in ('git symbolic-ref --short -q HEAD 2^>nul') do set "BR=%%i" + call git branch %%BK%% HEAD + if errorlevel 1 ( + echo Could not make the backup branch: nothing was updated. + pause + exit /b 1 + ) + call git checkout -q -B %%BR%% origin/main + if errorlevel 1 ( + call git branch -D %%BK%% >nul 2>nul + echo. + echo Could not move to the new history ^(the reason is above^): nothing was updated. By hand: + echo git checkout -B main origin/main + pause + exit /b 1 + ) + call echo Moved to the new history. Your old commits are kept in the branch %%BK%%. + echo Untracked files ^(models, settings, the engine^) were not touched. + ) else ( + echo. + echo git pull did not succeed ^(the reason is above^): nothing was updated. Files you changed here can stop it: + echo "git status" lists them. + pause + exit /b 1 + ) + ) + ) else ( + echo This copy of Strata was not made with git, so it cannot fetch new files itself. Download the newest one: + echo https://github.com/Niko1221/Strata/archive/refs/heads/main.zip + echo unzip it anywhere and run START-HERE.bat ^(or UPDATE.bat^) in it: it finds the model files in Strata-data + echo and sets itself up the same way - nothing big is downloaded again. + echo Checking this copy's engine and settings meanwhile ... + ) + call "%~dp0START-HERE.bat" --update %* + if not errorlevel 1 pause + exit /b +) diff --git a/engine/strata/apps/desktop/package-lock.json b/engine/strata/apps/desktop/package-lock.json new file mode 100644 index 00000000..448060e1 --- /dev/null +++ b/engine/strata/apps/desktop/package-lock.json @@ -0,0 +1,232 @@ +{ + "name": "strata-desktop", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "strata-desktop", + "version": "0.1.0", + "devDependencies": { + "@tauri-apps/cli": "2.12.3" + } + }, + "node_modules/@tauri-apps/cli": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.12.3.tgz", + "integrity": "sha512-f7/LsY74SVb1ChmOPw1ajOpxii0GSzDAgmWHRci8JUYuuai04rXsSbFobpmB0sP2DdlvMD/B5ZotEn8GOGMRUg==", + "dev": true, + "license": "Apache-2.0 OR MIT", + "bin": { + "tauri": "tauri.js" + }, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/tauri" + }, + "optionalDependencies": { + "@tauri-apps/cli-darwin-arm64": "2.12.3", + "@tauri-apps/cli-darwin-x64": "2.12.3", + "@tauri-apps/cli-linux-arm-gnueabihf": "2.12.3", + "@tauri-apps/cli-linux-arm64-gnu": "2.12.3", + "@tauri-apps/cli-linux-arm64-musl": "2.12.3", + "@tauri-apps/cli-linux-riscv64-gnu": "2.12.3", + "@tauri-apps/cli-linux-x64-gnu": "2.12.3", + "@tauri-apps/cli-linux-x64-musl": "2.12.3", + "@tauri-apps/cli-win32-arm64-msvc": "2.12.3", + "@tauri-apps/cli-win32-ia32-msvc": "2.12.3", + "@tauri-apps/cli-win32-x64-msvc": "2.12.3" + } + }, + "node_modules/@tauri-apps/cli-darwin-arm64": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.12.3.tgz", + "integrity": "sha512-xmVNoJOOKzKLj7GLHXmXLimRby9M42aBIJa0sB80N7o24eKV5JiVmToKTRLVH9yhL05GZ/B6rSSOmbzNFJwBAA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-darwin-x64": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.12.3.tgz", + "integrity": "sha512-URd+0usfmUQQyb5kNPiKt2OT8gp7oGU7QR+qOppB6e35mpVBFFVNhWc9oWb3p0u71fDJ09DpF4T6m9xYxoIB8g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm-gnueabihf": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.12.3.tgz", + "integrity": "sha512-0kwUVx2LbmOoTRlwF1oDww7th4/NSluv4ZBQ6KRZsFKg4g0TlTcIiJ0VehqkQYUeC9xIT1Mk6XtF52mI155VSQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm64-gnu": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.12.3.tgz", + "integrity": "sha512-gKSGDx6fx+HBLQmG6guChFdisbrCSdx9Yli+j5teOa64gm1CeM+C6NLru5Pj3ZkkEep05BmCFjxvX+cjqAycZQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm64-musl": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.12.3.tgz", + "integrity": "sha512-Yr59qMy/gcvAfBuFdCGlAmGiLsYWMFDbsP4bAI6iNBzcJTGrYWZGeiQhGDo29MQwfF/NUBqyM2qljXu5tZ6wjQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-riscv64-gnu": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.12.3.tgz", + "integrity": "sha512-jKr0/REBMnLKC0OwPQZkyge0mKDaNZ0b/AbfGwVyCgFfwS730EVLfVDo3nt7MUu6jJaytRq08+xSj5qfy+U1+Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-x64-gnu": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.12.3.tgz", + "integrity": "sha512-gTkEqJAGCMROGanxHnzaJzQ+/rXl39HWVg0/hDODS1wDWBGqoceqGC6Qm1+mQbyT11xnsB8mKu/gyVID/YpFIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-x64-musl": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.12.3.tgz", + "integrity": "sha512-T2dTxL1svRym71fZtaW4pZYXbthbfFsEJr1NeOUg/p7laWXZbUt/8DMSZf8recu9f7+1F/Lv00HtzsEu6vDO9w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-arm64-msvc": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.12.3.tgz", + "integrity": "sha512-eoiQwpEZWbpsVHcM9BAzqqe4TCHszvr3rsM7pUQ4ofLK0lF1i1d/jX0Qo5DYMqcrUtwQuDdDuOCbcT0Izf1VwQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-ia32-msvc": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.12.3.tgz", + "integrity": "sha512-kE+KUg6Dbbkgvcw0m99wJVIToFQzJqpMBAXah74WqxaLzssNwSTUccrHp6+QVzMhjQP330tvekFmnQF+0NbE6Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-x64-msvc": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.12.3.tgz", + "integrity": "sha512-L7wndWAgX2mLW7alswpL3d1R0P9FN2WYBgHaQkAYEBxHHGkY4vFX9CjcRQ1LAxDAMIJxrY7/aDziFJeChS84NQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + } + } +} diff --git a/engine/strata/apps/desktop/package.json b/engine/strata/apps/desktop/package.json new file mode 100644 index 00000000..e66e5fbc --- /dev/null +++ b/engine/strata/apps/desktop/package.json @@ -0,0 +1,20 @@ +{ + "name": "strata-desktop", + "productName": "Strata", + "version": "0.2.5", + "private": true, + "description": "Strata Desktop - local AI, tuned to one model.", + "scripts": { + "build:ui": "npm --prefix ../host run build", + "typecheck:ui": "npm --prefix ../host run typecheck", + "test:ui": "npm --prefix ../host test", + "tauri": "tauri", + "dev": "npm run build:ui && tauri dev", + "build": "npm run build:ui && tauri build", + "build:app": "npm run build:ui && tauri build --bundles app", + "dmg": "npm run build:ui && tauri build --bundles dmg" + }, + "devDependencies": { + "@tauri-apps/cli": "2.12.3" + } +} diff --git a/engine/strata/apps/desktop/scripts/app-close-matrix.py b/engine/strata/apps/desktop/scripts/app-close-matrix.py new file mode 100644 index 00000000..31e65b98 --- /dev/null +++ b/engine/strata/apps/desktop/scripts/app-close-matrix.py @@ -0,0 +1,361 @@ +#!/usr/bin/env python3 +"""The installed Windows app, closed every way, with a stub engine: nothing may be left running. + + python apps/desktop/scripts/app-close-matrix.py --install [--scenarios all] [--report out.json] + +For each case it starts the REAL installed `strata-desktop.exe` (its window opens), loads a stub engine through the host's API +(profile + `runtime start` under Control's owner runtime, exactly the app's path), records every process of the tree (the app, +the host, Control, the owner host, the server, the engine), ends the app one way, and asserts: + * no process of the tree is left, the engine's port is free, the runtime lease can be taken again; + * the engine got the clean stop where the way of closing allows one (normal close, window X); + * the next load of the same slot works (a lost owner's state is cleaned, not a blocker). +It also proves a second launch focuses the open window and starts nothing, and that one app runs two engines and closes both. +Everything per-user lives under a scratch folder; the stub engine is a script. No real engine ever runs. +""" +from __future__ import annotations + +import argparse +import ctypes +import json +import os +import subprocess +import sys +import tempfile +import time +import urllib.error +import urllib.request +from ctypes import wintypes +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[3] +sys.path.insert(0, str(ROOT)) + +import psutil # noqa: E402 + +from strata_control import procs, runtime # noqa: E402 +from tests.terminal.lifecycle_matrix import install_fake_engine, port_open # noqa: E402 + +if os.name != "nt": + raise SystemExit("this matrix drives the Windows installer's app") + +user32 = ctypes.WinDLL("user32", use_last_error=True) +WM_CLOSE = 0x0010 + + +def main_window(pid: int) -> int | None: + found = [] + + @ctypes.WINFUNCTYPE(wintypes.BOOL, wintypes.HWND, wintypes.LPARAM) + def visit(hwnd, _): + owner = wintypes.DWORD() + user32.GetWindowThreadProcessId(hwnd, ctypes.byref(owner)) + if owner.value == pid and user32.IsWindowVisible(hwnd): + buf = ctypes.create_unicode_buffer(256) + user32.GetWindowTextW(hwnd, buf, 256) + if buf.value.strip() == "Strata": + found.append(hwnd) + return True + user32.EnumWindows(visit, 0) + return found[0] if found else None + + +class Scratch: + def __init__(self, root: Path, install: Path): + self.root, self.install = root, install + self.components = root / "components" + self.models = root / "models" + self.mark = root / "mark" + for d in (self.components, self.models, self.mark, root / "local", root / "home", root / "appdata", root / "webview"): + d.mkdir(parents=True, exist_ok=True) + install_fake_engine(self.components) + from tools.strata_tokenizer import BYTE_TO_UNICODE + tok = self.models / "tokenizer" + tok.mkdir() + tokens = [BYTE_TO_UNICODE[i] for i in range(256)] + ["ab", "<|im_start|>", "<|im_end|>", "<|endoftext|>"] + (tok / "vocab.json").write_text(json.dumps({t: i for i, t in enumerate(tokens)})) + (tok / "merges.txt").write_text("a b") + (tok / "token_type.json").write_text(json.dumps([0] * 257 + [3, 3, 3])) + for name in ("stub", "stub2"): + (self.models / f"strata-{name}.json").write_text(json.dumps({ + "exe": "component:strata-engine", "backend": "cuda", "tokenizer": str(tok), "args": [], "cwd": str(root), + "model_name": name, "host": "127.0.0.1", "port": 0})) + self.env = {**os.environ, "STRATA_COMPONENTS_DIR": str(self.components), "STRATA_PROFILE_DIR": str(root / "profiles"), + "STRATA_RUNTIME_DIR": str(root / "runtime"), "STRATA_INSTALL_DIR": str(self.models), + "STRATA_MODELS_DIR": str(root / "models-unused"), "STRATA_ENGINE_BACKEND": "cuda", + "STRATA_HOME": str(root / "home"), "APPDATA": str(root / "appdata"), "LOCALAPPDATA": str(root / "local"), + "WEBVIEW2_USER_DATA_FOLDER": str(root / "webview"), "FAKE_ENGINE_MARK": str(self.mark), + "FAKE_ENGINE_SLOW_STEPS": "0", "PYTHONDONTWRITEBYTECODE": "1"} + self.env.pop("STRATA_API_KEY", None) + for key in ("STRATA_COMPONENTS_DIR", "STRATA_PROFILE_DIR", "STRATA_RUNTIME_DIR", "LOCALAPPDATA", "STRATA_ENGINE_BACKEND", + "STRATA_NO_ACQUIRE", "FAKE_ENGINE_MARK"): + os.environ[key] = self.env.get(key, "1") # this process reads the same runtime and records folders + + +class App: + def __init__(self, scratch: Scratch): + self.s = scratch + self.proc = subprocess.Popen([str(scratch.install / "strata-desktop.exe")], cwd=scratch.install, env=scratch.env, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + self.base = None + + def host(self): + for child in psutil.Process(self.proc.pid).children(recursive=True): + if child.name().lower() == "node.exe": + return child + return None + + def wait_up(self, seconds=90): + deadline = time.monotonic() + seconds + while time.monotonic() < deadline: + if self.proc.poll() is not None: + raise RuntimeError(f"the app exited with {self.proc.returncode}") + try: + host = self.host() + if host: + for c in host.net_connections(kind="tcp"): + if c.status == "LISTEN" and c.laddr.ip == "127.0.0.1": + base = f"http://127.0.0.1:{c.laddr.port}" + try: + if urllib.request.urlopen(base + "/api/health", timeout=2).status == 200 and main_window(self.proc.pid): + self.base = base + return + except OSError: + pass + except psutil.Error: + pass + time.sleep(0.5) + raise RuntimeError("the app did not come up") + + def call(self, path, method="GET", body=None): + req = urllib.request.Request(self.base + path, method=method, data=None if body is None else json.dumps(body).encode(), + headers={"content-type": "application/json"}) + try: + with urllib.request.urlopen(req, timeout=120) as r: + return json.loads(r.read() or b"null") + except urllib.error.HTTPError as exc: + raise RuntimeError(f"{method} {path} -> {exc.code} {exc.read()[:300]!r}") from None + + def load(self, model, multiple=False): + self.call("/api/native?refresh=1") + started = self.call("/api/native/operations", "POST", {"kind": "load", "args": {"model": model, **({"multiple": True} if multiple else {})}}) + deadline = time.monotonic() + 180 + while time.monotonic() < deadline: + state = self.call("/api/native") + job = next((j for j in state["jobs"] if j["id"] == started["id"]), None) + if job and job["state"] != "running": + if job["state"] != "done": + raise RuntimeError(f"load {model}: {job['state']} {job.get('error')}") + return state + time.sleep(0.3) + raise RuntimeError("load did not finish") + + +def tree_of(app: App, slots=("app-1",)) -> tuple[list[procs.Ident], list[int]]: + idents, ports = [], [] + members = [psutil.Process(app.proc.pid), *psutil.Process(app.proc.pid).children(recursive=True)] + pids = {p.pid for p in members} + for slot in slots: + state = runtime._read_state(slot) + if state: + pids.add(state["host_pid"]) + for r in procs.records(): + if r.get("profile") in slots: # the app's own slots; a Terminal service is not part of the app's tree + pids.add(r["pid"]) + for pid in pids: + token = procs.start_token(pid) + if token: + idents.append(procs.Ident(pid, token, tuple(procs.command_line(pid) or []))) + return idents, ports + + +def survivors(idents): + return [f"{i.pid} {' '.join(i.cmd)[:80]}" for i in idents if procs.start_token(i.pid) == i.token] + + +def wait_gone(idents, seconds): + deadline = time.monotonic() + seconds + left = survivors(idents) + while left and time.monotonic() < deadline: + time.sleep(0.25) + left = survivors(idents) + return left + + +def lease_free() -> bool: + try: + fd = runtime.acquire_activity_lease(shared=False) + except Exception: # noqa: BLE001 + return False + runtime._unlock_file(fd) + os.close(fd) + return True + + +def control(scratch: Scratch, *argv: str, timeout: int = 300) -> dict: + py = scratch.install / "control" / "python" / "python.exe" + out = subprocess.run([str(py), str(scratch.install / "control" / "strata.py"), *argv, "--output", "json"], + env={**scratch.env, "PYTHONNOUSERSITE": "1", "STRATA_NO_ACQUIRE": "1"}, + capture_output=True, text=True, timeout=timeout) + try: + return json.loads(out.stdout) + except ValueError: + return {"ok": False, "raw": out.stdout[-300:] + out.stderr[-300:]} + + +def stop_cli(scratch: Scratch, slot: str) -> dict: + py = scratch.install / "control" / "python" / "python.exe" + out = subprocess.run([str(py), str(scratch.install / "control" / "strata.py"), "runtime", "stop", "--profile", slot, "--wait", "30", + "--output", "json"], env={**scratch.env, "PYTHONNOUSERSITE": "1", "STRATA_NO_ACQUIRE": "1"}, + capture_output=True, text=True, timeout=120) + try: + return json.loads(out.stdout) + except ValueError: + return {"state": "?", "raw": out.stdout[-200:] + out.stderr[-200:]} + + +def case(name: str, install: Path, how: str) -> dict: + with tempfile.TemporaryDirectory(prefix="strata-app-matrix-", ignore_cleanup_errors=True) as tmp: + saved = dict(os.environ) + scratch = Scratch(Path(tmp), install) + app = App(scratch) + problems, note = [], "" + try: + app.wait_up() + slots = ("app-1", "app-2") if how == "two-engines" else ("app-1",) + terminal = None + if how == "window-x-terminal-engine": + # an engine the Terminal started (its own profile, no tie to the app) must survive the app's close + control(scratch, "profile", "create", "terminal-1", "--from-config", str(scratch.models / "strata-stub2.json")) + terminal = control(scratch, "runtime", "start", "--profile", "terminal-1", "--wait", "60") + if terminal.get("state") != "ready": + raise RuntimeError(f"the Terminal's service did not start: {terminal}") + terminal_pids = {r["pid"] for r in procs.records(profile="terminal-1")} | {runtime._read_state("terminal-1")["host_pid"]} + state = app.load("stub") + if how == "two-engines": + state = app.load("stub2", multiple=True) + engine_ports = [i["port"] for i in state["instances"]] + idents, _ = tree_of(app, slots) + kinds = sorted({("engine" if "engine" in " ".join(i.cmd) else "server" if "serve.server" in " ".join(i.cmd) else + "owner" if "strata_control.runtime" in " ".join(i.cmd) else "app" if "strata-desktop" in i.cmd[0].lower() + else "host" if "node" in i.cmd[0].lower() else "other") for i in idents}) + note = f"tree {len(idents)} processes: {', '.join(kinds)}; engine ports {engine_ports}" + t0 = time.monotonic() + if how == "normal-close": + subprocess.run(["taskkill", "/PID", str(app.proc.pid)], capture_output=True) + elif how in ("window-x", "two-engines", "window-x-terminal-engine"): + hwnd = main_window(app.proc.pid) + if not hwnd: + raise RuntimeError("no main window") + user32.PostMessageW(hwnd, WM_CLOSE, 0, 0) + elif how == "kill-app": + subprocess.run(["taskkill", "/F", "/PID", str(app.proc.pid)], capture_output=True) + elif how == "host-crash": + host = app.host() + subprocess.run(["taskkill", "/F", "/PID", str(host.pid)], capture_output=True) + elif how == "second-launch": + second = subprocess.Popen([str(install / "strata-desktop.exe")], cwd=install, env=scratch.env, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + try: + code = second.wait(timeout=30) + except subprocess.TimeoutExpired: + second.kill() + problems.append("the second launch did not exit") + code = None + time.sleep(2) + hosts = [p for p in psutil.process_iter(["name", "pid"]) if p.info["name"].lower() == "node.exe" + and (p.parent() and p.parent().pid == app.proc.pid)] + apps = [p for p in psutil.process_iter(["name"]) if p.info["name"].lower() == "strata-desktop.exe"] + if app.proc.poll() is not None: + problems.append("the first app went away") + if len(apps) != 1: + problems.append(f"{len(apps)} app processes (want 1)") + if len(hosts) != 1: + problems.append(f"{len(hosts)} hosts under the first app (want 1)") + after, _ = tree_of(app, slots) + new = [i for i in after if i.pid not in {x.pid for x in idents}] + if new: + problems.append(f"the second launch started: {[' '.join(i.cmd)[:60] for i in new]}") + note += f"; second launch exit code {code}, app processes {len(apps)}, hosts {len(hosts)}" + subprocess.run(["taskkill", "/PID", str(app.proc.pid)], capture_output=True) + if how == "host-crash": + # the shell and its window stay (nothing here restarts a dead host); the host, Control's owner, the server and + # the engine must not + idents = [i for i in idents if any(k in " ".join(i.cmd) for k in ("strata_control.runtime", "serve.server", "engine", "node.exe"))] + left = wait_gone(idents, 90) + if left: + problems.append(f"processes left: {left}") + for port in engine_ports: + deadline = time.monotonic() + 10 + while port_open(port) and time.monotonic() < deadline: + time.sleep(0.2) + if port_open(port): + problems.append(f"engine port {port} still open") + if terminal is None and not lease_free(): + problems.append("lease still held") + marks = sorted(p.name for p in scratch.mark.iterdir()) + if terminal is not None: + status = control(scratch, "runtime", "status", "--profile", "terminal-1") + alive_pids = [p for p in terminal_pids if procs.start_token(p)] + if status.get("state") != "ready" or len(alive_pids) != len(terminal_pids): + problems.append(f"closing the app disturbed the Terminal's service: {status.get('state')}, alive {alive_pids} of {sorted(terminal_pids)}") + note += f"; the Terminal's service is {status.get('state')} after the app closed" + stopped = control(scratch, "runtime", "stop", "--profile", "terminal-1", "--wait", "30") + if stopped.get("state") != "stopped" or [p for p in terminal_pids if procs.start_token(p)]: + problems.append(f"the Terminal's service did not stop on request: {stopped}") + time.sleep(1) + if not lease_free(): + problems.append("lease still held after the Terminal's service stopped") + if how in ("normal-close", "window-x", "two-engines", "second-launch", "window-x-terminal-engine") and not ({"quit", "eof"} & set(marks)): + problems.append(f"the engine was not stopped the clean way (marks {marks})") + seconds = round(time.monotonic() - t0, 1) + if how == "host-crash": + subprocess.run(["taskkill", "/PID", str(app.proc.pid)], capture_output=True) + note += "; the app shell stays open after a host crash (by design today)" + # the slot must be usable again: stopping a lost owner's slot cleans its state; nothing blocks the next load + for slot in slots: + res = stop_cli(scratch, slot) + already = "not managed or is stopped" in json.dumps(res) # nothing was left to stop: the clean outcome + if res.get("state") not in ("stopped",) and not already: + problems.append(f"runtime stop {slot} after the close: {res}") + if runtime._read_state(slot) is not None: + problems.append(f"state of {slot} left behind") + return {"name": f"app-{how}", "ok": not problems, "problems": problems, "seconds": seconds, "marks": marks, "note": note} + except Exception as exc: # noqa: BLE001 + return {"name": f"app-{how}", "ok": False, "problems": [f"{type(exc).__name__}: {exc}"] + problems, "note": note} + finally: + for p in psutil.process_iter(["name", "exe"]): + try: + if (p.info["exe"] or "").lower().startswith(str(install).lower()): + p.kill() + except psutil.Error: + pass + for r in procs.records(): + try: + psutil.Process(r["pid"]).kill() + except psutil.Error: + pass + os.environ.clear(); os.environ.update(saved) + + +SCENARIOS = ["normal-close", "window-x", "window-x-terminal-engine", "kill-app", "host-crash", "second-launch", "two-engines"] + + +def main() -> int: + ap = argparse.ArgumentParser() + ap.add_argument("--install", required=True) + ap.add_argument("--scenarios", default="all") + ap.add_argument("--report") + a = ap.parse_args() + names = SCENARIOS if a.scenarios == "all" else a.scenarios.split(",") + results = [] + for how in names: + r = case(how, Path(a.install), how) + results.append(r) + print(("PASS " if r["ok"] else "FAIL ") + r["name"], r.get("seconds", ""), r.get("problems") or "", r.get("note", ""), flush=True) + if a.report: + Path(a.report).write_text(json.dumps({"platform": "windows", "engine": "fake", "results": results}, indent=1), encoding="utf-8") + return 0 if all(r["ok"] for r in results) else 1 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/engine/strata/apps/desktop/scripts/cards-e2e.mjs b/engine/strata/apps/desktop/scripts/cards-e2e.mjs new file mode 100644 index 00000000..fe31a7f4 --- /dev/null +++ b/engine/strata/apps/desktop/scripts/cards-e2e.mjs @@ -0,0 +1,110 @@ +#!/usr/bin/env node +/** + * The Graphics cards choice of the app, end to end on a box with two cards, through the installed app layout (packaged host + bundled Control + a real + * engine component): the model list carries the options (one rule, strata_control/gpu_fit.py), a model that fits one card recommends that card, then + * load with ONE card -> answers, only that card holds the model; load with BOTH cards (the layer split) -> answers, both cards hold the model. + * + * node cards-e2e.mjs --install --components > --work \ + * --family qwen --model IQ3_XXS --data [--smi "nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits"] + */ +import { spawn, spawnSync } from 'node:child_process'; +import { existsSync, mkdirSync, readdirSync } from 'node:fs'; +import { createServer } from 'node:net'; +import { join, resolve } from 'node:path'; + +const args = Object.fromEntries(process.argv.slice(2).reduce((acc, a, i, all) => (a.startsWith('--') ? [...acc, [a.slice(2), all[i + 1]?.startsWith('--') || all[i + 1] === undefined ? true : all[i + 1]]] : acc), [])); +for (const need of ['install', 'components', 'work', 'model']) if (!args[need]) { console.error('missing --' + need); process.exit(2); } +const install = resolve(args.install), work = resolve(args.work), components = resolve(args.components), family = String(args.family ?? 'qwen'), modelId = String(args.model); +const node = join(install, 'node', 'node'), hostEntry = join(install, 'host', 'server', 'index.mjs'); +const dirs = { models: join(work, 'models'), profiles: join(work, 'profiles'), runtime: join(work, 'runtime'), home: join(work, 'home'), xdg: join(work, 'xdg'), appdata: join(work, 'appdata') }; +for (const d of [dirs.models, dirs.home, dirs.xdg, dirs.appdata]) mkdirSync(d, { recursive: true }); +const delay = ms => new Promise(r => setTimeout(r, ms)); +let failed = false; +const record = (name, ok, detail = '') => { if (!ok) failed = true; console.log(`${ok ? 'ok ' : 'FAIL'} ${name}${detail ? ' ' + String(detail).slice(0, 500) : ''}`); }; +const freePort = async () => { const s = createServer(); await new Promise(r => s.listen(0, '127.0.0.1', r)); const p = s.address().port; await new Promise(r => s.close(r)); return p; }; +const env = { ...process.env, STRATA_COMPONENTS_DIR: components, STRATA_PROFILE_DIR: dirs.profiles, STRATA_RUNTIME_DIR: dirs.runtime, STRATA_INSTALL_DIR: dirs.models, + STRATA_HOME: dirs.home, STRATA_MODELS_DIR: join(work, 'models-unused'), APPDATA: dirs.appdata, XDG_CONFIG_HOME: dirs.xdg, PYTHONDONTWRITEBYTECODE: '1' }; +delete env.STRATA_API_KEY; +const port = await freePort(); +const base = `http://127.0.0.1:${port}`; +const host = spawn(node, [hostEntry], { cwd: join(install, 'host'), stdio: ['ignore', 'pipe', 'pipe'], + env: { ...env, STRATA_PORT: String(port), STRATA_DIST: join(install, 'host', 'dist'), NODE_ENV: 'production', STRATA_PACKAGED: '1', STRATA_REAL_ENGINE: '1', STRATA_NO_ACQUIRE: '1', + STRATA_SHARE_PORT: String(await freePort()), STRATA_TUNNEL_PORT: String(await freePort()) } }); +let hostLog = ''; +host.stdout.on('data', c => { hostLog += c; }); host.stderr.on('data', c => { hostLog += c; }); +const call = async (path, method = 'GET', body) => { + const response = await fetch(base + path, { method, headers: { 'content-type': 'application/json' }, body: body === undefined ? undefined : JSON.stringify(body) }); + return { status: response.status, body: await response.json().catch(() => null) }; +}; +async function waitJob(id, seconds) { + let last = ''; + for (let i = 0; i < seconds * 2; i++) { + const state = (await call('/api/native')).body; + const job = state.jobs.find(j => j.id === id); + if (job && job.summary !== last) { last = job.summary; console.log(' ... ' + String(last).slice(0, 120)); } + if (job && job.state !== 'running') return { job, state }; + await delay(500); + } + throw new Error('operation did not finish'); +} +const smi = () => { + const cmd = String(args.smi ?? 'nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits').split(' '); + const r = spawnSync(cmd[0], cmd.slice(1), { encoding: 'utf8' }); + return (r.stdout ?? '').split('\n').map(s => Number(s.trim())).filter(Number.isFinite); +}; +async function chatPong(instance) { + const chat = await call('/v1/chat/completions', 'POST', { model: instance?.apiModelId ?? modelId.toLowerCase(), max_tokens: 400, stream: false, temperature: 0, messages: [{ role: 'user', content: 'Reply with exactly one word: pong' }] }); + const m = chat.body?.choices?.[0]?.message ?? {}; + return { ok: chat.status === 200 && /pong/i.test(`${m.content ?? ''}`), text: `${m.content ?? ''}`.slice(0, 60), status: chat.status }; +} +async function main() { + let up = false; + for (let i = 0; i < 200 && !up; i++) { try { up = (await fetch(base + '/api/health')).ok; } catch { /* not yet */ } if (!up) await delay(150); } + record('host healthy', up, up ? base : hostLog.slice(-500)); + if (!up) return; + const packages = existsSync(join(components, 'engine')) ? readdirSync(join(components, 'engine')) : []; + record('an engine component is installed', packages.length > 0, packages.join(', ')); + + // ---- the model list carries the choice + const native = (await call('/api/native?refresh=1')).body; + const gpus = native.hardware?.gpus ?? []; + record('the host sees two or more graphics cards', gpus.filter(g => g.usable !== false).length >= 2, JSON.stringify(gpus.map(g => ({ i: g.index, n: g.name, gb: g.vram_gb })))); + const size = native.catalog?.families?.find(f => f.family === family)?.sizes.find(s => s.model === modelId); + const opt = size?.gpu_options; + record('the model list offers the cards choice for this model', !!opt && opt.options.length >= 2, JSON.stringify(opt?.options?.map(o => ({ key: o.key, cards: o.cards, verdict: o.verdict, rec: o.recommended })))); + record('a model that fits one card recommends the single largest card (the split is offered, not forced)', opt?.recommended === 'single' && opt.options.find(o => o.key === 'split'), `recommended=${opt?.recommended}`); + const single = opt?.options.find(o => o.key === 'single')?.cards ?? [0]; + const both = opt?.options.find(o => o.key === 'split')?.cards ?? [0, 1]; + + // ---- Download and prepare with the recommended card + const values = { family, model: modelId, context: 32768, vision: 'no', gpu: single[0], ...(args.data ? { data_dir: resolve(args.data) } : {}) }; + const started = await call('/api/native/operations', 'POST', { kind: 'install', args: values }); + record('the install operation starts', started.status === 200 || started.status === 202, JSON.stringify(started.body).slice(0, 160)); + const done = await waitJob(started.body.id, 3600); + record('Download and prepare finishes', done.job.state === 'done', `${done.job.state} ${done.job.error ?? done.job.summary}`); + const installed = (await call('/api/native?refresh=1')).body.installed?.models?.find(m => String(m.model).toLowerCase() === modelId.toLowerCase()); + const model = installed?.model ?? modelId.toLowerCase(); + + for (const [label, cards] of [['ONE card', single], ['BOTH cards (layer split)', both]]) { + const before = smi(); + const load = await call('/api/native/operations', 'POST', { kind: 'load', args: { model, gpus: cards } }); + const loaded = await waitJob(load.body.id, 900); + const instance = loaded.state.instances[0]; + record(`load with ${label} starts the engine`, loaded.job.state === 'done' && instance?.status === 'ready', `${loaded.job.state} ${loaded.job.error ?? ''}; instance=${instance?.status}; gpus=${JSON.stringify(instance?.gpus)}`); + record(`the instance runs on exactly the chosen card(s)`, JSON.stringify([...(instance?.gpus ?? [])].sort()) === JSON.stringify([...cards].sort()), `want ${JSON.stringify(cards)} got ${JSON.stringify(instance?.gpus)}`); + await delay(3000); + const used = smi(); + const holding = used.map((mb, i) => (mb - (before[i] ?? 0)) > 1000 ? i : -1).filter(i => i >= 0); + record(`only the chosen card(s) hold the model (graphics memory in use: ${used.join(', ')} MiB)`, JSON.stringify(holding) === JSON.stringify([...cards].sort()), `holding ${JSON.stringify(holding)}`); + const pong = await chatPong(instance); + record(`it answers (${label})`, pong.ok, `${pong.status} ${JSON.stringify(pong.text)}`); + const unloaded = await call(`/api/native/instances/${instance?.id}/unload`, 'POST', {}); + record(`unload (${label})`, unloaded.status === 200, unloaded.status); + await delay(4000); + } +} +try { await main(); } catch (e) { record('run', false, e.stack ?? e); } +host.kill(); +await delay(1500); +console.log(failed ? 'CARDS-E2E FAIL' : 'CARDS-E2E PASS'); +process.exit(failed ? 1 : 0); diff --git a/engine/strata/apps/desktop/scripts/fetch-node.ps1 b/engine/strata/apps/desktop/scripts/fetch-node.ps1 new file mode 100644 index 00000000..2d833a9b --- /dev/null +++ b/engine/strata/apps/desktop/scripts/fetch-node.ps1 @@ -0,0 +1,72 @@ +# Fetch and verify the private Node runtime the Windows desktop bundle ships (win-x64). +# +# The PowerShell twin of fetch-node.sh: same pinned version, same SHA-256 pin, same refusal to +# install anything whose digest does not match. Not committed output: node.exe is a ~90 MB binary. +# +# Usage: +# powershell -NoProfile -ExecutionPolicy Bypass -File apps\desktop\scripts\fetch-node.ps1 +# ... -File fetch-node.ps1 -Check # verify what is already installed +# ... -File fetch-node.ps1 -FromFile node.zip # verify and install a zip you already have (offline) +# +# The Node version must satisfy the App Host's own engines.node (>= 24.12.0). +[CmdletBinding()] +param( + [switch]$Check, + [string]$FromFile = '', + [string]$Dest = '' +) +$ErrorActionPreference = 'Stop' + +$NodeVersion = if ($env:STRATA_NODE_VERSION) { $env:STRATA_NODE_VERSION } else { '24.12.0' } +$Target = 'win-x64' +# SHA-256 of node-v24.12.0-win-x64.zip from nodejs.org's SHASUMS256.txt; keep equal to fetch-node.sh. +$Expected = '9c125f61ae947b52e779095830f9cac267846a043ef7192183c84016aaad2812' +if (-not $Dest) { $Dest = Join-Path $PSScriptRoot '..\src-tauri\resources\node' } +$Installed = Join-Path $Dest 'node.exe' + +function Fail([string]$Message) { [Console]::Error.WriteLine("fetch-node: $Message"); exit 1 } + +if ($Check) { + if (-not (Test-Path -LiteralPath $Installed)) { Fail "not installed at $Installed" } + $got = (& $Installed --version).Trim() + Write-Output "fetch-node: $Installed is $got" + if ($got -ne "v$NodeVersion") { Fail "expected v$NodeVersion" } + exit 0 +} + +$Archive = "node-v$NodeVersion-$Target.zip" +$Work = Join-Path ([IO.Path]::GetTempPath()) ("strata-node-" + [Guid]::NewGuid().ToString('N')) +New-Item -ItemType Directory -Path $Work | Out-Null +try { + $Zip = Join-Path $Work $Archive + if ($FromFile) { + Copy-Item -LiteralPath $FromFile -Destination $Zip + } else { + $Url = "https://nodejs.org/dist/v$NodeVersion/$Archive" + Write-Output "fetch-node: $Url" + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + $ProgressPreference = 'SilentlyContinue' + Invoke-WebRequest -UseBasicParsing -Uri $Url -OutFile $Zip + } + $Actual = (Get-FileHash -Algorithm SHA256 -LiteralPath $Zip).Hash.ToLowerInvariant() + if ($NodeVersion -ne '24.12.0') { + # another version has no recorded digest: say so rather than implying a verification + [Console]::Error.WriteLine("fetch-node: WARNING - no recorded digest for v$NodeVersion; this download is NOT authenticated.") + [Console]::Error.WriteLine("fetch-node: computed sha256 $Actual - record it in this script and fetch-node.sh.") + } elseif ($Actual -ne $Expected) { + Fail "REFUSING - $Archive hashes $Actual, expected $Expected" + } else { + Write-Output 'fetch-node: sha256 verified against the recorded digest' + } + Add-Type -AssemblyName System.IO.Compression.FileSystem + $zipFile = [IO.Compression.ZipFile]::OpenRead($Zip) + try { + $entry = $zipFile.GetEntry("node-v$NodeVersion-$Target/node.exe") + if (-not $entry) { Fail "node.exe is not inside $Archive" } + New-Item -ItemType Directory -Force -Path $Dest | Out-Null + [IO.Compression.ZipFileExtensions]::ExtractToFile($entry, $Installed, $true) + } finally { $zipFile.Dispose() } + Write-Output "fetch-node: installed at $Installed" +} finally { + Remove-Item -LiteralPath $Work -Recurse -Force -ErrorAction SilentlyContinue +} diff --git a/engine/strata/apps/desktop/scripts/fetch-node.sh b/engine/strata/apps/desktop/scripts/fetch-node.sh new file mode 100755 index 00000000..3a363233 --- /dev/null +++ b/engine/strata/apps/desktop/scripts/fetch-node.sh @@ -0,0 +1,103 @@ +#!/usr/bin/env bash +# Fetch and verify the private Node runtime the desktop bundle ships. +# +# The App Host is an ordinary Node program, and the packaging requirement is that an end user +# supplies no runtime of their own. The desktop bundle therefore carries a pinned standalone Node +# beside the host. +# +# It is NOT committed. It is a ~117 MB platform binary: committing it would bloat every clone, it +# cannot be reviewed in a diff, and it is not source. This script is the reproducible substitute — +# it downloads the official build for the target and refuses to install anything whose SHA-256 does +# not match the recorded digest. +# +# Usage: +# apps/desktop/scripts/fetch-node.sh # host platform +# apps/desktop/scripts/fetch-node.sh --target linux-x64 +# apps/desktop/scripts/fetch-node.sh --check # verify what is already installed +# +# The Node version must satisfy the App Host's own `engines.node` (>= 24.12.0). +set -euo pipefail + +NODE_VERSION="${STRATA_NODE_VERSION:-24.12.0}" +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +DEST="$HERE/../src-tauri/resources/node" + +# Published SHA-256 of each official nodejs.org archive, recorded so a tampered or truncated +# download is refused rather than shipped. Add a row when bumping the version. +# Taken from nodejs.org's own SHASUMS256.txt for v24.12.0, which is published over HTTPS beside +# the archives. Recorded here so the fetch is verified against a value that does not come from the +# same response as the payload. +digest_for() { + case "$1" in + darwin-arm64) echo "319f221adc5e44ff0ed57e8a441b2284f02b8dc6fc87b8eb92a6a93643fd8080" ;; + linux-x64) echo "6159227e0af7d7c3c6bb2fa900452b04a6cb8841a702a79acc613209d70b04d0" ;; + linux-arm64) echo "9b2a2eeb98a8eb37361224e2a1d060300ad2dd143af58dfdb16de785df0f1228" ;; + win-x64) echo "9c125f61ae947b52e779095830f9cac267846a043ef7192183c84016aaad2812" ;; + *) echo "" ;; + esac +} + +target() { + if [ "${1:-}" = "--target" ]; then echo "${2:?--target needs a value}"; return; fi + case "$(uname -s)-$(uname -m)" in + Darwin-arm64) echo darwin-arm64 ;; + Linux-x86_64) echo linux-x64 ;; + Linux-aarch64) echo linux-arm64 ;; + MINGW*|MSYS*|CYGWIN*) echo win-x64 ;; + *) echo "unsupported host: $(uname -s)-$(uname -m)" >&2; exit 2 ;; + esac +} + +TARGET="$(target "$@")" +EXE="node" +case "$TARGET" in win-*) EXE="node.exe" ;; esac +INSTALLED="$DEST/$EXE" + +if [ "${1:-}" = "--check" ]; then + if [ ! -x "$INSTALLED" ]; then echo "fetch-node: not installed at $INSTALLED" >&2; exit 1; fi + got="$("$INSTALLED" --version)" + echo "fetch-node: $INSTALLED is $got" + case "$got" in "v$NODE_VERSION") exit 0 ;; *) echo "fetch-node: expected v$NODE_VERSION" >&2; exit 1 ;; esac +fi + +# The official archive for this target. +case "$TARGET" in + darwin-arm64) ARCHIVE="node-v$NODE_VERSION-darwin-arm64.tar.gz" ;; + darwin-x64) ARCHIVE="node-v$NODE_VERSION-darwin-x64.tar.gz" ;; + linux-x64) ARCHIVE="node-v$NODE_VERSION-linux-x64.tar.gz" ;; + linux-arm64) ARCHIVE="node-v$NODE_VERSION-linux-arm64.tar.gz" ;; + win-x64) ARCHIVE="node-v$NODE_VERSION-win-x64.zip" ;; + *) echo "fetch-node: no archive known for $TARGET" >&2; exit 2 ;; +esac +URL="https://nodejs.org/dist/v$NODE_VERSION/$ARCHIVE" + +EXPECTED="$(digest_for "$TARGET")" +WORK="$(mktemp -d "${TMPDIR:-/tmp}/strata-node.XXXXXX")" # GNU mktemp needs the X template; BSD accepts it too +trap 'rm -rf "$WORK"' EXIT + +echo "fetch-node: $URL" +curl -fsSL -o "$WORK/$ARCHIVE" "$URL" + +ACTUAL="$(shasum -a 256 "$WORK/$ARCHIVE" 2>/dev/null | cut -d' ' -f1 || sha256sum "$WORK/$ARCHIVE" | cut -d' ' -f1)" +if [ -n "$EXPECTED" ]; then + if [ "$ACTUAL" != "$EXPECTED" ]; then + echo "fetch-node: REFUSING — $ARCHIVE hashes $ACTUAL, expected $EXPECTED" >&2 + exit 1 + fi + echo "fetch-node: sha256 verified against the recorded digest" +else + # Without a recorded digest the download cannot be authenticated. Say so loudly and keep the + # computed value so it can be recorded, rather than implying a verification that did not happen. + echo "fetch-node: WARNING — no recorded digest for $TARGET; this download is NOT authenticated." >&2 + echo "fetch-node: computed sha256 $ACTUAL — record it in $(basename "${BASH_SOURCE[0]}") to enable verification." >&2 +fi + +mkdir -p "$DEST" +case "$ARCHIVE" in + *.zip) unzip -q -j "$WORK/$ARCHIVE" "node-v$NODE_VERSION-win-x64/node.exe" -d "$DEST" ;; + *) tar xzf "$WORK/$ARCHIVE" -C "$WORK" + cp "$WORK/node-v$NODE_VERSION-$TARGET/bin/node" "$DEST/node" ;; +esac +chmod +x "$DEST/$EXE" + +echo "fetch-node: installed $("$DEST/$EXE" --version) at $DEST/$EXE" diff --git a/engine/strata/apps/desktop/scripts/first-run-ui.mjs b/engine/strata/apps/desktop/scripts/first-run-ui.mjs new file mode 100644 index 00000000..757905cd --- /dev/null +++ b/engine/strata/apps/desktop/scripts/first-run-ui.mjs @@ -0,0 +1,121 @@ +#!/usr/bin/env node +/** + * The first run of the installed app, headless: the host as the Tauri shell starts it (STRATA_PACKAGED=1, STRATA_NO_ACQUIRE=1, + * the staged Control, nothing installed, nothing in the per-user folders) and Chrome on its onboarding. + * + * node apps/desktop/scripts/first-run-ui.mjs [--control ] [--node ] [--work ] [--shots ] + * + * Checks, one line each (exit 1 if any fails): + * the host answers; /api/native has a real catalog (families with sizes), a recommendation and the GPUs of this PC + * (from Control's bundled installer on Control's Python); the page shows "Let's get started", and after it the model + * list with sizes (no "couldn't show this screen"); no page error; the install plan for the recommended model is a + * plan (nothing is downloaded or started: a plan changes nothing); the spy sees no pip/git/compiler/engine fetch. + * Per-user folders (STRATA_HOME, APPDATA, LOCALAPPDATA, the components and install folders) are all under --work. + * No model is downloaded and no engine runs. + */ +import { spawn } from 'node:child_process'; +import { existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs'; +import { createServer } from 'node:net'; +import { tmpdir } from 'node:os'; +import { dirname, join, resolve } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; + +const args = Object.fromEntries(process.argv.slice(2).reduce((acc, a, i, all) => (a.startsWith('--') ? [...acc, [a.slice(2), all[i + 1]?.startsWith('--') ? true : all[i + 1]]] : acc), [])); +const here = dirname(fileURLToPath(import.meta.url)); +const repoHost = resolve(here, '../../host'); +const staged = resolve(here, '../src-tauri/resources'); +const control = resolve(args.control ?? join(staged, 'control')); +const nodeExe = resolve(args.node ?? join(staged, 'node', process.platform === 'win32' ? 'node.exe' : 'node')); +const work = resolve(args.work ?? mkdtempSync(join(tmpdir(), 'strata-first-run-'))); +const shots = resolve(args.shots ?? join(work, 'shots')); +mkdirSync(work, { recursive: true }); mkdirSync(shots, { recursive: true }); +const spy = pathToFileURL(join(repoHost, 'tests/helpers/acquire-spy.mjs')).href; +const spyLog = join(work, 'spy.log'); writeFileSync(spyLog, ''); + +const { chromium } = await import(pathToFileURL(join(repoHost, 'node_modules/playwright-core/index.mjs')).href).catch(() => import('playwright-core')); +const CHROME = process.env.CHROME ?? ['C:/Program Files/Google/Chrome/Application/chrome.exe', '/usr/bin/google-chrome', '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'].find(existsSync); + +let failed = false; +const check = (ok, label, detail = '') => { console.log(`${ok ? 'ok ' : 'FAIL'} ${label}${detail ? ' ' + detail : ''}`); if (!ok) failed = true; }; +const delay = ms => new Promise(r => setTimeout(r, ms)); +const freePort = async () => { const s = createServer(); await new Promise(r => s.listen(0, '127.0.0.1', r)); const p = s.address().port; await new Promise(r => s.close(r)); return p; }; + +for (const need of [nodeExe, join(control, 'strata.py'), join(repoHost, 'dist', 'index.html')]) if (!existsSync(need)) { console.error(`missing ${need} (run stage-control.py, fetch-node and "npm run build" in apps/host first)`); process.exit(2); } + +const dirs = { home: join(work, 'home'), appdata: join(work, 'appdata'), local: join(work, 'local'), components: join(work, 'local', 'Strata', 'components') }; +for (const d of Object.values(dirs)) mkdirSync(d, { recursive: true }); +const port = await freePort(); +const env = { + ...process.env, + STRATA_PORT: String(port), STRATA_DIST: join(repoHost, 'dist'), STRATA_PACKAGED: '1', STRATA_REAL_ENGINE: '1', STRATA_NO_ACQUIRE: '1', + STRATA_CONTROL_DIR: control, STRATA_HOME: dirs.home, STRATA_MODELS_DIR: join(work, 'models'), STRATA_COMPONENTS_DIR: dirs.components, + APPDATA: dirs.appdata, LOCALAPPDATA: dirs.local, XDG_CONFIG_HOME: join(work, 'xdg'), XDG_DATA_HOME: join(work, 'xdgdata'), + STRATA_PROFILE_DIR: join(work, 'profiles'), STRATA_RUNTIME_DIR: join(work, 'runtime'), ACQUIRE_SPY_LOG: spyLog, +}; +delete env.STRATA_INSTALL_DIR; +mkdirSync(env.STRATA_MODELS_DIR, { recursive: true }); +const host = spawn(nodeExe, [...(args['no-spy'] === undefined ? ['--import', spy] : []), join(repoHost, 'server', 'index.mjs')], { cwd: repoHost, env, stdio: ['ignore', 'pipe', 'pipe'] }); +let hostLog = ''; +host.stdout.on('data', c => { hostLog += c; }); host.stderr.on('data', c => { hostLog += c; }); +const base = `http://127.0.0.1:${port}`; +const api = async (path, init) => { const r = await fetch(base + path, init); return { status: r.status, body: await r.json().catch(() => null) }; }; + +let browser; +try { + let up = false; + for (let i = 0; i < 150 && !up; i++) { try { up = (await api('/api/health')).status === 200; } catch { await delay(200); } } + check(up, 'the packaged host starts', `port ${port}`); + if (!up) throw new Error(hostLog.slice(-2000)); + + const native = await api('/api/native?refresh=1'); + const state = native.body; + check(native.status === 200 && state?.available === true, 'the host reads Control', state?.error ?? ''); + const sizes = (state?.catalog?.families ?? []).reduce((n, f) => n + (f.sizes?.length ?? 0), 0); + check((state?.catalog?.families?.length ?? 0) > 0 && sizes >= 3, 'the catalog has real families and sizes', `${state?.catalog?.families?.length} families, ${sizes} sizes`); + check(!!state?.catalog?.recommendation, 'the catalog has a recommendation', JSON.stringify(state?.catalog?.recommendation ?? null).slice(0, 120)); + check(Array.isArray(state?.hardware?.gpus), 'the hardware lists GPUs', (state?.hardware?.gpus ?? []).map(g => `${g.name} ${g.vram_gb} GB`).join('; ') || 'none on this PC'); + check(state?.installDir && realpathSync.native(state.installDir).toLowerCase().startsWith(realpathSync.native(work).toLowerCase()), 'models go to a writable per-user folder, not the bundle', state?.installDir); + const hw = (await api('/api/hardware')).body; + console.log('info host hardware probe:', JSON.stringify((hw?.gpus ?? []).map(g => ({ name: g.name, backend: g.backend, vramGb: g.vramGb, unified: g.unified })))); + check(!state?.installerError, 'the bundled installer answers', state?.installerError ?? ''); + + browser = await chromium.launch({ executablePath: CHROME, headless: true }); + const page = await browser.newPage({ viewport: { width: 1400, height: 950 } }); + const problems = []; + page.on('pageerror', e => problems.push(`pageerror: ${e.message}`)); + await page.goto(base, { waitUntil: 'domcontentloaded' }); + await page.waitForSelector('text=/Let.s get started|Choose a version|Connect your Strata/i', { timeout: 30000 }).catch(() => {}); + await page.screenshot({ path: join(shots, '1-welcome.png') }); + const broken = await page.locator('text=/couldn.t show this screen/i').count(); + check(broken === 0, 'the first screen renders (not "Strata couldn\'t show this screen")'); + const start = page.getByRole('button', { name: /get started/i }); + check(await start.count() > 0, 'the welcome step offers "Let\'s get started"'); + if (await start.count()) await start.first().click(); + await page.waitForSelector('text=/Choose a version/i', { timeout: 30000 }).catch(() => {}); + await delay(1200); + await page.screenshot({ path: join(shots, '2-models.png') }); + check(await page.locator('text=/couldn.t show this screen/i').count() === 0, 'the model step renders'); + check(await page.getByText(/Choose a version/i).count() > 0, 'the model step lists the versions'); + const labels = await page.locator('[role=radio]').allInnerTexts(); + check(labels.length >= 3, 'the versions are the real catalog\'s sizes', labels.map(l => l.replace(/\s+/g, ' ').slice(0, 40)).join(' | ')); + check(labels.some(l => /\d+\.\d\s*GB/.test(l)), 'each version shows its download size'); + check(problems.length === 0, 'no page error', problems.join('; ')); + + const recommended = state?.catalog?.recommendation; + if (recommended?.model) { + const plan = await api('/api/native/plan', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ family: recommended.family, model: recommended.model, context: recommended.context, data_dir: join(work, 'Strata-data') }) }); + check(plan.status === 200 && !!plan.body?.plan, 'the install plan for the recommended model is a plan (nothing downloaded)', plan.body?.summary?.slice(0, 100) ?? JSON.stringify(plan.body).slice(0, 150)); + check(!existsSync(join(work, 'Strata-data', 'models')), 'a plan wrote no model files'); + } +} catch (error) { + check(false, 'the run', String(error?.message ?? error).slice(0, 600)); +} finally { + await browser?.close().catch(() => {}); + host.kill(); + await new Promise(r => host.once('exit', r)); // only the PID this script started + const attempts = readFileSync(spyLog, 'utf8').split('\n').filter(Boolean); + check(attempts.length === 0, 'the spy saw no pip, git, compiler, engine or internet access', attempts.slice(0, 3).join(' ')); + console.log(`shots in ${shots}`); + if (!args.work) rmSync(work, { recursive: true, force: true, maxRetries: 3 }); +} +process.exit(failed ? 1 : 0); diff --git a/engine/strata/apps/desktop/scripts/flatten-pnpm.mjs b/engine/strata/apps/desktop/scripts/flatten-pnpm.mjs new file mode 100644 index 00000000..403d4df2 --- /dev/null +++ b/engine/strata/apps/desktop/scripts/flatten-pnpm.mjs @@ -0,0 +1,133 @@ +/** + * Turn a pnpm "isolated" node_modules (a virtual store in `.pnpm` full of links) into an ordinary hoisted tree of real folders. + * + * Why: the installer copies the Harness folder file by file. pnpm's layout is thousands of links (junctions on Windows); a copy + * that follows them duplicates every package once per dependent and one that does not breaks on the first dangling link. A hoisted + * tree has each package once (nested only where two versions of the same name are needed), no links, and Node resolves it + * exactly as it resolves any npm install. + * + * Algorithm (the one npm uses, in short): the packages the root names come first, at the top. Then, walking each placed package's + * own dependencies: look the name up from the package's own folder upwards; if the same instance is already visible, nothing to + * do; if a DIFFERENT instance of that name is visible, nest this one inside the dependent; if none is visible, hoist it to the top. + * + * @param {string} out folder holding `node_modules` + * @param {{skip?: RegExp}} [options] package names never copied (the caller removes them anyway) + * @returns {{packages:number, copied:number, nested:number}} + */ +import { cpSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync } from 'node:fs'; +import { dirname, join, relative, sep } from 'node:path'; + +export function flattenPnpm(out, { skip = null } = {}) { + const nm = join(out, 'node_modules'); + const store = join(nm, '.pnpm'); + const flatRoot = join(out, 'node_modules.flat'); + rmSync(flatRoot, { recursive: true, force: true }); + mkdirSync(join(flatRoot, 'node_modules'), { recursive: true }); + + const manifest = dir => { try { return JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8')); } catch { return null; } }; + const nameOf = dir => manifest(dir)?.name ?? null; + /** + * What makes two instances "the same package": name and version. pnpm keeps one copy per set of peer packages (the same workspace + * package under many hashed folders); in one hoisted tree they are one package. + */ + const identity = dir => { const m = manifest(dir); return m ? `${m.name}@${m.version}` : dir; }; + /** The sibling links of a store instance: its dependencies, by name -> real instance folder. */ + function storeDeps(instance, name) { + const container = name.startsWith('@') ? dirname(dirname(instance)) : dirname(instance); + const found = new Map(); + for (const e of readdirSync(container, { withFileTypes: true })) { + if (e.name === '.bin') continue; + const entries = e.name.startsWith('@') ? readdirSync(join(container, e.name), { withFileTypes: true }).map(x => [`${e.name}/${x.name}`, join(container, e.name, x.name)]) : [[e.name, join(container, e.name)]]; + for (const [dep, p] of entries) { + if (dep === name) continue; + try { if (lstatSync(p).isSymbolicLink() || existsSync(p)) found.set(dep, realpathSync(p)); } catch { /* a dangling link: the package was removed on purpose */ } + } + } + return found; + } + /** Every instance in the store by package name, for packages that arrived without a store entry (copied peers). */ + const byName = new Map(); + if (existsSync(store)) { + for (const id of readdirSync(store, { withFileTypes: true })) { + if (!id.isDirectory()) continue; + const container = join(store, id.name, 'node_modules'); + if (!existsSync(container)) continue; + for (const e of readdirSync(container, { withFileTypes: true })) { + if (e.name === '.bin') continue; + const dirs = e.name.startsWith('@') ? readdirSync(join(container, e.name)).map(x => join(container, e.name, x)) : [join(container, e.name)]; + for (const d of dirs) { + let real; try { real = realpathSync(d); } catch { continue; } + if (!real.startsWith(store)) continue; // a link to a workspace package outside the store is handled through the instance table + const n = nameOf(real); + if (n && !byName.has(n)) byName.set(n, real); + } + } + } + } + + const placed = new Map(); // folder (in the flat tree) -> real instance folder it holds + let copied = 0, nested = 0; + + const visibleFrom = (chain, name) => { + for (const dir of chain) { + const slot = join(dir, 'node_modules', ...name.split('/')); + if (placed.has(slot)) return { slot, instance: placed.get(slot) }; + } + return null; + }; + const copyInto = (slot, instance) => { + mkdirSync(dirname(slot), { recursive: true }); + cpSync(instance, slot, { recursive: true, dereference: true, filter: f => !relative(instance, f).split(sep).includes('node_modules') }); + placed.set(slot, identity(instance)); + copied++; + }; + + const queue = []; // { slotDir (folder of the placed package), chain (folders searched upwards), instance, name } + const rootChain = [flatRoot]; + const place = (name, instance, chain, forceHere) => { + if (skip?.test(name)) return; + const seen = visibleFrom(chain, name); + if (seen && seen.instance === identity(instance)) return; + const hoist = !seen && !forceHere; + const base = hoist ? flatRoot : chain[0]; + const slot = join(base, 'node_modules', ...name.split('/')); + if (placed.has(slot)) return; // another instance already sits where this one would go (it nests below, handled by the caller's chain) + copyInto(slot, instance); + if (!hoist && base !== flatRoot) nested++; + queue.push({ slotDir: slot, chain: [slot, ...(hoist ? rootChain : chain)], instance, name }); + }; + + // 1. the packages the root names + const rootEntries = []; + for (const e of readdirSync(nm, { withFileTypes: true })) { + if (e.name === '.pnpm' || e.name === '.bin' || e.name.startsWith('.')) continue; + const entries = e.name.startsWith('@') ? readdirSync(join(nm, e.name)).map(x => [`${e.name}/${x}`, join(nm, e.name, x)]) : [[e.name, join(nm, e.name)]]; + for (const [name, p] of entries) rootEntries.push([name, p]); + } + for (const [name, p] of rootEntries) { + let real; try { real = realpathSync(p); } catch { continue; } + place(name, real, rootChain, true); + } + // 2. their dependencies, breadth first + while (queue.length) { + const { slotDir, chain, instance, name } = queue.shift(); + let wants; + if (instance.startsWith(store)) wants = storeDeps(instance, name); + else { + // a package copied in without a store entry: its declared requirements, taken from the store by name when not visible yet + const m = manifest(instance) ?? {}; + wants = new Map(); + for (const dep of [...Object.keys(m.dependencies ?? {}), ...Object.keys(m.peerDependencies ?? {}), ...Object.keys(m.optionalDependencies ?? {})]) { + if (visibleFrom(chain, dep)) continue; + const real = byName.get(dep); + if (real) wants.set(dep, real); + } + } + for (const [dep, real] of wants) place(dep, real, chain, false); + } + + rmSync(nm, { recursive: true, force: true }); + renameSync(join(flatRoot, 'node_modules'), nm); + rmSync(flatRoot, { recursive: true, force: true }); + return { packages: placed.size, copied, nested }; +} diff --git a/engine/strata/apps/desktop/scripts/harness-prune.mjs b/engine/strata/apps/desktop/scripts/harness-prune.mjs new file mode 100644 index 00000000..35b81124 --- /dev/null +++ b/engine/strata/apps/desktop/scripts/harness-prune.mjs @@ -0,0 +1,79 @@ +/** + * Which files and folders of the staged Harness are dropped, and the check that nothing the Harness imports is gone. + * + * The 2026-10-17 tester report: on Linux and Mac every agent chat failed ("session/create ... waiting for workflowEngine"). + * Cause: the old rule "drop any folder named after another operating system" also removed the Harness's own JavaScript package + * `@deepseek-ai/dsh-win32-process`. It is plain JS (no binary), and `dsh-subprocess-local` and `dsh-sandbox-local` import it by + * name on every platform, so those two plugins failed to load, and everything waiting on them (shell, subprocess, ptcRuntime, + * workflowEngine) never started. Windows kept it (the rule differs there), so the Windows tests passed. + */ +import { existsSync, readFileSync, readdirSync } from 'node:fs'; +import { join, sep } from 'node:path'; + +export const OTHER_OS = { + win32: /(^|[\\/._-])(darwin|linux|android|freebsd|musl)([\\/._-]|$)/i, + darwin: /(^|[\\/._-])(win32|linux|android|freebsd|musl)([\\/._-]|$)/i, + // Linux: the AppImage bundler (linuxdeploy) resolves the libraries of every ELF file under resources and stops on one it + // cannot satisfy (koffi's musl build wants libc.musl). The app is glibc x86_64, so musl and other-CPU builds are dropped. + linux: /(^|[\\/._-])(win32|darwin|android|freebsd|musl|arm64|aarch64|armv7|arm|ia32|riscv64|ppc64|s390x|loong64)([\\/._-]|$)/i, +}; +const NATIVE_FOLDER = /prebuild|bin|native|platform|-(win32|darwin|linux)/i; + +/** The Harness's own JavaScript packages (`@deepseek-ai/dsh-*`) are code every platform imports by name; never drop one. */ +export function isHarnessCodePackage(path) { + const parts = path.split(sep); + const i = parts.lastIndexOf('@deepseek-ai'); + return i >= 0 && i === parts.length - 2 && parts[i + 1].startsWith('dsh-'); +} + +/** True when the folder `path` (a directory named `name`) is another operating system's prebuilt binary and can go. */ +export function isOtherOsBinaryFolder(platform, name, path) { + const rule = OTHER_OS[platform] ?? OTHER_OS.linux; + if (isHarnessCodePackage(path)) return false; + return rule.test(name) && NATIVE_FOLDER.test(path); +} + +/** Imports the Windows copy (which works) is also without: browser-side or dev-only bundles, and the document converter the app drops on purpose. */ +const KNOWN_ABSENT = new Set([ + '@deepseek-ai/libreoffice-kit', '@deepseek-ai/dsh-client-ui-dockkit', '@deepseek-ai/dsh-client-web', + '@deepseek-ai/dsh-experimental-webworker-runtime', '@deepseek-ai/dsh-remote-mock', '@deepseek-ai/dsh-client-test-runtime', +]); + +function jsFiles(dir, out = []) { + for (const e of readdirSync(dir, { withFileTypes: true })) { + const p = join(dir, e.name); + if (e.isSymbolicLink()) continue; + if (e.isDirectory()) jsFiles(p, out); + else if (/\.(m?js|cjs)$/.test(e.name)) out.push(p); + } + return out; +} + +/** + * Every bare `@deepseek-ai/` the staged Harness's own packages import (static `from "x"` and `import("x")`) must exist + * in the staged node_modules. Returns the list of `{from, missing}` problems (empty = good). Plugins that are only loaded on + * another platform still count: Node resolves a static import whether or not the code runs. + */ +export function missingHarnessImports(harnessDir) { + const scope = join(harnessDir, 'node_modules', '@deepseek-ai'); + if (!existsSync(scope)) return [{ from: scope, missing: '@deepseek-ai (no installed packages)' }]; + const problems = []; + const seen = new Set(); + const re = /(?:from|import)\s*\(?\s*["'](@deepseek-ai\/[^"'/]+)(?:\/[^"']*)?["']/g; + for (const pkg of readdirSync(scope)) { + const lib = join(scope, pkg, 'lib'); + if (!existsSync(lib)) continue; + for (const file of jsFiles(lib)) { + const text = readFileSync(file, 'utf8'); + for (const m of text.matchAll(re)) { + const name = m[1]; + const key = `${pkg}>${name}`; + if (seen.has(key) || KNOWN_ABSENT.has(name)) continue; + seen.add(key); + if (!existsSync(join(harnessDir, 'node_modules', ...name.split('/'))) + && !existsSync(join(scope, pkg, 'node_modules', ...name.split('/')))) problems.push({ from: `${pkg}`, missing: name }); + } + } + } + return problems; +} diff --git a/engine/strata/apps/desktop/scripts/installed-flow.mjs b/engine/strata/apps/desktop/scripts/installed-flow.mjs new file mode 100644 index 00000000..7816b5c2 --- /dev/null +++ b/engine/strata/apps/desktop/scripts/installed-flow.mjs @@ -0,0 +1,310 @@ +#!/usr/bin/env node +/** + * Prove the INSTALLED app layout can start and stop an engine with nothing acquired, using a stub engine. + * + * node apps/desktop/scripts/installed-flow.mjs --install [--work ] [--spy ] + * + * It starts the installed host with the installed node.exe exactly as the Tauri shell does (STRATA_PACKAGED=1, + * STRATA_NO_ACQUIRE=1; Control found beside the host), against a scratch component folder holding a fake engine + * package and a scratch install folder holding one run config. Everything per-user (profiles, runtime state, host data, + * components) lives under --work, so the real profile of whoever runs this is never read or written. + * + * Steps (each one printed, the run exits 1 if any fails): + * host health, Control status (engine usable, acquiring forbidden), models from Control, load through the host + * (profile + `runtime start` under the owner runtime), a chat answer from the stub engine, a second client attaches to + * the same owner/instance, unload stops it, no engine for this PC is a notice with nothing started, the Tauri-style + * clean shutdown stops the engines the host started, a hard-killed host takes its engine with it. + * With --spy the host runs under tests/helpers/acquire-spy.mjs and the run fails on any attempt to reach the internet or + * run an installer. + * + * REAL mode (a test box with a GPU): --components > --models .json + * whose engine is "component:strata-engine"> --model [--backend cuda]. The same host and Control, a real engine and a + * real model: load, a real answer, ownership, unload, the missing-engine notice, load again, clean shutdown. The stub-only + * steps (the marker file, the hard-kill report) are left out. + */ +import { spawn, spawnSync } from 'node:child_process'; +import { createHash, randomBytes } from 'node:crypto'; +import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync, chmodSync } from 'node:fs'; +import { createServer } from 'node:net'; +import { tmpdir } from 'node:os'; +import { join, resolve } from 'node:path'; +import { pathToFileURL } from 'node:url'; + +const args = Object.fromEntries(process.argv.slice(2).reduce((acc, a, i, all) => (a.startsWith('--') ? [...acc, [a.slice(2), all[i + 1]?.startsWith('--') || all[i + 1] === undefined ? true : all[i + 1]]] : acc), [])); +if (!args.install) { console.error('usage: installed-flow.mjs --install [--work ] [--spy ]'); process.exit(2); } +const install = resolve(args.install); +const isWin = process.platform === 'win32'; +const node = join(install, 'node', isWin ? 'node.exe' : 'node'); +const hostEntry = join(install, 'host', 'server', 'index.mjs'); +const controlDir = join(install, 'control'); +const python = isWin ? join(controlDir, 'python', 'python.exe') : join(controlDir, 'python', 'bin', 'python3'); +const real = !!args.components; +const modelId = String(args.model ?? 'stub'); +const work = resolve(args.work ?? mkdtempSync(join(tmpdir(), 'strata-installed-flow-'))); +mkdirSync(work, { recursive: true }); +const dirs = { components: real ? resolve(args.components) : join(work, 'components'), models: real ? resolve(args.models) : join(work, 'models'), profiles: join(work, 'profiles'), runtime: join(work, 'runtime'), home: join(work, 'home') }; +// the runtime and profile folders are created by Control itself, with the owner-only ACL it insists on +for (const [name, d] of Object.entries(dirs)) if (!['runtime', 'profiles'].includes(name) && !(real && ['components', 'models'].includes(name))) mkdirSync(d, { recursive: true }); + +const steps = []; +const record = (name, ok, detail = '') => { steps.push({ name, ok: !!ok, detail: String(detail) }); console.log(`${ok ? 'ok ' : 'FAIL'} ${name}${detail ? ' ' + detail : ''}`); }; +const delay = ms => new Promise(r => setTimeout(r, ms)); +const freePort = async () => { const s = createServer(); await new Promise(r => s.listen(0, '127.0.0.1', r)); const p = s.address().port; await new Promise(r => s.close(r)); return p; }; +const sha = buf => createHash('sha256').update(buf).digest('hex'); + +// ------------------------------------------------------------------------------ fixtures +const baseEnv = { + ...process.env, + STRATA_COMPONENTS_DIR: dirs.components, STRATA_PROFILE_DIR: dirs.profiles, STRATA_RUNTIME_DIR: dirs.runtime, + STRATA_INSTALL_DIR: dirs.models, STRATA_ENGINE_BACKEND: String(args.backend ?? 'cuda'), STRATA_HOME: dirs.home, STRATA_MODELS_DIR: real ? join(work, 'models-unused') : dirs.models, + APPDATA: join(work, 'appdata'), XDG_CONFIG_HOME: join(work, 'xdg'), PYTHONDONTWRITEBYTECODE: '1', +}; +delete baseEnv.STRATA_API_KEY; +mkdirSync(baseEnv.APPDATA, { recursive: true }); +const mark = join(work, 'engine-ran.json'); + +const FAKE_ENGINE = `import os, sys, json +from pathlib import Path +Path(os.environ['FAKE_ENGINE_MARK']).write_text(json.dumps({'pid': os.getpid(), 'script': os.path.abspath(__file__), 'argv': sys.argv[1:]})) +print('READY 4096 stop', flush=True) +for line in sys.stdin: + if line.strip() == 'QUIT': break + if line.startswith(('GEN ', 'BGEN ')): + slot = int(line.split()[1]) if line.startswith('BGEN ') else None + print('T 97', flush=True) + print('DONE 1 1 1.0 1.0 length 0 0 0', flush=True) + if slot is not None: print(f'BADM {slot} 0', flush=True) +`; + +function installFakeEngine() { + const platform = isWin ? 'windows-x86_64' : 'linux-x86_64'; + const folder = join(dirs.components, 'engine', `0.1.45-${platform}-cuda`); + mkdirSync(folder, { recursive: true }); + writeFileSync(join(folder, 'engine_main.py'), FAKE_ENGINE); + const entry = isWin ? 'engine.cmd' : 'engine'; + writeFileSync(join(folder, entry), isWin + ? `@echo off\r\n"${python}" "%~dp0engine_main.py" %*\r\n` + : `#!/bin/sh\nexec "${python}" "$(dirname "$0")/engine_main.py" "$@"\n`); + if (!isWin) chmodSync(join(folder, entry), 0o755); + const files = [entry, 'engine_main.py'].map(p => { const b = readFileSync(join(folder, p)); return { path: p, sha256: sha(b), bytes: b.length }; }); + writeFileSync(join(folder, 'engine-component.json'), JSON.stringify({ schema_version: 1, id: 'strata-engine', version: '0.1.45', platform, backend: 'cuda', entrypoint: entry, files })); + return folder; +} + +function makeTokenizerAndConfig() { + const tok = join(dirs.models, 'tokenizer'); + mkdirSync(tok, { recursive: true }); + const script = `import json, sys\nfrom tools.strata_tokenizer import BYTE_TO_UNICODE\ntok = sys.argv[1]\ntokens = [BYTE_TO_UNICODE[i] for i in range(256)] + ['ab', '<|im_start|>', '<|im_end|>', '<|endoftext|>']\njson.dump({t: i for i, t in enumerate(tokens)}, open(tok + '/vocab.json', 'w'))\nopen(tok + '/merges.txt', 'w').write('a b')\njson.dump([0] * 257 + [3, 3, 3], open(tok + '/token_type.json', 'w'))\n`; + const done = spawnSync(python, ['-c', script, tok], { cwd: controlDir, env: { ...baseEnv, PYTHONNOUSERSITE: '1' }, encoding: 'utf8' }); + if (done.status !== 0) throw new Error('tokenizer fixture failed: ' + done.stderr); + writeFileSync(join(dirs.models, 'strata-stub.json'), JSON.stringify({ exe: 'component:strata-engine', backend: 'cuda', tokenizer: tok, args: [], cwd: work, model_name: 'stub', host: '127.0.0.1', port: 0 })); +} + +const control = (...argv) => spawnSync(python, [join(controlDir, 'strata.py'), ...argv, '--output', 'json'], { cwd: controlDir, env: { ...baseEnv, PYTHONNOUSERSITE: '1', STRATA_NO_ACQUIRE: '1', FAKE_ENGINE_MARK: mark }, encoding: 'utf8', timeout: 120000 }); +const controlJson = (...argv) => { const r = control(...argv); let json = null; try { json = JSON.parse(r.stdout.slice(r.stdout.indexOf('{'))); } catch { /* not json */ } return { code: r.status, json, text: r.stdout + r.stderr }; }; +const alive = pid => { try { process.kill(pid, 0); return true; } catch { return false; } }; + +// ------------------------------------------------------------------------------ the host +let host = null, port = 0, base = '', spyLog = null, shutdownToken = randomBytes(32).toString('hex'); +async function startHost() { + port = await freePort(); base = `http://127.0.0.1:${port}`; + const hostArgs = [...(args.spy ? ['--import', pathToFileURL(resolve(args.spy)).href] : []), hostEntry]; + if (args.spy) { spyLog = join(work, 'acquire-spy.log'); writeFileSync(spyLog, ''); } + host = spawn(node, hostArgs, { + cwd: join(install, 'host'), stdio: ['ignore', 'pipe', 'pipe'], windowsHide: true, + env: { ...baseEnv, STRATA_PORT: String(port), STRATA_DIST: join(install, 'host', 'dist'), NODE_ENV: 'production', STRATA_PACKAGED: '1', STRATA_REAL_ENGINE: '1', + STRATA_NO_ACQUIRE: '1', STRATA_SHUTDOWN_TOKEN: shutdownToken, FAKE_ENGINE_MARK: mark, STRATA_SHARE_PORT: String(await freePort()), STRATA_TUNNEL_PORT: String(await freePort()), + ...(spyLog ? { ACQUIRE_SPY_LOG: spyLog } : {}) }, + }); + let log = ''; + host.stdout.on('data', c => { log += c; }); host.stderr.on('data', c => { log += c; }); + host.hostLog = () => log; + for (let i = 0; i < 200; i++) { try { if ((await fetch(base + '/api/health')).ok) return true; } catch { /* not yet */ } await delay(150); } + return false; +} +/** The host started the way the Tauri shell starts it, by a stand-in shell (a node process) that can then be killed hard. */ +async function startHostViaShell() { + port = await freePort(); base = `http://127.0.0.1:${port}`; + const spec = { command: node, args: [hostEntry], options: { + cwd: join(install, 'host'), stdio: 'ignore', windowsHide: true, + env: { ...baseEnv, STRATA_PORT: String(port), STRATA_DIST: join(install, 'host', 'dist'), NODE_ENV: 'production', STRATA_PACKAGED: '1', STRATA_REAL_ENGINE: '1', + STRATA_NO_ACQUIRE: '1', STRATA_SHUTDOWN_TOKEN: shutdownToken, STRATA_EXIT_WITH_PARENT: '1', FAKE_ENGINE_MARK: mark, + STRATA_SHARE_PORT: String(await freePort()), STRATA_TUNNEL_PORT: String(await freePort()) } } }; + const shell = spawn(node, ['-e', "const s=JSON.parse(process.env.HOST_SPEC);const c=require('node:child_process').spawn(s.command,s.args,s.options);console.log(c.pid);setInterval(()=>{},1000);"], + { env: { ...process.env, HOST_SPEC: JSON.stringify(spec) }, stdio: ['ignore', 'pipe', 'inherit'], windowsHide: true }); + const hostPid = await new Promise(r => shell.stdout.once('data', c => r(Number(String(c).trim())))); + for (let i = 0; i < 200; i++) { try { if ((await fetch(base + '/api/health')).ok) return { shell, hostPid }; } catch { /* not yet */ } await delay(150); } + return { shell, hostPid, failed: true }; +} +const call = async (path, method = 'GET', body) => { + const response = await fetch(base + path, { method, headers: { 'content-type': 'application/json' }, body: body === undefined ? undefined : JSON.stringify(body) }); + return { status: response.status, body: await response.json().catch(() => null) }; +}; +async function waitJob(id, seconds = 120) { + for (let i = 0; i < seconds * 5; i++) { + const state = (await call('/api/native')).body; + const job = state.jobs.find(j => j.id === id); + if (job && job.state !== 'running') return { job, state }; + await delay(200); + } + throw new Error('operation did not finish'); +} +async function stopHost(hard = false) { + if (!host || host.exitCode !== null) return; + if (hard) { if (isWin) spawnSync('taskkill', ['/PID', String(host.pid), '/T', '/F'], { windowsHide: true }); else host.kill('SIGKILL'); } + else host.kill(); + for (let i = 0; i < 100 && host.exitCode === null; i++) await delay(100); +} + +async function main() { + for (const need of [node, hostEntry, python, join(controlDir, 'strata.py')]) if (!existsSync(need)) { record('installed layout', false, `missing ${need}`); return; } + record('installed layout', true, install); + if (real) { + const packages = existsSync(join(dirs.components, 'engine')) ? readdirSync(join(dirs.components, 'engine')) : []; + record('fixtures', packages.length > 0 && existsSync(join(dirs.models, `strata-${modelId}.json`)), `engine package(s) ${packages.join(', ')} in ${dirs.components}; run config strata-${modelId}.json in ${dirs.models}`); + } else { + installFakeEngine(); + makeTokenizerAndConfig(); + record('fixtures', true, `stub engine package in ${dirs.components}; run config strata-stub.json`); + } + + if (!(await startHost())) { record('host healthy', false, host.hostLog().slice(-600)); return; } + record('host healthy', true, base); + + const status = (await call('/api/control/status')).body; + record('Control status: bundled, engine usable, acquiring forbidden', status.control?.python?.startsWith(controlDir) && status.engine?.usable === true && status.acquisition?.forbidden === true, + `python=${status.control?.python}; engine=${status.engine?.engine?.version}; forbidden=${status.acquisition?.forbidden}`); + + const native = (await call('/api/native?refresh=1')).body; + const model = native.installed?.models?.find(m => m.model === modelId); + record('models come from Control', native.available && model?.ready === true && native.packaged === true, `available=${native.available}; model ready=${model?.ready}; ${native.summary ?? native.error}`); + + // ---- load + const started = (await call('/api/native/operations', 'POST', { kind: 'load', args: { model: modelId } })).body; + const loaded = await waitJob(started.id, 400); + const instance = loaded.state.instances[0]; + record('load through the host starts the engine under Control', loaded.job.state === 'done' && instance?.status === 'ready', `job=${loaded.job.state} ${loaded.job.error ?? ''}; instance=${instance?.status}`); + let ran = existsSync(mark) ? JSON.parse(readFileSync(mark, 'utf8')) : null; + if (real) { + const listed = spawnSync('ps', ['-eo', 'pid,args'], { encoding: 'utf8' }).stdout.split('\n').filter(l => l.includes(`${dirs.components}/engine/`) && l.includes('--serve')); + ran = listed.length ? { pid: Number(listed[0].trim().split(/\s+/)[0]), script: listed[0].trim().split(/\s+/)[1] } : null; + record('the engine process running is the binary from the component folder', !!ran, listed[0] ? listed[0].trim().slice(0, 160) : 'no engine process under the component folder'); + } else { + record('the engine that ran is the one in the component folder', ran && ran.script.toLowerCase().startsWith(dirs.components.toLowerCase()), ran?.script ?? 'engine never ran'); + } + + const runtime = controlJson('runtime', 'status', '--profile', 'app-1'); + record('a second client sees the same owner and instance (ownership)', runtime.json?.state === 'ready' && !!runtime.json.owner_id && !!runtime.json.instance_id && runtime.json.host_pid !== host.pid, + `state=${runtime.json?.state}; owner=${String(runtime.json?.owner_id).slice(0, 8)}; instance=${String(runtime.json?.instance_id).slice(0, 8)}; owner host pid ${runtime.json?.host_pid} is not the app host (${host.pid})`); + + // ---- answer + const chat = await call('/v1/chat/completions', 'POST', real + ? { model: instance?.apiModelId ?? modelId, messages: [{ role: 'user', content: 'Reply with exactly one word: pong' }], max_tokens: 200, temperature: 0, reasoning_effort: 'none', stream: false } + : { model: instance?.apiModelId ?? modelId, messages: [{ role: 'user', content: 'hi' }], max_tokens: 4, stream: false }); + const message = chat.body?.choices?.[0]?.message ?? {}; + const answer = `${message.content ?? ''}${message.reasoning_content ?? ''}`; // the stub emits token 97 ("a"); the server files it as reasoning + record(real ? 'the real model answers through the host (the answer text is checked)' : 'the engine answers through the host (the stub token, not an error)', + chat.status === 200 && (real ? /pong/i.test(answer) : answer === 'a'), `status=${chat.status}; answer=${JSON.stringify(answer.slice(0, 200))}${chat.status === 200 ? '' : ' ' + JSON.stringify(chat.body).slice(0, 160)}`); + + // ---- unload + const unloaded = await call(`/api/native/instances/${instance.id}/unload`, 'POST', {}); + await delay(500); + const after = controlJson('runtime', 'status', '--profile', 'app-1'); + for (let i = 0; i < 100 && ran && alive(ran.pid); i++) await delay(100); // a real engine takes a moment to release the GPU + record('unload stops the engine', unloaded.status === 200 && after.json?.state === 'stopped' && (!ran || !alive(ran.pid)), `status=${unloaded.status}; runtime=${after.json?.state}; engine pid ${ran?.pid} alive=${ran ? alive(ran.pid) : 'n/a'}`); + + // ---- no engine for this PC + const hidden = join(dirs.components, real ? 'engine.hidden-by-flow' : 'engine.gone'); + renameSync(join(dirs.components, 'engine'), hidden); + rmSync(mark, { force: true }); + const missing = await waitJob((await call('/api/native/operations', 'POST', { kind: 'load', args: { model: modelId } })).body.id); + record('no engine for this PC is a notice and nothing is started', missing.job.state === 'error' && /No engine for this PC/.test(missing.job.error) && /never downloads/.test(missing.job.error) && !existsSync(mark), + `${missing.job.state}: ${String(missing.job.error).slice(0, 160)}`); + const refused = await waitJob((await call('/api/native/operations', 'POST', { kind: 'install', args: { family: 'qwen', model: 'IQ2_XS' } })).body.id); + record('installing from the app is refused (Terminal only)', refused.job.state === 'error' && /Terminal/.test(refused.job.error), refused.job.error); + const binary = await call('/api/engine/binary', 'POST'); + record('the llama.cpp download route is refused', binary.status === 409 && /never downloads/.test(binary.body?.error ?? ''), `${binary.status} ${binary.body?.error}`); + + // ---- clean shutdown (what the Tauri shell does on exit) + renameSync(hidden, join(dirs.components, 'engine')); + rmSync(mark, { force: true }); + const again = await waitJob((await call('/api/native/operations', 'POST', { kind: 'load', args: { model: modelId } })).body.id, 400); + let ran2 = existsSync(mark) ? JSON.parse(readFileSync(mark, 'utf8')) : null; + if (real) { + const listed = spawnSync('ps', ['-eo', 'pid,args'], { encoding: 'utf8' }).stdout.split('\n').filter(l => l.includes(`${dirs.components}/engine/`) && l.includes('--serve')); + ran2 = listed.length ? { pid: Number(listed[0].trim().split(/\s+/)[0]) } : null; + } + record('load again after the engine package returns', again.job.state === 'done', again.job.error ?? ''); + const wrong = await fetch(base + '/api/control/shutdown', { method: 'POST', headers: { 'x-strata-shutdown': 'nope' } }); + record('shutdown without the shell\'s secret is refused', wrong.status === 403, String(wrong.status)); + const exited = new Promise(r => host.once('exit', code => r(code))); + const stopping = await fetch(base + '/api/control/shutdown', { method: 'POST', headers: { 'x-strata-shutdown': shutdownToken } }); + const code = await Promise.race([exited, delay(90000).then(() => 'timeout')]); + for (let i = 0; i < 100 && ran2 && alive(ran2.pid); i++) await delay(100); + const final = controlJson('runtime', 'status', '--profile', 'app-1'); + record('clean shutdown stops the engine the app started and exits', stopping.status === 202 && code === 0 && final.json?.state === 'stopped' && (!ran2 || !alive(ran2.pid)), `status=${stopping.status}; host exit=${code}; runtime=${final.json?.state}; engine alive=${ran2 ? alive(ran2.pid) : 'n/a'}`); + + // ---- hard kill: an engine whose app host dies ends with it (the owner follows the host: runtime start --die-with-pid) + if (!(await startHost())) { record('host restarts', false, host.hostLog().slice(-400)); return; } + await call('/api/native?refresh=1'); + rmSync(mark, { force: true }); + const third = await waitJob((await call('/api/native/operations', 'POST', { kind: 'load', args: { model: modelId } })).body.id, 400); + let ran3 = existsSync(mark) ? JSON.parse(readFileSync(mark, 'utf8')) : null; + if (real) { + const listed = spawnSync('ps', ['-eo', 'pid,args'], { encoding: 'utf8' }).stdout.split('\n').filter(l => l.includes(`${dirs.components}/engine/`) && l.includes('--serve')); + ran3 = listed.length ? { pid: Number(listed[0].trim().split(/\s+/)[0]) } : null; + record('(real) the engine is up before the host is killed', !!ran3, listed[0] ? listed[0].trim().slice(0, 120) : 'no engine process'); + } + await stopHost(true); + for (let i = 0; i < 600 && ran3 && alive(ran3.pid); i++) await delay(100); // the owner notices within a second, drains, stops + const orphan = controlJson('runtime', 'status', '--profile', 'app-1'); + record('a hard-killed app host takes its engine with it', third.job.state === 'done' && (!ran3 || !alive(ran3.pid)), `engine alive=${ran3 ? alive(ran3.pid) : 'n/a'}; runtime=${orphan.json?.state ?? orphan.json?.error?.message}`); + const cleanup = controlJson('runtime', 'stop', '--profile', 'app-1'); + record('nothing is left to stop afterwards', /stopped|not managed/.test(JSON.stringify(cleanup.json)) && controlJson('runtime', 'status', '--profile', 'app-1').json?.state === 'stopped', JSON.stringify(cleanup.json).slice(0, 160)); + + // ---- the shell itself is killed (what the desktop shell's crash or kill looks like to the host): the host leaves, and + // its engine with it, with nothing announced. Windows also has the job object; this is the path that works everywhere. + const started2 = await startHostViaShell(); + if (started2.failed) { record('host starts under a stand-in shell', false, ''); try { started2.shell.kill('SIGKILL'); } catch { /* gone */ } } + else { + await call('/api/native?refresh=1'); + rmSync(mark, { force: true }); + const fourth = await waitJob((await call('/api/native/operations', 'POST', { kind: 'load', args: { model: modelId } })).body.id, 400); + let ran4 = existsSync(mark) ? JSON.parse(readFileSync(mark, 'utf8')) : null; + if (real) { + const listed = spawnSync('ps', ['-eo', 'pid,args'], { encoding: 'utf8' }).stdout.split('\n').filter(l => l.includes(`${dirs.components}/engine/`) && l.includes('--serve')); + ran4 = listed.length ? { pid: Number(listed[0].trim().split(/\s+/)[0]) } : null; + } + if (isWin) spawnSync('taskkill', ['/PID', String(started2.shell.pid), '/F'], { windowsHide: true }); else started2.shell.kill('SIGKILL'); + for (let i = 0; i < 100 && alive(started2.hostPid); i++) await delay(100); + const hostGone = !alive(started2.hostPid); + for (let i = 0; i < 900 && ran4 && alive(ran4.pid); i++) await delay(100); + const engineGone = !ran4 || !alive(ran4.pid); + record('a killed shell takes the host and its engine with it', fourth.job.state === 'done' && hostGone && engineGone, + `host pid ${started2.hostPid} gone=${hostGone}; engine pid ${ran4?.pid} gone=${engineGone}; runtime=${controlJson('runtime', 'status', '--profile', 'app-1').json?.state}`); + controlJson('runtime', 'stop', '--profile', 'app-1'); + } + + await finishSpy(); +} + +async function finishSpy() { + if (spyLog) { + const attempts = readFileSync(spyLog, 'utf8').split('\n').filter(Boolean); + record('no acquisition attempt by the host during the whole run (spy)', attempts.length === 0, attempts.join(' | ')); + } +} + +try { await main(); } +catch (error) { record('flow', false, error.stack ?? error.message); } +finally { + try { const hid = join(dirs.components, 'engine.hidden-by-flow'); if (real && existsSync(hid) && !existsSync(join(dirs.components, 'engine'))) renameSync(hid, join(dirs.components, 'engine')); } catch { /* reported by the run */ } + await stopHost(true); + controlJson('runtime', 'stop', '--profile', 'app-1'); + controlJson('runtime', 'stop', '--profile', 'app-2'); +} +const failed = steps.filter(s => !s.ok); +writeFileSync(join(work, 'installed-flow.json'), JSON.stringify({ ok: failed.length === 0, install, work, steps }, null, 1)); +console.log(`\n${steps.length - failed.length}/${steps.length} ok; report ${join(work, 'installed-flow.json')}`); +if (!args.keep && !args.work && failed.length === 0) { try { rmSync(work, { recursive: true, force: true }); } catch { /* leave it */ } } +process.exit(failed.length ? 1 : 0); diff --git a/engine/strata/apps/desktop/scripts/installer-mockups.mjs b/engine/strata/apps/desktop/scripts/installer-mockups.mjs new file mode 100644 index 00000000..cc7a3c8f --- /dev/null +++ b/engine/strata/apps/desktop/scripts/installer-mockups.mjs @@ -0,0 +1,73 @@ +#!/usr/bin/env node +/** + * Mock-ups of the Windows installer in Strata's own look: four screens (welcome, where, installing, done), light and dark, drawn with + * the app's built CSS (apps/host/dist) and brand files, then photographed with Chrome. Nothing here is built or shipped: it is what + * the owner is shown before an installer is chosen. + * + * node apps/desktop/scripts/installer-mockups.mjs [--out ] + */ +import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs'; +import { dirname, join, resolve } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; + +const args = Object.fromEntries(process.argv.slice(2).reduce((acc, a, i, all) => (a.startsWith('--') ? [...acc, [a.slice(2), all[i + 1]]] : acc), [])); +const here = dirname(fileURLToPath(import.meta.url)); +const host = resolve(here, '../../host'); +const out = resolve(args.out ?? join(here, '../installer-mockups')); +mkdirSync(out, { recursive: true }); +const dist = join(host, 'dist'); +const css = readdirSync(join(dist, 'assets')).filter(f => f.endsWith('.css')).map(f => readFileSync(join(dist, 'assets', f), 'utf8')).join('\n'); +const logo = theme => readFileSync(join(dist, 'brand', `strata-lockup-${theme}.svg`), 'utf8'); +const { chromium } = await import(pathToFileURL(join(host, 'node_modules/playwright-core/index.mjs')).href).catch(() => import('playwright-core')); +const CHROME = process.env.CHROME ?? ['C:/Program Files/Google/Chrome/Application/chrome.exe', '/usr/bin/google-chrome'].find(existsSync); + +const check = ''; +const folder = ''; + +const screens = { + welcome: theme => `
+

State of the art. At home.

Strata runs AI on your own computer.
Setting it up takes a few minutes.

+
${check}Private${check}Fast${check}Easy to use
+
Installs for you only. No administrator needed.
`, + where: theme => `
+

Where should Strata go?

This is the right place for most people.

+
${folder}
Your Strata folderC:\\Users\\Alex\\AppData\\Local\\Strata
+

About 310 MB. Your models and chats are kept somewhere else and are never removed by an update.

+
`, + installing: theme => `
+

Installing Strata…

Copying the app and its engine room. You can keep working meanwhile.

+
+
62% · 190 / 310 MB
About 1 min left
+
Next: choose your first model inside Strata.
`, + done: theme => `
+

Strata is ready.

Open it to pick your first model. Strata downloads it for you and gets it ready.

+
A shortcut was added to your Start menu and desktop.
`, +}; + +const page = (name, theme) => `
Strata setup– ☐ ✕
+
${screens[name](theme)}
`; + +const browser = await chromium.launch({ executablePath: CHROME, headless: true }); +const written = []; +for (const theme of ['light', 'dark']) { + for (const name of Object.keys(screens)) { + const tab = await browser.newPage({ viewport: { width: 860, height: 620 }, deviceScaleFactor: 1 }); + await tab.setContent(page(name, theme)); + await tab.waitForTimeout(250); + const file = join(out, `${name}-${theme}.png`); + await tab.screenshot({ path: file }); + written.push(file); + await tab.close(); + } +} +await browser.close(); +console.log(written.join('\n')); diff --git a/engine/strata/apps/desktop/scripts/local-gguf-e2e.mjs b/engine/strata/apps/desktop/scripts/local-gguf-e2e.mjs new file mode 100644 index 00000000..32e49fa7 --- /dev/null +++ b/engine/strata/apps/desktop/scripts/local-gguf-e2e.mjs @@ -0,0 +1,126 @@ +#!/usr/bin/env node +/** + * "Use your own GGUF" end to end on a box, through the installed app layout (packaged host + bundled Control + a real engine component): + * preview a folder of a supported model, preview an unsupported GGUF (must be refused in plain terms), prepare the supported one + * (pack, from the folder, nothing copied), load it, get a chat answer, unload, shut down, and check nothing is left running. + * + * node local-gguf-e2e.mjs --root /data/ui4-e2e --good /data/141-gyro/models/IQ2_XS --bad /data/ui4-e2e/bad [--context 8192] [--backend cuda|metal] + * (the app folder is /app: node/, host/, control/ ...; /components gets the engine, from /app/engine-bundle when the app carries one) + */ +import { spawn, spawnSync } from 'node:child_process'; +import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; +import { createServer } from 'node:net'; +import { join, resolve } from 'node:path'; + +const args = Object.fromEntries(process.argv.slice(2).reduce((acc, a, i, all) => (a.startsWith('--') ? [...acc, [a.slice(2), all[i + 1]]] : acc), [])); +const root = resolve(args.root); +const good = args.good, bad = args.bad; +const context = Number(args.context ?? 8192); +const app = join(root, 'app'); +const dirs = { components: join(root, 'components'), install: join(root, 'install'), profiles: join(root, 'profiles'), runtime: join(root, 'runtime'), home: join(root, 'home'), xdg: join(root, 'xdg'), appdata: join(root, 'appdata') }; +for (const d of [dirs.install, dirs.home, dirs.xdg, dirs.appdata]) mkdirSync(d, { recursive: true }); +const delay = ms => new Promise(r => setTimeout(r, ms)); +const steps = []; +let failed = false; +const record = (name, ok, detail = '') => { steps.push({ name, ok: !!ok, detail: String(detail).slice(0, 400) }); console.log(`${ok ? 'ok ' : 'FAIL'} ${name}${detail ? ' ' + String(detail).slice(0, 300) : ''}`); if (!ok) failed = true; }; +const freePort = async () => { const s = createServer(); await new Promise(r => s.listen(0, '127.0.0.1', r)); const p = s.address().port; await new Promise(r => s.close(r)); return p; }; + +const env = { ...process.env, STRATA_COMPONENTS_DIR: dirs.components, STRATA_PROFILE_DIR: dirs.profiles, STRATA_RUNTIME_DIR: dirs.runtime, STRATA_INSTALL_DIR: dirs.install, STRATA_HOME: dirs.home, STRATA_MODELS_DIR: join(root, 'Strata-data'), STRATA_ENGINE_BACKEND: args.backend ?? 'cuda', XDG_CONFIG_HOME: dirs.xdg, APPDATA: dirs.appdata, PYTHONDONTWRITEBYTECODE: '1' }; +delete env.STRATA_API_KEY; +const port = await freePort(); +const base = `http://127.0.0.1:${port}`; +const host = spawn(join(app, 'node', 'node'), [join(app, 'host', 'server', 'index.mjs')], { cwd: join(app, 'host'), stdio: ['ignore', 'pipe', 'pipe'], detached: false, + env: { ...env, STRATA_PORT: String(port), STRATA_DIST: join(app, 'host', 'dist'), NODE_ENV: 'production', STRATA_PACKAGED: '1', STRATA_REAL_ENGINE: '1', STRATA_NO_ACQUIRE: '1', STRATA_EXIT_WITH_PARENT: '1', + STRATA_SHARE_PORT: String(await freePort()), STRATA_TUNNEL_PORT: String(await freePort()), STRATA_WORKSPACE: join(root, 'workspace') } }); +mkdirSync(join(root, 'workspace'), { recursive: true }); +let hostLog = ''; host.stdout.on('data', c => { hostLog += c; }); host.stderr.on('data', c => { hostLog += c; }); +const call = async (path, method = 'GET', body) => { const r = await fetch(base + path, { method, headers: { 'content-type': 'application/json' }, body: body === undefined ? undefined : JSON.stringify(body) }); return { status: r.status, body: await r.json().catch(() => null) }; }; +async function waitJob(id, seconds) { + const until = Date.now() + seconds * 1000; + let last = ''; + while (Date.now() < until) { + const state = (await call('/api/native')).body; + const job = state.jobs.find(j => j.id === id); + if (job && job.state !== 'running') return { job, state }; + if (job && job.summary !== last) { last = job.summary; console.log(' ...', String(job.summary).slice(0, 140)); } + await delay(2000); + } + throw new Error('operation did not finish in time'); +} +const engineProcs = () => spawnSync('ps', ['-eo', 'pid,args'], { encoding: 'utf8' }).stdout.split('\n').filter(l => l.includes(join(dirs.components, 'engine')) && /\/strata( |$)/.test(l)); + +async function main() { + let up = false; + for (let i = 0; i < 200 && !up; i++) { try { up = (await fetch(base + '/api/health')).ok; } catch { await delay(150); } } + record('host healthy', up, up ? base : hostLog.slice(-500)); + if (!up) return; + let status = (await call('/api/control/status')).body; + for (let i = 0; i < 180 && status?.engineSetup; i++) { await delay(1000); status = (await call('/api/control/status')).body; } // the engine that came with the app is copied on the first start + record('Control status: bundled, engine usable', status?.engine?.usable === true, `engine=${status?.engine?.engine?.version} ${status?.engine?.notice ?? ''}`); + await call('/api/native?refresh=1'); + + // ---- the unsupported GGUF: a plain refusal + const badPreview = await call('/api/native/local/preview', 'POST', { path: bad }); + const badIssues = badPreview.body?.preview?.issues ?? badPreview.body?.issues ?? []; + const badStatus = badPreview.body?.preview?.file_set_status; + console.log(' bad preview:', badPreview.status, JSON.stringify(badPreview.body).slice(0, 400)); + record('an unsupported GGUF is refused, nothing adopted', badPreview.status === 200 ? (badStatus !== 'plausible' || !badPreview.body.preview.candidate_selection) : badPreview.status >= 400, `status=${badPreview.status}; file_set_status=${badStatus}; issues=${JSON.stringify(badIssues)}`); + + // ---- the supported folder + const goodPreview = await call('/api/native/local/preview', 'POST', { path: good }); + const selection = goodPreview.body?.preview?.candidate_selection; + console.log(' good preview:', JSON.stringify(goodPreview.body).slice(0, 500)); + record('a folder of a supported model is recognised', goodPreview.status === 200 && goodPreview.body?.preview?.file_set_status === 'plausible' && !!selection, `family=${selection?.family}; model=${selection?.model}; files=${goodPreview.body?.preview?.file_count}`); + if (!selection || args.only === 'preview') return; + + // ---- prepare (what the page's button does): install from the folder, nothing copied or downloaded + const native0 = (await call('/api/native?refresh=1')).body; + const catalogSize = native0.catalog?.families?.find(f => f.family === selection.family)?.sizes.find(s => s.model === selection.model); + record('the catalog lists the recognised version', !!catalogSize, catalogSize ? `id=${catalogSize.id}` : `no ${selection.family}/${selection.model} in the catalog`); + const started = await call('/api/native/operations', 'POST', { kind: 'install', args: { family: selection.family, model: selection.model, gguf_dir: good, context, vision: 'no' } }); + record('prepare starts', started.status < 300 && !!started.body?.id, `status=${started.status} ${JSON.stringify(started.body).slice(0, 200)}`); + if (!started.body?.id) return; + const prepared = await waitJob(started.body.id, 3600); + record('prepare finishes', prepared.job.state === 'done', `${prepared.job.state}: ${prepared.job.error ?? prepared.job.summary}`); + if (prepared.job.state !== 'done') return; + const native1 = (await call('/api/native?refresh=1')).body; + const modelId = catalogSize?.id ?? `${selection.family === 'qwen' ? '' : selection.family + '-'}${String(selection.model).toLowerCase()}`; + const entry = native1.installed?.models?.find(m => m.model === modelId); + record('the model is ready and points at the folder, not a copy', entry?.ready === true, `model=${modelId}; ready=${entry?.ready}; dataFolder=${entry?.dataFolder}`); + if (!entry?.ready) return; + + // ---- load + const load = await call('/api/native/operations', 'POST', { kind: 'load', args: { model: modelId } }); + const loaded = await waitJob(load.body.id, 1800); + const instance = loaded.state.instances[0]; + record('load starts the engine from the component folder', loaded.job.state === 'done' && instance?.status === 'ready', `job=${loaded.job.state} ${loaded.job.error ?? ''}; instance=${instance?.status}`); + if (instance?.status !== 'ready') return; + record('one engine process is running', engineProcs().length === 1, engineProcs().map(l => l.trim().slice(0, 140)).join(' | ')); + + // ---- a chat answer, checked + const chat = await fetch(base + '/api/chat/stream', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ sessionId: 'e2e-chat', message: 'Reply with exactly one word: pong', history: [], nativeModelId: instance.id, thinking: 'Off', agent: false, workspaceId: null }) }); + let text = '', done = null; + for await (const chunk of chat.body) { + for (const line of Buffer.from(chunk).toString('utf8').split('\n')) { + if (!line.trim()) continue; + try { const f = JSON.parse(line); if (f.type === 'delta') text += f.text ?? ''; if (f.type === 'done') done = f; if (f.type === 'error') text += ` [error: ${f.message}]`; } catch { /* partial line */ } + } + } + record('the model answers through the app (the answer text is checked)', chat.status === 200 && /pong/i.test(text), `status=${chat.status}; answer=${JSON.stringify(text.slice(0, 120))}; tokensOut=${done?.tokensOut}; tps=${done?.tps}`); + + // ---- unload, shutdown, nothing left + const unload = await call(`/api/native/instances/${instance.id}/unload`, 'POST'); + await delay(3000); + record('unload stops the engine', unload.status < 300 && engineProcs().length === 0, `status=${unload.status}; engines left=${engineProcs().length}`); +} + +try { await main(); } catch (e) { record('the flow', false, e?.stack ?? e); } +host.kill(); +for (let i = 0; i < 100 && host.exitCode === null; i++) await delay(100); +if (host.exitCode === null) host.kill('SIGKILL'); +await delay(2000); +const left = spawnSync('ps', ['-eo', 'pid,args'], { encoding: 'utf8' }).stdout.split('\n').filter(l => (l.includes(dirs.install) || l.includes(join(app, 'host'))) && !l.includes('ps -eo')); +record('nothing of this run is left running', left.length === 0, left.join(' | ').slice(0, 300)); +writeFileSync(join(root, 'e2e-result.json'), JSON.stringify({ steps, hostLogTail: hostLog.slice(-2000) }, null, 1)); +console.log(failed ? 'FAILED' : 'ALL OK'); +process.exit(failed ? 1 : 0); diff --git a/engine/strata/apps/desktop/scripts/make-dmg.sh b/engine/strata/apps/desktop/scripts/make-dmg.sh new file mode 100755 index 00000000..909579f8 --- /dev/null +++ b/engine/strata/apps/desktop/scripts/make-dmg.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +# Build the Strata DMG without a Finder session. +# +# Tauri's default DMG step runs an AppleScript that asks Finder to arrange the window (icon +# positions, background). Finder AppleEvents time out in a non-GUI or sandboxed context — observed +# here as `Finder got an error: AppleEvent timed out. (-1712)` — so the default path cannot be +# relied on for an automated build. The upstream `create-dmg` script already supports exactly this +# case via `--skip-jenkins`, which produces a plain, correct DMG with the app and the Applications +# drop link and no cosmetic arrangement. +# +# Usage: scripts/make-dmg.sh [output.dmg] +set -euo pipefail + +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +DESKTOP="$(cd "$HERE/.." && pwd)" +BUNDLE="$DESKTOP/src-tauri/target/release/bundle" +APP="$BUNDLE/macos/Strata.app" +VERSION="$(grep -m1 '^version = ' "$DESKTOP/src-tauri/Cargo.toml" | cut -d'"' -f2)" # the one place the app version is written +OUT="${1:-$BUNDLE/dmg/Strata_${VERSION}_aarch64.dmg}" + +if [ ! -d "$APP" ]; then + echo "error: $APP does not exist; run 'cargo tauri build --bundles app' first" >&2 + exit 1 +fi + +WORK="$(mktemp -d -t strata-dmg)" +trap 'rm -rf "$WORK"' EXIT + +# A staging folder is what create-dmg copies into the image: the app, and nothing else. +# +# The Applications drop link is created by `--app-drop-link` below. Adding one here as well makes +# create-dmg fail with "File exists", because it links into the volume it is assembling. +mkdir -p "$WORK/stage" +cp -R "$APP" "$WORK/stage/" + +# Reuse Tauri's vendored create-dmg if the bundler left it behind, otherwise take it from the +# bundle cache. Building it yourself is not necessary and not expected. +SCRIPT="$BUNDLE/dmg/bundle_dmg.sh" +if [ ! -x "$SCRIPT" ]; then + echo "error: $SCRIPT not found; run 'cargo tauri build --bundles dmg' once to vendor it" >&2 + exit 1 +fi + +mkdir -p "$(dirname "$OUT")" +rm -f "$OUT" + +# --skip-jenkins: no Finder AppleScript. Everything else is the same code path Tauri uses. +"$SCRIPT" \ + --volname "Strata $VERSION" \ + --volicon "$BUNDLE/macos/Strata.app/Contents/Resources/Strata.icns" \ + --app-drop-link 400 200 \ + --skip-jenkins \ + --no-internet-enable \ + "$OUT" "$WORK/stage" + +echo +echo "built: $OUT" +ls -lh "$OUT" | awk '{print "size: " $5}' +shasum -a 256 "$OUT" diff --git a/engine/strata/apps/desktop/scripts/make-icons.mjs b/engine/strata/apps/desktop/scripts/make-icons.mjs new file mode 100644 index 00000000..411e4b97 --- /dev/null +++ b/engine/strata/apps/desktop/scripts/make-icons.mjs @@ -0,0 +1,78 @@ +#!/usr/bin/env node +/** + * The app and installer icon, refined from the existing Strata mark (apps/host/public/brand/strata-mark-*.svg and the current + * icons/icon.png): the same three rounded bars on the same dark tile, in the same colours. Nothing is redrawn. What changes is + * how it is cut for small sizes: at 16-48 px the bars are snapped to whole pixels and made a little bolder and wider so they + * stay crisp instead of blurring; from 64 px up the geometry is the mark's own proportions. + * + * node apps/desktop/scripts/make-icons.mjs [--out ] writes icon-.png for every size and icon.ico + */ +import { existsSync, mkdirSync, writeFileSync } from 'node:fs'; +import { dirname, join, resolve } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; + +const args = Object.fromEntries(process.argv.slice(2).reduce((acc, a, i, all) => (a.startsWith('--') ? [...acc, [a.slice(2), all[i + 1]]] : acc), [])); +const here = dirname(fileURLToPath(import.meta.url)); +const host = resolve(here, '../../host'); +const out = resolve(args.out ?? join(here, '../src-tauri/icons')); +mkdirSync(out, { recursive: true }); +const { chromium } = await import(pathToFileURL(join(host, 'node_modules/playwright-core/index.mjs')).href).catch(() => import('playwright-core')); +const CHROME = process.env.CHROME ?? ['C:/Program Files/Google/Chrome/Application/chrome.exe', '/usr/bin/google-chrome'].find(existsSync); + +const TILE = '#161a1d', LIGHT = '#eef1f3', GREEN = '#34d399'; // the colours of the current icon.png + +/** Integer geometry for the small sizes: bars on whole pixels, centred. Returns [{x,y,w,h,fill}]. */ +function hinted(size) { + const bar = Math.max(2, Math.round(size * 0.14)), gap = Math.max(2, Math.round(size * 0.1)), mid = bar + 1; + const total = 2 * bar + mid + 2 * gap, top = Math.floor((size - total) / 2); + const even = w => (w % 2 === size % 2 ? w : w + 1); + const wide = even(Math.round(size * 0.5)), long = even(Math.round(size * 0.76)); + return [ + { x: (size - wide) / 2, y: top, w: wide, h: bar, fill: LIGHT }, + { x: (size - long) / 2, y: top + bar + gap, w: long, h: mid, fill: GREEN }, + { x: (size - wide) / 2, y: top + bar + gap + mid + gap, w: wide, h: bar, fill: LIGHT }, + ]; +} +/** The mark's own proportions (from icon.png at 512): bars 34% / 50% / 34% wide, 9% high, on a tile with 21.5% corners. */ +function proportional(size) { + const k = size / 512; + return [ + { x: 170 * k, y: 156 * k, w: 173 * k, h: 46 * k, fill: LIGHT }, + { x: 128 * k, y: 232 * k, w: 256 * k, h: 48 * k, fill: GREEN }, + { x: 170 * k, y: 309 * k, w: 173 * k, h: 46 * k, fill: LIGHT }, + ]; +} +function svg(size) { + const small = size <= 48; + const bars = (small ? hinted(size) : proportional(size)); + const radius = small ? Math.round(size * 0.22) : size * 0.215; + const rects = bars.map(b => ``).join(''); + return `${rects}`; +} + +const SIZES = [16, 20, 24, 32, 40, 48, 64, 96, 128, 256, 512, 1024]; +const browser = await chromium.launch({ executablePath: CHROME, headless: true }); +const png = {}; +for (const size of SIZES) { + const page = await browser.newPage({ viewport: { width: size, height: size }, deviceScaleFactor: 1 }); + await page.setContent(`${svg(size)}`); + png[size] = await page.screenshot({ omitBackground: true, clip: { x: 0, y: 0, width: size, height: size } }); + await page.close(); + writeFileSync(join(out, `icon-${size}.png`), png[size]); +} +await browser.close(); + +// The .ico: one PNG image per size (16-256), the sizes Windows asks for at 100-250% scaling. +const ICO = [16, 20, 24, 32, 40, 48, 64, 96, 128, 256]; +const head = Buffer.alloc(6); head.writeUInt16LE(0, 0); head.writeUInt16LE(1, 2); head.writeUInt16LE(ICO.length, 4); +let offset = 6 + 16 * ICO.length; +const entries = [], blobs = []; +for (const size of ICO) { + const data = png[size], e = Buffer.alloc(16); + e.writeUInt8(size === 256 ? 0 : size, 0); e.writeUInt8(size === 256 ? 0 : size, 1); e.writeUInt8(0, 2); e.writeUInt8(0, 3); + e.writeUInt16LE(1, 4); e.writeUInt16LE(32, 6); e.writeUInt32LE(data.length, 8); e.writeUInt32LE(offset, 12); + offset += data.length; entries.push(e); blobs.push(data); +} +writeFileSync(join(out, 'icon.ico'), Buffer.concat([head, ...entries, ...blobs])); +writeFileSync(join(out, 'icon.png'), png[512]); +console.log('icons in', out, ICO.join(',')); diff --git a/engine/strata/apps/desktop/scripts/make-installer-images.mjs b/engine/strata/apps/desktop/scripts/make-installer-images.mjs new file mode 100644 index 00000000..f12d6cc1 --- /dev/null +++ b/engine/strata/apps/desktop/scripts/make-installer-images.mjs @@ -0,0 +1,66 @@ +#!/usr/bin/env node +/** + * The installer's pictures, drawn from the app's own design: the light surface and ink colours of the app (src/styles tokens), the + * brand lockup and mark files, GT Walsheim Bold for the words (baked into the pictures, because NSIS cannot use a web font). + * + * node apps/desktop/scripts/make-installer-images.mjs [--out ] [--preview ] + * + * Writes sidebar.bmp (164x314, the welcome and finish pages) and header.bmp (150x57, the other pages) as 24-bit BMPs, and with + * --preview the same as PNGs at 3x. + */ +import { spawnSync } from 'node:child_process'; +import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; +import { dirname, join, resolve } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; +import { tmpdir } from 'node:os'; + +const args = Object.fromEntries(process.argv.slice(2).reduce((acc, a, i, all) => (a.startsWith('--') ? [...acc, [a.slice(2), all[i + 1]]] : acc), [])); +const here = dirname(fileURLToPath(import.meta.url)); +const host = resolve(here, '../../host'); +const out = resolve(args.out ?? join(here, '../src-tauri/nsis')); +mkdirSync(out, { recursive: true }); +const { chromium } = await import(pathToFileURL(join(host, 'node_modules/playwright-core/index.mjs')).href).catch(() => import('playwright-core')); +const CHROME = process.env.CHROME ?? ['C:/Program Files/Google/Chrome/Application/chrome.exe', '/usr/bin/google-chrome'].find(existsSync); +const font = pathToFileURL(join(host, 'public/fonts/GTWalsheimPro-Bold.woff2')).href; +const fontMedium = pathToFileURL(join(host, 'public/fonts/GTWalsheimPro-Medium.woff2')).href; +const lockup = readFileSync(join(host, 'public/brand/strata-lockup-light.svg'), 'utf8'); +const mark = readFileSync(join(host, 'public/brand/strata-mark-light.svg'), 'utf8'); + +// the app's light tokens +const SURFACE = '#f9fafb', INK = '#171b1e', MUTED = '#5b646b', ACCENT = '#10b981', LINE = '#e3e8ea'; +const css = `@font-face{font-family:GT;font-weight:700;src:url(${font})}@font-face{font-family:GT;font-weight:500;src:url(${fontMedium})} +*{box-sizing:border-box}body{margin:0;font-family:GT,'Segoe UI',sans-serif;color:${INK};background:${SURFACE}}`; + +const pages = { + sidebar: { w: 164, h: 314, html: `
+
${lockup.replace(' +
+
State of
the art.
At home.
+
AI on your own computer.
Private. Fast. Easy.
+
+
` }, + header: { w: 150, h: 57, html: `
${lockup.replace('` }, +}; + +const browser = await chromium.launch({ executablePath: CHROME, headless: true }); +const work = join(tmpdir(), 'strata-installer-images'); mkdirSync(work, { recursive: true }); +for (const [name, page] of Object.entries(pages)) { + for (const scale of [1, 3]) { + const file = join(work, `${name}.html`); + writeFileSync(file, `${page.html}`); + const tab = await browser.newPage({ viewport: { width: page.w, height: page.h }, deviceScaleFactor: scale }); + await tab.goto(pathToFileURL(file).href); + await tab.evaluate(() => document.fonts.ready); + await tab.waitForTimeout(200); + const png = join(work, `${name}@${scale}.png`); + await tab.screenshot({ path: png, clip: { x: 0, y: 0, width: page.w, height: page.h } }); + await tab.close(); + if (scale === 3 && args.preview) { mkdirSync(resolve(args.preview), { recursive: true }); writeFileSync(join(resolve(args.preview), `${name}.png`), readFileSync(png)); } + } +} +await browser.close(); +// 24-bit BMP, the format NSIS wants: render at 3x, shrink with a good filter +const py = `import sys\nfrom PIL import Image\nfor name in ('sidebar','header'):\n im = Image.open(sys.argv[1] + '/' + name + '@3.png').convert('RGB')\n w, h = im.width // 3, im.height // 3\n im.resize((w, h), Image.LANCZOS).save(sys.argv[2] + '/' + name + '.bmp', 'BMP')\n`; +const done = spawnSync('python', ['-c', py, work, out], { encoding: 'utf8' }); +if (done.status !== 0) { console.error(done.stderr); process.exit(1); } +console.log('wrote', join(out, 'sidebar.bmp'), join(out, 'header.bmp')); diff --git a/engine/strata/apps/desktop/scripts/make-tester-readme.sh b/engine/strata/apps/desktop/scripts/make-tester-readme.sh new file mode 100644 index 00000000..e38103c8 --- /dev/null +++ b/engine/strata/apps/desktop/scripts/make-tester-readme.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash +# Write a tester's README with the checksums and sizes of the files it names, computed from the files themselves. +# +# apps/desktop/scripts/make-tester-readme.sh