Skip to content

fix(vm): binder:vm / TCG compatibility & boot-cache reliability sweep - #248

Merged
Xiddoc merged 1 commit into
masterfrom
claude/beetroot-sweep-optimize-fnq7r0
Jun 30, 2026
Merged

fix(vm): binder:vm / TCG compatibility & boot-cache reliability sweep#248
Xiddoc merged 1 commit into
masterfrom
claude/beetroot-sweep-optimize-fnq7r0

Conversation

@Xiddoc

@Xiddoc Xiddoc commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary

First batch of an automated codebase sweep, focused on binder: vm (QEMU micro-VM / TCG) compatibility — the one device backend reachable on binderless / no-KVM hosts (incl. the Claude Code web sandbox). These fixes make a cold software-emulated (TCG) boot actually succeed, repeat cleanly via the savevm boot-cache, and not corrupt or orphan state, plus a few process-safety and cache-correctness bugs.

Each issue was verified against the real code by a triage pass, implemented with tests, and gate-checked before integration.

Fixes (12 issues)

Compatibility / TCG boot

Process safety / correctness

Relay / guest

Testing

Full local gate green: ruff check (src+tests), ruff format --check, mypy --strict (src+tests), pytest -p no:randomly with 100% line+branch coverage (1744 passed, 6 docker-daemon skips), shellcheck -S style -s sh + shfmt -i 4, yamllint, actionlint 1.7.12, zizmor 1.25.2, codespell 2.4.2, deptry 0.25.1, uv lock --check, changelog lint.

🤖 Generated with Claude Code

https://claude.ai/code/session_01P1YsNMpGizhSDDPCBu5cut


Generated by Claude Code

Compatibility-focused batch hardening the binder:vm (QEMU micro-VM /
TCG) backend so a cold software-emulated boot succeeds and repeats
cleanly, plus process-safety and cache-correctness fixes.

- Accelerator-aware ADB-connect wait: TCG uses a boot-completed-scale
  deadline instead of the flat 60s so a ~222s cold TCG boot no longer
  fails `up` before the guest exposes ADB; KVM keeps the short default (#160)
- boot_cache: fold resolved -smp/-m geometry into the staleness
  fingerprint so a geometry edit cold-boots instead of resuming into a
  mismatch (#161); recreate a snapshot-less overlay before a cold boot so
  an aborted first boot's dirty COW layer is never reused, sidecar written
  atomically (#175); re-check QEMU liveness during the ADB wait and fall
  back to one cold boot when a warm -loadvm resume dies (#176)
- compute_cache_key/base_identity break basename ties on content hash,
  hashing each input exactly once (#235)
- doctor: drop the always-failing Magisk rows on the Magisk-less VM guest (#163)
- up()/_up_cached() terminate the just-launched QEMU on a timed-out wait
  instead of orphaning it (#174)
- verify the recorded PID still names this instance's QEMU before
  SIGTERM/SIGKILL on down/restart/destroy (#162)
- fix the in-guest ADB port to a single 5555 contract (#237) and harden
  the adb relay: IPv6 loopback, eth0 address verify, distinct warnings,
  short-read-safe adbprobe (#238)
- align self-contradicting vm.py comments/docstrings with guest-init.sh (#241)
- e2e tier-vm-qemu caches the savevm overlay to skip the ~100s cold TCG
  boot on repeat runs (#49)

All changes covered by new tests; full gate green (ruff, mypy --strict
src+tests, pytest 100% line+branch, shellcheck/shfmt, yamllint,
actionlint, zizmor, codespell, deptry).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1YsNMpGizhSDDPCBu5cut
@Xiddoc
Xiddoc merged commit 5f44f82 into master Jun 30, 2026
12 checks passed
@Xiddoc
Xiddoc deleted the claude/beetroot-sweep-optimize-fnq7r0 branch June 30, 2026 17:55
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.

2 participants