Java · Introspection

Introspection

import cloud.unum.usearch.*; 3.0.0-rc.1 · 4c3e5023

long entries = index.count(Key.of(42));
boolean present = index.contains(Key.of(42));

DenseIndexDescription description = index.describe();
DenseReachability reachability = index.health();
System.out.println(reachability.reachable() + " of " + reachability.audited() + " entries reachable");
System.out.println(Types.version() + " built for " + Types.capabilitiesCompiled() + ", here " + Types.capabilitiesAvailable());

describe reports the frozen DenseMetadata with the size, capacity, memory usage and dispatched capabilities in one call. health audits how much of the graph a search reaches from its landmarks; entries it misses stay unfound until a refine re-links them. Types.capabilitiesCompiled lists the hardware capabilities the linked binary was compiled with, and Types.capabilitiesAvailable those the current machine offers.

API

ClassTypesThe vocabulary every modality shares: entry identities, failure reporting, scalar kinds, the executor every fanned-out verb runs on, deferred calls, and the strided descriptors batches travel in.2
Types.java:40 ↗
class Types

The class itself is the library's introspection: its version, and the hardware it can and does use. Everything else it holds is a nested type.

CPUClassA CPU family USearch ships tuned variants for, which a RAM or NVMe placement or executor may pin.
Types.java:467 ↗
enum CPUClass

Fields

SERIALThe portable floor, with no SIMD assumptions.
INTEL_HASWELLHaswell-class x86: AVX2 and FMA.
INTEL_SIERRASierra Forest-class x86: AVX-VNNI without AVX-512.
INTEL_SKYLAKESkylake-class x86: the AVX-512 foundation.
INTEL_ICELAKEIcelake-class x86: AVX-512 VNNI and VPOPCNT.
AMD_GENOAGenoa-class x86: native bf16 dot products over AVX-512.
INTEL_SAPPHIRESapphire Rapids-class x86: AVX-512 FP16 and the AMX tiles.
INTEL_GRANITEGranite Rapids-class x86: the AMX-FP16 tiles.
INTEL_DIAMONDDiamond Rapids-class x86: AVX10.2's FP8 conversions.
AWS_G2Graviton2-class Arm: the bare NEON floor.
APPLE_M2Armv8.6 NEON with dot products and bf16.
APPLE_M4Apple M4-class Arm: the SME outer-product tiles.
AWS_G5Graviton5-class Arm: Armv9.2.
NVIDIA_VERAVera-class Arm: FP8 dot products.
ALIBABA_C930Alibaba C930-class RISC-V: RVA23 vectors.
WASM32_V128WebAssembly with fixed-width simd128.
WASM64_EXTENDEDWebAssembly with relaxed SIMD, threads and 64-bit addressing.
MONOVERSIONEDThe one class of a monoversioned build.
GPUClassA GPU family USearch ships tuned variants for, which a VRAM placement or executor may pin.
Types.java:525 ↗
enum GPUClass

Fields

NVIDIA_AMPEREAmpere-class NVIDIA, and every NVIDIA GPU without a class of its own.
NVIDIA_ADAAda-class NVIDIA: the fp8 conversions.
NVIDIA_HOPPERHopper-class NVIDIA.
NVIDIA_BLACKWELLBlackwell-class NVIDIA.
NVIDIA_BLACKWELLRTXConsumer Blackwell NVIDIA.
NVIDIA_RUBINRubin-class NVIDIA.
AMD_CDNA3CDNA3 AMD: gfx942.
AMD_CDNA4CDNA4 AMD: gfx950.
AMD_CDNA5CDNA5 AMD: gfx1250.
APPLE_METAL7Apple7-family GPUs, and every Apple GPU without a class of its own.
APPLE_METAL9Apple9-family GPUs.
APPLE_METAL10Apple10-family GPUs.

Functions

versionThe version of the linked library.
Types.java:45 ↗
String version();

Calls usearch_version_name.

capabilitiesCompiledThe hardware capabilities the linked binary was compiled with, comma separated.
Types.java:53 ↗
String capabilitiesCompiled();

Calls usearch_capabilities_compiled.

capabilitiesAvailableThe hardware capabilities the current machine offers at runtime, comma separated.
Types.java:61 ↗
String capabilitiesAvailable();

Calls usearch_capabilities_available.