Reuse settled suffixes after verified closed child edits

This commit is contained in:
gloamxun committed 2026-12-02 01:53:20 +08:00
1 parent 55c497dccd
commit e4d6e049f8
11 files changed
+565 -72

No files matched your search

+36
View File
@@ -169,6 +169,42 @@ impl ReplayBoundary {
pub(super) fn matches_for_suffix(&self, prior: &Self) -> bool {
self.entry_bytes.is_some() && prior.entry_bytes.is_some() && self.state == prior.state
}
pub(super) fn trace_for_suffix(&self) -> &texrra_tex_core::resources::ResourceTrace {
&self.state.trace
}
/// The caller proves that all reads of this canonical path are the
/// closed source or its typed size queries, and that none are in the tail.
pub(super) fn matches_for_closed_source_suffix(
&self,
prior: &Self,
previous: &ResourceVersion,
current: &ResourceVersion,
) -> bool {
if self.entry_bytes.is_none() || self.entry_bytes != prior.entry_bytes {
return false;
}
let ReplayState {
inputs, outputs, next_handle, columns, terminal_enabled, generated_reads,
generated_before, generated_written, trace, stream_events,
} = &self.state;
let old = &prior.state;
if inputs != &old.inputs || outputs != &old.outputs || next_handle != &old.next_handle
|| columns != &old.columns || terminal_enabled != &old.terminal_enabled
|| generated_reads != &old.generated_reads || generated_before != &old.generated_before
|| generated_written != &old.generated_written || stream_events != &old.stream_events
{
return false;
}
let mut old_trace = old.trace.clone();
for read in &mut old_trace.reads {
if read == previous {
*read = current.clone();
}
}
*trace == old_trace
}
}
#[derive(PartialEq, Eq)]