Repository navigation
Conversation
Guest-initiated vsock across snapshot restore probe. Verified on the rig before writing this plan: the golden nested-m8i snapshot already has python3 with working AF_VSOCK (no rebuild needed), its rootfs digest is already distinct from metal's (no contamination hazard to guard by name), and socat 1.8.0.0 works in the guest despite an earlier note claiming otherwise. 11 tasks: seal the prediction before any rung runs, build the driver incrementally with a KVM-free contract test at each step (env/preflight/ snapshot-integrity, jail helpers, the two-witness probe, VM lifecycle + rung A, rung B, rung C concurrent, rung D + main wiring), commit guest_client as its own buildable Go package, run all four rungs on the rig incrementally then as a full set, then write up EXPERIMENTS.md from the actual results. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Issue #271 asks for a guest-initiated-vsock-across-restore probe and, per P4 §7.4's practice, for its prediction to be sealed before any rung runs. That means appending to predictions.json, which is SHA-256 pinned. The pin moves here for the reason its own docstring allows: this is an append made BEFORE any measurement it could be informed by, not a restatement fitted to a result. §7.4's five entries are byte-identical; id 6 is new. E12 has no verdict machinery, so nothing it measures can feed back into this file. toHaveLength(5) becomes 6. The per-prediction falsifier assertions are unchanged and hold for id 6. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
…ty, records The skeleton of issue #271's probe: it starts no VM yet, and refuses to run for every wrong reason. Required rig-labeled SH_SUBSTRATE (a bare "nested" is rejected), fail-closed preflight, and a per-rung record writer that dies on an empty or unparseable record -- #266 shipped a ladder with a blank mem_available_bytes that exited 0 and still printed a verdict. Two deliberate choices, both explained in the header: The golden snapshot is protected mechanically rather than by a substrate name check. The driver hardlinks the snapshot in, mounts rootfs read-only, boots `ro`, and verifies rootfs_sha256 against manifest.json before AND after every run. A read-write mount alone changes an ext4 superblock, which would invalidate #266's comparison invisibly. This guard also holds for the metal confirmation run #271 defers, which a "never metal" name check would have had to be edited to allow. build-snapshot.sh is NOT refactored to share its jail helpers. build-snapshot.test.sh greps write_guest_client's body for statement ordering, so extracting shared helpers would break a source-order-coupled test for a throwaway probe. Each copied helper names its origin. Four forward-declared globals (PROBE_PORT, GUEST_RAM_MB, GUEST_CID, C_LADDER) are consumed only by Tasks 3-8, not this one; each carries a shellcheck disable=SC2034 with a one-line reason rather than deferring the warning. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
api_put, wait_for_socket, prepare_jail, link_snapshot_into_jail, teardown_jail and the exit trap that runs them. Copied rather than extracted into a shared lib, for the reason recorded in the driver's own header comment: build-snapshot.test.sh asserts write_guest_client's internal statement ordering, and a shared-lib refactor would break that test for a throwaway probe's benefit. link_snapshot_into_jail hardlinks by default, matching build-snapshot.sh, which is also what keeps assert_snapshot_pristine meaningful: a hardlink cannot be written to without the drift showing up under $SNAPSHOT_DIR too. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
…mand) The core mechanism: a host-side python3 accept-once-and-reply loop on <jail>/vsock.sock_1025 (the "<uds_path>_<PORT>" naming vsock.md documents for the guest-initiated direction), and a guest-side python3 script - delivered through the EXISTING agent Exec path on vsock:1024, base64-piped into the guest's /tmp - that connects AF_VSOCK to VMADDR_CID_HOST (2) on port 1025. run_probe_once requires BOTH witnesses before calling anything "ok": the host-side capture file must contain the VM's nonce, AND the guest's own stdout (relayed back through guest_client) must show the ACK. Neither alone is evidence a second-port vsock connection happened; only their conjunction is. The host listener's accept-loop is proven directly in the test over a real AF_UNIX socket, no VM involved - real evidence before any Firecracker boot is attempted. Assisted-By: Claude (Anthropic AI) <[email protected]> Co-Authored-By: Claude Sonnet 5 <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
boot_fresh_vm and restore_vm match build-snapshot.sh's own boot_quiesce_snapshot_firecracker / verify_restore_firecracker configs exactly (drive config, vsock config, machine-config, the vsock_override shape), so any failure in a later rung is about what E12 adds - a second guest-initiated port - not about basic VM bringup that this repo already knows works on this rig. restore_vm's vsock_override rewrites uds_path to the CALLING jail's own /vsock.sock, which is why concurrent restores in rung C (Task 7) need no additional socket-naming scheme: chroot already gives every jail its own filesystem namespace. Both functions return their vsock uds path via a global (VM_UDS), never via `echo` captured through $(...): command substitution forks a subshell, and CLEANUP_PID/CLEANUP_JAIL (set inside the call, a few lines up) would never propagate back out of it to the caller - teardown_jail would then be handed an empty pid, failing to kill the VM while still rm -rf-ing the jail out from under it. Every caller (rung A here; rungs B/C/D in later tasks) calls these as plain statements for exactly this reason. Rung A: fresh boot, run the two-witness probe, teardown. This is the control - if it fails, the failure is our plumbing, not Firecracker's restore mechanism, because no restore has happened yet. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
The rung issue #271 is actually about. Restores the golden snapshot into a fresh jail with vsock_override, runs the two-witness probe on port 1025, tears down. Reuses restore_vm and run_probe_once from Tasks 4-5 unchanged - rung B is mechanically just "rung A's probe against a restored VM instead of a fresh one", which is deliberate: any difference in outcome between A and B is then attributable to the restore itself, not to a different probe path. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Restores 8, then 128, microVMs CONCURRENTLY from the golden snapshot - all alive at once, all connecting on port 1025 - rather than sequentially, because sequential restarts cannot surface a socket-naming collision (only one jail would ever exist at a time) and that is rung C's actual purpose per issue #271. Each VM gets its own jail, so restore_vm's per-jail vsock_override rewrite (Task 5) means a collision has structurally nowhere to happen except in this function's own aggregation - checked explicitly via a nonce-uniqueness pass across all N per-VM records, rather than assumed. 128 concurrent microVMs at 256 MiB each is within what this same nested-m8i rig already ran for E11's density ladder (Sigma PSS <= 0.41 GB there), so N=128 is not new capacity risk, only new plumbing. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
…n main Rung D restores a VM, starts the 1025 listener so it is PRESENT, and exercises the EXISTING host-initiated Exec path on 1024 directly (not via run_probe_once, which drives 1025) - so a failure here is unambiguously about the second port interfering with the mechanism P4 already ships on, which issue #271 names as the worst possible outcome. main() now dispatches every rung named in $RUNGS (default "A B C D"), verifies the snapshot digest before AND after the full set (not just per-rung), and prints exactly one "E12 ANSWER:" line - the boolean this whole driver exists to produce. Still no STOP/MANDATORY anywhere in the source, checked against the FULL file now that every rung is wired in, not just the Task 2 skeleton. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
deploy/microvm/build-snapshot.sh generates its own guest_client.go into a throwaway temp package at run time, which is fine for a script that already owns the whole build pipeline. e12-vsock-egress-probe.sh is not that script, and reaching into build-snapshot.sh's private write_guest_client to reuse its output would recreate exactly the cross-script coupling that script's own test (build-snapshot.test.sh, which greps write_guest_client's body for statement ordering) makes expensive to touch. So this commits the same client - identical framed-protocol/CONNECT-handshake logic - as its own buildable cmd package, the same way cmd/vmpoolctl already sits alongside the library it drives. Builds and go vets with no KVM and no snapshot required. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
…every witness check The real rig run (issue #271, first hardware execution) showed guest_client exiting 0 with a genuine "ACK E12 <nonce>" reply, yet run_probe_once reported both witnesses false on every rung - a false negative that would have made the whole probe unable to answer its own question regardless of the true mechanism behavior. Root cause: guest_probe_command sent "E12 " + nonce over the wire, a decorative tag, while run_probe_once's own exact-match comparisons (host_nonce = $nonce, and *"ACK $nonce"* against guest_out) expected the bare nonce. Every comparison failed unconditionally. Fix: the guest now sends the bare nonce. The nonce already starts with "e12-" (built as "e12-${label}-$$-${RANDOM}"), so the tag was purely redundant - nothing is lost by dropping it. Added a regression test that decodes guest_probe_command's OWN generated embedded python source (not a hand-typed stand-in) and asserts it sends the bare nonce. The prior test exercised the listener with a hand-typed nonce directly, bypassing the real wire format entirely - which is exactly how this shipped unnoticed through Task 4's original review. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Per-rung and per-VM JSON records plus the combined run log from the rig at 3.235.29.220 (SH_SUBSTRATE=nested-m8i). Task 11 reads these into EXPERIMENTS.md's E12 section rather than re-describing them from memory. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
… N=128 scale finding flagged Records the answer issue #271 asked for, built from the actual run records in deploy/microvm/e12-results/ (Task 10). The core mechanism question has a reliable yes: rungs A, B, D and C@8 pass unanimously across both the standalone and combined runs. Separately, C@128 shows a real, non-deterministic connection-failure rate on this 4-vCPU rig (76/128 in the combined run, 127/128 standalone) that is markedly worse under concurrent load from other rungs - consistent with scheduling/resource contention, not with a restore-mechanism defect (no failure carries the signature of the bug fixed in 1ac8371). Explains the 4-VM bookkeeping gap in the combined C@128 aggregate (die()'s raw exit bypasses the per-VM JSON-writing fallback, so the count is right but four per-VM diagnostics are missing) by reading the driver's own run_rung_c_n control flow, not by guessing. Scores predictions.json's id 6 honestly: its falsifier fires on the letter of its text (rung C reported ok=false at N=128 while rung A reported ok=true), but the falsifier was sealed before rung A ran and did not anticipate a concurrency-scale failure mode distinct from a restore-mechanism failure. Both facts are stated, not resolved by picking the convenient framing. States what a nested-m8i run can and cannot establish about the metal case, per the driver's own design comments, and what this means for PR #268's T1 decision (stands; N=128 becomes an open scale/capacity question for P4.1, not grounds to revert to the NIC option). Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
…r-line accuracy Four fixes from the final whole-branch review, none touching the driver's actual probe logic: - .prettierignore did not cover deploy/microvm/e12-results/, so the prettier pre-commit hook (and CI's lint job) would silently reformat 138 committed evidence JSON files on the next unrelated `make fmt`/`make lint` run. - run.log, named in EXPERIMENTS.md's evidence list, was gitignored (*.log) and never actually committed - force-added so the evidence directory matches what the write-up claims. - EXPERIMENTS.md said the cause of 4 missing rung-C-128 per-VM records "is not recorded anywhere" - it is, in each VM's own .boot.log (restore_vm's stderr redirect target), just not archived in the committed results directory. Reworded to say so accurately. - The driver's own failure-branch "E12 ANSWER" log line said the mechanism "DOES NOT SURVIVE restore" whenever ANY rung failed - literally false on the real run, where only rung C at N=128 failed (a concurrency-scale finding, not a restore-mechanism failure) while A/B/D and C@8 all passed. Reworded to state the mechanical fact rather than over-interpreting the cause, so a future operator reading only the log output (not EXPERIMENTS.md) isn't misled into reverting PR #268's T1 decision. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
|
Pushed one more commit ( |
deploy/microvm/e12-results/ (139 files: per-rung/per-VM JSON records plus run.log) should never have been committed - it's throwaway rig output, not source or a maintained artifact, and the previous fix that made it prettier-clean fixed the symptom rather than the actual problem. Removed the directory from git and added it to .gitignore (kept the existing .prettierignore entry too, since `make fmt` walks the directory tree ignoring .gitignore - if this path is ever repopulated locally without being re-tracked, it stays out of prettier's way). EXPERIMENTS.md's numbers are unchanged - only its references to a committed evidence directory are removed, since the actual data (the table, the die()-bypass explanation, the prediction scoring) already carries everything that matters and none of it depended on the raw files being in git. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
|
Removed |
…tion Integrates main (through #292) so this branch can target main directly and carry E12 + E13 as one landing: #273's branch already contains every commit of #272, so retargeting its base collapses the stack rather than dropping any of it. #272 is closed as superseded, not discarded. EXPERIMENTS.md was the only conflict, and it was a pure insertion clash -- main added its "Issue #266 -- the metal/nested ratio" section at the same point this branch added E12 and E13. Both sides kept, #266 first since it continues the E10/E11 material it ratios against. Three prose amendments to the E12 section, so main never carries a claim this branch already knows is wrong. E13 established that C@128's failures were this probe's own listener startup race -- a control at the same N=128 over the existing Exec path came back clean, memory and the OOM killer were ruled out directly, and the fix in b203e38 drove the dominant failure signature to zero on both substrates. E12's section previously attributed those failures to host resource or scheduling contention: - A dated caveat under the E12 heading names what is superseded and what still stands (rungs A, B, D, C@8, both witnesses, T1's support). The numbers stay, as the record of what the pre-fix probe produced. - Sealed prediction 6 is re-scored. Its falsifier still fires, but on the residual failure family rather than the race: 37 of 40 post-fix metal iterations clean, 3 failures across 5,120 VM-attempts, none of them the signature the fix removed. Verdict unchanged, substance changed. - E12's "Effect on PR #268" paragraph now points at E13's revised recommendations rather than standing as current. No script, test or prediction file changed in this merge. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
|
Closing as superseded by #273, not discarded — every commit on this branch is contained in #273's, which has now been retargeted from this branch to Why collapse the stack rather than merge this first: #273 both (a) fixes a defect in this PR's driver — Nothing is lost. E12's numbers are unchanged in Review #273 instead — it is the full E12 + E13 diff against |
Follow-up to PR rossoctl#272 (E12): rung C@128 showed a real, non-deterministic connection-failure rate, described there as "consistent with resource/ scheduling contention" without naming which resource. Issue rossoctl#266's own E10/E11 run on this same nested-m8i rig already found a ~288 MiB/VM memory ceiling around 15 GiB total - a stronger, more falsifiable lead than generic contention, and one PR rossoctl#272's own N=128 choice didn't check against. Sealed before either E13 diagnostic (the no-second-port control, and the memory-telemetry rerun) has been run, per the same §7.4 discipline id 6 (E12) followed. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
…isting agent only Isolates PR rossoctl#272's rung C@128 finding from anything E12 added: restores N VMs concurrently (rung C's own shape) and runs ONLY the existing host-initiated Exec on port 1024 against each - no listener on 1025, no guest-side probe script, nothing new. Sources e12-vsock-egress-probe.sh via its own E12_PROBE_SOURCE_ONLY=1 hook to reuse restore_vm/teardown_jail/ write_json_record unchanged, rather than duplicating them. The contract test's sharpest assertions are negative: it fails if this file ever references PROBE_PORT, start_host_listener, or run_probe_once - the entire point of this script is that none of those exist here. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Tests E13's leading hypothesis for PR rossoctl#272's rung C@128 failures directly: issue rossoctl#266's own E10/E11 run on this same nested-m8i rig already found a ~288 MiB/resident-VM admission ceiling against 15 GiB total, and PR rossoctl#272 ran 128 concurrent restores (4x that already-known-tight budget) with no admission gate. e13-mem-telemetry.sh wraps any command with MemAvailable sampling and an OOM-killer watch for its exact duration. e13-correlate.py cross-references per-VM record/.boot.log mtimes - a free proxy for "when did this VM finish", since neither driver is modified to add explicit per-VM timestamps - against that telemetry. Correlation logic is covered by a fixture-file unit test; the wrapper itself needs a live host to test meaningfully (Task 4). The OOM watcher is started via process substitution (`> >(grep ...)`) rather than a pipeline (`cmd | grep ...`), so `$!` captures the watcher's own PID instead of grep's - `$!` after a backgrounded pipeline always names the pipeline's last command. Without this, cleanup() never signalled the real journalctl/dmesg process, leaking it on every run. cleanup()'s trap is also now armed before the post-start liveness checks, so even the immediate-death path (e.g. a missing /proc/meminfo) still cleans up the watcher instead of leaking it. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
…e probe's own added workload Both disjuncts of prediction 7's falsifier fired. The no-second-port control at N=128 is a clean 128/128 pass (control-128.json fail_count=0), while the telemetry-wrapped rerun of E12's rung C@128 still fails 38/128 with the same "read: EOF" signature - and correlation-summary.json shows oom_events_total=0, failed_near_oom_event=0, failed_below_low_water=0, with MemAvailable never below 12.32 GiB. Memory is not the cause, and the control also refutes PR rossoctl#272's own "128 concurrent restores exceed a 4-vCPU rig" framing: the restores alone are fine in 5.4s. What differs is rung C's own probe apparatus - 128 host-side python3 listeners plus a python3 interpreter and real vsock round trip inside each guest - and the channel it degrades is the pre-existing Exec relay on port 1024, not the 1025 path E12 added. PR rossoctl#268's T1 (route sandbox egress over vsock) stands, on firmer ground than after E12. P4.1's open scale question is re-scoped from "how many concurrent restores" to "how much concurrent CPU-bound work runs alongside a restore burst, and whether the 1024 Exec channel survives it": no per-connection host helper process, retry the Exec relay, and gate on a distribution rather than a run (1/128, 52/128 and 38/128 are all the same rung at the same N). Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Closes #271.
The question
Does a guest-initiated vsock connection on a second port (1025) survive a
Firecracker snapshot restore, and survive N concurrent restores of one
snapshot? This gates PR #268's P4.1 egress transport decision T1 (route all
sandbox egress over vsock, because the microVM tier has no network device).
The answer: two distinct findings, not one boolean
Core mechanism: yes, reliably. Rungs A (fresh boot), B (single restore —
the actual question), and D (host-initiated regression fence) all pass
unanimously, with both independent witnesses (host-side nonce capture and
guest-side ACK) agreeing every time, across two separate runs on
nested-m8i.Rung C at N=8 concurrent restores shows the same clean result.
N=128 concurrency: a real, distinct scale-reliability finding. At 128
concurrent restores from one snapshot, there is a non-zero, non-deterministic
connection-failure rate on this 4-vCPU rig — 76/128 succeeded in the combined
run (all rungs in one invocation), 127/128 when run standalone. Every observed
failure is a
guest_client-relay-level connection error (EOF, connectionrefused, connection reset) with
guest_client_exit=1— none carry thesignature of the bug fixed in
1ac8371(which producedguest_client_exit=0with a mis-compared ACK). This points to resource/scheduling contention under
heavy concurrent boot load, not a defect in the vsock-across-restore mechanism
itself.
Because
main()ANDs every rung together, this single N=128 result flips therun's top-level
oktofalseine12-answer.jsoneven though three of thefour rungs, and rung C's own N=8 point, are unanimous passes. See
deploy/microvm/EXPERIMENTS.md's new E12 section for the full write-up,including the results table, an explanation of a 4-VM bookkeeping gap in the
combined C@128 aggregate (traced to
die()'s rawexitbypassing theper-VM JSON-writing fallback — the count is correct, four per-VM diagnostics
are simply missing), what a nested run does and doesn't establish about the
metal case, and an honest scoring of
predictions.jsonid 6 (its falsifiertechnically fires on the letter of its text, while the mechanism it was
meant to test is well-supported — that tension is stated, not resolved by
picking whichever framing is convenient).
Underlying run records:
deploy/microvm/e12-results/(fromnested-m8i,committed in a prior commit on this branch).
Effect on PR #268
T1 (route egress over vsock) is supported by the core finding and should
stand. The N=128 finding should be carried into P4.1's implementation as an
open scale/capacity question — how many concurrent egress connections a
single host is expected to serve, and whether restores should be staggered or
rate-limited under heavy load — not as grounds to revert to the NIC option.
No snapshot rebuild was needed — the golden rootfs already had python3 with
working AF_VSOCK.
deploy/microvm/build-snapshot.shwas not touched.assert_snapshot_pristineverified the snapshot's rootfs digest unchangedbefore and after every run, both passes.
🤖 Generated with Claude Code