harshil

discomp

Lets people lend their computer's spare power. Other people's jobs run inside a locked box on that computer.

in progressRust2026-10 → nowsoloprivate repodiscomp.cloud ↗

what
A network that joins the idle laptops and desktops of many owners into one big computer that other people can rent.
the hard part
Strangers' code runs on your machine. It must never see your files, never slow you down, and never drain your battery.
where it is
Built and tested on Mac and Linux. Each job runs in its own small virtual machine. Still in development.

How it works

  1. You install one program. It keeps checking your machine.
  2. It tells the discomp server how much it can lend right now: whole CPUs, GB of memory, GB of disk. This slice is a capacity lease — A slice of one machine (whole CPUs, GiB of memory, GiB of disk) given to one job for a limited time..
  3. Someone else’s job runs inside a microVM — A very small virtual machine that starts in about a second. Work inside it cannot see or touch the host machine. — a small, locked virtual machine. It cannot see your files.
  4. Your computer only connects out. It never opens a port.

The rule I care about most

A computer must never offer power it does not have. When in doubt, it says no (fail closed — When a reading fails, choose the safe answer. For discomp: if the battery level is unknown, lend nothing.):

  • Battery unknown, or at or below your limit (30% by default): lend nothing. Start again only at your limit + 5%, or when it is plugged in.
  • Laptop lid closed on battery: lend nothing, unless you allow it.
  • Machine too hot, or memory under pressure: lend nothing.
  • You always keep at least 2 CPUs and 8 GB (or half your memory) for yourself.

What went wrong

The automated checks (CI) were slow, and not because of the tests. Each test machine runs one job at a time, so jobs waited in a queue. In three runs they waited 471, 857 and 748 seconds for 7 to 9 minutes of real work. I merged the steps so the Linux machine runs 2 jobs per run instead of 6.

Design choices

  • Your share comes first. By default the machine lends half its spare CPUs and three quarters of its spare memory, and keeps the rest for you.
  • No check compares two machines’ clocks. Clocks drift. The design works without them.
  • Every connection is encrypted and both sides prove who they are (mutual TLS — An encrypted connection where both sides prove who they are with a certificate, not only the server.).
  • Tests run on real virtual machines, on a real Linux machine and a real Mac. A test that cannot run is reported as skipped, never as passed.

numbers

valuewhatsource
61klines of Rust in 15 parts (counted 2026-12-01)repo
261 / 138commits / pull requests, 30 Oct → 30 Nov 2026GitHub
40+written design decisions, each with its reasondocs/architecture.md
2operating systems that run jobs today - macOS and LinuxREADME

explore the code

Explorer 8 parts · tap one
crates/domain

The rules. Decides, from the machine's state, how much it may lend right now. No network, no disk - just logic, so every rule has a test.

crates/probe

Reads the machine's state - CPU, memory, disk, battery, lid, temperature, and if the owner is using it. Only reads.

crates/executor

The program on each lender's computer. Reports what it can lend, and runs the jobs it gets.

crates/allocator

The central server. Keeps a live list of every computer and what it can lend, and hands out the work.

crates/sandbox

Starts one small virtual machine per job - Firecracker on Linux, Apple Virtualization on Mac.

crates/guest

The first program that starts inside that virtual machine. Runs the job and reports back.

crates/cli

A command that shows the whole network as a table.

docs/architecture.md

The full design, with 40+ numbered decisions and the reason for each one.

keys

This page reads like any web page. If you use vim, it also works like vim.

move
j / knext / previous line
gg / Gtop / bottom
Ctrl-d / Ctrl-uhalf a page down / up
]] / [[next / previous heading
H / Lprevious / next project or post
act
Enter or gfopen the link on the current line
Kexplain the term on the current line
/ then n / Nsearch this page
:command line: a page name, help, q
Spacemenu: f find, p projects, w writing
Space a / Ctrl-e / Alt-1…4pin a page, list pins, jump to a pin
Ctrl-oback
Escclose, clear search