Skip to content

Add a bounded client-side guest runtime - #31

Merged
keys-i merged 7 commits into
mainfrom
runtime
Aug 15, 2026
Merged

Add a bounded client-side guest runtime#31
keys-i merged 7 commits into
mainfrom
runtime

Conversation

@keys-i

@keys-i keys-i commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Motivation

Provide an honest browser-native guest path without claiming complete Linux, BSD, ISA, or raw-socket compatibility.

Changes

  • add bounded ELF64 loading, x86-64/AArch64 instruction subsets, and a hot-block WebAssembly JIT
  • add Linux and FreeBSD syscall maps over bounded memory and virtual files
  • harden BlockFS/OPFS persistence, mapping/file/output limits, and cooperative cancellation
  • add deny-by-default Fetch/WebSocket transport and trusted host capability hooks for AI, Python, and Go runtimes
  • add an optional injected v86 lifecycle adapter for higher-fidelity x86 PC images
  • document exact instruction/syscall contracts, security limits, architecture, benchmarks, and a CSP-constrained playground

Verification

  • npm run build — PASS; 71,745 B JavaScript and 3,842 B Wasm
  • npm run validate — PASS; Biome, JavaScript regressions, and cargo test
  • npm run benchmark — PASS; 80,219 simple ops/s, 64,874 parse ops/s, 239.7% warm Wasm improvement, 76.59x x86 and 84.84x AArch64 loop JIT speedups
  • npm pack --dry-run — PASS; 71 files
  • git diff --check — PASS
  • browser execution — UNVERIFIED locally because Chromium, Firefox, chromedriver, and geckodriver are unavailable; CI owns that gate
  • final gate — PASS via the documented gpt-5.6-sol fallback after the fixed gpt-5.6 gatekeeper model was unavailable for this account

Risks

This remains a documented instruction/syscall subset, not a distribution boot environment. Browser WebSockets may include ambient cookies, raw TCP/UDP requires a relay, mprotect does not enforce page permissions, and v86/source URLs remain host policy.

Rollback

Revert bed3189.

Closes #20
Closes #21
Refs #22
Refs #23
Refs #24
Refs #5

keys-i and others added 5 commits August 3, 2026 20:17
Move biome and release-plz into tools/config, and build/test/benchmark/manual/browser tooling into tools/scripts. Keep a thin root biome.json that only extends the real config so Biome can still resolve the project root.

Closes #16

Co-authored-by: Cursor <[email protected]>
Introduce BlockDevice and BlockFS with an inode table, free-block set, and MemoryFS-compatible API so createShell can mount either backend. Persist across remounts from the same ArrayBuffer.

Closes #17

Co-authored-by: Cursor <[email protected]>
Ship LinearMemory, a register/flags file, and an interpreter covering MOV/ALU/JMP/Jcc/CALL/RET/PUSH/POP/LEA/INC/DEC/NOP/SYSCALL for toy programs. Fail closed on unsupported encodings.

Closes #18

Co-authored-by: Cursor <[email protected]>
Share LinearMemory/flags with the x86 core and interpret MOVZ/MOVK, ADD/SUB, logic ops, LDR/STR, B/B.cond/BL/RET, NOP, and SVC for toy programs.

Closes #19

Co-authored-by: Cursor <[email protected]>
@keys-i
keys-i changed the base branch from arm to main August 13, 2026 10:01
@keys-i
keys-i marked this pull request as ready for review August 13, 2026 10:01
@keys-i keys-i closed this Aug 13, 2026
@keys-i keys-i reopened this Aug 13, 2026
@keys-i
keys-i merged commit ea38346 into main Aug 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux/BSD syscall emulation layer Runtime WASM JIT for hot basic blocks

1 participant