Repository navigation
Berth v0.3.3
Fixes from the Windows testers and two gateway additions. On a single-GPU Windows desktop, the
squatter total no longer passes the card's used memory, so berth run gets its grant while a model
is loaded. A lease whose berth run process dies after attach now frees itself, and the Windows check
kit prints its per-process rows and events again. The gateway reads the next engine's files into the
page cache while the holder drains, and it measures every start it runs and prices a switch, or a
chain of them, from those times.
Added
- Measured switch costs on the gateway: it times every start it runs, from the lease
grant to the engine answering, and keeps the last 20 times per engine and tier in
~/.local/state/berth/swapcost.json.GET /v1/berth/cost?engine=NAMEanswers one
estimate per tier from those times (an estimate withknown:falsehas no samples
behind it), andPOST /v1/berth/planprices a declared chain: the per-step estimate, a
lower-bound total with its unmeasured count, the engine to prefetch at each step, and
the engines the chain comes back to. A failed start records nothing, and every route
takes the node's key like the rest of the gateway. prefetchon an[[engine]]entry: absolute file and directory paths the gateway asks the
kernel to read into the page cache the moment it decides to start that engine, so the disk
reads overlap the drain of the engine it replaces (when the machine has the RAM to keep them). A directory means its own files,
not its subdirectories. The ask commits no RAM, since the kernel takes the pages back when the
machine needs them, and it never delays or fails a start: a file that cannot be asked for is
one WARN line. A relative path failsberth config check, andberth prefetch MODELmakes the
same ask by hand.
Fixed
- The Windows check kit (
contrib/windows/check.ps1): the per-process rows render again, the label and
the MiB figure computed before the row list, and the status reads the keys it actually has
(squatters,unprotected,leases; there is noholders).berth eventsis called with
--format json, and a berth that answers nothing leaves its stderr in the report instead of
a silent "returned nothing". - The squatter sum is bounded by the memory the driver reports the card as
using: on Windows a process's reading counts its committed reservation, so
while the v0.3.2 per-process cap bounds one process, the sum could still
exceed the card's real usage (the desktop compositor read as 11 GB on a
16 GB card the driver reported at 15.5 GB in use) and aberth runrequest
that fit the free space the driver actually shows was refused forever.
Admission, the contested-grant figure and the "squatters hold N MiB" wait
reason now count the bounded total, and the per-squatter status and event
entries keep the raw readings. While it clamps, the bound logs at most one
INFO line per change of that state, never per tick.
#103 - A lease whose attached run process dies without the wrapper's disconnect
reaching the daemon (the run's tree force-killed, a crash, a power loss)
is no longer left granted with an empty PIDS list: the broker now checks
the attached process itself on every tick, and after it has been seen
gone on two consecutive ticks it releases the lease exactly as a
disconnect would, once the card shows nothing of the run left. A PID the
kernel reused counts as gone, a lease that names a container or still
counts a process on the card is left alone, and nothing is signalled.
The event log getslease.orphaned, thenlease.releasedand
lease.freed(#104).