Skip to main content

Module graph_accel

Module graph_accel 

Source
Expand description

Graph acceleration: GPU-first integer kernels over NQuins / u64 keys, with a CPU radix / scan / sort-merge floor that always works.

Chain: GPU (shared wgpu) → CPU. NPU is a reserved AccelPath slot; platform::npu_ffi today is wgpu (sieve.wgsl), not a third backend.

Override: QUALIA_GRAPH_ACCEL=cpu|gpu|auto (default auto).

Structs§

GpuQuinSieve
GPU warp-transposed uvec4 equality sieve over 48-byte NQuinWire buffers.
GpuRadixSorter
JoinOutcome
NQuinWire
48-byte Super-Quin wire layout. Six 64-bit integer fields aligned to 16 bytes.
SieveOutcome
SortOutcome
Result of a sort: which path ran. Items are mutated in place.

Enums§

AccelPath
Best-path that produced a result. Callers never fail because GPU is missing.
AccelPolicy
How the dispatcher should choose. QUALIA_GRAPH_ACCEL=cpu|gpu|auto overrides.
QuinField

Constants§

GPU_JOIN_MIN
GPU_SIEVE_MIN
GPU_SORT_MIN
Below this many records, PCIe + dispatch lose to the CPU radix floor.

Functions§

gpu_available
Prefer GPU when a shared device exists and policy allows it.
hash_join_u64
Join probe to build on equal keys. Writes (probe_idx, build_idx).
hash_join_u64_cpu
CPU-only oracle (tests).
npu_available
Distinct NPU integer backend (DirectML/Hexagon/CoreML as compute, not wgpu). Today’s platform::npu_ffi dispatches sieve.wgsl on wgpu — that is AccelPath::Gpu.
sieve_eq
Compact Quins whose field == needle into out. Returns count + path.
sieve_eq_indices
Indices only (caller gathers). Same fallback contract.
sieve_volume_file
Read all Quins from path (single-file volume) into scratch, then compact matches into out. Fails closed if the volume is larger than scratch.
sort_quins_by_object
Sort quins by object (ingest run order). Never fails.
sort_quins_by_object_cpu_only
CPU-only radix (tests / oracles).
sort_u64_indices
Sort indices so keys[indices[i]] is non-decreasing.

Type Aliases§

GpuNQuinSieve
Alias matching Runbook 05 naming (GpuNQuinSieve).