Skip to content

Fix callback navigation, frame Markdown and ResizeObserver layout delivery - #1481

Closed
lanyue-llk wants to merge 3 commits into
mainfrom
codex/render-navigation-frames
Closed

lanyue-llk wants to merge 3 commits into
mainfrom
codex/render-navigation-frames

Conversation

@lanyue-llk

Copy link
Copy Markdown
Contributor

A successful Load can return a bootstrap page before a credentialed fetch callback replaces it. Markdown also omits live child-frame content, and ResizeObserver can read an old layout snapshot after a size change.

This change fixes those three paths:

  • At Load, a pending credentialed fetch or XHR owned by the current top-level Document gets the existing bounded navigation grace. Ordinary polling and long timers do not extend completion. Replacement continuations retain the requested lifecycle stage and command completion when the Document changes; the ownership invariant remains enforced.
  • Markdown --with-frames converts the current child Documents at their frame positions, including nested and cross-origin frames. Links and images use each Document's effective base URL, including inherited srcdoc bases and <base>. Frames with no usable content retain their source link or label.
  • With real layout enabled, ResizeObserver delivery runs on the exact Document's rendering task after fresh layout publication. Callback mutations trigger another layout pass in the same bounded update, unchanged sizes are deduplicated, and same-depth feedback leaves an undelivered-notification warning after the update.

Default fetch --dump markdown continues to use the native text path without real layout. A CLI virtual-list fixture verifies that its resize-driven children appear with explicit --layout and remain absent without it. This does not improve dynamic-104 under the default text method.

Validation on ARM64 Linux, Rust 1.96.1:

  • cargo fmt --all passed.
  • Clippy passed for the moli, moli-renderer-v8, and moli-test-support libraries with all features and warnings denied; moli also passed with all targets.
  • 13 selected nextest tests passed: credential callback navigation in HTML and Markdown, bounded non-navigation grace, unrelated polling/timers, current/nested/cross-origin frame content and URL bases, failed-frame links, resize-driven children and size deduplication, bounded feedback, the CLI layout boundary, and existing 403 navigation, timeout, same-document navigation, HTML-frame and semantic-tree regressions.

This branch starts from main at 7a36b6a63f7b8f8f9801e19959343620fba36265 and is independent of PR1476 and the content/navigation stack.

@github-actions

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 7a36b6a63f → HEAD a2c2ceeab3; 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 476.8 s 479.8 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 268.8 MiB 263.8 MiB -5.0 MiB
Periodic peak PSS 265.6 MiB 262.2 MiB -3.4 MiB
RSS · first 10 avg 180.9 MiB 181.1 MiB +0.2 MiB
RSS · last 10 avg 183.1 MiB 191.4 MiB +8.4 MiB
RSS · last − first window +2.2 MiB +10.4 MiB +8.2 MiB
RSS · warm slope / 100 nav +0.3 MiB +3.6 MiB +3.3 MiB
PSS · first 10 avg 178.1 MiB 178.2 MiB +0.1 MiB
PSS · last 10 avg 180.3 MiB 188.3 MiB +8.0 MiB
PSS · last − first window +2.2 MiB +10.1 MiB +7.9 MiB
PSS · warm slope / 100 nav +0.5 MiB +3.6 MiB +3.1 MiB
Peak file descriptors 59 59 0
Peak threads 31 29 -2

HEAD memory by 50-navigation quarter

HEAD range Avg RSS Final RSS Peak RSS Avg PSS Final PSS Peak FD
1–50 181.2 MiB 158.1 MiB 231.0 MiB 178.2 MiB 154.7 MiB 54
51–100 184.7 MiB 175.7 MiB 229.1 MiB 181.7 MiB 172.7 MiB 54
101–150 183.2 MiB 164.6 MiB 226.2 MiB 180.2 MiB 161.4 MiB 53
151–200 187.9 MiB 180.4 MiB 233.7 MiB 184.8 MiB 177.5 MiB 53

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.

@github-actions

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 7a36b6a63f7b → HEAD a2c2ceeab30b; 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 58.97 s 66.92 s +7.96 s (+13.49%)
Estimated CPU 49.34 s 50.30 s +0.96 s (+1.95%)
Peak PSS 270.76 MiB 272.88 MiB +2.12 MiB (+0.78%)
Peak RSS 274.37 MiB 277.05 MiB +2.68 MiB (+0.98%)
Peak threads 27 27 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.539, 3.041, 3.541, 5.041, 6.541, 7.042, 8.043, 10.045, 11.548, 13.049, 15.053, 16.554, 18.054, 19.557, 21.558, 23.061, 24.563, 26.066, 28.068, 29.57, 31.073, 33.075, 34.575, 36.076, 37.076, 37.576, 39.578, 41.079, 42.581, 44.583, 46.084, 47.587, 49.089, 51.092, 52.594, 54.096, 55.598, 57.6]
    y-axis "CPU percent" 0 --> 500
    line [35.92, 0, 98.03, 136.03, 161.98, 199.86, 139.92, 95.94, 175.75, 77.93, 133.82, 105.89, 8, 5.99, 2, 0, 2, 99.78, 89.97, 7.98, 7.98, 95.98, 125.95, 92.01, 112.06, 105.93, 137.92, 155.75, 121.73, 103.88, 133.84, 89.73, 143.84, 19.97, 31.96, 119.82, 8, 122.05]
Loading
xychart-beta
    title "Base memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.036, 1.539, 3.041, 3.541, 5.041, 6.541, 7.042, 8.043, 10.045, 11.548, 13.049, 15.053, 16.554, 18.054, 19.557, 21.558, 23.061, 24.563, 26.066, 28.068, 29.57, 31.073, 33.075, 34.575, 36.076, 37.076, 37.576, 39.578, 41.079, 42.581, 44.583, 46.084, 47.587, 49.089, 51.092, 52.594, 54.096, 55.598, 57.6, 58.968]
    y-axis "Memory MiB" 0 --> 500
    line [12.39, 89.73, 100.05, 117.92, 153.62, 152.64, 174.47, 183.34, 168.13, 171.99, 160.74, 177.52, 144.11, 143.04, 143.96, 144.71, 144.91, 145.33, 162.89, 151.32, 136.88, 139.39, 174.06, 165.86, 170.44, 274.37, 191.67, 186.6, 160.23, 206.78, 157.21, 154.99, 178.29, 234.68, 172.89, 162.72, 184.19, 147.27, 177.9, 0]
    line [9.03, 86.02, 96.33, 114.33, 150.01, 149.03, 170.39, 179.73, 164.39, 168.22, 157.01, 173.82, 140.38, 139.31, 140.23, 140.98, 141.19, 141.61, 159.18, 147.59, 133.2, 135.67, 170.49, 162.15, 166.74, 270.76, 187.94, 182.87, 156.52, 203.16, 153.6, 151.26, 174.67, 230.96, 170.37, 159.09, 180.48, 143.54, 174.16, 0]
Loading

HEAD

xychart-beta
    title "HEAD CPU"
    x-axis "Elapsed seconds" [1.037, 1.537, 2.037, 3.54, 5.545, 7.547, 9.549, 11.051, 13.053, 15.055, 17.057, 18.559, 20.563, 22.564, 24.067, 26.069, 28.071, 30.073, 31.576, 33.578, 35.581, 37.082, 39.084, 41.086, 43.089, 44.591, 46.593, 48.594, 50.597, 52.098, 54.1, 56.103, 57.605, 59.608, 61.61, 63.614, 65.115, 65.615]
    y-axis "CPU percent" 0 --> 500
    line [0, 8, 2, 119.76, 127.67, 137.87, 91.92, 129.9, 101.92, 133.79, 6, 0, 0, 119.86, 17.98, 33.95, 11.99, 11.99, 0, 0, 27.97, 9.98, 13.99, 3.99, 93.89, 113.83, 116.01, 121.8, 173.98, 127.97, 115.9, 59.95, 119.79, 15.98, 133.99, 33.94, 132, 203.99]
Loading
xychart-beta
    title "HEAD memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.036, 1.037, 1.537, 2.037, 3.54, 5.545, 7.547, 9.549, 11.051, 13.053, 15.055, 17.057, 18.559, 20.563, 22.564, 24.067, 26.069, 28.071, 30.073, 31.576, 33.578, 35.581, 37.082, 39.084, 41.086, 43.089, 44.591, 46.593, 48.594, 50.597, 52.098, 54.1, 56.103, 57.605, 59.608, 61.61, 63.614, 65.115, 65.615, 66.924]
    y-axis "Memory MiB" 0 --> 500
    line [12.29, 54.86, 63.14, 67.13, 115.43, 144.95, 171.11, 164.98, 182.79, 191.23, 166.07, 150.41, 149.98, 150.88, 178.55, 161.78, 164.11, 160.66, 162.25, 161.11, 161.44, 163.23, 161.63, 138.75, 140.69, 167.26, 180.03, 277.05, 232.34, 174.89, 174.96, 164.98, 159.59, 170.03, 167.45, 195.77, 159.25, 200.6, 216.01, 0]
    line [8.97, 51.21, 59.49, 63.5, 111.83, 141.73, 167.39, 161.3, 179.91, 188.14, 162.32, 146.68, 146.25, 147.14, 174.86, 158.05, 160.4, 156.94, 158.52, 157.38, 157.71, 159.5, 157.9, 135.03, 136.96, 163.53, 176.97, 272.88, 228.75, 171.6, 171.24, 161.33, 155.86, 166.36, 163.72, 192.05, 156.27, 196.87, 212.27, 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.85 s 19.86 s +0.01 s (+0.07%)
Estimated CPU 0.40 s 0.42 s +0.02 s (+5.22%)
Peak PSS 66.17 MiB 65.90 MiB -0.27 MiB (-0.41%)
Peak RSS 69.66 MiB 69.36 MiB -0.31 MiB (-0.44%)
Peak threads 18 18 0 (0.00%)
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

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.025550%
Frontend differential ✅ 1,020/1,020 cases matched; 0 issues
Agent episodes ✅ 8/8 Moli episodes passed; 0 failures
Runtime/CDP contracts ✅ 26 contract cases; 0 failures
CDP smoke ✅ 52/52 groups passed; 621 scenarios
WebMainBench ✅ 545/545 completed; 0 unexpected failures
Release regression — ✅ HEAD/base failures 0/0; raw binary +0.025550%

Package and image size

Metric Base HEAD Delta Delta %
Raw binary 150.47 MiB 150.51 MiB +39.37 KiB +0.025550%
Stripped binary 103.94 MiB 103.98 MiB +36.00 KiB +0.033823%
gzip binary 51.74 MiB 51.75 MiB +15.02 KiB +0.028352%
Rootfs 157.37 MiB 157.41 MiB +40.00 KiB +0.024822%
gzip rootfs 60.68 MiB 60.70 MiB +20.35 KiB +0.032748%

Startup latency and PSS

Case Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta
Serve ready 27.24 ms 27.38 ms +0.14 ms 3.81 MiB 3.99 MiB +185.50 KiB
CDP first page 51.30 ms 50.59 ms −0.71 ms 4.20 MiB 3.87 MiB −334.00 KiB
CDP warm page 12.87 ms 11.94 ms −0.92 ms 49.16 MiB 49.40 MiB +244.50 KiB
CLI about:blank 14.86 ms 15.99 ms +1.13 ms 2.89 MiB 2.51 MiB −387.00 KiB
CLI local JS 19.13 ms 20.07 ms +0.94 ms 2.63 MiB 1.40 MiB −1.23 MiB

Concurrency matrix

Concurrency Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta HEAD failures Unstable B/H
1 19.48 ms 19.82 ms +0.34 ms 573.00 KiB 575.00 KiB +2.00 KiB 0 0/0
5 22.14 ms 21.67 ms −0.47 ms 13.36 MiB 27.23 MiB +13.87 MiB 0 0/0
10 21.15 ms 21.72 ms +0.57 ms 13.49 MiB 12.62 MiB −895.00 KiB 0 0/0
25 21.72 ms 21.27 ms −0.44 ms 22.84 MiB 22.72 MiB −120.50 KiB 0 0/0
100 20.98 ms 22.16 ms +1.18 ms 18.22 MiB 40.76 MiB +22.53 MiB 0 0/0
Frontend differential — ✅ 1,020/1,020 cases matched; 0 issues
Match DOM mismatch Diagnostic mismatch Moli error Reference error Infrastructure error Mismatched frames Duration
1,020 0 0 0 0 0 0 7m 35.59s
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 4.48 ms 27.64 ms
Chromium 8 8 47/47 277.22 ms 96.57 ms
Operation p50 Chromium Moli Delta Delta %
navigate 50.04 ms 6.61 ms −43.43 ms −86.79%
observe 0.86 ms 1.10 ms +0.23 ms +26.94%
fill 3.61 ms 3.32 ms −0.29 ms −8.10%
click 5.21 ms 4.85 ms −0.36 ms −6.99%
Idle-resource episode Peak RSS Peak PSS Average CPU Peak CPU Peak processes Sampler
Moli 65.69 MiB 63.10 MiB 0.78% 10.00% 1 ✅
Chromium 1286.73 MiB 331.43 MiB 2.12% 102.86% 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 18.91 ms 20.25 ms 1.03 MiB
Long-lived CDP session 13 0 18.70 ms 19.66 ms —
CDP smoke — ✅ 52/52 groups passed; 621 scenarios

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

Slowest group Scenarios Duration Status
scrollbar-visibility 22 28.11 s ✅
target-lifecycle 24 17.07 s ✅
dom-input 27 12.80 s ✅
multi-page 45 11.45 s ✅
chromium-cdp 56 10.95 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.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Superseded by #1501 for the evidenced Web Fetch fixes: frame Markdown, per-frame stripping, navigation-stage preservation, and ResizeObserver delivery/recovery. The credential-request navigation heuristic was intentionally excluded.

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.

1 participant