Wolfram · Platform Notes

Platform Notes

3.0.0-rc.1 · 4c3e5023

§ What This Binding Does Not Expose

  • Deferred calls, since every call blocks.
  • Search predicates and progress callbacks, since the kernel evaluates on one thread and the executor’s workers would have nowhere to call back into.
  • Traversal telemetry, cursors, search streams & absorb, which the C interface has and this package does not bind yet.

§ Design

  • A thin layer over the C ABI. Every name follows include/usearch/: a C verb usearch_dense_<verb> is a Dense<Verb> here, every option is a C field, and every usage message names the C symbol it calls or says it is binding-only. Metrics, quantizations, moods and statuses cross as the strings usearch_*_name spells, read back through usearch_*_from_name, so the C library owns every spelling.
  • The receiver chooses, the verb stays. The index runs a verb on the kernel’s own thread, and DenseIndexOn[index, executor] runs it on an executor’s workers, with the same arguments.
  • No life of its own. The package starts no threads and keeps no queues, so every worker belongs to an executor you made.
  • Arenas are lent and reused, never shared. Every output whose length scales with the call lands in an arena the caller passes, and is copied into Wolfram arrays before the call returns, so no result reads an arena a later call rewound.
  • Nothing costs anything until it is used. A call reads the kernel’s tensors in place, and an arena allocates only when a call writes into it.
  • Calls block. Every verb returns once its call is final, on the kernel’s own thread or an executor’s workers, and there is one verb per operation rather than a twin per output style.
  • Handles are managed expressions. The kernel frees an index, executor or arena once its last reference dies, and an integer a caller typed never reaches the library as a pointer. A call holds every handle it names until it returns, so DenseSearch[DenseIndexOn[index, ExecutorForRam[]], queries, 10, ArenaInit[]] is safe.