Repository navigation
fix(renderer): use native prototypes for browser-created objects - #1585
Conversation
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.537, 3.038, 4.538, 5.54, 7.042, 8.542, 10.043, 11.545, 13.046, 14.047, 15.55, 17.051, 18.554, 20.055, 21.056, 21.557, 22.557, 24.059, 25.561, 27.063, 28.565, 30.065, 31.067, 32.57, 34.072, 35.574, 37.076, 38.577, 39.578, 41.079, 41.579, 42.581, 44.082, 45.584, 47.086, 48.088, 49.59]
y-axis "CPU percent" 0 --> 500
line [119.88, 133.86, 135.8, 165.78, 201.72, 155.78, 157.94, 175.48, 155.75, 143.84, 95.92, 127.84, 133.87, 81.97, 77.85, 0, 4, 0, 0, 155.59, 119.83, 149.98, 111.97, 101.81, 117.79, 113.74, 152.05, 77.9, 7.99, 7.99, 135.85, 119.89, 83.89, 13.98, 61.92, 111.78, 21.97, 113.82]
xychart-beta
title "Base memory: RSS then PSS"
x-axis "Elapsed seconds" [0.035, 1.537, 2.537, 3.038, 4.538, 5.54, 7.042, 8.542, 10.043, 11.545, 13.046, 14.047, 15.55, 17.051, 18.554, 20.055, 21.056, 21.557, 22.557, 24.059, 25.561, 27.063, 28.565, 30.065, 31.067, 32.57, 34.072, 35.574, 37.076, 38.577, 39.578, 41.079, 41.579, 42.581, 44.082, 45.584, 47.086, 48.088, 49.59, 50.677]
y-axis "Memory MiB" 0 --> 500
line [12.41, 115.11, 123.48, 133.07, 142.08, 178.24, 225.22, 234.82, 185.22, 191.15, 171.34, 169.54, 191.98, 158.13, 161.71, 178.52, 149, 147.29, 147.29, 151.79, 174.32, 160.28, 175.74, 212.21, 215.39, 158.3, 187.38, 157.55, 165.9, 155.92, 156.99, 213.42, 264.56, 263.05, 187.02, 184.13, 205.15, 171.26, 173.16, 0]
line [9.08, 111.41, 119.82, 129.79, 138.43, 174.65, 221.64, 231.09, 180.7, 187.46, 167.55, 165.92, 187.93, 154.4, 157.98, 174.79, 145.27, 143.56, 143.56, 148.06, 170.75, 156.6, 172.46, 208.53, 211.66, 154.58, 183.7, 153.67, 162.37, 152.21, 153.27, 209.7, 260.84, 259.6, 183.4, 180.66, 201.49, 167.55, 169.46, 0]
HEADxychart-beta
title "HEAD CPU"
x-axis "Elapsed seconds" [1.538, 2.54, 3.041, 4.043, 5.545, 7.047, 8.549, 9.549, 11.052, 12.553, 14.056, 15.057, 16.56, 18.062, 19.564, 20.565, 22.068, 23.57, 24.571, 25.072, 26.073, 27.576, 29.078, 30.58, 31.581, 33.083, 34.585, 36.087, 37.088, 38.589, 40.092, 41.593, 42.595, 44.096, 45.599, 46.099, 47.1, 48.101]
y-axis "CPU percent" 0 --> 200
line [131.79, 141.63, 131.8, 87.82, 157.75, 167.87, 133.65, 177.88, 63.94, 69.95, 121.88, 27.95, 83.93, 17.98, 57.95, 137.81, 95.88, 139.78, 109.96, 113.84, 125.76, 65.89, 147.94, 127.7, 77.89, 133.97, 13.99, 0, 2, 103.92, 73.79, 7.99, 15.98, 109.84, 115.88, 187.69, 69.99, 121.87]
xychart-beta
title "HEAD memory: RSS then PSS"
x-axis "Elapsed seconds" [0.035, 1.538, 2.54, 3.041, 4.043, 5.545, 7.047, 8.549, 9.549, 11.052, 12.553, 14.056, 15.057, 16.56, 18.062, 19.564, 20.565, 22.068, 23.57, 24.571, 25.072, 26.073, 27.576, 29.078, 30.58, 31.581, 33.083, 34.585, 36.087, 37.088, 38.589, 40.092, 41.593, 42.595, 44.096, 45.599, 46.099, 47.1, 48.101, 49.54]
y-axis "Memory MiB" 0 --> 500
line [12.37, 115.07, 113.01, 136.8, 132.06, 197.8, 170.17, 182, 172.21, 151.52, 173.81, 161.55, 147.44, 162.96, 196.88, 152.85, 176.49, 167.61, 177.4, 292.89, 208.08, 216.05, 155.91, 189.29, 172.6, 156.45, 173.43, 155.75, 158.67, 157.86, 171.83, 170.14, 153.27, 151.93, 161.65, 181.68, 171.91, 154.64, 173.71, 0]
line [9.12, 111.5, 109.48, 133.21, 128.45, 190.84, 165.32, 178.4, 168.61, 147.91, 170.21, 158.47, 143.81, 159.39, 193.3, 149.22, 172.96, 163.99, 173.87, 289.05, 204.5, 212.54, 152.31, 185.96, 169.01, 152.85, 169.98, 152.16, 155.08, 154.28, 168.35, 166.61, 149.68, 148.23, 158.14, 178, 168.71, 151.01, 170.09, 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.00%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; 621 scenariosWorkers: 4 · cumulative group time: 193.08 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. |
431cf7b to
6473dd4
Compare
Problem
Replacing public constructors could change or break browser-created CustomElementRegistry, MediaError and HTMLAllCollection objects. Custom-element definitions also missed the supported move callback when the public Element constructor was replaced.
Change
Use the saved realm-native interface prototypes and existing callback collection. Keep author-visible constructor replacement separate from the native objects the browser creates; cover both live and detached document collections.
This preserves existing native object behavior and callback support. It adds no new browser interface.
Reproduce and verify
Save
HTMLAllCollection.prototype, replacewindow.HTMLAllCollection, then readdocument.alland a detached document's collection. Both must keep the saved prototype and working native methods. Companion fixtures replace CustomElementRegistry, Element and MediaError before exercising native construction and callbacks.cargo nextest run --locked -p moli-renderer-v8 --lib -E 'test(public_constructor_replacement) | test(custom_element_move_callback_support)' --no-fail-fastBefore extraction, this source passed
cargo fmt --all, workspace/all-target/all-feature Clippy with-D warnings, and the full workspace nextest suite (20,140 passed, 17 skipped). This unit has no source changes since that validation. The PR CI checks its extraction onto mainbe610b8fe.Regression fixtures:
media_error_uses_the_native_prototype_after_public_constructor_replacementcustom_elements_uses_realm_intrinsics_after_public_constructor_replacementcustom_element_move_callback_support_uses_the_native_element_interfacehtml_all_collections_ignore_public_constructor_replacementDependencies
Independent change targeting
main; no other open PR is required. Extracted from #1501. Review map and sibling PRs.