Dispatch isolated editor edits promptly and measure browser paints

This commit is contained in:
gloamxun committed 2026-12-02 00:23:48 +08:00
1 parent bf42a88dff
commit 473b3beace
6 files changed
+91 -32

No files matched your search

+35 -15
View File
@@ -716,23 +716,30 @@ impl PublishedCheckpoints {
cancellation,
&mut attempt,
Some(Box::new(|world, preparation| {
let mut rejection = None;
let remaining = std::iter::from_fn(|| candidates.pop_front());
for candidate in std::iter::once(first).chain(remaining) {
match candidate
// Only the first candidate passed the immutable project
// and entry-prefix checks before arriving at this host.
let guard = first.guard();
let rejection = match guard
.verify_clock_environment()
.and_then(|()| guard.verify_host(project, world, preparation))
{
Ok(()) => {
selected = Some(first);
return Ok(());
}
Err(error) => error,
};
for candidate in std::iter::from_fn(|| candidates.pop_front()) {
if candidate
.accept_entry(project)
.and_then(|()| candidate.guard().verify(request, world, preparation))
.is_ok()
{
Ok(()) => {
selected = Some(candidate);
return Ok(());
}
Err(error) => {
rejection.get_or_insert(error);
}
selected = Some(candidate);
return Ok(());
}
}
Err(rejection.unwrap_or_else(|| "no entry checkpoint retained".into()))
Err(rejection)
})),
EffectMode::Draft,
KernelPreparation::Resume,
@@ -1358,6 +1365,11 @@ impl PrefixInputGuard {
));
}
}
self.verify_clock_environment()?;
Ok(current)
}
fn verify_clock_environment(&self) -> Result<(), String> {
if self
.clock_environment
.as_ref()
@@ -1365,7 +1377,7 @@ impl PrefixInputGuard {
{
return Err("checkpoint file-date environment changed".into());
}
Ok(current)
Ok(())
}
fn verify_replayed_inputs(&self, files: &Files, current: &ProjectSnapshot) -> Result<(), CompileError> {
@@ -1397,11 +1409,19 @@ impl PrefixInputGuard {
world: &FileWorld,
preparation: &HostPreparation,
) -> Result<(), String> {
let current = self.verify_project(request)?;
self.verify_host(self.verify_project(request)?, world, preparation)
}
fn verify_host(
&self,
project: &ProjectSnapshot,
world: &FileWorld,
preparation: &HostPreparation,
) -> Result<(), String> {
if self.format_input_bindings != world.trace().format_input_bindings {
return Err("checkpoint format input bindings changed".into());
}
if world.trace().reads.first() != current.file(&self.entry).map(|file| &file.version) {
if world.trace().reads.first() != project.file(&self.entry).map(|file| &file.version) {
return Err("checkpoint entry resolved to a different path".into());
}
let current = preparation