Reuse equivalent native page layouts after execution
This commit is contained in:
1 parent
f09bb04a32
commit
79bfee5ab1
4 files changed
+45
-20
No files matched your search
@@ -66,19 +66,12 @@ fn pdf_resource_entries_empty(entries: &Arc<[u8]>) -> bool {
|
||||
}
|
||||
|
||||
impl NativeShipout {
|
||||
/// The checkpoint and its resumed execution share actual TeX lists.
|
||||
/// Check that identity first, then compare the rest of the shipout snapshot.
|
||||
/// Match the complete inputs to local layout, including source locations
|
||||
/// and device resources. Re-execution can produce an equal packed box
|
||||
/// even when its nodes no longer share storage with the prior revision.
|
||||
pub fn shares_local_layout_with(&self, prior: &Self) -> bool {
|
||||
let shared = match (&self.box_node.content, &prior.box_node.content) {
|
||||
(BoxContent::Horizontal(current), BoxContent::Horizontal(previous)) => {
|
||||
Arc::ptr_eq(current, previous)
|
||||
}
|
||||
(BoxContent::Vertical(current), BoxContent::Vertical(previous)) => {
|
||||
Arc::ptr_eq(current, previous)
|
||||
}
|
||||
_ => false,
|
||||
};
|
||||
shared && self == prior
|
||||
std::ptr::eq(self, prior)
|
||||
|| (self.box_node.span == prior.box_node.span && self == prior)
|
||||
}
|
||||
|
||||
pub fn display_list(&self) -> Result<crate::render::DisplayList, String> {
|
||||
|
||||
@@ -18,6 +18,34 @@
|
||||
| W6 会话 | 实施中 | 共享库/CLI 与当前原生文字/数学/规则来源进入公共结果;真实 A4 副本九类/27 revision 与独立干净作业页面/PDF/aux/映射一致,新增数学场景独立参考通过;详细失败/捕获重放及宿主/离线/CLI观察已通过;原子项目版本/已知生成初态及TeX流记录已接通;完整副作用/恢复契约、旧来源和性能仍缺 |
|
||||
| W7 总验收 | 未满足 | 原有和新增测试、原样项目、格式与会话门禁全部通过才能结项 |
|
||||
|
||||
## 2026-11-29 重新执行后的等价页面复用
|
||||
|
||||
与上次成功发布的同位置页面比较完整出页状态,包括 TeX 节点、
|
||||
来源范围、字体绑定和设备资源。共享出页对象走身份检查。重新
|
||||
构造的等价节点也复用其绘制列表。即使入口检查点失效并从头执行,
|
||||
仍可单独复用等价布局。跨页 PDF 资源、现版字体和来源映射依然
|
||||
使用当前修订解析。
|
||||
|
||||
三页 XeTeX 的外部正文编辑由转换两页降到一页。首部改动让
|
||||
复用执行步归零,布局仍复用其余两页。只移动第二页的来源时,
|
||||
PDF 保持字节相同,新的来源映射与独立全量一致。十页 pdfTeX
|
||||
的两个不同编辑位置各转换一页,其余九页复用。原有连续编辑
|
||||
回归已强化为精确检查这两个范围。
|
||||
|
||||
沿用原样 NeurIPS 2025 的三项交付、220 项解析后资源和冻结
|
||||
辅助文件。编辑及恢复均只转换第 3 页,各复用十一页。此前
|
||||
同样操作转换十页。编辑和恢复均仅发布第 3 页的预览补丁。
|
||||
PDF、绘制列表、SVG、实际资源读取、来源映射及 aux/out 与
|
||||
独立全量一致。故障保留上次发布的文档和文件,恢复与原始
|
||||
发布一致。
|
||||
|
||||
本批证明了减少的局部绘制转换范围。执行、文档级 PDF 输出与
|
||||
正式浏览器时延仍待处理。本次原样项目包含并行构建的单次诊断,
|
||||
浏览器和峰值内存按冻结预算另行取样。
|
||||
|
||||
证据在 target/p4-equal-shipout-layouts/。SHA256SUMS 指纹为
|
||||
a93861914d5bd59f454032e7aa2b5d7872998e398f02df1dfeda57994d6dc4c6。
|
||||
|
||||
## 2026-11-29 XeTeX Type 1C 字体信息与字宽
|
||||
|
||||
原生从实际 Type 1 字体取 FontInfo 字符串,解析 PostScript 括号
|
||||
|
||||
+4
-5
@@ -1133,9 +1133,7 @@ impl CompileJob {
|
||||
let e = &execution.execution;
|
||||
let font_cache = &self.compiler.font_cache;
|
||||
let type1_before = font_cache.type1_work();
|
||||
let prior_layout = (entry_checkpoint_work.reused_steps > 0)
|
||||
.then(|| self.compiler.latest())
|
||||
.flatten();
|
||||
let prior_layout = checkpoints.and_then(|_| self.compiler.latest());
|
||||
let mut shipout_layout_work = ShipoutLayoutWork::default();
|
||||
let mut shipout_layouts = Vec::new();
|
||||
let (mut pages, paper_width, paper_height, origin) = if request.target
|
||||
@@ -1148,8 +1146,9 @@ impl CompileJob {
|
||||
}).zip(&prior.shipout_layouts)
|
||||
});
|
||||
let pages = e.shipout_display_lists_with(|page| {
|
||||
let shared = old.next().filter(|(prior, _)| page.shares_local_layout_with(prior));
|
||||
if let Some((_, layout)) = shared {
|
||||
if let Some((_, layout)) =
|
||||
old.next().filter(|(prior, _)| page.shares_local_layout_with(prior))
|
||||
{
|
||||
shipout_layout_work.reused_pages += 1;
|
||||
shipout_layouts.push(layout.clone());
|
||||
return Ok((**layout).clone());
|
||||
|
||||
@@ -1861,6 +1861,10 @@ fn automatic_checkpoints_follow_successive_edits_at_different_frontiers() {
|
||||
let compiler = NativeCompiler::default().with_automatic_entry_checkpoints();
|
||||
let original_result = compiler.compile(request.clone()).unwrap();
|
||||
assert_eq!(original_result.pages.len(), 10);
|
||||
let one_page_changed = ShipoutLayoutWork {
|
||||
lowered_pages: 1,
|
||||
reused_pages: 9,
|
||||
};
|
||||
|
||||
let first_edit = original.replace("width10pt", "width22pt");
|
||||
let edited_project = project
|
||||
@@ -1872,6 +1876,8 @@ fn automatic_checkpoints_follow_successive_edits_at_different_frontiers() {
|
||||
let first_request = request.clone().with_project(edited_project.clone());
|
||||
let first = compiler.compile(first_request.clone()).unwrap();
|
||||
let first_full = NativeCompiler::default().compile(first_request).unwrap();
|
||||
assert_eq!(first.shipout_layout_work, one_page_changed);
|
||||
assert_eq!(first.pages, first_full.pages);
|
||||
let first_work = &first.entry_checkpoint_work;
|
||||
let first_frontier = first_work.reused_frontier.unwrap();
|
||||
assert!(first_work.captured_frontier.unwrap() > first_frontier);
|
||||
@@ -1891,9 +1897,8 @@ fn automatic_checkpoints_follow_successive_edits_at_different_frontiers() {
|
||||
let second_request = request.clone().with_project(second_project.clone());
|
||||
let second = compiler.compile(second_request.clone()).unwrap();
|
||||
let second_full = NativeCompiler::default().compile(second_request).unwrap();
|
||||
let layout = second.shipout_layout_work;
|
||||
assert!(layout.reused_pages > 0, "{layout:?}");
|
||||
assert_eq!(layout.reused_pages + layout.lowered_pages, second.pages.len());
|
||||
assert_eq!(second.shipout_layout_work, one_page_changed);
|
||||
assert_eq!(second.pages, second_full.pages);
|
||||
assert_eq!(second_full.shipout_layout_work.reused_pages, 0);
|
||||
assert_eq!(second_full.shipout_layout_work.lowered_pages, second_full.pages.len());
|
||||
let second_work = &second.entry_checkpoint_work;
|
||||
|
||||
Reference in new issue
Block a user