Skip to main content

ProvenanceStash

Struct ProvenanceStash 

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

Both provenance stores, moved out of a Ppu so a caller can put them back.

§Why this exists

A save-state restore clears both stores, and that is right: the restored bytes were not written by anything this session ran, so the honest answer is “no record” rather than a PC from a timeline that no longer exists.

Run-ahead is the one caller for which that is wrong, and it is wrong for a reason that has nothing to do with the restore itself. Its cycle runs the persistent frame, snapshots, runs the hidden and then the visible frame, lets the frontend harvest that frame, and only then rolls back. The rollback is therefore the last thing to happen before the emulator lock reaches the UI — so a clear there does not discard a stale timeline, it discards the record for the exact frame the user is looking at, before anyone can read it. That is what made the shipped Pixel Provenance inspector render a complete, confident, entirely empty report (v2.3.6 workstream 0, defect 1).

Stashing is a move, not a copy: both stores are boxed, so this costs two pointer moves per visible frame rather than the ~37 KiB memcpy a snapshot of the contents would. The restore in between sees None on both, so its clear is a no-op and its own reasoning is left completely intact — this mechanism changes nothing for save-state loads or for netplay rollback, both of which still want the clear.

Implementations§

Source§

impl ProvenanceStash

Source

pub const fn is_armed(&self) -> bool

Whether either store was armed when this stash was taken.

Callers use it to skip the put-back entirely on the overwhelmingly common path where nothing is armed at all.

Source

pub fn pixel_frame(&self) -> Option<&PixelProvenanceFrame>

The stashed per-pixel provenance frame, or None when unarmed.

v2.3.8 — read-only, so a detached stash can be inspected without being put back into an emulator first. The Divergence Lens captures a trial’s provenance precisely so it never touches a live Nes again; routing the read through a scratch instance would undo that. Mirrors rustynes_apu::provenance::AudioProvenanceStash::mix_trace.

Trait Implementations§

Source§

impl Debug for ProvenanceStash

Source§

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

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

impl Default for ProvenanceStash

Source§

fn default() -> ProvenanceStash

Returns the “default value” for a type. 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, 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.