code: def test_index_peachpy(ndim: int, batch_size: int):
      try:
          from peachpy import (
              Argument,
              ptr,
              float_,
              const_float_,
          )
          from peachpy.x86_64 import (
              abi,
              Function,
              uarch,
              isa,
              GeneralPurposeRegister64,
              LOAD,
              YMMRegister,
              VSUBPS,
              VADDPS,
              VHADDPS,
              VMOVUPS,
              VFMADD231PS,
              VPERM2F128,
              VXORPS,
              RETURN,
          )
      except ImportError:
          return
  
      a = Argument(ptr(const_float_), name="a")
      b = Argument(ptr(const_float_), name="b")
  
      with Function(
          "InnerProduct",
          (a, b),
          float_,
          target=uarch.default + isa.avx + isa.avx2,
      ) as asm_function:
          # Request two 64-bit general-purpose registers for addresses
          reg_a, reg_b = (
              GeneralPurposeRegister64(),
              GeneralPurposeRegister64(),
          )
          LOAD.ARGUMENT(reg_a, a)
          LOAD.ARGUMENT(reg_b, b)
  
          # Load the vectors
          ymm_a = YMMRegister()
          ymm_b = YMMRegister()
          VMOVUPS(ymm_a, [reg_a])
          VMOVUPS(ymm_b, [reg_b])
  
          # Prepare the accumulator
          ymm_c = YMMRegister()
          ymm_one = YMMRegister()
          VXORPS(ymm_c, ymm_c, ymm_c)
          VXORPS(ymm_one, ymm_one, ymm_one)
  
          # Accumulate A and B product into C
          VFMADD231PS(ymm_c, ymm_a, ymm_b)
  
          # Reduce the contents of a YMM register
          ymm_c_permuted = YMMRegister()
          VPERM2F128(ymm_c_permuted, ymm_c, ymm_c, 1)
          VADDPS(ymm_c, ymm_c, ymm_c_permuted)
          VHADDPS(ymm_c, ymm_c, ymm_c)
          VHADDPS(ymm_c, ymm_c, ymm_c)
  
          # Negate the values, to go from "similarity" to "distance"
          VSUBPS(ymm_c, ymm_one, ymm_c)
  
          # A common convention is to return floats in XMM registers
          RETURN(ymm_c.as_xmm)
  
      python_function = (
          asm_function.finalize(abi.detect()).encode().load()
      )
      metric = CompiledMetric(
          pointer=python_function.loader.code_address,
          kind=MetricKind.IP,
          signature=MetricSignature.ArrayArray,
      )
      index = Index(ndim=ndim, metric=metric)
  
      keys = np.arange(batch_size)
      vectors = random_vectors(count=batch_size, ndim=ndim)
  
      index.add(keys, vectors)
      matches, distances, count = index.search(vectors, 10)
      assert matches.shape[0] == distances.shape[0]
      assert count.shape[0] == batch_size
  
imports: import pytest
  import numpy
  from usearch.eval import random_vectors
  from usearch.index import Index, MetricKind, MetricSignature, CompiledMetric
label_desc: Use image node_id 3 for calling a global function with example usage: test_index_peachpy(ndim, batch_size) without return types