placement

package
v0.207.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package placement is the ONE decision table of the composite tier (ADR 0052, 0.116.0): it turns (task class, token need, quality gate, context_class, budget, live occupancy, live guards) into a Decision — which layer, which seat, on which device pin, and why. It exists as a pure package because three callers must agree on the same answer: the local box placing its own work, the delegator placing a contract onto a remote node's advertised layers (built from health rows through FromRows), and the node itself re-running the decision for the layer a contract names, with its OWN live readers so the display-card guards are evaluated where the card is (council R5: no second "fit" heuristic across layers). Everything the table needs about the machine arrives through Live; nothing here execs, dials or loads a model — the readers do, and only through the memoised Snapshot.

Index

Constants

View Source
const (
	LayerSingle  = "single"
	LayerPair    = "pair"
	LayerTriple  = "triple"
	LayerDisplay = "display"
)

Layer names the table resolves by. They are the closed set config.ValidateLayers admits on a composite box, named here so a row that says "the pair's long seat" reads the same literal the fixture and the tier table declare.

View Source
const (
	RoleRouter = "router"
	RoleAgent  = "agent"
	RoleLong   = "long"
	RoleOCR    = "ocr"
	RoleVision = "vision"
)

Seat roles the rows key on — the same closed vocabulary config holds LayerSeat.Role to.

View Source
const DefaultSnapshotTTL = 2 * time.Second

DefaultSnapshotTTL is how long one reading serves: 2 s, so a 32-subtask spread deciding per subtask per tick execs nvidia-smi once, not 32 times.

Variables

This section is empty.

Functions

func AgentHome

func AgentHome(layers []config.LayerSpec) string

AgentHome names the layer whose agent seat takes the free choice (see table.agentHome).

func EstimateTokens

func EstimateTokens(c core.AgentContract) int

EstimateTokens is the prompt-side estimate every placement starts from: ceil(chars/3) over goal, each context doc's name and text, the raw output schema and every acceptance string — the exact arithmetic delegate.EstimateTokens has always used, moved here so the delegate can call this and both sides of the wire size a contract identically. chars/3 is a deliberate conservative bound, not a tokenizer: it overshoots English prose by ~33 % and is used only as a gate, never to claim a fit.

func LayerAdmissible

func LayerAdmissible(l config.LayerSpec, s config.LayerSeat, live Live, rowVerdict *bool) (ok bool, reason, guard string)

LayerAdmissible runs a layer's guards, in declared order, for ONE seat and reports the first refusal (ok=false, reason, guard) or an admission whose reason carries every guard's reading. It is the only place a guard is evaluated: the local decision, the node's re-check at admission and the health row's verdict all call it, so "admissible" means one thing.

Every guard fails CLOSED: a reader that is nil, a card the probe cannot see, a presence the OS cannot tell — each refuses rather than admitting on a number it never had. rowVerdict is a remote row's own answer and stands in for a guard ONLY where that guard's reader is nil (the delegator has no nvidia-smi on <node-b>'s display card; <node-b> did, and said so); a live reading always wins over a carried verdict.

display_floor is `free(display) − seat.DisplayFootprintGiB ≥ floor` on the resolved display card (council R6: the old free-VRAM check admitted a 10.5 GB load onto a card with 9 GB free). A seat whose pin includes the display device but declares no footprint refuses as "display footprint undeclared" BEFORE any arithmetic; a seat pinned off the display card is checked as free − 0 honestly. A UUID display pin is resolved to its index through Live.DeviceIndex; unresolvable = refuse (the seat may be on it). display_device "auto" is the card the driver reports as the monitor's (Live.ScreenCards), refused unless it names exactly one, and a seat that declares a footprint but is pinned off that card is refused (displayFloor).

func LeasesAgainstContract

func LeasesAgainstContract(cfg config.Config, info gpulease.Info, c core.AgentContract, pick func(gpulease.Info) bool) gpulease.Info

LeasesAgainstContract narrows info to what stands between c and the local seats it could run on. pick, when non-nil, first limits the question to the leases it accepts (the ones that refuse new work, the ones that fence); nil asks about every live lease. The result is the zero Info as soon as one seat of the chain sits on no accepted lease (the placement table falls back to it), and the first seat's accepted leases (the holder a defer names) when every seat is held.

Unchanged, whole-node: a box that declares no layers, a long-context contract (it runs on a long seat the agent chain does not describe), and a contract no agent seat's window can hold, or one that names a layer nobody declares. Nothing narrows on a guess.

func LocalSeatCards

func LocalSeatCards(cfg config.Config, cards []gpuprobe.Card, c core.AgentContract) (seats [][]string, ok bool)

LocalSeatCards is RemoteSeatCards for this box: the chain of local agent seats c could run on, each as the lease ids of its cards, its pin resolved against cards (nil when the pin cannot be placed: unknown is every card). ok is false when there is no chain to read: a box that declares no layers, a long-context contract, a layer nobody declares, a contract no agent seat's window can hold.

func PresenceAllows

func PresenceAllows(p Presence) (bool, string)

PresenceAllows is the presence guard's rule over one reading: whether the operator's being away (or having said so) lets the display card take, or keep, a load, and the reading in words. It is the ONE rule behind both the admission guard and the check on a seat that is already loaded (ResidentVerdict), so the two cannot disagree about what "away" is: present never, away always (the operator's unconditional override, no idle, lock or fullscreen test), auto only on a known reading that is locked or idle, and an unknown reading is not away.

func RemoteSeatCards

func RemoteSeatCards(rows []LayerRow, cards []gpuprobe.Card, c core.AgentContract, est int) (seats [][]string, ok bool)

RemoteSeatCards is the chain of local agent seats a contract could run on, on a node that published rows, as the lease ids of each seat's cards: the node's own ids when it published them, else its pin resolved against the node's card table, else nil (the seat's cards are unknown, which is every card). One element per seat, in the order the table walks them. ok is false when there is no chain to read: a node with no rows, a long-context contract, a layer the node does not declare.

func ResidentVerdict

func ResidentVerdict(l config.LayerSpec, live Live) (ok bool, reasons []string)

ResidentVerdict puts a layer's desktop guards to a seat that is ALREADY loaded: the admission guards decide once, at the moment of the placement, and a twin then sits on the desktop's card until llama-swap's idle ttl takes it down, long after the operator may have come back or a game may have taken the card's memory. It evaluates the two guards that are about the desktop, presence and display_floor, in the layer's declared order, with the same readers, the same card resolution and screen cross-check, and the same fail-closed reading of anything unreadable. ok=false carries one reason per guard that refused.

The floor is free(card) ≥ floor, never the admission arithmetic free − footprint ≥ floor: a resident seat's footprint is already out of the free number, and subtracting it again would read a healthy 6.2 GiB twin as a violation and unload it forever. host_ram bounds what a seat holds in RAM at load time, so it is no violation of one that is already up and is not evaluated here; an unknown guard name refuses, as it does at admission.

func SeatOnLayer

func SeatOnLayer(layers []config.LayerSpec, name string) (string, bool)

SeatOnLayer names the model a layer would be ENTERED on — its agent seat, else its long seat, else its router seat — from the declaration alone. It is for metadata a surface must produce before any live reading exists (the job feed names the seat at admission, while the guards and the window run at execution): a caller that must place work calls Decide / DecideOnLayer, not this. ok=false when the layer is undeclared or names no seat with a model.

Types

type ChainSeat

type ChainSeat struct {
	Layer config.LayerSpec
	Seat  config.LayerSeat
}

ChainSeat is one local agent seat a contract may run on.

func AgentChain

func AgentChain(layers []config.LayerSpec, named string, need int) []ChainSeat

AgentChain lists the local agent seats a contract may run on, in the order the table tries them. named != "" is a contract that names its layer: that layer's agent seat alone (it runs there or waits there). Otherwise the home layer's seat first, then every other declared layer's agent seat in declared order, skipping opt-in layers (never entered unnamed) and dormant ones. need > 0 drops a seat whose served window cannot hold the contract (a seat that declares no window is kept: it cannot be sized, so it is not excluded on a guess). The delegator reads it to decide whether the local box is busy for a contract, and the table reads it to fall back when the home seat's cards are held, so the two cannot disagree about which seats exist.

type Class

type Class string

Class is the task class the table keys on. It is a closed vocabulary rather than the caller's free-form kind because each class maps to exactly one default (layer, role) pair and a misspelt class must not silently take the agent row.

const (
	// ClassMechanical is single-shot mechanical text (summarize / classify /
	// extract / triage): the cascade's router rung on the single layer, or the
	// display layer's twin when the pair holds the cards and the layer is awake.
	ClassMechanical Class = "mechanical"
	// ClassAgent is a delegation contract: the home agent seat by default (the
	// flagship triple when it carries one, else the pair), the pair's long seat
	// on window overflow, the triple's long seat on an explicit context_class
	// long.
	ClassAgent Class = "agent"
	// ClassOCR is the ocr vision role (single layer, device 2 on <node-b>).
	ClassOCR Class = "ocr"
	// ClassVision is the vision role (the pair's vl-32b); documentary — no
	// media row is placed here.
	ClassVision Class = "vision"
)

type Decision

type Decision struct {
	core.Placed
	// Wait asks the caller to hold in the capacity wait until the seat named
	// in Evicts drains, then run (the pair-long eviction rule, council R1).
	Wait bool
	// Defer is a refusal; DeferClass is core.DeferClassContract (the contract
	// cannot be served as written) or core.DeferClassCapacity (a guard refused
	// right now; Guard names it).
	Defer      bool
	DeferClass string
}

Decision is what the table hands back: the Placed block every result publishes, plus the three flags a caller acts on. On a Defer whose cause is a layer that exists (a guard, an infeasible prefill), Placed.Layer names it; on a Defer with no candidate layer at all (no layer serves the class, no window holds the contract) Layer is the largest-window layer considered or "" when there was none — the reason always says which.

func Decide

func Decide(req Request, layers []config.LayerSpec, live Live) Decision

Decide runs the table over every declared layer. A box with no layers gets the zero Decision — the caller publishes nothing and behaves exactly as the pre-layer build (the byte-identical constraint).

func DecideOnLayer

func DecideOnLayer(req Request, layers []config.LayerSpec, name string, live Live) Decision

DecideOnLayer is Decide restricted to one named layer: the node uses it for the layer a contract carries (contract.layer), the delegator for a remote's single advertised layer. Every other layer's OCCUPANCY is still read (the single layer's time-share note needs the pair's state) — only the CHOICE is pinned. A dormant layer named explicitly is a capacity defer: the operator decides when it wakes, never a contract.

type LayerRow

type LayerRow struct {
	Name            string    `json:"name"`
	Tier            string    `json:"tier,omitempty"`
	Devices         []string  `json:"devices,omitempty"`
	OptIn           bool      `json:"opt_in,omitempty"`
	Dormant         bool      `json:"dormant,omitempty"`
	DisplayDevice   string    `json:"display_device,omitempty"`
	DisplayFloorGiB float64   `json:"display_floor_gib,omitempty"`
	Guards          []string  `json:"guards,omitempty"`
	Seats           []SeatRow `json:"seats,omitempty"`
	Admissible      bool      `json:"admissible"`
	Reason          string    `json:"reason"`
}

LayerRow is one layer as a node publishes it: the spec (so a delegator can rebuild config.LayerSpec exactly) plus the node's OWN verdict on the layer (Admissible/Reason from LayerAdmissible with the node's live readers). The verdict travels because the display-card guards can only be read where the card is; the delegator feeds it to Decide as the row verdict and the node re-checks at admission. name, admissible and reason are always present: a row that names no layer, or reports no verdict, is not a row.

func MarkServed

func MarkServed(rows []LayerRow, names []string) []LayerRow

MarkServed stamps SeatRow.Served from a roster's name list (canonical ids AND aliases, as swapclient.Roster.Names returns them). A seat with a model is served when that name is in the list; a router seat with a model_map is served only when EVERY twin it may substitute is, because a layer that can serve one rung and not the other cannot answer for the role. Rows are returned modified in place — the caller owns them.

func RowsFromConfig

func RowsFromConfig(cfg config.Config, live Live) []LayerRow

RowsFromConfig renders what a node publishes for its layers: every seat's occupancy from live.Seat, every layer's verdict from LayerAdmissible over its placement seat — the agent seat where one exists, else the long or router seat an opt-in layer places on — in config order. A non-composite box returns nil so its health and status stay byte-identical.

func WithDeviceIDs

func WithDeviceIDs(rows []LayerRow, cards []gpuprobe.Card) []LayerRow

WithDeviceIDs stamps each seat row with the lease ids of the cards its pin names, resolved against cards (the card table of the box that owns the rows). A node publishes them so a delegator never has to guess which index space a bare pin is in. A pin the table cannot place, and a box with no card table, leave the row as it was: unknown is every card. The rows are modified in place and returned.

type Live

type Live struct {
	// Seat reads a (layer, role) seat's live occupancy.
	Seat func(layer, role string) SeatState
	// DeviceFree reads a device's free VRAM in GiB by CUDA index or GPU-UUID
	// prefix; !ok = not visible = refuse.
	DeviceFree func(device string) (float64, bool)
	// DeviceIndex resolves a GPU-UUID prefix to the CUDA index nvidia-smi
	// reports for it, so a UUID-pinned display device (<node-b> pins it by
	// UUID because the board reorders indices on power loss) can be matched
	// against a seat's index pin. !ok = cannot resolve = the guard refuses.
	DeviceIndex func(device string) (string, bool)
	// ScreenCards names, as CUDA indices, the cards the driver says drive the operator's monitor
	// (gpuprobe.Device.DrivesDisplay). The display_floor guard uses it to CONTRADICT a declared
	// display_device that is not among them: the floor would be guarding a card that is not the
	// desktop's. nil, or a nil/empty answer (no card flagged, or a reading that cannot say which),
	// contradicts nothing, so a guard with no evidence trusts the declaration as it did before this
	// reader existed. display_device "auto" reads it the other way round: the one card named IS the
	// display card, and no reader, no card or several refuse. A remote row carries none: the node's
	// own verdict already includes the check.
	ScreenCards func() []string
	// WatcherAlive says whether the display layer's post-admission watcher (internal/displaywatch) is
	// checking on this box, from the heartbeat it leaves (internal/displaystate.Alive), and why not in
	// words. The display layer's presence guard asks it: a twin admitted onto the operator's card with
	// nothing watching it stays there until llama-swap's idle ttl however soon the operator is back.
	// nil refuses on the display layer's presence guard (fail closed, like every reader), except where
	// the presence reader is nil too and a remote row's own verdict stands for both. ResidentVerdict,
	// which the watcher itself calls, never reads it: a watcher must not unload twins because of its
	// own bookkeeping.
	WatcherAlive func() (bool, string)
	// HostFree reads free host RAM in GiB; !ok = refuse on the host_ram guard.
	HostFree func() (float64, bool)
	// Presence reads the operator-presence state (ProbePresence).
	Presence func() Presence
	// Verdict returns a remote row's own admissibility for a layer and the
	// node's reason (nil = no verdict). It stands in for a guard ONLY where
	// that guard's reader is nil: a live reading always wins over a carried
	// verdict, and the node re-checks at admission anyway. The reason rides
	// along so a delegator's defer can say what the node saw ("free 3.0 GiB −
	// footprint 10.5 < floor 4"), not merely that it refused.
	Verdict func(layer string) (verdict *bool, reason string)
	// CardsHeld reports whether a lease this process does not hold sits on any card the
	// pins name (PCI-order indices or UUID prefixes: a seat's Device split by DeviceList),
	// and says why. It is how the table learns that the flagship layer's cards intersect a
	// render's, so the agent lane takes the next layer whose cards are free (agent row 5).
	// nil = unknown, which changes nothing: a remote row's Live carries none, and the node
	// that owns the cards decides at admission.
	CardsHeld func(pins []string) (held bool, why string)
}

Live is the reader contract: how the table sees the machine. Every reader may be nil (= unknown): a guard whose reader is nil refuses (fail closed) unless Verdict supplies a remote row's own answer; an occupancy reader that is nil is neutral. The local box builds it from a Snapshot (memoised, read once per decision); a delegator builds it from a remote node's health rows through FromRows, where only Seat and Verdict are set — the display-card numbers were read where the card is and are carried as the row's verdict.

func FromRows

func FromRows(rows []LayerRow) ([]config.LayerSpec, Live)

FromRows rebuilds a remote node's []config.LayerSpec and a Live whose Seat answers occupancy from the rows and whose Verdict answers each layer's own admissibility; DeviceFree, DeviceIndex, HostFree and Presence stay nil (the delegator cannot read the remote's cards — the verdict stands in, and the node re-checks at admission). nil rows → nil layers and an empty Live, so a plain node decodes to nothing composite.

func LiveFromConfig

func LiveFromConfig(cfg config.Config) Live

LiveFromConfig is the one-liner every local caller uses: a fresh 2 s snapshot's readers. Callers that make many decisions per tick (the spread) keep one Snapshot and call Live() once instead.

func LiveFromReadings

func LiveFromReadings(devs []gpuprobe.Device, hostFreeGiB *float64, pres *Presence) Live

LiveFromReadings builds a Live from readings a caller ALREADY holds, for the surface that must not read anything itself: a fleet node's health handler answers from its background VRAM snapshot and host sample, never from an exec or a seat probe inside the request. A nil reading stays a nil reader, so the guard that needed it refuses (fail closed) instead of being admitted on a number nobody read.

Seat is deliberately absent: a cached health read knows which seats the roster ANSWERS for (published per seat as SeatRow.Served), not which are loaded, and claiming an unread seat is cold is how a delegator would tell itself there was nothing to evict.

type Presence

type Presence struct {
	Mode    string
	Known   bool
	Away    bool
	Locked  bool
	IdleSec int
	Note    string
}

Presence is the operator-presence reading the presence guard consumes. Mode echoes the config (present | away | auto); Known=false means the probe could not tell (no console session, an API failure) and the guard refuses.

func ProbePresence

func ProbePresence(mode string, idle time.Duration) Presence

ProbePresence answers the presence guard for a configured mode. present and away are operator overrides that never touch the OS (present is the default: the display card stays closed until the operator opts in); auto reads the console session — lock state, last input against the idle threshold, and the shell's notification state so a game or a presentation counts as "at the desk" even with the mouse untouched. Any probe failure is Known=false, which the guard refuses.

type Request

type Request struct {
	Class Class
	// EstTokens is the prompt-side estimate (EstimateTokens over goal, docs,
	// schema and acceptance).
	EstTokens int
	// MaxTokens is the completion budget (0 → 1024). need = EstTokens + MaxTokens
	// is what a window must hold.
	MaxTokens int
	// QualityGated is true when the contract carries acceptance checks or an
	// output_schema. Recorded for the reason text; the table never trades a
	// gated contract down to a weaker seat (council R2 removed the only row
	// that would have).
	QualityGated bool
	// ContextClass is "" (the estimate decides) or core.ContextClassLong (the
	// caller asks for the triple's long seat explicitly).
	ContextClass string
	// BudgetSec is the contract's timeout_sec (0 → core.AgentTimeoutSecDefault);
	// it bounds the prefill feasibility check on a long seat.
	BudgetSec int
	// RouteKey (mechanical only) is the cascade route being placed
	// (workhorse | triage | escalation) — the key into a router seat's
	// model_map when the display layer substitutes its twin.
	RouteKey string
}

Request is everything the table needs to know about ONE unit of work. It carries an estimate, never a tokenizer count, because placement happens before any seat is touched (the estimate leans conservative: chars/3).

func RequestForContract

func RequestForContract(c core.AgentContract, est, maxTokens int) Request

RequestForContract builds the agent-class Request for a contract from the estimate and completion budget the caller already computed, so the two agent doors, the delegate runner and the node all describe a contract to the table the same way (quality gate = acceptance or schema present; budget = timeout_sec; class = the contract's context_class).

func (Request) Need

func (r Request) Need() int

Need is the tokens a window must hold for the request: the prompt estimate plus the completion budget. Exported so the delegator sizes a local seat against a contract the way the table does.

type SeatRow

type SeatRow struct {
	Role   string `json:"role"`
	Model  string `json:"model,omitempty"`
	Device string `json:"device,omitempty"`
	// DeviceIDs are the lease ids (lower-cased GPU UUIDs) of the cards Device names,
	// resolved by the node that owns the seat against its own card table (WithDeviceIDs).
	// A delegator reading a lease on that node compares them with the lease's devices; it
	// cannot resolve a bare pin itself, because which index space it is in is the node's
	// fact. Absent when the node could not place the pin, which reads as every card, and on
	// a node one release behind.
	DeviceIDs   []string `json:"device_ids,omitempty"`
	CtxTokens   int      `json:"ctx_tokens,omitempty"`
	MaxInflight int      `json:"max_inflight,omitempty"`
	Loaded      bool     `json:"loaded,omitempty"`
	// Served is the ROSTER fact, not an occupancy one: the llama-swap behind
	// this box answers for the seat's model (by id or alias). It exists
	// because a fleet node's health is a cached read that never probes
	// /running — it knows which seats it can serve, not which are loaded —
	// and a delegator must be able to tell "this node declares the seat" from
	// "this node has it warm". Left unset by a renderer with no roster in
	// hand (offload_status's local rows report live occupancy instead).
	Served              bool              `json:"served,omitempty"`
	Known               bool              `json:"known,omitempty"`
	Inflight            int               `json:"inflight,omitempty"`
	FootprintGiB        float64           `json:"footprint_gib,omitempty"`
	DisplayFootprintGiB float64           `json:"display_footprint_gib,omitempty"`
	HostRAMGiB          float64           `json:"host_ram_gib,omitempty"`
	PrefillTPS          float64           `json:"prefill_tps,omitempty"`
	ModelMap            map[string]string `json:"model_map,omitempty"`
}

SeatRow is one seat of a layer as a node publishes it in health and offload_status: the declared numbers the table needs plus the live occupancy. It is the ONE shape shared by fleetnode, delegate.NodeView and offload_status so a delegator can rebuild a remote's layers (FromRows) and run the same Decide over them. Every measured number is omitempty; role is always present because a seat without a role cannot be resolved.

type SeatState

type SeatState struct {
	Known    bool
	Loaded   bool
	Inflight int
}

SeatState is one live occupancy reading. Known=false means "could not read" — the table treats that as NEUTRAL for occupancy (no saturation note, no wait) because occupancy only shapes the reason and the wait, never a guard; a guard that cannot read refuses instead.

type Snapshot

type Snapshot struct {
	// contains filtered or unexported fields
}

Snapshot is the memoised Live of the local box. Every reader is read at most once per ttl — one gpuprobe.Read serves every DeviceFree/DeviceIndex, one HostFreeRAMGiB every HostFree, one ProbePresence every Presence, one seatload.Inflight per (layer, role) — because the table asks several questions per decision and a spread makes many decisions per tick. A snapshot never loads a model: seatload.Inflight stops at /running for a cold seat, and windows come from config.

func NewSnapshot

func NewSnapshot(cfg config.Config, ttl time.Duration) *Snapshot

NewSnapshot builds the local box's memoised readers over its config: the layers say which seats exist, Endpoint says where llama-swap answers for them (a layer seat is pinned to a local device, so it is never behind a seat_endpoints override), operator_presence/operator_idle_sec drive the presence probe. ttl ≤ 0 reads as DefaultSnapshotTTL.

func SharedSnapshot

func SharedSnapshot(cfg config.Config) *Snapshot

SharedSnapshot returns the process-wide Snapshot for cfg's placement identity — its endpoint, presence settings and layer seats — building it on first use with DefaultSnapshotTTL.

WHY process-wide and not per pipeline: the in-loop offload builds a fresh Pipeline per contract (NewInLoopPipeline per agent_run on the MCP door, NewRecordlessOffload per node-side contract), so a memo owned by the pipeline gives every in-flight contract its own readers — 32 contracts on the pair seat would exec nvidia-smi and GET /running 32 times per window, the exact multiplicity DefaultSnapshotTTL exists to prevent. Keying on the placement identity rather than the endpoint alone keeps two configs that disagree on layers or presence (a test process, a hot-reloaded config) from reading through each other's memo.

func (*Snapshot) DeviceFree

func (s *Snapshot) DeviceFree(device string) (float64, bool)

DeviceFree reads one card's free VRAM by index or UUID prefix from the memoised probe.

func (*Snapshot) DeviceIndex

func (s *Snapshot) DeviceIndex(device string) (string, bool)

DeviceIndex resolves a UUID prefix (or echoes an index the probe knows) to the CUDA index nvidia-smi reports, from the same memoised probe. Ambiguous or absent = !ok, so the display-floor guard refuses rather than guessing which card the operator's UUID meant.

func (*Snapshot) HostFree

func (s *Snapshot) HostFree() (float64, bool)

HostFree reads free host RAM from the memoised reader.

func (*Snapshot) Live

func (s *Snapshot) Live() Live

Live exposes the snapshot as the table's reader contract. Verdict stays nil: a local box has no remote verdict to carry. CardsHeld is the local box's own reading of the machine-wide lease (the directory the load gate is armed at, the cards its seats are pinned to): the agent row's fallback when a lease holds the flagship's cards (plan P4).

func (*Snapshot) Presence

func (s *Snapshot) Presence() Presence

Presence reads the operator-presence state for the config's mode and idle threshold, memoised.

func (*Snapshot) ScreenCards

func (s *Snapshot) ScreenCards() []string

ScreenCards names the cards the memoised probe says drive the monitor (gpuprobe.ScreenCardIndexes); nil when the probe failed or cannot say.

func (*Snapshot) Seat

func (s *Snapshot) Seat(layer, role string) SeatState

Seat reads a (layer, role) seat's occupancy through llama-swap, memoised per seat. Known=false for an undeclared seat, the router role (its rungs are the cascade's, not one seat), a read error, or an ambiguous reading (the roster unreadable and /running holding entries this name cannot be matched against) — "could not tell" is never "idle".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL