Skip to content

Update README.md#14

Merged
5133n merged 1 commit intomasterfrom
deferred_async
Feb 23, 2023
Merged

Update README.md#14
5133n merged 1 commit intomasterfrom
deferred_async

Conversation

@5133n
Copy link
Copy Markdown
Contributor

@5133n 5133n commented Feb 23, 2023

No description provided.

@5133n 5133n merged commit b377ab2 into master Feb 23, 2023
@frstrtr frstrtr deleted the deferred_async branch March 6, 2026 10:10
frstrtr added a commit that referenced this pull request Apr 20, 2026
Builds the visual-regression infrastructure the Explorer spec §11
anchors against the (freshly-tagged) explorer-baseline-v0 on master
@ d95779a. Opens dashboard.html in both modes against a mock c2pool
server, screenshots #defrag-canvas in each, diffs with pixelmatch,
reports delta vs threshold. Current measured delta: 5.02%, passing
the 7% initial threshold with documented reduction path.

Also tags master:

  git tag -a explorer-baseline-v0 master  (annotated)

So every future commit on the explorer-module branch can pixel-diff
against a fixed anchor — spec §11 step 1.

Harness layout (tests/visual/)

- fixtures/generate.mjs      Seeded mulberry32 RNG (seed=0xC2FFEE),
                             deterministic 200-share chain across
                             the full V36-native / V35→V36 / V35-
                             legacy / stale / dead / fee / block mix.
                             Miner 'XMINEADDRESS' triggers mine-
                             colour branches. Emits window.json,
                             tip.json, stats.json, merged_payouts.json.

- mock-server.mjs            Node http server listening on 127.0.0.1
                             :18082. Serves the fixtures for the
                             endpoints dashboard.html hits. SSE
                             stream is keep-alive-only — no tip
                             pushes during capture window, so the
                             screenshots are static. Empty-object
                             replies for non-Explorer endpoints
                             (/peers, /uptime, /stratum_stats, …)
                             keep the rest of dashboard.html from
                             error-cascading.

- capture.mjs                puppeteer-core against the system
                             Chrome (/usr/bin/google-chrome by
                             default; CHROME_BIN overrides).
                             1280x900 viewport, dpr 1, font-hinting
                             off. Goes to dashboard.html twice:
                               inline  → no flag
                               bundled → ?new-explorer=1
                             waits for #defrag-canvas + a 3 s
                             render-settle pause, then screenshots
                             that element only. Stable sizing: same
                             fixture → same cols/rows → identically-
                             sized canvas on both paths.

- diff.mjs                   pngjs + pixelmatch. Writes out/diff.png
                             (red-highlighted delta), reports
                             {pixels, fraction, threshold}, exits
                             non-zero on exceed. Threshold: 0.07
                             default (7%), override via
                             THRESHOLD env or positional arg.

- run.sh                     Orchestrator: generate → start server
                             → capture → diff → kill server. EXIT
                             trap guarantees cleanup.

- README.md                  Design + measured-delta table + three
                             known divergence sources and how
                             future increments close them.

devDeps: puppeteer-core@^23, pixelmatch@^6, pngjs@^7. No browser
download — uses the system Chrome. Install footprint ~5 MB total.

npm run visual               Runs the whole pipeline. Exits non-zero
                             on threshold exceed.

.gitignore                   tests/visual/out/ ignored — screenshots
                             regenerate on every run. Fixture JSON
                             and scripts are tracked.

Status

- npm run visual             PASSES with 5.02% delta vs 7% threshold
- Fixtures:                  200 shares, 12 miners, 2 blocks
- Tests unchanged:           192/192 still green
- Bundle sizes:              shared-core 25.1 KB, sharechain-explorer
                             48.3 KB — unchanged
- explorer-baseline-v0 tag   Annotated, points at master @ d95779a,
                             local-only (not pushed)

Next tightening passes in priority order:

  Phase B #11 particles + cards  Expected to flatten row-boundary
                                 AA differences (source #2 in README)
                                 → 2-3% delta.
  Cell border pass in grid-paint Match inline's fill-then-stroke
                                 order (source #1) → 1% delta.
  Final parity audit             Pin threshold at 0.1%, bake into CI.
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