Expose optional checkpoint clone and suffix proof timings

This commit is contained in:
gloamxun committed 2026-12-02 02:38:43 +08:00
1 parent 67396827a9
commit c8f7a0cbe6
7 files changed
+170 -27

No files matched your search

+20 -1
View File
@@ -33,7 +33,8 @@ pub use texrra_tex_core::resources::{ProjectDefinition, ProjectSnapshot, Project
pub use texrra_tex_core::resources::{WorldFailure, WorldObservation};
use texrra_tex_core::{
execution::{
Cancellation, ExecutionFailure, Executor, FormatImage, InputProfile, JobTime, Limits,
Cancellation, CheckpointCloneTimings, ExecutionFailure, Executor, FormatImage, InputProfile,
JobTime, Limits,
NativeSession, Profile, RevisionError, RevisionExecution, RevisionFailure, RevisionJob, SourceFile,
SourceProvider, State, SuffixKernelTimings, WriteDestination,
},
@@ -102,6 +103,8 @@ pub struct CheckpointTimings {
/// Restoring the executor, running new commands, observing checkpoints,
/// and finishing the revision's kernel result.
pub resume: Duration,
/// Executor clone times within resume, including captures rejected by the host.
pub clones: CheckpointCloneTimings,
pub capture: Duration,
pub suffix_host_validation: Duration,
pub suffix_kernel_validation: Duration,
@@ -121,6 +124,22 @@ pub trait CompileObserver: Send + Sync {
/// Observe the work of a resumed native revision before layout begins.
fn checkpoint_timings(&self, _revision: u64, _timings: CheckpointTimings) {}
/// Opt in to executor clone timings and individual suffix candidate observations.
fn wants_checkpoint_details(&self) -> bool {
false
}
/// Observe one candidate that reached the kernel. Donors are numbered in
/// the order considered, starting at zero. Acceptance here precedes replay.
fn suffix_candidate_timing(
&self,
_revision: u64,
_page: usize,
_donor_index: usize,
_accepted: bool,
_timings: SuffixKernelTimings,
) {}
/// Called for a completed native draft before its staged files are synced
/// and installed. The caller can display these pages provisionally. The
/// compile result determines whether this revision actually published.