Repository navigation
feat(demo): browser benchmark page comparing proj-wasm and proj4js - #11
Merged
Merged
Conversation
- demo/benchmark.html with its own portal card: the same point sequence and the same CRS rows go forward and back through proj-wasm (single-threaded browser runtime) and proj4js. The page shows elapsed time, success and failure counts, round-trip error in metres, the largest difference between the two engines' forward output, and the message behind every failure. Work larger than the point set cycles back to the start. - CRS scope: EPSG:3857, JGD2000 and Tokyo plane rectangular I-XIX, JGD2000 UTM 51-55 and the historical city-plan grids, selectable as all, one group or one CRS. Rows are found through the Atlas search around the whole bundled dataset, so they do not depend on the points of the run; an id that cannot be found stays in the table as not found. - A one-click contrast (engine-coverage): plane rectangular IX, where both engines succeed, against historical grid zone B, which only proj-wasm can read. - Bundled data: summits from the GSI list of 1003 major mountains and the four extreme points of Japan, with source, licence (PDL1.0) and processing notes. - proj4 2.22.0 as an exact devDependency; it is not a runtime dependency and the demo is not in the published files. - Pages build verification covers the new page, its data and the second portal card. - Candidate CRS demo: a test that the page calls initDemo(), a test for going back to neutral after a manual change, one area-name mapping instead of two, jsdom ^30.0.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… operation
- runProjWasmEngine returned the bare stats when the operation could not be created,
so runBenchmark stopped with a TypeError and the page showed nothing. It now returns
{ stats, forward } like every other branch; the row is marked failed with the message.
- Stub-engine tests pin the numbers the page shows: the forward difference between the
two engines, the round-trip error in metres, and per-point proj4js failures.
- The real-engine test now requires a forward difference above zero (the engines
compute separately) and below 1e-6 m.
- A data test checks that every bundled place lies in Japan, has a name and a known
category; the provenance note now says so instead of claiming a load-time check.
- Test comments: the sample summits are in Yamanashi and Shizuoka; drop a dangling note.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kochizufan
marked this pull request as ready for review
October 27, 2026 18:57
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.
Summary
Adds the second demo page, a browser benchmark that compares proj-wasm and proj4js on the same input.
demo/benchmark.html(+ portal card): the same point sequence and the same CRS rows go forward and back through both engines. The page shows the input (category, point limit, work count, CRS scope) and the output: elapsed time, success / failure counts, mean and max round-trip error in metres, the largest difference between the two engines' forward output, and the message behind each failure.engine-coverage: A = plane rectangular IX (both engines succeed on every point; forward difference about 1e-9 m), B = historical grid zone B (proj-wasm succeeds; proj4js fails on every point withCould not get projection name from: +proj=pipeline …).demo/data/benchmark-places.provenance.jsonand on the page.proj42.22.0 is added as an exact devDependency. It is not independencies, anddemo/is not in the published files.verify:demonow checks the benchmark page, its two data assets under/Atlas/and the second portal card.atlas-benchmark-demo/tasks.md: all items checked, with implementation notes.Follow-ups to the candidate CRS demo:
demo/presets.js^30.0.1Test plan
pnpm run test(25 files, 151 tests),typecheck,build,verify:demo,verify:packed-browser: all exit 0;git status --short distis emptypnpm pack --dry-runlists nodemo/and noproj4;pnpm audit --prodreports no vulnerabilities/Atlas/in Chrome: both cards on the portal, the page initializes, preset A and B split as described, "all CRS" runs🤖 Generated with Claude Code