struct Residency Conforms to
Hashable, Sendable, CustomStringConvertible, EquatableWhere the payload lives is the constructor’s name, as in the C lifecycle verbs, so a residency an index lacks has no constructor to call. initRam and initVram start empty, loadRam, loadVram and their Buffer forms copy a checkpoint in, and viewRam and viewNvme serve one in place.
Each takes only the placement its own hardware has, one shard per named memory domain, device, or path, and an empty list derives the placement from the machine:
let inRam = try DenseIndex.initRam(options, memoryDomains: [0, 1]) // one graph per socket
let inVram = try DenseIndex.initVram(options, devices: [0, 1]) // sharded, never replicated
let onNvme = try DenseIndex.viewNvme("index.safegraphs.json", config: DenseViewNvmeConfig(paths: ["/mnt/nvme0"]))An NVMe index serves a checkpoint in place, so it is only ever viewed, and until NVMe checkpoints carry keys, viewNvme reports unsupported.
Placement never comes back out of a checkpoint, which records where it was written, never where a reader must keep it, so metadataRead answers a DenseMetadata naming dimensions, metric, quantization and connectivity alone. valuesPerKey is absent from it too, bounding a live handle’s mutable state rather than the serialized form.
ResidencyWhere an executor computes, and with it where the arenas it makes keep their memory.5struct Residency Hashable, Sendable, CustomStringConvertible, EquatableramHost memory, walked by host threads.static let ram: Residency vramDevice memory, walked by device streams; no host read reaches it.static let vram: Residency nvmeNVMe drives, read through host submission rings into host memory.static let nvme: Residency descriptionThe residency rendered as the library spells it.var description: String { get } initReads a spelling back, and nil for one no residency carries.init?(name: String)