Compare the current implementation against the minimal correct algorithm. Use when debugging regressions, reviewing complex fixes, or when the user asks what should happen versus what is happening now.
Use this to avoid patching symptoms. The output must separate the minimal correct algorithm from the current algorithm, then name the smallest intervention that moves current toward correct.
Use exactly these sections:
Goal: Dropping a per-machine vhost-user server must not block the registry actor and must not leak fds when no VM ever connects.
Minimal algorithm: bind listener; spawn accept loop cancellable by a shutdown token; Drop fires token, wakes listener, signals workers, joins threads with a bound, and closes all owned fds.
Current algorithm: start() moves VhostUserDaemon into an accept thread and calls daemon.start(&mut listener). Drop removes the socket path, then tries to take the daemon from Arc<Mutex<Option<_>>>. If the thread is blocked in accept(), the option is None, so cleanup is skipped.
Gap: unlinking a Unix socket path does not wake a blocked accept(), so the daemon owner never returns to Drop.
Smallest fix: keep Drop nonblocking, but spawn a bounded reaper that self-connects to wake accept(), waits for daemon handoff, signals workers, and joins the protocol thread off the actor thread.
Falsifier: create and drop N servers without clients, then assert the fd delta over a control arm stays below the regression threshold. If fd count grows linearly with N, the fix is wrong.