Skip to content

fix: handle V8 termination, link labels and PermissionStatus events - #1476

Closed
lanyue-llk wants to merge 2 commits into
mainfrom
codex/main-watchdog-markdown
Closed

lanyue-llk wants to merge 2 commits into
mainfrom
codex/main-watchdog-markdown

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Watchdog termination can make a captured WeakMap call return no value after V8 resets the isolate's termination flag. Wrap construction, get and set in local TryCatch scopes, recognize has_terminated(), rethrow termination and propagate the absent cross-origin Window/Location surface. Ordinary intrinsic failures still panic. Tests cover interrupted construction and insertion, recovery, observer identity and an ordinary throwing intrinsic.

The HTML-to-Markdown converter uses an empty anchor's own nonblank aria-label when it has no descendant content. Visible inline and block descendants remain primary, including code blocks, headings, lists and tables; ancestor and sibling labels are never borrowed. PermissionStatus now inherits EventTarget and has per-instance listener storage, as required by the Permissions IDL. Tests cover listener removal, once, target identity, instance isolation and the illegal constructor.

This branch contains only these fixes on main. It does not import the content/navigation stack. Office document MIME classification is already fixed on main and was validated without duplicating that change.

Validation on ARM64 Linux with rust:1.96.1-bookworm:

  • cargo fmt --all and final format check passed.

  • cargo clippy --workspace --all-targets --all-features -- -D warnings passed before the final TryCatch refinement; cargo clippy -p moli-renderer-v8 --lib --all-features -- -D warnings passed again on the final renderer code.

  • Initial selected nextest tests: 7 passed (3 cross-origin cache tests, PermissionStatus events, link-label regression, binary response headers and document MIME classification).

  • The same link-label regression failed against unmodified main ([](/report) instead of [Open report](/report)). The first termination tests also exposed the insufficient isolate-flag check and passed after the TryCatch correction.

  • Additional link regressions: 3 passed, with the block-descendant regression first failing on the prior implementation. Package clippy passed for all moli-html2md targets.

Full workspace nextest did not reach test execution: building the renderer test binary was killed by the kernel at about 7.39 GiB resident anonymous memory plus 1.75 GiB swap in the original 8 GiB ARM environment. Validation was then explicitly narrowed to the affected functional tests. No CI result is claimed.

@github-actions

github-actions Bot commented Oct 13, 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 7a36b6a63f7b → HEAD db61fe82348c; 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 45.59 s 55.08 s +9.50 s (+20.83%)
Estimated CPU 47.12 s 48.90 s +1.78 s (+3.77%)
Peak PSS 273.46 MiB 289.69 MiB +16.23 MiB (+5.94%)
Peak RSS 276.63 MiB 292.89 MiB +16.26 MiB (+5.88%)
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, 2.541, 4.044, 5.045, 6.546, 7.547, 9.05, 10.052, 11.554, 12.555, 14.057, 15.058, 16.561, 17.563, 19.065, 20.066, 21.568, 23.07, 24.072, 25.073, 25.574, 26.576, 28.076, 29.077, 30.578, 31.58, 33.082, 34.082, 35.584, 36.586, 38.089, 39.089, 39.589, 40.59, 41.592, 42.093, 43.094, 44.096]
    y-axis "CPU percent" 0 --> 500
    line [65.81, 133.68, 147.64, 117.79, 143.84, 175.78, 179.69, 159.72, 133.85, 167.75, 59.9, 2, 115.86, 83.82, 67.91, 45.94, 75.9, 123.84, 151.75, 101.89, 115.71, 101.79, 132.04, 115.87, 109.88, 141.73, 113.82, 124.04, 73.91, 149.74, 107.76, 23.99, 0, 109.98, 93.77, 201.54, 65.96, 127.75]
Loading
xychart-beta
    title "Base memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.037, 1.539, 2.541, 4.044, 5.045, 6.546, 7.547, 9.05, 10.052, 11.554, 12.555, 14.057, 15.058, 16.561, 17.563, 19.065, 20.066, 21.568, 23.07, 24.072, 25.073, 25.574, 26.576, 28.076, 29.077, 30.578, 31.58, 33.082, 34.082, 35.584, 36.586, 38.089, 39.089, 39.589, 40.59, 41.592, 42.093, 43.094, 44.096, 45.587]
    y-axis "Memory MiB" 0 --> 500
    line [12.18, 94.16, 123.48, 132.15, 156.83, 168.18, 159.98, 196.46, 192.07, 177.83, 179.79, 174.36, 151.94, 183.77, 202.8, 149.76, 156.2, 182.32, 165.58, 152.21, 276.63, 249.08, 220.16, 158.97, 154.53, 203.28, 176.29, 157.34, 151.59, 164.68, 202.05, 178.12, 163.8, 163.8, 185.47, 187.4, 193.96, 164.11, 190.8, 0]
    line [9.2, 90.8, 120.08, 128.89, 153.97, 164.82, 156.57, 192.6, 189.97, 173.78, 176.73, 171, 148.51, 180.48, 199.39, 146.33, 152.77, 178.95, 162.08, 148.64, 273.46, 244.98, 216.62, 155.33, 151.32, 199.36, 172.56, 153.63, 147.83, 161.04, 198.65, 174.42, 160.1, 160.1, 181.78, 184.18, 190.52, 160.4, 187.14, 0]
Loading

HEAD

xychart-beta
    title "HEAD CPU"
    x-axis "Elapsed seconds" [1.547, 3.05, 4.051, 4.552, 5.553, 6.054, 7.556, 9.057, 10.559, 12.06, 14.062, 15.565, 17.065, 18.567, 20.069, 21.57, 23.072, 24.074, 24.575, 26.076, 27.578, 29.087, 30.601, 32.103, 33.605, 35.111, 36.613, 38.116, 39.616, 41.619, 43.119, 44.621, 46.123, 47.626, 49.128, 50.63, 52.13, 53.632]
    y-axis "CPU percent" 0 --> 200
    line [65.82, 131.79, 141.93, 117.85, 155.92, 165.9, 155.83, 93.97, 158, 57.95, 63.96, 143.7, 39.97, 91.91, 57.91, 37.97, 2, 0, 5.99, 51.99, 41.93, 93.76, 136.43, 109.88, 101.91, 149.6, 167.77, 127.71, 40.02, 127.8, 28, 133.79, 95.87, 0, 3.99, 139.8, 133.97, 133.83]
Loading
xychart-beta
    title "HEAD memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.045, 1.547, 3.05, 4.051, 4.552, 5.553, 6.054, 7.556, 9.057, 10.559, 12.06, 14.062, 15.565, 17.065, 18.567, 20.069, 21.57, 23.072, 24.074, 24.575, 26.076, 27.578, 29.087, 30.601, 32.103, 33.605, 35.111, 36.613, 38.116, 39.616, 41.619, 43.119, 44.621, 46.123, 47.626, 49.128, 50.63, 52.13, 53.632, 55.084]
    y-axis "Memory MiB" 0 --> 500
    line [12.18, 93.79, 130.94, 161.61, 127.44, 155.17, 164.85, 175.02, 163.02, 168.81, 168.5, 166.54, 166.43, 143.97, 169.56, 195.38, 142.42, 140.29, 140.29, 140.28, 149.34, 166.88, 148.48, 162.91, 292.89, 209.1, 166.55, 163.31, 169.08, 150.14, 160.47, 151.15, 211.66, 169.63, 172.04, 158.54, 183.06, 150.63, 183.82, 0]
    line [9.26, 90.61, 127.93, 158.37, 124.14, 151.85, 161.79, 171.75, 159.69, 165.56, 165.5, 163.16, 163, 140.62, 166.59, 192.13, 139.12, 137.04, 136.99, 137.01, 146.21, 163.64, 145.49, 159.73, 289.69, 205.82, 163.34, 160.14, 165.8, 146.72, 157.35, 147.76, 208.55, 166.24, 168.65, 155.15, 179.44, 147.21, 180.35, 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.87 s 19.86 s -0.01 s (-0.05%)
Estimated CPU 0.44 s 0.44 s 0.00 s (0.00%)
Peak PSS 66.56 MiB 66.70 MiB +0.14 MiB (+0.21%)
Peak RSS 69.65 MiB 69.70 MiB +0.05 MiB (+0.08%)
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

github-actions Bot commented Oct 13, 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.00%
Frontend differential ❌ 1,019/1,020 cases matched; 1 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.00%

Package and image size

Metric Base HEAD Delta Delta %
Raw binary 150.47 MiB 150.47 MiB 0 B 0.00%
Stripped binary 103.94 MiB 103.94 MiB 0 B 0.00%
gzip binary 51.74 MiB 51.74 MiB +833 B +0.001535%
Rootfs 157.37 MiB 157.37 MiB 0 B 0.00%
gzip rootfs 60.68 MiB 60.68 MiB −194 B −0.000305%

Startup latency and PSS

Case Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta
Serve ready 27.23 ms 27.75 ms +0.52 ms 3.88 MiB 5.00 MiB +1.12 MiB
CDP first page 50.08 ms 51.13 ms +1.05 ms 4.28 MiB 4.19 MiB −87.00 KiB
CDP warm page 11.76 ms 12.59 ms +0.83 ms 49.22 MiB 49.54 MiB +335.00 KiB
CLI about:blank 14.44 ms 14.49 ms +0.05 ms 1.41 MiB 4.55 MiB +3.14 MiB
CLI local JS 20.19 ms 19.38 ms −0.81 ms 4.64 MiB 2.85 MiB −1.78 MiB

Concurrency matrix

Concurrency Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta HEAD failures Unstable B/H
1 19.14 ms 18.03 ms −1.11 ms 694.00 KiB 696.00 KiB +2.00 KiB 0 0/0
5 20.97 ms 20.33 ms −0.64 ms 12.89 MiB 18.38 MiB +5.49 MiB 0 0/0
10 21.35 ms 20.21 ms −1.14 ms 27.50 MiB 22.93 MiB −4.56 MiB 0 0/0
25 21.81 ms 21.50 ms −0.31 ms 15.71 MiB 13.06 MiB −2.65 MiB 0 0/0
100 21.46 ms 21.96 ms +0.49 ms 27.58 MiB 12.84 MiB −14.73 MiB 0 0/0
Frontend differential — ❌ 1,019/1,020 cases matched; 1 issues
Match DOM mismatch Diagnostic mismatch Moli error Reference error Infrastructure error Mismatched frames Duration
0 0 0 0 1 0 0 4m 17.90s

First failing cases

  • react/service-worker-cache-boundaries/registration-ready-controller — reference_error · Chromium error fixture did not become ready: {'id': 'react/service-worker-cache-boundaries/registration-ready-controller', 'phase': 'timeout', 'observed': {'id': 'react/servic
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.42 ms 26.44 ms
Chromium 8 8 47/47 278.86 ms 90.63 ms
Operation p50 Chromium Moli Delta Delta %
navigate 44.62 ms 5.91 ms −38.71 ms −86.76%
observe 0.76 ms 1.07 ms +0.31 ms +40.83%
fill 3.91 ms 3.89 ms −0.02 ms −0.55%
click 4.80 ms 4.39 ms −0.42 ms −8.65%
Idle-resource episode Peak RSS Peak PSS Average CPU Peak CPU Peak processes Sampler
Moli 65.79 MiB 64.14 MiB 0.84% 10.00% 1 ✅
Chromium 1325.42 MiB 433.56 MiB 2.53% 98.41% 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.89 ms 19.64 ms 693.00 KiB
Long-lived CDP session 13 0 18.02 ms 18.55 ms —
CDP smoke — ✅ 52/52 groups passed; 621 scenarios

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

Slowest group Scenarios Duration Status
scrollbar-visibility 22 14.35 s ✅
target-lifecycle 24 11.40 s ✅
chromium-cdp 56 9.24 s ✅
dom-input 27 9.16 s ✅
multi-page 45 8.28 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 Oct 13, 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 7a36b6a63f → HEAD db61fe8234; benchmark order: head-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 480.1 s 509.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 263.0 MiB 264.0 MiB +1.0 MiB
Periodic peak PSS 260.3 MiB 260.3 MiB +0.0 MiB
RSS · first 10 avg 167.8 MiB 177.2 MiB +9.4 MiB
RSS · last 10 avg 185.5 MiB 153.5 MiB -32.1 MiB
RSS · last − first window +17.7 MiB -23.8 MiB -41.5 MiB
RSS · warm slope / 100 nav +7.3 MiB -19.4 MiB -26.7 MiB
PSS · first 10 avg 164.5 MiB 173.8 MiB +9.3 MiB
PSS · last 10 avg 182.7 MiB 150.5 MiB -32.2 MiB
PSS · last − first window +18.2 MiB -23.3 MiB -41.5 MiB
PSS · warm slope / 100 nav +7.5 MiB -19.2 MiB -26.7 MiB
Peak file descriptors 60 64 4
Peak threads 29 31 2

HEAD memory by 50-navigation quarter

HEAD range Avg RSS Final RSS Peak RSS Avg PSS Final PSS Peak FD
1–50 175.5 MiB 165.3 MiB 236.6 MiB 172.2 MiB 161.6 MiB 52
51–100 174.8 MiB 121.0 MiB 233.7 MiB 171.5 MiB 117.5 MiB 54
101–150 163.9 MiB 132.1 MiB 222.3 MiB 160.4 MiB 129.0 MiB 54
151–200 150.4 MiB 146.8 MiB 194.8 MiB 147.5 MiB 143.8 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.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

The Web Fetch portions of this PR are superseded by #1501. This PR remains open because it also contains an independent PermissionStatus EventTarget fix that is outside #1501's scope; closing it now would discard that unrelated fix.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Superseded cleanly by two scoped PRs:

No unique code remains in this mixed PR.

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