Skip to main content

FileBatch

Struct FileBatch 

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

Persistent device-owned batch buffers.

Implementations§

Source§

impl FileBatch

Source

pub fn upload( device_queue: Arc<(Device, Queue)>, files: &[BatchFile], rule_count: u32, hit_capacity: u32, ) -> Result<Self, PipelineError>

Upload a new multi-file batch into persistent GPU buffers.

§Errors

Returns PipelineError::QueueFull when the batch exceeds the current u32 table limits or the work queue would overflow.

Source

pub fn refresh( &mut self, files: &[BatchFile], rule_count: u32, hit_capacity: u32, ) -> Result<(), PipelineError>

Refresh this batch in place, reusing host staging vectors and resident GPU buffers whenever the new batch fits existing allocations.

§Errors

Returns PipelineError::QueueFull before mutating the batch when the requested file/rule fanout cannot fit the megakernel batch protocol.

Source

pub fn refresh_with_report( &mut self, files: &[BatchFile], rule_count: u32, hit_capacity: u32, ) -> Result<FileBatchRefreshReport, PipelineError>

Refresh this batch in place and return allocation/transfer telemetry.

§Errors

Returns PipelineError::QueueFull before mutating the batch when the requested file/rule fanout cannot fit the megakernel batch protocol.

Source

pub fn reset_queue_state(&self) -> Result<(), PipelineError>

Reset the persistent queue indices before another dispatch.

§Errors

Returns PipelineError::Backend when the queue-state upload fails.

Source

pub fn set_segmentation( &mut self, seg_len: u32, overlap: u32, ) -> Result<(), PipelineError>

Re-tile this batch at a new window geometry: rebuild the segments table (each file split into ceil(len / seg_len) windows, files shorter than seg_len staying whole), grow/rewrite the resident segments buffer, and update queue_len = segment_count * rule_count + the queue-state header so the next dispatch claims the new work space. seg_len = u32::MAX restores one segment per file (the legacy whole-file scan).

SOUNDNESS CONTRACT: overlap MUST be at least segmentation::catalog_sync_overlap over the rules that will scan this batch. With a shorter warm-up a window can reconstruct the wrong DFA state at emit_start and drop or fabricate matches. The geometry is the caller’s decision (it owns the rule catalog); this method enforces only the structural invariant seg_len > 0.

§Errors

Returns PipelineError::QueueFull when seg_len == 0 or the new work queue overflows the device claim protocol, or PipelineError::Backend when the buffer upload fails.

Source

pub fn file_count(&self) -> usize

Number of files in the batch.

Source

pub const fn queue_len(&self) -> u32

Number of queued (file, rule, layer) items.

Source

pub const fn hit_capacity(&self) -> u32

Sparse-hit capacity.

Source

pub fn device_queue(&self) -> Arc<(Device, Queue)>

Device queue used for every buffer in this batch.

Source

pub const fn haystack(&self) -> &GpuBufferHandle

Packed haystack buffer.

Source

pub const fn offsets(&self) -> &GpuBufferHandle

Prefix-sum offset table. Length = file_count + 1.

Source

pub const fn metadata(&self) -> &GpuBufferHandle

Per-file metadata table.

Source

pub const fn segments(&self) -> &GpuBufferHandle

Flat segment table (segment_count * SEGMENT_WORDS u32s). The device claim decode reads row seg_idx = claim / rule_count to derive the window (file_idx, scan_start, emit_start, emit_end).

Source

pub const fn queue_state(&self) -> &GpuBufferHandle

Queue-state/control words.

Source

pub const fn hit_ring(&self) -> &GpuBufferHandle

Sparse output ring.

Source

pub fn host_metadata(&self) -> &[FileMetadata]

Host-side file metadata.

Source

pub fn host_offsets(&self) -> &[u32]

Host-side prefix offsets.

Source

pub fn host_work_items(&self) -> &[WorkTriple]

Host-side dense work queue.

Dense batches derive work items on-device, so there are no host materialized triples to expose.

Trait Implementations§

Source§

impl Clone for FileBatch

Source§

fn clone(&self) -> FileBatch

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 Debug for FileBatch

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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<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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

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