Skip to content

fix(fetch): stabilize default page completion - #1436

Closed
lanyue-llk wants to merge 2 commits into
mainfrom
codex/default-page-completion-current
Closed

lanyue-llk wants to merge 2 commits into
mainfrom
codex/default-page-completion-current

Conversation

@lanyue-llk

Copy link
Copy Markdown
Contributor

The default done mode could return immediately after the load event, before post-load scripts had rendered their final document content. A page that appends an external script from a load handler therefore produced incomplete Markdown, while explicitly selecting DOM stability produced the expected table.

This change keeps load exact and makes the default done mode use the existing bounded DOM-stability phase after load, within the same absolute deadline. It preserves the current raw-document policy and adds browser-level coverage for both inline post-load rendering and an external script inserted by a load handler.

Validation:

  • core fetch post-load completion tests: 2 passed
  • CLI default completion tests: 2 passed
  • real Grid.js page: the previously missing rendered tables are present and the benchmark case passes

@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 da7a9b254bcf → HEAD 65bdce8495f4; benchmark order: head-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: 37; HTTP error + rows: 1; empty: 7; HTTP error + empty: 1; snapshot error + empty: 2 extracted: 36; HTTP error + rows: 2; empty: 7; HTTP error + empty: 1; snapshot error + empty: 2 —
Observed duration 53.20 s 54.25 s +1.05 s (+1.98%)
Estimated CPU 53.22 s 49.82 s -3.40 s (-6.39%)
Peak PSS 288.91 MiB 282.42 MiB -6.50 MiB (-2.25%)
Peak RSS 292.45 MiB 286.01 MiB -6.45 MiB (-2.20%)
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.542, 3.045, 4.547, 6.05, 7.552, 9.053, 10.555, 12.056, 13.559, 14.561, 16.063, 17.565, 19.098, 20.711, 22.227, 23.729, 25.236, 26.739, 28.239, 29.741, 31.243, 31.743, 32.745, 34.246, 35.748, 37.25, 38.751, 40.253, 41.254, 42.755, 43.256, 44.258, 45.761, 47.262, 48.763, 50.264, 51.767, 52.768]
    y-axis "CPU percent" 0 --> 500
    line [70.02, 123.75, 105.93, 183.6, 181.61, 105.84, 151.82, 175.85, 159.67, 33.92, 77.92, 73.9, 146.53, 42.54, 103.89, 111.91, 43.94, 79.83, 46.01, 99.81, 99.92, 112, 107.77, 145.93, 153.79, 115.97, 102.02, 119.82, 15.98, 4, 0, 107.81, 85.88, 2, 129.82, 65.92, 113.83, 213.69]
Loading
xychart-beta
    title "Base memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.042, 1.542, 3.045, 4.547, 6.05, 7.552, 9.053, 10.555, 12.056, 13.559, 14.561, 16.063, 17.565, 19.098, 20.711, 22.227, 23.729, 25.236, 26.739, 28.239, 29.741, 31.243, 31.743, 32.745, 34.246, 35.748, 37.25, 38.751, 40.253, 41.254, 42.755, 43.256, 44.258, 45.761, 47.262, 48.763, 50.264, 51.767, 52.768, 53.197]
    y-axis "Memory MiB" 0 --> 500
    line [12.54, 93.67, 143.89, 133.28, 156.48, 195.42, 215.26, 171.47, 181.98, 197.22, 170.41, 164.72, 186.16, 168.39, 156.25, 153.89, 193.43, 145.21, 156.94, 143.88, 170.77, 250.13, 292.45, 204.01, 185.88, 162.82, 185.75, 151.86, 161.68, 154.79, 154.48, 154.49, 189.2, 169.73, 151.21, 165.22, 160.31, 178.27, 204.89, 0]
    line [9.29, 90.04, 140.3, 129.65, 152.79, 191.73, 211.61, 168.52, 178.3, 193.75, 166.79, 161.08, 182.38, 164.71, 152.61, 150.24, 189.76, 141.52, 153.17, 140.18, 167.1, 246.67, 288.91, 200.45, 181.08, 158.3, 182.26, 148.31, 158.16, 151.25, 150.93, 150.95, 184.88, 166.19, 147.67, 161.67, 156.83, 174.73, 201.49, 0]
Loading

HEAD

xychart-beta
    title "HEAD CPU"
    x-axis "Elapsed seconds" [1.538, 3.04, 4.042, 4.542, 5.543, 6.044, 7.546, 9.048, 10.55, 12.052, 13.553, 15.056, 16.556, 18.059, 19.06, 19.561, 21.062, 22.564, 24.066, 25.567, 27.568, 29.071, 30.572, 32.074, 33.576, 35.077, 36.578, 38.08, 39.582, 41.083, 42.585, 44.086, 45.589, 47.089, 48.593, 50.096, 51.598, 53.099]
    y-axis "CPU percent" 0 --> 500
    line [121.64, 129.96, 93.84, 125.94, 153.89, 133.64, 161.6, 219.75, 137.92, 91.9, 125.84, 99.9, 81.93, 93.79, 0, 5.98, 2, 3.99, 19.99, 99.98, 119.89, 101.84, 141.79, 107.74, 103.79, 107.83, 159.87, 101.91, 101.82, 13.99, 43.93, 83.87, 49.91, 14, 75.9, 105.45, 51.93, 113.75]
Loading
xychart-beta
    title "HEAD memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.037, 1.538, 3.04, 4.042, 4.542, 5.543, 6.044, 7.546, 9.048, 10.55, 12.052, 13.553, 15.056, 16.556, 18.059, 19.06, 19.561, 21.062, 22.564, 24.066, 25.567, 27.568, 29.071, 30.572, 32.074, 33.576, 35.077, 36.578, 38.08, 39.582, 41.083, 42.585, 44.086, 45.589, 47.089, 48.593, 50.096, 51.598, 53.099, 54.25]
    y-axis "Memory MiB" 0 --> 500
    line [12.76, 113.48, 137.04, 134.94, 169.09, 175.97, 172.3, 178.41, 157.18, 191.58, 184.23, 176.36, 175.05, 157.96, 171.9, 145.07, 143.52, 146.74, 143.36, 147.09, 172.36, 162.39, 286.01, 208.25, 245.46, 163.48, 184.78, 175.26, 159.51, 158.49, 156.56, 158.84, 157.43, 163.71, 163.04, 156.53, 171.09, 155.84, 177.48, 0]
    line [9.77, 110.18, 133.22, 131.2, 166.02, 172.19, 169.04, 174.9, 153.83, 188.76, 180.86, 173.01, 171.67, 154.61, 168.54, 141.72, 140.16, 143.37, 139.71, 143.94, 168.71, 158.76, 282.42, 204.63, 241.95, 159.9, 181.63, 171.66, 155.97, 154.95, 153.02, 155.35, 153.82, 160.03, 159.36, 152.89, 167.51, 151.99, 174.08, 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.86 s 19.87 s +0.01 s (+0.06%)
Estimated CPU 0.41 s 0.42 s +0.01 s (+2.42%)
Peak PSS 66.15 MiB 66.23 MiB +0.08 MiB (+0.12%)
Peak RSS 69.69 MiB 69.82 MiB +0.13 MiB (+0.18%)
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

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 da7a9b254b → HEAD 65bdce8495; benchmark order: head-first; workflow: success.

Session resilience

Metric Base HEAD
Attempted / planned 200 / 200 200 / 200
Direct observable pass 198 / 200 199 / 200
Failures / recovered 2 / 2 1 / 1
Recovery failures 0 0
Lifecycle order violations 0 0
Network order violations 0 0
Wall time 536.3 s 500.5 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 264.5 MiB 267.2 MiB +2.7 MiB
Periodic peak PSS 261.0 MiB 263.4 MiB +2.5 MiB
RSS · first 10 avg 179.6 MiB 181.4 MiB +1.8 MiB
RSS · last 10 avg 161.4 MiB 161.2 MiB -0.2 MiB
RSS · last − first window -18.2 MiB -20.2 MiB -2.0 MiB
RSS · warm slope / 100 nav -1.3 MiB -9.3 MiB -8.0 MiB
PSS · first 10 avg 175.7 MiB 178.3 MiB +2.6 MiB
PSS · last 10 avg 158.5 MiB 157.5 MiB -1.0 MiB
PSS · last − first window -17.2 MiB -20.8 MiB -3.6 MiB
PSS · warm slope / 100 nav -1.4 MiB -9.3 MiB -7.9 MiB
Peak file descriptors 60 56 -4
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 152.1 MiB 232.2 MiB 177.9 MiB 148.4 MiB 53
51–100 187.2 MiB 177.2 MiB 223.1 MiB 183.8 MiB 174.3 MiB 53
101–150 184.9 MiB 171.6 MiB 227.6 MiB 181.7 MiB 168.2 MiB 53
151–200 168.9 MiB 151.5 MiB 221.4 MiB 165.5 MiB 147.7 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

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.002825%
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.002825%

Package and image size

Metric Base HEAD Delta Delta %
Raw binary 148.81 MiB 148.81 MiB +4.30 KiB +0.002825%
Stripped binary 102.46 MiB 102.47 MiB +4.00 KiB +0.003812%
gzip binary 51.05 MiB 51.05 MiB −1.59 KiB −0.003037%
Rootfs 155.71 MiB 155.71 MiB 0 B 0.00%
gzip rootfs 59.94 MiB 59.94 MiB +3.06 KiB +0.004993%

Startup latency and PSS

Case Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta
Serve ready 27.32 ms 27.49 ms +0.17 ms 3.83 MiB 4.84 MiB +1.00 MiB
CDP first page 50.68 ms 52.32 ms +1.64 ms 4.29 MiB 4.50 MiB +216.00 KiB
CDP warm page 12.34 ms 12.55 ms +0.21 ms 50.01 MiB 49.64 MiB −375.50 KiB
CLI about:blank 15.20 ms 15.45 ms +0.25 ms 3.89 MiB 2.89 MiB −1.01 MiB
CLI local JS 20.19 ms 376.01 ms +355.82 ms 2.57 MiB 39.68 MiB +37.11 MiB

Concurrency matrix

Concurrency Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta HEAD failures Unstable B/H
1 19.57 ms 374.59 ms +355.02 ms 824.00 KiB 41.07 MiB +40.27 MiB 0 0/0
5 22.09 ms 375.71 ms +353.63 ms 18.91 MiB 12.08 MiB −6.83 MiB 0 0/0
10 21.93 ms 375.90 ms +353.97 ms 22.50 MiB 12.10 MiB −10.40 MiB 0 0/0
25 22.41 ms 375.15 ms +352.74 ms 13.32 MiB 12.04 MiB −1.28 MiB 0 0/0
100 21.41 ms 374.85 ms +353.44 ms 13.36 MiB 11.75 MiB −1.62 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 6m 49.93s
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.67 ms 25.18 ms
Chromium 8 8 47/47 256.87 ms 90.56 ms
Operation p50 Chromium Moli Delta Delta %
navigate 42.74 ms 5.91 ms −36.83 ms −86.18%
observe 1.48 ms 0.91 ms −0.57 ms −38.79%
fill 3.74 ms 3.40 ms −0.34 ms −9.00%
click 5.95 ms 4.05 ms −1.90 ms −31.88%
Idle-resource episode Peak RSS Peak PSS Average CPU Peak CPU Peak processes Sampler
Moli 66.16 MiB 64.20 MiB 0.79% 10.01% 1 ✅
Chromium 1284.21 MiB 333.33 MiB 1.94% 93.90% 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 374.32 ms 374.89 ms 40.84 MiB
Long-lived CDP session 13 0 18.17 ms 18.80 ms —
CDP smoke — ✅ 52/52 groups passed; 621 scenarios

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

Slowest group Scenarios Duration Status
scrollbar-visibility 22 26.91 s ✅
target-lifecycle 24 12.42 s ✅
dom-input 27 10.32 s ✅
chromium-cdp 56 9.61 s ✅
multi-page 45 8.80 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.

@ldm0

ldm0 commented Oct 12, 2026

Copy link
Copy Markdown
Member

Use domstable mode instead.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Closing after review. Changing default completion to wait for DOM stability adds systematic latency and conflicts with the explicit mode. This approach is intentionally excluded from #1501.

@lanyue-llk lanyue-llk closed this Oct 13, 2026
@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Correction to the close note: changing default completion to wait for DOM stability adds systematic latency and conflicts with the explicit domstable mode. This approach is intentionally excluded from #1501.

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