Skip to main content

HybridKernelRaw

Struct HybridKernelRaw 

Source
pub struct HybridKernelRaw { /* private fields */ }
Expand description

Hybrid kernel with no provenance tracking.

Every eval() call runs all steps unconditionally. Useful as a baseline and for graphs where inputs change on every evaluation.

Implementations§

Source§

impl HybridKernelRaw

Source

pub fn eval(&mut self, coords: &[u64])

Evaluate all hybrid steps unconditionally: a new round.

Source

pub fn set_input(&mut self, name: &str, value: Value) -> Result<(), String>

Set an extern by name, as PolydatState::set_input does on the interpreter. Every run evaluates everything, so it takes effect at the next run.

Source

pub fn set_input_at(&mut self, index: usize, value: Value) -> Result<(), String>

Self::set_input by input index.

Source

pub fn externs(&self) -> Vec<(&str, PortType)>

The kernel’s externs by name and declared type.

Source

pub fn cursor_schemas(&self) -> &[SourceSchema]

The cursors the program declares, with the partitions the compiler resolved where its over clause and extent were constant, as PolydatProgram::cursor_schemas reports them.

Source

pub fn set_cursor( &mut self, name: &str, partition: &Partition, ) -> Result<(), String>

Narrow a cursor to one partition, as narrow_cursor does on the interpreter: its Ext slot and six scalar projections are set as externs.

Source

pub fn eval_for_slot(&mut self, coords: &[u64], slot: usize) -> u64

Eval all steps and return the value at slot.

Source

pub fn get(&self, name: &str) -> u64

Read a named output after eval(). Panics on Ref2 slots (axiom S2) — use read_vec_*.

Source

pub fn get_slot(&self, slot: usize) -> u64

Read by slot index. Panics on Ref2 slots (axiom S2) — use read_vec_*.

Source

pub fn read_vec_f32(&self, slot: usize) -> &[f32]

Borrow a vec_f32 output’s current contents.

Source

pub fn read_vec_f64(&self, slot: usize) -> &[f64]

Borrow a vec_f64 output’s current contents.

Source

pub fn read_vec_f16(&self, slot: usize) -> &[f16]

Borrow a vec_f16 output’s current contents.

Source

pub fn read_vec_i8(&self, slot: usize) -> &[i8]

Borrow a vec_i8 output’s current contents.

Source

pub fn read_vec_i16(&self, slot: usize) -> &[i16]

Borrow a vec_i16 output’s current contents.

Source

pub fn read_vec_i32(&self, slot: usize) -> &[i32]

Borrow a vec_i32 output’s current contents.

Source

pub fn read_vec_i64(&self, slot: usize) -> &[i64]

Borrow a vec_i64 output’s current contents.

Source

pub fn get_value(&self, name: &str) -> Value

The named output as a typed Value, decoded by its port type: a Ref2 output is copied out through its pair (compiled_handles.md §4), so the caller never holds a pointer.

Source

pub fn coord_count(&self) -> usize

Number of coordinate inputs.

Source

pub fn engine_counts(&self) -> (usize, usize)

The number of native segments and of closure steps in this kernel, in that order: what the per-node engine choice decided.

Source

pub fn resolve_output(&self, name: &str) -> Option<usize>

Resolve an output name to its buffer slot.

Source

pub fn retain_nodes(&mut self, nodes: Vec<Box<dyn PolydatNode>>)

Store owned nodes to keep JIT-baked pointers valid.

Trait Implementations§

Source§

impl Clone for HybridKernelRaw

Source§

fn clone(&self) -> HybridKernelRaw

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Kernel for HybridKernelRaw

Source§

fn output_names(&self) -> Vec<String>

In declaration order, as the interpreter lists them: the assembler sets them on every compiled kernel.

Source§

fn engine(&self) -> Engine

The engine this kernel runs on.
Source§

fn set_inputs(&mut self, coords: &[u64])

Set the coordinate inputs for the next evaluation.
Source§

fn set_input(&mut self, name: &str, value: Value) -> Result<(), String>

Set an extern by name. One rule on every engine: the value must satisfy the declared port type (a carrier’s bit-stuffed forms included) or be None, which clears the extern; a value of another type is refused at the write, never healed. A coordinate is set with Self::set_inputs, not here. An unknown name is an error naming the known ones.
Source§

fn set_cursor( &mut self, name: &str, partition: &Partition, ) -> Result<(), String>

Narrow a cursor to one partition: its Ext slot and its six scalar projections are set.
Source§

fn eval(&mut self)

Evaluate every output for the inputs set so far.
Source§

fn pull(&mut self, name: &str) -> Value

The named output for the inputs set so far, evaluating what it needs and no more: the output’s cone, on the interpreter, the closure tier, and the hybrid kernel alike (pure native code, being one function, evaluates the program). A side channel in the cone fires when the output is pulled; a failing node fails when pulled, with the same attributed message on every engine: the node’s name, the outputs it feeds, the program’s context, and its inputs. The value is owned; a handle is never returned to the host, and a slot that holds None reads as None.
Source§

fn input_names(&self) -> Vec<String>

Every input by name, the coordinates first.
Source§

fn output_type(&self, name: &str) -> Option<PortType>

The declared port type of a named output.
Source§

fn externs(&self) -> Vec<(String, PortType)>

The externs by name and declared type.
Source§

fn cursor_schemas(&self) -> &[SourceSchema]

The cursors the program declares, with the partitions the compiler resolved where it could.
Source§

fn input_value(&self, name: &str) -> Option<Value>

The value of a named input as the kernel holds it now, an extern or a coordinate; None for a name that is not an input.
Source§

fn traversals(&self) -> &[Traversal]

The traversals the program declares, in document order.
Source§

fn plan(&self) -> EnginePlan

What this kernel’s engine decided for the program: how much of it runs as native segments, as closure steps, and on the interpreter. The one planning detail a kernel exposes.
Source§

fn input_index(&self, name: &str) -> Option<usize>

The index of a named input among Self::input_names, the coordinates first: what Self::set_input_at takes.
Source§

fn set_input_at(&mut self, index: usize, value: Value) -> Result<(), String>

Self::set_input by index, for a host that binds the same inputs every cycle: the name is resolved once, with Self::input_index, and no lookup runs per write.
Source§

fn output_index(&self, name: &str) -> Option<usize>

The index of a named output among Self::output_names: what Self::pull_at takes.
Source§

fn pull_at(&mut self, index: usize) -> Value

Self::pull by index, for a host that reads the same outputs every cycle: the name is resolved once, with Self::output_index, and no lookup runs per pull.
Source§

fn traverse(&mut self, index: usize) -> Result<TraversalStream, String>

Open the traversal at index against this kernel’s current values (SRD 113 §3.6): the comprehension’s sources see the wires they reference as this kernel holds them now, and the cascaded wires are snapshotted into every activation. On every engine (engine parity, step 8).
Source§

fn invalidate_all(&mut self)

Begin the next cycle with nothing current, so every step, a side channel included, runs again when pulled. The runtime model makes a cycle whose inputs did not move cost nothing; this is how a host runs such a cycle anyway, as the polydat binary does when every input is fixed.
Source§

fn shared_cells(&self) -> Vec<SharedCellEntry>

The cells this kernel’s shared bindings are bound to (scope model §6): one register per binding, which every kernel holding the cell reads and writes.
Source§

fn attach_shared_cell( &mut self, name: &str, cell: SharedCell, ) -> Result<(), String>

Bind the shared binding name to cell, so this kernel and every other holder of the cell read and write one register: a write on any of them is what the others read next, and a dependent output is recomputed. A name that is not a shared binding is an error naming the ones that are.
Source§

fn into_program(self: Box<Self>) -> Arc<dyn KernelProgram>

The program this kernel runs, shareable across threads: each thread creates its own kernel from it with KernelProgram::create_kernel.
Source§

fn ledger(&self) -> &Arc<CompileLedger>

The compile ledger of the program tree this kernel belongs to: what compiling it and everything opened from it has built.
Source§

fn traverse_all(&mut self) -> Result<Vec<TraversalStream>, String>

Open every traversal, in document order.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more