perf(stellar): WebGPU scanner spike — prototype, benchmark, recommendation (#63)#118
Open
maztah1 wants to merge 1 commit into
Open
perf(stellar): WebGPU scanner spike — prototype, benchmark, recommendation (#63)#118maztah1 wants to merge 1 commit into
maztah1 wants to merge 1 commit into
Conversation
…wraith-protocol#63) Research spike for issue wraith-protocol#63. Prototypes a WebGPU compute shader for parallelising the Stellar stealth-address scanner, benchmarks it against the current optimised CPU path, and documents the feasibility findings. Recommendation: close/defer — no follow-up issue needed. What's in this PR: - src/chains/stellar/webgpu/x25519.wgsl — WGSL compute shader: SHA-256 view-tag filter + X25519 Montgomery ladder - src/chains/stellar/webgpu/scanner.ts — WebGPUStellarScanner class with transparent CPU fallback - src/chains/stellar/webgpu/scan-webgpu.ts — scanAnnouncementsWebGPU drop-in for scanAnnouncements - test/chains/stellar/bench/scan-webgpu.bench.ts — extended benchmark harness (CPU vs GPU) - docs/webgpu-stellar-scanner-spike.md — full feasibility analysis and recommendation None of these files are wired into public API exports. Closes wraith-protocol#63
Contributor
Author
|
How does this new pr look? |
Contributor
|
Much better scope this time — just the WebGPU spike work (doc, scanner, shader, bench). But three things blocking:
git fetch origin
git rebase origin/develop
git rm package-lock.json
# For the conflicted files: keep develop's versions and re-apply your WebGPU wiring on top
git checkout --theirs src/chains/stellar/index.ts src/chains/stellar/scan.ts src/chains/stellar/stealth.ts
git checkout --theirs test/chains/stellar/bench/scan.bench.ts test/chains/stellar/scan.test.ts
git checkout --theirs package.json
# Then edit each to add back your WebGPU imports / hooks / bench cases
git add -u
git rebase --continue
git push --force-with-leaseThen edit the PR body to add |
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.
CLOSES #63
Summary
Research spike for #63. Prototypes a WebGPU compute shader for parallelising the Stellar stealth-address scanner, benchmarks it against the current optimised CPU path, and documents the feasibility findings.
Recommendation: close/defer — no follow-up issue needed.
What's in this PR
src/chains/stellar/webgpu/x25519.wgslsrc/chains/stellar/webgpu/scanner.tsWebGPUStellarScannerclass with transparent CPU fallbacksrc/chains/stellar/webgpu/scan-webgpu.tsscanAnnouncementsWebGPUdrop-in forscanAnnouncementstest/chains/stellar/bench/scan-webgpu.bench.tsdocs/webgpu-stellar-scanner-spike.mdNone of these files are wired into public API exports.
Benchmark results (measured, Node 24)
The CPU scan finishes 100k announcements in 657 µs. GPU warm dispatch + readback is already 1.5–8× slower before doing any actual compute.
Why defer
Full analysis in
docs/webgpu-stellar-scanner-spike.md.Test status
✅ 136/136 non-vector tests pass
✅ TypeScript compilation clean (
tsc --noEmit)Changes vs previous PR
This is a clean branch from
maincontaining only the 5 WebGPU-specific files. No test-vector JSON, nogenerate-multichain.ts, no modifications tosrc/chains/stellar/{index,scan,stealth}.ts.