Skip to main content

Module gpu_context

Module gpu_context 

Source
Expand description

Shared GPU context and VRAM ledger for LLM + tensor + render coexistence.

Compute universes (Track B2): logical partitions on one physical adapter — pinned ledger slots and queue lanes, not multiple GPUDevice instances.

Qualia-native bindings (graph–tensor SOA, Phase-8 SPSC, Sentinel, ledger pins) live in compute_universe.rs — this module owns VRAM accounting and shared_gpu().

Operational modes: Full, Eco, Reserve (no heap in hot-path accounting).

Modules§

device_registry
Device-per-circuit registry — obtain a etalon::Device for a SPECIFIC adapter/circuit (e.g. the integrated GPU), not just the single process-wide primary (STELLAR H3 foundation). Native only; mirrors try_shared_gpu — never panics on a missing/failed device. Device-per-circuit registry — obtain a etalon::Device for a SPECIFIC adapter/circuit (STELLAR §A H3 foundation for heterogeneous GPU routing).

Structs§

AllocationId
Unique identifier for an underlying driver buffer or host allocation.
BufferRegion
Validated slice within an allocation.
EtalonAllocationId
Unique identifier for an underlying driver buffer or host allocation.
EtalonBufferRegion
Validated slice within an allocation.
EtalonHalComputeLane
Etalon compute lane with queue-scoped callback completion on native and WebGPU.
EtalonQueueId
Hardware queue identifier.
EtalonSiliconCapability
Description of an identified silicon capability.
EtalonSlabAllocator
EtalonSubmissionLease
Queue-retained resource ownership until hardware completion.
GpuAdapterCaps
GpuFeatureCaps
GpuLimitCaps
GraphicsReservationError
HalComputeLane
Etalon compute lane with queue-scoped callback completion on native and WebGPU.
QualiaSlabAllocator
QueueId
Hardware queue identifier.
SharedGpuContext
SiliconCapability
Description of an identified silicon capability.
SubmissionLease
Queue-retained resource ownership until hardware completion.
UniverseOrchestrator
Orchestrator enforces pinned boundaries on one adapter (Full / Eco / Reserve degrade per universe).
UniversePartition
Hermetic partition: universe ↔ ledger bounds ↔ queue preference.
VramByteRange
Immutable consecutive byte range in the logical VRAM ledger (no overlap between universes).
VramLedger
Zero-heap VRAM budget tracker (bytes, atomics).
VramReservation
RAII byte reservation against the process-wide adapter budget.

Enums§

AccessRights
Memory access rights for a leased region.
CapabilityState
State progression for hardware acceleration capabilities. Workloads must only be routed to a lane once it reaches Verified.
ComputeUniverse
Parallel compute plane on shared silicon (maps to 10D q / w semantics).
EtalonAccessRights
Memory access rights for a leased region.
EtalonCapabilityState
State progression for hardware acceleration capabilities. Workloads must only be routed to a lane once it reaches Verified.
EtalonMemoryTopology
MemoryTopology
OperationalMode
Desktop / portal operational mode (thermal + VRAM driven).
QueueLane
Preferred async queue on the single etalon::Device (spatial concurrency, not MIG).
VramLedgerSlot
Pinned VRAM accounting bucket (zero-copy crossover between universes reads, not writes).
VramResourceClass

Functions§

ambient_draw_instances
Live ledger hook for per-frame draw throttling (no buffer resize).
ambient_draw_instances_for_mode
Zero-heap ambient draw throttle — static SSBO, dynamic instance_count (instant step-down).
global_universe_orchestrator
Alias retained for orchestration call sites.
global_vram_ledger
Process-wide VRAM ledger (lazy static, 6 GiB default budget).
qualia_backend_override
An explicit GPU-backend override for the inference device.
recommend_inference_backend
Capability-aware recommendation for which GPU backend this machine should run inference on (advisory; surfaced by the doctor/setup checker). Prefers the portable, vendor-neutral path so the build is not silently locked to Windows (DX12) or NVIDIA (CUDA). Reactive to the adapter actually in hand; a full enumerate-all-backends-and-pick is the next layer.
record_bake_pulse
Tensor / Quin bake or encode event.
record_context_ring_drop
Context inject ring full — lossy drop rather than stalling U0.
record_draft_acceptance
Topological speculative decode: accepted draft tokens this step (B3.1e).
record_llm_decode_step
Called once per autoregressive decode step (gguf_bridge hot loop).
record_logic_flash
SPARQL / GeoSPARQL / rule resolution flash.
record_network_ripple
Mesh / network I/O ripple (daemon fetch, torrent, etc.).
record_producer_cycle
U1 background producer completed a kNN inject cycle (B3.3).
sample_ambient_telemetry
Portal + desktop ambient field sampling (48 B contract subset).
shared_gpu
Process-wide wgpu device + queue (lazy init). Panics if no GPU is available — use only where a device is genuinely mandatory. Prefer try_shared_gpu on any path that can fall back to CPU.
try_shared_etalon_hal_lane
Convenience helper to obtain an Etalon HAL compute lane from the shared GPU context, or None if GPU runtime is unavailable or failed to initialize.
try_shared_gpu
Process-wide wgpu device + queue, or None when no usable GPU adapter exists (headless / integrated-only / GPU-less machine, or the tokio runtime can’t start).
universe_orchestrator
Universe map derived from adapter budget + live operational mode (recomputed; 3 partitions).
viewport_operational_mode
U2-effective operational mode from live VramLedger pressure.

Type Aliases§

EtalonSubmissionToken
Type alias for a queue submission fence token.
SubmissionToken
Type alias for a queue submission fence token.