Repository navigation
fix(layout): preserve inline fragments and published geometry - #756
lanyue-llk wants to merge 1 commit into
Conversation
7bc4a0a to
ef06d30
Compare
a4b6756 to
cec1eda
Compare
Sequential Navigation Soak A/B✅ HEAD completed the 200-navigation resilience and memory observation. One browser process, one target, and one CDP session navigate CSDN → SegmentFault → Huaban → example.com repeatedly. This run issued 200 Common ancestor Session resilience
A public-page failure is reported separately from an unrecoverable session. The soak requires all navigation attempts, zero failed recovery, zero lifecycle/network ordering violations, and complete resource evidence. Process-tree memory
HEAD memory by 50-navigation quarter
Raw reports and per-navigation boundary samples: workflow run and full Public-site timing and memory are observational. Use the A/B deltas and trend shape as evidence, not as a deterministic performance threshold. |
Spider Bench A/B✅ All benchmark browser service runs completed; results are informational. Public HEAD: 184 / 240 rows; 38 / 48 sites produced rows; 10 unexpected empty sites. ✅ Deterministic fixture contract is clean. Common ancestor Public 48-site run · informational
Public-site content, timing, and memory are noisy. This single A/B run reports evidence only; site outcome counts explain missing rows without treating them as a deterministic regression. CPU and memory timelinesThese are bounded 40-point views of the same complete process-tree samples used by the HTML report. CPU uses 100% per occupied logical core; memory lines are RSS first and PSS second when complete PSS samples are available. Basexychart-beta
title "Base CPU"
x-axis "Elapsed seconds" [1.537, 2.539, 4.041, 5.041, 6.542, 7.543, 9.045, 10.046, 11.547, 12.548, 14.05, 15.051, 16.552, 17.053, 17.553, 19.054, 20.055, 21.557, 23.057, 24.058, 24.558, 25.56, 26.562, 28.064, 29.066, 30.567, 31.568, 33.069, 34.071, 35.574, 36.575, 38.078, 39.08, 40.581, 41.581, 43.082, 44.083, 44.584]
y-axis "CPU percent" 0 --> 500
line [31.96, 101.8, 142.01, 126.04, 141.58, 178.03, 173.74, 149.87, 135.98, 51.97, 117.88, 105.73, 80.05, 0, 17.98, 65.92, 11.99, 61.93, 138.09, 99.91, 109.93, 131.72, 145.72, 133.96, 91.91, 130.09, 137.76, 104.08, 101.8, 69.81, 139.99, 49.9, 9.99, 138, 161.84, 119.98, 133.75, 193.7]
xychart-beta
title "Base memory: RSS then PSS"
x-axis "Elapsed seconds" [0.036, 1.537, 2.539, 4.041, 5.041, 6.542, 7.543, 9.045, 10.046, 11.547, 12.548, 14.05, 15.051, 16.552, 17.053, 17.553, 19.054, 20.055, 21.557, 23.057, 24.058, 24.558, 25.56, 26.562, 28.064, 29.066, 30.567, 31.568, 33.069, 34.071, 35.574, 36.575, 38.078, 39.08, 40.581, 41.581, 43.082, 44.083, 44.584, 45.095]
y-axis "Memory MiB" 0 --> 500
line [12.23, 86.56, 125.54, 130.53, 158.44, 168.34, 171.73, 190.29, 189.21, 167.16, 169.35, 167.11, 163.02, 150.65, 150.66, 150.73, 151.22, 150.65, 158.96, 163.7, 269.46, 281.67, 205.5, 211.71, 190.82, 162.03, 196.77, 169.05, 162.14, 162.07, 158.02, 211.84, 183.52, 167.57, 183.07, 168.38, 166.54, 190.41, 208.73, 0]
line [9.05, 83.08, 122.05, 127.09, 155.38, 164.84, 168.23, 186.75, 185.85, 163.6, 165.84, 163.58, 159.51, 147.14, 147.15, 147.22, 147.71, 147.14, 155.39, 160.29, 266, 277.74, 202.14, 208.22, 187.32, 158.52, 193.6, 165.56, 158.64, 158.53, 154.51, 208.42, 180.01, 164.06, 179.59, 164.88, 163.03, 186.78, 205.22, 0]
HEADxychart-beta
title "HEAD CPU"
x-axis "Elapsed seconds" [1.035, 1.535, 2.537, 4.037, 5.54, 6.542, 8.044, 9.545, 10.546, 12.048, 13.549, 14.551, 16.053, 17.556, 18.557, 20.06, 21.562, 22.563, 24.065, 25.567, 26.568, 27.57, 28.07, 29.572, 30.574, 32.076, 33.576, 34.578, 36.079, 37.58, 38.581, 40.084, 41.585, 42.586, 44.089, 45.59, 46.591, 47.593]
y-axis "CPU percent" 0 --> 500
line [4, 17.99, 123.86, 143.87, 157.64, 145.76, 173.83, 179.85, 139.91, 131.91, 141.88, 37.91, 85.93, 7.98, 0, 29.92, 0, 5.99, 61.97, 119.79, 143.75, 103.79, 110.02, 125.78, 109.75, 125.88, 159.95, 93.89, 117.91, 67.92, 135.97, 101.81, 9.99, 99.97, 141.77, 87.91, 109.83, 197.68]
xychart-beta
title "HEAD memory: RSS then PSS"
x-axis "Elapsed seconds" [0.035, 1.035, 1.535, 2.537, 4.037, 5.54, 6.542, 8.044, 9.545, 10.546, 12.048, 13.549, 14.551, 16.053, 17.556, 18.557, 20.06, 21.562, 22.563, 24.065, 25.567, 26.568, 27.57, 28.07, 29.572, 30.574, 32.076, 33.576, 34.578, 36.079, 37.58, 38.581, 40.084, 41.585, 42.586, 44.089, 45.59, 46.591, 47.593, 48.009]
y-axis "Memory MiB" 0 --> 500
line [12.2, 65.47, 76.62, 121.57, 161.88, 154.01, 176.58, 179.2, 195.95, 179.61, 189.14, 195.54, 166.66, 154.73, 153.11, 149.07, 148.99, 147.25, 146.6, 169.02, 164.57, 169.44, 286.99, 246.82, 207.79, 183.39, 188.98, 166.16, 155, 165.67, 161.54, 209.49, 183.54, 161.59, 178.3, 171.48, 160.96, 182.49, 215.3, 0]
line [9.06, 62.41, 73.18, 118.33, 158.35, 150.47, 173.09, 175.76, 192.32, 176.14, 185.59, 191.95, 163.06, 150.22, 149.51, 145.47, 145.39, 143.65, 143, 165.38, 159.58, 165.96, 283.26, 242.75, 204.18, 179.79, 185.84, 162.57, 151.42, 162.08, 157.71, 205.91, 179.93, 157.98, 174.79, 167.89, 157.37, 178.89, 211.7, 0]
Deterministic fixture · required contractThe fixture exercises 15 routes: 8 are expected to emit rows and 7 intentionally exercise empty, loading, or timeout behavior.
Full HTML, JSON, CSV, logs, and page snapshots: workflow run and full The public-web A/B is informational. The exact HEAD fixture contract runs as a separate required CI check; timing and public-site content deltas remain non-blocking. |
CI Regression ReportSource CI run · source state at render:
Release regression — ✅ HEAD/base failures 0/0; raw binary +0.014622%Package and image size
Startup latency and PSS
Concurrency matrix
Frontend differential — ✅ 1,020/1,020 cases matched; 0 issues
Agent episodes · Moli vs Chromium — ✅ 8/8 Moli episodes passed; 0 failures
Runtime and CDP session contracts — ✅ 26 contract cases; 0 failures
CDP smoke — ✅ 52/52 groups passed; 616 scenariosWorkers: 4 · cumulative group time: 199.41 s · failed groups: 0
WebMainBench · 545 pages — ✅ 545/545 completed; 0 unexpected failures
Frozen HTML · Linux · Diagnostics: All artifact fields are parsed by the trusted default-branch renderer; missing or invalid inputs remain visible as unavailable. |
19f651f to
7649f13
Compare
ef06d30 to
d979e94
Compare
7649f13 to
6185ba5
Compare
d979e94 to
f4461d1
Compare
008b31d to
2009cd7
Compare
f4461d1 to
eeb8a55
Compare
eeb8a55 to
3bd7cb9
Compare
3bd7cb9 to
d1c5f5c
Compare
行内元素包含块级或 flex 子元素时,布局构造和投影可能丢失分裂后的行内片段:页面看起来有内容,链接的几何却是零宽/零面积,真实指针点击失败。另一些动态页面存在滚动条反馈、根字号和实际布局输入变化处理不完整的问题。本 PR 修复几何生成及缓存失效,同时保留普通几何读取的已发布快照语义。
一图看懂
图示说明问题、修复机制与行为边界;点击可查看原图。验收归属不等于当前提交通过结果,版本和测试证据见下文。
场景与修复后的行为
机制与设计边界
构造阶段记录连续块子元素对应的 inline continuation;投影使用已有流位置和包含块宽度生成片段,不另造自动高度或百分比偏移规则。根字号/根行高同步到 Stylo Device,使单节点样式解析与后续布局使用一致输入。普通 getter 不承担隐式发布职责,自动化调用通过
Page.getLayoutMetrics({publishLayout:true})请求更新;默认值及false保持只读。这一边界也应用于 main 新增的原生 Page 分派路径。代码阅读路线与大段改动
moli-layout的 builder/world 和 projection:先看 continuation 如何建立、再看片段如何投影,重点核对相对包含块、自动高度及百分比偏移。Taffy 缓存处理负责滚动条反馈后的受影响子树,不能全局清空来掩盖失效遗漏。moli-renderer-v8的样式/宿主环境/图片资源处理:核对实际输入变化与根字体 Device 同步;不是根据网站、选择器或 case 编号触发刷新。moli-layout/tests/phase5_output_contract.rs、renderer 的 DOM surface/inline layout、root font units 与 rendering update 场景。大段新增主要是布局边界矩阵;审阅时应核对场景维度与独立预期,而不是只看新增行数。回归场景与独立预期
本轮修正两项依赖系统 monospace 指标的夹具,使用仓库固定字体;几何预期以独立 Chromium 实测为参照,保留具体数值断言。另一个导航夹具改为按 loader 关联事件。三项失败均先在相同 main 基线复现,没有删除、跳过或弱化功能断言。
Case 对应与验收版本
布局负责 27 题:
29,66,108,156,163,196,314,349,374,389,399,404,415,418,441,448,506,547,576,585,590,620,640,645,658,666,714。按原 11 类:第 1 类零面积 18 题;第 2 类零宽栏目链接中
66,404,620,640,645;第 3 类可见索引314,349;第 4 类建议框576;第 5 类向导547。595 不计入这 27 题,由 #758 认领,但须同时具备本 PR 的链接几何修复。d1c5f5cd341bcf7dc76173c03af7020efe98c339,baseb21b4f05615c1b9aa71ea2074084646895d82be73bd7cb9b77a206b90c7d5c443f7a49bc2a4a9d8129,66,108,163,196,314,349各评分 1.0;不是当前 HEAD 的任务复跑当前直接 base 是 main。#758 也独立以 main 为 base;595 是行为层面的组合验收,不是要求恢复旧的分支堆叠。来源:原布局 PR #735。
Reviewer 复现:最小场景与真实 badcase
先在本 PR 的 Moli checkout 跑最小回归场景,不需要 WebArena:
cargo nextest run --no-fail-fast -p moli-layout -p moli-protocol \ -E 'test(split_inline_) | test(explicit_layout_metrics_publication_exposes_new_click_target) | test(get_layout_metrics_initializes_layout_and_reuses_content_until_capture) | test(local_scrollbar_feedback_invalidates_only_the_changed_subtree_and_ancestor_path)'预期:inline 内含块元素时保留全部片段;发布后新增元素,普通读取及
false保留旧快照,true发布后可命中新目标;滚动条反馈不清空无关缓存。完整复现指南与环境准备 · 下载复现包。包内有按 case 选题的脚本、固定动作和 DOM 采集合同,不含历史答案。代码复用 browser-eval 的执行、HAR 采集与评分器,不是重新实现评分。
首次使用:解压到 Moli 仓库外,将
REPRO_DIR设为解压目录的绝对路径。独立克隆 browser-eval 后,固定版本并安装锁定依赖:将
site-map.json的主机和端口换成自己使用的 WebArena 测试站点。需要 Reddit、GitLab、Shopping、Shopping Admin;不用 Map/Wikipedia。镜像、初始化、测试账号和地址要求见指南。下文命令都在这个 browser-eval 目录执行。脚本自行启动待审二进制,使用新 profile 和可用端口,结束后只停止它启动的进程。优先跑不修改网站数据的 7 题;也可以用
--cases 29,66只跑指定题目:每题动作完成且官方评分为 1.0 才算通过。完整 27 题用
--cases layout --allow-fixture-writes,它包含发帖、下单、资料修改和创建 MR,必须用自己独占、已重置的测试站点;每个二进制从同样初始数据开始。其余 20 题的具体任务、原 11 类对应关系和动作在指南及cases.json中。此回放是功能复现:读取题使用固定版本的 DOM 采集合同,部分比早期 90 题轨迹多了采集步骤,不能把新结果改标成原 1.1.9 统计。脚本不自动重试失败题,不从历史答案填结果。595 仍是与 #758 的组合场景。
保存和判断结果
每轮使用新结果目录。
inputs.json记录二进制、输入哈希及回放/评分器版本;每题保存result.json、trace.json、network.har、实际响应与评分。动作失败时评分文件可能尚未生成,先看failure_stage和 trace;网络问题对照 HAR 的方法、URL、Referer、重定向与状态码。默认每动作 30 秒、每题 300 秒,每题只执行一次。比较历史失败时用 1.1.9 官方二进制和待审 PR,并保持相同站点初始数据。当前 main 已包含其他修复,不应预设所有历史题仍会在 main 上失败。
Reviewer 重点
整组验收与证据入口
这组修复来自 #640,对应 1.1.9 的 34 个失败 case,加上 1.1.8 已失败的 386,共 35 个唯一 case。按最终职责分配为:#756 布局 27、#757 输入 4、#758 网络 3、#761 文本 1;#755、#759、#760 以各自独立功能契约验收,不重复认领这 35 个 case。