Skip to main content

FttsqReader

Struct FttsqReader 

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

A parsed, validated .fttsq directory over a buffer the reader does not own.

Implementations§

Source§

impl FttsqReader

Source

pub fn open(bytes: &[u8]) -> Result<Self, FttsqError>

Parses and fully validates an artifact, including every section digest.

Digest verification is not optional here. A reader that can be asked to skip it grows a caller that always skips it, and then corruption surfaces as audio rather than as an error.

§Errors

Returns a named FttsqError for any structural, range, or integrity violation.

Source

pub fn parse_directory(bytes: &[u8]) -> Result<Self, FttsqError>

Parses and structurally validates without computing digests.

For inspection tooling (ftts inspect) over an artifact whose bytes are not all present — listing a remote artifact’s tensors, say. Never use this to load weights: it does not prove the payload is intact.

§Errors

Returns a named FttsqError for any structural or range violation.

Source

pub fn verify_digests(&self, bytes: &[u8]) -> Result<(), FttsqError>

Recomputes and checks every section digest against bytes.

§Errors

Returns FttsqError::DigestMismatch naming the first corrupt section.

Source

pub const fn format_version(&self) -> u32

The format version the artifact declares.

Source

pub fn model_family(&self) -> &str

The model family the artifact was built from.

Source

pub fn source_sha256(&self) -> &str

SHA-256 of the upstream checkpoint this artifact was converted from.

Source

pub fn license_notice(&self) -> &str

The Apache-2.0 §4 attribution notice. Guaranteed non-empty.

Source

pub const fn model_config(&self) -> &Value

The frozen copy of the upstream model config.

Source

pub const fn quantization_manifest(&self) -> &Value

The per-tensor quantization policy actually applied, which the license notice references.

Source

pub fn sections(&self) -> &[SectionEntry]

Every declared section, in declaration order.

Source

pub fn tensors(&self) -> &[TensorEntry]

Every declared tensor, in declaration order.

Source

pub fn section(&self, name: &str) -> Option<&SectionEntry>

Looks a section up by name.

Source

pub fn tensor(&self, name: &str) -> Option<&TensorEntry>

Looks a tensor up by name.

Source

pub fn sections_in_class(&self, class: AccessClass) -> Vec<&SectionEntry>

Sections belonging to one access class.

Source

pub fn tensor_bytes<'a>( &self, name: &str, bytes: &'a [u8], ) -> Result<&'a [u8], FttsqError>

The byte span of one tensor within bytes.

§Errors

Returns FttsqError::UnknownSection when the tensor’s section is missing, or FttsqError::RangeOutOfBounds when the resolved span leaves the buffer.

Source

pub fn page_in_plan(&self) -> Vec<(&SectionEntry, PagePolicy)>

The page-in plan: every section paired with its policy, in the order to apply them.

Ordered PagePolicy::Resident first. Prefetch order matters under memory pressure — the section that gets its MADV_WILLNEED in last is the one most likely to find the page cache already full, and that must never be the microdecoder pack.

Within the resident group, smaller sections come first: the ~110 MB microdecoder pack lands ahead of the ~440 MB talker, so the reread-15×-per-frame working set wins the race for cache it would otherwise lose to a body read once per frame.

Source

pub fn verify_census( &self, manifest: &ArtifactManifest, ) -> Result<(), Box<ArtifactCensus>>

Audits the artifact’s tensor directory against an expected inventory.

§Errors

Returns the itemized ArtifactCensus when anything is missing, extra, or mis-declared.

Trait Implementations§

Source§

impl Clone for FttsqReader

Source§

fn clone(&self) -> FttsqReader

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 FttsqReader

Source§

fn fmt(&self, f: &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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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.