Skip to content

fix(navigation): keep hash setters within the current document - #1786

Merged
ldm0 merged 2 commits into
mainfrom
fix/location-hash-same-document-20261021
Oct 21, 2026
Merged

ldm0 merged 2 commits into
mainfrom
fix/location-hash-same-document-20261021

Conversation

@ldm0

@ldm0 ldm0 commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Clearing Location.hash could enter cross-document navigation and replace srcdoc Documents. Fix fragment construction and equality directly in the setter: retain an empty fragment when clearing a nonempty hash, compare encoded fragments, and treat absent and empty fragments as equivalent for no-op assignments. This follows the Location.hash setter steps.

Reuse the existing same-document navigation route and remove the added navigate_location_hash helper and hash_setter routing options. The final production change is confined to the setter. Tests cover empty/absent fragment no-ops without history or navigation events, encoded-fragment equality, and srcdoc Document/origin identity without child replacement tasks.

Fixes the same-document regression introduced in 536fa76aee97f8cae5922a72aaf06381e8ad8fd6 (#1701). This PR is independent of the other runtime splits from #1726.

Validation on a0d9b3ae81d:

  • cargo fmt --all
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo nextest run --no-fail-fast: 20,437 passed, 18 skipped, using default machine parallelism.

The final PR changes one production file and one test file; no documentation or aggregate Cases snapshots are included.

Clearing Location.hash produced a URL without a target fragment and
entered the full-URL navigation path, interrupting load/harness completion and
replacing srcdoc documents. Preserve explicit hash-setter intent in the shared
Location route and compare encoded fragments before taking any navigation.

Keep the main branch's full href/assign no-fragment behavior and retired-facade
checks. Cover top-level hash removal, canonical hash reassignment, and srcdoc
Document identity, origin and NavigateEvent metadata.

Fixes: 536fa76 (PR #1701)

Validate this independent patch on main ce0781f:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast
     Summary [ 493.678s] 20436 tests run: 20436 passed (9 slow), 18 skipped

Original-commit: 9446bea
@github-actions

github-actions Bot commented Oct 21, 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 ce0781f2ad → HEAD a0d9b3ae81; benchmark order: base-first; workflow: success.

Session resilience

Metric Base HEAD
Attempted / planned 200 / 200 200 / 200
Direct observable pass 199 / 200 200 / 200
Failures / recovered 1 / 1 0 / 0
Recovery failures 0 0
Lifecycle order violations 0 0
Network order violations 0 0
Wall time 575.8 s 532.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 220.0 MiB 242.3 MiB +22.4 MiB
Periodic peak PSS 216.6 MiB 239.0 MiB +22.4 MiB
RSS · first 10 avg 142.0 MiB 179.6 MiB +37.5 MiB
RSS · last 10 avg 169.6 MiB 193.1 MiB +23.5 MiB
RSS · last − first window +27.6 MiB +13.5 MiB -14.1 MiB
RSS · warm slope / 100 nav +0.3 MiB +8.9 MiB +8.6 MiB
PSS · first 10 avg 138.4 MiB 176.5 MiB +38.1 MiB
PSS · last 10 avg 166.3 MiB 190.0 MiB +23.7 MiB
PSS · last − first window +27.9 MiB +13.5 MiB -14.4 MiB
PSS · warm slope / 100 nav +0.4 MiB +9.4 MiB +9.0 MiB
Peak file descriptors 60 58 -2
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 174.1 MiB 150.4 MiB 210.8 MiB 170.5 MiB 147.0 MiB 54
51–100 182.9 MiB 132.7 MiB 219.7 MiB 179.6 MiB 129.4 MiB 53
101–150 189.5 MiB 160.0 MiB 238.1 MiB 186.0 MiB 156.5 MiB 54
151–200 187.1 MiB 198.0 MiB 226.1 MiB 184.3 MiB 194.9 MiB 54

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

github-actions Bot commented Oct 21, 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.000080%
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; 622 scenarios
WebMainBench ✅ 545/545 completed; 0 unexpected failures
Release regression — ✅ HEAD/base failures 0/0; raw binary −0.000080%

Package and image size

Metric Base HEAD Delta Delta %
Raw binary 153.42 MiB 153.42 MiB −128 B −0.000080%
Stripped binary 106.66 MiB 106.66 MiB 0 B 0.00%
gzip binary 52.84 MiB 52.85 MiB +130 B +0.000235%
Rootfs 160.32 MiB 160.32 MiB 0 B 0.00%
gzip rootfs 61.90 MiB 61.90 MiB +1.16 KiB +0.001823%

Startup latency and PSS

Case Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta
Serve ready 27.16 ms 27.11 ms −0.05 ms 4.08 MiB 4.10 MiB +28.50 KiB
CDP first page 50.02 ms 50.21 ms +0.19 ms 3.81 MiB 4.18 MiB +379.50 KiB
CDP warm page 12.02 ms 11.92 ms −0.11 ms 50.54 MiB 50.59 MiB +47.50 KiB
CLI about:blank 37.40 ms 38.61 ms +1.22 ms 4.08 MiB 3.16 MiB −941.00 KiB
CLI local JS 42.18 ms 42.75 ms +0.58 ms 3.17 MiB 4.00 MiB +853.00 KiB

Concurrency matrix

Concurrency Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta HEAD failures Unstable B/H
1 41.66 ms 42.05 ms +0.39 ms 628.00 KiB 623.00 KiB −5.00 KiB 0 0/0
5 42.17 ms 42.88 ms +0.71 ms 4.36 MiB 4.10 MiB −269.00 KiB 0 0/0
10 42.07 ms 45.66 ms +3.58 ms 3.16 MiB 4.15 MiB +1012.00 KiB 0 0/0
25 42.72 ms 45.50 ms +2.78 ms 5.42 MiB 3.45 MiB −1.97 MiB 0 0/0
100 41.04 ms 43.55 ms +2.51 ms 2.40 MiB 6.11 MiB +3.71 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 41.84s
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 29.11 ms 25.70 ms
Chromium 8 8 47/47 249.36 ms 80.34 ms
Operation p50 Chromium Moli Delta Delta %
navigate 40.14 ms 5.94 ms −34.21 ms −85.21%
observe 0.99 ms 0.97 ms −0.02 ms −1.64%
fill 3.23 ms 3.30 ms +0.07 ms +2.06%
click 4.14 ms 4.09 ms −0.04 ms −1.08%
Idle-resource episode Peak RSS Peak PSS Average CPU Peak CPU Peak processes Sampler
Moli 67.34 MiB 64.75 MiB 0.73% 14.01% 1 ✅
Chromium 1287.26 MiB 299.94 MiB 0.62% 14.02% 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 40.81 ms 41.50 ms 625.00 KiB
Long-lived CDP session 13 0 16.99 ms 17.76 ms —
CDP smoke — ✅ 52/52 groups passed; 622 scenarios

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

Slowest group Scenarios Duration Status
scrollbar-visibility 22 30.65 s ✅
target-lifecycle 24 17.01 s ✅
dom-input 27 13.24 s ✅
chromium-cdp 56 11.55 s ✅
multi-page 45 11.03 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 21, 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 ce0781f2ad7e → HEAD a0d9b3ae81d5; 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 41.79 s 46.40 s +4.60 s (+11.01%)
Estimated CPU 35.29 s 36.59 s +1.30 s (+3.67%)
Peak PSS 209.40 MiB 248.88 MiB +39.48 MiB (+18.86%)
Peak RSS 213.11 MiB 252.38 MiB +39.27 MiB (+18.43%)
Peak threads 26 27 +1 (+3.85%)
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.035, 2.036, 2.536, 3.538, 4.539, 6.042, 7.042, 8.042, 9.543, 10.542, 11.543, 13.043, 14.044, 15.045, 16.546, 17.547, 18.549, 20.051, 21.052, 22.053, 22.553, 23.555, 24.555, 25.557, 27.058, 28.059, 29.06, 30.561, 31.562, 32.563, 34.064, 35.065, 36.066, 37.569, 38.571, 39.572, 41.075, 41.576]
    y-axis "CPU percent" 0 --> 200
    line [2, 67.89, 33.99, 115.85, 113.9, 117.78, 131.88, 84.01, 127.95, 86.01, 38, 124.05, 22, 101.85, 107.95, 5.99, 39.93, 47.89, 117.98, 117.73, 99.94, 107.88, 105.98, 135.78, 131.89, 119.9, 99.96, 101.9, 23.99, 33.98, 39.97, 45.97, 4, 105.78, 129.86, 15.98, 129.66, 167.85]
Loading
xychart-beta
    title "Base memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.034, 1.035, 2.036, 2.536, 3.538, 4.539, 6.042, 7.042, 8.042, 9.543, 10.542, 11.543, 13.043, 14.044, 15.045, 16.546, 17.547, 18.549, 20.051, 21.052, 22.053, 22.553, 23.555, 24.555, 25.557, 27.058, 28.059, 29.06, 30.561, 31.562, 32.563, 34.064, 35.065, 36.066, 37.569, 38.571, 39.572, 41.075, 41.576, 41.795]
    y-axis "Memory MiB" 0 --> 500
    line [13.59, 62.61, 92.32, 84.39, 113.5, 135.91, 161.98, 140.93, 152.33, 136.18, 131.92, 139.49, 153.29, 135.54, 129.66, 154.96, 116.81, 120.47, 152.23, 137.3, 141.59, 213.11, 174.51, 208.59, 156.96, 155.83, 145.61, 132.73, 143.38, 133.45, 137.66, 128.78, 135.69, 124.49, 150.1, 157.76, 124.97, 166.5, 163.26, 0]
    line [10.06, 58.92, 88.11, 79.53, 110.79, 132.43, 156.1, 137.23, 148.57, 132.38, 128.3, 136.01, 149.56, 131.78, 125.84, 150.97, 113.06, 116.72, 148.16, 133.55, 140.39, 209.4, 170.82, 204.89, 153.23, 152.88, 141.88, 128.97, 139.71, 129.7, 133.91, 125.03, 132.01, 120.74, 146.71, 154.01, 121.22, 162.78, 159.61, 0]
Loading

HEAD

xychart-beta
    title "HEAD CPU"
    x-axis "Elapsed seconds" [1.037, 1.538, 2.539, 4.041, 5.042, 6.543, 8.045, 9.047, 10.549, 11.551, 13.053, 14.055, 15.558, 17.061, 18.062, 19.564, 20.566, 22.069, 23.57, 24.571, 25.571, 26.072, 27.072, 28.574, 29.574, 31.075, 32.575, 33.575, 35.078, 36.08, 37.581, 39.082, 40.082, 41.584, 42.586, 44.089, 45.09, 46.091]
    y-axis "CPU percent" 0 --> 200
    line [0, 2, 15.99, 105.83, 113.88, 135.82, 121.79, 95.86, 107.75, 127.79, 119.8, 117.79, 79.83, 125.74, 3.99, 0, 39.98, 119.75, 116.03, 133.88, 99.95, 111.88, 102.02, 79.87, 131.9, 131.91, 106.12, 114.01, 35.92, 143.86, 63.92, 0, 0, 25.98, 127.61, 13.96, 129.9, 177.72]
Loading
xychart-beta
    title "HEAD memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.036, 1.037, 1.538, 2.539, 4.041, 5.042, 6.543, 8.045, 9.047, 10.549, 11.551, 13.053, 14.055, 15.558, 17.061, 18.062, 19.564, 20.566, 22.069, 23.57, 24.571, 25.571, 26.072, 27.072, 28.574, 29.574, 31.075, 32.575, 33.575, 35.078, 36.08, 37.581, 39.082, 40.082, 41.584, 42.586, 44.089, 45.09, 46.091, 46.398]
    y-axis "Memory MiB" 0 --> 500
    line [13.59, 54.82, 54.82, 73.9, 103.63, 110.63, 119.57, 153.84, 133, 147.01, 154, 136.54, 133.09, 137.68, 137.3, 117.76, 117.81, 132.03, 164.23, 144.46, 150.43, 252.38, 234.13, 189.04, 132.26, 153.96, 150.59, 139.07, 126.85, 140.16, 196, 143.04, 129.13, 127.17, 138.45, 164.95, 126.73, 156.94, 165.25, 0]
    line [10.08, 51.18, 51.18, 70.33, 100, 107.04, 115.94, 150.1, 129.51, 143.26, 150.46, 132.79, 129.3, 133.01, 134.08, 113.95, 114, 128.21, 160.46, 140.65, 146.75, 248.88, 229.97, 185.24, 128.68, 151.44, 146.83, 135.32, 123.03, 136.36, 191.2, 139.23, 125.32, 123.36, 134.57, 161.15, 122.8, 153.16, 161.45, 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.91 s 19.87 s -0.04 s (-0.18%)
Estimated CPU 0.42 s 0.43 s +0.01 s (+2.61%)
Peak PSS 67.33 MiB 67.32 MiB -0.01 MiB (-0.01%)
Peak RSS 71.14 MiB 71.11 MiB -0.04 MiB (-0.05%)
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.

@ldm0
ldm0 merged commit 7d13c04 into main Oct 21, 2026
21 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.

1 participant