export const featureNames = [ "Memory64", "AArch64 P-code semantics", "Dynamic block translation", "JSPI", "Tail calls", "SIMD", "Relaxed SIMD", "Multiple memories", "Typed function references", "Exception handling", ] as const; export type FeatureName = (typeof featureNames)[number]; export type FixtureName = | "compiler-c" | "compiler-diagnostic" | "libc-c" | "rust" | "infinite-loop" | "file-roundtrip" | "project-persistence-write" | "project-persistence-read" | "pipe-roundtrip" | "vfs-lifecycle" | "system-services" | "spawn-wait" | "spawn-exec" | "terminal-input" | "execve-launcher"; export type RunTarget = FixtureName | "uploaded-program"; export interface FeatureResult { name: FeatureName; supported: boolean; detail?: string; } export interface ExecutionLimits { instructionBudget: bigint; syscallBudget: bigint; maxOutputBytes: bigint; maxMemoryBytes: bigint; maxFilesystemBytes: bigint; } export interface ExecutionDiagnostic { code: string; message: string; } export interface ExecutionReport { outcome: "exited" | "diagnostic" | "waiting-input"; diagnostic?: ExecutionDiagnostic; stdout: string; stderr: string; trace: string; exitCode: number | null; executedInstructions: bigint; dispatchedSyscalls: bigint; outputBytes: bigint; profiledBlocks: bigint; hottestBlockStart: bigint | null; hottestBlockExecutions: bigint; translatedBlockExecutions: bigint; translatedInstructions: bigint; translationFallbackBlocks: bigint; compiledBlocks: bigint; translationCacheHits: bigint; compiledWasmBytes: bigint; inputMaxBytes: bigint; } export interface TranslationBenchmarkReport { iterations: number; guestInstructions: bigint; interpretedMilliseconds: number; translatedMilliseconds: number; speedup: number; translatedBlocks: bigint; fallbackBlocks: bigint; } export type WorkerCommand = | { kind: "run"; runId: number; fixture: FixtureName; limits: ExecutionLimits; } | { kind: "run-program"; runId: number; executable: Uint8Array; argv0: string; arguments: string[]; environment: string[]; limits: ExecutionLimits; } | { kind: "input"; runId: number; input: string; endOfFile: boolean; } | { kind: "filesystem-export"; requestId: number; maxFilesystemBytes: bigint; } | { kind: "filesystem-import"; requestId: number; maxFilesystemBytes: bigint; mode: "replace" | "install"; snapshot: Uint8Array; } | { kind: "filesystem-write"; requestId: number; maxFilesystemBytes: bigint; path: string; contents: Uint8Array; } | { kind: "filesystem-clear-cache"; requestId: number; maxFilesystemBytes: bigint; } | { kind: "translation-benchmark"; requestId: number; iterations: number; }; export type WorkerMessage = | { kind: "ready"; results: FeatureResult[] } | { kind: "result"; runId: number; target: RunTarget; execution: ExecutionReport; } | { kind: "filesystem-image"; requestId: number; operation: "export" | "replace" | "install" | "write" | "clear-cache"; snapshot: Uint8Array; } | { kind: "translation-benchmark"; requestId: number; report: TranslationBenchmarkReport; } | { kind: "error"; message: string };