Adom Hydrogen
Public Made by Adomby adom
The whole Adom experience as one signed native app: your editor, your AI agent, and the full electronics design toolchain, running locally on your own machine.
Prefetch the golden image at setup start and resume it across the WSL2 reboot (byte-range resume; host verified 206)
Kyle's idea, relayed by John 2026-09-04: start the golden image download the moment the setup cascade starts, so it overlaps the slow steps (enabling WSL2, which needs a reboot) and people on slow internet are not waiting at the image step later. John's follow-up: the WSL2 reboot would abandon a download that is 30% done, so it has to resume where it left off.
What exists today (runtime/wsl.rs, download_tarball)
- The image is fetched at the
ensure-workspacestep, which runs AFTERensure-wsl(the reboot). So on a fresh machine the 663 MB download does not even begin until after the reboot. - It streams to
<LocalAppData>/.../cache/adom-golden.tar.gz.partwithFile::create, which truncates: a.partleft by a reboot is thrown away and the download restarts from byte 0. - A completed
adom-golden.tar.gzis reused if its SHA-256 matches the pin (verified-cache fast path), andDOWNLOAD_LOCKalready serialises the two cascade entry points (startup auto-run and the post-reboot resume detector) so they cannot interleave into one.part.
Verified from the cloud, 2026-09-04
curl -I -r 0-0 on the v27 asset (redirected to release-assets.githubusercontent.com) returns HTTP 206, accept-ranges: bytes, content-range: bytes 0-0/694902658. Byte-range resume needs nothing from the host.
Plan
- Prefetch at cascade start. Spawn
download_tarballas a detached task the moment the cascade begins, beforeensure-wsl. The image step later either hits the verified-cache fast path or waits onDOWNLOAD_LOCKfor the in-flight download, exactly as the post-reboot resume detector does today. Progress goes to the same on_pct channel so the setup UI can show "image 31% in the background" while WSL2 installs. - Byte-range resume. On entry, if
.partexists: read its length N, sendRange: bytes=N-; on206open the file for append and continue; on200(range ignored) truncate and start over; on anything else, error as today. Keep the SHA-256 verification at the end unchanged, so a bad resume is caught the same way a bad download is. - Sidecar so a stale part is never resumed. Write
adom-golden.tar.gz.part.jsonwith{url, sha256, total}when the download starts. On resume, if the pinned URL or sha differs (a version bump between reboot and relaunch), discard the.part. Also discard if N is greater thantotal. - Reboot survival is then free. The
.partand sidecar are on disk; Hydrogen autostarts after the WSL2 reboot; the cascade resumes at its incomplete step; the prefetch is re-armed at cascade start and continues from byte N. - Do not fight the reboot. Before the cascade triggers the reboot, let the in-flight chunk finish (a few hundred KB) and flush; the
.partlength is then exactly what the resume sends.
Not in scope: multi-connection or throttled downloads. The single stream is already the fastest a home connection gets.