Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.