Skip to main content

Snapshot

Struct Snapshot 

Source
pub struct Snapshot {
    pub commit: String,
    pub built_from: String,
    pub input: String,
    pub environment: BTreeMap<String, String>,
    pub snapshot: Value,
    pub code: BTreeMap<String, Written>,
    pub inside: Value,
    pub reaches: Value,
    pub architecture: Value,
    pub declaring: Option<Written>,
    pub mapped: Vec<String>,
    pub unneeded: Vec<String>,
}
Expand description

A graph as one checkout had it.

Fields§

§commit: String

What checkout this was, for saying so afterwards.

§built_from: String

The module:function that built it.

§input: String

"sentinel" when no real input was hashed. Two snapshots are only comparable if they were taken the same way: the names come out of the snapshot, so one taken with an input against one taken without has everything moved and nothing saying why.

§environment: BTreeMap<String, String>

What the graph was built against: the interpreter, and the version of every distribution it reached for.

The axis git does not cover — a checkout pins its own code and not the interpreter outside it — and deliberately not part of the recipe a snapshot is remembered under. Two probes months apart are meant to disagree here out loud.

§snapshot: Value

foreseen.snapshot’s own answer, carried opaque.

Never read on this side and never reshaped: what a name is made of is the model’s business, and a reader here that understood its insides would be a second model with a delay on it.

§code: BTreeMap<String, Written>

The class behind each node: where it lives and what it says.

Read while the graph existed, because a snapshot outlives the process that made it — and the checkout it was read from is a worktree that was removed minutes later.

§inside: Value

What each node is made of inside: {node: [piece, ...]}.

A node is a box and what it holds is usually what the experiment is about — Pure is a wrapper and the router inside it is the piece — so drawing the box and saying nothing about the inside draws the wrapper.

Read without running anything, so it is the declared composition: what __init__ built. somatize.torch.architecture answers better — it sees what is not a module — and executes the graph to do it, which is what this side never does. Opaque, like the rest.

§reaches: Value

What files each node is made of, and where the count stops.

code shows one class, which is what somebody clicking a node wants. But a network is often written across four modules joined in an __init__, and inspect.getsourcefile knows only one of the four.

Not a second model of what depends on what: it is the transitive closure soma’s fingerprint already walked in order to hash it, said out loud, so it moves when what goes into a fingerprint moves.

No source inside, on purpose: forty commits of whole files are nearly all of the answer and none of it read. What is here are paths, and the content is asked for by its own when somebody opens one.

§architecture: Value

The orthogonal facts of a graph beside what each node computes: who implements it, where it runs, on which device, what is kept, what is frozen, and in what order it would run.

Opaque like snapshot: the vocabulary is soma’s, and all that is needed here is that it reaches whoever draws intact.

§declaring: Option<Written>

The code that declares the graph: the body of build, with the >> and the |.

The one part of a graph that cannot be read node by node — each class says what it does and none says how they connect — so without it the topology is only ever seen drawn and never written.

None when there is no source to read, which is the absence UNVERSIONED names a level below.

§mapped: Vec<String>

The nodes named by the content of their items, which nobody has before a run. Carried so a report can say cannot tell out loud.

§unneeded: Vec<String>

What would not have to run at all, because something under it is kept. Empty without a real store, and that is not the same as “nothing”.

Implementations§

Source§

impl Snapshot

Source

pub fn names(&self) -> BTreeMap<String, String>

What each node’s answer will be called, {node: key}.

Reading inside the opaque snapshot is the one thing this side does not do — what a name is made of is the model’s business — and this is not that: using a name as a name, to look it up in a store, is what the model publishes it for. Decomposing a key to get something out of it would be the other thing, and it would live in foreseen.

Nodes are missing and it is not an oversight: a .mapped() is named by the content of its items, which nobody has before a run. That absence reads cannot tell and never no data.

Source

pub fn fingerprints(&self) -> BTreeMap<String, String>

What version of the code each node had, {node: fingerprint}.

The side of attribution that survives what the other does not: a key is computed against the probing interpreter’s environment, so probing a three-month-old commit today gives keys matching nothing kept then, while the fingerprint was written beside the value by whoever ran.

Source

pub fn drifted_from<'a>( &'a self, other: &'a Self, ) -> Vec<(&'a str, String, String)>

What was built differently around the two of them: name, before, after.

Usually nothing, because two commits probed in one sitting share an interpreter. It is a cached probe from months ago against a fresh one that answers something here — which is the whole reason the environment is left out of what a snapshot is remembered under.

Trait Implementations§

Source§

impl Debug for Snapshot

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Snapshot

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Snapshot

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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> Same for T

Source§

type Output = T

Should always be Self
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,