Skip to content

fix(forms): resolve live named properties without repeated scans - #760

Merged
ldm0 merged 1 commit into
mainfrom
codex/pr640-reopen-forms
Sep 28, 2026
Merged

ldm0 merged 1 commit into
mainfrom
codex/pr640-reopen-forms

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

读取不存在的表单命名属性会反复全量扫描控件;简单缓存最终答案则会在改名、移除、表单归属变化或跨文档收养后过期。本 PR 使用文档实时名称索引筛选候选,再检查当前归属,避免全扫描而保持实时语义。

一图看懂

PR #760 · 实时索引查询,不缓存过期答案

图示说明问题、修复机制与行为边界;点击可查看原图。验收归属不等于当前提交通过结果,版本和测试证据见下文。

机制与边界

不缓存可能失效的最终查询答案。读取真实标准属性不应枚举虚拟名称或意外执行 getter;重复名称、枚举和 descriptor 必须保持原有语义。detached/adopted 文档与控件身份仍按实际 DOM 归属处理。

代码阅读路线

  • moli-dom/src/native/host/query_index.rs、document.rs:名称索引与更新生命周期。
  • renderer 的 element/forms/form_element.rs、forms、template_install/accessors_forms:候选查询、归属过滤及真实/虚拟属性边界。
  • detached objects builders 和 element bridge:脱离文档、收养及元素身份。
  • script_vm/tests/dom_xhr/forms/named_lookup.rs 与 forms tests:实时语义和避免扫描的正反对照。

验收场景

场景 必须约束的结果
missing / present 返回当前结果,重复 missing 查询不重复全扫描
改名、移除、form 归属改变 下一次读取立即反映新状态
同名与重复控件 不因索引优化改变返回及集合语义
标准属性、getter、in/descriptor/枚举 不意外调用 getter,不把虚拟名称混进真实属性路径
自定义元素升级、detached、adopted 归属与身份保持正确,旧文档索引不返回错误结果

性能测试使用扫描计数正反对照,语义测试独立检查 DOM 行为;不能只断言缓存命中或依赖运行耗时。此 PR 不认领历史 35 题,历史专项证据见 原 PR #739 与报告。

已合入;最后 head 5f9803a1cf3934a662850f77b577a0ec0f74c380,base main,最终提交门禁见 Checks。旧报告中的 #755 直接分支依赖是历史状态,工程前提已进入 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。

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

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 6185ba57bee6 → HEAD b81655b485c9; benchmark order: base-first; workflow: success.

Public 48-site run · informational

Metric Base HEAD Δ
Run status success success —
Extracted rows / contract 184 / 240 184 / 240 0 (0.00%)
Contract fill 76.67% 76.67% 0.00 pp (0.00%)
Sites with rows 38 / 48 38 / 48 0 (0.00%)
Sites meeting row contract 36 / 48 36 / 48 0 (0.00%)
Unexpected empty sites 10 10 0 (0.00%)
Partial-row sites 2 2 0 (0.00%)
Site outcomes extracted: 36; HTTP error + rows: 2; empty: 7; HTTP error + empty: 1; snapshot error + empty: 2 extracted: 37; HTTP error + rows: 1; empty: 7; HTTP error + empty: 1; snapshot error + empty: 2 —
Observed duration 51.41 s 47.25 s -4.16 s (-8.09%)
Estimated CPU 52.43 s 49.66 s -2.77 s (-5.28%)
Peak PSS 268.42 MiB 265.16 MiB -3.26 MiB (-1.21%)
Peak RSS 272.08 MiB 268.83 MiB -3.25 MiB (-1.20%)
Peak threads 26 26 0 (0.00%)
Mismatched sites 0 0 0
Timeout with items 0 0 0
Category rows Base HEAD Δ
news 35 / 40 35 / 40 0
stocks 20 / 40 20 / 40 0
tech 35 / 40 35 / 40 0
sports 27 / 40 27 / 40 0
games 37 / 40 37 / 40 0
life 30 / 40 30 / 40 0

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 timelines

These 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.

Base

xychart-beta
    title "Base CPU"
    x-axis "Elapsed seconds" [1.535, 2.536, 3.037, 4.539, 5.54, 7.043, 8.545, 10.047, 11.549, 13.052, 14.554, 15.555, 16.056, 17.057, 18.559, 20.06, 21.561, 23.062, 24.563, 26.064, 26.565, 27.066, 28.569, 30.071, 31.574, 33.076, 34.577, 36.079, 37.08, 38.582, 40.084, 41.584, 43.086, 44.589, 46.091, 47.092, 48.595, 50.097]
    y-axis "CPU percent" 0 --> 200
    line [81.91, 111.86, 139.81, 113.96, 161.7, 135.71, 165.67, 179.88, 101.75, 111.91, 127.99, 97.73, 0, 33.92, 107.98, 105.74, 45.99, 93.83, 147.97, 97.75, 101.8, 109.87, 151.7, 119.97, 117.9, 99.84, 25.99, 71.83, 103.96, 35.98, 127.71, 42.03, 79.93, 141.58, 185.74, 19.98, 101.7, 103.87]
Loading
xychart-beta
    title "Base memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.034, 1.535, 2.536, 3.037, 4.539, 5.54, 7.043, 8.545, 10.047, 11.549, 13.052, 14.554, 15.555, 16.056, 17.057, 18.559, 20.06, 21.561, 23.062, 24.563, 26.064, 26.565, 27.066, 28.569, 30.071, 31.574, 33.076, 34.577, 36.079, 37.08, 38.582, 40.084, 41.584, 43.086, 44.589, 46.091, 47.092, 48.595, 50.097, 51.407]
    y-axis "Memory MiB" 0 --> 500
    line [12.4, 91.18, 115.37, 120.93, 141.74, 166.44, 172.1, 149.01, 183.18, 181.37, 170.88, 189.79, 162.78, 162.75, 143.57, 154.26, 148, 146.95, 181.53, 161.44, 210.94, 272.08, 258.09, 196.35, 170.66, 163.78, 176.99, 147.2, 145.38, 151.21, 150.48, 182.16, 160.77, 169.54, 185.17, 158.55, 157.67, 158.75, 171.66, 0]
    line [9.14, 87.4, 111.79, 117.36, 138.14, 162.37, 168.48, 145.3, 179.48, 175.22, 167.26, 186.16, 159.1, 159.07, 139.89, 150.64, 144.33, 143.27, 177.86, 157.32, 207.33, 268.42, 254, 192.7, 166.78, 160.14, 173.21, 143.51, 141.69, 146.16, 146.81, 178.48, 157.09, 165.87, 181.52, 154.5, 153.99, 155.07, 167.98, 0]
Loading

HEAD

xychart-beta
    title "HEAD CPU"
    x-axis "Elapsed seconds" [1.036, 1.537, 2.539, 4.042, 5.542, 6.543, 8.045, 9.047, 10.549, 12.052, 13.054, 14.555, 16.057, 17.058, 18.559, 20.059, 21.06, 22.562, 23.564, 24.065, 25.067, 26.569, 27.571, 29.072, 30.573, 31.575, 33.076, 34.578, 35.579, 37.08, 38.581, 39.582, 41.083, 42.083, 43.586, 45.088, 46.089, 46.59]
    y-axis "CPU percent" 0 --> 500
    line [31.92, 123.85, 131.8, 121.86, 201.98, 153.87, 107.85, 179.79, 65.91, 115.88, 141.79, 129.99, 97.9, 91.88, 63.99, 98.05, 133.69, 133.8, 107.79, 103.86, 103.78, 127.94, 109.81, 100, 31.98, 63.84, 113.84, 65.92, 151.8, 83.92, 0, 133.74, 117.92, 153.86, 99.75, 111.9, 107.7, 203.72]
Loading
xychart-beta
    title "HEAD memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.035, 1.036, 1.537, 2.539, 4.042, 5.542, 6.543, 8.045, 9.047, 10.549, 12.052, 13.054, 14.555, 16.057, 17.058, 18.559, 20.059, 21.06, 22.562, 23.564, 24.065, 25.067, 26.569, 27.571, 29.072, 30.573, 31.575, 33.076, 34.578, 35.579, 37.08, 38.581, 39.582, 41.083, 42.083, 43.586, 45.088, 46.089, 46.59, 47.247]
    y-axis "Memory MiB" 0 --> 500
    line [12.27, 88.66, 107.51, 116.02, 133.96, 148.67, 175.08, 161.4, 196.34, 178.63, 189.18, 183.24, 180.25, 174.63, 156.09, 151.46, 186.74, 153.71, 168.81, 268.83, 232.12, 218.82, 161.36, 160.47, 172.72, 145.4, 143.75, 143.33, 151.01, 193.85, 181.25, 153.22, 171.3, 189.41, 164.95, 158.85, 155.25, 174.89, 193.01, 0]
    line [9.09, 85.06, 103.86, 112.41, 130.43, 145.09, 171.42, 157.79, 192.74, 171.82, 185.56, 179.57, 176.58, 170.95, 152.41, 147.97, 179.08, 150.04, 165.18, 265.16, 227.77, 215.22, 157.61, 156.83, 169.04, 141.86, 140.08, 139.63, 147.33, 189.17, 177.58, 149.55, 167.62, 185.78, 160.75, 155.17, 151.63, 171.22, 189.48, 0]
Loading

Deterministic fixture · required contract

The fixture exercises 15 routes: 8 are expected to emit rows and 7 intentionally exercise empty, loading, or timeout behavior.

Metric Base HEAD Δ
Run status success success —
Extracted rows / contract 40 / 40 40 / 40 0 (0.00%)
Contract fill 100.00% 100.00% 0.00 pp (0.00%)
Sites with rows 8 / 15 8 / 15 0 (0.00%)
Sites meeting row contract 15 / 15 15 / 15 0 (0.00%)
Unexpected empty sites 0 0 0
Partial-row sites 0 0 0
Site outcomes extracted: 7; HTTP error + rows: 1; empty: 3; timeout + empty: 4 extracted: 7; HTTP error + rows: 1; empty: 3; timeout + empty: 4 —
Observed duration 19.88 s 19.87 s -0.00 s (-0.01%)
Estimated CPU 0.42 s 0.43 s +0.01 s (+2.38%)
Peak PSS 58.04 MiB 58.04 MiB -0.00 MiB (-0.01%)
Peak RSS 61.49 MiB 61.45 MiB -0.04 MiB (-0.06%)
Peak threads 19 18 -1 (-5.26%)
Mismatched sites 0 0 0
Timeout with items 0 0 0

Full HTML, JSON, CSV, logs, and page snapshots: workflow run and full spider-bench-results artifact.

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.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

CI Regression Report

Source CI run · source state at render: in_progress · artifacts: 6/6

Check Status Signal
Release regression ✅ HEAD/base failures 0/0; raw binary +0.003341%
Frontend differential ✅ 1,020/1,020 cases matched; 0 issues; 2 Chromium reference recoveries
Agent episodes ✅ 8/8 Moli episodes passed; 0 failures
Runtime/CDP contracts ✅ 26 contract cases; 0 failures
CDP smoke ✅ 50/50 groups passed; 574 scenarios
WebMainBench ✅ 545/545 completed; 0 unexpected failures
Release regression — ✅ HEAD/base failures 0/0; raw binary +0.003341%

Package and image size

Metric Base HEAD Delta Delta %
Raw binary 146.59 MiB 146.59 MiB +5.02 KiB +0.003341%
Stripped binary 100.57 MiB 100.57 MiB +4.00 KiB +0.003884%
gzip binary 50.17 MiB 50.17 MiB +416 B +0.000791%
Rootfs 153.49 MiB 153.50 MiB +10.00 KiB +0.006363%
gzip rootfs 58.95 MiB 58.95 MiB +348 B +0.000563%

Startup latency and PSS

Case Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta
Serve ready 27.16 ms 27.28 ms +0.12 ms 4.32 MiB 5.02 MiB +718.00 KiB
CDP first page 50.47 ms 51.33 ms +0.86 ms 4.09 MiB 5.49 MiB +1.40 MiB
CDP warm page 13.09 ms 14.35 ms +1.26 ms 48.62 MiB 49.60 MiB +1003.00 KiB
CLI about:blank 14.29 ms 14.54 ms +0.25 ms 2.36 MiB 5.19 MiB +2.83 MiB
CLI local JS 19.23 ms 19.28 ms +0.05 ms 5.49 MiB 5.33 MiB −170.50 KiB

Concurrency matrix

Concurrency Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta HEAD failures Unstable B/H
1 18.77 ms 16.48 ms −2.28 ms 791.00 KiB 992.00 KiB +201.00 KiB 0 0/0
5 23.27 ms 20.88 ms −2.40 ms 18.36 MiB 17.70 MiB −681.50 KiB 0 0/0
10 22.34 ms 21.26 ms −1.08 ms 15.97 MiB 13.73 MiB −2.24 MiB 0 0/0
25 21.46 ms 21.73 ms +0.27 ms 15.71 MiB 12.61 MiB −3.10 MiB 0 0/0
100 19.73 ms 20.51 ms +0.79 ms 18.21 MiB 18.37 MiB +158.75 KiB 0 0/0
Frontend differential — ✅ 1,020/1,020 cases matched; 0 issues; 2 Chromium reference recoveries
Match DOM mismatch Diagnostic mismatch Moli error Reference error Infrastructure error Mismatched frames Duration
1,020 0 0 0 0 0 0 7m 29.61s

Recovered Chromium reference infrastructure failures

  • react/events/click-update — 1 failed attempt(s) before recovery · unknown
  • react/cors-credentials-boundaries/exposed-header-filtering — 1 failed attempt(s) before recovery · unknown
Agent episodes · Moli vs Chromium — ✅ 8/8 Moli episodes passed; 0 failures
Fast contract Episodes Passed Assertions Ready p50 Episode p50
Moli 8 8 47/47 3.22 ms 25.83 ms
Chromium 8 8 47/47 263.89 ms 93.42 ms
Operation p50 Chromium Moli Delta Delta %
navigate 43.79 ms 7.18 ms −36.61 ms −83.60%
observe 0.95 ms 0.84 ms −0.11 ms −11.20%
fill 3.84 ms 3.40 ms −0.43 ms −11.31%
click 6.37 ms 3.77 ms −2.60 ms −40.85%
Idle-resource episode Peak RSS Peak PSS Average CPU Peak CPU Peak processes Sampler
Moli 63.89 MiB 60.85 MiB 0.66% 10.00% 1 ✅
Chromium 1309.11 MiB 354.20 MiB 2.22% 88.15% 13 ⚠️ PSS partial
Runtime and CDP session contracts — ✅ 26 contract cases; 0 failures
Suite Cases Failures Median case p50 Median case p95 Median peak PSS p50
Synthetic fetch 13 0 16.75 ms 17.49 ms 640.00 KiB
Long-lived CDP session 13 0 19.32 ms 19.46 ms —
CDP smoke — ✅ 50/50 groups passed; 574 scenarios

Workers: 4 · cumulative group time: 156.95 s · failed groups: 0

Slowest group Scenarios Duration Status
target-lifecycle 24 17.25 s ✅
dom-input 27 12.42 s ✅
multi-page 45 12.20 s ✅
chromium-cdp 56 10.77 s ✅
layout-screenshot 5 7.79 s ✅
WebMainBench · 545 pages — ✅ 545/545 completed; 0 unexpected failures
Completed Successful Expected DNS failure Unexpected failures Panics Crashes Timeouts Empty output
545/545 544 1 0 0 0 0 0

Frozen HTML · Linux · --wait done · 45 seconds per page · no retries. Content quality is evaluated separately.

Diagnostics: webmainbench-results — every page's Markdown, stderr, and exit status. Source run and artifacts

All artifact fields are parsed by the trusted default-branch renderer; missing or invalid inputs remain visible as unavailable.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

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 Page.navigate commands per binary.

Common ancestor 6185ba57be → HEAD b81655b485; benchmark order: base-first; workflow: success.

Session resilience

Metric Base HEAD
Attempted / planned 200 / 200 200 / 200
Direct observable pass 200 / 200 200 / 200
Failures / recovered 0 / 0 0 / 0
Recovery failures 0 0
Lifecycle order violations 0 0
Network order violations 0 0
Wall time 324.8 s 310.2 s

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

Metric Base HEAD Δ
Boundary samples 200 200 0
Boundary RSS samples 200 200 0
Boundary PSS samples 200 200 0
Periodic peak RSS 255.4 MiB 234.0 MiB -21.4 MiB
Periodic peak PSS 251.8 MiB 230.0 MiB -21.8 MiB
RSS · first 10 avg 153.1 MiB 172.3 MiB +19.2 MiB
RSS · last 10 avg 166.8 MiB 163.9 MiB -2.9 MiB
RSS · last − first window +13.7 MiB -8.4 MiB -22.2 MiB
RSS · warm slope / 100 nav +2.3 MiB +0.7 MiB -1.6 MiB
PSS · first 10 avg 149.6 MiB 168.8 MiB +19.2 MiB
PSS · last 10 avg 163.2 MiB 160.5 MiB -2.7 MiB
PSS · last − first window +13.6 MiB -8.3 MiB -21.9 MiB
PSS · warm slope / 100 nav +2.3 MiB +0.6 MiB -1.6 MiB
Peak file descriptors 65 64 -1
Peak threads 31 31 0

HEAD memory by 50-navigation quarter

HEAD range Avg RSS Final RSS Peak RSS Avg PSS Final PSS Peak FD
1–50 164.8 MiB 152.0 MiB 229.4 MiB 161.4 MiB 148.6 MiB 52
51–100 163.5 MiB 141.2 MiB 207.0 MiB 160.1 MiB 137.8 MiB 52
101–150 168.4 MiB 153.0 MiB 231.3 MiB 165.0 MiB 149.5 MiB 53
151–200 166.4 MiB 140.5 MiB 233.1 MiB 162.9 MiB 137.1 MiB 57

Raw reports and per-navigation boundary samples: workflow run and full sequential-navigation-soak-results artifact.

Public-site timing and memory are observational. Use the A/B deltas and trend shape as evidence, not as a deterministic performance threshold.

@lanyue-llk
lanyue-llk force-pushed the codex/pr640-reopen-engineering branch from 19f651f to 7649f13 Compare September 24, 2026 04:21
@lanyue-llk
lanyue-llk force-pushed the codex/pr640-reopen-forms branch from 7c4f06a to b2e8f4c Compare September 24, 2026 04:22
@lanyue-llk
lanyue-llk force-pushed the codex/pr640-reopen-engineering branch from 7649f13 to 6185ba5 Compare September 24, 2026 05:10
@lanyue-llk
lanyue-llk force-pushed the codex/pr640-reopen-forms branch from b2e8f4c to b81655b Compare September 24, 2026 05:10
@ldm0
ldm0 force-pushed the codex/pr640-reopen-engineering branch from 008b31d to 2009cd7 Compare September 28, 2026 20:51
@ldm0
ldm0 force-pushed the codex/pr640-reopen-forms branch from b81655b to 5f9803a Compare September 28, 2026 22:20
@ldm0
ldm0 changed the base branch from codex/pr640-reopen-engineering to main September 28, 2026 22:23
@ldm0
ldm0 merged commit 468729e into main Sep 28, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants