# Introspection

> USearch for Go

```go
description, _ := index.Describe()
fmt.Println(description.Metadata.Dimensions, description.Size, description.Capacity,
	description.MemoryUsage, description.Capabilities) // the codename dispatch picked on this machine

found, _ := index.Contains(usearch.KeyFromUint64(42))
count, _ := index.Count(usearch.KeyFromUint64(42)) // entries sharing one key

reachability, _ := index.Health()
fmt.Println(reachability.Reachable, "of", reachability.Audited, "entries reachable")

fmt.Println(usearch.Version(), usearch.CapabilitiesCompiled(), usearch.CapabilitiesAvailable())
```

`Health` audits how much of the graph a search reaches from its landmarks; entries it misses stay unfound until a `Refine` re-links them.

`import "github.com/unum-cloud/USearch/golang"`

## DenseIndexDescription

DenseIndexDescription is a live index's frozen metadata and current counters, each read once, so under concurrent insertions they may come from slightly different moments.

```go
type DenseIndexDescription struct {
    Metadata DenseMetadata
    Size uint
    Capacity uint
    MemoryUsage uint
    CPUClass string
    GPUClass string
    ShardsCount uint
}
```

- `Metadata` `DenseMetadata`: Metadata is the frozen metric, quantization, dimensions and connectivity, as a checkpoint reports them.
- `Size` `uint`: Size is the number of stored entries.
- `Capacity` `uint`: Capacity is the number of entries hosted without growing again.
- `MemoryUsage` `uint`: MemoryUsage is the bytes the handle holds; traversal scratch is the executor's.
- `CPUClass` `string`: CPUClass is the CPU class dispatch picked on this machine, as CPUClass.String spells it.
- `GPUClass` `string`: GPUClass is the GPU class dispatch picked on the index's devices; "unknown" for a host index.
- `ShardsCount` `uint`: ShardsCount is the number of live shards.

## DenseReachability

DenseReachability is one reachability audit: the population it judged, and how much of it a search reaches.

```go
type DenseReachability struct {
    Audited uint
    Reachable uint
    Sweeps uint
    BackSweeps uint
}
```

- `Audited` `uint`: Audited counts the entries published when the audit started; compare Reachable against this, never a later size.
- `Reachable` `uint`: Reachable counts those a search reaches; the rest no search finds until a refinement re-links them.
- `Sweeps` `uint`: Sweeps counts the levels the sweep took to converge.
- `BackSweeps` `uint`: BackSweeps counts the levels the sweep back toward the entry point took, where an audit sweeps both ways.

## CPUClass

CPUClass is a CPU family USearch ships tuned variants for; a RAM or NVMe placement or executor may pin one, and the zero value pins none.

```go
type CPUClass int32
```

- `CPUClassUnknown`: CPUClassUnknown pins nothing, so dispatch derives the CPU's own class.
- `CPUClassSerial`: CPUClassSerial is the portable floor, with no SIMD assumptions.
- `CPUClassIntelHaswell`: CPUClassIntelHaswell is Haswell-class x86: AVX2 and FMA.
- `CPUClassIntelSierra`: CPUClassIntelSierra is Sierra Forest-class x86: AVX-VNNI without AVX-512.
- `CPUClassIntelSkylake`: CPUClassIntelSkylake is Skylake-class x86: the AVX-512 foundation.
- `CPUClassIntelIcelake`: CPUClassIntelIcelake is Icelake-class x86: AVX-512 VNNI and VPOPCNT.
- `CPUClassAmdGenoa`: CPUClassAmdGenoa is Genoa-class x86: native bf16 dot products over AVX-512.
- `CPUClassIntelSapphire`: CPUClassIntelSapphire is Sapphire Rapids-class x86: AVX-512 FP16 and the AMX tiles.
- `CPUClassIntelGranite`: CPUClassIntelGranite is Granite Rapids-class x86: the AMX-FP16 tiles.
- `CPUClassIntelDiamond`: CPUClassIntelDiamond is Diamond Rapids-class x86: AVX10.2's FP8 conversions.
- `CPUClassAwsG2`: CPUClassAwsG2 is Graviton2-class Arm: the bare NEON floor.
- `CPUClassAppleM2`: CPUClassAppleM2 is Armv8.6 NEON with dot products and bf16.
- `CPUClassAppleM4`: CPUClassAppleM4 is Apple M4-class Arm: the SME outer-product tiles.
- `CPUClassAwsG5`: CPUClassAwsG5 is Graviton5-class Arm: Armv9.2.
- `CPUClassNvidiaVera`: CPUClassNvidiaVera is Vera-class Arm: FP8 dot products.
- `CPUClassAlibabaC930`: CPUClassAlibabaC930 is Alibaba C930-class RISC-V: RVA23 vectors.
- `CPUClassWasm32V128`: CPUClassWasm32V128 is WebAssembly with fixed-width simd128.
- `CPUClassWasm64Extended`: CPUClassWasm64Extended is WebAssembly with relaxed SIMD, threads and 64-bit addressing.
- `CPUClassMonoversioned`: CPUClassMonoversioned is the one class of a monoversioned build.

## *String

String renders the class as the library spells it.

```go
func (class CPUClass) String() string
```

## GPUClass

GPUClass is a GPU family USearch ships tuned variants for; a VRAM placement or executor may pin one, and the zero value pins none.

```go
type GPUClass int32
```

- `GPUClassUnknown`: GPUClassUnknown pins nothing, so dispatch derives the devices' own class.
- `GPUClassNvidiaAmpere`: GPUClassNvidiaAmpere is Ampere-class NVIDIA, and every NVIDIA GPU without a class of its own.
- `GPUClassNvidiaAda`: GPUClassNvidiaAda is Ada-class NVIDIA: the fp8 conversions.
- `GPUClassNvidiaHopper`: GPUClassNvidiaHopper is Hopper-class NVIDIA.
- `GPUClassNvidiaBlackwell`: GPUClassNvidiaBlackwell is Blackwell-class NVIDIA.
- `GPUClassNvidiaBlackwellRTX`: GPUClassNvidiaBlackwellRTX is Consumer Blackwell NVIDIA.
- `GPUClassNvidiaRubin`: GPUClassNvidiaRubin is Rubin-class NVIDIA.
- `GPUClassAmdCDNA3`: GPUClassAmdCDNA3 is CDNA3 AMD: gfx942.
- `GPUClassAmdCDNA4`: GPUClassAmdCDNA4 is CDNA4 AMD: gfx950.
- `GPUClassAmdCDNA5`: GPUClassAmdCDNA5 is CDNA5 AMD: gfx1250.
- `GPUClassAppleMetal7`: GPUClassAppleMetal7 is Apple7-family GPUs, and every Apple GPU without a class of its own.
- `GPUClassAppleMetal9`: GPUClassAppleMetal9 is Apple9-family GPUs.
- `GPUClassAppleMetal10`: GPUClassAppleMetal10 is Apple10-family GPUs.

## CapabilitiesAvailable

CapabilitiesAvailable lists the hardware capabilities the current machine offers at runtime, comma separated.

```go
func CapabilitiesAvailable() string
```

## CapabilitiesCompiled

CapabilitiesCompiled lists the hardware capabilities the linked binary was compiled with, comma separated.

```go
func CapabilitiesCompiled() string
```

## Version

Version reports the version of the linked library.

```go
func Version() string
```

