Skip to content

fix(markdown): preserve visible text and share export style observations - #1428

Closed
lanyue-llk wants to merge 6 commits into
codex/readme-web-fetch-benchmarksfrom
codex/preserve-painted-markdown-text
Closed

lanyue-llk wants to merge 6 commits into
codex/readme-web-fetch-benchmarksfrom
codex/preserve-painted-markdown-text

Conversation

@lanyue-llk

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

Copy link
Copy Markdown
Contributor

Native Markdown can omit visible white text over an image, positioned sibling or pseudo-element. The visibility adapter infers the painted background from DOM ancestors and a default white canvas, then removes text when the inferred background matches its color. DOM ancestry does not establish the actual painted backdrop.

Remove this color-only suppression and its unused helpers. Explicit display, visibility and opacity filtering remains in place. The regression scenarios cover sibling pictures, pseudo-element backgrounds and positioned backdrops, alongside controls for genuinely hidden text. Existing expectations for color-only suppression are updated to preserve the text.

Markdown export also sampled the same document through six independent style observations. Collect the required properties and visibility provenance together, remove unused color/background samples, and preserve the adapter's field layout. A large catalog scenario checks cascading styles, meaningful images, hidden controls, dynamic updates and repeated exports.

The exporter already projects finite, single-run opacity animations with a forwards fill to their bounded final state. Apply that same rule when the animation has a positive delay; a finite delay does not make the final state unbounded. The regression includes a delayed reveal and retains controls for paused, repeating, reverse, zero-duration and non-opacity animations.

This is stacked after #1380, whose branch already contains the #1337 style-aware Markdown export. The affected export does not exist on main. This PR does not update #919, add site-specific extraction, modify benchmark answers or postprocess native output. The performance change removes known repeated work; historical logs do not establish it as the sole cause of an observed export timeout.

Validation: whitespace checks passed. Format, Clippy and the test suite are delegated to the repository's normal CI; no local test suite or benchmark calls were run. Historical benchmark outputs and verdicts remain unchanged by this product patch.

PR stack

This PR is the sixth layer of the GitHub stack and targets the preceding branch directly:

main → #1334 → #1335 → #1336 → #1337 → #1380 → #1428 → #1431 → #1432

Merge from left to right. The GitHub base of #1428 is codex/readme-web-fetch-benchmarks, not #919 and not main; its Files changed view therefore contains only this layer's product fix. #919 remains a separate rebased historical combination and is not a dependency of this stack. #1429 targets main independently because it only adds reusable CI infrastructure.

@lanyue-llk lanyue-llk changed the title fix(markdown): preserve text over independently painted backgrounds fix(markdown): preserve visible text and share export style observations Oct 12, 2026
@lanyue-llk
lanyue-llk marked this pull request as draft October 12, 2026 06:28
@lanyue-llk
lanyue-llk force-pushed the codex/preserve-painted-markdown-text branch from d205d91 to d1653c6 Compare October 12, 2026 06:56
@lanyue-llk
lanyue-llk changed the base branch from codex/content-rendered-state to codex/readme-web-fetch-benchmarks October 12, 2026 06:56
@lanyue-llk
lanyue-llk force-pushed the codex/readme-web-fetch-benchmarks branch from 8a39036 to 1f99b9f Compare October 12, 2026 07:37
@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 1f99b9fee9 → HEAD 8b63b90fdd; benchmark order: base-first; workflow: success.

Session resilience

Metric Base HEAD
Attempted / planned 200 / 200 200 / 200
Direct observable pass 199 / 200 196 / 200
Failures / recovered 1 / 1 4 / 4
Recovery failures 0 0
Lifecycle order violations 0 0
Network order violations 0 0
Wall time 468.9 s 470.1 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.9 MiB 289.2 MiB +24.3 MiB
Periodic peak PSS 262.5 MiB 285.5 MiB +23.0 MiB
RSS · first 10 avg 180.2 MiB 159.0 MiB -21.3 MiB
RSS · last 10 avg 194.1 MiB 198.8 MiB +4.6 MiB
RSS · last − first window +13.9 MiB +39.8 MiB +25.9 MiB
RSS · warm slope / 100 nav +4.5 MiB +8.1 MiB +3.6 MiB
PSS · first 10 avg 176.3 MiB 155.4 MiB -21.0 MiB
PSS · last 10 avg 190.7 MiB 195.3 MiB +4.7 MiB
PSS · last − first window +14.3 MiB +40.0 MiB +25.7 MiB
PSS · warm slope / 100 nav +4.6 MiB +8.2 MiB +3.6 MiB
Peak file descriptors 58 59 1
Peak threads 29 29 0

HEAD memory by 50-navigation quarter

HEAD range Avg RSS Final RSS Peak RSS Avg PSS Final PSS Peak FD
1–50 178.8 MiB 161.4 MiB 248.9 MiB 175.2 MiB 157.7 MiB 55
51–100 187.0 MiB 177.8 MiB 228.0 MiB 183.4 MiB 173.9 MiB 53
101–150 191.2 MiB 167.2 MiB 227.6 MiB 187.4 MiB 163.6 MiB 54
151–200 194.7 MiB 197.8 MiB 246.3 MiB 191.3 MiB 194.3 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.011257%
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.011257%

Package and image size

Metric Base HEAD Delta Delta %
Raw binary 149.03 MiB 149.02 MiB −17.18 KiB −0.011257%
Stripped binary 102.66 MiB 102.65 MiB −16.00 KiB −0.015220%
gzip binary 51.15 MiB 51.15 MiB −3.20 KiB −0.006102%
Rootfs 155.94 MiB 155.92 MiB −20.00 KiB −0.012525%
gzip rootfs 60.05 MiB 60.05 MiB −6.71 KiB −0.010905%

Startup latency and PSS

Case Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta
Serve ready 27.58 ms 27.29 ms −0.29 ms 4.67 MiB 4.30 MiB −382.50 KiB
CDP first page 53.33 ms 51.26 ms −2.07 ms 5.26 MiB 3.78 MiB −1.48 MiB
CDP warm page 12.90 ms 12.16 ms −0.74 ms 49.77 MiB 49.28 MiB −505.00 KiB
CLI about:blank 16.33 ms 15.90 ms −0.42 ms 3.75 MiB 2.63 MiB −1.12 MiB
CLI local JS 20.19 ms 19.36 ms −0.83 ms 3.06 MiB 2.15 MiB −928.50 KiB

Concurrency matrix

Concurrency Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta HEAD failures Unstable B/H
1 18.50 ms 17.97 ms −0.53 ms 562.00 KiB 566.00 KiB +4.00 KiB 0 0/0
5 21.05 ms 21.75 ms +0.71 ms 22.15 MiB 27.26 MiB +5.12 MiB 0 0/0
10 21.17 ms 20.73 ms −0.44 ms 26.82 MiB 27.39 MiB +583.50 KiB 0 0/0
25 20.78 ms 20.52 ms −0.26 ms 27.65 MiB 13.20 MiB −14.46 MiB 0 0/0
100 20.85 ms 20.58 ms −0.28 ms 12.49 MiB 27.42 MiB +14.93 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 16.94s
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.48 ms 26.35 ms
Chromium 8 8 47/47 274.58 ms 90.97 ms
Operation p50 Chromium Moli Delta Delta %
navigate 45.41 ms 6.15 ms −39.26 ms −86.45%
observe 1.00 ms 0.90 ms −0.10 ms −10.34%
fill 4.50 ms 3.67 ms −0.84 ms −18.55%
click 3.41 ms 4.26 ms +0.85 ms +25.03%
Idle-resource episode Peak RSS Peak PSS Average CPU Peak CPU Peak processes Sampler
Moli 65.68 MiB 62.49 MiB 0.72% 10.00% 1 ✅
Chromium 1288.66 MiB 315.85 MiB 2.46% 99.23% 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 19.00 ms 21.07 ms 595.00 KiB
Long-lived CDP session 13 0 18.62 ms 19.08 ms —
CDP smoke — ✅ 52/52 groups passed; 621 scenarios

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

Slowest group Scenarios Duration Status
scrollbar-visibility 22 20.41 s ✅
target-lifecycle 24 12.45 s ✅
dom-input 27 10.34 s ✅
chromium-cdp 56 9.88 s ✅
multi-page 45 9.20 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

Copy link
Copy Markdown

Spider Bench A/B

✅ All benchmark browser service runs completed; results are informational.

Public HEAD: 189 / 240 rows; 39 / 48 sites produced rows; 9 unexpected empty sites.

✅ Deterministic fixture contract is clean.

Common ancestor 1f99b9fee9dd → HEAD 8b63b90fdd5b; benchmark order: base-first; workflow: success.

Public 48-site run · informational

Metric Base HEAD Δ
Run status success success —
Extracted rows / contract 184 / 240 189 / 240 +5 (+2.72%)
Contract fill 76.67% 78.75% +2.08 pp (+2.71%)
Sites with rows 38 / 48 39 / 48 +1 (+2.63%)
Sites meeting row contract 36 / 48 37 / 48 +1 (+2.78%)
Unexpected empty sites 10 9 -1 (-10.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: 38; HTTP error + rows: 1; empty: 6; HTTP error + empty: 1; snapshot error + empty: 2 —
Observed duration 48.42 s 44.48 s -3.94 s (-8.14%)
Estimated CPU 48.76 s 47.52 s -1.25 s (-2.56%)
Peak PSS 282.44 MiB 275.06 MiB -7.38 MiB (-2.61%)
Peak RSS 296.08 MiB 277.43 MiB -18.64 MiB (-6.30%)
Peak threads 26 26 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 32 / 40 +5
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.037, 1.538, 2.54, 3.542, 4.043, 5.045, 5.545, 6.546, 8.047, 9.548, 11.05, 12.052, 13.554, 15.055, 16.057, 17.559, 19.06, 20.062, 21.564, 23.065, 24.568, 25.568, 27.07, 28.572, 29.573, 31.074, 32.576, 33.576, 35.076, 36.578, 37.579, 39.081, 40.582, 42.084, 43.084, 44.585, 46.086, 47.087]
    y-axis "CPU percent" 0 --> 500
    line [2, 91.79, 107.77, 123.76, 147.75, 123.7, 181.94, 157.74, 165.82, 209.95, 179.76, 147.59, 103.91, 113.85, 87.86, 3.99, 109.86, 129.81, 11.97, 4, 123.83, 120, 143.84, 109.87, 103.81, 145.78, 147.81, 143.99, 126.03, 83.89, 37.96, 145.88, 84.04, 3.99, 74.02, 103.97, 27.98, 135.8]
Loading
xychart-beta
    title "Base memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.036, 1.037, 1.538, 2.54, 3.542, 4.043, 5.045, 5.545, 6.546, 8.047, 9.548, 11.05, 12.052, 13.554, 15.055, 16.057, 17.559, 19.06, 20.062, 21.564, 23.065, 24.568, 25.568, 27.07, 28.572, 29.573, 31.074, 32.576, 33.576, 35.076, 36.578, 37.579, 39.081, 40.582, 42.084, 43.084, 44.585, 46.086, 47.087, 48.424]
    y-axis "Memory MiB" 0 --> 500
    line [12.52, 62.09, 93.77, 121.77, 126.28, 138.91, 157.05, 177.14, 186.21, 176.63, 176.19, 185.32, 169.94, 188, 167.86, 158.4, 147, 159.37, 159.58, 148.73, 143.4, 186.06, 187.5, 164.27, 296.08, 206.02, 157.02, 164.18, 202.63, 176.53, 159.32, 154.29, 205.57, 178.39, 166.27, 183.64, 204, 158.24, 176.09, 0]
    line [9.97, 59.31, 91.04, 119.11, 123.5, 136.13, 154.34, 174.38, 183.44, 173.87, 173.41, 182.54, 167.16, 184.78, 164.67, 155.17, 143.79, 156.1, 156.48, 145.46, 140.21, 182.87, 184.65, 161.09, 282.44, 202.87, 152.9, 161.01, 199.61, 173.35, 156.08, 151.06, 202.54, 175.15, 163.02, 180.05, 198.74, 155, 172.84, 0]
Loading

HEAD

xychart-beta
    title "HEAD CPU"
    x-axis "Elapsed seconds" [1.037, 2.539, 3.539, 5.043, 6.044, 7.546, 8.548, 10.049, 11.05, 12.551, 13.553, 15.055, 16.056, 17.557, 18.559, 19.56, 20.06, 21.061, 22.563, 23.564, 24.566, 25.066, 26.066, 27.067, 28.57, 29.57, 31.071, 32.071, 33.573, 34.574, 36.075, 37.077, 38.579, 39.58, 41.08, 42.081, 43.584, 44.085]
    y-axis "CPU percent" 0 --> 500
    line [2, 127.78, 125.92, 95.75, 171.97, 161.73, 99.83, 159.91, 69.88, 61.92, 131.84, 105.88, 89.93, 35.96, 51.85, 0, 4, 159.85, 91.91, 111.95, 105.8, 109.82, 110.18, 137.92, 45.92, 160, 135.91, 103.99, 125.85, 23.99, 135.96, 125.72, 17.97, 124, 169.87, 83.88, 139.69, 193.59]
Loading
xychart-beta
    title "HEAD memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.037, 1.037, 2.539, 3.539, 5.043, 6.044, 7.546, 8.548, 10.049, 11.05, 12.551, 13.553, 15.055, 16.056, 17.557, 18.559, 19.56, 20.06, 21.061, 22.563, 23.564, 24.566, 25.066, 26.066, 27.067, 28.57, 29.57, 31.071, 32.071, 33.573, 34.574, 36.075, 37.077, 38.579, 39.58, 41.08, 42.081, 43.584, 44.085, 44.484]
    y-axis "Memory MiB" 0 --> 500
    line [12.67, 62.46, 125.87, 135.52, 151.44, 182.59, 199.26, 180.25, 190, 166.07, 188.86, 195.48, 152.53, 156.3, 166.86, 159.26, 153.01, 152.09, 173.6, 161.45, 180.15, 212.04, 277.43, 195.55, 207.33, 157.77, 185.86, 168.58, 158.05, 163.15, 160.5, 207.1, 202.84, 167.74, 194.67, 196.73, 171.48, 202.61, 212.86, 0]
    line [9.72, 59.24, 122.58, 132.31, 148.43, 179.48, 195.17, 176.99, 186.76, 162.82, 185.23, 192.17, 149.24, 153.24, 163.58, 156, 149.75, 148.83, 171.04, 158.32, 176.97, 208.78, 275.06, 192.33, 204.07, 154.49, 182.89, 165.3, 154.73, 159.86, 157.27, 203.81, 199.59, 164.45, 191.38, 193.45, 168.21, 198.84, 209.58, 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.88 s 19.87 s -0.01 s (-0.03%)
Estimated CPU 0.45 s 0.42 s -0.03 s (-6.21%)
Peak PSS 66.85 MiB 66.95 MiB +0.11 MiB (+0.16%)
Peak RSS 69.88 MiB 70.11 MiB +0.23 MiB (+0.32%)
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.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Closing after the consolidation audit. This only repairs regressions introduced by the earlier #1337 visibility stack, which is not being adopted. It has no independent role in the minimal #1501 fix.

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